Remove outdated pascal specifier

This commit is contained in:
Michael Buckley 2019-05-23 18:18:53 -07:00
parent d691cf052b
commit 2af9a88744
18 changed files with 231 additions and 303 deletions

View File

@ -27,14 +27,14 @@
static AEEventHandlerUPP oappUPP, rappUPP, pdocUPP, quitUPP, odocUPP; static AEEventHandlerUPP oappUPP, rappUPP, pdocUPP, quitUPP, odocUPP;
static pascal OSErr AEoapp (const AppleEvent *, AppleEvent *, long); static OSErr AEoapp (const AppleEvent *, AppleEvent *, long);
static pascal OSErr AErapp (const AppleEvent *, AppleEvent *, long); static OSErr AErapp (const AppleEvent *, AppleEvent *, long);
static pascal OSErr AEpdoc (const AppleEvent *, AppleEvent *, long); static OSErr AEpdoc (const AppleEvent *, AppleEvent *, long);
static pascal OSErr AEquit (const AppleEvent *, AppleEvent *, long); static OSErr AEquit (const AppleEvent *, AppleEvent *, long);
static pascal OSErr AEodoc (const AppleEvent *, AppleEvent *, long); static OSErr AEodoc (const AppleEvent *, AppleEvent *, long);
static pascal OSErr AEoapp (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) static OSErr AEoapp (const AppleEvent *theEvent, AppleEvent *theReply, long refCon)
{ {
if (running) if (running)
return (noErr); return (noErr);
@ -53,7 +53,7 @@ static pascal OSErr AEoapp (const AppleEvent *theEvent, AppleEvent *theReply, lo
return (noErr); return (noErr);
} }
static pascal OSErr AErapp (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) static OSErr AErapp (const AppleEvent *theEvent, AppleEvent *theReply, long refCon)
{ {
if (running) if (running)
return (noErr); return (noErr);
@ -80,12 +80,12 @@ static pascal OSErr AErapp (const AppleEvent *theEvent, AppleEvent *theReply, lo
return (noErr); return (noErr);
} }
static pascal OSErr AEpdoc (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) static OSErr AEpdoc (const AppleEvent *theEvent, AppleEvent *theReply, long refCon)
{ {
return (errAEEventNotHandled); return (errAEEventNotHandled);
} }
static pascal OSErr AEquit (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) static OSErr AEquit (const AppleEvent *theEvent, AppleEvent *theReply, long refCon)
{ {
if (running) if (running)
return (noErr); return (noErr);
@ -96,7 +96,7 @@ static pascal OSErr AEquit (const AppleEvent *theEvent, AppleEvent *theReply, lo
return (noErr); return (noErr);
} }
static pascal OSErr AEodoc (const AppleEvent *theEvent, AppleEvent *theReply, long refCon) static OSErr AEodoc (const AppleEvent *theEvent, AppleEvent *theReply, long refCon)
{ {
OSErr err; OSErr err;
FSRef ref; FSRef ref;

View File

@ -67,8 +67,8 @@ static void ReplaceAudioUnitCarbonView (void);
static void ResizeSoundEffectsDialog (HIViewRef); static void ResizeSoundEffectsDialog (HIViewRef);
static void MacSamplesAvailableCallBack (void *); static void MacSamplesAvailableCallBack (void *);
static OSStatus MacAURenderCallBack (void *, AudioUnitRenderActionFlags *, const AudioTimeStamp *, UInt32, UInt32, AudioBufferList *); static OSStatus MacAURenderCallBack (void *, AudioUnitRenderActionFlags *, const AudioTimeStamp *, UInt32, UInt32, AudioBufferList *);
static pascal OSStatus SoundEffectsEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus SoundEffectsEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus SoundEffectsCarbonViewEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus SoundEffectsCarbonViewEventHandler (EventHandlerCallRef, EventRef, void *);
void InitMacSound (void) void InitMacSound (void)
@ -830,7 +830,7 @@ void ConfigureSoundEffects (void)
} }
} }
static pascal OSStatus SoundEffectsCarbonViewEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus SoundEffectsCarbonViewEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
HIViewRef ctl; HIViewRef ctl;
@ -863,7 +863,7 @@ static pascal OSStatus SoundEffectsCarbonViewEventHandler (EventHandlerCallRef i
return (result); return (result);
} }
static pascal OSStatus SoundEffectsEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus SoundEffectsEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowRef tWindowRef = (WindowRef) inUserData; WindowRef tWindowRef = (WindowRef) inUserData;

View File

