KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kiway_express.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
5 * Copyright (C) 2014 KiCad Developers, see AUTHORS.TXT for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#include <kiway_express.h>
26
27#include <wx/window.h>
28
29//IMPLEMENT_DYNAMIC_CLASS( KIWAY_EXPRESS, wxEvent )
30
31
32#if 0 // requires that this code reside in only a single link image, rather than
33 // in each of kicad.exe, _pcbnew.kiface, and _eeschema.kiface as now.
34 // In the current case wxEVENT_ID will get a different value in each link
35 // image. We need to put this into a shared library for common utilization,
36 // I think that library should be libki.so. I am reluctant to do that now
37 // because the cost will be finding libki.so at runtime, and we need infrastructure
38 // to set our LIB_ENV_VAR to the proper place so libki.so can be reliably found.
39 // All things in due course.
40const wxEventType KIWAY_EXPRESS::wxEVENT_ID = wxNewEventType();
41#else
42const wxEventType KIWAY_EXPRESS::wxEVENT_ID = 30000; // common across all link images, hopefully unique.
43#endif
44
45
47 wxEvent( anOther ),
48 m_destination( anOther.m_destination ),
49 m_payload( anOther.m_payload )
50{
51}
52
53
54KIWAY_EXPRESS::KIWAY_EXPRESS( FRAME_T aDestination, MAIL_T aCommand, std::string& aPayload,
55 wxWindow* aSource ) :
56 wxEvent( aCommand, wxEVENT_ID ),
57 m_destination( aDestination ),
58 m_payload( aPayload )
59{
60 SetEventObject( aSource );
61}
62
Carry a payload from one KIWAY_PLAYER to another within a PROJECT.
Definition: kiway_express.h:40
KIWAY_EXPRESS(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
static const wxEventType wxEVENT_ID
The wxEventType argument to wxEvent() and identifies an event class in a hurry.
Definition: kiway_express.h:73
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:33
MAIL_T
The set of mail types sendable via KIWAY::ExpressMail() and supplied as the aCommand parameter to tha...
Definition: mail_type.h:38