]> git.sur5r.net Git - i3/i3/blob - i3bar/include/xcb.h
Merge i3bar into next
[i3/i3] / i3bar / include / xcb.h
1 /*
2  * i3bar - an xcb-based status- and ws-bar for i3
3  *
4  * © 2010-2011 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 //#include "outputs.h"
14
15 struct xcb_color_strings_t {
16     char *bar_fg;
17     char *bar_bg;
18     char *active_ws_fg;
19     char *active_ws_bg;
20     char *inactive_ws_fg;
21     char *inactive_ws_bg;
22     char *focus_ws_bg;
23     char *focus_ws_fg;
24     char *urgent_ws_bg;
25     char *urgent_ws_fg;
26 };
27
28 typedef struct xcb_colors_t xcb_colors_t;
29
30 /*
31  * Initialize xcb and use the specified fontname for text-rendering
32  *
33  */
34 char *init_xcb();
35
36 /*
37  * Initialize the colors
38  *
39  */
40 void init_colors(const struct xcb_color_strings_t *colors);
41
42 /*
43  * Cleanup the xcb-stuff.
44  * Called once, before the program terminates.
45  *
46  */
47 void clean_xcb();
48
49 /*
50  * Get the earlier requested atoms and save them in the prepared data-structure
51  *
52  */
53 void get_atoms();
54
55 /*
56  * Destroy the bar of the specified output
57  *
58  */
59 void destroy_window(i3_output *output);
60
61 /*
62  * Reallocate the statusline-buffer
63  *
64  */
65 void realloc_sl_buffer();
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