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 The 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, see <https://www.gnu.org/licenses/>.
19 */
21#include <bitmap2cmp_frame.h>
22#include <bitmap2cmp_settings.h>
23#include <kiface_base.h>
24#include <kiway.h>
25#include <pgm_base.h>
27
28
29namespace BMP2CMP {
30
31static struct IFACE : public KIFACE_BASE
32{
33 bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway ) override;
34
35 wxWindow* CreateKiWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway,
36 int aCtlBits = 0 ) override
37 {
40 return new BITMAP2CMP_FRAME( aKiway, aParent );
41 }
42
53 void* IfaceOrAddress( int aDataId ) override
54 {
55 return nullptr;
56 }
57
58 IFACE( const char* aDSOname, KIWAY::FACE_T aType ) :
59 KIFACE_BASE( aDSOname, aType )
60 {}
61
62} kiface( "BMP2CMP", KIWAY::FACE_BMP2CMP );
63
64} // namespace BMP2CMP
65
66using namespace BMP2CMP;
67
68
70{
71 return kiface;
72}
73
74
75// KIFACE_GETTER's actual spelling is a substitution macro found in kiway.h.
76// KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
77KIFACE* KIFACE_GETTER( int* aKIFACEversion, int aKIWAYversion, PGM_BASE* aProgram )
78{
79 return &kiface;
80}
81
82
83bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway )
84{
85 return start_common( aCtlBits );
86}
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
A KIFACE implementation.
Definition kiface_base.h:35
KIFACE_BASE(const char *aKifaceName, KIWAY::FACE_T aId)
Definition kiface_base.h:63
void InitSettings(APP_SETTINGS_BASE *aSettings)
Definition kiface_base.h:93
APP_SETTINGS_BASE * KifaceSettings() const
Definition kiface_base.h:91
bool start_common(int aCtlBits)
Common things to do for a top program module, during OnKifaceStart().
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
Definition kiway.h:311
FACE_T
Known KIFACE implementations.
Definition kiway.h:317
@ FACE_BMP2CMP
Definition kiway.h:324
Container for data for KiCad programs.
Definition pgm_base.h:102
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition pgm_base.h:124
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Take ownership of the pointer passed in.
#define KIFACE_GETTER
Definition kiway.h:109
BMP2CMP::IFACE KIFACE_BASE kiface("BMP2CMP", KIWAY::FACE_BMP2CMP)
PGM_BASE & Pgm()
The global program "get" accessor.
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:152