Debian Codegraph @

i3bar/include/xcb.h

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