diff options
author | rsc <devnull@localhost> | 2004-04-29 17:13:24 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-04-29 17:13:24 +0000 |
commit | be36ff68854c86247fdc769c0eaa89eb284b5ca7 (patch) | |
tree | a523e17071eb0e3088f906446b158b3d184b77fe /src/cmd/draw | |
parent | 3d72637f9b4c42b1fc9b7d95d278ea3dd65c748d (diff) | |
download | plan9port-be36ff68854c86247fdc769c0eaa89eb284b5ca7.tar.gz plan9port-be36ff68854c86247fdc769c0eaa89eb284b5ca7.tar.bz2 plan9port-be36ff68854c86247fdc769c0eaa89eb284b5ca7.zip |
add -W to specify window size.
various other little fixes.
Diffstat (limited to 'src/cmd/draw')
-rw-r--r-- | src/cmd/draw/gview.c | 5 | ||||
-rw-r--r-- | src/cmd/draw/img.c | 7 | ||||
-rw-r--r-- | src/cmd/draw/stats.c | 5 | ||||
-rw-r--r-- | src/cmd/draw/tweak.c | 16 |
4 files changed, 29 insertions, 4 deletions
diff --git a/src/cmd/draw/gview.c b/src/cmd/draw/gview.c index 82491558..5e80ee2a 100644 --- a/src/cmd/draw/gview.c +++ b/src/cmd/draw/gview.c @@ -1956,7 +1956,7 @@ void usage(void) int i; fprintf(stderr,"Usage %s [options] [infile]\n", argv0); fprintf(stderr, -"option ::= -l logfile | -m\n" +"option ::= -W winsize | -l logfile | -m\n" "\n" "Read a polygonal line graph in an ASCII format (one x y pair per line, delimited\n" "by spaces with a label after each polyline), and view it interactively. Use\n" @@ -1981,6 +1981,9 @@ void main(int argc, char *argv[]) break; case 'l': logfil = fopen(ARGF(),"w"); break; + case 'W': + winsize = EARGF(usage()); + break; default: usage(); } ARGEND diff --git a/src/cmd/draw/img.c b/src/cmd/draw/img.c index 354e5885..01caa3c4 100644 --- a/src/cmd/draw/img.c +++ b/src/cmd/draw/img.c @@ -6,7 +6,7 @@ void usage(void) { - fprint(2, "usage: img [file]\n"); + fprint(2, "usage: img [-W winsize] [file]\n"); exits("usage"); } @@ -29,6 +29,9 @@ main(int argc, char **argv) Event e; ARGBEGIN{ + case 'W': + winsize = EARGF(usage()); + break; default: usage(); }ARGEND @@ -48,6 +51,8 @@ main(int argc, char **argv) if((image=readimage(display, fd, 0)) == nil) sysfatal("readimage: %r"); + drawresizewindow(Rect(0,0,Dx(image->r),Dy(image->r))); + einit(Emouse|Ekeyboard); eresized(0); for(;;){ diff --git a/src/cmd/draw/stats.c b/src/cmd/draw/stats.c index f49f541c..8a43fb09 100644 --- a/src/cmd/draw/stats.c +++ b/src/cmd/draw/stats.c @@ -332,7 +332,7 @@ update1(Graph *g, long v, ulong vmax) void usage(void) { - fprint(2, "usage: stats [-O] [-S scale] [-LY] [-%s] [machine...]\n", argchars); + fprint(2, "usage: stats [-O] [-S scale] [-LY] [-W winsize] [-%s] [machine...]\n", argchars); exits("usage"); } @@ -710,6 +710,9 @@ threadmain(int argc, char *argv[]) case 'O': oldsystem = 1; break; + case 'W': + winsize = EARGF(usage()); + break; default: if(nargs>=sizeof args || strchr(argchars, ARGC())==nil) usage(); diff --git a/src/cmd/draw/tweak.c b/src/cmd/draw/tweak.c index c7e12878..82a22ee1 100644 --- a/src/cmd/draw/tweak.c +++ b/src/cmd/draw/tweak.c @@ -172,12 +172,26 @@ void drawall(void); void tclose1(Thing*); void +usage(void) +{ + fprint(2, "usage: tweak [-W winsize] file...\n"); + exits("usage"); +} + +void main(int argc, char *argv[]) { int i; Event e; Thing *t; + ARGBEGIN{ + case 'W': + winsize = EARGF(usage()); + break; + default: + usage(); + }ARGEND mag = Mag; if(initdraw(error, 0, "tweak") < 0){ fprint(2, "tweak: initdraw failed: %r\n"); @@ -191,7 +205,7 @@ main(int argc, char *argv[]) } einit(Emouse|Ekeyboard); eresized(0); - i = 1; + i = 0; setjmp(err); for(; i<argc; i++){ file = argv[i]; |