KiCad PCB EDA Suite
mock_pgm.cpp File Reference
#include <fctsys.h>
#include <pgm_base.h>
#include <kiface_i.h>
#include <kiway.h>
#include <kiway_player.h>

Go to the source code of this file.

Classes

struct  IFACE
 
struct  PGM_TEST_FRAME
 
class  MOCK_PLAYER
 

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
 

Function Documentation

◆ CreateWindow()

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

Definition at line 62 of file mock_pgm.cpp.

64  {
65  return NULL;
66  }
#define NULL

◆ IFACE()

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

Definition at line 51 of file mock_pgm.cpp.

64  {

◆ 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 mock_pgm.cpp.

84  {

◆ 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 118 of file mock_pgm.cpp.

119 {
120  return kiface;
121 }
IFACE KIFACE_I kiface("pcb_test_frame", KIWAY::FACE_PCB)

References kiface().

◆ OnKifaceEnd()

void kiface::OnKifaceEnd ( )
override

Definition at line 60 of file mock_pgm.cpp.

64 {

◆ OnKifaceStart()

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

Definition at line 55 of file mock_pgm.cpp.

64  {

◆ 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 104 of file mock_pgm.cpp.

105 {
106  return program;
107 }
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 112 of file mock_pgm.cpp.

113 {
114  return &program;
115 }
PGM_TEST_FRAME program

References program.

Variable Documentation

◆ program

PGM_TEST_FRAME program
static

Referenced by Pgm(), and PgmOrNull().