26 #include <wx/snglinst.h> 52 wxWindow*
CreateWindow( wxWindow* aParent,
int aClassId,
KIWAY* aKiway,
int aCtlBits = 0 )
override 92 void SaveFileAs(
const wxString& aProjectBasePath,
const wxString& aSrcProjectName,
93 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
94 const wxString& aSrcFilePath, wxString& aErrors )
override;
145 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
146 const wxString& aSrcFilePath, wxString& aErrors )
148 wxFileName destFile( aSrcFilePath );
149 wxString destPath = destFile.GetPathWithSep();
150 wxUniChar pathSep = wxFileName::GetPathSeparator();
151 wxString ext = destFile.GetExt();
153 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
155 destPath.Replace( aProjectBasePath, aNewProjectBasePath,
false );
156 destFile.SetPath( destPath );
159 if( ext ==
"kicad_wks" )
161 if( destFile.GetName() == aSrcProjectName )
162 destFile.SetName( aNewProjectName );
164 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
168 wxFAIL_MSG(
"Unexpected filetype for Pcbnew::SaveFileAs()" );
virtual SETTINGS_MANAGER & GetSettingsManager() const
A KIFACE (I)mplementation.
bool start_common(int aCtlBits)
Common things to do for a top program module, during OnKifaceStart().
This file is part of the common library TODO brief description.
IFACE(const char *aName, KIWAY::FACE_T aType)
This file is part of the common library.
Container for data for KiCad programs.
PL_EDITOR_FRAME is the main window used in the drawing sheet editor.
MY_API(KIFACE *) KIFACE_GETTER(int *aKIFACEversion
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
APP_SETTINGS_BASE * KifaceSettings() const
void * IfaceOrAddress(int aDataId) override
Function IfaceOrAddress return a pointer to the requested object.
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
void SaveFileAs(const wxString &aProjectBasePath, const wxString &aSrcProjectName, const wxString &aNewProjectBasePath, const wxString &aNewProjectName, const wxString &aSrcFilePath, wxString &aErrors) override
Function SaveFileAs Saving a file under a different name is delegated to the various KIFACEs because ...
void end_common()
Common things to do for a top program module, during OnKifaceEnd();.
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
static PGM_BASE * process
FACE_T
Known KIFACE implementations.
JSON_SETTINGS * RegisterSettings(JSON_SETTINGS *aSettings, bool aLoadNow=true)
Takes ownership of the pointer passed in.
wxWindow * CreateWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
PGE::IFACE KIFACE_I kiface("pl_editor", KIWAY::FACE_PL_EDITOR)
Implement a participant in the KIWAY alchemy.
void InitSettings(APP_SETTINGS_BASE *aSettings)
PGM_BASE & Pgm()
The global Program "get" accessor.
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
Typically start_common() is called from here.