ordered variables in structs and source files alphabetically
This commit is contained in:
		
							
								
								
									
										4
									
								
								draw.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								draw.c
									
									
									
									
									
								
							@@ -8,7 +8,7 @@
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <X11/Xlocale.h>
 | 
			
		||||
 | 
			
		||||
/* static functions */
 | 
			
		||||
/* static */
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
drawborder(void)
 | 
			
		||||
@@ -90,7 +90,7 @@ drawtext(const char *text, Bool invert, Bool border)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* extern functions */
 | 
			
		||||
/* extern */
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
drawall()
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										38
									
								
								dwm.h
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								dwm.h
									
									
									
									
									
								
							@@ -37,28 +37,28 @@ union Arg {
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* atoms */
 | 
			
		||||
enum { WMProtocols, WMDelete, WMLast };
 | 
			
		||||
enum { NetSupported, NetWMName, NetLast };
 | 
			
		||||
enum { WMProtocols, WMDelete, WMLast };
 | 
			
		||||
 | 
			
		||||
/* cursor */
 | 
			
		||||
enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
 | 
			
		||||
enum { CurNormal, CurResize, CurMove, CurLast };
 | 
			
		||||
 | 
			
		||||
struct Fnt {
 | 
			
		||||
	XFontStruct *xfont;
 | 
			
		||||
	XFontSet set;
 | 
			
		||||
	int ascent;
 | 
			
		||||
	int descent;
 | 
			
		||||
	int height;
 | 
			
		||||
	XFontSet set;
 | 
			
		||||
	XFontStruct *xfont;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct DC { /* draw context */
 | 
			
		||||
	GC gc;
 | 
			
		||||
	Drawable drawable;
 | 
			
		||||
	int x, y, w, h;
 | 
			
		||||
	Fnt font;
 | 
			
		||||
	unsigned long bg;
 | 
			
		||||
	unsigned long fg;
 | 
			
		||||
	unsigned long border;
 | 
			
		||||
	Drawable drawable;
 | 
			
		||||
	Fnt font;
 | 
			
		||||
	GC gc;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct Client {
 | 
			
		||||
@@ -72,10 +72,10 @@ struct Client {
 | 
			
		||||
	unsigned int border;
 | 
			
		||||
	long flags; 
 | 
			
		||||
	Bool isfloat;
 | 
			
		||||
	Window win;
 | 
			
		||||
	Window title;
 | 
			
		||||
	Client *next;
 | 
			
		||||
	Client *revert;
 | 
			
		||||
	Window win;
 | 
			
		||||
	Window title;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
struct Rule {
 | 
			
		||||
@@ -92,20 +92,18 @@ struct Key {
 | 
			
		||||
	Arg arg;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
extern Display *dpy;
 | 
			
		||||
extern Window root, barwin;
 | 
			
		||||
extern Atom wmatom[WMLast], netatom[NetLast];
 | 
			
		||||
extern Cursor cursor[CurLast];
 | 
			
		||||
extern Bool running, issel;
 | 
			
		||||
extern char *tags[TLast], stext[1024];
 | 
			
		||||
extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
 | 
			
		||||
extern void (*handler[LASTEvent])(XEvent *);
 | 
			
		||||
extern void (*arrange)(Arg *);
 | 
			
		||||
extern Key key[];
 | 
			
		||||
 | 
			
		||||
extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
 | 
			
		||||
extern char *tags[TLast], stext[1024];
 | 
			
		||||
 | 
			
		||||
extern DC dc;
 | 
			
		||||
extern Atom wmatom[WMLast], netatom[NetLast];
 | 
			
		||||
extern Bool running, issel;
 | 
			
		||||
extern Client *clients, *sel;
 | 
			
		||||
extern Cursor cursor[CurLast];
 | 
			
		||||
extern DC dc;
 | 
			
		||||
extern Display *dpy;
 | 
			
		||||
extern Key key[];
 | 
			
		||||
extern Window root, barwin;
 | 
			
		||||
 | 
			
		||||
/* client.c */
 | 
			
		||||
extern void ban(Client *c);
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										7
									
								
								dwm.html
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								dwm.html
									
									
									
									
									
								
							@@ -39,10 +39,9 @@
 | 
			
		||||
		</p>
 | 
			
		||||
		<ul>
 | 
			
		||||
			<li>
 | 
			
		||||
			dwm has no 9P support, no menu, no editable tagbars,
 | 
			
		||||
			no shell-based configuration and remote control and comes without
 | 
			
		||||
			any additional tools like printing the selection or warping the
 | 
			
		||||
			mouse.
 | 
			
		||||
			dwm has no 9P support, no editable tagbars, no shell-based
 | 
			
		||||
			configuration and remote control and comes without any additional
 | 
			
		||||
			tools like printing the selection or warping the mouse.
 | 
			
		||||
			</li>
 | 
			
		||||
			<li>
 | 
			
		||||
			dwm is only a single binary, it's source code is intended to never
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										37
									
								
								event.c
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								event.c
									
									
									
									
									
								
							@@ -11,45 +11,44 @@
 | 
			
		||||
#define ButtonMask      (ButtonPressMask | ButtonReleaseMask)
 | 
			
		||||
#define MouseMask       (ButtonMask | PointerMotionMask)
 | 
			
		||||
 | 
			
		||||
/********** CUSTOMIZE **********/
 | 
			
		||||
 | 
			
		||||
/* CUSTOMIZE */
 | 
			
		||||
const char *browse[] = { "firefox", NULL };
 | 
			
		||||
const char *gimp[] = { "gimp", NULL };
 | 
			
		||||
const char *term[] = { 
 | 
			
		||||
	"urxvtc", "-tr", "+sb", "-bg", "black", "-fg", "white", "-cr", "white",
 | 
			
		||||
	"-fn", "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*", NULL
 | 
			
		||||
};
 | 
			
		||||
const char *browse[] = { "firefox", NULL };
 | 
			
		||||
const char *xlock[] = { "xlock", NULL };
 | 
			
		||||
 | 
			
		||||
Key key[] = {
 | 
			
		||||
	/* modifier				key			function	arguments */
 | 
			
		||||
	{ Mod1Mask,				XK_Return,	zoom,		{ 0 } },
 | 
			
		||||
	{ Mod1Mask,				XK_k,		focusprev,		{ 0 } },
 | 
			
		||||
	{ Mod1Mask,				XK_j,		focusnext,		{ 0 } }, 
 | 
			
		||||
	{ Mod1Mask,				XK_m,		maximize,		{ 0 } }, 
 | 
			
		||||
	{ ControlMask,			XK_0,		appendtag,	{ .i = Tscratch } }, 
 | 
			
		||||
	{ ControlMask,			XK_1,		appendtag,	{ .i = Tdev } }, 
 | 
			
		||||
	{ ControlMask,			XK_2,		appendtag,	{ .i = Twww } }, 
 | 
			
		||||
	{ ControlMask,			XK_3,		appendtag,	{ .i = Twork } }, 
 | 
			
		||||
	{ Mod1Mask,				XK_0,		view,		{ .i = Tscratch } }, 
 | 
			
		||||
	{ Mod1Mask,				XK_1,		view,		{ .i = Tdev } }, 
 | 
			
		||||
	{ Mod1Mask,				XK_2,		view,		{ .i = Twww } }, 
 | 
			
		||||
	{ Mod1Mask,				XK_3,		view,		{ .i = Twork } }, 
 | 
			
		||||
	{ Mod1Mask,				XK_j,		focusnext,		{ 0 } }, 
 | 
			
		||||
	{ Mod1Mask,				XK_k,		focusprev,		{ 0 } },
 | 
			
		||||
	{ Mod1Mask,				XK_m,		maximize,		{ 0 } }, 
 | 
			
		||||
	{ Mod1Mask,				XK_space,	dotile,		{ 0 } }, 
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_space,	dofloat,	{ 0 } }, 
 | 
			
		||||
	{ Mod1Mask,				XK_Return,	zoom,		{ 0 } },
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_0,		replacetag,		{ .i = Tscratch } }, 
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_1,		replacetag,		{ .i = Tdev } }, 
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_2,		replacetag,		{ .i = Twww } }, 
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_3,		replacetag,		{ .i = Twork } }, 
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_c,		killclient,		{ 0 } }, 
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_q,		quit,		{ 0 } },
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_Return,	spawn,		{ .argv = term } },
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_w,		spawn,		{ .argv = browse } },
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_g,		spawn,		{ .argv = gimp } },
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_l,		spawn,		{ .argv = xlock } },
 | 
			
		||||
	{ ControlMask,			XK_0,		appendtag,	{ .i = Tscratch } }, 
 | 
			
		||||
	{ ControlMask,			XK_1,		appendtag,	{ .i = Tdev } }, 
 | 
			
		||||
	{ ControlMask,			XK_2,		appendtag,	{ .i = Twww } }, 
 | 
			
		||||
	{ ControlMask,			XK_3,		appendtag,	{ .i = Twork } }, 
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_q,		quit,		{ 0 } },
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_space,	dofloat,	{ 0 } }, 
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_w,		spawn,		{ .argv = browse } },
 | 
			
		||||
	{ Mod1Mask|ShiftMask,	XK_Return,	spawn,		{ .argv = term } },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/********** CUSTOMIZE **********/
 | 
			
		||||
 | 
			
		||||
