KiCad PCB EDA Suite
mock_pgm.cpp File Reference
#include <pgm_base.h>
#include <kiface_i.h>
#include <kiway.h>
#include <kiway_player.h>
#include <wx/app.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 ()
 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...
 
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.

65  {
66  return NULL;
#define NULL

◆ IFACE()

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

Definition at line 51 of file mock_pgm.cpp.

65  {

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

85  {

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

120 {
121  return kiface;
122 }
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.

65 {

◆ OnKifaceStart()

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

Definition at line 55 of file mock_pgm.cpp.

65  {

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

106 {
107  return program;
108 }
PGM_TEST_FRAME program

References program.

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

114 {
115  return &program;
116 }
PGM_TEST_FRAME program

References program.

Variable Documentation

◆ program

PGM_TEST_FRAME program
static

Referenced by Pgm(), and PgmOrNull().