X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b46b1d59d6f69ad80dcf5955375578a6504d100a..9cb0c458c4601f444437f7e816efe654158eaf90:/src/unix/evtloopunix.cpp diff --git a/src/unix/evtloopunix.cpp b/src/unix/evtloopunix.cpp index 1aadf8f498..ec07e2559d 100644 --- a/src/unix/evtloopunix.cpp +++ b/src/unix/evtloopunix.cpp @@ -19,7 +19,7 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#include "wx/evtloop.h" +#if wxUSE_CONSOLE_EVENTLOOP #ifndef WX_PRECOMP #include "wx/app.h" @@ -27,9 +27,11 @@ #endif #include +#include "wx/apptrait.h" +#include "wx/evtloop.h" #include "wx/thread.h" #include "wx/module.h" -#include "wx/generic/private/timer.h" +#include "wx/unix/private/timer.h" #include "wx/unix/private/epolldispatcher.h" #include "wx/private/selectdispatcher.h" @@ -124,15 +126,9 @@ wxConsoleEventLoop::wxConsoleEventLoop() return; } -#ifdef HAVE_SYS_EPOLL_H - m_dispatcher = wxEpollDispatcher::Get(); + m_dispatcher = wxFDIODispatcher::Get(); if ( !m_dispatcher ) -#endif // HAVE_SYS_EPOLL_H - { - m_dispatcher = wxSelectDispatcher::Get(); - } - - wxCHECK_RET( m_dispatcher, _T("failed to create IO dispatcher") ); + return; m_dispatcher->RegisterFD ( @@ -140,7 +136,7 @@ wxConsoleEventLoop::wxConsoleEventLoop() &m_wakeupPipe, wxFDIO_INPUT ); -}; +} //----------------------------------------------------------------------------- // events dispatch and loop handling @@ -180,7 +176,7 @@ void wxConsoleEventLoop::OnNextIteration() timeout = wxFDIODispatcher::TIMEOUT_INFINITE; } - m_dispatcher->RunLoop(timeout); + m_dispatcher->Dispatch(timeout); #if wxUSE_TIMER wxTimerScheduler::Get().NotifyExpired(); @@ -190,3 +186,10 @@ void wxConsoleEventLoop::OnNextIteration() wxTheApp->CheckSignal(); } + +wxEventLoopBase *wxConsoleAppTraits::CreateEventLoop() +{ + return new wxEventLoop(); +} + +#endif // wxUSE_CONSOLE_EVENTLOOP