]> git.sur5r.net Git - i3/i3/blob - i3bar/include/xcb.h
Merge branch '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-2012 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 *sep_fg;
32     char *active_ws_fg;
33     char *active_ws_bg;
34     char *active_ws_border;
35     char *inactive_ws_fg;
36     char *inactive_ws_bg;
37     char *inactive_ws_border;
38     char *focus_ws_bg;
39     char *focus_ws_fg;
40     char *focus_ws_border;
41     char *urgent_ws_bg;
42     char *urgent_ws_fg;
43     char *urgent_ws_border;
44 };
45
46 typedef struct xcb_colors_t xcb_colors_t;
47
48 /*
49  * Early initialization of the connection to X11: Everything which does not
50  * depend on 'config'.
51  *
52  */
53 char *init_xcb_early();
54
55 /**
56  * Initialization which depends on 'config' being usable. Called after the
57  * configuration has arrived.
58  *
59  */
60 void init_xcb_late(char *fontname);
61
62 /*
63  * Initialize the colors
64  *
65  */
66 void init_colors(const struct xcb_color_strings_t *colors);
67
68 /*
69  * Cleanup the xcb-stuff.
70  * Called once, before the program terminates.
71  *
72  */
73 void clean_xcb(void);
74
75 /*
76  * Get the earlier requested atoms and save them in the prepared data-structure
77  *
78  */
79 void get_atoms(void);
80
81 /*
82  * Reparents all tray clients of the specified output to the root window. This
83  * is either used when shutting down, when an output appears (xrandr --output
84  * VGA1 --off) or when the primary output changes.
85  *
86  * Applications using the tray will start the protocol from the beginning again
87  * afterwards.
88  *
89  */
90 void kick_tray_clients(i3_output *output);
91
92 /*
93  * We need to set the _NET_SYSTEM_TRAY_COLORS atom on the tray selection window
94  * to make GTK+ 3 applets with Symbolic Icons visible. If the colors are unset,
95  * they assume a light background.
96  * See also https://bugzilla.gnome.org/show_bug.cgi?id=679591
97  *
98  */
99 void init_tray_colors(void);
100
101 /*
102  * Destroy the bar of the specified output
103  *
104  */
105 void destroy_window(i3_output *output);
106
107 /*
108  * Reallocate the statusline-buffer
109  *
110  */
111 void realloc_sl_buffer(void);
112
113 /*
114  * Reconfigure all bars and create new for newly activated outputs
115  *
116  */
117 void reconfig_windows(void);
118
119 /*
120  * Render the bars, with buttons and statusline
121  *
122  */
123 void draw_bars(bool force_unhide);
124
125 /*
126  * Redraw the bars, i.e. simply copy the buffer to the barwindow
127  *
128  */
129 void redraw_bars(void);
130
131 /*
132  * Set the current binding mode
133  *
134  */
135 void set_current_mode(struct mode *mode);
136
137 #endif