home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.0 (User) / OS_user_4.0.iso / NextLibrary / Frameworks / AppKit.framework / Versions / B / Resources / windowPackage.ps < prev   
Encoding:
Text File  |  1996-05-04  |  34.9 KB  |  1,962 lines

  1. currentshared true setshared
  2. nextdict begin
  3. /_NXDebug false def
  4. /packageSize 140 def
  5. /WindowDictSize 14 def
  6. /windowPackage1.0 //packageSize dict def
  7. /windowPackage windowPackage1.0 def
  8. /Winredraw 0 def
  9. /AppAct 1 def
  10. /AppDeact 2 def
  11. /Winresized 3 def
  12. /Winmoved 4 def
  13. /AppUnhide 7 def
  14. /AppActDeferred 9 def
  15. /AppHide 10 def
  16. /Windragged 0 def
  17. /Cursorrect 17 def
  18. /Cursorrectmask 1 Cursorrect bitshift def
  19. /Journalevent 18 def
  20. /Journaleventmask 1 Journalevent bitshift def
  21. /Journalflag 31 def
  22. /Journalflagmask 1 Journalflag bitshift def
  23. /keyMask //Keydownmask //Keyupmask or def
  24. /MouseEvent //Lmousedownmask //Lmouseupmask or
  25. //Lmousedraggedmask or
  26. //Rmousedownmask or
  27. //Rmouseupmask or
  28. //Rmousedraggedmask or
  29. //Mousemovedmask or def
  30. /MenuEvent //Rmousedownmask //Rmouseupmask or
  31. //Rmousedraggedmask or def
  32. /defaultClientMask //Lmousedownmask //Lmouseupmask or
  33. //Keydownmask or
  34. //Keyupmask or
  35. //Kitdefinedmask or
  36. //Sysdefinedmask or
  37. //Appdefinedmask or def
  38. /Helpmask 1 22 bitshift def
  39. /buckyBitMask //Commandmask //Shiftmask or
  40. //Controlmask or //Helpmask or
  41. //Alternatemask or def
  42. /contextArraySize 3 def
  43. /CDPid 0 def
  44. /CDToken 1 def
  45. /CDKitVersion 2 def
  46. /mainMenuLevel 20 def
  47. /subMenuLevel 10 def
  48. /dockLevel 5 def
  49. /normalLevel 0 def
  50. /wbutSize 15 def
  51. /_NXCurrentEventFlags 0 def
  52. /_NXCheckAndDef {
  53. 2 index 2 index known
  54. {
  55. pop pop pop
  56. } {
  57. put
  58. } ifelse
  59. } bind executeonly def
  60. /winexec {
  61. windowPackage1.0 exch get exec
  62. } bind executeonly def
  63. /pkget {
  64. windowPackage1.0 exch get
  65. } bind executeonly def
  66. /pkput {
  67. windowPackage1.0 3 1 roll put
  68. } bind executeonly def
  69. /sharedIcons {
  70. nextdict /_NXSharedGray known {_NXSharedGray} {workspaceWindow} ifelse
  71. } executeonly def
  72. /sharedCursors {
  73. nextdict /_NXSharedGrayAlpha known {_NXSharedGrayAlpha} {workspaceWindow} ifelse
  74. } executeonly def
  75. _NXDebug {
  76. /_NXStartProc {
  77. userdict /_NXCallStack known not {
  78. userdict /_NXCallStack 100 array put
  79. userdict /_NXCallStackTop 0 put
  80. } if
  81. _NXCallStack exch _NXCallStackTop exch put
  82. /_NXCallStackTop _NXCallStackTop 1 add store
  83. } def
  84. /_NXEndProc {
  85. _NXCallStackTop 0 gt {
  86. /_NXCallStackTop _NXCallStackTop 1 sub store
  87. } if
  88. } def
  89. /_NXDefProc {
  90. dup length 3 add array cvx
  91. dup 2
  92. 4 -1 roll
  93. putinterval
  94. dup 0 3 index put
  95. dup 1 /_NXStartProc cvx put
  96. dup dup length 1 sub /_NXEndProc cvx put
  97. bind def
  98. } bind executeonly def
  99. /_NXSimpleDefProc {
  100. dup length 3 add array cvx
  101. dup 2
  102. 4 -1 roll
  103. putinterval
  104. dup 0 3 index put
  105. dup 1 /_NXStartProc cvx put
  106. dup dup length 1 sub /_NXEndProc cvx put
  107. def
  108. } bind executeonly def
  109. }{
  110. /_NXDefProc {
  111. bind executeonly def
  112. } bind executeonly def
  113. /_NXSimpleDefProc {
  114. executeonly def
  115. } bind executeonly def
  116. } ifelse
  117. end
  118. nextdict /activeApp 0 _NXCheckAndDef
  119. nextdict /appLock lock _NXCheckAndDef
  120. nextdict /curActivation 0 _NXCheckAndDef
  121. nextdict /debugging false _NXCheckAndDef
  122. nextdict /_journalRecording false _NXCheckAndDef
  123. nextdict /_jrnMDownEvtNum 0 _NXCheckAndDef
  124. windowPackage1.0 /contextDataLock lock _NXCheckAndDef
  125. nextdict /_NXSnapIconsToGrid false _NXCheckAndDef
  126. windowPackage1.0 /lastCompletedActivation 0 _NXCheckAndDef
  127. windowPackage1.0 begin
  128. /version 4 def
  129. /stackSwap {
  130. 1 add exch 1 index 2 add
  131. 1 roll
  132. -1 roll
  133. } bind executeonly def
  134. /revForall {
  135. exch aload length
  136. dup 2 add -1 roll
  137. repeat
  138. } bind executeonly def
  139. end
  140. setshared
  141. currentshared true setshared
  142. windowPackage1.0 begin
  143. /_hideMenus {
  144. true exch /getWindows winexec {
  145. mark exch
  146. dup currentwindowdict
  147. dup null ne {
  148. /hideOnDeact get {
  149. {
  150. Out exch 0 exch orderwindow
  151. } stopped
  152. } if
  153. } if
  154. cleartomark
  155. } forall
  156. /returnWindows winexec
  157. } _NXDefProc
  158. /_showMenus {
  159. false exch /getWindows winexec {
  160. mark exch
  161. dup currentwindowdict
  162. dup null ne {
  163. dup /hideOnDeact get exch
  164. /kitVisible get and {
  165. {
  166. dup currentwindowlevel 0 ne
  167. 4 index 0 eq or {
  168. Above exch 0 exch orderwindow
  169. }{
  170. Below exch
  171. 4 index exch
  172. orderwindow
  173. } ifelse
  174. } stopped
  175. } if
  176. } if
  177. cleartomark
  178. } forall
  179. /returnWindows winexec pop
  180. } _NXDefProc
  181. /_lockedDoDeactivate {
  182. activeApp 0 eq not {
  183. activeApp //_hideMenus exec
  184. //Kitdefined 0 0 0 0 0 //AppDeact curActivation 0
  185. activeApp false /postByContext winexec
  186. nextdict /activeApp 0 put
  187. 0 setactiveapp
  188. } if
  189. } _NXDefProc
  190. /_lockedDoActivate {
  191. 2 copy exch //_showMenus exec
  192. dup 0 ne {
  193. currentwindowdict dup null ne {
  194. /localNum get
  195. }{
  196. pop 0
  197. } ifelse
  198. } if
  199. 1 index setactiveapp
  200. //Kitdefined 0 0
  201. 6 -1 roll 0 0
  202. //AppAct
  203. curActivation 1 add
  204. dup nextdict /curActivation 3 -1 roll put
  205. dup /lastCompletedActivation exch pkput
  206. 9 -1 roll
  207. 9 index false /postByContext winexec
  208. nextdict /activeApp
  209. 3 -1 roll
  210. put
  211. } _NXDefProc
  212. /doShellActivate {
  213. appLock {
  214. 0 3 1 roll /_lockedDoActivate winexec
  215. } monitor
  216. } _NXDefProc
  217. /doShellDeactivate {
  218. appLock {
  219. /_lockedDoDeactivate winexec
  220. dup setactiveapp
  221. nextdict /activeApp 3 -1 roll put
  222. } monitor
  223. } _NXDefProc
  224. /activateByWindow {
  225. appLock {
  226. {
  227. //_lockedDoDeactivate exec
  228. 0 exch dup currentowner exch
  229. //_lockedDoActivate exec
  230. } stopped
  231. {handleerror} if
  232. } monitor
  233. } _NXDefProc
  234. /_lockedActivateContext {
  235. dup activeApp ne {
  236. {
  237. //_lockedDoDeactivate exec
  238. 0 //_lockedDoActivate exec
  239. } stopped
  240. {handleerror} if
  241. }{
  242. pop pop
  243. } ifelse
  244. } _NXDefProc
  245. /activateContext {
  246. appLock {
  247. 0 exch //_lockedActivateContext exec
  248. } monitor
  249. } _NXDefProc
  250. /pseudoActivateWindow {
  251. mark
  252. appLock {
  253. 2 index 0 eq
  254. 3 index /lastCompletedActivation pkget gt or {
  255. {
  256. 1 index currentowner dup activeApp ne {
  257. {
  258. //_lockedDoDeactivate exec
  259. dup 3 index exch
  260. //_showMenus exec
  261. dup setactiveapp
  262. nextdict /activeApp
  263. 3 -1 roll put
  264. /lastCompletedActivation
  265. 3 index pkput
  266. true
  267. } stopped {
  268. handleerror stop
  269. } if
  270. }{
  271. true
  272. } ifelse
  273. } stopped {
  274. false
  275. } if
  276. }{
  277. false
  278. } ifelse
  279. {
  280. cleartomark pop pop
  281. }{
  282. cleartomark
  283. //Kitdefined 0 0 0 0 0 //AppDeact
  284. 9 -1 roll 0
  285. 10 -1 roll currentowner false
  286. /postByContext winexec
  287. } ifelse
  288. } monitor
  289. } _NXDefProc
  290. /sendDeferredAct {
  291. appLock {
  292. //Kitdefined 0 0 0 0 0
  293. //AppActDeferred
  294. curActivation 1 add
  295. nextdict /curActivation 2 index put 0
  296. 10 -1 roll false /postByContext winexec
  297. curActivation
  298. } monitor
  299. } _NXDefProc
  300. /activateSelf {
  301. appLock {
  302. 0 ne
  303. activeApp 0 eq or {
  304. 0 currentcontext //_lockedActivateContext exec
  305. } if
  306. } monitor
  307. } _NXDefProc
  308. /deactivateCurrContext {
  309. appLock {
  310. //_lockedDoDeactivate exec
  311. /setArrowCursor winexec
  312. } monitor
  313. } _NXDefProc
  314. /deactivateSelf {
  315. appLock {
  316. activeApp currentcontext eq {
  317. //_lockedDoDeactivate exec
  318. /setArrowCursor winexec
  319. } if
  320. } monitor
  321. } _NXDefProc
  322. /activateNextApp {
  323. appLock {
  324. dup activeApp eq activeApp 0 eq or {
  325. true 0 /getWindows winexec
  326. false exch {
  327. dup currentwindowlevel
  328. dup //mainMenuLevel gt exch
  329. dup //dockLevel lt exch
  330. //normalLevel ge and or {
  331. dup currentwindowdict
  332. dup null ne {
  333. dup /icon get 1 ne
  334. exch /hideOnDeact get not
  335. and {
  336. dup currentowner
  337. 4 index ne {
  338. true exit
  339. } if
  340. } if
  341. }{
  342. pop
  343. } ifelse
  344. } if
  345. pop
  346. } forall
  347. {
  348. 4 index exch currentowner //_lockedActivateContext exec
  349. pop
  350. }{
  351. 1 index activeApp eq {
  352. //_lockedDoDeactivate exec
  353. } if
  354. } ifelse
  355. /returnWindows winexec
  356. } if
  357. pop pop
  358. } monitor
  359. } _NXDefProc
  360. /orderPanelIfActive {
  361. appLock {
  362. activeApp currentcontext eq {
  363. 3 copy orderwindow
  364. } if
  365. currentwindowdict /kitVisible
  366. 4 2 roll pop
  367. Out ne put
  368. } monitor
  369. } _NXDefProc
  370. /orderWinsAndPanels {
  371. appLock {
  372. dup currentwindowdict
  373. dup /hideOnDeact get not
  374. exch /kitVisible get
  375. 2 index currentowner activeApp eq
  376. and or {
  377. orderwindow
  378. }{
  379. pop pop pop
  380. } ifelse
  381. } monitor
  382. } _NXDefProc
  383. /setHideOnDeact {
  384. mark 4 1 roll
  385. appLock {
  386. dup currentwindowdict
  387. dup /hideOnDeact get
  388. 3 index ne {
  389. dup /hideOnDeact 4 index put
  390. 3 -1 roll {
  391. /kitVisible 4 -1 roll put
  392. activeApp currentcontext ne {
  393. Out exch 0 exch orderwindow
  394. } if
  395. } if
  396. } if
  397. } monitor
  398. cleartomark
  399. } _NXDefProc
  400. /reorderWindows {
  401. appLock {
  402. dup activeApp eq exch
  403. true exch /getWindows winexec
  404. 0 exch {
  405. dup currentwindowlevel 0 eq
  406. 1 index currentwindowdict
  407. /hideOnDeact get not
  408. 5 index or and {
  409. exch dup 0 eq {
  410. Above
  411. }{
  412. Below
  413. } ifelse
  414. exch 2 index orderwindow
  415. }{
  416. pop
  417. } ifelse
  418. } forall
  419. pop /returnWindows winexec pop
  420. } monitor
  421. } _NXDefProc
  422. /hideOtherApps {
  423. dup 0 ne {
  424. dup /activateContext winexec
  425. } if
  426. true 0 /getWindows winexec {
  427. mark exch
  428. dup currentowner
  429. dup 0 ne
  430. 1 index 6 index ne and {
  431. dup //CDToken /currentContextData winexec
  432. 3 -1 roll ne {
  433. //Kitdefined 0 0 0 0 0
  434. //AppHide 0 0
  435. 10 -1 roll false
  436. /postByContext winexec
  437. } if
  438. } if
  439. cleartomark
  440. } forall
  441. /returnWindows winexec pop
  442. } _NXDefProc
  443. end
  444. setshared
  445. currentshared true setshared
  446. nextdict /Beepfile (SystemBeep) _NXCheckAndDef
  447. nextdict /Beepwindow 0 _NXCheckAndDef
  448. nextdict /_beepContext null _NXCheckAndDef
  449. nextdict /_beepCondition condition _NXCheckAndDef
  450. nextdict /_beepLock lock _NXCheckAndDef
  451. nextdict /_mustBeep false _NXCheckAndDef
  452. windowPackage1.0 begin
  453. /_doBeep {
  454. mark
  455. {
  456. Beepfile null eq
  457. {
  458. Beepwindow 0 ne
  459. {
  460. gsave
  461. true setinstance
  462. Beepwindow windowdeviceround
  463. Beepwindow currentwindowbounds
  464. 4 -2 roll pop pop 0 0 4 2 roll
  465. 1 setgray .333 setalpha
  466. Sover compositerect
  467. 500 {yield} repeat
  468. newinstance
  469. grestore
  470. } if
  471. }{
  472. Beepfile 0 playsound
  473. } ifelse
  474. } stopped
  475. cleartomark
  476. } bind executeonly def
  477. /_waitToBeep {
  478. _beepLock
  479. {
  480. {
  481. _mustBeep
  482. {
  483. exit
  484. } if
  485. yield
  486. _beepLock _beepCondition wait
  487. } loop
  488. } monitor
  489. } bind executeonly def
  490. /_beepThreadProc {
  491. {
  492. /_waitToBeep winexec
  493. yield
  494. /_doBeep winexec
  495. yield
  496. nextdict /_mustBeep false put
  497. } loop
  498. } bind executeonly def
  499. /beep {
  500. _mustBeep not
  501. {
  502. _beepLock {
  503. nextdict /_mustBeep true put
  504. _beepCondition notify
  505. } monitor
  506. } if
  507. } _NXDefProc
  508. /beepPrepareToRestoreNextdict {
  509. _NXPackagesInfo /_beepContext nextdict /_beepContext get put
  510. _NXPackagesInfo /_beepCondition nextdict /_beepCondition get put
  511. _NXPackagesInfo /_beepLock nextdict /_beepLock get put
  512. } _NXDefProc
  513. /beepPrepareToReloadPackages {
  514. nextdict /_beepContext _NXPackagesInfo /_beepContext get put
  515. nextdict /_beepCondition _NXPackagesInfo /_beepCondition get put
  516. nextdict /_beepLock _NXPackagesInfo /_beepLock get put
  517. } _NXDefProc
  518. end
  519. nextdict /_beepContext get null eq
  520. {
  521. nextdict /_beepContext
  522. mark /_beepThreadProc pkget fork
  523. put
  524. _beepContext detach
  525. } if
  526. setshared
  527. currentshared true setshared
  528. windowPackage1.0 /_contextData 5 dict _NXCheckAndDef
  529. windowPackage1.0 begin
  530. /_intialContextData {
  531. //contextArraySize array
  532. dup //CDPid 0 put
  533. dup //CDKitVersion 1 put
  534. } _NXDefProc
  535. /_getOrInitContextData {
  536. /_contextData pkget
  537. exch 2 copy
  538. known not {
  539. currentshared true setshared
  540. 2 index dup maxlength
  541. exch length eq {
  542. 3 -1 roll
  543. dup maxlength 5 add
  544. dict copy
  545. dup /_contextData exch //pkput exec
  546. 3 1 roll
  547. } if
  548. 2 index 2 index
  549. //_intialContextData exec put
  550. setshared
  551. } if
  552. get
  553. } _NXDefProc
  554. /currentContextData {
  555. exch //_getOrInitContextData exec
  556. exch get
  557. } _NXDefProc
  558. /setContextData {
  559. 3 -1 roll //_getOrInitContextData exec
  560. 3 1 roll put
  561. } _NXDefProc
  562. /freeContextData {
  563. /_contextData pkget
  564. exch 2 copy
  565. known {
  566. undef
  567. }{
  568. pop pop
  569. } ifelse
  570. } _NXDefProc
  571. end
  572. setshared
  573. currentshared true setshared
  574. nextdict /_NXNullGState null _NXCheckAndDef
  575. windowPackage1.0 begin
  576. /setNullGState {
  577. _NXNullGState null eq {
  578. currentshared true setshared
  579. gsave
  580. initgraphics
  581. 0 0 0 0 Nonretained window windowdeviceround
  582. gstate
  583. grestore
  584. nextdict /_NXNullGState 3 -1 roll put
  585. setshared
  586. } if
  587. _NXNullGState setgstate
  588. } _NXDefProc
  589. /Window {
  590. {
  591. window
  592. dup
  593. currentshared true setshared //WindowDictSize dict exch setshared
  594. dup 3 -1 roll setwindowdict
  595. begin
  596. /num exch def
  597. /level 0 def
  598. /icon null def
  599. /otherWindows null def
  600. /localNum null def
  601. /rightMargin 0 def
  602. /leftMargin 0 def
  603. /topMargin 0 def
  604. /title null def
  605. /clientEventMask //defaultClientMask def
  606. /hideOnDeact false def
  607. /kitVisible false def
  608. /otherOwner null def
  609. /avoidsActivation false def
  610. //defaultClientMask num /setEventMask winexec
  611. /eventHandlers pkget num seteventprocedures
  612. } stopped {handleerror} if
  613. num
  614. end
  615. } _NXDefProc
  616. /moveWindow {
  617. movewindow
  618. } _NXDefProc
  619. /placeWindow {
  620. gsave
  621. 5 index setgstate
  622. placewindow
  623. initmatrix initclip
  624. currentgstate pop
  625. grestore
  626. } _NXDefProc
  627. /currentWindowBounds
  628. /currentwindowbounds load
  629. def
  630. /setTitle {
  631. currentwindowdict begin
  632. dup length
  633. currentshared true setshared exch string exch setshared
  634. copy
  635. /title exch def
  636. end
  637. } _NXDefProc
  638. /currentTitle {
  639. currentwindowdict /title get
  640. } _NXDefProc
  641. /setPid {
  642. /contextDataLock pkget {
  643. //CDPid exch /setContextData winexec
  644. } monitor
  645. } _NXDefProc
  646. /setKitVersion {
  647. /contextDataLock pkget {
  648. currentcontext exch //CDKitVersion exch /setContextData winexec
  649. } monitor
  650. } _NXDefProc
  651. /setOtherOwner {
  652. dup currentwindowdict /otherOwner currentcontext put
  653. /contextDataLock pkget {
  654. currentcontext exch
  655. //CDToken exch /setContextData winexec
  656. } monitor
  657. } _NXDefProc
  658. /setWSOtherOwner {
  659. currentwindowdict /otherOwner -1 put
  660. } _NXDefProc
  661. end
  662. setshared
  663. currentshared true setshared
  664. windowPackage1.0 begin
  665. /printCallStack {
  666. /userdict load /_NXCallStack known {
  667. (Call Stack:\n) print
  668. _NXCallStack _NXCallStackTop
  669. 1 sub -1 0 {
  670. 1 index exch
  671. get
  672. ( ) print =
  673. } for
  674. pop flush
  675. } if
  676. } bind executeonly def
  677. /newhandleerror {
  678. $error begin
  679. currentwriteblock mark false setwriteblock
  680. {
  681. newerror {
  682. /newerror false def
  683. (%%[ Error: ) print
  684. errorname
  685. {
  686. dup type /stringtype ne {
  687. =string cvs
  688. } if
  689. print
  690. } exec
  691. (; OffendingCommand: ) print
  692. /command load
  693. {
  694. dup type /stringtype ne {
  695. { =string cvs } stopped {
  696. pop pop (<long object>)
  697. } if
  698. } if
  699. print
  700. } exec
  701. (; Context: ) print
  702. currentcontext systemdict /= get exec
  703. (OpStack:) print
  704. ostack length 0 gt {
  705. (\n) print
  706. } if
  707. ostack
  708. aload length
  709. {
  710. ( ) print systemdict /== get exec
  711. } repeat
  712. //printCallStack exec
  713. /_NXCallStackTop 0 store
  714. (]%%\n) print
  715. flush
  716. } if
  717. } stopped pop
  718. cleartomark setwriteblock
  719. end
  720. } bind executeonly def
  721. _NXDebug {
  722. /debugmsg {
  723. currentwindowdict begin
  724. nextdict /debugging get
  725. {
  726. nextdict /errfile known not
  727. {
  728. currentshared true setshared
  729. nextdict /errfile (/tmp/pserr) (w) file put
  730. setshared
  731. } if
  732. errfile exch writestring
  733. errfile flushfile
  734. }{
  735. pop
  736. }
  737. ifelse
  738. end
  739. } _NXDefProc
  740. }if
  741. nextdict begin
  742. /_NXInstallDebugErrorHandler {
  743. $error /recordstacks true put
  744. errordict /handleerror /newhandleerror //pkget exec put
  745. userdict /_NXInstallDebugErrorHandler {} put
  746. } _NXDefProc
  747. _NXDebug {
  748. /_NXTrace {
  749. (--------- ) print
  750. print
  751. ( ---------\n) print
  752. (Context: ) print
  753. currentcontext =
  754. (OpStack:\n) print
  755. 0 1 count 3 sub {
  756. ( ) print index ==
  757. } for
  758. //printCallStack exec
  759. } bind executeonly def
  760. } if
  761. end
  762. end
  763. setshared
  764. currentshared true setshared
  765. windowPackage1.0 /_NXOldMask 0 _NXCheckAndDef
  766. windowPackage1.0 /_WSsentMouseDown false _NXCheckAndDef
  767. windowPackage1.0 /_WSMouseDown 9 array _NXCheckAndDef
  768. windowPackage1.0 /_sentMouseDown true _NXCheckAndDef
  769. windowPackage1.0 /_dragNetWin known not {
  770. 0 0 0 0 Nonretained window
  771. dup windowPackage1.0 /_dragNetWin 4 -1 roll put
  772. dup -1 -1 bitshift exch setwindowlevel
  773. dup 0 exch setowner
  774. Lmousedraggedmask Lmouseupmask or exch seteventmask
  775. } if
  776. windowPackage1.0 /_dragInitX 0.0 _NXCheckAndDef
  777. windowPackage1.0 /_draginitY 0.0 _NXCheckAndDef
  778. windowPackage1.0 /_dragWinXOffset 0.0 _NXCheckAndDef
  779. windowPackage1.0 /_dragWinYOffset 0.0 _NXCheckAndDef
  780. windowPackage1.0 /_dragWinNum 0 _NXCheckAndDef
  781. windowPackage1.0 /_dragWCEnabled true _NXCheckAndDef
  782. windowPackage1.0 /_lmupLock lock _NXCheckAndDef
  783. windowPackage1.0 /_lmdownTime 0 _NXCheckAndDef
  784. windowPackage1.0 /_lmupCount -1 _NXCheckAndDef
  785. windowPackage1.0 /_frontWin -1 _NXCheckAndDef
  786. windowPackage1.0 /_frontWinEventTime -1 -1 bitshift -1 xor _NXCheckAndDef
  787. windowPackage1.0 /_lastOpenFileEventTime 0 _NXCheckAndDef
  788. windowPackage1.0 /_hitAvoidingWindow false _NXCheckAndDef
  789. windowPackage1.0 /_pkgsDoDeferredOrdering false _NXCheckAndDef
  790. windowPackage1.0 /_pkgsDoDeferredAct false _NXCheckAndDef
  791. windowPackage1.0 /_pendingActCount 0 _NXCheckAndDef
  792. windowPackage1.0 begin
  793. /setEventMask {
  794. dup currentwindowdict
  795. /clientEventMask 3 index put exch
  796. //keyMask //Sysdefinedmask //Flagschangedmask //Rmousedownmask or or or
  797. or exch seteventmask
  798. } _NXDefProc
  799. /currentEventMask {
  800. currentwindowdict /clientEventMask get
  801. } _NXDefProc
  802. /_compareTimes {
  803. pop dup 0 eq exch
  804. /_frontWinEventTime pkget ge
  805. or
  806. } _NXDefProc
  807. /_compareTimesAndApps {
  808. /_frontWin pkget currentowner activeApp eq
  809. 1 index currentowner activeApp ne
  810. and {
  811. pop pop false
  812. }{
  813. //_compareTimes exec
  814. } ifelse
  815. } _NXDefProc
  816. /_safeTestAndOrder {
  817. dup currentwindowlevel 0 ne {
  818. Above 0 3 -1 roll
  819. /orderWinsAndPanels winexec pop pop
  820. }{
  821. mark 4 -1 roll
  822. {
  823. 3 index exch
  824. 3 index exch exec not {
  825. Below /_frontWin pkget 3 index
  826. /orderWinsAndPanels winexec
  827. pop pop pop
  828. }{
  829. stop
  830. } ifelse
  831. } stopped {
  832. cleartomark
  833. Above 0 2 index
  834. /orderWinsAndPanels winexec
  835. /_frontWin exch pkput
  836. /_frontWinEventTime exch pkput
  837. } if
  838. } ifelse
  839. } _NXDefProc
  840. /safeOrderFront {
  841. //_compareTimesAndApps 3 1 roll
  842. //_safeTestAndOrder exec
  843. } _NXDefProc
  844. /safeOrderFrontDuringOpenFile {
  845. /_lastOpenFileEventTime pkget exch //safeOrderFront exec
  846. } _NXDefProc
  847. /setLastOpenFileTime {
  848. pop /_lastOpenFileEventTime 0 //pkput exec
  849. } _NXDefProc
  850. /_sendWinMoved {
  851. //Kitdefined 4 1 roll
  852. 0 0 3 -1 roll
  853. //Winmoved 0 0
  854. 3 index currentwindowdict begin
  855. /checkAndTransmit winexec
  856. end
  857. } _NXDefProc
  858. /_frontWithClick {
  859. Above 0 2 index orderwindow
  860. dup currentwindowlevel 0 eq {
  861. /_frontWin exch //pkput exec
  862. /_frontWinEventTime exch //pkput exec
  863. }{
  864. pop pop
  865. } ifelse
  866. } _NXDefProc
  867. /_safeFrontWithClick {
  868. //_compareTimes 3 1 roll
  869. //_safeTestAndOrder exec
  870. } _NXDefProc
  871. /_pkgsDeferredOrdering {
  872. mark 3 1 roll
  873. /_pkgsDoDeferredOrdering pkget {
  874. {
  875. exch 1 index
  876. //_safeFrontWithClick exec
  877. /_pkgsDoDeferredAct pkget {
  878. /_pendingActCount pkget exch
  879. /pseudoActivateWindow winexec
  880. } if
  881. } stopped
  882. } if
  883. cleartomark
  884. /_pkgsDoDeferredOrdering false pkput
  885. /_pkgsDoDeferredAct false pkput
  886. } _NXDefProc
  887. /_doKitDeferredOrdering {
  888. mark 7 1 roll
  889. 3 -1 roll
  890. /_lmupCount pkget gt {
  891. /_pkgsDoDeferredOrdering false pkput
  892. /_pkgsDoDeferredAct false pkput
  893. } if
  894. {
  895. 5 -1 roll {
  896. exch 1 index
  897. //_safeFrontWithClick exec
  898. }{
  899. exch pop
  900. } ifelse
  901. 3 -1 roll {
  902. /pseudoActivateWindow winexec
  903. } if
  904. } stopped pop
  905. cleartomark
  906. } _NXDefProc
  907. /kitDeferredOrdering {
  908. //_lmupLock {
  909. 2 index /_lmupCount pkget gt
  910. 7 index or
  911. 8 -1 roll
  912. 7 -1 roll
  913. 5 index /_lmupCount pkget gt
  914. or or
  915. 7 -1 roll and
  916. 6 2 roll
  917. //_doKitDeferredOrdering exec
  918. } monitor
  919. } _NXDefProc
  920. /blockWindowOrdering {
  921. //_lmupLock {
  922. /_lmupCount pkget gt {
  923. /_pkgsDoDeferredOrdering false pkput
  924. /_pkgsDoDeferredAct false pkput
  925. true
  926. }{
  927. false
  928. } ifelse
  929. } monitor
  930. } _NXDefProc
  931. /_prepareToDrag {
  932. //Above 0 //_dragNetWin orderwindow
  933. false setflushexposures
  934. //Lmousedragged //Firstwindow sethowpost
  935. //Lmouseup //Firstwindow sethowpost
  936. dup /_dragWinNum exch //pkput exec
  937. currentwindowbounds pop pop
  938. /_dragInitY exch //pkput exec
  939. /_dragInitX exch //pkput exec
  940. /_dragWinYOffset exch //pkput exec
  941. /_dragWinXOffset exch //pkput exec
  942. /_dragWCEnabled 0 currentwaitcursorenabled //pkput exec
  943. false 0 setwaitcursorenabled
  944. } _NXDefProc
  945. /doDragWindow {
  946. //_lmupLock {
  947. exch /_lmupCount pkget gt {
  948. //_prepareToDrag exec
  949. }{
  950. dup currentwindowbounds pop pop
  951. 3 -1 roll //_sendWinMoved exec
  952. pop pop
  953. } ifelse
  954. } monitor
  955. } _NXDefProc
  956. /_reapContext {
  957. mark exch
  958. dup //CDToken /currentContextData winexec
  959. exch /freeContextData winexec
  960. dup null ne {
  961. {
  962. currentwindowdict
  963. /otherOwner null put
  964. } stopped
  965. } if
  966. cleartomark
  967. } _NXDefProc
  968. /_doPostEvent {
  969. nextdict /_journalRecording get {
  970. 7 -1 roll Journalflagmask or 7 1 roll
  971. } if
  972. stopped {
  973. 10 {pop} repeat
  974. false
  975. }{
  976. not {
  977. (event not posted\n) print
  978. (Frog) 1 playsound
  979. } if
  980. true
  981. } ifelse
  982. }
  983. _NXDebug {
  984. dup length 1 add array cvx
  985. dup 1
  986. 4 -1 roll
  987. putinterval
  988. dup 0 /_NXInstallDebugErrorHandler cvx put
  989. } if
  990. _NXDefProc
  991. true {
  992. /postByContext {
  993. 11 1 roll
  994. dup 0 eq {
  995. 10 {pop} repeat
  996. {
  997. /beep winexec
  998. } if
  999. }{
  1000. dup 12 1 roll
  1001. /posteventbycontext cvx
  1002. //_doPostEvent exec {
  1003. pop pop
  1004. }{
  1005. {
  1006. /beep winexec
  1007. } if
  1008. //_reapContext exec
  1009. } ifelse
  1010. } ifelse
  1011. } _NXDefProc
  1012. }{
  1013. /postByContext {
  1014. 11 1 roll
  1015. dup 0 eq {
  1016. 10 {pop} repeat
  1017. {
  1018. /beep winexec
  1019. } if
  1020. }{
  1021. dup 12 1 roll
  1022. 5 -1 roll pop 4 1 roll
  1023. Bypscontext
  1024. //_doPostEvent exec not {
  1025. {
  1026. /beep winexec
  1027. } if
  1028. //_reapContext exec
  1029. }{
  1030. pop pop
  1031. } ifelse
  1032. } ifelse
  1033. } _NXDefProc
  1034. } ifelse
  1035. /checkAndTransmit {
  1036. 8 index 1 exch bitshift clientEventMask and 0 ne
  1037. {
  1038. /transmitEvent winexec
  1039. }{
  1040. 9 {pop} repeat
  1041. }
  1042. ifelse
  1043. } _NXDefProc
  1044. /_postToNilWindow {
  1045. 8 index
  1046. 8 index
  1047. 6 index currentwindowbounds pop pop
  1048. 3 -1 roll add
  1049. 3 1 roll add
  1050. 11 -1 roll pop 10 1 roll
  1051. 9 -1 roll pop 8 1 roll
  1052. 5 -1 roll pop 0 5 1 roll
  1053. activeApp exch /postByContext winexec
  1054. } _NXDefProc
  1055. /_handleCommand {
  1056. mark 10 1 roll
  1057. 1 index -16 bitshift 255 and
  1058. 2 index 65535 and
  1059. dup 46 eq
  1060. 2 index 0 eq and
  1061. 1 index 173 eq
  1062. 2 index 175 eq or
  1063. 4 -1 roll 1 eq and
  1064. 7 index //Numericpadmask and 0 ne and
  1065. or {
  1066. 3 index 65535 and 0 eq {
  1067. dup 173 eq {
  1068. true 0 /getWindows winexec
  1069. mark exch {
  1070. mark exch
  1071. dup currentwindowlevel 0 eq {
  1072. dup currentwindowdict
  1073. dup null ne {
  1074. /icon get 1 ne {
  1075. Above exch 0 exch orderwindow
  1076. cleartomark
  1077. exit
  1078. } if
  1079. } if
  1080. } if
  1081. cleartomark
  1082. } /revForall winexec
  1083. cleartomark
  1084. /returnWindows winexec
  1085. }{
  1086. dup 175 eq {
  1087. true 0 /getWindows winexec
  1088. mark exch {
  1089. dup currentwindowlevel 0 eq {
  1090. dup currentwindowdict
  1091. dup null ne {
  1092. /icon get 1 ne {
  1093. Below exch 0 exch
  1094. systemdict /orderwindow get exec
  1095. exit
  1096. } if
  1097. } if
  1098. } if
  1099. } forall
  1100. cleartomark
  1101. /returnWindows winexec
  1102. }{
  1103. pop
  1104. activeApp true /postByContext winexec
  1105. activeApp //CDPid /currentContextData winexec
  1106. activeApp //CDKitVersion /currentContextData winexec
  1107. 4 lt 1 index 0 ne and
  1108. {
  1109. 2 unixsignal
  1110. }{
  1111. pop
  1112. } ifelse
  1113. } ifelse
  1114. } ifelse
  1115. }{
  1116. pop
  1117. } ifelse
  1118. }{
  1119. pop
  1120. activeApp true /postByContext winexec
  1121. } ifelse
  1122. cleartomark
  1123. } _NXDefProc
  1124. /_ptInRect {
  1125. false mark 8 2 roll
  1126. 6 -1 roll 5 -1 roll sub
  1127. 5 -2 roll sub
  1128. dup 0 ge {
  1129. exch dup 0 ge {
  1130. 4 -1 roll lt {
  1131. gt {
  1132. exch pop true exch
  1133. } if
  1134. } if
  1135. } if
  1136. } if
  1137. cleartomark
  1138. } _NXDefProc
  1139. /_testTitleBar {
  1140. currentwindowbounds 4 2 roll pop pop
  1141. topMargin sub 3 -1 roll exch sub 1 sub exch
  1142. 1 index 0 ge {
  1143. topMargin //wbutSize sub 2 div
  1144. 3 index leftMargin lt {
  1145. exch pop
  1146. leftMargin //wbutSize sub
  1147. exch
  1148. //wbutSize //wbutSize
  1149. //_ptInRect exec
  1150. }{
  1151. 1 index rightMargin sub 4 index le {
  1152. exch rightMargin sub
  1153. exch
  1154. //wbutSize //wbutSize
  1155. //_ptInRect exec
  1156. }{
  1157. pop pop pop pop false
  1158. } ifelse
  1159. } ifelse
  1160. true
  1161. }{
  1162. pop pop pop false false
  1163. } ifelse
  1164. } _NXDefProc
  1165. /transmitEvent {
  1166. 3 index 0 ne {
  1167. 3 index currentwindowdict
  1168. /localNum get 3 //stackSwap exec
  1169. currentowner true
  1170. /postByContext winexec
  1171. }{
  1172. 9 {pop} repeat
  1173. /beep winexec
  1174. (transmitEvent can't post to a nil window\n) print
  1175. } ifelse
  1176. } _NXDefProc
  1177. /_lmdownInTitle {
  1178. dup 3 index 1 gt or {
  1179. not icon 1 eq and 2 index 2 eq and {
  1180. 3 index currentowner activeApp ne {
  1181. num currentowner //CDKitVersion
  1182. /currentContextData winexec
  1183. 2 ge {
  1184. num /activateByWindow winexec
  1185. }{
  1186. num currentowner /activateContext winexec
  1187. } ifelse
  1188. } if
  1189. } if
  1190. /transmitEvent winexec
  1191. }{
  1192. pop
  1193. 4 index //buckyBitMask and //Commandmask eq {
  1194. num currentwindowlevel 0 eq {
  1195. Below 0 num
  1196. systemdict /orderwindow get exec
  1197. } if
  1198. 9 {pop} repeat
  1199. /_sentMouseDown false //pkput exec
  1200. }{
  1201. 5 index num //_frontWithClick exec
  1202. 7 index 7 index 6 index
  1203. 12 3 roll
  1204. 4 index //buckyBitMask and
  1205. //Alternatemask eq
  1206. icon 1 eq or {
  1207. 9 {pop} repeat
  1208. /_sentMouseDown false //pkput exec
  1209. }{
  1210. 3 index currentowner activeApp ne {
  1211. avoidsActivation {
  1212. /_hitAvoidingWindow true //pkput exec
  1213. }{
  1214. num /activateByWindow winexec
  1215. } ifelse
  1216. } if
  1217. /transmitEvent winexec
  1218. } ifelse
  1219. Journalflagmask and 0 eq {
  1220. num //_prepareToDrag exec
  1221. }{
  1222. pop pop
  1223. } ifelse
  1224. } ifelse
  1225. } ifelse
  1226. } _NXDefProc
  1227. /_lmdownInBody {
  1228. pop
  1229. num currentowner //CDKitVersion
  1230. /currentContextData winexec
  1231. 2 ge {
  1232. 1 index 1 eq {
  1233. /_pkgsDoDeferredOrdering true pkput
  1234. num currentowner activeApp ne {
  1235. avoidsActivation not {
  1236. /_pkgsDoDeferredAct true pkput
  1237. } if
  1238. num currentowner
  1239. /sendDeferredAct winexec
  1240. /_pendingActCount exch pkput
  1241. } if
  1242. } if
  1243. }{
  1244. 5 index num //_frontWithClick exec
  1245. num currentowner activeApp ne {
  1246. num /activateByWindow winexec
  1247. } if
  1248. } ifelse
  1249. /transmitEvent winexec
  1250. } _NXDefProc
  1251. /_lmdownWithHelp {
  1252. pop pop
  1253. 1 index 1 eq
  1254. num currentowner activeApp ne and {
  1255. num currentowner /activateContext winexec
  1256. } if
  1257. /transmitEvent winexec
  1258. } _NXDefProc
  1259. /lmdownEvProc {
  1260. /_lmdownTime 6 index //pkput exec
  1261. /_sentMouseDown true //pkput exec
  1262. /_hitAvoidingWindow false //pkput exec
  1263. /_pkgsDoDeferredOrdering false //pkput exec
  1264. /_pkgsDoDeferredAct false //pkput exec
  1265. 3 index currentwindowdict begin
  1266. {
  1267. 7 index 7 index 5 index //_testTitleBar exec
  1268. 6 index //buckyBitMask and
  1269. dup //Helpmask eq
  1270. exch //Controlmask //Alternatemask or eq or {
  1271. //_lmdownWithHelp exec
  1272. }{
  1273. {
  1274. //_lmdownInTitle exec
  1275. }{
  1276. //_lmdownInBody exec
  1277. } ifelse
  1278. } ifelse
  1279. } stopped {
  1280. end handleerror
  1281. }{
  1282. end
  1283. } ifelse
  1284. } _NXDefProc
  1285. /_transmitLmup {
  1286. 1 index 4 index 11 2 roll
  1287. /transmitEvent winexec
  1288. /_hitAvoidingWindow pkget
  1289. 1 index currentowner activeApp ne
  1290. 4 -1 roll 1 eq and and {
  1291. currentowner /activateContext winexec
  1292. }{
  1293. pop
  1294. } ifelse
  1295. } _NXDefProc
  1296. /lmupEvProc {
  1297. //_lmupLock {
  1298. /_lmupCount 3 index //pkput exec
  1299. /_dragWinNum pkget 0 eq {
  1300. /_lmdownTime //pkget exec
  1301. 4 index //_pkgsDeferredOrdering exec
  1302. /_sentMouseDown pkget {
  1303. //_transmitLmup exec
  1304. }{
  1305. 9 {pop} repeat
  1306. } ifelse
  1307. }{
  1308. /lmupWinDragEvProc winexec
  1309. } ifelse
  1310. } monitor
  1311. } _NXDefProc
  1312. /_postRightEvent {
  1313. 4 index currentowner activeApp eq
  1314. {
  1315. pop /transmitEvent winexec
  1316. }{
  1317. //_postToNilWindow exec
  1318. } ifelse
  1319. } _NXDefProc
  1320. /rmdownEvProc {
  1321. 3 index currenteventmask
  1322. /_NXOldMask 1 index //pkput exec
  1323. //MenuEvent or 4 index seteventmask
  1324. true //_postRightEvent exec
  1325. } _NXDefProc
  1326. /rmupEvProc {
  1327. /_NXOldMask pkget 4 index seteventmask
  1328. false //_postRightEvent exec
  1329. } _NXDefProc
  1330. /rmdragEvProc {
  1331. false //_postRightEvent exec
  1332. } _NXDefProc
  1333. /mEnterEvProc {
  1334. dup -1 eq {
  1335. //Cursorrect 8 //stackSwap exec pop
  1336. Mouseentered 4 //stackSwap exec pop
  1337. } if
  1338. /transmitEvent winexec
  1339. } _NXDefProc
  1340. /mExitEvProc {
  1341. dup -1 eq
  1342. {
  1343. //Cursorrect 8 //stackSwap exec pop
  1344. Mouseexited 4 //stackSwap exec pop
  1345. } if
  1346. /transmitEvent winexec
  1347. } _NXDefProc
  1348. /keyDownEvProc {
  1349. 4 index //Commandmask and 0 ne
  1350. {
  1351. 2 index 65535 and 0 eq
  1352. 10 1 roll
  1353. /_handleCommand winexec
  1354. activeApp 0 eq
  1355. and
  1356. {
  1357. /beep winexec
  1358. } if
  1359. }{
  1360. activeApp 0 eq {
  1361. /beep winexec
  1362. }{
  1363. activeApp true /postByContext winexec
  1364. } ifelse
  1365. } ifelse
  1366. } _NXDefProc
  1367. /flagsChEvProc {
  1368. nextdict /currentEventFlags 6 index put
  1369. nextdict /_NXCurrentEventFlags 6 index put
  1370. activeApp false /postByContext winexec
  1371. } _NXDefProc
  1372. /keyUpEvProc
  1373. /flagsChEvProc load _NXDefProc
  1374. /sysDefEvProc {
  1375. 2 index 1 eq {
  1376. 4 -1 roll pop 0 4 1 roll
  1377. //Broadcast /postevent cvx //_doPostEvent exec not {
  1378. handleerror
  1379. } if
  1380. }{
  1381. 2 index 0 eq {
  1382. 1 index activeApp eq {
  1383. appLock
  1384. {
  1385. nextdict /activeApp 0 put
  1386. /setArrowCursor winexec
  1387. } monitor
  1388. } if
  1389. 5 index 2 index /activateNextApp winexec
  1390. 1 index //_reapContext exec
  1391. } if
  1392. 9 {pop} repeat
  1393. } ifelse
  1394. } _NXDefProc
  1395. /lmdownWSEvProc {
  1396. 3 index currentwindowdict /otherOwner get
  1397. dup null eq {
  1398. activeApp ne 2 index 2 eq and {
  1399. /deactivateCurrContext winexec
  1400. 4 index //buckyBitMask and
  1401. //Commandmask eq {
  1402. 0 /hideOtherApps winexec
  1403. } if
  1404. } if
  1405. /_WSsentMouseDown true //pkput exec
  1406. /transmitEvent winexec
  1407. }{
  1408. dup -1 eq {
  1409. pop
  1410. /_WSsentMouseDown true //pkput exec
  1411. /transmitEvent winexec
  1412. }{
  1413. 2 index 1 eq {
  1414. pop Above 0 5 index orderwindow
  1415. /_WSMouseDown pkget astore
  1416. }{
  1417. 2 index 2 eq {
  1418. //Kitdefined 0 0 0 0 0
  1419. //AppUnhide 0 0
  1420. 9 index
  1421. /posteventbycontext cvx
  1422. //_doPostEvent exec {
  1423. 5 index //buckyBitMask and
  1424. //Commandmask eq {
  1425. /hideOtherApps winexec
  1426. }{
  1427. /activateContext winexec
  1428. } ifelse
  1429. 9 {pop} repeat
  1430. }{
  1431. //_reapContext exec
  1432. /_WSsentMouseDown true //pkput exec
  1433. /transmitEvent winexec
  1434. } ifelse
  1435. }{
  1436. 10 {pop} repeat
  1437. } ifelse
  1438. } ifelse
  1439. } ifelse
  1440. } ifelse
  1441. } _NXDefProc
  1442. /lmdragWSEvProc {
  1443. 3 index currentwindowdict /otherOwner get
  1444. null ne {
  1445. /_WSsentMouseDown pkget not {
  1446. /_WSMouseDown pkget
  1447. dup aload pop
  1448. 15 index 6 index sub 18 gt
  1449. 18 index 9 index sub abs 5 gt
  1450. 18 index 9 index sub abs 5 gt
  1451. or or {
  1452. /transmitEvent winexec pop
  1453. /_WSsentMouseDown true //pkput exec
  1454. /transmitEvent winexec
  1455. }{
  1456. 19 {pop} repeat
  1457. } ifelse
  1458. }{
  1459. /transmitEvent winexec
  1460. } ifelse
  1461. }{
  1462. /transmitEvent winexec
  1463. } ifelse
  1464. } _NXDefProc
  1465. /lmupWSEvProc {
  1466. /_WSsentMouseDown pkget
  1467. {
  1468. /transmitEvent winexec
  1469. }{
  1470. 9 {pop} repeat
  1471. } ifelse
  1472. /_WSsentMouseDown false //pkput exec
  1473. } _NXDefProc
  1474. /gridWindow {
  1475. dup currentwindowdict /icon get 1 eq
  1476. nextdict /_NXSnapIconsToGrid get
  1477. 4 -1 roll //Alternatemask and 0 eq
  1478. and and {
  1479. 0 currentwindowbounds
  1480. 4 index currentwindowbounds pop pop
  1481. 2 {
  1482. 64 div round 64 mul exch
  1483. } repeat
  1484. 2 {
  1485. dup 3 index 6 index add 1 sub gt {
  1486. 64 sub
  1487. } if
  1488. dup 5 index lt {
  1489. 64 add
  1490. } if
  1491. 6 1 roll
  1492. } repeat
  1493. pop pop pop pop
  1494. 3 -1 roll movewindow
  1495. }{
  1496. pop
  1497. } ifelse
  1498. } _NXDefProc
  1499. /lmdragWinDragEvProc {
  1500. 6 {pop} repeat
  1501. /_dragWinYOffset pkget sub exch
  1502. /_dragWinXOffset pkget sub exch
  1503. /_dragWinNum pkget
  1504. nextdict /_journalRecording get {
  1505. 3 1 roll
  1506. 2 index currentwindowbounds pop pop
  1507. 2 index
  1508. exch
  1509. sub
  1510. exch
  1511. 3 index
  1512. exch
  1513. sub
  1514. exch
  1515. Journalevent 3 1 roll 0 0 7 index //Windragged 0 0
  1516. /transmitEvent winexec
  1517. 3 -1 roll
  1518. } if
  1519. dup currentwindowdict /otherWindows get
  1520. dup null eq {
  1521. pop movewindow pop
  1522. }{
  1523. 1 index currentwindowbounds pop pop
  1524. 4 index exch sub exch
  1525. 5 index exch sub exch
  1526. 6 3 roll movewindow
  1527. 3 -1 roll
  1528. dup length 1 sub 1 exch getinterval {
  1529. mark exch {
  1530. dup currentwindowbounds pop pop
  1531. 4 index add exch
  1532. 5 index add exch
  1533. 3 -1 roll movewindow
  1534. } stopped pop
  1535. cleartomark
  1536. } forall pop pop pop
  1537. } ifelse
  1538. } _NXDefProc
  1539. /lmupWinDragEvProc {
  1540. 9 copy
  1541. //lmdragWinDragEvProc exec
  1542. //Out 0 //_dragNetWin orderwindow
  1543. true setflushexposures
  1544. //Lmousedragged //Lastleft sethowpost
  1545. //Lmouseup //Lastleft sethowpost
  1546. 4 index 10 1 roll
  1547. /_sentMouseDown pkget {
  1548. /_dragWinNum pkget 3 //stackSwap exec pop
  1549. /_dragWinYOffset pkget 6 //stackSwap exec pop
  1550. /_dragWinXOffset pkget 7 //stackSwap exec pop
  1551. //_transmitLmup exec
  1552. }{
  1553. 9 {pop} repeat
  1554. } ifelse
  1555. /_dragWinNum pkget exch 1 index
  1556. //gridWindow exec
  1557. dup currentwindowbounds pop pop 2 copy
  1558. /_dragInitY pkget ne exch
  1559. /_dragInitX pkget ne exch
  1560. or {
  1561. 3 -1 roll //_sendWinMoved exec
  1562. }{
  1563. pop pop pop
  1564. } ifelse
  1565. /_dragWCEnabled //pkget exec 0 setwaitcursorenabled
  1566. /_dragWinNum 0 //pkput exec
  1567. } _NXDefProc
  1568. /eventsPrepareToRestoreNextdict {
  1569. /_dragNetWin pkget termwindow
  1570. } _NXDefProc
  1571. windowPackage1.0 /eventHandlers [
  1572. /transmitEvent load
  1573. /lmdownEvProc load
  1574. /lmupEvProc load
  1575. /rmdownEvProc load
  1576. /rmupEvProc load
  1577. /transmitEvent load
  1578. /transmitEvent load
  1579. /rmdragEvProc load
  1580. /mEnterEvProc load
  1581. /mExitEvProc load
  1582. /keyDownEvProc load
  1583. /keyUpEvProc load
  1584. /flagsChEvProc load
  1585. /transmitEvent load
  1586. /sysDefEvProc load
  1587. /transmitEvent load
  1588. ] _NXCheckAndDef
  1589. windowPackage1.0 /deskWinHandler [
  1590. null
  1591. null
  1592. null
  1593. /rmdownEvProc load
  1594. /rmupEvProc load
  1595. null
  1596. null
  1597. /rmdragEvProc load
  1598. null
  1599. null
  1600. null
  1601. null
  1602. null
  1603. null
  1604. /sysDefEvProc load
  1605. null
  1606. ] _NXCheckAndDef
  1607. windowPackage1.0 /workspaceHandler [
  1608. null
  1609. /lmdownWSEvProc load
  1610. /lmupWSEvProc load
  1611. /rmdownEvProc load
  1612. /rmupEvProc load
  1613. null
  1614. /lmdragWSEvProc load
  1615. /rmdragEvProc load
  1616. null
  1617. null
  1618. /keyDownEvProc load
  1619. /keyUpEvProc load
  1620. /flagsChEvProc load
  1621. null
  1622. /sysDefEvProc load
  1623. null
  1624. ] _NXCheckAndDef
  1625. windowPackage1.0 /_dragWindowHandler [
  1626. null
  1627. null
  1628. /lmupWinDragEvProc load
  1629. null
  1630. null
  1631. null
  1632. /lmdragWinDragEvProc load
  1633. null
  1634. null
  1635. null
  1636. null
  1637. null
  1638. null
  1639. null
  1640. /sysDefEvProc load
  1641. null
  1642. ] _NXCheckAndDef
  1643. windowPackage1.0 /specialTileHandler [
  1644. null
  1645. /transmitEvent load
  1646. /transmitEvent load
  1647. /rmdownEvProc load
  1648. /rmupEvProc load
  1649. null
  1650. /transmitEvent load
  1651. /rmdragEvProc load
  1652. null
  1653. null
  1654. /keyDownEvProc load
  1655. /keyUpEvProc load
  1656. /flagsChEvProc load
  1657. null
  1658. /sysDefEvProc load
  1659. null
  1660. ] _NXCheckAndDef
  1661. //Rmousedownmask //Sysdefinedmask or deskWin seteventmask
  1662. deskWinHandler deskWin seteventprocedures
  1663. _dragWindowHandler _dragNetWin seteventprocedures
  1664. end
  1665. setshared
  1666. currentshared true setshared
  1667. nextdict /_windowCoverLock lock _NXCheckAndDef
  1668. nextdict /_coverWin 0 _NXCheckAndDef
  1669. nextdict /_edgeWindows 0 _NXCheckAndDef
  1670. windowPackage1.0 begin
  1671. /ensureEdgeWindows {
  1672. _windowCoverLock
  1673. {
  1674. _edgeWindows 0 eq
  1675. {
  1676. currentshared true setshared
  1677. gsave
  1678. 0.1 setgray
  1679. 1 1 4 {
  1680. pop
  1681. 0 0 0 0 Nonretained window
  1682. dup currentcontext exch setowner
  1683. dup 25 exch setwindowlevel
  1684. dup windowdeviceround
  1685. setexposurecolor
  1686. } for
  1687. 4 array astore
  1688. grestore
  1689. exch setshared
  1690. }{
  1691. _edgeWindows
  1692. dup {currentcontext exch setowner} forall
  1693. nextdict /_edgeWindows 0 put
  1694. } ifelse
  1695. /userdict load /_NXedgeWindows 3 -1 roll put
  1696. }
  1697. monitor
  1698. } _NXDefProc
  1699. /placeEdgeWindows {
  1700. aload pop /userdict load /_NXedgeWindows get {placewindow} forall
  1701. } _NXDefProc
  1702. /showEdgeWindows {
  1703. /userdict load /_NXedgeWindows get {Above 0 3 -1 roll orderwindow} forall
  1704. } _NXDefProc
  1705. /hideEdgeWindows {
  1706. /userdict load /_NXedgeWindows get {Out 0 3 -1 roll orderwindow} forall
  1707. _windowCoverLock
  1708. {
  1709. /userdict load /_NXedgeWindows get
  1710. _edgeWindows 0 eq
  1711. {
  1712. dup {0 exch setowner} forall
  1713. nextdict /_edgeWindows 3 -1 roll put
  1714. }{
  1715. {termwindow} forall
  1716. } ifelse
  1717. /userdict load /_NXedgeWindows 0 put
  1718. }
  1719. monitor
  1720. } _NXDefProc
  1721. /_checkOutCoverWin {
  1722. _windowCoverLock
  1723. {
  1724. _coverWin 0 eq
  1725. {
  1726. currentshared true setshared
  1727. 0 0 0 0 Nonretained window
  1728. dup currentcontext exch setowner
  1729. dup false exch setautofill
  1730. exch setshared
  1731. }{
  1732. _coverWin
  1733. dup currentcontext exch setowner
  1734. nextdict /_coverWin 0 put
  1735. } ifelse
  1736. /userdict load /_NXcoverWindow 3 -1 roll put
  1737. }
  1738. monitor
  1739. } _NXDefProc
  1740. /_checkInCoverWin {
  1741. _windowCoverLock
  1742. {
  1743. /userdict load /_NXcoverWindow get
  1744. _coverWin 0 eq
  1745. {
  1746. dup 0 exch setowner
  1747. nextdict /_coverWin 3 -1 roll put
  1748. }{
  1749. termwindow
  1750. } ifelse
  1751. /userdict load /_NXcoverWindow 0 put
  1752. }
  1753. monitor
  1754. } _NXDefProc
  1755. /coverWindow {
  1756. mark exch
  1757. //_checkOutCoverWin exec
  1758. /userdict load /_NXcoverWindow get
  1759. {
  1760. 1 index currentwindowlevel
  1761. 1 index setwindowlevel
  1762. 1 index currentwindowbounds
  1763. 4 index placewindow
  1764. Above 2 index 3 -1 roll orderwindow
  1765. Out 0 3 -1 roll orderwindow
  1766. } stopped {
  1767. //_checkInCoverWin exec
  1768. }
  1769. cleartomark
  1770. } _NXDefProc
  1771. /uncoverWindow {
  1772. /userdict load /_NXcoverWindow get
  1773. dup 0 ne {
  1774. appLock {
  1775. 1 index currentwindowdict
  1776. dup /hideOnDeact get not
  1777. exch /kitVisible get
  1778. activeApp currentcontext eq
  1779. and or {
  1780. {
  1781. Above 1 index 4 -1 roll
  1782. orderwindow
  1783. } stopped {
  1784. pop pop pop
  1785. } if
  1786. }{
  1787. exch pop
  1788. } ifelse
  1789. } monitor
  1790. Out 0 3 -1 roll orderwindow
  1791. //_checkInCoverWin exec
  1792. }{
  1793. pop pop
  1794. } ifelse
  1795. } _NXDefProc
  1796. /resizePrepareToRestoreNextdict {
  1797. _NXPackagesInfo /_windowCoverLock nextdict /_windowCoverLock get put
  1798. _NXPackagesInfo /_coverWin nextdict /_coverWin get put
  1799. _NXPackagesInfo /_edgeWindows nextdict /_edgeWindows get put
  1800. } _NXDefProc
  1801. /resizePrepareToReloadPackages {
  1802. nextdict /_windowCoverLock _NXPackagesInfo /_windowCoverLock get put
  1803. nextdict /_coverWin _NXPackagesInfo /_coverWin get put
  1804. nextdict /_edgeWindows _NXPackagesInfo /_edgeWindows get put
  1805. } _NXDefProc
  1806. end
  1807. setshared
  1808. currentshared true setshared
  1809. windowPackage1.0 begin
  1810. /setCursor {
  1811. appLock
  1812. {
  1813. {
  1814. /lastCompletedActivation pkget eq {
  1815. setcursor
  1816. }{
  1817. pop pop pop pop
  1818. } ifelse
  1819. } stopped
  1820. {handleerror} if
  1821. } monitor
  1822. } _NXSimpleDefProc
  1823. /setArrowCursor {
  1824. gsave
  1825. {
  1826. sharedCursors windowdeviceround
  1827. 0 48 1 -1 setcursor
  1828. } stopped
  1829. {handleerror} if
  1830. grestore
  1831. } _NXSimpleDefProc
  1832. end
  1833. setshared
  1834. currentshared true setshared
  1835. windowPackage1.0 /_winList null _NXCheckAndDef
  1836. nextdict /_winListLock lock _NXCheckAndDef
  1837. windowPackage1.0 begin
  1838. /setWindowLevel /setwindowlevel load def
  1839. /localScreenList {
  1840. currentcontext screenlist
  1841. 0 1 2 index length 1 sub {
  1842. 1 index exch
  1843. 2 copy get
  1844. currentwindowdict dup null ne {
  1845. /localNum get
  1846. }{
  1847. pop -1
  1848. } ifelse
  1849. put
  1850. } for
  1851. } _NXDefProc
  1852. /getWindows {
  1853. //_winListLock {
  1854. dup 2 index {
  1855. countscreenlist
  1856. }{
  1857. countwindowlist
  1858. } ifelse
  1859. 5 add
  1860. /_winList //pkget exec
  1861. /_winList null //pkput exec
  1862. } monitor
  1863. dup null eq {
  1864. true
  1865. }{
  1866. dup length 2 index lt
  1867. } ifelse
  1868. {
  1869. pop currentshared true setshared
  1870. exch array
  1871. exch setshared
  1872. }{
  1873. exch pop
  1874. } ifelse
  1875. dup 4 2 roll exch {
  1876. screenlist
  1877. }{
  1878. windowlist
  1879. } ifelse
  1880. } _NXDefProc
  1881. /returnWindows {
  1882. //_winListLock {
  1883. /_winList pkget
  1884. dup null eq {
  1885. pop
  1886. }{
  1887. 1 index length
  1888. 1 index length
  1889. lt {
  1890. exch
  1891. } if pop
  1892. } ifelse
  1893. /_winList exch //pkput exec
  1894. } monitor
  1895. } _NXDefProc
  1896. end
  1897. setshared
  1898. currentshared true setshared
  1899. 0 =string framebuffer pop
  1900. 8 2 roll 6 {pop} repeat exch
  1901. 64 idiv 1 sub 64 mul
  1902. windowPackage1.0 /_zeroScreenLimit
  1903. 2 index _NXCheckAndDef
  1904. 64 idiv
  1905. exch 64 idiv mul dup
  1906. string windowPackage1.0 exch
  1907. /_miniMap exch _NXCheckAndDef
  1908. string windowPackage1.0 exch
  1909. /_zeroMiniMap exch _NXCheckAndDef
  1910. windowPackage1.0 begin
  1911. /_isIcon {
  1912. mark exch
  1913. {
  1914. currentwindowdict /icon get 1 eq
  1915. exch pop
  1916. } stopped {
  1917. cleartomark false
  1918. } if
  1919. } _NXDefProc
  1920. /calcIconPosition {
  1921. /contextDataLock pkget {
  1922. //_miniMap 0 //_zeroMiniMap putinterval
  1923. false 0 /getWindows winexec {
  1924. dup //_isIcon exec {
  1925. dup currentwindowbounds pop pop
  1926. 1 index -32 ge
  1927. 2 index 64 add //_zeroScreenLimit le and {
  1928. 2 {
  1929. 64 div round 64 mul exch
  1930. } repeat
  1931. 2 {
  1932. 1 index 64 div
  1933. } repeat
  1934. //_zeroScreenLimit 64 idiv
  1935. mul add cvi
  1936. dup //_miniMap length lt
  1937. 1 index 0 ge and {
  1938. //_miniMap exch 1 put
  1939. }{
  1940. pop
  1941. } ifelse
  1942. pop pop pop
  1943. }{
  1944. pop pop pop
  1945. } ifelse
  1946. }{
  1947. pop
  1948. } ifelse
  1949. } forall
  1950. /returnWindows winexec
  1951. 0 0 1 //_miniMap length 1 sub {
  1952. //_miniMap exch get 0 eq {
  1953. exit
  1954. }{
  1955. 1 add
  1956. } ifelse
  1957. } for
  1958. } monitor
  1959. } _NXDefProc
  1960. end
  1961. setshared
  1962.