1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-26 14:04:39 +02:00

eeshow/gfx/gfx.c (gfx_sheet_name): pass sheet name (title) to driver

This commit is contained in:
Werner Almesberger 2016-08-21 11:32:13 -03:00
parent 1930eedb64
commit 7652f3a88f
3 changed files with 10 additions and 0 deletions

View File

@ -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) void gfx_new_sheet(void)
{ {
if (gfx_ops->new_sheet) if (gfx_ops->new_sheet)

View File

@ -38,6 +38,7 @@ struct gfx_ops {
int points, const int x[points], const int y[points]); int points, const int x[points], const int y[points]);
unsigned (*text_width)(void *ctx, const char *s, unsigned size); unsigned (*text_width)(void *ctx, const char *s, unsigned size);
void *(*init)(int argc, char *const *argv); void *(*init)(int argc, char *const *argv);
void (*sheet_name)(void *ctx, const char *name);
void (*new_sheet)(void *ctx); void (*new_sheet)(void *ctx);
void (*end)(void *ctx); void (*end)(void *ctx);
}; };
@ -65,6 +66,7 @@ unsigned gfx_text_width(const char *s, unsigned size);
/* inititalization and termination */ /* inititalization and termination */
void gfx_init(const struct gfx_ops *ops, int argc, char *const *argv); 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); void gfx_new_sheet(void);
bool gfx_multi_sheet(void); bool gfx_multi_sheet(void);
void gfx_end(void); void gfx_end(void);

View File

@ -243,6 +243,7 @@ found:
if (!gfx_multi_sheet()) if (!gfx_multi_sheet())
fatal("graphics backend only supports single sheet\n"); fatal("graphics backend only supports single sheet\n");
for (sheet = sch_ctx.sheets; sheet; sheet = sheet->next) { for (sheet = sch_ctx.sheets; sheet; sheet = sheet->next) {
gfx_sheet_name(sheet->title);
sch_render(sheet); sch_render(sheet);
if (sheet->next) if (sheet->next)
gfx_new_sheet(); gfx_new_sheet();