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