@ -15,6 +15,7 @@
(c) Copyright 2004 Alexander and Sander (c) Copyright 2004 Alexander and Sander
(c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2004 - 2005 Steven Seeger
(c) Copyright 2005 Ryan Vogt (c) Copyright 2005 Ryan Vogt
(c) Copyright 2019 Michael Donald Buckley
***********************************************************************************/ ***********************************************************************************/
@ -60,21 +61,21 @@ static NavState gSheetNav;
static NSAutoreleasePool *gPool; static NSAutoreleasePool *gPool;
static NSPopUpButton *gPopM, *gPopI, *gPopV, *gPopH; static NSPopUpButton *gPopM, *gPopI, *gPopV, *gPopH;
static pascal void NavGenericOpenEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); static void NavGenericOpenEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData);
static pascal void NavGenericSaveEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); static void NavGenericSaveEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData);
static pascal Boolean NavOpenCartFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes); static Boolean NavOpenCartFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes);
static pascal Boolean NavDefrostFromFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes); static Boolean NavDefrostFromFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes);
static pascal Boolean NavPlayMovieFromFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes); static Boolean NavPlayMovieFromFilter (AEDesc *, void *, NavCallBackUserData, NavFilterModes);
#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT
static void GlobalPointToWindowLocalPoint (Point *, WindowRef); static void GlobalPointToWindowLocalPoint (Point *, WindowRef);
static pascal void NavOpenCartEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); static void NavOpenCartEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData);
static pascal void NavRecordMovieToEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); static void NavRecordMovieToEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData);
static pascal void NavPlayMovieFromEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); static void NavPlayMovieFromEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData);
static pascal void NavQTMovieRecordToEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData); static void NavQTMovieRecordToEventHandler (const NavEventCallbackMessage, NavCBRecPtr, NavCallBackUserData);
#endif #endif
#ifdef MAC_TIGER_PANTHER_SUPPORT #ifdef MAC_TIGER_PANTHER_SUPPORT
static pascal Boolean NavDefrostFromPreview (NavCBRecPtr, NavCallBackUserData); static Boolean NavDefrostFromPreview (NavCBRecPtr, NavCallBackUserData);
static pascal Boolean NavPlayMovieFromPreview (NavCBRecPtr, NavCallBackUserData); static Boolean NavPlayMovieFromPreview (NavCBRecPtr, NavCallBackUserData);
#endif #endif
@ -1085,7 +1086,7 @@ bool8 NavEndChooseFolderSheet (FSRef *ref)
return (false); return (false);
} }
static pascal void NavGenericOpenEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) static void NavGenericOpenEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD)
{ {
OSStatus err; OSStatus err;
NavReplyRecord reply; NavReplyRecord reply;
@ -1163,7 +1164,7 @@ static pascal void NavGenericOpenEventHandler (const NavEventCallbackMessage cal
} }
} }
static pascal void NavGenericSaveEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) static void NavGenericSaveEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD)
{ {
OSStatus err; OSStatus err;
NavReplyRecord reply; NavReplyRecord reply;
@ -1221,7 +1222,7 @@ static pascal void NavGenericSaveEventHandler (const NavEventCallbackMessage cal
} }
#ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT #ifdef MAC_LEOPARD_TIGER_PANTHER_SUPPORT
static pascal void NavOpenCartEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) static void NavOpenCartEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD)
{ {
static Boolean embedded = false; static Boolean embedded = false;
@ -1385,7 +1386,7 @@ static pascal void NavOpenCartEventHandler (const NavEventCallbackMessage callBa
} }
} }
static pascal void NavPlayMovieFromEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) static void NavPlayMovieFromEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD)
{ {
static Boolean embedded = false; static Boolean embedded = false;
@ -1509,7 +1510,7 @@ static pascal void NavPlayMovieFromEventHandler (const NavEventCallbackMessage c
} }
} }
static pascal void NavRecordMovieToEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) static void NavRecordMovieToEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD)
{ {
static Boolean embedded = false; static Boolean embedded = false;
@ -1667,7 +1668,7 @@ static pascal void NavRecordMovieToEventHandler (const NavEventCallbackMessage c
} }
} }
static pascal void NavQTMovieRecordToEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) static void NavQTMovieRecordToEventHandler (const NavEventCallbackMessage callBackSelector, NavCBRecPtr callBackParms, NavCallBackUserData callBackUD)
{ {
static Boolean embedded = false; static Boolean embedded = false;
@ -1804,7 +1805,7 @@ static pascal void NavQTMovieRecordToEventHandler (const NavEventCallbackMessage
} }
#endif #endif
static pascal Boolean NavOpenCartFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode) static Boolean NavOpenCartFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode)
{ {
OSStatus err; OSStatus err;
AEDesc resultDesc; AEDesc resultDesc;
@ -1849,7 +1850,7 @@ static pascal Boolean NavOpenCartFilter (AEDesc *theItem, void *ninfo, NavCallBa
return (result); return (result);
} }
static pascal Boolean NavDefrostFromFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode) static Boolean NavDefrostFromFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode)
{ {
OSStatus err; OSStatus err;
AEDesc resultDesc; AEDesc resultDesc;
@ -1890,7 +1891,7 @@ static pascal Boolean NavDefrostFromFilter (AEDesc *theItem, void *ninfo, NavCal
return (result); return (result);
} }
static pascal Boolean NavPlayMovieFromFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode) static Boolean NavPlayMovieFromFilter (AEDesc *theItem, void *ninfo, NavCallBackUserData callbackUD, NavFilterModes filterMode)
{ {
OSStatus err; OSStatus err;
AEDesc resultDesc; AEDesc resultDesc;
@ -1932,7 +1933,7 @@ static pascal Boolean NavPlayMovieFromFilter (AEDesc *theItem, void *ninfo, NavC
} }
#ifdef MAC_TIGER_PANTHER_SUPPORT #ifdef MAC_TIGER_PANTHER_SUPPORT
static pascal Boolean NavDefrostFromPreview (NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) static Boolean NavDefrostFromPreview (NavCBRecPtr callBackParms, NavCallBackUserData callBackUD)
{ {
if (systemVersion >= 0x1050) if (systemVersion >= 0x1050)
return (true); return (true);
@ -2006,7 +2007,7 @@ static pascal Boolean NavDefrostFromPreview (NavCBRecPtr callBackParms, NavCallB
bounds.size.width = 128.0f; bounds.size.width = 128.0f;
bounds.size.height = 120.0f; bounds.size.height = 120.0f;
DrawThumbnailResource(&ref, ctx, bounds); DrawThumbnailFromExtendedAttribute(&ref, ctx, bounds);
HIThemeTextInfo textinfo; HIThemeTextInfo textinfo;
@ -2045,7 +2046,7 @@ static pascal Boolean NavDefrostFromPreview (NavCBRecPtr callBackParms, NavCallB
return (result); return (result);
} }
static pascal Boolean NavPlayMovieFromPreview (NavCBRecPtr callBackParms, NavCallBackUserData callBackUD) static Boolean NavPlayMovieFromPreview (NavCBRecPtr callBackParms, NavCallBackUserData callBackUD)
{ {
if (systemVersion >= 0x1050) if (systemVersion >= 0x1050)
return (true); return (true);
@ -2178,7 +2179,7 @@ static pascal Boolean NavPlayMovieFromPreview (NavCBRecPtr callBackParms, NavCal
bounds.size.width = 128.0f; bounds.size.width = 128.0f;
bounds.size.height = 120.0f; bounds.size.height = 120.0f;
DrawThumbnailResource(&ref, ctx, bounds); DrawThumbnailFromExtendedAttribute(&ref, ctx, bounds);
// Text // Text

View File

@ -62,10 +62,10 @@ static void DetachCheatItems (void);
static void AddCheatItem (void); static void AddCheatItem (void);
static void DeleteCheatItem (void); static void DeleteCheatItem (void);
static void EnableAllCheatItems (void); static void EnableAllCheatItems (void);
static pascal void DBItemNotificationCallBack (HIViewRef, DataBrowserItemID, DataBrowserItemNotification); static void DBItemNotificationCallBack (HIViewRef, DataBrowserItemID, DataBrowserItemNotification);
static pascal Boolean DBCompareCallBack (HIViewRef, DataBrowserItemID, DataBrowserItemID, DataBrowserPropertyID); static Boolean DBCompareCallBack (HIViewRef, DataBrowserItemID, DataBrowserItemID, DataBrowserPropertyID);
static pascal OSStatus DBClientDataCallback (HIViewRef, DataBrowserItemID, DataBrowserPropertyID, DataBrowserItemDataRef, Boolean); static OSStatus DBClientDataCallback (HIViewRef, DataBrowserItemID, DataBrowserPropertyID, DataBrowserItemDataRef, Boolean);
static pascal OSStatus CheatEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus CheatEventHandler (EventHandlerCallRef, EventRef, void *);
static void InitCheatItems (void) static void InitCheatItems (void)
@ -341,7 +341,7 @@ static void EnableAllCheatItems (void)
err = UpdateDataBrowserItems(dbRef, kDataBrowserNoItem, kDataBrowserNoItem, NULL, kDataBrowserItemNoProperty, kCmCheckBox); err = UpdateDataBrowserItems(dbRef, kDataBrowserNoItem, kDataBrowserNoItem, NULL, kDataBrowserItemNoProperty, kCmCheckBox);
} }
static pascal OSStatus DBClientDataCallback (HIViewRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean changeValue) static OSStatus DBClientDataCallback (HIViewRef browser, DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemDataRef itemData, Boolean changeValue)
{ {
OSStatus err, result; OSStatus err, result;
CFStringRef str; CFStringRef str;
@ -486,7 +486,7 @@ static pascal OSStatus DBClientDataCallback (HIViewRef browser, DataBrowserItemI
return (result); return (result);
} }
static pascal Boolean DBCompareCallBack (HIViewRef browser, DataBrowserItemID itemOne, DataBrowserItemID itemTwo, DataBrowserPropertyID sortProperty) static Boolean DBCompareCallBack (HIViewRef browser, DataBrowserItemID itemOne, DataBrowserItemID itemTwo, DataBrowserPropertyID sortProperty)
{ {
Boolean result = false; Boolean result = false;
@ -511,7 +511,7 @@ static pascal Boolean DBCompareCallBack (HIViewRef browser, DataBrowserItemID it
return (result); return (result);
} }
static pascal void DBItemNotificationCallBack (HIViewRef browser, DataBrowserItemID itemID, DataBrowserItemNotification message) static void DBItemNotificationCallBack (HIViewRef browser, DataBrowserItemID itemID, DataBrowserItemNotification message)
{ {
OSStatus err; OSStatus err;
HIViewRef ctl; HIViewRef ctl;
@ -531,7 +531,7 @@ static pascal void DBItemNotificationCallBack (HIViewRef browser, DataBrowserIte
} }
} }
static pascal OSStatus CheatEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) static OSStatus CheatEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowRef tWindowRef; WindowRef tWindowRef;

View File

@ -156,10 +156,10 @@ static SInt64 CheatFinderReadBytes (UInt8 *, UInt32);
static SInt64 CheatFinderGetValueEditText (ControlRef); static SInt64 CheatFinderGetValueEditText (ControlRef);
static Boolean CheatFinderCompare (SInt64, SInt64); static Boolean CheatFinderCompare (SInt64, SInt64);
static HIViewPartCode CheatFinderListViewFindPart (EventRef, ListViewData *, SInt32 *); static HIViewPartCode CheatFinderListViewFindPart (EventRef, ListViewData *, SInt32 *);
static pascal OSStatus CheatFinderListViewHandler (EventHandlerCallRef, EventRef, void *); static OSStatus CheatFinderListViewHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus CheatFinderSheetEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus CheatFinderSheetEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus CheatFinderWindowEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus CheatFinderWindowEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus CheatFinderListFrameEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus CheatFinderListFrameEventHandler (EventHandlerCallRef, EventRef, void *);
void InitCheatFinder (void) void InitCheatFinder (void)
@ -505,7 +505,7 @@ static SInt64 CheatFinderReadBytes (UInt8 *mem, UInt32 addr)
return (0); return (0);
} }
static pascal OSStatus CheatFinderWindowEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) static OSStatus CheatFinderWindowEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowData *cf; WindowData *cf;
@ -1176,7 +1176,7 @@ static void CheatFinderEndAddEntrySheet (WindowData *cf)
} }
} }
static pascal OSStatus CheatFinderSheetEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) static OSStatus CheatFinderSheetEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowData *cf = (WindowData *) inUserData; WindowData *cf = (WindowData *) inUserData;
@ -1285,7 +1285,7 @@ static void CheatFinderAddEntry (SInt64 value, char *description)
} }
} }
static pascal OSStatus CheatFinderListFrameEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *userData) static OSStatus CheatFinderListFrameEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *userData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
HIViewRef view = (HIViewRef) userData; HIViewRef view = (HIViewRef) userData;
@ -1736,7 +1736,7 @@ static void CheatFinderListViewScrollToThere (float where, ListViewData *myData)
} }
} }
static pascal OSStatus CheatFinderListViewHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) static OSStatus CheatFinderListViewHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
ListViewData *myData = (ListViewData *) inUserData; ListViewData *myData = (ListViewData *) inUserData;

