KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 The 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, see <https://www.gnu.org/licenses/>.
20 */
21
22#include <core/ignore.h>
23#include <kiway.h>
24#include <kiway_holder.h>
25#include <project.h>
26
27#if defined(DEBUG)
28 #include <typeinfo>
29#endif
30
31
33{
34 return Kiway().Prj();
35}
36
37
38// this is not speed critical, hide it out of line.
39void KIWAY_HOLDER::SetKiway( wxWindow* aDest, KIWAY* aKiway )
40{
41#if defined(DEBUG)
42 // offer a trap point for debugging most any window
43 wxASSERT( aDest );
44 if( !strcmp( typeid(aDest).name(), "DIALOG_EDIT_LIBENTRY_FIELDS_IN_LIB" ) )
45 {
46 int breakhere=1;
47 ignore_unused( breakhere );
48 }
49#endif
50
51 ignore_unused( aDest );
52
53 m_kiway = aKiway;
54}
const char * name
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY * m_kiway
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
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:311
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Definition kiway.cpp:201
Container for project specific data.
Definition project.h:62
void ignore_unused(const T &)
Definition ignore.h:20