%! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @(#)neatwin.ps % % NeatWindow Class pie menu based window manager % Copyright (C) 1988. % 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. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% systemdict begin systemdict /PieMenu known not { (NeWS/piemenu.ps) LoadFile pop } if /NeatWindow LiteWindow [] classbegin /stretchtopright { FrameX FrameY BBoxFromUser reshape non-iconic } def /stretchtopleft { FrameX FrameWidth add FrameY BBoxFromUser reshape non-iconic } def /stretchbottomright { FrameX FrameY FrameHeight add BBoxFromUser reshape non-iconic } def /stretchbottomleft { FrameX FrameWidth add FrameY FrameHeight add BBoxFromUser reshape non-iconic } def /stretchtop { /GA_value FrameX def /GA_constraint 0 def FrameX FrameWidth add FrameY BBoxFromUser reshape non-iconic } def /stretchbottom { /GA_value FrameX def /GA_constraint 0 def FrameX FrameWidth add FrameY FrameHeight add BBoxFromUser reshape non-iconic } def /stretchleft { /GA_value FrameY def /GA_constraint 1 def FrameX FrameWidth add FrameY FrameHeight add BBoxFromUser reshape non-iconic } def /stretchright { /GA_value FrameY def /GA_constraint 1 def FrameX FrameY FrameHeight add BBoxFromUser reshape non-iconic } def /movevertical { /GA_constraint 0 def slide } def /movehorizontal { /GA_constraint 1 def slide } def /flipmove { gsave framebuffer setcanvas /unmap self send /Iconic? Iconic? not def CurrentEvent begin XLocation YLocation end Iconic? { exch IconWidth 2 div sub exch IconHeight 2 div sub } { exch FrameWidth 2 div sub exch FrameHeight 2 div sub } ifelse move map slide grestore } def /non-iconic { Iconic? { flipiconic } if } def /reshapefromuser-open { reshapefromuser non-iconic } def /CreateFrameMenu { % - => - (Create frame menu) % Note: Store menu in class to share menus, especially if retained. /FrameMenu ClassFrameMenu def } def /CreateIconMenu { % - => - (Create icon menu) % Note: Store menu in class to share menus, especially if retained. /IconMenu ClassIconMenu def } def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The menus shared by all instances of the class: /FrameZapMenu [ /nuke {/destroy ThisWindow send} (No!) {} (No!) {} (No!) {} ] /new DefaultMenu send def FrameZapMenu /MenuFont /Times-BoldItalic findfont 24 scalefont put /FrameMoveMenu [ /move_v {/movevertical ThisWindow send} /move {/slide ThisWindow send} /eye3 {/flipmove ThisWindow send} /move_h {/movehorizontal ThisWindow send} ] /new DefaultMenu send def /IconMoveMenu [ /move_v {/movevertical ThisWindow send} /move {/slide ThisWindow send} /eye {/flipmove ThisWindow send} /move_h {/movehorizontal ThisWindow send} ] /new DefaultMenu send def /FrameStretchMenu [ /stretch_h {/stretchtop ThisWindow send} /stretchNE {/stretchtopright ThisWindow send} [/stretch_v 4 0] {/stretchright ThisWindow send} /stretchSE {/stretchbottomright ThisWindow send} /stretch_h {/stretchbottom ThisWindow send} /stretchSW {/stretchbottomleft ThisWindow send} [/stretch_v 4 0] {/stretchleft ThisWindow send} /stretchNW {/stretchtopleft ThisWindow send} ] /new DefaultMenu send def /ClassFrameMenu [ [(\255) /Symbol findfont 18 scalefont] {/totop ThisWindow send} /painting_hand {/paint ThisWindow send} (Move\274) FrameMoveMenu (Zap?) FrameZapMenu [(\257) /Symbol findfont 18 scalefont] {/tobottom ThisWindow send} (Reshape!) {/reshapefromuser-open ThisWindow send} (Stretch\274) FrameStretchMenu /eye3 {/flipiconic ThisWindow send} ] /new DefaultMenu send def ClassFrameMenu /MenuFont /Times-Roman findfont 18 scalefont put /ClassIconMenu [ [(\255) /Symbol findfont 18 scalefont] {/totop ThisWindow send} /painting_hand {/paint ThisWindow send} (Move\274) IconMoveMenu (Zap?) FrameZapMenu [(\257) /Symbol findfont 18 scalefont] {/tobottom ThisWindow send} (Reshape!) {/reshapefromuser-open ThisWindow send} (Stretch\274) FrameStretchMenu /eye {/flipiconic ThisWindow send} ] /new DefaultMenu send def ClassIconMenu /MenuFont /Times-Roman findfont 18 scalefont put classend def /DefaultWindow NeatWindow def end % systemdict