]> git.sur5r.net Git - i3/i3/blob - i3bar/include/common.h
Merge branch 'master' into next
[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 #pragma once
9
10 #include <stdbool.h>
11 #include <xcb/xcb.h>
12 #include <xcb/xproto.h>
13 #include "libi3.h"
14 #include "queue.h"
15
16 typedef struct rect_t rect;
17
18 struct ev_loop *main_loop;
19
20 struct rect_t {
21     int x;
22     int y;
23     int w;
24     int h;
25 };
26
27 typedef enum {
28     /* First value to make it the default. */
29     ALIGN_LEFT,
30     ALIGN_CENTER,
31     ALIGN_RIGHT
32 } blockalign_t;
33
34 /* This data structure represents one JSON dictionary, multiple of these make
35  * up one status line. */
36 struct status_block {
37     i3String *full_text;
38
39     char *color;
40     uint32_t min_width;
41     blockalign_t align;
42
43     bool urgent;
44     bool no_separator;
45
46     /* The amount of pixels necessary to render a separater after the block. */
47     uint32_t sep_block_width;
48
49     /* The amount of pixels necessary to render this block. These variables are
50      * only temporarily used in refresh_statusline(). */
51     uint32_t width;
52     uint32_t x_offset;
53     uint32_t x_append;
54
55     /* Optional */
56     char *name;
57     char *instance;
58
59     TAILQ_ENTRY(status_block) blocks;
60 };
61
62 TAILQ_HEAD(statusline_head, status_block) statusline_head;
63
64 #include "child.h"
65 #include "ipc.h"
66 #include "outputs.h"
67 #include "util.h"
68 #include "workspaces.h"
69 #include "mode.h"
70 #include "trayclients.h"
71 #include "xcb.h"
72 #include "config.h"
73 #include "libi3.h"
74 #include "parse_json_header.h"