KiCad PCB EDA Suite
pcb_calculator.cpp File Reference

Go to the source code of this file.

Classes

struct  PCBCALC::IFACE
 

Namespaces

 PCBCALC
 

Functions

const wxString PcbCalcDataFileExt (wxT("pcbcalc"))
 
PCBCALC::IFACE KIFACE_BASE PCBCALC::kiface ("pcb_calculator", KIWAY::FACE_PCB_CALCULATOR)
 
 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...
 
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
 

Function Documentation

◆ CreateWindow()

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

Definition at line 124 of file pcb_calculator.cpp.

◆ IFACE()

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

Definition at line 116 of file pcb_calculator.cpp.

◆ 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 requested object and must be cast into the know type.

Definition at line 140 of file pcb_calculator.cpp.

◆ Kiface()

KIFACE_BASE& Kiface ( )

Global KIFACE_BASE "get" accessor.

Definition at line 78 of file pcb_calculator.cpp.

78 { return kiface; }
return & kiface

References PCBCALC::kiface().

◆ MY_API()

MY_API ( KIFACE )

◆ OnKifaceEnd()

void kiface::OnKifaceEnd ( )
override

Definition at line 47 of file mocks_eeschema.cpp.

47  {
48  return true;
49  }

◆ OnKifaceStart()

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

Definition at line 40 of file common_mocks.cpp.

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

◆ PcbCalcDataFileExt()

const wxString PcbCalcDataFileExt ( wxT("pcbcalc")  )

◆ 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 90 of file pcb_calculator.cpp.

91 {
92  wxASSERT( process ); // KIFACE_GETTER has already been called.
93  return *process;
94 }
static PGM_BASE * process

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 98 of file pcb_calculator.cpp.

99 {
100  return process;
101 }
static PGM_BASE * process

References process.

Variable Documentation

◆ aKiwayVersion

int aKiwayVersion

Definition at line 83 of file pcb_calculator.cpp.

◆ aProgram

int PGM_BASE* aProgram
Initial value:
{
Container for data for KiCad programs.
Definition: pgm_base.h:93
static PGM_BASE * process
int PGM_BASE * aProgram

Definition at line 84 of file pcb_calculator.cpp.

Referenced by PCBCALC::IFACE::OnKifaceStart().

◆ kiface

return& kiface

Definition at line 86 of file pcb_calculator.cpp.

◆ process

PGM_BASE* process
static

Definition at line 75 of file pcb_calculator.cpp.

Referenced by Pgm(), and PgmOrNull().