1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: gtk/gsockgtk.cpp
3 // Purpose: implementation of wxGTK-specific socket event handling
4 // Author: Guilhem Lavaux, Vadim Zeitlin
7 // Copyright: (c) 1999, 2007 wxWidgets dev team
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
22 #include "wx/private/gsocket.h"
23 #include "wx/apptrait.h"
27 void wxSocket_GDK_Input(gpointer data
,
28 gint
WXUNUSED(source
),
29 GdkInputCondition condition
)
31 wxSocketImpl
* const socket
= static_cast<wxSocketImpl
*>(data
);
33 if ( condition
& GDK_INPUT_READ
)
34 socket
->Detected_Read();
35 if ( condition
& GDK_INPUT_WRITE
)
36 socket
->Detected_Write();
40 class GTKSocketManager
: public wxSocketInputBasedManager
43 virtual int AddInput(wxSocketImpl
*socket
, SocketDir d
)
48 d
== FD_OUTPUT
? GDK_INPUT_WRITE
: GDK_INPUT_READ
,
54 virtual void RemoveInput(int fd
)
60 wxSocketManager
*wxGUIAppTraits::GetSocketManager()
62 static GTKSocketManager s_manager
;
66 #endif // wxUSE_SOCKETS