2007-04-27 11:58:48 -06:00
|
|
|
/*
|
|
|
|
* calmwm - the calm window manager
|
|
|
|
*
|
|
|
|
* Copyright (c) 2004 Marius Aamodt Eriksen <marius@monkey.org>
|
|
|
|
*
|
2008-01-11 09:06:44 -07: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.
|
|
|
|
*
|
2017-12-29 13:03:46 -07:00
|
|
|
* $OpenBSD: calmwm.h,v 1.351 2017/12/29 20:03:46 okan Exp $
|
2007-04-27 11:58:48 -06:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CALMWM_H_
|
|
|
|
#define _CALMWM_H_
|
|
|
|
|
2012-05-15 19:04:36 -06:00
|
|
|
#include <X11/XKBlib.h>
|
2009-12-14 20:24:36 -07: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 11:58:48 -06:00
|
|
|
#undef MIN
|
|
|
|
#undef MAX
|
|
|
|
#define MIN(x, y) ((x) < (y) ? (x) : (y))
|
|
|
|
#define MAX(x, y) ((x) > (y) ? (x) : (y))
|
|
|
|
|
2011-05-05 10:40:37 -06:00
|
|
|
#ifndef nitems
|
|
|
|
#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
|
|
|
|
#endif
|
|
|
|
|
2008-03-23 09:09:21 -06:00
|
|
|
#define CONFFILE ".cwmrc"
|
|
|
|
|
2015-08-21 10:52:37 -06:00
|
|
|
#define BUTTONMASK (ButtonPressMask | ButtonReleaseMask)
|
|
|
|
#define MOUSEMASK (BUTTONMASK | PointerMotionMask)
|
2017-12-15 06:13:17 -07:00
|
|
|
#define MENUMASK (MOUSEMASK | ButtonMotionMask | KeyPressMask | \
|
|
|
|
ExposureMask)
|
2015-08-21 10:52:37 -06:00
|
|
|
#define MENUGRABMASK (MOUSEMASK | ButtonMotionMask | StructureNotifyMask)
|
2015-08-21 10:53:48 -06:00
|
|
|
#define IGNOREMODMASK (LockMask | Mod2Mask | 0x2000)
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2015-11-12 11:26:41 -07:00
|
|
|
/* direction/amount */
|
|
|
|
#define CWM_UP 0x0001
|
|
|
|
#define CWM_DOWN 0x0002
|
|
|
|
#define CWM_LEFT 0x0004
|
|
|
|
#define CWM_RIGHT 0x0008
|
|
|
|
#define CWM_BIGAMOUNT 0x0010
|
|
|
|
#define DIRECTIONMASK (CWM_UP | CWM_DOWN | CWM_LEFT | CWM_RIGHT)
|
2011-05-05 10:40:37 -06:00
|
|
|
|
2016-10-18 11:03:30 -06:00
|
|
|
#define CWM_CYCLE_FORWARD 0x0001
|
|
|
|
#define CWM_CYCLE_REVERSE 0x0002
|
|
|
|
#define CWM_CYCLE_INGROUP 0x0004
|
2011-05-05 10:40:37 -06:00
|
|
|
|
2016-10-18 11:03:30 -06:00
|
|
|
enum cwm_status {
|
|
|
|
CWM_QUIT,
|
|
|
|
CWM_RUNNING,
|
|
|
|
CWM_EXEC_WM
|
2014-01-29 14:13:52 -07:00
|
|
|
};
|
2013-06-17 11:11:10 -06:00
|
|
|
enum cursor_font {
|
|
|
|
CF_NORMAL,
|
2016-10-03 12:43:49 -06:00
|
|
|
CF_MOVE,
|
2013-06-17 11:11:10 -06:00
|
|
|
CF_RESIZE,
|
2016-10-03 12:43:49 -06:00
|
|
|
CF_QUESTION,
|
2013-06-17 11:11:10 -06:00
|
|
|
CF_NITEMS
|
|
|
|
};
|
2013-05-19 17:09:59 -06:00
|
|
|
enum color {
|
2011-07-14 05:39:53 -06:00
|
|
|
CWM_COLOR_BORDER_ACTIVE,
|
2009-05-17 17:40:57 -06:00
|
|
|
CWM_COLOR_BORDER_INACTIVE,
|
2013-12-13 07:40:52 -07:00
|
|
|
CWM_COLOR_BORDER_URGENCY,
|
2009-05-17 17:40:57 -06:00
|
|
|
CWM_COLOR_BORDER_GROUP,
|
|
|
|
CWM_COLOR_BORDER_UNGROUP,
|
2013-05-19 17:09:59 -06:00
|
|
|
CWM_COLOR_MENU_FG,
|
|
|
|
CWM_COLOR_MENU_BG,
|
|
|
|
CWM_COLOR_MENU_FONT,
|
|
|
|
CWM_COLOR_MENU_FONT_SEL,
|
2013-07-16 08:04:44 -06:00
|
|
|
CWM_COLOR_NITEMS
|
2009-05-17 17:40:57 -06:00
|
|
|
};
|
|
|
|
|
2012-07-13 08:18:04 -06:00
|
|
|
struct geom {
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
int w;
|
|
|
|
int h;
|
|
|
|
};
|
|
|
|
|
2016-10-18 11:03:30 -06:00
|
|
|
enum apply_gap {
|
|
|
|
CWM_NOGAP = 0,
|
|
|
|
CWM_GAP
|
|
|
|
};
|
2010-01-26 20:04:50 -07:00
|
|
|
struct gap {
|
|
|
|
int top;
|
|
|
|
int bottom;
|
|
|
|
int left;
|
|
|
|
int right;
|
|
|
|
};
|
2009-05-17 17:40:57 -06:00
|
|
|
|
2007-04-27 11:58:48 -06:00
|
|
|
struct winname {
|
2008-07-11 08:21:28 -06:00
|
|
|
TAILQ_ENTRY(winname) entry;
|
|
|
|
char *name;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
2016-10-18 11:03:30 -06:00
|
|
|
TAILQ_HEAD(name_q, winname);
|
2014-01-30 15:17:22 -07:00
|
|
|
TAILQ_HEAD(ignore_q, winname);
|
2007-04-27 11:58:48 -06:00
|
|
|
|
|
|
|
struct client_ctx {
|
2014-09-08 14:11:22 -06:00
|
|
|
TAILQ_ENTRY(client_ctx) entry;
|
|
|
|
TAILQ_ENTRY(client_ctx) group_entry;
|
2007-04-27 11:58:48 -06:00
|
|
|
struct screen_ctx *sc;
|
2015-08-27 12:53:14 -06:00
|
|
|
struct group_ctx *gc;
|
2007-04-27 11:58:48 -06:00
|
|
|
Window win;
|
2012-12-17 11:35:26 -07:00
|
|
|
Colormap colormap;
|
2017-04-26 15:10:54 -06:00
|
|
|
int bwidth; /* border width */
|
2013-12-16 12:02:17 -07:00
|
|
|
struct geom geom, savegeom, fullgeom;
|
2011-09-03 03:42:33 -06:00
|
|
|
struct {
|
2013-11-02 13:13:56 -06:00
|
|
|
long flags; /* defined hints */
|
2011-05-05 10:40:37 -06: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 03:42:33 -06:00
|
|
|
} hint;
|
2007-04-27 11:58:48 -06:00
|
|
|
struct {
|
2011-05-05 10:40:37 -06:00
|
|
|
int x; /* x position */
|
|
|
|
int y; /* y position */
|
2007-04-27 11:58:48 -06:00
|
|
|
} ptr;
|
2015-06-08 09:11:29 -06:00
|
|
|
struct {
|
2015-06-09 07:02:15 -06:00
|
|
|
int h; /* height */
|
2015-06-08 09:11:29 -06:00
|
|
|
int w; /* width */
|
|
|
|
} dim;
|
2011-05-05 10:40:37 -06:00
|
|
|
#define CLIENT_HIDDEN 0x0001
|
|
|
|
#define CLIENT_IGNORE 0x0002
|
2011-09-04 10:59:31 -06:00
|
|
|
#define CLIENT_VMAXIMIZED 0x0004
|
|
|
|
#define CLIENT_HMAXIMIZED 0x0008
|
|
|
|
#define CLIENT_FREEZE 0x0010
|
2012-12-17 10:48:57 -07:00
|
|
|
#define CLIENT_GROUP 0x0020
|
|
|
|
#define CLIENT_UNGROUP 0x0040
|
2013-11-01 08:07:19 -06:00
|
|
|
#define CLIENT_INPUT 0x0080
|
2013-11-08 10:35:12 -07:00
|
|
|
#define CLIENT_WM_DELETE_WINDOW 0x0100
|
|
|
|
#define CLIENT_WM_TAKE_FOCUS 0x0200
|
2013-12-13 07:40:52 -07:00
|
|
|
#define CLIENT_URGENCY 0x0400
|
2013-12-16 12:02:17 -07:00
|
|
|
#define CLIENT_FULLSCREEN 0x0800
|
2014-08-25 06:49:19 -06:00
|
|
|
#define CLIENT_STICKY 0x1000
|
2014-09-10 14:30:38 -06:00
|
|
|
#define CLIENT_ACTIVE 0x2000
|
2017-12-19 07:30:53 -07:00
|
|
|
#define CLIENT_SKIP_PAGER 0x4000
|
|
|
|
#define CLIENT_SKIP_TASKBAR 0x8000
|
|
|
|
|
|
|
|
#define CLIENT_SKIP_CYCLE (CLIENT_HIDDEN | CLIENT_IGNORE | \
|
|
|
|
CLIENT_SKIP_TASKBAR | CLIENT_SKIP_PAGER)
|
2012-12-17 10:48:57 -07:00
|
|
|
#define CLIENT_HIGHLIGHT (CLIENT_GROUP | CLIENT_UNGROUP)
|
2011-09-04 10:59:31 -06:00
|
|
|
#define CLIENT_MAXFLAGS (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED)
|
|
|
|
#define CLIENT_MAXIMIZED (CLIENT_VMAXIMIZED | CLIENT_HMAXIMIZED)
|
2007-04-27 11:58:48 -06:00
|
|
|
int flags;
|
2011-05-05 10:40:37 -06:00
|
|
|
int stackingorder;
|
2016-10-18 11:03:30 -06:00
|
|
|
struct name_q nameq;
|
2011-05-05 10:40:37 -06:00
|
|
|
char *name;
|
|
|
|
char *label;
|
2013-12-11 07:09:21 -07:00
|
|
|
XClassHint ch;
|
|
|
|
XWMHints *wmh;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
2016-10-18 11:03:30 -06:00
|
|
|
TAILQ_HEAD(client_q, client_ctx);
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2011-05-05 10:40:37 -06:00
|
|
|
struct group_ctx {
|
|
|
|
TAILQ_ENTRY(group_ctx) entry;
|
2014-09-07 14:57:26 -06:00
|
|
|
struct screen_ctx *sc;
|
2014-09-06 10:08:58 -06:00
|
|
|
char *name;
|
2014-08-20 09:15:29 -06:00
|
|
|
int num;
|
2016-10-18 11:03:30 -06:00
|
|
|
struct client_q clientq;
|
2011-05-05 10:40:37 -06:00
|
|
|
};
|
2016-10-18 11:03:30 -06:00
|
|
|
TAILQ_HEAD(group_q, group_ctx);
|
2008-03-23 09:09:21 -06:00
|
|
|
|
2016-10-18 11:03:30 -06:00
|
|
|
struct autogroup {
|
|
|
|
TAILQ_ENTRY(autogroup) entry;
|
|
|
|
char *class;
|
|
|
|
char *name;
|
|
|
|
int num;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
2016-10-18 11:03:30 -06:00
|
|
|
TAILQ_HEAD(autogroup_q, autogroup);
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2014-02-03 14:07:47 -07:00
|
|
|
struct region_ctx {
|
|
|
|
TAILQ_ENTRY(region_ctx) entry;
|
|
|
|
int num;
|
2015-11-11 07:22:01 -07:00
|
|
|
struct geom area;
|
2015-11-09 13:03:29 -07:00
|
|
|
struct geom view; /* viewable area */
|
|
|
|
struct geom work; /* workable area, gap-applied */
|
2014-02-03 14:07:47 -07:00
|
|
|
};
|
2016-10-18 11:03:30 -06:00
|
|
|
TAILQ_HEAD(region_q, region_ctx);
|
2014-02-03 14:07:47 -07:00
|
|
|
|
2011-05-05 10:40:37 -06:00
|
|
|
struct screen_ctx {
|
|
|
|
TAILQ_ENTRY(screen_ctx) entry;
|
2013-04-28 18:56:47 -06:00
|
|
|
int which;
|
2011-05-05 10:40:37 -06:00
|
|
|
Window rootwin;
|
2012-05-13 09:17:13 -06:00
|
|
|
int cycling;
|
2014-09-23 07:45:48 -06:00
|
|
|
int hideall;
|
2013-11-27 11:34:34 -07:00
|
|
|
int snapdist;
|
2012-07-13 08:18:04 -06:00
|
|
|
struct geom view; /* viewable area */
|
|
|
|
struct geom work; /* workable area, gap-applied */
|
2011-05-05 10:40:37 -06:00
|
|
|
struct gap gap;
|
2016-10-18 11:03:30 -06:00
|
|
|
struct client_q clientq;
|
|
|
|
struct region_q regionq;
|
|
|
|
struct group_q groupq;
|
2011-05-05 10:40:37 -06:00
|
|
|
struct group_ctx *group_active;
|
2016-09-28 18:21:55 -06:00
|
|
|
struct {
|
|
|
|
Window win;
|
|
|
|
XftDraw *xftdraw;
|
|
|
|
} menu;
|
2014-09-23 07:45:48 -06:00
|
|
|
XftColor xftcolor[CWM_COLOR_NITEMS];
|
|
|
|
XftFont *xftfont;
|
2009-01-23 11:58:40 -07:00
|
|
|
};
|
2016-10-18 11:03:30 -06:00
|
|
|
TAILQ_HEAD(screen_q, screen_ctx);
|
2009-01-23 11:58:40 -07:00
|
|
|
|
2017-05-09 07:40:18 -06:00
|
|
|
struct cargs {
|
|
|
|
char *cmd;
|
|
|
|
int flag;
|
|
|
|
enum {
|
|
|
|
CWM_XEV_KEY,
|
|
|
|
CWM_XEV_BTN
|
|
|
|
} xev;
|
2016-10-18 11:03:30 -06:00
|
|
|
};
|
|
|
|
enum context {
|
2017-05-09 07:40:18 -06:00
|
|
|
CWM_CONTEXT_NONE = 0,
|
2016-10-18 11:03:30 -06:00
|
|
|
CWM_CONTEXT_CC,
|
|
|
|
CWM_CONTEXT_SC
|
|
|
|
};
|
|
|
|
struct bind_ctx {
|
|
|
|
TAILQ_ENTRY(bind_ctx) entry;
|
2017-05-09 07:40:18 -06:00
|
|
|
void (*callback)(void *, struct cargs *);
|
|
|
|
struct cargs *cargs;
|
2016-10-18 11:03:30 -06:00
|
|
|
enum context context;
|
2017-05-09 07:40:18 -06:00
|
|
|
unsigned int modmask;
|
|
|
|
union {
|
|
|
|
KeySym keysym;
|
|
|
|
unsigned int button;
|
|
|
|
} press;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
2016-10-18 11:03:30 -06:00
|
|
|
TAILQ_HEAD(keybind_q, bind_ctx);
|
|
|
|
TAILQ_HEAD(mousebind_q, bind_ctx);
|
2008-06-14 15:48:54 -06:00
|
|
|
|
2016-10-18 11:03:30 -06:00
|
|
|
struct cmd_ctx {
|
|
|
|
TAILQ_ENTRY(cmd_ctx) entry;
|
2014-02-02 08:46:05 -07:00
|
|
|
char *name;
|
2015-01-19 07:54:16 -07:00
|
|
|
char path[PATH_MAX];
|
2011-05-05 10:40:37 -06:00
|
|
|
};
|
2016-10-18 11:03:30 -06:00
|
|
|
TAILQ_HEAD(cmd_q, cmd_ctx);
|
2017-12-29 13:03:46 -07:00
|
|
|
TAILQ_HEAD(wm_q, cmd_ctx);
|
2016-10-18 11:03:30 -06:00
|
|
|
|
|
|
|
#define CWM_MENU_DUMMY 0x0001
|
|
|
|
#define CWM_MENU_FILE 0x0002
|
|
|
|
#define CWM_MENU_LIST 0x0004
|
2016-12-01 11:17:52 -07:00
|
|
|
#define CWM_MENU_WINDOW_ALL 0x0008
|
|
|
|
#define CWM_MENU_WINDOW_HIDDEN 0x0010
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2011-05-05 10:40:37 -06:00
|
|
|
struct menu {
|
|
|
|
TAILQ_ENTRY(menu) entry;
|
|
|
|
TAILQ_ENTRY(menu) resultentry;
|
2012-11-07 07:39:44 -07:00
|
|
|
#define MENU_MAXENTRY 200
|
2011-05-05 10:40:37 -06: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 11:58:48 -06:00
|
|
|
struct conf {
|
2016-10-18 11:03:30 -06:00
|
|
|
struct keybind_q keybindq;
|
|
|
|
struct mousebind_q mousebindq;
|
|
|
|
struct autogroup_q autogroupq;
|
2014-01-30 15:17:22 -07:00
|
|
|
struct ignore_q ignoreq;
|
2008-03-23 09:09:21 -06:00
|
|
|
struct cmd_q cmdq;
|
2017-12-29 13:03:46 -07:00
|
|
|
struct wm_q wmq;
|
2016-10-04 09:18:20 -06:00
|
|
|
int ngroups;
|
2016-10-03 08:42:34 -06:00
|
|
|
int stickygroups;
|
2016-10-04 09:52:32 -06:00
|
|
|
int nameqlen;
|
2009-01-21 08:04:38 -07:00
|
|
|
int bwidth;
|
2009-02-07 14:07:00 -07:00
|
|
|
int mamount;
|
2011-06-24 00:06:24 -06:00
|
|
|
int snapdist;
|
2010-01-26 20:04:50 -07:00
|
|
|
struct gap gap;
|
2013-07-16 08:04:44 -06:00
|
|
|
char *color[CWM_COLOR_NITEMS];
|
2015-01-19 07:54:16 -07:00
|
|
|
char known_hosts[PATH_MAX];
|
2011-09-03 03:17:16 -06:00
|
|
|
char *font;
|
2016-10-05 07:10:59 -06:00
|
|
|
char *wmname;
|
2013-06-17 11:11:10 -06:00
|
|
|
Cursor cursor[CF_NITEMS];
|
2016-10-18 11:03:30 -06:00
|
|
|
int xrandr;
|
|
|
|
int xrandr_event_base;
|
2017-12-07 08:47:14 -07:00
|
|
|
char *homedir;
|
2016-10-18 11:03:30 -06:00
|
|
|
char *wm_argv;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
/* MWM hints */
|
|
|
|
struct mwm_hints {
|
2015-05-20 17:54:39 -06:00
|
|
|
#define MWM_HINTS_ELEMENTS 3L
|
2016-10-03 08:42:34 -06:00
|
|
|
#define MWM_FLAGS_STATUS (1<<3)
|
2015-05-20 17:54:39 -06:00
|
|
|
|
|
|
|
#define MWM_FLAGS_FUNCTIONS (1<<0)
|
|
|
|
#define MWM_FLAGS_DECORATIONS (1<<1)
|
|
|
|
#define MWM_FLAGS_INPUT_MODE (1<<2)
|
2016-10-03 08:42:34 -06:00
|
|
|
unsigned long flags;
|
2015-05-20 17:54:39 -06:00
|
|
|
|
|
|
|
#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)
|
2016-10-03 08:42:34 -06:00
|
|
|
unsigned long functions;
|
2015-05-20 17:54:39 -06:00
|
|
|
|
2011-05-05 10:40:37 -06:00
|
|
|
#define MWM_DECOR_ALL (1<<0)
|
|
|
|
#define MWM_DECOR_BORDER (1<<1)
|
2015-05-20 17:54:39 -06: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)
|
2016-10-03 08:42:34 -06:00
|
|
|
unsigned long decorations;
|
|
|
|
};
|
2008-04-15 14:24:41 -06:00
|
|
|
|
2016-10-18 11:03:30 -06:00
|
|
|
enum cwmh {
|
2013-07-15 17:53:19 -06:00
|
|
|
WM_STATE,
|
|
|
|
WM_DELETE_WINDOW,
|
|
|
|
WM_TAKE_FOCUS,
|
|
|
|
WM_PROTOCOLS,
|
|
|
|
_MOTIF_WM_HINTS,
|
|
|
|
UTF8_STRING,
|
|
|
|
WM_CHANGE_STATE,
|
|
|
|
CWMH_NITEMS
|
|
|
|
};
|
2016-10-18 11:03:30 -06:00
|
|
|
enum ewmh {
|
2013-07-15 17:53:19 -06:00
|
|
|
_NET_SUPPORTED,
|
|
|
|
_NET_SUPPORTING_WM_CHECK,
|
|
|
|
_NET_ACTIVE_WINDOW,
|
|
|
|
_NET_CLIENT_LIST,
|
2015-08-24 09:42:57 -06:00
|
|
|
_NET_CLIENT_LIST_STACKING,
|
2013-07-15 17:53:19 -06:00
|
|
|
_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,
|
2017-12-19 07:30:53 -07:00
|
|
|
#define _NET_WM_STATES_NITEMS 9
|
2014-08-25 06:49:19 -06:00
|
|
|
_NET_WM_STATE_STICKY,
|
2013-07-15 17:53:19 -06:00
|
|
|
_NET_WM_STATE_MAXIMIZED_VERT,
|
|
|
|
_NET_WM_STATE_MAXIMIZED_HORZ,
|
2014-09-17 10:00:44 -06:00
|
|
|
_NET_WM_STATE_HIDDEN,
|
2013-12-16 12:02:17 -07:00
|
|
|
_NET_WM_STATE_FULLSCREEN,
|
2013-12-13 07:40:52 -07:00
|
|
|
_NET_WM_STATE_DEMANDS_ATTENTION,
|
2017-12-19 07:30:53 -07:00
|
|
|
_NET_WM_STATE_SKIP_PAGER,
|
|
|
|
_NET_WM_STATE_SKIP_TASKBAR,
|
2015-08-24 08:56:10 -06:00
|
|
|
_CWM_WM_STATE_FREEZE,
|
2013-07-15 17:53:19 -06:00
|
|
|
EWMH_NITEMS
|
|
|
|
};
|
2016-10-18 11:03:30 -06:00
|
|
|
enum net_wm_state {
|
2013-07-15 17:53:19 -06:00
|
|
|
_NET_WM_STATE_REMOVE,
|
|
|
|
_NET_WM_STATE_ADD,
|
|
|
|
_NET_WM_STATE_TOGGLE
|
|
|
|
};
|
2016-10-18 11:03:30 -06:00
|
|
|
|
|
|
|
extern Display *X_Dpy;
|
|
|
|
extern Time Last_Event_Time;
|
2013-07-15 17:53:19 -06:00
|
|
|
extern Atom cwmh[CWMH_NITEMS];
|
|
|
|
extern Atom ewmh[EWMH_NITEMS];
|
2016-10-18 11:03:30 -06:00
|
|
|
extern struct screen_q Screenq;
|
|
|
|
extern struct conf Conf;
|
2013-07-15 17:53:19 -06:00
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
__dead void usage(void);
|
|
|
|
|
2011-05-05 10:40:37 -06:00
|
|
|
void client_applysizehints(struct client_ctx *);
|
2013-06-10 15:37:30 -06:00
|
|
|
void client_config(struct client_ctx *);
|
2011-05-05 10:40:37 -06:00
|
|
|
struct client_ctx *client_current(void);
|
2011-06-23 23:40:09 -06:00
|
|
|
void client_cycle(struct screen_ctx *, int);
|
2013-11-12 14:25:00 -07:00
|
|
|
void client_delete(struct client_ctx *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void client_draw_border(struct client_ctx *);
|
|
|
|
struct client_ctx *client_find(Window);
|
2013-12-11 07:16:09 -07:00
|
|
|
long client_get_wm_state(struct client_ctx *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void client_getsizehints(struct client_ctx *);
|
|
|
|
void client_hide(struct client_ctx *);
|
2013-01-08 08:16:04 -07:00
|
|
|
void client_htile(struct client_ctx *);
|
2008-04-15 14:24:41 -06:00
|
|
|
void client_lower(struct client_ctx *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void client_map(struct client_ctx *);
|
2013-12-12 13:15:07 -07:00
|
|
|
void client_msg(struct client_ctx *, Atom, Time);
|
2008-04-15 14:24:41 -06:00
|
|
|
void client_move(struct client_ctx *);
|
2017-12-29 11:50:43 -07:00
|
|
|
void client_mtf(struct client_ctx *);
|
2016-09-20 13:11:19 -06:00
|
|
|
int client_inbound(struct client_ctx *, int, int);
|
2016-09-16 08:32:02 -06:00
|
|
|
struct client_ctx *client_init(Window, struct screen_ctx *, int);
|
2017-05-01 06:54:55 -06:00
|
|
|
void client_ptr_inbound(struct client_ctx *, int);
|
2011-05-05 10:40:37 -06:00
|
|
|
void client_ptrsave(struct client_ctx *);
|
|
|
|
void client_ptrwarp(struct client_ctx *);
|
|
|
|
void client_raise(struct client_ctx *);
|
2012-09-09 13:47:47 -06:00
|
|
|
void client_resize(struct client_ctx *, int);
|
2008-04-15 14:24:41 -06:00
|
|
|
void client_send_delete(struct client_ctx *);
|
2013-12-11 07:16:09 -07:00
|
|
|
void client_set_wm_state(struct client_ctx *, long);
|
2013-11-26 17:01:23 -07:00
|
|
|
void client_setactive(struct client_ctx *);
|
2008-04-15 14:24:41 -06:00
|
|
|
void client_setname(struct client_ctx *);
|
2017-12-29 05:54:54 -07:00
|
|
|
void client_show(struct client_ctx *);
|
2011-06-24 00:06:24 -06:00
|
|
|
int client_snapcalc(int, int, int, int, int);
|
2014-09-17 12:41:44 -06: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 *);
|
2017-12-19 07:30:53 -07:00
|
|
|
void client_toggle_skip_pager(struct client_ctx *);
|
|
|
|
void client_toggle_skip_taskbar(struct client_ctx *);
|
2014-09-17 12:41:44 -06:00
|
|
|
void client_toggle_sticky(struct client_ctx *);
|
|
|
|
void client_toggle_vmaximize(struct client_ctx *);
|
2011-09-13 02:41:57 -06:00
|
|
|
void client_transient(struct client_ctx *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void client_unhide(struct client_ctx *);
|
2013-12-13 07:40:52 -07:00
|
|
|
void client_urgency(struct client_ctx *);
|
2013-01-08 08:16:04 -07:00
|
|
|
void client_vtile(struct client_ctx *);
|
2013-12-11 08:41:11 -07:00
|
|
|
void client_wm_hints(struct client_ctx *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
2011-05-05 10:40:37 -06:00
|
|
|
void group_alltoggle(struct screen_ctx *);
|
2015-08-25 12:29:10 -06:00
|
|
|
void group_assign(struct group_ctx *, struct client_ctx *);
|
|
|
|
int group_autogroup(struct client_ctx *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void group_cycle(struct screen_ctx *, int);
|
2014-09-08 07:51:29 -06:00
|
|
|
void group_hide(struct group_ctx *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void group_hidetoggle(struct screen_ctx *, int);
|
2014-09-17 10:32:53 -06:00
|
|
|
int group_holds_only_hidden(struct group_ctx *);
|
2014-09-17 08:31:37 -06:00
|
|
|
int group_holds_only_sticky(struct group_ctx *);
|
2014-10-08 06:48:51 -06:00
|
|
|
void group_init(struct screen_ctx *, int);
|
2011-05-05 10:40:37 -06:00
|
|
|
void group_movetogroup(struct client_ctx *, int);
|
|
|
|
void group_only(struct screen_ctx *, int);
|
2015-08-25 12:29:10 -06:00
|
|
|
int group_restore(struct client_ctx *);
|
2014-09-08 07:51:29 -06:00
|
|
|
void group_show(struct group_ctx *);
|
2017-12-29 09:55:50 -07:00
|
|
|
void group_toggle_membership(struct client_ctx *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void group_update_names(struct screen_ctx *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
2011-05-05 10:40:37 -06:00
|
|
|
void search_match_client(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
|
|
|
void search_match_exec(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
2016-12-01 13:28:19 -07:00
|
|
|
void search_match_path(struct menu_q *, struct menu_q *,
|
2012-11-07 07:39:44 -07:00
|
|
|
char *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void search_match_text(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
2017-12-07 09:03:10 -07:00
|
|
|
void search_match_cmd(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
|
|
|
void search_match_group(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
2017-12-29 13:03:46 -07:00
|
|
|
void search_match_wm(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void search_print_client(struct menu *, int);
|
2015-06-30 12:54:12 -06:00
|
|
|
void search_print_cmd(struct menu *, int);
|
2015-07-12 08:31:47 -06:00
|
|
|
void search_print_group(struct menu *, int);
|
2016-12-06 14:54:10 -07:00
|
|
|
void search_print_text(struct menu *, int);
|
2017-12-29 13:03:46 -07:00
|
|
|
void search_print_wm(struct menu *, int);
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2015-11-11 07:22:01 -07:00
|
|
|
struct region_ctx *region_find(struct screen_ctx *, int, int);
|
2015-06-26 10:11:21 -06:00
|
|
|
struct geom screen_apply_gap(struct screen_ctx *, struct geom);
|
2014-09-07 11:38:38 -06:00
|
|
|
struct screen_ctx *screen_find(Window);
|
2016-10-18 11:03:30 -06:00
|
|
|
struct geom screen_area(struct screen_ctx *, int, int,
|
|
|
|
enum apply_gap);
|
2013-04-28 18:56:47 -06:00
|
|
|
void screen_init(int);
|
2012-07-05 11:35:13 -06:00
|
|
|
void screen_update_geometry(struct screen_ctx *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void screen_updatestackingorder(struct screen_ctx *);
|
2016-10-04 14:15:55 -06:00
|
|
|
void screen_assert_clients_within(struct screen_ctx *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
2017-05-09 07:40:18 -06:00
|
|
|
void kbfunc_cwm_status(void *, struct cargs *);
|
|
|
|
void kbfunc_ptrmove(void *, struct cargs *);
|
2017-12-07 09:25:33 -07:00
|
|
|
void kbfunc_client_snap(void *, struct cargs *);
|
2017-05-09 07:40:18 -06:00
|
|
|
void kbfunc_client_move(void *, struct cargs *);
|
|
|
|
void kbfunc_client_resize(void *, struct cargs *);
|
|
|
|
void kbfunc_client_delete(void *, struct cargs *);
|
|
|
|
void kbfunc_client_lower(void *, struct cargs *);
|
|
|
|
void kbfunc_client_raise(void *, struct cargs *);
|
|
|
|
void kbfunc_client_hide(void *, struct cargs *);
|
|
|
|
void kbfunc_client_toggle_freeze(void *, struct cargs *);
|
|
|
|
void kbfunc_client_toggle_sticky(void *, struct cargs *);
|
2016-10-18 11:03:30 -06:00
|
|
|
void kbfunc_client_toggle_fullscreen(void *,
|
2017-05-09 07:40:18 -06:00
|
|
|
struct cargs *);
|
|
|
|
void kbfunc_client_toggle_maximize(void *, struct cargs *);
|
|
|
|
void kbfunc_client_toggle_hmaximize(void *, struct cargs *);
|
|
|
|
void kbfunc_client_toggle_vmaximize(void *, struct cargs *);
|
|
|
|
void kbfunc_client_htile(void *, struct cargs *);
|
|
|
|
void kbfunc_client_vtile(void *, struct cargs *);
|
|
|
|
void kbfunc_client_cycle(void *, struct cargs *);
|
|
|
|
void kbfunc_client_toggle_group(void *, struct cargs *);
|
|
|
|
void kbfunc_client_movetogroup(void *, struct cargs *);
|
|
|
|
void kbfunc_group_toggle(void *, struct cargs *);
|
|
|
|
void kbfunc_group_only(void *, struct cargs *);
|
|
|
|
void kbfunc_group_cycle(void *, struct cargs *);
|
|
|
|
void kbfunc_group_alltoggle(void *, struct cargs *);
|
|
|
|
void kbfunc_menu_client(void *, struct cargs *);
|
|
|
|
void kbfunc_menu_cmd(void *, struct cargs *);
|
|
|
|
void kbfunc_menu_group(void *, struct cargs *);
|
2017-12-29 13:03:46 -07:00
|
|
|
void kbfunc_menu_wm(void *, struct cargs *);
|
2017-05-09 07:40:18 -06:00
|
|
|
void kbfunc_menu_exec(void *, struct cargs *);
|
|
|
|
void kbfunc_menu_ssh(void *, struct cargs *);
|
2017-07-12 10:56:26 -06:00
|
|
|
void kbfunc_client_menu_label(void *, struct cargs *);
|
2017-05-09 07:40:18 -06:00
|
|
|
void kbfunc_exec_cmd(void *, struct cargs *);
|
|
|
|
void kbfunc_exec_lock(void *, struct cargs *);
|
|
|
|
void kbfunc_exec_term(void *, struct cargs *);
|
|
|
|
|
2016-09-30 09:12:19 -06:00
|
|
|
void menu_windraw(struct screen_ctx *, Window,
|
|
|
|
const char *, ...);
|
2011-05-05 10:40:37 -06:00
|
|
|
struct menu *menu_filter(struct screen_ctx *, struct menu_q *,
|
2014-01-21 08:42:44 -07:00
|
|
|
const char *, const char *, int,
|
2011-05-05 10:40:37 -06:00
|
|
|
void (*)(struct menu_q *, struct menu_q *, char *),
|
|
|
|
void (*)(struct menu *, int));
|
2014-01-20 11:58:03 -07:00
|
|
|
void menuq_add(struct menu_q *, void *, const char *, ...);
|
2012-12-17 07:32:39 -07:00
|
|
|
void menuq_clear(struct menu_q *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
2011-05-05 10:40:37 -06:00
|
|
|
int parse_config(const char *, struct conf *);
|
|
|
|
|
2013-07-15 08:50:44 -06:00
|
|
|
void conf_atoms(void);
|
2015-05-16 22:34:01 -06:00
|
|
|
void conf_autogroup(struct conf *, int, const char *,
|
|
|
|
const char *);
|
2016-11-14 14:25:59 -07:00
|
|
|
int conf_bind_key(struct conf *, const char *,
|
2014-01-20 12:06:04 -07:00
|
|
|
const char *);
|
|
|
|
int conf_bind_mouse(struct conf *, const char *,
|
|
|
|
const char *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void conf_clear(struct conf *);
|
|
|
|
void conf_client(struct client_ctx *);
|
2014-01-29 11:34:22 -07:00
|
|
|
int conf_cmd_add(struct conf *, const char *,
|
2014-01-20 14:34:32 -07:00
|
|
|
const char *);
|
2017-12-29 13:03:46 -07:00
|
|
|
int conf_wm_add(struct conf *, const char *,
|
|
|
|
const char *);
|
2013-06-17 11:11:10 -06:00
|
|
|
void conf_cursor(struct conf *);
|
2013-05-23 10:52:39 -06:00
|
|
|
void conf_grab_kbd(Window);
|
|
|
|
void conf_grab_mouse(Window);
|
2011-05-05 10:40:37 -06:00
|
|
|
void conf_init(struct conf *);
|
2014-01-30 15:17:22 -07:00
|
|
|
void conf_ignore(struct conf *, const char *);
|
2013-05-11 15:46:27 -06:00
|
|
|
void conf_screen(struct screen_ctx *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
2014-01-22 14:48:27 -07:00
|
|
|
void xev_process(void);
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2013-10-03 07:51:57 -06:00
|
|
|
int xu_getprop(Window, Atom, Atom, long, unsigned char **);
|
2011-05-05 10:40:37 -06:00
|
|
|
int xu_getstrprop(Window, Atom, char **);
|
|
|
|
void xu_ptr_getpos(Window, int *, int *);
|
|
|
|
void xu_ptr_setpos(Window, int, int);
|
2013-05-19 17:09:59 -06:00
|
|
|
void xu_xorcolor(XftColor, XftColor, XftColor *);
|
2012-05-15 19:17:14 -06:00
|
|
|
|
|
|
|
void xu_ewmh_net_supported(struct screen_ctx *);
|
|
|
|
void xu_ewmh_net_supported_wm_check(struct screen_ctx *);
|
2012-07-03 07:49:03 -06: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 *);
|
2015-08-24 09:42:57 -06:00
|
|
|
void xu_ewmh_net_client_list_stacking(struct screen_ctx *);
|
2012-07-03 07:49:03 -06:00
|
|
|
void xu_ewmh_net_active_window(struct screen_ctx *, Window);
|
2016-09-16 08:32:02 -06:00
|
|
|
Window xu_ewmh_get_net_active_window(struct screen_ctx *);
|
2012-07-03 07:49:03 -06:00
|
|
|
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 08:25:08 -06:00
|
|
|
void xu_ewmh_net_current_desktop(struct screen_ctx *);
|
2014-08-25 08:31:22 -06:00
|
|
|
void xu_ewmh_net_desktop_names(struct screen_ctx *);
|
2012-07-03 07:49:03 -06:00
|
|
|
|
|
|
|
void xu_ewmh_net_wm_desktop(struct client_ctx *);
|
2013-05-20 15:13:58 -06:00
|
|
|
Atom *xu_ewmh_get_net_wm_state(struct client_ctx *, int *);
|
2013-05-20 18:29:20 -06:00
|
|
|
void xu_ewmh_handle_net_wm_state_msg(struct client_ctx *,
|
|
|
|
int, Atom , Atom);
|
2013-05-20 15:13:58 -06:00
|
|
|
void xu_ewmh_set_net_wm_state(struct client_ctx *);
|
|
|
|
void xu_ewmh_restore_net_wm_state(struct client_ctx *);
|
2012-07-03 07:49:03 -06:00
|
|
|
|
2015-09-16 11:58:25 -06:00
|
|
|
char *u_argv(char * const *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void u_exec(char *);
|
2011-06-23 23:40:09 -06:00
|
|
|
void u_spawn(char *);
|
2011-05-05 10:40:37 -06:00
|
|
|
|
|
|
|
void *xcalloc(size_t, size_t);
|
|
|
|
void *xmalloc(size_t);
|
2015-03-28 17:12:47 -06:00
|
|
|
void *xreallocarray(void *, size_t, size_t);
|
2011-05-05 10:40:37 -06:00
|
|
|
char *xstrdup(const char *);
|
2012-11-28 07:32:44 -07:00
|
|
|
int xasprintf(char **, const char *, ...)
|
|
|
|
__attribute__((__format__ (printf, 2, 3)))
|
|
|
|
__attribute__((__nonnull__ (2)));
|
2011-05-05 10:40:37 -06:00
|
|
|
|
2007-04-27 11:58:48 -06:00
|
|
|
#endif /* _CALMWM_H_ */
|