110#define KIFACE_VERSION 1
111#define KIFACE_GETTER KIFACE_1
115#define KIFACE_INSTANCE_NAME_AND_VERSION "KIFACE_1"
118#if defined(__linux__) || defined(__FreeBSD__)
119 #define LIB_ENV_VAR wxT( "LD_LIBRARY_PATH" )
120#elif defined(__WXMAC__)
121 #define LIB_ENV_VAR wxT( "DYLD_LIBRARY_PATH" )
123 #define LIB_ENV_VAR wxT( "PATH" )
125 #error Platform support missing
134class wxTopLevelWindow;
158#define KFCTL_STANDALONE ( 1 << 0 )
159#define KFCTL_CPP_PROJECT_SUITE ( 1 << 1 )
160#define KFCTL_CLI ( 1 << 2 )
209 KIWAY* aKIWAY,
int aCtlBits = 0 ) = 0;
217 const wxString& srcProjectName,
218 const wxString& newProjectBasePath,
219 const wxString& newProjectName,
220 const wxString& srcFilePath,
242 virtual void GetActions( std::vector<TOOL_ACTION*>& aActions )
const = 0;
338 wxTopLevelWindow* aParent =
nullptr );
368 wxWindow* aSource =
nullptr );
373 virtual void GetActions( std::vector<TOOL_ACTION*>& aActions )
const;
415 void SetTop( wxFrame* aTop );
439 void player_destroy_handler( wxWindowDestroyEvent& event );
505#if defined(BUILD_KIWAY_DLL)
An simple container class that lets us dispatch output jobs to kifaces.
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
const wxString dso_search_path(FACE_T aFaceId)
Get the [path &] name of the DSO holding the requested FACE_T.
int ProcessJob(KIWAY::FACE_T aFace, JOB *job)
void SetCtlBits(int aCtlBits)
Overwrites previously set ctl bits, only for use in kicad.cpp to flip between standalone and manager ...
void SetBlockingDialog(wxWindow *aWin)
virtual bool PlayerClose(FRAME_T aFrameType, bool doForce)
Call the KIWAY_PLAYER::Close( bool force ) function on the window and if not vetoed,...
static FACE_T KifaceType(FRAME_T aFrameType)
A simple mapping function which returns the FACE_T which is known to implement aFrameType.
wxWindowID m_blockingDialog
bool set_kiface(FACE_T aFaceType, KIFACE *aKiface)
wxWindow * GetBlockingDialog()
Gets the window pointer to the blocking dialog (to send it signals)
static KIFACE * m_kiface[KIWAY_FACE_COUNT]
virtual void SetLanguage(int aLanguage)
Change the language and then calls ShowChangedLanguage() on all #KIWAY_PLAYERs.
virtual KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Return the KIFACE* given a FACE_T.
FACE_T
Known KIFACE implementations.
static int m_kiface_version[KIWAY_FACE_COUNT]
KIWAY_PLAYER * GetPlayerFrame(FRAME_T aFrameType)
bool ProcessEvent(wxEvent &aEvent) override
virtual bool PlayersClose(bool doForce)
Call the KIWAY_PLAYER::Close( bool force ) function on all the windows and if none are vetoed,...
std::atomic< wxWindowID > m_playerFrameId[KIWAY_PLAYER_COUNT]
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
virtual void GetActions(std::vector< TOOL_ACTION * > &aActions) const
Append all registered actions to the given list.
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 ProjectChanged()
Calls ProjectChanged() on all KIWAY_PLAYERs.
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
Container for data for KiCad programs.
Container for project specific data.
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
KIFACE * KIFACE_GETTER_FUNC(int *aKIFACEversion, int aKIWAYversion, PGM_BASE *aProgram)
Point to the one and only KIFACE export.
MAIL_T
The set of mail types sendable via KIWAY::ExpressMail() and supplied as the aCommand parameter to tha...
Implement a participant in the KIWAY alchemy.
virtual wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKIWAY, int aCtlBits=0)=0
Create a wxWindow for the current project.
virtual void OnKifaceEnd()=0
Called just once just before the DSO is to be unloaded.
virtual void * IfaceOrAddress(int aDataId)=0
Return pointer to the requested object.
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 ...
virtual void Reset()=0
Reloads global state.
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)
virtual bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits)=0
Called just once shortly after the DSO is loaded.
Struct PGM_SINGLE_TOP implements PGM_BASE with its own OnPgmInit() and OnPgmExit().