From 74655f835aa9fe0e976473d443f62d253602696c Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Fri, 7 Dec 2018 12:33:45 +0000 Subject: swaybar: add StatusNotifierItem to tray --- include/swaybar/tray/item.h | 38 ++++++++++++++++++++++++++++++++++++++ include/swaybar/tray/tray.h | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 include/swaybar/tray/item.h (limited to 'include/swaybar') diff --git a/include/swaybar/tray/item.h b/include/swaybar/tray/item.h new file mode 100644 index 00000000..57affb78 --- /dev/null +++ b/include/swaybar/tray/item.h @@ -0,0 +1,38 @@ +#ifndef _SWAYBAR_TRAY_ITEM_H +#define _SWAYBAR_TRAY_ITEM_H + +#include +#include "swaybar/tray/tray.h" +#include "list.h" + +struct swaybar_pixmap { + int size; + unsigned char pixels[]; +}; + +struct swaybar_sni { + // icon properties + struct swaybar_tray *tray; + cairo_surface_t *icon; + int min_size; + int max_size; + + // dbus properties + char *watcher_id; + char *service; + char *path; + char *interface; + + char *status; + char *icon_name; + list_t *icon_pixmap; // struct swaybar_pixmap * + char *attention_icon_name; + list_t *attention_icon_pixmap; // struct swaybar_pixmap * + bool item_is_menu; + char *menu; +}; + +struct swaybar_sni *create_sni(char *id, struct swaybar_tray *tray); +void destroy_sni(struct swaybar_sni *sni); + +#endif diff --git a/include/swaybar/tray/tray.h b/include/swaybar/tray/tray.h index 1d976b4a..8958b69a 100644 --- a/include/swaybar/tray/tray.h +++ b/include/swaybar/tray/tray.h @@ -24,7 +24,7 @@ struct swaybar_tray { struct swaybar_host host_xdg; struct swaybar_host host_kde; - list_t *items; // char * + list_t *items; // struct swaybar_sni * struct swaybar_watcher *watcher_xdg; struct swaybar_watcher *watcher_kde; -- cgit v1.2.3