35#include <wx/snglinst.h> 
   62#include <python_scripting.h> 
   92    void Reset() 
override;
 
  230            std::vector<TOOL_ACTION*>            actions;
 
  231            std::vector<ACTION_TOOLBAR_CONTROL*> controls;
 
  234                actions.push_back( action );
 
  237                controls.push_back( control );
 
  287            BOARD*          board = 
nullptr;
 
  291                board = 
static_cast<PCB_EDIT_FRAME*
>( boardProvider )->
GetBoard();
 
  293            return new PANEL_PCBNEW_COLOR_SETTINGS( aParent, board );
 
 
  301            std::vector<TOOL_ACTION*>            actions;
 
  302            std::vector<ACTION_TOOLBAR_CONTROL*> controls;
 
  305                actions.push_back( action );
 
  308                controls.push_back( control );
 
  330            std::vector<TOOL_ACTION*>            actions;
 
  331            std::vector<ACTION_TOOLBAR_CONTROL*> controls;
 
  334                actions.push_back( action );
 
  337                controls.push_back( control );
 
 
  386    void SaveFileAs( 
const wxString& aProjectBasePath, 
const wxString& aSrcProjectName,
 
  387                     const wxString& aNewProjectBasePath, 
const wxString& aNewProjectName,
 
  388                     const wxString& aSrcFilePath, wxString& aErrors ) 
override;
 
 
  463    m_jobHandler = std::make_unique<PCBNEW_JOBS_HANDLER>( aKiway );
 
 
  485    if( !fn.FileExists() )
 
  503            wxString msg = 
_( 
"An error occurred attempting to load the global footprint library " 
  505                              "Please edit this global footprint library table in Preferences " 
 
  523                        const wxString& aNewProjectBasePath, 
const wxString& aNewProjectName,
 
  524                        const wxString& aSrcFilePath, wxString& aErrors )
 
  526    wxFileName destFile( aSrcFilePath );
 
  527    wxString   destPath = destFile.GetPathWithSep();
 
  528    wxUniChar  pathSep = wxFileName::GetPathSeparator();
 
  529    wxString   ext = destFile.GetExt();
 
  531    if( destPath.StartsWith( aProjectBasePath + pathSep ) )
 
  532        destPath.Replace( aProjectBasePath, aNewProjectBasePath, 
false );
 
  534    wxString srcProjectFootprintLib = pathSep + aSrcProjectName + wxT( 
".pretty" ) + pathSep;
 
  535    wxString newProjectFootprintLib = pathSep + aNewProjectName + wxT( 
".pretty" ) + pathSep;
 
  537    destPath.Replace( srcProjectFootprintLib, newProjectFootprintLib, 
true );
 
  539    destFile.SetPath( destPath );
 
  544        if( destFile.GetName() == aSrcProjectName )
 
  545            destFile.SetName( aNewProjectName );
 
  547        KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
 
  551        if( destFile.GetName() == aSrcProjectName )
 
  552            destFile.SetName( aNewProjectName );
 
  554        KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
 
  560        KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
 
  566    else if( ext == wxT( 
"rpt" ) )
 
  572        KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
 
  579            fpLibTable.
Load( aSrcFilePath );
 
  581            for( 
unsigned i = 0; i < fpLibTable.
GetCount(); i++ )
 
  586                uri.Replace( wxT( 
"/" ) + aSrcProjectName + wxT( 
".pretty" ),
 
  587                             wxT( 
"/" ) + aNewProjectName + wxT( 
".pretty" ) );
 
  592            fpLibTable.
Save( destFile.GetFullPath() );
 
  598            if( !aErrors.empty() )
 
  599                aErrors += wxT( 
"\n" );
 
  601            msg.Printf( 
_( 
"Cannot copy file '%s'." ), destFile.GetFullPath() );
 
  607        wxFAIL_MSG( wxT( 
"Unexpected filetype for Pcbnew::SaveFileAs()" ) );
 
 
  614    return m_jobHandler->RunJob( aJob, aReporter, aProgressReporter );
 
 
 
constexpr EDA_IU_SCALE pcbIUScale
 
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
 
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.
 
