X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2ddff00c923d454f651aba32c8fe3654fd303e43..c2193ac9115470a4ecbc6844bbe19734a8c636ad:/include/wx/evtloop.h diff --git a/include/wx/evtloop.h b/include/wx/evtloop.h index 254f8fe078..0be2ab6dc7 100644 --- a/include/wx/evtloop.h +++ b/include/wx/evtloop.h @@ -116,14 +116,14 @@ protected: #elif defined(__WXMSW__) #include "wx/msw/evtloop.h" #elif defined(__WXMAC__) - #include "wx/mac/evtloop.h" + #include "wx/osx/evtloop.h" #elif defined(__WXDFB__) #include "wx/dfb/evtloop.h" #else // other platform -class WXDLLEXPORT wxEventLoopImpl; +class WXDLLIMPEXP_FWD_CORE wxEventLoopImpl; -class WXDLLEXPORT wxGUIEventLoop : public wxEventLoopBase +class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxEventLoopBase { public: wxGUIEventLoop() { m_impl = NULL; } @@ -174,7 +174,7 @@ inline bool wxEventLoopBase::IsRunning() const { return GetActive() == this; } // implement modality, we will surely need platform-specific implementations // too, this generic implementation is here only temporarily to see how it // works -class WXDLLEXPORT wxModalEventLoop : public wxGUIEventLoop +class WXDLLIMPEXP_CORE wxModalEventLoop : public wxGUIEventLoop { public: wxModalEventLoop(wxWindow *winModal) @@ -223,4 +223,30 @@ private: wxEventLoopBase *m_evtLoopOld; }; +class wxEventLoopGuarantor +{ +public: + wxEventLoopGuarantor() + { + m_evtLoopNew = NULL; + if (!wxEventLoop::GetActive()) + { + m_evtLoopNew = new wxEventLoop; + wxEventLoop::SetActive(m_evtLoopNew); + } + } + + ~wxEventLoopGuarantor() + { + if (m_evtLoopNew) + { + wxEventLoop::SetActive(NULL); + delete m_evtLoopNew; + } + } + +private: + wxEventLoop *m_evtLoopNew; +}; + #endif // _WX_EVTLOOP_H_