diff options
author | 2018-12-31 15:43:23 -0500 | |
---|---|---|
committer | 2018-12-31 15:43:23 -0500 | |
commit | 3d7c20f062bebe39199d3872e5b64d5e8d61d100 (patch) | |
tree | 93b8ddb51873cae14db8d5f07db74ca96236f184 /include/swaybar/tray/sni.h | |
parent | Apply implicit fallback seat config (diff) | |
parent | swaybar: use KDE's SNI IconThemePath property (diff) | |
download | sway-3d7c20f062bebe39199d3872e5b64d5e8d61d100.tar.gz sway-3d7c20f062bebe39199d3872e5b64d5e8d61d100.tar.zst sway-3d7c20f062bebe39199d3872e5b64d5e8d61d100.zip |
Merge pull request #3249 from ianyfan/tray
Swaybar tray
Diffstat (limited to 'include/swaybar/tray/sni.h')
-rw-r--r-- | include/swaybar/tray/sni.h | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/include/swaybar/tray/sni.h b/include/swaybar/tray/sni.h deleted file mode 100644 index c2544e2a..00000000 --- a/include/swaybar/tray/sni.h +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | #ifndef _SWAYBAR_SNI_H | ||
2 | #define _SWAYBAR_SNI_H | ||
3 | |||
4 | #include <stdbool.h> | ||
5 | #include <client/cairo.h> | ||
6 | |||
7 | struct StatusNotifierItem { | ||
8 | /* Name registered to sni watcher */ | ||
9 | char *name; | ||
10 | /* Unique bus name, needed for determining signal origins */ | ||
11 | char *unique_name; | ||
12 | bool kde_special_snowflake; | ||
13 | |||
14 | cairo_surface_t *image; | ||
15 | bool dirty; | ||
16 | }; | ||
17 | |||
18 | /* Each output holds an sni_icon_ref of each item to render */ | ||
19 | struct sni_icon_ref { | ||
20 | cairo_surface_t *icon; | ||
21 | struct StatusNotifierItem *ref; | ||
22 | }; | ||
23 | |||
24 | struct sni_icon_ref *sni_icon_ref_create(struct StatusNotifierItem *item, | ||
25 | int height); | ||
26 | |||
27 | void sni_icon_ref_free(struct sni_icon_ref *sni_ref); | ||
28 | |||
29 | /** | ||
30 | * Will return a new item and get its icon. (see warning below) | ||
31 | * May return `NULL` if `name` is not valid. | ||
32 | */ | ||
33 | struct StatusNotifierItem *sni_create(const char *name); | ||
34 | |||
35 | /** | ||
36 | * `item` must be a struct StatusNotifierItem * | ||
37 | * `str` must be a NUL terminated char * | ||
38 | * | ||
39 | * Returns 0 if `item` has a name of `str` | ||
40 | */ | ||
41 | int sni_str_cmp(const void *item, const void *str); | ||
42 | |||
43 | /** | ||
44 | * Returns 0 if `item` has a unique name of `str` or if | ||
45 | * `item->unique_name == NULL` | ||
46 | */ | ||
47 | int sni_uniq_cmp(const void *item, const void *str); | ||
48 | |||
49 | /** | ||
50 | * Gets an icon for the given item if found. | ||
51 | * | ||
52 | * XXX | ||
53 | * This function keeps a reference to the item until it gets responses, make | ||
54 | * sure that the reference and item are valid during this time. | ||
55 | */ | ||
56 | void get_icon(struct StatusNotifierItem *item); | ||
57 | |||
58 | /** | ||
59 | * Calls the "activate" method on the given StatusNotifierItem | ||
60 | * | ||
61 | * x and y should be where the item was clicked | ||
62 | */ | ||
63 | void sni_activate(struct StatusNotifierItem *item, uint32_t x, uint32_t y); | ||
64 | |||
65 | /** | ||
66 | * Asks the item to draw a context menu at the given x and y coords | ||
67 | */ | ||
68 | void sni_context_menu(struct StatusNotifierItem *item, uint32_t x, uint32_t y); | ||
69 | |||
70 | /** | ||
71 | * Calls the "secondary activate" method on the given StatusNotifierItem | ||
72 | * | ||
73 | * x and y should be where the item was clicked | ||
74 | */ | ||
75 | void sni_secondary(struct StatusNotifierItem *item, uint32_t x, uint32_t y); | ||
76 | |||
77 | /** | ||
78 | * Deconstructs `item` | ||
79 | */ | ||
80 | void sni_free(struct StatusNotifierItem *item); | ||
81 | |||
82 | #endif /* _SWAYBAR_SNI_H */ | ||