]>
git.saurik.com Git - wxWidgets.git/blob - src/os2/sockpm.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/os2/sockpm.cpp
3 // Purpose: implementation of OS-2-specific handler event handling
4 // Author: Guilhem Lavaux, Vadim Zeitlin
6 // Copyright: (c) 1999-2008 wxWidgets dev team
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
16 #include "wx/private/socket.h"
18 #include "wx/apptrait.h"
20 #define wxSockReadMask 0x01
21 #define wxSockWriteMask 0x02
23 static void wxSocket_PM_Input(void *data
)
25 wxFDIOHandler
*handler
= static_cast<wxSocketImplUnix
*>(data
);
27 handler
->OnReadWaiting();
30 static void wxSocket_PM_Output(void *data
)
32 wxFDIOHandler
*handler
= static_cast<wxSocketImplUnix
*>(data
);
34 handler
->OnWriteWaiting();
37 class PMFDIOManager
: public wxFDIOManager
40 virtual int AddInput(wxFDIOHandler
*handler
,
42 wxFDIOManager::Direction d
)
45 return wxTheApp
->AddSocketHandler(fd
, wxSockWriteMask
,
46 wxSocket_PM_Output
, handler
);
48 return wxTheApp
->AddSocketHandler(fd
, wxSockReadMask
,
49 wxSocket_PM_Input
, handler
);
53 RemoveInput(wxFDIOHandler
* WXUNUSED(handler
),
55 wxFDIOManager::Direction
WXUNUSED(dir
))
57 wxTheApp
->RemoveSocketHandler(fd
);
61 wxFDIOManager
*wxGUIAppTraits::GetFDIOManager()
63 static PMFDIOManager s_manager
;
68 #else /* !wxUSE_SOCKETS */
70 /* some compilers don't like having empty source files */
71 static int wxDummyGsockVar
= 0;
73 #endif /* wxUSE_SOCKETS/!wxUSE_SOCKETS */