![]() |
KiCad PCB EDA Suite
|
A KIFACE (I)mplementation. More...
#include <kiface_i.h>
Public Member Functions | |
virtual bool | OnKifaceStart (PGM_BASE *aProgram, int aCtlBits) override=0 |
Typically start_common() is called from here. More... | |
virtual void | OnKifaceEnd () override |
Called just once just before the DSO is to be unloaded. More... | |
virtual wxWindow * | CreateWindow (wxWindow *aParent, int aClassId, KIWAY *aKIWAY, int aCtlBits=0) override=0 |
Create a wxWindow for the current project. More... | |
virtual void * | IfaceOrAddress (int aDataId) override=0 |
Return pointer to the requested object. More... | |
KIFACE_I (const char *aKifaceName, KIWAY::FACE_T aId) | |
const wxString | Name () |
APP_SETTINGS_BASE * | KifaceSettings () const |
void | InitSettings (APP_SETTINGS_BASE *aSettings) |
int | StartFlags () const |
Return whatever was passed as aCtlBits to OnKifaceStart(). More... | |
bool | IsSingle () const |
Is this KIFACE_I running under single_top? More... | |
const wxString & | GetHelpFileName () const |
Return just the basename portion of the current help file. More... | |
SEARCH_STACK & | KifaceSearch () |
Only for DSO specific 'non-library' files. More... | |
virtual void | SaveFileAs (const wxString &srcProjectBasePath, const wxString &srcProjectName, const wxString &newProjectBasePath, const wxString &newProjectName, const wxString &srcFilePath, wxString &aErrors) |
Saving a file under a different name is delegated to the various KIFACEs because the project doesn't know the internal format of the various files (which may have paths in them that need updating). More... | |
Protected Member Functions | |
bool | start_common (int aCtlBits) |
Common things to do for a top program module, during OnKifaceStart(). More... | |
void | end_common () |
Common things to do for a top program module, during OnKifaceEnd();. More... | |
Private Attributes | |
KIWAY::FACE_T | m_id |
BIN_MOD | m_bm |
int | m_start_flags |
flags provided in OnKifaceStart() More... | |
This has useful for DSOs which implement a KIFACE. It is abstract so a few functions must be implemented in derivations.
Definition at line 37 of file kiface_i.h.
|
inline |
aKifaceName | should point to a C string in permanent storage which contains the name of the DSO. Examples: "eeschema", "pcbnew", etc. This controls the name of the wxConfigBase established in m_bm, so it should be lowercase. |
aId | is the type of DSO ( #FACE_SCH, #FACE_PCB, #FACE_CVPCB, #FACE_GERBVIEW, #FACE_PL_EDITOR, #FACE_PCB_CALCULATOR, #FACE_BMP2CMP) |
Definition at line 64 of file kiface_i.h.
|
overridepure virtual |
Create a wxWindow for the current project.
The caller must cast the return value into the known type.
aParent | may be NULL or is otherwise the parent to connect under. If NULL then caller may want to connect the returned wxWindow into some hierarchy after this function returns. |
aClassId | identifies which wxFrame or wxDialog to retrieve, using a value known to the implementing KIFACE. |
aKIWAY | tells the window which KIWAY (and PROJECT) it is a participant in. |
aCtlBits | consists of bit flags from the set of KFCTL_* #defines above. |
Implements KIFACE.
Implemented in SCH::IFACE, PCB::IFACE, IFACE, GERBV::IFACE, CV::IFACE, IFACE, PGE::IFACE, IFACE, PCBCALC::IFACE, IFACE, and BMP2CMP::IFACE.
|
protected |
Common things to do for a top program module, during OnKifaceEnd();.
Definition at line 98 of file kiface_i.cpp.
References BIN_MOD::End(), and m_bm.
Referenced by OnKifaceEnd(), PCBCALC::IFACE::OnKifaceEnd(), PGE::IFACE::OnKifaceEnd(), CV::IFACE::OnKifaceEnd(), GERBV::IFACE::OnKifaceEnd(), PCB::IFACE::OnKifaceEnd(), and SCH::IFACE::OnKifaceEnd().
|
inline |
Return just the basename portion of the current help file.
Definition at line 109 of file kiface_i.h.
References m_bm, and BIN_MOD::m_help_file.
Referenced by EDA_BASE_FRAME::help_name().
|
overridepure virtual |
Return 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. Segfaults are your fault.
aDataId | identifies which object you want the address of, and consists of choices known in advance by the implementing KIFACE. |
Implements KIFACE.
Implemented in SCH::IFACE, PCB::IFACE, IFACE, GERBV::IFACE, PGE::IFACE, CV::IFACE, IFACE, PCBCALC::IFACE, IFACE, BMP2CMP::IFACE, and IFACE.
|
inline |
Definition at line 94 of file kiface_i.h.
References BIN_MOD::InitSettings(), and m_bm.
Referenced by BMP2CMP::IFACE::CreateWindow(), PCBCALC::IFACE::OnKifaceStart(), PGE::IFACE::OnKifaceStart(), CV::IFACE::OnKifaceStart(), GERBV::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), and SCH::IFACE::OnKifaceStart().
|
inline |
Is this KIFACE_I running under single_top?
Definition at line 104 of file kiface_i.h.
References KFCTL_STANDALONE, and m_start_flags.
Referenced by ACTION_MENU::AddQuitOrClose(), AskSaveBoardFileName(), SCH_EDIT_FRAME::canCloseWindow(), PCB::IFACE::CreateWindow(), SCH::IFACE::CreateWindow(), SCH_EDIT_FRAME::doAutoSave(), PCB_BASE_EDIT_FRAME::doCloseWindow(), PL_EDITOR_FRAME::OnExit(), SCH_EDIT_FRAME::OnExit(), SCH_EDIT_FRAME::OnOpenPcbnew(), PCB_EDIT_FRAME::OnQuit(), DRC_TOOL::RunTests(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), and SCH_EDIT_FRAME::SetCrossProbeConnection().
|
inline |
Only for DSO specific 'non-library' files.
(The library search path is in the PROJECT class.)
Definition at line 113 of file kiface_i.h.
References m_bm, and BIN_MOD::m_search.
Referenced by CVPCB_MAINFRAME::buildEquivalenceList(), DS_DATA_MODEL::MakeFullFileName(), DS_DATA_MODEL::MakeShortFileName(), and EDA_BASE_FRAME::sys_search().
|
inline |
Definition at line 92 of file kiface_i.h.
References m_bm, and BIN_MOD::m_config.
Referenced by EDA_BASE_FRAME::config(), BMP2CMP::IFACE::CreateWindow(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_COLOR_PICKER::DIALOG_COLOR_PICKER(), DIALOG_PRINT_GERBVIEW::DIALOG_PRINT_GERBVIEW(), DIALOG_PRINT_PCBNEW::DIALOG_PRINT_PCBNEW(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), EDA_DRAW_FRAME::loadCanvasTypeSetting(), PCBCALC::IFACE::OnKifaceStart(), PGE::IFACE::OnKifaceStart(), CV::IFACE::OnKifaceStart(), GERBV::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), SCH::IFACE::OnKifaceStart(), EDA_DRAW_FRAME::saveCanvasTypeSetting(), LIB_TREE_MODEL_ADAPTER::SaveColWidths(), and DIALOG_COLOR_PICKER::~DIALOG_COLOR_PICKER().
|
inline |
Definition at line 87 of file kiface_i.h.
References m_bm, and BIN_MOD::m_name.
|
inlineoverridevirtual |
Called just once just before the DSO is to be unloaded.
It is called before static C++ destructors are called. A default implementation is supplied.
Implements KIFACE.
Reimplemented in SCH::IFACE, PCB::IFACE, IFACE, GERBV::IFACE, CV::IFACE, PGE::IFACE, IFACE, PCBCALC::IFACE, and IFACE.
Definition at line 45 of file kiface_i.h.
References end_common().
|
overridepure virtual |
Typically start_common() is called from here.
Implements KIFACE.
Implemented in SCH::IFACE, PCB::IFACE, IFACE, GERBV::IFACE, CV::IFACE, PGE::IFACE, IFACE, PCBCALC::IFACE, IFACE, IFACE, and BMP2CMP::IFACE.
|
inlinevirtualinherited |
Saving a file under a different name is delegated to the various KIFACEs because the project doesn't know the internal format of the various files (which may have paths in them that need updating).
Reimplemented in SCH::IFACE, PCB::IFACE, GERBV::IFACE, and PGE::IFACE.
Definition at line 208 of file kiway.h.
Referenced by SAVE_AS_TRAVERSER::OnFile().
|
protected |
Common things to do for a top program module, during OnKifaceStart().
Definition at line 88 of file kiface_i.cpp.
References BIN_MOD::Init(), m_bm, m_id, BIN_MOD::m_search, m_start_flags, and setSearchPaths().
Referenced by BMP2CMP::IFACE::OnKifaceStart(), PCBCALC::IFACE::OnKifaceStart(), IFACE::OnKifaceStart(), PGE::IFACE::OnKifaceStart(), CV::IFACE::OnKifaceStart(), GERBV::IFACE::OnKifaceStart(), PCB::IFACE::OnKifaceStart(), and SCH::IFACE::OnKifaceStart().
|
inline |
Return whatever was passed as aCtlBits to OnKifaceStart().
Definition at line 99 of file kiface_i.h.
References m_start_flags.
|
private |
Definition at line 118 of file kiface_i.h.
Referenced by end_common(), GetHelpFileName(), InitSettings(), KifaceSearch(), KifaceSettings(), Name(), and start_common().
|
private |
Definition at line 116 of file kiface_i.h.
Referenced by start_common().
|
private |
flags provided in OnKifaceStart()
Definition at line 120 of file kiface_i.h.
Referenced by IsSingle(), start_common(), and StartFlags().