X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/09e6e5ec02fdcf888062ac8a52fada2017608950..b3fcfa4d89d44425ed28050462c6064100fe7b05:/include/wx/unix/gsockunx.h?ds=sidebyside diff --git a/include/wx/unix/gsockunx.h b/include/wx/unix/gsockunx.h index e5eefa2c4e..2eba13f4ef 100644 --- a/include/wx/unix/gsockunx.h +++ b/include/wx/unix/gsockunx.h @@ -34,7 +34,7 @@ class GSocketBSD { public: GSocketBSD(); - ~GSocketBSD(); + virtual ~GSocketBSD(); bool IsOk() { return m_ok; } void Close(); void Shutdown(); @@ -70,10 +70,14 @@ protected: void Detected_Read(); void Detected_Write(); bool m_ok; + virtual void EventLoop_Enable_Events() = 0; + virtual void EventLoop_Disable_Events() = 0; + virtual void EventLoop_Install_Callback(GSocketEvent event) = 0; + virtual void EventLoop_Uninstall_Callback(GSocketEvent event) = 0; public: -//DFE: We can't protect these data member until the GUI code is updated -//protected: -#else //def wxUSE_GSOCKET_CPLUSPLUS + /* DFE: We can't protect these data member until the GUI code is updated */ + /* protected: */ +#else /* def wxUSE_GSOCKET_CPLUSPLUS */ #ifdef __cplusplus extern "C" { @@ -81,7 +85,7 @@ extern "C" { /* Definition of GSocket */ struct _GSocket { -#endif //def wxUSE_GSOCKET_CPLUSPLUS +#endif /* def wxUSE_GSOCKET_CPLUSPLUS */ int m_fd; GAddress *m_local; GAddress *m_peer; @@ -108,7 +112,31 @@ struct _GSocket #ifdef __cplusplus } #endif /* __cplusplus */ -#endif //ndef wxUSE_GSOCKET_CPLUSPLUS +#else +/**************************************************************************/ +/* GSocketBSDGUIShim */ +class GSocketBSDGUIShim:public GSocketBSD +{ + friend void GSocket_SetGUIFunctions(struct GSocketGUIFunctionsTable *guifunc); +public: + static inline bool GUI_Init(); + static inline void GUI_Cleanup(); + static inline bool UseGUI(); + GSocketBSDGUIShim(); + virtual ~GSocketBSDGUIShim(); +protected: + virtual void EventLoop_Enable_Events(); + virtual void EventLoop_Disable_Events(); + virtual void EventLoop_Install_Callback(GSocketEvent event); + virtual void EventLoop_Uninstall_Callback(GSocketEvent event); +private: +/* Table of GUI-related functions. We must call them indirectly because + * of wxBase and GUI separation: */ + + static struct GSocketGUIFunctionsTable *ms_gui_functions; +}; + +#endif /* ndef wxUSE_GSOCKET_CPLUSPLUS */ #ifdef __cplusplus extern "C" { @@ -128,7 +156,7 @@ struct _GAddress } #endif /* __cplusplus */ -// Compatibility methods to support old C API (from gsocket.h) +/* Compatibility methods to support old C API (from gsocket.h) */ #ifdef wxUSE_GSOCKET_CPLUSPLUS inline void GSocket_Shutdown(GSocket *socket) { socket->Shutdown(); } @@ -164,7 +192,7 @@ inline void GSocket_SetCallback(GSocket *socket, GSocketEventFlags flags, inline void GSocket_UnsetCallback(GSocket *socket, GSocketEventFlags flags) { socket->UnsetCallback(flags); } -#endif //def wxUSE_GSOCKET_CPLUSPLUS +#endif /* def wxUSE_GSOCKET_CPLUSPLUS */ #ifdef __cplusplus extern "C" { @@ -198,7 +226,7 @@ void _GSocket_Disable(GSocket *socket, GSocketEvent event); #ifndef wxUSE_GSOCKET_CPLUSPLUS void _GSocket_Detected_Read(GSocket *socket); void _GSocket_Detected_Write(GSocket *socket); -#endif //ndef wxUSE_GSOCKET_CPLUSPLUS +#endif /* ndef wxUSE_GSOCKET_CPLUSPLUS */ /* GAddress */