dwm.h (view raw)
1/* See LICENSE file for copyright and license details. */
2#include <X11/Xlib.h>
3
4/* enums */
5enum { BarTop, BarBot, BarOff }; /* bar position */
6enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
7enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
8enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
9enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
10
11/* typedefs */
12typedef struct Client Client;
13struct Client {
14 char name[256];
15 int x, y, w, h;
16 int rx, ry, rw, rh; /* revert geometry */
17 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
18 int minax, maxax, minay, maxay;
19 long flags;
20 unsigned int border, oldborder;
21 Bool isbanned, isfixed, ismax, isfloating, wasfloating;
22 Bool *tags;
23 Client *next;
24 Client *prev;
25 Client *snext;
26 Window win;
27};
28
29typedef struct {
30 int x, y, w, h;
31 unsigned long norm[ColLast];
32 unsigned long sel[ColLast];
33 Drawable drawable;
34 GC gc;
35 struct {
36 int ascent;
37 int descent;
38 int height;
39 XFontSet set;
40 XFontStruct *xfont;
41 } font;
42} DC; /* draw context */
43
44typedef struct {
45 unsigned long mod;
46 KeySym keysym;
47 void (*func)(const char *arg);
48 const char *arg;
49} Key;
50
51typedef struct {
52 const char *symbol;
53 void (*arrange)(void);
54} Layout;
55
56/* functions */
57void applyrules(Client *c);
58void arrange(void);
59void attach(Client *c);
60void attachstack(Client *c);
61void ban(Client *c);
62void buttonpress(XEvent *e);
63void checkotherwm(void);
64void cleanup(void);
65void compileregs(void);
66void configure(Client *c);
67void configurenotify(XEvent *e);
68void configurerequest(XEvent *e);
69void destroynotify(XEvent *e);
70void detach(Client *c);
71void detachstack(Client *c);
72void drawbar(void);
73void drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]);
74void drawtext(const char *text, unsigned long col[ColLast]);
75void *emallocz(unsigned int size);
76void enternotify(XEvent *e);
77void eprint(const char *errstr, ...);
78void expose(XEvent *e);
79void floating(void); /* default floating layout */
80void focus(Client *c);
81void focusnext(const char *arg);
82void focusprev(const char *arg);
83Client *getclient(Window w);
84unsigned long getcolor(const char *colstr);
85long getstate(Window w);
86Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
87void grabbuttons(Client *c, Bool focused);
88unsigned int idxoftag(const char *tag);
89void initfont(const char *fontstr);
90Bool isarrange(void (*func)());
91Bool isoccupied(unsigned int t);
92Bool isprotodel(Client *c);
93Bool isvisible(Client *c);
94void keypress(XEvent *e);
95void killclient(const char *arg);
96void leavenotify(XEvent *e);
97void manage(Window w, XWindowAttributes *wa);
98void mappingnotify(XEvent *e);
99void maprequest(XEvent *e);
100void movemouse(Client *c);
101Client *nexttiled(Client *c);
102void propertynotify(XEvent *e);
103void quit(const char *arg);
104void resize(Client *c, int x, int y, int w, int h, Bool sizehints);
105void resizemouse(Client *c);
106void restack(void);
107void run(void);
108void scan(void);
109void setclientstate(Client *c, long state);
110void setlayout(const char *arg);
111void setmwfact(const char *arg);
112void setup(void);
113void spawn(const char *arg);
114void tag(const char *arg);
115unsigned int textnw(const char *text, unsigned int len);
116unsigned int textw(const char *text);
117void tile(void);
118void togglebar(const char *arg);
119void togglefloating(const char *arg);
120void togglemax(const char *arg);
121void toggletag(const char *arg);
122void toggleview(const char *arg);
123void unban(Client *c);
124void unmanage(Client *c);
125void unmapnotify(XEvent *e);
126void updatebarpos(void);
127void updatesizehints(Client *c);
128void updatetitle(Client *c);
129void view(const char *arg);
130void viewprevtag(const char *arg); /* views previous selected tags */
131int xerror(Display *dpy, XErrorEvent *ee);
132int xerrordummy(Display *dsply, XErrorEvent *ee);
133int xerrorstart(Display *dsply, XErrorEvent *ee);
134void zoom(const char *arg);