[hackers] [wmii] New parsing code for ctl messages. New fontstring for 'fixed' for less missing fontsets.

From: Kris Maglione <jg_AT_suckless.org>
Date: Fri, 01 Jun 2007 01:10:21 -0000

changeset: 2127:14dd324d1b60
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Apr 24 01:41:41 2007 -0400
summary: New parsing code for ctl messages. New fontstring for 'fixed' for less missing fontsets.

diff -r eff4d9932d5f -r 14dd324d1b60 cmd/wmii/Makefile
--- a/cmd/wmii/Makefile Mon Apr 23 18:31:35 2007 -0400
+++ b/cmd/wmii/Makefile Tue Apr 24 01:41:41 2007 -0400
@@ -21,6 +21,7 @@ OBJ = area \
         key \
         main \
         map \
+ message \
         mouse \
         rule \
         printevent\
diff -r eff4d9932d5f -r 14dd324d1b60 cmd/wmii/area.c
--- a/cmd/wmii/area.c Mon Apr 23 18:31:35 2007 -0400
+++ b/cmd/wmii/area.c Tue Apr 24 01:41:41 2007 -0400
@@ -12,7 +12,6 @@
 #include "fns.h"
 
 static void place_frame(Frame *f);
-static char Ebadvalue[] = "bad value";
 
 Client *
 area_selclient(Area *a) {
@@ -179,7 +178,7 @@ attach_to_area(Area *a, Frame *f, Bool s
                 f->r.max.y = Dy(a->r) / n_frame;
         }
 
- insert_frame(a->sel, f, False);
+ insert_frame(a->sel, f);
 
         if(a->floating)
                 place_frame(f);
@@ -412,156 +411,3 @@ focus_area(Area *a) {
                         write_event("ClientFocus 0x%x\n", a->sel->client->w.w);
         }
 }
-
-char *
-select_area(Area *a, char *arg) {
- uint i;
- Frame *p, *f;
- Area *ap;
- View *v;
-
- v = a->view;
- f = a->sel;
- if(!strcmp(arg, "toggle")) {
- if(!a->floating)
- ap = v->area;
- else if(v->revert && v->revert != a)
- ap = v->revert;
- else
- ap = v->area->next;
- }
- else if(!strcmp(arg, "left")) {
- if(a->floating)
- return Ebadvalue;
- for(ap=v->area->next; ap->next; ap=ap->next)
- if(ap->next == a) break;
- }
- else if(!strcmp(arg, "right")) {
- if(a->floating)
- return Ebadvalue;
- ap = a->next;
- if(ap == nil)
- ap = v->area->next;
- }
- else if(!strcmp(arg, "up")) {
- if(!f)
- return Ebadvalue;
- for(p = f->area->frame; p->anext; p = p->anext)
- if(p->anext == f) break;
- goto focus_frame;
- }
- else if(!strcmp(arg, "down")) {
- if(!f)
- return Ebadvalue;
- p = f->anext;
- if(p == nil)
- p = a->frame;
- goto focus_frame;
- }
- else if(!strcmp(arg, "~"))
- ap = v->area;
- else {
- if(sscanf(arg, "%u", &i) != 1 || i == 0)
- return Ebadvalue;
- for(ap=v->area->next; ap; ap=ap->next)
- if(!--i) break;
- }
- focus_area(ap);
- return nil;
-
-focus_frame:
- focus_frame(p, False);
- frame_to_top(p);
- if(v == screen->sel)
- restack_view(v);
- return nil;
-}
-
-char *
-send_client(Frame *f, char *arg, Bool swap) {
- Area *to, *a;
- Client *c;
- Frame *tf;
- View *v;
- Bool before;
- int j;
-
- a = f->area;
- v = a->view;
- c = f->client;
-
- if(!strncmp(arg, "toggle", 7)) {
- if(!a->floating)
- to = v->area;
- else if(c->revert && !c->revert->floating)
- to = c->revert;
- else
- to = v->area->next;
- goto send_area;
- }else if(!a->floating) {
- if(!strncmp(arg, "left", 5)) {
- if(a->floating)
- return Ebadvalue;
- for(to=v->area->next; to; to=to->next)
- if(a == to->next) break;
- if(!to && !swap && (f->anext || f != a->frame))
- to=new_column(v, v->area, 0);
- goto send_area;
- }
- else if(!strncmp(arg, "right", 5)) {
- if(a->floating)
- return Ebadvalue;
- to = a->next;
- if(!to && !swap && (f->anext || f != a->frame))
- to = new_column(v, a, 0);
- goto send_area;
- }
- else if(!strncmp(arg, "up", 3)) {
- for(tf=a->frame; tf; tf=tf->anext)
- if(tf->anext == f) break;
- before = True;
- goto send_frame;
- }
- else if(!strncmp(arg, "down", 5)) {
- tf = f->anext;
- before = False;
- goto send_frame;
- }
- else {
- if(sscanf(arg, "%d", &j) != 1)
- return Ebadvalue;
- for(to=v->area; to; to=to->next)
- if(!--j) break;
- goto send_area;
- }
- }
- return Ebadvalue;
-
-send_frame:
- if(!tf)
- return Ebadvalue;
- if(!swap) {
- remove_frame(f);
- insert_frame(tf, f, before);
- }else
- swap_frames(f, tf);
- arrange_column(a, False);
-
- flushevents(EnterWindowMask, False);
- focus_frame(f, True);
- update_views();
- return nil;
-
-send_area:
- if(!to)
- return Ebadvalue;
- if(!swap)
- send_to_area(to, f);
- else if(to->sel)
- swap_frames(f, to->sel);
-
- flushevents(EnterWindowMask, False);
- focus_frame(f, True);
- update_views();
- return nil;
-}
diff -r eff4d9932d5f -r 14dd324d1b60 cmd/wmii/client.c
--- a/cmd/wmii/client.c Mon Apr 23 18:31:35 2007 -0400
+++ b/cmd/wmii/client.c Tue Apr 24 01:41:41 2007 -0400
@@ -11,7 +11,6 @@
 #include "fns.h"
 
 static Handlers handlers;
