comparison src/redraw_man.c @ 356:3e84458968ec

Move mb_img_data_t out from argument list of rdman_shape_image_new(). - Application should specify content of sh_image_t by fill the shape with a paint_image_t.
author Thinker K.F. Li <thinker@branda.to>
date Mon, 09 Mar 2009 23:05:57 +0800
parents 85b8bb36fe71
children 44b8223f307c
comparison
equal deleted inserted replaced
355:958b67d911db 356:3e84458968ec
2269 return parent; 2269 return parent;
2270 } 2270 }
2271 2271
2272 /* @} */ 2272 /* @} */
2273 2273
2274 /*! \brief Load an image as a paint_image_t.
2275 */
2276 paint_t *rdman_img_ldr_load_paint(redraw_man_t *rdman, const char *img_id) {
2277 mb_img_data_t *img_data;
2278 paint_t *paint;
2279 mb_img_ldr_t *ldr = rdman_img_ldr(rdman);
2280
2281 img_data = MB_IMG_LDR_LOAD(ldr, img_id);
2282 if(img_data == NULL)
2283 return NULL;
2284
2285 paint = rdman_paint_image_new(rdman, img_data);
2286 if(paint == NULL)
2287 MB_IMG_DATA_FREE(img_data);
2288
2289 return paint;
2290 }
2291
2274 #ifdef UNITTEST 2292 #ifdef UNITTEST
2275 /* Test cases */ 2293 /* Test cases */
2276 2294
2277 #include <CUnit/Basic.h> 2295 #include <CUnit/Basic.h>
2278 #include "mb_paint.h" 2296 #include "mb_paint.h"