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 "keybinding.h"
32 #include "common/xutil.h"
33 #include "common/xembed.h"
34 #include "common/refcount.h"
39 WINDOW_TYPE_NORMAL
= 0,
49 WIBOX_TYPE_NORMAL
= 0,
56 CurNormal
, CurResize
, CurResizeH
, CurResizeV
, CurMove
,
57 CurTopLeft
, CurTopRight
, CurBotLeft
, CurBotRight
, CurLast
60 typedef struct button_t button_t
;
61 typedef struct widget_t widget_t
;
62 typedef struct widget_node_t widget_node_t
;
63 typedef struct client_t client_t
;
64 typedef struct client_node client_node_t
;
65 typedef struct tag tag_t
;
66 typedef struct tag_client_node_t tag_client_node_t
;
67 typedef widget_t
*(widget_constructor_t
)(alignment_t
);
68 typedef void (widget_destructor_t
)(widget_t
*);
69 typedef struct awesome_t awesome_t
;
71 ARRAY_TYPE(widget_node_t
, widget_node
)
72 ARRAY_TYPE(button_t
*, button
)
94 widget_node_array_t widgets
;
95 luaA_ref widgets_table
;
96 /** Widget the mouse is over */
101 ARRAY_TYPE(wibox_t
*, wibox
)
110 /** Widget type is constructor */
111 widget_constructor_t
*type
;
112 /** Widget destructor */
113 widget_destructor_t
*destructor
;
114 /** Geometry function */
115 area_t (*geometry
)(widget_t
*, int, int, int);
117 void (*draw
)(widget_t
*, draw_context_t
*, area_t
, int, wibox_t
*);
118 /** Index function */
119 int (*index
)(lua_State
*, awesome_token_t
);
120 /** Newindex function */
121 int (*newindex
)(lua_State
*, awesome_token_t
);
122 /** Button event handler */
123 void (*button
)(widget_node_t
*, xcb_button_press_event_t
*, int, wibox_t
*);
124 /** Mouse over event handler */
125 luaA_ref mouse_enter
, mouse_leave
;
128 /** Supported alignment */
129 alignment_t align_supported
;
130 /** Misc private data */
132 /** Button bindings */
133 button_array_t buttons
;
136 /** True if the widget is visible */
143 uint16_t left
, right
, top
, bottom
;
144 uint16_t left_start_y
, left_end_y
;
145 uint16_t right_start_y
, right_end_y
;
146 uint16_t top_start_x
, top_end_x
;
147 uint16_t bottom_start_x
, bottom_end_x
;
155 /** Valid, or not ? */
158 char *name
, *icon_name
;
159 /** Window geometry */
161 /** Floating window geometry */
163 /** Max window geometry */
166 int basew
, baseh
, incw
, inch
, maxw
, maxh
, minw
, minh
;
167 int minax
, maxax
, minay
, maxay
;
171 /** Respect resize hints */
173 int border
, oldborder
;
174 xcolor_t border_color
;
175 /** True if the client is sticky */
177 /** Has urgency hint */
179 /** true if the window is floating */
181 /** true if the client is moving */
183 /** True if the client is hidden */
185 /** True if the client is minimized */
187 /** True if the client is fullscreen */
189 /** True if the client is above others */
191 /** True if the client is below others */
193 /** True if the client is modal */
195 /** True if the client is on top */
197 /** true if the client must be skipped from task bar client list */
199 /** True if the client cannot have focus */
201 /** The window type */
203 /** Window of the client */
205 /** Client logical screen */
207 /** Client physical screen */
209 /** Path to an icon */
213 /** Button bindings */
214 button_array_t buttons
;
218 xcb_size_hints_t size_hints
;
219 /** Window it is transient for */
220 client_t
*transient_for
;
221 /** Next and previous clients */
222 client_t
*prev
, *next
;
224 ARRAY_TYPE(client_t
*, client
)
235 /** true if selected */
237 /** Current tag layout */
239 /** Master width factor */
241 /** Number of master windows */
243 /** Number of columns in tile layout */
245 /** clients in this tag */
246 client_array_t clients
;
248 ARRAY_TYPE(tag_t
*, tag
)
253 /** Padding at top */
255 /** Padding at bottom */
257 /** Padding at left */
259 /** Padding at right */
267 /** Screen geometry */
269 /** true if we need to arrange() */
274 wibox_array_t wiboxes
;
277 /** Window that contains the systray */
281 /** Systray window parent */
284 /** Focused client */
285 client_t
*client_focus
;
288 /** Main configuration structure */
291 /** Connection ref */
292 xcb_connection_t
*connection
;
293 /** Event and error handlers */
294 xcb_event_handlers_t evenths
;
295 /** Property change handler */
296 xcb_property_handlers_t prophs
;
297 /** Default screen number */
299 /** Keys symbol table */
300 xcb_key_symbols_t
*keysyms
;
301 /** Logical screens */
303 /** Number of screens */
305 /** True if xinerama is active */
306 bool xinerama_is_active
;
310 keybinding_array_t by_code
;
311 keybinding_array_t by_sym
;
313 /** Mouse bindings list */
314 button_array_t buttons
;
316 unsigned int numlockmask
;
318 unsigned int shiftlockmask
;
320 unsigned int capslockmask
;
321 /** Check for XRandR extension */
324 xcb_cursor_t cursor
[CurLast
];
327 /** Embedded windows */
328 xembed_window_t
*embedded
;
329 /** Path to config file */
331 /** Stack client history */
332 client_node_t
*stack
;
333 /** Command line passed to awesome */
335 /** Last XMotionEvent coords */
336 int pointer_x
, pointer_y
;
339 /** Default colors */
348 /** Command to execute when spawning a new client */
350 /** Command to execute when unmanaging client */
352 /** Command to execute when giving focus to a client */
354 /** Command to execute when removing focus to a client */
356 /** Command to run when mouse enter a client */
357 luaA_ref mouse_enter
;
358 /** Command to run on arrange */
360 /** Command to run when client list changes */
362 /** Command to run on numbers of tag changes */
364 /** Command to run when client gets (un)tagged */
366 /** Command to run on property change */
368 /** Command to run on time */
371 /** The event loop */
372 struct ev_loop
*loop
;
373 /** The timeout after which we need to stop select() */
374 struct ev_timer timer
;
375 /** The key grabber function */
377 /** Focused screen */
378 screen_t
*screen_focus
;
382 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80