%! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @(#)handymenu.ps % % HandyMenu pie menu Class % Copyright (C) 1989. % By Don Hopkins. % All rights reserved. % % This program is provided for UNRESTRICTED use provided that this % copyright message is preserved on all copies and derivative works. % This is provided without any warranty. No author or distributor % accepts any responsibility whatsoever to any person or any entity % with respect to any loss or damage caused or alleged to be caused % directly or indirectly by this program. This includes, but is not % limited to, any interruption of service, loss of business, loss of % information, loss of anticipated profits, core dumps, abuses of the % virtual memory system, or any consequential or incidental damages % resulting from the use of this program. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /newfont 50 dict def newfont begin /FontType 3 def /FontMatrix [1 0 0 1 0 0] def /FontBBox [-2 -2 2 2] def /BuildChar { 10 dict begin /mask? 1 index 128 ge def /char exch 127 and 128 div 360 mul def /font exch def /x char cos 2 mul def /y char sin 2 mul def newpath 0 0 x y 1 mask? not pointer-path % x y % XXX core dumps NeWS % convert to fixed % x 2048 mul cvi -11 bitshift y 2048 mul cvi -11 bitshift 0 0 pathbbox setcachedevice 0 setgray .001 setlinewidth mask? { fill } { stroke } ifelse end } def end % newfont /Pointer newfont definefont pop systemdict begin /point-cursor { % ang => - { dup 360 ge { 360 sub } { dup 0 lt { 360 add } { exit } ifelse } ifelse } loop 360 div 128 mul floor 0 max 127 min /Pointer findfont 32 scalefont exch dup 128 add setcanvascursor } def /PointPieMenu SimplePieMenu dictbegin dictend classbegin /SetMenuValue { /SetMenuValue super send MenuValue null eq { /beye /beye_m MenuCanvas setstandardcursor } { gsave MenuCanvas setcanvas MenuItems MenuValue get /ang get point-cursor grestore } ifelse } def classend def /PieMenu PointPieMenu store PointPieMenu setdefaultmenu end % systemdict framebuffer setcanvas erasepage /Pointer findfont 32 scalefont setfont % Load up the cache! clippath pathbbox /H exch def /W exch def pop pop W 2 div H 2 div moveto % make string with 0..255 in random order [ 0 1 255 { counttomark random mul floor 1 add -1 roll } for ] cvas /s exch def s { (x) dup 0 3 index put show currentpoint dup 0 lt exch H ge or exch dup 0 lt exch W ge or or { W 2 div H 2 div moveto } if pause } forall %2 { 0 360 127 div 360 { point-cursor .01 60 div sleep } for } repeat