comparison src/shape_image.c @ 1370:bae104d8d247

Add clone functions for shape types
author Thinker K.F. Li <thinker@codemud.net>
date Sat, 05 Mar 2011 22:00:16 +0800
parents a8d20bc8ce40
children 7bd6c0e88ec8
comparison
equal deleted inserted replaced
1369:9ad74b29e011 1370:bae104d8d247
90 rdman_man_shape(rdman, (shape_t *)img); 90 rdman_man_shape(rdman, (shape_t *)img);
91 91
92 return (shape_t *)img; 92 return (shape_t *)img;
93 } 93 }
94 94
95 shape_t *
96 rdman_shape_image_clone(redraw_man_t *rdman, const shape_t *_src_img) {
97 const sh_image_t *src_img = (const sh_image_t *)_src_img;
98 sh_image_t *new_img;
99
100 new_img = (sh_image_t *)rdman_shape_image_new(rdman,
101 src_img->x, src_img->y,
102 src_img->w, src_img->h);
103 if(new_img == NULL)
104 return NULL;
105
106 sh_copy_style(rdman, (shape_t *)src_img, (shape_t *)new_img);
107
108 return (shape_t *)new_img;
109 }
110
95 void sh_image_free(shape_t *shape) { 111 void sh_image_free(shape_t *shape) {
96 sh_image_t *img = (sh_image_t *)shape; 112 sh_image_t *img = (sh_image_t *)shape;
97 113
98 mb_obj_destroy(shape); 114 mb_obj_destroy(shape);
99 free(img); 115 free(img);