]> git.sur5r.net Git - i3/i3/blob - i3bar/include/xcb.h
Merge branch 'release-4.1.2'
[i3/i3] / i3bar / include / xcb.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  * xcb.c: Communicating with X
8  *
9  */
10 #ifndef XCB_H_
11 #define XCB_H_
12
13 #include <stdint.h>
14 //#include "outputs.h"
15
16 #ifdef XCB_COMPAT
17 #define XCB_ATOM_CARDINAL CARDINAL
18 #endif
19
20 #define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0
21 #define _NET_SYSTEM_TRAY_ORIENTATION_VERT 1
22 #define SYSTEM_TRAY_REQUEST_DOCK    0
23 #define SYSTEM_TRAY_BEGIN_MESSAGE   1
24 #define SYSTEM_TRAY_CANCEL_MESSAGE  2
25 #define XEMBED_MAPPED                   (1 << 0)
26 #define XEMBED_EMBEDDED_NOTIFY          0
27
28 struct xcb_color_strings_t {
29     char *bar_fg;
30     char *bar_bg;
31     char *active_ws_fg;
32     char *active_ws_bg;
33     char *inactive_ws_fg;
34     char *inactive_ws_bg;
35     char *focus_ws_bg;
36     char *focus_ws_fg;
37     char *urgent_ws_bg;
38     char *urgent_ws_fg;
39 };
40
41 typedef struct xcb_colors_t xcb_colors_t;
42
43 /*
44  * Early initialization of the connection to X11: Everything which does not
45  * depend on 'config'.
46  *
47  */
48 char *init_xcb_early();
49
50 /**
51  * Initialization which depends on 'config' being usable. Called after the
52  * configuration has arrived.
53  *
54  */
55 void init_xcb_late(char *fontname);
56
57 /*
58  * Initialize the colors
59  *
60  */
61 void init_colors(const struct xcb_color_strings_t *colors);
62
63 /*
64  * Cleanup the xcb-stuff.
65  * Called once, before the program terminates.
66  *
67  */
68 void clean_xcb();
69
70 /*
71  * Get the earlier requested atoms and save them in the prepared data-structure
72  *
73  */
74 void get_atoms();
75
76 /*
77  * Destroy the bar of the specified output
78  *
79  */
80 void destroy_window(i3_output *output);
81
82 /*
83  * Reallocate the statusline-buffer
84  *
85  */
86 void realloc_sl_buffer();
87
88 /*
89  * Reconfigure all bars and create new for newly activated outputs
90  *
91  */
92 void reconfig_windows();
93
94 /*
95  * Render the bars, with buttons and statusline
96  *
97  */
98 void draw_bars();
99
100 /*
101  * Redraw the bars, i.e. simply copy the buffer to the barwindow
102  *
103  */
104 void redraw_bars();
105
106 /*
107  * Predicts the length of text based on cached data.
108  * The string has to be encoded in ucs2 and glyph_len has to be the length
109  * of the string (in glyphs).
110  *
111  */
112 uint32_t predict_text_extents(xcb_char2b_t *text, uint32_t length);
113
114 #endif