#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; }
#else // !GUI
// we can't define wxEventLoop differently in GUI and base libraries so use
// a #define to still allow writing wxEventLoop in the user code
- #if defined(__WXMSW__) || defined(__UNIX__)
+ #if wxUSE_CONSOLE_EVENTLOOP && (defined(__WXMSW__) || defined(__UNIX__))
#define wxEventLoop wxConsoleEventLoop
#else // we still must define it somehow for the code below...
#define wxEventLoop wxEventLoopBase
// 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)
wxEventLoopBase *m_evtLoopOld;
};
+#if wxUSE_CONSOLE_EVENTLOOP
+
+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 // wxUSE_CONSOLE_EVENTLOOP
+
#endif // _WX_EVTLOOP_H_