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

Handle to a non owned tray. More...

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

Public Member Functions

constexpr TrayRef (const TrayRef &other)
 Copy constructor.
 
constexpr TrayRef (TrayRef &&other)
 Move constructor.
 
constexpr ~TrayRef ()=default
 Default constructor.
 
TrayRefoperator= (TrayRef other)
 Assignment operator.
 
void reset (SDL_Tray *newResource={})
 Destroys a tray object.
 
 TrayBase (SurfaceBase &icon, StringParam tooltip)
 Create an icon to be placed in the operating system's tray, or equivalent.
 
- Public Member Functions inherited from SDL::TrayBase
 TrayBase (SurfaceBase &icon, StringParam tooltip)
 Create an icon to be placed in the operating system's tray, or equivalent.
 
void SetIcon (SurfaceBase &icon)
 Updates the system tray icon's icon.
 
void SetTooltip (StringParam tooltip)
 Updates the system tray icon's tooltip.
 
TrayMenu CreateMenu ()
 Create a menu for a system tray.
 
TrayMenu GetMenu () const
 Gets a previously created tray menu.
 
constexpr Resource (T resource={})
 Constructs the underlying resource.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
 Resource (const Resource &other)=delete
 
 Resource (Resource &&other)=delete
 
- Public Member Functions inherited from SDL::Resource< SDL_Tray * >
constexpr Resource (SDL_Tray * resource={})
 Constructs the underlying resource.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
 Resource (const Resource &other)=delete
 
 Resource (Resource &&other)=delete
 
Resourceoperator= (const Resource &other)=delete
 
Resourceoperator= (Resource &&other)=delete
 
constexpr operator bool () const
 True if contains a valid resource.
 
constexpr bool operator== (const Resource &other) const=default
 Comparison.
 
constexpr bool operator== (std::nullopt_t) const
 Comparison.
 
constexpr bool operator== (std::nullptr_t) const
 Comparison.
 
constexpr SDL_Tray * get () const
 Return contained resource;.
 
constexpr SDL_Tray * release (SDL_Tray * newResource={})
 Return contained resource and empties or replace value.
 
constexpr const SDL_Tray * operator-> () const
 Access to fields.
 
constexpr SDL_Tray * operator-> ()
 Access to fields.
 

Detailed Description

Category:
Resource
See also
TrayBase
Tray

Member Function Documentation

◆ reset()

void SDL::TrayRef::reset ( SDL_Tray *  newResource = {})
inline

This also destroys all associated menus and entries.

Thread safety:
This function should be called on the thread that created the tray.
Since
This function is available since SDL 3.2.0.
See also
TrayBase.TrayBase

◆ TrayBase()

SDL::TrayBase::TrayBase ( SurfaceBase 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
TrayBase.CreateMenu
TrayBase.GetMenu

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