X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d90072c22f3f7aff3991ef3187c67b2cdc5ea70..69373110a5708901801ebf2c7d2d4ee76754e866:/src/mac/carbon/evtloop.cpp diff --git a/src/mac/carbon/evtloop.cpp b/src/mac/carbon/evtloop.cpp index cfe38c8b4c..d5a9804e67 100644 --- a/src/mac/carbon/evtloop.cpp +++ b/src/mac/carbon/evtloop.cpp @@ -25,33 +25,28 @@ #endif #include "wx/evtloop.h" +#include "wx/app.h" -#include - +#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 +55,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;