JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
applied Eric Mertens patch to mainstream dwm, however this needs testing
[dwm.git] / dwm.h
1 /* See LICENSE file for copyright and license details. */
2 #include <X11/Xlib.h>
3
4 /* enums */
5 enum { BarTop, BarBot, BarOff };                        /* bar position */
6 enum { CurNormal, CurResize, CurMove, CurLast };        /* cursor */
7 enum { ColBorder, ColFG, ColBG, ColLast };              /* color */
8 enum { NetSupported, NetWMName, NetLast };              /* EWMH atoms */
9 enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
10
11 /* typedefs */
12 typedef struct Client Client;
13 struct 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
29 typedef 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
44 typedef struct {
45         unsigned long mod;
46         KeySym keysym;
47         void (*func)(const char *arg);
48         const char *arg;
49 } Key;
50
51 typedef struct {
52         const char *symbol;
53         void (*arrange)(void);
54 } Layout;
55
56 /* functions */
57 void applyrules(Client *c);
58 void arrange(void);
59 void attach(Client *c);
60 void attachstack(Client *c);
61 void ban(Client *c);
62 void buttonpress(XEvent *e);
63 void checkotherwm(void);
64 void cleanup(void);
65 void compileregs(void);
66 void configure(Client *c);
67 void configurenotify(XEvent *e);
68 void configurerequest(XEvent *e);
69 void destroynotify(XEvent *e);
70 void detach(Client *c);
71 void detachstack(Client *c);
72 void drawbar(void);
73 void drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]);
74 void drawtext(const char *text, unsigned long col[ColLast]);
75 void *emallocz(unsigned int size);
76 void enternotify(XEvent *e);
77 void eprint(const char *errstr, ...);
78 void expose(XEvent *e);
79 void floating(void); /* default floating layout */
80 void focus(Client *c);
81 void focusnext(const char *arg);
82 void focusprev(const char *arg);
83 Client *getclient(Window w);
84 unsigned long getcolor(const char *colstr);
85 long getstate(Window w);
86 Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
87 void grabbuttons(Client *c, Bool focused);
88 unsigned int idxoftag(const char *tag);
89 void initfont(const char *fontstr);
90 Bool isarrange(void (*func)());
91 Bool isoccupied(unsigned int t);
92 Bool isprotodel(Client *c);
93 Bool isvisible(Client *c);
94 void keypress(XEvent *e);
95 void killclient(const char *arg);
96 void leavenotify(XEvent *e);
97 void manage(Window w, XWindowAttributes *wa);
98 void mappingnotify(XEvent *e);
99 void maprequest(XEvent *e);
100 void movemouse(Client *c);
101 Client *nexttiled(Client *c);
102 void propertynotify(XEvent *e);
103 void quit(const char *arg);
104 void resize(Client *c, int x, int y, int w, int h, Bool sizehints);
105 void resizemouse(Client *c);
106 void restack(void);
107 void run(void);
108 void scan(void);
109 void setclientstate(Client *c, long state);
110 void setlayout(const char *arg);
111 void setmwfact(const char *arg);
112 void setup(void);
113 void spawn(const char *arg);
114 void tag(const char *arg);
115 unsigned int textnw(const char *text, unsigned int len);
116 unsigned int textw(const char *text);
117 void tile(void);
118 void togglebar(const char *arg);
119 void togglefloating(const char *arg);
120 void togglemax(const char *arg);
121 void toggletag(const char *arg);
122 void toggleview(const char *arg);
123 void unban(Client *c);
124 void unmanage(Client *c);
125 void unmapnotify(XEvent *e);
126 void updatebarpos(void);
127 void updatesizehints(Client *c);
128 void updatetitle(Client *c);
129 void view(const char *arg);
130 void viewprevtag(const char *arg);      /* views previous selected tags */
131 int xerror(Display *dpy, XErrorEvent *ee);
132 int xerrordummy(Display *dsply, XErrorEvent *ee);
133 int xerrorstart(Display *dsply, XErrorEvent *ee);
134 void zoom(const char *arg);