KiCad PCB EDA Suite
mocks.cpp File Reference
#include <fctsys.h>
#include <pgm_base.h>
#include <kiface_i.h>
#include <confirm.h>
#include <pcb_edit_frame.h>
#include <eda_dde.h>
#include <wx/file.h>
#include <wx/snglinst.h>
#include <class_board.h>
#include <fp_lib_table.h>
#include <footprint_viewer_frame.h>
#include <footprint_wizard_frame.h>
#include <class_drawsegment.h>
#include <class_pcb_text.h>
#include <class_pcb_target.h>
#include <class_module.h>
#include <class_dimension.h>
#include <class_zone.h>
#include <class_edge_mod.h>
#include <tools/pcb_actions.h>
#include <router/router_tool.h>
#include <dialog_find.h>
#include <dialog_filter_selection.h>

Go to the source code of this file.

Classes

struct  IFACE
 
struct  PGM_TEST_FRAME
 

Functions

IFACE KIFACE_I kiface ("pcb_test_frame", KIWAY::FACE_PCB)
 
 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
 Function IfaceOrAddress return a pointer to the requested object. More...
 
PGM_BASEPgm ()
 The global Program "get" accessor. More...
 
PGM_BASEPgmOrNull ()
 similat 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...
 
KIFACE_IKiface ()
 Global KIFACE_I "get" accessor. More...
 

Variables

PGM_TEST_FRAME program
 
FP_LIB_TABLE GFootprintTable
 !!!!!!!!!!!!!! This code is obsolete because of the merge into pcbnew, don't bother with it. More...
 

Function Documentation

◆ CreateWindow()

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

Definition at line 62 of file mocks.cpp.

62  {}
63 
64  wxWindow* CreateWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway, int aCtlBits = 0 ) override
65  {
66  assert( false );
KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the s...
Definition: kiway.h:274
wxWindow * CreateWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Definition: mocks.cpp:62

◆ IFACE()

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

Definition at line 51 of file mocks.cpp.

53  :
54  KIFACE_I( aName, aType )
KIFACE_I is a KIFACE (I)mplementation, with some features useful for DSOs which implement a KIFACE.
Definition: kiface_i.h:37

◆ IfaceOrAddress()

void* kiface::IfaceOrAddress ( int  aDataId)
override

Function IfaceOrAddress 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
void* - and must be cast into the know type.

Definition at line 79 of file mocks.cpp.

82  {

◆ kiface()

IFACE KIFACE_I kiface ( "pcb_test_frame"  ,
KIWAY::FACE_PCB   
)
static

Referenced by Kiface().

◆ Kiface()

KIFACE_I& Kiface ( )

Global KIFACE_I "get" accessor.

Definition at line 136 of file mocks.cpp.

137 {
138  return kiface;
139 }
IFACE KIFACE_I kiface("pcb_test_frame", KIWAY::FACE_PCB)

References kiface(), and BMP2CMP::kiface().

◆ OnKifaceEnd()

void kiface::OnKifaceEnd ( )
override

Definition at line 60 of file mocks.cpp.

62 {}

◆ OnKifaceStart()

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

Definition at line 55 of file mocks.cpp.

55  {}
56 
57  bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits ) override
58  {
PGM_BASE keeps program (whole process) data for KiCad programs.
Definition: pgm_base.h:156
int PGM_BASE * aProgram
Definition: cvpcb/cvpcb.cpp:95
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
Definition: mocks.cpp:55

◆ 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 122 of file mocks.cpp.

123 {
124  return program;
125 }
PGM_TEST_FRAME program

References program.

◆ PgmOrNull()

PGM_BASE* PgmOrNull ( )

similat 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 130 of file mocks.cpp.

131 {
132  return &program;
133 }
PGM_TEST_FRAME program

References process, and program.

Variable Documentation

◆ GFootprintTable

FP_LIB_TABLE GFootprintTable

!!!!!!!!!!!!!! This code is obsolete because of the merge into pcbnew, don't bother with it.

!!!!!!!!!!!!!! This code is obsolete because of the merge into pcbnew, don't bother with it.

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 142 of file mocks.cpp.

◆ program

PGM_TEST_FRAME program
static

Referenced by Pgm(), and PgmOrNull().