Mercurial > MadButterfly
comparison include/mb_obj.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 | |
children | 586e50f82c1f |
comparison
equal
deleted
inserted
replaced
302:8b45e7b374b8 | 303:f894b30676e9 |
---|---|
1 #ifndef __MBOBJ_H | |
2 #define __MBOBJ_H | |
3 #include "mb_shapes.h" | |
4 #include "mb_shapes.h" | |
5 /*! \brief Change the location of the object. | |
6 * | |
7 * The location of the object will be relocated to the new position. This function works for group(coord_t) | |
8 * and text shape (shape_text_t). For others, this command will be ignored since we don't know the original | |
9 * point of a path. | |
10 */ | |
11 void mb_obj_set_pos(mb_obj_t *obj, co_aix x, co_aix y); | |
12 | |
13 /*! \brief Get the position of the object. | |
14 * | |
15 * Return the position of the object. This works for group and text only. For others, (0,0) will be returned. | |
16 */ | |
17 void mb_obj_get_pos(mb_obj_t *obj, co_aix *x, co_aix *y); | |
18 | |
19 /*! \brief set the width of the object. | |
20 * | |
21 */ | |
22 void mb_obj_set_scalex(mb_obj_t *obj, int scale); | |
23 | |
24 /*! \brief return the scale of width. | |
25 */ | |
26 int mb_obj_get_scalex(mb_obj_t *obj); | |
27 | |
28 /*! \brief set the scale of height. | |
29 */ | |
30 void mb_obj_set_scaley(mb_obj_t *obj, int scale); | |
31 /*! \brief return the scale of height | |
32 * | |
33 */ | |
34 int mb_obj_get_scaley(mb_obj_t *obj); | |
35 | |
36 | |
37 /*! \brief Change the rotation degree. | |
38 * | |
39 */ | |
40 void mb_obj_set_rotation(mb_obj_t *obj, int degree); | |
41 | |
42 /*! \brief Return the rotation degree of an object. | |
43 * | |
44 */ | |
45 | |
46 int mb_obj_get_rotation(mb_obj_t *obj); | |
47 | |
48 /*! \brief set the textformat of the texts inside a group. | |
49 * | |
50 * If the obj is a group, we will search the first text element inside it. If it is a shape_t, it will be applied to it directly. | |
51 * | |
52 */ | |
53 void mb_obj_set_textstyle(mb_obj_t *obj, mb_textstyle_t *format, int begin, int end); | |
54 | |
55 /*! \brief return the text format style between 'begin' and 'end'. | |
56 * | |
57 */ | |
58 void mb_obj_get_textstyle(mb_obj_t *, mb_textstyle_t *format,int begin,int end); | |
59 | |
60 /*! \brief Change the characters of a text field. | |
61 * Change the content of a text field. If the obj is a group, we will search for the first text field inside it as the target. | |
62 */ | |
63 void mb_obj_set_text(mb_obj_t *obj, const char *text); | |
64 | |
65 | |
66 /*! \brief Get the content of a text field. | |
67 * | |
68 * The 'text' is the data buffer and the 'size' is the size of the buffer. | |
69 */ | |
70 void mb_obj_get_text(mb_obj_t *obj, char *text, int size); | |
71 | |
72 #endif | |
73 |