changeset 429:9d5506968efb

Change the interface of rdman_shape_stext_new(). It had better to put text as 2nd argument after rdman. Since, text content is more meaningful than x, y position for a text object.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 29 Jul 2009 14:58:34 +0800
parents c3faebaec0c4
children bec538d361e9
files include/mb_shapes.h src/shape_stext.c
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/include/mb_shapes.h	Wed Jul 29 14:58:31 2009 +0800
+++ b/include/mb_shapes.h	Wed Jul 29 14:58:34 2009 +0800
@@ -294,8 +294,8 @@
 } mb_style_blk_t;
 
 extern shape_t *rdman_shape_stext_new(redraw_man_t *rdman,
-				      co_aix x, co_aix y,
-				      const char *txt);
+				      const char *txt,
+				      co_aix x, co_aix y);
 extern void sh_stext_transform(shape_t *shape);
 extern void sh_stext_draw(shape_t *shape, cairo_t *cr);
 extern int sh_stext_set_text(shape_t *shape, const char *txt);
--- a/src/shape_stext.c	Wed Jul 29 14:58:31 2009 +0800
+++ b/src/shape_stext.c	Wed Jul 29 14:58:34 2009 +0800
@@ -387,8 +387,8 @@
     free(txt_o);
 }
 
-shape_t *rdman_shape_stext_new(redraw_man_t *rdman, co_aix x, co_aix y,
-		      const char *txt) {
+shape_t *rdman_shape_stext_new(redraw_man_t *rdman, const char *txt,
+			       co_aix x, co_aix y) {
     sh_stext_t *txt_o;
 
     ASSERT(txt != NULL);
@@ -812,7 +812,7 @@
     int r;
 
     txt_o = (sh_stext_t *)rdman_shape_stext_new((redraw_man_t *)NULL,
-						10, 15, "Hello World");
+						"Hello World", 10, 15);
     CU_ASSERT(txt_o != NULL);
 
     aggr = txt_o->shape.aggr;
@@ -861,7 +861,7 @@
     area_t *area;
     int r;
 
-    txt_o = (sh_stext_t *)rdman_shape_stext_new(NULL, 100, 50, "hello world");
+    txt_o = (sh_stext_t *)rdman_shape_stext_new(NULL, "hello world", 100, 50);
     CU_ASSERT(txt_o != NULL);
 
     aggr = txt_o->shape.aggr;
@@ -907,7 +907,7 @@
     area_t *area;
     int r;
 
-    txt_o = (sh_stext_t *)rdman_shape_stext_new(NULL, 100, 50, "hello world");
+    txt_o = (sh_stext_t *)rdman_shape_stext_new(NULL, "hello world", 100, 50);
     CU_ASSERT(txt_o != NULL);
     
     aggr = txt_o->shape.aggr;