streamlining OSX event support second step, moving pending and idle event handling to runloop-observer, see #11805, see #11797

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63689 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2010-03-15 19:31:57 +00:00
parent 0056673c67
commit 293a13bad7
2 changed files with 58 additions and 31 deletions

View File

@@ -13,7 +13,8 @@
#ifndef _WX_OSX_EVTLOOP_H_
#define _WX_OSX_EVTLOOP_H_
typedef struct __CFRunLoop * CFRunLoopRef;
DECLARE_WXOSX_OPAQUE_CFREF( CFRunLoop );
DECLARE_WXOSX_OPAQUE_CFREF( CFRunLoopObserver );
class WXDLLIMPEXP_BASE wxCFEventLoop : public wxEventLoopBase
{
@@ -28,7 +29,7 @@ public:
// sets the "should exit" flag and wakes up the loop so that it terminates
// soon
virtual void Exit(int rc = 0);
// return true if any events are available
virtual bool Pending() const;
@@ -51,19 +52,22 @@ public:
AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags);
#endif // wxUSE_EVENTLOOP_SOURCE
void ObserverCallBack(CFRunLoopObserverRef observer, int activity);
protected:
// get the currently executing CFRunLoop
virtual CFRunLoopRef CFGetCurrentRunLoop() const;
virtual int DoDispatchTimeout(unsigned long timeout);
double m_sleepTime;
// should we exit the loop?
bool m_shouldExit;
// the loop exit code
int m_exitcode;
// runloop observer
CFRunLoopObserverRef m_runLoopObserver;
private:
// process all already pending events and dispatch a new one (blocking
@@ -71,6 +75,7 @@ private:
//
// returns the return value of DoDispatchTimeout()
int DoProcessEvents();
};
#if wxUSE_GUI