Mercurial > dwm-meillo
annotate dwm.h @ 129:c478383db7c9
applied sanders no_sizehints for tiled mode patch (thx!)
author | arg@10ksloc.org |
---|---|
date | Thu, 20 Jul 2006 19:09:11 +0200 |
parents | 1480e19f6377 |
children | 30d1302dbe3b |
rev | line source |
---|---|
0 | 1 /* |
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> | |
3 * See LICENSE file for license details. | |
4 */ | |
5 | |
32 | 6 #include <X11/Xlib.h> |
7 | |
125 | 8 /* CUSTOMIZE */ |
2 | 9 |
51 | 10 #define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*" |
78
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
11 #define BGCOLOR "#0a2c2d" |
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
12 #define FGCOLOR "#ddeeee" |
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
13 #define BORDERCOLOR "#176164" |
113
b2445fd41f5e
applied Jukka's patch with s/ModKeyMask/MODKEY/g
arg@10ksloc.org
parents:
105
diff
changeset
|
14 #define MODKEY Mod1Mask /* Mod4Mask */ |
78
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
15 /* |
51 | 16 #define BGCOLOR "#666699" |
59
5d4653de9a1c
implemented dwm reading status text from stdin
Anselm R. Garbe <garbeam@wmii.de>
parents:
58
diff
changeset
|
17 #define FGCOLOR "#eeeeee" |
51 | 18 #define BORDERCOLOR "#9999CC" |
78
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
19 */ |
51 | 20 #define MASTERW 52 /* percent */ |
21 #define WM_PROTOCOL_DELWIN 1 | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
22 |
32 | 23 /* tags */ |
59
5d4653de9a1c
implemented dwm reading status text from stdin
Anselm R. Garbe <garbeam@wmii.de>
parents:
58
diff
changeset
|
24 enum { Tscratch, Tdev, Twww, Twork, TLast }; |
32 | 25 |
125 | 26 /* END CUSTOMIZE */ |
32 | 27 |
51 | 28 typedef union Arg Arg; |
105 | 29 typedef struct Client Client; |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
30 typedef enum Corner Corner; |
34 | 31 typedef struct DC DC; |
32 | 32 typedef struct Fnt Fnt; |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
33 |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
34 union Arg { |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
35 const char **argv; |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
36 int i; |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
37 }; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
38 |
5 | 39 /* atoms */ |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
40 enum { NetSupported, NetWMName, NetLast }; |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
41 enum { WMProtocols, WMDelete, WMLast }; |
0 | 42 |
5 | 43 /* cursor */ |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
44 enum { CurNormal, CurResize, CurMove, CurLast }; |
0 | 45 |
105 | 46 enum Corner { TopLeft, TopRight, BotLeft, BotRight }; |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
47 |
32 | 48 struct Fnt { |
49 int ascent; | |
50 int descent; | |
51 int height; | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
52 XFontSet set; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
53 XFontStruct *xfont; |
32 | 54 }; |
55 | |
34 | 56 struct DC { /* draw context */ |
32 | 57 int x, y, w, h; |
58 unsigned long bg; | |
59 unsigned long fg; | |
60 unsigned long border; | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
61 Drawable drawable; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
62 Fnt font; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
63 GC gc; |
32 | 64 }; |
65 | |
0 | 66 struct Client { |
31 | 67 char name[256]; |
68 char *tags[TLast]; | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
69 int proto; |
115
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
70 int x, y, w, h; |
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
71 int tx, ty, tw, th; /* title */ |
20 | 72 int basew, baseh, incw, inch, maxw, maxh, minw, minh; |
29 | 73 int grav; |
74 unsigned int border; | |
20 | 75 long flags; |
80
8125f908c80c
several additions in mouse handling ;)
Anselm R. Garbe <garbeam@wmii.de>
parents:
78
diff
changeset
|
76 Bool isfloat; |
124
75576e44c1d8
made status bar drawing more robust, implemented togglemax and togglemode, works quite well
arg@10ksloc.org
parents:
115
diff
changeset
|
77 Bool ismax; |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
78 Client *next; |
127
1480e19f6377
using double-linked list in order to get correct prev focus handling
arg@10ksloc.org
parents:
125
diff
changeset
|
79 Client *prev; |
0 | 80 Window win; |
81 Window title; | |
82 }; | |
83 | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
84 extern char *tags[TLast], stext[1024]; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
85 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw; |
53 | 86 extern void (*handler[LASTEvent])(XEvent *); |
87 extern void (*arrange)(Arg *); | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
88 extern Atom wmatom[WMLast], netatom[NetLast]; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
89 extern Bool running, issel; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
90 extern Client *clients, *sel; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
91 extern Cursor cursor[CurLast]; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
92 extern DC dc; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
93 extern Display *dpy; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
94 extern Window root, barwin; |
3
e969f3575b7a
several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents:
2
diff
changeset
|
95 |
5 | 96 /* client.c */ |
75 | 97 extern void ban(Client *c); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
98 extern void focus(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
99 extern void focusnext(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
100 extern void focusprev(Arg *arg); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
101 extern Client *getclient(Window w); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
102 extern Client *getctitle(Window w); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
103 extern void gravitate(Client *c, Bool invert); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
104 extern void higher(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
105 extern void killclient(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
106 extern void lower(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
107 extern void manage(Window w, XWindowAttributes *wa); |
94 | 108 extern void pop(Client *c); |
129
c478383db7c9
applied sanders no_sizehints for tiled mode patch (thx!)
arg@10ksloc.org
parents:
127
diff
changeset
|
109 extern void resize(Client *c, Bool sizehints, Corner sticky); |
74 | 110 extern void setsize(Client *c); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
111 extern void settitle(Client *c); |
124
75576e44c1d8
made status bar drawing more robust, implemented togglemax and togglemode, works quite well
arg@10ksloc.org
parents:
115
diff
changeset
|
112 extern void togglemax(Arg *arg); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
113 extern void unmanage(Client *c); |
75 | 114 extern void zoom(Arg *arg); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
115 |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
116 /* draw.c */ |
75 | 117 extern void drawall(); |
74 | 118 extern void drawstatus(); |
119 extern void drawtitle(Client *c); | |
120 extern unsigned long getcolor(const char *colstr); | |
121 extern void setfont(const char *fontstr); | |
43 | 122 extern unsigned int textw(char *text); |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
123 |
75 | 124 /* event.c */ |
73 | 125 extern void grabkeys(); |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
126 |
43 | 127 /* main.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
128 extern int getproto(Window w); |
75 | 129 extern void quit(Arg *arg); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
130 extern void sendevent(Window w, Atom a, long value); |
75 | 131 extern int xerror(Display *dsply, XErrorEvent *ee); |
43 | 132 |
75 | 133 /* tag.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
134 extern void appendtag(Arg *arg); |
75 | 135 extern void dofloat(Arg *arg); |
136 extern void dotile(Arg *arg); | |
93
c498da7520c7
added heretag command which allows to tag a client of a foreign tag with current tag
Anselm R. Garbe <garbeam@wmii.de>
parents:
84
diff
changeset
|
137 extern Client *getnext(Client *c, unsigned int t); |
127
1480e19f6377
using double-linked list in order to get correct prev focus handling
arg@10ksloc.org
parents:
125
diff
changeset
|
138 extern Client *getprev(Client *c); |
93
c498da7520c7
added heretag command which allows to tag a client of a foreign tag with current tag
Anselm R. Garbe <garbeam@wmii.de>
parents:
84
diff
changeset
|
139 extern void heretag(Arg *arg); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
140 extern void replacetag(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
141 extern void settags(Client *c); |
124
75576e44c1d8
made status bar drawing more robust, implemented togglemax and togglemode, works quite well
arg@10ksloc.org
parents:
115
diff
changeset
|
142 extern void togglemode(Arg *arg); |
73 | 143 extern void view(Arg *arg); |
144 | |
32 | 145 /* util.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
146 extern void *emallocz(unsigned int size); |
75 | 147 extern void eprint(const char *errstr, ...); |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
148 extern void spawn(Arg *arg); |