SDL3pp
A slim C++ wrapper for SDL3
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SDL::TrayRef Struct Reference

Semi-safe reference for Tray.

Inheritance diagram for SDL::TrayRef:
Inheritance graph
[legend]
Collaboration diagram for SDL::TrayRef:
Collaboration graph
[legend]

Public Member Functions

 TrayRef (TrayParam resource) noexcept
 Constructs from TrayParam. More...
 
 TrayRef (TrayRaw resource) noexcept
 Constructs from TrayParam. More...
 
 TrayRef (const TrayRef &other) noexcept
 Copy constructor.
 
 ~TrayRef ()
 Destructor.
 
constexpr Tray (std::nullptr_t=nullptr) noexcept
 Default ctor.
 
constexpr Tray (const TrayRaw resource) noexcept
 Constructs from TrayParam. More...
 
constexpr Tray (const Tray &other)=delete
 Copy constructor.
 
constexpr Tray (Tray &&other) noexcept
 Move constructor.
 
constexpr Tray (const TrayRef &other)=delete
 
constexpr Tray (TrayRef &&other)=delete
 
 Tray (SurfaceParam icon, StringParam tooltip)
 Create an icon to be placed in the operating system's tray, or equivalent. More...
 
- Public Member Functions inherited from SDL::Tray
constexpr Tray (std::nullptr_t=nullptr) noexcept
 Default ctor.
 
constexpr Tray (const TrayRaw resource) noexcept
 Constructs from TrayParam. More...
 
constexpr Tray (const Tray &other)=delete
 Copy constructor.
 
constexpr Tray (Tray &&other) noexcept
 Move constructor.
 
constexpr Tray (const TrayRef &other)=delete
 
constexpr Tray (TrayRef &&other)=delete
 
 Tray (SurfaceParam icon, StringParam tooltip)
 Create an icon to be placed in the operating system's tray, or equivalent. More...
 
 ~Tray ()
 Destructor.
 
constexpr Trayoperator= (Tray &&other) noexcept
 Assignment operator.
 
constexpr TrayRaw get () const noexcept
 Retrieves underlying TrayRaw.
 
constexpr TrayRaw release () noexcept
 Retrieves underlying TrayRaw and clear this.
 
constexpr auto operator<=> (const Tray &other) const noexcept=default
 Comparison.
 
constexpr operator bool () const noexcept
 Converts to bool.
 
constexpr operator TrayParam () const noexcept
 Converts to TrayParam.
 
void Destroy ()
 Destroys a tray object. More...
 
void SetIcon (SurfaceParam icon)
 Updates the system tray icon's icon. More...
 
void SetTooltip (StringParam tooltip)
 Updates the system tray icon's tooltip. More...
 
TrayMenu CreateMenu ()
 Create a menu for a system tray. More...
 
TrayMenu GetMenu () const
 Gets a previously created tray menu. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SDL::Tray
constexpr Trayoperator= (const Tray &other) noexcept=default
 Assignment operator.
 

Constructor & Destructor Documentation

◆ TrayRef() [1/2]

SDL::TrayRef::TrayRef ( TrayParam  resource)
inlinenoexcept
Parameters
resourcea TrayRaw or Tray.

This does not takes ownership!

◆ TrayRef() [2/2]

SDL::TrayRef::TrayRef ( TrayRaw  resource)
inlinenoexcept
Parameters
resourcea TrayRaw or Tray.

This does not takes ownership!

Member Function Documentation

◆ Tray() [1/2]

constexpr SDL::Tray::Tray ( const TrayRaw  resource)
inlineexplicitconstexprnoexcept
Parameters
resourcea TrayRaw to be wrapped.

This assumes the ownership, call release() if you need to take back.

◆ Tray() [2/2]

SDL::Tray::Tray ( SurfaceParam  icon,
StringParam  tooltip 
)
inline

Many platforms advise not using a system tray unless persistence is a necessary feature. Avoid needlessly creating a tray icon, as the user may feel like it clutters their interface.

Using tray icons require the video subsystem.

Parameters
icona surface to be used as icon. May be nullptr.
tooltipa tooltip to be displayed when the mouse hovers the icon in UTF-8 encoding. Not supported on all platforms. May be nullptr.
Postcondition
The newly created system tray icon.
Thread safety:
This function should only be called on the main thread.
Since
This function is available since SDL 3.2.0.
See also
Tray.CreateMenu
Tray.GetMenu
Tray.Destroy

The documentation for this struct was generated from the following file: