KiCad PCB EDA Suite
Loading...
Searching...
No Matches
eeschema.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) 2004 Jean-Pierre Charras, [email protected]
5 * Copyright (C) 2008 Wayne Stambaugh <[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
26#include <pgm_base.h>
27#include <kiface_base.h>
29#include <confirm.h>
30#include <gestfich.h>
31#include <eda_dde.h>
33#include "eeschema_helpers.h"
34#include <eeschema_settings.h>
35#include <sch_edit_frame.h>
37#include <symbol_edit_frame.h>
38#include <symbol_viewer_frame.h>
40#include <symbol_lib_table.h>
47#include <kiway.h>
50#include <sexpr/sexpr.h>
51#include <sexpr/sexpr_parser.h>
52#include <kiface_ids.h>
54#include <wx/ffile.h>
56
57#include <schematic.h>
58#include <connection_graph.h>
68#include <sim/simulator_frame.h>
69
70#include <wx/crt.h>
71
72// The main sheet of the project
74
75
76namespace SCH {
77
78
79static struct IFACE : public KIFACE_BASE, public UNITS_PROVIDER
80{
81 // Of course all are virtual overloads, implementations of the KIFACE.
82
83 IFACE( const char* aName, KIWAY::FACE_T aType ) :
84 KIFACE_BASE( aName, aType ),
86 {}
87
88 bool OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway ) override;
89
90 void Reset() override;
91
92 void OnKifaceEnd() override;
93
94 wxWindow* CreateKiWindow( wxWindow* aParent, int aClassId, KIWAY* aKiway,
95 int aCtlBits = 0 ) override
96 {
97 switch( aClassId )
98 {
99 case FRAME_SCH:
100 {
101 SCH_EDIT_FRAME* frame = new SCH_EDIT_FRAME( aKiway, aParent );
102
104
105 if( Kiface().IsSingle() )
106 {
107 // only run this under single_top, not under a project manager.
109 }
110
111 return frame;
112 }
113
115 {
116 SYMBOL_EDIT_FRAME* frame = new SYMBOL_EDIT_FRAME( aKiway, aParent );
117 return frame;
118 }
119
120 case FRAME_SIMULATOR:
121 {
122 SIMULATOR_FRAME* frame = new SIMULATOR_FRAME( aKiway, aParent );
123 return frame;
124 }
125
126 case FRAME_SCH_VIEWER:
127 {
128 SYMBOL_VIEWER_FRAME* frame = new SYMBOL_VIEWER_FRAME( aKiway, aParent );
129 return frame;
130 }
131
133 {
134 SYMBOL_CHOOSER_FRAME* frame = new SYMBOL_CHOOSER_FRAME( aKiway, aParent );
135 return frame;
136 }
137
139 InvokeSchEditSymbolLibTable( aKiway, aParent );
140 // Dialog has completed; nothing to return.
141 return nullptr;
142
144 InvokeEditDesignBlockLibTable( aKiway, aParent );
145 // Dialog has completed; nothing to return.
146 return nullptr;
147
149 {
151 APP_SETTINGS_BASE* cfg = mgr.GetAppSettings<SYMBOL_EDITOR_SETTINGS>( "symbol_editor" );
152
153 return new PANEL_SYM_DISPLAY_OPTIONS( aParent, cfg );
154 }
155
157 {
159 APP_SETTINGS_BASE* cfg = mgr.GetAppSettings<SYMBOL_EDITOR_SETTINGS>( "symbol_editor" );
160 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_SCH_SYMBOL_EDITOR, false );
161
162 if( !frame )
163 frame = aKiway->Player( FRAME_SCH_VIEWER, false );
164
165 if( !frame )
166 frame = aKiway->Player( FRAME_SCH, false );
167
168 if( frame )
169 SetUserUnits( frame->GetUserUnits() );
170
171 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_SCH_SYMBOL_EDITOR );
172 }
173
175 {
176 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_SCH_SYMBOL_EDITOR, false );
177
178 if( !frame )
179 frame = aKiway->Player( FRAME_SCH_VIEWER, false );
180
181 if( !frame )
182 frame = aKiway->Player( FRAME_SCH, false );
183
184 if( frame )
186
187 return new PANEL_SYM_EDITING_OPTIONS( aParent, this, frame );
188 }
189
190 case PANEL_SYM_COLORS:
191 return new PANEL_SYM_COLOR_SETTINGS( aParent );
192
194 {
196 EESCHEMA_SETTINGS* cfg = mgr.GetAppSettings<EESCHEMA_SETTINGS>( "eeschema" );
197
198 return new PANEL_EESCHEMA_DISPLAY_OPTIONS( aParent, cfg );
199 }
201 case PANEL_SCH_GRIDS:
204 EESCHEMA_SETTINGS* cfg = mgr.GetAppSettings<EESCHEMA_SETTINGS>( "eeschema" );
205 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_SCH, false );
207 if( !frame )
208 frame = aKiway->Player( FRAME_SCH_SYMBOL_EDITOR, false );
209
210 if( !frame )
211 frame = aKiway->Player( FRAME_SCH_VIEWER, false );
212
213 if( frame )
214 SetUserUnits( frame->GetUserUnits() );
215
216 return new PANEL_GRID_SETTINGS( aParent, this, frame, cfg, FRAME_SCH );
217 }
218
220 {
221 EDA_BASE_FRAME* frame = aKiway->Player( FRAME_SCH, false );
222
223 if( !frame )
224 frame = aKiway->Player( FRAME_SCH_SYMBOL_EDITOR, false );
225
226 if( !frame )
227 frame = aKiway->Player( FRAME_SCH_VIEWER, false );
228
229 if( frame )
230 SetUserUnits( frame->GetUserUnits() );
231
232 return new PANEL_EESCHEMA_EDITING_OPTIONS( aParent, this, frame );
233 }
234
236 {
237 EDA_BASE_FRAME* schSettingsProvider = aKiway->Player( FRAME_SCH, false );
238
239 return new PANEL_EESCHEMA_ANNOTATION_OPTIONS( aParent, schSettingsProvider );
240 }
241
242 case PANEL_SCH_COLORS:
243 return new PANEL_EESCHEMA_COLOR_SETTINGS( aParent );
244
246 return new PANEL_TEMPLATE_FIELDNAMES( aParent, nullptr );
247
249 return new PANEL_SIMULATOR_PREFERENCES( aParent );
250
251 default:
252 return nullptr;
253 }
254 }
255
266 void* IfaceOrAddress( int aDataId ) override
267 {
268 return nullptr;
269 }
270
276 void SaveFileAs( const wxString& aProjectBasePath, const wxString& aProjectName,
277 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
278 const wxString& aSrcFilePath, wxString& aErrors ) override;
279
280
281 int HandleJob( JOB* aJob, REPORTER* aReporter ) override;
282
283 bool HandleJobConfig( JOB* aJob, wxWindow* aParent ) override;
284
285private:
286 bool loadGlobalLibTable();
288
289 std::unique_ptr<EESCHEMA_JOBS_HANDLER> m_jobHandler;
290
291} kiface( "eeschema", KIWAY::FACE_SCH );
292
293} // namespace
294
295using namespace SCH;
296
297
299
300
301// KIFACE_GETTER's actual spelling is a substitution macro found in kiway.h.
302// KIFACE_GETTER will not have name mangling due to declaration in kiway.h.
303KIFACE_API KIFACE* KIFACE_GETTER( int* aKIFACEversion, int aKiwayVersion, PGM_BASE* aProgram )
304{
305 return &kiface;
306}
307
308
309bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits, KIWAY* aKiway )
310{
311 // This is process-level-initialization, not project-level-initialization of the DSO.
312 // Do nothing in here pertinent to a project!
314
315 // Register the symbol editor settings as well because they share a KiFACE and need to be
316 // loaded prior to use to avoid threading deadlocks
318 aProgram->GetSettingsManager().RegisterSettings( symSettings ); // manager takes ownership
319
320 // We intentionally register KifaceSettings after SYMBOL_EDITOR_SETTINGS
321 // In legacy configs, many settings were in a single editor config nd the migration routine
322 // for the main editor file will try and call into the now separate settings stores
323 // to move the settings into them
325
326 start_common( aCtlBits );
327
329 {
330 // we didnt get anywhere deregister the settings
331 aProgram->GetSettingsManager().FlushAndRelease( symSettings, false );
332 aProgram->GetSettingsManager().FlushAndRelease( KifaceSettings(), false );
333 return false;
334 }
335
336 m_jobHandler = std::make_unique<EESCHEMA_JOBS_HANDLER>( aKiway );
337
339 {
340 m_jobHandler->SetReporter( &CLI_REPORTER::GetInstance() );
341 m_jobHandler->SetProgressReporter( &CLI_PROGRESS_REPORTER::GetInstance() );
342 }
343
344 return true;
345}
346
347
349{
351}
352
353
355{
357
358 if( !fn.FileExists() )
359 {
360 if( !( m_start_flags & KFCTL_CLI ) )
361 {
362 // Ensure the splash screen does not hide the dialog:
363 Pgm().HideSplash();
364
365 DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG symDialog( nullptr );
366
367 if( symDialog.ShowModal() != wxID_OK )
368 return false;
369 }
370 }
371 else
372 {
373 try
374 {
375 // The global table is not related to a specific project. All projects
376 // will use the same global table. So the KIFACE::OnKifaceStart() contract
377 // of avoiding anything project specific is not violated here.
379 return false;
380 }
381 catch( const IO_ERROR& ioe )
382 {
383 // if we are here, a incorrect global symbol library table was found.
384 // Incorrect global symbol library table is not a fatal error:
385 // the user just has to edit the (partially) loaded table.
386 wxString msg =
387 _( "An error occurred attempting to load the global symbol library table.\n"
388 "Please edit this global symbol library table in Preferences menu." );
389
390 DisplayErrorMessage( nullptr, msg, ioe.What() );
391 }
392 }
393
394 return true;
395}
396
397
399{
400 try
401 {
403
404 if( !fn.FileExists() )
405 {
406 DESIGN_BLOCK_LIB_TABLE emptyTable;
407 emptyTable.Save( fn.GetFullPath() );
408 }
409
410 // The global table is not related to a specific project. All projects
411 // will use the same global table. So the KIFACE::OnKifaceStart() contract
412 // of avoiding anything project specific is not violated here.
415 return false;
416 }
417 catch( const IO_ERROR& ioe )
418 {
419 // if we are here, a incorrect global design block library table was found.
420 // Incorrect global design block library table is not a fatal error:
421 // the user just has to edit the (partially) loaded table.
422 wxString msg =
423 _( "An error occurred attempting to load the global design block library table.\n"
424 "Please edit this global design block library table in Preferences menu." );
425
426 DisplayErrorMessage( nullptr, msg, ioe.What() );
427 }
428
429 return true;
430}
431
432
434{
435 end_common();
436}
437
438
439static void traverseSEXPR( SEXPR::SEXPR* aNode,
440 const std::function<void( SEXPR::SEXPR* )>& aVisitor )
441{
442 aVisitor( aNode );
443
444 if( aNode->IsList() )
445 {
446 for( unsigned i = 0; i < aNode->GetNumberOfChildren(); i++ )
447 traverseSEXPR( aNode->GetChild( i ), aVisitor );
448 }
449}
450
451
452void IFACE::SaveFileAs( const wxString& aProjectBasePath, const wxString& aProjectName,
453 const wxString& aNewProjectBasePath, const wxString& aNewProjectName,
454 const wxString& aSrcFilePath, wxString& aErrors )
455{
456 wxFileName destFile( aSrcFilePath );
457 wxString destPath = destFile.GetPathWithSep();
458 wxUniChar pathSep = wxFileName::GetPathSeparator();
459 wxString ext = destFile.GetExt();
460
461 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
462 destPath.Replace( aProjectBasePath, aNewProjectBasePath, false );
463
464 destFile.SetPath( destPath );
465
470 {
471 if( destFile.GetName() == aProjectName )
472 {
473 destFile.SetName( aNewProjectName );
474 }
475 else if( destFile.GetName() == aNewProjectName )
476 {
477 wxString msg;
478
479 if( !aErrors.empty() )
480 aErrors += wxS( "\n" );
481
482 msg.Printf( _( "Cannot copy file '%s' as it will be overwritten by the new root "
483 "sheet file." ), destFile.GetFullPath() );
484 aErrors += msg;
485 return;
486 }
487
488 // Sheet paths when auto-generated are relative to the root, so those will stay
489 // pointing to whatever they were pointing at.
490 // The author can create their own absolute and relative sheet paths. Absolute
491 // sheet paths aren't an issue, and relative ones will continue to work as long
492 // as the author didn't include any '..'s. If they did, it's still not clear
493 // whether they should be adjusted or not (as the author may be duplicating an
494 // entire tree with several projects within it), so we leave this as an exercise
495 // to the author.
496
497 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
498 }
500 {
501 // Symbols are not project-specific. Keep their source names.
502 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
503 }
507 {
508 if( destFile.GetName() == aProjectName + wxS( "-cache" ) )
509 destFile.SetName( aNewProjectName + wxS( "-cache" ) );
510
511 if( destFile.GetName() == aProjectName + wxS( "-rescue" ) )
512 destFile.SetName( aNewProjectName + wxS( "-rescue" ) );
513
514 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
515 }
516 else if( ext == FILEEXT::NetlistFileExtension )
517 {
518 bool success = false;
519
520 if( destFile.GetName() == aProjectName )
521 destFile.SetName( aNewProjectName );
522
523 try
524 {
525 SEXPR::PARSER parser;
526 std::unique_ptr<SEXPR::SEXPR> sexpr( parser.ParseFromFile( TO_UTF8( aSrcFilePath ) ) );
527
528 traverseSEXPR( sexpr.get(), [&]( SEXPR::SEXPR* node )
529 {
530 if( node->IsList() && node->GetNumberOfChildren() > 1
531 && node->GetChild( 0 )->IsSymbol()
532 && node->GetChild( 0 )->GetSymbol() == "source" )
533 {
534 auto pathNode = dynamic_cast<SEXPR::SEXPR_STRING*>( node->GetChild( 1 ) );
535 auto symNode = dynamic_cast<SEXPR::SEXPR_SYMBOL*>( node->GetChild( 1 ) );
536 wxString path;
537
538 if( pathNode )
539 path = pathNode->m_value;
540 else if( symNode )
541 path = symNode->m_value;
542
543 if( path == aProjectName + wxS( ".sch" ) )
544 path = aNewProjectName + wxS( ".sch" );
545 else if( path == aProjectBasePath + "/" + aProjectName + wxS( ".sch" ) )
546 path = aNewProjectBasePath + "/" + aNewProjectName + wxS( ".sch" );
547 else if( path.StartsWith( aProjectBasePath ) )
548 path.Replace( aProjectBasePath, aNewProjectBasePath, false );
549
550 if( pathNode )
551 pathNode->m_value = path;
552 else if( symNode )
553 symNode->m_value = path;
554 }
555 } );
556
557 wxFFile destNetList( destFile.GetFullPath(), "wb" );
558
559 if( destNetList.IsOpened() )
560 success = destNetList.Write( sexpr->AsString( 0 ) );
561
562 // wxFFile dtor will close the file
563 }
564 catch( ... )
565 {
566 success = false;
567 }
568
569 if( !success )
570 {
571 wxString msg;
572
573 if( !aErrors.empty() )
574 aErrors += wxS( "\n" );
575
576 msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() );
577 aErrors += msg;
578 }
579 }
580 else if( destFile.GetName() == FILEEXT::SymbolLibraryTableFileName )
581 {
582 SYMBOL_LIB_TABLE symbolLibTable;
583 symbolLibTable.Load( aSrcFilePath );
584
585 for( unsigned i = 0; i < symbolLibTable.GetCount(); i++ )
586 {
587 LIB_TABLE_ROW& row = symbolLibTable.At( i );
588 wxString uri = row.GetFullURI();
589
590 uri.Replace( wxS( "/" ) + aProjectName + wxS( "-cache.lib" ),
591 wxS( "/" ) + aNewProjectName + wxS( "-cache.lib" ) );
592 uri.Replace( wxS( "/" ) + aProjectName + wxS( "-rescue.lib" ),
593 wxS( "/" ) + aNewProjectName + wxS( "-rescue.lib" ) );
594 uri.Replace( wxS( "/" ) + aProjectName + wxS( ".lib" ),
595 wxS( "/" ) + aNewProjectName + wxS( ".lib" ) );
596
597 row.SetFullURI( uri );
598 }
599
600 try
601 {
602 symbolLibTable.Save( destFile.GetFullPath() );
603 }
604 catch( ... )
605 {
606 wxString msg;
607
608 if( !aErrors.empty() )
609 aErrors += "\n";
610
611 msg.Printf( _( "Cannot copy file '%s'." ), destFile.GetFullPath() );
612 aErrors += msg;
613 }
614 }
615 else
616 {
617 wxFAIL_MSG( wxS( "Unexpected filetype for Eeschema::SaveFileAs()" ) );
618 }
619}
620
621
622int IFACE::HandleJob( JOB* aJob, REPORTER* aReporter )
623{
624 return m_jobHandler->RunJob( aJob, aReporter );
625}
626
627
628bool IFACE::HandleJobConfig( JOB* aJob, wxWindow* aParent )
629{
630 return m_jobHandler->HandleJobConfig( aJob, aParent );
631}
constexpr EDA_IU_SCALE schIUScale
Definition: base_units.h:110
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
static PROGRESS_REPORTER & GetInstance()
static REPORTER & GetInstance()
Definition: reporter.cpp:145
static wxString GetGlobalTableFileName()
static bool LoadGlobalTable(DESIGN_BLOCK_LIB_TABLE &aTable)
Load the global design block library table into aTable.
static DESIGN_BLOCK_LIB_TABLE & GetGlobalLibTable()
int ShowModal() override
The base frame for deriving all KiCad main window classes.
static void SetSchEditFrame(SCH_EDIT_FRAME *aSchEditFrame)
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 CreateServer(int service, bool local=true)
Definition: eda_dde.cpp:43
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_SCH
eeschema DSO
Definition: kiway.h:292
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.
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
Schematic editor (Eeschema) main window.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:59
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.
std::unique_ptr< SEXPR > ParseFromFile(const std::string &aFilename)
size_t GetNumberOfChildren() const
Definition: sexpr.cpp:71
bool IsList() const
Definition: sexpr.h:49
SEXPR * GetChild(size_t aIndex) const
Definition: sexpr.cpp:49
The SIMULATOR_FRAME holds the main user-interface for running simulations.
Symbol library viewer main window.
The symbol library editor main window.
static SYMBOL_LIB_TABLE & GetGlobalLibTable()
static wxString GetGlobalTableFileName()
Fetch the global symbol library table file name.
static bool LoadGlobalTable(SYMBOL_LIB_TABLE &aTable)
Load the global symbol library table into aTable.
Symbol library viewer main window.
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.
#define _(s)
DDE server & client.
#define KICAD_SCH_PORT_SERVICE_NUMBER
Eeschema listens on this port for commands from Pcbnew.
Definition: eda_dde.h:43
EDA_UNITS
Definition: eda_units.h:46
SCH_SHEET * g_RootSheet
Definition: eeschema.cpp:73
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
Definition: eeschema.cpp:298
static void traverseSEXPR(SEXPR::SEXPR *aNode, const std::function< void(SEXPR::SEXPR *)> &aVisitor)
Definition: eeschema.cpp:439
@ PANEL_SYM_EDIT_GRIDS
Definition: frame_type.h:73
@ FRAME_SCH_SYMBOL_EDITOR
Definition: frame_type.h:35
@ PANEL_SCH_FIELD_NAME_TEMPLATES
Definition: frame_type.h:82
@ FRAME_SCH_VIEWER
Definition: frame_type.h:36
@ PANEL_SCH_DISP_OPTIONS
Definition: frame_type.h:77
@ PANEL_SCH_SIMULATOR
Definition: frame_type.h:83
@ FRAME_SCH
Definition: frame_type.h:34
@ FRAME_SIMULATOR
Definition: frame_type.h:38
@ PANEL_SYM_EDIT_OPTIONS
Definition: frame_type.h:74
@ PANEL_SCH_EDIT_OPTIONS
Definition: frame_type.h:79
@ PANEL_SYM_DISP_OPTIONS
Definition: frame_type.h:72
@ DIALOG_SCH_LIBRARY_TABLE
Definition: frame_type.h:117
@ PANEL_SYM_COLORS
Definition: frame_type.h:75
@ PANEL_SCH_ANNO_OPTIONS
Definition: frame_type.h:80
@ PANEL_SCH_GRIDS
Definition: frame_type.h:78
@ PANEL_SCH_COLORS
Definition: frame_type.h:81
@ DIALOG_DESIGN_BLOCK_LIBRARY_TABLE
Definition: frame_type.h:116
@ FRAME_SYMBOL_CHOOSER
Definition: frame_type.h:37
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
Definition: gestfich.cpp:290
static const std::string LegacySchematicFileExtension
static const std::string NetlistFileExtension
static const std::string SymbolLibraryTableFileName
static const std::string SchematicSymbolFileExtension
static const std::string KiCadSchematicFileExtension
static const std::string LegacySymbolLibFileExtension
static const std::string KiCadSymbolLibFileExtension
static const std::string BackupFileSuffix
static const std::string LegacySymbolDocumentFileExtension
#define KIFACE_API
Definition: import_export.h:61
#define KFCTL_CLI
Running as CLI app.
Definition: kiway.h:161
#define KIFACE_GETTER
Definition: kiway.h:110
Definition: eeschema.cpp:76
SCH::IFACE KIFACE_BASE, UNITS_PROVIDER kiface("eeschema", KIWAY::FACE_SCH)
void InvokeEditDesignBlockLibTable(KIWAY *aKiway, wxWindow *aParent)
void InvokeSchEditSymbolLibTable(KIWAY *aKiway, wxWindow *aParent)
PGM_BASE & Pgm()
The global program "get" accessor.
Definition: pgm_base.cpp:1073
see class PGM_BASE
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: string_utils.h:398
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: eeschema.cpp:622
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
Typically start_common() is called from here.
Definition: eeschema.cpp:309
bool loadGlobalDesignBlockLibTable()
Definition: eeschema.cpp:398
void SaveFileAs(const wxString &aProjectBasePath, const wxString &aProjectName, 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: eeschema.cpp:452
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
Definition: eeschema.cpp:94
IFACE(const char *aName, KIWAY::FACE_T aType)
Definition: eeschema.cpp:83
void Reset() override
Reloads global state.
Definition: eeschema.cpp:348
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
Definition: eeschema.cpp:266
std::unique_ptr< EESCHEMA_JOBS_HANDLER > m_jobHandler
Definition: eeschema.cpp:289
bool loadGlobalLibTable()
Definition: eeschema.cpp:354
bool HandleJobConfig(JOB *aJob, wxWindow *aParent) override
Definition: eeschema.cpp:628
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
Definition: eeschema.cpp:433
Definition of file extensions used in Kicad.