Mercurial > MadButterfly
annotate include/mb_shapes.h @ 287:5c066380a84e
* Fix tspan inside tspan parsing issue
* Fix the compilation issue for the dynamic. However, we need to find why the rules for so does not work.
author | wycc |
---|---|
date | Sat, 31 Jan 2009 17:24:00 +0800 |
parents | c8b6ca46950b |
children | 137a73822d48 |
rev | line source |
---|---|
101 | 1 /*! \file |
2 * \brief Declare interfaces of shapes. | |
3 * | |
4 * \todo Add ellipse shape. | |
5 * \todo Add circle shape. | |
6 */ | |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
7 #ifndef __SHAPES_H_ |
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
8 #define __SHAPES_H_ |
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
9 |
12 | 10 #include <cairo.h> |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
11 #include "mb_types.h" |
186
530bb7728546
Move header files to $(top_srcdir)/include/ and prefixed with 'mb_'.
Thinker K.F. Li <thinker@branda.to>
parents:
185
diff
changeset
|
12 #include "mb_redraw_man.h" |
257
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
13 #include "mb_img_ldr.h" |
278
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
14 #include <pango/pangocairo.h> |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
15 |
101 | 16 /*! \page define_shape How to Define Shapes |
27 | 17 * |
159
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
18 * A shape implementation must include |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
19 * - rdman_shape_*_new() |
35
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
20 * - clear memory for shape_t member. |
159
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
21 * - assign *_free() to \ref shape_t::free. |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
22 * - make new object been managed by a redraw manager. |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
23 * - call rdman_shape_man() |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
24 * - *_free() |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
25 * - assigned to \ref shape_t::free. |
27 | 26 * - *_transform() |
30
e06a4a667ce2
Accept mouse/pointer event and hint the shape that the pointer is over.
Thinker K.F. Li <thinker@branda.to>
parents:
27
diff
changeset
|
27 * - *_draw() |
260
29acbd8a0dd0
Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents:
257
diff
changeset
|
28 * - *_draw() is responsive to define shape. How the shape is filled |
29acbd8a0dd0
Integrate sh_image with svg2code.py.
Thinker K.F. Li <thinker@branda.to>
parents:
257
diff
changeset
|
29 * or stroked is defined by paint. |
108 | 30 * - first member variable of a shape type must be a shape_t. |
35
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
31 * |
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
32 * Must modify |
101 | 33 * - event.c::draw_shape_path() |
34 * - redraw_man.c::clean_shape() | |
35 * - redraw_man.c::draw_shape() | |
257
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
36 * |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
37 * \section shape_transform Shape Transform |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
38 * |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
39 * All shape types must have a shape transform function. It is invoked by |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
40 * redraw_man.c::clean_shape(). It's task is to update \ref geo_t of the |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
41 * shape object. In most situtation, it call geo_from_positions() to |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
42 * update geo_t. |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
43 * |
27 | 44 */ |
45 | |
101 | 46 /*! \defgroup shapes Shapes |
47 * @{ | |
48 */ | |
30
e06a4a667ce2
Accept mouse/pointer event and hint the shape that the pointer is over.
Thinker K.F. Li <thinker@branda.to>
parents:
27
diff
changeset
|
49 |
101 | 50 /*! \defgroup shape_path Shape of Path |
51 * @{ | |
52 */ | |
159
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
53 extern shape_t *rdman_shape_path_new(redraw_man_t *rdman, char *data); |
197
bcad1ccdf45c
Translate the path string into binary array to save the parsing in the runtime. It can reduce the size as well.
wycc@wycc-desktop
parents:
186
diff
changeset
|
54 extern shape_t *rdman_shape_path_new_from_binary(redraw_man_t *rdman, char *commands, co_aix *arg,int arg_cnt,int *fix_arg,int fix_arg_cnt); |
12 | 55 extern void sh_path_transform(shape_t *shape); |
30
e06a4a667ce2
Accept mouse/pointer event and hint the shape that the pointer is over.
Thinker K.F. Li <thinker@branda.to>
parents:
27
diff
changeset
|
56 extern void sh_path_draw(shape_t *shape, cairo_t *cr); |
101 | 57 /* @} */ |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
58 |
101 | 59 /*! \defgroup shape_text Shape of Text |
60 * @{ | |
61 */ | |
159
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
62 extern shape_t *rdman_shape_text_new(redraw_man_t *rdman, |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
63 const char *txt, co_aix x, co_aix y, |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
64 co_aix font_size, |
278
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
65 cairo_font_face_t *face,PangoAttrList *attrs); |
88
dd813dcc232c
New example, calculator.
Thinker K.F. Li <thinker@branda.to>
parents:
73
diff
changeset
|
66 extern void sh_text_set_text(shape_t *shape, const char *txt); |
27 | 67 extern void sh_text_transform(shape_t *shape); |
30
e06a4a667ce2
Accept mouse/pointer event and hint the shape that the pointer is over.
Thinker K.F. Li <thinker@branda.to>
parents:
27
diff
changeset
|
68 extern void sh_text_draw(shape_t *shape, cairo_t *cr); |
101 | 69 /* @} */ |
27 | 70 |
278
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
71 /*! \defgroup mb_text_t Shape of Text |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
72 * @{ |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
73 */ |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
74 #define TEXTSTYLE_BOLD 1 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
75 #define TEXTSTYLE_ITALIC 2 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
76 #define TEXTSTYLE_UNDERLINE 4 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
77 #define TEXTSTYLE_COLOR 8 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
78 #define TEXTSTYLE_FONT 0x10 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
79 #define TEXTSTYLE_ALIGN 0x20 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
80 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
81 typedef struct { |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
82 int property; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
83 unsigned int color; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
84 unsigned int align; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
85 char *font; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
86 } mb_textstyle_t; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
87 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
88 typedef struct _textsegment { |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
89 int x; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
90 int y; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
91 mb_textstyle_t style; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
92 int size; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
93 char *buf; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
94 struct _textsegment *next; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
95 } mb_text_segment_t; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
96 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
97 #define MBTEXT_DIRTY 1 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
98 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
99 typedef struct { |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
100 int nseg; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
101 mb_text_segment_t *segs; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
102 int flag; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
103 cairo_surface_t *surface; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
104 } mb_text_t; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
105 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
106 extern void mb_textstyle_init(mb_textstyle_t *style); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
107 extern void mb_textstyle_set_font(mb_textstyle_t *style, char *font); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
108 static inline char *mb_textstyle_get_font(mb_textstyle_t *style) |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
109 { |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
110 if (style->property & TEXTSTYLE_FONT) |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
111 return style->font; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
112 else |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
113 return NULL; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
114 } |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
115 extern void mb_textstyle_set_bold(mb_textstyle_t *style, int bold); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
116 static inline int mb_textstyle_get_bold(mb_textstyle_t *style) |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
117 { |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
118 return style->property & TEXTSTYLE_BOLD; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
119 } |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
120 extern void mb_textstyle_set_italic(mb_textstyle_t *style, int italic); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
121 static inline int mb_textstyle_get_italic(mb_textstyle_t *style) |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
122 { |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
123 return style->property & TEXTSTYLE_ITALIC; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
124 } |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
125 extern void mb_textstyle_set_underline(mb_textstyle_t *style, int underline); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
126 static inline int mb_textstyle_get_undeline(mb_textstyle_t *style) |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
127 { |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
128 return style->property & TEXTSTYLE_UNDERLINE; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
129 } |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
130 extern void mb_textstyle_set_color(mb_textstyle_t *style, unsigned int color); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
131 static inline unsigned int mb_textstyle_get_color(mb_textstyle_t *style) |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
132 { |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
133 if (style->property & TEXTSTYLE_COLOR) |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
134 return style->color; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
135 else |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
136 return 0; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
137 } |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
138 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
139 static inline int mb_textstyle_has_color(mb_textstyle_t *style) |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
140 { |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
141 return style->property & TEXTSTYLE_COLOR; |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
142 } |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
143 extern void mb_textstyle_set_alignment(mb_textstyle_t *style, int alignment); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
144 extern int mb_textstyle_get_alignment(mb_textstyle_t *style); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
145 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
146 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
147 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
148 extern void mb_text_set_style(mb_text_t *text, int begin,int end,mb_textstyle_t *style); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
149 extern void mb_text_get_style(mb_text_t *text, int n,mb_textstyle_t *style); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
150 extern void mb_text_set_text(mb_text_t *text, char *string,int begin,int end); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
151 extern void mb_text_get_text(mb_text_t *text, int begin,int end, char *string); |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
152 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
153 |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
154 /* @} */ |
a90fd749af82
Implement the whole tspan attribute. Currently, we can accept font family/font style/font weight and font size.
wycc
parents:
197
diff
changeset
|
155 |
101 | 156 /*! \defgroup shape_rect Shape of Rectangle |
157 * @{ | |
158 */ | |
159
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
159 extern shape_t *rdman_shape_rect_new(redraw_man_t *rdman, |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
160 co_aix x, co_aix y, |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
161 co_aix w, co_aix h, |
b90abd31a281
Postponse free of coords, shapes, and paints when the rdman is dirty.
Thinker K.F. Li <thinker@branda.to>
parents:
108
diff
changeset
|
162 co_aix rx, co_aix ry); |
35
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
163 extern void sh_rect_transform(shape_t *shape); |
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
164 extern void sh_rect_draw(shape_t *shape, cairo_t *cr); |
40 | 165 extern void sh_rect_set(shape_t *shape, co_aix x, co_aix y, |
166 co_aix w, co_aix h, co_aix rx, co_aix ry); | |
101 | 167 /* @} */ |
257
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
168 |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
169 /*! \defgroup shape_image Shape of Image |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
170 * @{ |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
171 */ |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
172 extern shape_t *rdman_shape_image_new(redraw_man_t *rdman, |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
173 mb_img_data_t *img_data, |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
174 co_aix x, co_aix y, |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
175 co_aix w, co_aix h); |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
176 extern void sh_image_transform(shape_t *shape); |
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
177 extern void sh_image_draw(shape_t *shape, cairo_t *cr); |
265
b42ee279669e
Change function name and add comments.
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
178 extern void sh_image_set_geometry(shape_t *shape, co_aix x, co_aix y, |
b42ee279669e
Change function name and add comments.
Thinker K.F. Li <thinker@branda.to>
parents:
260
diff
changeset
|
179 co_aix w, co_aix h); |
257
50d253d0fcba
Simple image loader and image shape.
Thinker K.F. Li <thinker@branda.to>
parents:
197
diff
changeset
|
180 /* @} */ |
101 | 181 /* @} */ |
27 | 182 |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
183 #endif /* __SHAPES_H_ */ |