109#define KIFACE_VERSION 1
110#define KIFACE_GETTER KIFACE_1
114#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" )
121 #define LIB_ENV_VAR wxT( "PATH" )
123 #error Platform support missing
131class wxTopLevelWindow;
174#define KFCTL_STANDALONE ( 1 << 0 )
175#define KFCTL_CPP_PROJECT_SUITE ( 1 << 1 )
176#define KFCTL_CLI ( 1 << 2 )
225 KIWAY* aKIWAY,
int aCtlBits = 0 ) = 0;
233 const wxString& srcProjectName,
234 const wxString& newProjectBasePath,
235 const wxString& newProjectName,
236 const wxString& srcFilePath,
258 virtual void GetActions( std::vector<TOOL_ACTION*>& aActions )
const = 0;
275 *aError = wxS(
"OpenDocument is not implemented for this face" );
285 *aError = wxS(
"CloseDocument is not implemented for this face" );
366 static FACE_T KifaceType(
FRAME_T aFrameType );
376 virtual KIFACE* KiFACE( FACE_T aFaceId,
bool doLoad =
true );
398 wxTopLevelWindow* aParent =
nullptr );
408 virtual bool PlayerClose(
FRAME_T aFrameType,
bool doForce );
419 virtual bool PlayersClose(
bool doForce );
424 void PlayerDidClose(
FRAME_T aFrameType );
432 virtual void ExpressMail(
FRAME_T aDestination,
MAIL_T aCommand, std::string& aPayload,
433 wxWindow* aSource =
nullptr,
bool aFromOtherThread =
false );
438 virtual void GetActions( std::vector<TOOL_ACTION*>& aActions )
const;
456 virtual void SetLanguage(
int aLanguage );
463 virtual void CommonSettingsChanged(
int aFlags = 0 );
469 void ClearFileHistory();
477 KIWAY(
int aCtlBits, wxFrame* aTop =
nullptr );
491 void SetTop( wxFrame* aTop );
498 bool ProcessEvent( wxEvent& aEvent )
override;
500 void QueueEvent( wxEvent* aEvent )
override;
504 bool ProcessJobConfigDialog(
KIWAY::FACE_T aFace,
JOB* aJob, wxWindow* aWindow );
508 wxString* aError =
nullptr );
510 bool ProcessApiCloseDocument(
KIWAY::FACE_T aFace,
const wxString& aPath,
512 wxString* aError =
nullptr );
518 wxWindow* GetBlockingDialog();
520 void SetBlockingDialog( wxWindow* aWin );
524 const wxString dso_search_path( FACE_T aFaceId );
543 static std::array<KIFACE*,KIWAY_FACE_COUNT>
m_kiface;
584#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...
void SetCtlBits(int aCtlBits)
Overwrites previously set ctl bits, only for use in kicad.cpp to flip between standalone and manager ...
LOCAL_HISTORY * m_local_history
wxWindowID m_blockingDialog
bool set_kiface(FACE_T aFaceType, KIFACE *aKiface)
static std::array< KIFACE *, KIWAY_FACE_COUNT > m_kiface
bool HasBlockingDialog() const
friend struct PGM_SINGLE_TOP
FACE_T
Known KIFACE implementations.
static std::array< int, KIWAY_FACE_COUNT > m_kiface_version
std::atomic< wxWindowID > m_playerFrameId[KIWAY_PLAYER_COUNT]
KIWAY(int aCtlBits, wxFrame *aTop=nullptr)
LOCAL_HISTORY & LocalHistory()
Return the LOCAL_HISTORY associated with this KIWAY.
A logical library item identifier and consists of various portions much like a URI.
Simple local history manager built on libgit2.
Container for data for KiCad programs.
A progress reporter interface for use in multi-threaded environments.
Container for project specific data.
A pure virtual class used to derive REPORTER objects from.
void ProjectChanged() override
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...
KIWAY Kiway(KFCTL_STANDALONE)
wxString path
File path (KIND::FILE_KIND) or project path (KIND::FPID_KIND).
LIB_ID libId
Library identifier; valid when kind == KIND::FPID_KIND.
@ FPID_KIND
Open the library element named by libId.
@ FILE_KIND
Open the file at path.
@ CREATE_KIND
Create a new document at path and open it (in memory, not persisted)
Implement a participant in the KIWAY alchemy.
virtual bool HandleJobConfig(JOB *aJob, wxWindow *aParent)
virtual wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKIWAY, int aCtlBits=0)=0
Create a wxWindow for the current project.
virtual bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway)=0
Called just once shortly after the DSO is loaded.
virtual void ProjectChanged()
virtual void OnKifaceEnd()=0
Called just once just before the DSO is to be unloaded.
virtual void PreloadLibraries(KIWAY *aKiway)
virtual void RegisterLibraryHandlers(KICAD_API_SERVER *aServer)
Register this face's library API handlers on the given server.
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 bool HandleApiCloseDocument(const wxString &aBoardFileName, KICAD_API_SERVER *aServer, wxString *aError)
virtual bool HandleApiOpenDocument(const DOCUMENT_SPEC &aSpec, KICAD_API_SERVER *aServer, wxString *aError)
virtual void CancelPreload(bool aBlock=true)
virtual int HandleJob(JOB *aJob, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter)
virtual bool LoadAllLibraries()
Starts a background load of all libraries of the type owned by this face.