1 #define GFX_SUBPIXEL 2560
3 typedef float gfxcoord_t;
5 typedef enum {gfx_moveTo, gfx_lineTo, gfx_splineTo} gfx_linetype;
7 typedef struct _gfxline
12 struct _gfxline*next; /*NULL=end*/
15 typedef struct _gfxglyph
20 int unicode; // array?
24 typedef struct _gfxfont
33 typedef struct _gfxcolor
41 typedef struct _gfxmatrix
47 typedef struct _gfximage
54 typedef enum {gfxgradient_radial, gfxgradient_linear} gfxgradienttype_t;
56 typedef struct _gfxgradient
59 float pos; // 0.0 - 1.0
60 struct _gfxgradient*next; //NULL=end
63 typedef struct _gfxcxform
72 typedef struct _gfxbbox
74 gfxcoord_t xmin, ymin, xmax, ymax;
77 typedef struct _gfxdevice
79 int (*setparameter)(struct _gfxdevice*dev, const char*key, const char*value);
81 int (*startpage)(struct _gfxdevice*dev, int xmin, int ymin, int xmax, int ymax); /*xmin/ymin?*/
83 void (*startClip)(struct _gfxdevice*dev, gfxline_t*line);
84 void (*endClip)(struct _gfxdevice*dev);
85 void (*stroke)(struct _gfxdevice*dev, gfxline_t*line, int width, gfxcolor_t*color, int cap_style, int joint_style);
86 void (*fill)(struct _gfxdevice*dev, gfxline_t*line, gfxcolor_t*color);
87 void (*fillbitmap)(struct _gfxdevice*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform); //cxform? tiling?
88 void (*fillgradient)(struct _gfxdevice*dev, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix); //?
90 void (*addfont)(struct _gfxdevice*dev, char*fontid, gfxfont_t*font, gfxmatrix_t*matrix);
91 void (*drawchar)(struct _gfxdevice*dev, char*fontid, int glyph, int x, int y);
93 void (*drawLink)(struct _gfxdevice*dev, int x1, int y1, int x2, int y2, char*action);
95 int (*endpage)(struct _gfxdevice*dev); //?
97 int (*finish)(struct _gfxdevice*dev);