SDL 3.0
SDL_tray.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22/**
23 * # CategoryTray
24 *
25 * SDL offers a way to add items to the "system tray" (more correctly called
26 * the "notification area" on Windows). On platforms that offer this concept,
27 * an SDL app can add a tray icon, submenus, checkboxes, and clickable
28 * entries, and register a callback that is fired when the user clicks on
29 * these pieces.
30 */
31
32#ifndef SDL_tray_h_
33#define SDL_tray_h_
34
35#include <SDL3/SDL_stdinc.h>
36#include <SDL3/SDL_error.h>
37#include <SDL3/SDL_properties.h>
38#include <SDL3/SDL_surface.h>
39#include <SDL3/SDL_video.h>
40
41#include <SDL3/SDL_begin_code.h>
42/* Set up for C function definitions, even when using C++ */
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47/**
48 * An opaque handle representing a toplevel system tray object.
49 *
50 * \since This struct is available since SDL 3.2.0.
51 */
52typedef struct SDL_Tray SDL_Tray;
53
54/**
55 * An opaque handle representing a menu/submenu on a system tray object.
56 *
57 * \since This struct is available since SDL 3.2.0.
58 */
60
61/**
62 * An opaque handle representing an entry on a system tray object.
63 *
64 * \since This struct is available since SDL 3.2.0.
65 */
67
68/**
69 * Flags that control the creation of system tray entries.
70 *
71 * Some of these flags are required; exactly one of them must be specified at
72 * the time a tray entry is created. Other flags are optional; zero or more of
73 * those can be OR'ed together with the required flag.
74 *
75 * \since This datatype is available since SDL 3.2.0.
76 *
77 * \sa SDL_InsertTrayEntryAt
78 */
80
81#define SDL_TRAYENTRY_BUTTON 0x00000001u /**< Make the entry a simple button. Required. */
82#define SDL_TRAYENTRY_CHECKBOX 0x00000002u /**< Make the entry a checkbox. Required. */
83#define SDL_TRAYENTRY_SUBMENU 0x00000004u /**< Prepare the entry to have a submenu. Required */
84#define SDL_TRAYENTRY_DISABLED 0x80000000u /**< Make the entry disabled. Optional. */
85#define SDL_TRAYENTRY_CHECKED 0x40000000u /**< Make the entry checked. This is valid only for checkboxes. Optional. */
86
87/**
88 * A callback that is invoked when a tray entry is selected.
89 *
90 * \param userdata an optional pointer to pass extra data to the callback when
91 * it will be invoked.
92 * \param entry the tray entry that was selected.
93 *
94 * \since This datatype is available since SDL 3.2.0.
95 *
96 * \sa SDL_SetTrayEntryCallback
97 */
98typedef void (SDLCALL *SDL_TrayCallback)(void *userdata, SDL_TrayEntry *entry);
99
100/**
101 * A callback that is invoked when the tray icon is clicked.
102 *
103 * \param userdata an optional pointer to pass extra data to the callback when
104 * it will be invoked. May be NULL.
105 * \param tray the tray that was clicked.
106 * \returns true to show the tray menu after the callback returns, false to
107 * skip showing the menu. This return value is only used for left and
108 * right click callbacks; other mouse events ignore the return value.
109 *
110 * \since This datatype is available since SDL 3.6.0.
111 *
112 * \sa SDL_CreateTrayWithProperties
113 */
114typedef bool (SDLCALL *SDL_TrayClickCallback)(void *userdata, SDL_Tray *tray);
115
116/**
117 * Create an icon to be placed in the operating system's tray, or equivalent.
118 *
119 * Many platforms advise not using a system tray unless persistence is a
120 * necessary feature. Avoid needlessly creating a tray icon, as the user may
121 * feel like it clutters their interface.
122 *
123 * You should set the SDL_PROP_APP_METADATA_IDENTIFIER_STRING property to
124 * ensure correct behaviour on some platforms like Linux.
125 *
126 * Using tray icons require the video subsystem.
127 *
128 * \param icon a surface to be used as icon. May be NULL.
129 * \param tooltip a tooltip to be displayed when the mouse hovers the icon in
130 * UTF-8 encoding. Not supported on all platforms. May be NULL.
131 * \returns The newly created system tray icon.
132 *
133 * \threadsafety This function should only be called on the main thread.
134 *
135 * \since This function is available since SDL 3.2.0.
136 *
137 * \sa SDL_CreateTrayWithProperties
138 * \sa SDL_CreateTrayMenu
139 * \sa SDL_GetTrayMenu
140 * \sa SDL_DestroyTray
141 */
142extern SDL_DECLSPEC SDL_Tray * SDLCALL SDL_CreateTray(SDL_Surface *icon, const char *tooltip);
143
144/**
145 * Create an icon to be placed in the operating system's tray, or equivalent.
146 *
147 * Many platforms advise not using a system tray unless persistence is a
148 * necessary feature. Avoid needlessly creating a tray icon, as the user may
149 * feel like it clutters their interface.
150 *
151 * You should set the SDL_PROP_APP_METADATA_IDENTIFIER_STRING property to
152 * ensure correct behaviour on some platforms like Linux.
153 *
154 * Using tray icons require the video subsystem.
155 *
156 * These are the supported properties:
157 *
158 * - `SDL_PROP_TRAY_CREATE_ICON_POINTER`: an SDL_Surface to be used as the
159 * tray icon. May be NULL.
160 * - `SDL_PROP_TRAY_CREATE_TOOLTIP_STRING`: a tooltip to be displayed when the
161 * mouse hovers the icon in UTF-8 encoding. Not supported on all platforms.
162 * May be NULL.
163 * - `SDL_PROP_TRAY_CREATE_USERDATA_POINTER`: an optional pointer to associate
164 * with the tray, which will be passed to click callbacks. May be NULL.
165 * - `SDL_PROP_TRAY_CREATE_LEFTCLICK_CALLBACK_POINTER`: an
166 * SDL_TrayClickCallback to be invoked when the tray icon is left-clicked.
167 * Not supported on all platforms. The callback should return true to show
168 * the default menu, or false to skip showing it. May be NULL.
169 * - `SDL_PROP_TRAY_CREATE_RIGHTCLICK_CALLBACK_POINTER`: an
170 * SDL_TrayClickCallback to be invoked when the tray icon is right-clicked.
171 * Not supported on all platforms. The callback should return true to show
172 * the default menu, or false to skip showing it. May be NULL.
173 * - `SDL_PROP_TRAY_CREATE_MIDDLECLICK_CALLBACK_POINTER`: an
174 * SDL_TrayClickCallback to be invoked when the tray icon is middle-clicked.
175 * Not supported on all platforms. May be NULL.
176 *
177 * \param props the properties to use.
178 * \returns The newly created system tray icon.
179 *
180 * \threadsafety This function should only be called on the main thread.
181 *
182 * \since This function is available since SDL 3.6.0.
183 *
184 * \sa SDL_CreateTray
185 * \sa SDL_CreateTrayMenu
186 * \sa SDL_GetTrayMenu
187 * \sa SDL_DestroyTray
188 */
189extern SDL_DECLSPEC SDL_Tray * SDLCALL SDL_CreateTrayWithProperties(SDL_PropertiesID props);
190
191#define SDL_PROP_TRAY_CREATE_ICON_POINTER "SDL.tray.create.icon"
192#define SDL_PROP_TRAY_CREATE_TOOLTIP_STRING "SDL.tray.create.tooltip"
193#define SDL_PROP_TRAY_CREATE_USERDATA_POINTER "SDL.tray.create.userdata"
194#define SDL_PROP_TRAY_CREATE_LEFTCLICK_CALLBACK_POINTER "SDL.tray.create.leftclick_callback"
195#define SDL_PROP_TRAY_CREATE_RIGHTCLICK_CALLBACK_POINTER "SDL.tray.create.rightclick_callback"
196#define SDL_PROP_TRAY_CREATE_MIDDLECLICK_CALLBACK_POINTER "SDL.tray.create.middleclick_callback"
197
198/**
199 * Updates the system tray icon's icon.
200 *
201 * \param tray the tray icon to be updated.
202 * \param icon the new icon. May be NULL.
203 *
204 * \threadsafety This function should be called on the thread that created the
205 * tray.
206 *
207 * \since This function is available since SDL 3.2.0.
208 *
209 * \sa SDL_CreateTray
210 */
211extern SDL_DECLSPEC void SDLCALL SDL_SetTrayIcon(SDL_Tray *tray, SDL_Surface *icon);
212
213/**
214 * Updates the system tray icon's tooltip.
215 *
216 * \param tray the tray icon to be updated.
217 * \param tooltip the new tooltip in UTF-8 encoding. May be NULL.
218 *
219 * \threadsafety This function should be called on the thread that created the
220 * tray.
221 *
222 * \since This function is available since SDL 3.2.0.
223 *
224 * \sa SDL_CreateTray
225 */
226extern SDL_DECLSPEC void SDLCALL SDL_SetTrayTooltip(SDL_Tray *tray, const char *tooltip);
227
228/**
229 * Create a menu for a system tray.
230 *
231 * This should be called at most once per tray icon.
232 *
233 * This function does the same thing as SDL_CreateTraySubmenu(), except that
234 * it takes a SDL_Tray instead of a SDL_TrayEntry.
235 *
236 * A menu does not need to be destroyed; it will be destroyed with the tray.
237 *
238 * \param tray the tray to bind the menu to.
239 * \returns the newly created menu.
240 *
241 * \threadsafety This function should be called on the thread that created the
242 * tray.
243 *
244 * \since This function is available since SDL 3.2.0.
245 *
246 * \sa SDL_CreateTray
247 * \sa SDL_GetTrayMenu
248 * \sa SDL_GetTrayMenuParentTray
249 */
250extern SDL_DECLSPEC SDL_TrayMenu * SDLCALL SDL_CreateTrayMenu(SDL_Tray *tray);
251
252/**
253 * Create a submenu for a system tray entry.
254 *
255 * This should be called at most once per tray entry.
256 *
257 * This function does the same thing as SDL_CreateTrayMenu, except that it
258 * takes a SDL_TrayEntry instead of a SDL_Tray.
259 *
260 * A menu does not need to be destroyed; it will be destroyed with the tray.
261 *
262 * \param entry the tray entry to bind the menu to.
263 * \returns the newly created menu.
264 *
265 * \threadsafety This function should be called on the thread that created the
266 * tray.
267 *
268 * \since This function is available since SDL 3.2.0.
269 *
270 * \sa SDL_InsertTrayEntryAt
271 * \sa SDL_GetTraySubmenu
272 * \sa SDL_GetTrayMenuParentEntry
273 */
274extern SDL_DECLSPEC SDL_TrayMenu * SDLCALL SDL_CreateTraySubmenu(SDL_TrayEntry *entry);
275
276/**
277 * Gets a previously created tray menu.
278 *
279 * You should have called SDL_CreateTrayMenu() on the tray object. This
280 * function allows you to fetch it again later.
281 *
282 * This function does the same thing as SDL_GetTraySubmenu(), except that it
283 * takes a SDL_Tray instead of a SDL_TrayEntry.
284 *
285 * A menu does not need to be destroyed; it will be destroyed with the tray.
286 *
287 * \param tray the tray entry to bind the menu to.
288 * \returns the newly created menu.
289 *
290 * \threadsafety This function should be called on the thread that created the
291 * tray.
292 *
293 * \since This function is available since SDL 3.2.0.
294 *
295 * \sa SDL_CreateTray
296 * \sa SDL_CreateTrayMenu
297 */
298extern SDL_DECLSPEC SDL_TrayMenu * SDLCALL SDL_GetTrayMenu(SDL_Tray *tray);
299
300/**
301 * Gets a previously created tray entry submenu.
302 *
303 * You should have called SDL_CreateTraySubmenu() on the entry object. This
304 * function allows you to fetch it again later.
305 *
306 * This function does the same thing as SDL_GetTrayMenu(), except that it
307 * takes a SDL_TrayEntry instead of a SDL_Tray.
308 *
309 * A menu does not need to be destroyed; it will be destroyed with the tray.
310 *
311 * \param entry the tray entry to bind the menu to.
312 * \returns the newly created menu.
313 *
314 * \threadsafety This function should be called on the thread that created the
315 * tray.
316 *
317 * \since This function is available since SDL 3.2.0.
318 *
319 * \sa SDL_InsertTrayEntryAt
320 * \sa SDL_CreateTraySubmenu
321 */
322extern SDL_DECLSPEC SDL_TrayMenu * SDLCALL SDL_GetTraySubmenu(SDL_TrayEntry *entry);
323
324/**
325 * Returns a list of entries in the menu, in order.
326 *
327 * \param menu The menu to get entries from.
328 * \param count An optional pointer to obtain the number of entries in the
329 * menu.
330 * \returns a NULL-terminated list of entries within the given menu. The
331 * pointer becomes invalid when any function that inserts or deletes
332 * entries in the menu is called.
333 *
334 * \threadsafety This function should be called on the thread that created the
335 * tray.
336 *
337 * \since This function is available since SDL 3.2.0.
338 *
339 * \sa SDL_RemoveTrayEntry
340 * \sa SDL_InsertTrayEntryAt
341 */
342extern SDL_DECLSPEC const SDL_TrayEntry ** SDLCALL SDL_GetTrayEntries(SDL_TrayMenu *menu, int *count);
343
344/**
345 * Removes a tray entry.
346 *
347 * \param entry The entry to be deleted.
348 *
349 * \threadsafety This function should be called on the thread that created the
350 * tray.
351 *
352 * \since This function is available since SDL 3.2.0.
353 *
354 * \sa SDL_GetTrayEntries
355 * \sa SDL_InsertTrayEntryAt
356 */
357extern SDL_DECLSPEC void SDLCALL SDL_RemoveTrayEntry(SDL_TrayEntry *entry);
358
359/**
360 * Insert a tray entry at a given position.
361 *
362 * If label is NULL, the entry will be a separator. Many functions won't work
363 * for an entry that is a separator.
364 *
365 * An entry does not need to be destroyed; it will be destroyed with the tray.
366 *
367 * \param menu the menu to append the entry to.
368 * \param pos the desired position for the new entry. Entries at or following
369 * this place will be moved. If pos is -1, the entry is appended.
370 * \param label the text to be displayed on the entry, in UTF-8 encoding, or
371 * NULL for a separator.
372 * \param flags a combination of flags, some of which are mandatory.
373 * \returns the newly created entry, or NULL if pos is out of bounds.
374 *
375 * \threadsafety This function should be called on the thread that created the
376 * tray.
377 *
378 * \since This function is available since SDL 3.2.0.
379 *
380 * \sa SDL_TrayEntryFlags
381 * \sa SDL_GetTrayEntries
382 * \sa SDL_RemoveTrayEntry
383 * \sa SDL_GetTrayEntryParent
384 */
385extern SDL_DECLSPEC SDL_TrayEntry * SDLCALL SDL_InsertTrayEntryAt(SDL_TrayMenu *menu, int pos, const char *label, SDL_TrayEntryFlags flags);
386
387/**
388 * Sets the label of an entry.
389 *
390 * An entry cannot change between a separator and an ordinary entry; that is,
391 * it is not possible to set a non-NULL label on an entry that has a NULL
392 * label (separators), or to set a NULL label to an entry that has a non-NULL
393 * label. The function will silently fail if that happens.
394 *
395 * \param entry the entry to be updated.
396 * \param label the new label for the entry in UTF-8 encoding.
397 *
398 * \threadsafety This function should be called on the thread that created the
399 * tray.
400 *
401 * \since This function is available since SDL 3.2.0.
402 *
403 * \sa SDL_GetTrayEntries
404 * \sa SDL_InsertTrayEntryAt
405 * \sa SDL_GetTrayEntryLabel
406 */
407extern SDL_DECLSPEC void SDLCALL SDL_SetTrayEntryLabel(SDL_TrayEntry *entry, const char *label);
408
409/**
410 * Gets the label of an entry.
411 *
412 * If the returned value is NULL, the entry is a separator.
413 *
414 * \param entry the entry to be read.
415 * \returns the label of the entry in UTF-8 encoding.
416 *
417 * \threadsafety This function should be called on the thread that created the
418 * tray.
419 *
420 * \since This function is available since SDL 3.2.0.
421 *
422 * \sa SDL_GetTrayEntries
423 * \sa SDL_InsertTrayEntryAt
424 * \sa SDL_SetTrayEntryLabel
425 */
426extern SDL_DECLSPEC const char * SDLCALL SDL_GetTrayEntryLabel(SDL_TrayEntry *entry);
427
428/**
429 * Sets whether or not an entry is checked.
430 *
431 * The entry must have been created with the SDL_TRAYENTRY_CHECKBOX flag.
432 *
433 * \param entry the entry to be updated.
434 * \param checked true if the entry should be checked; false otherwise.
435 *
436 * \threadsafety This function should be called on the thread that created the
437 * tray.
438 *
439 * \since This function is available since SDL 3.2.0.
440 *
441 * \sa SDL_GetTrayEntries
442 * \sa SDL_InsertTrayEntryAt
443 * \sa SDL_GetTrayEntryChecked
444 */
445extern SDL_DECLSPEC void SDLCALL SDL_SetTrayEntryChecked(SDL_TrayEntry *entry, bool checked);
446
447/**
448 * Gets whether or not an entry is checked.
449 *
450 * The entry must have been created with the SDL_TRAYENTRY_CHECKBOX flag.
451 *
452 * \param entry the entry to be read.
453 * \returns true if the entry is checked; false otherwise.
454 *
455 * \threadsafety This function should be called on the thread that created the
456 * tray.
457 *
458 * \since This function is available since SDL 3.2.0.
459 *
460 * \sa SDL_GetTrayEntries
461 * \sa SDL_InsertTrayEntryAt
462 * \sa SDL_SetTrayEntryChecked
463 */
464extern SDL_DECLSPEC bool SDLCALL SDL_GetTrayEntryChecked(SDL_TrayEntry *entry);
465
466/**
467 * Sets whether or not an entry is enabled.
468 *
469 * \param entry the entry to be updated.
470 * \param enabled true if the entry should be enabled; false otherwise.
471 *
472 * \threadsafety This function should be called on the thread that created the
473 * tray.
474 *
475 * \since This function is available since SDL 3.2.0.
476 *
477 * \sa SDL_GetTrayEntries
478 * \sa SDL_InsertTrayEntryAt
479 * \sa SDL_GetTrayEntryEnabled
480 */
481extern SDL_DECLSPEC void SDLCALL SDL_SetTrayEntryEnabled(SDL_TrayEntry *entry, bool enabled);
482
483/**
484 * Gets whether or not an entry is enabled.
485 *
486 * \param entry the entry to be read.
487 * \returns true if the entry is enabled; false otherwise.
488 *
489 * \threadsafety This function should be called on the thread that created the
490 * tray.
491 *
492 * \since This function is available since SDL 3.2.0.
493 *
494 * \sa SDL_GetTrayEntries
495 * \sa SDL_InsertTrayEntryAt
496 * \sa SDL_SetTrayEntryEnabled
497 */
498extern SDL_DECLSPEC bool SDLCALL SDL_GetTrayEntryEnabled(SDL_TrayEntry *entry);
499
500/**
501 * Sets a callback to be invoked when the entry is selected.
502 *
503 * \param entry the entry to be updated.
504 * \param callback a callback to be invoked when the entry is selected.
505 * \param userdata an optional pointer to pass extra data to the callback when
506 * it will be invoked.
507 *
508 * \threadsafety This function should be called on the thread that created the
509 * tray.
510 *
511 * \since This function is available since SDL 3.2.0.
512 *
513 * \sa SDL_GetTrayEntries
514 * \sa SDL_InsertTrayEntryAt
515 */
516extern SDL_DECLSPEC void SDLCALL SDL_SetTrayEntryCallback(SDL_TrayEntry *entry, SDL_TrayCallback callback, void *userdata);
517
518/**
519 * Simulate a click on a tray entry.
520 *
521 * \param entry The entry to activate.
522 *
523 * \threadsafety This function should be called on the thread that created the
524 * tray.
525 *
526 * \since This function is available since SDL 3.2.0.
527 */
528extern SDL_DECLSPEC void SDLCALL SDL_ClickTrayEntry(SDL_TrayEntry *entry);
529
530/**
531 * Destroys a tray object.
532 *
533 * This also destroys all associated menus and entries.
534 *
535 * \param tray the tray icon to be destroyed.
536 *
537 * \threadsafety This function should be called on the thread that created the
538 * tray.
539 *
540 * \since This function is available since SDL 3.2.0.
541 *
542 * \sa SDL_CreateTray
543 */
544extern SDL_DECLSPEC void SDLCALL SDL_DestroyTray(SDL_Tray *tray);
545
546/**
547 * Gets the menu containing a certain tray entry.
548 *
549 * \param entry the entry for which to get the parent menu.
550 * \returns the parent menu.
551 *
552 * \threadsafety This function should be called on the thread that created the
553 * tray.
554 *
555 * \since This function is available since SDL 3.2.0.
556 *
557 * \sa SDL_InsertTrayEntryAt
558 */
559extern SDL_DECLSPEC SDL_TrayMenu * SDLCALL SDL_GetTrayEntryParent(SDL_TrayEntry *entry);
560
561/**
562 * Gets the entry for which the menu is a submenu, if the current menu is a
563 * submenu.
564 *
565 * Either this function or SDL_GetTrayMenuParentTray() will return non-NULL
566 * for any given menu.
567 *
568 * \param menu the menu for which to get the parent entry.
569 * \returns the parent entry, or NULL if this menu is not a submenu.
570 *
571 * \threadsafety This function should be called on the thread that created the
572 * tray.
573 *
574 * \since This function is available since SDL 3.2.0.
575 *
576 * \sa SDL_CreateTraySubmenu
577 * \sa SDL_GetTrayMenuParentTray
578 */
579extern SDL_DECLSPEC SDL_TrayEntry * SDLCALL SDL_GetTrayMenuParentEntry(SDL_TrayMenu *menu);
580
581/**
582 * Gets the tray for which this menu is the first-level menu, if the current
583 * menu isn't a submenu.
584 *
585 * Either this function or SDL_GetTrayMenuParentEntry() will return non-NULL
586 * for any given menu.
587 *
588 * \param menu the menu for which to get the parent enttrayry.
589 * \returns the parent tray, or NULL if this menu is a submenu.
590 *
591 * \threadsafety This function should be called on the thread that created the
592 * tray.
593 *
594 * \since This function is available since SDL 3.2.0.
595 *
596 * \sa SDL_CreateTrayMenu
597 * \sa SDL_GetTrayMenuParentEntry
598 */
599extern SDL_DECLSPEC SDL_Tray * SDLCALL SDL_GetTrayMenuParentTray(SDL_TrayMenu *menu);
600
601/**
602 * Update the trays.
603 *
604 * This is called automatically by the event loop and is only needed if you're
605 * using trays but aren't handling SDL events.
606 *
607 * \threadsafety This function should only be called on the main thread.
608 *
609 * \since This function is available since SDL 3.2.0.
610 */
611extern SDL_DECLSPEC void SDLCALL SDL_UpdateTrays(void);
612
613/* Ends C function definitions when using C++ */
614#ifdef __cplusplus
615}
616#endif
617#include <SDL3/SDL_close_code.h>
618
619#endif /* SDL_tray_h_ */
Uint32 SDL_PropertiesID
#define bool
Definition SDL_stdinc.h:101
uint32_t Uint32
Definition SDL_stdinc.h:495
SDL_TrayMenu * SDL_GetTrayMenu(SDL_Tray *tray)
SDL_Tray * SDL_CreateTray(SDL_Surface *icon, const char *tooltip)
bool SDL_GetTrayEntryEnabled(SDL_TrayEntry *entry)
void SDL_SetTrayIcon(SDL_Tray *tray, SDL_Surface *icon)
void SDL_SetTrayTooltip(SDL_Tray *tray, const char *tooltip)
SDL_TrayMenu * SDL_CreateTraySubmenu(SDL_TrayEntry *entry)
void(* SDL_TrayCallback)(void *userdata, SDL_TrayEntry *entry)
Definition SDL_tray.h:98
struct SDL_TrayMenu SDL_TrayMenu
Definition SDL_tray.h:59
void SDL_SetTrayEntryEnabled(SDL_TrayEntry *entry, bool enabled)
void SDL_UpdateTrays(void)
SDL_TrayEntry * SDL_GetTrayMenuParentEntry(SDL_TrayMenu *menu)
void SDL_SetTrayEntryCallback(SDL_TrayEntry *entry, SDL_TrayCallback callback, void *userdata)
SDL_TrayEntry * SDL_InsertTrayEntryAt(SDL_TrayMenu *menu, int pos, const char *label, SDL_TrayEntryFlags flags)
const char * SDL_GetTrayEntryLabel(SDL_TrayEntry *entry)
SDL_Tray * SDL_CreateTrayWithProperties(SDL_PropertiesID props)
SDL_TrayMenu * SDL_GetTrayEntryParent(SDL_TrayEntry *entry)
bool SDL_GetTrayEntryChecked(SDL_TrayEntry *entry)
SDL_TrayMenu * SDL_GetTraySubmenu(SDL_TrayEntry *entry)
SDL_Tray * SDL_GetTrayMenuParentTray(SDL_TrayMenu *menu)
void SDL_SetTrayEntryChecked(SDL_TrayEntry *entry, bool checked)
bool(* SDL_TrayClickCallback)(void *userdata, SDL_Tray *tray)
Definition SDL_tray.h:114
Uint32 SDL_TrayEntryFlags
Definition SDL_tray.h:79
void SDL_DestroyTray(SDL_Tray *tray)
struct SDL_TrayEntry SDL_TrayEntry
Definition SDL_tray.h:66
const SDL_TrayEntry ** SDL_GetTrayEntries(SDL_TrayMenu *menu, int *count)
SDL_TrayMenu * SDL_CreateTrayMenu(SDL_Tray *tray)
void SDL_SetTrayEntryLabel(SDL_TrayEntry *entry, const char *label)
void SDL_ClickTrayEntry(SDL_TrayEntry *entry)
void SDL_RemoveTrayEntry(SDL_TrayEntry *entry)
struct SDL_Tray SDL_Tray
Definition SDL_tray.h:52