dwm-meillo

changeset 84:052fe7498930

ordered variables in structs and source files alphabetically
author Anselm R. Garbe <garbeam@wmii.de>
date Mon, 17 Jul 2006 09:12:29 +0200
parents ca809fdd30ea
children 0a6472e22039
files draw.c dwm.h dwm.html event.c main.c tag.c util.c
diffstat 7 files changed, 70 insertions(+), 77 deletions(-) [+]
line diff
     1.1 --- a/draw.c	Mon Jul 17 08:37:37 2006 +0200
     1.2 +++ b/draw.c	Mon Jul 17 09:12:29 2006 +0200
     1.3 @@ -8,7 +8,7 @@
     1.4  #include <string.h>
     1.5  #include <X11/Xlocale.h>
     1.6  
     1.7 -/* static functions */
     1.8 +/* static */
     1.9  
    1.10  static void
    1.11  drawborder(void)
    1.12 @@ -90,7 +90,7 @@
    1.13  	}
    1.14  }
    1.15  
    1.16 -/* extern functions */
    1.17 +/* extern */
    1.18  
    1.19  void
    1.20  drawall()
     2.1 --- a/dwm.h	Mon Jul 17 08:37:37 2006 +0200
     2.2 +++ b/dwm.h	Mon Jul 17 09:12:29 2006 +0200
     2.3 @@ -37,28 +37,28 @@
     2.4  };
     2.5  
     2.6  /* atoms */
     2.7 +enum { NetSupported, NetWMName, NetLast };
     2.8  enum { WMProtocols, WMDelete, WMLast };
     2.9 -enum { NetSupported, NetWMName, NetLast };
    2.10  
    2.11  /* cursor */
    2.12 -enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
    2.13 +enum { CurNormal, CurResize, CurMove, CurLast };
    2.14  
    2.15  struct Fnt {
    2.16 -	XFontStruct *xfont;
    2.17 -	XFontSet set;
    2.18  	int ascent;
    2.19  	int descent;
    2.20  	int height;
    2.21 +	XFontSet set;
    2.22 +	XFontStruct *xfont;
    2.23  };
    2.24  
    2.25  struct DC { /* draw context */
    2.26 -	GC gc;
    2.27 -	Drawable drawable;
    2.28  	int x, y, w, h;
    2.29 -	Fnt font;
    2.30  	unsigned long bg;
    2.31  	unsigned long fg;
    2.32  	unsigned long border;
    2.33 +	Drawable drawable;
    2.34 +	Fnt font;
    2.35 +	GC gc;
    2.36  };
    2.37  
    2.38  struct Client {
    2.39 @@ -72,10 +72,10 @@
    2.40  	unsigned int border;
    2.41  	long flags; 
    2.42  	Bool isfloat;
    2.43 +	Client *next;
    2.44 +	Client *revert;
    2.45  	Window win;
    2.46  	Window title;
    2.47 -	Client *next;
    2.48 -	Client *revert;
    2.49  };
    2.50  
    2.51  struct Rule {
    2.52 @@ -92,20 +92,18 @@
    2.53  	Arg arg;
    2.54  };
    2.55  
    2.56 -extern Display *dpy;
    2.57 -extern Window root, barwin;
    2.58 -extern Atom wmatom[WMLast], netatom[NetLast];
    2.59 -extern Cursor cursor[CurLast];
    2.60 -extern Bool running, issel;
    2.61 +extern char *tags[TLast], stext[1024];
    2.62 +extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
    2.63  extern void (*handler[LASTEvent])(XEvent *);
    2.64  extern void (*arrange)(Arg *);
    2.65 +extern Atom wmatom[WMLast], netatom[NetLast];
    2.66 +extern Bool running, issel;
    2.67 +extern Client *clients, *sel;
    2.68 +extern Cursor cursor[CurLast];
    2.69 +extern DC dc;
    2.70 +extern Display *dpy;
    2.71  extern Key key[];
    2.72 -
    2.73 -extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
    2.74 -extern char *tags[TLast], stext[1024];
    2.75 -
    2.76 -extern DC dc;
    2.77 -extern Client *clients, *sel;
    2.78 +extern Window root, barwin;
    2.79  
    2.80  /* client.c */
    2.81  extern void ban(Client *c);
     3.1 --- a/dwm.html	Mon Jul 17 08:37:37 2006 +0200
     3.2 +++ b/dwm.html	Mon Jul 17 09:12:29 2006 +0200
     3.3 @@ -39,10 +39,9 @@
     3.4  		</p>
     3.5  		<ul>
     3.6  			<li>
     3.7 -			dwm has no 9P support, no menu, no editable tagbars,
     3.8 -			no shell-based configuration and remote control and comes without
     3.9 -			any additional tools like printing the selection or warping the
    3.10 -			mouse.
    3.11 +			dwm has no 9P support, no editable tagbars, no shell-based
    3.12 +			configuration and remote control and comes without any additional
    3.13 +			tools like printing the selection or warping the mouse.
    3.14  			</li>
    3.15  			<li>
    3.16  			dwm is only a single binary, it's source code is intended to never
     4.1 --- a/event.c	Mon Jul 17 08:37:37 2006 +0200
     4.2 +++ b/event.c	Mon Jul 17 09:12:29 2006 +0200
     4.3 @@ -11,45 +11,44 @@
     4.4  #define ButtonMask      (ButtonPressMask | ButtonReleaseMask)
     4.5  #define MouseMask       (ButtonMask | PointerMotionMask)
     4.6  
     4.7 -/********** CUSTOMIZE **********/
     4.8 -
     4.9 +/* CUSTOMIZE */
    4.10 +const char *browse[] = { "firefox", NULL };
    4.11 +const char *gimp[] = { "gimp", NULL };
    4.12  const char *term[] = { 
    4.13  	"urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white",
    4.14  	"-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL
    4.15  };
    4.16 -const char *browse[] = { "firefox", NULL };
    4.17  const char *xlock[] = { "xlock", NULL };
    4.18  
    4.19  Key key[] = {
    4.20  	/* modifier				key			function	arguments */
    4.21 -	{ Mod1Mask,				XK_Return,	zoom,		{ 0 } },
    4.22 -	{ Mod1Mask,				XK_k,		focusprev,		{ 0 } },
    4.23 -	{ Mod1Mask,				XK_j,		focusnext,		{ 0 } }, 
    4.24 -	{ Mod1Mask,				XK_m,		maximize,		{ 0 } }, 
    4.25 +	{ ControlMask,			XK_0,		appendtag,	{ .i = Tscratch } }, 
    4.26 +	{ ControlMask,			XK_1,		appendtag,	{ .i = Tdev } }, 
    4.27 +	{ ControlMask,			XK_2,		appendtag,	{ .i = Twww } }, 
    4.28 +	{ ControlMask,			XK_3,		appendtag,	{ .i = Twork } }, 
    4.29  	{ Mod1Mask,				XK_0,		view,		{ .i = Tscratch } }, 
    4.30  	{ Mod1Mask,				XK_1,		view,		{ .i = Tdev } }, 
    4.31  	{ Mod1Mask,				XK_2,		view,		{ .i = Twww } }, 
    4.32  	{ Mod1Mask,				XK_3,		view,		{ .i = Twork } }, 
    4.33 +	{ Mod1Mask,				XK_j,		focusnext,		{ 0 } }, 
    4.34 +	{ Mod1Mask,				XK_k,		focusprev,		{ 0 } },
    4.35 +	{ Mod1Mask,				XK_m,		maximize,		{ 0 } }, 
    4.36  	{ Mod1Mask,				XK_space,	dotile,		{ 0 } }, 
    4.37 -	{ Mod1Mask|ShiftMask,	XK_space,	dofloat,	{ 0 } }, 
    4.38 +	{ Mod1Mask,				XK_Return,	zoom,		{ 0 } },
    4.39  	{ Mod1Mask|ShiftMask,	XK_0,		replacetag,		{ .i = Tscratch } }, 
    4.40  	{ Mod1Mask|ShiftMask,	XK_1,		replacetag,		{ .i = Tdev } }, 
    4.41  	{ Mod1Mask|ShiftMask,	XK_2,		replacetag,		{ .i = Twww } }, 
    4.42  	{ Mod1Mask|ShiftMask,	XK_3,		replacetag,		{ .i = Twork } }, 
    4.43  	{ Mod1Mask|ShiftMask,	XK_c,		killclient,		{ 0 } }, 
    4.44 +	{ Mod1Mask|ShiftMask,	XK_g,		spawn,		{ .argv = gimp } },
    4.45 +	{ Mod1Mask|ShiftMask,	XK_l,		spawn,		{ .argv = xlock } },
    4.46  	{ Mod1Mask|ShiftMask,	XK_q,		quit,		{ 0 } },
    4.47 +	{ Mod1Mask|ShiftMask,	XK_space,	dofloat,	{ 0 } }, 
    4.48 +	{ Mod1Mask|ShiftMask,	XK_w,		spawn,		{ .argv = browse } },
    4.49  	{ Mod1Mask|ShiftMask,	XK_Return,	spawn,		{ .argv = term } },
    4.50 -	{ Mod1Mask|ShiftMask,	XK_w,		spawn,		{ .argv = browse } },
    4.51 -	{ Mod1Mask|ShiftMask,	XK_l,		spawn,		{ .argv = xlock } },
    4.52 -	{ ControlMask,			XK_0,		appendtag,	{ .i = Tscratch } }, 
    4.53 -	{ ControlMask,			XK_1,		appendtag,	{ .i = Tdev } }, 
    4.54 -	{ ControlMask,			XK_2,		appendtag,	{ .i = Twww } }, 
    4.55 -	{ ControlMask,			XK_3,		appendtag,	{ .i = Twork } }, 
    4.56  };
    4.57  
    4.58 -/********** CUSTOMIZE **********/
    4.59 -
    4.60 -/* static functions */
    4.61 +/* static */
    4.62  
    4.63  static void
    4.64  movemouse(Client *c)
    4.65 @@ -337,7 +336,7 @@
    4.66  		unmanage(c);
    4.67  }
    4.68  
    4.69 -/* extern functions */
    4.70 +/* extern */
    4.71  
    4.72  void (*handler[LASTEvent]) (XEvent *) = {
    4.73  	[ButtonPress] = buttonpress,
     5.1 --- a/main.c	Mon Jul 17 08:37:37 2006 +0200
     5.2 +++ b/main.c	Mon Jul 17 09:12:29 2006 +0200
     5.3 @@ -14,26 +14,12 @@
     5.4  #include <X11/Xatom.h>
     5.5  #include <X11/Xproto.h>
     5.6  
     5.7 -Display *dpy;
     5.8 -Window root, barwin;
     5.9 -Atom wmatom[WMLast], netatom[NetLast];
    5.10 -Cursor cursor[CurLast];
    5.11 -Bool running = True;
    5.12 -Bool issel = True;
    5.13  
    5.14 -int tsel = Tdev; /* default tag */
    5.15 -int screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
    5.16 -char stext[1024];
    5.17 -
    5.18 -DC dc = {0};
    5.19 -Client *clients = NULL;
    5.20 -Client *sel = NULL;
    5.21 +/* static */
    5.22  
    5.23  static Bool otherwm;
    5.24  static int (*xerrorxlib)(Display *, XErrorEvent *);
    5.25  
    5.26 -/* static functions */
    5.27 -
    5.28  static void
    5.29  cleanup()
    5.30  {
    5.31 @@ -97,7 +83,20 @@
    5.32  	return -1;
    5.33  }
    5.34  
    5.35 -/* extern functions */
    5.36 +/* extern */
    5.37 +
    5.38 +char stext[1024];
    5.39 +int tsel = Tdev; /* default tag */
    5.40 +int screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
    5.41 +Atom wmatom[WMLast], netatom[NetLast];
    5.42 +Bool running = True;
    5.43 +Bool issel = True;
    5.44 +Client *clients = NULL;
    5.45 +Client *sel = NULL;
    5.46 +Cursor cursor[CurLast];
    5.47 +Display *dpy;
    5.48 +DC dc = {0};
    5.49 +Window root, barwin;
    5.50  
    5.51  int
    5.52  getproto(Window w)
    5.53 @@ -141,10 +140,9 @@
    5.54  }
    5.55  
    5.56  /*
    5.57 - * There's no way to check accesses to destroyed windows, thus
    5.58 - * those cases are ignored (especially on UnmapNotify's).
    5.59 - * Other types of errors call Xlib's default error handler, which
    5.60 - * calls exit().
    5.61 + * There's no way to check accesses to destroyed windows, thus those cases are
    5.62 + * ignored (especially on UnmapNotify's).  Other types of errors call Xlibs
    5.63 + * default error handler, which calls exit().
    5.64   */
    5.65  int
    5.66  xerror(Display *dpy, XErrorEvent *ee)
     6.1 --- a/tag.c	Mon Jul 17 08:37:37 2006 +0200
     6.2 +++ b/tag.c	Mon Jul 17 09:12:29 2006 +0200
     6.3 @@ -7,24 +7,23 @@
     6.4  #include <string.h>
     6.5  #include <X11/Xutil.h>
     6.6  
     6.7 -/********** CUSTOMIZE **********/
     6.8 +/* static */
     6.9  
    6.10 +/* CUSTOMIZE */ 
    6.11 +static Rule rule[] = {
    6.12 +	/* class			instance	tags						isfloat */
    6.13 +	{ "Firefox-bin",	"Gecko",	{ [Twww] = "www" },			False },
    6.14 +};
    6.15 +
    6.16 +/* extern */
    6.17 +
    6.18 +/* CUSTOMIZE */
    6.19  char *tags[TLast] = {
    6.20  	[Tscratch] = "scratch",
    6.21  	[Tdev] = "dev",
    6.22  	[Twww] = "www",
    6.23  	[Twork] = "work",
    6.24  };
    6.25 -
    6.26 -static Rule rule[] = {
    6.27 -	/* class			instance	tags						isfloat */
    6.28 -	{ "Firefox-bin",	"Gecko",	{ [Twww] = "www" },			False },
    6.29 -};
    6.30 -
    6.31 -/********** CUSTOMIZE **********/
    6.32 -
    6.33 -/* extern functions */
    6.34 -
    6.35  void (*arrange)(Arg *) = dotile;
    6.36  
    6.37  void
     7.1 --- a/util.c	Mon Jul 17 08:37:37 2006 +0200
     7.2 +++ b/util.c	Mon Jul 17 09:12:29 2006 +0200
     7.3 @@ -10,7 +10,7 @@
     7.4  #include <sys/wait.h>
     7.5  #include <unistd.h>
     7.6  
     7.7 -/* static functions */
     7.8 +/* static */
     7.9  
    7.10  static void
    7.11  bad_malloc(unsigned int size)
    7.12 @@ -20,7 +20,7 @@
    7.13  	exit(1);
    7.14  }
    7.15  
    7.16 -/* extern functions */
    7.17 +/* extern */
    7.18  
    7.19  void *
    7.20  emallocz(unsigned int size)