X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad8d42f83cdf7a4f26969957e94ed166a1a5710e..1bb7462687e4ce250372f6201a92a155a6f67af6:/include/wx/private/selectdispatcher.h diff --git a/include/wx/private/selectdispatcher.h b/include/wx/private/selectdispatcher.h index b444c23d8c..a704b8a83c 100644 --- a/include/wx/private/selectdispatcher.h +++ b/include/wx/private/selectdispatcher.h @@ -13,7 +13,17 @@ #include "wx/defs.h" -#include +#if wxUSE_SELECT_DISPATCHER + +#ifdef __WATCOMC__ + #include + #include + #include + #include + #include +#else + #include +#endif #include "wx/private/fdiodispatcher.h" @@ -36,9 +46,9 @@ public: // same as SetFD() except it unsets the bits set in the flags for the given // fd - bool ClearFD(int fd, int flags) + bool ClearFD(int fd) { - return SetFD(fd, wxFDIO_ALL & ~flags); + return SetFD(fd, 0); } @@ -74,30 +84,22 @@ private: class WXDLLIMPEXP_BASE wxSelectDispatcher : public wxMappedFDIODispatcher { public: - // returns the unique instance of this class, the pointer shouldn't be - // deleted and is normally never NULL - static wxSelectDispatcher *Get(); - - // if we have any registered handlers, check for any pending events to them - // and dispatch them -- this is used from wxX11 and wxDFB event loops - // implementation - static void DispatchPending(); + // default ctor + wxSelectDispatcher() { m_maxFD = -1; } // implement pure virtual methods of the base class virtual bool RegisterFD(int fd, wxFDIOHandler *handler, int flags = wxFDIO_ALL); virtual bool ModifyFD(int fd, wxFDIOHandler *handler, int flags = wxFDIO_ALL); - virtual bool UnregisterFD(int fd, int flags = wxFDIO_ALL); - virtual void RunLoop(int timeout = TIMEOUT_INFINITE); - -protected: - wxSelectDispatcher(); + virtual bool UnregisterFD(int fd); + virtual bool Dispatch(int timeout = TIMEOUT_INFINITE); private: // common part of RegisterFD() and ModifyFD() bool DoUpdateFDAndHandler(int fd, wxFDIOHandler *handler, int flags); - // call the handlers for the fds present in the given sets - void ProcessSets(const wxSelectSets& sets); + // call the handlers for the fds present in the given sets, return true if + // we called any handlers + bool ProcessSets(const wxSelectSets& sets); // helper of ProcessSets(): call the handler if its fd is in the set void DoProcessFD(int fd, const fd_set& fds, wxFDIOHandler *handler, @@ -111,5 +113,6 @@ private: int m_maxFD; }; +#endif // wxUSE_SELECT_DISPATCHER #endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_