diff src/shape_text.c @ 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 2ca0773cd48d
children b0571f10c1b8
line wrap: on
line diff
--- a/src/shape_text.c	Sun Feb 15 08:33:47 2009 +0800
+++ b/src/shape_text.c	Sun Feb 15 08:34:57 2009 +0800
@@ -72,7 +72,28 @@
     return (shape_t *)text;
 }
 
-extern void sh_text_set_text(shape_t *shape, const char *txt) {
+void sh_text_set_pos(shape_t *shape, co_aix x, co_aix y)
+{
+    sh_text_t *text = (sh_text_t *)shape;
+    text->x = x;
+    text->y = y;
+}
+
+
+void sh_text_get_pos(shape_t *shape, co_aix *x, co_aix *y)
+{
+    sh_text_t *text = (sh_text_t *)shape;
+    *x = text->x;
+    *y = text->y;
+}
+
+void sh_text_get_text(shape_t *shape, char *text,int size)
+{
+    sh_text_t *t = (sh_text_t *)shape;
+    strncpy(text,t->data, size);
+}
+
+void sh_text_set_text(shape_t *shape, const char *txt) {
     sh_text_t *text = (sh_text_t *)shape;
     char *buf;
 
@@ -230,7 +251,7 @@
     }
     text->layout = pango_cairo_create_layout(cr);
     desc = pango_font_description_from_string("Sans Bold");
-    cairo_set_source_rgb (cr, 0, 0, 0);
+    //cairo_set_source_rgb (cr, 0, 0, 0);
     pango_layout_set_font_description (text->layout, desc);
     pango_layout_set_text(text->layout,text->data,strlen(text->data));
     pango_layout_set_attributes(text->layout, text->attrs);