summaryrefslogtreecommitdiffstats
path: root/include/swaybar/bar.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/swaybar/bar.h')
-rw-r--r--include/swaybar/bar.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/include/swaybar/bar.h b/include/swaybar/bar.h
new file mode 100644
index 00000000..a3c511d9
--- /dev/null
+++ b/include/swaybar/bar.h
@@ -0,0 +1,63 @@
1#ifndef _SWAYBAR_BAR_H
2#define _SWAYBAR_BAR_H
3
4#include "client/registry.h"
5#include "client/window.h"
6#include "list.h"
7
8struct bar {
9 struct config *config;
10 struct status_line *status;
11 list_t *outputs;
12
13 int ipc_event_socketfd;
14 int ipc_socketfd;
15 int status_read_fd;
16 pid_t status_command_pid;
17};
18
19struct output {
20 struct window *window;
21 struct registry *registry;
22 list_t *workspaces;
23 char *name;
24 int idx;
25};
26
27struct workspace {
28 int num;
29 char *name;
30 bool focused;
31 bool visible;
32 bool urgent;
33};
34
35/** Global bar state */
36extern struct bar swaybar;
37
38/**
39 * Setup bar.
40 */
41void bar_setup(struct bar *bar, const char *socket_path, const char *bar_id);
42
43/**
44 * Create new output struct from name.
45 */
46struct output *new_output(const char *name);
47
48/**
49 * Bar mainloop.
50 */
51void bar_run(struct bar *bar);
52
53/**
54 * free workspace list.
55 */
56void free_workspaces(list_t *workspaces);
57
58/**
59 * Teardown bar.
60 */
61void bar_teardown(struct bar *bar);
62
63#endif /* _SWAYBAR_BAR_H */