1 #ifndef __gfxdevice_h__
2 #define __gfxdevice_h__
8 #define GFX_SUBPIXEL 2560
10 typedef double gfxcoord_t;
12 typedef enum {gfx_moveTo, gfx_lineTo, gfx_splineTo} gfx_linetype;
13 typedef enum {gfx_joinMiter, gfx_joinRound, gfx_joinBevel} gfx_joinType;
14 typedef enum {gfx_capButt, gfx_capRound, gfx_capSquare} gfx_capType;
16 typedef struct _gfxline
21 struct _gfxline*next; /*NULL=end*/
24 typedef struct _gfxglyph
29 int unicode; // array?
33 typedef struct _gfxfont
42 typedef struct _gfxcolor
50 typedef struct _gfxmatrix
56 typedef struct _gfximage
63 typedef enum {gfxgradient_radial, gfxgradient_linear} gfxgradienttype_t;
65 typedef struct _gfxgradient
68 float pos; // 0.0 - 1.0
69 struct _gfxgradient*next; //NULL=end
72 typedef struct _gfxcxform
74 float rr,rg,rb,ra, tr;
75 float gr,gg,gb,ga, tg;
76 float br,bg,bb,ba, tb;
77 float ar,ag,ab,aa, ta;
81 typedef struct _gfxbbox
83 gfxcoord_t xmin, ymin, xmax, ymax;
86 typedef struct _gfxdevice
88 int (*setparameter)(struct _gfxdevice*dev, const char*key, const char*value);
90 void (*startpage)(struct _gfxdevice*dev, int xmin, int ymin, int xmax, int ymax); /*xmin/ymin?*/
92 void (*startclip)(struct _gfxdevice*dev, gfxline_t*line);
93 void (*endclip)(struct _gfxdevice*dev);
94 void (*stroke)(struct _gfxdevice*dev, gfxline_t*line, gfxcoord_t width, gfxcolor_t*color, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit);
95 void (*fill)(struct _gfxdevice*dev, gfxline_t*line, gfxcolor_t*color);
96 void (*fillbitmap)(struct _gfxdevice*dev, gfxline_t*line, gfximage_t*img, gfxmatrix_t*matrix, gfxcxform_t*cxform); //cxform? tiling?
97 void (*fillgradient)(struct _gfxdevice*dev, gfxline_t*line, gfxgradient_t*gradient, gfxgradienttype_t type, gfxmatrix_t*matrix); //?
99 void (*addfont)(struct _gfxdevice*dev, char*fontid, gfxfont_t*font, gfxmatrix_t*matrix);
100 void (*drawchar)(struct _gfxdevice*dev, char*fontid, int glyph, int x, int y);
102 void (*drawlink)(struct _gfxdevice*dev, int x1, int y1, int x2, int y2, char*action);
104 void (*endpage)(struct _gfxdevice*dev); //?
106 void* (*finish)(struct _gfxdevice*dev);
115 #endif //__gfxdevice_h__