]> git.sur5r.net Git - i3/i3/blob - i3bar/include/common.h
22b9a28ac81d39e9d7a3a24cf40f2ba900839fe7
[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     i3String *short_text;
39
40     char *color;
41
42     /* min_width can be specified either as a numeric value (in pixels) or as a
43      * string. For strings, we set min_width to the measured text width of
44      * min_width_str. */
45     uint32_t min_width;
46     char *min_width_str;
47
48     blockalign_t align;
49
50     bool urgent;
51     bool no_separator;
52     bool is_markup;
53
54     /* The amount of pixels necessary to render a separater after the block. */
55     uint32_t sep_block_width;
56
57     /* The amount of pixels necessary to render this block. These variables are
58      * only temporarily used in refresh_statusline(). */
59     uint32_t width;
60     uint32_t x_offset;
61     uint32_t x_append;
62
63     /* Optional */
64     char *name;
65     char *instance;
66
67     TAILQ_ENTRY(status_block) blocks;
68 };
69
70 TAILQ_HEAD(statusline_head, status_block) statusline_head;
71
72 #include "child.h"
73 #include "ipc.h"
74 #include "outputs.h"
75 #include "util.h"
76 #include "workspaces.h"
77 #include "mode.h"
78 #include "trayclients.h"
79 #include "xcb.h"
80 #include "config.h"
81 #include "libi3.h"
82 #include "parse_json_header.h"