99 #include <wx/dynlib.h> 108 #define KIFACE_VERSION 1 109 #define KIFACE_GETTER KIFACE_1 113 #define KIFACE_INSTANCE_NAME_AND_VERSION "KIFACE_1" 116 #if defined(__linux__) || defined(__FreeBSD__) 117 #define LIB_ENV_VAR wxT( "LD_LIBRARY_PATH" ) 118 #elif defined(__WXMAC__) 119 #define LIB_ENV_VAR wxT( "DYLD_LIBRARY_PATH" ) 120 #elif defined(_WIN32) 121 #define LIB_ENV_VAR wxT( "PATH" ) 123 #error Platform support missing 132 class wxTopLevelWindow;
155 #define KFCTL_STANDALONE (1<<0) 156 #define KFCTL_CPP_PROJECT_SUITE (1<<1) 157 #define KFCTL_PY_PROJECT_SUITE (1<<2) 200 virtual wxWindow*
CreateWindow( wxWindow* aParent,
int aClassId,
201 KIWAY* aKIWAY,
int aCtlBits = 0 ) = 0;
209 const wxString& srcProjectName,
210 const wxString& newProjectBasePath,
211 const wxString& newProjectName,
212 const wxString& srcFilePath,
319 wxTopLevelWindow* aParent =
nullptr );
349 wxWindow* aSource =
nullptr );
385 void SetTop( wxFrame* aTop );
398 void player_destroy_handler( wxWindowDestroyEvent& event );
463 #if defined(BUILD_KIWAY_DLL) virtual wxWindow * CreateWindow(wxWindow *aParent, int aClassId, KIWAY *aKIWAY, int aCtlBits=0)=0
Create a wxWindow for the current project.
virtual bool PlayersClose(bool doForce)
Call the KIWAY_PLAYER::Close( bool force ) function on all the windows and if none are vetoed,...
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Struct PGM_SINGLE_TOP implements PGM_BASE with its own OnPgmInit() and OnPgmExit().
Container for project specific data.
static FACE_T KifaceType(FRAME_T aFrameType)
A simple mapping function which returns the FACE_T which is known to implement aFrameType.
KIWAY_PLAYER * GetPlayerFrame(FRAME_T aFrameType)
Container for data for KiCad programs.
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
virtual void SetLanguage(int aLanguage)
Change the language and then calls ShowChangedLanguage() on all #KIWAY_PLAYERs.
bool set_kiface(FACE_T aFaceType, KIFACE *aKiface)
MAIL_T
The set of mail types sendable via KIWAY::ExpressMail() and supplied as the aCommand parameter to tha...
virtual bool PlayerClose(FRAME_T aFrameType, bool doForce)
Call the KIWAY_PLAYER::Close( bool force ) function on the window and if not vetoed,...
bool ProcessEvent(wxEvent &aEvent) override
KIFACE * KIFACE_GETTER_FUNC(int *aKIFACEversion, int aKIWAYversion, PGM_BASE *aProgram)
Point to the one and only KIFACE export.
virtual void ProjectChanged()
Calls ProjectChanged() on all KIWAY_PLAYERs.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
const wxString dso_search_path(FACE_T aFaceId)
Get the [path &] name of the DSO holding the requested FACE_T.
virtual KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Return the KIFACE* given a FACE_T.
void SetTop(wxFrame *aTop)
Tell this KIWAY about the top most frame in the program and optionally allows it to play the role of ...
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 ...
FACE_T
Known KIFACE implementations.
virtual void * IfaceOrAddress(int aDataId)=0
Return pointer to the requested object.
Implement a participant in the KIWAY alchemy.
KIWAY(PGM_BASE *aProgram, int aCtlBits, wxFrame *aTop=nullptr)
static int m_kiface_version[KIWAY_FACE_COUNT]
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
wxArrayString m_playerFrameName
virtual void OnKifaceEnd()=0
Called just once just before the DSO is to be unloaded.
static KIFACE * m_kiface[KIWAY_FACE_COUNT]
virtual bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits)=0
Called just once shortly after the DSO is loaded.