2 * vim:ts=4:sw=4:expandtab
4 * i3bar - an xcb-based status- and ws-bar for i3
5 * © 2010 Axel Wagner and contributors (see also: LICENSE)
7 * xcb.c: Communicating with X
15 //#include "outputs.h"
17 #define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0
18 #define _NET_SYSTEM_TRAY_ORIENTATION_VERT 1
19 #define SYSTEM_TRAY_REQUEST_DOCK 0
20 #define SYSTEM_TRAY_BEGIN_MESSAGE 1
21 #define SYSTEM_TRAY_CANCEL_MESSAGE 2
22 #define XEMBED_MAPPED (1 << 0)
23 #define XEMBED_EMBEDDED_NOTIFY 0
25 /* We define xcb_request_failed as a macro to include the relevant line number */
26 #define xcb_request_failed(cookie, err_msg) _xcb_request_failed(cookie, err_msg, __LINE__)
27 int _xcb_request_failed(xcb_void_cookie_t cookie, char *err_msg, int line);
29 struct xcb_color_strings_t {
38 char *active_ws_border;
41 char *inactive_ws_border;
44 char *focus_ws_border;
47 char *urgent_ws_border;
48 char *binding_mode_bg;
49 char *binding_mode_fg;
50 char *binding_mode_border;
53 typedef struct xcb_colors_t xcb_colors_t;
55 /* Cached width of the custom separator if one was set */
56 int separator_symbol_width;
59 * Early initialization of the connection to X11: Everything which does not
63 char *init_xcb_early(void);
66 * Initialization which depends on 'config' being usable. Called after the
67 * configuration has arrived.
70 void init_xcb_late(char *fontname);
73 * Initialize the colors
76 void init_colors(const struct xcb_color_strings_t *colors);
79 * Cleanup the xcb stuff.
80 * Called once, before the program terminates.
86 * Get the earlier requested atoms and save them in the prepared data structure
92 * Reparents all tray clients of the specified output to the root window. This
93 * is either used when shutting down, when an output appears (xrandr --output
94 * VGA1 --off) or when the primary output changes.
96 * Applications using the tray will start the protocol from the beginning again
100 void kick_tray_clients(i3_output *output);
103 * We need to set the _NET_SYSTEM_TRAY_COLORS atom on the tray selection window
104 * to make GTK+ 3 applets with symbolic icons visible. If the colors are unset,
105 * they assume a light background.
106 * See also https://bugzilla.gnome.org/show_bug.cgi?id=679591
109 void init_tray_colors(void);
112 * Destroy the bar of the specified output
115 void destroy_window(i3_output *output);
118 * Reallocate the statusline buffer
121 void realloc_sl_buffer(void);
124 * Reconfigure all bars and create new for newly activated outputs
127 void reconfig_windows(bool redraw_bars);
130 * Render the bars, with buttons and statusline
133 void draw_bars(bool force_unhide);
136 * Redraw the bars, i.e. simply copy the buffer to the barwindow
139 void redraw_bars(void);
142 * Set the current binding mode
145 void set_current_mode(struct mode *mode);