KiCad PCB EDA Suite
Loading...
Searching...
No Matches
bitmap2cmp_main.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) 1992-2010 jean-pierre.charras
5 * Copyright (C) 1992-2021 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
26#include <bitmap2cmp_settings.h>
27#include <kiface_base.h>
28#include <kiway.h>
29#include <pgm_base.h>
31
32
33namespace BMP2CMP {
34
35static struct IFACE : public KIFACE_BASE
36{
37 bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway ) override;
38
39 wxWindow* CreateKiWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway,
40 int aCtlBits = 0 ) override
41 {
44 return new BITMAP2CMP_FRAME( aKiway, aParent );
45 }
46
57 void* IfaceOrAddress( int aDataId ) override
58 {
59 return nullptr;
60 }
61
62 IFACE( const char* aDSOname, KIWAY::FACE_T aType ) :
63 KIFACE_BASE( aDSOname, aType )
64 {}
65
66} kiface( "BMP2CMP", KIWAY::FACE_BMP2CMP );
67
68} // namespace BMP2CMP
69
70using namespace BMP2CMP;
71
72
74{
75 return kiface;
76}
77
78
79// KIFACE_GETTER's actual spelling is a substitution macro found in kiway.h.
80// KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
81KIFACE* KIFACE_GETTER( int* aKIFACEversion, int aKIWAYversion, PGM_BASE* aProgram )
82{
83 return &kiface;
84}
85
86
87bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway )
88{
89 return start_common( aCtlBits );
90}
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
A KIFACE implementation.
Definition: kiface_base.h:39
void InitSettings(APP_SETTINGS_BASE *aSettings)
Definition: kiface_base.h:97
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_base.h:95
bool start_common(int aCtlBits)
Common things to do for a top program module, during OnKifaceStart().
Definition: kiface_base.cpp:32
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition: kiway.h:284
FACE_T
Known KIFACE implementations.
Definition: kiway.h:290
@ FACE_BMP2CMP
Definition: kiway.h:297
Container for data for KiCad programs.
Definition: pgm_base.h:102
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:142
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Takes ownership of the pointer passed in.
#define KIFACE_GETTER
Definition: kiway.h:110
BMP2CMP::IFACE KIFACE_BASE kiface("BMP2CMP", KIWAY::FACE_BMP2CMP)
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: pgm_base.cpp:1060
see class PGM_BASE
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
IFACE(const char *aDSOname, KIWAY::FACE_T aType)
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
Implement a participant in the KIWAY alchemy.
Definition: kiway.h:151