annotate dwm.h @ 167:c11f86db4550 0.6

removed config.h (stupid hg)
author arg@10ksloc.org
date Wed, 02 Aug 2006 16:52:02 +0200
parents e0535db04dfe
children 1db04019684e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
1 /*
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
3 * See LICENSE file for license details.
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
4 */
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
5
166
e0535db04dfe removed the CONFIG variable from config.mk, renamed config.h into config.default.h, after first clone/extract one needs to copy config.default.h to config.h, that is easier than always heavy typing make CONFIG=blafasel
arg@10ksloc.org
parents: 164
diff changeset
6 #include "config.h"
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
7 #include <X11/Xlib.h>
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
8
143
36cabfe408cd applied Sanders patches
arg@10ksloc.org
parents: 142
diff changeset
9 /* mask shorthands, used in event.c and client.c */
150
a26b32ff8911 cleaned config.*h to prevent some confusion
arg@10ksloc.org
parents: 148
diff changeset
10 #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask)
a26b32ff8911 cleaned config.*h to prevent some confusion
arg@10ksloc.org
parents: 148
diff changeset
11 #define MOUSEMASK (BUTTONMASK | PointerMotionMask)
157
93012e947eae renamed WM_PROTOCOL_DELWIN into PROTODELWIN
arg@10ksloc.org
parents: 150
diff changeset
12 #define PROTODELWIN 1
143
36cabfe408cd applied Sanders patches
arg@10ksloc.org
parents: 142
diff changeset
13
51
035617ee18d1 new stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 50
diff changeset
14 typedef union Arg Arg;
105
3e74cc981e9b refactored Sanders code somewhat
arg@10ksloc.org
parents: 99
diff changeset
15 typedef struct Client Client;
34
cd30cce52b78 added logo+description
Anselm R. Garbe <garbeam@wmii.de>
parents: 33
diff changeset
16 typedef struct DC DC;
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
17 typedef struct Fnt Fnt;
49
466591c2f967 implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents: 46
diff changeset
18
466591c2f967 implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents: 46
diff changeset
19 union Arg {
466591c2f967 implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents: 46
diff changeset
20 const char **argv;
466591c2f967 implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents: 46
diff changeset
21 int i;
466591c2f967 implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents: 46
diff changeset
22 };
18
1efa34c6e1b6 added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents: 16
diff changeset
23
5
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
24 /* atoms */
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
25 enum { NetSupported, NetWMName, NetLast };
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
26 enum { WMProtocols, WMDelete, WMLast };
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
27
5
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
28 /* cursor */
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
29 enum { CurNormal, CurResize, CurMove, CurLast };
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
30
143
36cabfe408cd applied Sanders patches
arg@10ksloc.org
parents: 142
diff changeset
31 /* windowcorners */
36cabfe408cd applied Sanders patches
arg@10ksloc.org
parents: 142
diff changeset
32 typedef enum { TopLeft, TopRight, BotLeft, BotRight } Corner;
99
a19556fe83b5 applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents: 95
diff changeset
33
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
34 struct Fnt {
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
35 int ascent;
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
36 int descent;
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
37 int height;
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
38 XFontSet set;
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
39 XFontStruct *xfont;
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
40 };
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
41
34
cd30cce52b78 added logo+description
Anselm R. Garbe <garbeam@wmii.de>
parents: 33
diff changeset
42 struct DC { /* draw context */
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
43 int x, y, w, h;
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
44 unsigned long bg;
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
45 unsigned long fg;
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
46 unsigned long border;
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
47 Drawable drawable;
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
48 Fnt font;
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
49 GC gc;
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
50 };
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
51
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
52 struct Client {
31
386649deb651 before leaning things up
Anselm R. Garbe <garbeam@wmii.de>
parents: 29
diff changeset
53 char name[256];
386649deb651 before leaning things up
Anselm R. Garbe <garbeam@wmii.de>
parents: 29
diff changeset
54 char *tags[TLast];
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
55 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
56 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
57 int tx, ty, tw, th; /* title */
20
4560e0882c1d made code more readable
Anselm R. Garbe <garbeam@wmii.de>
parents: 19
diff changeset
58 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
29
8ad86d0a6a53 added gravity stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 28
diff changeset
59 int grav;
164
21071ae1fe68 made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents: 157
diff changeset
60 long flags;
29
8ad86d0a6a53 added gravity stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 28
diff changeset
61 unsigned int border;
80
8125f908c80c several additions in mouse handling ;)
Anselm R. Garbe <garbeam@wmii.de>
parents: 78
diff changeset
62 Bool isfloat;
124
75576e44c1d8 made status bar drawing more robust, implemented togglemax and togglemode, works quite well
arg@10ksloc.org
parents: 115
diff changeset
63 Bool ismax;
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
64 Client *next;
127
1480e19f6377 using double-linked list in order to get correct prev focus handling
arg@10ksloc.org
parents: 125
diff changeset
65 Client *prev;
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
66 Window win;
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
67 Window title;
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
68 };
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
69
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
70 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
71 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
53
529901e6a227 added mini stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 52
diff changeset
72 extern void (*handler[LASTEvent])(XEvent *);
529901e6a227 added mini stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 52
diff changeset
73 extern void (*arrange)(Arg *);
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
74 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
75 extern Bool running, issel;
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
76 extern Client *clients, *sel;
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
77 extern Cursor cursor[CurLast];
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
78 extern DC dc;
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
79 extern Display *dpy;
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
80 extern Window root, barwin;
3
e969f3575b7a several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents: 2
diff changeset
81
5
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
82 /* client.c */
75
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
83 extern void ban(Client *c);
76
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
84 extern void focus(Client *c);
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
85 extern void focusnext(Arg *arg);
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
86 extern void focusprev(Arg *arg);
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
87 extern Client *getclient(Window w);
76
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
88 extern Client *getctitle(Window w);
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
89 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
90 extern void higher(Client *c);
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
91 extern void killclient(Arg *arg);
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
92 extern void lower(Client *c);
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
93 extern void manage(Window w, XWindowAttributes *wa);
129
c478383db7c9 applied sanders no_sizehints for tiled mode patch (thx!)
arg@10ksloc.org
parents: 127
diff changeset
94 extern void resize(Client *c, Bool sizehints, Corner sticky);
74
5370ef170cc9 sanitized names
Anselm R. Garbe <garbeam@wmii.de>
parents: 73
diff changeset
95 extern void setsize(Client *c);
76
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
96 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
97 extern void togglemax(Arg *arg);
76
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
98 extern void unmanage(Client *c);
75
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
99 extern void zoom(Arg *arg);
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
100
33
e90449e03167 new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents: 32
diff changeset
101 /* draw.c */
75
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
102 extern void drawall();
74
5370ef170cc9 sanitized names
Anselm R. Garbe <garbeam@wmii.de>
parents: 73
diff changeset
103 extern void drawstatus();
5370ef170cc9 sanitized names
Anselm R. Garbe <garbeam@wmii.de>
parents: 73
diff changeset
104 extern void drawtitle(Client *c);
5370ef170cc9 sanitized names
Anselm R. Garbe <garbeam@wmii.de>
parents: 73
diff changeset
105 extern unsigned long getcolor(const char *colstr);
5370ef170cc9 sanitized names
Anselm R. Garbe <garbeam@wmii.de>
parents: 73
diff changeset
106 extern void setfont(const char *fontstr);
43
989178822938 changed default colors
Anselm R. Garbe <garbeam@wmii.de>
parents: 42
diff changeset
107 extern unsigned int textw(char *text);
33
e90449e03167 new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents: 32
diff changeset
108
75
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
109 /* event.c */
73
c2ddb9dbbd10 rearranged
Anselm R. Garbe <garbeam@wmii.de>
parents: 66
diff changeset
110 extern void grabkeys();
18
1efa34c6e1b6 added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents: 16
diff changeset
111
43
989178822938 changed default colors
Anselm R. Garbe <garbeam@wmii.de>
parents: 42
diff changeset
112 /* main.c */
76
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
113 extern int getproto(Window w);
75
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
114 extern void quit(Arg *arg);
76
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
115 extern void sendevent(Window w, Atom a, long value);
75
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
116 extern int xerror(Display *dsply, XErrorEvent *ee);
43
989178822938 changed default colors
Anselm R. Garbe <garbeam@wmii.de>
parents: 42
diff changeset
117
75
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
118 /* tag.c */
76
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
119 extern void appendtag(Arg *arg);
75
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
120 extern void dofloat(Arg *arg);
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
121 extern void dotile(Arg *arg);
142
9b9deafa0508 committed a patch which fixes the hints of Jukka
arg@10ksloc.org
parents: 130
diff changeset
122 extern Client *getnext(Client *c);
127
1480e19f6377 using double-linked list in order to get correct prev focus handling
arg@10ksloc.org
parents: 125
diff changeset
123 extern Client *getprev(Client *c);
76
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
124 extern void replacetag(Arg *arg);
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
125 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
126 extern void togglemode(Arg *arg);
73
c2ddb9dbbd10 rearranged
Anselm R. Garbe <garbeam@wmii.de>
parents: 66
diff changeset
127 extern void view(Arg *arg);
144
e61447a7f249 applied Jukkas prev/next patch with XK_{h,l}
arg@10ksloc.org
parents: 143
diff changeset
128 extern void viewnext(Arg *arg);
e61447a7f249 applied Jukkas prev/next patch with XK_{h,l}
arg@10ksloc.org
parents: 143
diff changeset
129 extern void viewprev(Arg *arg);
73
c2ddb9dbbd10 rearranged
Anselm R. Garbe <garbeam@wmii.de>
parents: 66
diff changeset
130
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
131 /* util.c */
76
4bd49f404f10 proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents: 75
diff changeset
132 extern void *emallocz(unsigned int size);
75
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
133 extern void eprint(const char *errstr, ...);
49
466591c2f967 implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents: 46
diff changeset
134 extern void spawn(Arg *arg);