summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-30 00:11:33 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-30 00:11:33 (GMT)
commitdcf32638d8d05c7cd45ed41128c41e73ec6aa5b4 (patch)
tree3d0a60aaadd213d3eb7c6e3b55d22ad2bbde3b30 /gfx
parentd6abf64c0aab528f732e99e266db2e645cfdde8e (diff)
downloadeeshow-dcf32638d8d05c7cd45ed41128c41e73ec6aa5b4.zip
eeshow-dcf32638d8d05c7cd45ed41128c41e73ec6aa5b4.tar.gz
eeshow-dcf32638d8d05c7cd45ed41128c41e73ec6aa5b4.tar.bz2
gfx/record.c: add section comments
Diffstat (limited to 'gfx')
-rw-r--r--gfx/record.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gfx/record.c b/gfx/record.c
index 4319a8d..7bf09c1 100644
--- a/gfx/record.c
+++ b/gfx/record.c
@@ -65,6 +65,9 @@ struct record_obj {
};
+/* ----- Helper functions -------------------------------------------------- */
+
+
static void bb(struct record *rec, int x, int y)
{
if (rec->xmin > x)
@@ -122,6 +125,9 @@ this_layer:
}
+/* ----- Graphics operations ----------------------------------------------- */
+
+
void record_line(void *ctx, int sx, int sy, int ex, int ey,
int color, unsigned layer)
{
@@ -247,22 +253,37 @@ void record_text(void *ctx, int x, int y, const char *s, unsigned size,
}
+/* ----- Initialization and cleanup ---------------------------------------- */
+
+
void record_init(struct record *rec, const struct gfx_ops *ops, void *user)
{
rec->ops = ops;
rec->user = user;
+ rec->extra = 0;
rec->xmin = rec->ymin = INT_MAX;
rec->xmax = rec->ymax = INT_MIN;
rec->layers = NULL;
}
+/* ----- Reset for a new page ---------------------------------------------- */
+
+
+/*
+ * This is used to signal a new page. The caller kepps a copy of the entire
+ * "struct record". The items on rec->layers are therefore not lost.
+ */
+
void record_wipe(struct record *rec)
{
rec->layers = NULL;
}
+/* ----- Replay ------------------------------------------------------------ */
+
+
void record_replay(const struct record *rec)
{
const struct gfx_ops *ops = rec->ops;
@@ -310,6 +331,9 @@ void record_replay(const struct record *rec)
}
+/* ----- Bounding box ------------------------------------------------------ */
+
+
void record_bbox(const struct record *rec, int *x, int *y, int *w, int *h)
{
if (x)
@@ -323,6 +347,9 @@ void record_bbox(const struct record *rec, int *x, int *y, int *w, int *h)
}
+/* ----- Cleanup ----------------------------------------------------------- */
+
+
static void record_obj_destroy(struct record_obj *obj)
{
switch (obj->type) {