Root/eeshow/gfx/record.h

1/*
2 * gfx/record.h - Record graphics operations by layers and replay
3 *
4 * Written 2016 by Werner Almesberger
5 * Copyright 2016 by Werner Almesberger
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13
14#ifndef GFX_RECORD_H
15#define GFX_RECORD_H
16
17#include "gfx/gfx.h"
18
19
20struct record_obj;
21
22struct record_layer {
23    unsigned layer;
24    struct record_obj *objs;
25    struct record_obj **next_obj;
26    struct record_layer *next;
27};
28
29struct record {
30    const struct gfx_ops *ops;
31    void *user;
32    int xmin, xmax;
33    int ymin, ymax;
34    struct record_layer *layers;
35};
36
37
38void record_line(void *ctx, int sx, int sy, int ex, int ey,
39    int color, unsigned layer);
40void record_rect(void *ctx, int sx, int sy, int ex, int ey,
41    int color, int fill_color, unsigned layer);
42void record_poly(void *ctx,
43    int points, const int x[points], const int y[points],
44    int color, int fill_color, unsigned layer);
45void record_circ(void *ctx, int x, int y, int r,
46    int color, int fill_color, unsigned layer);
47void record_arc(void *ctx, int x, int y, int r, int sa, int ea,
48    int color, int fill_color, unsigned layer);
49void record_text(void *ctx, int x, int y, const char *s, unsigned size,
50    enum text_align align, int rot, unsigned color, unsigned layer);
51
52void record_init(struct record *rec, const struct gfx_ops *ops, void *user);
53void record_wipe(struct record *rec);
54void record_replay(const struct record *rec);
55void record_bbox(const struct record *rec, int *x, int *y, int *w, int *h);
56void record_destroy(struct record *rec);
57
58#endif /* !GFX_RECORD_H */
59

Archive Download this file

Branches:
master



interactive