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
};
53 typedef struct Rule Rule
;
66 /** Next and previous rules */
71 typedef struct Key Key
;
78 /** Next and previous keys */
82 /** Mouse buttons bindings */
83 typedef struct Button Button
;
90 /** Next and previous buttons */
94 /** Widget tell status code */
101 WIDGET_ERROR_FORMAT_BOOL
,
102 WIDGET_ERROR_FORMAT_FONT
,
103 WIDGET_ERROR_FORMAT_COLOR
,
104 WIDGET_ERROR_FORMAT_SECTION
105 } widget_tell_status_t
;
108 typedef struct Widget Widget
;
109 typedef struct Statusbar Statusbar
;
115 int (*draw
)(Widget
*, DrawCtx
*, int, int);
116 /** Update function */
117 widget_tell_status_t (*tell
)(Widget
*, char *, char *);
118 /** ButtonPressedEvent handler */
119 void (*button_press
)(Widget
*, XButtonPressedEvent
*);
121 Statusbar
*statusbar
;
124 /** Misc private data */
126 /** True if user supplied coords */
127 Bool user_supplied_x
;
128 Bool user_supplied_y
;
131 /** Buttons bindings */
139 /** Next and previous widgets */
148 /** Statusbar name */
154 /** Default position */
162 /** Next and previous statusbars */
163 Statusbar
*prev
, *next
;
167 typedef struct Client Client
;
172 /** Window geometry */
174 /** Floating window geometry */
176 /** Max window geometry */
178 int basew
, baseh
, incw
, inch
, maxw
, maxh
, minw
, minh
;
179 int minax
, maxax
, minay
, maxay
;
180 int border
, oldborder
;
181 /** Has urgency hint */
183 /** Store previous floating state before maximizing */
185 /** True if the window is floating */
187 /** True if the window is fixed */
189 /** True if the window is maximized */
191 /** True if the client must be skipped from client list */
193 /** True if the client is moving */
195 /** True if the client must be skipped from task bar client list */
197 /** Next and previous clients */
199 /** Window of the client */
201 /** Client logical screen */
203 /** True if the client is a new one */
209 typedef struct client_node_t client_node_t
;
213 /** Next and previous client_nodes */
214 client_node_t
*prev
, *next
;
218 typedef struct Tag Tag
;
225 /** True if selected */
227 /** True if was selected before selecting others tags */
229 /** Current tag layout */
231 /** Master width factor */
233 /** Number of master windows */
235 /** Number of columns in tile layout */
237 /** Next and previous tags */
241 /** tag_client_node type */
242 typedef struct tag_client_node_t tag_client_node_t
;
243 struct tag_client_node_t
247 /** Next and previous tag_client_nodes */
248 tag_client_node_t
*prev
, *next
;
254 /** Padding at top */
256 /** Padding at bottom */
258 /** Padding at left */
260 /** Padding at right */
264 typedef area_t (FloatingPlacement
)(area_t
, int, int);
267 /** Titlebar default parameters */
268 Titlebar titlebar_default
;
269 /** Number of pixels to snap windows */
274 float mwfact_upper_limit
, mwfact_lower_limit
;
275 /** Floating window placement algo */
276 FloatingPlacement
*floating_placement
;
277 /** Respect resize hints */
279 /** Sloppy focus: focus follow mouse */
281 /** True if we should raise windows on focus */
282 Bool sloppy_focus_raise
;
283 /** Focus new clients */
285 /** True if new clients should become master */
286 Bool new_become_master
;
287 /** True if we need to arrange() */
296 /** Transparency of unfocused clients */
297 int opacity_unfocused
;
303 Statusbar
*statusbar
;
308 /** Main configuration structure */
309 typedef struct AwesomeConf AwesomeConf
;
314 /** Logical screens */
317 ScreensInfo
*screens_info
;
320 /** Keys bindings list */
322 /** Mouse bindings list */
329 unsigned int numlockmask
;
330 /** Check for XShape extension */
332 /** Check for XRandR extension */
335 Cursor cursor
[CurLast
];
338 /** Scratch client */
344 /** Path to config file */
346 /** Selected clients history */
347 client_node_t
*focus
;
348 /** Link between tags and clients */
349 tag_client_node_t
*tclink
;
350 /** Command line passed to awesome */
352 /** Last XMotionEvent coords */
353 int pointer_x
, pointer_y
;
357 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80