#endif
#include "wx/evtloop.h"
+#include "wx/app.h"
-#include <Carbon/Carbon.h>
-
+#ifdef __DARWIN__
+ #include <Carbon/Carbon.h>
+#else
+ #include <Carbon.h>
+#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;
}
{
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;