Mercurial > MadButterfly
comparison src/shape_rect.c @ 873:881efcd8a18f abs_n_rel_center
Merge from default branch
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Fri, 24 Sep 2010 16:06:42 +0800 |
parents | 9a7ac4487849 |
children | a8d20bc8ce40 |
comparison
equal
deleted
inserted
replaced
862:3ce9daa9558b | 873:881efcd8a18f |
---|---|
10 shape_t shape; | 10 shape_t shape; |
11 co_aix x, y; | 11 co_aix x, y; |
12 co_aix w, h; | 12 co_aix w, h; |
13 co_aix rx, ry; | 13 co_aix rx, ry; |
14 co_aix poses[12][2]; | 14 co_aix poses[12][2]; |
15 | |
16 redraw_man_t *rdman; /*!< \brief This is used by sh_rect_free() */ | |
15 } sh_rect_t; | 17 } sh_rect_t; |
16 | 18 |
19 int _sh_rect_size = sizeof(sh_rect_t); | |
20 | |
17 static void sh_rect_free(shape_t *shape) { | 21 static void sh_rect_free(shape_t *shape) { |
18 free(shape); | 22 sh_rect_t *rect = (sh_rect_t *)shape; |
23 | |
24 elmpool_elm_free(rect->rdman->sh_rect_pool, rect); | |
19 } | 25 } |
20 | 26 |
21 shape_t *rdman_shape_rect_new(redraw_man_t *rdman, | 27 shape_t *rdman_shape_rect_new(redraw_man_t *rdman, |
22 co_aix x, co_aix y, co_aix w, co_aix h, | 28 co_aix x, co_aix y, co_aix w, co_aix h, |
23 co_aix rx, co_aix ry) { | 29 co_aix rx, co_aix ry) { |
24 sh_rect_t *rect; | 30 sh_rect_t *rect; |
25 | 31 |
26 rect = (sh_rect_t *)malloc(sizeof(sh_rect_t)); | 32 rect = (sh_rect_t *)elmpool_elm_alloc(rdman->sh_rect_pool); |
27 if(rect == NULL) | 33 if(rect == NULL) |
28 return NULL; | 34 return NULL; |
29 | 35 |
30 memset(rect, 0, sizeof(sh_rect_t)); | 36 memset(rect, 0, sizeof(sh_rect_t)); |
31 | 37 |
35 rect->w = w; | 41 rect->w = w; |
36 rect->h = h; | 42 rect->h = h; |
37 rect->rx = rx; | 43 rect->rx = rx; |
38 rect->ry = ry; | 44 rect->ry = ry; |
39 rect->shape.free = sh_rect_free; | 45 rect->shape.free = sh_rect_free; |
46 rect->rdman = rdman; | |
40 | 47 |
41 rdman_shape_man(rdman, (shape_t *)rect); | 48 rdman_shape_man(rdman, (shape_t *)rect); |
42 | 49 |
43 return (shape_t *)rect; | 50 return (shape_t *)rect; |
44 } | 51 } |