dwm.h
author arg@suckless.org
Wed, 17 Oct 2007 12:28:34 +0200
changeset 1034 20ace4ebfd86
parent 1033 a8efbb301ef4
child 1035 2034efee9702
permissions -rw-r--r--
uncommented DEBUG CFLGAS/LDFLAGS
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1029
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
     1
/* See LICENSE file for copyright and license details. */
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
     2
1031
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
     3
/* enums */
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
     4
enum { BarTop, BarBot, BarOff };			/* bar position */
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
     5
enum { CurNormal, CurResize, CurMove, CurLast };	/* cursor */
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
     6
enum { ColBorder, ColFG, ColBG, ColLast };		/* color */
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
     7
enum { NetSupported, NetWMName, NetLast };		/* EWMH atoms */
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
     8
enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
     9
1029
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    10
/* typedefs */
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    11
typedef struct Client Client;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    12
struct Client {
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    13
	char name[256];
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    14
	int x, y, w, h;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    15
	int rx, ry, rw, rh; /* revert geometry */
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    16
	int basew, baseh, incw, inch, maxw, maxh, minw, minh;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    17
	int minax, maxax, minay, maxay;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    18
	long flags;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    19
	unsigned int border, oldborder;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    20
	Bool isbanned, isfixed, ismax, isfloating, wasfloating;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    21
	Bool *tags;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    22
	Client *next;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    23
	Client *prev;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    24
	Client *snext;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    25
	Window win;
2388a478f146 recreated dwm.h
Anselm R. Garbe <garbeam@gmail.com>
parents:
diff changeset
    26
};
1031
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    27
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    28
typedef struct {
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    29
	int x, y, w, h;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    30
	unsigned long norm[ColLast];
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    31
	unsigned long sel[ColLast];
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    32
	Drawable drawable;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    33
	GC gc;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    34
	struct {
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    35
		int ascent;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    36
		int descent;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    37
		int height;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    38
		XFontSet set;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    39
		XFontStruct *xfont;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    40
	} font;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    41
} DC; /* draw context */
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    42
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    43
typedef struct {
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    44
	unsigned long mod;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    45
	KeySym keysym;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    46
	void (*func)(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    47
	const char *arg;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    48
} Key;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    49
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    50
typedef struct {
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    51
	const char *symbol;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    52
	void (*arrange)(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    53
} Layout;
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    54
1033
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
    55
typedef struct {
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
    56
	const char *prop;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
    57
	const char *tags;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
    58
	Bool isfloating;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
    59
} Rule;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
    60
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
    61
typedef struct {
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
    62
	regex_t *propregex;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
    63
	regex_t *tagregex;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
    64
} Regs;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
    65
1031
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    66
/* functions */
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    67
void applyrules(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    68
void arrange(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    69
void attach(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    70
void attachstack(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    71
void ban(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    72
void buttonpress(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    73
void checkotherwm(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    74
void cleanup(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    75
void compileregs(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    76
void configure(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    77
void configurenotify(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    78
void configurerequest(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    79
void destroynotify(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    80
void detach(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    81
void detachstack(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    82
void drawbar(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    83
void drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    84
void drawtext(const char *text, unsigned long col[ColLast]);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    85
void *emallocz(unsigned int size);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    86
void enternotify(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    87
void eprint(const char *errstr, ...);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    88
void expose(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    89
void floating(void); /* default floating layout */
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    90
void focus(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    91
void focusnext(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    92
void focusprev(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    93
Client *getclient(Window w);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    94
unsigned long getcolor(const char *colstr);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    95
long getstate(Window w);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    96
Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    97
void grabbuttons(Client *c, Bool focused);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    98
unsigned int idxoftag(const char *tag);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
    99
void initfont(const char *fontstr);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   100
Bool isarrange(void (*func)());
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   101
Bool isoccupied(unsigned int t);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   102
Bool isprotodel(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   103
Bool isvisible(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   104
void keypress(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   105
void killclient(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   106
void leavenotify(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   107
void manage(Window w, XWindowAttributes *wa);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   108
void mappingnotify(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   109
void maprequest(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   110
void movemouse(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   111
Client *nexttiled(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   112
void propertynotify(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   113
void quit(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   114
void resize(Client *c, int x, int y, int w, int h, Bool sizehints);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   115
void resizemouse(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   116
void restack(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   117
void run(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   118
void scan(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   119
void setclientstate(Client *c, long state);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   120
void setlayout(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   121
void setmwfact(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   122
void setup(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   123
void spawn(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   124
void tag(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   125
unsigned int textnw(const char *text, unsigned int len);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   126
unsigned int textw(const char *text);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   127
void tile(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   128
void togglebar(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   129
void togglefloating(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   130
void togglemax(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   131
void toggletag(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   132
void toggleview(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   133
void unban(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   134
void unmanage(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   135
void unmapnotify(XEvent *e);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   136
void updatebarpos(void);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   137
void updatesizehints(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   138
void updatetitle(Client *c);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   139
void view(const char *arg);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   140
void viewprevtag(const char *arg);	/* views previous selected tags */
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   141
int xerror(Display *dpy, XErrorEvent *ee);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   142
int xerrordummy(Display *dsply, XErrorEvent *ee);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   143
int xerrorstart(Display *dsply, XErrorEvent *ee);
7216ff510041 cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Anselm R. Garbe <garbeam@gmail.com>
parents: 1029
diff changeset
   144
void zoom(const char *arg);
1033
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   145
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   146
/* variables */
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   147
char stext[256];
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   148
double mwfact;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   149
int screen, sx, sy, sw, sh, wax, way, waw, wah;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   150
int (*xerrorxlib)(Display *, XErrorEvent *);
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   151
unsigned int bh, bpos;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   152
unsigned int blw = 0;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   153
unsigned int ltidx = 0; /* default */
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   154
unsigned int nlayouts = 0;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   155
unsigned int nrules = 0;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   156
unsigned int numlockmask = 0;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   157
void (*handler[LASTEvent]) (XEvent *) = {
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   158
	[ButtonPress] = buttonpress,
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   159
	[ConfigureRequest] = configurerequest,
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   160
	[ConfigureNotify] = configurenotify,
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   161
	[DestroyNotify] = destroynotify,
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   162
	[EnterNotify] = enternotify,
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   163
	[LeaveNotify] = leavenotify,
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   164
	[Expose] = expose,
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   165
	[KeyPress] = keypress,
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   166
	[MappingNotify] = mappingnotify,
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   167
	[MapRequest] = maprequest,
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   168
	[PropertyNotify] = propertynotify,
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   169
	[UnmapNotify] = unmapnotify
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   170
};
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   171
Atom wmatom[WMLast], netatom[NetLast];
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   172
Bool otherwm, readin;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   173
Bool running = True;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   174
Bool selscreen = True;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   175
Client *clients = NULL;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   176
Client *sel = NULL;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   177
Client *stack = NULL;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   178
Cursor cursor[CurLast];
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   179
Display *dpy;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   180
DC dc = {0};
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   181
Window barwin, root;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   182
Regs *regs = NULL;
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   183
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   184
/* configuration, allows nested code to access above variables */
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   185
#include "config.h"
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   186
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   187
/* Statically define the number of tags. */
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   188
unsigned int ntags = sizeof tags / sizeof tags[0];
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   189
Bool seltags[sizeof tags / sizeof tags[0]] = {[0] = True};
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   190
Bool prevtags[sizeof tags / sizeof tags[0]] = {[0] = True};
a8efbb301ef4 just making dwm.h saner
arg@suckless.org
parents: 1031
diff changeset
   191