2 * i3bar - an xcb-based status- and ws-bar for i3
4 * © 2010-2011 Axel Wagner and contributors
6 * See file LICNSE for license information
13 //#include "outputs.h"
16 #define XCB_ATOM_CARDINAL CARDINAL
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
27 struct xcb_color_strings_t {
40 typedef struct xcb_colors_t xcb_colors_t;
43 * Initialize xcb and use the specified fontname for text-rendering
46 char *init_xcb(char *fontname);
49 * Initialize the colors
52 void init_colors(const struct xcb_color_strings_t *colors);
55 * Cleanup the xcb-stuff.
56 * Called once, before the program terminates.
62 * Get the earlier requested atoms and save them in the prepared data-structure
68 * Destroy the bar of the specified output
71 void destroy_window(i3_output *output);
74 * Reallocate the statusline-buffer
77 void realloc_sl_buffer();
80 * Reconfigure all bars and create new for newly activated outputs
83 void reconfig_windows();
86 * Render the bars, with buttons and statusline
92 * Redraw the bars, i.e. simply copy the buffer to the barwindow
98 * Predicts the length of text based on cached data.
99 * The string has to be encoded in ucs2 and glyph_len has to be the length
100 * of the string (in glyphs).
103 uint32_t predict_text_extents(xcb_char2b_t *text, uint32_t length);