View File

@ -136,9 +136,9 @@ static bool8 NPClientReplyPhaseSpanTest (void);
static void * NPClientConnectThread (void *); static void * NPClientConnectThread (void *);
static void * NPClientPrepareThread (void *); static void * NPClientPrepareThread (void *);
static void * NPClientNetPlayThread (void *); static void * NPClientNetPlayThread (void *);
static pascal void NPClientDialogTimerHandler (EventLoopTimerRef, void *); static void NPClientDialogTimerHandler (EventLoopTimerRef, void *);
static pascal OSStatus NPClientDialogEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus NPClientDialogEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus NPClientSheetEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus NPClientSheetEventHandler (EventHandlerCallRef, EventRef, void *);
bool8 NPClientDialog (void) bool8 NPClientDialog (void)
@ -230,7 +230,7 @@ bool8 NPClientDialog (void)
return (!npclient.dialogcancel); return (!npclient.dialogcancel);
} }
static pascal OSStatus NPClientDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus NPClientDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
@ -335,7 +335,7 @@ static pascal OSStatus NPClientDialogEventHandler (EventHandlerCallRef inHandler
return (result); return (result);
} }
static pascal void NPClientDialogTimerHandler (EventLoopTimerRef inTimer, void *userData) static void NPClientDialogTimerHandler (EventLoopTimerRef inTimer, void *userData)
{ {
WindowRef window = (WindowRef) userData; WindowRef window = (WindowRef) userData;
HIViewRef ctl; HIViewRef ctl;
@ -1017,7 +1017,7 @@ static void NPClientEndPlayerListSheet (void)
err = HideSheetWindow(sRef); err = HideSheetWindow(sRef);
} }
static pascal OSStatus NPClientSheetEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus NPClientSheetEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
if (!npclient.dialogsheet) if (!npclient.dialogsheet)
return (eventNotHandledErr); return (eventNotHandledErr);

