aewl
diff main.c @ 76:4bd49f404f10
proceeded with cleaning up, sorting functions, etc
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Sat, 15 Jul 2006 17:00:56 +0200 |
parents | f08271b7cb20 |
children | 38c8f7f7d401 |
line diff
1.1 --- a/main.c Sat Jul 15 16:30:50 2006 +0200 1.2 +++ b/main.c Sat Jul 15 17:00:56 2006 +0200 1.3 @@ -3,31 +3,17 @@ 1.4 * See LICENSE file for license details. 1.5 */ 1.6 1.7 +#include "dwm.h" 1.8 + 1.9 #include <errno.h> 1.10 -#include <stdarg.h> 1.11 #include <stdio.h> 1.12 #include <stdlib.h> 1.13 #include <string.h> 1.14 #include <unistd.h> 1.15 - 1.16 #include <X11/cursorfont.h> 1.17 #include <X11/Xatom.h> 1.18 #include <X11/Xproto.h> 1.19 1.20 -#include "dwm.h" 1.21 - 1.22 -/********** CUSTOMIZE **********/ 1.23 - 1.24 -char *tags[TLast] = { 1.25 - [Tscratch] = "scratch", 1.26 - [Tdev] = "dev", 1.27 - [Twww] = "www", 1.28 - [Twork] = "work", 1.29 -}; 1.30 - 1.31 -/********** CUSTOMIZE **********/ 1.32 - 1.33 -/* X structs */ 1.34 Display *dpy; 1.35 Window root, barwin; 1.36 Atom wm_atom[WMLast], net_atom[NetLast]; 1.37 @@ -48,8 +34,17 @@ 1.38 "dwm-" VERSION ", (C)opyright MMVI Anselm R. Garbe\n"; 1.39 static int (*xerrorxlib)(Display *, XErrorEvent *); 1.40 1.41 +/* static functions */ 1.42 + 1.43 static void 1.44 -usage() { eprint("usage: dwm [-v]\n"); } 1.45 +cleanup() 1.46 +{ 1.47 + while(sel) { 1.48 + resize(sel, True); 1.49 + unmanage(sel); 1.50 + } 1.51 + XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); 1.52 +} 1.53 1.54 static void 1.55 scan() 1.56 @@ -73,22 +68,6 @@ 1.57 XFree(wins); 1.58 } 1.59 1.60 -static void 1.61 -cleanup() 1.62 -{ 1.63 - while(sel) { 1.64 - resize(sel, True); 1.65 - unmanage(sel); 1.66 - } 1.67 - XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime); 1.68 -} 1.69 - 1.70 -void 1.71 -quit(Arg *arg) 1.72 -{ 1.73 - running = False; 1.74 -} 1.75 - 1.76 static int 1.77 win_property(Window w, Atom a, Atom t, long l, unsigned char **prop) 1.78 { 1.79 @@ -109,6 +88,19 @@ 1.80 return res; 1.81 } 1.82 1.83 +/* 1.84 + * Startup Error handler to check if another window manager 1.85 + * is already running. 1.86 + */ 1.87 +static int 1.88 +xerrorstart(Display *dsply, XErrorEvent *ee) 1.89 +{ 1.90 + otherwm = True; 1.91 + return -1; 1.92 +} 1.93 + 1.94 +/* extern functions */ 1.95 + 1.96 int 1.97 getproto(Window w) 1.98 { 1.99 @@ -144,15 +136,10 @@ 1.100 XFlush(dpy); 1.101 } 1.102 1.103 -/* 1.104 - * Startup Error handler to check if another window manager 1.105 - * is already running. 1.106 - */ 1.107 -static int 1.108 -xerrorstart(Display *dsply, XErrorEvent *ee) 1.109 +void 1.110 +quit(Arg *arg) 1.111 { 1.112 - otherwm = True; 1.113 - return -1; 1.114 + running = False; 1.115 } 1.116 1.117 /* 1.118 @@ -201,7 +188,7 @@ 1.119 exit(0); 1.120 break; 1.121 default: 1.122 - usage(); 1.123 + eprint("usage: dwm [-v]\n"); 1.124 break; 1.125 } 1.126 }