home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Utilities / ctxt-util-1.0 / ABWraps.psw < prev    next >
Encoding:
Text File  |  1998-04-01  |  1.8 KB  |  84 lines

  1. /**********************************************************************
  2.   ABWraps.psw
  3.  
  4.   Copyright (c) 1998, David C. Lambert.  All Rights Reserved.
  5. **********************************************************************/
  6.  
  7. defineps PSWMove(float x, y; int win)
  8.     x y win /moveWindow winexec
  9. endps
  10.  
  11. defineps PSWUnhideContext(int ctxt; boolean raise, makeActive, hideOthers)
  12.     13 0 0 0 0 0 
  13.     raise { 7 } { 10 } ifelse 0 0
  14.     ctxt true /postByContext winexec
  15.     makeActive ctxt currentactiveapp ne and { ctxt /activateContext winexec } if
  16.     hideOthers { ctxt /hideOtherApps winexec } if
  17. endps
  18.  
  19. defineps PSWReplaceIcon(int win, width)
  20.     /pos /calcIconPosition winexec 64 mul def
  21.     pos width mod
  22.     pos width div floor 64 mul
  23.     win /moveWindow winexec
  24. endps
  25.         
  26. defineps PSWGetCurrentOwner(int win | int *owner)
  27.     win currentowner owner
  28. endps
  29.  
  30. defineps PSWGetMiniWindows(int ctxt, count | int *miniCount, windows[count])
  31.     ctxt countscreenlist array
  32.     ctxt screenlist /list exch def
  33.     /cnt 0 def
  34.     list {
  35.         dup
  36.         currentwindowbounds 64 eq exch 64 eq and    {
  37.             2 {pop} repeat windows
  38.             cnt /cnt exch 1 add def
  39.         } {
  40.             3 {pop} repeat
  41.         } ifelse
  42.     } forall
  43.     cnt miniCount
  44. endps
  45.  
  46. defineps PSWGetIconFromScreenList(int ctxt | int *icon)
  47.     ctxt countscreenlist array
  48.     ctxt screenlist /list exch def
  49.     mark
  50.     list {
  51.         dup
  52.         currentwindowbounds 64 eq exch 64 eq and    {
  53.             2 {pop} repeat icon
  54.         } {
  55.             3 {pop} repeat
  56.         } ifelse
  57.     } forall
  58.     cleartomark
  59. endps
  60.  
  61. defineps PSWGetCtxtIconPidAndMenu(int ctxt | int *icon, *pid, *menu)
  62.     /i 100000 def
  63.     ctxt 0 /currentContextData winexec pid
  64.     ctxt 1 /currentContextData winexec
  65.     dup null eq { pop -1 } {} ifelse icon
  66.     ctxt countwindowlist array
  67.     ctxt windowlist /list exch def
  68.     list {
  69.         dup
  70.         currentwindowlevel mainMenuLevel ne    {
  71.             pop
  72.         } {
  73.             dup
  74.             i lt {
  75.                 /i exch def
  76.             } {
  77.                 pop
  78.             } ifelse
  79.         } ifelse
  80.     } forall
  81.     i menu
  82. endps
  83.  
  84.