View File

@ -93,7 +93,7 @@ static void ReplaceFilterUI (WindowRef);
static void FilterUIAddSubviews (WindowRef, HIViewRef); static void FilterUIAddSubviews (WindowRef, HIViewRef);
static void FilterUISetValues (HIViewRef); static void FilterUISetValues (HIViewRef);
static bool8 IsCoreImageFilterSupported (CIFilter *); static bool8 IsCoreImageFilterSupported (CIFilter *);
static pascal OSStatus CoreImageFilterEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus CoreImageFilterEventHandler (EventHandlerCallRef, EventRef, void *);
void InitCoreImage (void) void InitCoreImage (void)
@ -667,7 +667,7 @@ static void FilterUISetValues (HIViewRef parent)
} }
} }
static pascal OSStatus CoreImageFilterEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus CoreImageFilterEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowRef window = (WindowRef) inUserData; WindowRef window = (WindowRef) inUserData;

View File

@ -44,10 +44,10 @@ static void AutofireWriteAllSettings (int, HIViewRef);
static void AutofireWriteSetting (int, uint16 *, HIViewRef); static void AutofireWriteSetting (int, uint16 *, HIViewRef);
static void AutofireSelectTabPane (HIViewRef, SInt16); static void AutofireSelectTabPane (HIViewRef, SInt16);
static OSStatus UpdateTextControlView (HIViewRef); static OSStatus UpdateTextControlView (HIViewRef);
static pascal void AutofireSliderActionProc (HIViewRef, HIViewPartCode); static void AutofireSliderActionProc (HIViewRef, HIViewPartCode);
static pascal OSStatus RomInfoEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus RomInfoEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus AutofireTabEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus AutofireTabEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus AutofireWindowEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus AutofireWindowEventHandler (EventHandlerCallRef, EventRef, void *);
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
extern "C" FMFont FMGetFontFromATSFontRef (ATSFontRef iFont); extern "C" FMFont FMGetFontFromATSFontRef (ATSFontRef iFont);
@ -333,7 +333,7 @@ void AboutDialog (void)
} }
} }
pascal OSStatus DefaultEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) OSStatus DefaultEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowRef tWindowRef = (WindowRef) inUserData; WindowRef tWindowRef = (WindowRef) inUserData;
@ -787,7 +787,7 @@ static void AutofireSelectTabPane (HIViewRef tabControl, SInt16 index)
HIViewSetNeedsDisplay(tabControl, true); HIViewSetNeedsDisplay(tabControl, true);
} }
static pascal OSStatus AutofireTabEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus AutofireTabEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
HIViewRef ctl; HIViewRef ctl;
@ -810,7 +810,7 @@ static pascal OSStatus AutofireTabEventHandler (EventHandlerCallRef inHandlerRef
return (result); return (result);
} }
static pascal OSStatus AutofireWindowEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus AutofireWindowEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowRef tWindowRef = (WindowRef) inUserData; WindowRef tWindowRef = (WindowRef) inUserData;
@ -880,7 +880,7 @@ static pascal OSStatus AutofireWindowEventHandler (EventHandlerCallRef inHandler
return (result); return (result);
} }
static pascal void AutofireSliderActionProc (HIViewRef slider, HIViewPartCode partCode) static void AutofireSliderActionProc (HIViewRef slider, HIViewPartCode partCode)
{ {
HIViewRef ctl; HIViewRef ctl;
HIViewID cid; HIViewID cid;
@ -1081,7 +1081,7 @@ static void RomInfoBuildInfoText (char *romtext)
sprintf(romtext, "%s%s", s1, s2); sprintf(romtext, "%s%s", s1, s2);
} }
static pascal OSStatus RomInfoEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus RomInfoEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowRef tWindowRef = (WindowRef) inUserData; WindowRef tWindowRef = (WindowRef) inUserData;

View File

@ -55,6 +55,6 @@ OSStatus SetEditTextCStr (HIViewRef, char *, Boolean);
OSStatus CopyEditTextCFString (HIViewRef, CFStringRef *); OSStatus CopyEditTextCFString (HIViewRef, CFStringRef *);
OSStatus SetEditTextCFString (HIViewRef, CFStringRef, Boolean); OSStatus SetEditTextCFString (HIViewRef, CFStringRef, Boolean);
OSStatus SetEditTextSelection (HIViewRef, SInt16, SInt16); OSStatus SetEditTextSelection (HIViewRef, SInt16, SInt16);
pascal OSStatus DefaultEventHandler (EventHandlerCallRef, EventRef, void *); OSStatus DefaultEventHandler (EventHandlerCallRef, EventRef, void *);
#endif #endif

View File

