KiCad PCB EDA Suite
cvpcb.cpp File Reference
#include <confirm.h>
#include <fp_lib_table.h>
#include <footprint_info_impl.h>
#include <kiface_base.h>
#include <pgm_base.h>
#include <settings/settings_manager.h>
#include <cvpcb_mainframe.h>
#include <settings/cvpcb_settings.h>
#include <display_footprints_frame.h>
#include <kiface_ids.h>

Go to the source code of this file.

Classes

struct  CV::IFACE
 

Namespaces

namespace  CV
 

Functions

CV::IFACE KIFACE_BASE CV::kiface ("cvpcb", KIWAY::FACE_CVPCB)
 
 IFACE (const char *aName, KIWAY::FACE_T aType)
 
bool OnKifaceStart (PGM_BASE *aProgram, int aCtlBits) override
 
void OnKifaceEnd () override
 
wxWindow * CreateKiWindow (wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
 
void * IfaceOrAddress (int aDataId) override
 Return a pointer to the requested object. More...
 
KIFACE_BASEKiface ()
 Global KIFACE_BASE "get" accessor. More...
 
 MY_API (KIFACE *) KIFACE_GETTER(int *aKIFACEversion
 
PGM_BASEPgm ()
 The global Program "get" accessor. More...
 
PGM_BASEPgmOrNull ()
 similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from a script, not from a kicad appl More...
 

Variables

static PGM_BASEprocess
 
int aKIWAYversion
 
int PGM_BASEaProgram
 
return & kiface
 
FP_LIB_TABLE GFootprintTable
 The global footprint library table. More...
 
FOOTPRINT_LIST_IMPL GFootprintList
 The global footprint info table. More...
 

Function Documentation

◆ CreateKiWindow()

wxWindow * kiface::CreateKiWindow ( wxWindow *  aParent,
int  aClassId,
KIWAY aKiway,
int  aCtlBits = 0 
)
override

Definition at line 10 of file cvpcb.cpp.

19 :
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

◆ IFACE()

kiface::IFACE ( const char *  aName,
KIWAY::FACE_T  aType 
)

Definition at line 2 of file cvpcb.cpp.

19 :
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

◆ IfaceOrAddress()

void * kiface::IfaceOrAddress ( int  aDataId)
override

Return a pointer to the requested object.

The safest way to use this is to retrieve a pointer to a static instance of an interface, similar to how the KIFACE interface is exported. But if you know what you are doing use it to retrieve anything you want.

Parameters
aDataIdidentifies which object you want the address of.
Returns
the object requested and must be cast into the known type.

Definition at line 31 of file cvpcb.cpp.

38 {
39
40static struct IFACE : public KIFACE_BASE
41{
42 // Of course all are virtual overloads, implementations of the KIFACE.
43
44 IFACE( const char* aName, KIWAY::FACE_T aType ) :
45 KIFACE_BASE( aName, aType )
46 {}
47
48 bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits ) override;
49
50 void OnKifaceEnd() override;
A KIFACE implementation.
Definition: kiface_base.h:39
FACE_T
Known KIFACE implementations.
Definition: kiway.h:279
Container for data for KiCad programs.
Definition: pgm_base.h:94
int PGM_BASE * aProgram
Definition: cvpcb.cpp:110
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
Typically start_common() is called from here.
IFACE(const char *aName, KIWAY::FACE_T aType)
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.

◆ Kiface()

KIFACE_BASE & Kiface ( )

Global KIFACE_BASE "get" accessor.

Definition at line 104 of file cvpcb.cpp.

104{ return kiface; }
return & kiface
Definition: cvpcb.cpp:112

References kiface.

◆ MY_API()

MY_API ( KIFACE )

◆ OnKifaceEnd()

void kiface::OnKifaceEnd ( )
override

Definition at line 11 of file test_app_main.cpp.

18:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

Referenced by MOCK_BASE_CLASS().

◆ OnKifaceStart()

bool kiface::OnKifaceStart ( PGM_BASE aProgram,
int  aCtlBits 
)
override

Definition at line 6 of file test_app_main.cpp.

18 :
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html

◆ Pgm()

PGM_BASE & Pgm ( )

The global Program "get" accessor.

Implemented in: 1) common/single_top.cpp, 2) kicad/kicad.cpp, and 3) scripting/kiway.i

Definition at line 116 of file cvpcb.cpp.

117{
118 wxASSERT( process ); // KIFACE_GETTER has already been called.
119 return *process;
120}
static PGM_BASE * process
Definition: cvpcb.cpp:101

References process.

◆ PgmOrNull()

PGM_BASE * PgmOrNull ( )

similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from a script, not from a kicad appl

Definition at line 125 of file cvpcb.cpp.

126{
127 return process;
128}

References process.

Referenced by BOARD_ADAPTER::BOARD_ADAPTER(), DS_DRAW_ITEM_LIST::BuildFullText(), BOARD::ComputeBoundingBox(), LIB_PIN::LIB_PIN(), KIGFX::PCB_RENDER_SETTINGS::LoadColors(), and ACTION_PLUGINS::register_action().

Variable Documentation

◆ aKIWAYversion

int aKIWAYversion

Definition at line 109 of file cvpcb.cpp.

◆ aProgram

int PGM_BASE* aProgram
Initial value:

Definition at line 109 of file cvpcb.cpp.

Referenced by KIFACE_GETTER(), CV::IFACE::OnKifaceStart(), and KIGFX::SHADER::programInfo().

◆ GFootprintList

FOOTPRINT_LIST_IMPL GFootprintList

The global footprint info table.

This is performance-intensive to build so we keep a hash-stamped global version. Any deviation from the request vs. stored hash will result in it being rebuilt.

Definition at line 140 of file cvpcb.cpp.

Referenced by CV::IFACE::IfaceOrAddress().

◆ GFootprintTable

FP_LIB_TABLE GFootprintTable

The global footprint library table.

This is not dynamically allocated because in a multiple project environment we must keep its address constant (since it is the fallback table for multiple projects).

Definition at line 134 of file cvpcb.cpp.

Referenced by PCB_BASE_EDIT_FRAME::AddLibrary(), PCB_BASE_EDIT_FRAME::createNewLibrary(), FOOTPRINT_TREE_PANE::FOOTPRINT_TREE_PANE(), FP_TREE_SYNCHRONIZING_ADAPTER::GetLibrariesCount(), FP_TREE_SYNCHRONIZING_ADAPTER::GetValue(), CV::IFACE::IfaceOrAddress(), InvokePcbLibTableEditor(), CV::IFACE::OnKifaceStart(), PCB_BASE_EDIT_FRAME::selectLibTable(), and DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG::TransferDataFromWindow().

◆ kiface

◆ process

PGM_BASE* process
static

Definition at line 101 of file cvpcb.cpp.

Referenced by Pgm(), and PgmOrNull().