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/gsocket.h"
23 #include "wx/apptrait.h"
27 void _GSocket_GDK_Input(gpointer data
,
28 gint
WXUNUSED(source
),
29 GdkInputCondition condition
)
31 GSocket
*socket
= (GSocket
*)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 GSocketInputBasedManager
43 virtual int AddInput(GSocket
*socket
, SocketDir d
)
48 d
== FD_OUTPUT
? GDK_INPUT_WRITE
: GDK_INPUT_READ
,
54 virtual void RemoveInput(int fd
)
60 GSocketManager
*wxGUIAppTraits::GetSocketManager()
62 static GTKSocketManager s_manager
;
66 #endif // wxUSE_SOCKETS