X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d90072c22f3f7aff3991ef3187c67b2cdc5ea70..80a779275ae04443c568dca919adb26cf6f5002c:/src/mac/carbon/evtloop.cpp diff --git a/src/mac/carbon/evtloop.cpp b/src/mac/carbon/evtloop.cpp index cfe38c8b4c..0d1ba9532e 100644 --- a/src/mac/carbon/evtloop.cpp +++ b/src/mac/carbon/evtloop.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: mac/carbon/evtloop.cpp +// Name: src/mac/carbon/evtloop.cpp // Purpose: implementation of wxEventLoop for wxMac // Author: Vadim Zeitlin // Modified by: @@ -26,32 +26,30 @@ #include "wx/evtloop.h" -#include +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP +#ifdef __DARWIN__ + #include +#else + #include +#endif // ============================================================================ -// implementation +// wxEventLoop implementation // ============================================================================ -wxEventLoop::wxEventLoop() -{ - m_exitcode = 0; -#if !wxMAC_USE_RUN_APP_EVENT_LOOP - m_shouldExit = false; -#endif -} +// ---------------------------------------------------------------------------- +// high level functions for RunApplicationEventLoop() case +// ---------------------------------------------------------------------------- + +#if wxMAC_USE_RUN_APP_EVENT_LOOP int wxEventLoop::Run() { wxEventLoopActivator activate(this); -#if wxMAC_USE_RUN_APP_EVENT_LOOP RunApplicationEventLoop(); -#else // manual event loop - while ( !m_shouldExit ) - { - Dispatch(); - } -#endif // auto/manual event loop return m_exitcode; } @@ -60,13 +58,30 @@ void wxEventLoop::Exit(int rc) { m_exitcode = rc; -#if wxMAC_USE_RUN_APP_EVENT_LOOP QuitApplicationEventLoop(); + + OnExit(); +} + #else // manual event loop - m_shouldExit = true; -#endif // auto/manual event loop + +// ---------------------------------------------------------------------------- +// functions only used by wxEventLoopManual-based implementation +// ---------------------------------------------------------------------------- + +void wxEventLoop::WakeUp() +{ + extern void wxMacWakeUp(); + + wxMacWakeUp(); } +#endif // high/low-level event loop + +// ---------------------------------------------------------------------------- +// low level functions used in both cases +// ---------------------------------------------------------------------------- + bool wxEventLoop::Pending() const { EventRef theEvent; @@ -92,4 +107,3 @@ bool wxEventLoop::Dispatch() wxTheApp->MacDoOneEvent(); return true; } -