tsome more refactoring - dwm - [fork] customized build of dwm, the dynamic wind… | |
git clone git://src.adamsgaard.dk/dwm | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit b3d7e07f18f0f69f8c3b3542615da62dfc4c6175 | |
parent 30af19d4426ca32dc38318bbe87534cc44484998 | |
Author: Anselm R. Garbe <[email protected]> | |
Date: Mon, 19 Feb 2007 13:53:40 +0100 | |
some more refactoring | |
Diffstat: | |
M client.c | 42 -----------------------------… | |
M dwm.h | 10 +++++----- | |
M view.c | 42 +++++++++++++++++++++++++++++… | |
3 files changed, 47 insertions(+), 47 deletions(-) | |
--- | |
diff --git a/client.c b/client.c | |
t@@ -61,20 +61,6 @@ 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; | |
t@@ -93,24 +79,6 @@ 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; | |
t@@ -135,16 +103,6 @@ focus(Client *c) { | |
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); | |
} | |
-Client * | |
-getclient(Window w) { | |
- Client *c; | |
- | |
- for(c = clients; c; c = c->next) | |
- if(c->win == w) | |
- return c; | |
- return NULL; | |
-} | |
- | |
Bool | |
isprotodel(Client *c) { | |
int i, n; | |
diff --git a/dwm.h b/dwm.h | |
t@@ -99,13 +99,8 @@ extern Display *dpy; | |
extern Window root, barwin; | |
/* client.c */ | |
-extern void attach(Client *c); /* attaches c to global … | |
-extern void attachstack(Client *c); /* attaches client to stack… | |
extern void configure(Client *c); /* send synthetic configure e… | |
-extern void detach(Client *c); /* detaches c from globa… | |
-extern void detachstack(Client *c); /* detaches client from sta… | |
extern void focus(Client *c); /* focus c, c may be NULL… | |
-extern Client *getclient(Window w); /* return client of w */ | |
extern Bool isprotodel(Client *c); /* returns True if c->win su… | |
extern void killclient(Arg *arg); /* kill c nicely */ | |
extern void manage(Window w, XWindowAttributes *wa); /* manage new clie… | |
t@@ -148,9 +143,14 @@ extern void eprint(const char *errstr, ...); /* pr… | |
extern void spawn(Arg *arg); /* forks a new subprocess … | |
/* view.c */ | |
+extern void attach(Client *c); /* attaches c to global … | |
+extern void attachstack(Client *c); /* attaches client to stack… | |
extern void dofloat(void); /* arranges all windows floa… | |
+extern void detach(Client *c); /* detaches c from globa… | |
+extern void detachstack(Client *c); /* detaches client from sta… | |
extern void focusnext(Arg *arg); /* focuses next visible client… | |
extern void focusprev(Arg *arg); /* focuses previous visible cl… | |
+extern Client *getclient(Window w); /* return client of w */ | |
extern Bool isvisible(Client *c); /* returns True if client is … | |
extern Client *nextmanaged(Client *c); /* returns managed succe… | |
extern void restack(void); /* restores z layers of all … | |
diff --git a/view.c b/view.c | |
t@@ -8,6 +8,20 @@ | |
void (*arrange)(void) = DEFMODE; | |
void | |
+attach(Client *c) { | |
+ if(clients) | |
+ clients->prev = c; | |
+ c->next = clients; | |
+ clients = c; | |
+} | |
+ | |
+void | |
+attachstack(Client *c) { | |
+ c->snext = stack; | |
+ stack = c; | |
+} | |
+ | |
+void | |
dofloat(void) { | |
Client *c; | |
t@@ -31,6 +45,24 @@ dofloat(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 | |
focusnext(Arg *arg) { | |
Client *c; | |
t@@ -62,6 +94,16 @@ focusprev(Arg *arg) { | |
} | |
} | |
+Client * | |
+getclient(Window w) { | |
+ Client *c; | |
+ | |
+ for(c = clients; c; c = c->next) | |
+ if(c->win == w) | |
+ return c; | |
+ return NULL; | |
+} | |
+ | |
Bool | |
isvisible(Client *c) { | |
unsigned int i; |