Index: trunk/util/boxsym-rnd/generator.awk =================================================================== --- trunk/util/boxsym-rnd/generator.awk (revision 9903) +++ trunk/util/boxsym-rnd/generator.awk (revision 9904) @@ -1,7 +1,7 @@ # COPYRIGHT # # cschem - modular/flexible schematics editor - box symbol generator utility -# Copyright (C) 2022 Tibor 'Igor2' Palinkas +# Copyright (C) 2022,2023 Tibor 'Igor2' Palinkas # # (Supported by NLnet NGI0 PET Fund in 2022) # @@ -351,7 +351,7 @@ ALIGN["cfg", "expand_slot"] = 1 align_pins("", ALIGN) sym_begin(refdes, -2*pin_grid, -pin_grid) - draw_box(SYM, ALIGN["box","width"], ALIGN["box","height"], border, "") + draw_box(SYM, ALIGN["box","width"], ALIGN["box","height"], border, SLOT["", "shape"], SLOT["", "shape_fill"]) draw_all_pin("", ALIGN, 1) draw_all_labels("") sym_end() @@ -365,7 +365,7 @@ ALIGN["cfg", "expand_slot"] = 0 align_pins(sn, ALIGN) sym_begin(refdes, -2*pin_grid, -pin_grid) - draw_box(SYM, ALIGN["box","width"], ALIGN["box","height"], border, "") + draw_box(SYM, ALIGN["box","width"], ALIGN["box","height"], border, SLOT[sn, "shape"], SLOT[sn, "shape_fill"]) draw_all_pin(sn, ALIGN, 0) draw_all_labels(sn) gen_portmap(sn) Index: trunk/util/boxsym-rnd/parser.awk =================================================================== --- trunk/util/boxsym-rnd/parser.awk (revision 9903) +++ trunk/util/boxsym-rnd/parser.awk (revision 9904) @@ -1,7 +1,7 @@ # COPYRIGHT # # cschem - modular/flexible schematics editor - box symbol generator utility -# Copyright (C) 2022 Tibor 'Igor2' Palinkas +# Copyright (C) 2022,2023 Tibor 'Igor2' Palinkas # # (Supported by NLnet NGI0 PET Fund in 2022) # @@ -123,6 +123,8 @@ } if ($1 == "shape") SLOT[slot, "shape"] = del1($0) + else if ($1 == "shape_fill") + SLOT[slot, "shape_fill"] = tobool($2) else if ($1 == "pinalign") SLOT[slot, "pinalign", $2] = $3 else if ($1 == "label") @@ -162,6 +164,8 @@ ($1 == "attr") { SLOT["", "attr", $2] = del2($0) } ($1 == "attr_both") { SLOT["", "attr", $2] = del2($0); SLOT["", "attr_vis", $2] = "both"; } ($1 == "attr_invis") { SLOT["", "attr", $2] = del2($0); SLOT["", "attr_vis", $2] = "none"; } +($1 == "shape") { SLOT["", "shape"] = del1($0) } +($1 == "shape_fill") {SLOT["", "shape_fill"] = tobool($2) } ($1 == "text_size_mult") { text_size_mult = $2 + 0; Index: trunk/util/boxsym-rnd/util.awk =================================================================== --- trunk/util/boxsym-rnd/util.awk (revision 9903) +++ trunk/util/boxsym-rnd/util.awk (revision 9904) @@ -1,7 +1,7 @@ # COPYRIGHT # # cschem - modular/flexible schematics editor - box symbol generator utility -# Copyright (C) 2022 Tibor 'Igor2' Palinkas +# Copyright (C) 2022,2023 Tibor 'Igor2' Palinkas # # (Supported by NLnet NGI0 PET Fund in 2022) # @@ -37,10 +37,15 @@ function dbg(s) { if(debug) print s > stderr } function Dbg(s) { print s > stderr } -function draw_box(SYM, w, h, border, shape) +function draw_box(SYM, w, h, border, shape, shape_fill ,fill) { - if ((shape ~ "^box") || (shape == "")) - sym_rect(SYM, 0-border*pin_grid, 0-border*pin_grid, (w+border)*pin_grid, (h+border)*pin_grid) + if ((shape ~ "^box") || (shape == "")) { + if (shape_fill) + fill = "sym-decor-fill" + else + fill = "" + sym_rect(SYM, 0-border*pin_grid, 0-border*pin_grid, (w+border)*pin_grid, (h+border)*pin_grid, "sym-decor", fill) + } else error("can not draw box of unknown shape " shape) }