]> git.saurik.com Git - wxWidgets.git/blame - src/palmos/evtloop.cpp
Add some version checks to help compiling on OSX.
[wxWidgets.git] / src / palmos / evtloop.cpp
CommitLineData
ffecfa5a 1///////////////////////////////////////////////////////////////////////////////
e2731512 2// Name: src/palmos/evtloop.cpp
b46b1d59 3// Purpose: implements wxGUIEventLoop for Palm OS
e2731512 4// Author: William Osborne - minimal working wxPalmOS port
ffecfa5a
JS
5// Modified by:
6// Created: 10.14.04
e2731512 7// RCS-ID: $Id$
ffecfa5a 8// Copyright: (c) William Osborne
526954c5 9// Licence: wxWindows licence
ffecfa5a
JS
10///////////////////////////////////////////////////////////////////////////////
11
12// ============================================================================
13// declarations
14// ============================================================================
15
16// ----------------------------------------------------------------------------
17// headers
18// ----------------------------------------------------------------------------
19
ffecfa5a
JS
20// For compilers that support precompilation, includes "wx.h".
21#include "wx/wxprec.h"
22
23#ifdef __BORLANDC__
24 #pragma hdrstop
25#endif
26
27#ifndef WX_PRECOMP
28 #include "wx/window.h"
29 #include "wx/app.h"
30#endif //WX_PRECOMP
31
32#include "wx/evtloop.h"
33
34#include "wx/tooltip.h"
35#include "wx/except.h"
ffecfa5a
JS
36
37#if wxUSE_THREADS
38 #include "wx/thread.h"
39
40 // define the array of MSG strutures
41 WX_DECLARE_OBJARRAY(MSG, wxMsgArray);
42
43 #include "wx/arrimpl.cpp"
44
45 WX_DEFINE_OBJARRAY(wxMsgArray);
46#endif // wxUSE_THREADS
47
20bc5ad8
WS
48#include <Event.h>
49#include <SystemMgr.h>
50#include <Menu.h>
51#include <Form.h>
52
ffecfa5a 53// ============================================================================
b46b1d59 54// wxGUIEventLoop implementation
ffecfa5a
JS
55// ============================================================================
56
ffecfa5a
JS
57// ----------------------------------------------------------------------------
58// ctor/dtor
59// ----------------------------------------------------------------------------
60
b46b1d59 61wxGUIEventLoop::wxGUIEventLoop()
ffecfa5a
JS
62{
63 m_shouldExit = false;
64 m_exitcode = 0;
65}
66
67// ----------------------------------------------------------------------------
b46b1d59 68// wxGUIEventLoop message processing
ffecfa5a
JS
69// ----------------------------------------------------------------------------
70
b46b1d59 71void wxGUIEventLoop::ProcessMessage(WXMSG *msg)
ffecfa5a
JS
72{
73}
74
b46b1d59 75bool wxGUIEventLoop::PreProcessMessage(WXMSG *msg)
ffecfa5a 76{
e2731512 77 return false;
ffecfa5a
JS
78}
79
80// ----------------------------------------------------------------------------
b46b1d59 81// wxGUIEventLoop running and exiting
ffecfa5a
JS
82// ----------------------------------------------------------------------------
83
b46b1d59 84bool wxGUIEventLoop::IsRunning() const
ffecfa5a
JS
85{
86 return true;
87}
88
b46b1d59 89int wxGUIEventLoop::Run()
ffecfa5a
JS
90{
91 status_t error;
92 EventType event;
93
77fb1a02
VZ
94 wxEventLoopActivator activate(this);
95
ffecfa5a
JS
96 do {
97 wxTheApp && wxTheApp->ProcessIdle();
e2731512 98
ffecfa5a
JS
99 EvtGetEvent(&event, evtWaitForever);
100
101 if (SysHandleEvent(&event))
102 continue;
e2731512 103
ffecfa5a
JS
104 if (MenuHandleEvent(0, &event, &error))
105 continue;
e2731512 106
ffecfa5a
JS
107 FrmDispatchEvent(&event);
108
e2731512
WS
109 } while (event.eType != appStopEvent);
110
ffecfa5a
JS
111 return 0;
112}
113
b46b1d59 114void wxGUIEventLoop::Exit(int rc)
ffecfa5a
JS
115{
116 FrmCloseAllForms();
117
118 EventType AppStop;
119 AppStop.eType=appStopEvent;
120 EvtAddEventToQueue(&AppStop);
121}
122
123// ----------------------------------------------------------------------------
b46b1d59 124// wxGUIEventLoop message processing dispatching
ffecfa5a
JS
125// ----------------------------------------------------------------------------
126
b46b1d59 127bool wxGUIEventLoop::Pending() const
ffecfa5a 128{
e2731512 129 return false;
ffecfa5a
JS
130}
131
b46b1d59 132bool wxGUIEventLoop::Dispatch()
ffecfa5a
JS
133{
134 return false;
135}
136
9af42efd
VZ
137int wxGUIEventLoop::DispatchTimeout(unsigned long timeout)
138{
139 return -1;
140}
141
e2fc40b4
VZ
142void wxGUIEventLoop::WakeUp()
143{
144 return;
145}
146
dde19c21
FM
147bool wxGUIEventLoop::YieldFor(long eventsToProcess)
148{
149 return true;
150}
151