- SetDesktopTrayIcon(path) swaps the tray icon at runtime (empty restores the icon InitDesktopTray resolved): the emblem/attention state apps show while unseen notifications wait. gtk_dl gains gtk_status_icon_set_from_file. - SendNotificationAction + PollNotificationAction extend the notification API with one action button per popup on the GDBus backend: Notify's daemon id is kept with the caller's URL, an ActionInvoked subscription resolves the click, and Poll hands (action, url) to the app's main loop while pumping the dispatch context so it also works without one. Other backends degrade to the plain send. - go/kryui: bindings (SetNotificationAppName, NotificationSupported, SendNotificationAction, PollNotificationAction, SetDesktopTrayIcon).
41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
#ifndef KRYON_DESKTOP_TRAY_H
|
|
#define KRYON_DESKTOP_TRAY_H
|
|
|
|
typedef enum DesktopTrayMenuItemKind {
|
|
DESKTOP_TRAY_MENU_ITEM_ACTION = 0,
|
|
DESKTOP_TRAY_MENU_ITEM_SUBMENU,
|
|
DESKTOP_TRAY_MENU_ITEM_SEPARATOR
|
|
} DesktopTrayMenuItemKind;
|
|
|
|
typedef struct DesktopTrayMenuItem DesktopTrayMenuItem;
|
|
|
|
struct DesktopTrayMenuItem {
|
|
DesktopTrayMenuItemKind kind;
|
|
const char *label;
|
|
int action;
|
|
int enabled;
|
|
const DesktopTrayMenuItem *children;
|
|
int child_count;
|
|
};
|
|
|
|
typedef struct DesktopTraySpec {
|
|
const char *id;
|
|
const char *title;
|
|
const char *icon_name;
|
|
const char *const *icon_paths;
|
|
int close_action;
|
|
int activate_action;
|
|
const DesktopTrayMenuItem *menu_items;
|
|
int menu_item_count;
|
|
} DesktopTraySpec;
|
|
|
|
int InitDesktopTray(const DesktopTraySpec *spec);
|
|
void ShutdownDesktopTray(void);
|
|
int PollDesktopTrayAction(void);
|
|
void SetDesktopTrayStatus(const char *text);
|
|
void SetDesktopTrayMenu(const DesktopTrayMenuItem *items, int count);
|
|
void SetDesktopTrayActivateAction(int action);
|
|
void SetDesktopTrayIcon(const char *icon_path);
|
|
|
|
#endif
|