@ -477,8 +477,8 @@ static int gIconNumber[kNeedCount] =
}; };
static void JoypadSetDirectionInfo (void); static void JoypadSetDirectionInfo (void);
static pascal void IdleTimer (EventLoopTimerRef, void *); static void IdleTimer (EventLoopTimerRef, void *);
static pascal OSStatus ControllerEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus ControllerEventHandler (EventHandlerCallRef, EventRef, void *);
void SaveControllerSettings (void) void SaveControllerSettings (void)
@ -591,7 +591,7 @@ void LoadControllerSettings (void)
JoypadSetDirectionInfo(); JoypadSetDirectionInfo();
} }
static pascal OSStatus ControllerEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) static OSStatus ControllerEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowRef tWindowRef; WindowRef tWindowRef;
@ -779,7 +779,7 @@ static pascal OSStatus ControllerEventHandler (EventHandlerCallRef inHandlerCall
return (result); return (result);
} }
static pascal void IdleTimer (EventLoopTimerRef inTimer, void *userData) static void IdleTimer (EventLoopTimerRef inTimer, void *userData)
{ {
static uint32 old[MAC_MAX_PLAYERS] = { ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0 }; static uint32 old[MAC_MAX_PLAYERS] = { ~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0 };

View File

@ -299,9 +299,9 @@ static void DrawPlacedIcon (CGContextRef, int);
static void DrawDraggedIcon (CGContextRef, int, CGPoint *); static void DrawDraggedIcon (CGContextRef, int, CGPoint *);
static Boolean KeyCodeInUse (int); static Boolean KeyCodeInUse (int);
static int FindHitKey (HIPoint, CGRect *, CGPoint *); static int FindHitKey (HIPoint, CGRect *, CGPoint *);
static pascal OSStatus KeyWindowEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus KeyWindowEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus KeyLegendEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus KeyLegendEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus KeyLayoutEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus KeyLayoutEventHandler (EventHandlerCallRef, EventRef, void *);
#define kCustomLayoutViewClassID CFSTR("com.snes9x.macos.snes9x.keylayout") #define kCustomLayoutViewClassID CFSTR("com.snes9x.macos.snes9x.keylayout")
@ -780,7 +780,7 @@ static int FindHitKey (HIPoint where, CGRect *keybounds, CGPoint *offset)
return (hit); return (hit);
} }
static pascal OSStatus KeyWindowEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus KeyWindowEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowRef tWindowRef = (WindowRef) inUserData; WindowRef tWindowRef = (WindowRef) inUserData;
@ -830,7 +830,7 @@ static pascal OSStatus KeyWindowEventHandler (EventHandlerCallRef inHandlerRef,
return (result); return (result);
} }
static pascal OSStatus KeyLegendEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus KeyLegendEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
HIViewRef view = (HIViewRef) inUserData; HIViewRef view = (HIViewRef) inUserData;
@ -863,7 +863,7 @@ static pascal OSStatus KeyLegendEventHandler (EventHandlerCallRef inHandlerRef,
return (result); return (result);
} }
static pascal OSStatus KeyLayoutEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus KeyLayoutEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
CustomViewData *data = (CustomViewData *) inUserData; CustomViewData *data = (CustomViewData *) inUserData;

View File

@ -30,8 +30,8 @@
#define truncEnd 0 #define truncEnd 0
#endif #endif
static pascal OSStatus MultiCartEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus MultiCartEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus MultiCartPaneEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus MultiCartPaneEventHandler (EventHandlerCallRef, EventRef, void *);
static int multiCartDragHilite; static int multiCartDragHilite;
static Boolean multiCartDialogResult; static Boolean multiCartDialogResult;
@ -172,7 +172,7 @@ Boolean MultiCartDialog (void)
return (multiCartDialogResult); return (multiCartDialogResult);
} }
static pascal OSStatus MultiCartEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus MultiCartEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowRef window = (WindowRef) inUserData; WindowRef window = (WindowRef) inUserData;
@ -324,7 +324,7 @@ static pascal OSStatus MultiCartEventHandler (EventHandlerCallRef inHandlerRef,
return (result); return (result);
} }
static pascal OSStatus MultiCartPaneEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus MultiCartPaneEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
HIViewRef view; HIViewRef view;

View File

@ -15,6 +15,7 @@
(c) Copyright 2004 Alexander and Sander (c) Copyright 2004 Alexander and Sander
(c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2004 - 2005 Steven Seeger
(c) Copyright 2005 Ryan Vogt (c) Copyright 2005 Ryan Vogt
(c) Copyright 2019 Michael Donald Buckley
***********************************************************************************/ ***********************************************************************************/
@ -34,7 +35,6 @@
#endif #endif
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <QuickTime/QuickTime.h>
#import <pthread.h> #import <pthread.h>
#import "mac-prefix.h" #import "mac-prefix.h"
@ -352,10 +352,10 @@ static void UpdateFreezeDefrostScreen (int, CGImageRef, uint8 *, CGContextRef);
static void * MacSnes9xThread (void *); static void * MacSnes9xThread (void *);
static OSStatus HandleMenuChoice (UInt32, Boolean *); static OSStatus HandleMenuChoice (UInt32, Boolean *);
static inline void EmulationLoop (void); static inline void EmulationLoop (void);
static pascal OSStatus MainEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus MainEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus SubEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus SubEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus GameWindowEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus GameWindowEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus GameWindowUserPaneEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus GameWindowUserPaneEventHandler (EventHandlerCallRef, EventRef, void *);
int main (int argc, char **argv) int main (int argc, char **argv)
@ -600,7 +600,7 @@ static inline void EmulationLoop (void)
S9xMovieShutdown(); S9xMovieShutdown();
} }
static pascal OSStatus MainEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) static OSStatus MainEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
Boolean done = false; Boolean done = false;
@ -653,7 +653,7 @@ static pascal OSStatus MainEventHandler (EventHandlerCallRef inHandlerCallRef, E
return (result); return (result);
} }
static pascal OSStatus SubEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) static OSStatus SubEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
@ -939,7 +939,7 @@ void DeinitGameWindow (void)
gWindow = NULL; gWindow = NULL;
} }
static pascal OSStatus GameWindowEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) static OSStatus GameWindowEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
HIRect rct; HIRect rct;
@ -1052,7 +1052,7 @@ static pascal OSStatus GameWindowEventHandler (EventHandlerCallRef inHandlerCall
return (result); return (result);
} }
static pascal OSStatus GameWindowUserPaneEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) static OSStatus GameWindowUserPaneEventHandler (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
@ -2091,7 +2091,7 @@ int PromptFreezeDefrost (Boolean freezing)
newestDate = currentDate; newestDate = currentDate;
} }
DrawThumbnailResource(&ref, ctx, rct); DrawThumbnailFromExtendedAttribute(filename, ctx, rct);
CGContextSetShouldAntialias(ctx, false); CGContextSetShouldAntialias(ctx, false);
CGContextSetLineWidth(ctx, 1.0f); CGContextSetLineWidth(ctx, 1.0f);

View File

