summaryrefslogtreecommitdiff
path: root/gfx/gfx.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-29 21:16:07 -0300
committerWerner Almesberger <werner@almesberger.net>2016-09-29 21:16:07 -0300
commitda054390b0b924be7e42da258524d86358491c55 (patch)
tree947f5701258a457b0a573f2a09b324cc82fe5f44 /gfx/gfx.c
parentdcf32638d8d05c7cd45ed41128c41e73ec6aa5b4 (diff)
downloadeeshow-da054390b0b924be7e42da258524d86358491c55.tar.gz
eeshow-da054390b0b924be7e42da258524d86358491c55.tar.bz2
eeshow-da054390b0b924be7e42da258524d86358491c55.zip
gfx/: add "extra" flags to gfx API, and preserve them in record.c (WIP)
This is in preparation of generalizing the "extra" system.
Diffstat (limited to 'gfx/gfx.c')
-rw-r--r--gfx/gfx.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gfx/gfx.c b/gfx/gfx.c
index e49160c..bc1a318 100644
--- a/gfx/gfx.c
+++ b/gfx/gfx.c
@@ -24,10 +24,11 @@
struct gfx {
const struct gfx_ops *ops;
void *user;
+ enum gfx_extra extra;
};
-/* ----- Wrappers for graphis primitives ----------------------------------- */
+/* ----- Wrappers for graphics primitives ---------------------------------- */
void gfx_line(struct gfx *gfx,
@@ -107,6 +108,17 @@ unsigned gfx_text_width(struct gfx *gfx, const char *s, unsigned size,
}
+enum gfx_extra gfx_set_extra(struct gfx *gfx, enum gfx_extra extra)
+{
+ enum gfx_extra old = gfx->extra;
+
+ if (gfx->ops->set_extra)
+ gfx->ops->set_extra(gfx->user, extra);
+ gfx->extra = extra;
+ return old;
+}
+
+
/* ----- Initialization ---------------------------------------------------- */
@@ -117,6 +129,7 @@ struct gfx *gfx_init(const struct gfx_ops *ops)
new = alloc_type(struct gfx);
new->user = ops->init();
new->ops = ops;
+ new->extra = 0;
return new;
}