comparison include/mb_types.h @ 303:f894b30676e9

Add MBAF object suport. This is still work in progress yet. However, it won't affect other features. Therefore, it is checked in before it become mature.
author wycc
date Sun, 15 Feb 2009 08:34:57 +0800
parents 2469f8d23658
children 6c350fc92ae3
comparison
equal deleted inserted replaced
302:8b45e7b374b8 303:f894b30676e9
27 * use MBO_TYPE() to return this value. MBO_TYPE() will type-casting the 27 * use MBO_TYPE() to return this value. MBO_TYPE() will type-casting the
28 * object to mb_obj_t and return obj_type. 28 * object to mb_obj_t and return obj_type.
29 * 29 *
30 * mb_obj_t should be initialized with mb_obj_init() and destroied with 30 * mb_obj_t should be initialized with mb_obj_init() and destroied with
31 * mb_obj_destroy(). 31 * mb_obj_destroy().
32 *
33 * We have defined a set of convienent API which will wrap the coord_t or shape_t API accoridng to its type.
34 * Please refer to http://www.assembla.com/wiki/show/dFrSMOtDer3BZUab7jnrAJ/MBAF_Object for the details. This
35 * API is designed for regular programmers which can be used to change some common properties of objects without
36 * checking its type.
32 */ 37 */
33 struct _mb_obj { 38 struct _mb_obj {
34 int obj_type; /*!< \brief Type of a MadButterfly object. */ 39 int obj_type; /*!< \brief Type of a MadButterfly object. */
35 mb_prop_store_t props; /*!< Initialized by rdman. */ 40 mb_prop_store_t props; /*!< Initialized by rdman. */
36 }; 41 };
216 * The x,y,sx,sy are all in co_aix type. 221 * The x,y,sx,sy are all in co_aix type.
217 * 222 *
218 */ 223 */
219 #define coord_move(co,x,y) do {(co)->matrix[2] = (x); (co)->matrix[5] = (y);} while(0) 224 #define coord_move(co,x,y) do {(co)->matrix[2] = (x); (co)->matrix[5] = (y);} while(0)
220 #define coord_set_scalex(co,sx) do {(co)->matrix[0] = sx;} while(0) 225 #define coord_set_scalex(co,sx) do {(co)->matrix[0] = sx;} while(0)
221 #define coord_set_scaley(co,sy) do {(co)->matrux[3] = sy;} while(0) 226 #define coord_set_scaley(co,sy) do {(co)->matrix[3] = sy;} while(0)
222 #define coord_scalex(co) ((co)->matrix[0]) 227 #define coord_scalex(co) ((co)->matrix[0])
223 #define coord_scaley(co) ((co)->matrix[3]) 228 #define coord_scaley(co) ((co)->matrix[3])
224 #define coord_x(co) ((co)->matrix[2]) 229 #define coord_x(co) ((co)->matrix[2])
225 #define coord_y(co) ((co)->matrix[5]) 230 #define coord_y(co) ((co)->matrix[5])
226 #define FOR_COORD_MEMBERS(coord, geo) \ 231 #define FOR_COORD_MEMBERS(coord, geo) \