KiCad PCB EDA Suite
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
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 <dick@softplc.com>
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
72#include <toolbars_pcb_editor.h>
73
74#include <wx/crt.h>
75
76/* init functions defined by swig */
77
78extern "C" PyObject* PyInit__pcbnew( void );
79
80namespace PCB {
81
82static struct IFACE : public KIFACE_BASE, public UNITS_PROVIDER
83{
84 // Of course all are virtual overloads, implementations of the KIFACE.
85
86 IFACE( const char* aName, KIWAY::FACE_T aType ) :
87 KIFACE_BASE( aName, aType ),
89 {}
90
91 bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway ) override;
92
93 void Reset() override;
94
95 void OnKifaceEnd() override;
96
97 wxWindow* CreateKiWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway,
98 int aCtlBits = 0 ) override
99 {
100 switch( aClassId )
101 {
102 case FRAME_PCB_EDITOR:
103 {
104 auto frame = new PCB_EDIT_FRAME( aKiway, aParent );
105
106 // give the scripting helpers access to our frame
108
109 if( Kiface().IsSingle() )
110 {
111 // only run this under single_top, not under a project manager.
112 frame->CreateServer( KICAD_PCB_PORT_SERVICE_NUMBER );
113 }
114
115 return frame;
116 }
117
119 return new FOOTPRINT_EDIT_FRAME( aKiway, aParent );
120
122 return new FOOTPRINT_VIEWER_FRAME( aKiway, aParent );
123
125 return new FOOTPRINT_CHOOSER_FRAME( aKiway, aParent );
126
128 return new FOOTPRINT_WIZARD_FRAME( aKiway, aParent, FRAME_T( aClassId ) );
129
131 return FOOTPRINT_PREVIEW_PANEL::New( aKiway, aParent, this );
132
134 {
135 DIALOG_CONFIGURE_PATHS dlg( aParent );
136
137 // The dialog's constructor probably failed to set its Kiway because the
138 // dynamic_cast fails when aParent was allocated by a separate compilation
139 // module. So set it directly.
140 dlg.SetKiway( &dlg, aKiway );
141
142 // Use QuasiModal so that HTML help window will work
143 if( dlg.ShowQuasiModal() == wxID_OK )
145
146 // Dialog has completed; nothing to return.
147 return nullptr;
148 }
149
151 InvokePcbLibTableEditor( aKiway, aParent );
152 // Dialog has completed; nothing to return.
153 return nullptr;
154
156 {
159
160 return new PANEL_DISPLAY_OPTIONS( aParent, cfg );
161 }
162
163 case PANEL_FP_GRIDS:
164 {
167 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
168
169 if( !frame )
170 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
171
172 if( !frame )
173 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
174
175 if( frame )
176 SetUserUnits( frame->GetUserUnits() );
177
178 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_FOOTPRINT_EDITOR );
179 }
180
182 {
185
186 return new PANEL_PCBNEW_DISPLAY_ORIGIN( aParent, cfg, FRAME_FOOTPRINT_EDITOR );
187 }
188
190 {
191 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
192
193 if( !frame )
194 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
195
196 if( !frame )
197 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
198
199 if( frame )
200 SetUserUnits( frame->GetUserUnits() );
201
202 return new PANEL_EDIT_OPTIONS( aParent, this, frame, true );
203 }
204
206 {
207 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
208
209 if( !frame )
210 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
211
212 if( !frame )
213 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
214
215 if( frame )
216 SetUserUnits( frame->GetUserUnits() );
217
218 return new PANEL_FP_EDITOR_FIELD_DEFAULTS( aParent, this );
219 }
220
222 {
223 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
224
225 if( !frame )
226 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
227
228 if( !frame )
229 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
230
231 if( frame )
232 SetUserUnits( frame->GetUserUnits() );
233
234 return new PANEL_FP_EDITOR_GRAPHICS_DEFAULTS( aParent, this );
235 }
236
238 {
242
243 std::vector<TOOL_ACTION*> actions;
244 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
245
247 actions.push_back( action );
248
250 controls.push_back( control );
251
252 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb, actions, controls );
253 }
254
255 case PANEL_FP_COLORS:
256 return new PANEL_FP_EDITOR_COLOR_SETTINGS( aParent );
257
259 {
261 PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
262
263 return new PANEL_DISPLAY_OPTIONS( aParent, cfg );
264 }
265
266 case PANEL_PCB_GRIDS:
267 {
269 PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
270 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_PCB_EDITOR, false );
271
272 if( !frame )
273 frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
274
275 if( !frame )
276 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
277
278 if( frame )
279 SetUserUnits( frame->GetUserUnits() );
280
281 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_PCB_EDITOR );
282 }
283
285 {
287 PCBNEW_SETTINGS* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
288
289 return new PANEL_PCBNEW_DISPLAY_ORIGIN( aParent, cfg, FRAME_PCB_EDITOR );
290 }
291
293 {
294 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_PCB_EDITOR, false );
295
296 if( !frame )
297 frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
299 if( !frame )
300 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
301
302 if( frame )
303 SetUserUnits( frame->GetUserUnits() );
304
305 return new PANEL_EDIT_OPTIONS( aParent, this, frame, false );
306 }
307
308 case PANEL_PCB_COLORS:
309 {
310 BOARD* board = nullptr;
311 EDA_BASE_FRAME* boardProvider = aKiway->Player( FRAME_PCB_EDITOR, false );
312
313 if( boardProvider )
314 board = static_cast<PCB_EDIT_FRAME*>( boardProvider )->GetBoard();
315
316 return new PANEL_PCBNEW_COLOR_SETTINGS( aParent, board );
317 }
318
320 {
322 APP_SETTINGS_BASE* cfg = mgr.GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
323 TOOLBAR_SETTINGS* tb = mgr.GetToolbarSettings<PCB_EDIT_TOOLBAR_SETTINGS>( "pcbnew-toolbars" );
324
325 std::vector<TOOL_ACTION*> actions;
326 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
329 actions.push_back( action );
330
332 controls.push_back( control );
334 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb, actions, controls );
335 }
338 return new PANEL_PCBNEW_ACTION_PLUGINS( aParent );
339
341 return new PANEL_3D_DISPLAY_OPTIONS( aParent );
342
343 case PANEL_3DV_OPENGL:
344 return new PANEL_3D_OPENGL_OPTIONS( aParent );
345
347 return new PANEL_3D_RAYTRACING_OPTIONS( aParent );
348
350 {
353 TOOLBAR_SETTINGS* tb = mgr.GetToolbarSettings<EDA_3D_VIEWER_TOOLBAR_SETTINGS>( "3d_viewer-toolbars" );
354
355 std::vector<TOOL_ACTION*> actions;
356 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
357
359 actions.push_back( action );
360
362 controls.push_back( control );
363
364 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb, actions, controls );
365 }
366
367 default:
368 return nullptr;
369 }
370 }
371
382 void* IfaceOrAddress( int aDataId ) override
383 {
384 switch( aDataId )
385 {
386 // Return a pointer to the global instance of the footprint list.
388 return (void*) &GFootprintList;
389
390 // Return a new FP_LIB_TABLE with the global table installed as a fallback.
392 return (void*) new FP_LIB_TABLE( &GFootprintTable );
393
394 // Return a pointer to the global instance of the global footprint table.
396 return (void*) &GFootprintTable;
397
399 return reinterpret_cast<void*>( PyInit__pcbnew );
400
401 default:
402 return nullptr;
403 }
404 }
405
411 void SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcProjectName,
412 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
413 const wxString& aSrcFilePath, wxString& aErrors ) override;
414
415 int HandleJob( JOB* aJob, REPORTER* aReporter ) override;
416
417 bool HandleJobConfig( JOB* aJob, wxWindow* aParent ) override;
418
419private:
420 bool loadGlobalLibTable();
421
422 std::unique_ptr<PCBNEW_JOBS_HANDLER> m_jobHandler;
423
424} kiface( "pcbnew", KIWAY::FACE_PCB );
425
426} // namespace
427
428
429using namespace PCB;
430
431
433
434
435// KIFACE_GETTER's actual spelling is a substitution macro found in kiway.h.
436// KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
437KIFACE_API KIFACE* KIFACE_GETTER( int* aKIFACEversion, int aKiwayVersion, PGM_BASE* aProgram )
438{
439 return &kiface;
440}
441
442
447
452
453
454bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway )
455{
456 // This is process-level-initialization, not project-level-initialization of the DSO.
457 // Do nothing in here pertinent to a project!
459
460 SETTINGS_MANAGER& mgr = aProgram->GetSettingsManager();
461
464
465 // We intentionally register KifaceSettings after FOOTPRINT_EDITOR_SETTINGS and EDA_3D_VIEWER_SETTINGS
466 // In legacy configs, many settings were in a single editor config and the migration routine
467 // for the main editor file will try and call into the now separate settings stores
468 // to move the settings into them
470
471 // Register the footprint editor settings as well because they share a KiFACE and need to be
472 // loaded prior to use to avoid threading deadlocks
474
475 start_common( aCtlBits );
476
477 if( !loadGlobalLibTable() )
478 {
479 // we didnt get anywhere deregister the settings
480 mgr.FlushAndRelease( mgr.GetAppSettings<CVPCB_SETTINGS>( "cvpcb" ), false );
481 mgr.FlushAndRelease( KifaceSettings(), false );
482 mgr.FlushAndRelease( mgr.GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>( "fpedit" ), false );
483 mgr.FlushAndRelease( mgr.GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ), false );
484
485 return false;
486 }
487
488 m_jobHandler = std::make_unique<PCBNEW_JOBS_HANDLER>( aKiway );
489
491 {
492 m_jobHandler->SetReporter( &CLI_REPORTER::GetInstance() );
493 m_jobHandler->SetProgressReporter( &CLI_PROGRESS_REPORTER::GetInstance() );
494 }
495
496 return true;
497}
498
499
501{
503}
504
505
507{
508 wxFileName fn = FP_LIB_TABLE::GetGlobalTableFileName();
509
510 if( !fn.FileExists() )
511 {
512 if( !( m_start_flags & KFCTL_CLI ) )
513 {
514 // Ensure the splash screen does not hide the dialog:
515 Pgm().HideSplash();
516
517 DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG fpDialog( nullptr );
518
519 if( fpDialog.ShowModal() != wxID_OK )
520 return false;
521 }
522 }
523 else
524 {
525 try
526 {
527 // The global table is not related to a specific project. All projects
528 // will use the same global table. So the KIFACE::OnKifaceStart() contract
529 // of avoiding anything project specific is not violated here.
531 return false;
532 }
533 catch( const IO_ERROR& ioe )
534 {
535 // if we are here, a incorrect global footprint library table was found.
536 // Incorrect global symbol library table is not a fatal error:
537 // the user just has to edit the (partially) loaded table.
538 wxString msg = _( "An error occurred attempting to load the global footprint library "
539 "table.\n"
540 "Please edit this global footprint library table in Preferences "
541 "menu." );
542
543 DisplayErrorMessage( nullptr, msg, ioe.What() );
544 }
545 }
546
547 return true;
548}
549
550
552{
553 end_common();
554}
555
556
557void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcProjectName,
558 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
559 const wxString& aSrcFilePath, wxString& aErrors )
560{
561 wxFileName destFile( aSrcFilePath );
562 wxString destPath = destFile.GetPathWithSep();
563 wxUniChar pathSep = wxFileName::GetPathSeparator();
564 wxString ext = destFile.GetExt();
565
566 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
567 destPath.Replace( aProjectBasePath, aNewProjectBasePath, false );
568
569 wxString srcProjectFootprintLib = pathSep + aSrcProjectName + wxT( ".pretty" ) + pathSep;
570 wxString newProjectFootprintLib = pathSep + aNewProjectName + wxT( ".pretty" ) + pathSep;
571
572 destPath.Replace( srcProjectFootprintLib, newProjectFootprintLib, true );
573
574 destFile.SetPath( destPath );
575
578 {
579 if( destFile.GetName() == aSrcProjectName )
580 destFile.SetName( aNewProjectName );
581
582 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
583 }
584 else if( ext == FILEEXT::LegacyPcbFileExtension )
585 {
586 if( destFile.GetName() == aSrcProjectName )
587 destFile.SetName( aNewProjectName );
588
589 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
590 }
593 {
594 // Footprints are not project-specific. Keep their source names.
595 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
596 }
598 {
599 // TODO
600 }
601 else if( ext == wxT( "rpt" ) )
602 {
603 // DRC must be the "gold standard". Since we can't guarantee that there aren't
604 // any non-deterministic cases in the save-as algorithm, we don't want to certify
605 // the result with the source's DRC report. Therefore copy it under the old
606 // name.
607 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
608 }
609 else if( destFile.GetName() == FILEEXT::FootprintLibraryTableFileName )
610 {
611 try
612 {
613 FP_LIB_TABLE fpLibTable;
614 fpLibTable.Load( aSrcFilePath );
615
616 for( unsigned i = 0; i < fpLibTable.GetCount(); i++ )
617 {
618 LIB_TABLE_ROW& row = fpLibTable.At( i );
619 wxString uri = row.GetFullURI();
620
621 uri.Replace( wxT( "/" ) + aSrcProjectName + wxT( ".pretty" ),
622 wxT( "/" ) + aNewProjectName + wxT( ".pretty" ) );
623
624 row.SetFullURI( uri );
625 }
626
627 fpLibTable.Save( destFile.GetFullPath() );
628 }
629 catch( ... )
630 {
631 wxString msg;
632
633 if( !aErrors.empty() )
634 aErrors += wxT( "\n" );
635
636 msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() );
637 aErrors += msg;
638 }
639 }
640 else
641 {
642 wxFAIL_MSG( wxT( "Unexpected filetype for Pcbnew::SaveFileAs()" ) );
643 }
644}
645
646
647int IFACE::HandleJob( JOB* aJob, REPORTER* aReporter )
648{
649 return m_jobHandler->RunJob( aJob, aReporter );
650}
651
652
653bool IFACE::HandleJobConfig( JOB* aJob, wxWindow* aParent )
654{
655 return m_jobHandler->HandleJobConfig( aJob, aParent );
656}
constexpr EDA_IU_SCALE pcbIUScale
Definition: base_units.h:108
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
static std::list< TOOL_ACTION * > & GetActionList()
Return list of TOOL_ACTIONs.
Class to hold basic information about controls that can be added to the toolbars.
static std::list< ACTION_TOOLBAR_CONTROL * > & GetCustomControlList()
Get the list of custom controls that could be used on toolbars.
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:297
static PROGRESS_REPORTER & GetInstance()
static REPORTER & GetInstance()
Definition: reporter.cpp:137
int ShowQuasiModal()
int ShowModal() override
Toolbar configuration for the 3D viewer.
Definition: toolbars_3d.h:29
The base frame for deriving all KiCad main window classes.
Toolbar configuration for the footprint edit frame.
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 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
virtual void CommonSettingsChanged(int aFlags=0)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
Definition: kiway.cpp:617
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.
Toolbar configuration for the PCB editor frame.
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:444
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:73
T * GetAppSettings(const char *aFilename)
Return a handle to the a given settings by type.
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Take ownership of the pointer passed in.
T * GetToolbarSettings(const wxString &aFilename)
Return a handle to the given toolbar settings.
void FlushAndRelease(JSON_SETTINGS *aSettings, bool aSave=true)
If the given settings object is registered, save it to disk and unregister it.
Represent a single user action.
Definition: tool_action.h:304
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:194
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:97
@ FRAME_PCB_EDITOR
Definition: frame_type.h:42
@ PANEL_3DV_TOOLBARS
Definition: frame_type.h:107
@ FRAME_FOOTPRINT_VIEWER
Definition: frame_type.h:45
@ PANEL_3DV_OPENGL
Definition: frame_type.h:105
@ PANEL_FP_DEFAULT_GRAPHICS_VALUES
Definition: frame_type.h:93
@ PANEL_PCB_TOOLBARS
Definition: frame_type.h:100
@ PANEL_PCB_ORIGINS_AXES
Definition: frame_type.h:102
@ FRAME_FOOTPRINT_WIZARD
Definition: frame_type.h:46
@ PANEL_PCB_EDIT_OPTIONS
Definition: frame_type.h:98
@ PANEL_FP_DISPLAY_OPTIONS
Definition: frame_type.h:87
@ PANEL_PCB_COLORS
Definition: frame_type.h:99
@ PANEL_3DV_RAYTRACING
Definition: frame_type.h:106
@ DIALOG_PCB_LIBRARY_TABLE
Definition: frame_type.h:125
@ FRAME_FOOTPRINT_PREVIEW
Definition: frame_type.h:48
@ FRAME_FOOTPRINT_CHOOSER
Definition: frame_type.h:44
@ PANEL_FP_GRIDS
Definition: frame_type.h:88
@ PANEL_FP_ORIGINS_AXES
Definition: frame_type.h:94
@ PANEL_PCB_DISPLAY_OPTS
Definition: frame_type.h:96
@ DIALOG_CONFIGUREPATHS
Definition: frame_type.h:122
@ PANEL_FP_COLORS
Definition: frame_type.h:90
@ PANEL_FP_DEFAULT_FIELDS
Definition: frame_type.h:92
@ FRAME_FOOTPRINT_EDITOR
Definition: frame_type.h:43
@ PANEL_FP_EDIT_OPTIONS
Definition: frame_type.h:89
@ PANEL_FP_TOOLBARS
Definition: frame_type.h:91
@ PANEL_PCB_ACTION_PLUGINS
Definition: frame_type.h:101
@ PANEL_3DV_DISPLAY_OPTIONS
Definition: frame_type.h:104
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: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: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:432
FP_LIB_TABLE GFootprintTable
The global footprint library table.
Definition: pcbnew.cpp:446
FOOTPRINT_LIST_IMPL GFootprintList
The global footprint info table.
Definition: pcbnew.cpp:451
void ScriptingSetPcbEditFrame(PCB_EDIT_FRAME *aPcbEditFrame)
BOARD * GetBoard()
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1071
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:647
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
Definition: pcbnew.cpp:454
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:557
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
Definition: pcbnew.cpp:382
void Reset() override
Reloads global state.
Definition: pcbnew.cpp:500
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
Definition: pcbnew.cpp:97
IFACE(const char *aName, KIWAY::FACE_T aType)
Definition: pcbnew.cpp:86
bool loadGlobalLibTable()
Definition: pcbnew.cpp:506
std::unique_ptr< PCBNEW_JOBS_HANDLER > m_jobHandler
Definition: pcbnew.cpp:422
bool HandleJobConfig(JOB *aJob, wxWindow *aParent) override
Definition: pcbnew.cpp:653
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
Definition: pcbnew.cpp:551
#define ENVVARS_CHANGED
Definition: tools_holder.h:152
Definition of file extensions used in Kicad.