]> git.saurik.com Git - wxWidgets.git/blob - src/palmos/evtloop.cpp
no real change: just rename "near" into "onNearPart" (MSVC doesn't like 'near' as...
[wxWidgets.git] / src / palmos / evtloop.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/palmos/evtloop.cpp
3 // Purpose: implements wxGUIEventLoop for Palm OS
4 // Author: William Osborne - minimal working wxPalmOS port
5 // Modified by:
6 // Created: 10.14.04
7 // RCS-ID: $Id$
8 // Copyright: (c) William Osborne
9 // License: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
11
12 // ============================================================================
13 // declarations
14 // ============================================================================
15
16 // ----------------------------------------------------------------------------
17 // headers
18 // ----------------------------------------------------------------------------
19
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
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
48 #include <Event.h>
49 #include <SystemMgr.h>
50 #include <Menu.h>
51 #include <Form.h>
52
53 // ============================================================================
54 // wxGUIEventLoop implementation
55 // ============================================================================
56
57 // ----------------------------------------------------------------------------
58 // ctor/dtor
59 // ----------------------------------------------------------------------------
60
61 wxGUIEventLoop::wxGUIEventLoop()
62 {
63 m_shouldExit = false;
64 m_exitcode = 0;
65 }
66
67 // ----------------------------------------------------------------------------
68 // wxGUIEventLoop message processing
69 // ----------------------------------------------------------------------------
70
71 void wxGUIEventLoop::ProcessMessage(WXMSG *msg)
72 {
73 }
74
75 bool wxGUIEventLoop::PreProcessMessage(WXMSG *msg)
76 {
77 return false;
78 }
79
80 // ----------------------------------------------------------------------------
81 // wxGUIEventLoop running and exiting
82 // ----------------------------------------------------------------------------
83
84 bool wxGUIEventLoop::IsRunning() const
85 {
86 return true;
87 }
88
89 int wxGUIEventLoop::Run()
90 {
91 status_t error;
92 EventType event;
93
94 wxEventLoopActivator activate(this);
95
96 do {
97 wxTheApp && wxTheApp->ProcessIdle();
98
99 EvtGetEvent(&event, evtWaitForever);
100
101 if (SysHandleEvent(&event))
102 continue;
103
104 if (MenuHandleEvent(0, &event, &error))
105 continue;
106
107 FrmDispatchEvent(&event);
108
109 } while (event.eType != appStopEvent);
110
111 return 0;
112 }
113
114 void wxGUIEventLoop::Exit(int rc)
115 {
116 FrmCloseAllForms();
117
118 EventType AppStop;
119 AppStop.eType=appStopEvent;
120 EvtAddEventToQueue(&AppStop);
121 }
122
123 // ----------------------------------------------------------------------------
124 // wxGUIEventLoop message processing dispatching
125 // ----------------------------------------------------------------------------
126
127 bool wxGUIEventLoop::Pending() const
128 {
129 return false;
130 }
131
132 bool wxGUIEventLoop::Dispatch()
133 {
134 return false;
135 }
136
137 int wxGUIEventLoop::DispatchTimeout(unsigned long timeout)
138 {
139 return -1;
140 }
141
142 void wxGUIEventLoop::WakeUp()
143 {
144 return;
145 }
146
147 bool wxGUIEventLoop::YieldFor(long eventsToProcess)
148 {
149 return true;
150 }
151