diff --git a/README b/README index bfd905b..1438073 100644 --- a/README +++ b/README @@ -227,6 +227,7 @@ Type Layers (default) copper, solder mask, and solder paste bare copper and solder mask paste solder paste +mask solder mask Rounded pads diff --git a/dump.c b/dump.c index 9abaa86..80f2e54 100644 --- a/dump.c +++ b/dump.c @@ -328,6 +328,9 @@ char *print_obj(const struct obj *obj, const struct vec *prev) case pt_paste: s2 = " paste"; break; + case pt_mask: + s2 = " mask"; + break; default: abort(); } diff --git a/fpd.y b/fpd.y index 5d54248..c91366b 100644 --- a/fpd.y +++ b/fpd.y @@ -521,6 +521,8 @@ pad_type: $$ = pt_bare; else if (!strcmp($1, "paste")) $$ = pt_paste; + else if (!strcmp($1, "mask")) + $$ = pt_mask; else { yyerrorf("unknown pad type \"%s\"", $1); YYABORT; diff --git a/gui_inst.c b/gui_inst.c index 5bb8312..f1c28cd 100644 --- a/gui_inst.c +++ b/gui_inst.c @@ -263,8 +263,17 @@ void gui_draw_pad(struct inst *self) struct coord max = translate(self->u.pad.other); GdkGC *gc; - gc = self->obj->u.pad.type == pt_bare ? - gc_pad_bare[get_mode(self)] : gc_pad[get_mode(self)]; + switch (self->obj->u.pad.type) { + case pt_bare: + gc = gc_pad_bare[get_mode(self)]; + break; + case pt_mask: + gc = gc_pad_mask[get_mode(self)]; + break; + default: + gc = gc_pad[get_mode(self)]; + break; + } sort_coord(&min, &max); gdk_draw_rectangle(DA, gc, TRUE, min.x, min.y, max.x-min.x, max.y-min.y); @@ -280,8 +289,17 @@ void gui_draw_rpad(struct inst *self) GdkGC *gc; unit_type h, w, r; - gc = self->obj->u.pad.type == pt_bare ? - gc_pad_bare[get_mode(self)] : gc_pad[get_mode(self)]; + switch (self->obj->u.pad.type) { + case pt_bare: + gc = gc_pad_bare[get_mode(self)]; + break; + case pt_mask: + gc = gc_pad_mask[get_mode(self)]; + break; + default: + gc = gc_pad[get_mode(self)]; + break; + } sort_coord(&min, &max); h = max.y-min.y; w = max.x-min.x; diff --git a/gui_style.c b/gui_style.c index aea7619..3498675 100644 --- a/gui_style.c +++ b/gui_style.c @@ -26,6 +26,7 @@ GdkGC *gc_vec[mode_n]; GdkGC *gc_obj[mode_n]; GdkGC *gc_pad[mode_n]; GdkGC *gc_pad_bare[mode_n]; +GdkGC *gc_pad_mask[mode_n]; GdkGC *gc_ptext[mode_n]; GdkGC *gc_meas[mode_n]; GdkGC *gc_frame[mode_n]; @@ -65,6 +66,7 @@ void gui_setup_style(GdkDrawable *drawable) style(gc_obj, "#006060", "#00ffff", "#ffff80"); style(gc_pad, "#400000", "#ff0000", "#ffff80"); style(gc_pad_bare, "#402000", "#ff6000", "#ffff80"); + style(gc_pad_mask, "#000040", "#0000ff", "#ffff80"); style(gc_ptext, "#404040", "#ffffff", "#ffffff"); style(gc_meas, "#280040", "#ff00ff", "#ffff80"); style(gc_frame, "#005000", "#009000", "#ffff80"); diff --git a/gui_style.h b/gui_style.h index aad4107..9f583df 100644 --- a/gui_style.h +++ b/gui_style.h @@ -110,6 +110,7 @@ extern GdkGC *gc_vec[mode_n]; extern GdkGC *gc_obj[mode_n]; extern GdkGC *gc_pad[mode_n]; extern GdkGC *gc_pad_bare[mode_n]; +extern GdkGC *gc_pad_mask[mode_n]; extern GdkGC *gc_ptext[mode_n]; extern GdkGC *gc_meas[mode_n]; extern GdkGC *gc_frame[mode_n]; diff --git a/kicad.c b/kicad.c index 99c65d4..2c30097 100644 --- a/kicad.c +++ b/kicad.c @@ -98,6 +98,9 @@ static void kicad_pad(FILE *file, const struct inst *inst) case pt_paste: layers = 1 << layer_paste_top; break; + case pt_mask: + layers = 1 << layer_mask_top; + break; default: abort(); } diff --git a/obj.h b/obj.h index b838c28..6ad11c9 100644 --- a/obj.h +++ b/obj.h @@ -143,6 +143,7 @@ enum pad_type { pt_normal, /* copper and solder mask */ pt_bare, /* only copper (and finish) */ pt_paste, /* only solder paste */ + pt_mask, /* only solder mask */ }; struct frame_ref { diff --git a/postscript.c b/postscript.c index 56bf8cc..e88e111 100644 --- a/postscript.c +++ b/postscript.c @@ -198,6 +198,8 @@ static const char *hatch(enum pad_type type) return "hatchpath"; case pt_paste: return "backhatchpath"; + case pt_mask: + return "dotpath"; default: abort(); }