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