]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/include/config.h
Merge pull request #1805 from lasers/next
[i3/i3] / i3bar / include / config.h
index c5fc218c15d7e195ed0d639fb8f220f788c94e49..1ce5dfa6e4bebaaf930114d61081498a1f77ce55 100644 (file)
@@ -1,5 +1,13 @@
-#ifndef CONFIG_H_
-#define CONFIG_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)
+ *
+ * config.c: Parses the configuration (received from i3).
+ *
+ */
+#pragma once
 
 #include "common.h"
 
@@ -9,24 +17,47 @@ typedef enum {
     POS_BOT
 } position_t;
 
+/* Bar display mode (hide unless modifier is pressed or show in dock mode or always hide in invisible mode) */
+typedef enum { M_DOCK = 0,
+               M_HIDE = 1,
+               M_INVISIBLE = 2 } bar_display_mode_t;
+
+typedef struct binding_t {
+    int input_code;
+    char *command;
+
+    TAILQ_ENTRY(binding_t) bindings;
+} binding_t;
+
 typedef struct config_t {
-    int          hide_on_modifier;
-    position_t   position;
-    int          verbose;
+    int modifier;
+    TAILQ_HEAD(bindings_head, binding_t) bindings;
+    position_t position;
+    int verbose;
     struct xcb_color_strings_t colors;
-    int          disable_ws;
-    char         *bar_id;
-    char         *command;
-    char         *fontname;
-    char         *tray_output;
-    int          num_outputs;
-    char         **outputs;
+    bool disable_binding_mode_indicator;
+    bool disable_ws;
+    bool strip_ws_numbers;
+    char *bar_id;
+    char *command;
+    char *fontname;
+    i3String *separator_symbol;
+    char *tray_output;
+    int tray_padding;
+    int num_outputs;
+    char **outputs;
+
+    bar_display_mode_t hide_on_modifier;
+
+    /* The current hidden_state of the bar, which indicates whether it is hidden or shown */
+    enum { S_HIDE = 0,
+           S_SHOW = 1 } hidden_state;
 } config_t;
 
 config_t config;
 
 /**
- * Start parsing the received bar configuration json-string
+ * Start parsing the received bar configuration JSON string
  *
  */
 void parse_config_json(char *json);
@@ -36,5 +67,3 @@ void parse_config_json(char *json);
  *
  */
 void free_colors(struct xcb_color_strings_t *colors);
-
-#endif