diff -r -c MacGlk-src-087 Folder/.c files/about.c nitfol-carbon/Carbon MacGlk Folder/.c files/about.c *** MacGlk-src-087 Folder/.c files/about.c Sun Aug 22 14:43:57 2004 --- nitfol-carbon/Carbon MacGlk Folder/.c files/about.c Sun Aug 22 14:43:52 2004 *************** *** 53,65 **** --- 53,73 ---- if (!glm_aboutwin) { justcreated = TRUE; glm_aboutwin = GetNewWindow(128, NULL, (WindowPtr)(-1)); + #if TARGET_API_MAC_CARBON + GetWindowPortBounds(glm_aboutwin, &box); + #else box = glm_aboutwin->portRect; + #endif if (!glm_aboutwin) { show_generror(strix_CantCreateHelp, 0); return; } + #if TARGET_API_MAC_CARBON + SetPortWindowPort(glm_aboutwin); + #else SetPort(glm_aboutwin); + #endif han = Get1Resource('TEXT', 1000); han2 = Get1Resource('styl', 1000); *************** *** 106,113 **** --- 114,126 ---- popupTitleCenterJust, m_GridMenu, 0, popupMenuProc, 0); han = (*tedit)->hText; + #if !TARGET_API_MAC_CARBON mmenu = (*((popupPrivateHandle)(*popmenu)->contrlData))->menu; mcount = CountMItems(mmenu); + #else + mmenu = GetControlPopupMenuRef(popmenu); + mcount = CountMenuItems(mmenu); + #endif for (lx=0; lxviewRect.top-1); + Line(portRect.right-1, 0); + UpdateControls(glm_aboutwin, visRgn); + TEUpdate(&portRect, tedit); + DisposeRgn(visRgn); + + EndUpdate(glm_aboutwin); + } + #endif void activate_about_box(Boolean turnon) { *************** *** 211,217 **** --- 248,260 ---- static pascal void scroll_splat(ControlHandle cont, short part) { + #if TARGET_API_MAC_CARBON + WindowPtr win = GetControlOwner(cont); + short min = GetControlMinimum(cont); + short max = GetControlMaximum(cont); + #else WindowPtr win = (*cont)->contrlOwner; + #endif unsigned long dist; short oldval, newval; Rect *box; *************** *** 237,246 **** --- 280,296 ---- else { newval = oldval + dist; } + #if !TARGET_API_MAC_CARBON if (newval < (*cont)->contrlMin) newval = (*cont)->contrlMin; if (newval > (*cont)->contrlMax) newval = (*cont)->contrlMax; + #else + if (newval < min) + newval = min; + if (newval > max) + newval = max; + #endif if (newval != oldval) { SetControlValue(cont, newval); TEScroll(0, (oldval-newval), tedit); *************** *** 255,261 **** --- 305,315 ---- short origval, newval; long ref; + #if !TARGET_API_MAC_CARBON SetPort(glm_aboutwin); + #else + SetPortWindowPort(glm_aboutwin); + #endif GlobalToLocal(&ev->where); part = FindControl(ev->where, glm_aboutwin, &cont); if (cont == tscroll) { *************** *** 300,306 **** Rect *box; short newval, oldval; short dist = 0; ! switch (key) { case key_PageDown: box = &(*tedit)->viewRect; --- 354,364 ---- Rect *box; short newval, oldval; short dist = 0; ! #if TARGET_API_MAC_CARBON ! short min = GetControlMinimum(tscroll); ! short max = GetControlMaximum(tscroll); ! #endif ! switch (key) { case key_PageDown: box = &(*tedit)->viewRect; *************** *** 329,338 **** --- 387,403 ---- oldval = GetControlValue(tscroll); newval = oldval + dist; + #if !TARGET_API_MAC_CARBON if (newval < (*tscroll)->contrlMin) newval = (*tscroll)->contrlMin; if (newval > (*tscroll)->contrlMax) newval = (*tscroll)->contrlMax; + #else + if (newval < min) + newval = min; + if (newval > max) + newval = max; + #endif if (newval != oldval) { SetControlValue(tscroll, newval); TEScroll(0, (oldval-newval), tedit); diff -r -c MacGlk-src-087 Folder/.c files/about2.c nitfol-carbon/Carbon MacGlk Folder/.c files/about2.c *** MacGlk-src-087 Folder/.c files/about2.c Sun Aug 22 14:43:57 2004 --- nitfol-carbon/Carbon MacGlk Folder/.c files/about2.c Sun Aug 22 14:43:52 2004 *************** *** 34,46 **** --- 34,54 ---- if (!glm_about2win) { justcreated = TRUE; glm_about2win = GetNewWindow(2000, NULL, (WindowPtr)(-1)); + #if TARGET_API_MAC_CARBON + GetWindowPortBounds(glm_about2win, &box); + #else box = glm_about2win->portRect; + #endif if (!glm_about2win) { show_generror(strix_CantCreateHelp, 0); return; } + #if TARGET_API_MAC_CARBON + SetPortWindowPort(glm_about2win); + #else SetPort(glm_about2win); + #endif han = Get1Resource('TEXT', 2000); han2 = Get1Resource('styl', 2000); *************** *** 111,116 **** --- 119,125 ---- tedit = NULL; } + #if !TARGET_API_MAC_CARBON void update_about2_box() { SetPort(glm_about2win); *************** *** 124,129 **** --- 133,159 ---- EndUpdate(glm_about2win); } + #else + void update_about2_box() + { + Rect portRect; + RgnHandle visRgn = NewRgn(); + + SetPortWindowPort(glm_about2win); + BeginUpdate(glm_about2win); + GetWindowPortBounds(glm_about2win, &portRect); + GetPortVisibleRegion(GetWindowPort(glm_about2win), visRgn); + + EraseRect(&portRect); + MoveTo(0, (*tedit)->viewRect.top-1); + Line(portRect.right-1, 0); + UpdateControls(glm_about2win, visRgn); + TEUpdate(&portRect, tedit); + + EndUpdate(glm_about2win); + DisposeRgn(visRgn); + } + #endif void activate_about2_box(Boolean turnon) { *************** *** 138,144 **** --- 168,180 ---- static pascal void scroll_splat(ControlHandle cont, short part) { + #if TARGET_API_MAC_CARBON + WindowPtr win = GetControlOwner(cont); + short min = GetControlMinimum(cont); + short max = GetControlMaximum(cont); + #else WindowPtr win = (*cont)->contrlOwner; + #endif unsigned long dist; short oldval, newval; Rect *box; *************** *** 164,173 **** --- 200,216 ---- else { newval = oldval + dist; } + #if !TARGET_API_MAC_CARBON if (newval < (*cont)->contrlMin) newval = (*cont)->contrlMin; if (newval > (*cont)->contrlMax) newval = (*cont)->contrlMax; + #else + if (newval < min) + newval = min; + if (newval > max) + newval = max; + #endif if (newval != oldval) { SetControlValue(cont, newval); TEScroll(0, (oldval-newval), tedit); *************** *** 181,187 **** --- 224,234 ---- short origval, newval; long ref; + #if !TARGET_API_MAC_CARBON SetPort(glm_about2win); + #else + SetPortWindowPort(glm_about2win); + #endif GlobalToLocal(&ev->where); part = FindControl(ev->where, glm_about2win, &cont); if (cont == tscroll) { *************** *** 212,217 **** --- 259,268 ---- Rect *box; short newval, oldval; short dist = 0; + #if TARGET_API_MAC_CARBON + short min = GetControlMinimum(tscroll); + short max = GetControlMaximum(tscroll); + #endif switch (key) { case key_PageDown: *************** *** 241,250 **** --- 292,308 ---- oldval = GetControlValue(tscroll); newval = oldval + dist; + #if !TARGET_API_MAC_CARBON if (newval < (*tscroll)->contrlMin) newval = (*tscroll)->contrlMin; if (newval > (*tscroll)->contrlMax) newval = (*tscroll)->contrlMax; + #else + if (newval < min) + newval = min; + if (newval > max) + newval = max; + #endif if (newval != oldval) { SetControlValue(tscroll, newval); TEScroll(0, (oldval-newval), tedit); diff -r -c MacGlk-src-087 Folder/.c files/disk.c nitfol-carbon/Carbon MacGlk Folder/.c files/disk.c *** MacGlk-src-087 Folder/.c files/disk.c Sun Aug 22 14:43:57 2004 --- nitfol-carbon/Carbon MacGlk Folder/.c files/disk.c Sun Aug 22 14:43:52 2004 *************** *** 30,35 **** --- 30,38 ---- BufFile fl; long filelen; Boolean bflag; + #if TARGET_API_MAC_CARBON + Rect portRect; + #endif if (glm_mainwin) { GrafPtr origport; *************** *** 38,51 **** --- 41,64 ---- short winw, winh; GetPort(&origport); + #if TARGET_API_MAC_CARBON + SetPortWindowPort(glm_mainwin); + GetWindowPortBounds(glm_mainwin, &portRect); + #else SetPort(glm_mainwin); + #endif pt.h = 0; pt.v = 0; LocalToGlobal(&pt); winx = pt.h; winy = pt.v; + #if TARGET_API_MAC_CARBON + winw = portRect.right; + winh = portRect.bottom; + #else winw = glm_mainwin->portRect.right; winh = glm_mainwin->portRect.bottom; + #endif SetPort(origport); if (winx != glm_prefs.winx || winy != glm_prefs.winy diff -r -c MacGlk-src-087 Folder/.c files/disk2.c nitfol-carbon/Carbon MacGlk Folder/.c files/disk2.c *** MacGlk-src-087 Folder/.c files/disk2.c Sun Aug 22 14:43:57 2004 --- nitfol-carbon/Carbon MacGlk Folder/.c files/disk2.c Sun Aug 22 14:43:52 2004 *************** *** 22,31 **** --- 22,38 ---- ((unsigned char *)&((dat)->creator)) #define align_long(dat) ((dat) + ((4 - ((dat) & 3)) & 3)) + #if !TARGET_API_MAC_CARBON pascal short loadfile_dhook(short item, DialogPtr dia, loadfiledata_t *loadfiledata); pascal short export_dhook(short item, DialogPtr dia, struct exportdata_t *exportdata); static DlgHookYDUPP export_dhook_upp = NULL; pascal Boolean loadfile_ffilter(ParmBlkPtr pb, loadfiledata_t *loadfiledata); + #else + pascal void export_eventfunc(NavEventCallbackMessage callBackSelector, + NavCBRecPtr callBackParms, + NavCallBackUserData callBackUD); + static NavEventUPP export_eventfunc_upp = NULL; + #endif static OSErr copy_one_fork(FSSpec *inspec, FSSpec *outspec, Boolean resfork); static OSErr copy_resources(short outfile, unsigned char *outfilename, *************** *** 41,49 **** --- 48,60 ---- void init_disk_upps() { + #if !TARGET_API_MAC_CARBON export_dhook_upp = NewDlgHookYDProc(export_dhook); loadfile_ffilter_upp = NewFileFilterYDProc(loadfile_ffilter); loadfile_dhook_upp = NewDlgHookYDProc(loadfile_dhook); + #else + export_eventfunc_upp = NewNavEventUPP (export_eventfunc); + #endif } OSErr build_bound_game() *************** *** 51,57 **** --- 62,78 ---- static short activelist[8] = {3, 10, 13, 7, 3, 13, 7, 10}; Point wherept; + #if TARGET_API_MAC_CARBON + OSType creator, type; + NavReplyRecord rep; + NavDialogOptions doptions; + ScriptCode nvScript; + FSSpec nvFile; + NavTypeListHandle typeList; + Boolean nvReplacing; + #else StandardFileReply rep; + #endif struct exportdata_t exportdata; FSSpec spec; Str255 prompt, name, applname; *************** *** 78,83 **** --- 99,141 ---- exportdata.creator = '????'; while (1) { + #if TARGET_API_MAC_CARBON + memset(&doptions, 0, sizeof(doptions)); + doptions.dialogOptionFlags = kNavDefaultNavDlogOptions; + doptions.dialogOptionFlags &= ~kNavAllowStationery; + doptions.location = wherept; + pstrcpy(doptions.message, prompt); + pstrcpy(doptions.savedFileName, name); + err = NavPutFile(NULL, /* default location in file system */ + &rep, + &doptions, + export_eventfunc_upp, + type, + creator, + &exportdata); + if ((err == noErr) && rep.validRecord) { + AEKeyword theKeyword; + DescType actualType; + Size actualSize; + + err = AEGetNthPtr(&(rep.selection), 1, + typeFSS, &theKeyword, + &actualType,&nvFile, + sizeof(nvFile), + &actualSize); + nvScript = rep.keyScript; + nvReplacing = rep.replacing; + } + if ((err != noErr) || !rep.validRecord) { + NavDisposeReply(&rep); + return userCanceledErr; + } + NavDisposeReply(&rep); + + /* prepare to go around again. exportdata.creator is already set. */ + firsttime = FALSE; + pstrcpy(name, nvFile.name); + #else CustomPutFile(prompt, name, &rep, 1000, wherept, export_dhook_upp, NULL, activelist + (firsttime ? 0 : 4), NULL, &exportdata); *************** *** 87,92 **** --- 145,151 ---- /* prepare to go around again. exportdata.creator is already set. */ firsttime = FALSE; pstrcpy(name, rep.sfFile.name); + #endif StrLength(creatorstr) = 4; creatorstr[1] = ZAPCHAR(&exportdata)[0]; *************** *** 134,140 **** --- 193,203 ---- printai("\pPBDTGetAPPL: error", err); /* but allow the code */ } + #if TARGET_API_MAC_CARBON + else if (pstreq(applname, nvFile.name)) { + #else else if (pstreq(applname, rep.sfFile.name)) { + #endif /* user seems to be saving over an old copy. Allow it. */ } else { *************** *** 155,162 **** --- 218,230 ---- break; } + #if TARGET_API_MAC_CARBON + spec = nvFile; + if (nvReplacing) { + #else spec = rep.sfFile; if (rep.sfReplacing) { + #endif err = FSpDelete(&spec); if (err) { show_strerror(strix_CantDeleteFile, strix_StandAloneFile, spec.name, err); *************** *** 166,172 **** --- 234,244 ---- set_cursor_state(curs_Arrow); + #if TARGET_API_MAC_CARBON + err = FSpCreate(&spec, exportdata.creator, 'APPL', nvScript); + #else err = FSpCreate(&spec, exportdata.creator, 'APPL', rep.sfScript); + #endif if (err) { set_cursor_dynamic(); show_strerror(strix_CantCreateFile, strix_StandAloneFile, spec.name, err); *************** *** 242,248 **** --- 314,328 ---- OSErr build_unbound_game() { + #if TARGET_API_MAC_CARBON + NavReplyRecord rep; + NavDialogOptions doptions; + Boolean nvReplacing; + FSSpec nvFile; + ScriptCode nvScript; + #else StandardFileReply rep; + #endif FSSpec spec; Str255 prompt, name, applname; short outfile, infile; *************** *** 257,268 **** --- 337,387 ---- if (!StrLength(prompt)) GetIndString(prompt, strlist_Messages, strix_DefaultSaveUnboundGameAs); + #if TARGET_API_MAC_CARBON + memset(&doptions, 0, sizeof(doptions)); + doptions.dialogOptionFlags = kNavDefaultNavDlogOptions; + doptions.dialogOptionFlags &= ~kNavAllowStationery; + doptions.location.h = -1; + doptions.location.v = -1; + pstrcpy(doptions.message, prompt); + pstrcpy(doptions.savedFileName, name); + err = NavPutFile(NULL, /* default location in file system */ + &rep, + &doptions, + /* eventProc FIXME, add an event proc */NULL, + 'APPL', + glm_app_creator, + NULL); + + if ((err == noErr) && rep.validRecord) { + AEKeyword theKeyword; + DescType actualType; + Size actualSize; + + err = AEGetNthPtr(&(rep.selection), 1, + typeFSS, &theKeyword, + &actualType,&nvFile, + sizeof(nvFile), + &actualSize); + nvScript = rep.keyScript; + nvReplacing = rep.replacing; + } + if ((err != noErr) || !rep.validRecord) { + NavDisposeReply(&rep); + return userCanceledErr; + } + NavDisposeReply(&rep); + + spec = nvFile; + if (nvReplacing) { + #else StandardPutFile(prompt, name, &rep); if (!rep.sfGood) return userCanceledErr; spec = rep.sfFile; if (rep.sfReplacing) { + #endif err = FSpDelete(&spec); if (err) { show_strerror(strix_CantDeleteFile, strix_UnboundFile, spec.name, err); *************** *** 272,278 **** --- 391,401 ---- set_cursor_state(curs_Watch); + #if TARGET_API_MAC_CARBON + err = FSpCreate(&spec, glm_app_creator, 'APPL', nvScript); + #else err = FSpCreate(&spec, glm_app_creator, 'APPL', rep.sfScript); + #endif if (err) { set_cursor_dynamic(); show_strerror(strix_CantCreateFile, strix_UnboundFile, spec.name, err); *************** *** 340,346 **** --- 463,477 ---- OSErr export_game_file() { Str255 prompt, origname; + #if TARGET_API_MAC_CARBON + NavReplyRecord rep; + NavDialogOptions doptions; + Boolean nvReplacing; + FSSpec nvFile; + ScriptCode nvScript; + #else StandardFileReply rep; + #endif OSErr err; short file; long count; *************** *** 351,356 **** --- 482,528 ---- GetIndString(prompt, strlist_Messages, strix_SaveGameFileAs); GetIndString(origname, strlist_Messages, strix_UntitledGameFile); + #if TARGET_API_MAC_CARBON + memset(&doptions, 0, sizeof(doptions)); + doptions.dialogOptionFlags = kNavDefaultNavDlogOptions; + doptions.dialogOptionFlags &= ~kNavAllowStationery; + doptions.location.h = -1; + doptions.location.v = -1; + pstrcpy(doptions.message, prompt); + pstrcpy(doptions.savedFileName, origname); + err = NavPutFile(NULL, /* default location in file system */ + &rep, + &doptions, + /* eventProc FIXME, add an event proc */NULL, + 'APPL', + glm_app_creator, + NULL); + + if ((err == noErr) && rep.validRecord) { + AEKeyword theKeyword; + DescType actualType; + Size actualSize; + + err = AEGetNthPtr(&(rep.selection), 1, + typeFSS, &theKeyword, + &actualType,&nvFile, + sizeof(nvFile), + &actualSize); + nvScript = rep.keyScript; + nvReplacing = rep.replacing; + } + if ((err != noErr) || !rep.validRecord) { + NavDisposeReply(&rep); + return 1; + } + NavDisposeReply(&rep); + + /* user hit Save */ + if (nvReplacing) { + err = FSpDelete(&nvFile); + if (err) { + show_strerror(strix_CantDeleteFile, strix_GameFile, nvFile.name, err); + #else StandardPutFile(prompt, origname, &rep); if (!rep.sfGood) return 1; *************** *** 360,386 **** --- 532,574 ---- err = FSpDelete(&rep.sfFile); if (err) { show_strerror(strix_CantDeleteFile, strix_GameFile, rep.sfFile.name, err); + #endif return err; } } set_cursor_state(curs_Watch); + #if TARGET_API_MAC_CARBON + err = FSpCreate(&nvFile, glm_app_creator, glm_gamefile_types[0], nvScript); + #else err = FSpCreate(&rep.sfFile, glm_app_creator, glm_gamefile_types[0], rep.sfScript); + #endif if (err) { set_cursor_dynamic(); + #if TARGET_API_MAC_CARBON + show_strerror(strix_CantCreateFile, strix_GameFile, nvFile.name, err); + #else show_strerror(strix_CantCreateFile, strix_GameFile, rep.sfFile.name, err); + #endif return err; } + #if TARGET_API_MAC_CARBON + err = copy_stream_to_file(&nvFile, glm_gamefile); + + err = FlushVol(NULL, nvFile.vRefNum); + #else err = copy_stream_to_file(&rep.sfFile, glm_gamefile); err = FlushVol(NULL, rep.sfFile.vRefNum); + #endif set_cursor_dynamic(); return noErr; } + #if !TARGET_API_MAC_CARBON pascal short export_dhook(short item, DialogPtr dia, struct exportdata_t *exportdata) { short ix; *************** *** 473,478 **** --- 661,750 ---- return !gotmatch; } + #else Dialogs.h + #include + static pascal void export_eventfunc(NavEventCallbackMessage callBackSelector, + NavCBRecPtr callBackParms, + NavCallBackUserData callBackUD) + { + const short customditl = 1500; + static Handle DITLHandle; + static short customized = 0; + static short cwidth, cheight; + WindowPtr window; + short editbox; + + switch (callBackSelector) + { + case kNavCBCustomize: + if (!customized) { + DITLHandle = Get1Resource('DITL', customditl); + cwidth = ((short *)*DITLHandle)[6]; + cheight = ((short *)*DITLHandle)[5]; + callBackParms->customRect.right = callBackParms->customRect.left + cwidth; + callBackParms->customRect.bottom = callBackParms->customRect.top + cheight; + ReleaseResource(DITLHandle); + DITLHandle = NULL; + customized = 1; + + } + else { + if ((cwidth > (callBackParms->customRect.right - callBackParms->customRect.left)) || + (cheight > (callBackParms->customRect.bottom - callBackParms->customRect.top))) { + customized = -1; /* customization failed */ + } + } + break; + case kNavCBStart: + if (customized > 0) { + DITLHandle = Get1Resource('DITL', customditl); + + NavCustomControl (callBackParms->context, + kNavCtlAddControlList, DITLHandle); + + } + break; + case kNavCBTerminate: + + if (customized > 0) { + DialogRef dr; + DialogItemType itemType; + Handle ihan; + Rect box; + int ix; + UInt16 editbox; + Str255 buf; + struct exportdata_t *exportdata = (struct exportdata_t *)callBackUD; + + NavCustomControl(callBackParms->context, kNavCtlGetFirstControlID, &editbox); + dr = GetDialogFromWindow(callBackParms->window); + GetDialogItem(dr, editbox + 1, &itemType, &ihan, &box); + GetDialogItemText(ihan, buf); + for (ix=0; ix<4; ix++) { + if (ix < StrLength(buf)) + ZAPCHAR(exportdata)[ix] = buf[1+ix]; + else + ZAPCHAR(exportdata)[ix] = ' '; + } + + ReleaseResource(DITLHandle); + DITLHandle = NULL; + customized = 0; + } + break; + case kNavCBEvent: + window = + (WindowPtr)callBackParms->eventData.eventDataParms.event->message; + switch (callBackParms->eventData.eventDataParms.event->what) + { + case updateEvt: + /* fix me */ + break; + } + break; + } + } + #endif static OSErr copy_one_fork(FSSpec *inspec, FSSpec *outspec, Boolean resfork) { diff -r -c MacGlk-src-087 Folder/.c files/emux.c nitfol-carbon/Carbon MacGlk Folder/.c files/emux.c *** MacGlk-src-087 Folder/.c files/emux.c Sun Aug 22 14:43:57 2004 --- nitfol-carbon/Carbon MacGlk Folder/.c files/emux.c Sun Aug 22 14:43:52 2004 *************** *** 10,20 **** --- 10,28 ---- Be sure to test colorqd_avail. */ + #if TARGET_API_MAC_CARBON + #define TestSetPort(w) \ + if ((w) != curwin) { \ + SetPortWindowPort(w); curwin = (w); curfont = NULL; curislined = FALSE; \ + curcolor = NULL; curbcolor = NULL; \ + } + #else #define TestSetPort(w) \ if ((w) != curwin) { \ SetPort(w); curwin = (w); curfont = NULL; curislined = FALSE; \ curcolor = NULL; curbcolor = NULL; \ } + #endif static WindowPtr curwin; static fontref_t *curfont; *************** *** 64,69 **** --- 72,80 ---- void XClearWindow(WindowPtr win) { + #if TARGET_API_MAC_CARBON + Rect portRect; + #endif TestSetPort(win); if (colorqd_avail) { *************** *** 72,78 **** --- 83,93 ---- RGBBackColor(curbcolor); } } + #if TARGET_API_MAC_CARBON + EraseRect(GetWindowPortBounds(win, &portRect)); + #else EraseRect(&win->portRect); + #endif } void XClipToValid(WindowPtr win, Boolean first) *************** *** 83,89 **** --- 98,108 ---- if (first) { GetClip(tmpclipregion); + #if TARGET_API_MAC_CARBON + GetWindowRegion(win, kWindowUpdateRgn, tmp2region); + #else CopyRgn(((WindowPeek)win)->updateRgn, tmp2region); + #endif testpt.h = 0; testpt.v = 0; GlobalToLocal(&testpt); *************** *** 121,126 **** --- 140,148 ---- { Rect box; Boolean islined = (link && link->dounderline); + #if TARGET_API_MAC_CARBON + Pattern qdblack; + #endif TestSetPort(win); *************** *** 135,141 **** --- 157,167 ---- } mySetRect(&box, xpos, ypos-lineoff, xpos+fieldwid, ypos-lineoff+lineheight); + #if TARGET_API_MAC_CARBON + FillRect(&box, GetQDGlobalsBlack(&qdblack)); + #else FillRect(&box, &qd.black); + #endif MoveTo(xpos, ypos); DrawText(buf, 0, len); *************** *** 178,183 **** --- 204,212 ---- short pattern, short xpos, short ypos, short wid, short hgt) { Rect box; + #if TARGET_API_MAC_CARBON + Pattern qdpat; + #endif TestSetPort(win); *************** *** 202,207 **** --- 231,247 ---- mySetRect(&box, xpos, ypos, xpos+wid, ypos+hgt); switch (pattern) { + #if TARGET_API_MAC_CARBON + case gcblack: + FillRect(&box, GetQDGlobalsBlack(&qdpat)); + break; + case gcwhite: + FillRect(&box, GetQDGlobalsWhite(&qdpat)); + break; + case gcgrey: + FillRect(&box, GetQDGlobalsGray(&qdpat)); + break; + #else case gcblack: FillRect(&box, &qd.black); break; *************** *** 211,216 **** --- 251,257 ---- case gcgrey: FillRect(&box, &qd.gray); break; + #endif case gcflip: if (colorqd_avail) { LMSetHiliteMode(LMGetHiliteMode() & (~(1<