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>
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.
51 /* This ones are usually set on override-redirect windows. */
52 WINDOW_TYPE_DROPDOWN_MENU
,
53 WINDOW_TYPE_POPUP_MENU
,
55 WINDOW_TYPE_NOTIFICATION
,
63 WIBOX_TYPE_NORMAL
= 0,
67 typedef struct button_t button_t
;
68 typedef struct widget_t widget_t
;
69 typedef struct widget_node_t widget_node_t
;
70 typedef struct client_t client_t
;
71 typedef struct client_node client_node_t
;
72 typedef struct tag tag_t
;
73 typedef struct tag_client_node_t tag_client_node_t
;
74 typedef widget_t
*(widget_constructor_t
)(widget_t
*);
75 typedef void (widget_destructor_t
)(widget_t
*);
76 typedef struct awesome_t awesome_t
;
78 ARRAY_TYPE(widget_node_t
, widget_node
)
79 ARRAY_TYPE(button_t
*, button
)
101 widget_node_array_t widgets
;
102 luaA_ref widgets_table
;
103 /** Widget the mouse is over */
104 widget_t
*mouse_over
;
105 /** Mouse over event handler */
106 luaA_ref mouse_enter
, mouse_leave
;
111 /** Background image */
113 /* Banned? used for titlebars */
115 /** Button bindings */
116 button_array_t buttons
;
118 ARRAY_TYPE(wibox_t
*, wibox
)
125 /** Widget type is constructor */
126 widget_constructor_t
*type
;
127 /** Widget destructor */
128 widget_destructor_t
*destructor
;
129 /** Geometry function */
130 area_t (*geometry
)(widget_t
*, int, int, int);
132 void (*draw
)(widget_t
*, draw_context_t
*, area_t
, int, wibox_t
*);
133 /** Index function */
134 int (*index
)(lua_State
*, awesome_token_t
);
135 /** Newindex function */
136 int (*newindex
)(lua_State
*, awesome_token_t
);
137 /** Mouse over event handler */
138 luaA_ref mouse_enter
, mouse_leave
;
141 /** Supported alignment */
142 alignment_t align_supported
;
143 /** Misc private data */
145 /** Button bindings */
146 button_array_t buttons
;
147 /** True if the widget is visible */
154 uint16_t left
, right
, top
, bottom
;
155 uint16_t left_start_y
, left_end_y
;
156 uint16_t right_start_y
, right_end_y
;
157 uint16_t top_start_x
, top_end_x
;
158 uint16_t bottom_start_x
, bottom_end_x
;
166 /** Valid, or not ? */
169 char *name
, *icon_name
;
170 /** WM_CLASS stuff */
171 char *class, *instance
;
172 /** Window geometry */
176 /** Client geometry when (un)fullscreen */
178 /** Client geometry when (un)-max */
180 /** Internal geometry (matching X11 protocol) */
185 /** Ignore strut temporarily. */
187 /** Border width and pre-fullscreen border width */
188 int border
, border_fs
;
189 xcolor_t border_color
;
190 /** True if the client is sticky */
192 /** Has urgency hint */
194 /** True if the client is hidden */
196 /** True if the client is minimized */
198 /** True if the client is fullscreen */
200 /** True if the client is maximized horizontally */
202 /** True if the client is maximized vertically */
204 /** True if the client is above others */
206 /** True if the client is below others */
208 /** True if the client is modal */
210 /** True if the client is on top */
212 /** True if a client is banned to a position outside the viewport.
213 * Note that the geometry remains unchanged and that the window is still mapped.
216 /** true if the client must be skipped from task bar client list */
218 /** True if the client cannot have focus */
220 /** The window type */
222 /** Window of the client */
224 /** Window of the group leader */
225 xcb_window_t group_win
;
226 /** Window holding command needed to start it (session management related) */
227 xcb_window_t leader_win
;
228 /** Client logical screen */
230 /** Client physical screen */
234 /** Button bindings */
235 button_array_t buttons
;
241 xcb_size_hints_t size_hints
;
242 bool size_hints_honor
;
243 /** Window it is transient for */
244 client_t
*transient_for
;
245 /** Next and previous clients */
246 client_t
*prev
, *next
;
248 ARRAY_TYPE(client_t
*, client
)
259 /** true if selected */
261 /** clients in this tag */
262 client_array_t clients
;
264 ARRAY_TYPE(tag_t
*, tag
)
270 /** Screen geometry */
272 /** true if we need to arrange() */
277 wibox_array_t wiboxes
;
280 /** Window that contains the systray */
284 /** Systray window parent */
287 /** Focused client */
288 client_t
*client_focus
;
291 /** Main configuration structure */
294 /** Connection ref */
295 xcb_connection_t
*connection
;
296 /** Event and error handlers */
297 xcb_event_handlers_t evenths
;
298 /** Property change handler */
299 xcb_property_handlers_t prophs
;
300 /** Default screen number */
302 /** Keys symbol table */
303 xcb_key_symbols_t
*keysyms
;
304 /** Logical screens */
306 /** Number of screens */
308 /** True if xinerama is active */
309 bool xinerama_is_active
;
310 /** Root window key bindings */
312 /** Root window mouse bindings */
313 button_array_t buttons
;
315 unsigned int numlockmask
;
317 unsigned int shiftlockmask
;
319 unsigned int capslockmask
;
320 /** Check for XRandR extension */
322 /** Check for XTest extension */
326 /** Embedded windows */
327 xembed_window_array_t embedded
;
328 /** Path to config file */
330 /** Stack client history */
331 client_node_t
*stack
;
332 /** Command line passed to awesome */
336 /** Default colors */
345 /** Command to execute when spawning a new client */
347 /** Command to execute when unmanaging client */
349 /** Command to execute when giving focus to a client */
351 /** Command to execute when removing focus to a client */
353 /** Command to run when mouse enter a client */
354 luaA_ref mouse_enter
;
355 /** Command to run when mouse leave a client */
356 luaA_ref mouse_leave
;
357 /** Command to run on arrange */
359 /** Command to run when client list changes */
361 /** Command to run on numbers of tag changes */
363 /** Command to run when client gets (un)tagged */
365 /** Command to run on property change */
367 /** Command to run on time */
370 /** Command to run on dbus events */
374 /** The event loop */
375 struct ev_loop
*loop
;
376 /** The timeout after which we need to stop select() */
377 struct ev_timer timer
;
378 /** The key grabber function */
380 /** The mouse pointer grabber function */
381 luaA_ref mousegrabber
;
382 /** Focused screen */
383 screen_t
*screen_focus
;
384 /** Need to call client_stack_refresh() */
385 bool client_need_stack_refresh
;
388 DO_ARRAY(const void *, void, DO_NOTHING
)
390 extern awesome_t globalconf
;
393 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80