]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/evtloop.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: mac/carbon/evtloop.cpp
3 // Purpose: implementation of wxEventLoop for wxMac
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // for compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
27 #include "wx/evtloop.h"
30 #include <Carbon/Carbon.h>
32 // ============================================================================
33 // wxEventLoop implementation
34 // ============================================================================
36 // ----------------------------------------------------------------------------
37 // high level functions for RunApplicationEventLoop() case
38 // ----------------------------------------------------------------------------
40 #if wxMAC_USE_RUN_APP_EVENT_LOOP
42 int wxEventLoop::Run()
44 wxEventLoopActivator
activate(this);
46 RunApplicationEventLoop();
51 void wxEventLoop::Exit(int rc
)
55 QuitApplicationEventLoop();
60 #else // manual event loop
62 // ----------------------------------------------------------------------------
63 // functions only used by wxEventLoopManual-based implementation
64 // ----------------------------------------------------------------------------
66 void wxEventLoop::WakeUp()
68 extern void wxMacWakeUp();
73 #endif // high/low-level event loop
75 // ----------------------------------------------------------------------------
76 // low level functions used in both cases
77 // ----------------------------------------------------------------------------
79 bool wxEventLoop::Pending() const
83 return ReceiveNextEvent
85 0, // we want any event at all so we don't specify neither
86 NULL
, // the number of event types nor the types themselves
88 false, // don't remove the event from queue
93 bool wxEventLoop::Dispatch()
95 // TODO: we probably should do the dispatching directly from here but for
96 // now it's easier to forward to wxApp which has all the code to do
101 wxTheApp
->MacDoOneEvent();