|
KiCad PCB EDA Suite
|
Implement a participant in the KIWAY alchemy. More...
#include <kiway.h>
Classes | |
| struct | DOCUMENT_SPEC |
Public Member Functions | |
| virtual | ~KIFACE () throw () |
| virtual bool | OnKifaceStart (PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway)=0 |
| Called just once shortly after the DSO is loaded. | |
| virtual void | OnKifaceEnd ()=0 |
| Called just once just before the DSO is to be unloaded. | |
| virtual void | Reset ()=0 |
| Reloads global state. | |
| virtual wxWindow * | CreateKiWindow (wxWindow *aParent, int aClassId, KIWAY *aKIWAY, int aCtlBits=0)=0 |
| Create a wxWindow for the current project. | |
| 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). | |
| virtual void * | IfaceOrAddress (int aDataId)=0 |
| Return pointer to the requested object. | |
| virtual void | GetActions (std::vector< TOOL_ACTION * > &aActions) const =0 |
| Append this Kiface's registered actions to the given list. | |
| virtual int | HandleJob (JOB *aJob, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter) |
| virtual bool | HandleJobConfig (JOB *aJob, wxWindow *aParent) |
| virtual bool | HandleApiOpenDocument (const DOCUMENT_SPEC &aSpec, KICAD_API_SERVER *aServer, wxString *aError) |
| virtual bool | HandleApiCloseDocument (const DOCUMENT_SPEC &aSpec, KICAD_API_SERVER *aServer, wxString *aError) |
Close the document identified by aSpec. | |
| virtual void | PreloadLibraries (KIWAY *aKiway) |
| virtual void | CancelPreload (bool aBlock=true) |
| virtual void | ProjectChanged () |
| virtual void | RegisterLibraryHandlers (KICAD_API_SERVER *aServer) |
| Register this face's library API handlers on the given server. | |
| virtual bool | LoadAllLibraries () |
| Starts a background load of all libraries of the type owned by this face. | |
Implement a participant in the KIWAY alchemy.
KIWAY is a minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad process. It makes it possible to call between DSOs without having to link them together. Most all calls are via virtual functions which means C++ vtables are used to hold function pointers and eliminate the need to link to specific object code libraries. There is one KIWAY in the launching portion of the process for each open KiCad project. Each project has its own KIWAY. Within a KIWAY is an actual PROJECT data structure. A KIWAY also facilitates communicating between DSOs on the topic of the project in question.
|
inlinevirtual |
Reimplemented in PCB::IFACE, and SCH::IFACE.
Definition at line 300 of file kiway.h.
Referenced by KICAD_MANAGER_FRAME::CloseProject().
|
pure 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. |
Implemented in BMP2CMP::IFACE, CV::IFACE, GERBV::IFACE, IFACE, KIFACE_BASE, PCB::IFACE, PCBCALC::IFACE, PGE::IFACE, and SCH::IFACE.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
pure virtual |
Append this Kiface's registered actions to the given list.
Implemented in KIFACE_BASE.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inlinevirtual |
Close the document identified by aSpec.
KIND::FILE_KIND and KIND::CREATE_KIND address the KIFACE's file-backed document (board or schematic); KIND::LIBID_KIND addresses a library item (footprint or symbol). For LIBID_KIND the spec's libId must match the open library item; for the file kinds, an empty path means "whatever document is open".
Reimplemented in PCB::IFACE, and SCH::IFACE.
|
inlinevirtual |
Reimplemented in PCB::IFACE, and SCH::IFACE.
|
inlinevirtual |
Reimplemented in GERBV::IFACE, PCB::IFACE, and SCH::IFACE.
|
inlinevirtual |
Reimplemented in GERBV::IFACE, PCB::IFACE, and SCH::IFACE.
|
pure 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. |
Implemented in BMP2CMP::IFACE, CV::IFACE, GERBV::IFACE, IFACE, KIFACE_BASE, PCB::IFACE, PCBCALC::IFACE, PGE::IFACE, and SCH::IFACE.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), ERC_TESTER::TestFootprintLinkIssues(), and ERC_TESTER::TestPinMap().
|
inlinevirtual |
Starts a background load of all libraries of the type owned by this face.
Called by the API server's LoadAllLibraries handler after ensuring this kiface is loaded. Returns true if a load was started.
Reimplemented in PCB::IFACE, and SCH::IFACE.
|
pure virtual |
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.
Implemented in CV::IFACE, GERBV::IFACE, IFACE, KIFACE_BASE, PCB::IFACE, PCBCALC::IFACE, PGE::IFACE, and SCH::IFACE.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
pure virtual |
Called just once shortly after the DSO is loaded.
It is the second function called, immediately after the KIFACE_GETTER(). However before either of those, static C++ constructors are called. The DSO implementation should do process level initialization here, not project specific since there will be multiple projects open eventually.
| aProgram | is the process block: PGM_BASE*. |
| aCtlBits | consists of bit flags from the set of KFCTL_* #defines above. |
| aKiway |
Implemented in BMP2CMP::IFACE, CV::IFACE, GERBV::IFACE, IFACE, KIFACE_BASE, PCB::IFACE, PCBCALC::IFACE, PGE::IFACE, and SCH::IFACE.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inlinevirtual |
Reimplemented in PCB::IFACE, and SCH::IFACE.
Definition at line 298 of file kiway.h.
Referenced by SCH_EDIT_FRAME::LoadProject(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::OpenProjectFiles(), and KICAD_MANAGER_FRAME::PreloadAllLibraries().
|
inlinevirtual |
Reimplemented in PCB::IFACE, and SCH::IFACE.
|
inlinevirtual |
Register this face's library API handlers on the given server.
Called by the API server's library command handler after loading the kiface, so that library commands are available before any document is opened. The kiface retains ownership.
Reimplemented in PCB::IFACE, and SCH::IFACE.
Definition at line 309 of file kiway.h.
Referenced by CLI::API_SERVER_COMMAND::doPerform().
|
pure virtual |
Reloads global state.
Implemented in KIFACE_BASE, PCB::IFACE, and SCH::IFACE.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inlinevirtual |
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 GERBV::IFACE, PCB::IFACE, PGE::IFACE, and SCH::IFACE.
Definition at line 234 of file kiway.h.
Referenced by PROJECT_TREE_TRAVERSER::OnFile().