static PROGRESS_REPORTER & GetInstance()
 
static REPORTER & GetInstance()
 
The base frame for deriving all KiCad main window classes.
 
static bool LoadGlobalTable(FP_LIB_TABLE &aTable)
Load the global footprint library table into aTable.
 
static wxString GetGlobalTableFileName()
 
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.
 
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?
 
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.
 
FACE_T
Known KIFACE implementations.
 
virtual void CommonSettingsChanged(int aFlags=0)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
 
Hold a record identifying a library accessed by the appropriate plug in object in the LIB_TABLE.
 
void SetFullURI(const wxString &aFullURI)
Change the full URI for the library.
 
const wxString GetFullURI(bool aSubstituted=false) const
Return the full location specifying URI for the LIB, either in original UI form or in environment var...
 
LIB_TABLE_ROW & At(unsigned aIndex)
Get the 'n'th LIB_TABLE_ROW object.
 
void Load(const wxString &aFileName)
Load the library table using the path defined by aFileName aFallBackTable.
 
unsigned GetCount() const
Get the number of rows contained in the table.
 
void Save(const wxString &aFileName) const
Write this library table to aFileName in s-expression form.
 
The main frame for Pcbnew.
 
Container for data for KiCad programs.
 
virtual SETTINGS_MANAGER & GetSettingsManager() const
 
A progress reporter interface for use in multi-threaded environments.
 
A pure virtual class used to derive REPORTER objects from.
 
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Take ownership of the pointer passed in.
 
void FlushAndRelease(JSON_SETTINGS *aSettings, bool aSave=true)
If the given settings object is registered, save it to disk and unregister it.
 
UNITS_PROVIDER(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits)
 
EDA_UNITS GetUserUnits() const
 
void SetUserUnits(EDA_UNITS aUnits)
 
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
 
This file is part of the common library.
 
FP_LIB_TABLE GFootprintTable
The global footprint library table.
 
#define KICAD_PCB_PORT_SERVICE_NUMBER
Pcbnew listens on this port for commands from Eeschema.
 
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
 
@ DIALOG_PCB_LIBRARY_TABLE
 
@ FRAME_FOOTPRINT_PREVIEW
 
@ FRAME_FOOTPRINT_CHOOSER
 
@ PANEL_FP_DEFAULT_FIELDS
 
@ PANEL_PCB_ACTION_PLUGINS
 
@ PANEL_3DV_DISPLAY_OPTIONS
 
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
 
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
 
@ KIFACE_SCRIPTING_LEGACY
 
@ KIFACE_FOOTPRINT_LIST
Return a pointer to the global instance of FOOTPRINT_LIST from pcbnew.
 
@ KIFACE_GLOBAL_FOOTPRINT_TABLE
Return the global FP_LIB_TABLE.
 
@ KIFACE_NEW_FOOTPRINT_TABLE
Return a new FP_LIB_TABLE with the global table installed as a fallback.
 
#define KFCTL_CLI
Running as CLI app.
 
This file contains miscellaneous commonly used macros and functions.
 
PCB::IFACE KIFACE_BASE, UNITS_PROVIDER kiface("pcbnew", KIWAY::FACE_PCB)
 
void InvokePcbLibTableEditor(KIWAY *aKiway, wxWindow *aCaller)
Function InvokePcbLibTableEditor shows the modal DIALOG_FP_LIB_TABLE for purposes of editing the glob...
 
PyObject * PyInit__pcbnew(void)
 
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
 
void ScriptingSetPcbEditFrame(PCB_EDIT_FRAME *aPcbEditFrame)
 
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.
 
Implement a participant in the KIWAY alchemy.
 
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
 
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 * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
 
void Reset() override
Reloads global state.
 
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
 
IFACE(const char *aName, KIWAY::FACE_T aType)
 
int HandleJob(JOB *aJob, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter) override
 
bool loadGlobalLibTable()
 
std::unique_ptr< PCBNEW_JOBS_HANDLER > m_jobHandler
 
bool HandleJobConfig(JOB *aJob, wxWindow *aParent) override
 
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
 
Definition of file extensions used in Kicad.