Mercurial > MadButterfly
comparison include/mb_types.h @ 204:eb6ff421da7e
Doc about mb_obj_t
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 10 Dec 2008 11:49:39 +0800 |
parents | c234ee745ceb |
children | e01acb80f0e7 |
comparison
equal
deleted
inserted
replaced
203:1d485bf96480 | 204:eb6ff421da7e |
---|---|
13 typedef struct _paint paint_t; | 13 typedef struct _paint paint_t; |
14 typedef struct _mb_obj mb_obj_t; | 14 typedef struct _mb_obj mb_obj_t; |
15 | 15 |
16 struct _redraw_man; | 16 struct _redraw_man; |
17 | 17 |
18 /*! \brief MadButterfly object. | |
19 * | |
20 * All objects (coord and shapes) should have mb_obj_t as first member | |
21 * variable. obj_type is used to identify type of an object. Please, | |
22 * use MBO_TYPE() to return this value. MBO_TYPE() will type-casting the | |
23 * object to mb_obj_t and return obj_type. MBO_TYPE() is a left-side | |
24 * value. | |
25 */ | |
18 struct _mb_obj { | 26 struct _mb_obj { |
19 int obj_type; | 27 int obj_type; /*!< \brief Type of a MadButterfly object. */ |
20 }; | 28 }; |
21 | 29 |
22 enum { MBO_DUMMY, | 30 enum { MBO_DUMMY, |
23 MBO_COORD, | 31 MBO_COORD, |
24 MBO_SHAPES=0x1000, | 32 MBO_SHAPES=0x1000, |
26 MBO_TEXT, | 34 MBO_TEXT, |
27 MBO_RECT | 35 MBO_RECT |
28 }; | 36 }; |
29 #define MBO_CLASS_MASK 0xf000 | 37 #define MBO_CLASS_MASK 0xf000 |
30 #define MBO_CLASS(x) (((mb_obj_t *)(x))->obj_type & MBO_CLASS_MASK) | 38 #define MBO_CLASS(x) (((mb_obj_t *)(x))->obj_type & MBO_CLASS_MASK) |
39 /*! \brief Return type of a MadBufferly object. */ | |
31 #define MBO_TYPE(x) (((mb_obj_t *)(x))->obj_type) | 40 #define MBO_TYPE(x) (((mb_obj_t *)(x))->obj_type) |
32 #define IS_MBO_SHAPES(obj) (MBO_CLASS(obj) == MBO_SHAPES) | 41 #define IS_MBO_SHAPES(obj) (MBO_CLASS(obj) == MBO_SHAPES) |
33 #define IS_MBO_COORD(obj) (MBO_TYPE(obj) == MB_COORD) | 42 #define IS_MBO_COORD(obj) (MBO_TYPE(obj) == MB_COORD) |
34 | 43 |
35 /*! \brief Base of paint types. | 44 /*! \brief Base of paint types. |