Mercurial > MadButterfly
annotate src/shapes.h @ 169:7ca25f18902f
Autotoolize MadButterfly.
author | sylee@eeepc |
---|---|
date | Fri, 31 Oct 2008 00:12:17 +0800 |
parents | 565b55508c8d |
children | b90abd31a281 |
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" |
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
12 |
101 | 13 /*! \page define_shape How to Define Shapes |
27 | 14 * |
15 * A shape must include | |
16 * - *_new() and *_free() | |
35
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
17 * - clear memory for shape_t member. |
27 | 18 * - *_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
|
19 * - *_draw() |
108 | 20 * - 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
|
21 * |
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
22 * Must modify |
101 | 23 * - event.c::draw_shape_path() |
24 * - redraw_man.c::clean_shape() | |
25 * - redraw_man.c::draw_shape() | |
27 | 26 */ |
27 | |
101 | 28 /*! \defgroup shapes Shapes |
29 * @{ | |
30 */ | |
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
|
31 |
101 | 32 /*! \defgroup shape_path Shape of Path |
33 * @{ | |
34 */ | |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
35 extern shape_t *sh_path_new(char *data); |
12 | 36 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
|
37 extern void sh_path_draw(shape_t *shape, cairo_t *cr); |
101 | 38 /* @} */ |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
39 |
101 | 40 /*! \defgroup shape_text Shape of Text |
41 * @{ | |
42 */ | |
27 | 43 extern shape_t *sh_text_new(const char *txt, co_aix x, co_aix y, |
44 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
|
45 extern void sh_text_set_text(shape_t *shape, const char *txt); |
27 | 46 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
|
47 extern void sh_text_draw(shape_t *shape, cairo_t *cr); |
101 | 48 /* @} */ |
27 | 49 |
101 | 50 /*! \defgroup shape_rect Shape of Rectangle |
51 * @{ | |
52 */ | |
35
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
53 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
|
54 co_aix rx, co_aix ry); |
581a03196093
Support rectangle tag of SVG.
Thinker K.F. Li <thinker@branda.to>
parents:
33
diff
changeset
|
55 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
|
56 extern void sh_rect_draw(shape_t *shape, cairo_t *cr); |
40 | 57 extern void sh_rect_set(shape_t *shape, co_aix x, co_aix y, |
58 co_aix w, co_aix h, co_aix rx, co_aix ry); | |
101 | 59 /* @} */ |
60 /* @} */ | |
27 | 61 |
5
9c331ec9e210
SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff
changeset
|
62 #endif /* __SHAPES_H_ */ |