]>
git.saurik.com Git - wxWidgets.git/blob - src/palmos/evtloop.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: palmos/evtloop.cpp
3 // Purpose: implements wxEventLoop for Palm OS
4 // Author: William Osborne
8 // Copyright: (c) William Osborne
9 // License: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "evtloop.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
32 #include "wx/window.h"
36 #include "wx/evtloop.h"
38 #include "wx/tooltip.h"
39 #include "wx/except.h"
40 #include "wx/ptr_scpd.h"
43 #include "wx/thread.h"
45 // define the array of MSG strutures
46 WX_DECLARE_OBJARRAY(MSG
, wxMsgArray
);
48 #include "wx/arrimpl.cpp"
50 WX_DEFINE_OBJARRAY(wxMsgArray
);
51 #endif // wxUSE_THREADS
53 // ----------------------------------------------------------------------------
55 // ----------------------------------------------------------------------------
57 // this object sets the wxEventLoop given to the ctor as the currently active
58 // one and unsets it in its dtor
59 class wxEventLoopActivator
62 wxEventLoopActivator(wxEventLoop
**pActive
,
66 m_evtLoopOld
= *pActive
;
70 ~wxEventLoopActivator()
72 // restore the previously active event loop
73 *m_pActive
= m_evtLoopOld
;
77 wxEventLoop
*m_evtLoopOld
;
78 wxEventLoop
**m_pActive
;
81 // ============================================================================
82 // wxEventLoop implementation
83 // ============================================================================
85 wxEventLoop
*wxEventLoopBase::ms_activeLoop
= NULL
;
87 // ----------------------------------------------------------------------------
89 // ----------------------------------------------------------------------------
91 wxEventLoop::wxEventLoop()
97 // ----------------------------------------------------------------------------
98 // wxEventLoop message processing
99 // ----------------------------------------------------------------------------
101 void wxEventLoop::ProcessMessage(WXMSG
*msg
)
105 bool wxEventLoop::PreProcessMessage(WXMSG
*msg
)
110 // ----------------------------------------------------------------------------
111 // wxEventLoop running and exiting
112 // ----------------------------------------------------------------------------
114 bool wxEventLoop::IsRunning() const
119 int wxEventLoop::Run()
125 wxTheApp
&& wxTheApp
->ProcessIdle();
127 EvtGetEvent(&event
, evtWaitForever
);
129 if (SysHandleEvent(&event
))
132 if (MenuHandleEvent(0, &event
, &error
))
135 FrmDispatchEvent(&event
);
137 } while (event
.eType
!= appStopEvent
);
142 void wxEventLoop::Exit(int rc
)
147 AppStop
.eType
=appStopEvent
;
148 EvtAddEventToQueue(&AppStop
);
151 // ----------------------------------------------------------------------------
152 // wxEventLoop message processing dispatching
153 // ----------------------------------------------------------------------------
155 bool wxEventLoop::Pending() const
160 bool wxEventLoop::Dispatch()