]> git.sur5r.net Git - i3/i3/blob - i3bar/include/xcb.h
Don't reallocate the backbuffer on every refresh (thx sECuRE)
[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 //#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 *urgent_ws_bg;
23     char *urgent_ws_fg;
24 };
25
26 typedef struct xcb_colors_t xcb_colors_t;
27
28 /*
29  * Initialize xcb and use the specified fontname for text-rendering
30  *
31  */
32 char *init_xcb();
33
34 /*
35  * Initialize the colors
36  *
37  */
38 void init_colors(const struct xcb_color_strings_t *colors);
39
40 /*
41  * Cleanup the xcb-stuff.
42  * Called once, before the program terminates.
43  *
44  */
45 void clean_xcb();
46
47 /*
48  * Get the earlier requested atoms and save them in the prepared data-structure
49  *
50  */
51 void get_atoms();
52
53 /*
54  * Destroy the bar of the specified output
55  *
56  */
57 void destroy_window(i3_output *output);
58
59 /*
60  * Reallocate the statusline-buffer
61  *
62  */
63 void realloc_sl_buffer();
64
65 /*
66  * Reconfigure all bars and create new for newly activated outputs
67  *
68  */
69 void reconfig_windows();
70
71 /*
72  * Render the bars, with buttons and statusline
73  *
74  */
75 void draw_bars();
76
77 /*
78  * Redraw the bars, i.e. simply copy the buffer to the barwindow
79  *
80  */
81 void redraw_bars();
82
83 /*
84  * Predicts the length of text based on cached data.
85  * The string has to be encoded in ucs2 and glyph_len has to be the length
86  * of the string (in glyphs).
87  *
88  */
89 uint32_t predict_text_extents(xcb_char2b_t *text, uint32_t length);
90
91 #endif