Remember rotations across pages. [rsc] --rw-rw-r-- M 222375 glenda sys 2152 Jan 4 07:22 sys/src/cmd/page/page.h /n/sourcesdump/2006/0104/plan9/sys/src/cmd/page/page.h:42,47 - /n/sourcesdump/2006/0105/plan9/sys/src/cmd/page/page.h:42,48 void rot180(Image*); Image *rot90(Image*); + Image *rot270(Image*); Image *resample(Image*, Image*); /* ghostscript interface shared by ps, pdf */ [rsc] --rw-rw-r-- M 222375 glenda sys 10435 Jan 4 07:22 sys/src/cmd/page/rotate.c /n/sourcesdump/2006/0104/plan9/sys/src/cmd/page/rotate.c:245,250 - /n/sourcesdump/2006/0105/plan9/sys/src/cmd/page/rotate.c:245,275 return(tmp); } + /* rotates an image 270 degrees clockwise */ + Image * + rot270(Image *im) + { + Image *tmp; + int i, j, dx, dy; + + dx = Dx(im->r); + dy = Dy(im->r); + tmp = xallocimage(display, Rect(0, 0, dy, dx), im->chan, 0, DCyan); + if(tmp == nil) { + fprint(2, "out of memory during rot270: %r\n"); + wexits("memory"); + } + + for(i = 0; i < dy; i++) { + for(j = 0; j < dx; j++) { + drawop(tmp, Rect(i, j, i+1, j+1), im, nil, Pt(dx-(j+1), i), S); + } + } + freeimage(im); + + return(tmp); + } + /* from resample.c -- resize from → to using interpolation */ [rsc] --rw-rw-r-- M 222375 glenda sys 22893 Jan 4 07:22 sys/src/cmd/page/view.c /n/sourcesdump/2006/0104/plan9/sys/src/cmd/page/view.c:16,22 - /n/sourcesdump/2006/0105/plan9/sys/src/cmd/page/view.c:16,22 Document *doc; Image *im; int page; - int upside = 0; + int angle = 0; int showbottom = 0; /* on the next showpage, move the image so the bottom is visible. */ Rectangle ulrange; /* the upper left corner of the image must be in this rectangle */ /n/sourcesdump/2006/0104/plan9/sys/src/cmd/page/view.c:156,163 - /n/sourcesdump/2006/0105/plan9/sys/src/cmd/page/view.c:156,172 im = tmp; } - if(upside) + switch(angle){ + case 90: + im = rot90(im); + break; + case 180: rot180(im); + break; + case 270: + im = rot270(im); + break; + } esetcursor(nil); if(showbottom){ /n/sourcesdump/2006/0104/plan9/sys/src/cmd/page/view.c:390,396 - /n/sourcesdump/2006/0105/plan9/sys/src/cmd/page/view.c:399,405 esetcursor(&reading); rot180(im); esetcursor(nil); - upside = !upside; + angle = (angle+180) % 360; redraw(screen); flushimage(display, 1); break; /n/sourcesdump/2006/0104/plan9/sys/src/cmd/page/view.c:589,594 - /n/sourcesdump/2006/0105/plan9/sys/src/cmd/page/view.c:598,604 esetcursor(&reading); im = rot90(im); esetcursor(nil); + angle = (angle+90) % 360; redraw(screen); flushimage(display, 1); break; /n/sourcesdump/2006/0104/plan9/sys/src/cmd/page/view.c:598,604 - /n/sourcesdump/2006/0105/plan9/sys/src/cmd/page/view.c:608,614 esetcursor(&reading); rot180(im); esetcursor(nil); - upside = !upside; + angle = (angle+180) % 360; redraw(screen); flushimage(display, 1); break; Man page and usage updates. [rsc] --rw-rw-r-- M 222375 glenda sys 735 Jan 4 07:37 sys/man/1/freq /n/sourcesdump/2006/0104/plan9/sys/man/1/freq:4,10 - /n/sourcesdump/2006/0105/plan9/sys/man/1/freq:4,10 .SH SYNOPSIS .B freq [ - .B -dxocr + .B -cdorx ] [ .I file ... [rsc] --rw-rw-r-- M 222375 glenda sys 2257 Jan 4 07:37 sys/man/1/grep /n/sourcesdump/2006/0104/plan9/sys/man/1/grep:4,12 - /n/sourcesdump/2006/0105/plan9/sys/man/1/grep:4,18 .SH SYNOPSIS .B grep [ - .I option ... + .B -bchiLlnsv ] + [ + .B -e .I pattern + [ + .B -f + .I patternfile + ] [ .I file ... ] [rsc] --rw-rw-r-- M 222375 presotto sys 4361 Jan 4 07:37 sys/man/1/gview /n/sourcesdump/2006/0104/plan9/sys/man/1/gview:4,17 - /n/sourcesdump/2006/0105/plan9/sys/man/1/gview:4,14 .SH SYNOPSIS .B gview [ - .B -l - .I logfile + .B -mp ] [ - .B -m - ] - [ - .B -p + .B -l + .I logfile ] [ .I files [rsc] --rw-rw-r-- M 222375 glenda sys 2357 Jan 4 07:37 sys/man/1/hoc /n/sourcesdump/2006/0104/plan9/sys/man/1/hoc:4,14 - /n/sourcesdump/2006/0105/plan9/sys/man/1/hoc:4,14 .SH SYNOPSIS .B hoc [ - .I file ... - ] - [ .B -e .I expression + ] + [ + .I file ... ] .SH DESCRIPTION .I Hoc [rsc] --rw-rw-r-- M 222375 glenda sys 6098 Jan 4 07:37 sys/src/cmd/history.c /n/sourcesdump/2006/0104/plan9/sys/src/cmd/history.c:12,17 - /n/sourcesdump/2006/0105/plan9/sys/src/cmd/history.c:12,18 int diffb; char* sflag; + void usage(void); void ysearch(char*, char*); long starttime(char*); void lastbefore(ulong, char*, char*, char*); /n/sourcesdump/2006/0104/plan9/sys/src/cmd/history.c:26,32 - /n/sourcesdump/2006/0105/plan9/sys/src/cmd/history.c:27,33 ndump = nil; ARGBEGIN { default: - goto usage; + usage(); case 'v': verb = 1; break; /n/sourcesdump/2006/0104/plan9/sys/src/cmd/history.c:50,64 - /n/sourcesdump/2006/0105/plan9/sys/src/cmd/history.c:51,69 break; } ARGEND - if(argc == 0) { - usage: - fprint(2, "usage: history [-bDfuv] [-d 9fsname] [-s yyyymmdd] files\n"); - exits(0); - } + if(argc == 0) + usage(); for(i=0; immio + Pramin + 0x1E00 * 4); break; default: - p = (void*)((uchar*)scr->vaddr + scr->storage - 96*1024); + /* + * Reset the cursor location, since the kernel may + * have allocated less storage than aux/vga + * expected. + */ + tmp = scr->storage - 96*1024; + p = (void*)((uchar*)scr->vaddr + tmp); + vgaxo(Crtx, 0x30, 0x80|(tmp>>17)); + vgaxo(Crtx, 0x31, (tmp>>11)<<2); + vgaxo(Crtx, 0x2F, tmp>>24); break; }