]> git.saurik.com Git - wxWidgets.git/blame - src/palmos/evtloop.cpp
Commited Bryan Petty's blind fix patch.
[wxWidgets.git] / src / palmos / evtloop.cpp
CommitLineData
ffecfa5a 1///////////////////////////////////////////////////////////////////////////////
e2731512 2// Name: src/palmos/evtloop.cpp
ffecfa5a 3// Purpose: implements wxEventLoop 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
JS
8// Copyright: (c) William Osborne
9// License: wxWindows licence
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"
36#include "wx/ptr_scpd.h"
37
38#if wxUSE_THREADS
39 #include "wx/thread.h"
40
41 // define the array of MSG strutures
42 WX_DECLARE_OBJARRAY(MSG, wxMsgArray);
43
44 #include "wx/arrimpl.cpp"
45
46 WX_DEFINE_OBJARRAY(wxMsgArray);
47#endif // wxUSE_THREADS
48
20bc5ad8
WS
49#include <Event.h>
50#include <SystemMgr.h>
51#include <Menu.h>
52#include <Form.h>
53
ffecfa5a
JS
54// ============================================================================
55// wxEventLoop implementation
56// ============================================================================
57
ffecfa5a
JS
58// ----------------------------------------------------------------------------
59// ctor/dtor
60// ----------------------------------------------------------------------------
61
62wxEventLoop::wxEventLoop()
63{
64 m_shouldExit = false;
65 m_exitcode = 0;
66}
67
68// ----------------------------------------------------------------------------
69// wxEventLoop message processing
70// ----------------------------------------------------------------------------
71
72void wxEventLoop::ProcessMessage(WXMSG *msg)
73{
74}
75
76bool wxEventLoop::PreProcessMessage(WXMSG *msg)
77{
e2731512 78 return false;
ffecfa5a
JS
79}
80
81// ----------------------------------------------------------------------------
82// wxEventLoop running and exiting
83// ----------------------------------------------------------------------------
84
85bool wxEventLoop::IsRunning() const
86{
87 return true;
88}
89
90int wxEventLoop::Run()
91{
92 status_t error;
93 EventType event;
94
77fb1a02
VZ
95 wxEventLoopActivator activate(this);
96
ffecfa5a
JS
97 do {
98 wxTheApp && wxTheApp->ProcessIdle();
e2731512 99
ffecfa5a
JS
100 EvtGetEvent(&event, evtWaitForever);
101
102 if (SysHandleEvent(&event))
103 continue;
e2731512 104
ffecfa5a
JS
105 if (MenuHandleEvent(0, &event, &error))
106 continue;
e2731512 107
ffecfa5a
JS
108 FrmDispatchEvent(&event);
109
e2731512
WS
110 } while (event.eType != appStopEvent);
111
ffecfa5a
JS
112 return 0;
113}
114
115void wxEventLoop::Exit(int rc)
116{
117 FrmCloseAllForms();
118
119 EventType AppStop;
120 AppStop.eType=appStopEvent;
121 EvtAddEventToQueue(&AppStop);
122}
123
124// ----------------------------------------------------------------------------
125// wxEventLoop message processing dispatching
126// ----------------------------------------------------------------------------
127
128bool wxEventLoop::Pending() const
129{
e2731512 130 return false;
ffecfa5a
JS
131}
132
133bool wxEventLoop::Dispatch()
134{
135 return false;
136}
137