-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdat.h
162 lines (140 loc) · 4.11 KB
/
dat.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
/* Copyright (c) 1994-1996 David Hogan, see README for licence details */
#define true 1
#define false 0
#define BORDER _border
#define INSET _inset
#define MAXHIDDEN 32
#define B3FIXED 5
#define AllButtonMask (XCB_BUTTON_MASK_1|XCB_BUTTON_MASK_2 \
|XCB_BUTTON_MASK_3|XCB_BUTTON_MASK_4 \
|XCB_BUTTON_MASK_5)
#define ButtonMask (XCB_EVENT_MASK_BUTTON_PRESS \
|XCB_EVENT_MASK_BUTTON_RELEASE)
/*#define AllPointersMotion (XCB_EVENT_MASK_POINTER_MOTION|\
XCB_EVENT_MASK_POINTER_MOTION_HINT|\
XCB_EVENT_MASK_BUTTON_MOTION)
#define AllButtonsMotion (XCB_EVENT_MASK_BUTTON_1_MOTION|\
XCB_EVENT_MASK_BUTTON_2_MOTION|\
XCB_EVENT_MASK_BUTTON_3_MOTION|\
XCB_EVENT_MASK_BUTTON_4_MOTION|\
XCB_EVENT_MASK_BUTTON_5_MOTION)
#define AllMotion (AllPointersMotion|AllButtonsMotion)
#define MenuMask (ButtonMask|XCB_EVENT_MASK_BUTTON_MOTION \
|XCB_EVENT_MASK_EXPOSURE|AllMotion)*/
#define MenuMask (ButtonMask|XCB_EVENT_MASK_BUTTON_MOTION \
|XCB_EVENT_MASK_EXPOSURE)
#define MenuGrabMask (ButtonMask|XCB_EVENT_MASK_BUTTON_MOTION \
|XCB_EVENT_MASK_STRUCTURE_NOTIFY)
#ifdef Plan9
#define DEFSHELL "/bin/rc"
#else
#define DEFSHELL "/bin/sh"
#endif
typedef struct Client Client;
typedef struct Menu Menu;
typedef struct ScreenInfo ScreenInfo;
typedef struct TextItem TextItem;
struct Client {
xcb_window_t window;
xcb_window_t parent;
xcb_window_t trans;
Client *next;
Client *revert;
int x;
int y;
int dx;
int dy;
int border;
xcb_size_hints_t size;
int min_dx;
int min_dy;
int state;
int init;
int reparenting;
int is9term;
int hold;
int proto;
char *label;
char *instance;
char *class;
char *name;
char *iconname;
xcb_colormap_t cmap;
int ncmapwins;
xcb_window_t *cmapwins;
xcb_colormap_t *wmcmaps;
ScreenInfo *screen;
};
#define hidden(c) ((c)->state == XCB_ICCCM_WM_STATE_ICONIC)
#define withdrawn(c) ((c)->state == XCB_ICCCM_WM_STATE_WITHDRAWN)
#define normal(c) ((c)->state == XCB_ICCCM_WM_STATE_NORMAL)
/* c->proto */
#define Pdelete 1
#define Ptakefocus 2
struct Menu {
char **item;
char *(*gen)();
int lasthit;
};
struct ScreenInfo {
int num;
xcb_window_t root;
xcb_window_t menuwin;
xcb_colormap_t def_cmap;
xcb_gcontext_t gc;
uint32_t black;
uint32_t white;
int min_cmaps;
xcb_cursor_t target;
xcb_cursor_t sweep0;
xcb_cursor_t boxcurs;
xcb_cursor_t arrow;
xcb_pixmap_t root_pixmap;
char display[256]; /* arbitrary limit */
};
struct TextItem
{
uint8_t nchars;
int8_t delta;
uint8_t text[];
};
/* main.c */
extern xcb_connection_t *dpy;
extern int dpy_fd;
extern ScreenInfo *screens;
extern int num_screens;
extern int initting;
extern xcb_font_t font;
extern xcb_query_font_reply_t *font_info;
extern int nostalgia;
extern char **myargv;
extern uint8_t shape;
extern char *termprog;
extern char *shell;
extern char *version[];
extern int _border;
extern int _inset;
extern int curtime;
extern int debug;
extern int signalled;
extern xcb_atom_t exit_9wm;
extern xcb_atom_t restart_9wm;
extern xcb_atom_t wm_state;
extern xcb_atom_t wm_change_state;
extern xcb_atom_t _9wm_hold_mode;
extern xcb_atom_t wm_protocols;
extern xcb_atom_t wm_delete;
extern xcb_atom_t wm_take_focus;
extern xcb_atom_t wm_colormaps;
/* xutils.c */
extern uint16_t max_char_width;
/* client.c */
extern Client *clients;
extern Client *current;
/* menu.c */
extern Client *hiddenc[];
extern int numhidden;
extern char *b3items[];
extern Menu b3menu;
/* error.c */
extern int ignore_badwindow;