summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-21 11:32:13 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-21 11:32:13 -0300
commit05806761d1d63e0d22370948659f0a9eec9e2f12 (patch)
tree5e4ab58051af32ebeecf9e8358e345847f8e4ac6
parentd782cafa49d23f2dce9061d4cdd7cfe0a36d8ff5 (diff)
downloadeeshow-05806761d1d63e0d22370948659f0a9eec9e2f12.tar.gz
eeshow-05806761d1d63e0d22370948659f0a9eec9e2f12.tar.bz2
eeshow-05806761d1d63e0d22370948659f0a9eec9e2f12.zip
eeshow/gfx/gfx.c (gfx_sheet_name): pass sheet name (title) to driver
-rw-r--r--gfx/gfx.c7
-rw-r--r--gfx/gfx.h2
-rw-r--r--main.c1
3 files changed, 10 insertions, 0 deletions
diff --git a/gfx/gfx.c b/gfx/gfx.c
index a0ac9bd..6236888 100644
--- a/gfx/gfx.c
+++ b/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/gfx/gfx.h b/gfx/gfx.h
index 327a963..bdd5225 100644
--- a/gfx/gfx.h
+++ b/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/main.c b/main.c
index 7f2256e..a178a57 100644
--- a/main.c
+++ b/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();