Index: trunk/src/libcschem/cnc_grp.c =================================================================== --- trunk/src/libcschem/cnc_grp.c (revision 10859) +++ trunk/src/libcschem/cnc_grp.c (revision 10860) @@ -2,7 +2,7 @@ * COPYRIGHT * * cschem - modular/flexible schematics editor - libcschem (core library) - * Copyright (C) 2018..2020,2022,2023 Tibor 'Igor2' Palinkas + * Copyright (C) 2018..2020,2022..2024 Tibor 'Igor2' Palinkas * * (Supported by NLnet NGI0 PET Fund in 2022, Entrust in 2023) * @@ -57,6 +57,7 @@ #include "project.h" #include "abstract.h" #include "libcschem.h" +#include "extobj.h" RND_INLINE csch_role_t csch_role_str2role(const char *str) { @@ -327,6 +328,8 @@ csch_role_set(grp, val); csch_cgrp_update_dsply_recurse(sheet, grp); /* need to move all opjects to the wire layer */ } + if (strcmp(key, "extobj") == 0) + grp->extobj = csch_extobj_lookup(val); } csch_ahdr_t *csch_cgrp_get_abstract(csch_sheet_t *sheet, const csch_cgrp_t *grp, long idx) Index: trunk/src/libcschem/concrete.h =================================================================== --- trunk/src/libcschem/concrete.h (revision 10859) +++ trunk/src/libcschem/concrete.h (revision 10860) @@ -152,6 +152,8 @@ void *mark_ptr; }; +typedef struct csch_extobj_impl_s csch_extobj_impl_t; + struct csch_cgrp_s { /* type=CSCH_CTYPE_GRP || CSCH_CTYPE_GRP_REF */ csch_chdr_t hdr; minuid_bin_t uuid; /* instance (changes on dup/copy) */ @@ -191,6 +193,7 @@ vtl0_t aid; /* link to the abstract objects compiled from this group; zero or one in flat design but can be more in hierarchic */ char *file_name; /* hint: trace file name from which the group was loaded, if available */ csch_rtree_box_t bbox_flt; /* bounding box with floaters included (e.g. for sheet size) */ + const csch_extobj_impl_t *extobj; /* handler; not NULL if extobj attrib is set, but if implementation no found, all fields are NULL */ }; typedef enum csch_sheet_type_e { Index: trunk/src/libcschem/extobj.h =================================================================== --- trunk/src/libcschem/extobj.h (revision 10859) +++ trunk/src/libcschem/extobj.h (revision 10860) @@ -26,7 +26,7 @@ #include -typedef struct csch_extobj_impl_s { +struct csch_extobj_impl_s { const char *name; /* also the hash key */ void (*attr_edit_pre)(csch_cgrp_t *grp, const char *key); @@ -33,7 +33,7 @@ void (*attr_edit_post)(csch_cgrp_t *grp, const char *key); void (*update)(csch_cgrp_t *grp); void (*gui_edit)(csch_cgrp_t *grp); -} csch_extobj_impl_t; +}; void csch_extobj_impl_reg(const csch_extobj_impl_t *impl); void csch_extobj_impl_unreg(const csch_extobj_impl_t *impl); @@ -43,3 +43,5 @@ /* internal, do not call */ void csch_extobj_init(void); void csch_extobj_uninit(void); +const csch_extobj_impl_t *csch_extobj_lookup(const char *name); +