Mercurial > MadButterfly
annotate src/shapes.h @ 96:ca94493b75bb
-
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sat, 30 Aug 2008 00:32:05 +0800 |
parents | 7dfa4e60b26d |
children | d6f9af55b0d0 |
rev | line source |
---|---|
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
1 #ifndef __SHAPES_H_ |
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
2 #define __SHAPES_H_ |
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
3 |
12 | 4 #include <cairo.h> |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
5 #include "mb_types.h" |
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
6 |
27 | 7 /* Define a shape |
8 * | |
9 * A shape must include | |
10 * - *_new() and *_free() | |
35
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
11 * - clear memory for shape_t member. |
27 | 12 * - *_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
|
13 * - *_draw() |
27 | 14 * - struct of shape must include an shape_t as type of first member. |
35
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
15 * |
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
16 * Must modify |
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
17 * - event.c:draw_shape_path |
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
18 * - redraw_man.c:clean_shape |
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
19 * - redraw_man.c:draw_shape |
95 | 20 * |
21 * \todo Add arc for path shape. | |
22 * \todo Add ellipse shape. | |
23 * \todo Add circle shape. | |
27 | 24 */ |
25 | |
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
|
26 |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
27 extern shape_t *sh_path_new(char *data); |
12 | 28 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
|
29 extern void sh_path_draw(shape_t *shape, cairo_t *cr); |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
30 |
27 | 31 |
32 extern shape_t *sh_text_new(const char *txt, co_aix x, co_aix y, | |
33 co_aix font_size, cairo_font_face_t *face); | |
88
dd813dcc232c
New example, calculator.
Thinker K.F. Li <thinker@branda.to>
parents:
73
diff
changeset
|
34 extern void sh_text_set_text(shape_t *shape, const char *txt); |
27 | 35 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
|
36 extern void sh_text_draw(shape_t *shape, cairo_t *cr); |
27 | 37 |
35
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
38 extern shape_t *sh_rect_new(co_aix x, co_aix y, co_aix w, co_aix h, |
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
39 co_aix rx, co_aix ry); |
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
40 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
|
41 extern void sh_rect_draw(shape_t *shape, cairo_t *cr); |
40 | 42 extern void sh_rect_set(shape_t *shape, co_aix x, co_aix y, |
43 co_aix w, co_aix h, co_aix rx, co_aix ry); | |
27 | 44 |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
45 #endif /* __SHAPES_H_ */ |