dwm-meillo

changeset 7:49e2fc9fb94f

new stuff
author Anselm R. Garbe <garbeam@wmii.de>
date Tue, 11 Jul 2006 11:27:56 +0200
parents e0cefb3981c8
children 7066ff2fe8bc
files client.c draw.c menu.c wm.c wm.h
diffstat 5 files changed, 25 insertions(+), 32 deletions(-) [+]
line diff
     1.1 --- a/client.c	Tue Jul 11 11:10:05 2006 +0200
     1.2 +++ b/client.c	Tue Jul 11 11:27:56 2006 +0200
     1.3 @@ -14,7 +14,7 @@
     1.4  {
     1.5  	XTextProperty name;
     1.6  	int n;
     1.7 -	char **list = 0;
     1.8 +	char **list = NULL;
     1.9  
    1.10  	name.nitems = 0;
    1.11  	c->name[0] = 0;
     2.1 --- a/draw.c	Tue Jul 11 11:10:05 2006 +0200
     2.2 +++ b/draw.c	Tue Jul 11 11:27:56 2006 +0200
     2.3 @@ -116,7 +116,7 @@
     2.4  	char **missing, *def;
     2.5  	int n;
     2.6  
     2.7 -	missing = 0;
     2.8 +	missing = NULL;
     2.9  	def = "?";
    2.10  	setlocale(LC_ALL, "");
    2.11  	if(font->set)
    2.12 @@ -128,7 +128,7 @@
    2.13  		XFreeStringList(missing);
    2.14  		if(font->set) {
    2.15  			XFreeFontSet(dpy, font->set);
    2.16 -			font->set = 0;
    2.17 +			font->set = NULL;
    2.18  		}
    2.19  	}
    2.20  	if(font->set) {
    2.21 @@ -151,7 +151,7 @@
    2.22  	else {
    2.23  		if(font->xfont)
    2.24  			XFreeFont(dpy, font->xfont);
    2.25 -		font->xfont = 0;
    2.26 +		font->xfont = NULL;
    2.27  		font->xfont = XLoadQueryFont(dpy, fontstr);
    2.28  		if (!font->xfont)
    2.29  			font->xfont = XLoadQueryFont(dpy, "fixed");
     3.1 --- a/menu.c	Tue Jul 11 11:10:05 2006 +0200
     3.2 +++ b/menu.c	Tue Jul 11 11:27:56 2006 +0200
     3.3 @@ -34,15 +34,15 @@
     3.4  static XRectangle rect;
     3.5  static Bool done = False;
     3.6  
     3.7 -static Item *allitem = 0;	/* first of all items */
     3.8 -static Item *item = 0;	/* first of pattern matching items */
     3.9 -static Item *sel = 0;
    3.10 -static Item *nextoff = 0;
    3.11 -static Item *prevoff = 0;
    3.12 -static Item *curroff = 0;
    3.13 +static Item *allitem = NULL;	/* first of all items */
    3.14 +static Item *item = NULL;	/* first of pattern matching items */
    3.15 +static Item *sel = NULL;
    3.16 +static Item *nextoff = NULL;
    3.17 +static Item *prevoff = NULL;
    3.18 +static Item *curroff = NULL;
    3.19  
    3.20  static int screen;
    3.21 -static char *title = 0;
    3.22 +static char *title = NULL;
    3.23  static char text[4096];
    3.24  static int ret = 0;
    3.25  static int nitem = 0;
    3.26 @@ -107,7 +107,7 @@
    3.27  	else
    3.28  		cmdw = twidth;
    3.29  
    3.30 -	item = j = 0;
    3.31 +	item = j = NULL;
    3.32  	nitem = 0;
    3.33  
    3.34  	for(i = allitem; i; i=i->next)
    3.35 @@ -117,7 +117,7 @@
    3.36  			else
    3.37  				j->right = i;
    3.38  			i->left = j;
    3.39 -			i->right = 0;
    3.40 +			i->right = NULL;
    3.41  			j = i;
    3.42  			nitem++;
    3.43  		}
    3.44 @@ -129,7 +129,7 @@
    3.45  			else
    3.46  				j->right = i;
    3.47  			i->left = j;
    3.48 -			i->right = 0;
    3.49 +			i->right = NULL;
    3.50  			j = i;
    3.51  			nitem++;
    3.52  		}
    3.53 @@ -319,7 +319,7 @@
    3.54  static char *
    3.55  read_allitems()
    3.56  {
    3.57 -	static char *maxname = 0;
    3.58 +	static char *maxname = NULL;
    3.59  	char *p, buf[1024];
    3.60  	unsigned int len = 0, max = 0;
    3.61  	Item *i, *new;
    3.62 @@ -336,7 +336,7 @@
    3.63  		}
    3.64  
    3.65  		new = emalloc(sizeof(Item));
    3.66 -		new->next = new->left = new->right = 0;
    3.67 +		new->next = new->left = new->right = NULL;
    3.68  		new->text = p;
    3.69  		if(!i)
    3.70  			allitem = new;
     4.1 --- a/wm.c	Tue Jul 11 11:10:05 2006 +0200
     4.2 +++ b/wm.c	Tue Jul 11 11:27:56 2006 +0200
     4.3 @@ -20,8 +20,9 @@
     4.4  Cursor cursor[CurLast];
     4.5  XRectangle rect, barrect;
     4.6  Bool running = True;
     4.7 +Client *client = NULL;
     4.8  
     4.9 -char *bartext;
    4.10 +char *bartext, tag[256];
    4.11  int screen, sel_screen;
    4.12  unsigned int lock_mask, numlock_mask;
    4.13  
    4.14 @@ -74,12 +75,11 @@
    4.15  	status = XGetWindowProperty(dpy, w, a, 0L, l, False, t, &real, &format,
    4.16  			&res, &extra, prop);
    4.17  
    4.18 -	if(status != Success || *prop == 0) {
    4.19 +	if(status != Success || *prop == NULL) {
    4.20  		return 0;
    4.21  	}
    4.22 -	if(res == 0) {
    4.23 +	if(res == 0)
    4.24  		free((void *) *prop);
    4.25 -	}
    4.26  	return res;
    4.27  }
    4.28  
    4.29 @@ -264,7 +264,7 @@
    4.30  			barrect.width, barrect.height, 0, DefaultDepth(dpy, screen),
    4.31  			CopyFromParent, DefaultVisual(dpy, screen),
    4.32  			CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
    4.33 -	bartext = 0;
    4.34 +	bartext = NULL;
    4.35  	XDefineCursor(dpy, barwin, cursor[CurNormal]);
    4.36  	XMapRaised(dpy, barwin);
    4.37  	draw_bar();
     5.1 --- a/wm.h	Tue Jul 11 11:10:05 2006 +0200
     5.2 +++ b/wm.h	Tue Jul 11 11:27:56 2006 +0200
     5.3 @@ -20,11 +20,10 @@
     5.4  enum { RFloat, RGrid, RLast };
     5.5  
     5.6  typedef struct Client Client;
     5.7 -typedef struct Tag Tag;
     5.8  
     5.9  struct Client {
    5.10 -	Tag *tag;
    5.11  	char name[256];
    5.12 +	char tag[256];
    5.13  	int proto;
    5.14  	unsigned int border;
    5.15  	Bool fixedsize;
    5.16 @@ -37,27 +36,21 @@
    5.17  	Client *snext;
    5.18  };
    5.19  
    5.20 -struct Tag {
    5.21 -	char name[256];
    5.22 -	Client *stack;
    5.23 -	XRectangle r;
    5.24 -	Tag *next;
    5.25 -	Tag *cnext;
    5.26 -};
    5.27 -
    5.28  extern Display *dpy;
    5.29  extern Window root, barwin;
    5.30  extern Atom wm_atom[WMLast], net_atom[NetLast];
    5.31  extern Cursor cursor[CurLast];
    5.32  extern XRectangle rect, barrect;
    5.33  extern Bool running;
    5.34 +extern Bool grid;
    5.35  extern void (*handler[LASTEvent]) (XEvent *);
    5.36  
    5.37  extern int screen, sel_screen;
    5.38  extern unsigned int lock_mask, numlock_mask;
    5.39 -extern char *bartext;
    5.40 +extern char *bartext, tag[256];
    5.41  
    5.42  extern Brush brush;
    5.43 +extern Client *client;
    5.44  
    5.45  /* bar.c */
    5.46  extern void draw_bar();