Mercurial > MadButterfly
diff include/mb_types.h @ 283:7d106e4ef66d
Fix the compilation error of the inkscape
author | wycc@wycc-desktop |
---|---|
date | Sat, 31 Jan 2009 13:01:07 +0800 |
parents | 29acbd8a0dd0 |
children | 2469f8d23658 |
line wrap: on
line diff
--- a/include/mb_types.h Sat Jan 31 12:54:13 2009 +0800 +++ b/include/mb_types.h Sat Jan 31 13:01:07 2009 +0800 @@ -40,7 +40,8 @@ MBO_SHAPES=0x1000, /*! \note Don't touch this. */ MBO_PATH, MBO_TEXT, - MBO_RECT + MBO_RECT, + MBO_IMAGE }; #define MBO_CLASS_MASK 0xf000 #define MBO_CLASS(x) (((mb_obj_t *)(x))->obj_type & MBO_CLASS_MASK) @@ -63,6 +64,9 @@ * Paints should be freed by users by calling rdman_paint_free() of * the paint. * + * To define a foo paint, it should define a rdman_paint_foo_new() + * function. It return a paint object. + * * \todo move member functions to a seperate structure and setup a * singleton for each paint type. */ @@ -108,6 +112,10 @@ extern int areas_are_overlay(area_t *r1, area_t *r2); extern void area_init(area_t *area, int n_pos, co_aix pos[][2]); +#define _in_range(a, s, w) ((a) >= (s) && (a) < ((s) + (w))) +#define area_pos_is_in(area, _x, _y) \ + (_in_range(_x, (area)->x, (area)->w) && \ + _in_range(_y, (area)->y, (area)->h)) extern void geo_init(geo_t *g); extern void geo_from_positions(geo_t *g, int n_pos, co_aix pos[][2]); extern void geo_mark_overlay(geo_t *g, int n_others, geo_t **others, @@ -115,10 +123,7 @@ #define geo_get_shape(g) ((g)->shape) #define geo_get_shape_safe(g) ((g)? (g)->shape: NULL) #define geo_set_shape(g, sh) do {(g)->shape = sh;} while(0) -#define _geo_is_in(a, s, w) ((a) >= (s) && (a) < ((s) + (w))) -#define geo_pos_is_in(g, _x, _y) \ - (_geo_is_in(_x, (g)->cur_area->x, (g)->cur_area->w) && \ - _geo_is_in(_y, (g)->cur_area->y, (g)->cur_area->h)) +#define geo_pos_is_in(g, _x, _y) area_pos_is_in((g)->cur_area, _x, _y) #define geo_get_area(g) ((g)->cur_area) #define geo_get_flags(g, mask) ((g)->flags & (mask)) #define geo_set_flags(g, mask) do {(g)->flags |= mask;} while(0) @@ -196,6 +201,7 @@ } while(0) #define coord_show(co) do { co->flags &= ~COF_HIDDEN; } while(0) #define coord_get_mouse_event(coord) ((coord)->mouse_event) +#define coord_get_aggr_matrix(coord) ((coord)->aggr_matrix) #define FOR_COORDS_POSTORDER(coord, cur) \ for((cur) = postorder_coord_subtree((coord), NULL); \ (cur) != NULL; \ @@ -269,6 +275,9 @@ #define sh_clear_flags(sh, mask) geo_clear_flags(sh_get_geo(sh), mask) #define sh_pos_is_in(sh, x, y) geo_pos_is_in(sh_get_geo(sh), x, y) #define sh_get_area(sh) geo_get_area(sh_get_geo(sh)) +#define sh_get_coord(sh) ((sh)->coord) +#define sh_get_fill(sh) ((sh)->fill) +#define sh_get_stroke(sh) ((sh)->stroke) /*! \brief A sprite is a set of graphics that being an object in animation.