summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-30 01:11:04 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-30 01:22:03 (GMT)
commit9fa6e29c6bbd1cb2f1c3b988267c12522baae08a (patch)
treefb88db19f6b9f08c9bdb459bd669ece67324e454
parent5c7199fb2fced0064092c621107f4ff30f82f940 (diff)
downloadeeshow-9fa6e29c6bbd1cb2f1c3b988267c12522baae08a.zip
eeshow-9fa6e29c6bbd1cb2f1c3b988267c12522baae08a.tar.gz
eeshow-9fa6e29c6bbd1cb2f1c3b988267c12522baae08a.tar.bz2
add "extra" filtering at gfx_end (this fixed -e for all Cairo formats)
-rw-r--r--gfx/cro.c35
-rw-r--r--gfx/cro.h3
-rw-r--r--gfx/diff.c5
-rw-r--r--gfx/fig.c3
-rw-r--r--gfx/gfx.c4
-rw-r--r--gfx/gfx.h4
-rw-r--r--main/eediff.c2
-rw-r--r--main/eeplot.c4
8 files changed, 30 insertions, 30 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 5b23113..c68ba01 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -698,7 +698,7 @@ static void cr_pdf_new_sheet(void *ctx)
}
-static int cr_pdf_end(void *ctx)
+static int cr_pdf_end(void *ctx, enum gfx_extra extra)
{
struct cro_ctx *cc = ctx;
int w, h;
@@ -730,13 +730,13 @@ static int cr_pdf_end(void *ctx)
set_color(cc, COLOR_WHITE);
cairo_paint(cc->cr);
- record_replay(cc->sheets + i, 0);
+ record_replay(cc->sheets + i, extra);
record_destroy(cc->sheets + i);
cairo_show_page(cc->cr);
}
- record_replay(&cc->record, 0);
+ record_replay(&cc->record, extra);
record_destroy(&cc->record);
cairo_show_page(cc->cr);
@@ -796,7 +796,7 @@ static void cr_ps_new_sheet(void *ctx)
}
-static int ps_end(struct cro_ctx *cc, int eps)
+static int ps_end(struct cro_ctx *cc, enum gfx_extra extra, int eps)
{
int w, h;
unsigned i;
@@ -826,13 +826,13 @@ static int ps_end(struct cro_ctx *cc, int eps)
set_color(cc, COLOR_WHITE);
cairo_paint(cc->cr);
- record_replay(cc->sheets + i, 0);
+ record_replay(cc->sheets + i, extra);
record_destroy(cc->sheets + i);
cairo_show_page(cc->cr);
}
- record_replay(&cc->record, 0);
+ record_replay(&cc->record, extra);
record_destroy(&cc->record);
cairo_show_page(cc->cr);
@@ -847,15 +847,15 @@ static int ps_end(struct cro_ctx *cc, int eps)
}
-static int cr_ps_end(void *ctx)
+static int cr_ps_end(void *ctx, enum gfx_extra extra)
{
- return ps_end(ctx, 0);
+ return ps_end(ctx, extra, 0);
}
-static int cr_eps_end(void *ctx)
+static int cr_eps_end(void *ctx, enum gfx_extra extra)
{
- return ps_end(ctx, 1);
+ return ps_end(ctx, extra, 1);
}
@@ -879,7 +879,7 @@ static void *cr_svg_init(void)
}
-static int cr_svg_end(void *ctx)
+static int cr_svg_end(void *ctx, enum gfx_extra extra)
{
struct cro_ctx *cc = ctx;
int w, h;
@@ -908,13 +908,13 @@ static int cr_svg_end(void *ctx)
set_color(cc, COLOR_WHITE);
cairo_paint(cc->cr);
- record_replay(cc->sheets + i, 0);
+ record_replay(cc->sheets + i, extra);
record_destroy(cc->sheets + i);
cairo_show_page(cc->cr);
}
- record_replay(&cc->record, 0);
+ record_replay(&cc->record, extra);
record_destroy(&cc->record);
cairo_show_page(cc->cr);
@@ -946,13 +946,13 @@ static void *cr_png_init(void)
}
-static int cr_png_end(void *ctx)
+static int cr_png_end(void *ctx, enum gfx_extra extra)
{
struct cro_ctx *cc = ctx;
int w, h, stride;
uint32_t *data;
- data = cro_img_end(cc, &w, &h, &stride);
+ data = cro_img_end(cc, &w, &h, &stride, extra);
cro_img_write(cc->s, cc->output_name);
cairo_surface_destroy(cc->s);
@@ -967,7 +967,8 @@ static int cr_png_end(void *ctx)
/* ----- Images (auto-sizing, using redraw) -------------------------------- */
-uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride)
+uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride,
+ enum gfx_extra extra)
{
uint32_t *data;
@@ -990,7 +991,7 @@ uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride)
cairo_set_line_width(cc->cr, 2);
cairo_set_line_cap(cc->cr, CAIRO_LINE_CAP_ROUND);
- record_replay(&cc->record, 0);
+ record_replay(&cc->record, extra);
record_destroy(&cc->record);
cairo_surface_flush(cc->s);
diff --git a/gfx/cro.h b/gfx/cro.h
index f24ba38..b75d9ed 100644
--- a/gfx/cro.h
+++ b/gfx/cro.h
@@ -42,7 +42,8 @@ void cro_color_override(struct cro_ctx *cc, int color);
void cro_get_size(const struct cro_ctx *cc, int *w, int *h, int *x, int *y);
-uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride);
+uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride,
+ enum gfx_extra extra);
void cro_img_write(cairo_surface_t *s, const char *name);
void cro_img_reset(struct cro_ctx *cc);
void cro_img_destroy(struct cro_ctx *cc);
diff --git a/gfx/diff.c b/gfx/diff.c
index fd7245c..bba9697 100644
--- a/gfx/diff.c
+++ b/gfx/diff.c
@@ -196,7 +196,6 @@ void *diff_process_file(struct diff *diff, struct file_names *file_names,
if (!gfx_args(diff->gfx, argc, argv, opts))
goto fail_open;
sch_render(sch.sheets, diff->gfx);
- /* @@@ filter extra */
sch_free(&sch);
lib_free(&lib);
@@ -453,7 +452,7 @@ static cairo_t *make_diff(cairo_t *cr, int cx, int cy, float scale,
/* ----- Diff to file ------------------------------------------------------ */
-static int diff_end(void *ctx)
+static int diff_end(void *ctx, enum gfx_extra extra)
{
struct diff *diff = ctx;
cairo_t *old_cr;
@@ -467,7 +466,7 @@ static int diff_end(void *ctx)
cro_img_reset(gfx_user(diff->gfx));
old_cr = make_diff(NULL, 0, 0, diff->scale,
- gfx_user(diff->gfx), gfx_user(diff->new_gfx), 0, NULL,
+ gfx_user(diff->gfx), gfx_user(diff->new_gfx), extra, NULL,
&changed);
s = cairo_get_target(old_cr);
diff --git a/gfx/fig.c b/gfx/fig.c
index daa015a..5c6ceb8 100644
--- a/gfx/fig.c
+++ b/gfx/fig.c
@@ -365,10 +365,11 @@ static bool fig_args(void *ctx, int argc, char *const *argv, const char *opts)
}
-static int fig_end(void *ctx)
+static int fig_end(void *ctx, enum gfx_extra extra)
{
struct fig_ctx *fig = ctx;
+ /* @@@ support extra */
if (fclose(fig->file) < 0)
diag_pfatal("fclose");
free(ctx);
diff --git a/gfx/gfx.c b/gfx/gfx.c
index bc1a318..01d04f3 100644
--- a/gfx/gfx.c
+++ b/gfx/gfx.c
@@ -187,12 +187,12 @@ void gfx_destroy(struct gfx *gfx)
}
-int gfx_end(struct gfx *gfx)
+int gfx_end(struct gfx *gfx, enum gfx_extra extra)
{
int res = 0;
if (gfx->ops->end)
- res = gfx->ops->end(gfx->user);
+ res = gfx->ops->end(gfx->user, extra);
gfx_destroy(gfx);
return res;
}
diff --git a/gfx/gfx.h b/gfx/gfx.h
index 5aa1e82..0e73ba8 100644
--- a/gfx/gfx.h
+++ b/gfx/gfx.h
@@ -56,7 +56,7 @@ struct gfx_ops {
bool (*args)(void *ctx, int argc, char *const *argv, const char *opts);
void (*sheet_name)(void *ctx, const char *name);
void (*new_sheet)(void *ctx);
- int (*end)(void *ctx);
+ int (*end)(void *ctx, enum gfx_extra extra);
};
@@ -94,6 +94,6 @@ bool gfx_multi_sheet(struct gfx *gfx);
void *gfx_user(struct gfx *gfx); /* transitional kludge */
void gfx_destroy(struct gfx *gfx);
-int gfx_end(struct gfx *gfx);
+int gfx_end(struct gfx *gfx, enum gfx_extra extra);
#endif /* !GFX_GFX_H */
diff --git a/main/eediff.c b/main/eediff.c
index c13ade2..1289e41 100644
--- a/main/eediff.c
+++ b/main/eediff.c
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
free_file_names(&file_names_b);
free(opts);
- retval = gfx_end(gfx);
+ retval = gfx_end(gfx, 0);
file_cleanup();
cairo_debug_reset_static_data();
diff --git a/main/eeplot.c b/main/eeplot.c
index 17bc3e3..5a7c84e 100644
--- a/main/eeplot.c
+++ b/main/eeplot.c
@@ -239,7 +239,6 @@ int main(int argc, char **argv)
if (one_sheet) {
sch_render(sch_ctx.sheets, gfx);
- /* @@@ filter extra */
if (pl)
pl_render(pl, gfx, sch_ctx.sheets, sch_ctx.sheets);
} else {
@@ -248,14 +247,13 @@ int main(int argc, char **argv)
for (sheet = sch_ctx.sheets; sheet; sheet = sheet->next) {
gfx_sheet_name(gfx, sheet->title);
sch_render(sheet, gfx);
- /* @@@ filter extra */
if (pl)
pl_render(pl, gfx, sch_ctx.sheets, sheet);
if (sheet->next)
gfx_new_sheet(gfx);
}
}
- retval = gfx_end(gfx);
+ retval = gfx_end(gfx, extra ? gfx_pin_type : 0);
sch_free(&sch_ctx);
lib_free(&lib);