|
KiCad PCB EDA Suite
|
One open symbol tab owning a working LIB_SYMBOL and screen lent to the frame while active. More...
#include <symbol_editor_tab_context.h>
Public Member Functions | |
| SYMBOL_EDITOR_TAB_CONTEXT (const wxString &aLib, const wxString &aName, SYMBOL_BUFFER *aBuffer) | |
| SYMBOL_EDITOR_TAB_CONTEXT (LIB_SYMBOL *aSymbol, SCH_SCREEN *aScreen, const KIID &aSchematicSymbolUUID, const wxString &aReference) | |
| Construct an instance (schematic) tab over an already-built transient working symbol/screen. | |
| ~SYMBOL_EDITOR_TAB_CONTEXT () override | |
| wxString | GetTabKey () const override |
| Stable identity for persistence and de-duplication. | |
| wxString | GetDisplayName () const override |
| Short label shown on the tab. | |
| bool | IsTransient () const |
| True for an instance (schematic) tab, which is session-only and never persisted. | |
| bool | IsFromSchematic () const |
| const KIID & | GetSchematicSymbolUUID () const |
| const wxString & | GetReference () const |
| bool | IsModified () const override |
| True when the working screen carries unsaved edits. | |
| const wxString & | GetLibrary () const |
| const wxString & | GetName () const |
| LIB_SYMBOL * | GetSymbol () const |
| Observe the working symbol/screen. | |
| SCH_SCREEN * | GetScreen () const |
| void | ReleaseToFrame () |
| Hand the working symbol/screen to the frame as the tab becomes active. | |
| void | AdoptWorkingObjects (LIB_SYMBOL *aSymbol, SCH_SCREEN *aScreen) |
| Take ownership back on detach, capturing whatever the frame's symbol now points at. | |
| void | RefreshFrameOwnedObjects (LIB_SYMBOL *aSymbol, SCH_SCREEN *aScreen) |
| Track the frame's new working symbol after undo/redo replaces it, while staying frame-owned. | |
| int | GetUnit () const |
| void | SetUnit (int aUnit) |
| int | GetBodyStyle () const |
| void | SetBodyStyle (int aBodyStyle) |
| bool | IsPreview () const |
| void | SetPreview (bool aPreview) |
| UNDO_REDO_CONTAINER & | UndoList () |
| UNDO_REDO_CONTAINER & | RedoList () |
| VIEW_SNAPSHOT & | ViewSnapshot () |
| std::vector< KIID > & | SavedSelection () |
| Selection saved as resolved KIIDs, restored after the view is rebuilt. | |
Static Public Member Functions | |
| static wxString | MakeTabKey (const wxString &aLib, const wxString &aName) |
| De-duplication key for a library:symbol pair. | |
| static wxString | MakeInstanceTabKey (const KIID &aSchematicSymbolUUID) |
| De-duplication key for a placed schematic instance, in a namespace disjoint from library keys. | |
Protected Attributes | |
| bool | m_preview = false |
| std::unique_ptr< UNDO_REDO_CONTAINER > | m_undo |
| std::unique_ptr< UNDO_REDO_CONTAINER > | m_redo |
| VIEW_SNAPSHOT | m_viewSnapshot |
| std::vector< KIID > | m_savedSelection |
Private Attributes | |
| wxString | m_lib |
| wxString | m_name |
| LIB_SYMBOL * | m_symbol |
| Working copy; owned by the context while detached. | |
| SCH_SCREEN * | m_screen |
| Working screen; owned by the context while detached. | |
| bool | m_frameOwns |
| True while the tab is active and the frame owns the symbol/screen. | |
| int | m_unit |
| int | m_bodyStyle |
| True for an instance tab edited in place from a placed schematic symbol. | |
| bool | m_fromSchematic |
| Source instance UUID, used as both the de-dup key and the save-back target. | |
| KIID | m_schematicSymbolUUID |
| Reference designator of the source instance, shown as the tab label. | |
| wxString | m_reference |
One open symbol tab owning a working LIB_SYMBOL and screen lent to the frame while active.
A tab is one of two kinds. A library tab edits a buffered library symbol and is keyed by its library:name pair and persisted across sessions. An instance tab edits a symbol pulled from a placed schematic instance (Ctrl-E); it owns a transient working symbol with no library buffer, is keyed by the source instance UUID, and is session-only so it is never persisted.
Definition at line 41 of file symbol_editor_tab_context.h.
| SYMBOL_EDITOR_TAB_CONTEXT::SYMBOL_EDITOR_TAB_CONTEXT | ( | const wxString & | aLib, |
| const wxString & | aName, | ||
| SYMBOL_BUFFER * | aBuffer ) |
Definition at line 27 of file symbol_editor_tab_context.cpp.
References SYMBOL_BUFFER::GetSymbol(), SYMBOL_BUFFER::IsModified(), m_bodyStyle, m_frameOwns, m_fromSchematic, m_lib, m_name, m_screen, m_symbol, and m_unit.
| SYMBOL_EDITOR_TAB_CONTEXT::SYMBOL_EDITOR_TAB_CONTEXT | ( | LIB_SYMBOL * | aSymbol, |
| SCH_SCREEN * | aScreen, | ||
| const KIID & | aSchematicSymbolUUID, | ||
| const wxString & | aReference ) |
Construct an instance (schematic) tab over an already-built transient working symbol/screen.
The context takes ownership of both objects, following the same frame-borrow contract as a library tab. There is no library buffer. Save routing is driven by the stored source UUID and reference, which the frame restores on activation.
Definition at line 50 of file symbol_editor_tab_context.cpp.
References m_bodyStyle, m_frameOwns, m_fromSchematic, m_reference, m_schematicSymbolUUID, m_screen, m_symbol, and m_unit.
|
override |
Definition at line 65 of file symbol_editor_tab_context.cpp.
References m_frameOwns, m_screen, and m_symbol.
|
inline |
Take ownership back on detach, capturing whatever the frame's symbol now points at.
Definition at line 118 of file symbol_editor_tab_context.h.
References m_frameOwns, m_screen, and m_symbol.
Referenced by SYMBOL_EDIT_FRAME::promptAndCloseSymbolTab().
|
inline |
Definition at line 137 of file symbol_editor_tab_context.h.
References m_bodyStyle.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), and BOOST_AUTO_TEST_CASE().
|
inlineoverridevirtual |
Short label shown on the tab.
Implements EDITOR_TAB_CONTEXT.
Definition at line 83 of file symbol_editor_tab_context.h.
References m_fromSchematic, m_name, and m_reference.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and SYMBOL_EDIT_FRAME::promptAndCloseSymbolTab().
|
inline |
Definition at line 99 of file symbol_editor_tab_context.h.
References m_lib.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab().
|
inline |
Definition at line 100 of file symbol_editor_tab_context.h.
References m_name.
|
inline |
Definition at line 92 of file symbol_editor_tab_context.h.
References m_reference.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), and BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 91 of file symbol_editor_tab_context.h.
References m_schematicSymbolUUID.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), and BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 106 of file symbol_editor_tab_context.h.
References m_screen.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inline |
Observe the working symbol/screen.
Valid whether active or detached.
Definition at line 105 of file symbol_editor_tab_context.h.
References m_symbol.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inlineoverridevirtual |
Stable identity for persistence and de-duplication.
Implements EDITOR_TAB_CONTEXT.
Definition at line 77 of file symbol_editor_tab_context.h.
References m_fromSchematic, m_lib, m_name, m_schematicSymbolUUID, MakeInstanceTabKey(), and MakeTabKey().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and SYMBOL_EDIT_FRAME::restoreSymbolTabsFromSettings().
|
inline |
Definition at line 134 of file symbol_editor_tab_context.h.
References m_unit.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), and BOOST_AUTO_TEST_CASE().
|
inline |
Definition at line 90 of file symbol_editor_tab_context.h.
References m_fromSchematic.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), and BOOST_AUTO_TEST_CASE().
|
overridevirtual |
True when the working screen carries unsaved edits.
Implements EDITOR_TAB_CONTEXT.
Definition at line 76 of file symbol_editor_tab_context.cpp.
References m_screen.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::promptAndCloseSymbolTab(), and SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME().
|
inlineinherited |
Definition at line 58 of file editor_tab_context.h.
References m_preview.
|
inline |
True for an instance (schematic) tab, which is session-only and never persisted.
Definition at line 88 of file symbol_editor_tab_context.h.
References m_fromSchematic.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlinestatic |
De-duplication key for a placed schematic instance, in a namespace disjoint from library keys.
The leading control character cannot appear in a library nickname, so an instance key can never collide with a library:name key.
Definition at line 72 of file symbol_editor_tab_context.h.
References KIID::AsString().
Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::findOrCreateSymbolInstanceTab(), and GetTabKey().
|
inlinestatic |
De-duplication key for a library:symbol pair.
Definition at line 61 of file symbol_editor_tab_context.h.
Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::findOrCreateSymbolTab(), and GetTabKey().
|
inlineinherited |
Definition at line 62 of file editor_tab_context.h.
References m_redo.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), SYMBOL_EDIT_FRAME::clearSymbolTabUndoRedo(), FOOTPRINT_EDIT_FRAME::freeFootprintTabUndoRedo(), and FOOTPRINT_EDIT_FRAME::installFootprintTabBoard().
|
inline |
Track the frame's new working symbol after undo/redo replaces it, while staying frame-owned.
Definition at line 128 of file symbol_editor_tab_context.h.
|
inline |
Hand the working symbol/screen to the frame as the tab becomes active.
The context stops deleting them until AdoptWorkingObjects takes ownership back on detach.
Definition at line 113 of file symbol_editor_tab_context.h.
References m_frameOwns.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab().
|
inlineinherited |
Selection saved as resolved KIIDs, restored after the view is rebuilt.
Definition at line 77 of file editor_tab_context.h.
References m_savedSelection.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), and FOOTPRINT_EDIT_FRAME::installFootprintTabBoard().
|
inline |
Definition at line 138 of file symbol_editor_tab_context.h.
References m_bodyStyle.
Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::findOrCreateSymbolInstanceTab(), and SYMBOL_EDIT_FRAME::findOrCreateSymbolTab().
|
inlineinherited |
Definition at line 59 of file editor_tab_context.h.
References m_preview.
|
inline |
Definition at line 135 of file symbol_editor_tab_context.h.
References m_unit.
Referenced by BOOST_AUTO_TEST_CASE(), SYMBOL_EDIT_FRAME::findOrCreateSymbolInstanceTab(), and SYMBOL_EDIT_FRAME::findOrCreateSymbolTab().
|
inlineinherited |
Definition at line 61 of file editor_tab_context.h.
References m_undo.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), SYMBOL_EDIT_FRAME::clearSymbolTabUndoRedo(), FOOTPRINT_EDIT_FRAME::freeFootprintTabUndoRedo(), and FOOTPRINT_EDIT_FRAME::installFootprintTabBoard().
|
inlineinherited |
Definition at line 72 of file editor_tab_context.h.
References m_viewSnapshot.
Referenced by SYMBOL_EDIT_FRAME::activateSymbolTab(), and FOOTPRINT_EDIT_FRAME::installFootprintTabBoard().
|
private |
True for an instance tab edited in place from a placed schematic symbol.
Definition at line 147 of file symbol_editor_tab_context.h.
Referenced by GetBodyStyle(), SetBodyStyle(), SYMBOL_EDITOR_TAB_CONTEXT(), and SYMBOL_EDITOR_TAB_CONTEXT().
|
private |
True while the tab is active and the frame owns the symbol/screen.
Definition at line 145 of file symbol_editor_tab_context.h.
Referenced by AdoptWorkingObjects(), ReleaseToFrame(), SYMBOL_EDITOR_TAB_CONTEXT(), SYMBOL_EDITOR_TAB_CONTEXT(), and ~SYMBOL_EDITOR_TAB_CONTEXT().
|
private |
Source instance UUID, used as both the de-dup key and the save-back target.
Definition at line 150 of file symbol_editor_tab_context.h.
Referenced by GetDisplayName(), GetTabKey(), IsFromSchematic(), IsTransient(), SYMBOL_EDITOR_TAB_CONTEXT(), and SYMBOL_EDITOR_TAB_CONTEXT().
|
private |
Definition at line 141 of file symbol_editor_tab_context.h.
Referenced by GetLibrary(), GetTabKey(), and SYMBOL_EDITOR_TAB_CONTEXT().
|
private |
Definition at line 142 of file symbol_editor_tab_context.h.
Referenced by GetDisplayName(), GetName(), GetTabKey(), and SYMBOL_EDITOR_TAB_CONTEXT().
|
protectedinherited |
Definition at line 80 of file editor_tab_context.h.
Referenced by IsPreview(), and SetPreview().
|
protectedinherited |
Definition at line 82 of file editor_tab_context.h.
Referenced by EDITOR_TAB_CONTEXT(), and RedoList().
|
private |
Definition at line 156 of file symbol_editor_tab_context.h.
Referenced by GetDisplayName(), GetReference(), and SYMBOL_EDITOR_TAB_CONTEXT().
|
protectedinherited |
Definition at line 84 of file editor_tab_context.h.
Referenced by SavedSelection().
|
private |
Reference designator of the source instance, shown as the tab label.
Definition at line 153 of file symbol_editor_tab_context.h.
Referenced by GetSchematicSymbolUUID(), GetTabKey(), and SYMBOL_EDITOR_TAB_CONTEXT().
|
private |
Working screen; owned by the context while detached.
Definition at line 144 of file symbol_editor_tab_context.h.
Referenced by AdoptWorkingObjects(), GetScreen(), IsModified(), RefreshFrameOwnedObjects(), SYMBOL_EDITOR_TAB_CONTEXT(), SYMBOL_EDITOR_TAB_CONTEXT(), and ~SYMBOL_EDITOR_TAB_CONTEXT().
|
private |
Working copy; owned by the context while detached.
Definition at line 143 of file symbol_editor_tab_context.h.
Referenced by AdoptWorkingObjects(), GetSymbol(), RefreshFrameOwnedObjects(), SYMBOL_EDITOR_TAB_CONTEXT(), SYMBOL_EDITOR_TAB_CONTEXT(), and ~SYMBOL_EDITOR_TAB_CONTEXT().
|
protectedinherited |
Definition at line 81 of file editor_tab_context.h.
Referenced by EDITOR_TAB_CONTEXT(), and UndoList().
|
private |
Definition at line 146 of file symbol_editor_tab_context.h.
Referenced by GetUnit(), SetUnit(), SYMBOL_EDITOR_TAB_CONTEXT(), and SYMBOL_EDITOR_TAB_CONTEXT().
|
protectedinherited |
Definition at line 83 of file editor_tab_context.h.
Referenced by ViewSnapshot().