71e9885be0
Any event sources should be registered with all the event loops, including the ones that will be started in the future, and not only the current (and potentially not even existing yet) one. So make AddSourceForFD() method static. To still allow it to do different things in console and GUI applications, as it must, virtualize it via the new wxEventLoopSourcesManager class which has different implementations in the two cases, returned via wxAppTraits as usual. Notice that this required moving the implementation of this method from src/osx/core/evtloop_cf.cpp to src/osx/core/utilsexc_cf.cpp as the former file is base-only and didn't have access to wxGUIAppTraits. See #10258. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
///////////////////////////////////////////////////////////////////////////////
|
|
// Name: wx/osx/evtloopsrc.h
|
|
// Purpose: wxCFEventLoopSource class
|
|
// Author: Vadim Zeitlin
|
|
// Created: 2009-10-21
|
|
// RCS-ID: $Id$
|
|
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
|
|
// Licence: wxWindows licence
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _WX_OSX_EVTLOOPSRC_H_
|
|
#define _WX_OSX_EVTLOOPSRC_H_
|
|
|
|
typedef struct __CFFileDescriptor *CFFileDescriptorRef;
|
|
|
|
// ----------------------------------------------------------------------------
|
|
// wxCFEventLoopSource: CoreFoundation-based wxEventLoopSource for OS X
|
|
// ----------------------------------------------------------------------------
|
|
|
|
class WXDLLIMPEXP_BASE wxCFEventLoopSource : public wxEventLoopSource
|
|
{
|
|
public:
|
|
wxCFEventLoopSource(wxEventLoopSourceHandler *handler, int flags)
|
|
: wxEventLoopSource(handler, flags)
|
|
{
|
|
m_cffd = NULL;
|
|
}
|
|
|
|
// we take ownership of this CFFileDescriptorRef
|
|
void SetFileDescriptor(CFFileDescriptorRef cffd);
|
|
|
|
virtual ~wxCFEventLoopSource();
|
|
|
|
private:
|
|
CFFileDescriptorRef m_cffd;
|
|
|
|
wxDECLARE_NO_COPY_CLASS(wxCFEventLoopSource);
|
|
};
|
|
|
|
#endif // _WX_OSX_EVTLOOPSRC_H_
|
|
|