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/socket.h"
23 #include "wx/apptrait.h"
27 void wxSocket_GDK_Input(gpointer data
,
28 gint
WXUNUSED(source
),
29 GdkInputCondition condition
)
31 wxFDIOHandler
* const handler
= static_cast<wxFDIOHandler
*>(data
);
33 if ( condition
& GDK_INPUT_READ
)
34 handler
->OnReadWaiting();
35 if ( condition
& GDK_INPUT_WRITE
)
36 handler
->OnWriteWaiting();
40 class GTKSocketManager
: public wxSocketInputBasedManager
43 virtual int AddInput(wxFDIOHandler
*handler
, int fd
, 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