]> git.sur5r.net Git - i3/i3/blob - i3bar/include/xcb.h
Merge branch 'master' into next
[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 *active_ws_border;
34     char *inactive_ws_fg;
35     char *inactive_ws_bg;
36     char *inactive_ws_border;
37     char *focus_ws_bg;
38     char *focus_ws_fg;
39     char *focus_ws_border;
40     char *urgent_ws_bg;
41     char *urgent_ws_fg;
42     char *urgent_ws_border;
43 };
44
45 typedef struct xcb_colors_t xcb_colors_t;
46
47 /*
48  * Early initialization of the connection to X11: Everything which does not
49  * depend on 'config'.
50  *
51  */
52 char *init_xcb_early();
53
54 /**
55  * Initialization which depends on 'config' being usable. Called after the
56  * configuration has arrived.
57  *
58  */
59 void init_xcb_late(char *fontname);
60
61 /*
62  * Initialize the colors
63  *
64  */
65 void init_colors(const struct xcb_color_strings_t *colors);
66
67 /*
68  * Cleanup the xcb-stuff.
69  * Called once, before the program terminates.
70  *
71  */
72 void clean_xcb();
73
74 /*
75  * Get the earlier requested atoms and save them in the prepared data-structure
76  *
77  */
78 void get_atoms();
79
80 /*
81  * Destroy the bar of the specified output
82  *
83  */
84 void destroy_window(i3_output *output);
85
86 /*
87  * Reallocate the statusline-buffer
88  *
89  */
90 void realloc_sl_buffer();
91
92 /*
93  * Reconfigure all bars and create new for newly activated outputs
94  *
95  */
96 void reconfig_windows();
97
98 /*
99  * Render the bars, with buttons and statusline
100  *
101  */
102 void draw_bars();
103
104 /*
105  * Redraw the bars, i.e. simply copy the buffer to the barwindow
106  *
107  */
108 void redraw_bars();
109
110 #endif