aboutsummaryrefslogtreecommitdiffstats
path: root/include/swaybar
diff options
context:
space:
mode:
authorLibravatar Ian Fan <ianfan0@gmail.com>2018-10-28 10:25:47 +0000
committerLibravatar Ian Fan <ianfan0@gmail.com>2018-12-31 20:40:18 +0000
commit5f65f339896fadf0011b75d78c869594876d35d9 (patch)
treebbb234ad123657f1a8ed1f311cf9183b67e7e961 /include/swaybar
parentswaybar: remove old tray implementation (diff)
downloadsway-5f65f339896fadf0011b75d78c869594876d35d9.tar.gz
sway-5f65f339896fadf0011b75d78c869594876d35d9.tar.zst
sway-5f65f339896fadf0011b75d78c869594876d35d9.zip
swaybar: add tray interface
Diffstat (limited to 'include/swaybar')
-rw-r--r--include/swaybar/bar.h8
-rw-r--r--include/swaybar/tray/tray.h28
2 files changed, 36 insertions, 0 deletions
diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h
index 57c5114e..ef27012d 100644
--- a/include/swaybar/bar.h
+++ b/include/swaybar/bar.h
@@ -1,6 +1,7 @@
1#ifndef _SWAYBAR_BAR_H 1#ifndef _SWAYBAR_BAR_H
2#define _SWAYBAR_BAR_H 2#define _SWAYBAR_BAR_H
3#include <wayland-client.h> 3#include <wayland-client.h>
4#include "config.h"
4#include "input.h" 5#include "input.h"
5#include "pool-buffer.h" 6#include "pool-buffer.h"
6#include "wlr-layer-shell-unstable-v1-client-protocol.h" 7#include "wlr-layer-shell-unstable-v1-client-protocol.h"
@@ -8,6 +9,9 @@
8 9
9struct swaybar_config; 10struct swaybar_config;
10struct swaybar_output; 11struct swaybar_output;
12#if HAVE_TRAY
13struct swaybar_tray;
14#endif
11struct swaybar_workspace; 15struct swaybar_workspace;
12struct loop; 16struct loop;
13 17
@@ -38,6 +42,10 @@ struct swaybar {
38 int ipc_socketfd; 42 int ipc_socketfd;
39 43
40 struct wl_list outputs; // swaybar_output::link 44 struct wl_list outputs; // swaybar_output::link
45
46#if HAVE_TRAY
47 struct swaybar_tray *tray;
48#endif
41}; 49};
42 50
43struct swaybar_output { 51struct swaybar_output {
diff --git a/include/swaybar/tray/tray.h b/include/swaybar/tray/tray.h
new file mode 100644
index 00000000..217e2d45
--- /dev/null
+++ b/include/swaybar/tray/tray.h
@@ -0,0 +1,28 @@
1#ifndef _SWAYBAR_TRAY_TRAY_H
2#define _SWAYBAR_TRAY_TRAY_H
3
4#include "config.h"
5#ifdef HAVE_SYSTEMD
6#include <systemd/sd-bus.h>
7#elif HAVE_ELOGIND
8#include <elogind/sd-bus.h>
9#endif
10#include <cairo.h>
11#include <stdint.h>
12
13struct swaybar;
14struct swaybar_output;
15
16struct swaybar_tray {
17 struct swaybar *bar;
18
19 int fd;
20 sd_bus *bus;
21};
22
23struct swaybar_tray *create_tray(struct swaybar *bar);
24void destroy_tray(struct swaybar_tray *tray);
25void tray_in(int fd, short mask, void *data);
26uint32_t render_tray(cairo_t *cairo, struct swaybar_output *output, double *x);
27
28#endif