Mercurial > MadButterfly
comparison src/shape_text.c @ 196:c234ee745ceb
Start moving to mb_obj_t
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Tue, 09 Dec 2008 17:34:10 +0800 |
parents | 530bb7728546 |
children | 29e1b2bffe4c |
comparison
equal
deleted
inserted
replaced
195:5235aded379c | 196:c234ee745ceb |
---|---|
40 text = (sh_text_t *)malloc(sizeof(sh_text_t)); | 40 text = (sh_text_t *)malloc(sizeof(sh_text_t)); |
41 if(text == NULL) | 41 if(text == NULL) |
42 return NULL; | 42 return NULL; |
43 | 43 |
44 memset(text, 0, sizeof(sh_text_t)); | 44 memset(text, 0, sizeof(sh_text_t)); |
45 text->shape.sh_type = SHT_TEXT; | 45 MBO_TYPE(text) = MBO_TEXT; |
46 text->data = strdup(txt); | 46 text->data = strdup(txt); |
47 if(text->data == NULL) { | 47 if(text->data == NULL) { |
48 free(text); | 48 free(text); |
49 return NULL; | 49 return NULL; |
50 } | 50 } |