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 (C) 1992-2023 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>
62#include <python_scripting.h>
63
64#include "invoke_pcb_dialog.h"
66#include "pcbnew_jobs_handler.h"
67
68#include <wx/crt.h>
69
70/* init functions defined by swig */
71
72extern "C" PyObject* PyInit__pcbnew( void );
73
74namespace PCB {
75
76static struct IFACE : public KIFACE_BASE, public UNITS_PROVIDER
77{
78 // Of course all are virtual overloads, implementations of the KIFACE.
79
80 IFACE( const char* aName, KIWAY::FACE_T aType ) :
81 KIFACE_BASE( aName, aType ),
83 {}
84
85 bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway ) override;
86
87 void Reset() override;
88
89 void OnKifaceEnd() override;
90
91 wxWindow* CreateKiWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway,
92 int aCtlBits = 0 ) override
93 {
94 switch( aClassId )
95 {
97 {
98 auto frame = new PCB_EDIT_FRAME( aKiway, aParent );
99
100 // give the scripting helpers access to our frame
102
103 if( Kiface().IsSingle() )
104 {
105 // only run this under single_top, not under a project manager.
106 frame->CreateServer( KICAD_PCB_PORT_SERVICE_NUMBER );
107 }
108
109 return frame;
110 }
111
113 return new FOOTPRINT_EDIT_FRAME( aKiway, aParent );
114
116 return new FOOTPRINT_VIEWER_FRAME( aKiway, aParent );
117
119 return new FOOTPRINT_CHOOSER_FRAME( aKiway, aParent );
120
122 return new FOOTPRINT_WIZARD_FRAME( aKiway, aParent, FRAME_T( aClassId ) );
123
125 return FOOTPRINT_PREVIEW_PANEL::New( aKiway, aParent, this );
126
128 {
129 DIALOG_CONFIGURE_PATHS dlg( aParent );
130
131 // The dialog's constructor probably failed to set its Kiway because the
132 // dynamic_cast fails when aParent was allocated by a separate compilation
133 // module. So set it directly.
134 dlg.SetKiway( &dlg, aKiway );
135
136 // Use QuasiModal so that HTML help window will work
137 if( dlg.ShowQuasiModal() == wxID_OK )
138 aKiway->CommonSettingsChanged( true, false );
139
140 // Dialog has completed; nothing to return.
141 return nullptr;
142 }
143
145 InvokePcbLibTableEditor( aKiway, aParent );
146 // Dialog has completed; nothing to return.
147 return nullptr;
148
150 {
151 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
153
154 return new PANEL_PCB_DISPLAY_OPTIONS( aParent, cfg );
155 }
156
157 case PANEL_FP_GRIDS:
158 {
159 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
161 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
162
163 if( !frame )
164 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
165
166 if( !frame )
167 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
168
169 if( frame )
170 SetUserUnits( frame->GetUserUnits() );
171
172 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_FOOTPRINT_EDITOR );
173 }
174
176 {
177 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
179
180 return new PANEL_PCBNEW_DISPLAY_ORIGIN( aParent, cfg, FRAME_FOOTPRINT_EDITOR );
181 }
182
184 {
185 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
186
187 if( !frame )
188 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
189
190 if( !frame )
191 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
192
193 if( frame )
194 SetUserUnits( frame->GetUserUnits() );
195
196 return new PANEL_EDIT_OPTIONS( aParent, this, frame, true );
197 }
198
200 {
201 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
202
203 if( !frame )
204 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
205
206 if( !frame )
207 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
208
209 if( frame )
210 SetUserUnits( frame->GetUserUnits() );
211
212 return new PANEL_FP_EDITOR_DEFAULTS( aParent, this );
213 }
214
215 case PANEL_FP_COLORS:
216 return new PANEL_FP_EDITOR_COLOR_SETTINGS( aParent );
217
219 {
220 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
222
223 return new PANEL_PCB_DISPLAY_OPTIONS( aParent, cfg );
224 }
225
226 case PANEL_PCB_GRIDS:
227 {
228 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
230 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_PCB_EDITOR, false );
231
232 if( !frame )
233 frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
234
235 if( !frame )
236 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
237
238 if( frame )
239 SetUserUnits( frame->GetUserUnits() );
240
241 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_PCB_EDITOR );
242 }
243
245 {
246 SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager();
248
249 return new PANEL_PCBNEW_DISPLAY_ORIGIN( aParent, cfg, FRAME_PCB_EDITOR );
250 }
251
253 {
254 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_PCB_EDITOR, false );
255
256 if( !frame )
257 frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
258
259 if( !frame )
260 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
262 if( frame )
263 SetUserUnits( frame->GetUserUnits() );
265 return new PANEL_EDIT_OPTIONS( aParent, this, frame, false );
267
268 case PANEL_PCB_COLORS:
269 {
270 BOARD* board = nullptr;
271 EDA_BASE_FRAME* boardProvider = aKiway->Player( FRAME_PCB_EDITOR, false );
272
273 if( boardProvider )
274 board = static_cast<PCB_EDIT_FRAME*>( boardProvider )->GetBoard();
275
276 return new PANEL_PCBNEW_COLOR_SETTINGS( aParent, board );
277 }
278
280 return new PANEL_PCBNEW_ACTION_PLUGINS( aParent );
281
283 return new PANEL_3D_DISPLAY_OPTIONS( aParent );
284
285 case PANEL_3DV_OPENGL:
286 return new PANEL_3D_OPENGL_OPTIONS( aParent );
287
289 return new PANEL_3D_RAYTRACING_OPTIONS( aParent );
290
291 default:
292 return nullptr;
293 }
294 }
295
306 void* IfaceOrAddress( int aDataId ) override
307 {
308 switch( aDataId )
309 {
310 // Return a pointer to the global instance of the footprint list.
312 return (void*) &GFootprintList;
313
314 // Return a new FP_LIB_TABLE with the global table installed as a fallback.
316 return (void*) new FP_LIB_TABLE( &GFootprintTable );
317
318 // Return a pointer to the global instance of the global footprint table.
320 return (void*) &GFootprintTable;
321
323 return reinterpret_cast<void*>( PyInit__pcbnew );
324
325 default:
326 return nullptr;
327 }
328 }
329
335 void SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcProjectName,
336 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
337 const wxString& aSrcFilePath, wxString& aErrors ) override;
338
339 int HandleJob( JOB* aJob ) override;
340
341private:
342 bool loadGlobalLibTable();
343
344 std::unique_ptr<PCBNEW_JOBS_HANDLER> m_jobHandler;
345
346} kiface( "pcbnew", KIWAY::FACE_PCB );
347
348} // namespace
349
350
351using namespace PCB;
352
353
355
356
358
359
360// KIFACE_GETTER's actual spelling is a substitution macro found in kiway.h.
361// KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
362KIFACE_API KIFACE* KIFACE_GETTER( int* aKIFACEversion, int aKiwayVersion, PGM_BASE* aProgram )
363{
364 process = aProgram;
365 return &kiface;
366}
367
368
369#if defined( BUILD_KIWAY_DLL )
370PGM_BASE& Pgm()
371{
372 wxASSERT( process ); // KIFACE_GETTER has already been called.
373 return *process;
374}
375
376
377// Similar to PGM_BASE& Pgm(), but return nullptr when a *.ki_face is run from a python script.
379{
380 return process;
381}
382#endif
383
384
389
394
395
396bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway )
397{
398 // This is process-level-initialization, not project-level-initialization of the DSO.
399 // Do nothing in here pertinent to a project!
403
404 // We intentionally register KifaceSettings after FOOTPRINT_EDITOR_SETTINGS and EDA_3D_VIEWER_SETTINGS
405 // In legacy configs, many settings were in a single editor config and the migration routine
406 // for the main editor file will try and call into the now separate settings stores
407 // to move the settings into them
409
410 // Register the footprint editor settings as well because they share a KiFACE and need to be
411 // loaded prior to use to avoid threading deadlocks
413
414 start_common( aCtlBits );
415
416 if( !loadGlobalLibTable() )
417 {
418 // we didnt get anywhere deregister the
420 aProgram->GetSettingsManager().GetAppSettings<CVPCB_SETTINGS>(), false );
421
422 aProgram->GetSettingsManager().FlushAndRelease( KifaceSettings(), false );
423
426
429
430 return false;
431 }
432
433 m_jobHandler = std::make_unique<PCBNEW_JOBS_HANDLER>( aKiway );
434
436 {
437 m_jobHandler->SetReporter( &CLI_REPORTER::GetInstance() );
438 m_jobHandler->SetProgressReporter( &CLI_PROGRESS_REPORTER::GetInstance() );
439 }
440
441 return true;
442}
443
444
446{
448}
449
450
452{
453 wxFileName fn = FP_LIB_TABLE::GetGlobalTableFileName();
454
455 if( !fn.FileExists() )
456 {
457 if( !( m_start_flags & KFCTL_CLI ) )
458 {
459 // Ensure the splash screen does not hide the dialog:
460 Pgm().HideSplash();
461
462 DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG fpDialog( nullptr );
463
464 if( fpDialog.ShowModal() != wxID_OK )
465 return false;
466 }
467 }
468 else
469 {
470 try
471 {
472 // The global table is not related to a specific project. All projects
473 // will use the same global table. So the KIFACE::OnKifaceStart() contract
474 // of avoiding anything project specific is not violated here.
476 return false;
477 }
478 catch( const IO_ERROR& ioe )
479 {
480 // if we are here, a incorrect global footprint library table was found.
481 // Incorrect global symbol library table is not a fatal error:
482 // the user just has to edit the (partially) loaded table.
483 wxString msg = _( "An error occurred attempting to load the global footprint library "
484 "table.\n"
485 "Please edit this global footprint library table in Preferences "
486 "menu." );
487
488 DisplayErrorMessage( nullptr, msg, ioe.What() );
489 }
490 }
491
492 return true;
493}
494
495
497{
498 end_common();
499}
500
501
502void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcProjectName,
503 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
504 const wxString& aSrcFilePath, wxString& aErrors )
505{
506 wxFileName destFile( aSrcFilePath );
507 wxString destPath = destFile.GetPathWithSep();
508 wxUniChar pathSep = wxFileName::GetPathSeparator();
509 wxString ext = destFile.GetExt();
510
511 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
512 destPath.Replace( aProjectBasePath, aNewProjectBasePath, false );
513
514 wxString srcProjectFootprintLib = pathSep + aSrcProjectName + wxT( ".pretty" ) + pathSep;
515 wxString newProjectFootprintLib = pathSep + aNewProjectName + wxT( ".pretty" ) + pathSep;
516
517 destPath.Replace( srcProjectFootprintLib, newProjectFootprintLib, true );
518
519 destFile.SetPath( destPath );
520
523 {
524 if( destFile.GetName() == aSrcProjectName )
525 destFile.SetName( aNewProjectName );
526
527 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
528 }
529 else if( ext == FILEEXT::LegacyPcbFileExtension )
530 {
531 if( destFile.GetName() == aSrcProjectName )
532 destFile.SetName( aNewProjectName );
533
534 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
535 }
538 {
539 // Footprints are not project-specific. Keep their source names.
540 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
541 }
543 {
544 // TODO
545 }
546 else if( ext == wxT( "rpt" ) )
547 {
548 // DRC must be the "gold standard". Since we can't guarantee that there aren't
549 // any non-deterministic cases in the save-as algorithm, we don't want to certify
550 // the result with the source's DRC report. Therefore copy it under the old
551 // name.
552 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
553 }
554 else if( destFile.GetName() == wxT( "fp-lib-table" ) )
555 {
556 try
557 {
558 FP_LIB_TABLE fpLibTable;
559 fpLibTable.Load( aSrcFilePath );
560
561 for( unsigned i = 0; i < fpLibTable.GetCount(); i++ )
562 {
563 LIB_TABLE_ROW& row = fpLibTable.At( i );
564 wxString uri = row.GetFullURI();
565
566 uri.Replace( wxT( "/" ) + aSrcProjectName + wxT( ".pretty" ),
567 wxT( "/" ) + aNewProjectName + wxT( ".pretty" ) );
568
569 row.SetFullURI( uri );
570 }
571
572 fpLibTable.Save( destFile.GetFullPath() );
573 }
574 catch( ... )
575 {
576 wxString msg;
577
578 if( !aErrors.empty() )
579 aErrors += wxT( "\n" );
580
581 msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() );
582 aErrors += msg;
583 }
584 }
585 else
586 {
587 wxFAIL_MSG( wxT( "Unexpected filetype for Pcbnew::SaveFileAs()" ) );
588 }
589}
590
591
593{
594 return m_jobHandler->RunJob( aJob );
595}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:109
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
Definition: app_settings.h:92
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:276
static PROGRESS_REPORTER & GetInstance()
static REPORTER & GetInstance()
Definition: reporter.cpp:146
int ShowQuasiModal()
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:32
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:279
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
Definition: kiway.cpp:643
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:432
FACE_T
Known KIFACE implementations.
Definition: kiway.h:285
@ FACE_PCB
pcbnew DSO
Definition: kiway.h:287
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:96
virtual SETTINGS_MANAGER & GetSettingsManager() const
Definition: pgm_base.h:136
T * GetAppSettings()
Returns a handle to the a given settings by type If the settings have already been loaded,...
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Takes 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.
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:305
This file is part of the common library.
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
Definition: cvpcb.cpp:160
FP_LIB_TABLE GFootprintTable
The global footprint library table.
Definition: cvpcb.cpp:169
#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:175
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:93
@ FRAME_PCB_EDITOR
Definition: frame_type.h:42
@ FRAME_FOOTPRINT_VIEWER
Definition: frame_type.h:45
@ PANEL_3DV_OPENGL
Definition: frame_type.h:100
@ PANEL_PCB_ORIGINS_AXES
Definition: frame_type.h:97
@ FRAME_FOOTPRINT_WIZARD
Definition: frame_type.h:46
@ PANEL_PCB_EDIT_OPTIONS
Definition: frame_type.h:94
@ PANEL_FP_DISPLAY_OPTIONS
Definition: frame_type.h:85
@ PANEL_PCB_COLORS
Definition: frame_type.h:95
@ PANEL_3DV_RAYTRACING
Definition: frame_type.h:101
@ DIALOG_PCB_LIBRARY_TABLE
Definition: frame_type.h:116
@ 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:90
@ PANEL_PCB_DISPLAY_OPTS
Definition: frame_type.h:92
@ DIALOG_CONFIGUREPATHS
Definition: frame_type.h:114
@ PANEL_FP_COLORS
Definition: frame_type.h:88
@ 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:96
@ PANEL_FP_DEFAULT_VALUES
Definition: frame_type.h:89
@ PANEL_3DV_DISPLAY_OPTIONS
Definition: frame_type.h:99
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
Definition: gestfich.cpp:305
static const std::string LegacyPcbFileExtension
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:57
@ 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:160
#define KIFACE_GETTER
Definition: kiway.h:111
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)
static PGM_BASE * process
Definition: pcbnew.cpp:354
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
Definition: pcbnew.cpp:357
FP_LIB_TABLE GFootprintTable
The global footprint library table.
Definition: pcbnew.cpp:388
FOOTPRINT_LIST_IMPL GFootprintList
The global footprint info table.
Definition: pcbnew.cpp:393
void ScriptingSetPcbEditFrame(PCB_EDIT_FRAME *aPcbEditFrame)
BOARD * GetBoard()
see class PGM_BASE
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:119
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:151
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
Definition: pcbnew.cpp:396
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:502
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
Definition: pcbnew.cpp:306
void Reset() override
Reloads global state.
Definition: pcbnew.cpp:445
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
Definition: pcbnew.cpp:91
IFACE(const char *aName, KIWAY::FACE_T aType)
Definition: pcbnew.cpp:80
bool loadGlobalLibTable()
Definition: pcbnew.cpp:451
std::unique_ptr< PCBNEW_JOBS_HANDLER > m_jobHandler
Definition: pcbnew.cpp:344
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
Definition: pcbnew.cpp:496
int HandleJob(JOB *aJob) override
Definition: pcbnew.cpp:592
Definition of file extensions used in Kicad.