@ -206,12 +206,12 @@ static PrefList prefList[] =
#define kPrefListSize (sizeof(prefList) / sizeof(prefList[0])) #define kPrefListSize (sizeof(prefList) / sizeof(prefList[0]))
static void SelectTabPane (HIViewRef, SInt16); static void SelectTabPane (HIViewRef, SInt16);
static pascal void InputRateSliderActionProc (HIViewRef, HIViewPartCode); static void InputRateSliderActionProc (HIViewRef, HIViewPartCode);
static pascal void LittleArrowsActionProc (HIViewRef, HIViewPartCode); static void LittleArrowsActionProc (HIViewRef, HIViewPartCode);
static pascal OSStatus InputRateTextEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus InputRateTextEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus AspectRatioTextEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus AspectRatioTextEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus TabEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus TabEventHandler (EventHandlerCallRef, EventRef, void *);
static pascal OSStatus PreferencesEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus PreferencesEventHandler (EventHandlerCallRef, EventRef, void *);
void SavePrefs (void) void SavePrefs (void)
@ -1170,7 +1170,7 @@ static void SelectTabPane (HIViewRef tabControl, SInt16 index)
HIViewSetNeedsDisplay(tabControl, true); HIViewSetNeedsDisplay(tabControl, true);
} }
static pascal void InputRateSliderActionProc (HIViewRef slider, HIViewPartCode partCode) static void InputRateSliderActionProc (HIViewRef slider, HIViewPartCode partCode)
{ {
HIViewRef ctl; HIViewRef ctl;
HIViewID cid; HIViewID cid;
@ -1184,7 +1184,7 @@ static pascal void InputRateSliderActionProc (HIViewRef slider, HIViewPartCode p
SetStaticTextCStr(ctl, num, true); SetStaticTextCStr(ctl, num, true);
} }
static pascal void LittleArrowsActionProc (HIViewRef arrows, HIViewPartCode partCode) static void LittleArrowsActionProc (HIViewRef arrows, HIViewPartCode partCode)
{ {
HIViewRef ctl; HIViewRef ctl;
HIViewID cid = { 'msc2', iNibMTurboSkipText }; HIViewID cid = { 'msc2', iNibMTurboSkipText };
@ -1201,7 +1201,7 @@ static pascal void LittleArrowsActionProc (HIViewRef arrows, HIViewPartCode part
SetStaticTextCStr(ctl, num, true); SetStaticTextCStr(ctl, num, true);
} }
static pascal OSStatus InputRateTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus InputRateTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
HIViewRef ctl, slider; HIViewRef ctl, slider;
@ -1234,7 +1234,7 @@ static pascal OSStatus InputRateTextEventHandler (EventHandlerCallRef inHandlerR
return (result); return (result);
} }
static pascal OSStatus AspectRatioTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus AspectRatioTextEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
HIViewRef ctl, slider; HIViewRef ctl, slider;
@ -1264,7 +1264,7 @@ static pascal OSStatus AspectRatioTextEventHandler (EventHandlerCallRef inHandle
return (result); return (result);
} }
static pascal OSStatus TabEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus TabEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
HIViewRef ctl; HIViewRef ctl;
@ -1287,7 +1287,7 @@ static pascal OSStatus TabEventHandler (EventHandlerCallRef inHandlerRef, EventR
return (result); return (result);
} }
static pascal OSStatus PreferencesEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus PreferencesEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowRef tWindowRef = (WindowRef) inUserData; WindowRef tWindowRef = (WindowRef) inUserData;

View File

