73#include <wx/tokenzr.h>
107static int eeschemaMergeExport(
int aKind,
const wxString& aAncestor,
const wxString& aOurs,
108 const wxString& aTheirs,
const wxString& aOutput,
bool aInteractive,
109 bool aSingleFile,
REPORTER* aReporter );
111 const wxString& aLabelA,
const wxString& aLabelB,
112 wxWindow* aParent,
REPORTER* aReporter );
123 std::unique_ptr<SCHEMATIC>
schematic = std::make_unique<SCHEMATIC>(
nullptr );
127 wxFileName pro( aFilename );
130 wxString projectPath = pro.GetFullPath();
147 std::vector<SCH_SHEET*> topLevelSheets =
schematic->GetTopLevelSheets();
148 bool rootIsTopLevel = std::find( topLevelSheets.begin(), topLevelSheets.end(), rootSheet )
149 != topLevelSheets.end();
152 if( !rootIsTopLevel && !rootIsVirtualRoot )
153 schematic->SetTopLevelSheets( { rootSheet } );
158 screen->UpdateLocalLibSymbolLinks();
165 if(
schematic->RootScreen()->GetFileFormatVersionAtLoad() < 20230221 )
168 screen->FixLegacyPowerSymbolMismatches();
172 screen->MigrateSimModels();
176 sheet.UpdateAllScreenReferences();
184 schematic->ConnectionGraph()->Recalculate( sheets,
true );
217 wxWindow* focus = wxWindow::FindFocus();
218 wxWindow*
top = focus ? wxGetTopLevelParent( focus ) : wxTheApp->GetTopWindow();
297 if( !field->GetText().IsEmpty() )
298 return field->GetText();
301 if( std::shared_ptr<LIB_SYMBOL> parent = aSymbol.
GetParent().lock() )
304 return wxEmptyString;
360 const LIB_ID& aFootprint )
370 if( !byFilter && !byField && !byPinMap )
408 return result.ToJsonStr();
416 return result.ToJsonStr();
422 return result.ToJsonStr();
439 const bool byFilter = query.
m_MatchFilters && !match->m_MatchedFilter.IsEmpty();
441 const bool byPinMap = query.
m_MatchPinMaps && !match->m_MatchedPinMaps.empty();
443 if( !byFilter && !byField && !byPinMap )
448 result.m_IsLimited =
true;
452 result.m_Matches.push_back( std::move( *match ) );
461 return result.ToJsonStr();
463 catch(
const std::exception& )
468 return result.ToJsonStr();
523 void Reset()
override;
570 bool cancelled =
false;
637 std::vector<TOOL_ACTION*> actions;
638 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
641 actions.push_back( action );
644 controls.push_back( control );
697 std::vector<TOOL_ACTION*> actions;
698 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
701 actions.push_back( action );
704 controls.push_back( control );
782 void SaveFileAs(
const wxString& aProjectBasePath,
const wxString& aProjectName,
783 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
784 const wxString& aSrcFilePath, wxString& aErrors )
override;
793 wxString* aError )
override;
800 wxString* aError )
override;
831 const wxString& aTheirs,
const wxString& aOutput,
bool aInteractive,
832 bool aSingleFile,
REPORTER* aReporter )
835 aOurs, aTheirs, aOutput, aInteractive, aSingleFile,
841 const wxString& aLabelA,
const wxString& aLabelB,
842 wxWindow* aParent,
REPORTER* aReporter )
845 aFileB, aLabelA, aLabelB, aParent, aReporter );
856 aAfter, *aDiff, aReporter );
896 m_jobHandler = std::make_unique<EESCHEMA_JOBS_HANDLER>( aKiway );
904 if(
Pgm().ApiServerOrNull() )
932 constexpr static int interval = 150;
933 constexpr static int timeLimit = 120000;
951 [
this, aKiway]() ->
void
953 std::shared_ptr<BACKGROUND_JOB_REPORTER>
reporter =
959 bool aborted =
false;
961 reporter->Report(
_(
"Loading Symbol Libraries" ) );
973 std::this_thread::sleep_for( std::chrono::milliseconds( interval ) );
977 float progress = *loadStatus;
978 reporter->SetCurrentProgress( progress );
991 if( elapsed > timeLimit )
1014 wxLogTrace(
traceLibraries,
"eeschema PreloadLibraries: aborted, skipping symbol processing" );
1023 std::string payload =
"";
1032 std::future<void> preloadFuture = std::async( std::launch::async, preload );
1062 if(
Pgm().ApiServerOrNull() )
1078 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
1079 const wxString& aSrcFilePath, wxString& aErrors )
1081 wxFileName destFile( aSrcFilePath );
1082 wxString destPath = destFile.GetPathWithSep();
1083 wxUniChar pathSep = wxFileName::GetPathSeparator();
1084 wxString ext = destFile.GetExt();
1086 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
1087 destPath.Replace( aProjectBasePath, aNewProjectBasePath,
false );
1089 destFile.SetPath( destPath );
1096 if( destFile.GetName() == aProjectName )
1098 destFile.SetName( aNewProjectName );
1100 else if( destFile.GetName() == aNewProjectName )
1104 if( !aErrors.empty() )
1105 aErrors += wxS(
"\n" );
1107 msg.Printf(
_(
"Cannot copy file '%s' as it will be overwritten by the new root "
1108 "sheet file." ), destFile.GetFullPath() );
1114 [&](
const std::string& token, wxString& value ) ->
bool
1116 if( token ==
"project" && value == aProjectName )
1118 value = aNewProjectName;
1129 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
1135 if( destFile.GetName() == aProjectName + wxS(
"-cache" ) )
1136 destFile.SetName( aNewProjectName + wxS(
"-cache" ) );
1138 if( destFile.GetName() == aProjectName + wxS(
"-rescue" ) )
1139 destFile.SetName( aNewProjectName + wxS(
"-rescue" ) );
1141 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
1145 if( destFile.GetName() == aProjectName )
1146 destFile.SetName( aNewProjectName );
1149 [&](
const std::string& token, wxString& value ) ->
bool
1151 if( token ==
"source" )
1153 for( const wxString& extension : { wxString( wxT(
".sch" ) ), wxString( wxT(
".kicad_sch" ) ) } )
1155 if( value == aProjectName + extension )
1157 value = aNewProjectName + extension;
1160 else if( value == aProjectBasePath +
"/" + aProjectName + extension )
1162 value = aNewProjectBasePath +
"/" + aNewProjectName + extension;
1165 else if( value.StartsWith( aProjectBasePath ) )
1167 value.Replace( aProjectBasePath, aNewProjectBasePath, false );
1179 wxFileName libTableFn( aSrcFilePath );
1181 libTable.SetPath( destFile.GetFullPath() );
1184 for( LIBRARY_TABLE_ROW& row : libTable.Rows() )
1186 wxString uri = row.URI();
1188 uri.Replace( wxS(
"/" ) + aProjectName + wxS(
"-cache.lib" ),
1189 wxS(
"/" ) + aNewProjectName + wxS(
"-cache.lib" ) );
1190 uri.Replace( wxS(
"/" ) + aProjectName + wxS(
"-rescue.lib" ),
1191 wxS(
"/" ) + aNewProjectName + wxS(
"-rescue.lib" ) );
1192 uri.Replace( wxS(
"/" ) + aProjectName + wxS(
".lib" ),
1193 wxS(
"/" ) + aNewProjectName + wxS(
".lib" ) );
1198 libTable.Save().map_error(
1199 [&](
const LIBRARY_ERROR& aError )
1203 if( !aErrors.empty() )
1204 aErrors += wxT(
"\n" );
1206 msg.Printf(
_(
"Cannot copy file '%s'." ), destFile.GetFullPath() );
1212 wxFAIL_MSG( wxS(
"Unexpected filetype for Eeschema::SaveFileAs()" ) );
1219 return m_jobHandler->RunJob( aJob, aReporter, aProgressReporter );
1269 wxCHECK( aServer,
false );
1271 if( aSpec.
kind == DOCUMENT_SPEC::KIND::CREATE_KIND )
1274 if( aSpec.
kind == DOCUMENT_SPEC::KIND::LIBID_KIND )
1277 if( aSpec.
path.IsEmpty() )
1280 *aError = wxS(
"No path specified to open" );
1285 wxFileName projectPath( aSpec.
path );
1292 projectPath.MakeAbsolute();
1305 if( !settingsManager.
LoadProject( projectPath.GetFullPath(),
true ) )
1306 wxLogTrace(
traceApi,
"Warning: no project file found for %s", aSpec.
path );
1314 *aError = wxString::Format( wxS(
"Error loading project for %s" ), aSpec.
path );
1319 wxFileName schPath( projectPath );
1322 if( !schPath.FileExists() )
1325 *aError = wxString::Format( wxS(
"File not found: %s" ), schPath.GetFullPath() );
1339 *aError = wxS(
"Failed to load schematic" );
1347 *aError = wxS(
"Failed to load schematic" );
1371 wxFileName schPath( aPath );
1372 schPath.MakeAbsolute();
1374 wxFileName projectPath( schPath );
1382 *aError = wxS(
"The current schematic has unsaved changes; save or revert it first" );
1398 settingsManager.
LoadProject( projectPath.GetFullPath(),
true );
1405 *aError = wxString::Format( wxS(
"Error creating project for %s" ), aPath );
1410 std::unique_ptr<SCHEMATIC>
schematic = std::make_unique<SCHEMATIC>(
project );
1414 schematic->RootScreen()->SetFileName( schPath.GetFullPath() );
1438 if( libId.
Parse( aLibIdStr ) >= 0 )
1441 *aError = wxString::Format( wxS(
"Invalid symbol LIB_ID: %s" ), aLibIdStr );
1446 wxFileName projectPath( aProjectPath );
1447 projectPath.MakeAbsolute();
1451 if( !settingsManager.
LoadProject( projectPath.GetFullPath(),
true ) )
1453 wxLogTrace(
traceApi,
"Warning: no project file found for %s", aProjectPath );
1461 *aError = wxString::Format( wxS(
"Error loading project for %s" ), aProjectPath );
1470 std::unique_ptr<LIB_SYMBOL> symbol;
1479 *aError = wxString::Format( wxS(
"Symbol not found: %s" ), aLibIdStr );
1484 symbol = std::make_unique<LIB_SYMBOL>( *loaded );
1489 *aError = wxString::Format( wxS(
"Failed to load symbol: %s" ), err.
What() );
1496 *aError = wxS(
"Failed to load symbol" );
1521 wxCHECK( aServer,
false );
1523 if( aSpec.
kind == DOCUMENT_SPEC::KIND::LIBID_KIND )
1528 *aError = wxS(
"No symbol is currently open" );
1536 *aError = wxS(
"Requested document does not match the open document" );
1548 *aError = wxS(
"No schematic is currently open" );
1553 if( !aSpec.
path.IsEmpty() )
1555 wxFileName currentSch(
m_openContext->GetCurrentFileName() );
1557 if( currentSch.GetFullName() != wxFileName( aSpec.
path ).GetFullName() )
1560 *aError = wxS(
"Requested document does not match the open document" );
1573 wxCHECK_RET( aServer,
"no API server provided" );
constexpr EDA_IU_SCALE schIUScale
static std::list< TOOL_ACTION * > & GetActionList()
Return list of TOOL_ACTIONs.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
std::shared_ptr< BACKGROUND_JOB > Create(const wxString &aName)
Creates a background job with the given name.
void Remove(std::shared_ptr< BACKGROUND_JOB > job)
Removes the given background job from any lists and frees it.
static CLI_PROGRESS_REPORTER & GetInstance()
static CLI_REPORTER & GetInstance()
static bool IsOnStandardSocketPath()
static void AnnounceToPrimary(FRAME_T aFrameType)
The base frame for deriving all KiCad main window classes.
virtual bool SetPattern(const wxString &aPattern) override
Set the pattern against which candidates will be matched.
static void SetSchEditFrame(SCH_EDIT_FRAME *aSchEditFrame)
static SCHEMATIC * LoadSchematic(const wxString &aFileName, bool aSetActive, bool aForceDefaultProject, PROJECT *aProject=nullptr, bool aCalculateConnectivity=true, REPORTER *aRootReporter=nullptr)
Handle Eeschema job dispatches.
SNAP_INFERENCE_SETTINGS m_SnapInference
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
An simple container class that lets us dispatch output jobs to kifaces.
void RegisterHandler(API_HANDLER *aHandler)
Adds a new request handler to the server.
void DeregisterHandler(API_HANDLER *aHandler)
Keeps the documents drawn on a pair of diff canvases alive.
KIFACE_BASE(const char *aKifaceName, KIWAY::FACE_T aId)
void InitSettings(APP_SETTINGS_BASE *aSettings)
void end_common()
Common things to do for a top program module, during OnKifaceEnd();.
APP_SETTINGS_BASE * KifaceSettings() const
bool start_common(int aCtlBits)
Common things to do for a top program module, during OnKifaceStart().
int m_start_flags
flags provided in OnKifaceStart()
bool IsSingle() const
Is this KIFACE running under single_top?
static int Apply(const git_merge_driver_source *aSrc, const char **aPathOut, unsigned int *aModeOut, git_buf *aMergedOut)
A mix in class which holds the location of a wxWindow's KIWAY.
bool Destroy() override
Our version of Destroy() which is virtual from wxWidgets.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
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, bool aFromOtherThread=false)
Send aPayload to aDestination from aSource.
FACE_T
Known KIFACE implementations.
virtual PROJECT & Prj() const
Return the PROJECT associated with this KIWAY.
std::optional< float > AsyncLoadProgress() const
Returns the fraction of the libraries queued by AsyncLoad() that have been processed,...
std::vector< KI_ERROR > GetLibraryLoadErrors() const
Returns all library load errors as newline-separated strings for display.
void AbortAsyncLoad()
Aborts any async load in progress; blocks until fully done aborting.
std::vector< wxString > GetLibraryNames() const
Returns a list of library nicknames that are available (skips any that failed to load)
void AsyncLoad()
Loads all available libraries for this adapter type in the background.
A logical library item identifier and consists of various portions much like a URI.
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
bool IsValid() const
Check if this LID_ID is valid.
wxString GetUniStringLibId() const
const wxString GetUniStringLibItemName() const
Get strings for display messages in dialogs.
const wxString GetUniStringLibNickname() const
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
Define a library symbol object.
const LIB_ID & GetLibId() const override
std::weak_ptr< LIB_SYMBOL > & GetParent()
int GetPinCount() const override
const std::vector< ASSOCIATED_FOOTPRINT > & GetEffectiveAssociatedFootprints() const
SCH_FIELD * GetField(const wxString &aFieldName)
Find a field within this symbol matching aFieldName; return nullptr if not found.
wxArrayString GetFPFilters() const
Generate the KiCad netlist format supported by Pcbnew.
void Format(OUTPUTFORMATTER *aOutputFormatter, int aCtl)
Output this s-expression netlist into aOutputFormatter.
Container for data for KiCad programs.
virtual BACKGROUND_JOBS_MONITOR & GetBackgroundJobMonitor() const
void AddLibraryLoadMessages(const std::vector< KI_ERROR > &aMessages)
Add library load messages to all registered status bars.
void ClearLibraryLoadMessages()
Clear library load messages from all registered status bars.
KICAD_API_SERVER & GetApiServer()
virtual SETTINGS_MANAGER & GetSettingsManager() const
A progress reporter interface for use in multi-threaded environments.
static SYMBOL_LIBRARY_ADAPTER * SymbolLibAdapter(PROJECT *aProject)
Accessor for project symbol library manager adapter.
Container for project specific data.
A pure virtual class used to derive REPORTER objects from.
Holds all the data relating to one schematic.
Schematic editor (Eeschema) main window.
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
void UpdateSymbolInstanceData(const std::vector< SCH_SYMBOL_INSTANCE > &aSymbolInstances)
Update all of the symbol instance information using aSymbolInstances.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
bool IsVirtualRootSheet() const
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Take ownership of the pointer passed in.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
PROJECT * GetProject(const wxString &aFullPath) const
Retrieve a loaded project by name.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
The SIMULATOR_FRAME holds the main user-interface for running simulations.
Simple error container for failure to init the simulation engine and ultimately abort the frame const...
Symbol library viewer main window.
SNAP_INFERENCE_SETTINGS m_SnapInference
The symbol library editor main window.
An interface to the global shared library manager that is schematic-specific and linked to one projec...
LIB_SYMBOL * LoadSymbol(const wxString &aNickname, const wxString &aName)
Load a LIB_SYMBOL having aName from the library given by aNickname.
std::vector< LIB_SYMBOL * > GetSymbols(const wxString &aNickname, SYMBOL_TYPE aType=SYMBOL_TYPE::ALL_SYMBOLS)
Symbol library viewer main window.
UNITS_PROVIDER(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits)
EDA_UNITS GetUserUnits() const
void SetUserUnits(EDA_UNITS aUnits)
This file is part of the common library.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
@ FRAME_SCH_SYMBOL_EDITOR
@ PANEL_SCH_FIELD_NAME_TEMPLATES
@ DIALOG_SCH_LIBRARY_TABLE
@ DIALOG_DESIGN_BLOCK_LIBRARY_TABLE
void CopySexprFile(const wxString &aSrcPath, const wxString &aDestPath, std::function< bool(const std::string &token, wxString &value)> aCallback, wxString &aErrors)
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
static const std::string LegacySchematicFileExtension
static const std::string NetlistFileExtension
static const std::string SymbolLibraryTableFileName
static const std::string ProjectFileExtension
static const std::string SchematicSymbolFileExtension
static const std::string KiCadSchematicFileExtension
static const std::string LegacySymbolLibFileExtension
static const std::string KiCadSymbolLibFileExtension
static const std::string BackupFileSuffix
static const std::string LegacySymbolDocumentFileExtension
const wxChar *const traceLibraries
Flag to enable library table and library manager tracing.
const wxChar *const traceApi
Flag to enable debug output related to the IPC API and its plugin system.
std::unique_ptr< T > IO_RELEASER
Helper to hold and release an IO_BASE object when exceptions are thrown.
@ KIFACE_FILTER_FOOTPRINT_USERS
Function pointer type: wxString (*)(const wxString& aQueryJson) Input JSON: the object written by FOO...
@ KIFACE_MERGE_DOCUMENT
int (*)( int aKind, const wxString& aAncestor, const wxString& aOurs, const wxString& aTheirs,...
@ KIFACE_NETLIST_SCHEMATIC
@ KIFACE_TRIGGER_SYMBOLS_LOAD
Function pointer type: bool (*)() Starts loading the symbol libraries in the background.
@ KIFACE_ATTACH_DIFF_CANVASES
KICAD_DIFF::DIFF_CANVAS_CONTEXT* (*)( int aKind, const wxString& aFileA, const wxString& aFileB,...
@ KIFACE_OPEN_DIFF_DIALOG
int (*)( int aKind, const wxString& aFileA, const wxString& aFileB, const wxString& aLabelA,...
@ KIFACE_SYMBOLS_LOAD_PROGRESS
Function pointer type: float (*)() Returns how far the library loader has gotten as a fraction of the...
#define KFCTL_CLI
Running as CLI app.
DOC_KIND
Document type a diff/merge entry point should route to, derived from a file path's extension.
bool RegisterMergeDriver(const char *aName, MERGE_APPLY_FN aApply)
Register a KiCad merge driver with libgit2.
static int eeschemaMergeExport(int aKind, const wxString &aAncestor, const wxString &aOurs, const wxString &aTheirs, const wxString &aOutput, bool aInteractive, bool aSingleFile, REPORTER *aReporter)
static float symbolLibraryLoadProgress()
Return how far a background load has got.
bool generateSchematicNetlist(const wxString &aFilename, std::string &aNetlist, KIWAY *aKiway)
static wxString filterFootprintUsers(const wxString &aQueryJson)
Find the symbols that select a given footprint somehow (but FP field, filters or pin maps)
static bool footprintReferenceMatches(const LIB_ID &aReference, const LIB_ID &aFootprint)
Whether a footprint reference names aFootprint.
static KICAD_DIFF::DIFF_CANVAS_CONTEXT * eeschemaAttachDiffCanvasesExport(int aKind, const wxString &aFileA, const wxString &aFileB, WIDGET_DIFF_CANVAS *aBefore, WIDGET_DIFF_CANVAS *aAfter, KICAD_DIFF::DOCUMENT_DIFF *aDiff, REPORTER *aReporter)
static bool symbolPinMapsBindFootprint(const LIB_SYMBOL &aSymbol, const LIB_ID &aFootprint, FOOTPRINT_USER_MATCH &aMatch)
Whether one of the pin maps of aSymbol is bound to aFootprint; collects the names of the bound maps i...
static bool symbolFootprintFieldNamesFootprint(const LIB_SYMBOL &aSymbol, const LIB_ID &aFootprint, FOOTPRINT_USER_MATCH &aMatch)
Whether the footprint field of aSymbol names aFootprint; sets the footprint field flag in aMatch.
static std::optional< FOOTPRINT_USER_MATCH > symbolUsesFootprint(const LIB_SYMBOL &aSymbol, const LIB_ID &aFootprint)
Return how aSymbol uses aFootprint, or nothing when it doesn't.
static std::unique_ptr< SCHEMATIC > readSchematicFromFile(const std::string &aFilename)
static PROJECT * symbolLibraryProject()
Return the project whose symbol libraries the kiface-level symbol services work with.
static wxString effectiveFootprintText(const LIB_SYMBOL &aSymbol)
Return the footprint field text in effect for a symbol.
static bool symbolFilterMatchesFootprint(const LIB_SYMBOL &aSymbol, const LIB_ID &aFootprint, FOOTPRINT_USER_MATCH &aMatch)
Whether any footprint filter of a symbol selects a given footprint.
static bool startSymbolLibraryLoad()
Start loading the symbol libraries in the background.
SCH::IFACE KIFACE_BASE, UNITS_PROVIDER kiface("eeschema", KIWAY::FACE_SCH)
static int eeschemaOpenDiffDialogExport(int aKind, const wxString &aFileA, const wxString &aFileB, const wxString &aLabelA, const wxString &aLabelB, wxWindow *aParent, REPORTER *aReporter)
void InvokeEditDesignBlockLibTable(KIWAY *aKiway, wxWindow *aParent)
PANEL_SNAPPING * CreateSnappingPanel(wxWindow *aParent, SETTINGS_T *aCfg, FRAME_T aFrameType, SNAP_INFERENCE_SETTINGS SETTINGS_T::*aInference=nullptr, MAGNETIC_SETTINGS SETTINGS_T::*aMagnetics=nullptr)
Build the snapping page for an editor.
void InvokeSchEditSymbolLibTable(KIWAY *aKiway, wxWindow *aParent)
PGM_BASE & Pgm()
The global program "get" accessor.
T * GetToolbarSettings(const wxString &aFilename)
T * GetAppSettings(const char *aFilename)
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
The full set of changes between two parsed documents of one type.
wxString path
File path (KIND::FILE_KIND) or project path (KIND::LIBID_KIND).
LIB_ID libId
Library identifier; valid when kind == KIND::LIBID_KIND.
Implement a participant in the KIWAY alchemy.
std::future< void > m_libraryPreloadReturn
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
std::shared_ptr< BACKGROUND_JOB > m_libraryPreloadBackgroundJob
std::unique_ptr< API_HANDLER_SCH > m_openHandler
void PreloadLibraries(KIWAY *aKiway) override
void closeSymbol(KICAD_API_SERVER *aServer)
void SaveFileAs(const wxString &aProjectBasePath, const wxString &aProjectName, const wxString &aNewProjectBasePath, const wxString &aNewProjectName, const wxString &aSrcFilePath, wxString &aErrors) override
Saving a file under a different name is delegated to the various KIFACEs because the project doesn't ...
void ProjectChanged() override
std::unique_ptr< API_HANDLER_SYMBOL > m_openSymbolHandler
void CancelPreload(bool aBlock=true) override
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
EESCHEMA_JOBS_HANDLER * JobHandler() const
Accessor for the non-job diff/merge exports (eeschemaMergeExport etc.).
std::atomic_bool m_libraryPreloadAbort
IFACE(const char *aName, KIWAY::FACE_T aType)
void RegisterLibraryHandlers(KICAD_API_SERVER *aServer) override
Register this face's library API handlers on the given server.
void Reset() override
Reloads global state.
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
int HandleJob(JOB *aJob, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter) override
std::unique_ptr< EESCHEMA_JOBS_HANDLER > m_jobHandler
std::unique_ptr< API_HANDLER_SCH_LIBRARIES > m_apiHandlerSchLibs
bool LoadAllLibraries() override
Starts a background load of all libraries of the type owned by this face.
std::atomic_bool m_libraryPreloadInProgress
bool HandleApiCloseDocument(const DOCUMENT_SPEC &aSpec, KICAD_API_SERVER *aServer, wxString *aError) override
Close the document identified by aSpec.
bool HandleApiOpenDocument(const DOCUMENT_SPEC &aSpec, KICAD_API_SERVER *aServer, wxString *aError) override
void closeSchematic(KICAD_API_SERVER *aServer)
std::shared_ptr< HEADLESS_SYMBOL_EDITOR_CONTEXT > m_openSymbolContext
bool handleOpenSymbol(const wxString &aProjectPath, const wxString &aLibIdStr, KICAD_API_SERVER *aServer, wxString *aError)
bool HandleJobConfig(JOB *aJob, wxWindow *aParent) override
std::shared_ptr< HEADLESS_SCH_CONTEXT > m_openContext
bool handleCreateSchematic(const wxString &aPath, KICAD_API_SERVER *aServer, wxString *aError)
SCHEMATIC * m_openSchematic
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
@ FOOTPRINT
Field Name Module PCB, i.e. "16DIP300".
IbisParser parser & reporter
KIBIS top(path, &reporter)
VECTOR3I expected(15, 30, 45)
static const long long MM
wxString result
Test unit parsing edge cases and error handling.
wxLogTrace helper definitions.
Definition of file extensions used in Kicad.