X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3754265e328a7cc7f67a46a9beea105cf1d49a14..5cce8340b28be2eecea1822434eeff7055840f9c:/src/x11/evtloop.cpp diff --git a/src/x11/evtloop.cpp b/src/x11/evtloop.cpp index e08e74c2b4..408d6fee34 100644 --- a/src/x11/evtloop.cpp +++ b/src/x11/evtloop.cpp @@ -17,10 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "evtloop.h" -#endif - #include "wx/window.h" #include "wx/app.h" #include "wx/evtloop.h" @@ -31,6 +27,7 @@ #include "wx/timer.h" #include "wx/hash.h" #include "wx/module.h" +#include "wx/unix/private.h" #include "wx/x11/private.h" #include "X11/Xlib.h" @@ -178,14 +175,14 @@ void wxSocketTable::FillSets(fd_set* readset, fd_set* writeset, int* highest) if (entry->m_fdInput != -1) { - FD_SET(entry->m_fdInput, readset); + wxFD_SET(entry->m_fdInput, readset); if (entry->m_fdInput > *highest) * highest = entry->m_fdInput; } if (entry->m_fdOutput != -1) { - FD_SET(entry->m_fdOutput, writeset); + wxFD_SET(entry->m_fdOutput, writeset); if (entry->m_fdOutput > *highest) * highest = entry->m_fdOutput; } @@ -202,12 +199,12 @@ void wxSocketTable::ProcessEvents(fd_set* readset, fd_set* writeset) { wxSocketTableEntry* entry = (wxSocketTableEntry*) node->GetData(); - if (entry->m_fdInput != -1 && FD_ISSET(entry->m_fdInput, readset)) + if (entry->m_fdInput != -1 && wxFD_ISSET(entry->m_fdInput, readset)) { (entry->m_callbackInput) (entry->m_fdInput, entry->m_dataInput); } - if (entry->m_fdOutput != -1 && FD_ISSET(entry->m_fdOutput, writeset)) + if (entry->m_fdOutput != -1 && wxFD_ISSET(entry->m_fdOutput, writeset)) { (entry->m_callbackOutput) (entry->m_fdOutput, entry->m_dataOutput); } @@ -342,8 +339,6 @@ bool wxEventLoopImpl::SendIdleEvent() // wxEventLoop implementation // ============================================================================ -wxEventLoop *wxEventLoopBase::ms_activeLoop = NULL; - // ---------------------------------------------------------------------------- // wxEventLoop running and exiting // ---------------------------------------------------------------------------- @@ -360,8 +355,7 @@ int wxEventLoop::Run() m_impl = new wxEventLoopImpl; - wxEventLoop *oldLoop = ms_activeLoop; - ms_activeLoop = this; + wxEventLoopActivator activate(this); m_impl->m_keepGoing = TRUE; while ( m_impl->m_keepGoing ) @@ -403,8 +397,6 @@ int wxEventLoop::Run() delete m_impl; m_impl = NULL; - ms_activeLoop = oldLoop; - return exitcode; } @@ -459,10 +451,10 @@ bool wxEventLoop::Dispatch() fd_set readset; fd_set writeset; int highest = fd; - FD_ZERO(&readset); - FD_ZERO(&writeset); + wxFD_ZERO(&readset); + wxFD_ZERO(&writeset); - FD_SET(fd, &readset); + wxFD_SET(fd, &readset); #if wxUSE_SOCKETS if (wxTheSocketTable) @@ -477,7 +469,7 @@ bool wxEventLoop::Dispatch() else { // An X11 event was pending, so get it - if (FD_ISSET( fd, &readset )) + if (wxFD_ISSET( fd, &readset )) XNextEvent( wxGlobalDisplay(), &event ); #if wxUSE_SOCKETS