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"
30 /** Bar possible position */
40 /** Rules for floating rule */
50 { ColBorder
, ColFG
, ColBG
, ColLast
};
54 { CurNormal
, CurResize
, CurMove
, CurLast
};
57 typedef struct Rule Rule
;
73 typedef struct Key Key
;
83 /** Mouse buttons bindings */
84 typedef struct Button Button
;
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 */
150 /** Statusbar name */
156 /** Default position */
164 /** Next statusbar */
169 typedef struct Client Client
;
174 /** Window geometry */
176 /** Floating window geometry */
178 /** Max window geometry */
180 int basew
, baseh
, incw
, inch
, maxw
, maxh
, minw
, minh
;
181 int minax
, maxax
, minay
, maxay
;
182 int border
, oldborder
;
183 /** Has urgency hint */
185 /** Store previous floating state before maximizing */
187 /** True if the window is floating */
189 /** True if the window is fixed */
191 /** True if the window is maximized */
193 /** True if the client must be skipped from client list */
195 /** True if the client must be skipped from task bar client list */
199 /** Window of the client */
201 /** Client logical screen */
203 /** True if the client is a new one */
207 typedef struct client_node_t client_node_t
;
215 typedef struct Tag Tag
;
222 /** True if selected */
224 /** True if was selected before selecting others tags */
226 /** Current tag layout */
228 /** Master width factor */
230 /** Number of master windows */
232 /** Number of columns in tile layout */
238 /** tag_client_node type */
239 typedef struct tag_client_node_t tag_client_node_t
;
240 struct tag_client_node_t
244 tag_client_node_t
*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 /** Screen geometry */
265 /** Number of pixels to snap windows */
270 float mwfact_upper_limit
, mwfact_lower_limit
;
271 /** Floating window placement algo */
272 FloatingPlacement
*floating_placement
;
273 /** Respect resize hints */
275 /** Sloppy focus: focus follow mouse */
277 /** True if we should raise windows on focus */
278 Bool sloppy_focus_raise
;
279 /** Focus new clients */
281 /** True if new clients should become master */
282 Bool new_become_master
;
283 /** True if we need to arrange() */
286 XColor colors_normal
[ColLast
];
287 /** Selected colors */
288 XColor colors_selected
[ColLast
];
289 /** Urgency colors */
290 XColor colors_urgent
[ColLast
];
291 /** Transparency of unfocused clients */
292 int opacity_unfocused
;
298 Statusbar
*statusbar
;
303 /** Draw shadow under text */
307 /** Main configuration structure */
308 typedef struct AwesomeConf AwesomeConf
;
313 /** Logical screens */
315 /** Number of logical screens */
319 /** Keys bindings list */
321 /** Mouse bindings list */
328 unsigned int numlockmask
;
329 /** Check for XShape extension */
331 /** Check for XRandR extension */
334 Cursor cursor
[CurLast
];
337 /** Scratch client */
343 /** Path to config file */
345 /** Selected clients history */
346 client_node_t
*focus
;
347 /** Link between tags and clients */
348 tag_client_node_t
*tclink
;
349 /** Command line passed to awesome */
351 /** Last XMotionEvent coords */
352 int pointer_x
, pointer_y
;
356 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80