home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEPLOY / USER.Z / windowPackage.ps < prev    next >
Text File  |  1996-09-09  |  38KB  |  1,963 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. /Courier findfont setfont
  582. 0 0 0 0 Nonretained window windowdeviceround
  583. gstate
  584. grestore
  585. nextdict /_NXNullGState 3 -1 roll put
  586. setshared
  587. } if
  588. _NXNullGState setgstate
  589. } _NXDefProc
  590. /Window {
  591. {
  592. window
  593. dup
  594. currentshared true setshared //WindowDictSize dict exch setshared
  595. dup 3 -1 roll setwindowdict
  596. begin
  597. /num exch def
  598. /level 0 def
  599. /icon null def
  600. /otherWindows null def
  601. /localNum null def
  602. /rightMargin 0 def
  603. /leftMargin 0 def
  604. /topMargin 0 def
  605. /title null def
  606. /clientEventMask //defaultClientMask def
  607. /hideOnDeact false def
  608. /kitVisible false def
  609. /otherOwner null def
  610. /avoidsActivation false def
  611. //defaultClientMask num /setEventMask winexec
  612. /eventHandlers pkget num seteventprocedures
  613. } stopped {handleerror} if
  614. num
  615. end
  616. } _NXDefProc
  617. /moveWindow {
  618. movewindow
  619. } _NXDefProc
  620. /placeWindow {
  621. gsave
  622. 5 index setgstate
  623. placewindow
  624. initmatrix initclip
  625. currentgstate pop
  626. grestore
  627. } _NXDefProc
  628. /currentWindowBounds
  629. /currentwindowbounds load
  630. def
  631. /setTitle {
  632. currentwindowdict begin
  633. dup length
  634. currentshared true setshared exch string exch setshared
  635. copy
  636. /title exch def
  637. end
  638. } _NXDefProc
  639. /currentTitle {
  640. currentwindowdict /title get
  641. } _NXDefProc
  642. /setPid {
  643. /contextDataLock pkget {
  644. //CDPid exch /setContextData winexec
  645. } monitor
  646. } _NXDefProc
  647. /setKitVersion {
  648. /contextDataLock pkget {
  649. currentcontext exch //CDKitVersion exch /setContextData winexec
  650. } monitor
  651. } _NXDefProc
  652. /setOtherOwner {
  653. dup currentwindowdict /otherOwner currentcontext put
  654. /contextDataLock pkget {
  655. currentcontext exch
  656. //CDToken exch /setContextData winexec
  657. } monitor
  658. } _NXDefProc
  659. /setWSOtherOwner {
  660. currentwindowdict /otherOwner -1 put
  661. } _NXDefProc
  662. end
  663. setshared
  664. currentshared true setshared
  665. windowPackage1.0 begin
  666. /printCallStack {
  667. /userdict load /_NXCallStack known {
  668. (Call Stack:\n) print
  669. _NXCallStack _NXCallStackTop
  670. 1 sub -1 0 {
  671. 1 index exch
  672. get
  673. ( ) print =
  674. } for
  675. pop flush
  676. } if
  677. } bind executeonly def
  678. /newhandleerror {
  679. $error begin
  680. currentwriteblock mark false setwriteblock
  681. {
  682. newerror {
  683. /newerror false def
  684. (%%[ Error: ) print
  685. errorname
  686. {
  687. dup type /stringtype ne {
  688. =string cvs
  689. } if
  690. print
  691. } exec
  692. (; OffendingCommand: ) print
  693. /command load
  694. {
  695. dup type /stringtype ne {
  696. { =string cvs } stopped {
  697. pop pop (<long object>)
  698. } if
  699. } if
  700. print
  701. } exec
  702. (; Context: ) print
  703. currentcontext systemdict /= get exec
  704. (OpStack:) print
  705. ostack length 0 gt {
  706. (\n) print
  707. } if
  708. ostack
  709. aload length
  710. {
  711. ( ) print systemdict /== get exec
  712. } repeat
  713. //printCallStack exec
  714. /_NXCallStackTop 0 store
  715. (]%%\n) print
  716. flush
  717. } if
  718. } stopped pop
  719. cleartomark setwriteblock
  720. end
  721. } bind executeonly def
  722. _NXDebug {
  723. /debugmsg {
  724. currentwindowdict begin
  725. nextdict /debugging get
  726. {
  727. nextdict /errfile known not
  728. {
  729. currentshared true setshared
  730. nextdict /errfile (/tmp/pserr) (w) file put
  731. setshared
  732. } if
  733. errfile exch writestring
  734. errfile flushfile
  735. }{
  736. pop
  737. }
  738. ifelse
  739. end
  740. } _NXDefProc
  741. }if
  742. nextdict begin
  743. /_NXInstallDebugErrorHandler {
  744. $error /recordstacks true put
  745. errordict /handleerror /newhandleerror //pkget exec put
  746. userdict /_NXInstallDebugErrorHandler {} put
  747. } _NXDefProc
  748. _NXDebug {
  749. /_NXTrace {
  750. (--------- ) print
  751. print
  752. ( ---------\n) print
  753. (Context: ) print
  754. currentcontext =
  755. (OpStack:\n) print
  756. 0 1 count 3 sub {
  757. ( ) print index ==
  758. } for
  759. //printCallStack exec
  760. } bind executeonly def
  761. } if
  762. end
  763. end
  764. setshared
  765. currentshared true setshared
  766. windowPackage1.0 /_NXOldMask 0 _NXCheckAndDef
  767. windowPackage1.0 /_WSsentMouseDown false _NXCheckAndDef
  768. windowPackage1.0 /_WSMouseDown 9 array _NXCheckAndDef
  769. windowPackage1.0 /_sentMouseDown true _NXCheckAndDef
  770. windowPackage1.0 /_dragNetWin known not {
  771. 0 0 0 0 Nonretained window
  772. dup windowPackage1.0 /_dragNetWin 4 -1 roll put
  773. dup -1 -1 bitshift exch setwindowlevel
  774. dup 0 exch setowner
  775. Lmousedraggedmask Lmouseupmask or exch seteventmask
  776. } if
  777. windowPackage1.0 /_dragInitX 0.0 _NXCheckAndDef
  778. windowPackage1.0 /_draginitY 0.0 _NXCheckAndDef
  779. windowPackage1.0 /_dragWinXOffset 0.0 _NXCheckAndDef
  780. windowPackage1.0 /_dragWinYOffset 0.0 _NXCheckAndDef
  781. windowPackage1.0 /_dragWinNum 0 _NXCheckAndDef
  782. windowPackage1.0 /_dragWCEnabled true _NXCheckAndDef
  783. windowPackage1.0 /_lmupLock lock _NXCheckAndDef
  784. windowPackage1.0 /_lmdownTime 0 _NXCheckAndDef
  785. windowPackage1.0 /_lmupCount -1 _NXCheckAndDef
  786. windowPackage1.0 /_frontWin -1 _NXCheckAndDef
  787. windowPackage1.0 /_frontWinEventTime -1 -1 bitshift -1 xor _NXCheckAndDef
  788. windowPackage1.0 /_lastOpenFileEventTime 0 _NXCheckAndDef
  789. windowPackage1.0 /_hitAvoidingWindow false _NXCheckAndDef
  790. windowPackage1.0 /_pkgsDoDeferredOrdering false _NXCheckAndDef
  791. windowPackage1.0 /_pkgsDoDeferredAct false _NXCheckAndDef
  792. windowPackage1.0 /_pendingActCount 0 _NXCheckAndDef
  793. windowPackage1.0 begin
  794. /setEventMask {
  795. dup currentwindowdict
  796. /clientEventMask 3 index put exch
  797. //keyMask //Sysdefinedmask //Flagschangedmask //Rmousedownmask or or or
  798. or exch seteventmask
  799. } _NXDefProc
  800. /currentEventMask {
  801. currentwindowdict /clientEventMask get
  802. } _NXDefProc
  803. /_compareTimes {
  804. pop dup 0 eq exch
  805. /_frontWinEventTime pkget ge
  806. or
  807. } _NXDefProc
  808. /_compareTimesAndApps {
  809. /_frontWin pkget currentowner activeApp eq
  810. 1 index currentowner activeApp ne
  811. and {
  812. pop pop false
  813. }{
  814. //_compareTimes exec
  815. } ifelse
  816. } _NXDefProc
  817. /_safeTestAndOrder {
  818. dup currentwindowlevel 0 ne {
  819. Above 0 3 -1 roll
  820. /orderWinsAndPanels winexec pop pop
  821. }{
  822. mark 4 -1 roll
  823. {
  824. 3 index exch
  825. 3 index exch exec not {
  826. Below /_frontWin pkget 3 index
  827. /orderWinsAndPanels winexec
  828. pop pop pop
  829. }{
  830. stop
  831. } ifelse
  832. } stopped {
  833. cleartomark
  834. Above 0 2 index
  835. /orderWinsAndPanels winexec
  836. /_frontWin exch pkput
  837. /_frontWinEventTime exch pkput
  838. } if
  839. } ifelse
  840. } _NXDefProc
  841. /safeOrderFront {
  842. //_compareTimesAndApps 3 1 roll
  843. //_safeTestAndOrder exec
  844. } _NXDefProc
  845. /safeOrderFrontDuringOpenFile {
  846. /_lastOpenFileEventTime pkget exch //safeOrderFront exec
  847. } _NXDefProc
  848. /setLastOpenFileTime {
  849. pop /_lastOpenFileEventTime 0 //pkput exec
  850. } _NXDefProc
  851. /_sendWinMoved {
  852. //Kitdefined 4 1 roll
  853. 0 0 3 -1 roll
  854. //Winmoved 0 0
  855. 3 index currentwindowdict begin
  856. /checkAndTransmit winexec
  857. end
  858. } _NXDefProc
  859. /_frontWithClick {
  860. Above 0 2 index orderwindow
  861. dup currentwindowlevel 0 eq {
  862. /_frontWin exch //pkput exec
  863. /_frontWinEventTime exch //pkput exec
  864. }{
  865. pop pop
  866. } ifelse
  867. } _NXDefProc
  868. /_safeFrontWithClick {
  869. //_compareTimes 3 1 roll
  870. //_safeTestAndOrder exec
  871. } _NXDefProc
  872. /_pkgsDeferredOrdering {
  873. mark 3 1 roll
  874. /_pkgsDoDeferredOrdering pkget {
  875. {
  876. exch 1 index
  877. //_safeFrontWithClick exec
  878. /_pkgsDoDeferredAct pkget {
  879. /_pendingActCount pkget exch
  880. /pseudoActivateWindow winexec
  881. } if
  882. } stopped
  883. } if
  884. cleartomark
  885. /_pkgsDoDeferredOrdering false pkput
  886. /_pkgsDoDeferredAct false pkput
  887. } _NXDefProc
  888. /_doKitDeferredOrdering {
  889. mark 7 1 roll
  890. 3 -1 roll
  891. /_lmupCount pkget gt {
  892. /_pkgsDoDeferredOrdering false pkput
  893. /_pkgsDoDeferredAct false pkput
  894. } if
  895. {
  896. 5 -1 roll {
  897. exch 1 index
  898. //_safeFrontWithClick exec
  899. }{
  900. exch pop
  901. } ifelse
  902. 3 -1 roll {
  903. /pseudoActivateWindow winexec
  904. } if
  905. } stopped pop
  906. cleartomark
  907. } _NXDefProc
  908. /kitDeferredOrdering {
  909. //_lmupLock {
  910. 2 index /_lmupCount pkget gt
  911. 7 index or
  912. 8 -1 roll
  913. 7 -1 roll
  914. 5 index /_lmupCount pkget gt
  915. or or
  916. 7 -1 roll and
  917. 6 2 roll
  918. //_doKitDeferredOrdering exec
  919. } monitor
  920. } _NXDefProc
  921. /blockWindowOrdering {
  922. //_lmupLock {
  923. /_lmupCount pkget gt {
  924. /_pkgsDoDeferredOrdering false pkput
  925. /_pkgsDoDeferredAct false pkput
  926. true
  927. }{
  928. false
  929. } ifelse
  930. } monitor
  931. } _NXDefProc
  932. /_prepareToDrag {
  933. //Above 0 //_dragNetWin orderwindow
  934. false setflushexposures
  935. //Lmousedragged //Firstwindow sethowpost
  936. //Lmouseup //Firstwindow sethowpost
  937. dup /_dragWinNum exch //pkput exec
  938. currentwindowbounds pop pop
  939. /_dragInitY exch //pkput exec
  940. /_dragInitX exch //pkput exec
  941. /_dragWinYOffset exch //pkput exec
  942. /_dragWinXOffset exch //pkput exec
  943. /_dragWCEnabled 0 currentwaitcursorenabled //pkput exec
  944. false 0 setwaitcursorenabled
  945. } _NXDefProc
  946. /doDragWindow {
  947. //_lmupLock {
  948. exch /_lmupCount pkget gt {
  949. //_prepareToDrag exec
  950. }{
  951. dup currentwindowbounds pop pop
  952. 3 -1 roll //_sendWinMoved exec
  953. pop pop
  954. } ifelse
  955. } monitor
  956. } _NXDefProc
  957. /_reapContext {
  958. mark exch
  959. dup //CDToken /currentContextData winexec
  960. exch /freeContextData winexec
  961. dup null ne {
  962. {
  963. currentwindowdict
  964. /otherOwner null put
  965. } stopped
  966. } if
  967. cleartomark
  968. } _NXDefProc
  969. /_doPostEvent {
  970. nextdict /_journalRecording get {
  971. 7 -1 roll Journalflagmask or 7 1 roll
  972. } if
  973. stopped {
  974. 10 {pop} repeat
  975. false
  976. }{
  977. not {
  978. (event not posted\n) print
  979. (Frog) 1 playsound
  980. } if
  981. true
  982. } ifelse
  983. }
  984. _NXDebug {
  985. dup length 1 add array cvx
  986. dup 1
  987. 4 -1 roll
  988. putinterval
  989. dup 0 /_NXInstallDebugErrorHandler cvx put
  990. } if
  991. _NXDefProc
  992. true {
  993. /postByContext {
  994. 11 1 roll
  995. dup 0 eq {
  996. 10 {pop} repeat
  997. {
  998. /beep winexec
  999. } if
  1000. }{
  1001. dup 12 1 roll
  1002. /posteventbycontext cvx
  1003. //_doPostEvent exec {
  1004. pop pop
  1005. }{
  1006. {
  1007. /beep winexec
  1008. } if
  1009. //_reapContext exec
  1010. } ifelse
  1011. } ifelse
  1012. } _NXDefProc
  1013. }{
  1014. /postByContext {
  1015. 11 1 roll
  1016. dup 0 eq {
  1017. 10 {pop} repeat
  1018. {
  1019. /beep winexec
  1020. } if
  1021. }{
  1022. dup 12 1 roll
  1023. 5 -1 roll pop 4 1 roll
  1024. Bypscontext
  1025. //_doPostEvent exec not {
  1026. {
  1027. /beep winexec
  1028. } if
  1029. //_reapContext exec
  1030. }{
  1031. pop pop
  1032. } ifelse
  1033. } ifelse
  1034. } _NXDefProc
  1035. } ifelse
  1036. /checkAndTransmit {
  1037. 8 index 1 exch bitshift clientEventMask and 0 ne
  1038. {
  1039. /transmitEvent winexec
  1040. }{
  1041. 9 {pop} repeat
  1042. }
  1043. ifelse
  1044. } _NXDefProc
  1045. /_postToNilWindow {
  1046. 8 index
  1047. 8 index
  1048. 6 index currentwindowbounds pop pop
  1049. 3 -1 roll add
  1050. 3 1 roll add
  1051. 11 -1 roll pop 10 1 roll
  1052. 9 -1 roll pop 8 1 roll
  1053. 5 -1 roll pop 0 5 1 roll
  1054. activeApp exch /postByContext winexec
  1055. } _NXDefProc
  1056. /_handleCommand {
  1057. mark 10 1 roll
  1058. 1 index -16 bitshift 255 and
  1059. 2 index 65535 and
  1060. dup 46 eq
  1061. 2 index 0 eq and
  1062. 1 index 173 eq
  1063. 2 index 175 eq or
  1064. 4 -1 roll 1 eq and
  1065. 7 index //Numericpadmask and 0 ne and
  1066. or {
  1067. 3 index 65535 and 0 eq {
  1068. dup 173 eq {
  1069. true 0 /getWindows winexec
  1070. mark exch {
  1071. mark exch
  1072. dup currentwindowlevel 0 eq {
  1073. dup currentwindowdict
  1074. dup null ne {
  1075. /icon get 1 ne {
  1076. Above exch 0 exch orderwindow
  1077. cleartomark
  1078. exit
  1079. } if
  1080. } if
  1081. } if
  1082. cleartomark
  1083. } /revForall winexec
  1084. cleartomark
  1085. /returnWindows winexec
  1086. }{
  1087. dup 175 eq {
  1088. true 0 /getWindows winexec
  1089. mark exch {
  1090. dup currentwindowlevel 0 eq {
  1091. dup currentwindowdict
  1092. dup null ne {
  1093. /icon get 1 ne {
  1094. Below exch 0 exch
  1095. systemdict /orderwindow get exec
  1096. exit
  1097. } if
  1098. } if
  1099. } if
  1100. } forall
  1101. cleartomark
  1102. /returnWindows winexec
  1103. }{
  1104. pop
  1105. activeApp true /postByContext winexec
  1106. activeApp //CDPid /currentContextData winexec
  1107. activeApp //CDKitVersion /currentContextData winexec
  1108. 4 lt 1 index 0 ne and
  1109. {
  1110. 2 unixsignal
  1111. }{
  1112. pop
  1113. } ifelse
  1114. } ifelse
  1115. } ifelse
  1116. }{
  1117. pop
  1118. } ifelse
  1119. }{
  1120. pop
  1121. activeApp true /postByContext winexec
  1122. } ifelse
  1123. cleartomark
  1124. } _NXDefProc
  1125. /_ptInRect {
  1126. false mark 8 2 roll
  1127. 6 -1 roll 5 -1 roll sub
  1128. 5 -2 roll sub
  1129. dup 0 ge {
  1130. exch dup 0 ge {
  1131. 4 -1 roll lt {
  1132. gt {
  1133. exch pop true exch
  1134. } if
  1135. } if
  1136. } if
  1137. } if
  1138. cleartomark
  1139. } _NXDefProc
  1140. /_testTitleBar {
  1141. currentwindowbounds 4 2 roll pop pop
  1142. topMargin sub 3 -1 roll exch sub 1 sub exch
  1143. 1 index 0 ge {
  1144. topMargin //wbutSize sub 2 div
  1145. 3 index leftMargin lt {
  1146. exch pop
  1147. leftMargin //wbutSize sub
  1148. exch
  1149. //wbutSize //wbutSize
  1150. //_ptInRect exec
  1151. }{
  1152. 1 index rightMargin sub 4 index le {
  1153. exch rightMargin sub
  1154. exch
  1155. //wbutSize //wbutSize
  1156. //_ptInRect exec
  1157. }{
  1158. pop pop pop pop false
  1159. } ifelse
  1160. } ifelse
  1161. true
  1162. }{
  1163. pop pop pop false false
  1164. } ifelse
  1165. } _NXDefProc
  1166. /transmitEvent {
  1167. 3 index 0 ne {
  1168. 3 index currentwindowdict
  1169. /localNum get 3 //stackSwap exec
  1170. currentowner true
  1171. /postByContext winexec
  1172. }{
  1173. 9 {pop} repeat
  1174. /beep winexec
  1175. (transmitEvent can't post to a nil window\n) print
  1176. } ifelse
  1177. } _NXDefProc
  1178. /_lmdownInTitle {
  1179. dup 3 index 1 gt or {
  1180. not icon 1 eq and 2 index 2 eq and {
  1181. 3 index currentowner activeApp ne {
  1182. num currentowner //CDKitVersion
  1183. /currentContextData winexec
  1184. 2 ge {
  1185. num /activateByWindow winexec
  1186. }{
  1187. num currentowner /activateContext winexec
  1188. } ifelse
  1189. } if
  1190. } if
  1191. /transmitEvent winexec
  1192. }{
  1193. pop
  1194. 4 index //buckyBitMask and //Commandmask eq {
  1195. num currentwindowlevel 0 eq {
  1196. Below 0 num
  1197. systemdict /orderwindow get exec
  1198. } if
  1199. 9 {pop} repeat
  1200. /_sentMouseDown false //pkput exec
  1201. }{
  1202. 5 index num //_frontWithClick exec
  1203. 7 index 7 index 6 index
  1204. 12 3 roll
  1205. 4 index //buckyBitMask and
  1206. //Alternatemask eq
  1207. icon 1 eq or {
  1208. 9 {pop} repeat
  1209. /_sentMouseDown false //pkput exec
  1210. }{
  1211. 3 index currentowner activeApp ne {
  1212. avoidsActivation {
  1213. /_hitAvoidingWindow true //pkput exec
  1214. }{
  1215. num /activateByWindow winexec
  1216. } ifelse
  1217. } if
  1218. /transmitEvent winexec
  1219. } ifelse
  1220. Journalflagmask and 0 eq {
  1221. num //_prepareToDrag exec
  1222. }{
  1223. pop pop
  1224. } ifelse
  1225. } ifelse
  1226. } ifelse
  1227. } _NXDefProc
  1228. /_lmdownInBody {
  1229. pop
  1230. num currentowner //CDKitVersion
  1231. /currentContextData winexec
  1232. 2 ge {
  1233. 1 index 1 eq {
  1234. /_pkgsDoDeferredOrdering true pkput
  1235. num currentowner activeApp ne {
  1236. avoidsActivation not {
  1237. /_pkgsDoDeferredAct true pkput
  1238. } if
  1239. num currentowner
  1240. /sendDeferredAct winexec
  1241. /_pendingActCount exch pkput
  1242. } if
  1243. } if
  1244. }{
  1245. 5 index num //_frontWithClick exec
  1246. num currentowner activeApp ne {
  1247. num /activateByWindow winexec
  1248. } if
  1249. } ifelse
  1250. /transmitEvent winexec
  1251. } _NXDefProc
  1252. /_lmdownWithHelp {
  1253. pop pop
  1254. 1 index 1 eq
  1255. num currentowner activeApp ne and {
  1256. num currentowner /activateContext winexec
  1257. } if
  1258. /transmitEvent winexec
  1259. } _NXDefProc
  1260. /lmdownEvProc {
  1261. /_lmdownTime 6 index //pkput exec
  1262. /_sentMouseDown true //pkput exec
  1263. /_hitAvoidingWindow false //pkput exec
  1264. /_pkgsDoDeferredOrdering false //pkput exec
  1265. /_pkgsDoDeferredAct false //pkput exec
  1266. 3 index currentwindowdict begin
  1267. {
  1268. 7 index 7 index 5 index //_testTitleBar exec
  1269. 6 index //buckyBitMask and
  1270. dup //Helpmask eq
  1271. exch //Controlmask //Alternatemask or eq or {
  1272. //_lmdownWithHelp exec
  1273. }{
  1274. {
  1275. //_lmdownInTitle exec
  1276. }{
  1277. //_lmdownInBody exec
  1278. } ifelse
  1279. } ifelse
  1280. } stopped {
  1281. end handleerror
  1282. }{
  1283. end
  1284. } ifelse
  1285. } _NXDefProc
  1286. /_transmitLmup {
  1287. 1 index 4 index 11 2 roll
  1288. /transmitEvent winexec
  1289. /_hitAvoidingWindow pkget
  1290. 1 index currentowner activeApp ne
  1291. 4 -1 roll 1 eq and and {
  1292. currentowner /activateContext winexec
  1293. }{
  1294. pop
  1295. } ifelse
  1296. } _NXDefProc
  1297. /lmupEvProc {
  1298. //_lmupLock {
  1299. /_lmupCount 3 index //pkput exec
  1300. /_dragWinNum pkget 0 eq {
  1301. /_lmdownTime //pkget exec
  1302. 4 index //_pkgsDeferredOrdering exec
  1303. /_sentMouseDown pkget {
  1304. //_transmitLmup exec
  1305. }{
  1306. 9 {pop} repeat
  1307. } ifelse
  1308. }{
  1309. /lmupWinDragEvProc winexec
  1310. } ifelse
  1311. } monitor
  1312. } _NXDefProc
  1313. /_postRightEvent {
  1314. 4 index currentowner activeApp eq
  1315. {
  1316. pop /transmitEvent winexec
  1317. }{
  1318. //_postToNilWindow exec
  1319. } ifelse
  1320. } _NXDefProc
  1321. /rmdownEvProc {
  1322. 3 index currenteventmask
  1323. /_NXOldMask 1 index //pkput exec
  1324. //MenuEvent or 4 index seteventmask
  1325. true //_postRightEvent exec
  1326. } _NXDefProc
  1327. /rmupEvProc {
  1328. /_NXOldMask pkget 4 index seteventmask
  1329. false //_postRightEvent exec
  1330. } _NXDefProc
  1331. /rmdragEvProc {
  1332. false //_postRightEvent exec
  1333. } _NXDefProc
  1334. /mEnterEvProc {
  1335. dup -1 eq {
  1336. //Cursorrect 8 //stackSwap exec pop
  1337. Mouseentered 4 //stackSwap exec pop
  1338. } if
  1339. /transmitEvent winexec
  1340. } _NXDefProc
  1341. /mExitEvProc {
  1342. dup -1 eq
  1343. {
  1344. //Cursorrect 8 //stackSwap exec pop
  1345. Mouseexited 4 //stackSwap exec pop
  1346. } if
  1347. /transmitEvent winexec
  1348. } _NXDefProc
  1349. /keyDownEvProc {
  1350. 4 index //Commandmask and 0 ne
  1351. {
  1352. 2 index 65535 and 0 eq
  1353. 10 1 roll
  1354. /_handleCommand winexec
  1355. activeApp 0 eq
  1356. and
  1357. {
  1358. /beep winexec
  1359. } if
  1360. }{
  1361. activeApp 0 eq {
  1362. /beep winexec
  1363. }{
  1364. activeApp true /postByContext winexec
  1365. } ifelse
  1366. } ifelse
  1367. } _NXDefProc
  1368. /flagsChEvProc {
  1369. nextdict /currentEventFlags 6 index put
  1370. nextdict /_NXCurrentEventFlags 6 index put
  1371. activeApp false /postByContext winexec
  1372. } _NXDefProc
  1373. /keyUpEvProc
  1374. /flagsChEvProc load _NXDefProc
  1375. /sysDefEvProc {
  1376. 2 index 1 eq {
  1377. 4 -1 roll pop 0 4 1 roll
  1378. //Broadcast /postevent cvx //_doPostEvent exec not {
  1379. handleerror
  1380. } if
  1381. }{
  1382. 2 index 0 eq {
  1383. 1 index activeApp eq {
  1384. appLock
  1385. {
  1386. nextdict /activeApp 0 put
  1387. /setArrowCursor winexec
  1388. } monitor
  1389. } if
  1390. 5 index 2 index /activateNextApp winexec
  1391. 1 index //_reapContext exec
  1392. } if
  1393. 9 {pop} repeat
  1394. } ifelse
  1395. } _NXDefProc
  1396. /lmdownWSEvProc {
  1397. 3 index currentwindowdict /otherOwner get
  1398. dup null eq {
  1399. activeApp ne 2 index 2 eq and {
  1400. /deactivateCurrContext winexec
  1401. 4 index //buckyBitMask and
  1402. //Commandmask eq {
  1403. 0 /hideOtherApps winexec
  1404. } if
  1405. } if
  1406. /_WSsentMouseDown true //pkput exec
  1407. /transmitEvent winexec
  1408. }{
  1409. dup -1 eq {
  1410. pop
  1411. /_WSsentMouseDown true //pkput exec
  1412. /transmitEvent winexec
  1413. }{
  1414. 2 index 1 eq {
  1415. pop Above 0 5 index orderwindow
  1416. /_WSMouseDown pkget astore
  1417. }{
  1418. 2 index 2 eq {
  1419. //Kitdefined 0 0 0 0 0
  1420. //AppUnhide 0 0
  1421. 9 index
  1422. /posteventbycontext cvx
  1423. //_doPostEvent exec {
  1424. 5 index //buckyBitMask and
  1425. //Commandmask eq {
  1426. /hideOtherApps winexec
  1427. }{
  1428. /activateContext winexec
  1429. } ifelse
  1430. 9 {pop} repeat
  1431. }{
  1432. //_reapContext exec
  1433. /_WSsentMouseDown true //pkput exec
  1434. /transmitEvent winexec
  1435. } ifelse
  1436. }{
  1437. 10 {pop} repeat
  1438. } ifelse
  1439. } ifelse
  1440. } ifelse
  1441. } ifelse
  1442. } _NXDefProc
  1443. /lmdragWSEvProc {
  1444. 3 index currentwindowdict /otherOwner get
  1445. null ne {
  1446. /_WSsentMouseDown pkget not {
  1447. /_WSMouseDown pkget
  1448. dup aload pop
  1449. 15 index 6 index sub 18 gt
  1450. 18 index 9 index sub abs 5 gt
  1451. 18 index 9 index sub abs 5 gt
  1452. or or {
  1453. /transmitEvent winexec pop
  1454. /_WSsentMouseDown true //pkput exec
  1455. /transmitEvent winexec
  1456. }{
  1457. 19 {pop} repeat
  1458. } ifelse
  1459. }{
  1460. /transmitEvent winexec
  1461. } ifelse
  1462. }{
  1463. /transmitEvent winexec
  1464. } ifelse
  1465. } _NXDefProc
  1466. /lmupWSEvProc {
  1467. /_WSsentMouseDown pkget
  1468. {
  1469. /transmitEvent winexec
  1470. }{
  1471. 9 {pop} repeat
  1472. } ifelse
  1473. /_WSsentMouseDown false //pkput exec
  1474. } _NXDefProc
  1475. /gridWindow {
  1476. dup currentwindowdict /icon get 1 eq
  1477. nextdict /_NXSnapIconsToGrid get
  1478. 4 -1 roll //Alternatemask and 0 eq
  1479. and and {
  1480. 0 currentwindowbounds
  1481. 4 index currentwindowbounds pop pop
  1482. 2 {
  1483. 64 div round 64 mul exch
  1484. } repeat
  1485. 2 {
  1486. dup 3 index 6 index add 1 sub gt {
  1487. 64 sub
  1488. } if
  1489. dup 5 index lt {
  1490. 64 add
  1491. } if
  1492. 6 1 roll
  1493. } repeat
  1494. pop pop pop pop
  1495. 3 -1 roll movewindow
  1496. }{
  1497. pop
  1498. } ifelse
  1499. } _NXDefProc
  1500. /lmdragWinDragEvProc {
  1501. 6 {pop} repeat
  1502. /_dragWinYOffset pkget sub exch
  1503. /_dragWinXOffset pkget sub exch
  1504. /_dragWinNum pkget
  1505. nextdict /_journalRecording get {
  1506. 3 1 roll
  1507. 2 index currentwindowbounds pop pop
  1508. 2 index
  1509. exch
  1510. sub
  1511. exch
  1512. 3 index
  1513. exch
  1514. sub
  1515. exch
  1516. Journalevent 3 1 roll 0 0 7 index //Windragged 0 0
  1517. /transmitEvent winexec
  1518. 3 -1 roll
  1519. } if
  1520. dup currentwindowdict /otherWindows get
  1521. dup null eq {
  1522. pop movewindow pop
  1523. }{
  1524. 1 index currentwindowbounds pop pop
  1525. 4 index exch sub exch
  1526. 5 index exch sub exch
  1527. 6 3 roll movewindow
  1528. 3 -1 roll
  1529. dup length 1 sub 1 exch getinterval {
  1530. mark exch {
  1531. dup currentwindowbounds pop pop
  1532. 4 index add exch
  1533. 5 index add exch
  1534. 3 -1 roll movewindow
  1535. } stopped pop
  1536. cleartomark
  1537. } forall pop pop pop
  1538. } ifelse
  1539. } _NXDefProc
  1540. /lmupWinDragEvProc {
  1541. 9 copy
  1542. //lmdragWinDragEvProc exec
  1543. //Out 0 //_dragNetWin orderwindow
  1544. true setflushexposures
  1545. //Lmousedragged //Lastleft sethowpost
  1546. //Lmouseup //Lastleft sethowpost
  1547. 4 index 10 1 roll
  1548. /_sentMouseDown pkget {
  1549. /_dragWinNum pkget 3 //stackSwap exec pop
  1550. /_dragWinYOffset pkget 6 //stackSwap exec pop
  1551. /_dragWinXOffset pkget 7 //stackSwap exec pop
  1552. //_transmitLmup exec
  1553. }{
  1554. 9 {pop} repeat
  1555. } ifelse
  1556. /_dragWinNum pkget exch 1 index
  1557. //gridWindow exec
  1558. dup currentwindowbounds pop pop 2 copy
  1559. /_dragInitY pkget ne exch
  1560. /_dragInitX pkget ne exch
  1561. or {
  1562. 3 -1 roll //_sendWinMoved exec
  1563. }{
  1564. pop pop pop
  1565. } ifelse
  1566. /_dragWCEnabled //pkget exec 0 setwaitcursorenabled
  1567. /_dragWinNum 0 //pkput exec
  1568. } _NXDefProc
  1569. /eventsPrepareToRestoreNextdict {
  1570. /_dragNetWin pkget termwindow
  1571. } _NXDefProc
  1572. windowPackage1.0 /eventHandlers [
  1573. /transmitEvent load
  1574. /lmdownEvProc load
  1575. /lmupEvProc load
  1576. /rmdownEvProc load
  1577. /rmupEvProc load
  1578. /transmitEvent load
  1579. /transmitEvent load
  1580. /rmdragEvProc load
  1581. /mEnterEvProc load
  1582. /mExitEvProc load
  1583. /keyDownEvProc load
  1584. /keyUpEvProc load
  1585. /flagsChEvProc load
  1586. /transmitEvent load
  1587. /sysDefEvProc load
  1588. /transmitEvent load
  1589. ] _NXCheckAndDef
  1590. windowPackage1.0 /deskWinHandler [
  1591. null
  1592. null
  1593. null
  1594. /rmdownEvProc load
  1595. /rmupEvProc load
  1596. null
  1597. null
  1598. /rmdragEvProc load
  1599. null
  1600. null
  1601. null
  1602. null
  1603. null
  1604. null
  1605. /sysDefEvProc load
  1606. null
  1607. ] _NXCheckAndDef
  1608. windowPackage1.0 /workspaceHandler [
  1609. null
  1610. /lmdownWSEvProc load
  1611. /lmupWSEvProc load
  1612. /rmdownEvProc load
  1613. /rmupEvProc load
  1614. null
  1615. /lmdragWSEvProc load
  1616. /rmdragEvProc load
  1617. null
  1618. null
  1619. /keyDownEvProc load
  1620. /keyUpEvProc load
  1621. /flagsChEvProc load
  1622. null
  1623. /sysDefEvProc load
  1624. null
  1625. ] _NXCheckAndDef
  1626. windowPackage1.0 /_dragWindowHandler [
  1627. null
  1628. null
  1629. /lmupWinDragEvProc load
  1630. null
  1631. null
  1632. null
  1633. /lmdragWinDragEvProc load
  1634. null
  1635. null
  1636. null
  1637. null
  1638. null
  1639. null
  1640. null
  1641. /sysDefEvProc load
  1642. null
  1643. ] _NXCheckAndDef
  1644. windowPackage1.0 /specialTileHandler [
  1645. null
  1646. /transmitEvent load
  1647. /transmitEvent load
  1648. /rmdownEvProc load
  1649. /rmupEvProc load
  1650. null
  1651. /transmitEvent load
  1652. /rmdragEvProc load
  1653. null
  1654. null
  1655. /keyDownEvProc load
  1656. /keyUpEvProc load
  1657. /flagsChEvProc load
  1658. null
  1659. /sysDefEvProc load
  1660. null
  1661. ] _NXCheckAndDef
  1662. //Rmousedownmask //Sysdefinedmask or deskWin seteventmask
  1663. deskWinHandler deskWin seteventprocedures
  1664. _dragWindowHandler _dragNetWin seteventprocedures
  1665. end
  1666. setshared
  1667. currentshared true setshared
  1668. nextdict /_windowCoverLock lock _NXCheckAndDef
  1669. nextdict /_coverWin 0 _NXCheckAndDef
  1670. nextdict /_edgeWindows 0 _NXCheckAndDef
  1671. windowPackage1.0 begin
  1672. /ensureEdgeWindows {
  1673. _windowCoverLock
  1674. {
  1675. _edgeWindows 0 eq
  1676. {
  1677. currentshared true setshared
  1678. gsave
  1679. 0.1 setgray
  1680. 1 1 4 {
  1681. pop
  1682. 0 0 0 0 Nonretained window
  1683. dup currentcontext exch setowner
  1684. dup 25 exch setwindowlevel
  1685. dup windowdeviceround
  1686. setexposurecolor
  1687. } for
  1688. 4 array astore
  1689. grestore
  1690. exch setshared
  1691. }{
  1692. _edgeWindows
  1693. dup {currentcontext exch setowner} forall
  1694. nextdict /_edgeWindows 0 put
  1695. } ifelse
  1696. /userdict load /_NXedgeWindows 3 -1 roll put
  1697. }
  1698. monitor
  1699. } _NXDefProc
  1700. /placeEdgeWindows {
  1701. aload pop /userdict load /_NXedgeWindows get {placewindow} forall
  1702. } _NXDefProc
  1703. /showEdgeWindows {
  1704. /userdict load /_NXedgeWindows get {Above 0 3 -1 roll orderwindow} forall
  1705. } _NXDefProc
  1706. /hideEdgeWindows {
  1707. /userdict load /_NXedgeWindows get {Out 0 3 -1 roll orderwindow} forall
  1708. _windowCoverLock
  1709. {
  1710. /userdict load /_NXedgeWindows get
  1711. _edgeWindows 0 eq
  1712. {
  1713. dup {0 exch setowner} forall
  1714. nextdict /_edgeWindows 3 -1 roll put
  1715. }{
  1716. {termwindow} forall
  1717. } ifelse
  1718. /userdict load /_NXedgeWindows 0 put
  1719. }
  1720. monitor
  1721. } _NXDefProc
  1722. /_checkOutCoverWin {
  1723. _windowCoverLock
  1724. {
  1725. _coverWin 0 eq
  1726. {
  1727. currentshared true setshared
  1728. 0 0 0 0 Nonretained window
  1729. dup currentcontext exch setowner
  1730. dup false exch setautofill
  1731. exch setshared
  1732. }{
  1733. _coverWin
  1734. dup currentcontext exch setowner
  1735. nextdict /_coverWin 0 put
  1736. } ifelse
  1737. /userdict load /_NXcoverWindow 3 -1 roll put
  1738. }
  1739. monitor
  1740. } _NXDefProc
  1741. /_checkInCoverWin {
  1742. _windowCoverLock
  1743. {
  1744. /userdict load /_NXcoverWindow get
  1745. _coverWin 0 eq
  1746. {
  1747. dup 0 exch setowner
  1748. nextdict /_coverWin 3 -1 roll put
  1749. }{
  1750. termwindow
  1751. } ifelse
  1752. /userdict load /_NXcoverWindow 0 put
  1753. }
  1754. monitor
  1755. } _NXDefProc
  1756. /coverWindow {
  1757. mark exch
  1758. //_checkOutCoverWin exec
  1759. /userdict load /_NXcoverWindow get
  1760. {
  1761. 1 index currentwindowlevel
  1762. 1 index setwindowlevel
  1763. 1 index currentwindowbounds
  1764. 4 index placewindow
  1765. Above 2 index 3 -1 roll orderwindow
  1766. Out 0 3 -1 roll orderwindow
  1767. } stopped {
  1768. //_checkInCoverWin exec
  1769. }
  1770. cleartomark
  1771. } _NXDefProc
  1772. /uncoverWindow {
  1773. /userdict load /_NXcoverWindow get
  1774. dup 0 ne {
  1775. appLock {
  1776. 1 index currentwindowdict
  1777. dup /hideOnDeact get not
  1778. exch /kitVisible get
  1779. activeApp currentcontext eq
  1780. and or {
  1781. {
  1782. Above 1 index 4 -1 roll
  1783. orderwindow
  1784. } stopped {
  1785. pop pop pop
  1786. } if
  1787. }{
  1788. exch pop
  1789. } ifelse
  1790. } monitor
  1791. Out 0 3 -1 roll orderwindow
  1792. //_checkInCoverWin exec
  1793. }{
  1794. pop pop
  1795. } ifelse
  1796. } _NXDefProc
  1797. /resizePrepareToRestoreNextdict {
  1798. _NXPackagesInfo /_windowCoverLock nextdict /_windowCoverLock get put
  1799. _NXPackagesInfo /_coverWin nextdict /_coverWin get put
  1800. _NXPackagesInfo /_edgeWindows nextdict /_edgeWindows get put
  1801. } _NXDefProc
  1802. /resizePrepareToReloadPackages {
  1803. nextdict /_windowCoverLock _NXPackagesInfo /_windowCoverLock get put
  1804. nextdict /_coverWin _NXPackagesInfo /_coverWin get put
  1805. nextdict /_edgeWindows _NXPackagesInfo /_edgeWindows get put
  1806. } _NXDefProc
  1807. end
  1808. setshared
  1809. currentshared true setshared
  1810. windowPackage1.0 begin
  1811. /setCursor {
  1812. appLock
  1813. {
  1814. {
  1815. /lastCompletedActivation pkget eq {
  1816. setcursor
  1817. }{
  1818. pop pop pop pop
  1819. } ifelse
  1820. } stopped
  1821. {handleerror} if
  1822. } monitor
  1823. } _NXSimpleDefProc
  1824. /setArrowCursor {
  1825. gsave
  1826. {
  1827. sharedCursors windowdeviceround
  1828. 0 48 1 -1 setcursor
  1829. } stopped
  1830. {handleerror} if
  1831. grestore
  1832. } _NXSimpleDefProc
  1833. end
  1834. setshared
  1835. currentshared true setshared
  1836. windowPackage1.0 /_winList null _NXCheckAndDef
  1837. nextdict /_winListLock lock _NXCheckAndDef
  1838. windowPackage1.0 begin
  1839. /setWindowLevel /setwindowlevel load def
  1840. /localScreenList {
  1841. currentcontext screenlist
  1842. 0 1 2 index length 1 sub {
  1843. 1 index exch
  1844. 2 copy get
  1845. currentwindowdict dup null ne {
  1846. /localNum get
  1847. }{
  1848. pop -1
  1849. } ifelse
  1850. put
  1851. } for
  1852. } _NXDefProc
  1853. /getWindows {
  1854. //_winListLock {
  1855. dup 2 index {
  1856. countscreenlist
  1857. }{
  1858. countwindowlist
  1859. } ifelse
  1860. 5 add
  1861. /_winList //pkget exec
  1862. /_winList null //pkput exec
  1863. } monitor
  1864. dup null eq {
  1865. true
  1866. }{
  1867. dup length 2 index lt
  1868. } ifelse
  1869. {
  1870. pop currentshared true setshared
  1871. exch array
  1872. exch setshared
  1873. }{
  1874. exch pop
  1875. } ifelse
  1876. dup 4 2 roll exch {
  1877. screenlist
  1878. }{
  1879. windowlist
  1880. } ifelse
  1881. } _NXDefProc
  1882. /returnWindows {
  1883. //_winListLock {
  1884. /_winList pkget
  1885. dup null eq {
  1886. pop
  1887. }{
  1888. 1 index length
  1889. 1 index length
  1890. lt {
  1891. exch
  1892. } if pop
  1893. } ifelse
  1894. /_winList exch //pkput exec
  1895. } monitor
  1896. } _NXDefProc
  1897. end
  1898. setshared
  1899. currentshared true setshared
  1900. 0 =string framebuffer pop
  1901. 8 2 roll 6 {pop} repeat exch
  1902. 64 idiv 1 sub 64 mul
  1903. windowPackage1.0 /_zeroScreenLimit
  1904. 2 index _NXCheckAndDef
  1905. 64 idiv
  1906. exch 64 idiv mul dup
  1907. string windowPackage1.0 exch
  1908. /_miniMap exch _NXCheckAndDef
  1909. string windowPackage1.0 exch
  1910. /_zeroMiniMap exch _NXCheckAndDef
  1911. windowPackage1.0 begin
  1912. /_isIcon {
  1913. mark exch
  1914. {
  1915. currentwindowdict /icon get 1 eq
  1916. exch pop
  1917. } stopped {
  1918. cleartomark false
  1919. } if
  1920. } _NXDefProc
  1921. /calcIconPosition {
  1922. /contextDataLock pkget {
  1923. //_miniMap 0 //_zeroMiniMap putinterval
  1924. false 0 /getWindows winexec {
  1925. dup //_isIcon exec {
  1926. dup currentwindowbounds pop pop
  1927. 1 index -32 ge
  1928. 2 index 64 add //_zeroScreenLimit le and {
  1929. 2 {
  1930. 64 div round 64 mul exch
  1931. } repeat
  1932. 2 {
  1933. 1 index 64 div
  1934. } repeat
  1935. //_zeroScreenLimit 64 idiv
  1936. mul add cvi
  1937. dup //_miniMap length lt
  1938. 1 index 0 ge and {
  1939. //_miniMap exch 1 put
  1940. }{
  1941. pop
  1942. } ifelse
  1943. pop pop pop
  1944. }{
  1945. pop pop pop
  1946. } ifelse
  1947. }{
  1948. pop
  1949. } ifelse
  1950. } forall
  1951. /returnWindows winexec
  1952. 0 0 1 //_miniMap length 1 sub {
  1953. //_miniMap exch get 0 eq {
  1954. exit
  1955. }{
  1956. 1 add
  1957. } ifelse
  1958. } for
  1959. } monitor
  1960. } _NXDefProc
  1961. end
  1962. setshared
  1963.