KiCad PCB EDA Suite
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 <dick@softplc.com>
5  * Copyright (C) 2014 KiCad Developers, see CHANGELOG.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 //IMPLEMENT_DYNAMIC_CLASS( KIWAY_EXPRESS, wxEvent )
28 
29 
30 #if 0 // requires that this code reside in only a single link image, rather than
31  // in each of kicad.exe, _pcbnew.kiface, and _eeschema.kiface as now.
32  // In the current case wxEVENT_ID will get a different value in each link
33  // image. We need to put this into a shared library for common utilization,
34  // I think that library should be libki.so. I am reluctant to do that now
35  // because the cost will be finding libki.so at runtime, and we need infrastructure
36  // to set our LIB_ENV_VAR to the proper place so libki.so can be reliably found.
37  // All things in due course.
38 const wxEventType KIWAY_EXPRESS::wxEVENT_ID = wxNewEventType();
39 #else
40 const wxEventType KIWAY_EXPRESS::wxEVENT_ID = 30000; // commmon accross all link images, hopefully unique.
41 #endif
42 
43 
45  wxEvent( anOther )
46 {
47  m_destination = anOther.m_destination;
48  m_payload = anOther.m_payload;
49 }
50 
51 
53  const std::string& aPayload, wxWindow* aSource ) :
54  wxEvent( aCommand, wxEVENT_ID ),
55  m_destination( aDestination ),
56  m_payload( aPayload )
57 {
58  SetEventObject( aSource );
59 }
60 
KIWAY_EXPRESS(FRAME_T aDestination, MAIL_T aCommand, const std::string &aPayload, wxWindow *aSource=NULL)
std::string m_payload
very often s-expression text, but not always
Definition: kiway_express.h:85
Class KIWAY_EXPRESS carries a payload from one KIWAY_PLAYER to another within a PROJECT.
Definition: kiway_express.h:39
static const wxEventType wxEVENT_ID
The wxEventType argument to wxEvent() and identifies an event class in a hurry.
Definition: kiway_express.h:79
FRAME_T
Enum FRAME_T is the set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:34
FRAME_T m_destination
could have been a bitmap indicating multiple recipients
Definition: kiway_express.h:84
MAIL_T
Enum MAIL_T is the set of mail types sendable via KIWAY::ExpressMail() and supplied as the aCommand p...
Definition: mail_type.h:37