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;
353 return new FOOTPRINT_EDIT_FRAME( aKiway, aParent );
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();
675 void SaveFileAs(
const wxString& aProjectBasePath,
const wxString& aSrcProjectName,
676 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
677 const wxString& aSrcFilePath, wxString& aErrors )
override;
685 wxString* aError )
override;
689 wxString* aError )
override;
726 const wxString& aTheirs,
const wxString& aOutput,
bool aInteractive,
727 bool aSingleFile,
REPORTER* aReporter )
730 aOurs, aTheirs, aOutput, aInteractive, aSingleFile,
736 const wxString& aLabelA,
const wxString& aLabelB,
737 wxWindow* aParent,
REPORTER* aReporter )
740 aFileB, aLabelA, aLabelB, aParent, aReporter );
750 aAfter, *aDiff, aReporter );
795 m_jobHandler = std::make_unique<PCBNEW_JOBS_HANDLER>( aKiway );
811 if(
Pgm().ApiServerOrNull() )
832#if defined( KICAD_NATIVE_MODEL_PREVIEW ) && defined( __WXGTK3__ )
833 ShutdownNativeModelFilePickerGtk();
838 if(
Pgm().ApiServerOrNull() )
854 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
855 const wxString& aSrcFilePath, wxString& aErrors )
857 wxFileName destFile( aSrcFilePath );
858 wxString destPath = destFile.GetPathWithSep();
859 wxUniChar pathSep = wxFileName::GetPathSeparator();
860 wxString ext = destFile.GetExt();
862 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
863 destPath.Replace( aProjectBasePath, aNewProjectBasePath,
false );
865 wxString srcProjectFootprintLib = pathSep + aSrcProjectName + wxT(
".pretty" ) + pathSep;
866 wxString newProjectFootprintLib = pathSep + aNewProjectName + wxT(
".pretty" ) + pathSep;
868 destPath.Replace( srcProjectFootprintLib, newProjectFootprintLib,
true );
870 destFile.SetPath( destPath );
875 if( destFile.GetName() == aSrcProjectName )
876 destFile.SetName( aNewProjectName );
879 [&](
const std::string& token, wxString& value )
881 if( token ==
"sheetfile" )
883 for( const wxString extension : { wxT(
".sch" ), wxT(
".kicad_sch" ) } )
885 if( value == aSrcProjectName + extension )
887 value = aNewProjectName + extension;
890 else if( value == aProjectBasePath +
"/" + aSrcProjectName + extension )
892 value = aNewProjectBasePath +
"/" + aNewProjectName + extension;
895 else if( value.StartsWith( aProjectBasePath ) )
897 value.Replace( aProjectBasePath, aNewProjectBasePath, false );
909 if( destFile.GetName() == aSrcProjectName )
910 destFile.SetName( aNewProjectName );
912 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
918 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
924 else if( ext == wxT(
"rpt" ) )
930 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
934 wxFileName libTableFn( aSrcFilePath );
936 libTable.SetPath( destFile.GetFullPath() );
939 for( LIBRARY_TABLE_ROW& row : libTable.Rows() )
941 wxString uri = row.URI();
943 uri.Replace( wxT(
"/" ) + aSrcProjectName + wxT(
".pretty" ),
944 wxT(
"/" ) + aNewProjectName + wxT(
".pretty" ) );
949 libTable.Save().map_error(
950 [&](
const LIBRARY_ERROR& aError )
954 if( !aErrors.empty() )
955 aErrors += wxT(
"\n" );
957 msg.Printf(
_(
"Cannot copy file '%s'." ), destFile.GetFullPath() );
963 wxFAIL_MSG( wxT(
"Unexpected filetype for Pcbnew::SaveFileAs()" ) );
970 return m_jobHandler->RunJob( aJob, aReporter, aProgressReporter );
1015 wxCHECK( aServer,
false );
1017 if( aSpec.
kind == DOCUMENT_SPEC::KIND::LIBID_KIND )
1020 if( aSpec.
kind == DOCUMENT_SPEC::KIND::CREATE_KIND )
1023 if( aSpec.
path.IsEmpty() )
1026 *aError = wxS(
"No path specified to open" );
1040 if( fpid.
Parse( aLibIdStr ) >= 0 )
1043 *aError = wxString::Format( wxS(
"Invalid footprint LIB_ID: %s" ), aLibIdStr );
1048 wxFileName projectPath( aProjectPath );
1049 projectPath.MakeAbsolute();
1053 if( !settingsManager.
LoadProject( projectPath.GetFullPath(),
true ) )
1055 wxLogTrace(
traceApi,
"Warning: no project file found for %s", aProjectPath );
1063 *aError = wxString::Format( wxS(
"Error loading project for %s" ), aProjectPath );
1068 std::shared_ptr<HEADLESS_FOOTPRINT_CONTEXT> newContext;
1080 *aError = wxString::Format( wxS(
"Footprint not found: %s" ), aLibIdStr );
1085 newContext = std::make_shared<HEADLESS_FOOTPRINT_CONTEXT>(
1091 *aError = wxString::Format( wxS(
"Failed to load footprint: %s" ), aLibIdStr );
1115 wxFileName projectPath( aPath );
1122 projectPath.MakeAbsolute();
1135 if( !settingsManager.
LoadProject( projectPath.GetFullPath(),
true ) )
1136 wxLogTrace(
traceApi,
"Warning: no project file found for %s", aPath );
1144 *aError = wxString::Format( wxS(
"Error loading project for %s" ), aPath );
1149 wxFileName boardPath( projectPath );
1152 if( !boardPath.FileExists() )
1155 *aError = wxString::Format( wxS(
"File not found: %s" ), aPath );
1166 *aError = wxString::Format( wxS(
"%s is not a recognized file type" ), aPath );
1171 std::shared_ptr<HEADLESS_PCB_CONTEXT> newContext;
1180 *aError = wxS(
"Failed to load board" );
1185 newContext = std::make_shared<HEADLESS_PCB_CONTEXT>( std::move( loadedBoard ),
project,
1191 *aError = wxString::Format( wxS(
"Failed to load board: %s" ), ioe.
What() );
1198 *aError = wxS(
"Failed to load board" );
1220 wxFileName boardPath( aPath );
1221 boardPath.MakeAbsolute();
1223 wxFileName projectPath( boardPath );
1229 *aError = wxS(
"The current board has unsaved changes; save or revert it first" );
1242 settingsManager.
LoadProject( projectPath.GetFullPath(),
true );;
1249 *aError = wxString::Format( wxS(
"Error creating project for %s" ), aPath );
1254 std::shared_ptr<HEADLESS_PCB_CONTEXT> newContext;
1263 *aError = wxS(
"Failed to create board" );
1268 newBoard->SetFileName( boardPath.GetFullPath() );
1270 newContext = std::make_shared<HEADLESS_PCB_CONTEXT>( std::move( newBoard ),
project,
1276 *aError = wxS(
"Failed to create board" );
1298 wxCHECK( aServer,
false );
1300 if( aSpec.
kind == DOCUMENT_SPEC::KIND::LIBID_KIND )
1305 *aError = wxS(
"No footprint is currently open" );
1313 *aError = wxS(
"Requested document does not match the open document" );
1325 *aError = wxS(
"No board is currently open" );
1330 if( !aSpec.
path.IsEmpty() )
1332 wxFileName currentBoard(
m_openContext->GetCurrentFileName() );
1334 if( currentBoard.GetFullName() != wxFileName( aSpec.
path ).GetFullName() )
1337 *aError = wxS(
"Requested document does not match the open document" );
1350 constexpr static int interval = 150;
1351 constexpr static int timeLimit = 120000;
1369 [
this, aKiway]() ->
void
1371 std::shared_ptr<BACKGROUND_JOB_REPORTER>
reporter =
1377 bool aborted =
false;
1379 reporter->Report(
_(
"Loading Footprint Libraries" ) );
1391 std::this_thread::sleep_for( std::chrono::milliseconds( interval ) );
1395 float progress = *loadStatus;
1396 reporter->SetCurrentProgress( progress );
1407 elapsed += interval;
1409 if( elapsed > timeLimit )
1432 wxLogTrace(
traceLibraries,
"pcbnew PreloadLibraries: aborted, skipping footprint processing" );
1442 std::string payload =
"";
1451 std::future<void> preloadFuture = std::async( std::launch::async, preload );
1477 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.
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.
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,...
#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.