-static char Ebadcmd[] = "bad command";
 
 Rectangle gravclient(Client*, Rectangle);
 
@@ -433,7 +432,7 @@ kill_client(Client * c) {
                 XKillClient(display, c->w.w);
 }
 
-static void
+void
 set_urgent(Client *c, Bool urgent, Bool write) {
         XWMHints *wmh;
         char *cwrite, *cnot;
@@ -911,16 +910,3 @@ apply_rules(Client *c) {
         if(!strlen(c->tags))
                 apply_tags(c, "nil");
 }
-
-char *
-message_client(Client *c, char *message) {
- if(!strcmp(message, "kill"))
- kill_client(c);
- else if(!strcmp(message, "Urgent"))
- set_urgent(c, True, True);
- else if(!strcmp(message, "NotUrgent"))
- set_urgent(c, False, True);
- else
- return Ebadcmd;
- return nil;
-}
diff -r eff4d9932d5f -r 14dd324d1b60 cmd/wmii/dat.h
--- a/cmd/wmii/dat.h Mon Apr 23 18:31:35 2007 -0400
+++ b/cmd/wmii/dat.h Tue Apr 24 01:41:41 2007 -0400
@@ -7,7 +7,7 @@
 #include <utf.h>
 #include "x11.h"
 
-#define FONT "-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*"
+#define FONT "-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*"
 #define FOCUSCOLORS "#ffffff #335577 #447799"
 #define NORMCOLORS "#222222 #eeeeee #666666"
 
diff -r eff4d9932d5f -r 14dd324d1b60 cmd/wmii/event.c
--- a/cmd/wmii/event.c Mon Apr 23 18:31:35 2007 -0400
+++ b/cmd/wmii/event.c Tue Apr 24 01:41:41 2007 -0400
@@ -10,8 +10,6 @@
 
 void
 dispatch_event(XEvent *e) {
- Client *c;
-
         Debug printevent(e);
         if(handler[e->type])
                 handler[e->type](e);
diff -r eff4d9932d5f -r 14dd324d1b60 cmd/wmii/fns.h
--- a/cmd/wmii/fns.h Mon Apr 23 18:31:35 2007 -0400
+++ b/cmd/wmii/fns.h Tue Apr 24 01:41:41 2007 -0400
@@ -1,16 +1,12 @@
 /* © 2004-2006 Anselm R. Garbe <garbeam at gmail dot com>
  * See LICENSE file for license details.
  */
-
-/* wm.c */
-char *message_root(char *message);
 
 /* area.c */
 Area *create_area(View*, Area *pos, uint w);
 void destroy_area(Area*);
 Area *area_of_id(View*, ushort id);
 void focus_area(Area*);
-char *select_area(Area*, char *arg);
 void send_to_area(Area*, Frame*);
 void attach_to_area(Area*, Frame*, Bool send);
 void detach_from_area(Frame*);
@@ -36,6 +32,7 @@ void unmap_client(Client*, int state);
 void unmap_client(Client*, int state);
 int map_frame(Client*);
 int unmap_frame(Client*);
+void set_urgent(Client *c, Bool urgent, Bool write);
 void set_cursor(Client*, Cursor cur);
 void focus_frame(Frame*, Bool restack);
 void reparent_client(Client*, Window*, Point);
@@ -44,8 +41,6 @@ void focus_client(Client*);
 void focus_client(Client*);
 void resize_client(Client*, Rectangle*);
 void apply_sizehints(Client*, Rectangle*, Bool floating, Bool frame, Align sticky);
-char *send_client(Frame*, char*, Bool swap);
-char * message_client(Client*, char*);
 void move_client(Client*, char *arg);
 void size_client(Client*, char *arg);
 Client *selclient();
@@ -74,7 +69,7 @@ void print_focus(Client *c, char *to);
 /* frame.c */
 Frame *create_frame(Client*, View*);
 void remove_frame(Frame*);
-void insert_frame(Frame *pos, Frame*, Bool before);
+void insert_frame(Frame *pos, Frame*);
 void resize_frame(Frame*, Rectangle);
 Bool frame_to_top(Frame *f);
 void set_frame_cursor(Frame*, Point);
@@ -121,6 +116,17 @@ void* maprm(Map*, ulong);
 void* maprm(Map*, ulong);
 void* hashrm(Map*, char*);
 
+/* message.c */
+char * getword(Message*);
+Area * strarea(View*, char*);
+char * message_view(View*, Message*);
+char * parse_colors(Message*, CTuple*);
+char * message_root(void*, Message*);
+char * read_root_ctl();
+char * message_client(Client*, Message*);
+char *select_area(Area*, Message*);
+char *send_client(Frame*, Message*, Bool swap);
+
 /* mouse.c */
 void mouse_resizecol(Divide*);
 void do_mouse_resize(Client*, Bool opaque, Align);
@@ -142,10 +148,11 @@ void update_client_views(Client*, char**
 void update_client_views(Client*, char**);
 Rectangle *rects_of_view(View*, uint *num, Frame *ignore);
 View *view_of_id(ushort);
+Frame *view_clientframe(View *v, Client *c);
 void select_view(const char*);
 void attach_to_view(View*, Frame*);
 Client *view_selclient(View*);
-char *message_view(View*, char*);
+char *message_view(View *v, Message *m);
 void restack_view(View*);
 uchar *view_index(View*);
 void destroy_view(View*);
@@ -239,3 +246,4 @@ char* utfutf(char*, char*);
 char* utfutf(char*, char*);
 char* toutf8n(char*, int);
 char* toutf8(char*);
+int isspacerune(Rune c);
diff -r eff4d9932d5f -r 14dd324d1b60 cmd/wmii/frame.c
--- a/cmd/wmii/frame.c Mon Apr 23 18:31:35 2007 -0400
+++ b/cmd/wmii/frame.c Tue Apr 24 01:41:41 2007 -0400
@@ -55,13 +55,10 @@ remove_frame(Frame *f) {
 }
 
 void
-insert_frame(Frame *pos, Frame *f, Bool before) {
+insert_frame(Frame *pos, Frame *f) {
         Area *a;
 
         a = f->area;
-
- if(before)
- pos = pos->aprev;
 
         if(pos) {
                 f->aprev = pos;
diff -r eff4d9932d5f -r 14dd324d1b60 cmd/wmii/fs.c
--- a/cmd/wmii/fs.c Mon Apr 23 18:31:35 2007 -0400
+++ b/cmd/wmii/fs.c Tue Apr 24 01:41:41 2007 -0400
@@ -64,8 +64,7 @@ static char
         Enoperm[] = "permission denied",
         Enofile[] = "file not found",
         Ebadvalue[] = "bad value",
- Einterrupted[] = "interrupted",
- Ebadcmd[] = "bad command";
+ Einterrupted[] = "interrupted";
 
 /* Macros */
 #define QID(t, i) (((vlong)((t)&0xFF)<<32)|((i)&0xFFFFFFFF))
@@ -226,114 +225,38 @@ data_to_cstring(Ixp9Req *r) {
         free(p);
 }
 
-/* Should be somewhere else */
+typedef char* (*MsgFunc)(void*, Message*);
+
 char *
-parse_colors(char **buf, int *buflen, CTuple *col) {
- static regex_t reg;
- static Bool compiled;
-
- if(!compiled) {
- compiled = 1;
- regcomp(&reg, "^#[0-9a-f]{6} #[0-9a-f]{6} #[0-9a-f]{6}([[:space:]]|$)",
- REG_EXTENDED|REG_NOSUB|REG_ICASE);
- }
-
- if(*buflen < 23 || regexec(&reg, *buf, 0, 0, 0))
- return "bad value";
-
- (*buf)[23] = '\0';
- loadcolor(col, *buf);
-
- *buf += 23;
- *buflen -= 23;
- if(*buflen > 0) {
- (*buf)++;
- (*buflen)--;
- }
- return nil;
-}
-
-#define strecmp(str, const) (strncmp((str), (const), sizeof(const)-1))
-char *
-message_root(char *message) {
- Font *fn;
- uint n;
-
- if(!strchr(message, ' ')) {
- snprintf(buffer, sizeof(buffer), "%s ", message);
- message = buffer;
- }
-
- if(!strecmp(message, "quit "))
- srv.running = 0;
- else if(!strecmp(message, "exec ")) {
- message += sizeof("exec ")-1;
- execstr = emalloc(strlen(message) + sizeof("exec "));
- sprintf(execstr, "exec %s", message);
- srv.running = 0;
- }
- else if(!strecmp(message, "view ")) {
- message += sizeof("view ")-1;
- select_view(message);
- }
- else if(!strecmp(message, "selcolors ")) {
- fprintf(stderr, "%s: warning: selcolors have been removed\n", argv0);
- return Ebadcmd;
- }
- else if(!strecmp(message, "focuscolors ")) {
- message += sizeof("focuscolors ")-1;
- n = strlen(message);
- return parse_colors(&message, (int *)&n, &def.focuscolor);
- }
- else if(!strecmp(message, "normcolors ")) {
- message += sizeof("normcolors ")-1;
- n = strlen(message);
- return parse_colors(&message, (int *)&n, &def.normcolor);
- }
- else if(!strecmp(message, "font ")) {
- message += sizeof("font ")-1;
- fn = loadfont(message);
- if(fn) {
- freefont(def.font);
- def.font = fn;
- resize_bar(screen);
- }else
- return "can't load font";
- }
- else if(!strecmp(message, "border ")) {
- message += sizeof("border ")-1;
- n = (uint)strtol(message, &message, 10);
- if(*message)
- return Ebadvalue;
- def.border = n;
- }
- else if(!strecmp(message, "grabmod ")) {
- message += sizeof("grabmod ")-1;
- ulong mod;
- mod = mod_key_of_str(message);
- if(!(mod & (Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask)))
- return Ebadvalue;
- strncpy(def.grabmod, message, sizeof(def.grabmod));
- def.mod = mod;
- }
- else
- return Ebadcmd;
- return nil;
-}
-
-char *
-read_root_ctl() {
- uint i = 0;
- if(screen->sel)
- i += snprintf(&buffer[i], (sizeof(buffer) - i), "view %s\n", screen->sel->name);
- i += snprintf(&buffer[i], (sizeof(buffer) - i), "focuscolors %s\n", def.focuscolor.colstr);
- i += snprintf(&buffer[i], (sizeof(buffer) - i), "normcolors %s\n", def.normcolor.colstr);
- i += snprintf(&buffer[i], (sizeof(buffer) - i), "font %s\n", def.font->name);
- i += snprintf(&buffer[i], (sizeof(buffer) - i), "grabmod %s\n", def.grabmod);
- i += snprintf(&buffer[i], (sizeof(buffer) - i), "border %d\n", def.border);
- return buffer;
-}
-
+message(Ixp9Req *r, MsgFunc fn) {
+ char *err, *s, *p, c;
+ FileId *f;
+ Message m;
+
+ f = r->fid->aux;
+
+ data_to_cstring(r);
+ s = r->ifcall.data;
+
+ err = nil;
+ c = *s;
+ while(c != '\0') {
+ while(*s == '\n')
+ s++;
+ p = s;
+ while(*p != '\0' && *p != '\n')
+ p++;
+ c = *p;
+ *p = '\0';
+
+ m = ixp_message(s, p-s, 0);
+ s = fn(f->p.ref, &m);
+ if(s)
+ err = s;
+ s = p + 1;
+ }
+ return err;
+}
 
 void
 respond_event(Ixp9Req *r) {
@@ -627,7 +550,9 @@ fs_stat(Ixp9Req *r) {
         Stat s;
         int size;
         uchar *buf;
- FileId *f = r->fid->aux;
+ FileId *f;
+
+ f = r->fid->aux;
 
         if(!verify_file(f)) {
                 respond(r, Enofile);
@@ -797,47 +722,23 @@ fs_write(Ixp9Req *r) {
                 respond(r, nil);
                 return;
         case FsFBar:
- /* XXX: This should validate after each write */
                 i = strlen(f->p.bar->buf);
                 write_to_buf(r, &f->p.bar->buf, &i, 279);
                 r->ofcall.count = i - r->ifcall.offset;
                 respond(r, nil);
                 return;
         case FsFCctl:
- data_to_cstring(r);
- if((errstr = message_client(f->p.client, r->ifcall.data))) {
- respond(r, errstr);
- return;
- }
+ errstr = message(r, (MsgFunc)message_client);
                 r->ofcall.count = r->ifcall.count;
- respond(r, nil);
+ respond(r, errstr);
                 return;
         case FsFTctl:
- data_to_cstring(r);
- if((errstr = message_view(f->p.view, r->ifcall.data))) {
- respond(r, errstr);
- return;
- }
+ errstr = message(r, (MsgFunc)message_view);
                 r->ofcall.count = r->ifcall.count;
- respond(r, nil);
+ respond(r, errstr);
                 return;
         case FsFRctl:
- data_to_cstring(r);
- { uint n;
- char *p, *toks[32];
-
- errstr = nil;
- p = toutf8n(r->ifcall.data, r->ifcall.count);
- n = tokenize(toks, 32, p, '\n');
- for(i = 0; i < n; i++) {
- if(errstr)
- message_root(toks[i]);
- else
- errstr = message_root(toks[i]);
- }
- free(p);
- }
- focus_view(screen, screen->sel);
+ errstr = message(r, (MsgFunc)message_root);
                 r->ofcall.count = r->ifcall.count;
                 respond(r, errstr);
                 return;
@@ -944,12 +845,13 @@ fs_remove(Ixp9Req *r) {
 
 void
 fs_clunk(Ixp9Req *r) {
+ FidLink **fl, *ft;
+ FileId *f;
+ char *p, *q;
         Client *c;
- FidLink **fl, *ft;
- char *buf, *p, *q;
- int i;
- FileId *f = r->fid->aux;
-
+ Message m;
+
+ f = r->fid->aux;
         if(!verify_file(f)) {
                 respond(r, nil);
                 return;
@@ -969,18 +871,19 @@ fs_clunk(Ixp9Req *r) {
                 update_keys();
                 break;
         case FsFBar:
- buf = f->p.bar->buf;
- i = strlen(buf);
- buf = q = toutf8n(buf, i);
-
- parse_colors(&buf, &i, &f->p.bar->col);
- while(i > 0 && buf[i - 1] == '\n')
- buf[--i] = '\0';
-
- p = f->p.bar->text;
- utfecpy(p, p+sizeof(f->p.bar->text), buf);
-
- free(q);
+ p = toutf8(f->p.bar->buf);
+
+ m = ixp_message(p, strlen(p), 0);
+ parse_colors(&m, &f->p.bar->col);
+
+ q = m.end-1;
+ while(q >= (char*)m.pos && *q == '\n')
+ *q-- = '\0';
+
+ q = f->p.bar->text;
+ utfecpy(q, q+sizeof((Bar){}.text), m.pos);
+
+ free(p);
 
                 draw_bar(screen);
                 break;
diff -r eff4d9932d5f -r 14dd324d1b60 cmd/wmii/mouse.c
--- a/cmd/wmii/mouse.c Mon Apr 23 18:31:35 2007 -0400
+++ b/cmd/wmii/mouse.c Tue Apr 24 01:41:41 2007 -0400
@@ -287,7 +287,7 @@ horiz:
 
                                 remove_frame(f);
                                 f->area = fw->ra;
- insert_frame(fw->fp, f, False);
+ insert_frame(fw->fp, f);
 
                                 if(f->aprev) {
                                         f->aprev->r.max.y = fw->fr.min.y;
diff -r eff4d9932d5f -r 14dd324d1b60 cmd/wmii/utf.c
--- a/cmd/wmii/utf.c Mon Apr 23 18:31:35 2007 -0400
+++ b/cmd/wmii/utf.c Tue Apr 24 01:41:41 2007 -0400
@@ -351,3 +351,49 @@ toutf8(char *str) {
 toutf8(char *str) {
         return toutf8n(str, strlen(str));
 }
+
+/*
+ * space ranges
+ */
+static
+Rune __space2[] =
+{
+ 0x0009, 0x000a, /* tab and newline */
+ 0x0020, 0x0020, /* space */
+ 0x00a0, 0x00a0, /*   */
+ 0x2000, 0x200b, /*   - ​ */
+ 0x2028, 0x2029, /* 
 - 
 */
+ 0x3000, 0x3000, /*   */
+ 0xfeff, 0xfeff, /*  */
+};
+
+static Rune*
+bsearch(Rune c, Rune *t, int n, int ne)
+{
+ Rune *p;
+ int m;
+
+ while(n > 1) {
+ m = n/2;
+ p = t + m*ne;
+ if(c >= p[0]) {
+ t = p;
+ n = n-m;
+ } else
+ n = m;
+ }
+ if(n && c >= t[0])
+ return t;
+ return 0;
+}
+
+int
+isspacerune(Rune c)
+{
+ Rune *p;
+
+ p = bsearch(c, __space2, nelem(__space2)/2, 2);
+ if(p && c >= p[0] && c <= p[1])
+ return 1;
+ return 0;
+}
diff -r eff4d9932d5f -r 14dd324d1b60 cmd/wmii/view.c
--- a/cmd/wmii/view.c Mon Apr 23 18:31:35 2007 -0400
+++ b/cmd/wmii/view.c Tue Apr 24 01:41:41 2007 -0400
@@ -19,8 +19,9 @@ is_empty(View *v) {
 }
 
 Frame *
-clientframe_of_view(View *v, Client *c) {
- Frame *f;
+view_clientframe(View *v, Client *c) {
+ Frame *f;
+
         for(f=c->frame; f; f=f->cnext)
                 if(f->area->view == v)
                         break;
@@ -369,98 +370,6 @@ view_index(View *v) {
         return (uchar*)buffer;
 }
 
-Client *
-client_of_message(View *v, char *message, uint *next) {
- ulong id = 0;
- Client *c;
-
- if(!strncmp(message, "sel ", 4)) {
- *next = 4;
- return view_selclient(v);
- }
-
- sscanf(message, "0x%lx %n", &id, next);
- if(!id)
- sscanf(message, "%lu %n", &id, next);
- if(!id)
- return nil;
-
- for(c=client; c; c=c->next)
- if(c->w.w == id) break;
- return c;
-}
-
-Area *
-area_of_message(View *v, char *message, uint *next) {
- uint i;
- Area *a;
-
- if(!strncmp(message, "sel ", 4)) {
- *next = 4;
- return v->sel;
- }
- if(!strncmp(message, "~ ", 2)) {
- *next = 2;
- return v->area;
- }
-
- if(1 != sscanf(message, "%u %n", &i, next) || i == 0)
- return nil;
- for(a=v->area; a; a=a->next)
- if(i-- == 0) break;
- return a;
-}
-
-char *
-message_view(View *v, char *message) {
- int n, i;
- Client *c;
- Frame *f;
- Area *a;
- Bool swap;
- static char Ebadvalue[] = "bad value";
-
- if(!strncmp(message, "send ", 5)) {
- message += 5;
- swap = False;
- goto send;
- }
- if(!strncmp(message, "swap ", 5)) {
- message += 5;
- swap = True;
- goto send;
- }
- if(!strncmp(message, "select ", 7)) {
- message += 7;
- return select_area(v->sel, message);
- }
- if(!strncmp(message, "colmode ", 8)) {
- message += 8;
- if((a = area_of_message(v, message, &n)) == nil
- || a->floating)
- return Ebadvalue;
- if((i = str2colmode(&message[n])) == -1)
- return Ebadvalue;
-
- a->mode = i;
- arrange_column(a, True);
- restack_view(v);
-
- if(v == screen->sel)
- focus_view(screen, v);
- draw_frames();
- return nil;
- }
- return Ebadvalue;
-
-send:
- if(!(c = client_of_message(v, message, &n)))
- return Ebadvalue;
- if(!(f = clientframe_of_view(v, c)))
- return Ebadvalue;
- return send_client(f, &message[n], swap);
-}
-
 void
 update_views() {
         View *n, *v, *old;
diff -r eff4d9932d5f -r 14dd324d1b60 rc/rc.wmii.rc
--- a/rc/rc.wmii.rc Mon Apr 23 18:31:35 2007 -0400
+++ b/rc/rc.wmii.rc Tue Apr 24 01:41:41 2007 -0400
@@ -10,7 +10,7 @@ LEFT=h
 LEFT=h
 RIGHT=l
 
-WMII_FONT='fixed'
+WMII_FONT='-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*'
 WMII_NORMCOLORS=('#222222' '#5FBF77' '#2A7F3F')
 WMII_FOCUSCOLORS=('#ffffff' '#153F1F' '#2A7F3F')
 WMII_BACKGROUND='#333333'
diff -r eff4d9932d5f -r 14dd324d1b60 rc/wmiirc.sh
--- a/rc/wmiirc.sh Mon Apr 23 18:31:35 2007 -0400
+++ b/rc/wmiirc.sh Tue Apr 24 01:41:41 2007 -0400
@@ -13,7 +13,7 @@ WMII_FOCUSCOLORS='#ffffff #153F1F #2A7F3
 WMII_FOCUSCOLORS='#ffffff #153F1F #2A7F3F'
 
 WMII_BACKGROUND='#333333'
-WMII_FONT='-*-fixed-medium-r-normal-*-13-*-*-*-*-*-*-*'
+WMII_FONT='-*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*'
 
 set -- $(echo $WMII_NORMCOLORS $WMII_FOCUSCOLORS)
 WMII_MENU="dmenu -b -fn $WMII_FONT -nf $1 -nb $2 -sf $4 -sb $5"
Received on Fri Jun 01 2007 - 03:10:20 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:06 UTC