]> git.sur5r.net Git - i3/i3/blob - i3bar/include/config.h
Merge branch 'master' into next
[i3/i3] / i3bar / include / config.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3bar - an xcb-based status- and ws-bar for i3
5  * © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
6  *
7  * config.c: Parses the configuration (received from i3).
8  *
9  */
10 #pragma once
11
12 #include "common.h"
13
14 typedef enum {
15     POS_NONE = 0,
16     POS_TOP,
17     POS_BOT
18 } position_t;
19
20 /* Bar display mode (hide unless modifier is pressed or show in dock mode or always hide in invisible mode) */
21 typedef enum { M_DOCK = 0,
22                M_HIDE = 1,
23                M_INVISIBLE = 2 } bar_display_mode_t;
24
25 typedef struct config_t {
26     int modifier;
27     position_t position;
28     int verbose;
29     struct xcb_color_strings_t colors;
30     bool disable_binding_mode_indicator;
31     bool disable_ws;
32     bool strip_ws_numbers;
33     char *bar_id;
34     char *command;
35     char *fontname;
36     char *tray_output;
37     int num_outputs;
38     char **outputs;
39
40     bar_display_mode_t hide_on_modifier;
41
42     /* The current hidden_state of the bar, which indicates whether it is hidden or shown */
43     enum { S_HIDE = 0,
44            S_SHOW = 1 } hidden_state;
45 } config_t;
46
47 config_t config;
48
49 /**
50  * Start parsing the received bar configuration json-string
51  *
52  */
53 void parse_config_json(char *json);
54
55 /**
56  * free()s the color strings as soon as they are not needed anymore.
57  *
58  */
59 void free_colors(struct xcb_color_strings_t *colors);