]> git.sur5r.net Git - i3/i3/blob - i3bar/include/xcb.h
Custom colors can be set from the command line.
[i3/i3] / i3bar / include / xcb.h
1 /*
2  * i3bar - an xcb-based status- and ws-bar for i3
3  *
4  * © 2010 Axel Wagner and contributors
5  *
6  * See file LICNSE for license information
7  *
8  */
9 #ifndef XCB_H_
10 #define XCB_H_
11
12 #include <stdint.h>
13
14 struct colors_t {
15     char *bar_fg;
16     char *bar_bg;
17     char *active_ws_fg;
18     char *active_ws_bg;
19     char *inactive_ws_fg;
20     char *inactive_ws_bg;
21     char *urgent_ws_bg;
22     char *urgent_ws_fg;
23 };
24
25 struct parsed_colors_t {
26     uint32_t bar_fg;
27     uint32_t bar_bg;
28     uint32_t active_ws_fg;
29     uint32_t active_ws_bg;
30     uint32_t inactive_ws_fg;
31     uint32_t inactive_ws_bg;
32     uint32_t urgent_ws_bg;
33     uint32_t urgent_ws_fg;
34 };
35
36 /*
37  * Initialize xcb and use the specified fontname for text-rendering
38  *
39  */
40 void init_xcb();
41
42 /*
43  * Initialize the colors
44  *
45  */
46 void init_colors(const struct colors_t *colors);
47
48 /*
49  * Cleanup the xcb-stuff.
50  * Called once, before the program terminates.
51  *
52  */
53 void clean_xcb();
54
55 /*
56  * Get the earlier requested atoms and save them in the prepared data-structure
57  *
58  */
59 void get_atoms();
60
61 /*
62  * Destroy the bar of the specified output
63  *
64  */
65 void destroy_window(i3_output *output);
66
67 /*
68  * Reconfigure all bars and create new for newly activated outputs
69  *
70  */
71 void reconfig_windows();
72
73 /*
74  * Render the bars, with buttons and statusline
75  *
76  */
77 void draw_bars();
78
79 /*
80  * Redraw the bars, i.e. simply copy the buffer to the barwindow
81  *
82  */
83 void redraw_bars();
84
85 /*
86  * Predicts the length of text based on cached data.
87  * The string has to be encoded in ucs2 and glyph_len has to be the length
88  * of the string (in glyphs).
89  *
90  */
91 uint32_t predict_text_extents(xcb_char2b_t *text, uint32_t length);
92
93 #endif