about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-19 14:57:32 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-19 14:57:32 +0100
commit64871a7045077bb2ec4cbcd62a74cabbe6b45096 (patch)
tree7e9d0fbab49039b32bf99924546edbe41392842e
parent2e95bc04135936ff8adc75e57e21f5edab56e0d6 (diff)
downloaddwm-64871a7045077bb2ec4cbcd62a74cabbe6b45096.tar.gz
renamed manage.c to view.c
-rw-r--r--client.c96
-rw-r--r--dwm.h14
-rw-r--r--view.c (renamed from manage.c)74
3 files changed, 92 insertions, 92 deletions
diff --git a/client.c b/client.c
index e7a3864..45f2d19 100644
--- a/client.c
+++ b/client.c
@@ -46,6 +46,21 @@ grabbuttons(Client *c, Bool focused) {
 				GrabModeAsync, GrabModeSync, None, None);
 }
 
+static Bool
+isprotodel(Client *c) {
+	int i, n;
+	Atom *protocols;
+	Bool ret = False;
+
+	if(XGetWMProtocols(dpy, c->win, &protocols, &n)) {
+		for(i = 0; !ret && i < n; i++)
+			if(protocols[i] == wmatom[WMDelete])
+				ret = True;
+		XFree(protocols);
+	}
+	return ret;
+}
+
 static void
 setclientstate(Client *c, long state) {
 	long data[] = {state, None};
@@ -61,6 +76,20 @@ xerrordummy(Display *dsply, XErrorEvent *ee) {
 /* extern */
 
 void
+attach(Client *c) {
+	if(clients)
+		clients->prev = c;
+	c->next = clients;
+	clients = c;
+}
+
+void
+attachstack(Client *c) {
+	c->snext = stack;
+	stack = c;
+}
+
+void
 configure(Client *c) {
 	XConfigureEvent ce;
 
@@ -79,6 +108,24 @@ configure(Client *c) {
 }
 
 void
+detach(Client *c) {
+	if(c->prev)
+		c->prev->next = c->next;
+	if(c->next)
+		c->next->prev = c->prev;
+	if(c == clients)
+		clients = c->next;
+	c->next = c->prev = NULL;
+}
+
+void
+detachstack(Client *c) {
+	Client **tc;
+	for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext);
+	*tc = c->snext;
+}
+
+void
 focus(Client *c) {
 	if(c && !isvisible(c))
 		return;
@@ -103,19 +150,46 @@ focus(Client *c) {
 		XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
 }
 
-Bool
-isprotodel(Client *c) {
-	int i, n;
-	Atom *protocols;
-	Bool ret = False;
+void
+focusnext(Arg *arg) {
+	Client *c;
+   
+	if(!sel)
+		return;
+	for(c = sel->next; c && !isvisible(c); c = c->next);
+	if(!c)
+		for(c = clients; c && !isvisible(c); c = c->next);
+	if(c) {
+		focus(c);
+		restack();
+	}
+}
 
-	if(XGetWMProtocols(dpy, c->win, &protocols, &n)) {
-		for(i = 0; !ret && i < n; i++)
-			if(protocols[i] == wmatom[WMDelete])
-				ret = True;
-		XFree(protocols);
+void
+focusprev(Arg *arg) {
+	Client *c;
+
+	if(!sel)
+		return;
+	for(c = sel->prev; c && !isvisible(c); c = c->prev);
+	if(!c) {
+		for(c = clients; c && c->next; c = c->next);
+		for(; c && !isvisible(c); c = c->prev);
 	}
-	return ret;
+	if(c) {
+		focus(c);
+		restack();
+	}
+}
+
+Client *
+getclient(Window w) {
+	Client *c;
+
+	for(c = clients; c; c = c->next)
+		if(c->win == w)
+			return c;
+	return NULL;
 }
 
 void
diff --git a/dwm.h b/dwm.h
index 318ce9e..cca9984 100644
--- a/dwm.h
+++ b/dwm.h
@@ -99,8 +99,15 @@ extern Display *dpy;
 extern Window root, barwin;
 
 /* client.c */
+extern void attach(Client *c);			/* attaches c to global client list */
+extern void attachstack(Client *c);		/* attaches client to stack */
 extern void configure(Client *c);		/* send synthetic configure event */
+extern void detach(Client *c);			/* detaches c from global client list */
+extern void detachstack(Client *c);		/* detaches client from stack */
 extern void focus(Client *c);			/* focus c, c may be NULL */
+extern void focusnext(Arg *arg);		/* focuses next visible client, arg is ignored  */
+extern void focusprev(Arg *arg);		/* focuses previous visible client, arg is ignored */
+extern Client *getclient(Window w);		/* return client of w */
 extern void killclient(Arg *arg);		/* kill c nicely */
 extern void manage(Window w, XWindowAttributes *wa);	/* manage new client */
 extern void resize(Client *c, int x, int y,
@@ -125,16 +132,9 @@ extern void sendevent(Window w, Atom a, long value);	/* send synthetic event to
 extern int xerror(Display *dsply, XErrorEvent *ee);	/* dwm's X error handler */
 
 /* manage.c */
-extern void attach(Client *c);			/* attaches c to global client list */
-extern void attachstack(Client *c);		/* attaches client to stack */
 extern void compileregexps(void);		/* initialize regexps of rules defined in config.h */
-extern void detach(Client *c);			/* detaches c from global client list */
-extern void detachstack(Client *c);		/* detaches client from stack */
 extern void dofloat(void);			/* arranges all windows floating */
 extern void dotile(void);			/* arranges all windows tiled */
-extern void focusnext(Arg *arg);		/* focuses next visible client, arg is ignored  */
-extern void focusprev(Arg *arg);		/* focuses previous visible client, arg is ignored */
-extern Client *getclient(Window w);		/* return client of w */
 extern void incnmaster(Arg *arg);		/* increments nmaster with arg's index value */
 extern Bool isvisible(Client *c);		/* returns True if client is visible */
 extern void resizemaster(Arg *arg);		/* resizes the master percent with arg's index value */
diff --git a/manage.c b/view.c
index 9db139b..34aae58 100644
--- a/manage.c
+++ b/view.c
@@ -59,20 +59,6 @@ togglemax(Client *c) {
 /* extern */
 
 void
-attach(Client *c) {
-	if(clients)
-		clients->prev = c;
-	c->next = clients;
-	clients = c;
-}
-
-void
-attachstack(Client *c) {
-	c->snext = stack;
-	stack = c;
-}
-
-void
 compileregexps(void) {
 	unsigned int i;
 	regex_t *reg;
@@ -100,24 +86,6 @@ compileregexps(void) {
 }
 
 void
-detach(Client *c) {
-	if(c->prev)
-		c->prev->next = c->next;
-	if(c->next)
-		c->next->prev = c->prev;
-	if(c == clients)
-		clients = c->next;
-	c->next = c->prev = NULL;
-}
-
-void
-detachstack(Client *c) {
-	Client **tc;
-	for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext);
-	*tc = c->snext;
-}
-
-void
 dofloat(void) {
 	Client *c;
 
@@ -192,48 +160,6 @@ dotile(void) {
 }
 
 void
-focusnext(Arg *arg) {
-	Client *c;
-   
-	if(!sel)
-		return;
-	for(c = sel->next; c && !isvisible(c); c = c->next);
-	if(!c)
-		for(c = clients; c && !isvisible(c); c = c->next);
-	if(c) {
-		focus(c);
-		restack();
-	}
-}
-
-void
-focusprev(Arg *arg) {
-	Client *c;
-
-	if(!sel)
-		return;
-	for(c = sel->prev; c && !isvisible(c); c = c->prev);
-	if(!c) {
-		for(c = clients; c && c->next; c = c->next);
-		for(; c && !isvisible(c); c = c->prev);
-	}
-	if(c) {
-		focus(c);
-		restack();
-	}
-}
-
-Client *
-getclient(Window w) {
-	Client *c;
-
-	for(c = clients; c; c = c->next)
-		if(c->win == w)
-			return c;
-	return NULL;
-}
-
-void
 incnmaster(Arg *arg) {
 	if((arrange == dofloat) || (nmaster + arg->i < 1)
 	|| (wah / (nmaster + arg->i) <= 2 * BORDERPX))
8891d1'>eaeb9552 ^
c5ffb6e1 ^
4bbd3ded ^
c5ffb6e1 ^

4bbd3ded ^





9570363a ^
4bbd3ded ^





9570363a ^
4bbd3ded ^
c5ffb6e1 ^



c5ffb6e1 ^

672e3e50 ^
d5d908dd ^
672e3e50 ^

9570363a ^
672e3e50 ^
eaeb9552 ^
672e3e50 ^







c5ffb6e1 ^

4bbd3ded ^
d5d908dd ^
4bbd3ded ^


9570363a ^
4bbd3ded ^
eaeb9552 ^
4bbd3ded ^
9570363a ^
4bbd3ded ^







c5ffb6e1 ^

eaeb9552 ^
672e3e50 ^
62a52ffb ^

d5d908dd ^
62a52ffb ^

eaeb9552 ^
62a52ffb ^




672e3e50 ^



eaeb9552 ^

672e3e50 ^





65361948 ^
672e3e50 ^


eaeb9552 ^
672e3e50 ^
62a52ffb ^

672e3e50 ^


dbe12410 ^
eaeb9552 ^
d5d908dd ^
dbe12410 ^

672e3e50 ^

65361948 ^
672e3e50 ^





d5d908dd ^
672e3e50 ^
eaeb9552 ^

4bbd3ded ^






d5d908dd ^
4bbd3ded ^
eaeb9552 ^

4bbd3ded ^

672e3e50 ^


c5ffb6e1 ^

eaeb9552 ^



c5ffb6e1 ^
eaeb9552 ^




c5ffb6e1 ^

672e3e50 ^
eaeb9552 ^
65361948 ^
eaeb9552 ^

672e3e50 ^
eaeb9552 ^





c5ffb6e1 ^

eaeb9552 ^

c5ffb6e1 ^
eaeb9552 ^
c5ffb6e1 ^
eaeb9552 ^




4bbd3ded ^


eaeb9552 ^

4bbd3ded ^
eaeb9552 ^
4bbd3ded ^
9542bb11 ^
4bbd3ded ^
eaeb9552 ^
4bbd3ded ^
9542bb11 ^
4bbd3ded ^
eaeb9552 ^
4bbd3ded ^






c5ffb6e1 ^
eaeb9552 ^

c5ffb6e1 ^
eaeb9552 ^
c5ffb6e1 ^
eaeb9552 ^

c5ffb6e1 ^
eaeb9552 ^
c5ffb6e1 ^

eaeb9552 ^
65361948 ^
9542bb11 ^
65361948 ^

eaeb9552 ^
65361948 ^
9542bb11 ^
65361948 ^
eaeb9552 ^
65361948 ^


672e3e50 ^

c5ffb6e1 ^





eaeb9552 ^
c5ffb6e1 ^
eaeb9552 ^



c5ffb6e1 ^




eaeb9552 ^
c5ffb6e1 ^
eaeb9552 ^

c5ffb6e1 ^




eaeb9552 ^
c5ffb6e1 ^
eaeb9552 ^

c5ffb6e1 ^



eaeb9552 ^



c5ffb6e1 ^

eaeb9552 ^
c5ffb6e1 ^
eaeb9552 ^
672e3e50 ^

65361948 ^



d5d908dd ^
65361948 ^
eaeb9552 ^
65361948 ^




eaeb9552 ^
65361948 ^
eaeb9552 ^





65361948 ^
eaeb9552 ^

65361948 ^
eaeb9552 ^

62a52ffb ^
eaeb9552 ^

dbe12410 ^
eaeb9552 ^
dbe12410 ^
4bbd3ded ^
65361948 ^
62a52ffb ^
65361948 ^

672e3e50 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383