X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5dbe15d0bacde245539f54c4d97af6b4696f01f..88b987876d4e8d18580f8dd1705b7471aa91388b:/include/wx/evtloop.h diff --git a/include/wx/evtloop.h b/include/wx/evtloop.h index f6d1b55313..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 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_