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 must be skipped from task bar client list */
195 /** Next and previous clients */
197 /** Window of the client */
199 /** Client logical screen */
201 /** True if the client is a new one */
207 typedef struct client_node_t client_node_t
;
211 /** Next and previous client_nodes */
212 client_node_t
*prev
, *next
;
216 typedef struct Tag Tag
;
223 /** True if selected */
225 /** True if was selected before selecting others tags */
227 /** Current tag layout */
229 /** Master width factor */
231 /** Number of master windows */
233 /** Number of columns in tile layout */
235 /** Next and previous tags */
239 /** tag_client_node type */
240 typedef struct tag_client_node_t tag_client_node_t
;
241 struct tag_client_node_t
245 /** Next and previous tag_client_nodes */
246 tag_client_node_t
*prev
, *next
;
252 /** Padding at top */
254 /** Padding at bottom */
256 /** Padding at left */
258 /** Padding at right */
262 typedef area_t (FloatingPlacement
)(area_t
, int, int);
265 /** Titlebar default parameters */
266 Titlebar titlebar_default
;
267 /** Number of pixels to snap windows */
272 float mwfact_upper_limit
, mwfact_lower_limit
;
273 /** Floating window placement algo */
274 FloatingPlacement
*floating_placement
;
275 /** Respect resize hints */
277 /** Sloppy focus: focus follow mouse */
279 /** True if we should raise windows on focus */
280 Bool sloppy_focus_raise
;
281 /** Focus new clients */
283 /** True if new clients should become master */
284 Bool new_become_master
;
285 /** True if we need to arrange() */
294 /** Transparency of unfocused clients */
295 int opacity_unfocused
;
301 Statusbar
*statusbar
;
306 /** Main configuration structure */
307 typedef struct AwesomeConf AwesomeConf
;
312 /** Logical screens */
315 ScreensInfo
*screens_info
;
318 /** Keys bindings list */
320 /** Mouse bindings list */
327 unsigned int numlockmask
;
328 /** Check for XShape extension */
330 /** Check for XRandR extension */
333 Cursor cursor
[CurLast
];
336 /** Scratch client */
342 /** Path to config file */
344 /** Selected clients history */
345 client_node_t
*focus
;
346 /** Link between tags and clients */
347 tag_client_node_t
*tclink
;
348 /** Command line passed to awesome */
350 /** Last XMotionEvent coords */
351 int pointer_x
, pointer_y
;
355 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80