about summary refs log tree commit diff stats
path: root/layout.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-22 11:42:08 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-22 11:42:08 +0100
commit2c477cf66147d369ae8ff17acdce743c6811ee6a (patch)
tree121a031caf30be9f6931e37e26cf2469c8c7acfa /layout.c
parent986ca73074ef165880c75ee46a4eb6a1b328dc5b (diff)
downloaddwm-2c477cf66147d369ae8ff17acdce743c6811ee6a.tar.gz
replaced Arg union with const char *arg, seems cleaner to me, even if we need atoi() in some places
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/layout.c b/layout.c
index 5a7d4b4..8b4c940 100644
--- a/layout.c
+++ b/layout.c
@@ -69,7 +69,7 @@ LAYOUTS
 /* extern */
 
 void
-focusnext(Arg arg) {
+focusnext(const char *arg) {
 	Client *c;
    
 	if(!sel)
@@ -84,7 +84,7 @@ focusnext(Arg arg) {
 }
 
 void
-focusprev(Arg arg) {
+focusprev(const char *arg) {
 	Client *c;
 
 	if(!sel)
@@ -101,26 +101,29 @@ focusprev(Arg arg) {
 }
 
 void
-incmasterw(Arg arg) {
+incmasterw(const char *arg) {
+	int i;
 	if(lt->arrange != tile)
 		return;
-	if(arg.i == 0)
+	if(!arg)
 		masterw = MASTERWIDTH;
 	else {
-		if(waw * (masterw + arg.i) / 1000 >= waw - 2 * BORDERPX
-		|| waw * (masterw + arg.i) / 1000 <= 2 * BORDERPX)
+		i = atoi(arg);
+		if(waw * (masterw + i) / 1000 >= waw - 2 * BORDERPX
+		|| waw * (masterw + i) / 1000 <= 2 * BORDERPX)
 			return;
-		masterw += arg.i;
+		masterw += i;
 	}
 	lt->arrange();
 }
 
 void
-incnmaster(Arg arg) {
-	if((lt->arrange != tile) || (nmaster + arg.i < 1)
-	|| (wah / (nmaster + arg.i) <= 2 * BORDERPX))
+incnmaster(const char *arg) {
+	int i = arg ? atoi(arg) : 0;
+	if((lt->arrange != tile) || (nmaster + i < 1)
+	|| (wah / (nmaster + i) <= 2 * BORDERPX))
 		return;
-	nmaster += arg.i;
+	nmaster += i;
 	if(sel)
 		lt->arrange();
 	else
@@ -170,10 +173,10 @@ restack(void) {
 }
 
 void
-setlayout(Arg arg) {
+setlayout(const char *arg) {
 	unsigned int i;
 
-	if(arg.i == -1) {
+	if(!arg) {
 		for(i = 0; i < nlayouts && lt != &layout[i]; i++);
 		if(i == nlayouts - 1)
 			lt = &layout[0];
@@ -181,9 +184,10 @@ setlayout(Arg arg) {
 			lt = &layout[++i];
 	}
 	else {
-		if(arg.i < 0 || arg.i >= nlayouts)
+		i = atoi(arg);
+		if(i < 0 || i >= nlayouts)
 			return;
-		lt = &layout[arg.i];
+		lt = &layout[i];
 	}
 	if(sel)
 		lt->arrange();
@@ -192,7 +196,7 @@ setlayout(Arg arg) {
 }
 
 void
-togglemax(Arg arg) {
+togglemax(const char *arg) {
 	XEvent ev;
 
 	if(!sel || (lt->arrange != versatile && !sel->isversatile) || sel->isfixed)
@@ -234,7 +238,7 @@ versatile(void) {
 }
 
 void
-zoom(Arg arg) {
+zoom(const char *arg) {
 	unsigned int n;
 	Client *c;
 
s.org> 2007-02-21 11:30:52 +0100 cleaned up and commented the config.*.h' href='/acidbong/suckless/dwm/commit/config.arg.h?h=5.6.1&id=f196b71e4d543e7d8c4fd6398cf1bedd3dafc024'>f196b71 ^
3794c62 ^





352cae4 ^
f196b71 ^
352cae4 ^
3794c62 ^
f196b71 ^

b38905b ^
a73a882 ^
3059c9c ^
3171371 ^





352cae4 ^
3171371 ^









352cae4 ^









3171371 ^








42fd392 ^
19dcbc5 ^



11a08b9 ^
e1811c3 ^



352cae4 ^








3171371 ^
a73a882 ^
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