X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/489468feaa08b8f504735eecca522fb8d0f825d2..94d0d21a15fa73ac426480d195d16ee04caf2de8:/src/osx/carbon/evtloop.cpp diff --git a/src/osx/carbon/evtloop.cpp b/src/osx/carbon/evtloop.cpp index 681564bffa..deee02fdce 100644 --- a/src/osx/carbon/evtloop.cpp +++ b/src/osx/carbon/evtloop.cpp @@ -30,10 +30,10 @@ #include "wx/app.h" #endif // WX_PRECOMP -#ifdef __DARWIN__ +#if wxOSX_USE_CARBON #include #else - #include + #include #endif // ============================================================================ // wxEventLoop implementation @@ -43,6 +43,8 @@ // high level functions for RunApplicationEventLoop() case // ---------------------------------------------------------------------------- + + #if wxMAC_USE_RUN_APP_EVENT_LOOP int wxGUIEventLoop::Run() @@ -84,6 +86,7 @@ void wxGUIEventLoop::WakeUp() bool wxGUIEventLoop::Pending() const { +#if wxOSX_USE_CARBON EventRef theEvent; return ReceiveNextEvent @@ -94,16 +97,23 @@ bool wxGUIEventLoop::Pending() const false, // don't remove the event from queue &theEvent ) == noErr; +#else + return true; // TODO +#endif } bool wxGUIEventLoop::Dispatch() { - // TODO: we probably should do the dispatching directly from here but for - // now it's easier to forward to wxApp which has all the code to do - // it if ( !wxTheApp ) return false; +#if wxOSX_USE_CARBON + // TODO: we probably should do the dispatching directly from here but for + // now it's easier to forward to wxApp which has all the code to do + // it wxTheApp->MacDoOneEvent(); +#else + CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, 0); +#endif return true; }