X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b46b1d59d6f69ad80dcf5955375578a6504d100a..db7035e48a4ccc6265fa01949cb92db3c6b6c17f:/include/wx/private/gsocketiohandler.h diff --git a/include/wx/private/gsocketiohandler.h b/include/wx/private/gsocketiohandler.h index 135e938d2a..00c4cf3ea9 100644 --- a/include/wx/private/gsocketiohandler.h +++ b/include/wx/private/gsocketiohandler.h @@ -2,7 +2,6 @@ // Name: wx/private/gsocketiohandler.h // Purpose: class for registering GSocket in wxSelectDispatcher // Authors: Lukasz Michalski -// Modified by: // Created: December 2006 // Copyright: (c) Lukasz Michalski // RCS-ID: $Id$ @@ -13,30 +12,34 @@ #define _WX_PRIVATE_GSOCKETIOHANDLER_H_ #include "wx/defs.h" -#include "wx/private/selectdispatcher.h" -#if wxUSE_SOCKETS +#if wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER -// forward declarations -class GSocket; +#include "wx/private/selectdispatcher.h" +#include "wx/gsocket.h" -class WXDLLIMPEXP_CORE wxGSocketIOHandler : public wxFDIOHandler +class WXDLLIMPEXP_BASE wxGSocketIOHandler : public wxFDIOHandler { public: - wxGSocketIOHandler(GSocket* socket); - int GetFlags() const; - void RemoveFlag(wxFDIODispatcherEntryFlags flag); - void AddFlag(wxFDIODispatcherEntryFlags flag); + wxGSocketIOHandler(GSocket* socket) + { + m_socket = socket; + m_flags = 0; + } + + int GetFlags() const { return m_flags; } + void RemoveFlag(wxFDIODispatcherEntryFlags flag) { m_flags &= ~flag; } + void AddFlag(wxFDIODispatcherEntryFlags flag) { m_flags |= flag; } - virtual void OnReadWaiting(); - virtual void OnWriteWaiting(); - virtual void OnExceptionWaiting(); + virtual void OnReadWaiting() { m_socket->Detected_Read(); } + virtual void OnWriteWaiting() { m_socket->Detected_Write(); } + virtual void OnExceptionWaiting() { m_socket->Detected_Read(); } private: GSocket* m_socket; int m_flags; }; -#endif // wxUSE_SOCKETS +#endif // wxUSE_SOCKETS && wxUSE_SELECT_DISPATCHER #endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_