summaryrefslogtreecommitdiff
path: root/src/defs.h
blob: 95d17e7f6b8b1dc3dc1db1b00f1430387c21d65a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef DEFS_H
#define DEFS_H

#include <stdint.h>
#include <X11/Xlib.h>

#define SXWM_VERSION	"sxwm ver. 0.1.3"
#define SXWM_AUTHOR		"(C) Abhinav Prasai 2025"
#define SXWM_LICINFO	"See LICENSE for more info"

#define ALT		Mod1Mask
#define SUPER	Mod4Mask
#define SHIFT	ShiftMask

#define LENGTH(X) (sizeof X / sizeof X[0])
#define BIND(mod, key, cmdstr)	{ (mod), XK_##key, { cmdstr }, 0 }
#define CALL(mod, key, fnptr)	{ (mod), XK_##key, { .fn = fnptr }, 1 }
#define CMD(name, ...) \
	static const char *name[] = { __VA_ARGS__, NULL }

#define UDIST(a,b) abs((int)(a) - (int)(b))
#define MAXCLIENTS	64
#define MAXGAPS		100

enum { DRAG_NONE, DRAG_MOVE, DRAG_RESIZE } drag_mode = DRAG_NONE;
typedef void (*EventHandler)(XEvent *);

typedef union {
	const char **cmd;
	void (*fn)(void);
} Action;

typedef struct {
	unsigned int mods;
	KeySym keysym;
	Action action;
	int is_func;
} Binding;

typedef struct Client{
	Window win;
	uint x, y, h, w;
	Bool floating;
	struct Client *next;
} Client;

#endif