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 /** Bar possible position */
41 /** Rules for floating rule */
51 { CurNormal
, CurResize
, CurMove
, CurLast
};
54 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 */
205 typedef struct client_node_t client_node_t
;
209 /** Next and previous client_nodes */
210 client_node_t
*prev
, *next
;
214 typedef struct Tag Tag
;
221 /** True if selected */
223 /** True if was selected before selecting others tags */
225 /** Current tag layout */
227 /** Master width factor */
229 /** Number of master windows */
231 /** Number of columns in tile layout */
233 /** Next and previous tags */
237 /** tag_client_node type */
238 typedef struct tag_client_node_t tag_client_node_t
;
239 struct tag_client_node_t
243 /** Next and previous tag_client_nodes */
244 tag_client_node_t
*prev
, *next
;
250 /** Padding at top */
252 /** Padding at bottom */
254 /** Padding at left */
256 /** Padding at right */
260 typedef Area (FloatingPlacement
)(Area
, int, int);
263 /** Number of pixels to snap windows */
268 float mwfact_upper_limit
, mwfact_lower_limit
;
269 /** Floating window placement algo */
270 FloatingPlacement
*floating_placement
;
271 /** Respect resize hints */
273 /** Sloppy focus: focus follow mouse */
275 /** True if we should raise windows on focus */
276 Bool sloppy_focus_raise
;
277 /** Focus new clients */
279 /** True if new clients should become master */
280 Bool new_become_master
;
281 /** True if we need to arrange() */
290 /** Transparency of unfocused clients */
291 int opacity_unfocused
;
297 Statusbar
*statusbar
;
302 /** Main configuration structure */
303 typedef struct AwesomeConf AwesomeConf
;
308 /** Logical screens */
311 ScreensInfo
*screens_info
;
314 /** Keys bindings list */
316 /** Mouse bindings list */
323 unsigned int numlockmask
;
324 /** Check for XShape extension */
326 /** Check for XRandR extension */
329 Cursor cursor
[CurLast
];
332 /** Scratch client */
338 /** Path to config file */
340 /** Selected clients history */
341 client_node_t
*focus
;
342 /** Link between tags and clients */
343 tag_client_node_t
*tclink
;
344 /** Command line passed to awesome */
346 /** Last XMotionEvent coords */
347 int pointer_x
, pointer_y
;
351 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80