58#include <nlohmann/json.hpp>
80#include <wx/tokenzr.h>
94#if defined( KICAD_NATIVE_MODEL_PREVIEW ) && defined( __WXGTK3__ )
113 wxWindow* focus = wxWindow::FindFocus();
114 wxWindow*
top = focus ? wxGetTopLevelParent( focus ) : wxTheApp->GetTopWindow();
146 using json = nlohmann::json;
153 json input = json::parse( aFilterJson.utf8_string() );
155 unsigned pinCount = input.value(
"pin_count", 0 );
156 bool zeroFilters = input.value(
"zero_filters",
true );
157 int maxResults = input.value(
"max_results", 400 );
159 std::vector<std::unique_ptr<EDA_PATTERN_MATCH>> filterMatchers;
161 if( input.contains(
"filters" ) && input[
"filters"].is_array() )
163 for(
const auto& f : input[
"filters"] )
167 wxString pattern = wxString::FromUTF8( f.get<std::string>() );
168 auto matcher = std::make_unique<EDA_PATTERN_MATCH_WILDCARD_ANCHORED>();
169 matcher->SetPattern( pattern.Lower() );
170 filterMatchers.push_back( std::move( matcher ) );
175 bool hasFilters = ( pinCount > 0 || !filterMatchers.empty() );
178 if( zeroFilters && !hasFilters )
181 return result.ToJsonStr();
187 return result.ToJsonStr();
194 std::vector<FOOTPRINT*> footprints = adapter->
GetFootprints( nickname,
true );
204 unsigned fpPadCount = fp->GetNumberedPadCount();
206 if( fpPadCount != pinCount )
211 if( !filterMatchers.empty() )
213 bool matches =
false;
215 for(
const auto& matcher : filterMatchers )
220 if( matcher->GetPattern().Contains( wxS(
":" ) ) )
221 name = fp->GetFPID().GetLibNickname().wx_str().Lower() + wxS(
":" );
223 name += fp->GetFPID().GetLibItemName().wx_str().Lower();
225 if( matcher->Find(
name ) )
238 if( maxResults > 0 &&
static_cast<int>(
result.m_MatchingNames.size() ) >= maxResults )
240 result.m_IsLimited =
true;
244 wxString libId = fp->GetFPID().Format();
245 result.m_MatchingNames.emplace_back( libId );
254 return result.ToJsonStr();
256 catch(
const std::exception& )
259 result.m_MatchingNames.clear();
261 return result.ToJsonStr();
308static int pcbnewMergeExport(
int aKind,
const wxString& aAncestor,
const wxString& aOurs,
309 const wxString& aTheirs,
const wxString& aOutput,
bool aInteractive,
310 bool aSingleFile, REPORTER* aReporter );
312 const wxString& aLabelA,
const wxString& aLabelB,
313 wxWindow* aParent, REPORTER* aReporter );
314static KICAD_DIFF::DIFF_CANVAS_CONTEXT*
330 void Reset()
override;
374 dlg.SetKiway( &dlg, aKiway );
377 if( dlg.ShowQuasiModal() == wxID_OK )
431 return new PANEL_EDIT_OPTIONS( aParent,
this, frame,
true );
447 return new PANEL_FP_EDITOR_FIELD_DEFAULTS( aParent );
463 return new PANEL_FP_EDITOR_GRAPHICS_DEFAULTS( aParent,
this );
474 std::vector<TOOL_ACTION*> actions;
475 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
478 actions.push_back( action );
481 controls.push_back( control );
487 return new PANEL_FP_EDITOR_COLOR_SETTINGS( aParent );
506 return new PANEL_GRID_SETTINGS( aParent,
this, frame, cfg,
FRAME_PCB_EDITOR );
530 return new PANEL_EDIT_OPTIONS( aParent,
this, frame,
false );
535 BOARD* board =
nullptr;
539 board =
static_cast<PCB_EDIT_FRAME*
>( boardProvider )->GetBoard();
541 return new PANEL_PCBNEW_COLOR_SETTINGS( aParent, board );
549 std::vector<TOOL_ACTION*> actions;
550 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
553 actions.push_back( action );
556 controls.push_back( control );
558 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb,
FRAME_PCB_EDITOR, actions, controls );
562 return new PANEL_PCBNEW_ACTION_PLUGINS( aParent );
565 return new PANEL_3D_DISPLAY_OPTIONS( aParent );
568 return new PANEL_3D_OPENGL_OPTIONS( aParent );
571 return new PANEL_3D_RAYTRACING_OPTIONS( aParent );
578 std::vector<TOOL_ACTION*> actions;
579 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
582 actions.push_back( action );
585 controls.push_back( control );
587 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb,
FRAME_PCB_DISPLAY3D, actions, controls );
617 wxWindow* focus = wxWindow::FindFocus();
618 wxWindow*
top = focus ? wxGetTopLevelParent( focus ) : wxTheApp->GetTopWindow();
666 void SaveFileAs(
const wxString& aProjectBasePath,
const wxString& aSrcProjectName,
667 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
668 const wxString& aSrcFilePath, wxString& aErrors )
override;
676 wxString* aError )
override;
680 wxString* aError )
override;
717 const wxString& aTheirs,
const wxString& aOutput,
bool aInteractive,
718 bool aSingleFile,
REPORTER* aReporter )
721 aOurs, aTheirs, aOutput, aInteractive, aSingleFile,
727 const wxString& aLabelA,
const wxString& aLabelB,
728 wxWindow* aParent,
REPORTER* aReporter )
731 aFileB, aLabelA, aLabelB, aParent, aReporter );
741 aAfter, *aDiff, aReporter );
786 m_jobHandler = std::make_unique<PCBNEW_JOBS_HANDLER>( aKiway );
802 if(
Pgm().ApiServerOrNull() )
823#if defined( KICAD_NATIVE_MODEL_PREVIEW ) && defined( __WXGTK3__ )
824 ShutdownNativeModelFilePickerGtk();
829 if(
Pgm().ApiServerOrNull() )
845 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
846 const wxString& aSrcFilePath, wxString& aErrors )
848 wxFileName destFile( aSrcFilePath );
849 wxString destPath = destFile.GetPathWithSep();
850 wxUniChar pathSep = wxFileName::GetPathSeparator();
851 wxString ext = destFile.GetExt();
853 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
854 destPath.Replace( aProjectBasePath, aNewProjectBasePath,
false );
856 wxString srcProjectFootprintLib = pathSep + aSrcProjectName + wxT(
".pretty" ) + pathSep;
857 wxString newProjectFootprintLib = pathSep + aNewProjectName + wxT(
".pretty" ) + pathSep;
859 destPath.Replace( srcProjectFootprintLib, newProjectFootprintLib,
true );
861 destFile.SetPath( destPath );
866 if( destFile.GetName() == aSrcProjectName )
867 destFile.SetName( aNewProjectName );
870 [&](
const std::string& token, wxString& value )
872 if( token ==
"sheetfile" )
874 for( const wxString extension : { wxT(
".sch" ), wxT(
".kicad_sch" ) } )
876 if( value == aSrcProjectName + extension )
878 value = aNewProjectName + extension;
881 else if( value == aProjectBasePath +
"/" + aSrcProjectName + extension )
883 value = aNewProjectBasePath +
"/" + aNewProjectName + extension;
886 else if( value.StartsWith( aProjectBasePath ) )
888 value.Replace( aProjectBasePath, aNewProjectBasePath, false );
900 if( destFile.GetName() == aSrcProjectName )
901 destFile.SetName( aNewProjectName );
903 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
909 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
915 else if( ext == wxT(
"rpt" ) )
921 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
925 wxFileName libTableFn( aSrcFilePath );
927 libTable.SetPath( destFile.GetFullPath() );
930 for( LIBRARY_TABLE_ROW& row : libTable.Rows() )
932 wxString uri = row.URI();
934 uri.Replace( wxT(
"/" ) + aSrcProjectName + wxT(
".pretty" ),
935 wxT(
"/" ) + aNewProjectName + wxT(
".pretty" ) );
940 libTable.Save().map_error(
941 [&](
const LIBRARY_ERROR& aError )
945 if( !aErrors.empty() )
946 aErrors += wxT(
"\n" );
948 msg.Printf(
_(
"Cannot copy file '%s'." ), destFile.GetFullPath() );
954 wxFAIL_MSG( wxT(
"Unexpected filetype for Pcbnew::SaveFileAs()" ) );
961 return m_jobHandler->RunJob( aJob, aReporter, aProgressReporter );
1006 wxCHECK( aServer,
false );
1008 if( aSpec.
kind == DOCUMENT_SPEC::KIND::LIBID_KIND )
1011 if( aSpec.
kind == DOCUMENT_SPEC::KIND::CREATE_KIND )
1014 if( aSpec.
path.IsEmpty() )
1017 *aError = wxS(
"No path specified to open" );
1031 if( fpid.
Parse( aLibIdStr ) >= 0 )
1034 *aError = wxString::Format( wxS(
"Invalid footprint LIB_ID: %s" ), aLibIdStr );
1039 wxFileName projectPath( aProjectPath );
1040 projectPath.MakeAbsolute();
1044 if( !settingsManager.
LoadProject( projectPath.GetFullPath(),
true ) )
1046 wxLogTrace(
traceApi,
"Warning: no project file found for %s", aProjectPath );
1054 *aError = wxString::Format( wxS(
"Error loading project for %s" ), aProjectPath );
1059 std::shared_ptr<HEADLESS_FOOTPRINT_CONTEXT> newContext;
1071 *aError = wxString::Format( wxS(
"Footprint not found: %s" ), aLibIdStr );
1076 newContext = std::make_shared<HEADLESS_FOOTPRINT_CONTEXT>(
1082 *aError = wxString::Format( wxS(
"Failed to load footprint: %s" ), aLibIdStr );
1106 wxFileName projectPath( aPath );
1113 projectPath.MakeAbsolute();
1126 if( !settingsManager.
LoadProject( projectPath.GetFullPath(),
true ) )
1127 wxLogTrace(
traceApi,
"Warning: no project file found for %s", aPath );
1135 *aError = wxString::Format( wxS(
"Error loading project for %s" ), aPath );
1140 wxFileName boardPath( projectPath );
1143 if( !boardPath.FileExists() )
1146 *aError = wxString::Format( wxS(
"File not found: %s" ), aPath );
1157 *aError = wxString::Format( wxS(
"%s is not a recognized file type" ), aPath );
1162 std::shared_ptr<HEADLESS_PCB_CONTEXT> newContext;
1171 *aError = wxS(
"Failed to load board" );
1176 newContext = std::make_shared<HEADLESS_PCB_CONTEXT>( std::move( loadedBoard ),
project,
1182 *aError = wxString::Format( wxS(
"Failed to load board: %s" ), ioe.
What() );
1189 *aError = wxS(
"Failed to load board" );
1211 wxFileName boardPath( aPath );
1212 boardPath.MakeAbsolute();
1214 wxFileName projectPath( boardPath );
1220 *aError = wxS(
"The current board has unsaved changes; save or revert it first" );
1233 settingsManager.
LoadProject( projectPath.GetFullPath(),
true );;
1240 *aError = wxString::Format( wxS(
"Error creating project for %s" ), aPath );
1245 std::shared_ptr<HEADLESS_PCB_CONTEXT> newContext;
1254 *aError = wxS(
"Failed to create board" );
1259 newBoard->SetFileName( boardPath.GetFullPath() );
1261 newContext = std::make_shared<HEADLESS_PCB_CONTEXT>( std::move( newBoard ),
project,
1267 *aError = wxS(
"Failed to create board" );
1289 wxCHECK( aServer,
false );
1291 if( aSpec.
kind == DOCUMENT_SPEC::KIND::LIBID_KIND )
1296 *aError = wxS(
"No footprint is currently open" );
1304 *aError = wxS(
"Requested document does not match the open document" );
1316 *aError = wxS(
"No board is currently open" );
1321 if( !aSpec.
path.IsEmpty() )
1323 wxFileName currentBoard(
m_openContext->GetCurrentFileName() );
1325 if( currentBoard.GetFullName() != wxFileName( aSpec.
path ).GetFullName() )
1328 *aError = wxS(
"Requested document does not match the open document" );
1357 [
this, aKiway]() ->
void
1359 std::shared_ptr<BACKGROUND_JOB_REPORTER>
reporter =
1364 reporter->Report(
_(
"Loading Footprint Libraries" ) );
1377 wxLogTrace(
traceLibraries,
"pcbnew PreloadLibraries: aborted, skipping footprint processing" );
1386 std::string payload =
"";
1397 std::future<void> preloadFuture = std::async( std::launch::async, preload );
1428 wxCHECK_RET( aServer,
"no API server provided" );
constexpr EDA_IU_SCALE pcbIUScale
static std::list< TOOL_ACTION * > & GetActionList()
Return list of TOOL_ACTIONs.
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 std::unique_ptr< BOARD > CreateEmptyBoard(PROJECT *aProject)
static std::unique_ptr< BOARD > Load(const wxString &aFileName, PCB_IO_MGR::PCB_FILE_T aFormat, PROJECT *aProject, const OPTIONS &aOptions)
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.
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)
libgit2 merge-driver apply callback shim.
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.
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 void CommonSettingsChanged(int aFlags=0)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
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.
bool RunPreload(PROGRESS_REPORTER &aReporter, std::atomic_bool &aAbort)
Starts AsyncLoad() and waits for it on the calling thread, reporting progress to aReporter.
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
MAGNETIC_SETTINGS m_MagneticItems
SNAP_INFERENCE_SETTINGS m_SnapInference
The main frame for Pcbnew.
PCB_FILE_T
The set of file types that the PCB_IO_MGR knows about, and for which there has been a plugin written,...
static PCB_FILE_T FindPluginTypeFromBoardPath(const wxString &aFileName, int aCtl=0)
Return a plugin type given a path for a board file.
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 FOOTPRINT_LIBRARY_ADAPTER * FootprintLibAdapter(PROJECT *aProject)
Container for project specific data.
A pure virtual class used to derive REPORTER objects from.
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Take ownership of the pointer passed in.
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.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true, bool aOverrideLock=false)
Load a project or sets up a new project with a specified path.
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.
Abstract pattern-matching tool and implementations.
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
@ PANEL_FP_DEFAULT_GRAPHICS_VALUES
@ PANEL_FP_DISPLAY_OPTIONS
@ PANEL_FP_USER_LAYER_NAMES
@ DIALOG_PCB_LIBRARY_TABLE
@ FRAME_FOOTPRINT_PREVIEW
@ FRAME_FOOTPRINT_CHOOSER
@ PANEL_FP_DEFAULT_FIELDS
@ PANEL_PCB_ACTION_PLUGINS
@ PANEL_3DV_DISPLAY_OPTIONS
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 ProjectFileExtension
static const std::string LegacyPcbFileExtension
static const std::string FootprintLibraryTableFileName
static const std::string BackupFileSuffix
static const std::string LegacyFootprintLibPathExtension
static const std::string FootprintAssignmentFileExtension
static const std::string KiCadFootprintFileExtension
static const std::string KiCadPcbFileExtension
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.
@ KIFACE_MERGE_DOCUMENT
int (*)( int aKind, const wxString& aAncestor, const wxString& aOurs, const wxString& aTheirs,...
@ KIFACE_FOOTPRINT_LIBRARY_ADAPTER
@ KIFACE_FOOTPRINTS_LOAD_PROGRESS
Function pointer type: float (*)() Returns how far the library loader has gotten as a fraction of the...
@ KIFACE_FILTER_FOOTPRINTS
Function pointer type: wxString (*)(const wxString& aFilterJson) Input JSON: {"pin_count": N,...
@ KIFACE_TRIGGER_FOOTPRINTS_LOAD
Function pointer type: bool (*)() Starts loading the footprint 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,...
void * KifaceServiceAddress(T aAddress)
Return a service address for IfaceOrAddress().
#define KFCTL_CLI
Running as CLI app.
#define KICTL_KICAD_ONLY
chosen file is from KiCad according to user
This file contains miscellaneous commonly used macros and functions.
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.
PCB::IFACE KIFACE_BASE, UNITS_PROVIDER kiface("pcbnew", KIWAY::FACE_PCB)
static int pcbnewOpenDiffDialogExport(int aKind, const wxString &aFileA, const wxString &aFileB, const wxString &aLabelA, const wxString &aLabelB, wxWindow *aParent, REPORTER *aReporter)
static int pcbnewMergeExport(int aKind, const wxString &aAncestor, const wxString &aOurs, const wxString &aTheirs, const wxString &aOutput, bool aInteractive, bool aSingleFile, REPORTER *aReporter)
static KICAD_DIFF::DIFF_CANVAS_CONTEXT * pcbnewAttachDiffCanvasesExport(int aKind, const wxString &aFileA, const wxString &aFileB, WIDGET_DIFF_CANVAS *aBefore, WIDGET_DIFF_CANVAS *aAfter, KICAD_DIFF::DOCUMENT_DIFF *aDiff, REPORTER *aReporter)
void InvokePcbLibTableEditor(KIWAY *aKiway, wxWindow *aCaller)
Show the modal DIALOG_EDIT_LIBRARY_TABLES for purposes of editing the global and project library tabl...
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.
static bool startFootprintLibraryLoad()
Start loading the footprint libraries in the background.
static PROJECT * footprintLibraryProject()
Return the project whose footprint libraries the kiface-level footprint services work with.
static wxString filterFootprints(const wxString &aFilterJson)
Filter footprints based on criteria passed as JSON.
static float footprintLibraryLoadProgress()
Return how far a background load has got.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
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::atomic_bool m_libraryPreloadInProgress
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
void PreloadLibraries(KIWAY *aKiway) override
void ProjectChanged() override
void SaveFileAs(const wxString &aProjectBasePath, const wxString &aSrcProjectName, 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 CancelPreload(bool aBlock=true) override
std::shared_ptr< BACKGROUND_JOB > m_libraryPreloadBackgroundJob
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
void RegisterLibraryHandlers(KICAD_API_SERVER *aServer) override
Register this face's library API handlers on the given server.
void Reset() override
Reloads global state.
std::unique_ptr< API_HANDLER_FOOTPRINT > m_openFpHandler
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
bool handleOpenFootprint(const wxString &aProjectPath, const wxString &aLibIdStr, KICAD_API_SERVER *aServer, wxString *aError)
IFACE(const char *aName, KIWAY::FACE_T aType)
void closeFootprint(KICAD_API_SERVER *aServer)
std::unique_ptr< API_HANDLER_PCB > m_openHandler
std::atomic_bool m_libraryPreloadAbort
int HandleJob(JOB *aJob, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter) override
void closeBoard(KICAD_API_SERVER *aServer)
bool LoadAllLibraries() override
Starts a background load of all libraries of the type owned by this face.
std::shared_ptr< HEADLESS_FOOTPRINT_CONTEXT > m_openFpContext
bool HandleApiCloseDocument(const DOCUMENT_SPEC &aSpec, KICAD_API_SERVER *aServer, wxString *aError) override
Close the document identified by aSpec.
std::shared_ptr< HEADLESS_PCB_CONTEXT > m_openContext
bool HandleApiOpenDocument(const DOCUMENT_SPEC &aSpec, KICAD_API_SERVER *aServer, wxString *aError) override
PCBNEW_JOBS_HANDLER * JobHandler() const
Accessor for the non-job diff/merge exports (pcbnewMergeExport etc.).
std::unique_ptr< API_HANDLER_FP_LIBRARIES > m_apiHandlerFpLibs
std::unique_ptr< PCBNEW_JOBS_HANDLER > m_jobHandler
bool HandleJobConfig(JOB *aJob, wxWindow *aParent) override
bool handleCreatePcb(const wxString &aPath, KICAD_API_SERVER *aServer, wxString *aError)
bool handleOpenPcb(const wxString &aPath, KICAD_API_SERVER *aServer, wxString *aError)
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
std::future< void > m_libraryPreloadReturn
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.