Mercurial > MadButterfly
comparison include/mb_shapes.h @ 186:530bb7728546 include_mb_test
Move header files to $(top_srcdir)/include/ and prefixed with 'mb_'.
This is the solution that I dicussed with FourDollars, last night.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 05 Nov 2008 15:24:01 +0800 |
parents | include/mb/shapes.h@c7e5b8779bb5 |
children | bcad1ccdf45c |
comparison
equal
deleted
inserted
replaced
185:c7e5b8779bb5 | 186:530bb7728546 |
---|---|
1 /*! \file | |
2 * \brief Declare interfaces of shapes. | |
3 * | |
4 * \todo Add ellipse shape. | |
5 * \todo Add circle shape. | |
6 */ | |
7 #ifndef __SHAPES_H_ | |
8 #define __SHAPES_H_ | |
9 | |
10 #include <cairo.h> | |
11 #include "mb_types.h" | |
12 #include "mb_redraw_man.h" | |
13 | |
14 /*! \page define_shape How to Define Shapes | |
15 * | |
16 * A shape implementation must include | |
17 * - rdman_shape_*_new() | |
18 * - clear memory for shape_t member. | |
19 * - assign *_free() to \ref shape_t::free. | |
20 * - make new object been managed by a redraw manager. | |
21 * - call rdman_shape_man() | |
22 * - *_free() | |
23 * - assigned to \ref shape_t::free. | |
24 * - *_transform() | |
25 * - *_draw() | |
26 * - first member variable of a shape type must be a shape_t. | |
27 * | |
28 * Must modify | |
29 * - event.c::draw_shape_path() | |
30 * - redraw_man.c::clean_shape() | |
31 * - redraw_man.c::draw_shape() | |
32 */ | |
33 | |
34 /*! \defgroup shapes Shapes | |
35 * @{ | |
36 */ | |
37 | |
38 /*! \defgroup shape_path Shape of Path | |
39 * @{ | |
40 */ | |
41 extern shape_t *rdman_shape_path_new(redraw_man_t *rdman, char *data); | |
42 extern void sh_path_transform(shape_t *shape); | |
43 extern void sh_path_draw(shape_t *shape, cairo_t *cr); | |
44 /* @} */ | |
45 | |
46 /*! \defgroup shape_text Shape of Text | |
47 * @{ | |
48 */ | |
49 extern shape_t *rdman_shape_text_new(redraw_man_t *rdman, | |
50 const char *txt, co_aix x, co_aix y, | |
51 co_aix font_size, | |
52 cairo_font_face_t *face); | |
53 extern void sh_text_set_text(shape_t *shape, const char *txt); | |
54 extern void sh_text_transform(shape_t *shape); | |
55 extern void sh_text_draw(shape_t *shape, cairo_t *cr); | |
56 /* @} */ | |
57 | |
58 /*! \defgroup shape_rect Shape of Rectangle | |
59 * @{ | |
60 */ | |
61 extern shape_t *rdman_shape_rect_new(redraw_man_t *rdman, | |
62 co_aix x, co_aix y, | |
63 co_aix w, co_aix h, | |
64 co_aix rx, co_aix ry); | |
65 extern void sh_rect_transform(shape_t *shape); | |
66 extern void sh_rect_draw(shape_t *shape, cairo_t *cr); | |
67 extern void sh_rect_set(shape_t *shape, co_aix x, co_aix y, | |
68 co_aix w, co_aix h, co_aix rx, co_aix ry); | |
69 /* @} */ | |
70 /* @} */ | |
71 | |
72 #endif /* __SHAPES_H_ */ |