]> git.sur5r.net Git - i3/i3/blob - i3bar/include/config.h
Fix 'gcc -Wextra -Wno-unused-parameter'.
[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, M_HIDE = 1, M_INVISIBLE = 2 } bar_display_mode_t;
22
23 typedef struct config_t {
24     int          modifier;
25     position_t   position;
26     int          verbose;
27     struct xcb_color_strings_t colors;
28     bool         disable_binding_mode_indicator;
29     bool         disable_ws;
30     char         *bar_id;
31     char         *command;
32     char         *fontname;
33     char         *tray_output;
34     int          num_outputs;
35     char         **outputs;
36
37     bar_display_mode_t hide_on_modifier;
38
39     /* The current hidden_state of the bar, which indicates whether it is hidden or shown */
40     enum { S_HIDE = 0, S_SHOW = 1 } hidden_state;
41 } config_t;
42
43 config_t config;
44
45 /**
46  * Start parsing the received bar configuration json-string
47  *
48  */
49 void parse_config_json(char *json);
50
51 /**
52  * free()s the color strings as soon as they are not needed anymore.
53  *
54  */
55 void free_colors(struct xcb_color_strings_t *colors);