summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@gmail.com>2007-10-16 19:04:49 +0200
committerAnselm R. Garbe <garbeam@gmail.com>2007-10-16 19:04:49 +0200
commit5a04edecb1eb3a49f659938f7d2eba11d42760ae (patch)
treeffebf04ac2208c7348e0e29275727e466562c4a3 /dwm.c
parentsmall comment (diff)
downloaddwm-5a04edecb1eb3a49f659938f7d2eba11d42760ae.tar.gz
dwm-5a04edecb1eb3a49f659938f7d2eba11d42760ae.zip
cleaned up dwm.c/dwm.h somewhat that it allows easier integration of patches
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c116
1 files changed, 1 insertions, 115 deletions
diff --git a/dwm.c b/dwm.c
index af07638..a27a1ca 100644
--- a/dwm.c
+++ b/dwm.c
@@ -49,41 +49,7 @@
49#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask)) 49#define CLEANMASK(mask) (mask & ~(numlockmask | LockMask))
50#define MOUSEMASK (BUTTONMASK | PointerMotionMask) 50#define MOUSEMASK (BUTTONMASK | PointerMotionMask)
51 51
52/* enums */ 52/* local typedefs */
53enum { BarTop, BarBot, BarOff }; /* bar position */
54enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
55enum { ColBorder, ColFG, ColBG, ColLast }; /* color */
56enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
57enum { WMProtocols, WMDelete, WMName, WMState, WMLast };/* default atoms */
58
59/* typedefs */
60typedef struct {
61 int x, y, w, h;
62 unsigned long norm[ColLast];
63 unsigned long sel[ColLast];
64 Drawable drawable;
65 GC gc;
66 struct {
67 int ascent;
68 int descent;
69 int height;
70 XFontSet set;
71 XFontStruct *xfont;
72 } font;
73} DC; /* draw context */
74
75typedef struct {
76 unsigned long mod;
77 KeySym keysym;
78 void (*func)(const char *arg);
79 const char *arg;
80} Key;
81
82typedef struct {
83 const char *symbol;
84 void (*arrange)(void);
85} Layout;
86
87typedef struct { 53typedef struct {
88 const char *prop; 54 const char *prop;
89 const char *tags; 55 const char *tags;
@@ -95,86 +61,6 @@ typedef struct {
95 regex_t *tagregex; 61 regex_t *tagregex;
96} Regs; 62} Regs;
97 63
98/* forward declarations */
99void applyrules(Client *c);
100void arrange(void);
101void attach(Client *c);
102void attachstack(Client *c);
103void ban(Client *c);
104void buttonpress(XEvent *e);
105void checkotherwm(void);
106void cleanup(void);
107void compileregs(void);
108void configure(Client *c);
109void configurenotify(XEvent *e);
110void configurerequest(XEvent *e);
111void destroynotify(XEvent *e);
112void detach(Client *c);
113void detachstack(Client *c);
114void drawbar(void);
115void drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]);
116void drawtext(const char *text, unsigned long col[ColLast]);
117void *emallocz(unsigned int size);
118void enternotify(XEvent *e);
119void eprint(const char *errstr, ...);
120void expose(XEvent *e);
121void floating(void); /* default floating layout */
122void focus(Client *c);
123void focusnext(const char *arg);
124void focusprev(const char *arg);
125Client *getclient(Window w);
126unsigned long getcolor(const char *colstr);
127long getstate(Window w);
128Bool gettextprop(Window w, Atom atom, char *text, unsigned int size);
129void grabbuttons(Client *c, Bool focused);
130unsigned int idxoftag(const char *tag);
131void initfont(const char *fontstr);
132Bool isarrange(void (*func)());
133Bool isoccupied(unsigned int t);
134Bool isprotodel(Client *c);
135Bool isvisible(Client *c);
136void keypress(XEvent *e);
137void killclient(const char *arg);
138void leavenotify(XEvent *e);
139void manage(Window w, XWindowAttributes *wa);
140void mappingnotify(XEvent *e);
141void maprequest(XEvent *e);
142void movemouse(Client *c);
143Client *nexttiled(Client *c);
144void propertynotify(XEvent *e);
145void quit(const char *arg);
146void resize(Client *c, int x, int y, int w, int h, Bool sizehints);
147void resizemouse(Client *c);
148void restack(void);
149void run(void);
150void scan(void);
151void setclientstate(Client *c, long state);
152void setlayout(const char *arg);
153void setmwfact(const char *arg);
154void setup(void);
155void spawn(const char *arg);
156void tag(const char *arg);
157unsigned int textnw(const char *text, unsigned int len);
158unsigned int textw(const char *text);
159void tile(void);
160void togglebar(const char *arg);
161void togglefloating(const char *arg);
162void togglemax(const char *arg);
163void toggletag(const char *arg);
164void toggleview(const char *arg);
165void unban(Client *c);
166void unmanage(Client *c);
167void unmapnotify(XEvent *e);
168void updatebarpos(void);
169void updatesizehints(Client *c);
170void updatetitle(Client *c);
171void view(const char *arg);
172void viewprevtag(const char *arg); /* views previous selected tags */
173int xerror(Display *dpy, XErrorEvent *ee);
174int xerrordummy(Display *dsply, XErrorEvent *ee);
175int xerrorstart(Display *dsply, XErrorEvent *ee);
176void zoom(const char *arg);
177
178/* variables */ 64/* variables */
179char stext[256]; 65char stext[256];
180double mwfact; 66double mwfact;