#if wxUSE_SOCKETS
#ifdef __APPLE__
- #include <OT/OpenTransport.h>
+ #include <CoreServices/CoreServices.h>
#else
#include <OpenTransport.h>
#include <OpenTptInternet.h>
long wxApp::s_macAboutMenuItemId = wxID_ABOUT ;
wxString wxApp::s_macHelpMenuTitleName = "&Help" ;
-pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
+pascal OSErr AEHandleODoc( const AppleEvent *event , AppleEvent *reply , long refcon )
{
wxApp* app = (wxApp*) refcon ;
return wxTheApp->MacHandleAEODoc( (AppleEvent*) event , reply) ;
}
-pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
+pascal OSErr AEHandleOApp( const AppleEvent *event , AppleEvent *reply , long refcon )
{
wxApp* app = (wxApp*) refcon ;
return wxTheApp->MacHandleAEOApp( (AppleEvent*) event , reply ) ;
}
-pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
+pascal OSErr AEHandlePDoc( const AppleEvent *event , AppleEvent *reply , long refcon )
{
wxApp* app = (wxApp*) refcon ;
return wxTheApp->MacHandleAEPDoc( (AppleEvent*) event , reply ) ;
}
-pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , unsigned long refcon )
+pascal OSErr AEHandleQuit( const AppleEvent *event , AppleEvent *reply , long refcon )
{
wxApp* app = (wxApp*) refcon ;
return wxTheApp->MacHandleAEQuit( (AppleEvent*) event , reply) ;
}
// Yield to other processes
+
+static bool gs_inYield = FALSE;
+
bool wxYield()
{
+#ifdef __WXDEBUG__
+ if (gs_inYield)
+ wxFAIL_MSG( wxT("wxYield called recursively" ) );
+#endif
+
+ gs_inYield = TRUE;
+
#if wxUSE_THREADS
- YieldToAnyThread() ;
+ YieldToAnyThread() ;
#endif
- EventRecord event ;
+ EventRecord event ;
long sleepTime = 0 ; //::GetCaretTime();
}
wxMacProcessNotifierAndPendingEvents() ;
- return TRUE;
+
+ gs_inYield = FALSE;
+
+ return TRUE;
+}
+
+// Yield to incoming messages; but fail silently if recursion is detected.
+bool wxYieldIfNeeded()
+{
+ if (gs_inYield)
+ return FALSE;
+
+ return wxYield();
}
// platform specifics
case suspendResumeMessage :
{
bool isResuming = ev->message & resumeFlag ;
+#if !TARGET_CARBON
bool convertClipboard = ev->message & convertClipboardFlag ;
+#else
+ bool convertClipboard = false;
+#endif
bool doesActivate = UMAGetProcessModeDoesActivateOnFGSwitch() ;
if ( isResuming )
{