]> git.saurik.com Git - wxWidgets.git/blob - include/wx/mac/carbon/evtloop.h
implemented wxEventLoop for wxMac
[wxWidgets.git] / include / wx / mac / carbon / evtloop.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mac/carbon/evtloop.h
3 // Purpose: declaration of wxEventLoop for wxMac
4 // Author: Vadim Zeitlin
5 // Modified by:
6 // Created: 2006-01-12
7 // RCS-ID: $Id$
8 // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_MAC_CARBON_EVTLOOP_H_
13 #define _WX_MAC_CARBON_EVTLOOP_H_
14
15 // set wxMAC_USE_RUN_APP_EVENT_LOOP to 1 if the standard
16 // RunApplicationEventLoop function should be used, otherwise
17 // the lower level CarbonEventLoop will be used
18 //
19 // in the long run we should make this 1 by default but we will have to clean
20 // up event handling to make sure we don't miss handling of things like pending
21 // events etc and perhaps we will also have to pipe events through an
22 // ueber-event-handler to make sure we have one place to do all these
23 // house-keeping functions
24 #define wxMAC_USE_RUN_APP_EVENT_LOOP 0
25
26 // ----------------------------------------------------------------------------
27 // wxEventLoop
28 // ----------------------------------------------------------------------------
29
30 class WXDLLEXPORT wxEventLoop : public wxEventLoopBase
31 {
32 public:
33 wxEventLoop();
34
35 // implement base class pure virtuals
36 virtual int Run();
37 virtual void Exit(int rc = 0);
38 virtual bool Pending() const;
39 virtual bool Dispatch();
40
41 private:
42 // the loop exit code
43 int m_exitcode;
44
45 #if !wxMAC_USE_RUN_APP_EVENT_LOOP
46 // should we exit the loop?
47 bool m_shouldExit;
48 #endif // !wxMAC_USE_RUN_APP_EVENT_LOOP
49 };
50
51 #endif // _WX_MAC_CARBON_EVTLOOP_H_
52