Mercurial > MadButterfly
comparison include/mb_shapes.h @ 257:50d253d0fcba
Simple image loader and image shape.
- img_ldr.c is a simple image loader that rooted on a directory
specified when a loader instance been created.
- sh_image_t is corresponding shape of image tag in SVG.
- This changeset is still buggy. It need more testing.
- svg2code.py is not ready for image tag.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Thu, 15 Jan 2009 16:46:47 +0800 |
parents | bcad1ccdf45c |
children | 29acbd8a0dd0 |
comparison
equal
deleted
inserted
replaced
256:cac9ad3df633 | 257:50d253d0fcba |
---|---|
8 #define __SHAPES_H_ | 8 #define __SHAPES_H_ |
9 | 9 |
10 #include <cairo.h> | 10 #include <cairo.h> |
11 #include "mb_types.h" | 11 #include "mb_types.h" |
12 #include "mb_redraw_man.h" | 12 #include "mb_redraw_man.h" |
13 #include "mb_img_ldr.h" | |
13 | 14 |
14 /*! \page define_shape How to Define Shapes | 15 /*! \page define_shape How to Define Shapes |
15 * | 16 * |
16 * A shape implementation must include | 17 * A shape implementation must include |
17 * - rdman_shape_*_new() | 18 * - rdman_shape_*_new() |
27 * | 28 * |
28 * Must modify | 29 * Must modify |
29 * - event.c::draw_shape_path() | 30 * - event.c::draw_shape_path() |
30 * - redraw_man.c::clean_shape() | 31 * - redraw_man.c::clean_shape() |
31 * - redraw_man.c::draw_shape() | 32 * - redraw_man.c::draw_shape() |
33 * | |
34 * \section shape_transform Shape Transform | |
35 * | |
36 * All shape types must have a shape transform function. It is invoked by | |
37 * redraw_man.c::clean_shape(). It's task is to update \ref geo_t of the | |
38 * shape object. In most situtation, it call geo_from_positions() to | |
39 * update geo_t. | |
40 * | |
32 */ | 41 */ |
33 | 42 |
34 /*! \defgroup shapes Shapes | 43 /*! \defgroup shapes Shapes |
35 * @{ | 44 * @{ |
36 */ | 45 */ |
66 extern void sh_rect_transform(shape_t *shape); | 75 extern void sh_rect_transform(shape_t *shape); |
67 extern void sh_rect_draw(shape_t *shape, cairo_t *cr); | 76 extern void sh_rect_draw(shape_t *shape, cairo_t *cr); |
68 extern void sh_rect_set(shape_t *shape, co_aix x, co_aix y, | 77 extern void sh_rect_set(shape_t *shape, co_aix x, co_aix y, |
69 co_aix w, co_aix h, co_aix rx, co_aix ry); | 78 co_aix w, co_aix h, co_aix rx, co_aix ry); |
70 /* @} */ | 79 /* @} */ |
80 | |
81 /*! \defgroup shape_image Shape of Image | |
82 * @{ | |
83 */ | |
84 extern shape_t *rdman_shape_image_new(redraw_man_t *rdman, | |
85 mb_img_data_t *img_data, | |
86 co_aix x, co_aix y, | |
87 co_aix w, co_aix h); | |
88 extern void sh_image_transform(shape_t *shape); | |
89 extern void sh_image_draw(shape_t *shape, cairo_t *cr); | |
90 extern void sh_image_set(shape_t *shape, co_aix x, co_aix y, | |
91 co_aix w, co_aix h); | |
92 /* @} */ | |
71 /* @} */ | 93 /* @} */ |
72 | 94 |
73 #endif /* __SHAPES_H_ */ | 95 #endif /* __SHAPES_H_ */ |