]> git.saurik.com Git - wxWidgets.git/blame - src/os2/sockpm.cpp
Add missing WXK constants for the control keys
[wxWidgets.git] / src / os2 / sockpm.cpp
CommitLineData
a9d859df 1///////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: src/os2/sockpm.cpp
a9d859df
VZ
3// Purpose: implementation of OS-2-specific handler event handling
4// Author: Guilhem Lavaux, Vadim Zeitlin
5// Created: 1999
6// RCS-ID: $Id$
7// Copyright: (c) 1999-2008 wxWidgets dev team
8// Licence: wxWindows licence
9///////////////////////////////////////////////////////////////////////////////
05a019a2 10
6670f564
WS
11// For compilers that support precompilation, includes "wx.h".
12#include "wx/wxprec.h"
13
05a019a2
DE
14#if wxUSE_SOCKETS
15
16#include <stdlib.h>
60913641 17#include "wx/private/socket.h"
621b4574 18#include "wx/app.h"
cb1e81d4 19#include "wx/apptrait.h"
05a019a2
DE
20
21#define wxSockReadMask 0x01
22#define wxSockWriteMask 0x02
23
51fe4b60 24static void wxSocket_PM_Input(void *data)
05a019a2 25{
6bcc1145 26 wxFDIOHandler *handler = static_cast<wxSocketImplUnix *>(data);
51fe4b60 27
a9d859df 28 handler->OnReadWaiting();
05a019a2
DE
29}
30
51fe4b60 31static void wxSocket_PM_Output(void *data)
05a019a2 32{
6bcc1145 33 wxFDIOHandler *handler = static_cast<wxSocketImplUnix *>(data);
51fe4b60 34
a9d859df 35 handler->OnWriteWaiting();
05a019a2
DE
36}
37
6bcc1145 38class PMFDIOManager : public wxFDIOManager
05a019a2 39{
f90913e2 40public:
6bcc1145
VZ
41 virtual int AddInput(wxFDIOHandler *handler,
42 int fd,
43 wxFDIOManager::Direction d)
05a019a2 44 {
f90913e2 45 if (d == FD_OUTPUT)
a9d859df
VZ
46 return wxTheApp->AddSocketHandler(fd, wxSockWriteMask,
47 wxSocket_PM_Output, handler);
f90913e2 48 else
a9d859df
VZ
49 return wxTheApp->AddSocketHandler(fd, wxSockReadMask,
50 wxSocket_PM_Input, handler);
05a019a2 51 }
05a019a2 52
6bcc1145
VZ
53 virtual void
54 RemoveInput(wxFDIOHandler * WXUNUSED(handler),
55 int fd,
56 wxFDIOManager::Direction WXUNUSED(dir))
05a019a2 57 {
f90913e2 58 wxTheApp->RemoveSocketHandler(fd);
05a019a2 59 }
f90913e2 60};
05a019a2 61
6bcc1145 62wxFDIOManager *wxGUIAppTraits::GetFDIOManager()
05a019a2 63{
6bcc1145 64 static PMFDIOManager s_manager;
f90913e2 65 return &s_manager;
05a019a2
DE
66}
67
05a019a2
DE
68
69#else /* !wxUSE_SOCKETS */
70
71/* some compilers don't like having empty source files */
72static int wxDummyGsockVar = 0;
73
74#endif /* wxUSE_SOCKETS/!wxUSE_SOCKETS */