]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/include/workspaces.h
Merge branch 'next' into master
[i3/i3] / i3bar / include / workspaces.h
index 2055d8b8e420bc43ace703b8dd16f1a56f8271e8..e1f9e8878a57a374bb77c4b60d1f7179e7128599 100644 (file)
@@ -1,47 +1,45 @@
 /*
- * i3bar - an xcb-based status- and ws-bar for i3
+ * vim:ts=4:sw=4:expandtab
  *
- * © 2010-2011 Axel Wagner and contributors
+ * i3bar - an xcb-based status- and ws-bar for i3
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
- * See file LICNSE for license information
+ * workspaces.c: Maintaining the workspace lists
  *
  */
-#ifndef WORKSPACES_H_
-#define WORKSPACES_H_
-
-#include <xcb/xproto.h>
+#pragma once
 
 #include "common.h"
 
+#include <xcb/xproto.h>
+
 typedef struct i3_ws i3_ws;
 
 TAILQ_HEAD(ws_head, i3_ws);
 
 /*
- * Start parsing the received json-string
+ * Start parsing the received JSON string
  *
  */
-void parse_workspaces_json();
+void parse_workspaces_json(char *json);
 
 /*
- * free() all workspace data-structures
+ * free() all workspace data structures
  *
  */
-void free_workspaces();
+void free_workspaces(void);
 
 struct i3_ws {
-    int                num;         /* The internal number of the ws */
-    char               *name;       /* The name (in utf8) of the ws */
-    xcb_char2b_t       *ucs2_name;  /* The name (in ucs2) of the ws */
-    int                name_glyphs; /* The length (in glyphs) of the name */
-    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 */
-
-    TAILQ_ENTRY(i3_ws) tailq;       /* Pointer for the TAILQ-Macro */
+    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 */
+
+    TAILQ_ENTRY(i3_ws)
+    tailq; /* Pointer for the TAILQ-Macro */
 };
-
-#endif