%! % % Date: Thu, 14 Jul 88 14:27:05 EDT % To: NeWS-makers@brillig.umd.edu % Subject: Yin/Yang root image---with a twist % From: spe@spice.cs.cmu.edu (Sean Engelson) % This program changes the root image to a Yin/Yang symbol on a purplish % background. It also, if you want, will set the symbol to spin % around its centre. Quite pretty. % Created by Sean P. Engelson % Spinning thought of by John Kolojejchick % Date: Tue, 16 Aug 88 00:23:38 EDT % To: NeWS-makers@brillig.umd.edu % Subject: YinYang bug... % From: gregm@Sun.COM (Greg McLaughlin) % % There is a small bug in the YinYang root spin routine sent out a % while back. Once awaitevent returns it needed to pop the % unused event. If run long enough the NeWS stack would overflow. % % Here is the patched version: % % Greg McLaughlin % Sun Microsystems Inc. % systemdict begin % Draw a yin/yang (just some arcs and fills) /yinyang { % angle x y => __ translate 40 40 scale 10 10 translate rotate -10 -10 translate 1 setgray newpath 10 10 10 0 180 arcn 5 10 5 180 0 arc 15 10 5 180 0 arcn fill 0 setgray newpath 10 10 10 0 180 arc % big arc black side 5 10 5 180 0 arc % black bulge 15 10 5 180 0 arcn % white bulge fill gsave 4 10 moveto newpath 5 10 1 0 360 arc 1 setgray fill grestore newpath 10 10 10 0 360 arc stroke newpath 14 10 moveto newpath 15 10 1 0 360 arc 0 setgray fill } def % angle to draw it at /YinYangAng 0 def % Draw it on the root /RootYinYang { gsave framebuffer setcanvas 0 0 1200 1200 rectpath .5 .5 1 setrgbcolor fill YinYangAng 160 60 yinyang grestore } def /PaintRoot /RootYinYang load store PaintRoot end % Set the yin/yang to spin by queuing events. /TimeYinYang { % - => process /YinYangProc { /d 2 dict dup begin /RotateYinYang { /YinYangAng YinYangAng 5 add store % change the 5 to adjust % the speed gsave framebuffer setcanvas YinYangAng 160 60 yinyang grestore SendNewYinYangEvent } def end def /e1 createevent def e1 /Name d put e1 expressinterest /SendNewYinYangEvent { e1 createevent copy dup begin /Name /RotateYinYang def /TimeStamp currenttime .05 add def end sendevent } def SendNewYinYangEvent { awaitevent pop} loop } fork systemdict begin def end } def % If you don't want it to spin, comment this next line: TimeYinYang