19 Commits

Author SHA1 Message Date
John Beard
b34746e06b Symbol editor: allow editing all related symbols from the treeview
This makes it more straightforward to edit a group of related symbols
(related = all derived from the same parent, including the parent).

Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/21067
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/9742
Relates-To: https://gitlab.com/kicad/code/kicad/-/issues/11506
2025-09-03 00:24:18 +08:00
Jeff Young
7eb75720b5 Start to retire "alias" in favour of "symbol" and "derived symbol".
Note: terminology changes only.  No (intentional)
functional changes.
2025-02-24 11:08:29 +00:00
Jeff Young
aaca66351e Case-insensitive collision detection for symbol names.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/19370
2025-02-24 11:08:29 +00:00
Wayne Stambaugh
f45915ba93 Eeschema folder housekeeping. 2025-02-06 09:47:00 -05:00
Seth Hillbrand
0b2d4d4879 Revise Copyright statement to align with TLF
Recommendation is to avoid using the year nomenclature as this
information is already encoded in the git repo.  Avoids needing to
repeatly update.

Also updates AUTHORS.txt from current repo with contributor names
2025-01-01 14:12:04 -08:00
John Beard
9d4e7e359b SYMBOL_LIBRARY_MANAGER: SaveBuffer doesn't need ownership
This function just uses the buffer, it doesn't retain
part-ownership, so it doesn't need to get a copy of the
shared_ptr (or even know that the shared_ptr exists).

A reference count of the buffers is safely held by the caller
in SaveLibrary while this function executes.
2024-09-19 06:35:43 +01:00
John Beard
a8f4dfd47d SYMBOL_BUFFER: Enforce non-null returns
SYMBOL_BUFFER GetSymbol and GetOriginal cannot return null,
as the SYMBOL_BUFFER class internally ensures that the
original and current symbol pointers are always filled
through checks in the ctor and setters.

This means that clients don't need to null-check the returns,
which is good because they mostly already do not.

Return references instead, to formalise the non-nullity of
these pointers and absolve the calling code of having to
consider if they might be null.
2024-09-19 06:35:43 +01:00
John Beard
06eab304e5 SYMBOL_LIBRARY_MANAGER: Formalise ownership when creating SYMBOL_BUFFERs
Previously, SYMBOL_BUFFER took plain pointers and took ownership
of it (plus the ownership of an internal new'd pointer).
Use unique_ptr to express this relationship more clearly and
safely.

Add a non-null assert in SYMBOL_BUFFER's ctor.

Use more restricted-scope variables in a couple of places where
a re-used variable was not required.

There are still memory-leak opportunities in here, for example
SaveBuffer new's things and can return without handing them over
or deleting.
2024-09-19 06:35:43 +01:00
John Beard
49a0318fe5 SYMBOL_LIBRARY_MANAGER: Clarify UpdateBuffer ownership
Again, this doesn't retain part-ownership of the pointer
and null is a wxCHECK failure. So hoist the null check
and then handle it as a ref (=non null, caller owns).

Also fixes a trivial mem leak in test_symbol_library_manager.cpp.
2024-09-19 06:35:43 +01:00
John Beard
a756b058ae SYMBOL_LIBRARY_MANAGER: Clarify ownership semantics
DeleteBuffer took a std::shared_ptr by value. This means
it claims to take (and keep) part-ownership of the pointed-to
item. However, this function does not take any ownership or
change the item, it just refers to it. It also does not null-check
the pointer. So it should be a const reference to the item.
Ownership semantics are then: the caller retains ownership
while the function executes.

(It also saves a shared_ptr ref count, but that won't be
important here).
2024-09-19 06:35:43 +01:00
John Beard
69889eff7c SYMBOL_LIBRARY_MANAGER: Enforce non-null via reference
All code paths in CreateLibrary and AddLibrary check that
the LIB_TABLE is non-null first.
2024-09-19 06:35:43 +01:00
Jeff Young
251ed2ee54 Formatting and "auto" reduction. 2024-06-19 12:39:22 +01:00
Ian McInerney
85f62c1fde Rename all schematic IO plugins 2023-12-24 01:22:21 +00:00
Ian McInerney
d8b47d18d3 Initial rename of file plugin infrastructure components to IO 2023-12-24 01:22:21 +00:00
Wayne Stambaugh
9ff8d02e60 Symbol library manager object changes.
* Fix issue handling symbols with multiple inheritance.
* Remove unused code from the symbol library manager object.
* Splits out the library buffer and symbol buffer object so the can be unit
  tested without having to mock the symbol library manager object.
* Add unit tests for library buffer and symbol buffer objects.
2023-10-09 14:58:49 -04:00
Wayne Stambaugh
1026596964 Allow symbols to be derived from other derived symbols.
[CHANGED] Symbols can now be derived from other derived symbols removing
          the requirement to derive from root symbols.
2023-08-24 07:59:32 -04:00
Seth Hillbrand
14f6e32c74 ADDED: Change watcher for libraries
When editing or viewing library symbols, the files are watched for
underlying changes.  If any occur, the user is either prompted to reload
(if reloading would overwrite their current edits) or the file is
silently updated to the current version on disk.

This also sets a custom assertion handler to avoid unneeded crashes when
recieving invalid SAMBA packets and turns off assertions entirely when
running in release (non-debug) mode
2023-05-31 13:46:00 -07:00
Jon Evans
35520c78e4 Fix missing virtual dtor 2022-09-23 21:44:15 -04:00
Jon Evans
2089374f53 ADDED: Export symbols from schematic to library
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11433
2022-09-23 21:23:01 -04:00