gri3-wm/i3bar/include/xcb.h

114 lines
2.1 KiB
C
Raw Normal View History

2010-08-07 18:05:16 +02:00
/*
* i3bar - an xcb-based status- and ws-bar for i3
*
* © 2010-2011 Axel Wagner and contributors
2010-08-07 18:05:16 +02:00
*
* See file LICNSE for license information
*
*/
2010-07-22 01:15:18 +02:00
#ifndef XCB_H_
#define XCB_H_
#include <stdint.h>
2010-11-04 12:27:10 +01:00
//#include "outputs.h"
2011-08-17 01:32:29 +02:00
#ifdef XCB_COMPAT
#define XCB_ATOM_CARDINAL CARDINAL
#endif
#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
2010-11-04 12:27:10 +01:00
struct xcb_color_strings_t {
char *bar_fg;
char *bar_bg;
char *active_ws_fg;
char *active_ws_bg;
char *inactive_ws_fg;
char *inactive_ws_bg;
2011-03-20 19:29:30 +01:00
char *focus_ws_bg;
char *focus_ws_fg;
char *urgent_ws_bg;
char *urgent_ws_fg;
};
2010-11-04 12:27:10 +01:00
typedef struct xcb_colors_t xcb_colors_t;
2010-08-07 02:10:05 +02:00
/*
* Early initialization of the connection to X11: Everything which does not
* depend on 'config'.
2010-08-07 02:10:05 +02:00
*
*/
char *init_xcb_early();
/**
* Initialization which depends on 'config' being usable. Called after the
* configuration has arrived.
*
*/
void init_xcb_late(char *fontname);
2010-08-07 02:10:05 +02:00
/*
* Initialize the colors
*
*/
2010-11-04 12:27:10 +01:00
void init_colors(const struct xcb_color_strings_t *colors);
2010-08-07 02:10:05 +02:00
/*
* Cleanup the xcb-stuff.
* Called once, before the program terminates.
*
*/
2010-07-22 01:15:18 +02:00
void clean_xcb();
2010-08-07 02:10:05 +02:00
/*
* Get the earlier requested atoms and save them in the prepared data-structure
*
*/
2010-07-22 01:15:18 +02:00
void get_atoms();
2010-08-07 02:10:05 +02:00
/*
* Destroy the bar of the specified output
*
*/
void destroy_window(i3_output *output);
/*
* Reallocate the statusline-buffer
*
*/
void realloc_sl_buffer();
2010-08-07 02:10:05 +02:00
/*
* Reconfigure all bars and create new for newly activated outputs
*
*/
2010-08-06 03:32:05 +02:00
void reconfig_windows();
2010-08-07 02:10:05 +02:00
/*
* Render the bars, with buttons and statusline
*
*/
2010-08-04 03:34:18 +02:00
void draw_bars();
2010-08-07 02:10:05 +02:00
/*
* Redraw the bars, i.e. simply copy the buffer to the barwindow
*
*/
void redraw_bars();
2010-08-07 02:10:05 +02:00
/*
2010-09-17 03:11:49 +02:00
* Predicts the length of text based on cached data.
2010-08-07 02:10:05 +02:00
* The string has to be encoded in ucs2 and glyph_len has to be the length
2010-09-17 03:11:49 +02:00
* of the string (in glyphs).
2010-08-07 02:10:05 +02:00
*
*/
2010-09-17 03:11:49 +02:00
uint32_t predict_text_extents(xcb_char2b_t *text, uint32_t length);
2010-07-22 01:15:18 +02:00
#endif