diff options
| author | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-11 11:27:56 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@wmii.de> | 2006-07-11 11:27:56 +0200 |
| commit | 8a8b7956b6de80decbfd3bff6d2ad6e5bb69b2bd (patch) | |
| tree | 9d16550b8008be5469453dd1b39fc548e35256ad | |
| parent | implemented pipe_spawn (diff) | |
| download | dwm-8a8b7956b6de80decbfd3bff6d2ad6e5bb69b2bd.tar.gz dwm-8a8b7956b6de80decbfd3bff6d2ad6e5bb69b2bd.zip | |
new stuff
Diffstat (limited to '')
| -rw-r--r-- | client.c | 2 | ||||
| -rw-r--r-- | draw.c | 6 | ||||
| -rw-r--r-- | menu.c | 24 | ||||
| -rw-r--r-- | wm.c | 10 | ||||
| -rw-r--r-- | wm.h | 15 |
5 files changed, 25 insertions, 32 deletions
| @@ -14,7 +14,7 @@ update_client_name(Client *c) | |||
| 14 | { | 14 | { |
| 15 | XTextProperty name; | 15 | XTextProperty name; |
| 16 | int n; | 16 | int n; |
| 17 | char **list = 0; | 17 | char **list = NULL; |
| 18 | 18 | ||
| 19 | name.nitems = 0; | 19 | name.nitems = 0; |
| 20 | c->name[0] = 0; | 20 | c->name[0] = 0; |
| @@ -116,7 +116,7 @@ loadfont(Display *dpy, Fnt *font, const char *fontstr) | |||
| 116 | char **missing, *def; | 116 | char **missing, *def; |
| 117 | int n; | 117 | int n; |
| 118 | 118 | ||
| 119 | missing = 0; | 119 | missing = NULL; |
| 120 | def = "?"; | 120 | def = "?"; |
| 121 | setlocale(LC_ALL, ""); | 121 | setlocale(LC_ALL, ""); |
| 122 | if(font->set) | 122 | if(font->set) |
| @@ -128,7 +128,7 @@ loadfont(Display *dpy, Fnt *font, const char *fontstr) | |||
| 128 | XFreeStringList(missing); | 128 | XFreeStringList(missing); |
| 129 | if(font->set) { | 129 | if(font->set) { |
| 130 | XFreeFontSet(dpy, font->set); | 130 | XFreeFontSet(dpy, font->set); |
| 131 | font->set = 0; | 131 | font->set = NULL; |
| 132 | } | 132 | } |
| 133 | } | 133 | } |
| 134 | if(font->set) { | 134 | if(font->set) { |
| @@ -151,7 +151,7 @@ loadfont(Display *dpy, Fnt *font, const char *fontstr) | |||
| 151 | else { | 151 | else { |
| 152 | if(font->xfont) | 152 | if(font->xfont) |
| 153 | XFreeFont(dpy, font->xfont); | 153 | XFreeFont(dpy, font->xfont); |
| 154 | font->xfont = 0; | 154 | font->xfont = NULL; |
| 155 | font->xfont = XLoadQueryFont(dpy, fontstr); | 155 | font->xfont = XLoadQueryFont(dpy, fontstr); |
| 156 | if (!font->xfont) | 156 | if (!font->xfont) |
| 157 | font->xfont = XLoadQueryFont(dpy, "fixed"); | 157 | font->xfont = XLoadQueryFont(dpy, "fixed"); |
| @@ -34,15 +34,15 @@ static Window win; | |||
| 34 | static XRectangle rect; | 34 | static XRectangle rect; |
| 35 | static Bool done = False; | 35 | static Bool done = False; |
| 36 | 36 | ||
| 37 | static Item *allitem = 0; /* first of all items */ | 37 | static Item *allitem = NULL; /* first of all items */ |
| 38 | static Item *item = 0; /* first of pattern matching items */ | 38 | static Item *item = NULL; /* first of pattern matching items */ |
| 39 | static Item *sel = 0; | 39 | static Item *sel = NULL; |
| 40 | static Item *nextoff = 0; | 40 | static Item *nextoff = NULL; |
| 41 | static Item *prevoff = 0; | 41 | static Item *prevoff = NULL; |
| 42 | static Item *curroff = 0; | 42 | static Item *curroff = NULL; |
| 43 | 43 | ||
| 44 | static int screen; | 44 | static int screen; |
| 45 | static char *title = 0; | 45 | static char *title = NULL; |
| 46 | static char text[4096]; | 46 | static char text[4096]; |
| 47 | static int ret = 0; | 47 | static int ret = 0; |
| 48 | static int nitem = 0; | 48 | static int nitem = 0; |
| @@ -107,7 +107,7 @@ update_items(char *pattern) | |||
| 107 | else | 107 | else |
| 108 | cmdw = twidth; | 108 | cmdw = twidth; |
| 109 | 109 | ||
| 110 | item = j = 0; | 110 | item = j = NULL; |
| 111 | nitem = 0; | 111 | nitem = 0; |
| 112 | 112 | ||
| 113 | for(i = allitem; i; i=i->next) | 113 | for(i = allitem; i; i=i->next) |
| @@ -117,7 +117,7 @@ update_items(char *pattern) | |||
| 117 | else | 117 | else |
| 118 | j->right = i; | 118 | j->right = i; |
| 119 | i->left = j; | 119 | i->left = j; |
| 120 | i->right = 0; | 120 | i->right = NULL; |
| 121 | j = i; | 121 | j = i; |
| 122 | nitem++; | 122 | nitem++; |
| 123 | } | 123 | } |
| @@ -129,7 +129,7 @@ update_items(char *pattern) | |||
| 129 | else | 129 | else |
| 130 | j->right = i; | 130 | j->right = i; |
| 131 | i->left = j; | 131 | i->left = j; |
| 132 | i->right = 0; | 132 | i->right = NULL; |
| 133 | j = i; | 133 | j = i; |
| 134 | nitem++; | 134 | nitem++; |
| 135 | } | 135 | } |
| @@ -319,7 +319,7 @@ kpress(XKeyEvent * e) | |||
| 319 | static char * | 319 | static char * |
| 320 | read_allitems() | 320 | read_allitems() |
| 321 | { | 321 | { |
| 322 | static char *maxname = 0; | 322 | static char *maxname = NULL; |
| 323 | char *p, buf[1024]; | 323 | char *p, buf[1024]; |
| 324 | unsigned int len = 0, max = 0; | 324 | unsigned int len = 0, max = 0; |
| 325 | Item *i, *new; | 325 | Item *i, *new; |
| @@ -336,7 +336,7 @@ read_allitems() | |||
| 336 | } | 336 | } |
| 337 | 337 | ||
| 338 | new = emalloc(sizeof(Item)); | 338 | new = emalloc(sizeof(Item)); |
| 339 | new->next = new->left = new->right = 0; | 339 | new->next = new->left = new->right = NULL; |
| 340 | new->text = p; | 340 | new->text = p; |
| 341 | if(!i) | 341 | if(!i) |
| 342 | allitem = new; | 342 | allitem = new; |
| @@ -20,8 +20,9 @@ Atom wm_atom[WMLast], net_atom[NetLast]; | |||
| 20 | Cursor cursor[CurLast]; | 20 | Cursor cursor[CurLast]; |
| 21 | XRectangle rect, barrect; | 21 | XRectangle rect, barrect; |
| 22 | Bool running = True; | 22 | Bool running = True; |
| 23 | Client *client = NULL; | ||
| 23 | 24 | ||
| 24 | char *bartext; | 25 | char *bartext, tag[256]; |
| 25 | int screen, sel_screen; | 26 | int screen, sel_screen; |
| 26 | unsigned int lock_mask, numlock_mask; | 27 | unsigned int lock_mask, numlock_mask; |
| 27 | 28 | ||
| @@ -74,12 +75,11 @@ win_property(Window w, Atom a, Atom t, long l, unsigned char **prop) | |||
| 74 | status = XGetWindowProperty(dpy, w, a, 0L, l, False, t, &real, &format, | 75 | status = XGetWindowProperty(dpy, w, a, 0L, l, False, t, &real, &format, |
| 75 | &res, &extra, prop); | 76 | &res, &extra, prop); |
| 76 | 77 | ||
| 77 | if(status != Success || *prop == 0) { | 78 | if(status != Success || *prop == NULL) { |
| 78 | return 0; | 79 | return 0; |
| 79 | } | 80 | } |
| 80 | if(res == 0) { | 81 | if(res == 0) |
| 81 | free((void *) *prop); | 82 | free((void *) *prop); |
| 82 | } | ||
| 83 | return res; | 83 | return res; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| @@ -264,7 +264,7 @@ main(int argc, char *argv[]) | |||
| 264 | barrect.width, barrect.height, 0, DefaultDepth(dpy, screen), | 264 | barrect.width, barrect.height, 0, DefaultDepth(dpy, screen), |
| 265 | CopyFromParent, DefaultVisual(dpy, screen), | 265 | CopyFromParent, DefaultVisual(dpy, screen), |
| 266 | CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); | 266 | CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); |
| 267 | bartext = 0; | 267 | bartext = NULL; |
| 268 | XDefineCursor(dpy, barwin, cursor[CurNormal]); | 268 | XDefineCursor(dpy, barwin, cursor[CurNormal]); |
| 269 | XMapRaised(dpy, barwin); | 269 | XMapRaised(dpy, barwin); |
| 270 | draw_bar(); | 270 | draw_bar(); |
| @@ -20,11 +20,10 @@ enum { CurNormal, CurResize, CurMove, CurInput, CurLast }; | |||
| 20 | enum { RFloat, RGrid, RLast }; | 20 | enum { RFloat, RGrid, RLast }; |
| 21 | 21 | ||
| 22 | typedef struct Client Client; | 22 | typedef struct Client Client; |
| 23 | typedef struct Tag Tag; | ||
| 24 | 23 | ||
| 25 | struct Client { | 24 | struct Client { |
| 26 | Tag *tag; | ||
| 27 | char name[256]; | 25 | char name[256]; |
| 26 | char tag[256]; | ||
| 28 | int proto; | 27 | int proto; |
| 29 | unsigned int border; | 28 | unsigned int border; |
| 30 | Bool fixedsize; | 29 | Bool fixedsize; |
| @@ -37,27 +36,21 @@ struct Client { | |||
| 37 | Client *snext; | 36 | Client *snext; |
| 38 | }; | 37 | }; |
| 39 | 38 | ||
| 40 | struct Tag { | ||
| 41 | char name[256]; | ||
| 42 | Client *stack; | ||
| 43 | XRectangle r; | ||
| 44 | Tag *next; | ||
| 45 | Tag *cnext; | ||
| 46 | }; | ||
| 47 | |||
| 48 | extern Display *dpy; | 39 | extern Display *dpy; |
| 49 | extern Window root, barwin; | 40 | extern Window root, barwin; |
| 50 | extern Atom wm_atom[WMLast], net_atom[NetLast]; | 41 | extern Atom wm_atom[WMLast], net_atom[NetLast]; |
| 51 | extern Cursor cursor[CurLast]; | 42 | extern Cursor cursor[CurLast]; |
| 52 | extern XRectangle rect, barrect; | 43 | extern XRectangle rect, barrect; |
| 53 | extern Bool running; | 44 | extern Bool running; |
| 45 | extern Bool grid; | ||
| 54 | extern void (*handler[LASTEvent]) (XEvent *); | 46 | extern void (*handler[LASTEvent]) (XEvent *); |
| 55 | 47 | ||
| 56 | extern int screen, sel_screen; | 48 | extern int screen, sel_screen; |
| 57 | extern unsigned int lock_mask, numlock_mask; | 49 | extern unsigned int lock_mask, numlock_mask; |
| 58 | extern char *bartext; | 50 | extern char *bartext, tag[256]; |
| 59 | 51 | ||
| 60 | extern Brush brush; | 52 | extern Brush brush; |
| 53 | extern Client *client; | ||
| 61 | 54 | ||
| 62 | /* bar.c */ | 55 | /* bar.c */ |
| 63 | extern void draw_bar(); | 56 | extern void draw_bar(); |
