structs: rename to globalconf
[awesome.git] / globalconf.h
blob648ec89829ca4871b38d4350ba82a9a791dcf67f
1 /*
2 * globalconf.h - basic globalconf.header
4 * Copyright © 2007-2009 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_GLOBALCONF_H
23 #define AWESOME_GLOBALCONF_H
25 #define SN_API_NOT_YET_FROZEN
26 #include <libsn/sn.h>
28 #include <ev.h>
30 #include <xcb/xcb_icccm.h>
31 #include <xcb/xcb_keysyms.h>
33 #include "config.h"
34 #include "key.h"
35 #include "draw.h"
36 #include "common/xembed.h"
38 typedef struct wibox_t wibox_t;
39 typedef struct a_screen screen_t;
40 typedef struct button_t button_t;
41 typedef struct widget_t widget_t;
42 typedef struct client_t client_t;
43 typedef struct client_node client_node_t;
44 typedef struct tag tag_t;
45 typedef struct tag_client_node_t tag_client_node_t;
46 typedef struct awesome_t awesome_t;
48 ARRAY_TYPE(button_t *, button)
49 ARRAY_TYPE(tag_t *, tag)
50 ARRAY_TYPE(screen_t, screen)
51 ARRAY_TYPE(client_t *, client)
52 ARRAY_TYPE(wibox_t *, wibox)
54 /** Main configuration structure */
55 struct awesome_t
57 /** Connection ref */
58 xcb_connection_t *connection;
59 /** Event and error handlers */
60 xcb_event_handlers_t evenths;
61 /** Property change handler */
62 xcb_property_handlers_t prophs;
63 /** Default screen number */
64 int default_screen;
65 /** Keys symbol table */
66 xcb_key_symbols_t *keysyms;
67 /** Logical screens */
68 screen_array_t screens;
69 /** True if xinerama is active */
70 bool xinerama_is_active;
71 /** Root window key bindings */
72 key_array_t keys;
73 /** Root window mouse bindings */
74 button_array_t buttons;
75 /** Modifiers masks */
76 uint16_t numlockmask, shiftlockmask, capslockmask, modeswitchmask;
77 /** Check for XTest extension */
78 bool have_xtest;
79 /** Clients list */
80 client_array_t clients;
81 /** Embedded windows */
82 xembed_window_array_t embedded;
83 /** Path to config file */
84 char *conffile;
85 /** Stack client history */
86 client_array_t stack;
87 /** Command line passed to awesome */
88 char *argv;
89 /** Lua VM state */
90 lua_State *L;
91 /** Default colors */
92 struct
94 xcolor_t fg, bg;
95 } colors;
96 /** Default font */
97 font_t *font;
98 struct
100 /** Command to execute when spawning a new client */
101 int manage;
102 /** Command to execute when unmanaging client */
103 int unmanage;
104 /** Command to execute when giving focus to a client */
105 int focus;
106 /** Command to execute when removing focus to a client */
107 int unfocus;
108 /** Command to run when mouse enter a client */
109 int mouse_enter;
110 /** Command to run when mouse leave a client */
111 int mouse_leave;
112 /** Command to run when client list changes */
113 int clients;
114 /** Command to run on numbers of tag changes */
115 int tags;
116 /** Command to run when client gets (un)tagged */
117 int tagged;
118 /** Command to run on property change */
119 int property;
120 /** Command to run on time */
121 int timer;
122 /** Command to run on awesome exit */
123 int exit;
124 } hooks;
125 /** The event loop */
126 struct ev_loop *loop;
127 /** The timeout after which we need to stop select() */
128 struct ev_timer timer;
129 /** The key grabber function */
130 int keygrabber;
131 /** The mouse pointer grabber function */
132 int mousegrabber;
133 /** Focused screen */
134 screen_t *screen_focus;
135 /** Need to call client_stack_refresh() */
136 bool client_need_stack_refresh;
137 /** Wiboxes */
138 wibox_array_t wiboxes;
139 /** The startup notification display struct */
140 SnDisplay *sndisplay;
143 extern awesome_t globalconf;
145 #endif
146 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80