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.
|
|
|
|
*
|
2009-01-26 19:16:20 -07:00
|
|
|
* $Id: calmwm.h,v 1.82 2009/01/27 02:16:20 okan Exp $
|
2007-04-27 11:58:48 -06:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _CALMWM_H_
|
|
|
|
#define _CALMWM_H_
|
|
|
|
|
|
|
|
#define CALMWM_MAXNAMELEN 256
|
|
|
|
|
|
|
|
#undef MIN
|
|
|
|
#undef MAX
|
|
|
|
#define MIN(x, y) ((x) < (y) ? (x) : (y))
|
|
|
|
#define MAX(x, y) ((x) > (y) ? (x) : (y))
|
|
|
|
|
2008-03-23 09:09:21 -06:00
|
|
|
#define CONFFILE ".cwmrc"
|
|
|
|
|
2007-04-27 11:58:48 -06:00
|
|
|
#define ChildMask (SubstructureRedirectMask|SubstructureNotifyMask)
|
|
|
|
#define ButtonMask (ButtonPressMask|ButtonReleaseMask)
|
|
|
|
#define MouseMask (ButtonMask|PointerMotionMask)
|
|
|
|
|
|
|
|
struct client_ctx;
|
|
|
|
|
|
|
|
TAILQ_HEAD(cycle_entry_q, client_ctx);
|
|
|
|
|
|
|
|
struct screen_ctx {
|
|
|
|
TAILQ_ENTRY(screen_ctx) entry;
|
|
|
|
|
|
|
|
u_int which;
|
|
|
|
Window rootwin;
|
|
|
|
Window menuwin;
|
|
|
|
Colormap colormap;
|
2009-01-16 08:24:14 -07:00
|
|
|
XColor bgcolor, fgcolor, fccolor, redcolor, graycolor,
|
2007-04-27 11:58:48 -06:00
|
|
|
whitecolor, blackcolor;
|
2009-01-16 08:24:14 -07:00
|
|
|
unsigned long blackpixl, whitepixl, redpixl, bluepixl, graypixl;
|
2008-05-21 08:11:19 -06:00
|
|
|
GC gc;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
|
|
|
int altpersist;
|
|
|
|
|
2008-01-14 08:21:10 -07:00
|
|
|
int xmax;
|
|
|
|
int ymax;
|
|
|
|
|
2007-04-27 11:58:48 -06:00
|
|
|
struct cycle_entry_q mruq;
|
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
XftDraw *xftdraw;
|
|
|
|
XftColor xftcolor;
|
2008-09-29 17:16:46 -06:00
|
|
|
|
|
|
|
int xinerama_no;
|
|
|
|
XineramaScreenInfo *xinerama;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
TAILQ_HEAD(screen_ctx_q, screen_ctx);
|
|
|
|
|
2008-03-26 09:45:42 -06:00
|
|
|
#define CLIENT_PROTO_DELETE 0x01
|
|
|
|
#define CLIENT_PROTO_TAKEFOCUS 0x02
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2008-03-26 09:45:42 -06:00
|
|
|
#define CLIENT_MAXNAMEQLEN 5
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2008-03-26 09:45:42 -06:00
|
|
|
#define CLIENT_HIDDEN 0x01
|
|
|
|
#define CLIENT_IGNORE 0x02
|
|
|
|
#define CLIENT_DOMAXIMIZE 0x04
|
|
|
|
#define CLIENT_MAXIMIZED 0x08
|
|
|
|
#define CLIENT_DOVMAXIMIZE 0x10
|
|
|
|
#define CLIENT_VMAXIMIZED 0x20
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2008-03-26 09:45:42 -06:00
|
|
|
#define CLIENT_HIGHLIGHT_BLUE 1
|
2008-04-15 14:24:41 -06:00
|
|
|
#define CLIENT_HIGHLIGHT_RED 2
|
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);
|
|
|
|
|
|
|
|
struct client_ctx {
|
|
|
|
TAILQ_ENTRY(client_ctx) entry;
|
|
|
|
TAILQ_ENTRY(client_ctx) searchentry;
|
|
|
|
TAILQ_ENTRY(client_ctx) group_entry;
|
|
|
|
TAILQ_ENTRY(client_ctx) mru_entry;
|
|
|
|
|
|
|
|
struct screen_ctx *sc;
|
|
|
|
Window win;
|
|
|
|
XSizeHints *size;
|
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
Colormap cmap;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
|
|
|
u_int bwidth;
|
|
|
|
struct {
|
|
|
|
int x, y, width, height;
|
|
|
|
int min_dx, min_dy;
|
|
|
|
} geom, savegeom;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
int x,y;
|
|
|
|
} ptr;
|
|
|
|
|
|
|
|
int xproto;
|
|
|
|
|
|
|
|
int flags;
|
|
|
|
int state;
|
|
|
|
char *name;
|
|
|
|
struct winname_q nameq;
|
|
|
|
size_t nameqlen;
|
|
|
|
|
|
|
|
char *label;
|
|
|
|
int active;
|
|
|
|
int highlight;
|
|
|
|
|
|
|
|
char *matchname;
|
2008-04-15 14:24:41 -06:00
|
|
|
struct group_ctx *group;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
int stackingorder;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
char *app_class;
|
|
|
|
char *app_name;
|
|
|
|
char *app_cliarg;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
TAILQ_HEAD(client_ctx_q, client_ctx);
|
|
|
|
|
2009-01-11 14:46:48 -07:00
|
|
|
extern const char *shortcut_to_name[];
|
2008-03-23 09:09:21 -06:00
|
|
|
|
2007-04-27 11:58:48 -06:00
|
|
|
struct group_ctx {
|
2008-04-15 14:24:41 -06:00
|
|
|
TAILQ_ENTRY(group_ctx) entry;
|
|
|
|
struct client_ctx_q clients;
|
2009-01-26 17:42:53 -07:00
|
|
|
const char *name;
|
2008-04-15 14:24:41 -06:00
|
|
|
int shortcut;
|
|
|
|
int hidden;
|
|
|
|
int nhidden;
|
|
|
|
int highstack;
|
|
|
|
};
|
2007-04-27 11:58:48 -06:00
|
|
|
|
|
|
|
TAILQ_HEAD(group_ctx_q, group_ctx);
|
|
|
|
|
|
|
|
/* Autogroups */
|
|
|
|
struct autogroupwin {
|
|
|
|
TAILQ_ENTRY(autogroupwin) entry;
|
|
|
|
|
|
|
|
char *class;
|
|
|
|
char *name;
|
|
|
|
char *group;
|
|
|
|
};
|
|
|
|
|
|
|
|
TAILQ_HEAD(autogroupwin_q, autogroupwin);
|
|
|
|
|
|
|
|
/* NULL/0 values indicate match any. */
|
|
|
|
struct xevent {
|
2008-04-15 14:24:41 -06:00
|
|
|
TAILQ_ENTRY(xevent) entry;
|
|
|
|
Window *xev_win;
|
|
|
|
Window *xev_root;
|
|
|
|
int xev_type;
|
|
|
|
void (*xev_cb)(struct xevent *, XEvent *);
|
|
|
|
void *xev_arg;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
TAILQ_HEAD(xevent_q, xevent);
|
|
|
|
|
2008-04-16 07:47:29 -06:00
|
|
|
#define CWM_MOVE 0x01
|
|
|
|
#define CWM_RESIZE 0x02
|
|
|
|
#define CWM_PTRMOVE 0x04
|
|
|
|
#define CWM_BIGMOVE 0x08
|
|
|
|
#define CWM_UP 0x10
|
|
|
|
#define CWM_DOWN 0x20
|
|
|
|
#define CWM_LEFT 0x40
|
|
|
|
#define CWM_RIGHT 0x80
|
2007-06-27 07:28:22 -06:00
|
|
|
|
2008-03-23 09:09:21 -06:00
|
|
|
/*
|
|
|
|
* Match a window.
|
|
|
|
*/
|
2008-04-15 14:24:41 -06:00
|
|
|
#define CONF_MAX_WINTITLE 256
|
2008-03-23 09:09:21 -06:00
|
|
|
struct winmatch {
|
2008-04-15 14:24:41 -06:00
|
|
|
TAILQ_ENTRY(winmatch) entry;
|
2008-05-18 13:43:50 -06:00
|
|
|
char title[CONF_MAX_WINTITLE];
|
2008-03-23 09:09:21 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
TAILQ_HEAD(winmatch_q, winmatch);
|
|
|
|
|
2007-11-28 09:35:52 -07:00
|
|
|
/* for cwm_exec */
|
|
|
|
#define CWM_EXEC_PROGRAM 0x1
|
|
|
|
#define CWM_EXEC_WM 0x2
|
2008-05-19 11:11:19 -06:00
|
|
|
/* for alt-tab */
|
2008-05-19 09:17:50 -06:00
|
|
|
#define CWM_CYCLE 0x0
|
|
|
|
#define CWM_RCYCLE 0x1
|
2008-05-19 11:11:19 -06:00
|
|
|
/* for group cycle */
|
|
|
|
#define CWM_CYCLEGROUP 0x0
|
|
|
|
#define CWM_RCYCLEGROUP 0x1
|
2007-11-28 09:35:52 -07:00
|
|
|
|
2007-04-27 11:58:48 -06:00
|
|
|
#define KBFLAG_NEEDCLIENT 0x01
|
|
|
|
|
|
|
|
#define KBTOGROUP(X) ((X) - 1)
|
|
|
|
|
2009-01-23 11:58:40 -07:00
|
|
|
union arg {
|
|
|
|
char *c;
|
|
|
|
int i;
|
|
|
|
};
|
|
|
|
|
2007-04-27 11:58:48 -06:00
|
|
|
struct keybinding {
|
2009-01-23 11:58:40 -07:00
|
|
|
TAILQ_ENTRY(keybinding) entry;
|
|
|
|
void (*callback)(struct client_ctx *, union arg *);
|
|
|
|
union arg argument;
|
2008-04-15 14:24:41 -06:00
|
|
|
int modmask;
|
|
|
|
int keysym;
|
|
|
|
int keycode;
|
|
|
|
int flags;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
struct cmd {
|
2008-04-15 14:24:41 -06:00
|
|
|
TAILQ_ENTRY(cmd) entry;
|
|
|
|
int flags;
|
|
|
|
char image[MAXPATHLEN];
|
|
|
|
char label[256];
|
2007-04-27 11:58:48 -06:00
|
|
|
/* (argv) */
|
|
|
|
};
|
|
|
|
|
2008-06-14 15:48:54 -06:00
|
|
|
struct mousebinding {
|
|
|
|
int modmask;
|
|
|
|
int button;
|
|
|
|
int context;
|
|
|
|
void (*callback)(struct client_ctx *, void *);
|
|
|
|
TAILQ_ENTRY(mousebinding) entry;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define MOUSEBIND_CTX_ROOT 1
|
|
|
|
#define MOUSEBIND_CTX_WIN 2
|
|
|
|
|
2007-04-27 11:58:48 -06:00
|
|
|
TAILQ_HEAD(keybinding_q, keybinding);
|
|
|
|
TAILQ_HEAD(cmd_q, cmd);
|
2008-06-14 15:48:54 -06:00
|
|
|
TAILQ_HEAD(mousebinding_q, mousebinding);
|
2007-04-27 11:58:48 -06:00
|
|
|
|
|
|
|
/* Global configuration */
|
|
|
|
struct conf {
|
2008-03-23 09:09:21 -06:00
|
|
|
struct keybinding_q keybindingq;
|
|
|
|
struct autogroupwin_q autogroupq;
|
|
|
|
struct winmatch_q ignoreq;
|
|
|
|
char conf_path[MAXPATHLEN];
|
|
|
|
struct cmd_q cmdq;
|
2008-06-14 15:48:54 -06:00
|
|
|
struct mousebinding_q mousebindingq;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
#define CONF_STICKY_GROUPS 0x0001
|
2008-03-23 09:09:21 -06:00
|
|
|
int flags;
|
2009-01-21 08:04:38 -07:00
|
|
|
#define CONF_BWIDTH 1
|
|
|
|
int bwidth;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2008-03-23 09:09:21 -06:00
|
|
|
char termpath[MAXPATHLEN];
|
|
|
|
char lockpath[MAXPATHLEN];
|
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
#define DEFAULTFONTNAME "sans-serif:pixelsize=14:bold"
|
2008-03-23 09:09:21 -06:00
|
|
|
char *DefaultFontName;
|
2008-06-14 20:47:46 -06:00
|
|
|
XftFont *DefaultFont;
|
|
|
|
u_int FontHeight;
|
2008-04-15 14:24:41 -06:00
|
|
|
int gap_top, gap_bottom, gap_left, gap_right;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Menu stuff */
|
|
|
|
|
|
|
|
#define MENU_MAXENTRY 50
|
|
|
|
|
|
|
|
struct menu {
|
2008-04-15 14:24:41 -06:00
|
|
|
TAILQ_ENTRY(menu) entry;
|
|
|
|
TAILQ_ENTRY(menu) resultentry;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
char text[MENU_MAXENTRY + 1];
|
|
|
|
char print[MENU_MAXENTRY + 1];
|
|
|
|
void *ctx;
|
|
|
|
short dummy;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
TAILQ_HEAD(menu_q, menu);
|
|
|
|
|
|
|
|
enum ctltype {
|
|
|
|
CTL_NONE = -1,
|
|
|
|
CTL_ERASEONE = 0, CTL_WIPE, CTL_UP, CTL_DOWN, CTL_RETURN,
|
|
|
|
CTL_ABORT, CTL_ALL
|
|
|
|
};
|
|
|
|
|
|
|
|
/* MWM hints */
|
|
|
|
|
|
|
|
struct mwm_hints {
|
2008-04-15 14:24:41 -06:00
|
|
|
u_long flags;
|
|
|
|
u_long functions;
|
|
|
|
u_long decorations;
|
2007-04-27 11:58:48 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
#define MWM_NUMHINTS 3
|
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
#define PROP_MWM_HINTS_ELEMENTS 3
|
|
|
|
#define MWM_HINTS_DECORATIONS (1 << 1)
|
|
|
|
#define MWM_DECOR_ALL (1 << 0)
|
|
|
|
#define MWM_DECOR_BORDER (1 << 1)
|
|
|
|
|
|
|
|
int input_keycodetrans(KeyCode, u_int, enum ctltype *,
|
2008-05-19 12:07:53 -06:00
|
|
|
char *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
|
|
|
int x_errorhandler(Display *, XErrorEvent *);
|
2008-07-22 14:42:24 -06:00
|
|
|
void x_setup(void);
|
2008-04-15 14:24:41 -06:00
|
|
|
void x_setupscreen(struct screen_ctx *, u_int);
|
|
|
|
__dead void usage(void);
|
|
|
|
|
|
|
|
struct client_ctx *client_find(Window);
|
|
|
|
void client_setup(void);
|
|
|
|
struct client_ctx *client_new(Window, struct screen_ctx *, int);
|
2009-01-17 11:41:50 -07:00
|
|
|
int client_delete(struct client_ctx *);
|
2008-04-15 14:24:41 -06:00
|
|
|
void client_setactive(struct client_ctx *, int);
|
|
|
|
void client_resize(struct client_ctx *);
|
|
|
|
void client_lower(struct client_ctx *);
|
|
|
|
void client_raise(struct client_ctx *);
|
|
|
|
void client_move(struct client_ctx *);
|
|
|
|
void client_leave(struct client_ctx *);
|
|
|
|
void client_send_delete(struct client_ctx *);
|
|
|
|
struct client_ctx *client_current(void);
|
|
|
|
void client_hide(struct client_ctx *);
|
|
|
|
void client_unhide(struct client_ctx *);
|
|
|
|
void client_setname(struct client_ctx *);
|
|
|
|
void client_warp(struct client_ctx *);
|
|
|
|
void client_ptrwarp(struct client_ctx *);
|
|
|
|
void client_ptrsave(struct client_ctx *);
|
|
|
|
void client_draw_border(struct client_ctx *);
|
|
|
|
void client_update(struct client_ctx *);
|
|
|
|
void client_placecalc(struct client_ctx *);
|
|
|
|
void client_maximize(struct client_ctx *);
|
|
|
|
void client_vertmaximize(struct client_ctx *);
|
2008-05-19 11:32:22 -06:00
|
|
|
void client_map(struct client_ctx *);
|
|
|
|
void client_mtf(struct client_ctx *);
|
|
|
|
struct client_ctx *client_cycle(int);
|
|
|
|
struct client_ctx *client_mrunext(struct client_ctx *);
|
|
|
|
struct client_ctx *client_mruprev(struct client_ctx *);
|
|
|
|
void client_gethints(struct client_ctx *);
|
|
|
|
void client_freehints(struct client_ctx *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
2008-05-20 08:50:51 -06:00
|
|
|
struct menu *menu_filter(struct menu_q *, char *, char *, int,
|
|
|
|
void (*)(struct menu_q *, struct menu_q *, char *),
|
|
|
|
void (*)(struct menu *, int));
|
2008-05-21 08:11:19 -06:00
|
|
|
void menu_init(struct screen_ctx *);
|
2008-05-20 08:50:51 -06:00
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
void xev_handle_maprequest(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_unmapnotify(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_destroynotify(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_configurerequest(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_propertynotify(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_enternotify(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_leavenotify(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_buttonpress(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_buttonrelease(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_keypress(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_keyrelease(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_expose(struct xevent *, XEvent *);
|
|
|
|
void xev_handle_clientmessage(struct xevent *, XEvent *);
|
2008-09-29 17:16:46 -06:00
|
|
|
void xev_handle_randr(struct xevent *, XEvent *);
|
2008-07-22 15:01:54 -06:00
|
|
|
void xev_handle_mapping(struct xevent *, XEvent *);
|
2007-04-27 11:58:48 -06:00
|
|
|
|
|
|
|
#define XEV_QUICK(a, b, c, d, e) do { \
|
|
|
|
xev_register(xev_new(a, b, c, d, e)); \
|
|
|
|
} while (0)
|
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
/* XXX should be xu_ */
|
|
|
|
void xev_reconfig(struct client_ctx *);
|
|
|
|
|
|
|
|
void xev_init(void);
|
|
|
|
struct xevent *xev_new(Window *, Window *, int,
|
|
|
|
void (*)(struct xevent *, XEvent *), void *);
|
|
|
|
void xev_register(struct xevent *);
|
|
|
|
void xev_loop(void);
|
|
|
|
|
2009-01-22 08:26:33 -07:00
|
|
|
void xu_getatoms(void);
|
2008-04-15 14:24:41 -06:00
|
|
|
int xu_ptr_grab(Window, int, Cursor);
|
2008-06-17 17:40:33 -06:00
|
|
|
void xu_btn_grab(Window, int, u_int);
|
2008-04-15 14:24:41 -06:00
|
|
|
int xu_ptr_regrab(int, Cursor);
|
|
|
|
void xu_btn_ungrab(Window, int, u_int);
|
|
|
|
void xu_ptr_ungrab(void);
|
|
|
|
void xu_ptr_setpos(Window, int, int);
|
|
|
|
void xu_ptr_getpos(Window, int *, int *);
|
|
|
|
void xu_key_grab(Window, int, int);
|
2008-07-22 14:26:12 -06:00
|
|
|
void xu_key_ungrab(Window, int, int);
|
2008-04-15 14:24:41 -06:00
|
|
|
void xu_sendmsg(struct client_ctx *, Atom, long);
|
|
|
|
int xu_getprop(struct client_ctx *, Atom, Atom, long,
|
|
|
|
u_char **);
|
|
|
|
char *xu_getstrprop(struct client_ctx *, Atom atm);
|
|
|
|
void xu_setstate(struct client_ctx *, int);
|
|
|
|
int xu_getstate(struct client_ctx *, int *);
|
|
|
|
|
|
|
|
int u_spawn(char *);
|
2008-04-15 15:20:56 -06:00
|
|
|
void u_exec(char *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
|
|
|
void xfree(void *);
|
|
|
|
void *xmalloc(size_t);
|
2008-04-16 07:38:09 -06:00
|
|
|
void *xcalloc(size_t, size_t);
|
2008-04-15 14:24:41 -06:00
|
|
|
char *xstrdup(const char *);
|
2007-04-27 11:58:48 -06:00
|
|
|
|
|
|
|
#define XMALLOC(p, t) ((p) = (t *)xmalloc(sizeof * (p)))
|
2008-04-16 07:38:09 -06:00
|
|
|
#define XCALLOC(p, t) ((p) = (t *)xcalloc(1, sizeof * (p)))
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
struct screen_ctx *screen_fromroot(Window);
|
|
|
|
struct screen_ctx *screen_current(void);
|
|
|
|
void screen_updatestackingorder(void);
|
2008-09-29 17:16:46 -06:00
|
|
|
void screen_init_xinerama(struct screen_ctx *);
|
2009-01-14 17:32:35 -07:00
|
|
|
XineramaScreenInfo *screen_find_xinerama(struct screen_ctx *, int, int);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
|
|
|
void conf_setup(struct conf *, const char *);
|
|
|
|
void conf_client(struct client_ctx *);
|
2008-07-22 14:51:54 -06:00
|
|
|
void conf_grab(struct conf *, struct keybinding *);
|
|
|
|
void conf_ungrab(struct conf *, struct keybinding *);
|
2008-04-15 14:24:41 -06:00
|
|
|
void conf_bindname(struct conf *, char *, char *);
|
|
|
|
void conf_unbind(struct conf *, struct keybinding *);
|
2008-06-14 15:48:54 -06:00
|
|
|
void conf_mousebind(struct conf *, char *, char *);
|
|
|
|
void conf_mouseunbind(struct conf *, struct mousebinding *);
|
2008-06-25 16:37:29 -06:00
|
|
|
void conf_grab_mouse(struct client_ctx *);
|
2008-04-15 14:24:41 -06:00
|
|
|
void conf_reload(struct conf *);
|
2008-06-14 20:47:46 -06:00
|
|
|
void conf_font(struct conf *);
|
2009-01-11 14:34:22 -07:00
|
|
|
void conf_init(struct conf *);
|
2009-01-23 12:00:59 -07:00
|
|
|
void conf_clear(struct conf *);
|
2009-01-11 14:34:22 -07:00
|
|
|
void conf_cmd_add(struct conf *, char *, char *, int);
|
|
|
|
|
|
|
|
int parse_config(const char *, struct conf *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
2009-01-23 11:58:40 -07:00
|
|
|
void kbfunc_client_lower(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_raise(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_search(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_hide(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_cycle(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_rcycle(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_cmdexec(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_label(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_delete(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_group(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_client_cyclegroup(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void kbfunc_client_nogroup(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void kbfunc_client_grouptoggle(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void kbfunc_client_maximize(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void kbfunc_client_vmaximize(struct client_ctx *,
|
|
|
|
union arg *);
|
|
|
|
void kbfunc_reload(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_quit_wm(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_moveresize(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_menu_search(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_exec(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_ssh(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_term(struct client_ctx *, union arg *);
|
|
|
|
void kbfunc_lock(struct client_ctx *, union arg *);
|
2008-04-15 14:24:41 -06:00
|
|
|
|
2008-06-14 15:48:54 -06:00
|
|
|
void mousefunc_window_resize(struct client_ctx *, void *);
|
|
|
|
void mousefunc_window_move(struct client_ctx *, void *);
|
|
|
|
void mousefunc_window_grouptoggle(struct client_ctx *,
|
|
|
|
void *);
|
|
|
|
void mousefunc_window_lower(struct client_ctx *, void *);
|
2008-06-25 16:44:42 -06:00
|
|
|
void mousefunc_window_hide(struct client_ctx *, void *);
|
2008-06-14 15:48:54 -06:00
|
|
|
void mousefunc_menu_group(struct client_ctx *, void *);
|
|
|
|
void mousefunc_menu_unhide(struct client_ctx *, void *);
|
|
|
|
void mousefunc_menu_cmd(struct client_ctx *, void *);
|
|
|
|
|
2008-04-15 14:24:41 -06:00
|
|
|
void search_match_client(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
2008-05-19 11:32:22 -06:00
|
|
|
void search_print_client(struct menu *, int);
|
2008-04-15 14:24:41 -06:00
|
|
|
void search_match_text(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
|
|
|
void search_match_exec(struct menu_q *, struct menu_q *,
|
|
|
|
char *);
|
|
|
|
|
|
|
|
void group_init(void);
|
|
|
|
void group_hidetoggle(int);
|
2008-05-19 11:11:19 -06:00
|
|
|
void group_cycle(int);
|
2008-04-15 14:24:41 -06:00
|
|
|
void group_sticky(struct client_ctx *);
|
|
|
|
void group_client_delete(struct client_ctx *);
|
|
|
|
void group_menu(XButtonEvent *);
|
|
|
|
void group_alltoggle(void);
|
|
|
|
void group_sticky_toggle_enter(struct client_ctx *);
|
|
|
|
void group_sticky_toggle_exit(struct client_ctx *);
|
|
|
|
void group_autogroup(struct client_ctx *);
|
|
|
|
|
|
|
|
void font_init(struct screen_ctx *);
|
2008-06-14 20:47:46 -06:00
|
|
|
int font_width(const char *, int);
|
|
|
|
void font_draw(struct screen_ctx *, const char *, int,
|
2008-04-15 14:24:41 -06:00
|
|
|
Drawable, int, int);
|
2008-06-14 20:47:46 -06:00
|
|
|
XftFont *font_make(struct screen_ctx *, const char *);
|
|
|
|
|
|
|
|
#define font_ascent() Conf.DefaultFont->ascent
|
|
|
|
#define font_descent() Conf.DefaultFont->descent
|
|
|
|
#define font_height() Conf.FontHeight
|
2007-04-27 11:58:48 -06:00
|
|
|
|
|
|
|
#define CCTOSC(cc) (cc->sc)
|
|
|
|
|
|
|
|
/* Externs */
|
|
|
|
|
2007-05-28 12:34:27 -06:00
|
|
|
extern Display *X_Dpy;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2007-05-28 12:34:27 -06:00
|
|
|
extern Cursor Cursor_move;
|
|
|
|
extern Cursor Cursor_resize;
|
|
|
|
extern Cursor Cursor_select;
|
|
|
|
extern Cursor Cursor_default;
|
|
|
|
extern Cursor Cursor_question;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2007-05-28 12:34:27 -06:00
|
|
|
extern struct screen_ctx_q Screenq;
|
|
|
|
extern struct screen_ctx *curscreen;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2007-05-28 12:34:27 -06:00
|
|
|
extern struct client_ctx_q Clientq;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2008-09-29 17:16:46 -06:00
|
|
|
extern int HasXinerama, HasRandr, Randr_ev;
|
2007-05-28 12:34:27 -06:00
|
|
|
extern struct conf Conf;
|
2007-04-27 11:58:48 -06:00
|
|
|
|
2009-01-22 08:26:33 -07:00
|
|
|
#define WM_STATE cwm_atoms[0]
|
|
|
|
#define WM_DELETE_WINDOW cwm_atoms[1]
|
|
|
|
#define WM_TAKE_FOCUS cwm_atoms[2]
|
|
|
|
#define WM_PROTOCOLS cwm_atoms[3]
|
|
|
|
#define _MOTIF_WM_HINTS cwm_atoms[4]
|
2009-01-26 17:42:53 -07:00
|
|
|
#define _CWM_GRP cwm_atoms[5]
|
|
|
|
#define CWM_NO_ATOMS 6
|
2009-01-22 08:26:33 -07:00
|
|
|
|
|
|
|
extern Atom cwm_atoms[CWM_NO_ATOMS];
|
|
|
|
|
2007-04-27 11:58:48 -06:00
|
|
|
#endif /* _CALMWM_H_ */
|