streamlining OSX event support third step, using platform specific native run methods for event loops

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63697 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2010-03-17 07:14:03 +00:00
parent 0e92a846e4
commit 80eee8378f
10 changed files with 221 additions and 46 deletions

View File

@@ -23,6 +23,9 @@ public:
protected:
virtual int DoDispatchTimeout(unsigned long timeout);
virtual void DoRun();
virtual void DoStop();
};
#endif // _WX_MAC_CARBON_EVTLOOP_H_

View File

@@ -19,6 +19,9 @@ public:
protected:
virtual int DoDispatchTimeout(unsigned long timeout);
virtual void DoRun();
virtual void DoStop();
};
#endif // _WX_OSX_COCOA_EVTLOOP_H_

View File

@@ -59,7 +59,11 @@ protected:
virtual CFRunLoopRef CFGetCurrentRunLoop() const;
virtual int DoDispatchTimeout(unsigned long timeout);
virtual void DoRun();
virtual void DoStop();
// should we exit the loop?
bool m_shouldExit;
@@ -68,22 +72,40 @@ protected:
// runloop observer
CFRunLoopObserverRef m_runLoopObserver;
private:
// process all already pending events and dispatch a new one (blocking
// until it appears in the event queue if necessary)
//
// returns the return value of DoDispatchTimeout()
int DoProcessEvents();
};
#if wxUSE_GUI
#ifdef __WXOSX_COCOA__
#include "wx/osx/cocoa/evtloop.h"
#else
#include "wx/osx/carbon/evtloop.h"
#endif
#ifdef __WXOSX_COCOA__
#include "wx/osx/cocoa/evtloop.h"
#else
#include "wx/osx/carbon/evtloop.h"
#endif
class WXDLLIMPEXP_FWD_CORE wxWindow;
class WXDLLIMPEXP_FWD_CORE wxNonOwnedWindow;
class WXDLLIMPEXP_CORE wxModalEventLoop : public wxGUIEventLoop
{
public:
wxModalEventLoop(wxWindow *winModal);
protected:
virtual void DoRun();
virtual void DoStop();
// (in case) the modal window for this event loop
wxNonOwnedWindow* m_modalWindow;
};
#endif // wxUSE_GUI
#endif // _WX_OSX_EVTLOOP_H_