awful.client.toggletag: Use tag.getscreen()
[awesome.git] / globalconf.h
bloba10f9843f387a4f3c01b56d77ec7cbac6ed75f5f
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 "objects/key.h"
34 #include "color.h"
35 #include "common/xembed.h"
36 #include "common/buffer.h"
38 #define ROOT_WINDOW_EVENT_MASK \
39 (const uint32_t []) { \
40 XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY \
41 | XCB_EVENT_MASK_ENTER_WINDOW \
42 | XCB_EVENT_MASK_LEAVE_WINDOW \
43 | XCB_EVENT_MASK_STRUCTURE_NOTIFY \
44 | XCB_EVENT_MASK_BUTTON_PRESS \
45 | XCB_EVENT_MASK_BUTTON_RELEASE \
46 | XCB_EVENT_MASK_FOCUS_CHANGE \
47 | XCB_EVENT_MASK_PROPERTY_CHANGE \
50 typedef struct drawable_t drawable_t;
51 typedef struct drawin_t drawin_t;
52 typedef struct a_screen screen_t;
53 typedef struct button_t button_t;
54 typedef struct widget_t widget_t;
55 typedef struct client_t client_t;
56 typedef struct tag tag_t;
58 ARRAY_TYPE(button_t *, button)
59 ARRAY_TYPE(tag_t *, tag)
60 ARRAY_TYPE(screen_t, screen)
61 ARRAY_TYPE(client_t *, client)
62 ARRAY_TYPE(drawin_t *, drawin)
64 /** Main configuration structure */
65 typedef struct
67 /** Xlib Display */
68 Display * display;
69 /** Connection ref */
70 xcb_connection_t *connection;
71 /** Default screen number */
72 int default_screen;
73 /** Keys symbol table */
74 xcb_key_symbols_t *keysyms;
75 /** Logical screens */
76 screen_array_t screens;
77 /** Root window key bindings */
78 key_array_t keys;
79 /** Root window mouse bindings */
80 button_array_t buttons;
81 /** Modifiers masks */
82 uint16_t numlockmask, shiftlockmask, capslockmask, modeswitchmask;
83 /** Bitmask for currently pressed buttons */
84 uint32_t buttons_pressed;
85 /** Check for XTest extension */
86 bool have_xtest;
87 /** Clients list */
88 client_array_t clients;
89 /** Embedded windows */
90 xembed_window_array_t embedded;
91 /** Stack client history */
92 client_array_t stack;
93 /** Lua VM state */
94 lua_State *L;
95 /** All errors messages from loading config files */
96 buffer_t startup_errors;
97 /** The event loop */
98 struct ev_loop *loop;
99 /** The key grabber function */
100 int keygrabber;
101 /** The mouse pointer grabber function */
102 int mousegrabber;
103 /** Input focus information */
104 struct
106 /** Focused client */
107 client_t *client;
108 /** Is there a focus change pending? */
109 bool need_update;
110 } focus;
111 /** Drawins */
112 drawin_array_t drawins;
113 /** The startup notification display struct */
114 SnDisplay *sndisplay;
115 /** Latest timestamp we got from the X server */
116 xcb_timestamp_t timestamp;
117 /** Window that contains the systray */
118 struct
120 xcb_window_t window;
121 /** Systray window parent */
122 drawin_t *parent;
123 } systray;
124 /** The monitor of startup notifications */
125 SnMonitorContext *snmonitor;
126 /** The visual, used to draw */
127 xcb_visualtype_t *visual;
128 /** The screen's default visual */
129 xcb_visualtype_t *default_visual;
130 /** The screen's information */
131 xcb_screen_t *screen;
132 /** A graphic context. */
133 xcb_gcontext_t gc;
134 /** Our default depth */
135 uint8_t default_depth;
136 /** Our default color map */
137 xcb_colormap_t default_cmap;
138 /** Do we have to reban clients? */
139 bool need_lazy_banning;
140 /** Tag list */
141 tag_array_t tags;
142 } awesome_t;
144 extern awesome_t globalconf;
146 #endif
147 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80