diff options
author | Dan Cross <cross@gajendra.net> | 2020-01-10 14:44:21 +0000 |
---|---|---|
committer | Dan Cross <cross@gajendra.net> | 2020-01-10 14:54:30 +0000 |
commit | fa325e9b42b0bdfb48857d1958d9fb7ceac55151 (patch) | |
tree | 81d26256d152435135bcb1ae43121979a49f5f2b /src/cmd/devdraw | |
parent | 77a0a5b5194d4441c86de097f2aae297cb75e2c2 (diff) | |
download | plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.gz plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.tar.bz2 plan9port-fa325e9b42b0bdfb48857d1958d9fb7ceac55151.zip |
Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.
Signed-off-by: Dan Cross <cross@gajendra.net>
Diffstat (limited to 'src/cmd/devdraw')
-rw-r--r-- | src/cmd/devdraw/bigarrow.h | 124 | ||||
-rw-r--r-- | src/cmd/devdraw/cocoa-srv.c | 24 | ||||
-rw-r--r-- | src/cmd/devdraw/devdraw.c | 16 | ||||
-rw-r--r-- | src/cmd/devdraw/drawclient.c | 9 | ||||
-rw-r--r-- | src/cmd/devdraw/latin1.c | 2 | ||||
-rw-r--r-- | src/cmd/devdraw/mklatinkbd.c | 6 | ||||
-rw-r--r-- | src/cmd/devdraw/mouseswap.c | 2 | ||||
-rw-r--r-- | src/cmd/devdraw/nowsys.c | 4 | ||||
-rw-r--r-- | src/cmd/devdraw/osx-draw.c | 1 | ||||
-rw-r--r-- | src/cmd/devdraw/snarf.c | 3 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-alloc.c | 1 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-cload.c | 1 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-draw.c | 1 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-fill.c | 4 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-get.c | 7 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-init.c | 14 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-itrans.c | 18 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-keysym2ucs.c | 2 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-load.c | 1 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-pixelbits.c | 2 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-srv.c | 35 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-unload.c | 1 | ||||
-rw-r--r-- | src/cmd/devdraw/x11-wsys.c | 1 |
23 files changed, 129 insertions, 150 deletions
diff --git a/src/cmd/devdraw/bigarrow.h b/src/cmd/devdraw/bigarrow.h index 1221ec8c..4bfe0245 100644 --- a/src/cmd/devdraw/bigarrow.h +++ b/src/cmd/devdraw/bigarrow.h @@ -14,70 +14,70 @@ Cursor bigarrow = { Cursor2 bigarrow2 = { { -2, -2 }, - { 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, - 0xC0, 0x00, 0x00, 0x03, - 0xC0, 0x00, 0x00, 0x07, - 0xC0, 0x00, 0x00, 0x1E, - 0xC0, 0x00, 0x00, 0x3C, - 0xC0, 0x00, 0x00, 0xF0, - 0xC0, 0x00, 0x03, 0xE0, - 0xC0, 0x00, 0x0F, 0x80, - 0xC0, 0x00, 0x0E, 0x00, - 0xC0, 0x00, 0x07, 0x00, - 0xC0, 0x00, 0x03, 0x80, - 0xC0, 0x00, 0x01, 0xC0, - 0xC0, 0x00, 0x00, 0xE0, - 0xC0, 0x00, 0x00, 0x70, - 0xC0, 0x00, 0x00, 0x38, - 0xC0, 0x00, 0x00, 0x1C, - 0xC0, 0x00, 0x00, 0x0E, - 0xC0, 0x00, 0x00, 0x07, - 0xC0, 0x00, 0x00, 0x03, - 0xC0, 0xC0, 0x00, 0x07, - 0xC0, 0xE0, 0x00, 0x0E, - 0xC1, 0xF0, 0x00, 0x1C, - 0xC1, 0xB8, 0x00, 0x38, - 0xC3, 0x9C, 0x00, 0x70, - 0xC3, 0x0E, 0x00, 0xE0, - 0xC7, 0x07, 0x01, 0xC0, - 0xCE, 0x03, 0x83, 0x80, - 0xCC, 0x01, 0xC7, 0x00, - 0xDC, 0x00, 0xEE, 0x00, - 0xF8, 0x00, 0x7C, 0x00, + { 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, + 0xC0, 0x00, 0x00, 0x03, + 0xC0, 0x00, 0x00, 0x07, + 0xC0, 0x00, 0x00, 0x1E, + 0xC0, 0x00, 0x00, 0x3C, + 0xC0, 0x00, 0x00, 0xF0, + 0xC0, 0x00, 0x03, 0xE0, + 0xC0, 0x00, 0x0F, 0x80, + 0xC0, 0x00, 0x0E, 0x00, + 0xC0, 0x00, 0x07, 0x00, + 0xC0, 0x00, 0x03, 0x80, + 0xC0, 0x00, 0x01, 0xC0, + 0xC0, 0x00, 0x00, 0xE0, + 0xC0, 0x00, 0x00, 0x70, + 0xC0, 0x00, 0x00, 0x38, + 0xC0, 0x00, 0x00, 0x1C, + 0xC0, 0x00, 0x00, 0x0E, + 0xC0, 0x00, 0x00, 0x07, + 0xC0, 0x00, 0x00, 0x03, + 0xC0, 0xC0, 0x00, 0x07, + 0xC0, 0xE0, 0x00, 0x0E, + 0xC1, 0xF0, 0x00, 0x1C, + 0xC1, 0xB8, 0x00, 0x38, + 0xC3, 0x9C, 0x00, 0x70, + 0xC3, 0x0E, 0x00, 0xE0, + 0xC7, 0x07, 0x01, 0xC0, + 0xCE, 0x03, 0x83, 0x80, + 0xCC, 0x01, 0xC7, 0x00, + 0xDC, 0x00, 0xEE, 0x00, + 0xF8, 0x00, 0x7C, 0x00, 0xF0, 0x00, 0x38, 0x00, }, - { 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x3F, 0xFF, 0xFF, 0xFC, - 0x3F, 0xFF, 0xFF, 0xF8, - 0x3F, 0xFF, 0xFF, 0xE0, - 0x3F, 0xFF, 0xFF, 0xC0, - 0x3F, 0xFF, 0xFF, 0x00, - 0x3F, 0xFF, 0xFC, 0x00, - 0x3F, 0xFF, 0xF0, 0x00, - 0x3F, 0xFF, 0xF0, 0x00, - 0x3F, 0xFF, 0xF8, 0x00, - 0x3F, 0xFF, 0xFC, 0x00, - 0x3F, 0xFF, 0xFE, 0x00, - 0x3F, 0xFF, 0xFF, 0x00, - 0x3F, 0xFF, 0xFF, 0x80, - 0x3F, 0xFF, 0xFF, 0xC0, - 0x3F, 0xFF, 0xFF, 0xE0, - 0x3F, 0xFF, 0xFF, 0xF0, - 0x3F, 0xFF, 0xFF, 0xF8, - 0x3F, 0xFF, 0xFF, 0xFC, - 0x3F, 0x3F, 0xFF, 0xF8, - 0x3F, 0x1F, 0xFF, 0xF0, - 0x3E, 0x0F, 0xFF, 0xE0, - 0x3E, 0x07, 0xFF, 0xC0, - 0x3C, 0x03, 0xFF, 0x80, - 0x3C, 0x01, 0xFF, 0x00, - 0x38, 0x00, 0xFE, 0x00, - 0x30, 0x00, 0x7C, 0x00, - 0x30, 0x00, 0x38, 0x00, - 0x20, 0x00, 0x10, 0x00, - 0x00, 0x00, 0x00, 0x00, + { 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x3F, 0xFF, 0xFF, 0xFC, + 0x3F, 0xFF, 0xFF, 0xF8, + 0x3F, 0xFF, 0xFF, 0xE0, + 0x3F, 0xFF, 0xFF, 0xC0, + 0x3F, 0xFF, 0xFF, 0x00, + 0x3F, 0xFF, 0xFC, 0x00, + 0x3F, 0xFF, 0xF0, 0x00, + 0x3F, 0xFF, 0xF0, 0x00, + 0x3F, 0xFF, 0xF8, 0x00, + 0x3F, 0xFF, 0xFC, 0x00, + 0x3F, 0xFF, 0xFE, 0x00, + 0x3F, 0xFF, 0xFF, 0x00, + 0x3F, 0xFF, 0xFF, 0x80, + 0x3F, 0xFF, 0xFF, 0xC0, + 0x3F, 0xFF, 0xFF, 0xE0, + 0x3F, 0xFF, 0xFF, 0xF0, + 0x3F, 0xFF, 0xFF, 0xF8, + 0x3F, 0xFF, 0xFF, 0xFC, + 0x3F, 0x3F, 0xFF, 0xF8, + 0x3F, 0x1F, 0xFF, 0xF0, + 0x3E, 0x0F, 0xFF, 0xE0, + 0x3E, 0x07, 0xFF, 0xC0, + 0x3C, 0x03, 0xFF, 0x80, + 0x3C, 0x01, 0xFF, 0x00, + 0x38, 0x00, 0xFE, 0x00, + 0x30, 0x00, 0x7C, 0x00, + 0x30, 0x00, 0x38, 0x00, + 0x20, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, } }; diff --git a/src/cmd/devdraw/cocoa-srv.c b/src/cmd/devdraw/cocoa-srv.c index c1cf5983..dcb1801a 100644 --- a/src/cmd/devdraw/cocoa-srv.c +++ b/src/cmd/devdraw/cocoa-srv.c @@ -77,7 +77,7 @@ servep9p(void) Wsysmsg m; fmtinstall('W', drawfcallfmt); - + mbuf = nil; nmbuf = 0; while((n = read(3, buf, 4)) == 4){ @@ -106,15 +106,15 @@ void replyerror(Wsysmsg *m) { char err[256]; - + rerrstr(err, sizeof err); m->type = Rerror; m->error = err; replymsg(m); } -/* - * Handle a single wsysmsg. +/* + * Handle a single wsysmsg. * Might queue for later (kbd, mouse read) */ void @@ -123,7 +123,7 @@ runmsg(Wsysmsg *m) static uchar buf[65536]; int n; Memimage *i; - + switch(m->type){ case Tinit: memimageinit(); @@ -176,7 +176,7 @@ runmsg(Wsysmsg *m) setcursor(&m->cursor, &m->cursor2); replymsg(m); break; - + case Tbouncemouse: // _xbouncemouse(&m->mouse); replymsg(m); @@ -222,12 +222,12 @@ runmsg(Wsysmsg *m) replymsg(m); zunlock(); break; - + case Ttop: topwin(); replymsg(m); break; - + case Tresize: resizewindow(m->rect); replymsg(m); @@ -249,7 +249,7 @@ replymsg(Wsysmsg *m) /* T -> R msg */ if(m->type%2 == 0) m->type++; - + if(trace) fprint(2, "%ud [%d] -> %W\n", nsec()/1000000, threadid(), m); /* copy to output buffer */ n = sizeW2M(m); @@ -275,7 +275,7 @@ void matchkbd(void) { Wsysmsg m; - + if(kbd.stall) return; while(kbd.ri != kbd.wi && kbdtags.ri != kbdtags.wi){ @@ -297,7 +297,7 @@ void matchmouse(void) { Wsysmsg m; - + while(mouse.ri != mouse.wi && mousetags.ri != mousetags.wi){ m.type = Rrdmouse; m.tag = mousetags.t[mousetags.ri++]; @@ -321,7 +321,7 @@ void mousetrack(int x, int y, int b, uint ms) { Mouse *m; - + if(x < mouserect.min.x) x = mouserect.min.x; if(x > mouserect.max.x) diff --git a/src/cmd/devdraw/devdraw.c b/src/cmd/devdraw/devdraw.c index 7f0bff21..654ab4af 100644 --- a/src/cmd/devdraw/devdraw.c +++ b/src/cmd/devdraw/devdraw.c @@ -160,11 +160,11 @@ _drawreplacescreenimage(Memimage *m) /* * Replace the screen image because the screen * was resized. - * + * * In theory there should only be one reference * to the current screen image, and that's through * client0's image 0, installed a few lines above. - * Once the client drops the image, the underlying backing + * Once the client drops the image, the underlying backing * store freed properly. The client is being notified * about the resize through external means, so all we * need to do is this assignment. @@ -769,7 +769,7 @@ _drawmsgwrite(void *v, int n) { char cbuf[40], *err, ibuf[12*12+1], *s; int c, ci, doflush, dstid, e0, e1, esize, j, m; - int ni, nw, oesize, oldn, op, ox, oy, repl, scrnid, y; + int ni, nw, oesize, oldn, op, ox, oy, repl, scrnid, y; uchar *a, refresh, *u; u32int chan, value; Client *client; @@ -969,7 +969,7 @@ _drawmsgwrite(void *v, int n) err = "negative ellipse thickness"; goto error; } - + drawpoint(&sp, a+29); c = j; if(*a == 'E') @@ -1073,11 +1073,11 @@ _drawmsgwrite(void *v, int n) ni = sprint(ibuf, "%11d %11d %11s %11d %11d %11d %11d %11d" " %11d %11d %11d %11d ", client->clientid, - client->infoid, + client->infoid, chantostr(cbuf, i->chan), (i->flags&Frepl)==Frepl, i->r.min.x, i->r.min.y, i->r.max.x, i->r.max.y, - i->clipr.min.x, i->clipr.min.y, + i->clipr.min.x, i->clipr.min.y, i->clipr.max.x, i->clipr.max.y); free(client->readdata); client->readdata = malloc(ni); @@ -1087,7 +1087,7 @@ _drawmsgwrite(void *v, int n) client->nreaddata = ni; client->infoid = -1; continue; - + /* query: 'Q' n[1] queryspec[n] */ case 'q': if(n < 2) @@ -1633,5 +1633,3 @@ error: qunlock(&sdraw.lk); return -1; } - - diff --git a/src/cmd/devdraw/drawclient.c b/src/cmd/devdraw/drawclient.c index 87df3f18..f6139289 100644 --- a/src/cmd/devdraw/drawclient.c +++ b/src/cmd/devdraw/drawclient.c @@ -20,7 +20,7 @@ void startsrv(void) { int pid, p[2]; - + if(pipe(p) < 0) sysfatal("pipe"); if((pid=fork()) < 0) @@ -56,7 +56,7 @@ void cmdinit(int argc, char **argv) { Wsysmsg m; - + memset(&m, 0, sizeof m); m.op = Tinit; m.winsize = "100x100"; @@ -70,7 +70,7 @@ void cmdmouse(int argc, char **argv) { Wsysmsg m; - + memset(&m, 0, sizeof m); m.op = Trdmouse; if(domsg(&m) < 0) @@ -86,7 +86,7 @@ void cmdkbd(int argc, char **argv) { Wsysmsg m; - + memset(&m, 0, sizeof m); m.op = Trdkbd; if(domsg(&m) < 0) @@ -125,4 +125,3 @@ fprint(2, "%s...\n", p); } exits(0); } - diff --git a/src/cmd/devdraw/latin1.c b/src/cmd/devdraw/latin1.c index 09c67523..2fa9e29d 100644 --- a/src/cmd/devdraw/latin1.c +++ b/src/cmd/devdraw/latin1.c @@ -58,7 +58,7 @@ _latin1(Rune *k, int n) else return -5; } - + for(l=latintab; l->ld!=0; l++) if(k[0] == l->ld[0]){ if(n == 1) diff --git a/src/cmd/devdraw/mklatinkbd.c b/src/cmd/devdraw/mklatinkbd.c index abd202fb..db34b6ec 100644 --- a/src/cmd/devdraw/mklatinkbd.c +++ b/src/cmd/devdraw/mklatinkbd.c @@ -132,7 +132,7 @@ printtrie(Biobuf *b, Trie *t) printtrie(b, t->link[i]); if(t->n == 0) return; - + if(xflag) { for(i=0; i<256; i++) { if(t->r[i] == 0) @@ -142,7 +142,7 @@ printtrie(Biobuf *b, Trie *t) Bprint(b, " %k", *p); Bprint(b, " %k : \"%C\" U%04X\n", i, t->r[i], t->r[i]); } - return; + return; } Bprint(b, "\t\""); @@ -315,5 +315,3 @@ kfmt(Fmt *f) return fmtprint(f, "<%s>", xkey[i].s); return fmtprint(f, "<%c>", c); } - - diff --git a/src/cmd/devdraw/mouseswap.c b/src/cmd/devdraw/mouseswap.c index e6ece333..29f33b7b 100644 --- a/src/cmd/devdraw/mouseswap.c +++ b/src/cmd/devdraw/mouseswap.c @@ -51,7 +51,7 @@ mouseswap(int but) if(!map.init) initmap(); - + nbut = 0; for(i=0; i<Nbutton; i++) if((but&(1<<i)) && map.b[i] >= 0) diff --git a/src/cmd/devdraw/nowsys.c b/src/cmd/devdraw/nowsys.c index fd8b7ee1..08e0521f 100644 --- a/src/cmd/devdraw/nowsys.c +++ b/src/cmd/devdraw/nowsys.c @@ -18,14 +18,14 @@ main(int argc, char **argv) int n; uchar buf[1024*1024]; Wsysmsg m; - + ARGBEGIN{ case 'D': break; default: usage(); }ARGEND - + if(argc != 0) usage(); diff --git a/src/cmd/devdraw/osx-draw.c b/src/cmd/devdraw/osx-draw.c index d3f08331..fdf7acec 100644 --- a/src/cmd/devdraw/osx-draw.c +++ b/src/cmd/devdraw/osx-draw.c @@ -56,4 +56,3 @@ unloadmemimage(Memimage *i, Rectangle r, uchar *data, int ndata) { return _unloadmemimage(i, r, data, ndata); } - diff --git a/src/cmd/devdraw/snarf.c b/src/cmd/devdraw/snarf.c index 1e7a93a1..4d350654 100644 --- a/src/cmd/devdraw/snarf.c +++ b/src/cmd/devdraw/snarf.c @@ -96,7 +96,7 @@ runxevent(XEvent *xev) case Expose: _xexpose(xev); break; - + case DestroyNotify: if(_xdestroy(xev)) exits(0); @@ -107,4 +107,3 @@ runxevent(XEvent *xev) break; } } - diff --git a/src/cmd/devdraw/x11-alloc.c b/src/cmd/devdraw/x11-alloc.c index a465f998..9d85b451 100644 --- a/src/cmd/devdraw/x11-alloc.c +++ b/src/cmd/devdraw/x11-alloc.c @@ -121,4 +121,3 @@ freememimage(Memimage *m) } _freememimage(m); } - diff --git a/src/cmd/devdraw/x11-cload.c b/src/cmd/devdraw/x11-cload.c index 33e3170a..1666eced 100644 --- a/src/cmd/devdraw/x11-cload.c +++ b/src/cmd/devdraw/x11-cload.c @@ -15,4 +15,3 @@ cloadmemimage(Memimage *i, Rectangle r, uchar *data, int ndata) _xputxdata(i, r); return n; } - diff --git a/src/cmd/devdraw/x11-draw.c b/src/cmd/devdraw/x11-draw.c index 685ad88a..f3b6a689 100644 --- a/src/cmd/devdraw/x11-draw.c +++ b/src/cmd/devdraw/x11-draw.c @@ -147,4 +147,3 @@ xdraw(Memdrawparam *par) */ return 0; } - diff --git a/src/cmd/devdraw/x11-fill.c b/src/cmd/devdraw/x11-fill.c index fc43a684..adead1ea 100644 --- a/src/cmd/devdraw/x11-fill.c +++ b/src/cmd/devdraw/x11-fill.c @@ -23,7 +23,7 @@ _xfillcolor(Memimage *m, Rectangle r, u32int v) Point p; Xmem *xm; XGC gc; - + xm = m->X; assert(xm != nil); @@ -52,5 +52,3 @@ _xfillcolor(Memimage *m, Rectangle r, u32int v) p = subpt(r.min, m->r.min); XFillRectangle(_x.display, xm->pixmap, gc, p.x, p.y, Dx(r), Dy(r)); } - - diff --git a/src/cmd/devdraw/x11-get.c b/src/cmd/devdraw/x11-get.c index 1a47be01..61913f18 100644 --- a/src/cmd/devdraw/x11-get.c +++ b/src/cmd/devdraw/x11-get.c @@ -21,7 +21,7 @@ _xgetxdata(Memimage *m, Rectangle r) uchar *p; Point tp, xdelta, delta; Xmem *xm; - + xm = m->X; if(xm == nil) return nil; @@ -83,7 +83,7 @@ _xputxdata(Memimage *m, Rectangle r) XPutImage(_x.display, xm->pixmap, gc, xi, xdelta.x, xdelta.y, delta.x, delta.y, Dx(r), Dy(r)); - + if(_x.usetable && m->chan==CMAP8){ for(y=r.min.y; y<r.max.y; y++) for(x=r.min.x, p=byteaddr(m, Pt(x,y)); x<r.max.x; x++, p++) @@ -103,6 +103,3 @@ _xdirtyxdata(Memimage *m, Rectangle r) xm->dirty = 1; addrect(&xm->dirtyr, r); } - - - diff --git a/src/cmd/devdraw/x11-init.c b/src/cmd/devdraw/x11-init.c index f09963dc..8935c9d1 100644 --- a/src/cmd/devdraw/x11-init.c +++ b/src/cmd/devdraw/x11-init.c @@ -95,7 +95,7 @@ _xattach(char *label, char *winsize) xrootid = DefaultScreen(_x.display); xrootwin = DefaultRootWindow(_x.display); - /* + /* * Figure out underlying screen format. */ if(XMatchVisualInfo(_x.display, xrootid, 24, TrueColor, &xvi) @@ -207,7 +207,7 @@ _xattach(char *label, char *winsize) /* * Parse the various X resources. Thanks to Peter Canning. */ - char *screen_resources, *display_resources, *geom, + char *screen_resources, *display_resources, *geom, *geomrestype, *home, *file, *dpitype; XrmDatabase database; XrmValue geomres, dpires; @@ -548,7 +548,7 @@ plan9cmap(void) * be the default depth. On such "suboptimal" systems, we have to allocate an * empty color map anyway, according to Axel Belinfante. */ -static int +static int setupcmap(XWindow w) { char buf[30]; @@ -561,16 +561,16 @@ setupcmap(XWindow w) if(_x.depth >= 24) { if(_x.usetable == 0) - _x.cmap = XCreateColormap(_x.display, w, _x.vis, AllocNone); + _x.cmap = XCreateColormap(_x.display, w, _x.vis, AllocNone); /* * The pixel value returned from XGetPixel needs to * be converted to RGB so we can call rgb2cmap() * to translate between 24 bit X and our color. Unfortunately, - * the return value appears to be display server endian + * the return value appears to be display server endian * dependant. Therefore, we run some heuristics to later * determine how to mask the int value correctly. - * Yeah, I know we can look at _x.vis->byte_order but + * Yeah, I know we can look at _x.vis->byte_order but * some displays say MSB even though they run on LSB. * Besides, this is more anal. */ @@ -611,7 +611,7 @@ setupcmap(XWindow w) _x.cmap = XCreateColormap(_x.display, w, _x.vis, AllocNone); }else if(_x.vis->class == PseudoColor){ if(_x.usetable == 0){ - _x.cmap = XCreateColormap(_x.display, w, _x.vis, AllocAll); + _x.cmap = XCreateColormap(_x.display, w, _x.vis, AllocAll); XStoreColors(_x.display, _x.cmap, _x.map, 256); for(i = 0; i < 256; i++){ _x.tox11[i] = i; diff --git a/src/cmd/devdraw/x11-itrans.c b/src/cmd/devdraw/x11-itrans.c index 729f2647..bdf7d2b2 100644 --- a/src/cmd/devdraw/x11-itrans.c +++ b/src/cmd/devdraw/x11-itrans.c @@ -97,7 +97,7 @@ __xtoplan9kbd(XEvent *e) case XK_KP_End: k = Kend; break; - case XK_Page_Up: + case XK_Page_Up: case XK_KP_Page_Up: k = Kpgup; break; @@ -243,7 +243,7 @@ _xtoplan9mouse(XEvent *e, Mouse *m) case ButtonPress: be = (XButtonEvent*)e; - /* + /* * Fake message, just sent to make us announce snarf. * Apparently state and button are 16 and 8 bits on * the wire, since they are truncated by the time they @@ -443,7 +443,7 @@ _xgetsnarffrom(XWindow w, Atom clipboard, Atom target, int timeout0, int timeout /* get the property */ xdata = nil; - XGetWindowProperty(_x.display, _x.drawable, prop, 0, SnarfSize/sizeof(ulong), 0, + XGetWindowProperty(_x.display, _x.drawable, prop, 0, SnarfSize/sizeof(ulong), 0, AnyPropertyType, &type, &fmt, &len, &dummy, &xdata); if((type != target && type != XA_STRING && type != _x.utf8string) || len == 0){ if(xdata) @@ -500,7 +500,7 @@ _xgetsnarf(void) data = nil; goto out; } - + if((data = _xgetsnarffrom(w, clipboard, _x.utf8string, 10, 100)) == nil) if((data = _xgetsnarffrom(w, clipboard, XA_STRING, 10, 100)) == nil){ /* nothing left to do */ @@ -554,9 +554,9 @@ if(0) fprint(2, "xselect target=%d requestor=%d property=%d selection=%d (sizeof a[3] = _x.compoundtext; XChangeProperty(_x.display, xe->requestor, xe->property, XA_ATOM, 32, PropModeReplace, (uchar*)a, nelem(a)); - }else if(xe->target == XA_STRING - || xe->target == _x.utf8string - || xe->target == _x.text + }else if(xe->target == XA_STRING + || xe->target == _x.utf8string + || xe->target == _x.text || xe->target == _x.compoundtext || ((name = XGetAtomName(_x.display, xe->target)) && strcmp(name, "text/plain;charset=UTF-8") == 0)){ /* text/plain;charset=UTF-8 seems nonstandard but is used by Synergy */ @@ -643,7 +643,7 @@ _applegetsnarf(void) CFRelease(flavors); } qunlock(&clip.lk); - return nil; + return nil; } void @@ -677,7 +677,7 @@ _appleputsnarf(char *s) qunlock(&clip.lk); return; } - cfdata = CFDataCreate(kCFAllocatorDefault, + cfdata = CFDataCreate(kCFAllocatorDefault, (uchar*)clip.rbuf, runestrlen(clip.rbuf)*2); if(cfdata == nil){ fprint(2, "apple pasteboard cfdatacreate failed\n"); diff --git a/src/cmd/devdraw/x11-keysym2ucs.c b/src/cmd/devdraw/x11-keysym2ucs.c index 108f153c..853fa552 100644 --- a/src/cmd/devdraw/x11-keysym2ucs.c +++ b/src/cmd/devdraw/x11-keysym2ucs.c @@ -34,7 +34,7 @@ */ #ifndef KEYSYM2UCS_INCLUDED - + #include "x11-keysym2ucs.h" #define VISIBLE /* */ diff --git a/src/cmd/devdraw/x11-load.c b/src/cmd/devdraw/x11-load.c index a7446f37..895e1109 100644 --- a/src/cmd/devdraw/x11-load.c +++ b/src/cmd/devdraw/x11-load.c @@ -15,4 +15,3 @@ loadmemimage(Memimage *i, Rectangle r, uchar *data, int ndata) _xputxdata(i, r); return n; } - diff --git a/src/cmd/devdraw/x11-pixelbits.c b/src/cmd/devdraw/x11-pixelbits.c index 5cbdded8..5227f39b 100644 --- a/src/cmd/devdraw/x11-pixelbits.c +++ b/src/cmd/devdraw/x11-pixelbits.c @@ -12,5 +12,3 @@ pixelbits(Memimage *m, Point p) _xgetxdata(m, Rect(p.x, p.y, p.x+1, p.y+1)); return _pixelbits(m, p); } - - diff --git a/src/cmd/devdraw/x11-srv.c b/src/cmd/devdraw/x11-srv.c index 81416482..4d72415b 100644 --- a/src/cmd/devdraw/x11-srv.c +++ b/src/cmd/devdraw/x11-srv.c @@ -147,12 +147,12 @@ main(int argc, char **argv) /* * Ignore arguments. They're only for good ps -a listings. */ - + notify(bell); fdin.rp = fdin.wp = fdin.buf; fdin.ep = fdin.buf+sizeof fdin.buf; - + fdout.rp = fdout.wp = fdout.buf; fdout.ep = fdout.buf+sizeof fdout.buf; @@ -222,7 +222,7 @@ main(int argc, char **argv) runmsg(&m); fdin.rp += n; } - + /* slide data to beginning of buf */ fdslide(&fdin); } @@ -277,7 +277,7 @@ void replyerror(Wsysmsg *m) { char err[256]; - + rerrstr(err, sizeof err); m->type = Rerror; m->error = err; @@ -286,8 +286,8 @@ replyerror(Wsysmsg *m) -/* - * Handle a single wsysmsg. +/* + * Handle a single wsysmsg. * Might queue for later (kbd, mouse read) */ void @@ -296,7 +296,7 @@ runmsg(Wsysmsg *m) uchar buf[65536]; int n; Memimage *i; - + switch(m->type){ case Tinit: memimageinit(); @@ -339,7 +339,7 @@ runmsg(Wsysmsg *m) _xsetcursor(&m->cursor); replymsg(m); break; - + case Tbouncemouse: _xbouncemouse(&m->mouse); replymsg(m); @@ -381,12 +381,12 @@ runmsg(Wsysmsg *m) else replymsg(m); break; - + case Ttop: _xtopwindow(); replymsg(m); break; - + case Tresize: _xresizewindow(m->rect); replymsg(m); @@ -405,7 +405,7 @@ replymsg(Wsysmsg *m) /* T -> R msg */ if(m->type%2 == 0) m->type++; - + /* fprint(2, "-> %W\n", m); */ /* copy to output buffer */ n = sizeW2M(m); @@ -422,7 +422,7 @@ void matchkbd(void) { Wsysmsg m; - + if(kbd.stall) return; while(kbd.ri != kbd.wi && kbdtags.ri != kbdtags.wi){ @@ -444,7 +444,7 @@ void matchmouse(void) { Wsysmsg m; - + while(mouse.ri != mouse.wi && mousetags.ri != mousetags.wi){ m.type = Rrdmouse; m.tag = mousetags.t[mousetags.ri++]; @@ -519,7 +519,7 @@ runxevent(XEvent *xev) case Expose: _xexpose(xev); break; - + case DestroyNotify: if(_xdestroy(xev)) exits(0); @@ -552,7 +552,7 @@ runxevent(XEvent *xev) return; sendmouse(m); break; - + case KeyRelease: case KeyPress: ke = (XKeyEvent*)xev; @@ -618,7 +618,7 @@ runxevent(XEvent *xev) kbd.stall = 1; matchkbd(); break; - + case FocusOut: /* * Some key combinations (e.g. Alt-Tab) can cause us @@ -629,10 +629,9 @@ runxevent(XEvent *xev) altdown = 0; abortcompose(); break; - + case SelectionRequest: _xselect(xev); break; } } - diff --git a/src/cmd/devdraw/x11-unload.c b/src/cmd/devdraw/x11-unload.c index d01a232f..2f6241ba 100644 --- a/src/cmd/devdraw/x11-unload.c +++ b/src/cmd/devdraw/x11-unload.c @@ -12,4 +12,3 @@ unloadmemimage(Memimage *i, Rectangle r, uchar *data, int ndata) _xgetxdata(i, r); return _unloadmemimage(i, r, data, ndata); } - diff --git a/src/cmd/devdraw/x11-wsys.c b/src/cmd/devdraw/x11-wsys.c index 9095c950..82a7d32c 100644 --- a/src/cmd/devdraw/x11-wsys.c +++ b/src/cmd/devdraw/x11-wsys.c @@ -43,4 +43,3 @@ _xmovewindow(Rectangle r) XConfigureWindow(_x.display, _x.drawable, value_mask, &e); XFlush(_x.display); } - |