-
Notifications
You must be signed in to change notification settings - Fork 6
/
builtin-widgets.h
276 lines (218 loc) · 5.59 KB
/
builtin-widgets.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
#pragma once
#include "gui.h"
#include "widget-utils.h"
#include "array.h"
/* button states */
#define BUTTON_STATE_IDLE 0
#define BUTTON_STATE_IDLE_HIGHLIGHT 1
#define BUTTON_STATE_PRESSED 2
#define BUTTON_STATE_PRESSED_HIGHLIGHT 3
/**************************************************************************
Taskbar
**************************************************************************/
struct taskbar_task {
struct strbuf name;
cairo_surface_t *icon;
Window win;
int desktop;
int x;
int w;
int geom_x; /* for _NET_WM_ICON_GEOMETRY */
int geom_w;
int demands_attention;
int monitor; /* for multihead setups */
/* I'm using only one name source Atom and I'm watching it for
* updates.
*/
Atom name_atom;
Atom name_type_atom;
};
struct taskbar_state {
struct triple_image background;
struct text_info font;
int icon_offset[2];
int exists;
};
struct taskbar_theme {
struct taskbar_state states[4];
cairo_surface_t *default_icon;
int task_max_width;
cairo_surface_t *separator;
};
struct taskbar_widget {
struct taskbar_theme theme;
/* array */
struct taskbar_task *tasks;
size_t tasks_n;
size_t tasks_alloc;
Window active;
int highlighted;
int desktop;
Window dnd_win;
Window taken;
Cursor dnd_cur;
/* parameters from bmpanel2rc */
int task_death_threshold;
int task_urgency_hint;
unsigned int task_visible_monitors;
};
extern struct widget_interface taskbar_interface;
/**************************************************************************
Clock
**************************************************************************/
struct clock_theme {
struct triple_image background;
struct text_info font;
char *time_format;
};
struct clock_widget {
struct clock_theme theme;
/* parameters from bmpanel2rc */
char *clock_prog;
int mouse_button;
};
extern struct widget_interface clock_interface;
/**************************************************************************
Desktop Switcher
**************************************************************************/
struct desktops_state {
cairo_surface_t *left_corner;
struct triple_image background;
cairo_surface_t *right_corner;
struct text_info font;
int exists;
};
struct desktops_desktop {
char *name;
int x;
int w;
int textw;
};
struct desktops_theme {
struct desktops_state states[4];
cairo_surface_t *separator;
};
struct desktops_widget {
struct desktops_theme theme;
/* array */
struct desktops_desktop *desktops;
size_t desktops_n;
size_t desktops_alloc;
int active;
int highlighted;
};
extern struct widget_interface desktops_interface;
/**************************************************************************
Pager
**************************************************************************/
struct pager_state {
unsigned char border[3];
unsigned char fill[3];
unsigned char inactive_window_border[3];
unsigned char inactive_window_fill[3];
unsigned char active_window_border[3];
unsigned char active_window_fill[3];
struct text_info font;
int exists;
};
struct pager_theme {
/* pressed, idle, pressed_highlight, idle_highlight */
struct pager_state states[4];
int height;
int desktop_spacing;
};
struct pager_desktop {
int x;
int w;
int needs_expose;
int num_tasks;
struct rect workarea;
int div; /* use this value to convert window sizes */
};
struct pager_task {
Window win;
int x; /* coordinates aren't translated */
int y;
int w;
int h;
int visible;
int visible_on_panel;
int desktop; /* desktop this task affects */
int stackpos; /* if it was changed we need to redraw */
int alive; /* flag, used when syncing tasks with NETWM */
};
struct pager_widget {
struct pager_theme theme;
/* array */
struct pager_desktop *desktops;
size_t desktops_n;
size_t desktops_alloc;
int active;
int highlighted;
Window active_win;
Window *windows; /* from NETWM */
int windows_n;
GHashTable *tasks; /* synced table of windows with retrieved parameters */
int current_monitor_only;
};
extern struct widget_interface pager_interface;
/**************************************************************************
Decor
**************************************************************************/
struct decor_widget {
cairo_surface_t *image;
};
extern struct widget_interface decor_interface;
/**************************************************************************
Empty
**************************************************************************/
extern struct widget_interface empty_interface;
/**************************************************************************
Systray
**************************************************************************/
struct systray_icon {
Window icon;
Window embedder;
int mapped;
};
struct systray_theme {
struct triple_image background;
int icon_size[2];
int icon_offset[2];
int icon_spacing;
};
struct systray_widget {
/* array */
struct systray_icon *icons;
size_t icons_n;
size_t icons_alloc;
Atom tray_selection_atom;
Window selection_owner;
struct systray_theme theme;
};
extern struct widget_interface systray_interface;
/**************************************************************************
Launch Bar
**************************************************************************/
struct launchbar_item {
cairo_surface_t *icon;
char *execstr;
int x;
int w;
};
struct launchbar_theme {
struct triple_image background;
int icon_size[2];
int icon_offset[2];
int icon_spacing;
};
struct launchbar_widget {
struct launchbar_theme theme;
/* parameters from bmpanel2rc */
/* array */
struct launchbar_item *items;
size_t items_n;
size_t items_alloc;
int active;
};
extern struct widget_interface launchbar_interface;