]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/include/workspaces.h
Update copyright notices and get rid of ranges
[i3/i3] / i3bar / include / workspaces.h
index ad6ac787775fac6cd3711379af3e33c115fbb573..5ed84de86e426dc3f9f70dd318a3b4d79dbfb9c2 100644 (file)
@@ -1,26 +1,44 @@
-#ifndef WORKSPACES_H_
-#define WORKSPACES_H_
+/*
+ * vim:ts=4:sw=4:expandtab
+ *
+ * i3bar - an xcb-based status- and ws-bar for i3
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
+ *
+ * workspaces.c: Maintaining the workspace lists
+ *
+ */
+#pragma once
+
+#include <xcb/xproto.h>
 
 #include "common.h"
-#include "outputs.h"
 
-typedef struct i3_ws_t i3_ws;
+typedef struct i3_ws i3_ws;
 
-i3_ws* workspaces;
+TAILQ_HEAD(ws_head, i3_ws);
 
-void refresh_workspaces();
-void free_workspaces();
+/*
+ * Start parsing the received JSON string
+ *
+ */
+void parse_workspaces_json(char *json);
 
-struct i3_ws_t {
-       int             num;
-       char*           name;
-       bool            visible;
-       bool            focused;
-       bool            urgent;
-       rect            rect;
-       i3_output*      output;
+/*
+ * free() all workspace data structures
+ *
+ */
+void free_workspaces(void);
 
-       i3_ws*          next;
-};
+struct i3_ws {
+    int num;                  /* The internal number of the ws */
+    char *canonical_name;     /* The true name of the ws according to the ipc */
+    i3String *name;           /* The name of the ws that is displayed on the bar */
+    int name_width;           /* The rendered width of the name */
+    bool visible;             /* If the ws is currently visible on an output */
+    bool focused;             /* If the ws is currently focused */
+    bool urgent;              /* If the urgent hint of the ws is set */
+    rect rect;                /* The rect of the ws (not used (yet)) */
+    struct i3_output *output; /* The current output of the ws */
 
-#endif
+    TAILQ_ENTRY(i3_ws) tailq; /* Pointer for the TAILQ-Macro */
+};