KiCad PCB EDA Suite
|
#include <atomic>
#include <wx/defs.h>
#include <wx/event.h>
#include <import_export.h>
#include <search_stack.h>
#include <project.h>
#include <frame_type.h>
#include <mail_type.h>
#include <ki_exception.h>
Go to the source code of this file.
Classes | |
struct | KIFACE |
Implement a participant in the KIWAY alchemy. More... | |
class | KIWAY |
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad process. More... | |
Macros | |
#define | KIFACE_VERSION 1 |
The KIWAY and KIFACE classes are used to communicate between various process modules, all residing within a single process. | |
#define | KIFACE_GETTER KIFACE_1 |
#define | KIFACE_INSTANCE_NAME_AND_VERSION "KIFACE_1" |
#define | KFCTL_STANDALONE ( 1 << 0 ) |
Running as a standalone Top. | |
#define | KFCTL_CPP_PROJECT_SUITE ( 1 << 1 ) |
Running under C++ project mgr, possibly with others. | |
#define | KFCTL_CLI ( 1 << 2 ) |
Running as CLI app. | |
Typedefs | |
typedef KIFACE * | KIFACE_GETTER_FUNC(int *aKIFACEversion, int aKIWAYversion, PGM_BASE *aProgram) |
Point to the one and only KIFACE export. | |
Functions | |
KIFACE * | KIFACE_GETTER (int *aKIFACEversion, int aKIWAYversion, PGM_BASE *aProgram) |
No name mangling. Each KIFACE (DSO/DLL) will implement this once. | |
Variables | |
KIWAY | Kiway |
#define KFCTL_CPP_PROJECT_SUITE ( 1 << 1 ) |
#define KFCTL_STANDALONE ( 1 << 0 ) |
#define KIFACE_VERSION 1 |
The KIWAY and KIFACE classes are used to communicate between various process modules, all residing within a single process.
The program modules are either top level like an *.exe or subsidiary like a *.dll. In much of the documentation the term DSO is used to refer to the *.dll portions, that is the term used on linux. But it should be taken to mean DLL on Windows.
These are a couple of reasons why this design was chosen:
By using DSOs within a single process, it is not necessary to use IPC. The DSOs can send wxEvents between themselves using wxEvtHandler interfaces in a platform independent way. There can also be function calls from one DSO to another.
The use of a number of separately linked DSOs closely resembles the original KiCad program design, consisting of Eeschema and Pcbnew. But it also allows separate compilation and linking of those two DSOs without a ton of inter-DSO dependencies and common data structures. Linking smaller, purpose specific DSOs is thought to be better for maintenance simplicity than a large single link image.
By keeping the core functionality in DSOs rather than EXE tops, it becomes possible to re-use the DSOs under different program tops. For example, a DSO named _pcbnew.so can be used under a C++ top or under a python top. Only one CMake target must be defined to build either. Whether that is a separate build or not is not the important thing. Simply having a single CMake target has advantages. (Each builder person will have his/her own intentions relative to use of python or not.) Once a DSO is python capable, it can be driven by any number of python program tops, including demo-ing (automation) and testing separately.
All KiCad source code is UTF8 encoded by law, so make sure your editor is set as such! As such, it is OK to use UTF8 characters:
┏ ┗ ┓ ┛ ━ ┃
┏━━━process top━━━━━┓ ┃ ┃ wxEvent channels ┏━━━━━━━━━━━━━━━━━━━-━[KIWAY project 1]━-━━━━━━━━━━━━━━━━━━━━━━┓ ┃ ┃ ┃ ┃ ┃ ┏━━━━━━━━━━━━━-━[KIWAY project 2]━-━━━━━━━━━━┓ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┏━-━[KIWAY project 3]━-━┓ ┃ ┃ ┃ ┃ ┃ ┗━━━━━━━━━━━━━━━━━━━┛ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┏━━━━━━━━|━━━━━|━━━━━━━━━━━|━━━━━━━━━┓ ┏━━━━━━━━|━━━━━━━━|━━━━━━━━━━━|━━━━━┓ ┃ KIFACE ┃ ┃ ┃ ┃ ┃ KIFACE ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃┏━━━━━━━+━┓ ┏━+━━━━━━━┓ ┏━+━━━━━━━┓ ┃ ┃┏━━━━━━━+━┓ ┏━━━━+━━━━┓ ┏━━━━+━━━━┓┃ ┃┃wxFrame ┃ ┃wxFrame ┃ ┃wxFrame ┃ ┃ ┃┃wxFrame ┃ ┃wxFrame ┃ ┃wxFrame ┃┃ ┃┃project 1┃ ┃project 2┃ ┃project 3┃ ┃ ┃┃project 3┃ ┃project 2┃ ┃project 1┃┃ ┃┗━━━━━━━━━┛ ┗━━━━━━━━━┛ ┗━━━━━━━━━┛ ┃ ┃┗━━━━━━━━━┛ ┗━━━━━━━━━┛ ┗━━━━━━━━━┛┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗━━━━━━ eeschema DSO ━━━━━━━━━━━━━━━━┛ ┗━━━━━━ pcbnew DSO ━━━━━━━━━━━━━━━━━┛
Point to the one and only KIFACE export.
The export's address is looked up via symbolic string and should be extern "C" to avoid name mangling. This function will only be called one time. The DSO itself however may be asked to support multiple Top windows, i.e. multiple projects within its lifetime.
aKIFACEversion | is where to put the API version implemented by the KIFACE. |
aKIWAYversion | tells the KIFACE what KIWAY version will be available. |
aProgram | is a pointer to the PGM_BASE for this process. |
No name mangling. Each KIFACE (DSO/DLL) will implement this once.
Definition at line 81 of file bitmap2cmp_main.cpp.
References BMP2CMP::kiface(), CV::kiface(), SCH::kiface(), GERBV::kiface(), PCBCALC::kiface(), PCB::kiface(), and PGE::kiface().
|
extern |