home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume16 / nethck31 / part48 < prev    next >
Encoding:
Internet Message Format  |  1993-01-31  |  58.7 KB

  1. Path: uunet!news.tek.com!master!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v16i056:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Part48/108
  5. Message-ID: <4350@master.CNA.TEK.COM>
  6. Date: 30 Jan 93 01:14:39 GMT
  7. Sender: news@master.CNA.TEK.COM
  8. Lines: 2282
  9. Approved: billr@saab.CNA.TEK.COM
  10. Xref: uunet comp.sources.games:1605
  11.  
  12. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  13. Posting-number: Volume 16, Issue 56
  14. Archive-name: nethack31/Part48
  15. Supersedes: nethack3p9: Volume 10, Issue 46-102
  16. Environment: Amiga, Atari, Mac, MS-DOS, OS2, Unix, VMS, X11
  17.  
  18.  
  19.  
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then unpack
  22. # it by saving it into a file and typing "sh file".  To overwrite existing
  23. # files, type "sh file -c".  You can also feed this as standard input via
  24. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  25. # will see the following message at the end:
  26. #        "End of archive 48 (of 108)."
  27. # Contents:  sys/mac/macwin.c2 sys/vms/Makefile.src
  28. # Wrapped by billr@saab on Wed Jan 27 16:09:05 1993
  29. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  30. if test -f 'sys/mac/macwin.c2' -a "${1}" != "-c" ; then 
  31.   echo shar: Will not clobber existing file \"'sys/mac/macwin.c2'\"
  32. else
  33. echo shar: Extracting \"'sys/mac/macwin.c2'\" \(37726 characters\)
  34. sed "s/^X//" >'sys/mac/macwin.c2' <<'END_OF_FILE'
  35. Xstatic void
  36. XmacClickMenu ( EventRecord * theEvent , WindowPtr theWindow )
  37. X{
  38. X    Point p ;
  39. X    short hiRow = -1 , loRow = -1 ;
  40. X    Rect r ;
  41. X    NhWindow * aWin = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  42. X
  43. X    r = theWindow -> portRect ;
  44. X    if ( aWin -> scrollBar && ( * aWin -> scrollBar ) -> contrlVis ) {
  45. X        short code ;
  46. X        Point p = theEvent -> where ;
  47. X        ControlHandle theBar ;
  48. X
  49. X        r . right -= SBARWIDTH ;
  50. X        GlobalToLocal ( & p ) ;
  51. X        code = FindControl ( p , theWindow , & theBar ) ;
  52. X        if ( code ) {
  53. X            DoScrollBar ( p , code , theBar , aWin , theWindow ) ;
  54. X            return ;
  55. X        }
  56. X        if ( p . h >= r . right )
  57. X            return ;
  58. X    }
  59. X    r . top = r . bottom = 0 ;
  60. X    if ( inSelect != WIN_ERR ) {
  61. X        do {
  62. X            SystemTask ( ) ;
  63. X            GetMouse ( & p ) ;
  64. X            if ( p . h < theWindow -> portRect . left || p . h > theWindow ->
  65. X                portRect . right || p . v < 0 || p . v > theWindow -> portRect .
  66. X                bottom ) {
  67. X                hiRow = -1 ;
  68. X            } else {
  69. X                hiRow = p . v / aWin -> charHeight ;
  70. X                if ( hiRow >= aWin -> lin )
  71. X                    hiRow = -1 ;
  72. X            }
  73. X            if ( hiRow != loRow ) {
  74. X                if ( loRow > -1 && aWin -> itemChars [ loRow + aWin ->
  75. X                    scrollPos ] ) {
  76. X                    r . top = loRow * aWin -> charHeight ;
  77. X                    r . bottom = ( loRow + 1 ) * aWin -> charHeight ;
  78. X                    InvertRect ( & r ) ;
  79. X                }
  80. X                loRow = hiRow ;
  81. X                if ( loRow > -1 && aWin -> itemChars [ loRow + aWin ->
  82. X                    scrollPos ] ) {
  83. X                    r . top = loRow * aWin -> charHeight ;
  84. X                    r . bottom = ( loRow + 1 ) * aWin -> charHeight ;
  85. X                    InvertRect ( & r ) ;
  86. X                }
  87. X            }
  88. X        } while ( StillDown ( ) ) ;
  89. X        if ( loRow > -1 && aWin -> itemChars [ loRow + aWin -> scrollPos ] ) {
  90. X            InvertRect ( & r ) ;
  91. X            addToKeyQueue ( aWin -> itemChars [ loRow + aWin -> scrollPos ] , 1 ) ;
  92. X        }
  93. X    }
  94. X}
  95. X
  96. X
  97. Xstatic void
  98. XmacClickText ( EventRecord * theEvent , WindowPtr theWindow )
  99. X{
  100. X    short hiRow = -1 , loRow = -1 ;
  101. X    Rect r ;
  102. X    NhWindow * aWin = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  103. X
  104. X    r = theWindow -> portRect ;
  105. X    if ( aWin -> scrollBar && ( * aWin -> scrollBar ) -> contrlVis ) {
  106. X        short code ;
  107. X        Point p = theEvent -> where ;
  108. X        ControlHandle theBar ;
  109. X
  110. X        r . right -= SBARWIDTH ;
  111. X        GlobalToLocal ( & p ) ;
  112. X        code = FindControl ( p , theWindow , & theBar ) ;
  113. X        if ( code ) {
  114. X            DoScrollBar ( p , code , theBar , aWin , theWindow ) ;
  115. X            return ;
  116. X        }
  117. X    }
  118. X}
  119. X
  120. X
  121. Xstatic void
  122. XmacUpdateNull ( EventRecord * theEvent , WindowPtr theWindow )
  123. X{
  124. X    if ( ! theEvent || ! theWindow ) {
  125. X        Debugger ( ) ;
  126. X    }
  127. X}
  128. X
  129. X
  130. Xstatic void
  131. Xdraw_growicon_vert_only(WindowPtr wind) {
  132. X    GrafPtr org_port;
  133. X    RgnHandle org_clip = NewRgn();
  134. X    Rect r = wind->portRect;
  135. X    r.left = r.right - SBARWIDTH;
  136. X
  137. X    GetPort(&org_port);
  138. X    SetPort(wind);
  139. X    GetClip(org_clip);
  140. X    ClipRect(&r);
  141. X    DrawGrowIcon(wind);
  142. X    SetClip(org_clip);
  143. X    DisposeRgn(org_clip);
  144. X    SetPort(org_port);
  145. X}
  146. X
  147. X
  148. Xstatic void
  149. XmacUpdateMessage ( EventRecord * theEvent , WindowPtr theWindow )
  150. X{
  151. X    RgnHandle org_clip = NewRgn(), clip = NewRgn();
  152. X    Rect r = theWindow -> portRect ;
  153. X    NhWindow * aWin = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  154. X    int l ;
  155. X
  156. X    if ( ! theEvent ) {
  157. X        Debugger ( ) ;
  158. X    }
  159. X
  160. X    GetClip(org_clip);
  161. X
  162. X    DrawGrowIcon(theWindow);
  163. X
  164. X    l = 0;
  165. X    while (topl_resp[l]) {
  166. X        StringPtr name;
  167. X        unsigned char tmp[2];
  168. X        FontInfo font;
  169. X        Rect frame;
  170. X        topl_resp_rect(l, &frame);
  171. X        switch (topl_resp[l]) {
  172. X            case 'y':
  173. X                name = "\pyes";
  174. X                break;
  175. X            case 'n':
  176. X                name = "\pno";
  177. X                break;
  178. X            case 'N':
  179. X                name = "\pNone";
  180. X                break;
  181. X            case 'a':
  182. X                name = "\pall";
  183. X                break;
  184. X            case 'q':
  185. X                name = "\pquit";
  186. X                break;
  187. X            case CHAR_ANY:
  188. X                name = "\pany key";
  189. X                break;
  190. X            default:
  191. X                tmp[0] = 1;
  192. X                tmp[1] = topl_resp[l];
  193. X                name = &tmp;
  194. X                break;
  195. X        }
  196. X        TextFont(geneva);
  197. X        TextSize(9);
  198. X        GetFontInfo(&font);
  199. X        MoveTo((frame.left + frame.right  - StringWidth(name)) / 2,
  200. X               (frame.top  + frame.bottom + font.ascent-font.descent-font.leading-1) / 2);
  201. X        DrawString(name);
  202. X        PenNormal();
  203. X        if (l == topl_def_idx)
  204. X            PenSize(2, 2);
  205. X        FrameRoundRect(&frame, 4, 4);
  206. X        ++l;
  207. X    }
  208. X
  209. X    r . right -= SBARWIDTH + 2;
  210. X    r . bottom -= SBARHEIGHT + 1;
  211. X    /* Clip to the portrect - scrollbar/growicon *before* adjusting the rect
  212. X        to be larger than the size of the window (!) */
  213. X    RectRgn(clip, &r);
  214. X    if ( r . right < MIN_RIGHT )
  215. X        r . right = MIN_RIGHT ;
  216. X
  217. X    if (in_topl_mode()) {
  218. X        RgnHandle topl_rgn = NewRgn();
  219. X        Rect topl_r = r;
  220. X        for (l = aWin->windowTextLen - 1; --l >= aWin->textBase; )
  221. X            if ((*aWin->windowText)[l] == CHAR_CR)
  222. X                topl_r.top += aWin->charHeight;
  223. X        l = (*top_line)->destRect.right - (*top_line)->destRect.left;
  224. X        (*top_line)->viewRect = topl_r;
  225. X        (*top_line)->destRect = topl_r;
  226. X        if (l != topl_r.right - topl_r.left)
  227. X            TECalText(top_line);
  228. X        TEUpdate(&topl_r, top_line);
  229. X        RectRgn(topl_rgn, &topl_r);
  230. X        DiffRgn(clip, topl_rgn, clip);
  231. X        DisposeRgn(topl_rgn);
  232. X    }
  233. X
  234. X    SectRgn(clip, org_clip, clip);
  235. X    SetClip(clip);
  236. X    DisposeRgn(clip);
  237. X
  238. X    TextFont ( aWin -> fontNum ) ;
  239. X    TextSize ( aWin -> fontSize ) ;
  240. X    HLock ( aWin -> windowText ) ;
  241. X    TextBox ( * ( aWin -> windowText ) + aWin -> textBase , aWin ->
  242. X        windowTextLen - aWin -> textBase , & r , teJustLeft ) ;
  243. X    HUnlock ( aWin -> windowText ) ;
  244. X
  245. X    SetClip(org_clip);
  246. X    DisposeRgn(org_clip);
  247. X}
  248. X
  249. X
  250. Xstatic void
  251. XmacUpdateStatus ( EventRecord * theEvent , WindowPtr theWindow )
  252. X{
  253. X    NhWindow * nhw = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  254. X    int height = nhw -> charHeight ;
  255. X    int leading = nhw -> leading ;
  256. X    int i ;
  257. X
  258. X    if ( ! theEvent ) {
  259. X        Debugger ( ) ;
  260. X    }
  261. X
  262. X    TextFont ( nhw -> fontNum ) ;
  263. X    TextSize ( nhw -> fontSize ) ;
  264. X    HLock ( nhw -> windowText ) ;
  265. X    for ( i = 0 ; i < NUM_STAT_ROWS ; i ++ ) {
  266. X        MoveTo ( 0 , ( i + 1 ) * height - leading ) ;
  267. X        DrawText ( ( ( StatusData * ) ( * nhw -> windowText ) ) -> map [ i ] ,
  268. X            0 , NUM_COLS ) ;
  269. X    }
  270. X    HUnlock ( nhw -> windowText ) ;
  271. X}
  272. X
  273. X
  274. Xstatic void
  275. XDrawMapCursor ( NhWindow * nhw )
  276. X{
  277. X    Rect r ;
  278. X
  279. X    /*
  280. X     * We only want a cursor in the map
  281. X     * window...
  282. X     */
  283. X    if ( ! WIN_MAP || nhw - theWindows != WIN_MAP )
  284. X        return ;
  285. X
  286. X    r . left = nhw -> cursor . h * nhw -> charWidth ;
  287. X    r . right = ( nhw -> cursor . h + 1 ) * nhw -> charWidth ;
  288. X    r . top = nhw -> cursor . v * nhw -> charHeight ;
  289. X    r . bottom = ( nhw -> cursor . v + 1 ) * nhw -> charHeight ;
  290. X    InvertRect ( & r ) ;
  291. X    nhw -> cursorDrawn = 1 ;
  292. X}
  293. X
  294. X
  295. Xstatic void
  296. XmacUpdateMap ( EventRecord * theEvent , WindowPtr theWindow )
  297. X{
  298. X    NhWindow * nhw = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  299. X    int height = nhw -> charHeight ;
  300. X    int leading = nhw -> leading ;
  301. X    int i ;
  302. X
  303. X    if ( ! theEvent ) {
  304. X        Debugger ( ) ;
  305. X    }
  306. X
  307. X    TextFont ( nhw -> fontNum ) ;
  308. X    TextSize ( nhw -> fontSize ) ;
  309. X    HLock ( nhw -> windowText ) ;
  310. X    for ( i = 0 ; i < NUM_ROWS ; i ++ ) {
  311. X        MoveTo ( 0 , ( i + 1 ) * height - leading ) ;
  312. X        DrawText ( ( ( MapData * ) ( * nhw -> windowText ) ) -> map [ i ] ,
  313. X            0 , NUM_COLS ) ;
  314. X    }
  315. X    HUnlock ( nhw -> windowText ) ;
  316. X    if ( nhw -> cursorDrawn ) {
  317. X        DrawMapCursor ( nhw ) ;
  318. X    }
  319. X}
  320. X
  321. X
  322. Xstatic void
  323. XmacUpdateMenu ( EventRecord * theEvent , WindowPtr theWindow )
  324. X{
  325. X    Rect r = theWindow -> portRect ;
  326. X    Rect r2 = r ;
  327. X    NhWindow * aWin = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  328. X    RgnHandle h ;
  329. X    Boolean vis ;
  330. X
  331. X    if ( ! theEvent ) {
  332. X        Debugger ( ) ;
  333. X    }
  334. X
  335. X    draw_growicon_vert_only(theWindow);
  336. X
  337. X    r2 . left = r2 . right - SBARWIDTH ;
  338. X    r2 . right += 1 ;
  339. X    r2 . top -= 1 ;
  340. X    vis = ( r2 . bottom > r2 . top + 50 ) ;
  341. X    DrawControls ( theWindow ) ;
  342. X
  343. X    h = (RgnHandle) NULL ;
  344. X    if ( vis && ( h = NewRgn ( ) ) ) {
  345. X        RgnHandle tmp = NewRgn ( ) ;
  346. X        if ( ! tmp ) {
  347. X            DisposeRgn ( h ) ;
  348. X            h = (RgnHandle) NULL ;
  349. X        } else {
  350. X            GetClip ( h ) ;
  351. X            RectRgn ( tmp , & r2 ) ;
  352. X            DiffRgn ( h , tmp , tmp ) ;
  353. X            SetClip ( tmp ) ;
  354. X            DisposeRgn ( tmp ) ;
  355. X        }
  356. X    }
  357. X    if ( r . right < MIN_RIGHT )
  358. X        r . right = MIN_RIGHT ;
  359. X    r . top -= aWin -> scrollPos * aWin -> charHeight ;
  360. X    HLock ( aWin -> windowText ) ;
  361. X    TextBox ( * ( aWin -> windowText ) + aWin -> textBase , aWin ->
  362. X        windowTextLen - aWin -> textBase , & r , teJustLeft ) ;
  363. X    HUnlock ( aWin -> windowText ) ;
  364. X    if ( h ) {
  365. X        SetClip ( h ) ;
  366. X        DisposeRgn ( h ) ;
  367. X    }
  368. X}
  369. X
  370. X
  371. Xstatic void
  372. XmacUpdateText ( EventRecord * theEvent , WindowPtr theWindow )
  373. X{
  374. X    Rect r = theWindow -> portRect ;
  375. X    Rect r2 = r ;
  376. X    NhWindow * aWin = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  377. X    RgnHandle h ;
  378. X    Boolean vis ;
  379. X
  380. X    if ( ! theEvent ) {
  381. X        Debugger ( ) ;
  382. X    }
  383. X
  384. X    r2 . left = r2 . right - SBARWIDTH ;
  385. X    r2 . right += 1 ;
  386. X    r2 . top -= 1 ;
  387. X    vis = ( r2 . bottom > r2 . top + 50 ) ;
  388. X    DrawControls ( theWindow ) ;
  389. X
  390. X    h = (RgnHandle) NULL ;
  391. X    if ( vis && ( h = NewRgn ( ) ) ) {
  392. X        RgnHandle tmp = NewRgn ( ) ;
  393. X        if ( ! tmp ) {
  394. X            DisposeRgn ( h ) ;
  395. X            h = (RgnHandle) NULL ;
  396. X        } else {
  397. X            GetClip ( h ) ;
  398. X            RectRgn ( tmp , & r2 ) ;
  399. X            DiffRgn ( h , tmp , tmp ) ;
  400. X            SetClip ( tmp ) ;
  401. X            DisposeRgn ( tmp ) ;
  402. X        }
  403. X    }
  404. X    if ( r . right < MIN_RIGHT )
  405. X        r . right = MIN_RIGHT ;
  406. X    r . top -= aWin -> scrollPos * aWin -> charHeight ;
  407. X    r . right -= SBARWIDTH;
  408. X    HLock ( aWin -> windowText ) ;
  409. X    TextBox ( * ( aWin -> windowText ) + aWin -> textBase , aWin ->
  410. X        windowTextLen - aWin -> textBase , & r , teJustLeft ) ;
  411. X    HUnlock ( aWin -> windowText ) ;
  412. X    draw_growicon_vert_only(theWindow);
  413. X    if ( h ) {
  414. X        SetClip ( h ) ;
  415. X        DisposeRgn ( h ) ;
  416. X    }
  417. X}
  418. X
  419. X
  420. Xstatic void
  421. XmacCursorNull ( EventRecord * theEvent , WindowPtr theWindow , RgnHandle mouseRgn )
  422. X{
  423. X    Rect r = { -1 , -1 , 2 , 2 } ;
  424. X
  425. X    InitCursor ( ) ;
  426. X    OffsetRect ( & r , theEvent -> where . h , theEvent -> where . v ) ;
  427. X    RectRgn ( mouseRgn , & r ) ;
  428. X}
  429. X
  430. X
  431. Xstatic void
  432. XmacCursorMessage ( EventRecord * theEvent , WindowPtr theWindow , RgnHandle mouseRgn )
  433. X{
  434. X    Rect r = { -1 , -1 , 2 , 2 } ;
  435. X
  436. X    InitCursor ( ) ;
  437. X    OffsetRect ( & r , theEvent -> where . h , theEvent -> where . v ) ;
  438. X    RectRgn ( mouseRgn , & r ) ;
  439. X}
  440. X
  441. X
  442. Xstatic void
  443. XmacCursorStatus ( EventRecord * theEvent , WindowPtr theWindow , RgnHandle mouseRgn )
  444. X{
  445. X    Rect r = { -1 , -1 , 2 , 2 } ;
  446. X
  447. X    InitCursor ( ) ;
  448. X    OffsetRect ( & r , theEvent -> where . h , theEvent -> where . v ) ;
  449. X    RectRgn ( mouseRgn , & r ) ;
  450. X}
  451. X
  452. X
  453. Xstatic void
  454. XmacCursorMap ( EventRecord * theEvent , WindowPtr theWindow , RgnHandle mouseRgn )
  455. X{
  456. X    Point where ;
  457. X    CursHandle ch ;
  458. X    GrafPtr gp ;
  459. X    NhWindow * nhw = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  460. X    Rect r = { 0 , 0 , 1 , 1 } ;
  461. X
  462. X    GetPort ( & gp ) ;
  463. X    SetPort ( theWindow ) ;
  464. X
  465. X    where = theEvent -> where ;
  466. X    GlobalToLocal ( & where ) ;
  467. X    ch = GetCursor ( 512 + clickSector ( u . ux , u . uy , where . h / nhw -> charWidth ,
  468. X        where . v / nhw -> charHeight ) ) ;
  469. X    if ( ch ) {
  470. X
  471. X        HLock ( ( Handle ) ch ) ;
  472. X        SetCursor ( * ch ) ;
  473. X        ReleaseResource ( ( Handle ) ch ) ;
  474. X
  475. X    } else {
  476. X
  477. X        InitCursor ( ) ;
  478. X    }
  479. X    OffsetRect ( & r , theEvent -> where . h , theEvent -> where . v ) ;
  480. X    RectRgn ( mouseRgn , & r ) ;
  481. X
  482. X    SetPort ( gp ) ;
  483. X}
  484. X
  485. X
  486. Xstatic void
  487. XmacCursorMenu ( EventRecord * theEvent , WindowPtr theWindow , RgnHandle mouseRgn )
  488. X{
  489. X    Rect r = { -1 , -1 , 2 , 2 } ;
  490. X
  491. X    InitCursor ( ) ;
  492. X    OffsetRect ( & r , theEvent -> where . h , theEvent -> where . v ) ;
  493. X    RectRgn ( mouseRgn , & r ) ;
  494. X}
  495. X
  496. X
  497. Xstatic void
  498. XmacCursorText ( EventRecord * theEvent , WindowPtr theWindow , RgnHandle mouseRgn )
  499. X{
  500. X    Rect r = { -1 , -1 , 2 , 2 } ;
  501. X
  502. X    InitCursor ( ) ;
  503. X    OffsetRect ( & r , theEvent -> where . h , theEvent -> where . v ) ;
  504. X    RectRgn ( mouseRgn , & r ) ;
  505. X}
  506. X
  507. X
  508. Xvoid
  509. XUpdateMenus ( void )
  510. X{
  511. X    WindowPeek w = ( WindowPeek ) FrontWindow ( ) ;
  512. X    Boolean enable = FALSE ;
  513. X    int i ;
  514. X
  515. X    /* All menu items are OK, except the "edit" menu */
  516. X
  517. X    if ( w && w -> windowKind < 0 ) {
  518. X        enable = TRUE ;
  519. X    }
  520. X    for ( i = 1 ; i < 7 ; i ++ ) {
  521. X        if ( i == 2 )
  522. X            continue ;
  523. X        if ( enable ) {
  524. X            EnableItem ( editMenu , i ) ;
  525. X        } else {
  526. X            DisableItem ( editMenu , i ) ;
  527. X        }
  528. X    }
  529. X}
  530. X
  531. X
  532. Xvoid
  533. XDoMenu ( long choise )
  534. X{
  535. X    WindowPeek w = ( WindowPeek ) FrontWindow ( ) ;
  536. X    short menu = choise >> 16 ;
  537. X    short item = choise & 0xffff ;
  538. X    int i ;
  539. X    Str255 str ;
  540. X
  541. X    HiliteMenu ( menu ) ;
  542. X
  543. X    if ( menu == kHMHelpMenuID ) {
  544. X        menu = 128 ;
  545. X        item = 2 ;
  546. X    }
  547. X
  548. X    if ( menu == 128 && item > 2 ) /* apple, DA */ {
  549. X        GetItem ( appleMenu , item , str ) ;
  550. X        OpenDeskAcc ( str ) ;
  551. X    } else if ( menu == 130 ) /* edit */ {
  552. X        SystemEdit ( item - 1 ) ;
  553. X    } else {
  554. X        GetIndString ( str , menu + 1 , item ) ;
  555. X        if ( str [ 0 ] > QUEUE_LEN ) {
  556. X            error ( "Too long command : menul %d item %d" , menu , item ) ;
  557. X            str [ 0 ] = QUEUE_LEN ;
  558. X        }
  559. X        for ( i = 1 ; i <= str [ 0 ] ; i ++ ) {
  560. X            addToKeyQueue ( str [ i ] , 0 ) ;
  561. X        }
  562. X    }
  563. X
  564. X    HiliteMenu ( 0 ) ;
  565. X}
  566. X
  567. X
  568. Xvoid
  569. XHandleKey ( EventRecord * theEvent )
  570. X{
  571. X    WindowPtr theWindow = FrontWindow ( ) ;
  572. X
  573. X    if ( theEvent -> modifiers & cmdKey ) {
  574. X        if ( theEvent -> message & 0xff == '.' ) {
  575. X            int i ;
  576. X/* Flush key queue */
  577. X            for ( i = 0 ; i < QUEUE_LEN ; i ++ ) {
  578. X                keyQueue [ i ] = 0 ;
  579. X            }
  580. X            theEvent -> message = '\033' ;
  581. X            goto dispatchKey ;
  582. X        } else {
  583. X            UpdateMenus ( ) ;
  584. X            DoMenu ( MenuKey ( theEvent -> message & 0xff ) ) ;
  585. X        }
  586. X    } else {
  587. X
  588. XdispatchKey :
  589. X        if ( theWindow ) {
  590. X            ( ( NhWindow * ) GetWRefCon ( theWindow ) ) -> keyFunc ( theEvent ,
  591. X                theWindow ) ;
  592. X        } else {
  593. X            GeneralKey ( theEvent , (WindowPtr) NULL ) ;
  594. X        }
  595. X    }
  596. X}
  597. X
  598. X
  599. Xvoid
  600. XHandleClick ( EventRecord * theEvent )
  601. X{
  602. X    int code ;
  603. X    unsigned long l ;
  604. X    WindowPtr theWindow ;
  605. X    Rect r = ( * GetGrayRgn ( ) ) -> rgnBBox ;
  606. X    NhWindow * aWin ;
  607. X
  608. X    InsetRect ( & r , 4 , 4 ) ;
  609. X
  610. X    code = FindWindow ( theEvent -> where , & theWindow ) ;
  611. X    aWin = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  612. X
  613. X    if ( code != inContent ) {
  614. X        InitCursor ( ) ;
  615. X    } else {
  616. X        aWin -> cursorFunc ( theEvent , theWindow , gMouseRgn ) ; /* Correct direction */
  617. X    }
  618. X    switch ( code ) {
  619. X
  620. X    case inContent :
  621. X        if ( inSelect == WIN_ERR || aWin - theWindows == inSelect ) {
  622. X            SelectWindow ( theWindow ) ;
  623. X            SetPort ( theWindow ) ;
  624. X            ( ( NhWindow * ) GetWRefCon ( theWindow ) ) -> clickFunc ( theEvent ,
  625. X                theWindow ) ;
  626. X        } else {
  627. X            nhbell ( ) ;
  628. X        }
  629. X        break ;
  630. X
  631. X    case inDrag :
  632. X        if ( inSelect == WIN_ERR || aWin - theWindows == inSelect ) {
  633. X            InitCursor ( ) ;
  634. X            DragWindow ( theWindow , theEvent -> where , & r ) ;
  635. X            SaveWindowPos ( theWindow ) ;
  636. X        } else {
  637. X            nhbell ( ) ;
  638. X        }
  639. X        break ;
  640. X
  641. X    case inGrow :
  642. X        if ( inSelect == WIN_ERR || aWin - theWindows == inSelect ) {
  643. X            InitCursor ( ) ;
  644. X            SetRect ( & r , 80 , 2 * aWin -> charHeight + 1 , r . right ,
  645. X                r . bottom ) ;
  646. X            l = GrowWindow ( theWindow , theEvent -> where , & r ) ;
  647. X            SizeWindow ( theWindow , l & 0xffff , l >> 16 , FALSE ) ;
  648. X            SaveWindowSize ( theWindow ) ;
  649. X            SetPort ( theWindow ) ;
  650. X            InvalRect ( & ( theWindow -> portRect ) ) ;
  651. X            if ( aWin -> scrollBar ) {
  652. X                InvalScrollBar ( aWin ) ;
  653. X            }
  654. X        } else {
  655. X            nhbell ( ) ;
  656. X        }
  657. X        break ;
  658. X
  659. X    case inGoAway :
  660. X        if ( TrackGoAway ( theWindow , theEvent -> where ) ) {
  661. X            if ( aWin - theWindows == BASE_WINDOW && ! flags . window_inited ) {
  662. X                addToKeyQueue ( '\033' , 1 ) ;
  663. X                break ;
  664. X            } else {
  665. X                HideWindow ( theWindow ) ;
  666. X            }
  667. X            if ( inSelect == WIN_ERR || aWin - theWindows != inSelect ) {
  668. X                destroy_nhwindow ( aWin - theWindows ) ;
  669. X            } else {
  670. X                addToKeyQueue ( '\033' , 1 ) ;
  671. X            }
  672. X        }
  673. X        break ;
  674. X
  675. X    case inMenuBar :
  676. X        UpdateMenus ( ) ;
  677. X        DoMenu ( MenuSelect ( theEvent -> where ) ) ;
  678. X        break ;
  679. X
  680. X    case inSysWindow :
  681. X        SystemClick( theEvent, theWindow ) ;
  682. X        break ;
  683. X
  684. X    default :
  685. X        break ;
  686. X    }
  687. X}
  688. X
  689. X
  690. Xvoid
  691. XHandleUpdate ( EventRecord * theEvent )
  692. X{
  693. X    WindowPtr theWindow = ( WindowPtr ) theEvent -> message ;
  694. X
  695. X    BeginUpdate ( theWindow ) ;
  696. X    SetPort ( theWindow ) ;
  697. X    EraseRect ( & ( theWindow -> portRect ) ) ;
  698. X    ( ( NhWindow * ) GetWRefCon ( theWindow ) ) -> updateFunc ( theEvent ,
  699. X        theWindow ) ;
  700. X    EndUpdate ( theWindow ) ;
  701. X}
  702. X
  703. X
  704. Xstatic void
  705. XDoOsEvt ( EventRecord * theEvent )
  706. X{
  707. X    WindowPtr wp ;
  708. X    short code ;
  709. X
  710. X    if ( ( theEvent -> message & 0xff000000 ) == 0xfa000000 ) { /* Mouse Moved */
  711. X
  712. X        code = FindWindow ( theEvent -> where , & wp ) ;
  713. X        if ( code != inContent ) {
  714. X
  715. X            Rect r = { -1 , -1 , 2 , 2 } ;
  716. X
  717. X            InitCursor ( ) ;
  718. X            OffsetRect ( & r , theEvent -> where . h , theEvent -> where . v ) ;
  719. X            RectRgn ( gMouseRgn , & r ) ;
  720. X
  721. X        } else {
  722. X
  723. X            NhWindow * nhw = ( ( NhWindow * ) GetWRefCon ( wp ) ) ;
  724. X            if ( nhw ) {
  725. X                nhw -> cursorFunc ( theEvent , wp , gMouseRgn ) ;
  726. X            }
  727. X        }
  728. X    } else {
  729. X
  730. X        /* Suspend/resume */
  731. X    }
  732. X}
  733. X
  734. X
  735. Xvoid
  736. XHandleEvent ( EventRecord * theEvent )
  737. X{
  738. X    switch ( theEvent -> what ) {
  739. X    case autoKey :
  740. X    case keyDown :
  741. X        HandleKey ( theEvent ) ;
  742. X        break ;
  743. X    case updateEvt :
  744. X        HandleUpdate ( theEvent ) ;
  745. X        break ;
  746. X    case mouseDown :
  747. X        HandleClick ( theEvent ) ;
  748. X        break ;
  749. X    case diskEvt :
  750. X        if ( ( theEvent -> message & 0xffff0000 ) != 0 ) {
  751. X
  752. X            Point p = { 150 , 150 } ;
  753. X            ( void ) DIBadMount ( p , theEvent -> message ) ;
  754. X        }
  755. X        break ;
  756. X    case osEvt :
  757. X        DoOsEvt ( theEvent ) ;
  758. X        break ;
  759. X    default :
  760. X        if ( multi < 0 ) { // Get frozen, so stop repeating
  761. X            int ix;
  762. X            for ( ix = 0 ; ix < QUEUE_LEN ; ix ++ ) {
  763. X                keyQueue [ ix ] = 0 ;
  764. X            }
  765. X            FlushEvents ( keyDownMask , 0 ) ;
  766. X        }
  767. X        /*
  768. X         * This somewhat elaborate hack is needed to make the menu
  769. X         * commands work right. They're also needed for fast typists.
  770. X         */
  771. X        if ( keyQueue [ 0 ] && in_topl_mode() ) {
  772. X            int i ;
  773. X
  774. X            theEvent -> what = keyDown ;
  775. X            theEvent -> modifiers = 0 ;
  776. X            theEvent -> message = keyQueue [ 0 ] ;
  777. X
  778. X/* extract from key queue */
  779. X            for ( i = 0 ; i < QUEUE_LEN - 1 ; i ++ ) {
  780. X                keyQueue [ i ] = keyQueue [ i + 1 ] ;
  781. X            }
  782. X            keyQueue [ i ] = 0 ;
  783. X            SetPort ( theWindows [ WIN_MESSAGE ] . theWindow ) ;
  784. X            theWindows [ WIN_MESSAGE ] . keyFunc ( theEvent ,
  785. X                theWindows [ WIN_MESSAGE ] . theWindow ) ;
  786. X        }
  787. X        break ;
  788. X    }
  789. X}
  790. X
  791. X
  792. Xlong doDawdle = 0L ;
  793. X
  794. Xvoid
  795. XDimMenuBar ( void )
  796. X{
  797. X    DisableItem ( appleMenu , 0 ) ;
  798. X    DisableItem ( fileMenu , 0 ) ;
  799. X    DisableItem ( editMenu , 0 ) ;
  800. X    DisableItem ( extendMenu , 0 ) ;
  801. X    DisableItem ( miscMenu , 0 ) ;
  802. X    DisableItem ( commandsMenu , 0 ) ;
  803. X    DisableItem ( thingsMenu , 0 ) ;
  804. X    DrawMenuBar ( ) ;
  805. X}
  806. X
  807. X
  808. Xvoid
  809. XUndimMenuBar ( void )
  810. X{
  811. X    EnableItem ( appleMenu , 0 ) ;
  812. X    EnableItem ( fileMenu , 0 ) ;
  813. X    EnableItem ( editMenu , 0 ) ;
  814. X    EnableItem ( extendMenu , 0 ) ;
  815. X    EnableItem ( miscMenu , 0 ) ;
  816. X    EnableItem ( commandsMenu , 0 ) ;
  817. X    EnableItem ( thingsMenu , 0 ) ;
  818. X    DrawMenuBar ( ) ;
  819. X}
  820. X
  821. Xstatic int mBarDimmed = 0 ;
  822. X
  823. Xvoid
  824. Xmac_get_nh_event( void )
  825. X{
  826. X    EventRecord anEvent ;
  827. X
  828. X    if ( ( inSelect != WIN_ERR || ! flags . window_inited || in_topl_mode() ) &&
  829. X        ! mBarDimmed ) {
  830. X        DimMenuBar ( ) ;
  831. X        mBarDimmed = 1 ;
  832. X    } else if ( inSelect == WIN_ERR && flags . window_inited && mBarDimmed &&
  833. X                ! in_topl_mode() ) {
  834. X        UndimMenuBar ( ) ;
  835. X        mBarDimmed = 0 ;
  836. X    }
  837. X    /*
  838. X     * We want to take care of keys in the buffer as fast as
  839. X     * possible
  840. X     */
  841. X    if ( keyQueue [ 0 ] ) {
  842. X        doDawdle = 0L ;
  843. X    }
  844. X    if ( asyDSC ) {
  845. X        SetPort ( asyDSC -> theWindow ) ;
  846. X        DrawScrollbar ( asyDSC , asyDSC -> theWindow ) ;
  847. X    }
  848. X    if ( ! WaitNextEvent ( -1 , & anEvent , doDawdle , gMouseRgn ) ) {
  849. X        anEvent . what = nullEvent ;
  850. X    }
  851. X    doDawdle = 0L ;
  852. X    HandleEvent ( & anEvent ) ;
  853. X
  854. X    if (top_line && theWindows) {
  855. X        WindowPeek win = (WindowPeek)theWindows[WIN_MESSAGE].theWindow;
  856. X        if (win && win->visible)
  857. X            TEIdle(top_line);
  858. X    }
  859. X}
  860. X
  861. X
  862. Xint
  863. Xmac_nhgetch( void )
  864. X{
  865. X    int ch ;
  866. X    register int i ;
  867. X
  868. X    wait_synch ( ) ;
  869. X
  870. X    if ( flags . window_inited && ! theWindows [ WIN_MAP ] . cursorDrawn &&
  871. X        theWindows [ WIN_MAP ] . theWindow ) {
  872. X        SetPort ( theWindows [ WIN_MAP ] . theWindow ) ;
  873. X        DrawMapCursor ( & theWindows [ WIN_MAP ] ) ;
  874. X    }
  875. X
  876. X    if ( ! keyQueue [ 0 ] ) {
  877. X        long total , contig ;
  878. X        static char warn = 0 ;
  879. X
  880. X        PurgeSpace ( & total , & contig ) ;
  881. X        if ( contig < 64000L || total < 256000L ) {
  882. X            if ( ! warn ) {
  883. X                DebugStr ( ( ConstStr255Param ) "\014Low Memory !" ) ;
  884. X                warn = 1 ;
  885. X            }
  886. X        } else {
  887. X            warn = 0 ;
  888. X        }
  889. X    }
  890. X
  891. X    do {
  892. X        doDawdle = ( in_topl_mode() ? GetCaretTime ( ) : 120L ) ;
  893. X        get_nh_event ( ) ;
  894. X        ch = keyQueue [ 0 ] ;
  895. X    } while ( ! ch ) ;
  896. X
  897. X    if ( ! gClickedToMove ) {
  898. X        ObscureCursor ( ) ;
  899. X    } else {
  900. X        gClickedToMove = 0 ;
  901. X    }
  902. X    for ( i = 0 ; i < QUEUE_LEN - 1 ; i ++ ) {
  903. X        keyQueue [ i ] = keyQueue [ i + 1 ] ;
  904. X    }
  905. X    keyQueue [ i ] = 0 ;
  906. X
  907. X#ifdef MAC_THINKC5
  908. X    if (ch == '\r') ch = '\n';
  909. X#endif
  910. X
  911. X    return ch ;
  912. X}
  913. X
  914. X
  915. Xvoid
  916. Xmac_delay_output( void )
  917. X{
  918. X    long destTicks = TickCount ( ) + 1 ;
  919. X
  920. X    while ( TickCount ( ) < destTicks ) {
  921. X        wait_synch ( ) ;
  922. X    }
  923. X}
  924. X
  925. X
  926. Xvoid
  927. Xmac_wait_synch( void )
  928. X{
  929. X    get_nh_event ( ) ;
  930. X}
  931. X
  932. X
  933. Xvoid
  934. Xmac_mark_synch( void )
  935. X{
  936. X    get_nh_event ( ) ;
  937. X}
  938. X
  939. X
  940. Xvoid
  941. Xmac_cliparound ( int x , int y )
  942. X{
  943. X    /* TODO */
  944. X    if ( ! ( x * ( y + 1 ) ) ) {
  945. X        Debugger ( ) ;
  946. X    }
  947. X}
  948. X
  949. X
  950. Xvoid
  951. Xmac_raw_print ( const char * str )
  952. X{
  953. X    /* Here and in mac_raw_print_bold I assume that once theWindows got
  954. X       allocated by mac_init_nhwindows we can safely do putstr on BASE_WINDOW,
  955. X       even after mac_exit_nhwindows is called or flags.window_inited is reset
  956. X       to zero.  Is this assumption correct? */
  957. X    if ( theWindows ) {
  958. X
  959. X        ShowWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  960. X        SelectWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  961. X
  962. X        putstr ( BASE_WINDOW , 0 , str ) ;
  963. X
  964. X    } else
  965. X        showerror ( str , NULL ) ;
  966. X}
  967. X
  968. X
  969. Xvoid
  970. Xmac_raw_print_bold ( const char * str )
  971. X{
  972. X    if ( theWindows ) {
  973. X
  974. X        ShowWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  975. X        SelectWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  976. X
  977. X        putstr ( BASE_WINDOW , ATR_BOLD , str ) ;
  978. X
  979. X    } else {
  980. X        nhbell ( ) ;
  981. X        showerror ( str , NULL ) ;
  982. X    }
  983. X}
  984. X
  985. X
  986. Xvoid
  987. Xmac_exit_nhwindows ( const char * s )
  988. X{
  989. X    if ( s ) {
  990. X        raw_print ( s ) ;
  991. X        display_nhwindow ( BASE_WINDOW , TRUE ) ;
  992. X    }
  993. X
  994. X    clear_nhwindow ( BASE_WINDOW ) ;
  995. X    flags . window_inited = 0 ;
  996. X    destroy_nhwindow ( WIN_MAP ) ;
  997. X    destroy_nhwindow ( WIN_MESSAGE ) ;
  998. X    destroy_nhwindow ( WIN_STATUS ) ;
  999. X    destroy_nhwindow ( WIN_INVEN ) ;
  1000. X}
  1001. X
  1002. X
  1003. X/*
  1004. X * Don't forget to decrease in_putstr before returning...
  1005. X */
  1006. Xvoid
  1007. Xmac_putstr ( winid win , int attr , const char * str )
  1008. X{
  1009. X    long len , slen ;
  1010. X    NhWindow * aWin = & theWindows [ win ] ;
  1011. X    int kind ;
  1012. X    static char in_putstr = 0 ;
  1013. X    Rect r ;
  1014. X
  1015. X    if ( in_putstr > 3 ) {
  1016. X        DebugStr ( ( ConstStr255Param ) "\012Recursion!" ) ;
  1017. X        return ;
  1018. X    }
  1019. X    if ( win < 0 || win >= NUM_MACWINDOWS ) {
  1020. X        error ( "Invalid window %d (Max %d) in putstr." , win ,
  1021. X            NUM_MACWINDOWS , attr ) ;
  1022. X        return ;
  1023. X    }
  1024. X    if ( ! aWin -> theWindow ) {
  1025. X        error ( "Unallocated window %d in putstr." , win ) ;
  1026. X        return ;
  1027. X    }
  1028. X
  1029. X    in_putstr ++ ;
  1030. X    kind = ( ( WindowPeek ) ( aWin -> theWindow ) ) -> windowKind -
  1031. X        WIN_BASE_KIND ;
  1032. X
  1033. X    if ( kind == NHW_MAP || kind == NHW_STATUS ) {
  1034. X        short    h = ( NUM_COLS - aWin->cursor.h - strlen(str) );
  1035. X        /*
  1036. X         * The "dungeon" window
  1037. X         * putsym will call curs, so no updates necessary.
  1038. X         */
  1039. X        while ( * str ) {
  1040. X            putsym ( win , aWin -> cursor . h , aWin -> cursor . v , * str ) ;
  1041. X            curs ( win , aWin -> cursor . h + 1 , aWin -> cursor . v ) ;
  1042. X            str ++ ;
  1043. X        }
  1044. X        h = (h < 0) ? 0 : h;
  1045. X        while( h-- ) {
  1046. X            putsym ( win , aWin -> cursor . h , aWin -> cursor . v , CHAR_BLANK ) ;
  1047. X            curs ( win , aWin -> cursor . h + 1 , aWin -> cursor . v ) ;
  1048. X        }
  1049. X    } else {
  1050. X        char * sr , * ds ;
  1051. X        /*
  1052. X         * A "default" text window - uses TextBox
  1053. X         * We just add the text, without attributes for now
  1054. X         */
  1055. X        len = GetHandleSize ( aWin -> windowText ) ;
  1056. X        slen = strlen ( str ) ;
  1057. X        while ( aWin -> windowTextLen + slen + 1 > len ) {
  1058. X            len = ( len > 2048 ) ? ( len + 2048 ) : ( len * 2 ) ;
  1059. X            SetHandleSize ( aWin -> windowText , len ) ;
  1060. X            if ( MemError ( ) ) {
  1061. X                error ( "SetHandleSize (putstr)" ) ;
  1062. X                aWin -> windowTextLen = 0L ;
  1063. X                aWin -> textBase = 0 ;
  1064. X                aWin -> lin = 0 ;
  1065. X            }
  1066. X        }
  1067. X    
  1068. X        len = aWin -> windowTextLen ;
  1069. X        sr = (char *)str ;
  1070. X        ds = * ( aWin -> windowText ) + len ;
  1071. X        while ( * sr ) {
  1072. X            if ( * sr == CHAR_LF )
  1073. X                * ds = CHAR_CR ;
  1074. X            else
  1075. X                * ds = * sr ;
  1076. X            if ( * ds == CHAR_CR && kind != NHW_MENU ) {
  1077. X                aWin -> lin ++ ;
  1078. X            }
  1079. X            sr ++ ;
  1080. X            ds ++ ;
  1081. X        }
  1082. X        if ( slen > 1 ) {
  1083. X            ( * ( aWin -> windowText ) ) [ len + slen ] = CHAR_CR ;
  1084. X            aWin -> windowTextLen += slen + 1 ;
  1085. X            aWin -> lin ++ ;
  1086. X        } else {
  1087. X            aWin -> windowTextLen += slen ;
  1088. X        }
  1089. X    
  1090. X        SetPort ( aWin -> theWindow ) ;
  1091. X        r = aWin -> theWindow -> portRect ;
  1092. X        if ( win && win == WIN_MESSAGE ) {
  1093. X            r . bottom -= SBARHEIGHT + 1 ;
  1094. X        }
  1095. X        InvalRect ( & r ) ;
  1096. X        aWin -> clear = 0 ;
  1097. X        if ( kind == NHW_MESSAGE ) {
  1098. X            char * ptr , * stop ;
  1099. X            long oldBase = aWin -> textBase ;
  1100. X            short lines = ( r . bottom - r . top ) / aWin -> charHeight - 1 ;
  1101. X
  1102. X            stop = * aWin -> windowText ;
  1103. X            ptr = stop + aWin -> windowTextLen - 1 ;
  1104. X            while ( lines >= 0 && -- ptr > stop ) {
  1105. X                if ( * ptr == CHAR_CR || * ptr == CHAR_LF )
  1106. X                    lines -- ;
  1107. X            }
  1108. X            if ( ptr <= stop ) {
  1109. X                aWin -> textBase = 0L ;
  1110. X            } else {
  1111. X                aWin -> textBase = ptr - stop + 1 ;
  1112. X            }
  1113. X            if ( oldBase > aWin -> textBase ) {
  1114. X                aWin -> textBase = oldBase ;
  1115. X            }
  1116. X        }
  1117. X        if ( aWin -> scrollBar ) {
  1118. X            InvalScrollBar ( aWin ) ;
  1119. X        }
  1120. X    }
  1121. X    in_putstr -- ;
  1122. X}
  1123. X
  1124. X
  1125. Xvoid
  1126. Xputsym ( winid win , int x , int y , CHAR_P sym )
  1127. X{
  1128. X    NhWindow * aWin = & theWindows [ win ] ;
  1129. X    int kind = ( ( WindowPeek ) ( aWin -> theWindow ) ) -> windowKind
  1130. X        - WIN_BASE_KIND ;
  1131. X    Rect update ;
  1132. X
  1133. X    aWin -> clear = 0 ;
  1134. X    /*
  1135. X     * We don't need to invalidate the old position or set the window,
  1136. X     * since curs() will do that.
  1137. X     */
  1138. X    curs ( win , x , y ) ;
  1139. X    x = aWin -> cursor . h ;
  1140. X    y = aWin -> cursor . v ;
  1141. X
  1142. X    if ( kind == NHW_MAP || kind == NHW_STATUS) {
  1143. X        switch ( sym ) {
  1144. X        case CHAR_LF :
  1145. X        case CHAR_CR :
  1146. X            curs ( win , 1 , y + 1 ) ;
  1147. X            break ;
  1148. X        case CHAR_BS :
  1149. X            if ( x ) {
  1150. X                curs ( win , x - 1 , y ) ;
  1151. X            }
  1152. X            break ;
  1153. X        default :
  1154. X            /*
  1155. X             * Curs() takes care of getting cursor . v within range even for
  1156. X             * the shorter status window - note; this assumes the status and
  1157. X             * the map windows have the same width !
  1158. X             */
  1159. X            update . top = y * aWin -> charHeight ;
  1160. X            update . bottom = ( y + 1 ) * aWin -> charHeight ;
  1161. X            update . left = x * aWin -> charWidth ;
  1162. X            update . right = ( x + 1 ) * aWin -> charWidth ;
  1163. X            EraseRect ( & update ) ;
  1164. X            MoveTo ( x * aWin -> charWidth , ( y + 1 ) * aWin -> charHeight -
  1165. X                aWin -> leading ) ;
  1166. X            ( ( MapData * ) * aWin -> windowText ) -> map [ y ] [ x ] = sym ;
  1167. X            DrawChar ( sym ) ;
  1168. X            break ;
  1169. X        }
  1170. X    } else {
  1171. X        char ss [ 2 ] ;
  1172. X        ss [ 0 ] = sym ;
  1173. X        ss [ 1 ] = 0 ;
  1174. X        putstr ( win , 0 , ss ) ;
  1175. X    }
  1176. X}
  1177. X
  1178. X
  1179. Xvoid
  1180. Xmac_curs ( winid win , int x , int y )
  1181. X{
  1182. X    NhWindow * aWin = & theWindows [ win ] ;
  1183. X    int kind = ( ( WindowPeek ) ( aWin -> theWindow ) ) -> windowKind -
  1184. X        WIN_BASE_KIND ;
  1185. X
  1186. X    SetPort  ( aWin -> theWindow ) ;
  1187. X    if ( kind == NHW_MAP || kind == NHW_STATUS ) {
  1188. X        Rect update ;
  1189. X        if ( x >= NUM_COLS ) {
  1190. X            x = 1 ; y ++ ;
  1191. X        }
  1192. X        if ( y >= ( kind == NHW_STATUS ? NUM_STAT_ROWS : NUM_ROWS ) ) {
  1193. X            y = 0 ; x = 1 ;
  1194. X        }
  1195. X        if ( aWin -> cursorDrawn ) {
  1196. X            update . top = aWin -> cursor . v * aWin -> charHeight ;
  1197. X            update . bottom = ( aWin -> cursor . v + 1 ) * aWin -> charHeight ;
  1198. X            update . left = aWin -> cursor . h * aWin -> charWidth ;
  1199. X            update . right = ( aWin -> cursor . h + 1 ) * aWin -> charWidth ;
  1200. X            EraseRect ( & update ) ;
  1201. X            MoveTo ( aWin -> cursor . h * aWin -> charWidth , ( aWin ->
  1202. X                cursor . v + 1 ) * aWin -> charHeight - aWin -> leading ) ;
  1203. X            DrawChar ( ( ( MapData * ) * ( aWin -> windowText ) ) -> map
  1204. X                [ aWin -> cursor . v ] [ aWin -> cursor . h ] ) ;
  1205. X            aWin -> cursorDrawn = 0 ;
  1206. X        }
  1207. X    }
  1208. X    MoveTo ( x * aWin -> charWidth , ( y + 1 ) * aWin -> charHeight -
  1209. X        aWin -> leading ) ;
  1210. X    SetPt ( & ( aWin -> cursor ) , x , y ) ;
  1211. X}
  1212. X
  1213. X
  1214. X/*
  1215. X *  print_glyph
  1216. X *
  1217. X *  Print the glyph to the output device.  Don't flush the output device.
  1218. X *
  1219. X *  Since this is only called from show_glyph(), it is assumed that the
  1220. X *  position and glyph are always correct (checked there)!
  1221. X */
  1222. Xvoid
  1223. Xmac_print_glyph ( winid window , XCHAR_P x , XCHAR_P y , int glyph )
  1224. X{
  1225. X    unsigned int    ch;
  1226. X    register int    offset;
  1227. X
  1228. X#define zap_color(n)
  1229. X#define cmap_color(n)
  1230. X#define trap_color(n)
  1231. X#define obj_color(n)
  1232. X#define mon_color(n)
  1233. X#define pet_color(c)
  1234. X
  1235. X    /*
  1236. X     *  Map the glyph back to a character.
  1237. X     *
  1238. X     *  Warning:  For speed, this makes an assumption on the order of
  1239. X     *          offsets.  The order is set in display.h.
  1240. X     */
  1241. X    if ((offset = (glyph - GLYPH_SWALLOW_OFF)) >= 0) {        /* swallow */
  1242. X
  1243. X        /* see swallow_to_glyph() in display.c */
  1244. X        ch = (uchar) showsyms[S_sw_tl + (offset & 0x7)];
  1245. X        mon_color(offset >> 3);
  1246. X
  1247. X    } else if ((offset = (glyph - GLYPH_ZAP_OFF)) >= 0) {    /* zap beam */
  1248. X
  1249. X        /* see zapdir_to_glyph() in display.c */
  1250. X        ch = showsyms[S_vbeam + (offset & 0x3)];
  1251. X        zap_color((offset >> 2));
  1252. X
  1253. X    } else if ((offset = (glyph - GLYPH_CMAP_OFF)) >= 0) {    /* cmap */
  1254. X
  1255. X        ch = showsyms[offset];
  1256. X        cmap_color(offset);
  1257. X
  1258. X    } else if ((offset = (glyph - GLYPH_TRAP_OFF)) >= 0) {    /* trap */
  1259. X
  1260. X        ch = (offset == WEB) ? showsyms[S_web] : showsyms[S_trap];
  1261. X        trap_color(offset);
  1262. X
  1263. X    } else if ((offset = (glyph - GLYPH_OBJ_OFF)) >= 0) {    /* object */
  1264. X
  1265. X        ch = oc_syms[objects[offset].oc_class];
  1266. X        obj_color(offset);
  1267. X
  1268. X    } else if ((offset = (glyph - GLYPH_BODY_OFF)) >= 0) {    /* a corpse */
  1269. X
  1270. X        ch = oc_syms[objects[CORPSE].oc_class];
  1271. X        mon_color(offset);
  1272. X
  1273. X    } else if ((offset = (glyph - GLYPH_PET_OFF)) >= 0) {    /* a pet */
  1274. X
  1275. X        ch = monsyms[mons[offset].mlet];
  1276. X        pet_color(offset);
  1277. X
  1278. X    } else {                            /* a monster */
  1279. X
  1280. X        ch = monsyms[mons[glyph].mlet];
  1281. X        mon_color(glyph);
  1282. X    }
  1283. X
  1284. X    if ( ch > 255 ) {
  1285. X        error ( "cicn plotting is not supported." ) ;
  1286. X        /*
  1287. X         * cicn plotting goes here
  1288. X         */
  1289. X    } else {
  1290. X        /*
  1291. X         * Print a char from the hack font.
  1292. X         */
  1293. X        putsym ( window , x , y , ch ) ;
  1294. X    }
  1295. X}
  1296. X
  1297. X
  1298. Xint
  1299. Xmac_nh_poskey ( int * a , int * b , int * c )
  1300. X{
  1301. X    if ( ! a || ! b || ! c ) {
  1302. X        Debugger ( ) ;
  1303. X    }
  1304. X    return nhgetch ( ) ;
  1305. X}
  1306. X
  1307. X
  1308. Xvoid
  1309. Xmac_start_menu ( winid win )
  1310. X{
  1311. X    NhWindow * aWin = & theWindows [ win ] ;
  1312. X
  1313. X    HideWindow ( aWin -> theWindow ) ;
  1314. X    SetHandleSize ( aWin -> windowText , TEXT_BLOCK ) ;
  1315. X    aWin -> wid = 0 ;
  1316. X    aWin -> lin = 0 ;
  1317. X    clear_nhwindow ( win ) ;
  1318. X}
  1319. X
  1320. X
  1321. Xvoid
  1322. Xmac_add_menu ( winid win , CHAR_P menuChar , int attr , const char * str )
  1323. X{
  1324. X    long addSize ;
  1325. X    int newWid ;
  1326. X    NhWindow * aWin = & theWindows [ win ] ;
  1327. X
  1328. X    if ( ! str || aWin -> lin >= NUM_MENU_ITEMS )
  1329. X        return ;
  1330. X
  1331. X    SetPort ( aWin -> theWindow ) ;
  1332. X    aWin -> itemChars [ aWin -> lin ] = menuChar ;
  1333. X
  1334. X    addSize = strlen ( str ) ;
  1335. X    newWid = TextWidth ( str , 0 , addSize ) ;
  1336. X    if ( newWid > aWin -> wid )
  1337. X        aWin -> wid = newWid ;
  1338. X    putstr ( win , attr , str ) ;
  1339. X}
  1340. X
  1341. X
  1342. X/*
  1343. X * End a menu in this window, window must a type NHW_MENU.
  1344. X * ch is the value to return if the menu is canceled,
  1345. X * str is a list of cancel characters (values that may be input)
  1346. X * morestr is a prompt to display, rather than the default.
  1347. X * str and morestr might be ignored by some ports.
  1348. X */
  1349. Xvoid
  1350. Xmac_end_menu ( winid win , CHAR_P ch , const char * str , const char * morestr )
  1351. X{
  1352. X    unsigned char buf [ 256 ] ;
  1353. X    int len ;
  1354. X    NhWindow * aWin = & theWindows [ win ] ;
  1355. X
  1356. X    strncpy ( aWin -> cancelStr , str , NUM_CANCEL_ITEMS ) ;
  1357. X    aWin -> cancelStr [ NUM_CANCEL_ITEMS - 1 ] = 0 ;
  1358. X    aWin -> cancelChar = ch ;
  1359. X
  1360. X    buf [ 0 ] = 0 ;
  1361. X    if ( morestr ) {
  1362. X        strncpy ( (char *)& buf [ 1 ] , morestr , 255 ) ;
  1363. X        len = strlen ( morestr ) ;
  1364. X        if ( len > 255 )
  1365. X            buf [ 0 ] = 255 ;
  1366. X        else
  1367. X            buf [ 0 ] = len ;
  1368. X    }
  1369. X    SetWTitle ( aWin -> theWindow , buf ) ;
  1370. X}
  1371. X
  1372. X
  1373. Xchar
  1374. Xmac_select_menu ( winid win )
  1375. X{
  1376. X    short w , h ;
  1377. X    int c , l ;
  1378. X    WindowPtr theWin = theWindows [ win ] . theWindow ;
  1379. X    NhWindow * aWin = & theWindows [ win ] ;
  1380. X
  1381. X    inSelect = win ;
  1382. X
  1383. X    SetPort ( theWin ) ;
  1384. X    if ( aWin -> wid && aWin -> lin ) {
  1385. X        w = aWin -> wid + 16 ;
  1386. X        h = aWin -> lin * aWin -> charHeight ;
  1387. X        if ( w > 450 ) {
  1388. X            w = 450 ;
  1389. X        }
  1390. X        if ( h > 300 ) {
  1391. X            h = 300 ;
  1392. X        }
  1393. X        SizeWindow ( theWin , w , h , TRUE ) ;
  1394. X        if ( aWin -> scrollBar ) {
  1395. X            InvalScrollBar ( aWin ) ;
  1396. X        }
  1397. X    }
  1398. X    SelectWindow ( theWin ) ;
  1399. X    ShowWindow ( theWin ) ;
  1400. X    InvalRect ( & ( theWin -> portRect ) ) ;
  1401. X
  1402. X    do {
  1403. X        while ( ! ( c =  nhgetch ( ) ) ) ;
  1404. X        for ( l = 0 ; l < aWin -> lin ; l ++ ) {
  1405. X            if ( aWin -> itemChars [ l ] == c )
  1406. X                goto done ;
  1407. X        }
  1408. X        if ( ClosingWindowChar ( c ) ) {
  1409. X            c = aWin -> cancelChar ;
  1410. X        }
  1411. X    } while ( ! strchr ( aWin -> cancelStr , c ) &&
  1412. X        c != aWin -> cancelChar ) ;
  1413. X
  1414. Xdone :
  1415. X
  1416. X    HideWindow ( theWin ) ;
  1417. X
  1418. X    inSelect = WIN_ERR ;
  1419. X
  1420. X    return c ;
  1421. X}
  1422. X
  1423. X
  1424. Xvoid
  1425. Xmac_display_file ( name, complain )
  1426. Xconst char * name;
  1427. Xboolean    complain;
  1428. X{
  1429. X    long l ;
  1430. X    short refNum ;
  1431. X    Ptr buf ;
  1432. X    int win ;
  1433. X
  1434. X    if ( 0 > ( refNum = macopen ( name , O_RDONLY , TEXT_TYPE ) ) ) {
  1435. X        if (complain) error ( "Cannot open file %s." , name ) ;
  1436. X    } else {
  1437. X        l = macseek ( refNum , 0 , SEEK_END ) ;
  1438. X        ( void ) macseek ( refNum , 0 , 0L ) ;
  1439. X        win = create_nhwindow ( NHW_TEXT ) ;
  1440. X        if ( win == WIN_ERR ) {
  1441. X            if (complain) error ( "Cannot make window." ) ;
  1442. X            goto out ;
  1443. X        }
  1444. X        buf = NewPtr(l+1);
  1445. X        if (buf)
  1446. X            l = macread(refNum, buf, l);
  1447. X        if (buf && l > 0) {
  1448. X            buf[l] = '\0';
  1449. X            putstr(win, 0, buf);
  1450. X            display_nhwindow(win, FALSE);
  1451. X        } else {
  1452. X            HideWindow(theWindows[win].theWindow);
  1453. X            destroy_nhwindow(win);
  1454. X        }
  1455. X        if (buf)
  1456. X            DisposPtr(buf);
  1457. Xout :
  1458. X        macclose ( refNum ) ;
  1459. X    }
  1460. X}
  1461. X
  1462. X
  1463. Xvoid
  1464. Xport_help ( )
  1465. X{
  1466. X    display_file ( PORT_HELP , TRUE ) ;
  1467. X}
  1468. X
  1469. X
  1470. Xshort frame_corner ;
  1471. X
  1472. X
  1473. Xstatic pascal void
  1474. XFrameItem ( DialogPtr dlog , short item )
  1475. X{
  1476. X    short k ;
  1477. X    Handle h ;
  1478. X    Rect r ;
  1479. X
  1480. X    GetDItem ( dlog , item , & k , & h , & r ) ;
  1481. X    PenSize ( 3 , 3 ) ;
  1482. X    FrameRoundRect ( & r , frame_corner , frame_corner ) ;
  1483. X    PenNormal ( ) ;
  1484. X}
  1485. X
  1486. X
  1487. Xvoid
  1488. XSetFrameItem ( DialogPtr dlog , short frame , short item )
  1489. X{
  1490. X    Rect r , r2 ;
  1491. X    short kind ;
  1492. X    Handle h ;
  1493. X
  1494. X    GetDItem ( dlog , item , & kind , & h , & r ) ;
  1495. X    InsetRect ( & r , -4 , -4 ) ;
  1496. X    r2 = r ;
  1497. X    GetDItem ( dlog , frame , & kind , & h , & r ) ;
  1498. X    SetDItem ( dlog , frame , kind , ( Handle ) FrameItem , & r2 ) ;
  1499. X    frame_corner = 16 ;
  1500. X}
  1501. X
  1502. X
  1503. X//    Flash a button (for instance OK if you press enter)
  1504. X//
  1505. Xvoid
  1506. XFlashButton ( DialogPtr dlog , short item )
  1507. X{
  1508. X    short k ;
  1509. X    Handle h ;
  1510. X    Rect r ;
  1511. X    long l ;
  1512. X
  1513. X    GetDItem ( dlog , item , & k , & h , &  r ) ;
  1514. X    if ( k == ctrlItem + btnCtrl ) {
  1515. X        HiliteControl ( ( ControlHandle ) h , 1 ) ;
  1516. X        Delay ( GetDblTime ( ) / 2 , & l ) ;
  1517. X        HiliteControl ( ( ControlHandle ) h , 0 ) ;
  1518. X    }
  1519. X}
  1520. X
  1521. X
  1522. Xpascal Boolean
  1523. XCharacterDialogFilter ( DialogPtr dp , EventRecord * ev , short * item )
  1524. X{
  1525. X    int ix ;
  1526. X    Handle h ;
  1527. X    Rect r ;
  1528. X    short k ;
  1529. X    Str255 s ;
  1530. X    unsigned char com [ 2 ] ;
  1531. X
  1532. X    if ( ev -> what == mouseDown ) {
  1533. X
  1534. X        int code ;
  1535. X        WindowPtr wp ;
  1536. X        Rect r ;
  1537. X
  1538. X        code = FindWindow ( ev -> where , & wp ) ;
  1539. X        if ( wp != dp || code != inDrag ) {
  1540. X    
  1541. X            return 0 ;
  1542. X        }
  1543. X        r = ( * GetGrayRgn ( ) ) -> rgnBBox ;
  1544. X        InsetRect ( & r , 3 , 3 ) ;
  1545. X    
  1546. X        DragWindow ( wp , ev -> where , & r ) ;
  1547. X        SaveWindowPos ( wp ) ;
  1548. X
  1549. X        ev -> what = nullEvent ;
  1550. X        return 1 ;
  1551. X    }
  1552. X    if ( ev -> what != keyDown ) {
  1553. X
  1554. X        return 0 ;
  1555. X    }
  1556. X    com [ 0 ] = 1 ;
  1557. X    com [ 1 ] = ev -> message & 0xff ;
  1558. X
  1559. X    if ( com [ 1 ] == 10 || com [ 1 ] == 13 || com [ 1 ] == 32 ||
  1560. X        com [ 1 ] == 3 ) { // various "OK"
  1561. X
  1562. X        * item = 1 ;
  1563. X        FlashButton ( dp , 1 ) ;
  1564. X        return 1 ;
  1565. X    }
  1566. X    if ( com [ 1 ] == 'Q' || com [ 1 ] == 'q' ||
  1567. X         com [ 1 ] == 27 || ( ev -> message & 0xff00 == 0x3500 ) ) { // escape
  1568. X
  1569. X        * item = 2 ;
  1570. X        FlashButton ( dp , 2 ) ;
  1571. X        return 1 ;
  1572. X    }
  1573. X    for ( ix = 3 ; ix ; ix ++ ) {
  1574. X
  1575. X        h = ( Handle ) NULL ;
  1576. X        k = 0 ;
  1577. X        GetDItem ( dp , ix , & k , & h , & r ) ;
  1578. X        if ( ! k || ! h ) {
  1579. X
  1580. X            return 0 ;
  1581. X        }
  1582. X        if ( k == 6 ) { // Radio Button Item
  1583. X
  1584. X            GetCTitle ( ( ControlHandle ) h , s ) ;
  1585. X            s [ 0 ] = 1 ;
  1586. X            if ( ! IUEqualString ( com , s ) ) {
  1587. X
  1588. X                * item = ix ;
  1589. X                return 1 ;
  1590. X            }
  1591. X        }
  1592. X    }
  1593. X/*NOTREACHED*/
  1594. X    return 0 ;
  1595. X}
  1596. X
  1597. X
  1598. Xvoid
  1599. Xmac_player_selection ( void )
  1600. X{
  1601. X    ControlHandle    ctrl;
  1602. X    DialogPtr        characterDialog;
  1603. X    short            itemHit, lastItemSelected, type;
  1604. X    Rect            box;
  1605. X    
  1606. X    characterDialog = GetNewDialog(132, (Ptr) NULL, (WindowPtr) -1);
  1607. X    
  1608. X    /*
  1609. X    ** Default selection is random, beginning at the first item after the "Cancel" button.
  1610. X    */
  1611. X    
  1612. X    lastItemSelected = rn1(12, 3);
  1613. X
  1614. X    /*
  1615. X    ** Mark the default selection.
  1616. X    */
  1617. X    
  1618. X    GetDItem(characterDialog, lastItemSelected, &type, (Handle *) &ctrl, &box);
  1619. X    SetCtlValue(ctrl, 1);
  1620. X
  1621. X    InitCursor ( ) ;
  1622. X    SetFrameItem ( characterDialog , 15 , 1 ) ;
  1623. X    do {
  1624. X        ModalDialog((ModalFilterProcPtr) CharacterDialogFilter , &itemHit);
  1625. X        if ((itemHit != 1) && (itemHit != 2)) {
  1626. X            /*
  1627. X            ** If OK and Cancel (items 1 and 2) weren't selected then a radio button 
  1628. X            ** was pushed.  Unmark the previous selection.
  1629. X            */
  1630. X            
  1631. X            GetDItem(characterDialog, lastItemSelected, &type, (Handle *) &ctrl, &box);
  1632. X            SetCtlValue(ctrl, 0);
  1633. X            
  1634. X            /*
  1635. X            ** Mark the current selection.
  1636. X            */
  1637. X            
  1638. X            GetDItem(characterDialog, itemHit, &type, (Handle *) &ctrl, &box);
  1639. X            SetCtlValue(ctrl, 1);
  1640. X
  1641. X            /*
  1642. X            ** Save the item number for use later.
  1643. X            */
  1644. X            
  1645. X            lastItemSelected = itemHit;
  1646. X        }
  1647. X    } while ((itemHit != 1) && (itemHit != 2));
  1648. X    
  1649. X    if (itemHit == 2) {
  1650. X
  1651. X        clearlocks();
  1652. X        ExitToShell();
  1653. X
  1654. X    } else {
  1655. X        switch (lastItemSelected) {
  1656. X        case 3:
  1657. X            pl_character [ 0 ] = 'A';
  1658. X            break;
  1659. X        case 4:
  1660. X            pl_character [ 0 ] = 'B';
  1661. X            break;
  1662. X        case 5:
  1663. X            pl_character [ 0 ] = 'C';
  1664. X            break;
  1665. X        case 6:
  1666. X            pl_character [ 0 ] = 'E';
  1667. X            break;
  1668. X        case 7:
  1669. X            pl_character [ 0 ] = 'H';
  1670. X            break;
  1671. X        case 8:
  1672. X            pl_character [ 0 ] = 'K';
  1673. X            break;
  1674. X        case 9:
  1675. X            pl_character [ 0 ] = 'P';
  1676. X            break;
  1677. X        case 10:
  1678. X            pl_character [ 0 ] = 'R';
  1679. X            break;
  1680. X        case 11:
  1681. X            pl_character [ 0 ] = 'S';
  1682. X            break;
  1683. X        case 12:
  1684. X            pl_character [ 0 ] = 'T';
  1685. X            break;
  1686. X        case 13:
  1687. X            pl_character [ 0 ] = 'V';
  1688. X            break;
  1689. X        case 14:
  1690. X            pl_character [ 0 ] = 'W';
  1691. X            break;
  1692. X        }
  1693. X    }
  1694. X    
  1695. X    DisposDialog(characterDialog);
  1696. X}
  1697. X
  1698. Xvoid
  1699. Xmac_update_inventory ( void )
  1700. X{
  1701. X}
  1702. X
  1703. X
  1704. Xvoid
  1705. Xmac_suspend_nhwindows ( const char * )
  1706. X{
  1707. X    /*    Can't relly do that :-)        */
  1708. X}
  1709. X
  1710. X
  1711. Xvoid
  1712. Xmac_resume_nhwindows ( void )
  1713. X{
  1714. X    /*    Can't relly do that :-)        */
  1715. X}
  1716. X
  1717. X
  1718. Xint
  1719. Xtry_key_queue ( char * bufp )
  1720. X{
  1721. X    if ( keyQueue [ 0 ] ) {
  1722. X
  1723. X        int ix , flag = 0 ;
  1724. X        for ( ix = 0 ; ix < QUEUE_LEN ; ix ++ ) {
  1725. X
  1726. X            if ( ! flag ) {
  1727. X
  1728. X                if ( ! ( bufp [ ix ] = keyQueue [ ix ] ) ) {
  1729. X
  1730. X                    flag = 1 ;
  1731. X                }
  1732. X            }
  1733. X            keyQueue [ ix ] = 0 ;
  1734. X        }
  1735. X        if ( ! flag ) {
  1736. X
  1737. X            bufp [ ix ] = 0 ;
  1738. X        }
  1739. X        return 1 ;
  1740. X    }
  1741. X
  1742. X    return 0 ;
  1743. X}
  1744. X
  1745. X/* Interface definition, for windows.c */
  1746. Xstruct window_procs mac_procs = {
  1747. X    "mac",
  1748. X    mac_init_nhwindows,
  1749. X    mac_player_selection,
  1750. X    mac_askname,
  1751. X    mac_get_nh_event,
  1752. X    mac_exit_nhwindows,
  1753. X    mac_suspend_nhwindows,
  1754. X    mac_resume_nhwindows,
  1755. X    mac_create_nhwindow,
  1756. X    mac_clear_nhwindow,
  1757. X    mac_display_nhwindow,
  1758. X    mac_destroy_nhwindow,
  1759. X    mac_curs,
  1760. X    mac_putstr,
  1761. X    mac_display_file,
  1762. X    mac_start_menu,
  1763. X    mac_add_menu,
  1764. X    mac_end_menu,
  1765. X    mac_select_menu,
  1766. X    mac_update_inventory,
  1767. X    mac_mark_synch,
  1768. X    mac_wait_synch,
  1769. X#ifdef CLIPPING
  1770. X    mac_cliparound,
  1771. X#endif
  1772. X    mac_print_glyph,
  1773. X    mac_raw_print,
  1774. X    mac_raw_print_bold,
  1775. X    mac_nhgetch,
  1776. X    mac_nh_poskey,
  1777. X    mac_nhbell,
  1778. X    mac_doprev_message,
  1779. X    mac_yn_function,
  1780. X    mac_getlin,
  1781. X#ifdef COM_COMPL
  1782. X    mac_get_ext_cmd,
  1783. X#endif /* COM_COMPL */
  1784. X    mac_number_pad,
  1785. X    mac_delay_output,
  1786. X    /* other defs that really should go away (they're tty specific) */
  1787. X    0,    //    mac_start_screen,
  1788. X    0, //    mac_end_screen,
  1789. X} ;
  1790. X
  1791. X/*macwin.c*/
  1792. END_OF_FILE
  1793. if test 37726 -ne `wc -c <'sys/mac/macwin.c2'`; then
  1794.     echo shar: \"'sys/mac/macwin.c2'\" unpacked with wrong size!
  1795. fi
  1796. # end of 'sys/mac/macwin.c2'
  1797. fi
  1798. if test -f 'sys/vms/Makefile.src' -a "${1}" != "-c" ; then 
  1799.   echo shar: Will not clobber existing file \"'sys/vms/Makefile.src'\"
  1800. else
  1801. echo shar: Extracting \"'sys/vms/Makefile.src'\" \(17335 characters\)
  1802. sed "s/^X//" >'sys/vms/Makefile.src' <<'END_OF_FILE'
  1803. X#    NetHack Makefile (VMS) - for building nethack itself.
  1804. X#    SCCS Id: @(#)Makefile.src    3.1    93/01/25
  1805. X
  1806. X#  Copy this file to [.src]Makefile. and then edit it as needed.
  1807. X#  If you changed CC or CFLAGS, make similar changes in [.util]Makefile.
  1808. X#
  1809. X#  Note:  modifying this Makefile will cause crtl.opt to be rebuilt,
  1810. X#    which will trigger an update of makedefs, which will in turn
  1811. X#    result in a full build of just about _everything_.
  1812. X
  1813. XMAKE    = mms
  1814. XCD    = set default
  1815. XECHO    = write sys$output
  1816. XNOOP    = !
  1817. XRUN    = mcr
  1818. XTOUCH    = append/New _NLA0:    # only one file per $(TOUCH)
  1819. X# source tree, relative to 'src' and 'util'
  1820. XINC = [-.include]
  1821. XSHR = [-.sys.share]
  1822. XSRC = [-.src]
  1823. XTTY = [-.win.tty]
  1824. XUTL = [-.util]
  1825. XVMS = [-.sys.vms]
  1826. XX11 = [-.win.X11]
  1827. X
  1828. XMAKEFILE= $(SRC)Makefile.
  1829. X
  1830. X# if you are using gcc as your compiler:
  1831. X#    uncomment the CC definition below if it's not in your environment
  1832. X# CC = gcc
  1833. X
  1834. X# set option flags for C compiler and linker
  1835. X#
  1836. X#CFLAGS = /Debug/noOptimize/Include=$(INC)
  1837. XCFLAGS    = /Include=$(INC)/noList
  1838. X#CFLAGS = /Stand=VAXC/Incl=$(INC)/noList    # DECC in VAXC mode
  1839. X#LFLAGS = /Debug/Map/Cross_Ref            # for development
  1840. X#LFLAGS = /noTraceback/noMap            # for installing w/ privs
  1841. XLFLAGS    = /noMap
  1842. XLINK    = link
  1843. X
  1844. XLIBS    = sys$share:vaxcrtl.exe/Shareable
  1845. X#LIBS    =                    # blank for DECC
  1846. XMORELIBS =
  1847. X# GCC needs an extra library
  1848. X#MORELIBS = gnu_cc:[000000]gcclib.olb/Library
  1849. X
  1850. X# Specific VMS object files
  1851. XSYSSRC = $(VMS)vmsmain.c,$(VMS)vmstty.c,$(VMS)vmsunix.c,\
  1852. X    $(VMS)vmsmisc.c,$(VMS)vmsfiles.c,$(VMS)vmsmail.c
  1853. XSYSOBJ = vmsmain.obj,vmstty.obj,vmsunix.obj,vmsfiles.obj,vmsmail.obj #,vmsmisc.obj
  1854. XLIBOPT = $(SRC)crtl.opt;
  1855. X
  1856. X# Choose if you need the GNU termcap routines
  1857. XTERMCAPSRC = $(VMS)gnutermcap.c $(VMS)gnutparam.c
  1858. XTERMCAPOBJ = ,gnutermcap.obj,gnutparam.obj
  1859. X
  1860. X# Set WINSRC and WINOBJ lines corresponding to your desired combination
  1861. X# of windowing systems.  Also set windowing systems in config.h.
  1862. X#
  1863. X# a straight tty port using no native windowing system
  1864. XWINTTYSRC = $(TTY)getline.c $(TTY)termcap.c $(TTY)topl.c $(TTY)wintty.c \
  1865. X    $(TERMCAPSRC)
  1866. XWINTTYOBJ = getline.obj,termcap.obj,topl.obj,wintty.obj $(TERMCAPOBJ)
  1867. X#
  1868. X# an X11 port (not supported under DECwindows)
  1869. XWINX11SRC = $(X11)Window.c $(X11)dialogs.c $(X11)winX.c $(X11)winmap.c \
  1870. X    $(X11)winmenu.c $(X11)winmesg.c $(X11)winmisc.c $(X11)winstat.c \
  1871. X    $(X11)wintext.c $(X11)winval.c
  1872. XWINX11OBJ = Window.obj,dialogs.obj,winX.obj,winmap.obj,winmenu.obj,\
  1873. X    winmesg.obj,winmisc.obj,winstat.obj,wintext.obj,winval.obj
  1874. X#
  1875. X#
  1876. XWINSRC = $(WINTTYSRC)
  1877. XWINOBJ = $(WINTTYOBJ)
  1878. X
  1879. X# make NetHack for VMS
  1880. XSYSTEM    = SysVMS.timestamp;
  1881. XGAME    = $(SRC)nethack.exe;
  1882. X
  1883. X# RANDOM is defined in vmsconf.h
  1884. XRANDOBJ = random.obj
  1885. X
  1886. X# ----------------------------------------
  1887. X#
  1888. X# Nothing below this line should have to be changed.
  1889. X#
  1890. X# Other things that have to be reconfigured are in vmsconf.h,
  1891. X# and config.h
  1892. X
  1893. X# note: no trailing whitespace (or comment) after version or patchlevel numbers
  1894. XVERSION  =3.1
  1895. XPATCHLVL =0
  1896. X
  1897. XMAKEDEFS = $(UTL)makedefs.exe;
  1898. X
  1899. X# all .c that are part of the main NetHack program and are not operating- or
  1900. X# windowing-system specific
  1901. XHACKCSRC = allmain.c alloc.c apply.c artifact.c attrib.c ball.c bones.c\
  1902. X       botl.c cmd.c dbridge.c decl.c detect.c display.c do.c do_name.c\
  1903. X       do_wear.c dog.c dogmove.c dokick.c dothrow.c drawing.c dungeon.c\
  1904. X       eat.c end.c engrave.c exper.c explode.c extralev.c files.c\
  1905. X       fountain.c hack.c hacklib.c invent.c lock.c mail.c makemon.c\
  1906. X       mcastu.c mhitm.c mhitu.c minion.c mklev.c mkmap.c mkmaze.c\
  1907. X       mkobj.c mkroom.c mon.c mondata.c monmove.c monst.c mplayer.c\
  1908. X       mthrowu.c muse.c music.c o_init.c objects.c objnam.c options.c\
  1909. X       pager.c pickup.c pline.c polyself.c potion.c pray.c priest.c\
  1910. X       quest.c questpgr.c read.c rect.c restore.c rip.c rnd.c rumors.c\
  1911. X       save.c shk.c shknam.c sit.c sounds.c sp_lev.c spell.c steal.c\
  1912. X       timeout.c topten.c track.c trap.c u_init.c uhitm.c vault.c\
  1913. X       version.c vision.c weapon.c were.c wield.c windows.c wizard.c\
  1914. X       worm.c worn.c write.c zap.c
  1915. X
  1916. X# .c files for this version (for date.h)
  1917. XVERSOURCES = $(HACKCSRC) $(SYSSRC) $(WINSRC) monstr.c vis_tab.c
  1918. X
  1919. X# all .h files except date.h, onames.h, pm.h, and vis_tab.h which would
  1920. X# cause dependency loops if run through "make depend"
  1921. X# and dgn_comp.h, dgn_file.h, lev_comp.h, special level & dungeon files.
  1922. X#
  1923. XHACKINCL = align.h amiconf.h artifact.h artilist.h attrib.h color.h config.h\
  1924. X       coord.h decl.h def_os2.h display.h dungeon.h edog.h emin.h engrave.h\
  1925. X       epri.h eshk.h extern.h flag.h func_tab.h global.h hack.h lev.h\
  1926. X       macconf.h mfndpos.h micro.h mkroom.h monattk.h mondata.h monflag.h\
  1927. X       monst.h monsym.h obj.h objclass.h os2conf.h patchlevel.h pcconf.h\
  1928. X       permonst.h prop.h rect.h rm.h sp_lev.h spell.h system.h termcap.h\
  1929. X       tosconf.h tradstdc.h trampoli.h trap.h unixconf.h vault.h vision.h\
  1930. X       vmsconf.h wintty.h winX.h winprocs.h wintype.h you.h youprop.h
  1931. X
  1932. X#HSOURCES = $(HACKINCL) date.h onames.h pm.h vis_tab.h\
  1933. X#        lev_comp.h dgn_comp.h dgn_file.h
  1934. X
  1935. X# the following .obj's should be made before any others (for makedefs)
  1936. XFIRSTOBJ = vmsmisc.obj,monst.obj,objects.obj
  1937. X
  1938. X# split up long list so that we can write pieces of it into nethack.opt
  1939. XHOBJ1 = allmain.obj,alloc.obj,apply.obj,artifact.obj,attrib.obj, \
  1940. X    ball.obj,bones.obj,botl.obj,cmd.obj,dbridge.obj,decl.obj, \
  1941. X    detect.obj,display.obj,do.obj,do_name.obj,do_wear.obj,dog.obj
  1942. XHOBJ2 = dogmove.obj,dokick.obj,dothrow.obj,drawing.obj,dungeon.obj, \
  1943. X    eat.obj,end.obj,engrave.obj,exper.obj,explode.obj,extralev.obj, \
  1944. X    files.obj,fountain.obj,hack.obj,hacklib.obj,invent.obj
  1945. XHOBJ3 = lock.obj,mail.obj,makemon.obj,mcastu.obj,mhitm.obj,mhitu.obj, \
  1946. X    minion.obj,mklev.obj,mkmap.obj,mkmaze.obj,mkobj.obj,mkroom.obj, \
  1947. X    mon.obj,mondata.obj,monmove.obj,monstr.obj,mplayer.obj
  1948. XHOBJ4 = mthrowu.obj,muse.obj,music.obj,o_init.obj,objnam.obj, \
  1949. X    options.obj,pager.obj,pickup.obj,pline.obj,polyself.obj, \
  1950. X    potion.obj,pray.obj,priest.obj,quest.obj,questpgr.obj,read.obj
  1951. XHOBJ5 = rect.obj,restore.obj,rip.obj,rnd.obj,rumors.obj,save.obj, \
  1952. X    shk.obj,shknam.obj,sit.obj,sounds.obj,sp_lev.obj,spell.obj, \
  1953. X    steal.obj,timeout.obj,topten.obj,track.obj,trap.obj,u_init.obj
  1954. XHOBJ6 = uhitm.obj,vault.obj,vision.obj,vis_tab.obj,weapon.obj,were.obj, \
  1955. X    wield.obj,windows.obj,wizard.obj,worm.obj,worn.obj,write.obj, \
  1956. X    zap.obj,version.obj
  1957. XHOBJ  = $(FIRSTOBJ) $(SYSOBJ) $(WINOBJ) $(RANDOBJ) \
  1958. X    $(HOBJ1) $(HOBJ2) $(HOBJ3) $(HOBJ4) $(HOBJ5) $(HOBJ6)
  1959. X
  1960. X# simpler target name
  1961. Xnethack : $(GAME)
  1962. X      @ $(ECHO) "nethack is up to date."
  1963. X
  1964. X$(GAME) :    $(SYSTEM)
  1965. X      @ $(NOOP)
  1966. X
  1967. X$(SYSTEM) :    $(LIBOPT) $(HOBJ) nethack.opt
  1968. X      @ $(ECHO) "Linking ..."
  1969. X    $(LINK)/Exe=$(GAME) $(LFLAGS) nethack.opt/Opt,$(LIBOPT)/Opt
  1970. X    $(TOUCH) $(SYSTEM)
  1971. X
  1972. Xall :    $(GAME)
  1973. X      @ $(ECHO) "nethack is up to date."
  1974. X
  1975. X# linker options file for nethack's object modules
  1976. Xnethack.opt :    $(MAKEFILE)    # this file
  1977. X    open/Write f nethack.opt
  1978. X    write f "! nethack.opt"
  1979. X      @ write f f$edit("$(SYSOBJ)","COLLAPSE")
  1980. X      @ write f f$edit("$(WINOBJ)","COLLAPSE")
  1981. X      @ write f f$edit("$(RANDOBJ)","COLLAPSE")
  1982. X      @ write f f$edit("$(FIRSTOBJ)","COLLAPSE")
  1983. X      @ write f f$edit("$(HOBJ1)","COLLAPSE")
  1984. X      @ write f f$edit("$(HOBJ2)","COLLAPSE")
  1985. X      @ write f f$edit("$(HOBJ3)","COLLAPSE")
  1986. X      @ write f f$edit("$(HOBJ4)","COLLAPSE")
  1987. X      @ write f f$edit("$(HOBJ5)","COLLAPSE")
  1988. X      @ write f f$edit("$(HOBJ6)","COLLAPSE")
  1989. X      @ write f "iosegment=128"
  1990. X    write f "identification=$(VERSION).$(PATCHLVL)"
  1991. X    close f
  1992. X
  1993. X# linker options file for run-time libraries, also used by $(UTL)Makefile
  1994. X$(LIBOPT) :    $(MAKEFILE)    # this file
  1995. X    open/Write f $(LIBOPT)
  1996. X    write f "! crtl.opt"
  1997. X    write f "$(LIBS)"
  1998. X    write f "$(MORELIBS)"
  1999. X    close f
  2000. X# simplified target name, for interactive convenience
  2001. Xcrtl.opt :    $(LIBOPT)
  2002. X      @ $(NOOP)
  2003. X
  2004. X#    dependencies for makedefs and its outputs, which the util
  2005. X#    Makefile is responsible for keeping up to date
  2006. X#
  2007. X
  2008. X# special rules, to force update of makedefs, real dependencies should be
  2009. X# below in the 'make depend' output.
  2010. Xmonst.obj :
  2011. X    $(CC) $(CFLAGS) monst.c
  2012. X     @- if f$search("$(MAKEDEFS)").nes."" then delete $(MAKEDEFS)
  2013. X
  2014. Xobjects.obj :
  2015. X    $(CC) $(CFLAGS) objects.c
  2016. X     @- if f$search("$(MAKEDEFS)").nes."" then delete $(MAKEDEFS)
  2017. X
  2018. X$(MAKEDEFS) :    $(FIRSTOBJ) $(UTL)makedefs.c $(INC)patchlevel.h \
  2019. X        $(INC)config.h $(INC)artilist.h $(INC)qtext.h  $(LIBOPT)
  2020. X    $(CD) $(UTL)
  2021. X    $(MAKE)$(MAKEFLAGS) $(MAKEDEFS)
  2022. X      @ $(CD) $(SRC)
  2023. X$(INC)onames.h : $(MAKEDEFS)
  2024. X    $(CD) $(UTL)
  2025. X    $(MAKE)$(MAKEFLAGS) $(INC)onames.h
  2026. X      @ $(CD) $(SRC)
  2027. X$(INC)pm.h :    $(MAKEDEFS)
  2028. X    $(CD) $(UTL)
  2029. X    $(MAKE)$(MAKEFLAGS) $(INC)pm.h
  2030. X      @ $(CD) $(SRC)
  2031. Xmonstr.c : $(MAKEDEFS)
  2032. X    $(CD) $(UTL)
  2033. X    $(MAKE)$(MAKEFLAGS) $(SRC)monstr.c
  2034. X      @ $(CD) $(SRC)
  2035. X# both vis_tab.h and vis_tab.c are made at the same time by makedefs
  2036. X$(INC)vis_tab.h : vis_tab.c
  2037. X    $(TOUCH) $(INC)vis_tab.h
  2038. Xvis_tab.c : $(MAKEDEFS)
  2039. X    $(CD) $(UTL)
  2040. X    $(MAKE)$(MAKEFLAGS) $(SRC)vis_tab.c
  2041. X      @ $(CD) $(SRC)
  2042. X
  2043. X#    date.h should be remade any time any of the source or include code
  2044. X#    is modified.  Unfortunately, this would make the contents of this
  2045. X#    file far more complex.    Since "hack.h" depends on most of the include
  2046. X#    files, we kludge around this by making date.h dependent on hack.h,
  2047. X#    even though it doesn't include this file.
  2048. X#
  2049. X#    hack.h depends on makedefs' output, so we know makedefs will be
  2050. X#    up to date before being executed; kill old date.h to force update
  2051. X$(INC)date.h :    $(VERSOURCES) $(INC)hack.h
  2052. X     @- if f$search("$(INC)date.h").nes."" then  delete $(INC)date.h;*
  2053. X    $(CD) $(UTL)
  2054. X    $(MAKE)$(MAKEFLAGS) $(INC)date.h
  2055. X      @ $(CD) $(SRC)
  2056. X
  2057. X#
  2058. Xvmsmain.obj :    $(VMS)vmsmain.c $(INC)hack.h
  2059. Xvmstty.obj :    $(VMS)vmstty.c $(INC)hack.h $(INC)wintty.h $(INC)termcap.h
  2060. Xvmsunix.obj :    $(VMS)vmsunix.c $(INC)hack.h $(INC)date.h
  2061. Xvmsmisc.obj :    $(VMS)vmsmisc.c $(VMS)oldcrtl.c
  2062. Xvmsfiles.obj :    $(VMS)vmsfiles.c $(INC)config.h
  2063. Xvmsmail.obj :    $(VMS)vmsmail.c $(INC)config.h $(INC)winprocs.h $(INC)mail.h
  2064. Xgnutermcap.obj : $(VMS)gnutermcap.c
  2065. Xgnutparam.obj : $(VMS)gnutparam.c
  2066. X
  2067. Xrandom.c :
  2068. X    copy $(SHR)random.c random.c
  2069. X
  2070. X#
  2071. X#    The following are rules for window dependencies.  The ones used
  2072. X#    depend on wich window system you are using.
  2073. X#
  2074. Xgetline.obj :    $(TTY)getline.c $(INC)hack.h $(INC)wintty.h $(INC)func_tab.h
  2075. Xtermcap.obj :    $(TTY)termcap.c $(INC)hack.h $(INC)wintty.h $(INC)termcap.h
  2076. Xtopl.obj :    $(TTY)topl.c $(INC)hack.h $(INC)termcap.h $(INC)wintty.h
  2077. Xwintty.obj :    $(TTY)wintty.c $(INC)hack.h $(INC)termcap.h $(INC)wintty.h
  2078. XWindow.obj :    $(X11)Window.c $(INC)WindowP.h
  2079. Xdialogs.obj :    $(X11)dialogs.c $(INC)config.h
  2080. XwinX.obj :    $(X11)winX.c $(INC)hack.h $(INC)winX.h \
  2081. X        $(X11)nh72icon $(X11)nh56icon $(X11)nh32icon
  2082. Xwinmap.obj :    $(X11)winmap.c $(INC)Window.h $(INC)hack.h $(INC)winX.h
  2083. Xwinmenu.obj :    $(X11)winmenu.c $(INC)hack.h $(INC)winX.h
  2084. Xwinmesg.obj :    $(X11)winmesg.c $(INC)hack.h $(INC)winX.h
  2085. Xwinmisc.obj :    $(X11)winmisc.c $(INC)hack.h $(INC)func_tab.h $(INC)winX.h
  2086. Xwinstat.obj :    $(X11)winstat.c $(INC)hack.h $(INC)winX.h
  2087. Xwintext.obj :    $(X11)wintext.c $(INC)hack.h $(INC)winX.h
  2088. Xwinval.obj :    $(X11)winval.c $(INC)config.h
  2089. X
  2090. X
  2091. Xclean :
  2092. X      - if f$search("*.*;-1")      .nes."" then    purge
  2093. X      - if f$search("*.obj")      .nes."" then    delete *.obj;
  2094. X      - if f$search("nethack.opt").nes."" then    delete nethack.opt;
  2095. X
  2096. Xspotless :    clean
  2097. X      - if f$search("$(LIBOPT)").nes."" then  delete $(LIBOPT)
  2098. X      - if f$search("$(SYSTEM)").nes."" then  delete $(SYSTEM)
  2099. X      - if f$search("$(GAME)")    .nes."" then  delete $(GAME)
  2100. X      - delete monstr.c;,vis_tab.c;,$(INC)vis_tab.h;,\
  2101. X $(INC)pm.h;,$(INC)onames.h;,$(INC)date.h;
  2102. X      - if f$search("random.c").nes."" then    delete random.c;
  2103. X      - if f$search("nethack.olb").nes."" then    delete nethack.olb;
  2104. X
  2105. X
  2106. X# semi-automatically generated dependencies
  2107. X
  2108. Xallmain.obj :    $(INC)hack.h
  2109. Xalloc.obj :    $(INC)config.h
  2110. Xapply.obj :    $(INC)hack.h $(INC)edog.h
  2111. Xartifact.obj :    $(INC)hack.h $(INC)artifact.h $(INC)artilist.h
  2112. Xattrib.obj :    $(INC)hack.h $(INC)artifact.h
  2113. Xball.obj :    $(INC)hack.h
  2114. Xbones.obj :    $(INC)hack.h $(INC)lev.h
  2115. Xbotl.obj :    $(INC)hack.h
  2116. Xcmd.obj :    $(INC)hack.h $(INC)func_tab.h
  2117. Xdbridge.obj :    $(INC)hack.h
  2118. Xdecl.obj :    $(INC)hack.h $(INC)quest.h
  2119. Xdetect.obj :    $(INC)hack.h $(INC)artifact.h
  2120. Xdisplay.obj :    $(INC)hack.h
  2121. Xdo.obj :    $(INC)hack.h $(INC)lev.h
  2122. Xdo_name.obj :    $(INC)hack.h
  2123. Xdo_wear.obj :    $(INC)hack.h
  2124. Xdog.obj :    $(INC)hack.h $(INC)edog.h
  2125. Xdogmove.obj :    $(INC)hack.h $(INC)mfndpos.h $(INC)edog.h
  2126. Xdokick.obj :    $(INC)hack.h $(INC)eshk.h
  2127. Xdothrow.obj :    $(INC)hack.h
  2128. Xdrawing.obj :    $(INC)hack.h $(INC)termcap.h
  2129. Xdungeon.obj :    $(INC)hack.h $(INC)dgn_file.h
  2130. Xeat.obj :    $(INC)hack.h
  2131. Xend.obj :    $(INC)hack.h $(INC)eshk.h
  2132. Xengrave.obj :    $(INC)hack.h $(INC)lev.h
  2133. Xexper.obj :    $(INC)hack.h
  2134. Xexplode.obj :    $(INC)hack.h
  2135. Xextralev.obj :    $(INC)hack.h
  2136. Xfiles.obj :    $(INC)hack.h
  2137. Xfountain.obj :    $(INC)hack.h
  2138. Xhack.obj :    $(INC)hack.h
  2139. Xhacklib.obj :    $(INC)hack.h
  2140. Xinvent.obj :    $(INC)hack.h $(INC)artifact.h
  2141. Xlock.obj :    $(INC)hack.h
  2142. Xmail.obj :    $(INC)hack.h $(INC)mail.h
  2143. Xmakemon.obj :    $(INC)hack.h $(INC)epri.h $(INC)emin.h
  2144. Xmcastu.obj :    $(INC)hack.h
  2145. Xmhitm.obj :    $(INC)hack.h $(INC)artifact.h $(INC)edog.h
  2146. Xmhitu.obj :    $(INC)hack.h $(INC)artifact.h $(INC)edog.h
  2147. Xminion.obj :    $(INC)hack.h $(INC)emin.h $(INC)epri.h
  2148. Xmklev.obj :    $(INC)hack.h
  2149. Xmkmap.obj :    $(INC)hack.h $(INC)sp_lev.h
  2150. Xmkmaze.obj :    $(INC)hack.h $(INC)sp_lev.h
  2151. Xmkobj.obj :    $(INC)hack.h $(INC)artifact.h $(INC)prop.h
  2152. Xmkroom.obj :    $(INC)hack.h
  2153. Xmon.obj :    $(INC)hack.h $(INC)mfndpos.h $(INC)edog.h
  2154. Xmondata.obj :    $(INC)hack.h $(INC)eshk.h $(INC)epri.h
  2155. Xmonmove.obj :    $(INC)hack.h $(INC)mfndpos.h $(INC)artifact.h
  2156. Xmonst.obj :    $(INC)config.h $(INC)permonst.h $(INC)monsym.h $(INC)eshk.h \
  2157. X        $(INC)vault.h $(INC)epri.h $(INC)color.h
  2158. Xmplayer.obj :    $(INC)hack.h
  2159. Xmthrowu.obj :    $(INC)hack.h
  2160. Xmuse.obj :    $(INC)hack.h
  2161. Xmusic.obj :    $(INC)hack.h
  2162. Xo_init.obj :    $(INC)hack.h
  2163. Xobjects.obj :    $(INC)config.h $(INC)obj.h $(INC)objclass.h $(INC)prop.h \
  2164. X        $(INC)color.h objects.c
  2165. Xobjnam.obj :    $(INC)hack.h
  2166. Xoptions.obj :    $(INC)hack.h $(INC)termcap.h
  2167. Xpager.obj :    $(INC)hack.h
  2168. Xpickup.obj :    $(INC)hack.h
  2169. Xpline.obj :    $(INC)hack.h $(INC)epri.h
  2170. Xpolyself.obj :    $(INC)hack.h
  2171. Xpotion.obj :    $(INC)hack.h
  2172. Xpray.obj :    $(INC)hack.h $(INC)epri.h
  2173. Xpriest.obj :    $(INC)hack.h $(INC)mfndpos.h $(INC)eshk.h $(INC)epri.h $(INC)emin.h
  2174. Xquest.obj :    $(INC)hack.h $(INC)quest.h $(INC)qtext.h
  2175. Xquestpgr.obj :    $(INC)hack.h $(INC)qtext.h
  2176. Xread.obj :    $(INC)hack.h
  2177. Xrect.obj :    $(INC)hack.h
  2178. Xrestore.obj :    $(INC)hack.h $(INC)lev.h $(INC)termcap.h $(INC)quest.h
  2179. Xrip.obj :    $(INC)hack.h
  2180. Xrnd.obj :    $(INC)hack.h
  2181. Xrumors.obj :    $(INC)hack.h
  2182. Xsave.obj :    $(INC)hack.h $(INC)lev.h $(INC)quest.h
  2183. Xshk.obj :    $(INC)hack.h $(INC)eshk.h
  2184. Xshknam.obj :    $(INC)hack.h $(INC)eshk.h
  2185. Xsit.obj :    $(INC)hack.h $(INC)artifact.h
  2186. Xsounds.obj :    $(INC)hack.h $(INC)edog.h $(INC)eshk.h
  2187. Xsp_lev.obj :    $(INC)hack.h $(INC)sp_lev.h $(INC)rect.h
  2188. Xspell.obj :    $(INC)hack.h
  2189. Xsteal.obj :    $(INC)hack.h
  2190. Xtimeout.obj :    $(INC)hack.h
  2191. Xtopten.obj :    $(INC)hack.h
  2192. Xtrack.obj :    $(INC)hack.h
  2193. Xtrap.obj :    $(INC)hack.h
  2194. Xu_init.obj :    $(INC)hack.h
  2195. Xuhitm.obj :    $(INC)hack.h
  2196. Xvault.obj :    $(INC)hack.h $(INC)vault.h
  2197. Xversion.obj :    $(INC)hack.h $(INC)date.h  $(INC)patchlevel.h
  2198. Xvision.obj :    $(INC)hack.h $(INC)vis_tab.h
  2199. Xweapon.obj :    $(INC)hack.h
  2200. Xwere.obj :    $(INC)hack.h
  2201. Xwield.obj :    $(INC)hack.h
  2202. Xwindows.obj :    $(INC)hack.h $(INC)wintty.h
  2203. Xwizard.obj :    $(INC)hack.h $(INC)qtext.h
  2204. Xworm.obj :    $(INC)hack.h $(INC)lev.h
  2205. Xworn.obj :    $(INC)hack.h
  2206. Xwrite.obj :    $(INC)hack.h
  2207. Xzap.obj :    $(INC)hack.h
  2208. X$(INC)amiconf.h :  $(INC)micro.h $(INC)pcconf.h
  2209. X            $(TOUCH) $(INC)amiconf.h
  2210. X$(INC)config.h :  $(INC)tradstdc.h $(INC)global.h
  2211. X            $(TOUCH) $(INC)config.h
  2212. X$(INC)decl.h :    $(INC)quest.h $(INC)spell.h $(INC)color.h $(INC)obj.h \
  2213. X        $(INC)you.h $(INC)onames.h $(INC)pm.h
  2214. X            $(TOUCH) $(INC)decl.h
  2215. X$(INC)display.h :  $(INC)vision.h $(INC)mondata.h
  2216. X            $(TOUCH) $(INC)display.h
  2217. X$(INC)dungeon.h :  $(INC)align.h
  2218. X            $(TOUCH) $(INC)dungeon.h
  2219. X$(INC)emin.h :    $(INC)dungeon.h
  2220. X            $(TOUCH) $(INC)emin.h
  2221. X$(INC)epri.h :    $(INC)dungeon.h $(INC)align.h
  2222. X            $(TOUCH) $(INC)epri.h
  2223. X$(INC)eshk.h :    $(INC)dungeon.h
  2224. X            $(TOUCH) $(INC)eshk.h
  2225. X# ignore the non-VMS configuration headers
  2226. X#$(INC)global.h :  $(INC)coord.h $(INC)vmsconf.h $(INC)unixconf.h $(INC)os2conf.h \
  2227. X#           $(INC)pcconf.h $(INC)tosconf.h $(INC)amiconf.h $(INC)macconf.h
  2228. X$(INC)global.h :  $(INC)coord.h $(INC)vmsconf.h
  2229. X            $(TOUCH) $(INC)global.h
  2230. X$(INC)hack.h :    $(INC)config.h $(INC)dungeon.h $(INC)monsym.h $(INC)mkroom.h \
  2231. X        $(INC)objclass.h $(INC)decl.h $(INC)trap.h $(INC)flag.h \
  2232. X        $(INC)rm.h $(INC)vision.h $(INC)display.h $(INC)wintype.h \
  2233. X        $(INC)engrave.h $(INC)rect.h $(INC)winprocs.h $(INC)wintty.h \
  2234. X        $(INC)trampoli.h
  2235. X            $(TOUCH) $(INC)hack.h
  2236. X$(INC)macconf.h :  $(INC)system.h
  2237. X            $(TOUCH) $(INC)macconf.h
  2238. X$(INC)mondata.h :  $(INC)align.h
  2239. X            $(TOUCH) $(INC)mondata.h
  2240. X$(INC)monst.h :  $(INC)align.h
  2241. X            $(TOUCH) $(INC)monst.h
  2242. X$(INC)os2conf.h :  $(INC)pcconf.h
  2243. X            $(TOUCH) $(INC)os2conf.h
  2244. X$(INC)pcconf.h :  $(INC)micro.h $(INC)system.h
  2245. X            $(TOUCH) $(INC)pcconf.h
  2246. X$(INC)permonst.h :  $(INC)monattk.h $(INC)monflag.h $(INC)align.h
  2247. X            $(TOUCH) $(INC)permonst.h
  2248. X$(INC)rm.h :  $(INC)align.h
  2249. X            $(TOUCH) $(INC)rm.h
  2250. X$(INC)sp_lev.h :  $(INC)align.h
  2251. X            $(TOUCH) $(INC)sp_lev.h
  2252. X$(INC)tosconf.h :  $(INC)micro.h $(INC)pcconf.h
  2253. X            $(TOUCH) $(INC)tosconf.h
  2254. X$(INC)unixconf.h :  $(INC)system.h
  2255. X            $(TOUCH) $(INC)unixconf.h
  2256. X$(INC)vault.h :  $(INC)dungeon.h
  2257. X            $(TOUCH) $(INC)vault.h
  2258. X$(INC)vmsconf.h :  $(INC)system.h
  2259. X            $(TOUCH) $(INC)vmsconf.h
  2260. X$(INC)you.h :  $(INC)align.h $(INC)attrib.h $(INC)monst.h $(INC)youprop.h
  2261. X            $(TOUCH) $(INC)you.h
  2262. X$(INC)youprop.h :  $(INC)prop.h $(INC)permonst.h $(INC)mondata.h $(INC)pm.h
  2263. X            $(TOUCH) $(INC)youprop.h
  2264. X# eof
  2265. END_OF_FILE
  2266. if test 17335 -ne `wc -c <'sys/vms/Makefile.src'`; then
  2267.     echo shar: \"'sys/vms/Makefile.src'\" unpacked with wrong size!
  2268. fi
  2269. # end of 'sys/vms/Makefile.src'
  2270. fi
  2271. echo shar: End of archive 48 \(of 108\).
  2272. cp /dev/null ark48isdone
  2273. MISSING=""
  2274. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \
  2275. 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 \
  2276. 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 \
  2277. 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 \
  2278. 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 \
  2279. 101 102 103 104 105 106 107 108 ; do
  2280.     if test ! -f ark${I}isdone ; then
  2281.     MISSING="${MISSING} ${I}"
  2282.     fi
  2283. done
  2284. if test "${MISSING}" = "" ; then
  2285.     echo You have unpacked all 108 archives.
  2286.     echo "Now execute 'rebuild.sh'"
  2287.     rm -f ark10[0-8]isdone ark[1-9]isdone ark[1-9][0-9]isdone
  2288. else
  2289.     echo You still need to unpack the following archives:
  2290.     echo "        " ${MISSING}
  2291. fi
  2292. ##  End of shell archive.
  2293. exit 0
  2294.