@ -15,15 +15,15 @@
(c) Copyright 2004 Alexander and Sander (c) Copyright 2004 Alexander and Sander
(c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2004 - 2005 Steven Seeger
(c) Copyright 2005 Ryan Vogt (c) Copyright 2005 Ryan Vogt
(c) Copyright 2019 Michael Donald Buckley
***********************************************************************************/ ***********************************************************************************/
#include <sys/xattr.h>
#include "snes9x.h" #include "snes9x.h"
#include "memmap.h" #include "memmap.h"
#include "screenshot.h" #include "screenshot.h"
#include <QuickTime/QuickTime.h>
#include "mac-prefix.h" #include "mac-prefix.h"
#include "mac-file.h" #include "mac-file.h"
#include "mac-gworld.h" #include "mac-gworld.h"
@ -31,92 +31,50 @@
#include "mac-render.h" #include "mac-render.h"
#include "mac-screenshot.h" #include "mac-screenshot.h"
static Handle GetScreenAsRawHandle (int, int); const char *extendedAttributeName = "com.snes9x.preview";
static void ExportCGImageToPNGFile (CGImageRef, const char *);
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 unsigned char *CGImageToPNGData (CGImageRef image, CFIndex *outLength);
typedef struct QDPict* QDPictRef;
extern "C" QDPictRef QDPictCreateWithProvider (CGDataProviderRef provider);
extern "C" void QDPictRelease (QDPictRef pictRef);
extern "C" OSStatus QDPictDrawToCGContext (CGContextRef ctx, CGRect rect, QDPictRef pictRef);
#endif
static Handle GetScreenAsRawHandle (int destWidth, int destHeight) unsigned char *CGImageToPNGData (CGImageRef image, CFIndex *outLength)
{ {
CGContextRef ctx; if (!outLength)
CGColorSpaceRef color;
CGImageRef image;
Handle data = NULL;
image = CreateGameScreenCGImage();
if (image)
{ {
data = NewHandleClear(destWidth * destHeight * 2); return NULL;
}
CFMutableDataRef dataRef = CFDataCreateMutable(kCFAllocatorDefault, 0);
if (dataRef)
{
CGImageDestinationRef dest = CGImageDestinationCreateWithData(dataRef, kUTTypePNG, 1, NULL);
if (dest)
{
CGImageDestinationAddImage(dest, image, NULL);
CGImageDestinationFinalize(dest);
CFRelease(dest);
*outLength = CFDataGetLength(dataRef);
unsigned char *data = (unsigned char *)malloc(*outLength);
if (data) if (data)
{ {
HLock(data); CFDataGetBytes(dataRef, CFRangeMake(0, *outLength), data);
return data;
color = CGColorSpaceCreateDeviceRGB(); }
if (color) }
else
{ {
ctx = CGBitmapContextCreate(*data, destWidth, destHeight, 5, destWidth * 2, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Big : 0)); CFRelease(dataRef);
if (ctx) }
{
CGContextDrawImage(ctx, CGRectMake(0.0f, 0.0f, (float) destWidth, (float) destHeight), image);
CGContextRelease(ctx);
} }
CGColorSpaceRelease(color); return NULL;
}
HUnlock(data);
}
CGImageRelease(image);
}
return (data);
}
void WriteThumbnailToResourceFork (FSRef *ref, int destWidth, int destHeight)
{
OSStatus err;
HFSUniStr255 fork;
SInt16 resf;
err = FSGetResourceForkName(&fork);
if (err == noErr)
{
err = FSCreateResourceFork(ref, fork.length, fork.unicode, 0);
if ((err == noErr) || (err == errFSForkExists))
{
err = FSOpenResourceFile(ref, fork.length, fork.unicode, fsWrPerm, &resf);
if (err == noErr)
{
Handle pict;
pict = GetScreenAsRawHandle(destWidth, destHeight);
if (pict)
{
AddResource(pict, 'Thum', 128, "\p");
WriteResource(pict);
ReleaseResource(pict);
}
CloseResFile(resf);
}
}
}
} }
static void ExportCGImageToPNGFile (CGImageRef image, const char *path) static void ExportCGImageToPNGFile (CGImageRef image, const char *path)
{ {
OSStatus err;
GraphicsExportComponent exporter;
CFStringRef str; CFStringRef str;
CFURLRef url; CFURLRef url;
Handle dataRef;
OSType dataRefType;
str = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8); str = CFStringCreateWithCString(kCFAllocatorDefault, path, kCFStringEncodingUTF8);
if (str) if (str)
@ -124,24 +82,18 @@ static void ExportCGImageToPNGFile (CGImageRef image, const char *path)
url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, str, kCFURLPOSIXPathStyle, false); url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, str, kCFURLPOSIXPathStyle, false);
if (url) if (url)
{ {
err = QTNewDataReferenceFromCFURL(url, 0, &dataRef, &dataRefType); CFIndex length = 0;
if (err == noErr) unsigned char *data = CGImageToPNGData(image, &length);
if (data)
{ {
err = OpenADefaultComponent(GraphicsExporterComponentType, kQTFileTypePNG, &exporter); FILE *f = fopen(path, "wb");
if (err == noErr) if (f)
{ {
err = GraphicsExportSetInputCGImage(exporter, image); fwrite(data, length, 1, f);
if (err == noErr) fclose(f);
{
err = GraphicsExportSetOutputDataReference(exporter, dataRef, dataRefType);
if (err == noErr)
err = GraphicsExportDoExport(exporter, NULL);
} }
CloseComponent(exporter); free(data);
}
DisposeHandle(dataRef);
} }
CFRelease(url); CFRelease(url);
@ -198,84 +150,73 @@ CGImageRef CreateBlitScreenCGImage (int width, int height, int rowbytes, uint8 *
return (image); return (image);
} }
void DrawThumbnailResource (FSRef *ref, CGContextRef ctx, CGRect bounds) void WriteThumbnailToExtendedAttribute (const char *path, int destWidth, int destHeight)
{ {
OSStatus err; CGContextRef ctx;
CGDataProviderRef prov; CGColorSpaceRef color = NULL;
CGColorSpaceRef color; char *data[destWidth * destHeight * 2];
CGImageRef image; CGImageRef image = CreateGameScreenCGImage();
QDPictRef qdpr;
Handle pict;
HFSUniStr255 fork;
SInt16 resf;
Size size;
CGContextSaveGState(ctx); if (image)
CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
CGContextFillRect(ctx, bounds);
err = FSGetResourceForkName(&fork);
if (err == noErr)
{
err = FSOpenResourceFile(ref, fork.length, fork.unicode, fsRdPerm, &resf);
if (err == noErr)
{
pict = Get1Resource('PICT', 128);
if (pict)
{
HLock(pict);
size = GetHandleSize(pict);
prov = CGDataProviderCreateWithData(NULL, (void *) *pict, size, NULL);
if (prov)
{
qdpr = QDPictCreateWithProvider(prov);
if (qdpr)
{
QDPictDrawToCGContext(ctx, bounds, qdpr);
QDPictRelease(qdpr);
}
CGDataProviderRelease(prov);
}
HUnlock(pict);
ReleaseResource(pict);
}
else
{
pict = Get1Resource('Thum', 128);
if (pict)
{
HLock(pict);
size = GetHandleSize(pict);
prov = CGDataProviderCreateWithData(NULL, (void *) *pict, size, NULL);
if (prov)
{ {
color = CGColorSpaceCreateDeviceRGB(); color = CGColorSpaceCreateDeviceRGB();
if (color) if (color)
{ {
image = CGImageCreate(128, 120, 5, 16, 256, color, kCGImageAlphaNoneSkipFirst | ((systemVersion >= 0x1040) ? kCGBitmapByteOrder16Big : 0), prov, NULL, 0, kCGRenderingIntentDefault); ctx = CGBitmapContextCreate(data, destWidth, destHeight, 5, destWidth * 2, color, kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder16Big);
if (image)
if (ctx)
{ {
CGContextDrawImage(ctx, bounds, image); CGContextDrawImage(ctx, CGRectMake(0.0f, 0.0f, (float) destWidth, (float) destHeight), image);
CGImageRelease(image); CGContextRelease(ctx);
CFIndex length = 0;
unsigned char *data = CGImageToPNGData(image, &length);
if (data)
{
setxattr(path, extendedAttributeName, data, length, 0, 0);
free(data);
}
} }
CGColorSpaceRelease(color); CGColorSpaceRelease(color);
} }
CGDataProviderRelease(prov); CGImageRelease(image);
}
HUnlock(pict);
ReleaseResource(pict);
} }
} }
CloseResFile(resf); void DrawThumbnailFomExtendedAttribute (const char *path, CGContextRef ctx, CGRect bounds)
{
CGContextSaveGState(ctx);
CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f);
CGContextFillRect(ctx, bounds);
ssize_t size = getxattr(path, extendedAttributeName, NULL, 0, 0, 0);
if ( size > 0 )
{
unsigned char *buffer = (unsigned char *)malloc(size);
if (buffer != NULL)
{
CFDataRef data = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, buffer, size, NULL);
if (data)
{
CGImageSourceRef source = CGImageSourceCreateWithData(data, NULL);
if (source)
{
CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL);
if (image)
{
CGContextDrawImage(ctx, bounds, image);
CGImageRelease(image);
}
}
CFRelease(data);
}
free(buffer);
} }
} }

View File

