Mail Archives: geda-user/2015/07/14/06:42:46
On Tue, 14 Jul 2015, Kai-Martin Knaak wrote:
> Current gschem git head sort of has this. At least for symbols. You
> can select different symbols, type ee and the dialog presents all of
> the shared attributes.
> This comes handy for mass changes of attributes.
Xi has the complementary feature; when you select multiple objects, it
shows all attributes (line width etc.) any of the selected objects has,
but only shows a value if all objects have the same value.
If you want to implement this feature in your editor, you could consider
using libxornstorage. You don't have to use any Python to do so; it's a
simple C/C++ library which provides elementary data access functions.
For each built-in gEDA "attribute" like line width, text size, etc., it
provides a triplet of functions:
void xornsch_get_text_size(
xorn_revision_t rev, xorn_selection_t sel,
xorn_attst_t *state_return, int *value_return);
int xornsch_set_text_size(
xorn_revision_t rev, xorn_selection_t sel, int value);
xorn_selection_t xornsch_select_by_text_size(
xorn_revision_t rev, int value);
The returned "state" tells you whether any of the objects have the
attributes, and whether it is consistent:
xorn_attst_na
None of the selected objects has this attribute.
Don't show this attribute in the property editor.
xorn_attst_consistent
All selected objects have the same value of this attribute.
Show this value for this attribute in the property editor.
xorn_attst_inconsistent
There are different values of this attribute between the
selected objects. Show this attribute in the property
editor, but don't show a value.
For more information, see the libxornstorage documentation at
http://hedmen.org/xorn/doc/api/html/xornstorage_8h_source.html
Roland
- Raw text -