annotate dwm.h @ 461:9d23330a5268

removed a bunch of lines through making function signatures more consistent with my style ( { does not belong to a new line, if function args are single-lined)
author Anselm R. Garbe <arg@10kloc.org>
date Tue, 12 Sep 2006 10:57:28 +0200
parents ab4b08d49d24
children 210a99f18657
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.
457
e97ad13f04dc added a general comment to dwm.h how dwm is basically organized
Anselm R. Garbe <arg@10kloc.org>
parents: 456
diff changeset
4 *
e97ad13f04dc added a general comment to dwm.h how dwm is basically organized
Anselm R. Garbe <arg@10kloc.org>
parents: 456
diff changeset
5 * dynamic window manager is designed like any other X client as well. It is
e97ad13f04dc added a general comment to dwm.h how dwm is basically organized
Anselm R. Garbe <arg@10kloc.org>
parents: 456
diff changeset
6 * driven through handling X events. In contrast to other X clients, a window
e97ad13f04dc added a general comment to dwm.h how dwm is basically organized
Anselm R. Garbe <arg@10kloc.org>
parents: 456
diff changeset
7 * manager like dwm selects for SubstructureRedirectMask on the root window, to
460
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
8 * receive events about window appearance and disappearance. Only one X
459
3c3f429dca99 made introduction comment in dwm.h shorter
Anselm R. Garbe <arg@10kloc.org>
parents: 457
diff changeset
9 * connection at a time is allowed to select for this event mask.
457
e97ad13f04dc added a general comment to dwm.h how dwm is basically organized
Anselm R. Garbe <arg@10kloc.org>
parents: 456
diff changeset
10 *
460
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
11 * Calls to fetch an X event from the X event queue connection are blocking.
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
12 * Due reading status text from standard input, a select-driven main loop has
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
13 * been implemented which selects for reads on the X connection and
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
14 * STDIN_FILENO to handle all data smoothly and without busy-loop quirks. The
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
15 * event handlers of dwm are organized in an array which is accessed whenever a
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
16 * new event has been fetched. This allows event dispatching in O(1) time.
457
e97ad13f04dc added a general comment to dwm.h how dwm is basically organized
Anselm R. Garbe <arg@10kloc.org>
parents: 456
diff changeset
17 *
460
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
18 * Each child of the root window is called a client, except windows which have
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
19 * set the override_redirect flag. Clients are organized in a global
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
20 * doubly-linked client list, the focus history is remembered through a global
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
21 * stack list. Each client contains an array of Bools of the same size as the
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
22 * global tags array to indicate the tags of a client. For each client dwm
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
23 * creates a small title window which is resized whenever the WM_NAME or
ab4b08d49d24 some more simplifications of intro comment in dwm.h, this should suffice for comments in dwm
Anselm R. Garbe <arg@10kloc.org>
parents: 459
diff changeset
24 * _NET_WM_NAME properties are updated or the client is resized.
457
e97ad13f04dc added a general comment to dwm.h how dwm is basically organized
Anselm R. Garbe <arg@10kloc.org>
parents: 456
diff changeset
25 *
459
3c3f429dca99 made introduction comment in dwm.h shorter
Anselm R. Garbe <arg@10kloc.org>
parents: 457
diff changeset
26 * Keys and tagging rules are organized as arrays and defined in the config.h
3c3f429dca99 made introduction comment in dwm.h shorter
Anselm R. Garbe <arg@10kloc.org>
parents: 457
diff changeset
27 * file. These arrays are kept static in event.o and tag.o respectively,
3c3f429dca99 made introduction comment in dwm.h shorter
Anselm R. Garbe <arg@10kloc.org>
parents: 457
diff changeset
28 * because no other part of dwm needs access to them. The current mode is
3c3f429dca99 made introduction comment in dwm.h shorter
Anselm R. Garbe <arg@10kloc.org>
parents: 457
diff changeset
29 * represented by the arrange function pointer which wether points to dofloat
3c3f429dca99 made introduction comment in dwm.h shorter
Anselm R. Garbe <arg@10kloc.org>
parents: 457
diff changeset
30 * or dotile.
457
e97ad13f04dc added a general comment to dwm.h how dwm is basically organized
Anselm R. Garbe <arg@10kloc.org>
parents: 456
diff changeset
31 *
459
3c3f429dca99 made introduction comment in dwm.h shorter
Anselm R. Garbe <arg@10kloc.org>
parents: 457
diff changeset
32 * To understand everything else, start with reading main.c:main().
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
33 */
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
34
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
35 #include "config.h"
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
36 #include <X11/Xlib.h>
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
37
143
36cabfe408cd applied Sanders patches
arg@10ksloc.org
parents: 142
diff changeset
38 /* 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
39 #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask)
a26b32ff8911 cleaned config.*h to prevent some confusion
arg@10ksloc.org
parents: 148
diff changeset
40 #define MOUSEMASK (BUTTONMASK | PointerMotionMask)
157
93012e947eae renamed WM_PROTOCOL_DELWIN into PROTODELWIN
arg@10ksloc.org
parents: 150
diff changeset
41 #define PROTODELWIN 1
143
36cabfe408cd applied Sanders patches
arg@10ksloc.org
parents: 142
diff changeset
42
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
43 enum { NetSupported, NetWMName, NetLast }; /* EWMH atoms */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
44 enum { WMProtocols, WMDelete, WMLast }; /* default atoms */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
45 enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
46 enum { ColFG, ColBG, ColLast }; /* color */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
47
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
48 typedef enum {
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
49 TopLeft, TopRight, BotLeft, BotRight
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
50 } Corner; /* window corners */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
51
333
827f8f6c9e97 separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents: 327
diff changeset
52 typedef union {
189
523df4a3c1c4 using execl now, argv changed, using cmd and const char defs directly in the KEYS struct
arg@10ksloc.org
parents: 178
diff changeset
53 const char *cmd;
49
466591c2f967 implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents: 46
diff changeset
54 int i;
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
55 } Arg; /* argument type */
99
a19556fe83b5 applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents: 95
diff changeset
56
333
827f8f6c9e97 separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents: 327
diff changeset
57 typedef struct {
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
58 int ascent;
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
59 int descent;
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
60 int height;
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
61 XFontSet set;
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
62 XFontStruct *xfont;
333
827f8f6c9e97 separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents: 327
diff changeset
63 } Fnt;
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
64
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
65 typedef struct {
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
66 int x, y, w, h;
353
8a06efe5b563 new color stuff/new rendering stuff
Anselm R. Garbe <arg@10kloc.org>
parents: 352
diff changeset
67 unsigned long norm[ColLast];
8a06efe5b563 new color stuff/new rendering stuff
Anselm R. Garbe <arg@10kloc.org>
parents: 352
diff changeset
68 unsigned long sel[ColLast];
8a06efe5b563 new color stuff/new rendering stuff
Anselm R. Garbe <arg@10kloc.org>
parents: 352
diff changeset
69 unsigned long status[ColLast];
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
70 Drawable drawable;
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
71 Fnt font;
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
72 GC gc;
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
73 } DC; /* draw context */
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
74
333
827f8f6c9e97 separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents: 327
diff changeset
75 typedef struct Client Client;
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
76 struct Client {
31
386649deb651 before leaning things up
Anselm R. Garbe <garbeam@wmii.de>
parents: 29
diff changeset
77 char name[256];
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
78 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
79 int x, y, w, h;
453
f30f937f9e52 small fix
Anselm R. Garbe <arg@10kloc.org>
parents: 452
diff changeset
80 int tx, ty, tw, th; /* title window geometry */
20
4560e0882c1d made code more readable
Anselm R. Garbe <garbeam@wmii.de>
parents: 19
diff changeset
81 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
29
8ad86d0a6a53 added gravity stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 28
diff changeset
82 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
83 long flags;
381
b00cc483d13b still something wrong with reorder()
Anselm R. Garbe <arg@10kloc.org>
parents: 378
diff changeset
84 unsigned int border, weight;
80
8125f908c80c several additions in mouse handling ;)
Anselm R. Garbe <garbeam@wmii.de>
parents: 78
diff changeset
85 Bool isfloat;
178
e848966a1ac6 removed TLast tag enum, now tags is simple defined as char *[] array, the rest is calculated correctly, rules take an int array for the tags
arg@10ksloc.org
parents: 173
diff changeset
86 Bool *tags;
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
87 Client *next;
127
1480e19f6377 using double-linked list in order to get correct prev focus handling
arg@10ksloc.org
parents: 125
diff changeset
88 Client *prev;
446
a2e587651c79 using a global stack for focus recovery on arrange() - seems to work great
Anselm R. Garbe <arg@10kloc.org>
parents: 431
diff changeset
89 Client *snext;
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
90 Window win;
342
a1901753deef updated man page
Anselm R. Garbe <arg@10kloc.org>
parents: 333
diff changeset
91 Window twin;
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
92 };
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
93
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
94 extern const char *tags[]; /* all tags */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
95 extern char stext[1024]; /* status text */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
96 extern int bx, by, bw, bh, bmw; /* bar geometry, bar mode label width */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
97 extern int mw, screen, sx, sy, sw, sh; /* screen geometry, master width */
454
ffb462fb7903 small change to comments, renamed two set* functions in client.c into update*
Anselm R. Garbe <arg@10kloc.org>
parents: 453
diff changeset
98 extern unsigned int ntags, numlockmask; /* number of tags, dynamic lock mask */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
99 extern void (*handler[LASTEvent])(XEvent *); /* event handler */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
100 extern void (*arrange)(Arg *); /* arrange function, indicates mode */
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
101 extern Atom wmatom[WMLast], netatom[NetLast];
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
102 extern Bool running, issel, maximized, *seltag; /* seltag is array of Bool */
454
ffb462fb7903 small change to comments, renamed two set* functions in client.c into update*
Anselm R. Garbe <arg@10kloc.org>
parents: 453
diff changeset
103 extern Client *clients, *sel, *stack; /* global cleint list and stack */
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
104 extern Cursor cursor[CurLast];
454
ffb462fb7903 small change to comments, renamed two set* functions in client.c into update*
Anselm R. Garbe <arg@10kloc.org>
parents: 453
diff changeset
105 extern DC dc; /* global draw context */
84
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
106 extern Display *dpy;
052fe7498930 ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents: 80
diff changeset
107 extern Window root, barwin;
3
e969f3575b7a several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents: 2
diff changeset
108
5
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
109 /* client.c */
454
ffb462fb7903 small change to comments, renamed two set* functions in client.c into update*
Anselm R. Garbe <arg@10kloc.org>
parents: 453
diff changeset
110 extern void ban(Client *c); /* ban c from screen */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
111 extern void focus(Client *c); /* focus c, c may be NULL */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
112 extern Client *getclient(Window w); /* return client of w */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
113 extern Client *getctitle(Window w); /* return client of title window */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
114 extern void gravitate(Client *c, Bool invert); /* gravitate c */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
115 extern void killclient(Arg *arg); /* kill c nicely */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
116 extern void manage(Window w, XWindowAttributes *wa); /* manage new client */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
117 extern void resize(Client *c, Bool sizehints, Corner sticky); /* resize c*/
454
ffb462fb7903 small change to comments, renamed two set* functions in client.c into update*
Anselm R. Garbe <arg@10kloc.org>
parents: 453
diff changeset
118 extern void updatesize(Client *c); /* update the size structs of c */
ffb462fb7903 small change to comments, renamed two set* functions in client.c into update*
Anselm R. Garbe <arg@10kloc.org>
parents: 453
diff changeset
119 extern void updatetitle(Client *c); /* update the name of c */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
120 extern void togglemax(Arg *arg); /* (un)maximize c */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
121 extern void unmanage(Client *c); /* destroy c */
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
122
33
e90449e03167 new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents: 32
diff changeset
123 /* draw.c */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
124 extern void drawall(); /* draw all visible client titles and the bar */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
125 extern void drawstatus(); /* draw the bar */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
126 extern void drawtitle(Client *c); /* draw title of c */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
127 extern unsigned long getcolor(const char *colstr); /* return color of colstr */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
128 extern void setfont(const char *fontstr); /* set the font for DC */
456
d11d739ad9df some other simplifications
Anselm R. Garbe <arg@10kloc.org>
parents: 454
diff changeset
129 extern unsigned int textw(const char *text); /* return the width of text in px*/
33
e90449e03167 new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents: 32
diff changeset
130
75
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
131 /* event.c */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
132 extern void grabkeys(); /* grab all keys defined in config.h */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
133 extern void procevent(); /* process pending X events */
18
1efa34c6e1b6 added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents: 16
diff changeset
134
43
989178822938 changed default colors
Anselm R. Garbe <garbeam@wmii.de>
parents: 42
diff changeset
135 /* main.c */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
136 extern int getproto(Window w); /* return protocol mask of WMProtocols property of w */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
137 extern void quit(Arg *arg); /* quit dwm nicely */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
138 extern void sendevent(Window w, Atom a, long value); /* send synthetic event to w */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
139 extern int xerror(Display *dsply, XErrorEvent *ee); /* dwm's X error handler */
43
989178822938 changed default colors
Anselm R. Garbe <garbeam@wmii.de>
parents: 42
diff changeset
140
75
f08271b7cb20 rearranged several stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 74
diff changeset
141 /* tag.c */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
142 extern void initrregs(); /* initialize regexps of rules defined in config.h */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
143 extern Client *getnext(Client *c); /* returns next visible client */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
144 extern Client *getprev(Client *c); /* returns previous visible client */
454
ffb462fb7903 small change to comments, renamed two set* functions in client.c into update*
Anselm R. Garbe <arg@10kloc.org>
parents: 453
diff changeset
145 extern void settags(Client *c, Client *trans); /* sets tags of c */
456
d11d739ad9df some other simplifications
Anselm R. Garbe <arg@10kloc.org>
parents: 454
diff changeset
146 extern void tag(Arg *arg); /* tags c with arg's index */
d11d739ad9df some other simplifications
Anselm R. Garbe <arg@10kloc.org>
parents: 454
diff changeset
147 extern void toggletag(Arg *arg); /* toggles c tags with arg's index */
73
c2ddb9dbbd10 rearranged
Anselm R. Garbe <garbeam@wmii.de>
parents: 66
diff changeset
148
32
082c75b937b5 removed unnecessary crap
Anselm R. Garbe <garbeam@wmii.de>
parents: 31
diff changeset
149 /* util.c */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
150 extern void *emallocz(unsigned int size); /* allocates zero-initialized memory, exits on error */
456
d11d739ad9df some other simplifications
Anselm R. Garbe <arg@10kloc.org>
parents: 454
diff changeset
151 extern void eprint(const char *errstr, ...); /* prints errstr and exits with 1 */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
152 extern void *erealloc(void *ptr, unsigned int size); /* reallocates memory, exits on error */
456
d11d739ad9df some other simplifications
Anselm R. Garbe <arg@10kloc.org>
parents: 454
diff changeset
153 extern void spawn(Arg *arg); /* forks a new subprocess with to arg's cmd */
327
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents: 292
diff changeset
154
96d09fd98e89 separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents: 292
diff changeset
155 /* view.c */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
156 extern void detach(Client *c); /* detaches c from global client list */
456
d11d739ad9df some other simplifications
Anselm R. Garbe <arg@10kloc.org>
parents: 454
diff changeset
157 extern void dofloat(Arg *arg); /* arranges all windows floating, arg is ignored */
d11d739ad9df some other simplifications
Anselm R. Garbe <arg@10kloc.org>
parents: 454
diff changeset
158 extern void dotile(Arg *arg); /* arranges all windows, arg is ignored */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
159 extern void focusnext(Arg *arg); /* focuses next visible client, arg is ignored */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
160 extern void focusprev(Arg *arg); /* focuses previous visible client, arg is ignored */
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
161 extern Bool isvisible(Client *c); /* returns True if client is visible */
456
d11d739ad9df some other simplifications
Anselm R. Garbe <arg@10kloc.org>
parents: 454
diff changeset
162 extern void resizecol(Arg *arg); /* resizes the master width with arg's index value */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
163 extern void restack(); /* restores z layers of all clients */
456
d11d739ad9df some other simplifications
Anselm R. Garbe <arg@10kloc.org>
parents: 454
diff changeset
164 extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */
d11d739ad9df some other simplifications
Anselm R. Garbe <arg@10kloc.org>
parents: 454
diff changeset
165 extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */
d11d739ad9df some other simplifications
Anselm R. Garbe <arg@10kloc.org>
parents: 454
diff changeset
166 extern void view(Arg *arg); /* views the tag with arg's index */
454
ffb462fb7903 small change to comments, renamed two set* functions in client.c into update*
Anselm R. Garbe <arg@10kloc.org>
parents: 453
diff changeset
167 extern void viewall(Arg *arg); /* views all tags, arg is ignored */
452
026aba558fdf added some comments
Anselm R. Garbe <arg@10kloc.org>
parents: 446
diff changeset
168 extern void zoom(Arg *arg); /* zooms the focused client to master column, arg is ignored */