Mercurial > MadButterfly
comparison src/mb_types.h @ 18:0f3baa488a62
Support solid color paint for fill.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sat, 02 Aug 2008 14:45:42 +0800 |
parents | 41f0907b27ac |
children | d50f33040de6 |
comparison
equal
deleted
inserted
replaced
17:41f0907b27ac | 18:0f3baa488a62 |
---|---|
1 #ifndef __MB_TYPES_H_ | 1 #ifndef __MB_TYPES_H_ |
2 #define __MB_TYPES_H_ | 2 #define __MB_TYPES_H_ |
3 | 3 |
4 #include <cairo.h> | |
4 #include "tools.h" | 5 #include "tools.h" |
5 | 6 |
6 typedef float co_aix; | 7 typedef float co_aix; |
7 typedef struct _shape shape_t; | 8 typedef struct _shape shape_t; |
8 typedef struct _geo geo_t; | 9 typedef struct _geo geo_t; |
9 typedef struct _area area_t; | 10 typedef struct _area area_t; |
11 typedef struct _shnode shnode_t; | |
12 typedef struct _paint paint_t; | |
13 | |
14 struct _paint { | |
15 void (*prepare)(paint_t *paint, cairo_t *cr); | |
16 void (*free)(paint_t *paint); | |
17 STAILQ(shnode_t) members; | |
18 }; | |
19 | |
20 struct _shnode { | |
21 shape_t *shape; | |
22 shnode_t *next; | |
23 }; | |
10 | 24 |
11 struct _area { | 25 struct _area { |
12 co_aix x, y; | 26 co_aix x, y; |
13 co_aix w, h; | 27 co_aix w, h; |
14 }; | 28 }; |
94 struct _shape { | 108 struct _shape { |
95 int sh_type; | 109 int sh_type; |
96 geo_t *geo; | 110 geo_t *geo; |
97 coord_t *coord; | 111 coord_t *coord; |
98 shape_t *coord_mem_next; | 112 shape_t *coord_mem_next; |
113 paint_t *fill, *stroke; | |
99 }; | 114 }; |
100 enum { SHT_UNKNOW, SHT_PATH, SHT_TEXT }; | 115 enum { SHT_UNKNOW, SHT_PATH, SHT_TEXT }; |
101 | 116 |
102 #define sh_attach_geo(sh, g) \ | 117 #define sh_attach_geo(sh, g) \ |
103 do { \ | 118 do { \ |