X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=i3bar%2Finclude%2Fxcb.h;h=0a9bd7e41d67e175d984481d326ff3e971fb0042;hb=dc05d905c1ab0978ca98b3e15ff96d18df55c182;hp=dcc4d78116e9a6b1f9a4ca954acb251e2d65e153;hpb=2252b4f5b956551ad4844deabee0ab38ccc73c99;p=i3%2Fi3 diff --git a/i3bar/include/xcb.h b/i3bar/include/xcb.h index dcc4d781..0a9bd7e4 100644 --- a/i3bar/include/xcb.h +++ b/i3bar/include/xcb.h @@ -2,13 +2,12 @@ * vim:ts=4:sw=4:expandtab * * i3bar - an xcb-based status- and ws-bar for i3 - * © 2010-2012 Axel Wagner and contributors (see also: LICENSE) + * © 2010 Axel Wagner and contributors (see also: LICENSE) * * xcb.c: Communicating with X * */ -#ifndef XCB_H_ -#define XCB_H_ +#pragma once #include //#include "outputs.h" @@ -19,15 +18,25 @@ #define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0 #define _NET_SYSTEM_TRAY_ORIENTATION_VERT 1 -#define SYSTEM_TRAY_REQUEST_DOCK 0 -#define SYSTEM_TRAY_BEGIN_MESSAGE 1 -#define SYSTEM_TRAY_CANCEL_MESSAGE 2 -#define XEMBED_MAPPED (1 << 0) -#define XEMBED_EMBEDDED_NOTIFY 0 +#define SYSTEM_TRAY_REQUEST_DOCK 0 +#define SYSTEM_TRAY_BEGIN_MESSAGE 1 +#define SYSTEM_TRAY_CANCEL_MESSAGE 2 +#define XEMBED_MAPPED (1 << 0) +#define XEMBED_EMBEDDED_NOTIFY 0 + +xcb_connection_t *xcb_connection; + +/* We define xcb_request_failed as a macro to include the relevant line number */ +#define xcb_request_failed(cookie, err_msg) _xcb_request_failed(cookie, err_msg, __LINE__) +int _xcb_request_failed(xcb_void_cookie_t cookie, char *err_msg, int line); struct xcb_color_strings_t { char *bar_fg; char *bar_bg; + char *sep_fg; + char *focus_bar_fg; + char *focus_bar_bg; + char *focus_sep_fg; char *active_ws_fg; char *active_ws_bg; char *active_ws_border; @@ -40,10 +49,16 @@ struct xcb_color_strings_t { char *urgent_ws_bg; char *urgent_ws_fg; char *urgent_ws_border; + char *binding_mode_bg; + char *binding_mode_fg; + char *binding_mode_border; }; typedef struct xcb_colors_t xcb_colors_t; +/* Cached width of the custom separator if one was set */ +int separator_symbol_width; + /* * Early initialization of the connection to X11: Everything which does not * depend on 'config'. @@ -65,14 +80,14 @@ void init_xcb_late(char *fontname); void init_colors(const struct xcb_color_strings_t *colors); /* - * Cleanup the xcb-stuff. + * Cleanup the xcb stuff. * Called once, before the program terminates. * */ void clean_xcb(void); /* - * Get the earlier requested atoms and save them in the prepared data-structure + * Get the earlier requested atoms and save them in the prepared data structure * */ void get_atoms(void); @@ -88,6 +103,15 @@ void get_atoms(void); */ void kick_tray_clients(i3_output *output); +/* + * We need to set the _NET_SYSTEM_TRAY_COLORS atom on the tray selection window + * to make GTK+ 3 applets with symbolic icons visible. If the colors are unset, + * they assume a light background. + * See also https://bugzilla.gnome.org/show_bug.cgi?id=679591 + * + */ +void init_tray_colors(void); + /* * Destroy the bar of the specified output * @@ -95,7 +119,7 @@ void kick_tray_clients(i3_output *output); void destroy_window(i3_output *output); /* - * Reallocate the statusline-buffer + * Reallocate the statusline buffer * */ void realloc_sl_buffer(void); @@ -104,7 +128,7 @@ void realloc_sl_buffer(void); * Reconfigure all bars and create new for newly activated outputs * */ -void reconfig_windows(void); +void reconfig_windows(bool redraw_bars); /* * Render the bars, with buttons and statusline @@ -118,4 +142,8 @@ void draw_bars(bool force_unhide); */ void redraw_bars(void); -#endif +/* + * Set the current binding mode + * + */ +void set_current_mode(struct mode *mode);