forked from awesomeWM/awesome
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructs.h
More file actions
375 lines (356 loc) · 8.57 KB
/
Copy pathstructs.h
File metadata and controls
375 lines (356 loc) · 8.57 KB
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
/*
* structs.h - basic structs header
*
* Copyright © 2007-2008 Julien Danjou <julien@danjou.info>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifndef AWESOME_STRUCTS_H
#define AWESOME_STRUCTS_H
#include <regex.h>
#include "layout.h"
#include "common/draw.h"
#include "common/swindow.h"
#include "common/xscreen.h"
/** Rules for floating rule */
typedef enum
{
No = False,
Yes = True,
Maybe
} Fuzzy;
/** Cursors */
enum
{ CurNormal, CurResize, CurMove, CurLast };
typedef struct
{
SimpleWindow *sw;
Position position;
Position dposition;
Alignment align;
Alignment text_align;
int width, height;
/** Colors */
struct
{
style_t normal;
style_t focus;
style_t urgent;
} styles;
} Titlebar;
/** Rule type */
typedef struct Rule Rule;
struct Rule
{
char *icon;
char *xprop;
int screen;
Fuzzy isfloating;
Fuzzy ismaster;
Titlebar titlebar;
double opacity;
regex_t *prop_r;
regex_t *tags_r;
regex_t *xpropval_r;
/** Next and previous rules */
Rule *prev, *next;
};
/** Key bindings */
typedef struct Key Key;
struct Key
{
unsigned long mod;
KeySym keysym;
KeyCode keycode;
Uicb *func;
char *arg;
/** Next and previous keys */
Key *prev, *next;
};
/** Mouse buttons bindings */
typedef struct Button Button;
struct Button
{
unsigned long mod;
unsigned int button;
Uicb *func;
char *arg;
/** Next and previous buttons */
Button *prev, *next;
};
/** Widget tell status code */
typedef enum
{
WIDGET_NOERROR = 0,
WIDGET_ERROR,
WIDGET_ERROR_NOVALUE,
WIDGET_ERROR_CUSTOM,
WIDGET_ERROR_FORMAT_BOOL,
WIDGET_ERROR_FORMAT_FONT,
WIDGET_ERROR_FORMAT_COLOR,
WIDGET_ERROR_FORMAT_SECTION
} widget_tell_status_t;
/** Widget */
typedef struct Widget Widget;
typedef struct Statusbar Statusbar;
struct Widget
{
/** Widget name */
char *name;
/** Draw function */
int (*draw)(Widget *, DrawCtx *, int, int);
/** Update function */
widget_tell_status_t (*tell)(Widget *, char *, char *);
/** ButtonPressedEvent handler */
void (*button_press)(Widget *, XButtonPressedEvent *);
/** Statusbar */
Statusbar *statusbar;
/** Alignement */
Alignment alignment;
/** Misc private data */
void *data;
/** True if user supplied coords */
Bool user_supplied_x;
Bool user_supplied_y;
/** area_t */
area_t area;
/** Buttons bindings */
Button *buttons;
/** Cache */
struct
{
Bool needs_update;
int flags;
} cache;
/** Next and previous widgets */
Widget *prev, *next;
};
/** Status bar */
struct Statusbar
{
/** Window */
SimpleWindow *sw;
/** Statusbar name */
char *name;
/** Bar width */
int width;
/** Bar height */
int height;
/** Default position */
Position dposition;
/** Bar position */
Position position;
/** Screen */
int screen;
/** Physical screen id */
int phys_screen;
/** Widget list */
Widget *widgets;
/** Draw context */
DrawCtx *ctx;
/** Next and previous statusbars */
Statusbar *prev, *next;
};
/** Client type */
typedef struct Client Client;
struct Client
{
/** Client name */
char name[256];
/** Window geometry */
area_t geometry;
/** Floating window geometry */
area_t f_geometry;
/** Max window geometry */
area_t m_geometry;
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int minax, maxax, minay, maxay;
int border, oldborder;
/** Has urgency hint */
Bool isurgent;
/** Store previous floating state before maximizing */
Bool wasfloating;
/** True if the window is floating */
Bool isfloating;
/** True if the window is fixed */
Bool isfixed;
/** True if the window is maximized */
Bool ismax;
/** True if the client must be skipped from client list */
Bool skip;
/** True if the client is moving */
Bool ismoving;
/** True if the client must be skipped from task bar client list */
Bool skiptb;
/** Next and previous clients */
Client *prev, *next;
/** Window of the client */
Window win;
/** Client logical screen */
int screen;
/** Client physical screen */
int phys_screen;
/** True if the client is a new one */
Bool newcomer;
/** Titlebar */
Titlebar titlebar;
};
typedef struct client_node_t client_node_t;
struct client_node_t
{
Client *client;
/** Next and previous client_nodes */
client_node_t *prev, *next;
};
/** Tag type */
typedef struct Tag Tag;
struct Tag
{
/** Tag name */
char *name;
/** Screen */
int screen;
/** True if selected */
Bool selected;
/** True if was selected before selecting others tags */
Bool was_selected;
/** Current tag layout */
Layout *layout;
/** Master width factor */
double mwfact;
/** Number of master windows */
int nmaster;
/** Number of columns in tile layout */
int ncol;
/** Next and previous tags */
Tag *prev, *next;
};
/** tag_client_node type */
typedef struct tag_client_node_t tag_client_node_t;
struct tag_client_node_t
{
Tag *tag;
Client *client;
/** Next and previous tag_client_nodes */
tag_client_node_t *prev, *next;
};
/** Padding type */
typedef struct
{
/** Padding at top */
int top;
/** Padding at bottom */
int bottom;
/** Padding at left */
int left;
/** Padding at right */
int right;
} Padding;
typedef area_t (FloatingPlacement)(Client *);
typedef struct
{
/** Titlebar default parameters */
Titlebar titlebar_default;
/** Number of pixels to snap windows */
int snap;
/** Border size */
int borderpx;
/** Mwfact limits */
float mwfact_upper_limit, mwfact_lower_limit;
/** Floating window placement algo */
FloatingPlacement *floating_placement;
/** Respect resize hints */
Bool resize_hints;
/** Sloppy focus: focus follow mouse */
Bool sloppy_focus;
/** True if we should raise windows on focus */
Bool sloppy_focus_raise;
/** Focus new clients */
Bool new_get_focus;
/** True if new clients should become master */
Bool new_become_master;
/** True if we need to arrange() */
Bool need_arrange;
/** Colors */
struct
{
style_t normal;
style_t focus;
style_t urgent;
} styles;
/** Transparency of unfocused clients */
double opacity_unfocused;
/** Transparency of focused clients */
double opacity_focused;
/** Tag list */
Tag *tags;
/** Layout list */
Layout *layouts;
/** Status bar */
Statusbar *statusbar;
/** Padding */
Padding padding;
} VirtScreen;
/** Main configuration structure */
typedef struct AwesomeConf AwesomeConf;
struct AwesomeConf
{
/** Display ref */
Display *display;
/** Logical screens */
VirtScreen *screens;
/** Screens info */
ScreensInfo *screens_info;
/** Rules list */
Rule *rules;
/** Keys bindings list */
Key *keys;
/** Mouse bindings list */
struct
{
Button *root;
Button *client;
Button *titlebar;
} buttons;
/** Numlock mask */
unsigned int numlockmask;
/** Check for XShape extension */
Bool have_shape;
/** Check for XRandR extension */
Bool have_randr;
/** Cursors */
Cursor cursor[CurLast];
/** Clients list */
Client *clients;
/** Scratch client */
struct
{
Client *client;
Bool isvisible;
} scratch;
/** Path to config file */
char *configpath;
/** Selected clients history */
client_node_t *focus;
/** Link between tags and clients */
tag_client_node_t *tclink;
/** Command line passed to awesome */
char *argv;
/** Last XMotionEvent coords */
int pointer_x, pointer_y;
};
#endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80