]> git.sur5r.net Git - i3/i3/blob - i3bar/include/xcb.h
Update copyright notices and get rid of ranges
[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 #ifdef XCB_COMPAT
16 #define XCB_ATOM_CARDINAL CARDINAL
17 #endif
18
19 #define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0
20 #define _NET_SYSTEM_TRAY_ORIENTATION_VERT 1
21 #define SYSTEM_TRAY_REQUEST_DOCK 0
22 #define SYSTEM_TRAY_BEGIN_MESSAGE 1
23 #define SYSTEM_TRAY_CANCEL_MESSAGE 2
24 #define XEMBED_MAPPED (1 << 0)
25 #define XEMBED_EMBEDDED_NOTIFY 0
26
27 struct xcb_color_strings_t {
28     char *bar_fg;
29     char *bar_bg;
30     char *sep_fg;
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 /* Cached width of the custom separator if one was set */
48 int separator_symbol_width;
49
50 /*
51  * Early initialization of the connection to X11: Everything which does not
52  * depend on 'config'.
53  *
54  */
55 char *init_xcb_early();
56
57 /**
58  * Initialization which depends on 'config' being usable. Called after the
59  * configuration has arrived.
60  *
61  */
62 void init_xcb_late(char *fontname);
63
64 /*
65  * Initialize the colors
66  *
67  */
68 void init_colors(const struct xcb_color_strings_t *colors);
69
70 /*
71  * Cleanup the xcb stuff.
72  * Called once, before the program terminates.
73  *
74  */
75 void clean_xcb(void);
76
77 /*
78  * Get the earlier requested atoms and save them in the prepared data structure
79  *
80  */
81 void get_atoms(void);
82
83 /*
84  * Reparents all tray clients of the specified output to the root window. This
85  * is either used when shutting down, when an output appears (xrandr --output
86  * VGA1 --off) or when the primary output changes.
87  *
88  * Applications using the tray will start the protocol from the beginning again
89  * afterwards.
90  *
91  */
92 void kick_tray_clients(i3_output *output);
93
94 /*
95  * We need to set the _NET_SYSTEM_TRAY_COLORS atom on the tray selection window
96  * to make GTK+ 3 applets with symbolic icons visible. If the colors are unset,
97  * they assume a light background.
98  * See also https://bugzilla.gnome.org/show_bug.cgi?id=679591
99  *
100  */
101 void init_tray_colors(void);
102
103 /*
104  * Destroy the bar of the specified output
105  *
106  */
107 void destroy_window(i3_output *output);
108
109 /*
110  * Reallocate the statusline buffer
111  *
112  */
113 void realloc_sl_buffer(void);
114
115 /*
116  * Reconfigure all bars and create new for newly activated outputs
117  *
118  */
119 void reconfig_windows(bool redraw_bars);
120
121 /*
122  * Render the bars, with buttons and statusline
123  *
124  */
125 void draw_bars(bool force_unhide);
126
127 /*
128  * Redraw the bars, i.e. simply copy the buffer to the barwindow
129  *
130  */
131 void redraw_bars(void);
132
133 /*
134  * Set the current binding mode
135  *
136  */
137 void set_current_mode(struct mode *mode);