NetHack is an open-source project. This file contains the differences between the "official" 3.4.3 source release and what was needed to compile this port. - Kevin Hugo Index: macconf.h =================================================================== RCS file: /usr/local/cvsroot/nethack/include/macconf.h,v retrieving revision 1.4.2.1 diff -c -r1.4.2.1 macconf.h *** macconf.h 26 Aug 2003 02:41:51 -0000 1.4.2.1 --- macconf.h 9 Aug 2004 02:03:35 -0000 *************** *** 53,61 **** * include the relevant files in the relevant .c files instead ! */ #if TARGET_API_MAC_CARBON ! /* Avoid including -- it has a conflicting expl() */ ! # define __FP__ ! # include #else # include #endif --- 53,68 ---- * include the relevant files in the relevant .c files instead ! */ #if TARGET_API_MAC_CARBON ! # ifdef GNUC ! /* Avoid including -- it has a conflicting expl() */ ! # define __FP__ ! # include ! # else ! /* Avoid including -- it uses GENERATINGPOWERPC */ ! # define __FENV__ ! # include ! # include ! # endif #else # include #endif *************** *** 73,79 **** extern void error(const char *,...); #if !defined(O_WRONLY) ! # ifdef __MWERKS__ # include # endif # include --- 80,86 ---- extern void error(const char *,...); #if !defined(O_WRONLY) ! # if defined(__MWERKS__) && !TARGET_API_MAC_CARBON # include # endif # include Index: mactty.h =================================================================== RCS file: /usr/local/cvsroot/nethack/include/mactty.h,v retrieving revision 1.2.2.1 diff -c -r1.2.2.1 mactty.h *** mactty.h 26 Aug 2003 02:41:51 -0000 1.2.2.1 --- mactty.h 9 Aug 2004 02:03:35 -0000 *************** *** 44,50 **** #undef red /* undef internal color const strings from decl */ #undef green #undef blue ! #if !TARGET_API_MAC_CARBON # include #endif --- 44,50 ---- #undef red /* undef internal color const strings from decl */ #undef green #undef blue ! #if 1 /*!TARGET_API_MAC_CARBON*/ # include #endif Index: Files.r =================================================================== RCS file: /usr/local/cvsroot/nethack/sys/mac/Files.r,v retrieving revision 1.2.2.1 diff -c -r1.2.2.1 Files.r *** Files.r 28 Aug 2003 01:02:09 -0000 1.2.2.1 --- Files.r 9 Aug 2004 01:58:55 -0000 *************** *** 2,10 **** #include "date.h" #include "patchlevel.h" - resource 'plst' (0, purgeable) { - }; resource 'vers' (1, purgeable) { VERSION_MAJOR, (VERSION_MINOR<<4) | PATCHLEVEL, final, EDITLEVEL, verUS, VERSION_STRING, --- 2,29 ---- #include "date.h" #include "patchlevel.h" + /* Carbon 'carb' resource + * has been made obsolete by the 'plst' resource below. + */ + + /* Carbon 'plst' resource + * Single-file applications must have this resource for MacOS X to + * count it as a Carbon app rather than a Classic app. It contains + * an embedded Info.plist file, with the same format as would occur + * in an application based on a directory bundle. The attributes + * declared in this resource override the 'BNDL', 'FREF', and 'vers' + * resources in MacOS X. + * + * For further information, see + * http://developer.apple.com/technotes/tn/tn2013.html + */ + read 'plst' (0) "carbon.plist"; + + + /* Classic resources + * These resources are used in MacOS 9.x and earlier. + */ resource 'vers' (1, purgeable) { VERSION_MAJOR, (VERSION_MINOR<<4) | PATCHLEVEL, final, EDITLEVEL, verUS, VERSION_STRING, *************** *** 17,22 **** --- 36,175 ---- "devteam@nethack.org" }; + + /* Dungeon librarian files + * File data and quest.dat have gotten too big to be put into resources! + */ + #ifdef TARGET_API_MAC_CARBON + read 'File' (1000,"cmdhelp") "cmdhelp"; + read 'File' (1001,"help") "help"; + read 'File' (1002,"hh") "hh"; + read 'File' (1003,"history") "history"; + read 'File' (1004,"license") "license"; + read 'File' (1005,"MacHelp") "MacHelp"; + read 'File' (1006,"News") "News"; + read 'File' (1007,"opthelp") "opthelp"; + read 'File' (1008,"wizhelp") "wizhelp"; + read 'File' (1009,"air.lev") "air.lev"; + read 'File' (1010,"asmodeus.lev") "asmodeus.lev"; + read 'File' (1011,"astral.lev") "astral.lev"; + read 'File' (1012,"baalz.lev") "baalz.lev"; + read 'File' (1013,"bigrm-1.lev") "bigrm-1.lev"; + read 'File' (1014,"bigrm-2.lev") "bigrm-2.lev"; + read 'File' (1015,"bigrm-3.lev") "bigrm-3.lev"; + read 'File' (1016,"bigrm-4.lev") "bigrm-4.lev"; + read 'File' (1017,"bigrm-5.lev") "bigrm-5.lev"; + read 'File' (1018,"castle.lev") "castle.lev"; + //read 'File' (1019,"data") "data"; + read 'File' (1020,"dungeon") "dungeon"; + read 'File' (1021,"earth.lev") "earth.lev"; + read 'File' (1022,"fakewiz1.lev") "fakewiz1.lev"; + read 'File' (1023,"fakewiz2.lev") "fakewiz2.lev"; + read 'File' (1024,"fire.lev") "fire.lev"; + read 'File' (1025,"juiblex.lev") "juiblex.lev"; + read 'File' (1026,"knox.lev") "knox.lev"; + read 'File' (1027,"medusa-1.lev") "medusa-1.lev"; + read 'File' (1028,"medusa-2.lev") "medusa-2.lev"; + read 'File' (1029,"minefill.lev") "minefill.lev"; + read 'File' (1030,"minend-1.lev") "minend-1.lev"; + read 'File' (1031,"minend-2.lev") "minend-2.lev"; + read 'File' (1032,"minend-3.lev") "minend-3.lev"; + read 'File' (1034,"minetn-1.lev") "minetn-1.lev"; + read 'File' (1035,"minetn-2.lev") "minetn-2.lev"; + read 'File' (1036,"minetn-3.lev") "minetn-3.lev"; + read 'File' (1037,"minetn-4.lev") "minetn-4.lev"; + read 'File' (1038,"minetn-5.lev") "minetn-5.lev"; + read 'File' (1039,"minetn-6.lev") "minetn-6.lev"; + read 'File' (1040,"minetn-7.lev") "minetn-7.lev"; + read 'File' (1041,"options") "options"; + read 'File' (1042,"oracle.lev") "oracle.lev"; + read 'File' (1043,"oracles") "oracles"; + read 'File' (1044,"orcus.lev") "orcus.lev"; + //read 'File' (1045,"quest.dat") "quest.dat"; + read 'File' (1046,"rumors") "rumors"; + read 'File' (1047,"sanctum.lev") "sanctum.lev"; + read 'File' (1048,"soko1-1.lev") "soko1-1.lev"; + read 'File' (1049,"soko1-2.lev") "soko1-2.lev"; + read 'File' (1050,"soko2-1.lev") "soko2-1.lev"; + read 'File' (1051,"soko2-2.lev") "soko2-2.lev"; + read 'File' (1052,"soko3-1.lev") "soko3-1.lev"; + read 'File' (1053,"soko3-2.lev") "soko3-2.lev"; + read 'File' (1054,"soko4-1.lev") "soko4-1.lev"; + read 'File' (1055,"soko4-2.lev") "soko4-2.lev"; + read 'File' (1056,"tower1.lev") "tower1.lev"; + read 'File' (1057,"tower2.lev") "tower2.lev"; + read 'File' (1058,"tower3.lev") "tower3.lev"; + read 'File' (1059,"valley.lev") "valley.lev"; + read 'File' (1060,"water.lev") "water.lev"; + read 'File' (1061,"wizard1.lev") "wizard1.lev"; + read 'File' (1062,"wizard2.lev") "wizard2.lev"; + read 'File' (1063,"wizard3.lev") "wizard3.lev"; + read 'File' (1100,"Arc-fila.lev") "Arc-fila.lev"; + read 'File' (1101,"Arc-filb.lev") "Arc-filb.lev"; + read 'File' (1102,"Arc-goal.lev") "Arc-goal.lev"; + read 'File' (1103,"Arc-loca.lev") "Arc-loca.lev"; + read 'File' (1104,"Arc-strt.lev") "Arc-strt.lev"; + read 'File' (1105,"Bar-fila.lev") "Bar-fila.lev"; + read 'File' (1106,"Bar-filb.lev") "Bar-filb.lev"; + read 'File' (1107,"Bar-goal.lev") "Bar-goal.lev"; + read 'File' (1108,"Bar-loca.lev") "Bar-loca.lev"; + read 'File' (1109,"Bar-strt.lev") "Bar-strt.lev"; + read 'File' (1110,"Cav-fila.lev") "Cav-fila.lev"; + read 'File' (1111,"Cav-filb.lev") "Cav-filb.lev"; + read 'File' (1112,"Cav-goal.lev") "Cav-goal.lev"; + read 'File' (1113,"Cav-loca.lev") "Cav-loca.lev"; + read 'File' (1114,"Cav-strt.lev") "Cav-strt.lev"; + read 'File' (1115,"Hea-fila.lev") "Hea-fila.lev"; + read 'File' (1116,"Hea-filb.lev") "Hea-filb.lev"; + read 'File' (1117,"Hea-goal.lev") "Hea-goal.lev"; + read 'File' (1118,"Hea-loca.lev") "Hea-loca.lev"; + read 'File' (1119,"Hea-strt.lev") "Hea-strt.lev"; + read 'File' (1120,"Kni-fila.lev") "Kni-fila.lev"; + read 'File' (1121,"Kni-filb.lev") "Kni-filb.lev"; + read 'File' (1122,"Kni-goal.lev") "Kni-goal.lev"; + read 'File' (1123,"Kni-loca.lev") "Kni-loca.lev"; + read 'File' (1124,"Kni-strt.lev") "Kni-strt.lev"; + read 'File' (1125,"Mon-fila.lev") "Mon-fila.lev"; + read 'File' (1126,"Mon-filb.lev") "Mon-filb.lev"; + read 'File' (1127,"Mon-goal.lev") "Mon-goal.lev"; + read 'File' (1128,"Mon-loca.lev") "Mon-loca.lev"; + read 'File' (1129,"Mon-strt.lev") "Mon-strt.lev"; + read 'File' (1130,"Pri-fila.lev") "Pri-fila.lev"; + read 'File' (1131,"Pri-filb.lev") "Pri-filb.lev"; + read 'File' (1132,"Pri-goal.lev") "Pri-goal.lev"; + read 'File' (1133,"Pri-loca.lev") "Pri-loca.lev"; + read 'File' (1134,"Pri-strt.lev") "Pri-strt.lev"; + read 'File' (1135,"Ran-fila.lev") "Ran-fila.lev"; + read 'File' (1136,"Ran-filb.lev") "Ran-filb.lev"; + read 'File' (1137,"Ran-goal.lev") "Ran-goal.lev"; + read 'File' (1138,"Ran-loca.lev") "Ran-loca.lev"; + read 'File' (1139,"Ran-strt.lev") "Ran-strt.lev"; + read 'File' (1140,"Rog-fila.lev") "Rog-fila.lev"; + read 'File' (1141,"Rog-filb.lev") "Rog-filb.lev"; + read 'File' (1142,"Rog-goal.lev") "Rog-goal.lev"; + read 'File' (1143,"Rog-loca.lev") "Rog-loca.lev"; + read 'File' (1144,"Rog-strt.lev") "Rog-strt.lev"; + read 'File' (1145,"Sam-fila.lev") "Sam-fila.lev"; + read 'File' (1146,"Sam-filb.lev") "Sam-filb.lev"; + read 'File' (1147,"Sam-goal.lev") "Sam-goal.lev"; + read 'File' (1148,"Sam-loca.lev") "Sam-loca.lev"; + read 'File' (1149,"Sam-strt.lev") "Sam-strt.lev"; + read 'File' (1150,"Tou-fila.lev") "Tou-fila.lev"; + read 'File' (1151,"Tou-filb.lev") "Tou-filb.lev"; + read 'File' (1152,"Tou-goal.lev") "Tou-goal.lev"; + read 'File' (1153,"Tou-loca.lev") "Tou-loca.lev"; + read 'File' (1154,"Tou-strt.lev") "Tou-strt.lev"; + read 'File' (1155,"Val-fila.lev") "Val-fila.lev"; + read 'File' (1156,"Val-filb.lev") "Val-filb.lev"; + read 'File' (1157,"Val-goal.lev") "Val-goal.lev"; + read 'File' (1158,"Val-loca.lev") "Val-loca.lev"; + read 'File' (1159,"Val-strt.lev") "Val-strt.lev"; + read 'File' (1160,"Wiz-fila.lev") "Wiz-fila.lev"; + read 'File' (1161,"Wiz-filb.lev") "Wiz-filb.lev"; + read 'File' (1162,"Wiz-goal.lev") "Wiz-goal.lev"; + read 'File' (1163,"Wiz-loca.lev") "Wiz-loca.lev"; + read 'File' (1164,"Wiz-strt.lev") "Wiz-strt.lev"; + #else read 'File' (1000,"cmdhelp") ":dat:cmdhelp"; read 'File' (1001,"help") ":dat:help"; read 'File' (1002,"hh") ":dat:hh"; *************** *** 50,56 **** read 'File' (1030,"minend-1.lev") ":lib:minend-1.lev"; read 'File' (1031,"minend-2.lev") ":lib:minend-2.lev"; read 'File' (1032,"minend-3.lev") ":lib:minend-3.lev"; - read 'File' (1033,"minend-4.lev") ":lib:minend-4.lev"; read 'File' (1034,"minetn-1.lev") ":lib:minetn-1.lev"; read 'File' (1035,"minetn-2.lev") ":lib:minetn-2.lev"; read 'File' (1036,"minetn-3.lev") ":lib:minetn-3.lev"; --- 203,208 ---- *************** *** 146,148 **** --- 298,301 ---- read 'File' (1162,"Wiz-goal.lev") ":lib:Wiz-goal.lev"; read 'File' (1163,"Wiz-loca.lev") ":lib:Wiz-loca.lev"; read 'File' (1164,"Wiz-strt.lev") ":lib:Wiz-strt.lev"; + #endif Index: maccurs.c =================================================================== RCS file: /usr/local/cvsroot/nethack/sys/mac/maccurs.c,v retrieving revision 1.1.1.1.2.2 diff -c -r1.1.1.1.2.2 maccurs.c *** maccurs.c 28 Aug 2003 01:02:09 -0000 1.1.1.1.2.2 --- maccurs.c 9 Aug 2004 01:58:55 -0000 *************** *** 6,12 **** #include "mactty.h" #include "macwin.h" ! #if !TARGET_API_MAC_CARBON #include #include #include --- 6,12 ---- #include "mactty.h" #include "macwin.h" ! #if 1 /*!TARGET_API_MAC_CARBON*/ #include #include #include Index: macmain.c =================================================================== RCS file: /usr/local/cvsroot/nethack/sys/mac/macmain.c,v retrieving revision 1.2.2.1 diff -c -r1.2.2.1 macmain.c *** macmain.c 26 Aug 2003 02:41:54 -0000 1.2.2.1 --- macmain.c 9 Aug 2004 01:58:56 -0000 *************** *** 9,15 **** #include "macwin.h" #include "mactty.h" ! #if !TARGET_API_MAC_CARBON #include #include #include --- 9,15 ---- #include "macwin.h" #include "mactty.h" ! #if 1 /*!TARGET_API_MAC_CARBON*/ #include #include #include Index: macmenu.c =================================================================== RCS file: /usr/local/cvsroot/nethack/sys/mac/macmenu.c,v retrieving revision 1.3.2.1 diff -c -r1.3.2.1 macmenu.c *** macmenu.c 26 Aug 2003 02:41:54 -0000 1.3.2.1 --- macmenu.c 9 Aug 2004 01:58:56 -0000 *************** *** 767,774 **** } SetPort(oldport); DisposeDialog(askdialog); ! DisposeRoutineDescriptor(filter); ! DisposeRoutineDescriptor(redraw); /* Process the mode */ #ifdef WIZARD --- 767,774 ---- } SetPort(oldport); DisposeDialog(askdialog); ! DisposeModalFilterUPP(filter); ! DisposeUserItemUPP(redraw); /* Process the mode */ #ifdef WIZARD Index: macsnd.c =================================================================== RCS file: /usr/local/cvsroot/nethack/sys/mac/macsnd.c,v retrieving revision 1.2.2.1 diff -c -r1.2.2.1 macsnd.c *** macsnd.c 26 Aug 2003 02:41:54 -0000 1.2.2.1 --- macsnd.c 9 Aug 2004 01:58:56 -0000 *************** *** 17,26 **** #include "hack.h" #include "mactty.h" #include "macwin.h" ! #if !TARGET_API_MAC_CARBON # include # include ! #else # define freqDurationCmd 40 #endif --- 17,28 ---- #include "hack.h" #include "mactty.h" #include "macwin.h" ! #if 1 /*!TARGET_API_MAC_CARBON*/ # include # include ! #endif ! ! #ifndef freqDurationCmd # define freqDurationCmd 40 #endif Index: macwin.c =================================================================== RCS file: /usr/local/cvsroot/nethack/sys/mac/macwin.c,v retrieving revision 1.7.2.4 diff -c -r1.7.2.4 macwin.c *** macwin.c 10 Dec 2003 19:34:39 -0000 1.7.2.4 --- macwin.c 9 Aug 2004 01:58:58 -0000 *************** *** 13,19 **** #include "mactty.h" #include "wintty.h" ! #if !TARGET_API_MAC_CARBON #include #include #include --- 13,19 ---- #include "mactty.h" #include "wintty.h" ! #if 1 /*!TARGET_API_MAC_CARBON*/ #include #include #include *************** *** 28,34 **** * Local variables and functions */ ! #if TARGET_API_MAC_CARBON static EventTypeSpec baseevents[] = { { kEventClassKeyboard, kEventRawKeyDown }, { kEventClassKeyboard, kEventRawKeyRepeat }, --- 28,34 ---- * Local variables and functions */ ! #if 0//TARGET_API_MAC_CARBON static EventTypeSpec baseevents[] = { { kEventClassKeyboard, kEventRawKeyDown }, { kEventClassKeyboard, kEventRawKeyRepeat }, *************** *** 225,236 **** static int FDECL(filter_scroll_key,(const int, NhWindow *)); ! #if !TARGET_API_MAC_CARBON static void FDECL(DoScrollBar,(Point, short, ControlHandle, NhWindow *)); #endif static pascal void FDECL(MoveScrollBar, (ControlHandle, short)); ! #if !TARGET_API_MAC_CARBON typedef void (*CbFunc) (EventRecord *, WindowPtr); typedef short (*CbUpFunc) (EventRecord *, WindowPtr); typedef void (*CbCursFunc) (EventRecord *, WindowPtr, RgnHandle); --- 225,236 ---- static int FDECL(filter_scroll_key,(const int, NhWindow *)); ! #if 1//!TARGET_API_MAC_CARBON static void FDECL(DoScrollBar,(Point, short, ControlHandle, NhWindow *)); #endif static pascal void FDECL(MoveScrollBar, (ControlHandle, short)); ! #if 1//!TARGET_API_MAC_CARBON typedef void (*CbFunc) (EventRecord *, WindowPtr); typedef short (*CbUpFunc) (EventRecord *, WindowPtr); typedef void (*CbCursFunc) (EventRecord *, WindowPtr, RgnHandle); *************** *** 464,470 **** /* Create the "record" file, if necessary */ check_recordfile(""); ! #if TARGET_API_MAC_CARBON /* Create event handler universal procedure pointers */ dispatcher = GetEventDispatcherTarget(); baseupp = NewEventHandlerUPP(BaseEvent); --- 464,470 ---- /* Create the "record" file, if necessary */ check_recordfile(""); ! #if 0//TARGET_API_MAC_CARBON /* Create event handler universal procedure pointers */ dispatcher = GetEventDispatcherTarget(); baseupp = NewEventHandlerUPP(BaseEvent); *************** *** 568,588 **** { #if TARGET_API_MAC_CARBON Rect rbase, rmsg; ! UInt16 height; ! ConstrainWindowToScreen(_mt_window, kWindowStructureRgn, kWindowConstrainMoveRegardlessOfFit, NULL, NULL); ! GetWindowBounds(_mt_window, kWindowStructureRgn, &rbase); ! GetWindowBounds(theWindows[NHW_MESSAGE].its_window, kWindowStructureRgn, &rmsg); height = rmsg.bottom - rmsg.top; rmsg.top = rbase.bottom+2; rmsg.bottom = rmsg.top + height; rmsg.left = rbase.left; rmsg.right = rbase.right; ! SetWindowBounds(theWindows[NHW_MESSAGE].its_window, kWindowStructureRgn, &rmsg); ! ConstrainWindowToScreen(theWindows[NHW_MESSAGE].its_window, kWindowStructureRgn, kWindowConstrainMoveRegardlessOfFit, NULL, NULL); #else short left, top, width, height; int ix, numText = 0, numMenu = 0; --- 568,605 ---- { #if TARGET_API_MAC_CARBON Rect rbase, rmsg; ! SInt16 i, width, height; ! ConstrainWindowToScreen(_mt_window, kWindowContentRgn, kWindowConstrainMoveRegardlessOfFit, NULL, NULL); ! GetWindowBounds(_mt_window, kWindowContentRgn, &rbase); ! if (RetrievePosition(kMapWindow, &rbase.top, &rbase.left)) ! MoveWindow(_mt_window, rbase.left, rbase.top, TRUE); ! ! GetWindowBounds(theWindows[NHW_MESSAGE].its_window, kWindowContentRgn, &rmsg); height = rmsg.bottom - rmsg.top; rmsg.top = rbase.bottom+2; rmsg.bottom = rmsg.top + height; rmsg.left = rbase.left; rmsg.right = rbase.right; ! RetrievePosition(kMessageWindow, &rmsg.top, &rmsg.left); ! if (RetrieveSize(kMessageWindow, rmsg.top, rmsg.left, &height, &width)) { ! rmsg.right = rmsg.left + width; ! rmsg.bottom = rmsg.top + height; ! } ! SetWindowBounds(theWindows[NHW_MESSAGE].its_window, kWindowContentRgn, &rmsg); ! ConstrainWindowToScreen(theWindows[NHW_MESSAGE].its_window, kWindowContentRgn, kWindowConstrainMoveRegardlessOfFit, NULL, NULL); + DrawScrollbar(&theWindows[NHW_MESSAGE]); + + for (i = 0; i < NUM_MACWINDOWS; i++) + if (i != WIN_STATUS && i != WIN_MESSAGE && i != WIN_MAP && + i != BASE_WINDOW && theWindows[i].its_window) { + /* FIXME */ + ConstrainWindowToScreen(theWindows[i].its_window, kWindowContentRgn, + kWindowConstrainMoveRegardlessOfFit, NULL, NULL); + } #else short left, top, width, height; int ix, numText = 0, numMenu = 0; *************** *** 674,681 **** void mac_init_nhwindows (int *argcp, char **argv) { #if !TARGET_API_MAC_CARBON ! Rect r, scr = (*GetGrayRgn())->rgnBBox; small_screen = scr.bottom - scr.top <= (iflags.large_font ? 12*40 : 9*40); #endif --- 691,699 ---- void mac_init_nhwindows (int *argcp, char **argv) { + Rect r; #if !TARGET_API_MAC_CARBON ! Rect scr = (*GetGrayRgn())->rgnBBox; small_screen = scr.bottom - scr.top <= (iflags.large_font ? 12*40 : 9*40); #endif *************** *** 701,707 **** mac_create_nhwindow(NHW_BASE); tty_create_nhwindow(NHW_MESSAGE); ! #if !TARGET_API_MAC_CARBON /* Resize and reposition the message window */ RetrievePosition(kMessageWindow, &r.top, &r.left); RetrieveSize(kMessageWindow, r.top, r.left, &r.bottom, &r.right); --- 719,725 ---- mac_create_nhwindow(NHW_BASE); tty_create_nhwindow(NHW_MESSAGE); ! #if 1//!TARGET_API_MAC_CARBON /* Resize and reposition the message window */ RetrievePosition(kMessageWindow, &r.top, &r.left); RetrieveSize(kMessageWindow, r.top, r.left, &r.bottom, &r.right); *************** *** 767,773 **** get_tty_metrics(aWin->its_window, &x_sz, &y_sz, &x_sz_p, &y_sz_p, &aWin->font_number, &aWin->font_size, &aWin->char_width, &aWin->row_height); ! #if TARGET_API_MAC_CARBON InstallWindowEventHandler(aWin->its_window, baseupp, sizeof(baseevents)/sizeof(EventTypeSpec), baseevents, (void *)aWin, NULL); --- 785,791 ---- get_tty_metrics(aWin->its_window, &x_sz, &y_sz, &x_sz_p, &y_sz_p, &aWin->font_number, &aWin->font_size, &aWin->char_width, &aWin->row_height); ! #if 0//TARGET_API_MAC_CARBON InstallWindowEventHandler(aWin->its_window, baseupp, sizeof(baseevents)/sizeof(EventTypeSpec), baseevents, (void *)aWin, NULL); *************** *** 788,794 **** aWin->x_curs = aWin->y_curs = 0; aWin->drawn = TRUE; mac_clear_nhwindow (i); ! #if TARGET_API_MAC_CARBON switch (kind) { case NHW_MESSAGE: InstallWindowEventHandler(aWin->its_window, msgupp, --- 806,812 ---- aWin->x_curs = aWin->y_curs = 0; aWin->drawn = TRUE; mac_clear_nhwindow (i); ! #if 0//TARGET_API_MAC_CARBON switch (kind) { case NHW_MESSAGE: InstallWindowEventHandler(aWin->its_window, msgupp, *************** *** 929,936 **** static Boolean ClosingWindowChar(const int c) { ! return c == CHAR_ESC || c == CHAR_BLANK || c == CHAR_LF || c == CHAR_CR || ! c == 'q'; } --- 947,953 ---- static Boolean ClosingWindowChar(const int c) { ! return (c == CHAR_ESC || c == CHAR_BLANK || c == CHAR_LF || c == CHAR_CR); } *************** *** 988,994 **** void leave_topl_mode(char *answer) { ! unsigned char *ap, *bp; int ans_len = (*top_line)->teLength - topl_query_len; NhWindow *aWin = theWindows + WIN_MESSAGE; --- 1005,1011 ---- void leave_topl_mode(char *answer) { ! /*unsigned*/ char *ap, *bp; int ans_len = (*top_line)->teLength - topl_query_len; NhWindow *aWin = theWindows + WIN_MESSAGE; *************** *** 1207,1213 **** MoveWindow(theWindow, r.left, r.top, false); SizeWindow(theWindow, width, height, true); ConstrainWindowToScreen(theWindow, kWindowStructureRgn, ! kWindowConstrainMoveRegardlessOfFit, NULL, NULL); #else Rect scr_r = (*GetGrayRgn())->rgnBBox; const Rect win_ind = {2, 2, 3, 3}; --- 1224,1230 ---- MoveWindow(theWindow, r.left, r.top, false); SizeWindow(theWindow, width, height, true); ConstrainWindowToScreen(theWindow, kWindowStructureRgn, ! kWindowConstrainMayResize|kWindowConstrainMoveRegardlessOfFit, NULL, NULL); #else Rect scr_r = (*GetGrayRgn())->rgnBBox; const Rect win_ind = {2, 2, 3, 3}; *************** *** 1462,1468 **** static pascal void MoveScrollBar (ControlHandle theBar, short part) { ! #if !TARGET_API_MAC_CARBON EventRecord fake; #endif Rect r; --- 1479,1485 ---- static pascal void MoveScrollBar (ControlHandle theBar, short part) { ! #if 1//!TARGET_API_MAC_CARBON EventRecord fake; #endif Rect r; *************** *** 1510,1516 **** InvalWindowRgn(theWin, rgn); BeginUpdate(theWin); } ! #if TARGET_API_MAC_CARBON switch (GetWindowKind(theWin) - WIN_BASE_KIND) { case NHW_MESSAGE: MsgUpdate(GetNhWin(theWin)); --- 1527,1533 ---- InvalWindowRgn(theWin, rgn); BeginUpdate(theWin); } ! #if 0//TARGET_API_MAC_CARBON switch (GetWindowKind(theWin) - WIN_BASE_KIND) { case NHW_MESSAGE: MsgUpdate(GetNhWin(theWin)); *************** *** 1532,1538 **** } ! #if !TARGET_API_MAC_CARBON static void DoScrollBar (Point p, short code, ControlHandle theBar, NhWindow *aWin) { --- 1549,1555 ---- } ! #if 1//!TARGET_API_MAC_CARBON static void DoScrollBar (Point p, short code, ControlHandle theBar, NhWindow *aWin) { *************** *** 1636,1642 **** if (!iflags.window_inited) return; ! (void) WaitNextEvent (everyEvent, &anEvent, -1, gMouseRgn); HandleEvent(&anEvent); return; } --- 1653,1662 ---- if (!iflags.window_inited) return; ! #if TARGET_API_MAC_CARBON ! QDFlushPortBuffer(GetWindowPort(_mt_window), NULL); ! #endif ! (void) WaitNextEvent (everyEvent, &anEvent, 1, gMouseRgn); HandleEvent(&anEvent); return; } *************** *** 1649,1655 **** EventRecord anEvent; ! #if !TARGET_API_MAC_CARBON /* We want to take care of keys in the buffer as fast as * possible */ --- 1669,1675 ---- EventRecord anEvent; ! #if 1//!TARGET_API_MAC_CARBON /* We want to take care of keys in the buffer as fast as * possible */ *************** *** 1674,1679 **** --- 1694,1702 ---- #endif do { + #if TARGET_API_MAC_CARBON + QDFlushPortBuffer(GetWindowPort(_mt_window), NULL); + #endif #if 0//TARGET_API_MAC_CARBON EventRef event; *************** *** 2100,2109 **** if (strchr(topl_resp, *click_to_cmd(pt.h, pt.v, clicked_mod))) nhbell(); else { ! #if !TARGET_API_MAC_CARBON if (cursor_locked) while (WaitMouseUp()) ! SystemTask(); #endif gClickedToMove = TRUE; --- 2123,2132 ---- if (strchr(topl_resp, *click_to_cmd(pt.h, pt.v, clicked_mod))) nhbell(); else { ! #if 1//!TARGET_API_MAC_CARBON if (cursor_locked) while (WaitMouseUp()) ! /*SystemTask()*/; #endif gClickedToMove = TRUE; *************** *** 2139,2145 **** } ! #if TARGET_API_MAC_CARBON static pascal OSStatus BaseEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata) { --- 2162,2168 ---- } ! #if 0//TARGET_API_MAC_CARBON static pascal OSStatus BaseEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata) { *************** *** 2422,2428 **** } ! #if TARGET_API_MAC_CARBON static pascal OSStatus MsgEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata) { --- 2445,2451 ---- } ! #if 0//TARGET_API_MAC_CARBON static pascal OSStatus MsgEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata) { *************** *** 2647,2653 **** } ! #if TARGET_API_MAC_CARBON static pascal OSStatus MenwEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata) { --- 2670,2676 ---- } ! #if 0//TARGET_API_MAC_CARBON static pascal OSStatus MenwEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata) { *************** *** 2825,2831 **** } ! #if TARGET_API_MAC_CARBON static pascal OSStatus TextEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata) { --- 2848,2854 ---- } ! #if 0//TARGET_API_MAC_CARBON static pascal OSStatus TextEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata) { *************** *** 2913,2919 **** * Global events */ ! #if TARGET_API_MAC_CARBON static pascal OSStatus GlobalEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata) { --- 2936,2942 ---- * Global events */ ! #if 0//TARGET_API_MAC_CARBON static pascal OSStatus GlobalEvent(EventHandlerCallRef nexthandler, EventRef event, void *userdata) { *************** *** 2997,3003 **** switch (code) { case inContent : ! #if !TARGET_API_MAC_CARBON if (not_inSelect) { int kind = GetWindowKind(theWindow) - WIN_BASE_KIND; winCursorFuncs [kind] (theEvent, theWindow, gMouseRgn); --- 3020,3026 ---- switch (code) { case inContent : ! #if 1//!TARGET_API_MAC_CARBON if (not_inSelect) { int kind = GetWindowKind(theWindow) - WIN_BASE_KIND; winCursorFuncs [kind] (theEvent, theWindow, gMouseRgn); *************** *** 3059,3065 **** } ! #if !TARGET_API_MAC_CARBON static short GeneralUpdate (EventRecord *theEvent, WindowPtr theWindow) { --- 3082,3088 ---- } ! #if 1//!TARGET_API_MAC_CARBON static short GeneralUpdate (EventRecord *theEvent, WindowPtr theWindow) { *************** *** 3077,3082 **** --- 3100,3108 ---- WindowPtr theWindow = (WindowPtr) theEvent->message; NhWindow *aWin = GetNhWin (theWindow); Rect r; + #if 1//!TARGET_API_MAC_CARBON + EventRecord fake; + #endif char existing_update_region = FALSE; *************** *** 3090,3096 **** GetWindowBounds(theWindow, kWindowContentRgn, &r); OffsetRect(&r, -r.left, -r.top); EraseRect(&r); ! #if TARGET_API_MAC_CARBON switch (GetWindowKind(theWindow) - WIN_BASE_KIND) { case NHW_BASE: case NHW_MAP: --- 3116,3122 ---- GetWindowBounds(theWindow, kWindowContentRgn, &r); OffsetRect(&r, -r.left, -r.top); EraseRect(&r); ! #if 0//TARGET_API_MAC_CARBON switch (GetWindowKind(theWindow) - WIN_BASE_KIND) { case NHW_BASE: case NHW_MAP: *************** *** 3108,3114 **** break; } #else ! winUpdateFuncs [GetWindowKind(theWin) - WIN_BASE_KIND] (&fake, theWin); #endif if (theWindow == _mt_window && existing_update_region) { --- 3134,3140 ---- break; } #else ! winUpdateFuncs[GetWindowKind(theWindow) - WIN_BASE_KIND](&fake, theWindow); #endif if (theWindow == _mt_window && existing_update_region) { *************** *** 3119,3125 **** } ! #if !TARGET_API_MAC_CARBON static void GeneralCursor (EventRecord *theEvent, WindowPtr theWindow, RgnHandle mouseRgn) { --- 3145,3151 ---- } ! #if 1//!TARGET_API_MAC_CARBON static void GeneralCursor (EventRecord *theEvent, WindowPtr theWindow, RgnHandle mouseRgn) { *************** *** 3150,3156 **** OffsetRect (&r, theEvent->where.h, theEvent->where.v); RectRgn (gMouseRgn, &r); } else { ! #if !TARGET_API_MAC_CARBON int kind = GetWindowKind(win) - WIN_BASE_KIND; if (kind >= 0 && kind <= NHW_TEXT) { winCursorFuncs [kind] (theEvent, win, gMouseRgn); --- 3176,3182 ---- OffsetRect (&r, theEvent->where.h, theEvent->where.v); RectRgn (gMouseRgn, &r); } else { ! #if 1//!TARGET_API_MAC_CARBON int kind = GetWindowKind(win) - WIN_BASE_KIND; if (kind >= 0 && kind <= NHW_TEXT) { winCursorFuncs [kind] (theEvent, win, gMouseRgn); *************** *** 3167,3173 **** void HandleEvent (EventRecord *theEvent) { switch (theEvent->what) { ! #if !TARGET_API_MAC_CARBON case autoKey: case keyDown: HandleKey(theEvent); --- 3193,3199 ---- void HandleEvent (EventRecord *theEvent) { switch (theEvent->what) { ! #if 1//!TARGET_API_MAC_CARBON case autoKey: case keyDown: HandleKey(theEvent); Index: mmodal.c =================================================================== RCS file: /usr/local/cvsroot/nethack/sys/mac/mmodal.c,v retrieving revision 1.3.2.1 diff -c -r1.3.2.1 mmodal.c *** mmodal.c 26 Aug 2003 02:41:55 -0000 1.3.2.1 --- mmodal.c 9 Aug 2004 01:58:58 -0000 *************** *** 2,8 **** /* Copyright (c) Jon W{tte, Hao-Yang Wang, Jonathan Handler 1992. */ /* NetHack may be freely redistributed. See license for details. */ ! #if !TARGET_API_MAC_CARBON # include # include #else --- 2,8 ---- /* Copyright (c) Jon W{tte, Hao-Yang Wang, Jonathan Handler 1992. */ /* NetHack may be freely redistributed. See license for details. */ ! #if 1 /*!TARGET_API_MAC_CARBON*/ # include # include #else Index: mttymain.c =================================================================== RCS file: /usr/local/cvsroot/nethack/sys/mac/mttymain.c,v retrieving revision 1.4.2.2 diff -c -r1.4.2.2 mttymain.c *** mttymain.c 28 Aug 2003 01:02:13 -0000 1.4.2.2 --- mttymain.c 9 Aug 2004 01:58:59 -0000 *************** *** 11,16 **** --- 11,17 ---- #if !TARGET_API_MAC_CARBON #include #endif + #include #define MT_WINDOW 135 #define MT_WIDTH 80