]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/evtloop.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/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"
34 #include <Carbon/Carbon.h>
38 // ============================================================================
39 // wxEventLoop implementation
40 // ============================================================================
42 // ----------------------------------------------------------------------------
43 // high level functions for RunApplicationEventLoop() case
44 // ----------------------------------------------------------------------------
46 #if wxMAC_USE_RUN_APP_EVENT_LOOP
48 int wxEventLoop::Run()
50 wxEventLoopActivator
activate(this);
52 RunApplicationEventLoop();
57 void wxEventLoop::Exit(int rc
)
61 QuitApplicationEventLoop();
66 #else // manual event loop
68 // ----------------------------------------------------------------------------
69 // functions only used by wxEventLoopManual-based implementation
70 // ----------------------------------------------------------------------------
72 void wxEventLoop::WakeUp()
74 extern void wxMacWakeUp();
79 #endif // high/low-level event loop
81 // ----------------------------------------------------------------------------
82 // low level functions used in both cases
83 // ----------------------------------------------------------------------------
85 bool wxEventLoop::Pending() const
89 return ReceiveNextEvent
91 0, // we want any event at all so we don't specify neither
92 NULL
, // the number of event types nor the types themselves
94 false, // don't remove the event from queue
99 bool wxEventLoop::Dispatch()
101 // TODO: we probably should do the dispatching directly from here but for
102 // now it's easier to forward to wxApp which has all the code to do
107 wxTheApp
->MacDoOneEvent();