/* static functions */
 | 
			
		||||
/* static */
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
movemouse(Client *c)
 | 
			
		||||
@@ -337,7 +336,7 @@ unmapnotify(XEvent *e)
 | 
			
		||||
		unmanage(c);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* extern functions */
 | 
			
		||||
/* extern */
 | 
			
		||||
 | 
			
		||||
void (*handler[LASTEvent]) (XEvent *) = {
 | 
			
		||||
	[ButtonPress] = buttonpress,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										38
									
								
								main.c
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								main.c
									
									
									
									
									
								
							@@ -14,26 +14,12 @@
 | 
			
		||||
#include <X11/Xatom.h>
 | 
			
		||||
#include <X11/Xproto.h>
 | 
			
		||||
 | 
			
		||||
Display *dpy;
 | 
			
		||||
Window root, barwin;
 | 
			
		||||
Atom wmatom[WMLast], netatom[NetLast];
 | 
			
		||||
Cursor cursor[CurLast];
 | 
			
		||||
Bool running = True;
 | 
			
		||||
Bool issel = True;
 | 
			
		||||
 | 
			
		||||
int tsel = Tdev; /* default tag */
 | 
			
		||||
int screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
 | 
			
		||||
char stext[1024];
 | 
			
		||||
 | 
			
		||||
DC dc = {0};
 | 
			
		||||
Client *clients = NULL;
 | 
			
		||||
Client *sel = NULL;
 | 
			
		||||
/* static */
 | 
			
		||||
 | 
			
		||||
static Bool otherwm;
 | 
			
		||||
static int (*xerrorxlib)(Display *, XErrorEvent *);
 | 
			
		||||
 | 
			
		||||
/* static functions */
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
cleanup()
 | 
			
		||||
{
 | 
			
		||||
@@ -97,7 +83,20 @@ xerrorstart(Display *dsply, XErrorEvent *ee)
 | 
			
		||||
	return -1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* extern functions */
 | 
			
		||||
/* extern */
 | 
			
		||||
 | 
			
		||||
char stext[1024];
 | 
			
		||||
int tsel = Tdev; /* default tag */
 | 
			
		||||
int screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
 | 
			
		||||
Atom wmatom[WMLast], netatom[NetLast];
 | 
			
		||||
Bool running = True;
 | 
			
		||||
Bool issel = True;
 | 
			
		||||
Client *clients = NULL;
 | 
			
		||||
Client *sel = NULL;
 | 
			
		||||
Cursor cursor[CurLast];
 | 
			
		||||
Display *dpy;
 | 
			
		||||
DC dc = {0};
 | 
			
		||||
Window root, barwin;
 | 
			
		||||
 | 
			
		||||
int
 | 
			
		||||
getproto(Window w)
 | 
			
		||||
@@ -141,10 +140,9 @@ quit(Arg *arg)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * There's no way to check accesses to destroyed windows, thus
 | 
			
		||||
 * those cases are ignored (especially on UnmapNotify's).
 | 
			
		||||
 * Other types of errors call Xlib's default error handler, which
 | 
			
		||||
 * calls exit().
 | 
			
		||||
 * There's no way to check accesses to destroyed windows, thus those cases are
 | 
			
		||||
 * ignored (especially on UnmapNotify's).  Other types of errors call Xlibs
 | 
			
		||||
 * default error handler, which calls exit().
 | 
			
		||||
 */
 | 
			
		||||
int
 | 
			
		||||
xerror(Display *dpy, XErrorEvent *ee)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										21
									
								
								tag.c
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								tag.c
									
									
									
									
									
								
							@@ -7,24 +7,23 @@
 | 
			
		||||
#include <string.h>
 | 
			
		||||
#include <X11/Xutil.h>
 | 
			
		||||
 | 
			
		||||
/********** CUSTOMIZE **********/
 | 
			
		||||
/* static */
 | 
			
		||||
 | 
			
		||||
/* CUSTOMIZE */ 
 | 
			
		||||
static Rule rule[] = {
 | 
			
		||||
	/* class			instance	tags						isfloat */
 | 
			
		||||
	{ "Firefox-bin",	"Gecko",	{ [Twww] = "www" },			False },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* extern */
 | 
			
		||||
 | 
			
		||||
/* CUSTOMIZE */
 | 
			
		||||
char *tags[TLast] = {
 | 
			
		||||
	[Tscratch] = "scratch",
 | 
			
		||||
	[Tdev] = "dev",
 | 
			
		||||
	[Twww] = "www",
 | 
			
		||||
	[Twork] = "work",
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static Rule rule[] = {
 | 
			
		||||
	/* class			instance	tags						isfloat */
 | 
			
		||||
	{ "Firefox-bin",	"Gecko",	{ [Twww] = "www" },			False },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/********** CUSTOMIZE **********/
 | 
			
		||||
 | 
			
		||||
/* extern functions */
 | 
			
		||||
 | 
			
		||||
void (*arrange)(Arg *) = dotile;
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user