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"
35 #include "common/tokenize.h"
40 WINDOW_TYPE_NORMAL
= 0,
45 /* The ones below may have TRANSIENT_FOR, but are not plain dialogs.
46 * They were purposefully placed below DIALOG.
56 WIBOX_TYPE_NORMAL
= 0,
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
)(widget_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 */
103 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 /** Mouse over event handler */
123 luaA_ref mouse_enter
, mouse_leave
;
126 /** Supported alignment */
127 alignment_t align_supported
;
128 /** Misc private data */
130 /** Button bindings */
131 button_array_t buttons
;
132 /** True if the widget is visible */
139 uint16_t left
, right
, top
, bottom
;
140 uint16_t left_start_y
, left_end_y
;
141 uint16_t right_start_y
, right_end_y
;
142 uint16_t top_start_x
, top_end_x
;
143 uint16_t bottom_start_x
, bottom_end_x
;
151 /** Valid, or not ? */
154 char *name
, *icon_name
;
155 /** Window geometry */
159 /** Client geometry when (un)fullscreen */
161 /** Client geometry when (un)-max */
165 int basew
, baseh
, incw
, inch
, maxw
, maxh
, minw
, minh
;
166 int minax
, maxax
, minay
, maxay
;
169 /** Respect resize hints */
171 int border
, oldborder
;
172 xcolor_t border_color
;
173 /** True if the client is sticky */
175 /** Has urgency hint */
177 /** True if the client is hidden */
179 /** True if the client is minimized */
181 /** True if the client is fullscreen */
183 /** True if the client is maximized horizontally */
185 /** True if the client is maximized vertically */
187 /** True if the client is above others */
189 /** True if the client is below others */
191 /** True if the client is modal */
193 /** True if the client is on top */
195 /** True if a client is banned to a position outside the viewport.
196 * Note that the geometry remains unchanged and that the window is still mapped.
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 /** Window of the group leader */
208 xcb_window_t group_win
;
209 /** Window holding command needed to start it (session management related) */
210 xcb_window_t leader_win
;
211 /** Client logical screen */
213 /** Client physical screen */
215 /** Path to an icon */
219 /** Button bindings */
220 button_array_t buttons
;
224 xcb_size_hints_t size_hints
;
225 /** Window it is transient for */
226 client_t
*transient_for
;
227 /** Next and previous clients */
228 client_t
*prev
, *next
;
230 ARRAY_TYPE(client_t
*, client
)
241 /** true if selected */
243 /** clients in this tag */
244 client_array_t clients
;
246 ARRAY_TYPE(tag_t
*, tag
)
252 /** Screen geometry */
254 /** true if we need to arrange() */
259 wibox_array_t wiboxes
;
262 /** Window that contains the systray */
266 /** Systray window parent */
269 /** Focused client */
270 client_t
*client_focus
;
273 /** Main configuration structure */
276 /** Connection ref */
277 xcb_connection_t
*connection
;
278 /** Event and error handlers */
279 xcb_event_handlers_t evenths
;
280 /** Property change handler */
281 xcb_property_handlers_t prophs
;
282 /** Default screen number */
284 /** Keys symbol table */
285 xcb_key_symbols_t
*keysyms
;
286 /** Logical screens */
288 /** Number of screens */
290 /** True if xinerama is active */
291 bool xinerama_is_active
;
295 keybinding_array_t by_code
;
296 keybinding_array_t by_sym
;
298 /** Mouse bindings list */
299 button_array_t buttons
;
301 unsigned int numlockmask
;
303 unsigned int shiftlockmask
;
305 unsigned int capslockmask
;
306 /** Check for XRandR extension */
310 /** Embedded windows */
311 xembed_window_array_t embedded
;
312 /** Path to config file */
314 /** Stack client history */
315 client_node_t
*stack
;
316 /** Command line passed to awesome */
318 /** Last XMotionEvent coords */
319 int pointer_x
, pointer_y
;
322 /** Default colors */
331 /** Command to execute when spawning a new client */
333 /** Command to execute when unmanaging client */
335 /** Command to execute when giving focus to a client */
337 /** Command to execute when removing focus to a client */
339 /** Command to run when mouse enter a client */
340 luaA_ref mouse_enter
;
341 /** Command to run when mouse leave a client */
342 luaA_ref mouse_leave
;
343 /** Command to run on arrange */
345 /** Command to run when client list changes */
347 /** Command to run on numbers of tag changes */
349 /** Command to run when client gets (un)tagged */
351 /** Command to run on property change */
353 /** Command to run on time */
356 /** Command to run on dbus events */
360 /** The event loop */
361 struct ev_loop
*loop
;
362 /** The timeout after which we need to stop select() */
363 struct ev_timer timer
;
364 /** The key grabber function */
366 /** The mouse pointer grabber function */
367 luaA_ref mousegrabber
;
368 /** Focused screen */
369 screen_t
*screen_focus
;
373 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80