aboutsummaryrefslogtreecommitdiff
path: root/swaybar/bar.h
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-01-24 09:46:28 -0500
committerDrew DeVault <sir@cmpwn.com>2016-01-24 09:46:28 -0500
commit4b48a8399a33f3bb5f5d55f87213bb4692a5f1f9 (patch)
tree1d820cd07f6ba693a89d43caf01b3c8b01390609 /swaybar/bar.h
parentc8cf3f70f979a6eb373ec1ebdf8f80bc42dcd633 (diff)
parenta61a27c485d1b20fc7c5cbfc42b5d90148d82355 (diff)
Merge pull request #467 from mikkeloscar/swaybar-refactor
[WIP] Swaybar refactor
Diffstat (limited to 'swaybar/bar.h')
-rw-r--r--swaybar/bar.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/swaybar/bar.h b/swaybar/bar.h
new file mode 100644
index 00000000..89496da6
--- /dev/null
+++ b/swaybar/bar.h
@@ -0,0 +1,55 @@
+#ifndef _SWAYBAR_BAR_H
+#define _SWAYBAR_BAR_H
+
+#include "client/registry.h"
+#include "client/window.h"
+#include "list.h"
+
+struct bar {
+ struct config *config;
+ struct status_line *status;
+ struct output *output;
+ /* list_t *outputs; */
+
+ int ipc_event_socketfd;
+ int ipc_socketfd;
+ int status_read_fd;
+ pid_t status_command_pid;
+};
+
+struct output {
+ struct window *window;
+ struct registry *registry;
+ list_t *workspaces;
+ char *name;
+};
+
+struct workspace {
+ int num;
+ char *name;
+ bool focused;
+ bool visible;
+ bool urgent;
+};
+
+/**
+ * Setup bar.
+ */
+void bar_setup(struct bar *bar, const char *socket_path, const char *bar_id, int desired_output);
+
+/**
+ * Bar mainloop.
+ */
+void bar_run(struct bar *bar);
+
+/**
+ * free workspace list.
+ */
+void free_workspaces(list_t *workspaces);
+
+/**
+ * Teardown bar.
+ */
+void bar_teardown(struct bar *bar);
+
+#endif /* _SWAYBAR_BAR_H */