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
27 lines
859 B
C++
27 lines
859 B
C++
///////////////////////////////////////////////////////////////////////////////
|
|
// Name: wx/private/eventloopsourcesmanager.h
|
|
// Purpose: declares wxEventLoopSourcesManagerBase class
|
|
// Author: Rob Bresalier
|
|
// Created: 2013-06-19
|
|
// RCS-ID: $Id$
|
|
// Copyright: (c) 2013 Rob Bresalier
|
|
// Licence: wxWindows licence
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _WX_PRIVATE_EVENTLOOPSOURCESMANAGER_H_
|
|
#define _WX_PRIVATE_EVENTLOOPSOURCESMANAGER_H_
|
|
|
|
// For pulling in the value of wxUSE_EVENTLOOP_SOURCE
|
|
#include "wx/evtloop.h"
|
|
|
|
class WXDLLIMPEXP_BASE wxEventLoopSourcesManagerBase
|
|
{
|
|
public:
|
|
#if wxUSE_EVENTLOOP_SOURCE
|
|
virtual wxEventLoopSource*
|
|
AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags) = 0;
|
|
#endif
|
|
};
|
|
|
|
#endif // _WX_PRIVATE_EVENTLOOPSOURCESMANAGER_H_
|