1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/motif/sockmot.cpp
3 // Purpose: implementation of wxMotif-specific socket event handling
4 // Author: Guilhem Lavaux, Vadim Zeitlin
6 // Copyright: (c) 1999, 2007 wxWidgets dev team
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
15 #include <X11/Intrinsic.h> // XtAppAdd/RemoveInput()
16 #include "wx/motif/private.h" // wxGetAppContext()
17 #include "wx/private/fdiomanager.h"
18 #include "wx/apptrait.h"
22 static void wxSocket_Motif_Input(XtPointer data
, int *WXUNUSED(fid
),
23 XtInputId
*WXUNUSED(id
))
25 wxFDIOHandler
* const handler
= static_cast<wxFDIOHandler
*>(data
);
27 handler
->OnReadWaiting();
30 static void wxSocket_Motif_Output(XtPointer data
, int *WXUNUSED(fid
),
31 XtInputId
*WXUNUSED(id
))
33 wxFDIOHandler
* const handler
= static_cast<wxFDIOHandler
*>(data
);
35 handler
->OnWriteWaiting();
40 class MotifFDIOManager
: public wxFDIOManager
43 virtual int AddInput(wxFDIOHandler
*handler
, int fd
, Direction d
)
49 (XtPointer
)(d
== OUTPUT
? XtInputWriteMask
51 d
== OUTPUT
? wxSocket_Motif_Output
52 : wxSocket_Motif_Input
,
58 RemoveInput(wxFDIOHandler
* WXUNUSED(handler
), int fd
, Direction
WXUNUSED(d
))
64 wxFDIOManager
*wxGUIAppTraits::GetFDIOManager()
66 static MotifFDIOManager s_manager
;
70 #endif // wxUSE_SOCKETS