2 * structs.h - basic structs header
4 * Copyright © 2007-2008 Julien Danjou <julien@danjou.info>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef AWESOME_STRUCTS_H
23 #define AWESOME_STRUCTS_H
25 #include <xcb/xcb_event.h>
26 #include <xcb/xcb_icccm.h>
27 #include <xcb/xcb_property.h>
34 #include "common/xutil.h"
35 #include "common/xembed.h"
36 #include "common/refcount.h"
41 WINDOW_TYPE_NORMAL
= 0,
51 WIBOX_TYPE_NORMAL
= 0,
58 CurNormal
, CurResize
, CurResizeH
, CurResizeV
, CurMove
,
59 CurTopLeft
, CurTopRight
, CurBotLeft
, CurBotRight
, CurLast
62 typedef struct button_t button_t
;
63 typedef struct widget_t widget_t
;
64 typedef struct widget_node_t widget_node_t
;
65 typedef struct client_t client_t
;
66 typedef struct client_node client_node_t
;
67 typedef struct tag tag_t
;
68 typedef struct tag_client_node_t tag_client_node_t
;
69 typedef widget_t
*(widget_constructor_t
)(alignment_t
);
70 typedef void (widget_destructor_t
)(widget_t
*);
71 typedef struct awesome_t awesome_t
;
73 ARRAY_TYPE(widget_node_t
, widget_node
)
74 ARRAY_TYPE(button_t
*, button
)
96 widget_node_array_t widgets
;
97 luaA_ref widgets_table
;
98 /** Widget the mouse is over */
103 ARRAY_TYPE(wibox_t
*, wibox
)
112 /** Widget type is constructor */
113 widget_constructor_t
*type
;
114 /** Widget destructor */
115 widget_destructor_t
*destructor
;
116 /** Geometry function */
117 area_t (*geometry
)(widget_t
*, int, int, int);
119 void (*draw
)(widget_t
*, draw_context_t
*, area_t
, int, wibox_t
*);
120 /** Index function */
121 int (*index
)(lua_State
*, awesome_token_t
);
122 /** Newindex function */
123 int (*newindex
)(lua_State
*, awesome_token_t
);
124 /** Button event handler */
125 void (*button
)(widget_node_t
*, xcb_button_press_event_t
*, int, wibox_t
*);
126 /** Mouse over event handler */
127 luaA_ref mouse_enter
, mouse_leave
;
130 /** Supported alignment */
131 alignment_t align_supported
;
132 /** Misc private data */
134 /** Button bindings */
135 button_array_t buttons
;
138 /** True if the widget is visible */
145 uint16_t left
, right
, top
, bottom
;
146 uint16_t left_start_y
, left_end_y
;
147 uint16_t right_start_y
, right_end_y
;
148 uint16_t top_start_x
, top_end_x
;
149 uint16_t bottom_start_x
, bottom_end_x
;
157 /** Valid, or not ? */
160 char *name
, *icon_name
;
161 /** Window geometry */
163 /** Floating window geometry */
165 /** Max window geometry */
168 int basew
, baseh
, incw
, inch
, maxw
, maxh
, minw
, minh
;
169 int minax
, maxax
, minay
, maxay
;
173 /** Respect resize hints */
175 int border
, oldborder
;
176 xcolor_t border_color
;
177 /** True if the client is sticky */
179 /** Has urgency hint */
181 /** true if the window is floating */
183 /** true if the client is moving */
185 /** True if the client is hidden */
187 /** True if the client is minimized */
189 /** True if the client is fullscreen */
191 /** True if the client is above others */
193 /** True if the client is below others */
195 /** True if the client is modal */
197 /** True if the client is on top */
199 /** true if the client must be skipped from task bar client list */
201 /** True if the client cannot have focus */
203 /** The window type */
205 /** Window of the client */
207 /** Client logical screen */
209 /** Client physical screen */
211 /** Path to an icon */
215 /** Button bindings */
216 button_array_t buttons
;
220 xcb_size_hints_t size_hints
;
221 /** Window it is transient for */
222 client_t
*transient_for
;
223 /** Next and previous clients */
224 client_t
*prev
, *next
;
226 ARRAY_TYPE(client_t
*, client
)
237 /** true if selected */
239 /** Current tag layout */
241 /** Master width factor */
243 /** Number of master windows */
245 /** Number of columns in tile layout */
247 /** clients in this tag */
248 client_array_t clients
;
250 ARRAY_TYPE(tag_t
*, tag
)
255 /** Padding at top */
257 /** Padding at bottom */
259 /** Padding at left */
261 /** Padding at right */
269 /** Screen geometry */
271 /** true if we need to arrange() */
276 wibox_array_t wiboxes
;
279 /** Window that contains the systray */
283 /** Systray window parent */
286 /** Focused client */
287 client_t
*client_focus
;
290 /** Main configuration structure */
293 /** Connection ref */
294 xcb_connection_t
*connection
;
295 /** Event and error handlers */
296 xcb_event_handlers_t evenths
;
297 /** Property change handler */
298 xcb_property_handlers_t prophs
;
299 /** Default screen number */
301 /** Keys symbol table */
302 xcb_key_symbols_t
*keysyms
;
303 /** Logical screens */
305 /** Number of screens */
307 /** True if xinerama is active */
308 bool xinerama_is_active
;
309 /** Mouse bindings list */
310 button_array_t buttons
;
312 unsigned int numlockmask
;
314 unsigned int shiftlockmask
;
316 unsigned int capslockmask
;
317 /** Check for XRandR extension */
320 xcb_cursor_t cursor
[CurLast
];
323 /** Embedded windows */
324 xembed_window_t
*embedded
;
325 /** Path to config file */
327 /** Stack client history */
328 client_node_t
*stack
;
329 /** Command line passed to awesome */
331 /** Last XMotionEvent coords */
332 int pointer_x
, pointer_y
;
335 /** Default colors */
344 /** Command to execute when spawning a new client */
346 /** Command to execute when unmanaging client */
348 /** Command to execute when giving focus to a client */
350 /** Command to execute when removing focus to a client */
352 /** Command to run when mouse enter a client */
353 luaA_ref mouse_enter
;
354 /** Command to run on arrange */
356 /** Command to run when client list changes */
358 /** Command to run on numbers of tag changes */
360 /** Command to run when client gets (un)tagged */
362 /** Command to run on property change */
364 /** Command to run on time */
367 /** The event loop */
368 struct ev_loop
*loop
;
369 /** The timeout after which we need to stop select() */
370 struct ev_timer timer
;
371 /** The key grabber function */
373 /** Focused screen */
374 screen_t
*screen_focus
;
378 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80