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_icccm.h>
26 #include <xcb/xcb_property.h>
31 #include "common/xutil.h"
32 #include "common/xembed.h"
33 #include "common/refcount.h"
38 WINDOW_TYPE_NORMAL
= 0,
48 WIBOX_TYPE_NORMAL
= 0,
55 CurNormal
, CurResize
, CurResizeH
, CurResizeV
, CurMove
,
56 CurTopLeft
, CurTopRight
, CurBotLeft
, CurBotRight
, CurLast
59 typedef struct button_t button_t
;
60 typedef struct widget_t widget_t
;
61 typedef struct widget_node_t widget_node_t
;
62 typedef struct client_t client_t
;
63 typedef struct client_node client_node_t
;
64 typedef struct tag tag_t
;
65 typedef struct tag_client_node_t tag_client_node_t
;
66 typedef widget_t
*(widget_constructor_t
)(alignment_t
);
67 typedef void (widget_destructor_t
)(widget_t
*);
68 typedef struct awesome_t awesome_t
;
70 ARRAY_TYPE(widget_node_t
, widget_node
)
71 ARRAY_TYPE(button_t
*, button
)
93 widget_node_array_t widgets
;
94 luaA_ref widgets_table
;
95 /** Widget the mouse is over */
100 ARRAY_TYPE(wibox_t
*, wibox
)
109 /** Widget type is constructor */
110 widget_constructor_t
*type
;
111 /** Widget destructor */
112 widget_destructor_t
*destructor
;
113 /** Geometry function */
114 area_t (*geometry
)(widget_t
*, int, int, int);
116 void (*draw
)(widget_t
*, draw_context_t
*, area_t
, int, wibox_t
*);
117 /** Index function */
118 int (*index
)(lua_State
*, awesome_token_t
);
119 /** Newindex function */
120 int (*newindex
)(lua_State
*, awesome_token_t
);
121 /** Button event handler */
122 void (*button
)(widget_node_t
*, xcb_button_press_event_t
*, int, wibox_t
*);
123 /** Mouse over event handler */
124 luaA_ref mouse_enter
, mouse_leave
;
127 /** Supported alignment */
128 alignment_t align_supported
;
129 /** Misc private data */
131 /** Button bindings */
132 button_array_t buttons
;
135 /** True if the widget is visible */
142 uint16_t left
, right
, top
, bottom
;
143 uint16_t left_start_y
, left_end_y
;
144 uint16_t right_start_y
, right_end_y
;
145 uint16_t top_start_x
, top_end_x
;
146 uint16_t bottom_start_x
, bottom_end_x
;
154 /** Valid, or not ? */
157 char *name
, *icon_name
;
158 /** Window geometry */
160 /** Floating window geometry */
162 /** Max window geometry */
165 int basew
, baseh
, incw
, inch
, maxw
, maxh
, minw
, minh
;
166 int minax
, maxax
, minay
, maxay
;
170 /** Respect resize hints */
172 int border
, oldborder
;
173 xcolor_t border_color
;
174 /** True if the client is sticky */
176 /** Has urgency hint */
178 /** true if the window is floating */
180 /** true if the client is moving */
182 /** True if the client is hidden */
184 /** True if the client is minimized */
186 /** True if the client is fullscreen */
188 /** True if the client is above others */
190 /** True if the client is below others */
192 /** True if the client is modal */
194 /** True if the client is on top */
196 /** true if the client must be skipped from task bar client list */
198 /** True if the client cannot have focus */
200 /** The window type */
202 /** Window of the client */
204 /** Client logical screen */
206 /** Client physical screen */
208 /** Path to an icon */
212 /** Button bindings */
213 button_array_t buttons
;
217 xcb_size_hints_t size_hints
;
218 /** Window it is transient for */
219 client_t
*transient_for
;
220 /** Next and previous clients */
221 client_t
*prev
, *next
;
223 ARRAY_TYPE(client_t
*, client
)
234 /** true if selected */
236 /** Current tag layout */
238 /** Master width factor */
240 /** Number of master windows */
242 /** Number of columns in tile layout */
244 /** clients in this tag */
245 client_array_t clients
;
247 ARRAY_TYPE(tag_t
*, tag
)
252 /** Padding at top */
254 /** Padding at bottom */
256 /** Padding at left */
258 /** Padding at right */
266 /** Screen geometry */
268 /** true if we need to arrange() */
273 wibox_array_t wiboxes
;
276 /** Window that contains the systray */
280 /** Systray window parent */
283 /** Focused client */
284 client_t
*client_focus
;
287 /** Main configuration structure */
290 /** Connection ref */
291 xcb_connection_t
*connection
;
292 /** Event and error handlers */
293 xcb_event_handlers_t evenths
;
294 /** Property change handler */
295 xcb_property_handlers_t prophs
;
296 /** Default screen number */
298 /** Keys symbol table */
299 xcb_key_symbols_t
*keysyms
;
300 /** Logical screens */
302 /** Number of screens */
304 /** True if xinerama is active */
305 bool xinerama_is_active
;
306 /** Mouse bindings list */
307 button_array_t buttons
;
309 unsigned int numlockmask
;
311 unsigned int shiftlockmask
;
313 unsigned int capslockmask
;
314 /** Check for XRandR extension */
317 xcb_cursor_t cursor
[CurLast
];
320 /** Embedded windows */
321 xembed_window_t
*embedded
;
322 /** Path to config file */
324 /** Stack client history */
325 client_node_t
*stack
;
326 /** Command line passed to awesome */
328 /** Last XMotionEvent coords */
329 int pointer_x
, pointer_y
;
332 /** Default colors */
341 /** Command to execute when spawning a new client */
343 /** Command to execute when unmanaging client */
345 /** Command to execute when giving focus to a client */
347 /** Command to execute when removing focus to a client */
349 /** Command to run when mouse enter a client */
350 luaA_ref mouse_enter
;
351 /** Command to run on arrange */
353 /** Command to run when client list changes */
355 /** Command to run on numbers of tag changes */
357 /** Command to run when client gets (un)tagged */
359 /** Command to run on property change */
361 /** Command to run on time */
364 /** The event loop */
365 struct ev_loop
*loop
;
366 /** The timeout after which we need to stop select() */
367 struct ev_timer timer
;
368 /** The key grabber function */
370 /** Focused screen */
371 screen_t
*screen_focus
;
375 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80