2008-01-13 15:44:01 +01:00
|
|
|
/*
|
|
|
|
* structs.h - basic structs header
|
|
|
|
*
|
|
|
|
* Copyright © 2007-2008 Julien Danjou <julien@danjou.info>
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AWESOME_STRUCTS_H
|
|
|
|
#define AWESOME_STRUCTS_H
|
|
|
|
|
2009-04-03 16:30:18 +02:00
|
|
|
#define SN_API_NOT_YET_FROZEN
|
|
|
|
#include <libsn/sn.h>
|
|
|
|
|
2008-09-03 12:07:53 +02:00
|
|
|
#include <xcb/xcb_icccm.h>
|
2008-09-16 14:09:56 +02:00
|
|
|
#include <xcb/xcb_property.h>
|
2008-03-21 16:50:17 +01:00
|
|
|
|
2008-11-19 02:22:05 +01:00
|
|
|
#include "config.h"
|
2008-09-17 16:38:38 +02:00
|
|
|
#include "luaa.h"
|
2008-09-11 14:11:13 +02:00
|
|
|
#include "swindow.h"
|
2008-12-18 11:33:19 +01:00
|
|
|
#include "key.h"
|
2008-05-30 12:30:20 +02:00
|
|
|
#include "common/xutil.h"
|
2008-06-14 18:12:16 +02:00
|
|
|
#include "common/xembed.h"
|
2008-12-03 15:23:10 +01:00
|
|
|
#include "common/tokenize.h"
|
2008-01-13 15:44:01 +01:00
|
|
|
|
2008-09-03 14:59:18 +02:00
|
|
|
/** Windows type */
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
WINDOW_TYPE_NORMAL = 0,
|
|
|
|
WINDOW_TYPE_DESKTOP,
|
|
|
|
WINDOW_TYPE_DOCK,
|
|
|
|
WINDOW_TYPE_SPLASH,
|
|
|
|
WINDOW_TYPE_DIALOG,
|
2008-11-30 01:47:24 +01:00
|
|
|
/* The ones below may have TRANSIENT_FOR, but are not plain dialogs.
|
|
|
|
* They were purposefully placed below DIALOG.
|
|
|
|
*/
|
|
|
|
WINDOW_TYPE_MENU,
|
|
|
|
WINDOW_TYPE_TOOLBAR,
|
2009-02-13 11:25:38 +01:00
|
|
|
WINDOW_TYPE_UTILITY,
|
|
|
|
/* This ones are usually set on override-redirect windows. */
|
|
|
|
WINDOW_TYPE_DROPDOWN_MENU,
|
|
|
|
WINDOW_TYPE_POPUP_MENU,
|
|
|
|
WINDOW_TYPE_TOOLTIP,
|
|
|
|
WINDOW_TYPE_NOTIFICATION,
|
|
|
|
WINDOW_TYPE_COMBO,
|
|
|
|
WINDOW_TYPE_DND
|
2008-09-03 14:59:18 +02:00
|
|
|
} window_type_t;
|
|
|
|
|
2009-04-17 16:18:14 +02:00
|
|
|
typedef struct wibox_t wibox_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 widget_node_t widget_node_t;
|
|
|
|
typedef struct client_t client_t;
|
2008-10-24 20:40:02 +02:00
|
|
|
typedef struct client_node client_node_t;
|
2008-10-21 17:33:16 +02:00
|
|
|
typedef struct tag tag_t;
|
2008-06-09 21:43:09 +02:00
|
|
|
typedef struct tag_client_node_t tag_client_node_t;
|
2008-06-03 18:41:54 +02:00
|
|
|
typedef struct awesome_t awesome_t;
|
2008-01-13 15:44:01 +01:00
|
|
|
|
2008-10-21 17:21:21 +02:00
|
|
|
ARRAY_TYPE(widget_node_t, widget_node)
|
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:21:21 +02:00
|
|
|
|
2008-09-03 22:15:14 +02:00
|
|
|
/* Strut */
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
uint16_t left, right, top, bottom;
|
|
|
|
uint16_t left_start_y, left_end_y;
|
|
|
|
uint16_t right_start_y, right_end_y;
|
|
|
|
uint16_t top_start_x, top_end_x;
|
|
|
|
uint16_t bottom_start_x, bottom_end_x;
|
|
|
|
} strut_t;
|
|
|
|
|
2008-04-11 11:35:11 +02:00
|
|
|
/** client_t type */
|
|
|
|
struct client_t
|
2008-01-13 15:44:01 +01:00
|
|
|
{
|
2009-04-10 15:23:55 +02:00
|
|
|
/** Lua reference counter */
|
|
|
|
luaA_ref_array_t refs;
|
2008-07-31 17:29:05 +02:00
|
|
|
/** Valid, or not ? */
|
|
|
|
bool invalid;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Client name */
|
2008-10-21 15:12:55 +02:00
|
|
|
char *name, *icon_name;
|
2009-04-04 13:41:17 +02:00
|
|
|
/** WM_CLASS stuff */
|
|
|
|
char *class, *instance;
|
2009-04-04 13:04:19 +02:00
|
|
|
/** Startup ID */
|
|
|
|
char *startup_id;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Window geometry */
|
2008-03-14 09:37:25 +01:00
|
|
|
area_t geometry;
|
2008-11-25 11:24:25 +01:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
/** Client geometry when (un)fullscreen */
|
|
|
|
area_t fullscreen;
|
2008-11-25 11:54:38 +01:00
|
|
|
/** Client geometry when (un)-max */
|
|
|
|
area_t max;
|
2008-12-12 00:01:43 +01:00
|
|
|
/** Internal geometry (matching X11 protocol) */
|
|
|
|
area_t internal;
|
2008-11-25 11:24:25 +01:00
|
|
|
} geometries;
|
2008-09-03 22:15:14 +02:00
|
|
|
/** Strut */
|
|
|
|
strut_t strut;
|
2009-03-30 19:40:01 +02:00
|
|
|
/** Ignore strut temporarily. */
|
|
|
|
bool ignore_strut;
|
2008-12-09 11:18:16 +01:00
|
|
|
/** Border width and pre-fullscreen border width */
|
|
|
|
int border, border_fs;
|
2008-07-01 20:07:21 +02:00
|
|
|
xcolor_t border_color;
|
2008-08-21 16:29:53 +02:00
|
|
|
/** True if the client is sticky */
|
|
|
|
bool issticky;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Has urgency hint */
|
2008-03-21 16:50:17 +01:00
|
|
|
bool isurgent;
|
2008-06-09 18:24:12 +02:00
|
|
|
/** True if the client is hidden */
|
|
|
|
bool ishidden;
|
2008-09-06 13:52:05 +02:00
|
|
|
/** True if the client is minimized */
|
|
|
|
bool isminimized;
|
2008-08-21 17:52:44 +02:00
|
|
|
/** True if the client is fullscreen */
|
|
|
|
bool isfullscreen;
|
2008-11-25 11:54:38 +01:00
|
|
|
/** True if the client is maximized horizontally */
|
|
|
|
bool ismaxhoriz;
|
|
|
|
/** True if the client is maximized vertically */
|
|
|
|
bool ismaxvert;
|
2008-08-21 17:52:44 +02:00
|
|
|
/** True if the client is above others */
|
|
|
|
bool isabove;
|
|
|
|
/** True if the client is below others */
|
|
|
|
bool isbelow;
|
|
|
|
/** True if the client is modal */
|
|
|
|
bool ismodal;
|
|
|
|
/** True if the client is on top */
|
|
|
|
bool isontop;
|
2008-11-20 22:11:13 +01:00
|
|
|
/** True if a client is banned to a position outside the viewport.
|
|
|
|
* Note that the geometry remains unchanged and that the window is still mapped.
|
|
|
|
*/
|
|
|
|
bool isbanned;
|
2008-03-21 16:50:17 +01:00
|
|
|
/** true if the client must be skipped from task bar client list */
|
|
|
|
bool skiptb;
|
2008-09-03 16:51:46 +02:00
|
|
|
/** True if the client cannot have focus */
|
|
|
|
bool nofocus;
|
2008-09-03 14:59:18 +02:00
|
|
|
/** The window type */
|
|
|
|
window_type_t type;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Window of the client */
|
2008-03-21 16:50:17 +01:00
|
|
|
xcb_window_t win;
|
2008-12-01 19:06:35 +01:00
|
|
|
/** Window of the group leader */
|
|
|
|
xcb_window_t group_win;
|
2008-12-01 19:44:28 +01:00
|
|
|
/** Window holding command needed to start it (session management related) */
|
|
|
|
xcb_window_t leader_win;
|
2008-06-09 21:43:09 +02:00
|
|
|
/** Client logical screen */
|
2009-04-17 16:14:09 +02:00
|
|
|
screen_t *screen;
|
2008-03-21 10:53:17 +01:00
|
|
|
/** Client physical screen */
|
|
|
|
int phys_screen;
|
2008-06-04 11:50:21 +02:00
|
|
|
/** Titlebar */
|
2008-09-21 10:13:21 +02:00
|
|
|
wibox_t *titlebar;
|
2008-06-13 15:35:47 +02:00
|
|
|
/** Button bindings */
|
2008-08-12 13:23:10 +02:00
|
|
|
button_array_t buttons;
|
2009-01-05 16:59:20 +01:00
|
|
|
/** Key bindings */
|
|
|
|
keybindings_t keys;
|
2008-08-11 23:10:02 +02:00
|
|
|
/** Icon */
|
2008-09-11 15:26:56 +02:00
|
|
|
image_t *icon;
|
2008-09-03 12:07:53 +02:00
|
|
|
/** Size hints */
|
|
|
|
xcb_size_hints_t size_hints;
|
2008-12-09 11:38:29 +01:00
|
|
|
bool size_hints_honor;
|
2008-09-16 18:07:42 +02:00
|
|
|
/** Window it is transient for */
|
|
|
|
client_t *transient_for;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
2008-10-21 17:33:16 +02:00
|
|
|
ARRAY_TYPE(client_t *, client)
|
2008-01-13 15:44:01 +01:00
|
|
|
|
2008-06-09 21:43:09 +02:00
|
|
|
/** Tag type */
|
2008-10-21 17:33:16 +02:00
|
|
|
struct tag
|
2008-01-13 15:44:01 +01:00
|
|
|
{
|
2009-04-11 11:45:55 +02:00
|
|
|
/** Lua references count */
|
|
|
|
luaA_ref_array_t refs;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Tag name */
|
|
|
|
char *name;
|
2008-06-09 21:43:09 +02:00
|
|
|
/** Screen */
|
2009-04-17 16:14:09 +02:00
|
|
|
screen_t *screen;
|
2008-06-09 21:43:09 +02:00
|
|
|
/** true if selected */
|
|
|
|
bool selected;
|
2008-06-24 14:16:37 +02:00
|
|
|
/** clients in this tag */
|
|
|
|
client_array_t clients;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Main configuration structure */
|
2008-05-24 08:59:27 +02:00
|
|
|
struct awesome_t
|
2008-01-13 15:44:01 +01:00
|
|
|
{
|
2008-03-21 16:50:17 +01:00
|
|
|
/** Connection ref */
|
|
|
|
xcb_connection_t *connection;
|
|
|
|
/** Event and error handlers */
|
2008-09-16 15:36:44 +02:00
|
|
|
xcb_event_handlers_t evenths;
|
2008-09-16 14:09:56 +02:00
|
|
|
/** Property change handler */
|
|
|
|
xcb_property_handlers_t prophs;
|
2008-03-21 16:50:17 +01:00
|
|
|
/** Default screen number */
|
|
|
|
int default_screen;
|
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;
|
2008-09-18 16:03:05 +02:00
|
|
|
/** True if xinerama is active */
|
|
|
|
bool xinerama_is_active;
|
2009-01-05 16:59:20 +01:00
|
|
|
/** Root window key bindings */
|
|
|
|
keybindings_t keys;
|
|
|
|
/** Root window mouse bindings */
|
2008-08-12 13:23:10 +02:00
|
|
|
button_array_t buttons;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Check for XRandR extension */
|
2008-03-21 16:50:17 +01:00
|
|
|
bool have_randr;
|
2008-12-29 17:03:17 +01:00
|
|
|
/** Check for XTest extension */
|
|
|
|
bool have_xtest;
|
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-01-13 15:44:01 +01:00
|
|
|
/** Path to config file */
|
2008-09-30 15:35:47 +02:00
|
|
|
char *conffile;
|
2008-05-25 19:30:54 +02:00
|
|
|
/** Stack client history */
|
|
|
|
client_node_t *stack;
|
2008-01-13 15:44:01 +01:00
|
|
|
/** Command line passed to awesome */
|
|
|
|
char *argv;
|
2008-05-20 15:39:47 +02:00
|
|
|
/** Lua VM state */
|
|
|
|
lua_State *L;
|
|
|
|
/** Default colors */
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
xcolor_t fg, bg;
|
|
|
|
} colors;
|
|
|
|
/** Default font */
|
|
|
|
font_t *font;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
/** Command to execute when spawning a new client */
|
2008-08-11 10:12:12 +02:00
|
|
|
luaA_ref manage;
|
2008-06-10 19:03:10 +02:00
|
|
|
/** Command to execute when unmanaging client */
|
2008-08-11 10:12:12 +02:00
|
|
|
luaA_ref unmanage;
|
2008-05-20 15:39:47 +02:00
|
|
|
/** Command to execute when giving focus to a client */
|
2008-08-11 10:12:12 +02:00
|
|
|
luaA_ref focus;
|
2008-05-20 15:39:47 +02:00
|
|
|
/** Command to execute when removing focus to a client */
|
2008-08-11 10:12:12 +02:00
|
|
|
luaA_ref unfocus;
|
2008-09-22 17:54:48 +02:00
|
|
|
/** Command to run when mouse enter a client */
|
|
|
|
luaA_ref mouse_enter;
|
2008-12-01 15:43:16 +01:00
|
|
|
/** Command to run when mouse leave a client */
|
|
|
|
luaA_ref mouse_leave;
|
2008-05-23 17:09:34 +02:00
|
|
|
/** Command to run on arrange */
|
2008-08-11 10:12:12 +02:00
|
|
|
luaA_ref arrange;
|
2008-10-20 15:01:16 +02:00
|
|
|
/** Command to run when client list changes */
|
|
|
|
luaA_ref clients;
|
2008-10-19 19:14:55 +02:00
|
|
|
/** Command to run on numbers of tag changes */
|
|
|
|
luaA_ref tags;
|
|
|
|
/** Command to run when client gets (un)tagged */
|
|
|
|
luaA_ref tagged;
|
2008-09-22 17:54:48 +02:00
|
|
|
/** Command to run on property change */
|
|
|
|
luaA_ref property;
|
2008-05-29 13:47:11 +02:00
|
|
|
/** Command to run on time */
|
2008-08-11 10:12:12 +02:00
|
|
|
luaA_ref timer;
|
2009-04-03 16:30:18 +02:00
|
|
|
/** Startup notification hooks */
|
|
|
|
luaA_ref startup_notification;
|
2008-11-19 02:22:05 +01:00
|
|
|
#ifdef WITH_DBUS
|
|
|
|
/** Command to run on dbus events */
|
|
|
|
luaA_ref dbus;
|
|
|
|
#endif
|
2008-05-20 15:39:47 +02:00
|
|
|
} hooks;
|
2008-06-17 00:30:53 +02:00
|
|
|
/** The event loop */
|
|
|
|
struct ev_loop *loop;
|
2008-05-29 13:47:11 +02:00
|
|
|
/** The timeout after which we need to stop select() */
|
2008-06-17 00:30:53 +02:00
|
|
|
struct ev_timer timer;
|
2008-06-10 16:50:55 +02:00
|
|
|
/** The key grabber function */
|
2008-08-11 10:12:12 +02:00
|
|
|
luaA_ref keygrabber;
|
2008-11-13 16:08:34 +01:00
|
|
|
/** The mouse pointer grabber function */
|
|
|
|
luaA_ref mousegrabber;
|
2008-07-31 15:51:28 +02:00
|
|
|
/** Focused screen */
|
|
|
|
screen_t *screen_focus;
|
2009-04-10 18:15:48 +02:00
|
|
|
/** Need to call client_stack_refresh() */
|
|
|
|
bool client_need_stack_refresh;
|
2009-04-03 16:30:18 +02:00
|
|
|
/** The startup notification display struct */
|
|
|
|
SnDisplay *sndisplay;
|
2008-01-13 15:44:01 +01:00
|
|
|
};
|
|
|
|
|
2009-04-03 11:07:04 +02:00
|
|
|
DO_ARRAY(const void *, void, DO_NOTHING)
|
|
|
|
|
2009-04-10 13:28:21 +02:00
|
|
|
extern awesome_t globalconf;
|
|
|
|
|
2008-01-13 15:44:01 +01:00
|
|
|
#endif
|
|
|
|
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|