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

An opaque handle representing a toplevel system tray object. More...

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

Public Member Functions

void SetIcon (SurfaceRef 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 from the underlying resource.
 
constexpr Resource (const ResourceHandle< Resource< T > > auto &resource)
 Constructs from pointer like.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
- Public Member Functions inherited from SDL::Resource< SDL_Tray * >
constexpr Resource (SDL_Tray * resource={})
 Constructs from the underlying resource.
 
constexpr Resource (const ResourceHandle< Resource< SDL_Tray * > > auto &resource)
 Constructs from pointer like.
 
constexpr Resource (std::nullptr_t)
 Equivalent to default ctor.
 
constexpr Resource (std::nullopt_t)
 Equivalent to default ctor.
 
constexpr operator bool () const
 True if contains a valid resource.
 
constexpr operator value_type () const
 Converts back to underlying type.
 
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 const SDL_Tray * operator-> () const
 Access to fields.
 
constexpr SDL_Tray * operator-> ()
 Access to fields.
 

Static Public Member Functions

static void reset (SDL_Tray *resource)
 Destroys a tray object.
 

Additional Inherited Members

- Public Types inherited from SDL::Resource< SDL_Tray * >
using value_type = SDL_Tray *
 The raw resource type.
 

Detailed Description

Since
This struct is available since SDL 3.2.0.
Category:
Resource
See also
Tray

Member Function Documentation

◆ reset()

static void SDL::TrayRef::reset ( SDL_Tray *  resource)
inlinestatic

This also destroys all associated menus and entries.

Parameters
resourcethe tray icon to be destroyed.
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
Tray.Create

◆ SetIcon()

void SDL::TrayRef::SetIcon ( SurfaceRef  icon)
inline
Parameters
iconthe new icon. May be nullptr.
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
Tray.Create

◆ SetTooltip()

void SDL::TrayRef::SetTooltip ( StringParam  tooltip)
inline
Parameters
tooltipthe new tooltip in UTF-8 encoding. May be nullptr.
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
Tray.Create

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