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
27 #include "common/draw.h"
28 #include "common/swindow.h"
29 #include "common/xscreen.h"
31 /** Rules for floating rule */
41 { CurNormal
, CurResize
, CurMove
, CurLast
};
61 typedef struct Rule Rule
;
74 /** Next and previous rules */
79 typedef struct Key Key
;
86 /** Next and previous keys */
90 /** Mouse buttons bindings */
91 typedef struct Button Button
;
98 /** Next and previous buttons */
102 /** Widget tell status code */
107 WIDGET_ERROR_NOVALUE
,
109 WIDGET_ERROR_FORMAT_BOOL
,
110 WIDGET_ERROR_FORMAT_FONT
,
111 WIDGET_ERROR_FORMAT_COLOR
,
112 WIDGET_ERROR_FORMAT_SECTION
113 } widget_tell_status_t
;
116 typedef struct Widget Widget
;
117 typedef struct Statusbar Statusbar
;
123 int (*draw
)(Widget
*, DrawCtx
*, int, int);
124 /** Update function */
125 widget_tell_status_t (*tell
)(Widget
*, char *, char *);
126 /** ButtonPressedEvent handler */
127 void (*button_press
)(Widget
*, XButtonPressedEvent
*);
129 Statusbar
*statusbar
;
132 /** Misc private data */
134 /** True if user supplied coords */
135 Bool user_supplied_x
;
136 Bool user_supplied_y
;
139 /** Buttons bindings */
147 /** Next and previous widgets */
156 /** Statusbar name */
162 /** Default position */
168 /** Physical screen id */
174 /** Next and previous statusbars */
175 Statusbar
*prev
, *next
;
179 typedef struct Client Client
;
184 /** Window geometry */
186 /** Floating window geometry */
188 /** Max window geometry */
190 int basew
, baseh
, incw
, inch
, maxw
, maxh
, minw
, minh
;
191 int minax
, maxax
, minay
, maxay
;
192 int border
, oldborder
;
193 /** Has urgency hint */
195 /** Store previous floating state before maximizing */
197 /** True if the window is floating */
199 /** True if the window is fixed */
201 /** True if the window is maximized */
203 /** True if the client must be skipped from client list */
205 /** True if the client is moving */
207 /** True if the client must be skipped from task bar client list */
209 /** Next and previous clients */
211 /** Window of the client */
213 /** Client logical screen */
215 /** Client physical screen */
217 /** True if the client is a new one */
223 typedef struct client_node_t client_node_t
;
227 /** Next and previous client_nodes */
228 client_node_t
*prev
, *next
;
232 typedef struct Tag Tag
;
239 /** True if selected */
241 /** True if was selected before selecting others tags */
243 /** Current tag layout */
245 /** Master width factor */
247 /** Number of master windows */
249 /** Number of columns in tile layout */
251 /** Next and previous tags */
255 /** tag_client_node type */
256 typedef struct tag_client_node_t tag_client_node_t
;
257 struct tag_client_node_t
261 /** Next and previous tag_client_nodes */
262 tag_client_node_t
*prev
, *next
;
268 /** Padding at top */
270 /** Padding at bottom */
272 /** Padding at left */
274 /** Padding at right */
278 typedef area_t (FloatingPlacement
)(Client
*);
281 /** Titlebar default parameters */
282 Titlebar titlebar_default
;
283 /** Number of pixels to snap windows */
288 float mwfact_upper_limit
, mwfact_lower_limit
;
289 /** Floating window placement algo */
290 FloatingPlacement
*floating_placement
;
291 /** Respect resize hints */
293 /** Sloppy focus: focus follow mouse */
295 /** True if we should raise windows on focus */
296 Bool sloppy_focus_raise
;
297 /** Focus new clients */
299 /** True if new clients should become master */
300 Bool new_become_master
;
301 /** True if we need to arrange() */
310 /** Transparency of unfocused clients */
311 double opacity_unfocused
;
312 /** Transparency of focused clients */
313 double opacity_focused
;
319 Statusbar
*statusbar
;
324 /** Main configuration structure */
325 typedef struct AwesomeConf AwesomeConf
;
330 /** Logical screens */
333 ScreensInfo
*screens_info
;
336 /** Keys bindings list */
338 /** Mouse bindings list */
346 unsigned int numlockmask
;
347 /** Check for XShape extension */
349 /** Check for XRandR extension */
352 Cursor cursor
[CurLast
];
355 /** Scratch client */
361 /** Path to config file */
363 /** Selected clients history */
364 client_node_t
*focus
;
365 /** Link between tags and clients */
366 tag_client_node_t
*tclink
;
367 /** Command line passed to awesome */
369 /** Last XMotionEvent coords */
370 int pointer_x
, pointer_y
;
374 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80