]> git.sur5r.net Git - i3/i3/blob - i3bar/include/common.h
i3bar: be less strict about the {"version":1} JSON header
[i3/i3] / i3bar / include / common.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  */
8 #ifndef COMMON_H_
9 #define COMMON_H_
10
11 #include <stdbool.h>
12 #include <xcb/xcb.h>
13 #include <xcb/xproto.h>
14 #include "queue.h"
15
16 typedef struct rect_t rect;
17
18 struct ev_loop* main_loop;
19 char            *statusline;
20 char            *statusline_buffer;
21
22 struct rect_t {
23     int x;
24     int y;
25     int w;
26     int h;
27 };
28
29 /* This data structure represents one JSON dictionary, multiple of these make
30  * up one status line. */
31 struct status_block {
32     char *full_text;
33
34     char *color;
35
36     /* full_text, but converted to UCS-2. This variable is only temporarily
37      * used in refresh_statusline(). */
38     xcb_char2b_t *ucs2_full_text;
39     size_t glyph_count_full_text;
40
41     /* The amount of pixels necessary to render this block. This variable is
42      * only temporarily used in refresh_statusline(). */
43     uint32_t width;
44
45     TAILQ_ENTRY(status_block) blocks;
46 };
47
48 TAILQ_HEAD(statusline_head, status_block) statusline_head;
49
50 #include "child.h"
51 #include "ipc.h"
52 #include "outputs.h"
53 #include "util.h"
54 #include "workspaces.h"
55 #include "trayclients.h"
56 #include "xcb.h"
57 #include "config.h"
58 #include "libi3.h"
59 #include "determine_json_version.h"
60
61 #endif