[comp.windows.news] Gratuitous icon zoom procedure

don@BRILLIG.UMD.EDU (Don Hopkins) (06/02/87)

Date: Tue, 2 Jun 87 13:32:55 EDT
From: Don Hopkins <don@brillig.umd.edu>

Put this in a file called "pacman.ps", and load it into your NeWS
server with "psh pacman.ps". This is completely hedonistic, with no
socialy redeeming value whatsoever, so I'm certianly not responsible
for any time you waste watching your icons open and close!

	-Don

%!
%
% Silly pacman icon zoom.
% Don Hopkins, June 2, 1987
%	

{
    /ZoomPaint { % x y w h => - (Draw the zoom shape.)
      gsave
        erasepage
        4 2 roll translate
	scale
	.5 .5 translate
        i 4 and 0 eq {
          0 0 moveto
          0 0 .5 ZoomDir 20 add ZoomDir 330 add arc
        } {
          0 0 .5 0 360 arc
        } ifelse
        closepath
        stroke
      grestore
    } store

    /ZoomProc { % - => - (Perform the zoom animation.)
    gsave
      10 dict begin
        ZoomPaintInit
        FrameY FrameWidth 2 div add
        IconY IconWidth 2 div add sub
        FrameX FrameWidth 2 div add
        IconX IconWidth 2 div add sub
        atan
	Iconic? {180 add} if
        /ZoomDir exch def
        [IconX IconY IconWidth IconHeight]
        [FrameX FrameY FrameWidth FrameHeight]
        Iconic? {exch} if
        ZoomSteps {
            aload pop ZoomPaint pause
        } Zoom
        erasepage
      end
    grestore
    } store

    /ZoomSteps 40 store
} DefaultWindow send