make wxSocketImplUnix inherit from wxFDIOHandler as they're used for almost the same purpose; this removes the need for the bridge wxSocketOHandler class

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56998 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-11-28 14:39:49 +00:00
parent 9123889f20
commit a9d859df6f
9 changed files with 89 additions and 151 deletions

View File

@@ -28,26 +28,26 @@ void wxSocket_GDK_Input(gpointer data,
gint WXUNUSED(source),
GdkInputCondition condition)
{
wxSocketImpl const *socket = static_cast<wxSocketImpl *>(data);
wxFDIOHandler * const handler = static_cast<wxFDIOHandler *>(data);
if ( condition & GDK_INPUT_READ )
socket->Detected_Read();
if ( condition & GDK_INPUT_WRITE )
socket->Detected_Write();
if ( condition & GDK_INPUT_READ )
handler->OnReadWaiting();
if ( condition & GDK_INPUT_WRITE )
handler->OnWriteWaiting();
}
}
class GTKSocketManager : public wxSocketInputBasedManager
{
public:
virtual int AddInput(wxSocketImpl *socket, SocketDir d)
virtual int AddInput(wxFDIOHandler *handler, int fd, SocketDir d)
{
return gdk_input_add
(
socket->m_fd,
fd,
d == FD_OUTPUT ? GDK_INPUT_WRITE : GDK_INPUT_READ,
wxSocket_GDK_Input,
socket
handler
);
}