KiCad PCB EDA Suite
Loading...
Searching...
No Matches
footprint_context.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
21
23
24
26{
27public:
29 m_frame( aFrame )
30 {
31 }
32
33 BOARD* GetBoard() const override
34 {
35 return m_frame->GetBoard();
36 }
37
38 PROJECT& Prj() const override
39 {
40 return m_frame->Prj();
41 }
42
43 TOOL_MANAGER* GetToolManager() const override
44 {
45 return m_frame->GetToolManager();
46 }
47
48 KIWAY* GetKiway() const override
49 {
50 return &m_frame->Kiway();
51 }
52
53 bool CanAcceptApiCommands() const override
54 {
55 return m_frame->CanAcceptApiCommands();
56 }
57
58 LIB_ID GetLoadedFPID() const override
59 {
60 return m_frame->GetLoadedFPID();
61 }
62
63 bool SaveFootprint( FOOTPRINT* aFootprint ) override
64 {
65 return m_frame->SaveFootprint( aFootprint );
66 }
67
68 bool SaveFootprintInLibrary( FOOTPRINT* aFootprint, const wxString& aLibraryName ) override
69 {
70 return m_frame->SaveFootprintInLibrary( aFootprint, aLibraryName );
71 }
72
73private:
75};
76
77
78std::shared_ptr<FOOTPRINT_CONTEXT> CreateFootprintFrameContext( FOOTPRINT_EDIT_FRAME* aFrame )
79{
80 return std::make_shared<FOOTPRINT_EDIT_FRAME_CONTEXT>( aFrame );
81}
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:323
bool CanAcceptApiCommands() const override
FOOTPRINT_EDIT_FRAME * m_frame
BOARD * GetBoard() const override
FOOTPRINT_EDIT_FRAME_CONTEXT(FOOTPRINT_EDIT_FRAME *aFrame)
KIWAY * GetKiway() const override
LIB_ID GetLoadedFPID() const override
bool SaveFootprint(FOOTPRINT *aFootprint) override
PROJECT & Prj() const override
TOOL_MANAGER * GetToolManager() const override
bool SaveFootprintInLibrary(FOOTPRINT *aFootprint, const wxString &aLibraryName) override
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:315
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:49
Container for project specific data.
Definition project.h:66
Master controller class:
std::shared_ptr< FOOTPRINT_CONTEXT > CreateFootprintFrameContext(FOOTPRINT_EDIT_FRAME *aFrame)