1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: motif/sockmot.cpp
3 // Purpose: implementation of wxMotif-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"
16 #include <X11/Intrinsic.h> // XtAppAdd/RemoveInput()
17 #include "wx/motif/private.h" // wxGetAppContext()
18 #include "wx/private/socket.h"
19 #include "wx/apptrait.h"
23 static void wxSocket_Motif_Input(XtPointer data
, int *WXUNUSED(fid
),
24 XtInputId
*WXUNUSED(id
))
26 wxFDIOHandler
* const handler
= static_cast<wxFDIOHandler
*>(data
);
28 handler
->OnReadWaiting();
31 static void wxSocket_Motif_Output(XtPointer data
, int *WXUNUSED(fid
),
32 XtInputId
*WXUNUSED(id
))
34 wxFDIOHandler
* const handler
= static_cast<wxFDIOHandler
*>(data
);
36 handler
->OnWriteWaiting();
41 class MotifSocketManager
: public wxSocketInputBasedManager
44 virtual int AddInput(wxFDIOHandler
*handler
, int fd
, SocketDir d
)
50 (XtPointer
)(d
== FD_OUTPUT
? XtInputWriteMask
52 d
== FD_OUTPUT
? wxSocket_Motif_Output
53 : wxSocket_Motif_Input
,
58 virtual void RemoveInput(int fd
)
64 wxSocketManager
*wxGUIAppTraits::GetSocketManager()
66 static MotifSocketManager s_manager
;
70 #endif // wxUSE_SOCKETS