home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / volume16 / nethck31 / patch1j < prev    next >
Encoding:
Text File  |  1993-03-04  |  58.1 KB  |  2,074 lines

  1. Subject:  v17i051:  nethack31 - display oriented dungeons & dragons (Ver. 3.1), Patch1j/31
  2. Newsgroups: comp.sources.games
  3. Approved: billr@saab.CNA.TEK.COM
  4.  
  5. Submitted-by: izchak@linc.cis.upenn.edu (Izchak Miller)
  6. Posting-number: Volume 17, Issue 51
  7. Archive-name: nethack31/Patch1j
  8. Patch-To: nethack31: Volume 16, Issue 1-116
  9. Environment: Amiga, Atari, Mac, MS-DOS, Windows-NT, OS2, Unix, VMS, X11
  10.  
  11.  
  12.  
  13. #! /bin/sh
  14. # This is a shell archive.  Remove anything before this line, then unpack
  15. # it by saving it into a file and typing "sh file".  To overwrite existing
  16. # files, type "sh file -c".  You can also feed this as standard input via
  17. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  18. # will see the following message at the end:
  19. #        "End of archive 10 (of 31)."
  20. # Contents:  UPDATE1 patches01s
  21. # Wrapped by billr@saab on Fri Mar  5 10:50:43 1993
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'UPDATE1' -a "${1}" != "-c" ; then 
  24.   echo shar: Renaming existing file \"'UPDATE1'\" to \"'UPDATE1.orig'\"
  25.   mv -f 'UPDATE1' 'UPDATE1.orig'
  26. fi
  27. echo shar: Extracting \"'UPDATE1'\" \(1331 characters\)
  28. sed "s/^X//" >'UPDATE1' <<'END_OF_FILE'
  29. XWe wish to thank the many people who sent us bug reports, fixes, and
  30. Xsuggestions for improvements.  Please keep doing this.
  31. X
  32. XMore polish was applied to the Amiga, Mac, and X11 windowing systems.
  33. XX11 WM_DELETE_WINDOW handling was added by David Wexelblat.  As we said
  34. Xin the initial release, the Mac and the Amiga ports are still in
  35. Xdevelopment.  You will find them to be much improved, but there is more
  36. Xwork to be done.  Make constructive comments.
  37. X
  38. XThe instrument sound files were broken out from their Mac-specific format
  39. Xand are now being used by the Amiga port.
  40. X
  41. XA Windows NT console port was provided by Michael Allison.
  42. X
  43. XVarious portability fixes for more UNIX makes and HPUX versions.
  44. X
  45. XMany small bugs were fixed.  Some of the most popular include misconfiguring
  46. Xwindowing systems, the wrong phase of the moon for some micro ports,
  47. Xpolymorphing into bees, "ghosts" left by reeling monsters, throwing Mjollnir
  48. Xat walls, various problems with shop payment, mysterious rust damage on damp
  49. Xlevels, Bells of Opening for Tourists, and bones on endgame levels.
  50. X
  51. XMany, many small changes having to do with message phrasing (thanks to
  52. XFelix Lee) and Amiga declaration syntax for their new compiler version
  53. X(transparent to other ports).
  54. X
  55. XPlease NOTE:  Old save/bones files should be deleted.  They will NOT
  56. Xwork with NetHack 3.1.1.
  57. X
  58. END_OF_FILE
  59. if test 1331 -ne `wc -c <'UPDATE1'`; then
  60.     echo shar: \"'UPDATE1'\" unpacked with wrong size!
  61. fi
  62. # end of 'UPDATE1'
  63. if test -f 'patches01s' -a "${1}" != "-c" ; then 
  64.   echo shar: Renaming existing file \"'patches01s'\" to \"'patches01s.orig'\"
  65.   mv -f 'patches01s' 'patches01s.orig'
  66. fi
  67. echo shar: Extracting \"'patches01s'\" \(53863 characters\)
  68. sed "s/^X//" >'patches01s' <<'END_OF_FILE'
  69. X*** /tmp/da09374    Thu Feb 25 10:29:06 1993
  70. X--- sys/mac/maccurs.c    Sun Feb 21 16:06:06 1993
  71. X***************
  72. X*** 91,96 ****
  73. X--- 91,99 ----
  74. X  }
  75. X  
  76. X  
  77. X+ #if 0
  78. X+ /* Now we use click_to_cmd() instead. */
  79. X+ 
  80. X  int
  81. X  clickSector ( int x , int y , int toX , int toY )
  82. X  {
  83. X***************
  84. X*** 155,161 ****
  85. X      }
  86. X  }
  87. X  
  88. X! 
  89. X  
  90. X  
  91. X  Boolean
  92. X--- 158,164 ----
  93. X      }
  94. X  }
  95. X  
  96. X! #endif
  97. X  
  98. X  
  99. X  Boolean
  100. X*** /tmp/da09398    Thu Feb 25 10:29:12 1993
  101. X--- sys/mac/macmain.c    Thu Feb 11 12:12:23 1993
  102. X***************
  103. X*** 114,120 ****
  104. X          boolean remember_wiz_mode = wizard;
  105. X  #endif
  106. X  #ifdef NEWS
  107. X!         if(flags.news) display_file(NEWS, FALSE);
  108. X  #endif
  109. X          pline("Restoring save file...");
  110. X          mark_synch();    /* flush output */
  111. X--- 114,123 ----
  112. X          boolean remember_wiz_mode = wizard;
  113. X  #endif
  114. X  #ifdef NEWS
  115. X!         if(flags.news) {
  116. X!             display_file(NEWS, FALSE);
  117. X!             flags.news = FALSE;    /* in case dorecover() fails */
  118. X!         }
  119. X  #endif
  120. X          pline("Restoring save file...");
  121. X          mark_synch();    /* flush output */
  122. X***************
  123. X*** 174,185 ****
  124. X      attemptingto("proceed");
  125. X  #if defined(MAC_MPW32) && !defined(MODEL_FAR)
  126. X      UnloadAllSegments();                        /* Do this before naming residents */
  127. X!     IsResident( (Ptr) display_nhwindow );        /* Sample resident segments */
  128. X      IsResident( (Ptr) rhack );
  129. X      IsResident( (Ptr) engr_at );
  130. X      IsResident( (Ptr) movemon );
  131. X      IsResident( (Ptr) attacktype ) ;
  132. X      IsResident( (Ptr) mac_get_nh_event ) ;
  133. X  #endif
  134. X      moveloop();
  135. X      /*NOTREACHED*/
  136. X--- 177,197 ----
  137. X      attemptingto("proceed");
  138. X  #if defined(MAC_MPW32) && !defined(MODEL_FAR)
  139. X      UnloadAllSegments();                        /* Do this before naming residents */
  140. X!     IsResident( (Ptr) um_dist );                /* Sample resident segments */
  141. X!     IsResident( (Ptr) flush_screen );
  142. X      IsResident( (Ptr) rhack );
  143. X+     IsResident( (Ptr) remove_cadavers );
  144. X+     IsResident( (Ptr) dog_move );
  145. X+     IsResident( (Ptr) gethungry );
  146. X      IsResident( (Ptr) engr_at );
  147. X+     IsResident( (Ptr) domove );
  148. X+     IsResident( (Ptr) carried );
  149. X      IsResident( (Ptr) movemon );
  150. X      IsResident( (Ptr) attacktype ) ;
  151. X      IsResident( (Ptr) mac_get_nh_event ) ;
  152. X+     IsResident( (Ptr) dosounds ) ;
  153. X+     IsResident( (Ptr) t_at ) ;
  154. X+     IsResident( (Ptr) nh_timeout ) ;
  155. X  #endif
  156. X      moveloop();
  157. X      /*NOTREACHED*/
  158. X***************
  159. X*** 434,441 ****
  160. X  #define    kUnLoaded 0x3F3C                /* if unloaded then a LoadSeg trap */
  161. X                                          /* Note: probably incorrect for -model far! */
  162. X  
  163. X! /* #define TRACKSEGS /* Utility to print a trace of segment load frequencies. Add
  164. X!    a call to ListGUnloads into terminate() in end.c to use it */
  165. X  
  166. X  #ifdef TRACKSEGS
  167. X  
  168. X--- 446,452 ----
  169. X  #define    kUnLoaded 0x3F3C                /* if unloaded then a LoadSeg trap */
  170. X                                          /* Note: probably incorrect for -model far! */
  171. X  
  172. X! /* #define TRACKSEGS /* Utility to print a trace of segment load frequencies. */
  173. X  
  174. X  #ifdef TRACKSEGS
  175. X  
  176. X***************
  177. X*** 447,453 ****
  178. X    int i;
  179. X    FILE *f;
  180. X    
  181. X!   f = fopen("unloads","r+");
  182. X    fprintf(f,"%d calls to UnloadAllSegments\n\n",gUnloads[0]);
  183. X    for (i=1; i<=pMaxSegNum; i++) {
  184. X       fprintf(f,"Unloaded %10s, segment %2d, %6d times\n",gSegNames[i],i,gUnloads[i]);
  185. X--- 458,464 ----
  186. X    int i;
  187. X    FILE *f;
  188. X    
  189. X!   f = fopen("unloads","w");
  190. X    fprintf(f,"%d calls to UnloadAllSegments\n\n",gUnloads[0]);
  191. X    for (i=1; i<=pMaxSegNum; i++) {
  192. X       fprintf(f,"Unloaded %10s, segment %2d, %6d times\n",gSegNames[i],i,gUnloads[i]);
  193. X***************
  194. X*** 504,509 ****
  195. X--- 515,521 ----
  196. X      SetResLoad(false);    
  197. X  
  198. X      #ifdef TRACKSEGS
  199. X+     atexit(&ListGUnloads);
  200. X      gUnloads[0]=0;
  201. X      #endif
  202. X      for (i=1; i<=pMaxSegNum; i++) {
  203. X*** /tmp/da09414    Thu Feb 25 10:29:17 1993
  204. X--- sys/mac/mactopl.c    Thu Feb 18 17:37:56 1993
  205. X***************
  206. X*** 7,13 ****
  207. X  #include <OSUtils.h>
  208. X  #include <Packages.h>
  209. X  
  210. X- // int NDECL(mac_doprev_message);
  211. X  // char FDECL(yn_function,(const char *, const char *, CHAR_P));
  212. X  
  213. X  int FDECL ( try_key_queue , ( char * ) ) ;
  214. X--- 7,12 ----
  215. X***************
  216. X*** 25,59 ****
  217. X  extern winid inSelect ;
  218. X  extern short frame_corner ;
  219. X  
  220. X- int
  221. X- mac_doprev_message(void)
  222. X- {
  223. X-     NhWindow * aWin = & theWindows [ WIN_MESSAGE ] ;
  224. X-     char * start , * stop ;
  225. X  
  226. X-     if ( ! WIN_MESSAGE )
  227. X-         return 0 ;
  228. X- 
  229. X-     stop = * aWin -> windowText ;
  230. X-     start = * aWin -> windowText + aWin -> textBase - 2 ;
  231. X- 
  232. X-     while ( start > stop && * start != 10 && * start != 13 )
  233. X-         start -- ;
  234. X- 
  235. X-     if ( start <= stop )
  236. X-         aWin -> textBase = 0L ;
  237. X-     else
  238. X-         aWin -> textBase = start - stop + 1 ;
  239. X-     if ( aWin -> textBase > aWin -> windowTextLen )
  240. X-         aWin -> textBase = aWin -> windowTextLen ;
  241. X- 
  242. X-     display_nhwindow ( WIN_MESSAGE , FALSE ) ;
  243. X-     InvalRect ( & ( aWin -> theWindow -> portRect ) ) ;
  244. X- 
  245. X-     return 0 ;
  246. X- }
  247. X- 
  248. X- 
  249. X  char
  250. X  queued_resp(char *resp)
  251. X  {
  252. X--- 24,30 ----
  253. X***************
  254. X*** 414,420 ****
  255. X          topl_set_resp(resp, def);
  256. X  
  257. X          do {
  258. X!             c = nhgetch();
  259. X              if (c && resp && !strchr(resp, c)) {
  260. X                  nhbell();
  261. X                  c = '\0';
  262. X--- 385,391 ----
  263. X          topl_set_resp(resp, def);
  264. X  
  265. X          do {
  266. X!             c = readchar();
  267. X              if (c && resp && !strchr(resp, c)) {
  268. X                  nhbell();
  269. X                  c = '\0';
  270. X*** /tmp/da09430    Thu Feb 25 18:16:50 1993
  271. X--- sys/mac/macwin.c    Thu Feb 25 18:07:54 1993
  272. X***************
  273. X*** 79,85 ****
  274. X--- 79,100 ----
  275. X  
  276. X  Boolean gClickedToMove = 0 ; /* For ObscureCursor */
  277. X  
  278. X+ static unsigned long gNextClickRepeat = 0xffffffff ;
  279. X  
  280. X+ static Point clicked_pos ;    /* For nh_poskey */
  281. X+ static int clicked_mod ;
  282. X+ 
  283. X+ static Boolean cursor_locked = false ;
  284. X+ 
  285. X+ void
  286. X+ lock_mouse_cursor(Boolean new_cursor_locked)
  287. X+ {
  288. X+     cursor_locked = new_cursor_locked;
  289. X+     if (new_cursor_locked)
  290. X+         PostEvent(osEvt, mouseMovedMessage<<24);
  291. X+ }
  292. X+ 
  293. X+ 
  294. X  /*
  295. X   * Add key to input queue, force means replace last if full
  296. X   */
  297. X***************
  298. X*** 115,120 ****
  299. X--- 130,140 ----
  300. X  MacFlags macFlags ;
  301. X  
  302. X  /*
  303. X+  * The screen layouts on the small 512x342 screen need special cares.
  304. X+  */
  305. X+ Boolean small_screen;
  306. X+ 
  307. X+ /*
  308. X   * Async flag for keeping track of scrollbars...
  309. X   * Used by InvalScrollBar ( )
  310. X   */
  311. X***************
  312. X*** 121,129 ****
  313. X  static NhWindow * asyDSC = (NhWindow *) NULL ;
  314. X  
  315. X  /*
  316. X!  * The font to be used in the text window
  317. X   */
  318. X! short text_wind_font = geneva;
  319. X  
  320. X  /*
  321. X   * Whether to adjust the height of a text window according to its contents
  322. X--- 141,150 ----
  323. X  static NhWindow * asyDSC = (NhWindow *) NULL ;
  324. X  
  325. X  /*
  326. X!  * The font to be used in the text window, will be set to geneva after
  327. X!  * we create the base window
  328. X   */
  329. X! short text_wind_font = monaco;
  330. X  
  331. X  /*
  332. X   * Whether to adjust the height of a text window according to its contents
  333. X***************
  334. X*** 136,146 ****
  335. X  MenuHandle appleMenu ;
  336. X  MenuHandle fileMenu ;
  337. X  MenuHandle editMenu ;
  338. X! MenuHandle extendMenu ;
  339. X! MenuHandle miscMenu ;
  340. X! MenuHandle helpMenu ;
  341. X! MenuHandle commandsMenu ;
  342. X  MenuHandle thingsMenu ;
  343. X  
  344. X  #define NHW_BASE 0
  345. X  winid BASE_WINDOW ; // Was: , WIN_MAP , WIN_MESSAGE , WIN_INVEN , WIN_STATUS ;
  346. X--- 157,168 ----
  347. X  MenuHandle appleMenu ;
  348. X  MenuHandle fileMenu ;
  349. X  MenuHandle editMenu ;
  350. X! MenuHandle actionMenu ;
  351. X! MenuHandle inventoryMenu ;
  352. X  MenuHandle thingsMenu ;
  353. X+ MenuHandle extendedMenu ;
  354. X+ MenuHandle infoMenu ;
  355. X+ MenuHandle helpMenu ;
  356. X  
  357. X  #define NHW_BASE 0
  358. X  winid BASE_WINDOW ; // Was: , WIN_MAP , WIN_MESSAGE , WIN_INVEN , WIN_STATUS ;
  359. X***************
  360. X*** 271,277 ****
  361. X      InitSegMgmt( itworked );    /* itworked is always in the main segment */
  362. X      
  363. X      attemptingto("start up");
  364. X!     
  365. X      if ( Gestalt ( gestaltOSAttr , & l ) ) {
  366. X          macFlags . processes = 0 ;
  367. X          macFlags . tempMem = 0 ;
  368. X--- 293,299 ----
  369. X      InitSegMgmt( itworked );    /* itworked is always in the main segment */
  370. X      
  371. X      attemptingto("start up");
  372. X! 
  373. X      if ( Gestalt ( gestaltOSAttr , & l ) ) {
  374. X          macFlags . processes = 0 ;
  375. X          macFlags . tempMem = 0 ;
  376. X***************
  377. X*** 324,330 ****
  378. X  }
  379. X  
  380. X  
  381. X! #define MAX_HEIGHT 200
  382. X  #define MIN_HEIGHT 50
  383. X  #define MIN_WIDTH 300
  384. X  
  385. X--- 346,352 ----
  386. X  }
  387. X  
  388. X  
  389. X! #define MAX_HEIGHT 100
  390. X  #define MIN_HEIGHT 50
  391. X  #define MIN_WIDTH 300
  392. X  
  393. X***************
  394. X*** 355,361 ****
  395. X      width = nhWin -> charWidth * NUM_COLS ;
  396. X  
  397. X      if ( ! RetrievePosition ( kMapWindow , & top , & left ) ) {
  398. X!         top = GetMBarHeight ( ) * 2 ;
  399. X          left = ( screenArea . right - width ) / 2 ;
  400. X      }
  401. X  
  402. X--- 377,383 ----
  403. X      width = nhWin -> charWidth * NUM_COLS ;
  404. X  
  405. X      if ( ! RetrievePosition ( kMapWindow , & top , & left ) ) {
  406. X!         top = GetMBarHeight ( ) + ( small_screen ? 2 : 20 ) ;
  407. X          left = ( screenArea . right - width ) / 2 ;
  408. X      }
  409. X  
  410. X***************
  411. X*** 389,400 ****
  412. X      theWindow = nhWin -> theWindow ;
  413. X  
  414. X      if ( ! RetrievePosition ( kMessageWindow , & top , & left ) ) {
  415. X!         top = statTop + statHeight + 20 ;
  416. X          left = statLeft ;
  417. X      }
  418. X  
  419. X      if ( ! RetrieveSize ( kMessageWindow , top , left , & height , & width ) ) {
  420. X!         height = screenArea . bottom - top - 2 ;
  421. X          if ( height > MAX_HEIGHT ) {
  422. X              height = MAX_HEIGHT ;
  423. X          } else if ( height < MIN_HEIGHT ) {
  424. X--- 411,424 ----
  425. X      theWindow = nhWin -> theWindow ;
  426. X  
  427. X      if ( ! RetrievePosition ( kMessageWindow , & top , & left ) ) {
  428. X!         top = statTop + statHeight ;
  429. X!         if ( ! small_screen )
  430. X!             top += 20 ;
  431. X          left = statLeft ;
  432. X      }
  433. X  
  434. X      if ( ! RetrieveSize ( kMessageWindow , top , left , & height , & width ) ) {
  435. X!         height = screenArea . bottom - top - ( small_screen ? 2-SBARHEIGHT : 2 ) ;
  436. X          if ( height > MAX_HEIGHT ) {
  437. X              height = MAX_HEIGHT ;
  438. X          } else if ( height < MIN_HEIGHT ) {
  439. X***************
  440. X*** 410,419 ****
  441. X      mesgWidth = width ;
  442. X  
  443. X  /* Move these windows */
  444. X-     MoveWindow ( theWindows [ WIN_STATUS ] . theWindow , statLeft , statTop , 1 ) ;
  445. X-     SizeWindow ( theWindows [ WIN_STATUS ] . theWindow , statWidth , statHeight , 1 ) ;
  446. X      MoveWindow ( theWindows [ WIN_MESSAGE ] . theWindow , mesgLeft , mesgTop , 1 ) ;
  447. X      SizeWindow ( theWindows [ WIN_MESSAGE ] . theWindow , mesgWidth , mesgHeight , 1 ) ;
  448. X      MoveWindow ( theWindows [ WIN_MAP ] . theWindow , mainLeft , mainTop , 1 ) ;
  449. X      SizeWindow ( theWindows [ WIN_MAP ] . theWindow , mainWidth , mainHeight , 1 ) ;
  450. X  
  451. X--- 434,443 ----
  452. X      mesgWidth = width ;
  453. X  
  454. X  /* Move these windows */
  455. X      MoveWindow ( theWindows [ WIN_MESSAGE ] . theWindow , mesgLeft , mesgTop , 1 ) ;
  456. X      SizeWindow ( theWindows [ WIN_MESSAGE ] . theWindow , mesgWidth , mesgHeight , 1 ) ;
  457. X+     MoveWindow ( theWindows [ WIN_STATUS ] . theWindow , statLeft , statTop , 1 ) ;
  458. X+     SizeWindow ( theWindows [ WIN_STATUS ] . theWindow , statWidth , statHeight , 1 ) ;
  459. X      MoveWindow ( theWindows [ WIN_MAP ] . theWindow , mainLeft , mainTop , 1 ) ;
  460. X      SizeWindow ( theWindows [ WIN_MAP ] . theWindow , mainWidth , mainHeight , 1 ) ;
  461. X  
  462. X***************
  463. X*** 437,443 ****
  464. X                      } else {
  465. X                          if ( ! RetrievePosition ( kTextWindow , & top , & left ) ) {
  466. X                              top = GetMBarHeight ( ) * 2 ;
  467. X!                             left = screenArea . right - 3 ;
  468. X                          }
  469. X                          top += ( numText * GetMBarHeight ( ) ) ;
  470. X                          while ( top > screenArea . bottom - MIN_HEIGHT ) {
  471. X--- 461,468 ----
  472. X                      } else {
  473. X                          if ( ! RetrievePosition ( kTextWindow , & top , & left ) ) {
  474. X                              top = GetMBarHeight ( ) * 2 ;
  475. X!                             left = screenArea . right - 3 - ( theWindow -> portRect . right -
  476. X!                                                               theWindow -> portRect . left ) ;
  477. X                          }
  478. X                          top += ( numText * GetMBarHeight ( ) ) ;
  479. X                          while ( top > screenArea . bottom - MIN_HEIGHT ) {
  480. X***************
  481. X*** 445,452 ****
  482. X                              left -= 20 ;
  483. X                          }
  484. X                          numText ++ ;
  485. X!                         MoveWindow ( theWindow , left - ( theWindow -> portRect . right -
  486. X!                             theWindow -> portRect . left ) , top , 1 ) ;
  487. X                      }
  488. X                  }
  489. X              }
  490. X--- 470,476 ----
  491. X                              left -= 20 ;
  492. X                          }
  493. X                          numText ++ ;
  494. X!                         MoveWindow ( theWindow , left , top , 1 ) ;
  495. X                      }
  496. X                  }
  497. X              }
  498. X***************
  499. X*** 498,504 ****
  500. X      ( ( WindowPeek ) aWin -> theWindow ) -> windowKind = WIN_BASE_KIND
  501. X          + type ;
  502. X      aWin -> windowTextLen = 0L ;
  503. X-     aWin -> textBase = 0L ;
  504. X      aWin -> clear = 0 ; /* Yes, we need to inval the area on a clear */
  505. X      aWin -> scrollBar = (ControlHandle) NULL ;
  506. X      switch ( type ) {
  507. X--- 522,527 ----
  508. X***************
  509. X*** 530,535 ****
  510. X--- 553,560 ----
  511. X              aWin -> theWindow = (WindowPtr) NULL ;
  512. X              return WIN_ERR ;
  513. X          }
  514. X+         aWin -> windowTextLen = 0L ;
  515. X+         aWin -> lin = 0 ;
  516. X          break ;
  517. X      }
  518. X  
  519. X***************
  520. X*** 600,606 ****
  521. X          siz . bottom - siz . top , FALSE ) ;
  522. X      MoveWindow ( aWin -> theWindow , siz . left , siz . top , FALSE ) ;
  523. X  
  524. X!     if ( type == NHW_MENU || type == NHW_TEXT ) {
  525. X          Rect r = siz ;
  526. X          Boolean bool ;
  527. X          OffsetRect ( & r , - r . left , - r . top ) ;
  528. X--- 625,631 ----
  529. X          siz . bottom - siz . top , FALSE ) ;
  530. X      MoveWindow ( aWin -> theWindow , siz . left , siz . top , FALSE ) ;
  531. X  
  532. X!     if ( type == NHW_MENU || type == NHW_TEXT || type == NHW_MESSAGE ) {
  533. X          Rect r = siz ;
  534. X          Boolean bool ;
  535. X          OffsetRect ( & r , - r . left , - r . top ) ;
  536. X***************
  537. X*** 619,624 ****
  538. X--- 644,660 ----
  539. X  }
  540. X  
  541. X  
  542. X+ static MenuHandle
  543. X+ mustGetMHandle(int menu_id)
  544. X+ {
  545. X+     MenuHandle menu = GetMHandle(menu_id);
  546. X+     if (menu == nil) {
  547. X+         comment("Cannot find the menu.", menu_id);
  548. X+         ExitToShell();
  549. X+     }
  550. X+     return menu;
  551. X+ }
  552. X+ 
  553. X  void
  554. X  InitRes ( void )
  555. X  {
  556. X***************
  557. X*** 628,650 ****
  558. X      mustwork(ResError());
  559. X      SetMenuBar ( mBar ) ;
  560. X      
  561. X!     appleMenu = GetMHandle ( 128 ) ;
  562. X!     mustwork(ResError());
  563. X      AppendMenu ( appleMenu , ( ConstStr255Param ) "\002(-" ) ;
  564. X      AddResMenu ( appleMenu , 'DRVR' ) ;
  565. X  
  566. X!     fileMenu = GetMHandle ( 129 ) ;
  567. X!     mustwork(ResError());
  568. X!     editMenu = GetMHandle ( 130 ) ;
  569. X!     mustwork(ResError());
  570. X!     extendMenu = GetMHandle ( 131 ) ;
  571. X!     mustwork(ResError());
  572. X!     miscMenu = GetMHandle ( 132 ) ;
  573. X!     mustwork(ResError());
  574. X!     commandsMenu = GetMHandle ( 133 ) ;
  575. X!     mustwork ( ResError ( ) ) ;
  576. X!     thingsMenu = GetMHandle ( 134 ) ;
  577. X!     mustwork ( ResError ( ) ) ;
  578. X  
  579. X      if ( macFlags . help ) {
  580. X          if ( HMGetHelpMenuHandle ( & helpMenu ) ) {
  581. X--- 664,680 ----
  582. X      mustwork(ResError());
  583. X      SetMenuBar ( mBar ) ;
  584. X      
  585. X!     appleMenu = mustGetMHandle ( 128 ) ;
  586. X      AppendMenu ( appleMenu , ( ConstStr255Param ) "\002(-" ) ;
  587. X      AddResMenu ( appleMenu , 'DRVR' ) ;
  588. X  
  589. X!     fileMenu = mustGetMHandle ( 129 ) ;
  590. X!     editMenu = mustGetMHandle ( 130 ) ;
  591. X!     actionMenu = mustGetMHandle ( 131 ) ;
  592. X!     inventoryMenu = mustGetMHandle ( 132 ) ;
  593. X!     thingsMenu = mustGetMHandle ( 133 ) ;
  594. X!     extendedMenu = mustGetMHandle ( 134 ) ;
  595. X!     infoMenu = mustGetMHandle ( 135 ) ;
  596. X  
  597. X      if ( macFlags . help ) {
  598. X          if ( HMGetHelpMenuHandle ( & helpMenu ) ) {
  599. X***************
  600. X*** 667,672 ****
  601. X--- 697,706 ----
  602. X  {
  603. X      int i ;
  604. X  
  605. X+     Rect scr = (*GetGrayRgn())->rgnBBox;
  606. X+     small_screen = scr.bottom - scr.top <=    9*40 ||
  607. X+                    scr.bottom - scr.top <= 12*40 && flags.large_font;
  608. X+ 
  609. X      InitRes ( ) ;
  610. X  
  611. X      theWindows = ( NhWindow * ) NewPtr ( NUM_MACWINDOWS *
  612. X***************
  613. X*** 688,698 ****
  614. X      putstr(BASE_WINDOW, 0,
  615. X        "         By Stichting Mathematisch Centrum and M. Stephenson.");
  616. X      putstr(BASE_WINDOW, 0, "         See license for details.");
  617. X!     putstr(BASE_WINDOW, 0, "  ");
  618. X      display_nhwindow(BASE_WINDOW, FALSE);
  619. X  
  620. X      flags . window_inited = 1 ;
  621. X      DimMenuBar ( ) ;
  622. X  }
  623. X  
  624. X  
  625. X--- 722,733 ----
  626. X      putstr(BASE_WINDOW, 0,
  627. X        "         By Stichting Mathematisch Centrum and M. Stephenson.");
  628. X      putstr(BASE_WINDOW, 0, "         See license for details.");
  629. X!     putstr(BASE_WINDOW, 0, "");
  630. X      display_nhwindow(BASE_WINDOW, FALSE);
  631. X  
  632. X      flags . window_inited = 1 ;
  633. X      DimMenuBar ( ) ;
  634. X+     normal_font ( ) ;
  635. X  }
  636. X  
  637. X  
  638. X***************
  639. X*** 720,726 ****
  640. X      Rect r2 = theWindow -> portRect ;
  641. X      Rect r = r2 ;
  642. X      Boolean vis ;
  643. X!     short val ;
  644. X  
  645. X      if ( ! aWin -> scrollBar ) {
  646. X          return ;
  647. X--- 755,761 ----
  648. X      Rect r2 = theWindow -> portRect ;
  649. X      Rect r = r2 ;
  650. X      Boolean vis ;
  651. X!     short val , lin ;
  652. X  
  653. X      if ( ! aWin -> scrollBar ) {
  654. X          return ;
  655. X***************
  656. X*** 730,738 ****
  657. X      r2 . bottom -= SBARHEIGHT ;
  658. X      r2 . right += 1 ;
  659. X      r2 . top -= 1 ;
  660. X!     MoveControl ( aWin -> scrollBar , r2 . left , r2 . top ) ;
  661. X!     SizeControl ( aWin -> scrollBar , r2 . right - r2 . left ,
  662. X!         r2 . bottom - r2 . top ) ;
  663. X      vis = ( r2 . bottom > r2 . top + 50 ) ;
  664. X      if ( vis && ! ( * aWin -> scrollBar ) -> contrlVis ) {
  665. X          ShowControl ( aWin -> scrollBar ) ;
  666. X--- 765,777 ----
  667. X      r2 . bottom -= SBARHEIGHT ;
  668. X      r2 . right += 1 ;
  669. X      r2 . top -= 1 ;
  670. X!     if ( ( * aWin -> scrollBar ) -> contrlRect . top  != r2 . top ||
  671. X!          ( * aWin -> scrollBar ) -> contrlRect . left != r2 . left )
  672. X!         MoveControl ( aWin -> scrollBar , r2 . left , r2 . top ) ;
  673. X!     if ( ( * aWin -> scrollBar ) -> contrlRect . bottom != r2 . bottom ||
  674. X!          ( * aWin -> scrollBar ) -> contrlRect . right  != r2 . right )
  675. X!         SizeControl ( aWin -> scrollBar , r2 . right  - r2 . left ,
  676. X!                                           r2 . bottom - r2 . top ) ;
  677. X      vis = ( r2 . bottom > r2 . top + 50 ) ;
  678. X      if ( vis && ! ( * aWin -> scrollBar ) -> contrlVis ) {
  679. X          ShowControl ( aWin -> scrollBar ) ;
  680. X***************
  681. X*** 739,747 ****
  682. X      } else if ( ! vis && ( * aWin -> scrollBar ) -> contrlVis ) {
  683. X          HideControl ( aWin -> scrollBar ) ;
  684. X      }
  685. X!     if ( aWin -> lin ) {
  686. X!         short max = aWin -> lin - ( r . bottom - r . top ) / aWin ->
  687. X              charHeight ;
  688. X          if ( max < 0 ) max = 0 ;
  689. X          SetCtlMax ( aWin -> scrollBar , max ) ;
  690. X          if ( max ) HiliteControl ( aWin -> scrollBar , 0 ) ;
  691. X--- 778,794 ----
  692. X      } else if ( ! vis && ( * aWin -> scrollBar ) -> contrlVis ) {
  693. X          HideControl ( aWin -> scrollBar ) ;
  694. X      }
  695. X!     lin = aWin -> lin;
  696. X!     if ( aWin == theWindows + WIN_MESSAGE ) {
  697. X!         short min ;
  698. X!         r . bottom -= SBARHEIGHT + 1 ;
  699. X!         min = aWin -> save_lin + ( r . bottom - r . top ) / aWin ->
  700. X              charHeight ;
  701. X+         if ( lin < min )
  702. X+             lin = min ;
  703. X+     }
  704. X+     if ( lin ) {
  705. X+         short max = lin - ( r . bottom - r . top ) / aWin -> charHeight ;
  706. X          if ( max < 0 ) max = 0 ;
  707. X          SetCtlMax ( aWin -> scrollBar , max ) ;
  708. X          if ( max ) HiliteControl ( aWin -> scrollBar , 0 ) ;
  709. X***************
  710. X*** 775,780 ****
  711. X--- 822,828 ----
  712. X  mac_clear_nhwindow ( winid win )
  713. X  {
  714. X      long l ;
  715. X+     Rect r ;
  716. X      register char * start , * stop ;
  717. X      WindowPtr theWindow ;
  718. X      NhWindow * aWin = & theWindows [ win ] ;
  719. X***************
  720. X*** 791,797 ****
  721. X          return ;
  722. X      }
  723. X      SetPort ( theWindow ) ;
  724. X!     InvalRect ( & ( theWindow -> portRect ) ) ;
  725. X      switch ( ( ( WindowPeek ) theWindow ) -> windowKind - WIN_BASE_KIND ) {
  726. X      case NHW_MAP :
  727. X          stop = ( char * ) ( ( MapData * ) ( * aWin -> windowText ) )
  728. X--- 839,850 ----
  729. X          return ;
  730. X      }
  731. X      SetPort ( theWindow ) ;
  732. X!     r = theWindow -> portRect ;
  733. X!     if ( aWin -> scrollBar )
  734. X!         r . right -= SBARWIDTH + 1 ;
  735. X!     if ( aWin == theWindows + WIN_MESSAGE )
  736. X!         r . bottom -= SBARHEIGHT + 1 ;
  737. X!     InvalRect ( & r ) ;
  738. X      switch ( ( ( WindowPeek ) theWindow ) -> windowKind - WIN_BASE_KIND ) {
  739. X      case NHW_MAP :
  740. X          stop = ( char * ) ( ( MapData * ) ( * aWin -> windowText ) )
  741. X***************
  742. X*** 806,836 ****
  743. X          while ( start > stop ) * -- start = CHAR_BLANK ;
  744. X          break ;
  745. X      case NHW_MESSAGE :
  746. X!         l = GetHandleSize ( aWin -> windowText ) ;
  747. X!         if ( l > TEXT_BLOCK * 2 ) {
  748. X!             BlockMove ( * aWin -> windowText + TEXT_BLOCK ,
  749. X!                 * aWin -> windowText , l - TEXT_BLOCK ) ;
  750. X!             SetHandleSize ( aWin -> windowText , l - TEXT_BLOCK ) ;
  751. X!             aWin -> windowTextLen -= TEXT_BLOCK ;
  752. X!             if ( aWin -> windowTextLen < 0 ) {
  753. X!                 aWin -> windowTextLen = 0 ;
  754. X!             }
  755. X          }
  756. X! #if 1
  757. X!         aWin->textBase = aWin->windowTextLen;
  758. X! #else
  759. X!         stop = * aWin -> windowText ;
  760. X!         start = stop + aWin -> windowTextLen - 1 ;
  761. X!         while ( -- start > stop ) {
  762. X!             if ( * start == CHAR_CR || * start == CHAR_LF )
  763. X!                 break ;
  764. X          }
  765. X!         if ( start > stop ) {
  766. X!             aWin -> textBase = start - stop + 1 ;
  767. X!         } else {
  768. X!             aWin -> textBase = 0L ;
  769. X          }
  770. X- #endif
  771. X          break ;
  772. X      default :
  773. X          SetHandleSize ( aWin -> windowText , TEXT_BLOCK ) ;
  774. X--- 859,882 ----
  775. X          while ( start > stop ) * -- start = CHAR_BLANK ;
  776. X          break ;
  777. X      case NHW_MESSAGE :
  778. X!         l = 0;
  779. X!         while (aWin->lin > flags.msg_history) {
  780. X!             const char cr = CHAR_CR;
  781. X!             l = Munger(aWin->windowText, l, &cr, 1, nil, 0) + 1;
  782. X!             --aWin->lin;
  783. X          }
  784. X!         if (l) {
  785. X!             aWin->windowTextLen -= l;
  786. X!             BlockMove(*aWin->windowText + l, *aWin->windowText, aWin->windowTextLen);
  787. X          }
  788. X!         aWin->last_more_lin = aWin->lin;
  789. X!         aWin->save_lin        = aWin->lin;
  790. X!         aWin->scrollPos = aWin->lin ? aWin->lin - 1 : 0;
  791. X!         if (aWin->scrollBar) {
  792. X!             SetCtlMax  (aWin->scrollBar, aWin->lin);
  793. X!             SetCtlValue(aWin->scrollBar, aWin->scrollPos);
  794. X!             InvalScrollBar(aWin);
  795. X          }
  796. X          break ;
  797. X      default :
  798. X          SetHandleSize ( aWin -> windowText , TEXT_BLOCK ) ;
  799. X***************
  800. X*** 838,844 ****
  801. X          aWin -> lin = 0 ;
  802. X          aWin -> wid = 0 ;
  803. X          aWin -> scrollPos = 0 ;
  804. X-         aWin -> textBase = 0L ;
  805. X          if ( aWin -> scrollBar ) {
  806. X              SetCtlMax ( aWin -> scrollBar , 0 ) ;
  807. X              InvalScrollBar ( aWin ) ;
  808. X--- 884,889 ----
  809. X***************
  810. X*** 853,859 ****
  811. X  
  812. X  Boolean
  813. X  ClosingWindowChar(const int c) {
  814. X!     return  c == CHAR_ESC || c == CHAR_BLANK || c == CHAR_LF || c == CHAR_CR ;
  815. X  }
  816. X  
  817. X  
  818. X--- 898,905 ----
  819. X  
  820. X  Boolean
  821. X  ClosingWindowChar(const int c) {
  822. X!     return  c == CHAR_ESC || c == CHAR_BLANK || c == CHAR_LF || c == CHAR_CR ||
  823. X!             c == 'q' ;
  824. X  }
  825. X  
  826. X  
  827. X***************
  828. X*** 884,889 ****
  829. X--- 930,938 ----
  830. X  {
  831. X      if (!top_line || in_topl_mode())
  832. X          Debugger();
  833. X+ 
  834. X+     putstr(WIN_MESSAGE, ATR_BOLD, query);
  835. X+ 
  836. X      (*top_line)->viewRect.left = 0;
  837. X  
  838. X      topl_query_len = strlen(query);
  839. X***************
  840. X*** 893,899 ****
  841. X      TECalText(top_line);
  842. X  
  843. X      display_nhwindow(WIN_MESSAGE, FALSE);
  844. X-     putstr(WIN_MESSAGE, ATR_BOLD, query);
  845. X  }
  846. X  
  847. X  
  848. X--- 942,947 ----
  849. X***************
  850. X*** 902,912 ****
  851. X  {
  852. X      int ans_len = (*top_line)->teLength - topl_query_len;
  853. X      NhWindow *aWin = theWindows + WIN_MESSAGE;
  854. X-     char tmp[3] = "  ";
  855. X  
  856. X      if (!in_topl_mode())
  857. X          Debugger();
  858. X-     (*top_line)->viewRect.left += 10000;
  859. X  
  860. X      BlockMove(*(*top_line)->hText + topl_query_len, answer, ans_len);
  861. X      answer[ans_len] = '\0';
  862. X--- 950,958 ----
  863. X***************
  864. X*** 916,926 ****
  865. X          -- aWin -> windowTextLen ;
  866. X          -- aWin -> lin ;
  867. X      }
  868. X!     if (strlen(answer) <= 1) {
  869. X!         if (answer[0]) tmp[0] = answer[0];
  870. X!         putstr(WIN_MESSAGE, ATR_BOLD, tmp);
  871. X!     } else
  872. X!         putstr(WIN_MESSAGE, ATR_BOLD, answer);
  873. X  }
  874. X  
  875. X  /*
  876. X--- 962,970 ----
  877. X          -- aWin -> windowTextLen ;
  878. X          -- aWin -> lin ;
  879. X      }
  880. X!     putstr(WIN_MESSAGE, ATR_BOLD, answer);
  881. X! 
  882. X!     (*top_line)->viewRect.left += 10000;
  883. X  }
  884. X  
  885. X  /*
  886. X***************
  887. X*** 1044,1054 ****
  888. X      int r_len, r_len1;
  889. X  
  890. X      if (!resp) {
  891. X!         static char any_str[2] = { CHAR_ANY, '\0' };
  892. X          resp = any_str;
  893. X          def = CHAR_ANY;
  894. X      }
  895. X  
  896. X      r_len1 = strlen(resp);
  897. X      r_len  = strlen(topl_resp);
  898. X      if (r_len < r_len1)
  899. X--- 1088,1099 ----
  900. X      int r_len, r_len1;
  901. X  
  902. X      if (!resp) {
  903. X!         const char any_str[2] = { CHAR_ANY, '\0' };
  904. X          resp = any_str;
  905. X          def = CHAR_ANY;
  906. X      }
  907. X  
  908. X+     SetPort(theWindows[WIN_MESSAGE].theWindow);
  909. X      r_len1 = strlen(resp);
  910. X      r_len  = strlen(topl_resp);
  911. X      if (r_len < r_len1)
  912. X***************
  913. X*** 1123,1128 ****
  914. X--- 1168,1206 ----
  915. X  }
  916. X  
  917. X  
  918. X+ void
  919. X+ adjust_window_pos(NhWindow *aWin, WindowPtr theWindow, short w)
  920. X+ {
  921. X+     const Rect scr_r   = (*GetGrayRgn())->rgnBBox,
  922. X+                win_ind = { 20, 2, 3, 3 };
  923. X+     const short    min_w = theWindow->portRect.right - theWindow->portRect.left,
  924. X+                 max_w = scr_r.right - scr_r.left - win_ind.left - win_ind.right;
  925. X+     Point pos;
  926. X+     short h = aWin->lin * aWin->charHeight, max_h;
  927. X+ 
  928. X+     SetPort(theWindow);
  929. X+     if (!RetrieveWinPos(theWindow, &pos.v, &pos.h)) {
  930. X+         pos.v = theWindow->portRect.top;
  931. X+         pos.h = theWindow->portRect.left;
  932. X+         LocalToGlobal(&pos);
  933. X+     }
  934. X+ 
  935. X+     max_h = full_screen ? scr_r.bottom - win_ind.bottom - scr_r.top - win_ind.top
  936. X+                         : scr_r.bottom - win_ind.bottom - pos.v;
  937. X+     if (h > max_h      ) h = max_h;
  938. X+     if (h < MIN_HEIGHT) h = MIN_HEIGHT;
  939. X+     if (w < min_w      ) w = min_w;
  940. X+     if (w > max_w      ) w = max_w;
  941. X+     SizeWindow(theWindow, w, h, true);
  942. X+ 
  943. X+     if (pos.v + h + win_ind.bottom > scr_r.bottom)
  944. X+         pos.v = scr_r.bottom - h - win_ind.bottom;
  945. X+     if (pos.h + w + win_ind.right  > scr_r.right)
  946. X+         pos.h = scr_r.right     - w - win_ind.right;
  947. X+     MoveWindow(theWindow, pos.h, pos.v, false);
  948. X+ }
  949. X+ 
  950. X+ 
  951. X  /*
  952. X   * display/select/update the window.
  953. X   * If f is true, this window should be "modal" - don't return
  954. X***************
  955. X*** 1145,1213 ****
  956. X      }
  957. X  
  958. X      if ( f && inSelect == WIN_ERR && ( win == BASE_WINDOW || win == WIN_MESSAGE ) ) {
  959. X!         if ( win == WIN_MESSAGE )
  960. X              topl_set_resp ( NULL , 0 ) ;
  961. X!         /* The following piece of code prevents the "-- More --" prompt to be on a new
  962. X!            line by itself.  I comment it out because the result looks ugly to me. */
  963. X! #ifdef 0
  964. X!         if ( aWin -> windowTextLen > 0 &&
  965. X!              ( * aWin -> windowText ) [ aWin -> windowTextLen - 1 ] == CHAR_CR ) {
  966. X!             -- aWin -> windowTextLen ;
  967. X!             -- aWin -> lin ;
  968. X          }
  969. X! #endif
  970. X!         putstr ( win , ATR_INVERSE , "-- More --" ) ;
  971. X      }
  972. X  
  973. X!     if ( ! ( ( WindowPeek ) theWindow ) -> visible ) {
  974. X!         const Rect scr_r   = (*GetGrayRgn())->rgnBBox,
  975. X!                    win_ind = { 20, 2, 3, 3 };
  976. X!         const Point scr_sz = { scr_r.bottom - scr_r.top, scr_r.right - scr_r.left },
  977. X!                     wp_sz  = { theWindow->portRect.bottom - theWindow->portRect.top,
  978. X!                                theWindow->portRect.right  - theWindow->portRect.left };
  979. X!         const short max_h = scr_sz.v - win_ind.top    - win_ind.bottom,
  980. X!                     max_w = scr_sz.h - win_ind.left - win_ind.right;
  981. X!         const char cr = CHAR_CR;
  982. X  
  983. X!         long line_start = 0, line_end;
  984. X!         short w = wp_sz.h,
  985. X!               h = full_screen ? aWin->lin * aWin->charHeight : wp_sz.v;
  986. X!         Point pos = { theWindow->portRect.top, theWindow->portRect.left };
  987. X!         SetPort(theWindow);
  988. X!         LocalToGlobal(&pos);
  989. X  
  990. X!         HLock(aWin->windowText);
  991. X!         while (line_start < aWin->windowTextLen) {
  992. X!             short line_w;
  993. X!             line_end = Munger(aWin->windowText, line_start, &cr, 1, nil, 0);
  994. X!             if (line_end < 0)
  995. X!                 line_end = aWin->windowTextLen;
  996. X!             line_w = TextWidth(*aWin->windowText, line_start, line_end - line_start) +
  997. X!                      (SBARWIDTH + 2);
  998. X!             if (w < line_w)
  999. X!                 w = line_w;
  1000. X!             line_start = line_end + 1;
  1001. X!         }
  1002. X!         HUnlock(aWin->windowText);
  1003. X! 
  1004. X!         if (h > max_h) h = max_h;
  1005. X!         if (w > max_w) w = max_w;
  1006. X!         SizeWindow(theWindow, w, h, FALSE);
  1007. X! 
  1008. X!         if ( ! ( ( WindowPeek ) theWindow ) -> visible ) {
  1009. X!             short top , left ;
  1010. X!             if ( ! RetrieveWinPos ( theWindow , & top , & left ) ) {
  1011. X!                 if (pos.v + h + win_ind.bottom > scr_r.bottom)
  1012. X!                     pos.v = scr_r.bottom - h - win_ind.bottom;
  1013. X!                 if (pos.h + w + win_ind.right  > scr_r.right)
  1014. X!                     pos.h = scr_r.right     - w - win_ind.right;
  1015. X!                 top = pos . v ;
  1016. X!                 left = pos . h ;
  1017. X              }
  1018. X!             MoveWindow(theWindow, left, top, FALSE);
  1019. X          }
  1020. X  
  1021. X!         SelectWindow ( theWindow ) ;
  1022. X          ShowWindow ( theWindow ) ;
  1023. X      }
  1024. X  
  1025. X--- 1223,1266 ----
  1026. X      }
  1027. X  
  1028. X      if ( f && inSelect == WIN_ERR && ( win == BASE_WINDOW || win == WIN_MESSAGE ) ) {
  1029. X!         if ( win == WIN_MESSAGE ) {
  1030. X              topl_set_resp ( NULL , 0 ) ;
  1031. X!             if ( aWin -> windowTextLen > 0 &&
  1032. X!                  ( * aWin -> windowText ) [ aWin -> windowTextLen - 1 ] == CHAR_CR ) {
  1033. X!                 -- aWin -> windowTextLen ;
  1034. X!                 -- aWin -> lin ;
  1035. X!             }
  1036. X          }
  1037. X!         putstr ( win , flags . standout ? ATR_INVERSE : ATR_NONE , " --More--" ) ;
  1038. X      }
  1039. X  
  1040. X!     if ( ! ( ( WindowPeek ) theWindow ) -> visible || full_screen ) {
  1041. X  
  1042. X!         int kind = ((WindowPeek)theWindow)->windowKind - WIN_BASE_KIND;
  1043. X!         if (kind == NHW_TEXT || kind == NHW_MENU) {
  1044. X!             const char cr = CHAR_CR;
  1045. X!             short w = 0;
  1046. X!             long line_start = 0;
  1047. X!             HLock(aWin->windowText);
  1048. X  
  1049. X!             while (line_start < aWin->windowTextLen) {
  1050. X!                 long line_end;
  1051. X!                 short line_w;
  1052. X!                 line_end = Munger(aWin->windowText, line_start, &cr, 1, nil, 0);
  1053. X!                 if (line_end < 0)
  1054. X!                     line_end = aWin->windowTextLen;
  1055. X!                 line_w = TextWidth(*aWin->windowText, line_start, line_end - line_start);
  1056. X!                 if (w < line_w)
  1057. X!                     w = line_w;
  1058. X!                 line_start = line_end + 1;
  1059. X              }
  1060. X!             HUnlock(aWin->windowText);
  1061. X! 
  1062. X!             adjust_window_pos(aWin, theWindow, w + (SBARWIDTH+2));
  1063. X          }
  1064. X  
  1065. X!         if ( ! small_screen || win != WIN_MESSAGE || f )
  1066. X!             SelectWindow ( theWindow ) ;
  1067. X          ShowWindow ( theWindow ) ;
  1068. X      }
  1069. X  
  1070. X***************
  1071. X*** 1227,1233 ****
  1072. X  
  1073. X          if ( win == WIN_MESSAGE )
  1074. X              topl_set_resp ( "" , '\0' ) ;
  1075. X!         else
  1076. X              HideWindow ( theWindow ) ;
  1077. X  
  1078. X      } else {
  1079. X--- 1280,1286 ----
  1080. X  
  1081. X          if ( win == WIN_MESSAGE )
  1082. X              topl_set_resp ( "" , '\0' ) ;
  1083. X!         else if ( win != WIN_MAP && win != WIN_STATUS )
  1084. X              HideWindow ( theWindow ) ;
  1085. X  
  1086. X      } else {
  1087. X***************
  1088. X*** 1325,1334 ****
  1089. X  void
  1090. X  GeneralKey ( EventRecord * theEvent , WindowPtr theWindow )
  1091. X  {
  1092. X-     int i ;
  1093. X- 
  1094. X      trans_num_keys ( theEvent ) ;
  1095. X- 
  1096. X      addToKeyQueue ( topl_resp_key ( theEvent -> message & 0xff ) , 1 ) ;
  1097. X  }
  1098. X  
  1099. X--- 1378,1384 ----
  1100. X***************
  1101. X*** 1426,1431 ****
  1102. X--- 1476,1483 ----
  1103. X          }
  1104. X          ++r_idx;
  1105. X      }
  1106. X+ 
  1107. X+     macClickText(theEvent, theWindow);
  1108. X  }
  1109. X  
  1110. X  
  1111. X***************
  1112. X*** 1441,1472 ****
  1113. X  static void
  1114. X  macClickMap ( EventRecord * theEvent , WindowPtr theWindow )
  1115. X  {
  1116. X!     if ( ! theEvent || ! theWindow ) {
  1117. X!         Debugger ( ) ;
  1118. X!     }
  1119. X!     {
  1120. X!         NhWindow * nhw = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  1121. X!         Point where ;
  1122. X!         short posX , posY ;
  1123. X!         short sector ;
  1124. X!         char theDirectionChar [ 18 ] = {
  1125. X!             ' ' , 'k' , 'u' , 'l' , 'n' , 'j' , 'b' , 'h' , 'y' ,
  1126. X!             'o' , 'K' , 'U' , 'L' , 'N' , 'J' , 'B' , 'H' , 'Y' ,
  1127. X!         } ;
  1128. X  
  1129. X!         where = theEvent -> where ;
  1130. X!         GlobalToLocal ( & where ) ;
  1131. X!         posX = where . h / nhw -> charWidth ;
  1132. X!         posY = where . v / nhw -> charHeight ;
  1133. X! 
  1134. X!     /* 0 is ON, 1 is top, then clockwise */
  1135. X!         sector = clickSector ( u . ux , u . uy , posX , posY ) ;
  1136. X!         if ( theEvent -> modifiers & shiftKey ) {
  1137. X!             sector += 9 ;
  1138. X!         }
  1139. X!         addToKeyQueue ( theDirectionChar [ sector ] , 0 ) ;
  1140. X! 
  1141. X!         gClickedToMove = 1 ;
  1142. X      }
  1143. X  }
  1144. X  
  1145. X--- 1493,1516 ----
  1146. X  static void
  1147. X  macClickMap ( EventRecord * theEvent , WindowPtr theWindow )
  1148. X  {
  1149. X!     int shift_down = theEvent->modifiers & shiftKey;
  1150. X!     NhWindow *nhw = (NhWindow *)GetWRefCon(theWindow);
  1151. X!     Point where = theEvent->where;
  1152. X!         GlobalToLocal(&where);
  1153. X!         where.h /= nhw->charWidth;
  1154. X!         where.v /= nhw->charHeight;
  1155. X!     clicked_mod = shift_down ? CLICK_2 : CLICK_1;
  1156. X  
  1157. X!     if (strchr(topl_resp, click_to_cmd(where.h, where.v, clicked_mod)))
  1158. X!         nhbell();
  1159. X!     else {
  1160. X!         if (cursor_locked)
  1161. X!             while (WaitMouseUp())
  1162. X!                 SystemTask();
  1163. X!         else if (!shift_down)
  1164. X!             gNextClickRepeat = TickCount() + *(short *)KeyThresh;
  1165. X!         gClickedToMove = TRUE;
  1166. X!         clicked_pos = where;
  1167. X      }
  1168. X  }
  1169. X  
  1170. X***************
  1171. X*** 1495,1508 ****
  1172. X      SetCtlValue ( theBar , now - amtToScroll ) ;
  1173. X      winToScroll -> scrollPos = now - amtToScroll ;
  1174. X      r = winToScroll -> theWindow -> portRect ;
  1175. X!     r . right -= 15 ;
  1176. X      ScrollRect ( & r , 0 , amtToScroll * winToScroll -> charHeight , rgn ) ;
  1177. X      if ( rgn ) {
  1178. X          InvalRgn ( rgn ) ;
  1179. X-         r . top = r . bottom - 16 ;
  1180. X-         r . left = r . right ;
  1181. X-         r . right += 15 ;
  1182. X-         InvalRect ( & r ) ;
  1183. X          BeginUpdate ( winToScroll -> theWindow ) ;
  1184. X      }
  1185. X      winToScroll -> updateFunc  ( & fake , winToScroll -> theWindow ) ;
  1186. X--- 1539,1550 ----
  1187. X      SetCtlValue ( theBar , now - amtToScroll ) ;
  1188. X      winToScroll -> scrollPos = now - amtToScroll ;
  1189. X      r = winToScroll -> theWindow -> portRect ;
  1190. X!     r . right -= SBARWIDTH ;
  1191. X!     if ( winToScroll == theWindows + WIN_MESSAGE )
  1192. X!         r . bottom -= SBARHEIGHT + 1 ;
  1193. X      ScrollRect ( & r , 0 , amtToScroll * winToScroll -> charHeight , rgn ) ;
  1194. X      if ( rgn ) {
  1195. X          InvalRgn ( rgn ) ;
  1196. X          BeginUpdate ( winToScroll -> theWindow ) ;
  1197. X      }
  1198. X      winToScroll -> updateFunc  ( & fake , winToScroll -> theWindow ) ;
  1199. X***************
  1200. X*** 1535,1548 ****
  1201. X      SetCtlValue ( theBar , now + amtToScroll ) ;
  1202. X      winToScroll -> scrollPos = now + amtToScroll ;
  1203. X      r = winToScroll -> theWindow -> portRect ;
  1204. X!     r . right -= 15 ;
  1205. X      ScrollRect ( & r , 0 , - amtToScroll * winToScroll -> charHeight , rgn ) ; 
  1206. X      if ( rgn ) {
  1207. X          InvalRgn ( rgn ) ;
  1208. X-         r . top = r . bottom - 16 ;
  1209. X-         r . left = r . right ;
  1210. X-         r . right += 15 ;
  1211. X-         InvalRect ( & r ) ;
  1212. X          BeginUpdate ( winToScroll -> theWindow ) ;
  1213. X      }
  1214. X      winToScroll -> updateFunc  ( & fake , winToScroll -> theWindow ) ;
  1215. X--- 1577,1588 ----
  1216. X      SetCtlValue ( theBar , now + amtToScroll ) ;
  1217. X      winToScroll -> scrollPos = now + amtToScroll ;
  1218. X      r = winToScroll -> theWindow -> portRect ;
  1219. X!     r . right -= SBARWIDTH ;
  1220. X!     if ( winToScroll == theWindows + WIN_MESSAGE )
  1221. X!         r . bottom -= SBARHEIGHT + 1 ;
  1222. X      ScrollRect ( & r , 0 , - amtToScroll * winToScroll -> charHeight , rgn ) ; 
  1223. X      if ( rgn ) {
  1224. X          InvalRgn ( rgn ) ;
  1225. X          BeginUpdate ( winToScroll -> theWindow ) ;
  1226. X      }
  1227. X      winToScroll -> updateFunc  ( & fake , winToScroll -> theWindow ) ;
  1228. X***************
  1229. X*** 1615,1620 ****
  1230. X--- 1655,1674 ----
  1231. X  }
  1232. X  
  1233. X  
  1234. X+ int
  1235. X+ mac_doprev_message(void)
  1236. X+ {
  1237. X+     if (WIN_MESSAGE) {
  1238. X+         display_nhwindow(WIN_MESSAGE, FALSE);
  1239. X+         amtToScroll = 1;
  1240. X+         winToScroll = &theWindows[WIN_MESSAGE];
  1241. X+         SetPort(winToScroll->theWindow);
  1242. X+         Up(winToScroll->scrollBar, inUpButton);
  1243. X+     }    
  1244. X+     return 0 ;
  1245. X+ }
  1246. X+ 
  1247. X+ 
  1248. X  static void
  1249. X  macClickMenu ( EventRecord * theEvent , WindowPtr theWindow )
  1250. X  {
  1251. X***************
  1252. X*** 1742,1747 ****
  1253. X--- 1796,1802 ----
  1254. X  
  1255. X      GetClip(org_clip);
  1256. X  
  1257. X+     DrawControls(theWindow);
  1258. X      DrawGrowIcon(theWindow);
  1259. X  
  1260. X      l = 0;
  1261. X***************
  1262. X*** 1794,1808 ****
  1263. X      /* Clip to the portrect - scrollbar/growicon *before* adjusting the rect
  1264. X          to be larger than the size of the window (!) */
  1265. X      RectRgn(clip, &r);
  1266. X      if ( r . right < MIN_RIGHT )
  1267. X          r . right = MIN_RIGHT ;
  1268. X  
  1269. X      if (in_topl_mode()) {
  1270. X          RgnHandle topl_rgn = NewRgn();
  1271. X          Rect topl_r = r;
  1272. X!         for (l = aWin->windowTextLen - 1; --l >= aWin->textBase; )
  1273. X!             if ((*aWin->windowText)[l] == CHAR_CR)
  1274. X!                 topl_r.top += aWin->charHeight;
  1275. X          l = (*top_line)->destRect.right - (*top_line)->destRect.left;
  1276. X          (*top_line)->viewRect = topl_r;
  1277. X          (*top_line)->destRect = topl_r;
  1278. X--- 1849,1880 ----
  1279. X      /* Clip to the portrect - scrollbar/growicon *before* adjusting the rect
  1280. X          to be larger than the size of the window (!) */
  1281. X      RectRgn(clip, &r);
  1282. X+     SectRgn(clip, org_clip, clip);
  1283. X      if ( r . right < MIN_RIGHT )
  1284. X          r . right = MIN_RIGHT ;
  1285. X+     r . top -= aWin -> scrollPos * aWin -> charHeight ;
  1286. X  
  1287. X+ #if 0
  1288. X+     /* If you enable this band of code (and disable the next band), you will get
  1289. X+        fewer flickers but a slower performance while drawing the dot line. */
  1290. X+     {    RgnHandle dotl_rgn = NewRgn();
  1291. X+         Rect dotl;
  1292. X+         dotl.left    = r.left;
  1293. X+         dotl.right    = r.right;
  1294. X+         dotl.bottom = r.top + aWin->save_lin * aWin->charHeight;
  1295. X+         dotl.top    = dotl.bottom - 1;
  1296. X+         FillRect(&dotl, &qd.gray);
  1297. X+         RectRgn(dotl_rgn, &dotl);
  1298. X+         DiffRgn(clip, dotl_rgn, clip);
  1299. X+         DisposeRgn(dotl_rgn);
  1300. X+         SetClip(clip);
  1301. X+     }
  1302. X+ #endif
  1303. X+ 
  1304. X      if (in_topl_mode()) {
  1305. X          RgnHandle topl_rgn = NewRgn();
  1306. X          Rect topl_r = r;
  1307. X!         topl_r.top += (aWin->lin - 1) * aWin->charHeight;
  1308. X          l = (*top_line)->destRect.right - (*top_line)->destRect.left;
  1309. X          (*top_line)->viewRect = topl_r;
  1310. X          (*top_line)->destRect = topl_r;
  1311. X***************
  1312. X*** 1812,1830 ****
  1313. X          RectRgn(topl_rgn, &topl_r);
  1314. X          DiffRgn(clip, topl_rgn, clip);
  1315. X          DisposeRgn(topl_rgn);
  1316. X      }
  1317. X  
  1318. X-     SectRgn(clip, org_clip, clip);
  1319. X-     SetClip(clip);
  1320. X      DisposeRgn(clip);
  1321. X  
  1322. X      TextFont ( aWin -> fontNum ) ;
  1323. X      TextSize ( aWin -> fontSize ) ;
  1324. X      HLock ( aWin -> windowText ) ;
  1325. X!     TextBox ( * ( aWin -> windowText ) + aWin -> textBase , aWin ->
  1326. X!         windowTextLen - aWin -> textBase , & r , teJustLeft ) ;
  1327. X      HUnlock ( aWin -> windowText ) ;
  1328. X  
  1329. X      SetClip(org_clip);
  1330. X      DisposeRgn(org_clip);
  1331. X  }
  1332. X--- 1884,1906 ----
  1333. X          RectRgn(topl_rgn, &topl_r);
  1334. X          DiffRgn(clip, topl_rgn, clip);
  1335. X          DisposeRgn(topl_rgn);
  1336. X+         SetClip(clip);
  1337. X      }
  1338. X  
  1339. X      DisposeRgn(clip);
  1340. X  
  1341. X      TextFont ( aWin -> fontNum ) ;
  1342. X      TextSize ( aWin -> fontSize ) ;
  1343. X      HLock ( aWin -> windowText ) ;
  1344. X!     TextBox ( * aWin -> windowText , aWin -> windowTextLen , & r , teJustLeft ) ;
  1345. X      HUnlock ( aWin -> windowText ) ;
  1346. X  
  1347. X+ #if 1
  1348. X+     r.bottom = r.top + aWin->save_lin * aWin->charHeight;
  1349. X+     r.top     = r.bottom - 1;
  1350. X+     FillRect(&r, &qd.gray);
  1351. X+ #endif
  1352. X+ 
  1353. X      SetClip(org_clip);
  1354. X      DisposeRgn(org_clip);
  1355. X  }
  1356. X***************
  1357. X*** 1941,1948 ****
  1358. X          r . right = MIN_RIGHT ;
  1359. X      r . top -= aWin -> scrollPos * aWin -> charHeight ;
  1360. X      HLock ( aWin -> windowText ) ;
  1361. X!     TextBox ( * ( aWin -> windowText ) + aWin -> textBase , aWin ->
  1362. X!         windowTextLen - aWin -> textBase , & r , teJustLeft ) ;
  1363. X      HUnlock ( aWin -> windowText ) ;
  1364. X      if ( h ) {
  1365. X          SetClip ( h ) ;
  1366. X--- 2017,2023 ----
  1367. X          r . right = MIN_RIGHT ;
  1368. X      r . top -= aWin -> scrollPos * aWin -> charHeight ;
  1369. X      HLock ( aWin -> windowText ) ;
  1370. X!     TextBox ( * aWin -> windowText , aWin -> windowTextLen , & r , teJustLeft ) ;
  1371. X      HUnlock ( aWin -> windowText ) ;
  1372. X      if ( h ) {
  1373. X          SetClip ( h ) ;
  1374. X***************
  1375. X*** 1989,1996 ****
  1376. X      r . top -= aWin -> scrollPos * aWin -> charHeight ;
  1377. X      r . right -= SBARWIDTH;
  1378. X      HLock ( aWin -> windowText ) ;
  1379. X!     TextBox ( * ( aWin -> windowText ) + aWin -> textBase , aWin ->
  1380. X!         windowTextLen - aWin -> textBase , & r , teJustLeft ) ;
  1381. X      HUnlock ( aWin -> windowText ) ;
  1382. X      draw_growicon_vert_only(theWindow);
  1383. X      if ( h ) {
  1384. X--- 2064,2070 ----
  1385. X      r . top -= aWin -> scrollPos * aWin -> charHeight ;
  1386. X      r . right -= SBARWIDTH;
  1387. X      HLock ( aWin -> windowText ) ;
  1388. X!     TextBox ( * aWin -> windowText , aWin -> windowTextLen , & r , teJustLeft ) ;
  1389. X      HUnlock ( aWin -> windowText ) ;
  1390. X      draw_growicon_vert_only(theWindow);
  1391. X      if ( h ) {
  1392. X***************
  1393. X*** 2037,2042 ****
  1394. X--- 2111,2117 ----
  1395. X  macCursorMap ( EventRecord * theEvent , WindowPtr theWindow , RgnHandle mouseRgn )
  1396. X  {
  1397. X      Point where ;
  1398. X+     char * dir_bas , * dir ;
  1399. X      CursHandle ch ;
  1400. X      GrafPtr gp ;
  1401. X      NhWindow * nhw = ( NhWindow * ) GetWRefCon ( theWindow ) ;
  1402. X***************
  1403. X*** 2047,2059 ****
  1404. X  
  1405. X      where = theEvent -> where ;
  1406. X      GlobalToLocal ( & where ) ;
  1407. X!     ch = GetCursor ( 512 + clickSector ( u . ux , u . uy , where . h / nhw -> charWidth ,
  1408. X!         where . v / nhw -> charHeight ) ) ;
  1409. X      if ( ch ) {
  1410. X  
  1411. X          HLock ( ( Handle ) ch ) ;
  1412. X          SetCursor ( * ch ) ;
  1413. X!         ReleaseResource ( ( Handle ) ch ) ;
  1414. X  
  1415. X      } else {
  1416. X  
  1417. X--- 2122,2142 ----
  1418. X  
  1419. X      where = theEvent -> where ;
  1420. X      GlobalToLocal ( & where ) ;
  1421. X! 
  1422. X!     if ( cursor_locked )
  1423. X!         dir = NULL ;
  1424. X!     else {
  1425. X!         dir_bas = flags . num_pad ? ndir : sdir ;
  1426. X!         dir = strchr ( dir_bas , click_to_cmd ( where . h / nhw -> charWidth ,
  1427. X!                                                 where . v / nhw -> charHeight ,
  1428. X!                                                 CLICK_1 ) ) ;
  1429. X!     }
  1430. X!     ch = GetCursor ( dir ? dir - dir_bas + 513 : 512 ) ;
  1431. X      if ( ch ) {
  1432. X  
  1433. X          HLock ( ( Handle ) ch ) ;
  1434. X          SetCursor ( * ch ) ;
  1435. X!         HUnlock ( ( Handle ) ch ) ;
  1436. X  
  1437. X      } else {
  1438. X  
  1439. X***************
  1440. X*** 2226,2231 ****
  1441. X--- 2309,2316 ----
  1442. X              InitCursor ( ) ;
  1443. X              SetRect ( & r , 80 , 2 * aWin -> charHeight + 1 , r . right ,
  1444. X                  r . bottom ) ;
  1445. X+             if ( aWin == theWindows + WIN_MESSAGE )
  1446. X+                 r . top += SBARHEIGHT + 1 ;
  1447. X              l = GrowWindow ( theWindow , theEvent -> where , & r ) ;
  1448. X              SizeWindow ( theWindow , l & 0xffff , l >> 16 , FALSE ) ;
  1449. X              SaveWindowSize ( theWindow ) ;
  1450. X***************
  1451. X*** 2347,2372 ****
  1452. X              }
  1453. X              FlushEvents ( keyDownMask , 0 ) ;
  1454. X          }
  1455. X-         /*
  1456. X-          * This somewhat elaborate hack is needed to make the menu
  1457. X-          * commands work right. They're also needed for fast typists.
  1458. X-          */
  1459. X-         if ( keyQueue [ 0 ] && in_topl_mode() ) {
  1460. X-             int i ;
  1461. X- 
  1462. X-             theEvent -> what = keyDown ;
  1463. X-             theEvent -> modifiers = 0 ;
  1464. X-             theEvent -> message = keyQueue [ 0 ] ;
  1465. X- 
  1466. X- /* extract from key queue */
  1467. X-             for ( i = 0 ; i < QUEUE_LEN - 1 ; i ++ ) {
  1468. X-                 keyQueue [ i ] = keyQueue [ i + 1 ] ;
  1469. X-             }
  1470. X-             keyQueue [ i ] = 0 ;
  1471. X-             SetPort ( theWindows [ WIN_MESSAGE ] . theWindow ) ;
  1472. X-             theWindows [ WIN_MESSAGE ] . keyFunc ( theEvent ,
  1473. X-                 theWindows [ WIN_MESSAGE ] . theWindow ) ;
  1474. X-         }
  1475. X          break ;
  1476. X      }
  1477. X  }
  1478. X--- 2432,2437 ----
  1479. X***************
  1480. X*** 2380,2389 ****
  1481. X      DisableItem ( appleMenu , 0 ) ;
  1482. X      DisableItem ( fileMenu , 0 ) ;
  1483. X      DisableItem ( editMenu , 0 ) ;
  1484. X!     DisableItem ( extendMenu , 0 ) ;
  1485. X!     DisableItem ( miscMenu , 0 ) ;
  1486. X!     DisableItem ( commandsMenu , 0 ) ;
  1487. X      DisableItem ( thingsMenu , 0 ) ;
  1488. X      DrawMenuBar ( ) ;
  1489. X  }
  1490. X  
  1491. X--- 2445,2455 ----
  1492. X      DisableItem ( appleMenu , 0 ) ;
  1493. X      DisableItem ( fileMenu , 0 ) ;
  1494. X      DisableItem ( editMenu , 0 ) ;
  1495. X!     DisableItem ( actionMenu , 0 ) ;
  1496. X!     DisableItem ( inventoryMenu , 0 ) ;
  1497. X      DisableItem ( thingsMenu , 0 ) ;
  1498. X+     DisableItem ( extendedMenu , 0 ) ;
  1499. X+     DisableItem ( infoMenu , 0 ) ;
  1500. X      DrawMenuBar ( ) ;
  1501. X  }
  1502. X  
  1503. X***************
  1504. X*** 2394,2403 ****
  1505. X      EnableItem ( appleMenu , 0 ) ;
  1506. X      EnableItem ( fileMenu , 0 ) ;
  1507. X      EnableItem ( editMenu , 0 ) ;
  1508. X!     EnableItem ( extendMenu , 0 ) ;
  1509. X!     EnableItem ( miscMenu , 0 ) ;
  1510. X!     EnableItem ( commandsMenu , 0 ) ;
  1511. X      EnableItem ( thingsMenu , 0 ) ;
  1512. X      DrawMenuBar ( ) ;
  1513. X  }
  1514. X  
  1515. X--- 2460,2470 ----
  1516. X      EnableItem ( appleMenu , 0 ) ;
  1517. X      EnableItem ( fileMenu , 0 ) ;
  1518. X      EnableItem ( editMenu , 0 ) ;
  1519. X!     EnableItem ( actionMenu , 0 ) ;
  1520. X!     EnableItem ( inventoryMenu , 0 ) ;
  1521. X      EnableItem ( thingsMenu , 0 ) ;
  1522. X+     EnableItem ( extendedMenu , 0 ) ;
  1523. X+     EnableItem ( infoMenu , 0 ) ;
  1524. X      DrawMenuBar ( ) ;
  1525. X  }
  1526. X  
  1527. X***************
  1528. X*** 2408,2422 ****
  1529. X  {
  1530. X      EventRecord anEvent ;
  1531. X  
  1532. X!     if ( ( inSelect != WIN_ERR || ! flags . window_inited || in_topl_mode() ) &&
  1533. X!         ! mBarDimmed ) {
  1534. X!         DimMenuBar ( ) ;
  1535. X!         mBarDimmed = 1 ;
  1536. X!     } else if ( inSelect == WIN_ERR && flags . window_inited && mBarDimmed &&
  1537. X!                 ! in_topl_mode() ) {
  1538. X!         UndimMenuBar ( ) ;
  1539. X!         mBarDimmed = 0 ;
  1540. X!     }
  1541. X      /*
  1542. X       * We want to take care of keys in the buffer as fast as
  1543. X       * possible
  1544. X--- 2475,2489 ----
  1545. X  {
  1546. X      EventRecord anEvent ;
  1547. X  
  1548. X!     if ( ( inSelect == WIN_ERR && flags . window_inited && ! in_topl_mode ( ) )
  1549. X!          == mBarDimmed )
  1550. X!         if ( mBarDimmed ) {
  1551. X!             UndimMenuBar ( ) ;
  1552. X!             mBarDimmed = 0 ;
  1553. X!         } else {
  1554. X!             DimMenuBar ( ) ;
  1555. X!             mBarDimmed = 1 ;
  1556. X!         }
  1557. X      /*
  1558. X       * We want to take care of keys in the buffer as fast as
  1559. X       * possible
  1560. X***************
  1561. X*** 2447,2459 ****
  1562. X  {
  1563. X      int ch ;
  1564. X      register int i ;
  1565. X  
  1566. X      wait_synch ( ) ;
  1567. X  
  1568. X!     if ( flags . window_inited && ! theWindows [ WIN_MAP ] . cursorDrawn &&
  1569. X!         theWindows [ WIN_MAP ] . theWindow ) {
  1570. X!         SetPort ( theWindows [ WIN_MAP ] . theWindow ) ;
  1571. X!         DrawMapCursor ( & theWindows [ WIN_MAP ] ) ;
  1572. X      }
  1573. X  
  1574. X      if ( ! keyQueue [ 0 ] ) {
  1575. X--- 2514,2532 ----
  1576. X  {
  1577. X      int ch ;
  1578. X      register int i ;
  1579. X+     NhWindow * nhw = flags . window_inited ? theWindows + WIN_MAP : nil ;
  1580. X  
  1581. X+     if ( theWindows ) {
  1582. X+         NhWindow * aWin = theWindows + WIN_MESSAGE ;
  1583. X+         if ( aWin )
  1584. X+             aWin -> last_more_lin = aWin -> lin ;
  1585. X+     }
  1586. X+ 
  1587. X      wait_synch ( ) ;
  1588. X  
  1589. X!     if ( nhw && ! nhw -> cursorDrawn && nhw -> theWindow ) {
  1590. X!         SetPort ( nhw -> theWindow ) ;
  1591. X!         DrawMapCursor ( nhw ) ;
  1592. X      }
  1593. X  
  1594. X      if ( ! keyQueue [ 0 ] ) {
  1595. X***************
  1596. X*** 2461,2469 ****
  1597. X          static char warn = 0 ;
  1598. X  
  1599. X          PurgeSpace ( & total , & contig ) ;
  1600. X!         if ( contig < 64000L || total < 256000L ) {
  1601. X              if ( ! warn ) {
  1602. X!                 DebugStr ( ( ConstStr255Param ) "\014Low Memory !" ) ;
  1603. X                  warn = 1 ;
  1604. X              }
  1605. X          } else {
  1606. X--- 2534,2542 ----
  1607. X          static char warn = 0 ;
  1608. X  
  1609. X          PurgeSpace ( & total , & contig ) ;
  1610. X!         if ( contig < 25000L || total < 50000L ) {
  1611. X              if ( ! warn ) {
  1612. X!                 pline ( "Low Memory!" ) ;
  1613. X                  warn = 1 ;
  1614. X              }
  1615. X          } else {
  1616. X***************
  1617. X*** 2473,2481 ****
  1618. X  
  1619. X      do {
  1620. X          doDawdle = ( in_topl_mode() ? GetCaretTime ( ) : 120L ) ;
  1621. X          get_nh_event ( ) ;
  1622. X          ch = keyQueue [ 0 ] ;
  1623. X!     } while ( ! ch ) ;
  1624. X  
  1625. X      if ( ! gClickedToMove ) {
  1626. X          ObscureCursor ( ) ;
  1627. X--- 2546,2573 ----
  1628. X  
  1629. X      do {
  1630. X          doDawdle = ( in_topl_mode() ? GetCaretTime ( ) : 120L ) ;
  1631. X+ 
  1632. X+         if ( nhw ) {
  1633. X+             SetPort ( nhw -> theWindow ) ;
  1634. X+             if ( WaitMouseUp ( ) ) {
  1635. X+                 unsigned long tick = TickCount ( ) ;
  1636. X+                 if ( tick >= gNextClickRepeat ) {
  1637. X+                     Point where ;
  1638. X+                     GetMouse ( & where ) ;
  1639. X+                     SetPt ( & clicked_pos , where . h / nhw -> charWidth ,
  1640. X+                                             where . v / nhw -> charHeight ) ;
  1641. X+                     gClickedToMove = TRUE ;
  1642. X+                     gNextClickRepeat = tick + * ( short * ) KeyRepThresh ;
  1643. X+                 }
  1644. X+                 if ( doDawdle > * ( short * ) KeyRepThresh )
  1645. X+                     doDawdle = * ( short * ) KeyRepThresh ;
  1646. X+             } else
  1647. X+                 gNextClickRepeat = 0xffffffff ;
  1648. X+         }
  1649. X+ 
  1650. X          get_nh_event ( ) ;
  1651. X          ch = keyQueue [ 0 ] ;
  1652. X!     } while ( ! ch && ! gClickedToMove ) ;
  1653. X  
  1654. X      if ( ! gClickedToMove ) {
  1655. X          ObscureCursor ( ) ;
  1656. X***************
  1657. X*** 2536,2548 ****
  1658. X      /* Here and in mac_raw_print_bold I assume that once theWindows got
  1659. X         allocated by mac_init_nhwindows we can safely do putstr on BASE_WINDOW,
  1660. X         even after mac_exit_nhwindows is called or flags.window_inited is reset
  1661. X!        to zero.  Is this assumption correct? */
  1662. X      if ( theWindows ) {
  1663. X  
  1664. X          ShowWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  1665. X          SelectWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  1666. X  
  1667. X!         putstr ( BASE_WINDOW , 0 , str ) ;
  1668. X  
  1669. X      } else
  1670. X          showerror ( str , NULL ) ;
  1671. X--- 2628,2644 ----
  1672. X      /* Here and in mac_raw_print_bold I assume that once theWindows got
  1673. X         allocated by mac_init_nhwindows we can safely do putstr on BASE_WINDOW,
  1674. X         even after mac_exit_nhwindows is called or flags.window_inited is reset
  1675. X!        to zero.  Is this assumption correct?
  1676. X!        Also add a space or a bullet before each line to indicate the bold face
  1677. X!        before we really implement the text attributes */
  1678. X      if ( theWindows ) {
  1679. X+         char lstr [ 200 ] = " " ;
  1680. X+         strcat ( lstr , str ) ;
  1681. X  
  1682. X          ShowWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  1683. X          SelectWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  1684. X  
  1685. X!         putstr ( BASE_WINDOW , 0 , lstr ) ;
  1686. X  
  1687. X      } else
  1688. X          showerror ( str , NULL ) ;
  1689. X***************
  1690. X*** 2553,2563 ****
  1691. X  mac_raw_print_bold ( const char * str )
  1692. X  {
  1693. X      if ( theWindows ) {
  1694. X  
  1695. X          ShowWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  1696. X          SelectWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  1697. X  
  1698. X!         putstr ( BASE_WINDOW , ATR_BOLD , str ) ;
  1699. X  
  1700. X      } else {
  1701. X          nhbell ( ) ;
  1702. X--- 2649,2661 ----
  1703. X  mac_raw_print_bold ( const char * str )
  1704. X  {
  1705. X      if ( theWindows ) {
  1706. X+         char lstr [ 200 ] = "\xA5"/*bullet*/ ;
  1707. X+         strcat ( lstr , str ) ;
  1708. X  
  1709. X          ShowWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  1710. X          SelectWindow ( theWindows [ BASE_WINDOW ] . theWindow ) ;
  1711. X  
  1712. X!         putstr ( BASE_WINDOW , ATR_BOLD , lstr ) ;
  1713. X  
  1714. X      } else {
  1715. X          nhbell ( ) ;
  1716. X***************
  1717. X*** 2596,2602 ****
  1718. X      Rect r ;
  1719. X  
  1720. X      if ( in_putstr > 3 ) {
  1721. X!         DebugStr ( ( ConstStr255Param ) "\012Recursion!" ) ;
  1722. X          return ;
  1723. X      }
  1724. X      if ( win < 0 || win >= NUM_MACWINDOWS ) {
  1725. X--- 2694,2700 ----
  1726. X      Rect r ;
  1727. X  
  1728. X      if ( in_putstr > 3 ) {
  1729. X!         DebugStr ( ( ConstStr255Param ) "\pRecursion!" ) ;
  1730. X          return ;
  1731. X      }
  1732. X      if ( win < 0 || win >= NUM_MACWINDOWS ) {
  1733. X***************
  1734. X*** 2612,2642 ****
  1735. X      in_putstr ++ ;
  1736. X      kind = ( ( WindowPeek ) ( aWin -> theWindow ) ) -> windowKind -
  1737. X          WIN_BASE_KIND ;
  1738. X  
  1739. X      if ( kind == NHW_MAP || kind == NHW_STATUS ) {
  1740. X!         short    h = ( NUM_COLS - aWin->cursor.h - strlen(str) );
  1741. X!         /*
  1742. X!          * The "dungeon" window
  1743. X!          * putsym will call curs, so no updates necessary.
  1744. X!          */
  1745. X!         while ( * str ) {
  1746. X!             putsym ( win , aWin -> cursor . h , aWin -> cursor . v , * str ) ;
  1747. X!             curs ( win , aWin -> cursor . h + 1 , aWin -> cursor . v ) ;
  1748. X!             str ++ ;
  1749. X!         }
  1750. X!         h = (h < 0) ? 0 : h;
  1751. X!         while( h-- ) {
  1752. X!             putsym ( win , aWin -> cursor . h , aWin -> cursor . v , CHAR_BLANK ) ;
  1753. X!             curs ( win , aWin -> cursor . h + 1 , aWin -> cursor . v ) ;
  1754. X!         }
  1755. X      } else {
  1756. X          char * sr , * ds ;
  1757. X          /*
  1758. X           * A "default" text window - uses TextBox
  1759. X           * We just add the text, without attributes for now
  1760. X           */
  1761. X          len = GetHandleSize ( aWin -> windowText ) ;
  1762. X-         slen = strlen ( str ) ;
  1763. X          while ( aWin -> windowTextLen + slen + 1 > len ) {
  1764. X              len = ( len > 2048 ) ? ( len + 2048 ) : ( len * 2 ) ;
  1765. X              SetHandleSize ( aWin -> windowText , len ) ;
  1766. X--- 2710,2753 ----
  1767. X      in_putstr ++ ;
  1768. X      kind = ( ( WindowPeek ) ( aWin -> theWindow ) ) -> windowKind -
  1769. X          WIN_BASE_KIND ;
  1770. X+     slen = strlen ( str ) ;
  1771. X  
  1772. X      if ( kind == NHW_MAP || kind == NHW_STATUS ) {
  1773. X!         char *row;
  1774. X!         r.right     = aWin->theWindow->portRect.right;
  1775. X!         r.left     = aWin->charWidth    * aWin->cursor.h;
  1776. X!         r.bottom = aWin->charHeight *(aWin->cursor.v + 1);
  1777. X!         r.top     = r.bottom - aWin->charHeight;
  1778. X!         EraseRect(&r);
  1779. X!         MoveTo(r.left, r.bottom - aWin->leading);
  1780. X!         DrawText(str, 0, slen);
  1781. X! 
  1782. X!         if (slen > NUM_COLS - aWin->cursor.h)
  1783. X!             slen = NUM_COLS - aWin->cursor.h;
  1784. X!         row = &((MapData *)*aWin->windowText)->map[aWin->cursor.v][aWin->cursor.h];
  1785. X!         strncpy(row, str, slen);
  1786. X!         memset(row + slen, CHAR_BLANK, NUM_COLS - slen - aWin->cursor.h);
  1787. X!         curs(win, NUM_COLS, aWin->cursor.v);
  1788. X! 
  1789. X      } else {
  1790. X          char * sr , * ds ;
  1791. X+ 
  1792. X+         r = aWin->theWindow->portRect;
  1793. X+         if (win && win == WIN_MESSAGE) {
  1794. X+             r.right  -= SBARWIDTH  + 1;
  1795. X+             r.bottom -= SBARHEIGHT + 1;
  1796. X+             if ( aWin->last_more_lin < aWin->scrollPos )
  1797. X+                 aWin->last_more_lin = aWin->scrollPos;
  1798. X+             if ( flags.page_wait && aWin->last_more_lin <=
  1799. X+                  aWin->lin - (r.bottom - r.top) / aWin->charHeight )
  1800. X+                 display_nhwindow(win, TRUE);
  1801. X+         }
  1802. X+ 
  1803. X          /*
  1804. X           * A "default" text window - uses TextBox
  1805. X           * We just add the text, without attributes for now
  1806. X           */
  1807. X          len = GetHandleSize ( aWin -> windowText ) ;
  1808. X          while ( aWin -> windowTextLen + slen + 1 > len ) {
  1809. X              len = ( len > 2048 ) ? ( len + 2048 ) : ( len * 2 ) ;
  1810. X              SetHandleSize ( aWin -> windowText , len ) ;
  1811. X***************
  1812. X*** 2643,2649 ****
  1813. X              if ( MemError ( ) ) {
  1814. X                  error ( "SetHandleSize (putstr)" ) ;
  1815. X                  aWin -> windowTextLen = 0L ;
  1816. X!                 aWin -> textBase = 0 ;
  1817. X                  aWin -> lin = 0 ;
  1818. X              }
  1819. X          }
  1820. X--- 2754,2760 ----
  1821. X              if ( MemError ( ) ) {
  1822. X                  error ( "SetHandleSize (putstr)" ) ;
  1823. X                  aWin -> windowTextLen = 0L ;
  1824. X!                 aWin -> save_lin = 0 ;
  1825. X                  aWin -> lin = 0 ;
  1826. X              }
  1827. X          }
  1828. X***************
  1829. X*** 2662,2701 ****
  1830. X              sr ++ ;
  1831. X              ds ++ ;
  1832. X          }
  1833. X!         if ( slen > 1 ) {
  1834. X!             ( * ( aWin -> windowText ) ) [ len + slen ] = CHAR_CR ;
  1835. X!             aWin -> windowTextLen += slen + 1 ;
  1836. X!             aWin -> lin ++ ;
  1837. X!         } else {
  1838. X!             aWin -> windowTextLen += slen ;
  1839. X!         }
  1840. X      
  1841. X          SetPort ( aWin -> theWindow ) ;
  1842. X-         r = aWin -> theWindow -> portRect ;
  1843. X-         if ( win && win == WIN_MESSAGE ) {
  1844. X-             r . bottom -= SBARHEIGHT + 1 ;
  1845. X-         }
  1846. X          InvalRect ( & r ) ;
  1847. X          aWin -> clear = 0 ;
  1848. X          if ( kind == NHW_MESSAGE ) {
  1849. X!             char * ptr , * stop ;
  1850. X!             long oldBase = aWin -> textBase ;
  1851. X!             short lines = ( r . bottom - r . top ) / aWin -> charHeight - 1 ;
  1852. X! 
  1853. X!             stop = * aWin -> windowText ;
  1854. X!             ptr = stop + aWin -> windowTextLen - 1 ;
  1855. X!             while ( lines >= 0 && -- ptr > stop ) {
  1856. X!                 if ( * ptr == CHAR_CR || * ptr == CHAR_LF )
  1857. X!                     lines -- ;
  1858. X              }
  1859. X-             if ( ptr <= stop ) {
  1860. X-                 aWin -> textBase = 0L ;
  1861. X-             } else {
  1862. X-                 aWin -> textBase = ptr - stop + 1 ;
  1863. X-             }
  1864. X-             if ( oldBase > aWin -> textBase ) {
  1865. X-                 aWin -> textBase = oldBase ;
  1866. X-             }
  1867. X          }
  1868. X          if ( aWin -> scrollBar ) {
  1869. X              InvalScrollBar ( aWin ) ;
  1870. X--- 2773,2793 ----
  1871. X              sr ++ ;
  1872. X              ds ++ ;
  1873. X          }
  1874. X! 
  1875. X!         ( * ( aWin -> windowText ) ) [ len + slen ] = CHAR_CR ;
  1876. X!         aWin -> windowTextLen += slen + 1 ;
  1877. X!         aWin -> lin ++ ;
  1878. X      
  1879. X          SetPort ( aWin -> theWindow ) ;
  1880. X          InvalRect ( & r ) ;
  1881. X          aWin -> clear = 0 ;
  1882. X          if ( kind == NHW_MESSAGE ) {
  1883. X!             short min = aWin->lin - (r.bottom - r.top) / aWin->charHeight;
  1884. X!             if (aWin->scrollPos < min) {
  1885. X!                 aWin->scrollPos = min;
  1886. X!                 SetCtlMax  (aWin->scrollBar, aWin->lin);
  1887. X!                 SetCtlValue(aWin->scrollBar, min);
  1888. X              }
  1889. X          }
  1890. X          if ( aWin -> scrollBar ) {
  1891. X              InvalScrollBar ( aWin ) ;
  1892. X***************
  1893. X*** 2751,2760 ****
  1894. X--- 2843,2856 ----
  1895. X              break ;
  1896. X          }
  1897. X      } else {
  1898. X+ #if 1
  1899. X+         Debugger ( ) ;
  1900. X+ #else
  1901. X          char ss [ 2 ] ;
  1902. X          ss [ 0 ] = sym ;
  1903. X          ss [ 1 ] = 0 ;
  1904. X          putstr ( win , 0 , ss ) ;
  1905. X+ #endif
  1906. X      }
  1907. X  }
  1908. X  
  1909. X***************
  1910. X*** 2881,2890 ****
  1911. X  int
  1912. X  mac_nh_poskey ( int * a , int * b , int * c )
  1913. X  {
  1914. X!     if ( ! a || ! b || ! c ) {
  1915. X!         Debugger ( ) ;
  1916. X!     }
  1917. X!     return nhgetch ( ) ;
  1918. X  }
  1919. X  
  1920. X  
  1921. X--- 2977,2987 ----
  1922. X  int
  1923. X  mac_nh_poskey ( int * a , int * b , int * c )
  1924. X  {
  1925. X!     int ch = nhgetch();
  1926. X!     *a = clicked_pos.h;
  1927. X!     *b = clicked_pos.v;
  1928. X!     *c = clicked_mod;
  1929. X!     return ch;
  1930. X  }
  1931. X  
  1932. X  
  1933. X***************
  1934. X*** 2891,2902 ****
  1935. X  void
  1936. X  mac_start_menu ( winid win )
  1937. X  {
  1938. X!     NhWindow * aWin = & theWindows [ win ] ;
  1939. X! 
  1940. X!     HideWindow ( aWin -> theWindow ) ;
  1941. X!     SetHandleSize ( aWin -> windowText , TEXT_BLOCK ) ;
  1942. X!     aWin -> wid = 0 ;
  1943. X!     aWin -> lin = 0 ;
  1944. X      clear_nhwindow ( win ) ;
  1945. X  }
  1946. X  
  1947. X--- 2988,2994 ----
  1948. X  void
  1949. X  mac_start_menu ( winid win )
  1950. X  {
  1951. X!     HideWindow ( theWindows [ win ] . theWindow ) ;
  1952. X      clear_nhwindow ( win ) ;
  1953. X  }
  1954. X  
  1955. X***************
  1956. X*** 2956,2982 ****
  1957. X  char
  1958. X  mac_select_menu ( winid win )
  1959. X  {
  1960. X-     short w , h ;
  1961. X      int c , l ;
  1962. X-     WindowPtr theWin = theWindows [ win ] . theWindow ;
  1963. X      NhWindow * aWin = & theWindows [ win ] ;
  1964. X  
  1965. X      inSelect = win ;
  1966. X  
  1967. X      SetPort ( theWin ) ;
  1968. X!     if ( aWin -> wid && aWin -> lin ) {
  1969. X!         w = aWin -> wid + 16 ;
  1970. X!         h = aWin -> lin * aWin -> charHeight ;
  1971. X!         if ( w > 450 ) {
  1972. X!             w = 450 ;
  1973. X!         }
  1974. X!         if ( h > 300 ) {
  1975. X!             h = 300 ;
  1976. X!         }
  1977. X!         SizeWindow ( theWin , w , h , TRUE ) ;
  1978. X!         if ( aWin -> scrollBar ) {
  1979. X!             InvalScrollBar ( aWin ) ;
  1980. X!         }
  1981. X      }
  1982. X      SelectWindow ( theWin ) ;
  1983. X      ShowWindow ( theWin ) ;
  1984. X--- 3048,3063 ----
  1985. X  char
  1986. X  mac_select_menu ( winid win )
  1987. X  {
  1988. X      int c , l ;
  1989. X      NhWindow * aWin = & theWindows [ win ] ;
  1990. X+     WindowPtr theWin = aWin -> theWindow ;
  1991. X  
  1992. X      inSelect = win ;
  1993. X  
  1994. X+     adjust_window_pos ( aWin , theWin , aWin -> wid + ( SBARWIDTH + 2 ) ) ;
  1995. X      SetPort ( theWin ) ;
  1996. X!     if ( aWin -> scrollBar ) {
  1997. X!         InvalScrollBar ( aWin ) ;
  1998. X      }
  1999. X      SelectWindow ( theWin ) ;
  2000. X      ShowWindow ( theWin ) ;
  2001. X***************
  2002. X*** 2983,2989 ****
  2003. X      InvalRect ( & ( theWin -> portRect ) ) ;
  2004. X  
  2005. X      do {
  2006. X!         while ( ! ( c =  nhgetch ( ) ) ) ;
  2007. X          for ( l = 0 ; l < aWin -> lin ; l ++ ) {
  2008. X              if ( aWin -> itemChars [ l ] == c )
  2009. X                  goto done ;
  2010. X--- 3064,3070 ----
  2011. X      InvalRect ( & ( theWin -> portRect ) ) ;
  2012. X  
  2013. X      do {
  2014. X!         c = nhgetch ( ) ;
  2015. X          for ( l = 0 ; l < aWin -> lin ; l ++ ) {
  2016. X              if ( aWin -> itemChars [ l ] == c )
  2017. X                  goto done ;
  2018. X***************
  2019. X*** 3185,3191 ****
  2020. X      DialogPtr        characterDialog;
  2021. X      short            itemHit, lastItemSelected, type;
  2022. X      Rect            box;
  2023. X!     
  2024. X      characterDialog = GetNewDialog(132, (Ptr) NULL, (WindowPtr) -1);
  2025. X      
  2026. X      /*
  2027. X--- 3266,3287 ----
  2028. X      DialogPtr        characterDialog;
  2029. X      short            itemHit, lastItemSelected, type;
  2030. X      Rect            box;
  2031. X! 
  2032. X!     char pc;
  2033. X!     if ((pc = highc(pl_character[0])) != 0) {
  2034. X!         char pbuf[QBUFSZ];
  2035. X!         EventRecord update_evt;
  2036. X!         if(index(pl_classes, pc) != (char*) 0) {
  2037. X!             pl_character[0] = pc;
  2038. X!             return;
  2039. X!         }
  2040. X!         putstr(WIN_MESSAGE, 0, "");
  2041. X!         Sprintf(pbuf, "Unknown role: %c", pc);
  2042. X!         putstr(WIN_MESSAGE, 0, pbuf);
  2043. X!         while (CheckUpdate(&update_evt))
  2044. X!             HandleUpdate(&update_evt);
  2045. X!     }
  2046. X! 
  2047. X      characterDialog = GetNewDialog(132, (Ptr) NULL, (WindowPtr) -1);
  2048. X      
  2049. X      /*
  2050. X
  2051. END_OF_FILE
  2052. if test 53863 -ne `wc -c <'patches01s'`; then
  2053.     echo shar: \"'patches01s'\" unpacked with wrong size!
  2054. fi
  2055. # end of 'patches01s'
  2056. echo shar: End of archive 10 \(of 31\).
  2057. cp /dev/null ark10isdone
  2058. MISSING=""
  2059. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ; do
  2060.     if test ! -f ark${I}isdone ; then
  2061.     MISSING="${MISSING} ${I}"
  2062.     fi
  2063. done
  2064. if test "${MISSING}" = "" ; then
  2065.     echo You have unpacked all 31 archives.
  2066.     echo "Now execute 'patchit.sh'"
  2067.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2068. else
  2069.     echo You still need to unpack the following archives:
  2070.     echo "        " ${MISSING}
  2071. fi
  2072. ##  End of shell archive.
  2073. exit 0
  2074.