Back port of wxSocket-related fixes from trunk.
This patch combines the changes from the following trunk revisions: - r61675 - r61676 - r61677 - r61678 - r61685 - r61686 - r61687 - r61688 - r61689 - r61690 - r61696 - r61726 It refactors wxSocketImpl creation to use a Mac-specific version of it in GUI Mac applications which fixes generation of socket events under Mac (see #11030) and also fixes bug in wxSocketServer::WaitForAccept() (see #11107). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_9_0_BRANCH@61734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
54
include/wx/private/fdiohandler.h
Normal file
54
include/wx/private/fdiohandler.h
Normal file
@@ -0,0 +1,54 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/private/fdiohandler.h
|
||||
// Purpose: declares wxFDIOHandler class
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2009-08-17
|
||||
// RCS-ID: $Id: wxhead.h,v 1.11 2009-06-29 10:23:04 zeitlin Exp $
|
||||
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_PRIVATE_FDIOHANDLER_H_
|
||||
#define _WX_PRIVATE_FDIOHANDLER_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxFDIOHandler: interface used to process events on file descriptors
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class wxFDIOHandler
|
||||
{
|
||||
public:
|
||||
wxFDIOHandler() { m_regmask = 0; }
|
||||
|
||||
// called when descriptor is available for non-blocking read
|
||||
virtual void OnReadWaiting() = 0;
|
||||
|
||||
// called when descriptor is available for non-blocking write
|
||||
virtual void OnWriteWaiting() = 0;
|
||||
|
||||
// called when there is exception on descriptor
|
||||
virtual void OnExceptionWaiting() = 0;
|
||||
|
||||
// called to check if the handler is still valid, only used by
|
||||
// wxSocketImplUnix currently
|
||||
virtual bool IsOk() const { return true; }
|
||||
|
||||
|
||||
// get/set the mask of events for which we're currently registered for:
|
||||
// it's a combination of wxFDIO_{INPUT,OUTPUT,EXCEPTION}
|
||||
int GetRegisteredEvents() const { return m_regmask; }
|
||||
void SetRegisteredEvent(int flag) { m_regmask |= flag; }
|
||||
void ClearRegisteredEvent(int flag) { m_regmask &= ~flag; }
|
||||
|
||||
|
||||
// virtual dtor for the base class
|
||||
virtual ~wxFDIOHandler() { }
|
||||
|
||||
private:
|
||||
int m_regmask;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxFDIOHandler);
|
||||
};
|
||||
|
||||
#endif // _WX_PRIVATE_FDIOHANDLER_H_
|
||||
|
Reference in New Issue
Block a user