change codename
[awesome.git] / structs.h
blob7da52e41421eb1d49bd1702fdee64198a82d8c05
1 /*
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
25 #define SN_API_NOT_YET_FROZEN
26 #include <libsn/sn.h>
28 #include <xcb/xcb_icccm.h>
29 #include <xcb/xcb_keysyms.h>
31 #include "config.h"
32 #include "key.h"
33 #include "common/xembed.h"
35 typedef struct wibox_t wibox_t;
36 typedef struct a_screen screen_t;
37 typedef struct button_t button_t;
38 typedef struct widget_t widget_t;
39 typedef struct widget_node_t widget_node_t;
40 typedef struct client_t client_t;
41 typedef struct client_node client_node_t;
42 typedef struct tag tag_t;
43 typedef struct tag_client_node_t tag_client_node_t;
44 typedef struct awesome_t awesome_t;
46 ARRAY_TYPE(widget_node_t, widget_node)
47 ARRAY_TYPE(button_t *, button)
48 ARRAY_TYPE(tag_t *, tag)
49 ARRAY_TYPE(screen_t, screen)
50 ARRAY_TYPE(client_t *, client)
52 /** Main configuration structure */
53 struct awesome_t
55 /** Connection ref */
56 xcb_connection_t *connection;
57 /** Event and error handlers */
58 xcb_event_handlers_t evenths;
59 /** Property change handler */
60 xcb_property_handlers_t prophs;
61 /** Default screen number */
62 int default_screen;
63 /** Keys symbol table */
64 xcb_key_symbols_t *keysyms;
65 /** Logical screens */
66 screen_array_t screens;
67 /** True if xinerama is active */
68 bool xinerama_is_active;
69 /** Root window key bindings */
70 key_array_t keys;
71 /** Root window mouse bindings */
72 button_array_t buttons;
73 /** Modifiers masks */
74 uint16_t numlockmask, shiftlockmask, capslockmask, modeswitchmask;
75 /** Check for XRandR extension */
76 bool have_randr;
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 luaA_ref manage;
102 /** Command to execute when unmanaging client */
103 luaA_ref unmanage;
104 /** Command to execute when giving focus to a client */
105 luaA_ref focus;
106 /** Command to execute when removing focus to a client */
107 luaA_ref unfocus;
108 /** Command to run when mouse enter a client */
109 luaA_ref mouse_enter;
110 /** Command to run when mouse leave a client */
111 luaA_ref mouse_leave;
112 /** Command to run on arrange */
113 luaA_ref arrange;
114 /** Command to run when client list changes */
115 luaA_ref clients;
116 /** Command to run on numbers of tag changes */
117 luaA_ref tags;
118 /** Command to run when client gets (un)tagged */
119 luaA_ref tagged;
120 /** Command to run on property change */
121 luaA_ref property;
122 /** Command to run on time */
123 luaA_ref timer;
124 /** Startup notification hooks */
125 luaA_ref startup_notification;
126 #ifdef WITH_DBUS
127 /** Command to run on dbus events */
128 luaA_ref dbus;
129 #endif
130 } hooks;
131 /** The event loop */
132 struct ev_loop *loop;
133 /** The timeout after which we need to stop select() */
134 struct ev_timer timer;
135 /** The key grabber function */
136 luaA_ref keygrabber;
137 /** The mouse pointer grabber function */
138 luaA_ref mousegrabber;
139 /** Focused screen */
140 screen_t *screen_focus;
141 /** Need to call client_stack_refresh() */
142 bool client_need_stack_refresh;
143 /** The startup notification display struct */
144 SnDisplay *sndisplay;
147 extern awesome_t globalconf;
149 #endif
150 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80