aewl

changeset 773:d2e56ce18f5b

remove static since its only one source file now; removed empty lines
author meillo@marmaro.de
date Sat, 06 Dec 2008 11:28:48 +0100
parents 0c1e9952a278
children c7e8fe5ac881
files aewl.c
diffstat 1 files changed, 34 insertions(+), 137 deletions(-) [+]
line diff
     1.1 --- a/aewl.c	Sat Dec 06 11:15:51 2008 +0100
     1.2 +++ b/aewl.c	Sat Dec 06 11:28:48 2008 +0100
     1.3 @@ -148,12 +148,7 @@
     1.4  static unsigned int len = 0;
     1.5  
     1.6  
     1.7 -RULES
     1.8 -KEYS
     1.9  
    1.10 -
    1.11 -
    1.12 -/* client.c */
    1.13  void configure(Client *c);		/* send synthetic configure event */
    1.14  void focus(Client *c);			/* focus c, c may be NULL */
    1.15  Client *getclient(Window w);		/* return client of w */
    1.16 @@ -164,36 +159,29 @@
    1.17  void updatetitle(Client *c);		/* update the name of c */
    1.18  void unmanage(Client *c);		/* destroy c */
    1.19  
    1.20 -/* draw.c */
    1.21  void drawstatus(void);			/* draw the bar */
    1.22  unsigned long getcolor(const char *colstr);	/* return color of colstr */
    1.23  void setfont(const char *fontstr);	/* set the font for DC */
    1.24  unsigned int textw(const char *text);	/* return the width of text in px*/
    1.25  
    1.26 -/* event.c */
    1.27  void grabkeys(void);			/* grab all keys defined in config.h */
    1.28  void procevent(void);			/* process pending X events */
    1.29  
    1.30 -/* main.c */
    1.31  void sendevent(Window w, Atom a, long value);	/* send synthetic event to w */
    1.32  int xerror(Display *dsply, XErrorEvent *ee);	/* X error handler */
    1.33  
    1.34 -/* tag.c */
    1.35  Client *getnext(Client *c);		/* returns next visible client */
    1.36  void settag(Client *c, Client *trans);	/* sets tag of c */
    1.37  
    1.38 -/* util.c */
    1.39  void *emallocz(unsigned int size);	/* allocates zero-initialized memory, exits on error */
    1.40  void eprint(const char *errstr, ...);	/* prints errstr and exits with 1 */
    1.41  
    1.42 -/* view.c */
    1.43  void detach(Client *c);			/* detaches c from global client list */
    1.44  void dotile(void);			/* arranges all windows tiled */
    1.45  void domax(void);            /* arranges all windows fullscreen */
    1.46  Bool isvisible(Client *c);		/* returns True if client is visible */
    1.47  void restack(void);			/* restores z layers of all clients */
    1.48  
    1.49 -
    1.50  void toggleview(void);			/* toggle the view */
    1.51  void focusnext(void);		/* focuses next visible client  */
    1.52  void zoom(void);			/* zooms the focused client to master area */
    1.53 @@ -208,6 +196,10 @@
    1.54  
    1.55  
    1.56  
    1.57 +RULES
    1.58 +KEYS
    1.59 +
    1.60 +
    1.61  
    1.62  
    1.63  
    1.64 @@ -216,15 +208,14 @@
    1.65  
    1.66  
    1.67  /* from view.c */
    1.68 -/* static */
    1.69  
    1.70 -static Client *
    1.71 +Client *
    1.72  nexttiled(Client *c) {
    1.73  	for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
    1.74  	return c;
    1.75  }
    1.76  
    1.77 -static void
    1.78 +void
    1.79  togglemax(Client *c) {
    1.80  	XEvent ev;
    1.81  		
    1.82 @@ -252,7 +243,6 @@
    1.83  
    1.84  
    1.85  
    1.86 -void (*arrange)(void) = DEFMODE;
    1.87  
    1.88  void
    1.89  detach(Client *c) {
    1.90 @@ -455,24 +445,8 @@
    1.91  	arrange();
    1.92  }
    1.93  
    1.94 -
    1.95 -
    1.96 -
    1.97 -
    1.98 -
    1.99 -
   1.100 -
   1.101 -
   1.102 -
   1.103 -
   1.104 -
   1.105 -
   1.106 -
   1.107 -
   1.108 -
   1.109  /* from util.c */
   1.110  
   1.111 -
   1.112  void *
   1.113  emallocz(unsigned int size) {
   1.114  	void *res = calloc(1, size);
   1.115 @@ -516,22 +490,8 @@
   1.116  	wait(0);
   1.117  }
   1.118  
   1.119 -
   1.120 -
   1.121 -
   1.122 -
   1.123 -
   1.124 -
   1.125 -
   1.126 -
   1.127 -
   1.128 -
   1.129 -
   1.130 -
   1.131  /* from tag.c */
   1.132  
   1.133 -/* static */
   1.134 -
   1.135  Client *
   1.136  getnext(Client *c) {
   1.137  	while(c && !isvisible(c)) {
   1.138 @@ -581,22 +541,9 @@
   1.139  	toggleview();
   1.140  }
   1.141  
   1.142 +/* from event.c */
   1.143  
   1.144 -
   1.145 -
   1.146 -
   1.147 -
   1.148 -
   1.149 -
   1.150 -
   1.151 -
   1.152 -
   1.153 -/* from event.c */
   1.154 -/* static */
   1.155 -
   1.156 -
   1.157 -
   1.158 -static void
   1.159 +void
   1.160  movemouse(Client *c) {
   1.161  	int x1, y1, ocx, ocy, di;
   1.162  	unsigned int dui;
   1.163 @@ -640,7 +587,7 @@
   1.164  	}
   1.165  }
   1.166  
   1.167 -static void
   1.168 +void
   1.169  resizemouse(Client *c) {
   1.170  	int ocx, ocy;
   1.171  	int nw, nh;
   1.172 @@ -677,7 +624,7 @@
   1.173  	}
   1.174  }
   1.175  
   1.176 -static void
   1.177 +void
   1.178  buttonpress(XEvent *e) {
   1.179  	Client *c;
   1.180  	XButtonPressedEvent *ev = &e->xbutton;
   1.181 @@ -699,7 +646,7 @@
   1.182  	}
   1.183  }
   1.184  
   1.185 -static void
   1.186 +void
   1.187  configurerequest(XEvent *e) {
   1.188  	unsigned long newmask;
   1.189  	Client *c;
   1.190 @@ -748,7 +695,7 @@
   1.191  	}
   1.192  }
   1.193  
   1.194 -static void
   1.195 +void
   1.196  destroynotify(XEvent *e) {
   1.197  	Client *c;
   1.198  	XDestroyWindowEvent *ev = &e->xdestroywindow;
   1.199 @@ -757,7 +704,7 @@
   1.200  		unmanage(c);
   1.201  }
   1.202  
   1.203 -static void
   1.204 +void
   1.205  enternotify(XEvent *e) {
   1.206  	Client *c;
   1.207  	XCrossingEvent *ev = &e->xcrossing;
   1.208 @@ -773,7 +720,7 @@
   1.209  	}
   1.210  }
   1.211  
   1.212 -static void
   1.213 +void
   1.214  expose(XEvent *e) {
   1.215  	XExposeEvent *ev = &e->xexpose;
   1.216  
   1.217 @@ -783,7 +730,7 @@
   1.218  	}
   1.219  }
   1.220  
   1.221 -static void
   1.222 +void
   1.223  keypress(XEvent *e) {
   1.224  	static unsigned int len = sizeof key / sizeof key[0];
   1.225  	unsigned int i;
   1.226 @@ -799,7 +746,7 @@
   1.227  	}
   1.228  }
   1.229  
   1.230 -static void
   1.231 +void
   1.232  leavenotify(XEvent *e) {
   1.233  	XCrossingEvent *ev = &e->xcrossing;
   1.234  
   1.235 @@ -809,7 +756,7 @@
   1.236  	}
   1.237  }
   1.238  
   1.239 -static void
   1.240 +void
   1.241  mappingnotify(XEvent *e) {
   1.242  	XMappingEvent *ev = &e->xmapping;
   1.243  
   1.244 @@ -818,7 +765,7 @@
   1.245  		grabkeys();
   1.246  }
   1.247  
   1.248 -static void
   1.249 +void
   1.250  maprequest(XEvent *e) {
   1.251  	static XWindowAttributes wa;
   1.252  	XMapRequestEvent *ev = &e->xmaprequest;
   1.253 @@ -834,7 +781,7 @@
   1.254  		manage(ev->window, &wa);
   1.255  }
   1.256  
   1.257 -static void
   1.258 +void
   1.259  propertynotify(XEvent *e) {
   1.260  	Client *c;
   1.261  	Window trans;
   1.262 @@ -862,7 +809,7 @@
   1.263  	}
   1.264  }
   1.265  
   1.266 -static void
   1.267 +void
   1.268  unmapnotify(XEvent *e) {
   1.269  	Client *c;
   1.270  	XUnmapEvent *ev = &e->xunmap;
   1.271 @@ -918,24 +865,9 @@
   1.272  	}
   1.273  }
   1.274  
   1.275 +/* from draw.c */
   1.276  
   1.277 -
   1.278 -
   1.279 -
   1.280 -
   1.281 -
   1.282 -
   1.283 -
   1.284 -
   1.285 -
   1.286 -
   1.287 -
   1.288 -
   1.289 -
   1.290 -/* from draw.c */
   1.291 -/* static */
   1.292 -
   1.293 -static unsigned int
   1.294 +unsigned int
   1.295  textnw(const char *text, unsigned int len) {
   1.296  	XRectangle r;
   1.297  
   1.298 @@ -946,7 +878,7 @@
   1.299  	return XTextWidth(dc.font.xfont, text, len);
   1.300  }
   1.301  
   1.302 -static void
   1.303 +void
   1.304  drawtext(const char *text, unsigned long col[ColLast]) {
   1.305  	int x, y, w, h;
   1.306  	static char buf[256];
   1.307 @@ -991,8 +923,6 @@
   1.308  	}
   1.309  }
   1.310  
   1.311 -
   1.312 -
   1.313  void
   1.314  drawstatus(void) {
   1.315  	int x;
   1.316 @@ -1096,27 +1026,16 @@
   1.317  	return textnw(text, strlen(text)) + dc.font.height;
   1.318  }
   1.319  
   1.320 +/* from client.c */
   1.321  
   1.322 -
   1.323 -
   1.324 -
   1.325 -
   1.326 -
   1.327 -
   1.328 -
   1.329 -
   1.330 -
   1.331 -/* from client.c */
   1.332 -/* static */
   1.333 -
   1.334 -static void
   1.335 +void
   1.336  detachstack(Client *c) {
   1.337  	Client **tc;
   1.338  	for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext);
   1.339  	*tc = c->snext;
   1.340  }
   1.341  
   1.342 -static void
   1.343 +void
   1.344  grabbuttons(Client *c, Bool focused) {
   1.345  	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
   1.346  
   1.347 @@ -1153,20 +1072,18 @@
   1.348  	}
   1.349  }
   1.350  
   1.351 -static void
   1.352 +void
   1.353  setclientstate(Client *c, long state) {
   1.354  	long data[] = {state, None};
   1.355  	XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32,
   1.356  			PropModeReplace, (unsigned char *)data, 2);
   1.357  }
   1.358  
   1.359 -static int
   1.360 +int
   1.361  xerrordummy(Display *dsply, XErrorEvent *ee) {
   1.362  	return 0;
   1.363  }
   1.364  
   1.365 -
   1.366 -
   1.367  void
   1.368  configure(Client *c) {
   1.369  	XEvent synev;
   1.370 @@ -1453,28 +1370,9 @@
   1.371  	arrange();
   1.372  }
   1.373  
   1.374 +/* from main.c */
   1.375  
   1.376 -
   1.377 -
   1.378 -
   1.379 -
   1.380 -
   1.381 -
   1.382 -
   1.383 -
   1.384 -
   1.385 -
   1.386 -
   1.387 -
   1.388 -
   1.389 -
   1.390 -
   1.391 -
   1.392 -
   1.393 -/* static */
   1.394 -
   1.395 -
   1.396 -static void
   1.397 +void
   1.398  cleanup(void) {
   1.399  	close(STDIN_FILENO);
   1.400  	while(stack) {
   1.401 @@ -1496,7 +1394,7 @@
   1.402  	XSync(dpy, False);
   1.403  }
   1.404  
   1.405 -static void
   1.406 +void
   1.407  scan(void) {
   1.408  	unsigned int i, num;
   1.409  	Window *wins, d1, d2;
   1.410 @@ -1517,7 +1415,7 @@
   1.411  		XFree(wins);
   1.412  }
   1.413  
   1.414 -static void
   1.415 +void
   1.416  setup(void) {
   1.417  	int i, j;
   1.418  	unsigned int mask;
   1.419 @@ -1565,6 +1463,7 @@
   1.420  	sw = DisplayWidth(dpy, screen);
   1.421  	sh = DisplayHeight(dpy, screen);
   1.422  	nmaster = NMASTER;
   1.423 +	arrange = DEFMODE;
   1.424  	/* bar */
   1.425  	dc.h = bh = dc.font.height + 2;
   1.426  	wa.override_redirect = 1;
   1.427 @@ -1593,14 +1492,12 @@
   1.428   * Startup Error handler to check if another window manager
   1.429   * is already running.
   1.430   */
   1.431 -static int
   1.432 +int
   1.433  xerrorstart(Display *dsply, XErrorEvent *ee) {
   1.434  	otherwm = True;
   1.435  	return -1;
   1.436  }
   1.437  
   1.438 -
   1.439 -
   1.440  void
   1.441  sendevent(Window w, Atom a, long value) {
   1.442  	XEvent e;