swaybar: add StatusNotifierItem to tray

This commit is contained in:
Ian Fan 2018-12-07 12:33:45 +00:00
parent e6cb55e2f8
commit 74655f835a
6 changed files with 283 additions and 6 deletions

View file

@ -0,0 +1,38 @@
#ifndef _SWAYBAR_TRAY_ITEM_H
#define _SWAYBAR_TRAY_ITEM_H
#include <stdbool.h>
#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

View file

@ -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;