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