This repository has been archived by the owner on Apr 18, 2023. It is now read-only.
/
xcb.h
85 lines (72 loc) · 1.47 KB
/
xcb.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* i3bar - an xcb-based status- and ws-bar for i3
*
* © 2010 Axel Wagner and contributors
*
* See file LICNSE for license information
*
*/
#ifndef XCB_H_
#define XCB_H_
#include <stdint.h>
//#include "outputs.h"
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;
char *urgent_ws_bg;
char *urgent_ws_fg;
};
typedef struct xcb_colors_t xcb_colors_t;
/*
* Initialize xcb and use the specified fontname for text-rendering
*
*/
void init_xcb();
/*
* Initialize the colors
*
*/
void init_colors(const struct xcb_color_strings_t *colors);
/*
* Cleanup the xcb-stuff.
* Called once, before the program terminates.
*
*/
void clean_xcb();
/*
* Get the earlier requested atoms and save them in the prepared data-structure
*
*/
void get_atoms();
/*
* Destroy the bar of the specified output
*
*/
void destroy_window(i3_output *output);
/*
* Reconfigure all bars and create new for newly activated outputs
*
*/
void reconfig_windows();
/*
* Render the bars, with buttons and statusline
*
*/
void draw_bars();
/*
* Redraw the bars, i.e. simply copy the buffer to the barwindow
*
*/
void redraw_bars();
/*
* Predicts the length of text based on cached data.
* The string has to be encoded in ucs2 and glyph_len has to be the length
* of the string (in glyphs).
*
*/
uint32_t predict_text_extents(xcb_char2b_t *text, uint32_t length);
#endif