2007-04-27 21:58:48 +04:00
|
|
|
/*
|
|
|
|
* calmwm - the calm window manager
|
|
|
|
*
|
|
|
|
* Copyright (c) 2004 Marius Aamodt Eriksen <marius@monkey.org>
|
2008-01-11 19:06:44 +03:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2007-04-27 21:58:48 +04:00
|
|
|
*
|
2011-05-11 17:53:51 +04:00
|
|
|
* $OpenBSD$
|
2007-04-27 21:58:48 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CALMWM_H_
|
|
|
|
#define _CALMWM_H_
|
|
|
|
|
2012-05-16 05:04:36 +04:00
|
|
|
#include <X11/XKBlib.h>
|
2009-12-15 06:24:36 +03:00
|
|
|
#include <X11/Xatom.h>
|
|
|
|
#include <X11/Xft/Xft.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xproto.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
#include <X11/cursorfont.h>
|
|
|
|
#include <X11/extensions/Xrandr.h>
|
|
|
|
#include <X11/keysym.h>
|
|
|
|
|
2007-04-27 21:58:48 +04:00
|
|
|
#undef MIN
|
|
|
|
#undef MAX
|
|
|
|
#define MIN(x, y) ((x) < (y) ? (x) : (y))
|
|
|
|
#define MAX(x, y) ((x) > (y) ? (x) : (y))
|
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
#ifndef nitems
|
|
|
|
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
|
|
|
#endif
|
|
|
|
|
2008-03-23 18:09:21 +03:00
|
|
|
#define CONFFILE ".cwmrc"
|
2009-12-08 00:20:52 +03:00
|
|
|
#define WMNAME "CWM"
|
2008-03-23 18:09:21 +03:00
|
|
|
|
2011-07-23 17:09:11 +04:00
|
|
|
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
|
|
|
|
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
|
2012-12-18 22:35:36 +04:00
|
|
|
#define MENUMASK (MOUSEMASK|ButtonMotionMask|ExposureMask)
|
|
|
|
#define MENUGRABMASK (MOUSEMASK|ButtonMotionMask|StructureNotifyMask)
|
2011-07-23 17:09:11 +04:00
|
|
|
#define KEYMASK (KeyPressMask|ExposureMask)
|
2012-12-18 21:37:39 +04:00
|
|
|
#define IGNOREMODMASK (LockMask|Mod2Mask)
|
2007-04-27 21:58:48 +04:00
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
/* kb movement */
|
|
|
|
#define CWM_MOVE 0x0001
|
|
|
|
#define CWM_RESIZE 0x0002
|
|
|
|
#define CWM_PTRMOVE 0x0004
|
|
|
|
#define CWM_BIGMOVE 0x0008
|
|
|
|
#define CWM_UP 0x0010
|
|
|
|
#define CWM_DOWN 0x0020
|
|
|
|
#define CWM_LEFT 0x0040
|
|
|
|
#define CWM_RIGHT 0x0080
|
|
|
|
|
|
|
|
/* exec */
|
|
|
|
#define CWM_EXEC_PROGRAM 0x0001
|
|
|
|
#define CWM_EXEC_WM 0x0002
|
|
|
|
|
2011-06-24 09:30:42 +04:00
|
|
|
/* cycle */
|
2011-09-03 13:20:58 +04:00
|
|
|
#define CWM_CYCLE 0x0001
|
|
|
|
#define CWM_RCYCLE 0x0002
|
|
|
|
#define CWM_INGROUP 0x0004
|
2011-05-05 20:40:37 +04:00
|
|
|
|
2012-11-07 18:39:44 +04:00
|
|
|
/* menu */
|
2012-11-07 18:40:51 +04:00
|
|
|
#define CWM_MENU_DUMMY 0x0001
|
|
|
|
#define CWM_MENU_FILE 0x0002
|
2015-06-05 18:01:51 +03:00
|
|
|
#define CWM_MENU_LIST 0x0004
|
2012-11-07 18:39:44 +04:00
|
|
|
|
2013-01-01 18:33:52 +04:00
|
|
|
#define ARG_CHAR 0x0001
|
|
|
|
#define ARG_INT 0x0002
|
2013-01-08 19:16:04 +04:00
|
|
|
|
|
|
|
#define CWM_TILE_HORIZ 0x0001
|
|
|
|
#define CWM_TILE_VERT 0x0002
|
|
|
|
|
2013-12-14 02:39:13 +04:00
|
|
|
#define CWM_GAP 0x0001
|
|
|
|
#define CWM_NOGAP 0x0002
|
|
|
|
|
2014-01-21 03:03:51 +04:00
|
|
|
#define CWM_WIN 0x0001
|
2015-03-27 00:41:43 +03:00
|
|
|
#define CWM_CMD 0x0002
|
2014-01-21 03:03:51 +04:00
|
|
|
|
2014-01-23 01:48:27 +04:00
|
|
|
#define CWM_QUIT 0x0000
|
|
|
|
#define CWM_RUNNING 0x0001
|
|
|
|
#define CWM_RESTART 0x0002
|
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
union arg {
|
|
|
|
char *c;
|
|
|
|
int i;
|
|
|
|
};
|
2011-03-22 13:57:31 +03:00
|
|
|
|
2014-01-30 01:13:52 +04:00
|
|
|
union press {
|
|
|
|
KeySym keysym;
|
|
|
|
unsigned int button;
|
|
|
|
};
|
|
|
|
|
2013-06-17 21:11:10 +04:00
|
|
|
enum cursor_font {
|
|
|
|
CF_DEFAULT,
|
|
|
|
CF_MOVE,
|
|
|
|
CF_NORMAL,
|
|
|
|
CF_QUESTION,
|
|
|
|
CF_RESIZE,
|
|
|
|
CF_NITEMS
|
|
|
|
};
|
|
|
|
|
2013-05-20 03:09:59 +04:00
|
|
|
enum color {
|
2011-07-14 15:39:53 +04:00
|
|
|
CWM_COLOR_BORDER_ACTIVE,
|
2009-05-18 03:40:57 +04:00
|
|
|
CWM_COLOR_BORDER_INACTIVE,
|
2013-12-13 18:40:52 +04:00
|
|
|
CWM_COLOR_BORDER_URGENCY,
|
2009-05-18 03:40:57 +04:00
|
|
|
CWM_COLOR_BORDER_GROUP,
|
|
|
|
CWM_COLOR_BORDER_UNGROUP,
|
2013-05-20 03:09:59 +04:00
|
|
|
CWM_COLOR_MENU_FG,
|
|
|
|
CWM_COLOR_MENU_BG,
|
|
|
|
CWM_COLOR_MENU_FONT,
|
|
|
|
CWM_COLOR_MENU_FONT_SEL,
|
2013-07-16 18:04:44 +04:00
|
|
|
CWM_COLOR_NITEMS
|
2009-05-18 03:40:57 +04:00
|
|
|
};
|
|
|
|
|
2012-07-13 18:18:04 +04:00
|
|
|
struct geom {
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int w;
|
|
|
|
int h;
|
|
|
|
};
|
|
|
|
|
2010-01-27 06:04:50 +03:00
|
|
|
struct gap {
|
|
|
|
int top;
|
|
|
|
int bottom;
|
|
|
|
int left;
|
|
|
|
int right;
|
|
|
|
};
|
2009-05-18 03:40:57 +04:00
|
|
|
|
2007-04-27 21:58:48 +04:00
|
|
|
struct winname {
|
2008-07-11 18:21:28 +04:00
|
|
|
TAILQ_ENTRY(winname) entry;
|
|
|
|
char *name;
|
2007-04-27 21:58:48 +04:00
|
|
|
};
|
|
|
|
TAILQ_HEAD(winname_q, winname);
|
2014-01-31 02:17:22 +04:00
|
|
|
TAILQ_HEAD(ignore_q, winname);
|
2007-04-27 21:58:48 +04:00
|
|
|
|
|
|
|
struct client_ctx {
|
2014-09-09 00:11:22 +04:00
|
|
|
TAILQ_ENTRY(client_ctx) entry;
|
|
|
|
TAILQ_ENTRY(client_ctx) group_entry;
|
2007-04-27 21:58:48 +04:00
|
|
|
struct screen_ctx *sc;
|
|
|
|
Window win;
|
2012-12-17 22:35:26 +04:00
|
|
|
Colormap colormap;
|
2014-01-03 19:29:06 +04:00
|
|
|
unsigned int bwidth; /* border width */
|
2013-12-16 23:02:17 +04:00
|
|
|
struct geom geom, savegeom, fullgeom;
|
2011-09-03 13:42:33 +04:00
|
|
|
struct {
|
2013-11-02 23:13:56 +04:00
|
|
|
long flags; /* defined hints */
|
2011-05-05 20:40:37 +04:00
|
|
|
int basew; /* desired width */
|
|
|
|
int baseh; /* desired height */
|
|
|
|
int minw; /* minimum width */
|
|
|
|
int minh; /* minimum height */
|
|
|
|
int maxw; /* maximum width */
|
|
|
|
int maxh; /* maximum height */
|
|
|
|
int incw; /* width increment progression */
|
|
|
|
int inch; /* height increment progression */
|
|
|
|
float mina; /* minimum aspect ratio */
|
|
|
|
float maxa; /* maximum aspect ratio */
|
2011-09-03 13:42:33 +04:00
|
|
|
} hint;
|
2007-04-27 21:58:48 +04:00
|
|
|
struct {
|
2011-05-05 20:40:37 +04:00
|
|
|
int x; /* x position */
|
|
|
|
int y; /* y position */
|
2007-04-27 21:58:48 +04:00
|
|
|
} ptr;
|
2015-06-08 18:11:29 +03:00
|
|
|
struct {
|
2015-06-09 16:02:15 +03:00
|
|
|
int h; /* height */
|
2015-06-08 18:11:29 +03:00
|
|
|
int w; /* width */
|
|
|
|
} dim;
|
2011-05-05 20:40:37 +04:00
|
|
|
#define CLIENT_HIDDEN 0x0001
|
|
|
|
#define CLIENT_IGNORE 0x0002
|
2011-09-04 20:59:31 +04:00
|
|
|
#define CLIENT_VMAXIMIZED 0x0004
|
|
|
|
#define CLIENT_HMAXIMIZED 0x0008
|
|
|
|
#define CLIENT_FREEZE 0x0010
|
2012-12-17 21:48:57 +04:00
|
|
|
#define CLIENT_GROUP 0x0020
|
|
|
|
#define CLIENT_UNGROUP 0x0040
|
2013-11-01 18:07:19 +04:00
|
|
|
#define CLIENT_INPUT 0x0080
|
2013-11-08 21:35:12 +04:00
|
|
|
#define CLIENT_WM_DELETE_WINDOW 0x0100
|
|
|
|
#define CLIENT_WM_TAKE_FOCUS 0x0200
|
2013-12-13 18:40:52 +04:00
|
|
|
#define CLIENT_URGENCY 0x0400
|
2013-12-16 23:02:17 +04:00
|
|
|
#define CLIENT_FULLSCREEN 0x0800
|
2014-08-25 16:49:19 +04:00
|
|
|
#define CLIENT_STICKY 0x1000
|
2014-09-11 00:30:38 +04:00
|
|
|
#define CLIENT_ACTIVE 0x2000
|
2011-09-04 20:59:31 +04:00
|
|
|
|
2012-12-17 21:48:57 +04:00
|
|
|
#define CLIENT_HIGHLIGHT (CLIENT_GROUP | CLIENT_UNGROUP)
|
2011-09-04 20:59:31 +04:00
|
|
|
#define CLIENT_MAXFLAGS (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED)
|
|
|
|
#define CLIENT_MAXIMIZED (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED)
|
2007-04-27 21:58:48 +04:00
|
|
|
int flags;
|
2011-05-05 20:40:37 +04:00
|
|
|
int stackingorder;
|
|
|
|
struct winname_q nameq;
|
|
|
|
#define CLIENT_MAXNAMEQLEN 5
|
|
|
|
int nameqlen;
|
|
|
|
char *name;
|
|
|
|
char *label;
|
2007-04-27 21:58:48 +04:00
|
|
|
char *matchname;
|
2008-04-16 00:24:41 +04:00
|
|
|
struct group_ctx *group;
|
2013-12-11 18:09:21 +04:00
|
|
|
XClassHint ch;
|
|
|
|
XWMHints *wmh;
|
2007-04-27 21:58:48 +04:00
|
|
|
};
|
2011-05-05 20:40:37 +04:00
|
|
|
TAILQ_HEAD(client_ctx_q, client_ctx);
|
2007-04-27 21:58:48 +04:00
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
struct group_ctx {
|
|
|
|
TAILQ_ENTRY(group_ctx) entry;
|
2014-09-08 00:57:26 +04:00
|
|
|
struct screen_ctx *sc;
|
2014-09-06 20:08:58 +04:00
|
|
|
char *name;
|
2014-08-20 19:15:29 +04:00
|
|
|
int num;
|
2014-10-08 16:48:51 +04:00
|
|
|
struct client_ctx_q clientq;
|
2011-05-05 20:40:37 +04:00
|
|
|
};
|
|
|
|
TAILQ_HEAD(group_ctx_q, group_ctx);
|
2008-03-23 18:09:21 +03:00
|
|
|
|
2007-04-27 21:58:48 +04:00
|
|
|
struct autogroupwin {
|
2009-12-11 20:51:42 +03:00
|
|
|
TAILQ_ENTRY(autogroupwin) entry;
|
|
|
|
char *class;
|
|
|
|
char *name;
|
|
|
|
int num;
|
2007-04-27 21:58:48 +04:00
|
|
|
};
|
|
|
|
TAILQ_HEAD(autogroupwin_q, autogroupwin);
|
|
|
|
|
2014-02-04 01:07:47 +04:00
|
|
|
struct region_ctx {
|
|
|
|
TAILQ_ENTRY(region_ctx) entry;
|
|
|
|
int num;
|
|
|
|
struct geom area;
|
|
|
|
};
|
|
|
|
TAILQ_HEAD(region_ctx_q, region_ctx);
|
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
struct screen_ctx {
|
|
|
|
TAILQ_ENTRY(screen_ctx) entry;
|
2013-04-29 04:56:47 +04:00
|
|
|
int which;
|
2011-05-05 20:40:37 +04:00
|
|
|
Window rootwin;
|
|
|
|
Window menuwin;
|
2012-05-13 19:17:13 +04:00
|
|
|
int cycling;
|
2014-09-23 17:45:48 +04:00
|
|
|
int hideall;
|
2013-11-27 22:34:34 +04:00
|
|
|
int snapdist;
|
2012-07-13 18:18:04 +04:00
|
|
|
struct geom view; /* viewable area */
|
|
|
|
struct geom work; /* workable area, gap-applied */
|
2011-05-05 20:40:37 +04:00
|
|
|
struct gap gap;
|
2014-09-09 00:11:22 +04:00
|
|
|
struct client_ctx_q clientq;
|
2014-02-04 01:07:47 +04:00
|
|
|
struct region_ctx_q regionq;
|
2013-01-01 18:19:56 +04:00
|
|
|
#define CALMWM_NGROUPS 10
|
2011-05-05 20:40:37 +04:00
|
|
|
struct group_ctx_q groupq;
|
|
|
|
struct group_ctx *group_active;
|
2014-09-23 17:45:48 +04:00
|
|
|
XftColor xftcolor[CWM_COLOR_NITEMS];
|
|
|
|
XftDraw *xftdraw;
|
|
|
|
XftFont *xftfont;
|
2009-01-23 21:58:40 +03:00
|
|
|
};
|
2011-05-05 20:40:37 +04:00
|
|
|
TAILQ_HEAD(screen_ctx_q, screen_ctx);
|
2009-01-23 21:58:40 +03:00
|
|
|
|
2014-01-30 01:13:52 +04:00
|
|
|
struct binding {
|
|
|
|
TAILQ_ENTRY(binding) entry;
|
2009-01-23 21:58:40 +03:00
|
|
|
void (*callback)(struct client_ctx *, union arg *);
|
|
|
|
union arg argument;
|
2014-01-03 19:29:06 +04:00
|
|
|
unsigned int modmask;
|
2014-01-30 01:13:52 +04:00
|
|
|
union press press;
|
2008-04-16 00:24:41 +04:00
|
|
|
int flags;
|
2007-04-27 21:58:48 +04:00
|
|
|
};
|
2014-01-30 01:13:52 +04:00
|
|
|
TAILQ_HEAD(keybinding_q, binding);
|
|
|
|
TAILQ_HEAD(mousebinding_q, binding);
|
2008-06-15 01:48:54 +04:00
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
struct cmd {
|
2014-02-02 19:46:05 +04:00
|
|
|
TAILQ_ENTRY(cmd) entry;
|
|
|
|
char *name;
|
2015-01-19 17:54:16 +03:00
|
|
|
char path[PATH_MAX];
|
2011-05-05 20:40:37 +04:00
|
|
|
};
|
2007-04-27 21:58:48 +04:00
|
|
|
TAILQ_HEAD(cmd_q, cmd);
|
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
struct menu {
|
|
|
|
TAILQ_ENTRY(menu) entry;
|
|
|
|
TAILQ_ENTRY(menu) resultentry;
|
2012-11-07 18:39:44 +04:00
|
|
|
#define MENU_MAXENTRY 200
|
2011-05-05 20:40:37 +04:00
|
|
|
char text[MENU_MAXENTRY + 1];
|
|
|
|
char print[MENU_MAXENTRY + 1];
|
|
|
|
void *ctx;
|
|
|
|
short dummy;
|
|
|
|
short abort;
|
|
|
|
};
|
|
|
|
TAILQ_HEAD(menu_q, menu);
|
|
|
|
|
2007-04-27 21:58:48 +04:00
|
|
|
struct conf {
|
2008-03-23 18:09:21 +03:00
|
|
|
struct keybinding_q keybindingq;
|
2014-01-30 01:13:52 +04:00
|
|
|
struct mousebinding_q mousebindingq;
|
2008-03-23 18:09:21 +03:00
|
|
|
struct autogroupwin_q autogroupq;
|
2014-01-31 02:17:22 +04:00
|
|
|
struct ignore_q ignoreq;
|
2008-03-23 18:09:21 +03:00
|
|
|
struct cmd_q cmdq;
|
2011-05-05 20:40:37 +04:00
|
|
|
#define CONF_STICKY_GROUPS 0x0001
|
2008-03-23 18:09:21 +03:00
|
|
|
int flags;
|
2011-05-05 20:40:37 +04:00
|
|
|
#define CONF_BWIDTH 1
|
2009-01-21 18:04:38 +03:00
|
|
|
int bwidth;
|
2011-05-05 20:40:37 +04:00
|
|
|
#define CONF_MAMOUNT 1
|
2009-02-08 00:07:00 +03:00
|
|
|
int mamount;
|
2011-06-24 10:06:24 +04:00
|
|
|
#define CONF_SNAPDIST 0
|
|
|
|
int snapdist;
|
2010-01-27 06:04:50 +03:00
|
|
|
struct gap gap;
|
2013-07-16 18:04:44 +04:00
|
|
|
char *color[CWM_COLOR_NITEMS];
|
2015-01-19 17:54:16 +03:00
|
|
|
char known_hosts[PATH_MAX];
|
2011-09-03 13:17:16 +04:00
|
|
|
#define CONF_FONT "sans-serif:pixelsize=14:bold"
|
|
|
|
char *font;
|
2013-06-17 21:11:10 +04:00
|
|
|
Cursor cursor[CF_NITEMS];
|
2007-04-27 21:58:48 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* MWM hints */
|
|
|
|
struct mwm_hints {
|
2014-01-03 19:29:06 +04:00
|
|
|
unsigned long flags;
|
|
|
|
unsigned long functions;
|
|
|
|
unsigned long decorations;
|
2007-04-27 21:58:48 +04:00
|
|
|
};
|
2015-05-21 02:54:39 +03:00
|
|
|
#define MWM_HINTS_ELEMENTS 3L
|
|
|
|
|
|
|
|
#define MWM_FLAGS_FUNCTIONS (1<<0)
|
|
|
|
#define MWM_FLAGS_DECORATIONS (1<<1)
|
|
|
|
#define MWM_FLAGS_INPUT_MODE (1<<2)
|
|
|
|
#define MWM_FLAGS_STATUS (1<<3)
|
|
|
|
|
|
|
|
#define MWM_FUNCS_ALL (1<<0)
|
|
|
|
#define MWM_FUNCS_RESIZE (1<<1)
|
|
|
|
#define MWM_FUNCS_MOVE (1<<2)
|
|
|
|
#define MWM_FUNCS_MINIMIZE (1<<3)
|
|
|
|
#define MWM_FUNCS_MAXIMIZE (1<<4)
|
|
|
|
#define MWM_FUNCS_CLOSE (1<<5)
|
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
#define MWM_DECOR_ALL (1<<0)
|
|
|
|
#define MWM_DECOR_BORDER (1<<1)
|
2015-05-21 02:54:39 +03:00
|
|
|
#define MWM_DECOR_RESIZE_HANDLE (1<<2)
|
|
|
|
#define MWM_DECOR_TITLEBAR (1<<3)
|
|
|
|
#define MWM_DECOR_MENU (1<<4)
|
|
|
|
#define MWM_DECOR_MINIMIZE (1<<5)
|
|
|
|
#define MWM_DECOR_MAXIMIZE (1<<6)
|
2008-04-16 00:24:41 +04:00
|
|
|
|
2013-07-16 03:53:19 +04:00
|
|
|
extern Display *X_Dpy;
|
2013-12-13 00:15:07 +04:00
|
|
|
extern Time Last_Event_Time;
|
2013-07-16 03:53:19 +04:00
|
|
|
extern struct screen_ctx_q Screenq;
|
|
|
|
extern struct conf Conf;
|
2014-01-21 19:42:44 +04:00
|
|
|
extern const char *homedir;
|
2013-07-16 03:53:19 +04:00
|
|
|
extern int HasRandr, Randr_ev;
|
|
|
|
|
|
|
|
enum {
|
|
|
|
WM_STATE,
|
|
|
|
WM_DELETE_WINDOW,
|
|
|
|
WM_TAKE_FOCUS,
|
|
|
|
WM_PROTOCOLS,
|
|
|
|
_MOTIF_WM_HINTS,
|
|
|
|
UTF8_STRING,
|
|
|
|
WM_CHANGE_STATE,
|
|
|
|
CWMH_NITEMS
|
|
|
|
};
|
|
|
|
enum {
|
|
|
|
_NET_SUPPORTED,
|
|
|
|
_NET_SUPPORTING_WM_CHECK,
|
|
|
|
_NET_ACTIVE_WINDOW,
|
|
|
|
_NET_CLIENT_LIST,
|
|
|
|
_NET_NUMBER_OF_DESKTOPS,
|
|
|
|
_NET_CURRENT_DESKTOP,
|
|
|
|
_NET_DESKTOP_VIEWPORT,
|
|
|
|
_NET_DESKTOP_GEOMETRY,
|
|
|
|
_NET_VIRTUAL_ROOTS,
|
|
|
|
_NET_SHOWING_DESKTOP,
|
|
|
|
_NET_DESKTOP_NAMES,
|
|
|
|
_NET_WORKAREA,
|
|
|
|
_NET_WM_NAME,
|
|
|
|
_NET_WM_DESKTOP,
|
|
|
|
_NET_CLOSE_WINDOW,
|
|
|
|
_NET_WM_STATE,
|
2014-09-17 20:00:44 +04:00
|
|
|
#define _NET_WM_STATES_NITEMS 6
|
2014-08-25 16:49:19 +04:00
|
|
|
_NET_WM_STATE_STICKY,
|
2013-07-16 03:53:19 +04:00
|
|
|
_NET_WM_STATE_MAXIMIZED_VERT,
|
|
|
|
_NET_WM_STATE_MAXIMIZED_HORZ,
|
2014-09-17 20:00:44 +04:00
|
|
|
_NET_WM_STATE_HIDDEN,
|
2013-12-16 23:02:17 +04:00
|
|
|
_NET_WM_STATE_FULLSCREEN,
|
2013-12-13 18:40:52 +04:00
|
|
|
_NET_WM_STATE_DEMANDS_ATTENTION,
|
2013-07-16 03:53:19 +04:00
|
|
|
EWMH_NITEMS
|
|
|
|
};
|
|
|
|
enum {
|
|
|
|
_NET_WM_STATE_REMOVE,
|
|
|
|
_NET_WM_STATE_ADD,
|
|
|
|
_NET_WM_STATE_TOGGLE
|
|
|
|
};
|
|
|
|
extern Atom cwmh[CWMH_NITEMS];
|
|
|
|
extern Atom ewmh[EWMH_NITEMS];
|
|
|
|
|
2008-04-16 00:24:41 +04:00
|
|
|
__dead void usage(void);
|
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
void client_applysizehints(struct client_ctx *);
|
2013-06-11 01:37:30 +04:00
|
|
|
void client_config(struct client_ctx *);
|
2011-05-05 20:40:37 +04:00
|
|
|
struct client_ctx *client_current(void);
|
2011-06-24 09:40:09 +04:00
|
|
|
void client_cycle(struct screen_ctx *, int);
|
2013-11-27 04:01:23 +04:00
|
|
|
void client_cycle_leave(struct screen_ctx *);
|
2013-11-13 01:25:00 +04:00
|
|
|
void client_delete(struct client_ctx *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void client_draw_border(struct client_ctx *);
|
|
|
|
struct client_ctx *client_find(Window);
|
2013-12-11 18:16:09 +04:00
|
|
|
long client_get_wm_state(struct client_ctx *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void client_getsizehints(struct client_ctx *);
|
|
|
|
void client_hide(struct client_ctx *);
|
2013-01-08 19:16:04 +04:00
|
|
|
void client_htile(struct client_ctx *);
|
2008-04-16 00:24:41 +04:00
|
|
|
void client_lower(struct client_ctx *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void client_map(struct client_ctx *);
|
2013-12-13 00:15:07 +04:00
|
|
|
void client_msg(struct client_ctx *, Atom, Time);
|
2008-04-16 00:24:41 +04:00
|
|
|
void client_move(struct client_ctx *);
|
2014-02-04 00:20:39 +04:00
|
|
|
struct client_ctx *client_init(Window, struct screen_ctx *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void client_ptrsave(struct client_ctx *);
|
|
|
|
void client_ptrwarp(struct client_ctx *);
|
|
|
|
void client_raise(struct client_ctx *);
|
2012-09-09 23:47:47 +04:00
|
|
|
void client_resize(struct client_ctx *, int);
|
2008-04-16 00:24:41 +04:00
|
|
|
void client_send_delete(struct client_ctx *);
|
2013-12-11 18:16:09 +04:00
|
|
|
void client_set_wm_state(struct client_ctx *, long);
|
2013-11-27 04:01:23 +04:00
|
|
|
void client_setactive(struct client_ctx *);
|
2008-04-16 00:24:41 +04:00
|
|
|
void client_setname(struct client_ctx *);
|
2011-06-24 10:06:24 +04:00
|
|
|
int client_snapcalc(int, int, int, int, int);
|
2014-09-17 22:41:44 +04:00
|
|
|
void client_toggle_freeze(struct client_ctx *);
|
|
|
|
void client_toggle_fullscreen(struct client_ctx *);
|
|
|
|
void client_toggle_hidden(struct client_ctx *);
|
|
|
|
void client_toggle_hmaximize(struct client_ctx *);
|
|
|
|
void client_toggle_maximize(struct client_ctx *);
|
|
|
|
void client_toggle_sticky(struct client_ctx *);
|
|
|
|
void client_toggle_vmaximize(struct client_ctx *);
|
2011-09-13 12:41:57 +04:00
|
|
|
void client_transient(struct client_ctx *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void client_unhide(struct client_ctx *);
|
2013-12-13 18:40:52 +04:00
|
|
|
void client_urgency(struct client_ctx *);
|
2013-01-08 19:16:04 +04:00
|
|
|
void client_vtile(struct client_ctx *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void client_warp(struct client_ctx *);
|
2013-12-11 19:41:11 +04:00
|
|
|
void client_wm_hints(struct client_ctx *);
|
2008-04-16 00:24:41 +04:00
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
void group_alltoggle(struct screen_ctx *);
|
|
|
|
void group_autogroup(struct client_ctx *);
|
|
|
|
void group_cycle(struct screen_ctx *, int);
|
2014-09-08 17:51:29 +04:00
|
|
|
void group_hide(struct group_ctx *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void group_hidetoggle(struct screen_ctx *, int);
|
2014-09-17 20:32:53 +04:00
|
|
|
int group_holds_only_hidden(struct group_ctx *);
|
2014-09-17 18:31:37 +04:00
|
|
|
int group_holds_only_sticky(struct group_ctx *);
|
2014-10-08 16:48:51 +04:00
|
|
|
void group_init(struct screen_ctx *, int);
|
2011-05-05 20:40:37 +04:00
|
|
|
void group_movetogroup(struct client_ctx *, int);
|
|
|
|
void group_only(struct screen_ctx *, int);
|
2014-09-08 17:51:29 +04:00
|
|
|
void group_show(struct group_ctx *);
|
2014-09-27 23:04:32 +04:00
|
|
|
void group_toggle_membership_enter(struct client_ctx *);
|
|
|
|
void group_toggle_membership_leave(struct client_ctx *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void group_update_names(struct screen_ctx *);
|
2008-04-16 00:24:41 +04:00
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
void search_match_client(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
|
|
|
void search_match_exec(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
2012-12-17 06:53:29 +04:00
|
|
|
void search_match_exec_path(struct menu_q *,
|
|
|
|
struct menu_q *, char *);
|
2012-11-07 18:39:44 +04:00
|
|
|
void search_match_path_any(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void search_match_text(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
|
|
|
void search_print_client(struct menu *, int);
|
2007-04-27 21:58:48 +04:00
|
|
|
|
2015-06-26 19:11:21 +03:00
|
|
|
struct geom screen_apply_gap(struct screen_ctx *, struct geom);
|
2014-09-07 21:38:38 +04:00
|
|
|
struct screen_ctx *screen_find(Window);
|
2013-12-14 02:39:13 +04:00
|
|
|
struct geom screen_find_xinerama(struct screen_ctx *,
|
|
|
|
int, int, int);
|
2013-04-29 04:56:47 +04:00
|
|
|
void screen_init(int);
|
2012-07-05 21:35:13 +04:00
|
|
|
void screen_update_geometry(struct screen_ctx *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void screen_updatestackingorder(struct screen_ctx *);
|
2008-04-16 00:24:41 +04:00
|
|
|
|
2009-01-23 21:58:40 +03:00
|
|
|
void kbfunc_client_cycle(struct client_ctx *, union arg *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void kbfunc_client_cyclegroup(struct client_ctx *,
|
|
|
|
union arg *);
|
2009-01-23 21:58:40 +03:00
|
|
|
void kbfunc_client_delete(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_group(struct client_ctx *, union arg *);
|
2009-05-14 20:24:04 +04:00
|
|
|
void kbfunc_client_grouponly(struct client_ctx *,
|
|
|
|
union arg *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void kbfunc_client_grouptoggle(struct client_ctx *,
|
2009-01-23 21:58:40 +03:00
|
|
|
union arg *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void kbfunc_client_hide(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_label(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_lower(struct client_ctx *, union arg *);
|
2013-07-08 22:19:22 +04:00
|
|
|
void kbfunc_client_moveresize(struct client_ctx *,
|
|
|
|
union arg *);
|
2009-05-17 21:04:59 +04:00
|
|
|
void kbfunc_client_movetogroup(struct client_ctx *,
|
|
|
|
union arg *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void kbfunc_client_nogroup(struct client_ctx *,
|
2009-01-23 21:58:40 +03:00
|
|
|
union arg *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void kbfunc_client_raise(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_rcycle(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_search(struct client_ctx *, union arg *);
|
2014-09-17 22:41:44 +04:00
|
|
|
void kbfunc_client_toggle_freeze(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void kbfunc_client_toggle_fullscreen(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void kbfunc_client_toggle_hmaximize(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void kbfunc_client_toggle_maximize(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void kbfunc_client_toggle_sticky(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void kbfunc_client_toggle_vmaximize(struct client_ctx *,
|
2009-01-23 21:58:40 +03:00
|
|
|
union arg *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void kbfunc_cmdexec(struct client_ctx *, union arg *);
|
2014-01-23 01:48:27 +04:00
|
|
|
void kbfunc_cwm_status(struct client_ctx *, union arg *);
|
2009-01-23 21:58:40 +03:00
|
|
|
void kbfunc_exec(struct client_ctx *, union arg *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void kbfunc_lock(struct client_ctx *, union arg *);
|
2014-01-30 02:30:00 +04:00
|
|
|
void kbfunc_menu_cmd(struct client_ctx *, union arg *);
|
2009-01-23 21:58:40 +03:00
|
|
|
void kbfunc_ssh(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_term(struct client_ctx *, union arg *);
|
2013-01-08 19:16:04 +04:00
|
|
|
void kbfunc_tile(struct client_ctx *, union arg *);
|
2008-04-16 00:24:41 +04:00
|
|
|
|
2014-01-03 01:30:20 +04:00
|
|
|
void mousefunc_client_move(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void mousefunc_client_resize(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void mousefunc_menu_cmd(struct client_ctx *, union arg *);
|
|
|
|
void mousefunc_menu_group(struct client_ctx *, union arg *);
|
|
|
|
void mousefunc_menu_unhide(struct client_ctx *,
|
|
|
|
union arg *);
|
2008-06-15 01:48:54 +04:00
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
struct menu *menu_filter(struct screen_ctx *, struct menu_q *,
|
2014-01-21 19:42:44 +04:00
|
|
|
const char *, const char *, int,
|
2011-05-05 20:40:37 +04:00
|
|
|
void (*)(struct menu_q *, struct menu_q *, char *),
|
|
|
|
void (*)(struct menu *, int));
|
2014-01-20 22:58:03 +04:00
|
|
|
void menuq_add(struct menu_q *, void *, const char *, ...);
|
2012-12-17 18:32:39 +04:00
|
|
|
void menuq_clear(struct menu_q *);
|
2008-04-16 00:24:41 +04:00
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
int parse_config(const char *, struct conf *);
|
|
|
|
|
2013-07-15 18:50:44 +04:00
|
|
|
void conf_atoms(void);
|
2015-05-17 07:34:01 +03:00
|
|
|
void conf_autogroup(struct conf *, int, const char *,
|
|
|
|
const char *);
|
2014-01-20 23:06:04 +04:00
|
|
|
int conf_bind_kbd(struct conf *, const char *,
|
|
|
|
const char *);
|
|
|
|
int conf_bind_mouse(struct conf *, const char *,
|
|
|
|
const char *);
|
2011-05-05 20:40:37 +04:00
|
|
|
void conf_clear(struct conf *);
|
|
|
|
void conf_client(struct client_ctx *);
|
2014-01-29 22:34:22 +04:00
|
|
|
int conf_cmd_add(struct conf *, const char *,
|
2014-01-21 01:34:32 +04:00
|
|
|
const char *);
|
2013-06-17 21:11:10 +04:00
|
|
|
void conf_cursor(struct conf *);
|
2013-05-23 20:52:39 +04:00
|
|
|
void conf_grab_kbd(Window);
|
|
|
|
void conf_grab_mouse(Window);
|
2011-05-05 20:40:37 +04:00
|
|
|
void conf_init(struct conf *);
|
2014-01-31 02:17:22 +04:00
|
|
|
void conf_ignore(struct conf *, const char *);
|
2013-05-12 01:46:27 +04:00
|
|
|
void conf_screen(struct screen_ctx *);
|
2008-04-16 00:24:41 +04:00
|
|
|
|
2014-01-23 01:48:27 +04:00
|
|
|
void xev_process(void);
|
2007-04-27 21:58:48 +04:00
|
|
|
|
2014-01-03 19:29:06 +04:00
|
|
|
void xu_btn_grab(Window, int, unsigned int);
|
2013-10-19 23:39:34 +04:00
|
|
|
void xu_btn_ungrab(Window);
|
2013-10-03 17:51:57 +04:00
|
|
|
int xu_getprop(Window, Atom, Atom, long, unsigned char **);
|
2011-05-05 20:40:37 +04:00
|
|
|
int xu_getstrprop(Window, Atom, char **);
|
2014-01-03 19:29:06 +04:00
|
|
|
void xu_key_grab(Window, unsigned int, KeySym);
|
2013-10-20 05:55:32 +04:00
|
|
|
void xu_key_ungrab(Window);
|
2011-05-05 20:40:37 +04:00
|
|
|
void xu_ptr_getpos(Window, int *, int *);
|
2014-01-03 19:29:06 +04:00
|
|
|
int xu_ptr_grab(Window, unsigned int, Cursor);
|
|
|
|
int xu_ptr_regrab(unsigned int, Cursor);
|
2011-05-05 20:40:37 +04:00
|
|
|
void xu_ptr_setpos(Window, int, int);
|
|
|
|
void xu_ptr_ungrab(void);
|
2013-05-20 03:38:20 +04:00
|
|
|
void xu_xft_draw(struct screen_ctx *, const char *,
|
2013-05-21 00:21:04 +04:00
|
|
|
int, int, int);
|
2013-05-20 03:38:20 +04:00
|
|
|
int xu_xft_width(XftFont *, const char *, int);
|
2013-05-20 03:09:59 +04:00
|
|
|
void xu_xorcolor(XftColor, XftColor, XftColor *);
|
2012-05-16 05:17:14 +04:00
|
|
|
|
|
|
|
void xu_ewmh_net_supported(struct screen_ctx *);
|
|
|
|
void xu_ewmh_net_supported_wm_check(struct screen_ctx *);
|
2012-07-03 17:49:03 +04:00
|
|
|
void xu_ewmh_net_desktop_geometry(struct screen_ctx *);
|
|
|
|
void xu_ewmh_net_workarea(struct screen_ctx *);
|
|
|
|
void xu_ewmh_net_client_list(struct screen_ctx *);
|
|
|
|
void xu_ewmh_net_active_window(struct screen_ctx *, Window);
|
|
|
|
void xu_ewmh_net_wm_desktop_viewport(struct screen_ctx *);
|
|
|
|
void xu_ewmh_net_wm_number_of_desktops(struct screen_ctx *);
|
|
|
|
void xu_ewmh_net_showing_desktop(struct screen_ctx *);
|
|
|
|
void xu_ewmh_net_virtual_roots(struct screen_ctx *);
|
2014-09-23 18:25:08 +04:00
|
|
|
void xu_ewmh_net_current_desktop(struct screen_ctx *);
|
2014-08-25 18:31:22 +04:00
|
|
|
void xu_ewmh_net_desktop_names(struct screen_ctx *);
|
2012-07-03 17:49:03 +04:00
|
|
|
|
|
|
|
void xu_ewmh_net_wm_desktop(struct client_ctx *);
|
2013-05-21 01:13:58 +04:00
|
|
|
Atom *xu_ewmh_get_net_wm_state(struct client_ctx *, int *);
|
2013-05-21 04:29:20 +04:00
|
|
|
void xu_ewmh_handle_net_wm_state_msg(struct client_ctx *,
|
|
|
|
int, Atom , Atom);
|
2013-05-21 01:13:58 +04:00
|
|
|
void xu_ewmh_set_net_wm_state(struct client_ctx *);
|
|
|
|
void xu_ewmh_restore_net_wm_state(struct client_ctx *);
|
2012-07-03 17:49:03 +04:00
|
|
|
|
2011-05-05 20:40:37 +04:00
|
|
|
void u_exec(char *);
|
2011-06-24 09:40:09 +04:00
|
|
|
void u_spawn(char *);
|
2011-05-05 20:40:37 +04:00
|
|
|
|
|
|
|
void *xcalloc(size_t, size_t);
|
|
|
|
void *xmalloc(size_t);
|
2015-03-29 02:12:47 +03:00
|
|
|
void *xreallocarray(void *, size_t, size_t);
|
2011-05-05 20:40:37 +04:00
|
|
|
char *xstrdup(const char *);
|
2012-11-28 18:32:44 +04:00
|
|
|
int xasprintf(char **, const char *, ...)
|
|
|
|
__attribute__((__format__ (printf, 2, 3)))
|
|
|
|
__attribute__((__nonnull__ (2)));
|
2011-05-05 20:40:37 +04:00
|
|
|
|
2007-04-27 21:58:48 +04:00
|
|
|
#endif /* _CALMWM_H_ */
|