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 <cvpcb_settings.h>
#include <display_footprints_frame.h>
#include <kiface_ids.h>

Go to the source code of this file.


struct  CV::IFACE




 IFACE (const char *aName, KIWAY::FACE_T aType)
bool OnKifaceStart (PGM_BASE *aProgram, int aCtlBits) override
void OnKifaceEnd () override
wxWindow * CreateWindow (wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
void * IfaceOrAddress (int aDataId) override
 Return a pointer to the requested object. More...
 Global KIFACE_BASE "get" accessor. More...
 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...


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

Function Documentation

◆ CreateWindow()

wxWindow* kiface::CreateWindow ( wxWindow *  aParent,
int  aClassId,
KIWAY aKiway,
int  aCtlBits = 0 

Definition at line 208 of file cvpcb.cpp.


kiface::IFACE ( const char *  aName,

Definition at line 200 of file cvpcb.cpp.

◆ IfaceOrAddress()

void* kiface::IfaceOrAddress ( int  aDataId)

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.

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

Definition at line 229 of file cvpcb.cpp.

◆ 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 CV::kiface().

◆ MY_API()


◆ OnKifaceEnd()

void kiface::OnKifaceEnd ( )

Definition at line 47 of file mocks_eeschema.cpp.

47  {
48  return true;
49  }

◆ OnKifaceStart()

bool kiface::OnKifaceStart ( PGM_BASE aProgram,
int  aCtlBits 

Definition at line 40 of file common_mocks.cpp.

40 {
41  static PGM_TEST_FRAME program;
42  return program;
43 }

◆ 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 }
static PGM_BASE * process
Definition: cvpcb.cpp:101

Referenced by BOARD_ADAPTER::BOARD_ADAPTER(), DS_DRAW_ITEM_LIST::BuildFullText(), BOARD::ComputeBoundingBox(), LIB_PIN::LIB_PIN(), 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:
Container for data for KiCad programs.
Definition: pgm_base.h:93
static PGM_BASE * process
Definition: cvpcb.cpp:101
int PGM_BASE * aProgram
Definition: cvpcb.cpp:110

Definition at line 110 of file cvpcb.cpp.

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

◆ 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

return& kiface

Definition at line 112 of file cvpcb.cpp.

◆ process

PGM_BASE* process

Definition at line 101 of file cvpcb.cpp.

Referenced by Pgm(), and PgmOrNull().