KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
27#include <pgm_base.h>
29#include <confirm.h>
30#include <kiface_base.h>
31#include <kiface_ids.h>
32#include <pcb_edit_frame.h>
33#include <eda_dde.h>
34#include <macros.h>
35#include <wx/snglinst.h>
36#include <gestfich.h>
37#include <paths.h>
38#include <pcbnew_settings.h>
42#include <fp_lib_table.h>
48#include <footprint_info_impl.h>
53#include <panel_edit_options.h>
63#include <python_scripting.h>
64
65#include "invoke_pcb_dialog.h"
67#include "pcbnew_jobs_handler.h"
68
69#include <wx/crt.h>
70
71/* init functions defined by swig */
72
73extern "C" PyObject* PyInit__pcbnew( void );
74
75namespace PCB {
76
77static struct IFACE : public KIFACE_BASE, public UNITS_PROVIDER
78{
79 // Of course all are virtual overloads, implementations of the KIFACE.
80
81 IFACE( const char* aName, KIWAY::FACE_T aType ) :
82 KIFACE_BASE( aName, aType ),
84 {}
85
86 bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway ) override;
87
88 void Reset() override;
89
90 void OnKifaceEnd() override;
91
92 wxWindow* CreateKiWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway,
93 int aCtlBits = 0 ) override
94 {
95 switch( aClassId )
96 {
98 {
99 auto frame = new PCB_EDIT_FRAME( aKiway, aParent );
100
101 // give the scripting helpers access to our frame
103
104 if( Kiface().IsSingle() )
105 {
106 // only run this under single_top, not under a project manager.
107 frame->CreateServer( KICAD_PCB_PORT_SERVICE_NUMBER );
108 }
109
110 return frame;
111 }
112
114 return new FOOTPRINT_EDIT_FRAME( aKiway, aParent );
115
117 return new FOOTPRINT_VIEWER_FRAME( aKiway, aParent );
118
120 return new FOOTPRINT_CHOOSER_FRAME( aKiway, aParent );
121
123 return new FOOTPRINT_WIZARD_FRAME( aKiway, aParent, FRAME_T( aClassId ) );
124
126 return FOOTPRINT_PREVIEW_PANEL::New( aKiway, aParent, this );
127
129 {
130 DIALOG_CONFIGURE_PATHS dlg( aParent );
131
132 // The dialog's constructor probably failed to set its Kiway because the
133 // dynamic_cast fails when aParent was allocated by a separate compilation
134 // module. So set it directly.
135 dlg.SetKiway( &dlg, aKiway );
136
137 // Use QuasiModal so that HTML help window will work
138 if( dlg.ShowQuasiModal() == wxID_OK )
139 aKiway->CommonSettingsChanged( true, false );
140
141 // Dialog has completed; nothing to return.
142 return nullptr;
143 }
144
146 InvokePcbLibTableEditor( aKiway, aParent );
147 // Dialog has completed; nothing to return.
148 return nullptr;
149
151 {
154
155 return new PANEL_PCB_DISPLAY_OPTIONS( aParent, cfg );
156 }
157
158 case PANEL_FP_GRIDS:
159 {
162 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
163
164 if( !frame )
165 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
166
167 if( !frame )
168 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
169
170 if( frame )
171 SetUserUnits( frame->GetUserUnits() );
172
173 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_FOOTPRINT_EDITOR );
174 }
175
177 {
180
181 return new PANEL_PCBNEW_DISPLAY_ORIGIN( aParent, cfg, FRAME_FOOTPRINT_EDITOR );
182 }
183
185 {
186 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
187
188 if( !frame )
189 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
190
191 if( !frame )
192 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
193
194 if( frame )
195 SetUserUnits( frame->GetUserUnits() );
196
197 return new PANEL_EDIT_OPTIONS( aParent, this, frame, true );
198 }
199
201 {
202 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
203
204 if( !frame )
205 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
206
207 if( !frame )
208 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
209
210 if( frame )
211 SetUserUnits( frame->GetUserUnits() );
212
213 return new PANEL_FP_EDITOR_FIELD_DEFAULTS( aParent, this );
214 }
215
217 {
218 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
219
220 if( !frame )
221 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
222
223 if( !frame )
224 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
225
226 if( frame )
227 SetUserUnits( frame->GetUserUnits() );
228
229 return new PANEL_FP_EDITOR_GRAPHICS_DEFAULTS( aParent, this );
230 }
231
232 case PANEL_FP_COLORS:
233 return new PANEL_FP_EDITOR_COLOR_SETTINGS( aParent );
234
236 {
238 PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
239
240 return new PANEL_PCB_DISPLAY_OPTIONS( aParent, cfg );
241 }
242
243 case PANEL_PCB_GRIDS:
246 PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
247 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_PCB_EDITOR, false );
248
249 if( !frame )
250 frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
251
252 if( !frame )
253 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
254
255 if( frame )
256 SetUserUnits( frame->GetUserUnits() );
257
258 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_PCB_EDITOR );
259 }
260
262 {
264 PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
265
266 return new PANEL_PCBNEW_DISPLAY_ORIGIN( aParent, cfg, FRAME_PCB_EDITOR );
267 }
268
270 {
271 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_PCB_EDITOR, false );
272
273 if( !frame )
274 frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
275
276 if( !frame )
277 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
278
279 if( frame )
280 SetUserUnits( frame->GetUserUnits() );
281
282 return new PANEL_EDIT_OPTIONS( aParent, this, frame, false );
283 }
285 case PANEL_PCB_COLORS:
286 {
287 BOARD* board = nullptr;
288 EDA_BASE_FRAME* boardProvider = aKiway->Player( FRAME_PCB_EDITOR, false );
289
290 if( boardProvider )
291 board = static_cast<PCB_EDIT_FRAME*>( boardProvider )->GetBoard();
292
293 return new PANEL_PCBNEW_COLOR_SETTINGS( aParent, board );
294 }
295
297 return new PANEL_PCBNEW_ACTION_PLUGINS( aParent );
298
300 return new PANEL_3D_DISPLAY_OPTIONS( aParent );
301
302 case PANEL_3DV_OPENGL:
303 return new PANEL_3D_OPENGL_OPTIONS( aParent );
304
306 return new PANEL_3D_RAYTRACING_OPTIONS( aParent );
307
308 default:
309 return nullptr;
310 }
311 }
312
323 void* IfaceOrAddress( int aDataId ) override
324 {
325 switch( aDataId )
326 {
327 // Return a pointer to the global instance of the footprint list.
329 return (void*) &GFootprintList;
330
331 // Return a new FP_LIB_TABLE with the global table installed as a fallback.
333 return (void*) new FP_LIB_TABLE( &GFootprintTable );
334
335 // Return a pointer to the global instance of the global footprint table.
337 return (void*) &GFootprintTable;
338
340 return reinterpret_cast<void*>( PyInit__pcbnew );
341
342 default:
343 return nullptr;
344 }
345 }
346
352 void SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcProjectName,
353 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
354 const wxString& aSrcFilePath, wxString& aErrors ) override;
355
356 int HandleJob( JOB* aJob, REPORTER* aReporter ) override;
357
358 bool HandleJobConfig( JOB* aJob, wxWindow* aParent ) override;
359
360private:
361 bool loadGlobalLibTable();
362
363 std::unique_ptr<PCBNEW_JOBS_HANDLER> m_jobHandler;
364
365} kiface( "pcbnew", KIWAY::FACE_PCB );
366
367} // namespace
368
369
370using namespace PCB;
371
372
374
375
376// KIFACE_GETTER's actual spelling is a substitution macro found in kiway.h.
377// KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
378KIFACE_API KIFACE* KIFACE_GETTER( int* aKIFACEversion, int aKiwayVersion, PGM_BASE* aProgram )
379{
380 return &kiface;
381}
382
383
388
393
394
395bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway )
396{
397 // This is process-level-initialization, not project-level-initialization of the DSO.
398 // Do nothing in here pertinent to a project!
400
401 SETTINGS_MANAGER& mgr = aProgram->GetSettingsManager();
402
405
406 // We intentionally register KifaceSettings after FOOTPRINT_EDITOR_SETTINGS and EDA_3D_VIEWER_SETTINGS
407 // In legacy configs, many settings were in a single editor config and the migration routine
408 // for the main editor file will try and call into the now separate settings stores
409 // to move the settings into them
411
412 // Register the footprint editor settings as well because they share a KiFACE and need to be
413 // loaded prior to use to avoid threading deadlocks
415
416 start_common( aCtlBits );
417
418 if( !loadGlobalLibTable() )
419 {
420 // we didnt get anywhere deregister the settings
421 mgr.FlushAndRelease( mgr.GetAppSettings<CVPCB_SETTINGS>( "cvpcb" ), false );
422 mgr.FlushAndRelease( KifaceSettings(), false );
423 mgr.FlushAndRelease( mgr.GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>( "fpedit" ), false );
424 mgr.FlushAndRelease( mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ), false );
425
426 return false;
427 }
428
429 m_jobHandler = std::make_unique<PCBNEW_JOBS_HANDLER>( aKiway );
430
432 {
433 m_jobHandler->SetReporter( &CLI_REPORTER::GetInstance() );
434 m_jobHandler->SetProgressReporter( &CLI_PROGRESS_REPORTER::GetInstance() );
435 }
436
437 return true;
438}
439
440
442{
444}
445
446
448{
449 wxFileName fn = FP_LIB_TABLE::GetGlobalTableFileName();
450
451 if( !fn.FileExists() )
452 {
453 if( !( m_start_flags & KFCTL_CLI ) )
454 {
455 // Ensure the splash screen does not hide the dialog:
456 Pgm().HideSplash();
457
458 DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG fpDialog( nullptr );
459
460 if( fpDialog.ShowModal() != wxID_OK )
461 return false;
462 }
463 }
464 else
465 {
466 try
467 {
468 // The global table is not related to a specific project. All projects
469 // will use the same global table. So the KIFACE::OnKifaceStart() contract
470 // of avoiding anything project specific is not violated here.
472 return false;
473 }
474 catch( const IO_ERROR& ioe )
475 {
476 // if we are here, a incorrect global footprint library table was found.
477 // Incorrect global symbol library table is not a fatal error:
478 // the user just has to edit the (partially) loaded table.
479 wxString msg = _( "An error occurred attempting to load the global footprint library "
480 "table.\n"
481 "Please edit this global footprint library table in Preferences "
482 "menu." );
483
484 DisplayErrorMessage( nullptr, msg, ioe.What() );
485 }
486 }
487
488 return true;
489}
490
491
493{
494 end_common();
495}
496
497
498void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcProjectName,
499 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
500 const wxString& aSrcFilePath, wxString& aErrors )
501{
502 wxFileName destFile( aSrcFilePath );
503 wxString destPath = destFile.GetPathWithSep();
504 wxUniChar pathSep = wxFileName::GetPathSeparator();
505 wxString ext = destFile.GetExt();
506
507 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
508 destPath.Replace( aProjectBasePath, aNewProjectBasePath, false );
509
510 wxString srcProjectFootprintLib = pathSep + aSrcProjectName + wxT( ".pretty" ) + pathSep;
511 wxString newProjectFootprintLib = pathSep + aNewProjectName + wxT( ".pretty" ) + pathSep;
512
513 destPath.Replace( srcProjectFootprintLib, newProjectFootprintLib, true );
514
515 destFile.SetPath( destPath );
516
519 {
520 if( destFile.GetName() == aSrcProjectName )
521 destFile.SetName( aNewProjectName );
522
523 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
524 }
525 else if( ext == FILEEXT::LegacyPcbFileExtension )
526 {
527 if( destFile.GetName() == aSrcProjectName )
528 destFile.SetName( aNewProjectName );
529
530 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
531 }
534 {
535 // Footprints are not project-specific. Keep their source names.
536 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
537 }
539 {
540 // TODO
541 }
542 else if( ext == wxT( "rpt" ) )
543 {
544 // DRC must be the "gold standard". Since we can't guarantee that there aren't
545 // any non-deterministic cases in the save-as algorithm, we don't want to certify
546 // the result with the source's DRC report. Therefore copy it under the old
547 // name.
548 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
549 }
550 else if( destFile.GetName() == FILEEXT::FootprintLibraryTableFileName )
551 {
552 try
553 {
554 FP_LIB_TABLE fpLibTable;
555 fpLibTable.Load( aSrcFilePath );
556
557 for( unsigned i = 0; i < fpLibTable.GetCount(); i++ )
558 {
559 LIB_TABLE_ROW& row = fpLibTable.At( i );
560 wxString uri = row.GetFullURI();
561
562 uri.Replace( wxT( "/" ) + aSrcProjectName + wxT( ".pretty" ),
563 wxT( "/" ) + aNewProjectName + wxT( ".pretty" ) );
564
565 row.SetFullURI( uri );
566 }
567
568 fpLibTable.Save( destFile.GetFullPath() );
569 }
570 catch( ... )
571 {
572 wxString msg;
573
574 if( !aErrors.empty() )
575 aErrors += wxT( "\n" );
576
577 msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() );
578 aErrors += msg;
579 }
580 }
581 else
582 {
583 wxFAIL_MSG( wxT( "Unexpected filetype for Pcbnew::SaveFileAs()" ) );
584 }
585}
586
587
588int IFACE::HandleJob( JOB* aJob, REPORTER* aReporter )
589{
590 return m_jobHandler->RunJob( aJob, aReporter );
591}
592
593
594bool IFACE::HandleJobConfig( JOB* aJob, wxWindow* aParent )
595{
596 return m_jobHandler->HandleJobConfig( aJob, aParent );
597}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:108
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:295
static PROGRESS_REPORTER & GetInstance()
static REPORTER & GetInstance()
Definition: reporter.cpp:142
int ShowQuasiModal()
int ShowModal() override
The base frame for deriving all KiCad main window classes.
static FOOTPRINT_PREVIEW_PANEL * New(KIWAY *aKiway, wxWindow *aParent, UNITS_PROVIDER *aUnitsProvider)
Component library viewer main window.
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.
Definition: ki_exception.h:77
virtual const wxString What() const
A composite of Problem() and Where()
Definition: exceptions.cpp:30
An simple container class that lets us dispatch output jobs to kifaces.
Definition: job.h:182
A KIFACE implementation.
Definition: kiface_base.h:39
void InitSettings(APP_SETTINGS_BASE *aSettings)
Definition: kiface_base.h:97
void end_common()
Common things to do for a top program module, during OnKifaceEnd();.
Definition: kiface_base.cpp:42
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_base.h:95
bool start_common(int aCtlBits)
Common things to do for a top program module, during OnKifaceStart().
Definition: kiface_base.cpp:32
int m_start_flags
flags provided in OnKifaceStart()
Definition: kiface_base.h:125
bool IsSingle() const
Is this KIFACE running under single_top?
Definition: kiface_base.h:107
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...
Definition: kiway.h:285
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
Definition: kiway.cpp:617
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:406
FACE_T
Known KIFACE implementations.
Definition: kiway.h:291
@ FACE_PCB
pcbnew DSO
Definition: kiway.h:293
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.
Definition: pgm_base.h:103
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:125
void HideSplash()
Definition: pgm_base.cpp:446
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:72
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Take ownership of the pointer passed in.
T * GetAppSettings(const wxString &aFilename)
Return a handle to the a given settings by type.
void FlushAndRelease(JSON_SETTINGS *aSettings, bool aSave=true)
If the given settings object is registered, save it to disk and unregister it.
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.
Definition: confirm.cpp:195
This file is part of the common library.
FP_LIB_TABLE GFootprintTable
The global footprint library table.
Definition: cvpcb.cpp:150
#define _(s)
DDE server & client.
#define KICAD_PCB_PORT_SERVICE_NUMBER
Pcbnew listens on this port for commands from Eeschema.
Definition: eda_dde.h:40
EDA_UNITS
Definition: eda_units.h:46
FOOTPRINT_LIST_IMPL GFootprintList
The global footprint info table.
Definition: cvpcb.cpp:156
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:33
@ PANEL_PCB_GRIDS
Definition: frame_type.h:94
@ FRAME_PCB_EDITOR
Definition: frame_type.h:42
@ FRAME_FOOTPRINT_VIEWER
Definition: frame_type.h:45
@ PANEL_3DV_OPENGL
Definition: frame_type.h:101
@ PANEL_FP_DEFAULT_GRAPHICS_VALUES
Definition: frame_type.h:90
@ PANEL_PCB_ORIGINS_AXES
Definition: frame_type.h:98
@ FRAME_FOOTPRINT_WIZARD
Definition: frame_type.h:46
@ PANEL_PCB_EDIT_OPTIONS
Definition: frame_type.h:95
@ PANEL_FP_DISPLAY_OPTIONS
Definition: frame_type.h:85
@ PANEL_PCB_COLORS
Definition: frame_type.h:96
@ PANEL_3DV_RAYTRACING
Definition: frame_type.h:102
@ DIALOG_PCB_LIBRARY_TABLE
Definition: frame_type.h:118
@ FRAME_FOOTPRINT_PREVIEW
Definition: frame_type.h:48
@ FRAME_FOOTPRINT_CHOOSER
Definition: frame_type.h:44
@ PANEL_FP_GRIDS
Definition: frame_type.h:86
@ PANEL_FP_ORIGINS_AXES
Definition: frame_type.h:91
@ PANEL_PCB_DISPLAY_OPTS
Definition: frame_type.h:93
@ DIALOG_CONFIGUREPATHS
Definition: frame_type.h:115
@ PANEL_FP_COLORS
Definition: frame_type.h:88
@ PANEL_FP_DEFAULT_FIELDS
Definition: frame_type.h:89
@ FRAME_FOOTPRINT_EDITOR
Definition: frame_type.h:43
@ PANEL_FP_EDIT_OPTIONS
Definition: frame_type.h:87
@ PANEL_PCB_ACTION_PLUGINS
Definition: frame_type.h:97
@ PANEL_3DV_DISPLAY_OPTIONS
Definition: frame_type.h:100
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
Definition: gestfich.cpp:290
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
#define KIFACE_API
Definition: import_export.h:61
@ KIFACE_SCRIPTING_LEGACY
Definition: kiface_ids.h:56
@ KIFACE_FOOTPRINT_LIST
Return a pointer to the global instance of FOOTPRINT_LIST from pcbnew.
Definition: kiface_ids.h:39
@ KIFACE_GLOBAL_FOOTPRINT_TABLE
Return the global FP_LIB_TABLE.
Definition: kiface_ids.h:53
@ KIFACE_NEW_FOOTPRINT_TABLE
Return a new FP_LIB_TABLE with the global table installed as a fallback.
Definition: kiface_ids.h:46
#define KFCTL_CLI
Running as CLI app.
Definition: kiway.h:161
#define KIFACE_GETTER
Definition: kiway.h:110
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.
Definition: pcbnew.cpp:373
FP_LIB_TABLE GFootprintTable
The global footprint library table.
Definition: pcbnew.cpp:387
FOOTPRINT_LIST_IMPL GFootprintList
The global footprint info table.
Definition: pcbnew.cpp:392
void ScriptingSetPcbEditFrame(PCB_EDIT_FRAME *aPcbEditFrame)
BOARD * GetBoard()
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1073
see class PGM_BASE
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
Implement a participant in the KIWAY alchemy.
Definition: kiway.h:152
int HandleJob(JOB *aJob, REPORTER *aReporter) override
Definition: pcbnew.cpp:588
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
Definition: pcbnew.cpp:395
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 ...
Definition: pcbnew.cpp:498
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
Definition: pcbnew.cpp:323
void Reset() override
Reloads global state.
Definition: pcbnew.cpp:441
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
Definition: pcbnew.cpp:92
IFACE(const char *aName, KIWAY::FACE_T aType)
Definition: pcbnew.cpp:81
bool loadGlobalLibTable()
Definition: pcbnew.cpp:447
std::unique_ptr< PCBNEW_JOBS_HANDLER > m_jobHandler
Definition: pcbnew.cpp:363
bool HandleJobConfig(JOB *aJob, wxWindow *aParent) override
Definition: pcbnew.cpp:594
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
Definition: pcbnew.cpp:492
Definition of file extensions used in Kicad.