summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-02-20 13:56:21 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-02-20 13:56:21 +0100
commitd180ba418cd56f3a743d9a5863f86f7eae21602f (patch)
treed1d8936d9d97a49577163f6e8be13af713753dd8 /main.c
parentfixed order (diff)
downloaddwm-d180ba418cd56f3a743d9a5863f86f7eae21602f.tar.gz
dwm-d180ba418cd56f3a743d9a5863f86f7eae21602f.zip
renamed setfont to initfont, getcolor to initcolor
Diffstat (limited to 'main.c')
-rw-r--r--main.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/main.c b/main.c
index 1015017..73b713f 100644
--- a/main.c
+++ b/main.c
@@ -62,7 +62,7 @@ cleanup(void) {
62} 62}
63 63
64static unsigned long 64static unsigned long
65getcolor(const char *colstr) { 65initcolor(const char *colstr) {
66 Colormap cmap = DefaultColormap(dpy, screen); 66 Colormap cmap = DefaultColormap(dpy, screen);
67 XColor color; 67 XColor color;
68 68
@@ -72,27 +72,7 @@ getcolor(const char *colstr) {
72} 72}
73 73
74static void 74static void
75scan(void) { 75initfont(const char *fontstr) {
76 unsigned int i, num;
77 Window *wins, d1, d2;
78 XWindowAttributes wa;
79
80 wins = NULL;
81 if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) {
82 for(i = 0; i < num; i++) {
83 if(!XGetWindowAttributes(dpy, wins[i], &wa)
84 || wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1))
85 continue;
86 if(wa.map_state == IsViewable)
87 manage(wins[i], &wa);
88 }
89 }
90 if(wins)
91 XFree(wins);
92}
93
94static void
95setfont(const char *fontstr) {
96 char *def, **missing; 76 char *def, **missing;
97 int i, n; 77 int i, n;
98 78
@@ -133,6 +113,26 @@ setfont(const char *fontstr) {
133} 113}
134 114
135static void 115static void
116scan(void) {
117 unsigned int i, num;
118 Window *wins, d1, d2;
119 XWindowAttributes wa;
120
121 wins = NULL;
122 if(XQueryTree(dpy, root, &d1, &d2, &wins, &num)) {
123 for(i = 0; i < num; i++) {
124 if(!XGetWindowAttributes(dpy, wins[i], &wa)
125 || wa.override_redirect || XGetTransientForHint(dpy, wins[i], &d1))
126 continue;
127 if(wa.map_state == IsViewable)
128 manage(wins[i], &wa);
129 }
130 }
131 if(wins)
132 XFree(wins);
133}
134
135static void
136setup(void) { 136setup(void) {
137 int i, j; 137 int i, j;
138 unsigned int mask; 138 unsigned int mask;
@@ -173,13 +173,13 @@ setup(void) {
173 seltag = emallocz(sizeof(Bool) * ntags); 173 seltag = emallocz(sizeof(Bool) * ntags);
174 seltag[0] = True; 174 seltag[0] = True;
175 /* style */ 175 /* style */
176 dc.norm[ColBorder] = getcolor(NORMBORDERCOLOR); 176 dc.norm[ColBorder] = initcolor(NORMBORDERCOLOR);
177 dc.norm[ColBG] = getcolor(NORMBGCOLOR); 177 dc.norm[ColBG] = initcolor(NORMBGCOLOR);
178 dc.norm[ColFG] = getcolor(NORMFGCOLOR); 178 dc.norm[ColFG] = initcolor(NORMFGCOLOR);
179 dc.sel[ColBorder] = getcolor(SELBORDERCOLOR); 179 dc.sel[ColBorder] = initcolor(SELBORDERCOLOR);
180 dc.sel[ColBG] = getcolor(SELBGCOLOR); 180 dc.sel[ColBG] = initcolor(SELBGCOLOR);
181 dc.sel[ColFG] = getcolor(SELFGCOLOR); 181 dc.sel[ColFG] = initcolor(SELFGCOLOR);
182 setfont(FONT); 182 initfont(FONT);
183 /* geometry */ 183 /* geometry */
184 sx = sy = 0; 184 sx = sy = 0;
185 sw = DisplayWidth(dpy, screen); 185 sw = DisplayWidth(dpy, screen);