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.
|
|
|
|
*
|
2016-10-03 08:42:34 -06:00
|
|
|
* $OpenBSD: calmwm.h,v 1.320 2016/10/03 14:42:34 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"
|
2009-12-07 14:20:52 -07:00
|
|
|
#define WMNAME "CWM"
|
2008-03-23 09:09:21 -06:00
|
|
|
|
2015-08-21 10:52:37 -06:00
|
|
|
#define BUTTONMASK (ButtonPressMask | ButtonReleaseMask)
|
|
|
|
#define MOUSEMASK (BUTTONMASK | PointerMotionMask)
|
|
|
|
#define MENUMASK (MOUSEMASK | ButtonMotionMask | ExposureMask)
|
|
|
|
#define MENUGRABMASK (MOUSEMASK | ButtonMotionMask | StructureNotifyMask)
|
|
|
|
#define KEYMASK (KeyPressMask | ExposureMask)
|
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
|
|
|
|
2015-11-10 13:05:33 -07:00
|
|
|
#define CWM_CLIENT_CYCLE 0x0001
|
|
|
|
#define CWM_CLIENT_RCYCLE 0x0002
|
|
|
|
#define CWM_CLIENT_CYCLE_INGRP 0x0004
|
2011-05-05 10:40:37 -06:00
|
|
|
|
2015-11-10 13:05:33 -07:00
|
|
|
#define CWM_CLIENT_TILE_HORIZ 0x0001
|
|
|
|
#define CWM_CLIENT_TILE_VERT 0x0002
|
|
|
|
|
|
|
|
#define CWM_MENU_EXEC 0x0001
|
|
|
|
#define CWM_MENU_EXEC_WM 0x0002
|
2011-05-05 10:40:37 -06:00
|
|
|
|
2012-11-07 07:40:51 -07:00
|
|
|
#define CWM_MENU_DUMMY 0x0001
|
|
|
|
#define CWM_MENU_FILE 0x0002
|
2015-06-05 09:01:51 -06:00
|
|
|
#define CWM_MENU_LIST 0x0004
|
2012-11-07 07:39:44 -07:00
|
|
|
|
2015-11-11 07:22:01 -07:00
|
|
|
#define CWM_GAP 0x0001
|
|
|
|
#define CWM_NOGAP 0x0002
|
|
|
|
|
2015-11-10 13:05:33 -07:00
|
|
|
#define CWM_KBD 0x0001
|
|
|
|
#define CWM_MOUSE 0x0002
|
2013-01-08 08:16:04 -07:00
|
|
|
|
2015-11-10 13:05:33 -07:00
|
|
|
#define CWM_CONTEXT_NONE 0x0000
|
|
|
|
#define CWM_CONTEXT_CLIENT 0x0001
|
|
|
|
#define CWM_CONTEXT_SCREEN 0x0002
|
2014-01-20 16:03:51 -07:00
|
|
|
|
2014-01-22 14:48:27 -07:00
|
|
|
#define CWM_QUIT 0x0000
|
|
|
|
#define CWM_RUNNING 0x0001
|
2015-11-10 13:05:33 -07:00
|
|
|
#define CWM_EXEC_WM 0x0002
|
2014-01-22 14:48:27 -07:00
|
|
|
|
2011-05-05 10:40:37 -06:00
|
|
|
union arg {
|
|
|
|
char *c;
|
|
|
|
int i;
|
|
|
|
};
|
2014-01-29 14:13:52 -07:00
|
|
|
union press {
|
|
|
|
KeySym keysym;
|
|
|
|
unsigned int button;
|
|
|
|
};
|
|
|
|
|
2013-06-17 11:11:10 -06:00
|
|
|
enum cursor_font {
|
|
|
|
CF_DEFAULT,
|
|
|
|
CF_MOVE,
|
|
|
|
CF_NORMAL,
|
|
|
|
CF_QUESTION,
|
|
|
|
CF_RESIZE,
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
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
|
|
|
};
|
|
|
|
TAILQ_HEAD(winname_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;
|
2014-01-03 08:29:06 -07:00
|
|
|
unsigned 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
|
2011-09-04 10:59:31 -06:00
|
|
|
|
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;
|
|
|
|
struct winname_q nameq;
|
|
|
|
#define CLIENT_MAXNAMEQLEN 5
|
|
|
|
int nameqlen;
|
|
|
|
char *name;
|
|
|
|
char *label;
|
2007-04-27 11:58:48 -06:00
|
|
|
char *matchname;
|
2013-12-11 07:09:21 -07:00
|
|
|
XClassHint ch;
|
|
|
|
XWMHints *wmh;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
2011-05-05 10:40:37 -06:00
|
|
|
TAILQ_HEAD(client_ctx_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;
|
2014-10-08 06:48:51 -06:00
|
|
|
struct client_ctx_q clientq;
|
2011-05-05 10:40:37 -06:00
|
|
|
};
|
|
|
|
TAILQ_HEAD(group_ctx_q, group_ctx);
|
2008-03-23 09:09:21 -06:00
|
|
|
|
2007-04-27 11:58:48 -06:00
|
|
|
struct autogroupwin {
|
2009-12-11 10:51:42 -07:00
|
|
|
TAILQ_ENTRY(autogroupwin) entry;
|
|
|
|
char *class;
|
|
|
|
char *name;
|
|
|
|
int num;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
|
|
|
TAILQ_HEAD(autogroupwin_q, autogroupwin);
|
|
|
|
|
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
|
|
|
};
|
|
|
|
TAILQ_HEAD(region_ctx_q, region_ctx);
|
|
|
|
|
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;
|
2014-09-08 14:11:22 -06:00
|
|
|
struct client_ctx_q clientq;
|
2014-02-03 14:07:47 -07:00
|
|
|
struct region_ctx_q regionq;
|
2013-01-01 07:19:56 -07:00
|
|
|
#define CALMWM_NGROUPS 10
|
2011-05-05 10:40:37 -06:00
|
|
|
struct group_ctx_q groupq;
|
|
|
|
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
|
|
|
};
|
2011-05-05 10:40:37 -06:00
|
|
|
TAILQ_HEAD(screen_ctx_q, screen_ctx);
|
2009-01-23 11:58:40 -07:00
|
|
|
|
2014-01-29 14:13:52 -07:00
|
|
|
struct binding {
|
|
|
|
TAILQ_ENTRY(binding) entry;
|
2009-01-23 11:58:40 -07:00
|
|
|
void (*callback)(struct client_ctx *, union arg *);
|
|
|
|
union arg argument;
|
2014-01-03 08:29:06 -07:00
|
|
|
unsigned int modmask;
|
2014-01-29 14:13:52 -07:00
|
|
|
union press press;
|
2015-11-10 13:05:33 -07:00
|
|
|
int context;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
2014-01-29 14:13:52 -07:00
|
|
|
TAILQ_HEAD(keybinding_q, binding);
|
|
|
|
TAILQ_HEAD(mousebinding_q, binding);
|
2008-06-14 15:48:54 -06:00
|
|
|
|
2011-05-05 10:40:37 -06:00
|
|
|
struct cmd {
|
2014-02-02 08:46:05 -07:00
|
|
|
TAILQ_ENTRY(cmd) entry;
|
|
|
|
char *name;
|
2015-01-19 07:54:16 -07:00
|
|
|
char path[PATH_MAX];
|
2011-05-05 10:40:37 -06:00
|
|
|
};
|
2007-04-27 11:58:48 -06:00
|
|
|
TAILQ_HEAD(cmd_q, cmd);
|
|
|
|
|
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 {
|
2008-03-23 09:09:21 -06:00
|
|
|
struct keybinding_q keybindingq;
|
2014-01-29 14:13:52 -07:00
|
|
|
struct mousebinding_q mousebindingq;
|
2008-03-23 09:09:21 -06:00
|
|
|
struct autogroupwin_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;
|
2016-10-03 08:42:34 -06:00
|
|
|
int stickygroups;
|
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;
|
2013-06-17 11:11:10 -06:00
|
|
|
Cursor cursor[CF_NITEMS];
|
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
|
|
|
|
2013-07-15 17:53:19 -06:00
|
|
|
extern Display *X_Dpy;
|
2013-12-12 13:15:07 -07:00
|
|
|
extern Time Last_Event_Time;
|
2013-07-15 17:53:19 -06:00
|
|
|
extern struct screen_ctx_q Screenq;
|
|
|
|
extern struct conf Conf;
|
2015-09-16 11:58:25 -06:00
|
|
|
extern char *wm_argv;
|
2014-01-21 08:42:44 -07:00
|
|
|
extern const char *homedir;
|
2013-07-15 17:53:19 -06: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,
|
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,
|
2015-08-21 10:30:02 -06:00
|
|
|
#define _NET_WM_STATES_NITEMS 7
|
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,
|
2015-08-24 08:56:10 -06:00
|
|
|
_CWM_WM_STATE_FREEZE,
|
2013-07-15 17:53:19 -06: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-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-26 17:01:23 -07:00
|
|
|
void client_cycle_leave(struct screen_ctx *);
|
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 *);
|
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);
|
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 *);
|
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 *);
|
|
|
|
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 *);
|
2014-09-27 13:04:32 -06:00
|
|
|
void group_toggle_membership_enter(struct client_ctx *);
|
|
|
|
void group_toggle_membership_leave(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 *);
|
2012-12-16 19:53:29 -07:00
|
|
|
void search_match_exec_path(struct menu_q *,
|
|
|
|
struct menu_q *, char *);
|
2012-11-07 07:39:44 -07:00
|
|
|
void search_match_path_any(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void search_match_text(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
|
|
|
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);
|
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);
|
2015-11-11 07:22:01 -07:00
|
|
|
struct geom screen_area(struct screen_ctx *, int, int, int);
|
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 *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
2009-01-23 11:58:40 -07:00
|
|
|
void kbfunc_client_cycle(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_delete(struct client_ctx *, union arg *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void kbfunc_client_grouptoggle(struct client_ctx *,
|
2009-01-23 11:58:40 -07:00
|
|
|
union arg *);
|
2011-05-05 10:40:37 -06: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 *);
|
2015-11-12 11:26:41 -07:00
|
|
|
void kbfunc_client_move(struct client_ctx *, union arg *);
|
2009-05-17 11:04:59 -06:00
|
|
|
void kbfunc_client_movetogroup(struct client_ctx *,
|
|
|
|
union arg *);
|
2011-05-05 10:40:37 -06:00
|
|
|
void kbfunc_client_raise(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_rcycle(struct client_ctx *, union arg *);
|
2015-11-12 11:26:41 -07:00
|
|
|
void kbfunc_client_resize(struct client_ctx *, union arg *);
|
2015-11-10 13:05:33 -07:00
|
|
|
void kbfunc_client_tile(struct client_ctx *, union arg *);
|
2014-09-17 12:41:44 -06: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 11:58:40 -07:00
|
|
|
union arg *);
|
2014-01-22 14:48:27 -07:00
|
|
|
void kbfunc_cwm_status(struct client_ctx *, union arg *);
|
2009-01-23 11:58:40 -07:00
|
|
|
void kbfunc_exec(struct client_ctx *, union arg *);
|
2015-11-10 13:05:33 -07:00
|
|
|
void kbfunc_exec_lock(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_exec_term(struct client_ctx *, union arg *);
|
2015-11-12 14:28:03 -07:00
|
|
|
void kbfunc_group_alltoggle(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void kbfunc_group_cycle(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_group_only(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_group_toggle(struct client_ctx *, union arg *);
|
2015-11-10 13:05:33 -07:00
|
|
|
void kbfunc_menu_exec(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_menu_client(struct client_ctx *, union arg *);
|
2014-01-29 15:30:00 -07:00
|
|
|
void kbfunc_menu_cmd(struct client_ctx *, union arg *);
|
2015-07-12 08:31:47 -06:00
|
|
|
void kbfunc_menu_group(struct client_ctx *, union arg *);
|
2015-11-10 13:05:33 -07:00
|
|
|
void kbfunc_menu_ssh(struct client_ctx *, union arg *);
|
2015-11-12 11:26:41 -07:00
|
|
|
void kbfunc_ptrmove(struct client_ctx *, union arg *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
2014-01-02 14:30:20 -07:00
|
|
|
void mousefunc_client_move(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void mousefunc_client_resize(struct client_ctx *,
|
|
|
|
union arg *);
|
2008-06-14 15:48:54 -06:00
|
|
|
|
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 *);
|
2014-01-20 12:06:04 -07:00
|
|
|
int conf_bind_kbd(struct conf *, const char *,
|
|
|
|
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 *);
|
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_ */
|