comparison include/mb_redraw_man.h @ 260:29acbd8a0dd0

Integrate sh_image with svg2code.py. diff -r e8a784a306d0 examples/svg2code_ex/dsc_3241.png Binary file examples/svg2code_ex/dsc_3241.png has changed diff -r e8a784a306d0 examples/svg2code_ex/dsc_3241.png Binary file examples/svg2code_ex/dsc_3241.png has changed
author Thinker K.F. Li <thinker@branda.to>
date Fri, 23 Jan 2009 23:00:23 +0800
parents 50d253d0fcba
children b42ee279669e
comparison
equal deleted inserted replaced
259:e8a784a306d0 260:29acbd8a0dd0
3 3
4 #include <cairo.h> 4 #include <cairo.h>
5 #include "mb_tools.h" 5 #include "mb_tools.h"
6 #include "mb_types.h" 6 #include "mb_types.h"
7 #include "mb_observer.h" 7 #include "mb_observer.h"
8 #include "mb_img_ldr.h"
8 9
9 typedef struct _redraw_man redraw_man_t; 10 typedef struct _redraw_man redraw_man_t;
10 11
11 typedef void (*free_func_t)(redraw_man_t *rdman, void *obj); 12 typedef void (*free_func_t)(redraw_man_t *rdman, void *obj);
12 struct _free_obj { 13 struct _free_obj {
77 void *rt; /*!< \brief This is a pointer to the current 78 void *rt; /*!< \brief This is a pointer to the current
78 * graphic backend. 79 * graphic backend.
79 * \see rdman_attach_backend() 80 * \see rdman_attach_backend()
80 */ 81 */
81 mb_prop_store_t props; 82 mb_prop_store_t props;
83 mb_img_ldr_t *img_ldr; /*!< \brief Image Loader.
84 * This is initialized by backend.
85 */
82 }; 86 };
83 87
84 extern int redraw_man_init(redraw_man_t *rdman, cairo_t *cr, 88 extern int redraw_man_init(redraw_man_t *rdman, cairo_t *cr,
85 cairo_t *backend); 89 cairo_t *backend);
86 extern void redraw_man_destroy(redraw_man_t *rdman); 90 extern void redraw_man_destroy(redraw_man_t *rdman);
188 rdman_add_gen_geos(rdman, sh_get_geo(shape)) 192 rdman_add_gen_geos(rdman, sh_get_geo(shape))
189 #define rdman_shape_gl_len(rdman) \ 193 #define rdman_shape_gl_len(rdman) \
190 rdman_get_gen_geos(rdman)->num 194 rdman_get_gen_geos(rdman)->num
191 #define rdman_clear_shape_gl(rdman) \ 195 #define rdman_clear_shape_gl(rdman) \
192 DARRAY_CLEAN(rdman_get_gen_geos(rdman)) 196 DARRAY_CLEAN(rdman_get_gen_geos(rdman))
197 #define rdman_prop_store(rdman) ((rdman)->props)
198 #define rdman_img_ldr(rdman) ((rdman)->img_ldr)
193 199
194 /*! \brief Attach backend to the redraw manager so that we can hide the backend from the users. 200 /*! \brief Attach backend to the redraw manager so that we can hide the backend from the users.
195 * 201 *
196 */ 202 */
197 #define rdman_attach_backend(rdman,backend) (((rdman)->rt)=(backend)) 203 #define rdman_attach_backend(rdman,backend) (((rdman)->rt)=(backend))
198 /*! \brief Load sprite dymanicly from the shared object module. 204 /*! \brief Load sprite dymanicly from the shared object module.
199 * 205 *
200 * The search path can be changed by sprite_set_search_path. The name can have a relative path in the front of it. 206 * The search path can be changed by sprite_set_search_path. The name
201 * This function will search the object in the current working directory and then search the system search path. 207 * can have a relative path in the front of it.
202 * 208 * This function will search the object in the current working directory
209 * and then search the system search path.
203 */ 210 */
204 mb_sprite_t *sprite_load(const char *name, redraw_man_t *rdman, coord_t *root); 211 mb_sprite_t *sprite_load(const char *name, redraw_man_t *rdman, coord_t *root);
205 212
206 /*! \brief Set the search path of dymanic object loading. 213 /*! \brief Set the search path of dymanic object loading.
207 * 214 *