summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dwm.c116
-rw-r--r--dwm.h114
2 files changed, 115 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;
diff --git a/dwm.h b/dwm.h
index 10834f5..ff50d47 100644
--- a/dwm.h
+++ b/dwm.h
@@ -1,6 +1,13 @@
1/* See LICENSE file for copyright and license details. */ 1/* See LICENSE file for copyright and license details. */
2#include <X11/Xlib.h> 2#include <X11/Xlib.h>
3 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
4/* typedefs */ 11/* typedefs */
5typedef struct Client Client; 12typedef struct Client Client;
6struct Client { 13struct Client {
@@ -18,3 +25,110 @@ struct Client {
18 Client *snext; 25 Client *snext;
19 Window win; 26 Window win;
20}; 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);