summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-30 00:48:00 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-30 01:00:26 (GMT)
commit2f6677ab8f5f15fc09fc02d6ea86fd5b3f650a1d (patch)
tree0f0595cbd998d30e0178035f91b30f7ed6757e54 /kicad
parent2c9e549c9554e0cabb4d4ccdb2c3a2238d62bcf4 (diff)
downloadeeshow-2f6677ab8f5f15fc09fc02d6ea86fd5b3f650a1d.zip
eeshow-2f6677ab8f5f15fc09fc02d6ea86fd5b3f650a1d.tar.gz
eeshow-2f6677ab8f5f15fc09fc02d6ea86fd5b3f650a1d.tar.bz2
get rid of sch_render_extra and move selection to rendering (WIP)
This works for eeshow, but this breaks the -e option of eeplot and eediff, permanently enabling it in FIG, and permanently disabling it in all the Cairo-based formats.
Diffstat (limited to 'kicad')
-rw-r--r--kicad/lib-render.c31
-rw-r--r--kicad/lib.h2
-rw-r--r--kicad/sch-render.c27
-rw-r--r--kicad/sch.h1
4 files changed, 4 insertions, 57 deletions
diff --git a/kicad/lib-render.c b/kicad/lib-render.c
index 8562976..17e6c78 100644
--- a/kicad/lib-render.c
+++ b/kicad/lib-render.c
@@ -631,7 +631,7 @@ static void draw_pin(const struct comp *comp, const struct lib_pin *pin,
/* ----- Pin extras -------------------------------------------------------- */
-static void draw_pin_extra(const struct comp *comp, const struct lib_pin *pin,
+static void draw_pin_type(const struct comp *comp, const struct lib_pin *pin,
struct gfx *gfx, const int m[6])
{
int dx = 0, dy = 0;
@@ -752,25 +752,9 @@ static void draw(const struct comp *comp, const struct lib_obj *obj,
break;
case lib_obj_pin:
draw_pin(comp, &obj->u.pin, gfx, m);
- break;
- default:
- BUG("invalid object type %d", obj->type);
- }
-}
-
-
-static void draw_extra(const struct comp *comp, const struct lib_obj *obj,
- struct gfx *gfx, const int m[6])
-{
- switch (obj->type) {
- case lib_obj_poly:
- case lib_obj_rect:
- case lib_obj_circ:
- case lib_obj_arc:
- case lib_obj_text:
- break;
- case lib_obj_pin:
- draw_pin_extra(comp, &obj->u.pin, gfx, m);
+ gfx_set_extra(gfx, gfx_pin_type);
+ draw_pin_type(comp, &obj->u.pin, gfx, m);
+ gfx_set_extra(gfx, 0);
break;
default:
BUG("invalid object type %d", obj->type);
@@ -818,10 +802,3 @@ void lib_render(const struct comp *comp, struct gfx *gfx,
{
render_lib(comp, gfx, unit, convert, m, draw);
}
-
-
-void lib_render_extra(const struct comp *comp, struct gfx *gfx,
- unsigned unit, unsigned convert, const int m[4])
-{
- render_lib(comp, gfx, unit, convert, m, draw_extra);
-}
diff --git a/kicad/lib.h b/kicad/lib.h
index 2f628d1..37347ff 100644
--- a/kicad/lib.h
+++ b/kicad/lib.h
@@ -136,8 +136,6 @@ extern struct comp *comps;
const struct comp *lib_find(const struct lib *lib, const char *name);
void lib_render(const struct comp *comp, struct gfx *gfx,
unsigned unit, unsigned convert, const int m[6]);
-void lib_render_extra(const struct comp *comp, struct gfx *gfx,
- unsigned unit, unsigned convert, const int m[4]);
bool lib_parse_file(struct lib *lib, struct file *file);
bool lib_parse(struct lib *lib, const char *name, const struct file *related);
diff --git a/kicad/sch-render.c b/kicad/sch-render.c
index 81a97e4..830c99a 100644
--- a/kicad/sch-render.c
+++ b/kicad/sch-render.c
@@ -187,30 +187,3 @@ void sch_render(const struct sheet *sheet, struct gfx *gfx)
BUG("invalid object type \"%d\"", obj->type);
}
}
-
-
-void sch_render_extra(const struct sheet *sheet, struct gfx *gfx)
-{
- struct sch_obj *obj;
-
- for (obj = sheet->objs; obj; obj = obj->next)
- switch (obj->type) {
- case sch_obj_wire:
- case sch_obj_junction:
- case sch_obj_noconn:
- case sch_obj_glabel:
- case sch_obj_text:
- case sch_obj_sheet:
- break;
- case sch_obj_comp:
- {
- const struct sch_comp *comp = &obj->u.comp;
-
- lib_render_extra(comp->comp, gfx, comp->unit,
- comp->convert, comp->m);
- }
- break;
- default:
- BUG("invalid object type \"%d\"", obj->type);
- }
-}
diff --git a/kicad/sch.h b/kicad/sch.h
index 4dde552..92e6de9 100644
--- a/kicad/sch.h
+++ b/kicad/sch.h
@@ -147,7 +147,6 @@ struct sch_ctx {
void decode_alignment(struct text *txt, char hor, char vert);
void sch_render(const struct sheet *sheet, struct gfx *gfx);
-void sch_render_extra(const struct sheet *sheet, struct gfx *gfx);
bool sch_parse(struct sch_ctx *ctx, struct file *file, const struct lib *lib,
const struct sch_ctx *prev);
void sch_init(struct sch_ctx *ctx, bool recurse);