Index: plugins/io_eeschema/read_disp.c =================================================================== --- plugins/io_eeschema/read_disp.c (revision 11333) +++ plugins/io_eeschema/read_disp.c (revision 11334) @@ -1470,6 +1470,104 @@ return 0; } +static int eechema_parse__sch_sheet(read_ctx_t* ctx, csch_cgrp_t* dst, + gsxl_node_t* node) +{ + float x, y; + float w, h; + + csch_cgrp_t* grp; + + const char* const stroke = "sym-decor"; + + /* fetch (at) and (size) for further processing */ + { + gsxl_node_t* n = node; + gsxl_node_t* at = NULL; + gsxl_node_t* size = NULL; + + for(;n && (!at || !size);n=n->next) + { + if(strcmp(n->str, "at")==0) + { + at = n; + } + else + if(strcmp(n->str, "size")==0) + { + size = n; + } + } + + if(!at) + { + eechema_error(ctx, node->parent, + "missing 'at' node from 'sheet' object"); + return -1; + } + + if(!size) + { + eechema_error(ctx, node->parent, + "missing 'size' node from 'sheet' object"); + return -1; + } + + if(eechema_parse_xy(ctx, at->children, &x, &y)!=0) + { + return -1; + } + + if(eechema_parse_xy(ctx, size->children, &w, &h)!=0) + { + return -1; + } + } + + grp = csch_cgrp_alloc(ctx->sheet, &ctx->sheet->direct, + csch_oid_new(ctx->sheet, &ctx->sheet->direct)); + + { + csch_source_arg_t* src; + + src = make_src_attrib(ctx, node->parent); + csch_attrib_set(&grp->attr, CSCH_ATP_USER_DEFAULT, "role", + "symbol", src, NULL); + csch_attr_side_effects(grp, "role"); + } + + if(!csch_alien_mkrect(&ctx->alien, grp, x, y, x+w, y+h, stroke, NULL)) + { + eechema_error(ctx, node->parent, + "could not create 'sheet' rect decor"); + return -1; + } + + /* process (property) and (pin) nodes */ + { + gsxl_node_t* n = node; + + for(;n;n=n->next) + { + if(strcmp(n->str, "property")==0) + { + if(eeschema_parse_property__impl(ctx, grp, NULL, + n->children, 1)!=0) + { + return -1; + } + } + else + if(strcmp(n->str, "pin")==0) + { + TODO("TODO"); + } + } + } + + return 0; +} + static int eechema_parse__libsym_pin_numname(read_ctx_t* ctx, csch_cgrp_t* dst, gsxl_node_t* node, float* offset, int* hide) { @@ -2835,6 +2933,7 @@ { "hierarchical_label", eechema_parse_hierarchicallabel }, { "netclass_flag", eechema_parse_netclassflag }, { "bus_entry", eechema_parse__ignore }, /* TODO: bus is not supported, these must be ignored */ + { "sheet", eechema_parse__sch_sheet }, DRAWING_PRIMITIVES { 0 } };