]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/sockmot.cpp
Fix another crash when conversion fails in Unix PostScript code.
[wxWidgets.git] / src / motif / sockmot.cpp
index 98257ddddcb8a823c983b896c4fdabebd37e8c8e..3d28d956ca05067152e7245b3ff7590bfd0c8c53 100644 (file)
@@ -1,9 +1,8 @@
 ///////////////////////////////////////////////////////////////////////////////
-// Name:        motif/gsockmot.cpp
+// Name:        src/motif/sockmot.cpp
 // Purpose:     implementation of wxMotif-specific socket event handling
 // Author:      Guilhem Lavaux, Vadim Zeitlin
 // Created:     1999
-// RCS-ID:      $Id$
 // Copyright:   (c) 1999, 2007 wxWidgets dev team
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -15,7 +14,7 @@
 
 #include <X11/Intrinsic.h>      // XtAppAdd/RemoveInput()
 #include "wx/motif/private.h"   // wxGetAppContext()
-#include "wx/private/socket.h"
+#include "wx/private/fdiomanager.h"
 #include "wx/apptrait.h"
 
 extern "C" {
@@ -23,47 +22,48 @@ extern "C" {
 static void wxSocket_Motif_Input(XtPointer data, int *WXUNUSED(fid),
                                  XtInputId *WXUNUSED(id))
 {
-    wxSocketImpl * const socket = static_cast<wxSocketImpl *>(data);
+    wxFDIOHandler * const handler = static_cast<wxFDIOHandler *>(data);
 
-    socket->Detected_Read();
+    handler->OnReadWaiting();
 }
 
 static void wxSocket_Motif_Output(XtPointer data, int *WXUNUSED(fid),
                                   XtInputId *WXUNUSED(id))
 {
-    wxSocketImpl * const socket = static_cast<wxSocketImpl *>(data);
+    wxFDIOHandler * const handler = static_cast<wxFDIOHandler *>(data);
 
-    socket->Detected_Write();
+    handler->OnWriteWaiting();
 }
 
 }
 
-class MotifSocketManager : public wxSocketInputBasedManager
+class MotifFDIOManager : public wxFDIOManager
 {
 public:
-    virtual int AddInput(wxSocketImpl *socket, SocketDir d)
+    virtual int AddInput(wxFDIOHandler *handler, int fd, Direction d)
     {
         return XtAppAddInput
                (
                     wxGetAppContext(),
-                    socket->m_fd,
-                    (XtPointer)(d == FD_OUTPUT ? XtInputWriteMask
-                                               : XtInputReadMask),
-                    d == FD_OUTPUT ? wxSocket_Motif_Output
-                                   : wxSocket_Motif_Input,
-                    socket
+                    fd,
+                    (XtPointer)(d == OUTPUT ? XtInputWriteMask
+                                            : XtInputReadMask),
+                    d == OUTPUT ? wxSocket_Motif_Output
+                                : wxSocket_Motif_Input,
+                    handler
                );
     }
 
-    virtual void RemoveInput(int fd)
+    virtual void
+    RemoveInput(wxFDIOHandler* WXUNUSED(handler), int fd, Direction WXUNUSED(d))
     {
         XtRemoveInput(fd);
     }
 };
 
-wxSocketManager *wxGUIAppTraits::GetSocketManager()
+wxFDIOManager *wxGUIAppTraits::GetFDIOManager()
 {
-    static MotifSocketManager s_manager;
+    static MotifFDIOManager s_manager;
     return &s_manager;
 }