KiCad PCB EDA Suite
kiway_holder.cpp
Go to the documentation of this file.
1
2/*
3 * This program source code file is part of KiCad, a free EDA CAD application.
4 *
5 * Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
6 * Copyright (C) 2016 KiCad Developers, see AUTHORS.TXT for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include <ignore.h>
27#include <kiway.h>
28#include <kiway_holder.h>
29#include <project.h>
30
31#if defined(DEBUG)
32 #include <typeinfo>
33#endif
34
35
37{
38 return Kiway().Prj();
39}
40
41
42// this is not speed critical, hide it out of line.
43void KIWAY_HOLDER::SetKiway( wxWindow* aDest, KIWAY* aKiway )
44{
45#if defined(DEBUG)
46 // offer a trap point for debugging most any window
47 wxASSERT( aDest );
48 if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
49 {
50 int breakhere=1;
51 ignore_unused( breakhere );
52 }
53#endif
54
55 ignore_unused( aDest );
56
57 m_kiway = aKiway;
58}
const char * name
Definition: DXF_plotter.cpp:56
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY * m_kiway
Definition: kiway_holder.h:84
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
void SetKiway(wxWindow *aDest, KIWAY *aKiway)
It is only used for debugging, since "this" is not a wxWindow*.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:273
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Definition: kiway.cpp:192
Container for project specific data.
Definition: project.h:63
void ignore_unused(const T &)
Definition: ignore.h:24