]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/carbon/evtloop.h
wxTheColourDatabase->Find() can fail.
[wxWidgets.git] / include / wx / mac / carbon / evtloop.h
CommitLineData
4d90072c
VZ
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
c8026dea
VZ
30#if wxMAC_USE_RUN_APP_EVENT_LOOP
31
4d90072c
VZ
32class WXDLLEXPORT wxEventLoop : public wxEventLoopBase
33{
34public:
c8026dea 35 wxEventLoop() { m_exitcode = 0; }
4d90072c
VZ
36
37 // implement base class pure virtuals
38 virtual int Run();
39 virtual void Exit(int rc = 0);
40 virtual bool Pending() const;
41 virtual bool Dispatch();
42
43private:
4d90072c 44 int m_exitcode;
c8026dea
VZ
45};
46
47#else // manual event loop
48
49class WXDLLEXPORT wxEventLoop : public wxEventLoopManual
50{
51public:
52 wxEventLoop() { }
4d90072c 53
c8026dea
VZ
54 virtual bool Pending() const;
55 virtual bool Dispatch();
56
57protected:
58 // implement base class pure virtual
59 virtual void WakeUp();
4d90072c
VZ
60};
61
c8026dea
VZ
62#endif // auto/manual event loop
63
4d90072c
VZ
64#endif // _WX_MAC_CARBON_EVTLOOP_H_
65