|
From: Karsten W. <kar...@us...> - 2005-12-20 22:24:56
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19437 Modified Files: filedialog.c Log Message: reenabling os9 compilation Index: filedialog.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/filedialog.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** filedialog.c 7 Oct 2005 04:07:42 -0000 1.7 --- filedialog.c 20 Dec 2005 22:24:44 -0000 1.8 *************** *** 30,34 **** #ifdef MACVERSION ! #include "mac.h" #endif --- 30,34 ---- #ifdef MACVERSION ! # include "mac.h" #endif *************** *** 84,98 **** 6/11/93 dmb: added for System 7 Standard File */ ! #ifdef flcomponent long curA5; ! #endif if (GetWRefCon (pdialog) != sfMainDialogRefCon) return (item); ! #ifdef flcomponent curA5 = SetUpAppA5 (); ! #endif if (item == sfHookFirstCall) { --- 84,98 ---- 6/11/93 dmb: added for System 7 Standard File */ ! #ifdef flcomponent long curA5; ! #endif if (GetWRefCon (pdialog) != sfMainDialogRefCon) return (item); ! #ifdef flcomponent curA5 = SetUpAppA5 (); ! #endif if (item == sfHookFirstCall) { *************** *** 102,110 **** } ! #ifdef flcomponent RestoreA5 (curA5); ! #endif return (item); --- 102,110 ---- } ! #ifdef flcomponent RestoreA5 (curA5); ! #endif return (item); *************** *** 117,131 **** 6/11/93 dmb: recoded to System 7 Standard File */ ! #ifdef flcomponent long curA5; ! #endif if (GetWRefCon (pdialog) != sfMainDialogRefCon) return (item); ! #ifdef flcomponent curA5 = SetUpAppA5 (); ! #endif if (item == sfHookFirstCall) { --- 117,132 ---- 6/11/93 dmb: recoded to System 7 Standard File */ ! #ifdef flcomponent long curA5; ! #endif ! if (GetWRefCon (pdialog) != sfMainDialogRefCon) return (item); ! #ifdef flcomponent curA5 = SetUpAppA5 (); ! #endif if (item == sfHookFirstCall) { *************** *** 136,147 **** //Code change by Timothy Paustian Sunday, April 30, 2000 9:20:45 PM //Changed to Opaque call for Carbon ! #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 dialogPort = GetDialogPort(pdialog); GetPortBounds(dialogPort, &rdialog); ! #else //old code ! #pragma unused(dialogPort) rdialog = (*pdialog).portRect; ! #endif if (isemptystring ((*pdata).sfprompt)) { --- 137,148 ---- //Code change by Timothy Paustian Sunday, April 30, 2000 9:20:45 PM //Changed to Opaque call for Carbon ! #if ACCESSOR_CALLS_ARE_FUNCTIONS == 1 dialogPort = GetDialogPort(pdialog); GetPortBounds(dialogPort, &rdialog); ! #else //old code ! #pragma unused(dialogPort) rdialog = (*pdialog).portRect; ! #endif if (isemptystring ((*pdata).sfprompt)) { *************** *** 165,173 **** } ! #ifdef flcomponent RestoreA5 (curA5); ! #endif return (item); --- 166,174 ---- } ! #ifdef flcomponent RestoreA5 (curA5); ! #endif return (item); *************** *** 190,205 **** bigstring bs; ! #ifdef flcomponent long curA5; ! #endif if (GetWRefCon (pdialog) != sfMainDialogRefCon) return (item); ! #ifdef flcomponent curA5 = SetUpAppA5 (); ! #endif item = sfprompthook (item, pdialog, pdata); --- 191,206 ---- bigstring bs; ! #ifdef flcomponent long curA5; ! #endif if (GetWRefCon (pdialog) != sfMainDialogRefCon) return (item); ! #ifdef flcomponent curA5 = SetUpAppA5 (); ! #endif item = sfprompthook (item, pdialog, pdata); *************** *** 297,311 **** button like Frontier 1.0. */ ! #ifdef flcomponent long curA5; ! #endif if (GetWRefCon (pdialog) != sfMainDialogRefCon) return (item); ! #ifdef flcomponent curA5 = SetUpAppA5 (); ! #endif item = sfprompthook (item, pdialog, pdata); --- 298,313 ---- button like Frontier 1.0. */ ! #ifdef flcomponent long curA5; ! #endif ! if (GetWRefCon (pdialog) != sfMainDialogRefCon) return (item); ! #ifdef flcomponent curA5 = SetUpAppA5 (); ! #endif item = sfprompthook (item, pdialog, pdata); *************** *** 356,364 **** } ! #ifdef flcomponent RestoreA5 (curA5); ! #endif return (item); --- 358,366 ---- } ! #ifdef flcomponent RestoreA5 (curA5); ! #endif return (item); *************** *** 367,372 **** static pascal Boolean onlyfoldersfilter (ParmBlkPtr pb, tysfdata *pdata) { ! ! #pragma unused (pdata) /* --- 369,373 ---- static pascal Boolean onlyfoldersfilter (ParmBlkPtr pb, tysfdata *pdata) { ! #pragma unused (pdata) /* *************** *** 500,511 **** FSSpec *fs = &sfdata.sfreply.sfFile; OSErr anErr = noErr; ! #if !TARGET_API_MAC_CARBON ! Point pt = {-1, -1}; ! short cttypes = -1; ! OSType *types = nil; ! #endif ! #ifdef flcomponent long appA5; ! #endif //move the switch statement to below because it's smarter to call it there when using --- 501,514 ---- FSSpec *fs = &sfdata.sfreply.sfFile; OSErr anErr = noErr; ! ! #if !TARGET_API_MAC_CARBON ! Point pt = {-1, -1}; ! short cttypes = -1; ! OSType *types = nil; ! #endif ! ! #ifdef flcomponent long appA5; ! #endif //move the switch statement to below because it's smarter to call it there when using *************** *** 538,546 **** shellactivate (); ! #ifdef flcomponent appA5 = SetUpCurA5 (); /*for system*/ ! #endif switch (sfverb) { --- 541,549 ---- shellactivate (); ! #ifdef flcomponent appA5 = SetUpCurA5 (); /*for system*/ ! #endif switch (sfverb) { *************** *** 550,570 **** anErr = TimsPutFile(bsprompt, (*fs).name, &sfdata.sfreply); } ! #if TARGET_API_MAC_CARBON != 1 //we can get away with this because nav services is always there in OSX. else ! CustomPutFile (bsprompt, (*fs).name, &sfdata.sfreply, sfputfileid, pt, ! sfputfilehookUPP, nil, nil, nil, &sfdata); ! #endif break; case sfgetfileverb: ! if(gCanUseNavServ) ! anErr = getafile (bsprompt, filetypes, &sfdata.sfreply, filecreator); ! #if !TARGET_API_MAC_CARBON ! else ! CustomGetFile (knowntypesfilterUPP, cttypes, types, &sfdata.sfreply, sfgetfileid, pt, ! sfprompthookUPP, nil, nil, nil, &sfdata); ! #endif break; --- 553,587 ---- anErr = TimsPutFile(bsprompt, (*fs).name, &sfdata.sfreply); } ! #if TARGET_API_MAC_CARBON != 1 //we can get away with this because nav services is always there in OSX. else ! CustomPutFile ( ! bsprompt, ! (*fs).name, ! &sfdata.sfreply, ! sfputfileid, ! pt, ! sfputfilehookUPP, ! nil, nil, nil, ! &sfdata); ! #endif break; case sfgetfileverb: ! #if TARGET_API_MAC_CARBON == 1 ! anErr = getafile (bsprompt, filetypes, &sfdata.sfreply, filecreator); ! #else ! CustomGetFile ( ! knowntypesfilterUPP, ! cttypes, ! types, ! &sfdata.sfreply, ! sfgetfileid, ! pt, ! sfprompthookUPP, ! nil, nil, nil, ! &sfdata); ! #endif break; *************** *** 572,580 **** if(gCanUseNavServ) anErr = TimsGetFolderOrVolume(bsprompt, sfgetfolderid, &sfdata.sfreply); ! #if !TARGET_API_MAC_CARBON else CustomGetFile (onlyfoldersfilterUPP, cttypes, types, &sfdata.sfreply, sfgetfolderid, pt, sffolderhookUPP, nil, nil, nil, &sfdata); ! #endif break; --- 589,597 ---- if(gCanUseNavServ) anErr = TimsGetFolderOrVolume(bsprompt, sfgetfolderid, &sfdata.sfreply); ! #if !TARGET_API_MAC_CARBON else CustomGetFile (onlyfoldersfilterUPP, cttypes, types, &sfdata.sfreply, sfgetfolderid, pt, sffolderhookUPP, nil, nil, nil, &sfdata); ! #endif break; *************** *** 582,590 **** if(gCanUseNavServ) anErr = TimsGetFolderOrVolume(bsprompt, sfgetdiskid, &sfdata.sfreply); ! #if !TARGET_API_MAC_CARBON else CustomGetFile (nil, cttypes, types, &sfdata.sfreply, sfgetdiskid, pt, sfdiskhookUPP, nil, nil, nil, &sfdata); ! #endif break; --- 599,607 ---- if(gCanUseNavServ) anErr = TimsGetFolderOrVolume(bsprompt, sfgetdiskid, &sfdata.sfreply); ! #if !TARGET_API_MAC_CARBON else CustomGetFile (nil, cttypes, types, &sfdata.sfreply, sfgetdiskid, pt, sfdiskhookUPP, nil, nil, nil, &sfdata); ! #endif break; *************** *** 605,613 **** // sfhook, nil, nil, nil, &sfdata); ! #ifdef flcomponent RestoreA5 (appA5); ! #endif //if the user canceled return false //I know that oserror can handle this, but lets make it --- 622,630 ---- // sfhook, nil, nil, nil, &sfdata); ! #ifdef flcomponent RestoreA5 (appA5); ! #endif //if the user canceled return false //I know that oserror can handle this, but lets make it *************** *** 654,659 **** boolean sfdialog (tysfverb sfverb, bigstring bsprompt, ptrsftypelist filetypes, tyfilespec *fspec, OSType filecreator) { ! ! #pragma unused (filecreator) /* --- 671,675 ---- boolean sfdialog (tysfverb sfverb, bigstring bsprompt, ptrsftypelist filetypes, tyfilespec *fspec, OSType filecreator) { ! #pragma unused (filecreator) /* *************** *** 684,687 **** --- 700,704 ---- static LPMALLOC pMalloc = NULL; + OpenFileName.lStructSize = sizeof(OPENFILENAME); OpenFileName.hwndOwner = shellframewindow; *************** *** 1207,1223 **** NavCallBackUserData callBackUD) { ! #pragma unused(callBackUD) ! if (callBackSelector == kNavCBEvent) ! { ! if(((callBackParms->eventData) ! .eventDataParms).event->what == updateEvt) ! { ! //I was having a crash due to getting the window ptr outside the switch statement. ! // This now works. ! //10/30/00 Timothy Paustian ! WindowPtr window = (WindowPtr)(((callBackParms->eventData).eventDataParms).event)->message; ! shellupdatenow(window); ! } ! } } --- 1224,1239 ---- NavCallBackUserData callBackUD) { ! #pragma unused(callBackUD) ! if (callBackSelector == kNavCBEvent) ! { ! if( ((callBackParms->eventData).eventDataParms).event->what == updateEvt) ! { ! //I was having a crash due to getting the window ptr outside the switch statement. ! // This now works. ! //10/30/00 Timothy Paustian ! WindowPtr window = (WindowPtr)(((callBackParms->eventData).eventDataParms).event)->message; ! shellupdatenow(window); ! } ! } } |