]>
git.saurik.com Git - wxWidgets.git/blob - src/os2/sockpm.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: os2/sockpm.cpp
3 // Purpose: implementation of OS-2-specific handler event handling
4 // Author: Guilhem Lavaux, Vadim Zeitlin
7 // Copyright: (c) 1999-2008 wxWidgets dev team
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
17 #include "wx/private/socket.h"
19 #include "wx/apptrait.h"
21 #define wxSockReadMask 0x01
22 #define wxSockWriteMask 0x02
24 static void wxSocket_PM_Input(void *data
)
26 wxFDIOHandler
*handler
= static_cast<wxSocketImplUnix
*>(data
);
28 handler
->OnReadWaiting();
31 static void wxSocket_PM_Output(void *data
)
33 wxFDIOHandler
*handler
= static_cast<wxSocketImplUnix
*>(data
);
35 handler
->OnWriteWaiting();
38 class PMFDIOManager
: public wxFDIOManager
41 virtual int AddInput(wxFDIOHandler
*handler
,
43 wxFDIOManager::Direction d
)
46 return wxTheApp
->AddSocketHandler(fd
, wxSockWriteMask
,
47 wxSocket_PM_Output
, handler
);
49 return wxTheApp
->AddSocketHandler(fd
, wxSockReadMask
,
50 wxSocket_PM_Input
, handler
);
54 RemoveInput(wxFDIOHandler
* WXUNUSED(handler
),
56 wxFDIOManager::Direction
WXUNUSED(dir
))
58 wxTheApp
->RemoveSocketHandler(fd
);
62 wxFDIOManager
*wxGUIAppTraits::GetFDIOManager()
64 static PMFDIOManager s_manager
;
69 #else /* !wxUSE_SOCKETS */
71 /* some compilers don't like having empty source files */
72 static int wxDummyGsockVar
= 0;
74 #endif /* wxUSE_SOCKETS/!wxUSE_SOCKETS */