]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/evtloop.cpp
cfe38c8b4cb1af15a36b328241cf42f89deed470
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"
29 #include <Carbon/Carbon.h>
31 // ============================================================================
33 // ============================================================================
35 wxEventLoop::wxEventLoop()
38 #if !wxMAC_USE_RUN_APP_EVENT_LOOP
43 int wxEventLoop::Run()
45 wxEventLoopActivator
activate(this);
47 #if wxMAC_USE_RUN_APP_EVENT_LOOP
48 RunApplicationEventLoop();
49 #else // manual event loop
50 while ( !m_shouldExit
)
54 #endif // auto/manual event loop
59 void wxEventLoop::Exit(int rc
)
63 #if wxMAC_USE_RUN_APP_EVENT_LOOP
64 QuitApplicationEventLoop();
65 #else // manual event loop
67 #endif // auto/manual event loop
70 bool wxEventLoop::Pending() const
74 return ReceiveNextEvent
76 0, // we want any event at all so we don't specify neither
77 NULL
, // the number of event types nor the types themselves
79 false, // don't remove the event from queue
84 bool wxEventLoop::Dispatch()
86 // TODO: we probably should do the dispatching directly from here but for
87 // now it's easier to forward to wxApp which has all the code to do
92 wxTheApp
->MacDoOneEvent();