diff --git a/eeshow/gfx/gfx.c b/eeshow/gfx/gfx.c index a0ac9bd..6236888 100644 --- a/eeshow/gfx/gfx.c +++ b/eeshow/gfx/gfx.c @@ -101,6 +101,13 @@ void gfx_init(const struct gfx_ops *ops, int argc, char *const *argv) } +void gfx_sheet_name(const char *name) +{ + if (gfx_ops->sheet_name) + gfx_ops->sheet_name(gfx_ctx, name); +} + + void gfx_new_sheet(void) { if (gfx_ops->new_sheet) diff --git a/eeshow/gfx/gfx.h b/eeshow/gfx/gfx.h index 327a963..bdd5225 100644 --- a/eeshow/gfx/gfx.h +++ b/eeshow/gfx/gfx.h @@ -38,6 +38,7 @@ struct gfx_ops { int points, const int x[points], const int y[points]); unsigned (*text_width)(void *ctx, const char *s, unsigned size); void *(*init)(int argc, char *const *argv); + void (*sheet_name)(void *ctx, const char *name); void (*new_sheet)(void *ctx); void (*end)(void *ctx); }; @@ -65,6 +66,7 @@ unsigned gfx_text_width(const char *s, unsigned size); /* inititalization and termination */ void gfx_init(const struct gfx_ops *ops, int argc, char *const *argv); +void gfx_sheet_name(const char *name); void gfx_new_sheet(void); bool gfx_multi_sheet(void); void gfx_end(void); diff --git a/eeshow/main.c b/eeshow/main.c index 7f2256e..a178a57 100644 --- a/eeshow/main.c +++ b/eeshow/main.c @@ -243,6 +243,7 @@ found: if (!gfx_multi_sheet()) fatal("graphics backend only supports single sheet\n"); for (sheet = sch_ctx.sheets; sheet; sheet = sheet->next) { + gfx_sheet_name(sheet->title); sch_render(sheet); if (sheet->next) gfx_new_sheet();