Mercurial > MadButterfly
changeset 1059:36aef79d68e4
Move macros privated used by redraw manager to redraw_man.c
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Sun, 28 Nov 2010 12:07:37 +0800 |
parents | 3a03b0953e22 |
children | e415c55b4a0d |
files | include/mb_redraw_man.h include/mb_types.h src/redraw_man.c |
diffstat | 3 files changed, 37 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/include/mb_redraw_man.h Wed Nov 24 16:17:17 2010 +0800 +++ b/include/mb_redraw_man.h Sun Nov 28 12:07:37 2010 +0800 @@ -231,6 +231,11 @@ rdman_get_gen_geos(rdman)->num #define rdman_clear_shape_gl(rdman) \ DARRAY_CLEAN(rdman_get_gen_geos(rdman)) +#define _coord_get_canvas(coord) ((coord)->canvas_info->canvas) +#define _coord_set_canvas(coord, _canvas) \ + do { \ + (coord)->canvas_info->canvas = _canvas; \ + } while(0) #define rdman_prop_store(rdman) ((rdman)->props) #define rdman_img_ldr(rdman) ((rdman)->img_ldr) #define rdman_set_img_ldr(rdman, ldr) \
--- a/include/mb_types.h Wed Nov 24 16:17:17 2010 +0800 +++ b/include/mb_types.h Sun Nov 28 12:07:37 2010 +0800 @@ -309,21 +309,6 @@ (co)->flags &= ~COF_CACHE_MASK; \ } while(0) #define coord_is_root(co) ((co)->parent == NULL) -#define coord_is_cached(co) ((co)->flags & COF_OWN_CANVAS) -#define coord_is_always_cached(co) ((co)->flags & COF_ALWAYS_CACHE) -#define coord_is_fast_cached(co) ((co)->flags & COF_FAST_MASK) -#define coord_is_precise_cached(co) ((co)->flags & COF_PRECISE_MASK) -#define coord_is_zeroing(co) ((co)->flags & COF_MUST_ZEROING) -#define coord_set_zeroing(co) \ - do { (co)->flags |= COF_MUST_ZEROING; } while(0) -#define coord_clear_zeroing(co) \ - do { (co)->flags &= ~COF_MUST_ZEROING; } while(0) -#define coord_set_flags(co, _flags) \ - do { (co)->flags |= (_flags); } while(0) -#define coord_get_parent(co) ((co)->parent) -#define coord_get_flags(co, _flags) ((co)->flags & (_flags)) -#define coord_clear_flags(co, _flags) \ - do { (co)->flags &= ~(_flags); } while(0) #define coord_get_mouse_event(coord) ((coord)->mouse_event) #define coord_get_opacity(coord) ((coord)->opacity) #define coord_set_opacity(coord, v) do { (coord)->opacity = v; } while(0) @@ -361,22 +346,6 @@ sh_get_geo(shape)))) #define coord_get_area(coord) ((coord)->cur_area) #define coord_get_last_area(coord) ((coord)->last_area) -#define coord_get_pcache_area(coord) ((coord)->canvas_info->pcache_cur_area) -#define coord_get_pcache_last_area(coord) \ - ((coord)->canvas_info->pcache_last_area) -#define coord_get_cached(coord) ((coord)->canvas_info->owner) -#define _coord_get_canvas(coord) ((coord)->canvas_info->canvas) -#define _coord_set_canvas(coord, _canvas) \ - do { \ - (coord)->canvas_info->canvas = _canvas; \ - } while(0) -#define _coord_get_dirty_areas(coord) (&(coord)->canvas_info->dirty_areas) -#define _coord_get_aggr_dirty_areas(coord) \ - ((coord)->canvas_info->aggr_dirty_areas) -#define coord_get_2pdev(coord) ((coord)->canvas_info->cache_2_pdev) -#define coord_get_2pdev_rev(coord) ((coord)->canvas_info->cache_2_pdev_rev) -#define coord_get_aggr2pdev(coord) ((coord)->canvas_info->aggr_2_pdev) -#define coord_get_aggr2pdev_rev(coord) ((coord)->canvas_info->aggr_2_pdev_rev) /* @} */
--- a/src/redraw_man.c Wed Nov 24 16:17:17 2010 +0800 +++ b/src/redraw_man.c Sun Nov 28 12:07:37 2010 +0800 @@ -304,6 +304,38 @@ #define ASSERT(x) #endif +/* + * Conitions for coords. + */ +#define coord_is_cached(co) ((co)->flags & COF_OWN_CANVAS) +#define coord_is_always_cached(co) ((co)->flags & COF_ALWAYS_CACHE) +#define coord_is_fast_cached(co) ((co)->flags & COF_FAST_MASK) +#define coord_is_precise_cached(co) ((co)->flags & COF_PRECISE_MASK) +#define coord_is_zeroing(co) ((co)->flags & COF_MUST_ZEROING) +#define coord_set_zeroing(co) \ + do { (co)->flags |= COF_MUST_ZEROING; } while(0) +#define coord_clear_zeroing(co) \ + do { (co)->flags &= ~COF_MUST_ZEROING; } while(0) +#define coord_set_flags(co, _flags) \ + do { (co)->flags |= (_flags); } while(0) +#define coord_get_parent(co) ((co)->parent) +#define coord_get_flags(co, _flags) ((co)->flags & (_flags)) +#define coord_clear_flags(co, _flags) \ + do { (co)->flags &= ~(_flags); } while(0) + +#define coord_get_pcache_area(coord) ((coord)->canvas_info->pcache_cur_area) +#define coord_get_pcache_last_area(coord) \ + ((coord)->canvas_info->pcache_last_area) +#define coord_get_cached(coord) ((coord)->canvas_info->owner) +#define _coord_get_dirty_areas(coord) (&(coord)->canvas_info->dirty_areas) +#define _coord_get_aggr_dirty_areas(coord) \ + ((coord)->canvas_info->aggr_dirty_areas) +#define coord_get_2pdev(coord) ((coord)->canvas_info->cache_2_pdev) +#define coord_get_2pdev_rev(coord) ((coord)->canvas_info->cache_2_pdev_rev) +#define coord_get_aggr2pdev(coord) ((coord)->canvas_info->aggr_2_pdev) +#define coord_get_aggr2pdev_rev(coord) ((coord)->canvas_info->aggr_2_pdev_rev) + + /* NOTE: bounding box should also consider width of stroke. */