# HG changeset patch # User Thinker K.F. Li # Date 1228880979 -28800 # Node ID eb6ff421da7ef7a8b8ff4ae901e9b551e8d96f8b # Parent 1d485bf96480592450867501e6d36cfe049502b2 Doc about mb_obj_t diff -r 1d485bf96480 -r eb6ff421da7e include/mb_types.h --- a/include/mb_types.h Wed Dec 10 09:17:16 2008 +0800 +++ b/include/mb_types.h Wed Dec 10 11:49:39 2008 +0800 @@ -15,8 +15,16 @@ struct _redraw_man; +/*! \brief MadButterfly object. + * + * All objects (coord and shapes) should have mb_obj_t as first member + * variable. obj_type is used to identify type of an object. Please, + * use MBO_TYPE() to return this value. MBO_TYPE() will type-casting the + * object to mb_obj_t and return obj_type. MBO_TYPE() is a left-side + * value. + */ struct _mb_obj { - int obj_type; + int obj_type; /*!< \brief Type of a MadButterfly object. */ }; enum { MBO_DUMMY, @@ -28,6 +36,7 @@ }; #define MBO_CLASS_MASK 0xf000 #define MBO_CLASS(x) (((mb_obj_t *)(x))->obj_type & MBO_CLASS_MASK) +/*! \brief Return type of a MadBufferly object. */ #define MBO_TYPE(x) (((mb_obj_t *)(x))->obj_type) #define IS_MBO_SHAPES(obj) (MBO_CLASS(obj) == MBO_SHAPES) #define IS_MBO_COORD(obj) (MBO_TYPE(obj) == MB_COORD)