2008-01-13 15:44:01 +01:00
|
|
|
/*
|
2009-09-07 17:22:32 +02:00
|
|
|
* globalconf.h - basic globalconf.header
|
2008-01-13 15:44:01 +01:00
|
|
|
*
|
2009-09-07 17:22:32 +02:00
|
|
|
* Copyright © 2007-2009 Julien Danjou <julien@danjou.info>
|
2008-01-13 15:44:01 +01:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-09-07 17:22:32 +02:00
|
|
|
#ifndef AWESOME_GLOBALCONF_H
|
|
|
|
#define AWESOME_GLOBALCONF_H
|
2008-01-13 15:44:01 +01:00
|
|
|
|
2009-04-03 16:30:18 +02:00
|
|
|
#define SN_API_NOT_YET_FROZEN
|
|
|
|
#include <libsn/sn.h>
|
|
|
|
|
2012-11-21 21:01:12 +01:00
|
|
|
#include <glib.h>
|
2009-08-17 16:38:56 +02:00
|
|
|
|
2008-09-03 12:07:53 +02:00
|
|
|
#include <xcb/xcb_icccm.h>
|
2009-04-17 16:52:25 +02:00
|
|
|
#include <xcb/xcb_keysyms.h>
|
2013-09-19 16:48:10 +02:00
|
|
|
#include <xcb/xcb_cursor.h>
|
2008-03-21 16:50:17 +01:00
|
|
|
|
2009-09-14 20:27:56 +02:00
|
|
|
#include "objects/key.h"
|
2009-09-07 17:51:40 +02:00
|
|
|
#include "color.h"
|
2008-06-14 18:12:16 +02:00
|
|
|
#include "common/xembed.h"
|
2011-10-23 15:59:15 +02:00
|
|
|
#include "common/buffer.h"
|
2008-01-13 15:44:01 +01:00
|
|
|
|
2011-10-19 14:55:57 +02:00
|
|
|
#define ROOT_WINDOW_EVENT_MASK \
|
|
|
|
(const uint32_t []) { \
|
|
|
|
XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY \
|
|
|
|
| XCB_EVENT_MASK_ENTER_WINDOW \
|
|
|
|
| XCB_EVENT_MASK_LEAVE_WINDOW \
|
|
|
|
| XCB_EVENT_MASK_STRUCTURE_NOTIFY \
|
|
|
|
| XCB_EVENT_MASK_BUTTON_PRESS \
|
|
|
|
| XCB_EVENT_MASK_BUTTON_RELEASE \
|
|
|
|
| XCB_EVENT_MASK_FOCUS_CHANGE \
|
2012-04-07 21:52:24 +02:00
|
|
|
| XCB_EVENT_MASK_PROPERTY_CHANGE \
|
2011-10-19 14:55:57 +02:00
|
|
|
}
|
|
|
|
|
2012-10-14 17:14:22 +02:00
|
|
|
typedef struct drawable_t drawable_t;
|
2010-10-06 13:35:14 +02:00
|
|
|
typedef struct drawin_t drawin_t;
|
2009-04-17 16:14:09 +02:00
|
|
|
typedef struct a_screen screen_t;
|
2008-06-03 18:41:54 +02:00
|
|
|
typedef struct button_t button_t;
|
|
|
|
typedef struct widget_t widget_t;
|
|
|
|
typedef struct client_t client_t;
|
2008-10-21 17:33:16 +02:00
|
|
|
typedef struct tag tag_t;
|
2014-03-07 13:49:24 +01:00
|
|
|
typedef struct xproperty xproperty_t;
|
2008-01-13 15:44:01 +01:00
|
|
|
|
2008-10-24 20:38:29 +02:00
|
|
|
ARRAY_TYPE(button_t *, button)
|
2009-04-17 16:14:09 +02:00
|
|
|
ARRAY_TYPE(tag_t *, tag)
|
|
|
|
ARRAY_TYPE(screen_t, screen)
|
2008-10-21 17:33:16 +02:00
|
|
|
ARRAY_TYPE(client_t *, client)
|
2010-10-06 13:35:14 +02:00
|
|
|
ARRAY_TYPE(drawin_t *, drawin)
|
2014-03-07 13:49:24 +01:00
|
|
|
ARRAY_TYPE(xproperty_t, xproperty)
|
2008-01-13 15:44:01 +01:00
|
|
|
|
|
|
|
/** Main configuration structure */
|
2009-09-07 17:23:54 +02:00
|
|
|
typedef struct
|
2008-01-13 15:44:01 +01:00
|
|
|
{
|
2008-03-21 16:50:17 +01:00
|
|
|
/** Connection ref */
|
|
|
|
xcb_connection_t *connection;
|
|
|
|
/** Default screen number */
|
|
|
|
int default_screen;
|
2013-09-19 16:48:10 +02:00
|
|
|
/** xcb-cursor context */
|
|
|
|
xcb_cursor_context_t *cursor_ctx;
|
2008-03-24 00:48:42 +01:00
|
|
|
/** Keys symbol table */
|
|
|
|
xcb_key_symbols_t *keysyms;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Logical screens */
|
2009-04-17 16:14:09 +02:00
|
|
|
screen_array_t screens;
|
2009-01-05 16:59:20 +01:00
|
|
|
/** Root window key bindings */
|
2009-08-14 16:46:35 +02:00
|
|
|
key_array_t keys;
|
2009-01-05 16:59:20 +01:00
|
|
|
/** Root window mouse bindings */
|
2009-08-14 16:46:35 +02:00
|
|
|
button_array_t buttons;
|
2009-04-28 18:17:16 +02:00
|
|
|
/** Modifiers masks */
|
|
|
|
uint16_t numlockmask, shiftlockmask, capslockmask, modeswitchmask;
|
2008-12-29 17:03:17 +01:00
|
|
|
/** Check for XTest extension */
|
|
|
|
bool have_xtest;
|
2014-01-03 16:51:16 +01:00
|
|
|
/** Check for SHAPE extension */
|
|
|
|
bool have_shape;
|
2008-06-03 18:41:54 +02:00
|
|
|
/** Clients list */
|
2009-04-09 17:17:10 +02:00
|
|
|
client_array_t clients;
|
2008-06-14 18:12:16 +02:00
|
|
|
/** Embedded windows */
|
2008-12-01 16:43:44 +01:00
|
|
|
xembed_window_array_t embedded;
|
2008-05-25 19:30:54 +02:00
|
|
|
/** Stack client history */
|
2009-04-17 23:26:26 +02:00
|
|
|
client_array_t stack;
|
2008-05-20 15:39:47 +02:00
|
|
|
/** Lua VM state */
|
|
|
|
lua_State *L;
|
2011-10-23 15:59:15 +02:00
|
|
|
/** All errors messages from loading config files */
|
|
|
|
buffer_t startup_errors;
|
2012-11-21 21:01:12 +01:00
|
|
|
/** main loop that awesome is running on */
|
|
|
|
GMainLoop *loop;
|
2008-06-10 16:50:55 +02:00
|
|
|
/** The key grabber function */
|
2009-07-28 10:29:30 +02:00
|
|
|
int keygrabber;
|
2008-11-13 16:08:34 +01:00
|
|
|
/** The mouse pointer grabber function */
|
2009-07-28 10:29:30 +02:00
|
|
|
int mousegrabber;
|
2015-09-17 16:32:56 +02:00
|
|
|
/** The drawable that currently contains the pointer */
|
|
|
|
drawable_t *drawable_under_mouse;
|
2010-10-10 14:46:56 +02:00
|
|
|
/** Input focus information */
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
/** Focused client */
|
|
|
|
client_t *client;
|
2010-10-10 14:50:35 +02:00
|
|
|
/** Is there a focus change pending? */
|
|
|
|
bool need_update;
|
2015-09-23 20:48:56 +02:00
|
|
|
/** When nothing has the input focus, this window actually is focused */
|
|
|
|
xcb_window_t window_no_focus;
|
2010-10-10 14:46:56 +02:00
|
|
|
} focus;
|
2010-10-06 13:35:14 +02:00
|
|
|
/** Drawins */
|
|
|
|
drawin_array_t drawins;
|
2009-04-03 16:30:18 +02:00
|
|
|
/** The startup notification display struct */
|
|
|
|
SnDisplay *sndisplay;
|
2010-08-12 14:37:39 +02:00
|
|
|
/** Latest timestamp we got from the X server */
|
|
|
|
xcb_timestamp_t timestamp;
|
2010-08-16 13:55:12 +02:00
|
|
|
/** Window that contains the systray */
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
xcb_window_t window;
|
2014-08-20 11:40:50 +02:00
|
|
|
/** Atom for _NET_SYSTEM_TRAY_%d */
|
|
|
|
xcb_atom_t atom;
|
2014-08-20 11:47:47 +02:00
|
|
|
/** Do we own the systray selection? */
|
|
|
|
bool registered;
|
2010-08-16 13:55:12 +02:00
|
|
|
/** Systray window parent */
|
2010-10-06 15:38:44 +02:00
|
|
|
drawin_t *parent;
|
2015-08-12 10:26:27 +02:00
|
|
|
/** Background color */
|
|
|
|
uint32_t background_pixel;
|
2010-08-16 13:55:12 +02:00
|
|
|
} systray;
|
2010-08-16 13:57:31 +02:00
|
|
|
/** The monitor of startup notifications */
|
|
|
|
SnMonitorContext *snmonitor;
|
2012-04-07 21:32:45 +02:00
|
|
|
/** The visual, used to draw */
|
2010-08-16 13:59:51 +02:00
|
|
|
xcb_visualtype_t *visual;
|
2012-04-07 21:32:45 +02:00
|
|
|
/** The screen's default visual */
|
|
|
|
xcb_visualtype_t *default_visual;
|
2010-08-16 14:10:58 +02:00
|
|
|
/** The screen's information */
|
|
|
|
xcb_screen_t *screen;
|
2010-08-17 15:44:44 +02:00
|
|
|
/** A graphic context. */
|
|
|
|
xcb_gcontext_t gc;
|
2010-09-30 12:48:24 +02:00
|
|
|
/** Our default depth */
|
|
|
|
uint8_t default_depth;
|
|
|
|
/** Our default color map */
|
|
|
|
xcb_colormap_t default_cmap;
|
2011-03-27 19:57:06 +02:00
|
|
|
/** Do we have to reban clients? */
|
|
|
|
bool need_lazy_banning;
|
2012-10-20 17:33:32 +02:00
|
|
|
/** Tag list */
|
|
|
|
tag_array_t tags;
|
2014-03-07 13:49:24 +01:00
|
|
|
/** List of registered xproperties */
|
|
|
|
xproperty_array_t xproperties;
|
2009-09-07 17:23:54 +02:00
|
|
|
} awesome_t;
|
2008-01-13 15:44:01 +01:00
|
|
|
|
2009-04-10 13:28:21 +02:00
|
|
|
extern awesome_t globalconf;
|
|
|
|
|
2008-01-13 15:44:01 +01:00
|
|
|
#endif
|
2011-09-11 16:50:01 +02:00
|
|
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|