]> git.sur5r.net Git - i3/i3/blob - i3bar/include/xcb.h
Remove compatibility definitions for xcb-util < 0.3.8 (#2473)
[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 Axel Wagner and contributors (see also: LICENSE)
6  *
7  * xcb.c: Communicating with X
8  *
9  */
10 #pragma once
11
12 #include <stdint.h>
13 //#include "outputs.h"
14
15 #define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0
16 #define _NET_SYSTEM_TRAY_ORIENTATION_VERT 1
17 #define SYSTEM_TRAY_REQUEST_DOCK 0
18 #define SYSTEM_TRAY_BEGIN_MESSAGE 1
19 #define SYSTEM_TRAY_CANCEL_MESSAGE 2
20 #define XEMBED_MAPPED (1 << 0)
21 #define XEMBED_EMBEDDED_NOTIFY 0
22
23 /* We define xcb_request_failed as a macro to include the relevant line number */
24 #define xcb_request_failed(cookie, err_msg) _xcb_request_failed(cookie, err_msg, __LINE__)
25 int _xcb_request_failed(xcb_void_cookie_t cookie, char *err_msg, int line);
26
27 struct xcb_color_strings_t {
28     char *bar_fg;
29     char *bar_bg;
30     char *sep_fg;
31     char *focus_bar_fg;
32     char *focus_bar_bg;
33     char *focus_sep_fg;
34     char *active_ws_fg;
35     char *active_ws_bg;
36     char *active_ws_border;
37     char *inactive_ws_fg;
38     char *inactive_ws_bg;
39     char *inactive_ws_border;
40     char *focus_ws_bg;
41     char *focus_ws_fg;
42     char *focus_ws_border;
43     char *urgent_ws_bg;
44     char *urgent_ws_fg;
45     char *urgent_ws_border;
46     char *binding_mode_bg;
47     char *binding_mode_fg;
48     char *binding_mode_border;
49 };
50
51 typedef struct xcb_colors_t xcb_colors_t;
52
53 /* Cached width of the custom separator if one was set */
54 int separator_symbol_width;
55
56 /*
57  * Early initialization of the connection to X11: Everything which does not
58  * depend on 'config'.
59  *
60  */
61 char *init_xcb_early();
62
63 /**
64  * Initialization which depends on 'config' being usable. Called after the
65  * configuration has arrived.
66  *
67  */
68 void init_xcb_late(char *fontname);
69
70 /*
71  * Initialize the colors
72  *
73  */
74 void init_colors(const struct xcb_color_strings_t *colors);
75
76 /*
77  * Cleanup the xcb stuff.
78  * Called once, before the program terminates.
79  *
80  */
81 void clean_xcb(void);
82
83 /*
84  * Get the earlier requested atoms and save them in the prepared data structure
85  *
86  */
87 void get_atoms(void);
88
89 /*
90  * Reparents all tray clients of the specified output to the root window. This
91  * is either used when shutting down, when an output appears (xrandr --output
92  * VGA1 --off) or when the primary output changes.
93  *
94  * Applications using the tray will start the protocol from the beginning again
95  * afterwards.
96  *
97  */
98 void kick_tray_clients(i3_output *output);
99
100 /*
101  * We need to set the _NET_SYSTEM_TRAY_COLORS atom on the tray selection window
102  * to make GTK+ 3 applets with symbolic icons visible. If the colors are unset,
103  * they assume a light background.
104  * See also https://bugzilla.gnome.org/show_bug.cgi?id=679591
105  *
106  */
107 void init_tray_colors(void);
108
109 /*
110  * Destroy the bar of the specified output
111  *
112  */
113 void destroy_window(i3_output *output);
114
115 /*
116  * Reallocate the statusline buffer
117  *
118  */
119 void realloc_sl_buffer(void);
120
121 /*
122  * Reconfigure all bars and create new for newly activated outputs
123  *
124  */
125 void reconfig_windows(bool redraw_bars);
126
127 /*
128  * Render the bars, with buttons and statusline
129  *
130  */
131 void draw_bars(bool force_unhide);
132
133 /*
134  * Redraw the bars, i.e. simply copy the buffer to the barwindow
135  *
136  */
137 void redraw_bars(void);
138
139 /*
140  * Set the current binding mode
141  *
142  */
143 void set_current_mode(struct mode *mode);