Path: utzoo!attcan!utgpu!utstat!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcvax!ukc!icdoc!ist!jh From: jh@ist.CO.UK (Jeremy Huxtable) Newsgroups: comp.windows.news Subject: Fun window Zapper Message-ID: <1685@istop.ist.CO.UK> Date: 7 Jun 89 12:53:50 GMT Organization: Imperial Software Technology, London, UK Lines: 50 %! /usr/NeWS/bin/psh % Interesting NeWS window zapper (NeWS1.1) % % Jeremy Huxtable % % Mon May 22 08:53:57 BST 1989 % A more interesting way of zapping your windows. If you 'psh' this file, % then all windows which you zap from then on will be pushed off the screen % by a small person rather than just boringly disappearing. % Technical note: % The little person is drawn directly onto the framebuffer rather than using % a canvas. The area under it is then marked as damaged using 'extenddamage' % and is redrawn automatically. Canvases? Who needs canvases anyway? { /ThingWidth 16 def /ThingHeight 20 def /MoveDelta 15 def /Things [/man1 /man2 /man3 /man4 /man5] def /destroy { gsave framebuffer setcanvas 0 setgray clippath pathbbox pop 3 1 roll pop pop % fb_width FrameX sub MoveDelta div 1 sub 1 1 3 -1 roll { Iconic? { IconX ThingWidth sub 1 sub IconY moveto Things IconX MoveDelta div cvi Things length mod get showicon IconX MoveDelta add IconY move IconX MoveDelta sub ThingWidth sub 1 sub IconY } { FrameX ThingWidth sub 1 sub FrameY moveto Things FrameX MoveDelta div cvi Things length mod get showicon FrameX MoveDelta add FrameY move FrameX MoveDelta sub ThingWidth sub 1 sub FrameY } ifelse ThingWidth ThingHeight rectpath extenddamage pause } for grestore DestroyFrame DestroyClient } def } DefaultWindow send