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
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, int aCtlBits = 0 ) override
98 {
99 switch( aClassId )
100 {
101 case FRAME_PCB_EDITOR:
102 {
103 auto frame = new PCB_EDIT_FRAME( aKiway, aParent );
104
105 // give the scripting helpers access to our frame
107
108 if( Kiface().IsSingle() )
109 {
110 // only run this under single_top, not under a project manager.
111 frame->CreateServer( KICAD_PCB_PORT_SERVICE_NUMBER );
112 }
113
114 return frame;
115 }
116
118 return new FOOTPRINT_EDIT_FRAME( aKiway, aParent );
119
121 return new FOOTPRINT_VIEWER_FRAME( aKiway, aParent );
122
124 return new FOOTPRINT_CHOOSER_FRAME( aKiway, aParent );
125
127 return new FOOTPRINT_WIZARD_FRAME( aKiway, aParent, FRAME_T( aClassId ) );
128
130 return FOOTPRINT_PREVIEW_PANEL::New( aKiway, aParent, this );
131
133 {
134 DIALOG_CONFIGURE_PATHS dlg( aParent );
135
136 // The dialog's constructor probably failed to set its Kiway because the
137 // dynamic_cast fails when aParent was allocated by a separate compilation
138 // module. So set it directly.
139 dlg.SetKiway( &dlg, aKiway );
140
141 // Use QuasiModal so that HTML help window will work
142 if( dlg.ShowQuasiModal() == wxID_OK )
144
145 // Dialog has completed; nothing to return.
146 return nullptr;
147 }
148
150 InvokePcbLibTableEditor( aKiway, aParent );
151 // Dialog has completed; nothing to return.
152 return nullptr;
153
155 return new PANEL_DISPLAY_OPTIONS( aParent, GetAppSettings<FOOTPRINT_EDITOR_SETTINGS>( "fpedit" ) );
156
157 case PANEL_FP_GRIDS:
158 {
160 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
161
162 if( !frame )
163 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
164
165 if( !frame )
166 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
167
168 if( frame )
169 SetUserUnits( frame->GetUserUnits() );
170
171 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_FOOTPRINT_EDITOR );
172 }
173
177
179 {
180 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
181
182 if( !frame )
183 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
184
185 if( !frame )
186 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
187
188 if( frame )
189 SetUserUnits( frame->GetUserUnits() );
190
191 return new PANEL_EDIT_OPTIONS( aParent, this, frame, true );
192 }
193
195 {
196 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
197
198 if( !frame )
199 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
200
201 if( !frame )
202 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
203
204 if( frame )
205 SetUserUnits( frame->GetUserUnits() );
206
207 return new PANEL_FP_EDITOR_FIELD_DEFAULTS( aParent );
208 }
209
211 {
212 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
213
214 if( !frame )
215 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
216
217 if( !frame )
218 frame = aKiway->Player( FRAME_PCB_EDITOR, false );
219
220 if( frame )
221 SetUserUnits( frame->GetUserUnits() );
222
223 return new PANEL_FP_EDITOR_GRAPHICS_DEFAULTS( aParent, this );
224 }
225
227 {
230
231 std::vector<TOOL_ACTION*> actions;
232 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
233
235 actions.push_back( action );
236
238 controls.push_back( control );
239
240 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb, actions, controls );
241 }
242
243 case PANEL_FP_COLORS:
244 return new PANEL_FP_EDITOR_COLOR_SETTINGS( aParent );
245
247 return new PANEL_DISPLAY_OPTIONS( aParent, GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" ) );
248
249 case PANEL_PCB_GRIDS:
250 {
252 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_PCB_EDITOR, false );
253
254 if( !frame )
255 frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
256
257 if( !frame )
258 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
259
260 if( frame )
261 SetUserUnits( frame->GetUserUnits() );
262
263 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_PCB_EDITOR );
264 }
265
267 return new PANEL_PCBNEW_DISPLAY_ORIGIN( aParent, GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" ),
269
271 {
272 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_PCB_EDITOR, false );
273
274 if( !frame )
275 frame = aKiway->Player( FRAME_FOOTPRINT_EDITOR, false );
276
277 if( !frame )
278 frame = aKiway->Player( FRAME_FOOTPRINT_VIEWER, false );
279
280 if( frame )
281 SetUserUnits( frame->GetUserUnits() );
282
283 return new PANEL_EDIT_OPTIONS( aParent, this, frame, false );
284 }
285
286 case PANEL_PCB_COLORS:
287 {
288 BOARD* board = nullptr;
289 EDA_BASE_FRAME* boardProvider = aKiway->Player( FRAME_PCB_EDITOR, false );
290
291 if( boardProvider )
292 board = static_cast<PCB_EDIT_FRAME*>( boardProvider )->GetBoard();
293
294 return new PANEL_PCBNEW_COLOR_SETTINGS( aParent, board );
295 }
296
298 {
299 APP_SETTINGS_BASE* cfg = GetAppSettings<PCBNEW_SETTINGS>( "pcbnew" );
300 TOOLBAR_SETTINGS* tb = GetToolbarSettings<PCB_EDIT_TOOLBAR_SETTINGS>( "pcbnew-toolbars" );
301
302 std::vector<TOOL_ACTION*> actions;
303 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
304
306 actions.push_back( action );
309 controls.push_back( control );
310
311 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb, actions, controls );
313
315 return new PANEL_PCBNEW_ACTION_PLUGINS( aParent );
316
318 return new PANEL_3D_DISPLAY_OPTIONS( aParent );
319
320 case PANEL_3DV_OPENGL:
321 return new PANEL_3D_OPENGL_OPTIONS( aParent );
322
324 return new PANEL_3D_RAYTRACING_OPTIONS( aParent );
325
327 {
330
331 std::vector<TOOL_ACTION*> actions;
332 std::vector<ACTION_TOOLBAR_CONTROL*> controls;
333
335 actions.push_back( action );
336
338 controls.push_back( control );
339
340 return new PANEL_TOOLBAR_CUSTOMIZATION( aParent, cfg, tb, actions, controls );
341 }
342
343 default:
344 return nullptr;
345 }
346 }
347
358 void* IfaceOrAddress( int aDataId ) override
359 {
360 switch( aDataId )
361 {
362 // Return a pointer to the global instance of the footprint list.
364 return (void*) &GFootprintList;
365
366 // Return a new FP_LIB_TABLE with the global table installed as a fallback.
368 return (void*) new FP_LIB_TABLE( &GFootprintTable );
369
370 // Return a pointer to the global instance of the global footprint table.
372 return (void*) &GFootprintTable;
373
375 return reinterpret_cast<void*>( PyInit__pcbnew );
376
377 default:
378 return nullptr;
379 }
380 }
381
387 void SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcProjectName,
388 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
389 const wxString& aSrcFilePath, wxString& aErrors ) override;
390
391 int HandleJob( JOB* aJob, REPORTER* aReporter, PROGRESS_REPORTER* aProgressReporter ) override;
392
393 bool HandleJobConfig( JOB* aJob, wxWindow* aParent ) override;
394
395private:
396 bool loadGlobalLibTable();
397
398 std::unique_ptr<PCBNEW_JOBS_HANDLER> m_jobHandler;
399
400} kiface( "pcbnew", KIWAY::FACE_PCB );
401
402} // namespace
403
404
405using namespace PCB;
406
407
409
410
411// KIFACE_GETTER's actual spelling is a substitution macro found in kiway.h.
412// KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
413KIFACE_API KIFACE* KIFACE_GETTER( int* aKIFACEversion, int aKiwayVersion, PGM_BASE* aProgram )
414{
415 return &kiface;
416}
417
418
423
428
429
430bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway )
431{
432 // This is process-level-initialization, not project-level-initialization of the DSO.
433 // Do nothing in here pertinent to a project!
435
436 SETTINGS_MANAGER& mgr = aProgram->GetSettingsManager();
437
440
441 // We intentionally register KifaceSettings after FOOTPRINT_EDITOR_SETTINGS and EDA_3D_VIEWER_SETTINGS
442 // In legacy configs, many settings were in a single editor config and the migration routine
443 // for the main editor file will try and call into the now separate settings stores
444 // to move the settings into them
446
447 // Register the footprint editor settings as well because they share a KiFACE and need to be
448 // loaded prior to use to avoid threading deadlocks
450
451 start_common( aCtlBits );
452
453 if( !loadGlobalLibTable() )
454 {
455 // we didnt get anywhere deregister the settings
456 mgr.FlushAndRelease( GetAppSettings<CVPCB_SETTINGS>( "cvpcb" ), false );
457 mgr.FlushAndRelease( KifaceSettings(), false );
459 mgr.FlushAndRelease( GetAppSettings<EDA_3D_VIEWER_SETTINGS>( "3d_viewer" ), false );
460
461 return false;
462 }
463
464 m_jobHandler = std::make_unique<PCBNEW_JOBS_HANDLER>( aKiway );
465
467 {
468 m_jobHandler->SetReporter( &CLI_REPORTER::GetInstance() );
469 m_jobHandler->SetProgressReporter( &CLI_PROGRESS_REPORTER::GetInstance() );
470 }
471
472 return true;
473}
474
475
477{
479}
480
481
483{
484 wxFileName fn = FP_LIB_TABLE::GetGlobalTableFileName();
485
486 if( !fn.FileExists() )
487 {
488 if( !( m_start_flags & KFCTL_CLI ) )
489 {
490 // Ensure the splash screen does not hide the dialog:
491 Pgm().HideSplash();
492
493 DIALOG_GLOBAL_FP_LIB_TABLE_CONFIG fpDialog( nullptr );
494
495 if( fpDialog.ShowModal() != wxID_OK )
496 return false;
497 }
498 }
499 else
500 {
501 try
502 {
503 // The global table is not related to a specific project. All projects
504 // will use the same global table. So the KIFACE::OnKifaceStart() contract
505 // of avoiding anything project specific is not violated here.
507 return false;
508 }
509 catch( const IO_ERROR& ioe )
510 {
511 // if we are here, a incorrect global footprint library table was found.
512 // Incorrect global symbol library table is not a fatal error:
513 // the user just has to edit the (partially) loaded table.
514 wxString msg = _( "An error occurred attempting to load the global footprint library "
515 "table.\n"
516 "Please edit this global footprint library table in Preferences "
517 "menu." );
518
519 DisplayErrorMessage( nullptr, msg, ioe.What() );
520 }
521 }
522
523 return true;
524}
525
526
528{
529 end_common();
530}
531
532
533void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aSrcProjectName,
534 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
535 const wxString& aSrcFilePath, wxString& aErrors )
536{
537 wxFileName destFile( aSrcFilePath );
538 wxString destPath = destFile.GetPathWithSep();
539 wxUniChar pathSep = wxFileName::GetPathSeparator();
540 wxString ext = destFile.GetExt();
541
542 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
543 destPath.Replace( aProjectBasePath, aNewProjectBasePath, false );
544
545 wxString srcProjectFootprintLib = pathSep + aSrcProjectName + wxT( ".pretty" ) + pathSep;
546 wxString newProjectFootprintLib = pathSep + aNewProjectName + wxT( ".pretty" ) + pathSep;
547
548 destPath.Replace( srcProjectFootprintLib, newProjectFootprintLib, true );
549
550 destFile.SetPath( destPath );
551
554 {
555 if( destFile.GetName() == aSrcProjectName )
556 destFile.SetName( aNewProjectName );
557
558 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
559 }
560 else if( ext == FILEEXT::LegacyPcbFileExtension )
561 {
562 if( destFile.GetName() == aSrcProjectName )
563 destFile.SetName( aNewProjectName );
564
565 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
566 }
569 {
570 // Footprints are not project-specific. Keep their source names.
571 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
572 }
574 {
575 // TODO
576 }
577 else if( ext == wxT( "rpt" ) )
578 {
579 // DRC must be the "gold standard". Since we can't guarantee that there aren't
580 // any non-deterministic cases in the save-as algorithm, we don't want to certify
581 // the result with the source's DRC report. Therefore copy it under the old
582 // name.
583 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
584 }
585 else if( destFile.GetName() == FILEEXT::FootprintLibraryTableFileName )
586 {
587 try
588 {
589 FP_LIB_TABLE fpLibTable;
590 fpLibTable.Load( aSrcFilePath );
591
592 for( unsigned i = 0; i < fpLibTable.GetCount(); i++ )
593 {
594 LIB_TABLE_ROW& row = fpLibTable.At( i );
595 wxString uri = row.GetFullURI();
596
597 uri.Replace( wxT( "/" ) + aSrcProjectName + wxT( ".pretty" ),
598 wxT( "/" ) + aNewProjectName + wxT( ".pretty" ) );
599
600 row.SetFullURI( uri );
601 }
602
603 fpLibTable.Save( destFile.GetFullPath() );
604 }
605 catch( ... )
606 {
607 wxString msg;
608
609 if( !aErrors.empty() )
610 aErrors += wxT( "\n" );
611
612 msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() );
613 aErrors += msg;
614 }
615 }
616 else
617 {
618 wxFAIL_MSG( wxT( "Unexpected filetype for Pcbnew::SaveFileAs()" ) );
619 }
620}
621
622
623int IFACE::HandleJob( JOB* aJob, REPORTER* aReporter, PROGRESS_REPORTER* aProgressReporter )
624{
625 return m_jobHandler->RunJob( aJob, aReporter, aProgressReporter );
626}
627
628
629bool IFACE::HandleJobConfig( JOB* aJob, wxWindow* aParent )
630{
631 return m_jobHandler->HandleJobConfig( aJob, aParent );
632}
constexpr EDA_IU_SCALE pcbIUScale
Definition base_units.h:112
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.
static PROGRESS_REPORTER & GetInstance()
static REPORTER & GetInstance()
Definition reporter.cpp:129
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.
virtual const wxString What() const
A composite of Problem() and Where()
An simple container class that lets us dispatch output jobs to kifaces.
Definition job.h:183
A KIFACE implementation.
Definition kiface_base.h:39
KIFACE_BASE(const char *aKifaceName, KIWAY::FACE_T aId)
Definition kiface_base.h:67
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();.
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().
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...
Definition kiway.h:286
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition kiway.cpp:395
FACE_T
Known KIFACE implementations.
Definition kiway.h:292
@ FACE_PCB
pcbnew DSO
Definition kiway.h:294
virtual void CommonSettingsChanged(int aFlags=0)
Call CommonSettingsChanged() on all KIWAY_PLAYERs.
Definition kiway.cpp:589
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:333
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
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.
Represent a single user action.
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.
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:48
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:96
@ FRAME_PCB_EDITOR
Definition frame_type.h:42
@ PANEL_3DV_TOOLBARS
Definition frame_type.h:106
@ FRAME_FOOTPRINT_VIEWER
Definition frame_type.h:45
@ PANEL_3DV_OPENGL
Definition frame_type.h:104
@ PANEL_FP_DEFAULT_GRAPHICS_VALUES
Definition frame_type.h:92
@ PANEL_PCB_TOOLBARS
Definition frame_type.h:99
@ PANEL_PCB_ORIGINS_AXES
Definition frame_type.h:101
@ FRAME_FOOTPRINT_WIZARD
Definition frame_type.h:46
@ PANEL_PCB_EDIT_OPTIONS
Definition frame_type.h:97
@ PANEL_FP_DISPLAY_OPTIONS
Definition frame_type.h:86
@ PANEL_PCB_COLORS
Definition frame_type.h:98
@ PANEL_3DV_RAYTRACING
Definition frame_type.h:105
@ DIALOG_PCB_LIBRARY_TABLE
Definition frame_type.h:124
@ FRAME_FOOTPRINT_PREVIEW
Definition frame_type.h:48
@ FRAME_FOOTPRINT_CHOOSER
Definition frame_type.h:44
@ PANEL_FP_GRIDS
Definition frame_type.h:87
@ PANEL_FP_ORIGINS_AXES
Definition frame_type.h:93
@ PANEL_PCB_DISPLAY_OPTS
Definition frame_type.h:95
@ DIALOG_CONFIGUREPATHS
Definition frame_type.h:121
@ PANEL_FP_COLORS
Definition frame_type.h:89
@ PANEL_FP_DEFAULT_FIELDS
Definition frame_type.h:91
@ FRAME_FOOTPRINT_EDITOR
Definition frame_type.h:43
@ PANEL_FP_EDIT_OPTIONS
Definition frame_type.h:88
@ PANEL_FP_TOOLBARS
Definition frame_type.h:90
@ PANEL_PCB_ACTION_PLUGINS
Definition frame_type.h:100
@ PANEL_3DV_DISPLAY_OPTIONS
Definition frame_type.h:103
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
@ 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:162
#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:408
void ScriptingSetPcbEditFrame(PCB_EDIT_FRAME *aPcbEditFrame)
BOARD * GetBoard()
PGM_BASE & Pgm()
The global program "get" accessor.
Definition pgm_base.cpp:913
see class PGM_BASE
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.
Definition kiway.h:153
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
Definition pcbnew.cpp:430
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:533
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
Definition pcbnew.cpp:358
void Reset() override
Reloads global state.
Definition pcbnew.cpp:476
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
int HandleJob(JOB *aJob, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter) override
Definition pcbnew.cpp:623
bool loadGlobalLibTable()
Definition pcbnew.cpp:482
std::unique_ptr< PCBNEW_JOBS_HANDLER > m_jobHandler
Definition pcbnew.cpp:398
bool HandleJobConfig(JOB *aJob, wxWindow *aParent) override
Definition pcbnew.cpp:629
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
Definition pcbnew.cpp:527
#define ENVVARS_CHANGED
Definition of file extensions used in Kicad.