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
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
1 /*! \file
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
2 * \brief Declare interfaces of shapes.
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
3 *
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
4 * \todo Add ellipse shape.
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
5 * \todo Add circle shape.
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
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
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents: 5
diff changeset
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
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
13 /*! \page define_shape How to Define Shapes
27
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
14 *
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
15 * A shape must include
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
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
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
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
565b55508c8d More dox
Thinker K.F. Li <thinker@branda.to>
parents: 101
diff changeset
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
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
23 * - event.c::draw_shape_path()
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
24 * - redraw_man.c::clean_shape()
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
25 * - redraw_man.c::draw_shape()
27
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
26 */
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
27
101
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
28 /*! \defgroup shapes Shapes
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
29 * @{
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
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
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
32 /*! \defgroup shape_path Shape of Path
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
33 * @{
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
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
79e9edf4c00a Add redraw manager
Thinker K.F. Li <thinker@branda.to>
parents: 5
diff changeset
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
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
38 /* @} */
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
39
101
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
40 /*! \defgroup shape_text Shape of Text
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
41 * @{
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
42 */
27
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
43 extern shape_t *sh_text_new(const char *txt, co_aix x, co_aix y,
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
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
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
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
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
48 /* @} */
27
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
49
101
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
50 /*! \defgroup shape_rect Shape of Rectangle
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
51 * @{
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
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
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
57 extern void sh_rect_set(shape_t *shape, co_aix x, co_aix y,
Thinker K.F. Li <thinker@branda.to>
parents: 35
diff changeset
58 co_aix w, co_aix h, co_aix rx, co_aix ry);
101
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
59 /* @} */
d6f9af55b0d0 More documentation.
Thinker K.F. Li <thinker@branda.to>
parents: 95
diff changeset
60 /* @} */
27
19c603dd6ff9 Add text shape.
Thinker K.F. Li <thinker@branda.to>
parents: 22
diff changeset
61
5
9c331ec9e210 SVG path is partially supported
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
62 #endif /* __SHAPES_H_ */