@ -15,15 +15,15 @@
(c) Copyright 2004 Alexander and Sander (c) Copyright 2004 Alexander and Sander
(c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2004 - 2005 Steven Seeger
(c) Copyright 2005 Ryan Vogt (c) Copyright 2005 Ryan Vogt
(c) Copyright 2019 Michael Donald Buckley
***********************************************************************************/ ***********************************************************************************/
#ifndef _mac_scheenshot_h_ #ifndef _mac_scheenshot_h_
#define _mac_scheenshot_h_ #define _mac_scheenshot_h_
void WriteThumbnailToResourceFork (FSRef *, int, int); void WriteThumbnailToExtendedAttribute (const char *path, int destWidth, int destHeight);
void DrawThumbnailResource (FSRef *, CGContextRef, CGRect); void DrawThumbnailFromExtendedAttribute(const char *path, CGContextRef, CGRect);
PicHandle GetScreenAsPicHandle (int, int, int, int);
CGImageRef CreateGameScreenCGImage (void); CGImageRef CreateGameScreenCGImage (void);
CGImageRef CreateBlitScreenCGImage (int, int, int, uint8 *); CGImageRef CreateBlitScreenCGImage (int, int, int, uint8 *);

View File

@ -129,8 +129,8 @@ static bool8 NPServerSendPlayerListToClient (int);
static void * NPServerListenLoop (void *); static void * NPServerListenLoop (void *);
static void * NPServerProcessThread (void *); static void * NPServerProcessThread (void *);
static void * NPServerNetPlayThread (void *); static void * NPServerNetPlayThread (void *);
static pascal void NPServerDialogTimerHandler (EventLoopTimerRef, void *); static void NPServerDialogTimerHandler (EventLoopTimerRef, void *);
static pascal OSStatus NPServerDialogEventHandler (EventHandlerCallRef, EventRef, void *); static OSStatus NPServerDialogEventHandler (EventHandlerCallRef, EventRef, void *);
bool8 NPServerDialog (void) bool8 NPServerDialog (void)
@ -189,7 +189,7 @@ bool8 NPServerDialog (void)
return (!npserver.dialogcancel); return (!npserver.dialogcancel);
} }
static pascal void NPServerDialogTimerHandler (EventLoopTimerRef inTimer, void *userData) static void NPServerDialogTimerHandler (EventLoopTimerRef inTimer, void *userData)
{ {
WindowRef window = (WindowRef) userData; WindowRef window = (WindowRef) userData;
CFStringRef ref; CFStringRef ref;
@ -308,7 +308,7 @@ static pascal void NPServerDialogTimerHandler (EventLoopTimerRef inTimer, void *
} }
} }
static pascal OSStatus NPServerDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData) static OSStatus NPServerDialogEventHandler (EventHandlerCallRef inHandlerRef, EventRef inEvent, void *inUserData)
{ {
OSStatus err, result = eventNotHandledErr; OSStatus err, result = eventNotHandledErr;
WindowRef tWindowRef = (WindowRef) inUserData; WindowRef tWindowRef = (WindowRef) inUserData;

View File

@ -15,6 +15,7 @@
(c) Copyright 2004 Alexander and Sander (c) Copyright 2004 Alexander and Sander
(c) Copyright 2004 - 2005 Steven Seeger (c) Copyright 2004 - 2005 Steven Seeger
(c) Copyright 2005 Ryan Vogt (c) Copyright 2005 Ryan Vogt
(c) Copyright 2019 Michael Donald Buckley
***********************************************************************************/ ***********************************************************************************/
@ -238,8 +239,6 @@ void SNES9X_SoftReset (void)
bool8 SNES9X_Freeze (void) bool8 SNES9X_Freeze (void)
{ {
OSStatus err;
FSRef ref;
int which; int which;
const char *filename; const char *filename;
@ -253,14 +252,11 @@ bool8 SNES9X_Freeze (void)
{ {
filename = S9xGetFreezeFilename(which); filename = S9xGetFreezeFilename(which);
err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); unlink(filename);
if (!err)
FSDeleteObject(&ref);
S9xFreezeGame(filename); S9xFreezeGame(filename);
ChangeTypeAndCreator(filename, 'SAVE', '~9X~'); ChangeTypeAndCreator(filename, 'SAVE', '~9X~');
err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); WriteThumbnailToExtendedAttribute(filename, 128, 120);
WriteThumbnailToResourceFork(&ref, 128, 120);
SNES9X_Go(); SNES9X_Go();
@ -310,22 +306,17 @@ bool8 SNES9X_Defrost (void)
bool8 SNES9X_FreezeTo (void) bool8 SNES9X_FreezeTo (void)
{ {
OSStatus err;
FSRef ref;
char filename[PATH_MAX + 1]; char filename[PATH_MAX + 1];
if (cartOpen) if (cartOpen)
{ {
if (NavFreezeTo(filename)) if (NavFreezeTo(filename))
{ {
err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); unlink(filename);
if (!err)
FSDeleteObject(&ref);
S9xFreezeGame(filename); S9xFreezeGame(filename);
ChangeTypeAndCreator(filename, 'SAVE', '~9X~'); ChangeTypeAndCreator(filename, 'SAVE', '~9X~');;
err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); WriteThumbnailToExtendedAttribute(filename, 128, 120);
WriteThumbnailToResourceFork(&ref, 128, 120);
return (true); return (true);
} }
@ -355,17 +346,13 @@ bool8 SNES9X_DefrostFrom (void)
bool8 SNES9X_RecordMovie (void) bool8 SNES9X_RecordMovie (void)
{ {
OSStatus err;
FSRef ref;
char filename[PATH_MAX + 1]; char filename[PATH_MAX + 1];
if (cartOpen) if (cartOpen)
{ {
if (NavRecordMovieTo(filename)) if (NavRecordMovieTo(filename))
{ {
err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); unlink(filename);
if (!err)
FSDeleteObject(&ref);
int r; int r;
uint8 opt = 0, mask = 0; uint8 opt = 0, mask = 0;
@ -386,8 +373,7 @@ bool8 SNES9X_RecordMovie (void)
if ((macRecordFlag & (1 << 5)) == 0) if ((macRecordFlag & (1 << 5)) == 0)
{ {
err = FSPathMakeRef((unsigned char *) filename, &ref, NULL); WriteThumbnailToExtendedAttribute(filename, 128, 120);
WriteThumbnailToResourceFork(&ref, 128, 120);
} }
SNES9X_Go(); SNES9X_Go();