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 );
327 void Reset()
override;
350 return new FOOTPRINT_EDIT_FRAME( aKiway, aParent );
428 return new PANEL_EDIT_OPTIONS( aParent,
this, frame,
true );
444 return new PANEL_FP_EDITOR_FIELD_DEFAULTS( aParent );
460 return new PANEL_FP_EDITOR_GRAPHICS_DEFAULTS( aParent,
this );
471 std::vector<TOOL_ACTION*> actions;
472 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
475 actions.push_back( action );
478 controls.push_back( control );
484 return new PANEL_FP_EDITOR_COLOR_SETTINGS( aParent );
503 return new PANEL_GRID_SETTINGS( aParent,
this, frame, cfg,
FRAME_PCB_EDITOR );
527 return new PANEL_EDIT_OPTIONS( aParent,
this, frame,
false );
532 BOARD* board =
nullptr;
536 board =
static_cast<PCB_EDIT_FRAME*
>( boardProvider )->GetBoard();
538 return new PANEL_PCBNEW_COLOR_SETTINGS( aParent, board );
546 std::vector<TOOL_ACTION*> actions;
547 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
550 actions.push_back( action );
553 controls.push_back( control );
555 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb,
FRAME_PCB_EDITOR, actions, controls );
559 return new PANEL_PCBNEW_ACTION_PLUGINS( aParent );
562 return new PANEL_3D_DISPLAY_OPTIONS( aParent );
565 return new PANEL_3D_OPENGL_OPTIONS( aParent );
568 return new PANEL_3D_RAYTRACING_OPTIONS( aParent );
575 std::vector<TOOL_ACTION*> actions;
576 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
579 actions.push_back( action );
582 controls.push_back( control );
584 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb,
FRAME_PCB_DISPLAY3D, actions, controls );
614 wxWindow* focus = wxWindow::FindFocus();
615 wxWindow*
top = focus ? wxGetTopLevelParent( focus ) : wxTheApp->GetTopWindow();
670 void SaveFileAs(
const wxString& aProjectBasePath,
const wxString& aSrcProjectName,
671 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
672 const wxString& aSrcFilePath, wxString& aErrors )
override;
680 wxString* aError )
override;
684 wxString* aError )
override;
721 const wxString& aTheirs,
const wxString& aOutput,
bool aInteractive,
722 bool aSingleFile,
REPORTER* aReporter )
725 aOurs, aTheirs, aOutput, aInteractive, aSingleFile,
731 const wxString& aLabelA,
const wxString& aLabelB,
732 wxWindow* aParent,
REPORTER* aReporter )
735 aFileB, aLabelA, aLabelB, aParent, aReporter );
780 m_jobHandler = std::make_unique<PCBNEW_JOBS_HANDLER>( aKiway );
796 if(
Pgm().ApiServerOrNull() )
815#if defined( KICAD_NATIVE_MODEL_PREVIEW ) && defined( __WXGTK3__ )
816 ShutdownNativeModelFilePickerGtk();
821 if(
Pgm().ApiServerOrNull() )
837 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
838 const wxString& aSrcFilePath, wxString& aErrors )
840 wxFileName destFile( aSrcFilePath );
841 wxString destPath = destFile.GetPathWithSep();
842 wxUniChar pathSep = wxFileName::GetPathSeparator();
843 wxString ext = destFile.GetExt();
845 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
846 destPath.Replace( aProjectBasePath, aNewProjectBasePath,
false );
848 wxString srcProjectFootprintLib = pathSep + aSrcProjectName + wxT(
".pretty" ) + pathSep;
849 wxString newProjectFootprintLib = pathSep + aNewProjectName + wxT(
".pretty" ) + pathSep;
851 destPath.Replace( srcProjectFootprintLib, newProjectFootprintLib,
true );
853 destFile.SetPath( destPath );
858 if( destFile.GetName() == aSrcProjectName )
859 destFile.SetName( aNewProjectName );
862 [&](
const std::string& token, wxString& value )
864 if( token ==
"sheetfile" )
866 for( const wxString extension : { wxT(
".sch" ), wxT(
".kicad_sch" ) } )
868 if( value == aSrcProjectName + extension )
870 value = aNewProjectName + extension;
873 else if( value == aProjectBasePath +
"/" + aSrcProjectName + extension )
875 value = aNewProjectBasePath +
"/" + aNewProjectName + extension;
878 else if( value.StartsWith( aProjectBasePath ) )
880 value.Replace( aProjectBasePath, aNewProjectBasePath, false );
892 if( destFile.GetName() == aSrcProjectName )
893 destFile.SetName( aNewProjectName );
895 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
901 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
907 else if( ext == wxT(
"rpt" ) )
913 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
917 wxFileName libTableFn( aSrcFilePath );
919 libTable.SetPath( destFile.GetFullPath() );
922 for( LIBRARY_TABLE_ROW& row : libTable.Rows() )
924 wxString uri = row.URI();
926 uri.Replace( wxT(
"/" ) + aSrcProjectName + wxT(
".pretty" ),
927 wxT(
"/" ) + aNewProjectName + wxT(
".pretty" ) );
932 libTable.Save().map_error(
933 [&](
const LIBRARY_ERROR& aError )
937 if( !aErrors.empty() )
938 aErrors += wxT(
"\n" );
940 msg.Printf(
_(
"Cannot copy file '%s'." ), destFile.GetFullPath() );
946 wxFAIL_MSG( wxT(
"Unexpected filetype for Pcbnew::SaveFileAs()" ) );
953 return m_jobHandler->RunJob( aJob, aReporter, aProgressReporter );
998 wxCHECK( aServer,
false );
1000 if( aSpec.
kind == DOCUMENT_SPEC::KIND::LIBID_KIND )
1003 if( aSpec.
kind == DOCUMENT_SPEC::KIND::CREATE_KIND )
1006 if( aSpec.
path.IsEmpty() )
1009 *aError = wxS(
"No path specified to open" );
1023 if( fpid.
Parse( aLibIdStr ) >= 0 )
1026 *aError = wxString::Format( wxS(
"Invalid footprint LIB_ID: %s" ), aLibIdStr );
1031 wxFileName projectPath( aProjectPath );
1032 projectPath.MakeAbsolute();
1036 if( !settingsManager.
LoadProject( projectPath.GetFullPath(),
true ) )
1038 wxLogTrace(
traceApi,
"Warning: no project file found for %s", aProjectPath );
1046 *aError = wxString::Format( wxS(
"Error loading project for %s" ), aProjectPath );
1051 std::shared_ptr<HEADLESS_FOOTPRINT_CONTEXT> newContext;
1063 *aError = wxString::Format( wxS(
"Footprint not found: %s" ), aLibIdStr );
1068 newContext = std::make_shared<HEADLESS_FOOTPRINT_CONTEXT>(
1074 *aError = wxString::Format( wxS(
"Failed to load footprint: %s" ), aLibIdStr );
1098 wxFileName projectPath( aPath );
1105 projectPath.MakeAbsolute();
1118 if( !settingsManager.
LoadProject( projectPath.GetFullPath(),
true ) )
1119 wxLogTrace(
traceApi,
"Warning: no project file found for %s", aPath );
1127 *aError = wxString::Format( wxS(
"Error loading project for %s" ), aPath );
1132 wxFileName boardPath( projectPath );
1135 if( !boardPath.FileExists() )
1138 *aError = wxString::Format( wxS(
"File not found: %s" ), aPath );
1149 *aError = wxString::Format( wxS(
"%s is not a recognized file type" ), aPath );
1154 std::shared_ptr<HEADLESS_PCB_CONTEXT> newContext;
1163 *aError = wxS(
"Failed to load board" );
1168 newContext = std::make_shared<HEADLESS_PCB_CONTEXT>( std::move( loadedBoard ),
project,
1174 *aError = wxString::Format( wxS(
"Failed to load board: %s" ), ioe.
What() );
1181 *aError = wxS(
"Failed to load board" );
1203 wxFileName boardPath( aPath );
1204 boardPath.MakeAbsolute();
1206 wxFileName projectPath( boardPath );
1212 *aError = wxS(
"The current board has unsaved changes; save or revert it first" );
1225 settingsManager.
LoadProject( projectPath.GetFullPath(),
true );;
1232 *aError = wxString::Format( wxS(
"Error creating project for %s" ), aPath );
1237 std::shared_ptr<HEADLESS_PCB_CONTEXT> newContext;
1246 *aError = wxS(
"Failed to create board" );
1251 newBoard->SetFileName( boardPath.GetFullPath() );
1253 newContext = std::make_shared<HEADLESS_PCB_CONTEXT>( std::move( newBoard ),
project,
1259 *aError = wxS(
"Failed to create board" );
1281 wxCHECK( aServer,
false );
1283 if( aSpec.
kind == DOCUMENT_SPEC::KIND::LIBID_KIND )
1288 *aError = wxS(
"No footprint is currently open" );
1296 *aError = wxS(
"Requested document does not match the open document" );
1308 *aError = wxS(
"No board is currently open" );
1313 if( !aSpec.
path.IsEmpty() )
1315 wxFileName currentBoard(
m_openContext->GetCurrentFileName() );
1317 if( currentBoard.GetFullName() != wxFileName( aSpec.
path ).GetFullName() )
1320 *aError = wxS(
"Requested document does not match the open document" );
1333 constexpr static int interval = 150;
1334 constexpr static int timeLimit = 120000;
1352 [
this, aKiway]() ->
void
1354 std::shared_ptr<BACKGROUND_JOB_REPORTER>
reporter =
1360 bool aborted =
false;
1362 reporter->Report(
_(
"Loading Footprint Libraries" ) );
1374 std::this_thread::sleep_for( std::chrono::milliseconds( interval ) );
1378 float progress = *loadStatus;
1379 reporter->SetCurrentProgress( progress );
1390 elapsed += interval;
1392 if( elapsed > timeLimit )
1415 wxLogTrace(
traceLibraries,
"pcbnew PreloadLibraries: aborted, skipping footprint processing" );
1426 std::string payload =
"";
1433 std::future<void> preloadFuture = std::async( std::launch::async, preload );
1459 wxCHECK_RET( aServer,
"no API server provided" );
constexpr EDA_IU_SCALE pcbIUScale
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
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)
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.
void SetKiway(wxWindow *aDest, KIWAY *aKiway)
It is only used for debugging, since "this" is not a wxWindow*.
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.
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
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.
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.
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.
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_OPEN_DIFF_DIALOG
int (*)( int aKind, const wxString& aFileA, const wxString& aFileB, const wxString& aLabelA,...
#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)
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.
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.