home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / Utilities / Fiend-1.4.1-src / FiendWraps.psw < prev    next >
Encoding:
Text File  |  1997-05-29  |  3.7 KB  |  191 lines

  1. defineps PSWMoveWindowsInTandem(float dx, dy; int win, n, others[n])
  2.     win currentwindowbounds pop pop /oldy exch def /oldx exch def
  3.     dx oldx add dy oldy add win /moveWindow winexec
  4.     n 0 gt {
  5.         others    {
  6.             dup    currentwindowbounds pop pop
  7.             dy add exch dx add exch
  8.             3 -1 roll /moveWindow winexec
  9.         } forall
  10.     } if
  11. endps
  12.  
  13. defineps PSWMarkStatus(float y, w, h; boolean inColor, autoLaunch, autoScan, isSticky)
  14.     inColor {
  15.         0 1 0 setrgbcolor
  16.     }    {
  17.         0.10 setgray
  18.     } ifelse
  19.  
  20.     autoLaunch    {
  21.         autoScan    {
  22.             0.2 w mul 0.9 h mul
  23.             0.6 w mul 0.05 h mul rectfill
  24.         }    {
  25.             0.2 w mul 0.9 h mul
  26.             0.2 w mul 0.05 h mul rectfill
  27.  
  28.             0.6 w mul 0.9 h mul
  29.             0.2 w mul 0.05 h mul rectfill
  30.         } ifelse
  31.     }    {
  32.         autoScan    {
  33.             0.4 w mul 0.9 h mul
  34.             0.2 w mul 0.05 h mul rectfill
  35.         } if
  36.     } ifelse
  37.  
  38.     isSticky    {
  39.         w 0.85 mul 1 add round y 2 add round moveto
  40.         w 2 sub h 0.15 mul 1 sub round lineto
  41.         w 2 sub y 2 add lineto
  42.         closepath fill
  43.     } if
  44.  
  45.     0 setgray
  46.     autoLaunch    {
  47.         autoScan    {
  48.             0.2 w mul 0.9 h mul
  49.             0.6 w mul 0.05 h mul rectstroke
  50.         }    {
  51.             0.2 w mul 0.9 h mul
  52.             0.2 w mul 0.05 h mul rectstroke
  53.  
  54.             0.6 w mul 0.9 h mul
  55.             0.2 w mul 0.05 h mul rectstroke
  56.         } ifelse
  57.     }    {
  58.         autoScan    {
  59.             0.4 w mul 0.9 h mul
  60.             0.2 w mul 0.05 h mul rectstroke
  61.         } if
  62.     } ifelse
  63.  
  64.     isSticky    {
  65.         w 0.85 mul round y 1 add moveto
  66.         w 1 sub h 0.15 mul round lineto
  67.         w 1 sub y 1 add lineto
  68.         closepath stroke
  69.     } if
  70. endps
  71.  
  72. defineps PSWMove(float x, y; int win)
  73.     x y win /moveWindow winexec
  74. endps
  75.  
  76. defineps PSWUnhideContext(int ctxt; boolean raise, makeActive, hideOthers)
  77.     13 0 0 0 0 0 
  78.     raise { 7 } { 10 } ifelse 0 0
  79.     ctxt true /postByContext winexec
  80.     makeActive ctxt currentactiveapp ne and { ctxt /activateContext winexec } if
  81.     hideOthers { ctxt /hideOtherApps winexec } if
  82. endps
  83.  
  84. defineps PSWReplaceIcon(int win, width)
  85.     /pos /calcIconPosition winexec 64 mul def
  86.     pos width mod
  87.     pos width div floor 64 mul
  88.     win /moveWindow winexec
  89. endps
  90.         
  91. defineps PSWCopyWindow(float x, y, w, h; int win)
  92.     currentdict /temp known not {
  93.         gstate /temp exch def
  94.         gstate /orig exch def
  95.     } if
  96.  
  97.     orig currentgstate pop
  98.     win windowdevice temp currentgstate pop
  99.     orig setgstate
  100.     x y w h temp 0 0 Copy composite
  101. endps
  102.  
  103. defineps PSWGetCurrentOwner(int win | int *owner)
  104.     win currentowner owner
  105. endps
  106.  
  107. defineps PSWGetCtxtIconAndPid(int ctxt | int *icon, *pid)
  108.     appLock    {
  109.         ctxt 0 /currentContextData winexec pid
  110.         ctxt 1 /currentContextData winexec
  111.         dup null eq { pop -1 } {} ifelse icon
  112.     } monitor
  113. endps
  114.  
  115. defineps PSWSetDockOnTop(int yes)
  116.     clear
  117.     0 countscreenlist array
  118.     0 screenlist /list exch def
  119.  
  120.     list    {
  121.         dup dup
  122.         currentwindowbounds
  123.         0 ge
  124.         exch 0 ge and    {
  125.             pop pop
  126.             dup currentwindowlevel dup
  127.             5 eq exch -1 eq or    {
  128.                 yes 0 ne    {
  129.                     5 exch setwindowlevel
  130.                 }    {
  131.                     -1 exch setwindowlevel
  132.                 } ifelse
  133.             }    {
  134.                 pop
  135.             } ifelse
  136.         }    {
  137.             pop pop pop
  138.         } ifelse
  139.     } forall
  140. endps
  141.  
  142. defineps PSWWhirl(float xctr, yctr)
  143.     clear
  144.     /minilist {
  145.         list {
  146.             dup currentwindowbounds
  147.             64 eq
  148.             exch 64 eq and    {
  149.                 pop pop dup
  150.                 currentwindowlevel dup dup dup
  151.                 0 eq exch 5 eq or exch -1 eq or exch 6 eq or {} {pop} ifelse
  152.             }  {
  153.                 pop pop pop
  154.             } ifelse
  155.         } forall
  156.         count array astore
  157.     } def
  158.  
  159.     minilist {
  160.         currentwindowbounds
  161.         pop pop
  162.     } forall
  163.     count array astore
  164.     /positions exch def
  165.  
  166.     /done 0 def
  167.     /i 90 def
  168.     0 1 250 {
  169.         pop
  170.         buttondown { exit } if
  171.         minilist {
  172.             /win exch def
  173.             /x 1.5 i 70 add mul cos i i mul 100 div cos mul 250 mul xctr add def
  174.             /y 2 i mul cos 300 mul yctr add def
  175.             x y win /moveWindow winexec
  176.             i /i exch 2 add def
  177.             buttondown { /done 1 def exit } if
  178.         } forall
  179.         done 1 eq { exit } if
  180.     } for
  181.  
  182.     /i 0 def
  183.     minilist {
  184.         /win exch def
  185.         positions i 2 getinterval aload pop
  186.         win /moveWindow winexec
  187.         i /i exch 2 add def
  188.         10000 {} repeat
  189.     } forall
  190. endps    
  191.