comparison src/shape_stext.c @ 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 8f900da42eed
children 099941c3becf
comparison
equal deleted inserted replaced
428:c3faebaec0c4 429:9d5506968efb
385 free((void *)txt_o->txt); 385 free((void *)txt_o->txt);
386 386
387 free(txt_o); 387 free(txt_o);
388 } 388 }
389 389
390 shape_t *rdman_shape_stext_new(redraw_man_t *rdman, co_aix x, co_aix y, 390 shape_t *rdman_shape_stext_new(redraw_man_t *rdman, const char *txt,
391 const char *txt) { 391 co_aix x, co_aix y) {
392 sh_stext_t *txt_o; 392 sh_stext_t *txt_o;
393 393
394 ASSERT(txt != NULL); 394 ASSERT(txt != NULL);
395 395
396 txt_o = (sh_stext_t *)malloc(sizeof(sh_stext_t)); 396 txt_o = (sh_stext_t *)malloc(sizeof(sh_stext_t));
810 mb_font_face_t *face; 810 mb_font_face_t *face;
811 mb_text_extents_t *ext; 811 mb_text_extents_t *ext;
812 int r; 812 int r;
813 813
814 txt_o = (sh_stext_t *)rdman_shape_stext_new((redraw_man_t *)NULL, 814 txt_o = (sh_stext_t *)rdman_shape_stext_new((redraw_man_t *)NULL,
815 10, 15, "Hello World"); 815 "Hello World", 10, 15);
816 CU_ASSERT(txt_o != NULL); 816 CU_ASSERT(txt_o != NULL);
817 817
818 aggr = txt_o->shape.aggr; 818 aggr = txt_o->shape.aggr;
819 aggr[0] = 1; 819 aggr[0] = 1;
820 aggr[1] = 0; 820 aggr[1] = 0;
859 co_aix *aggr; 859 co_aix *aggr;
860 mb_font_face_t *face; 860 mb_font_face_t *face;
861 area_t *area; 861 area_t *area;
862 int r; 862 int r;
863 863
864 txt_o = (sh_stext_t *)rdman_shape_stext_new(NULL, 100, 50, "hello world"); 864 txt_o = (sh_stext_t *)rdman_shape_stext_new(NULL, "hello world", 100, 50);
865 CU_ASSERT(txt_o != NULL); 865 CU_ASSERT(txt_o != NULL);
866 866
867 aggr = txt_o->shape.aggr; 867 aggr = txt_o->shape.aggr;
868 aggr[0] = 2; 868 aggr[0] = 2;
869 aggr[1] = 0; 869 aggr[1] = 0;
905 co_aix *aggr; 905 co_aix *aggr;
906 mb_font_face_t *face; 906 mb_font_face_t *face;
907 area_t *area; 907 area_t *area;
908 int r; 908 int r;
909 909
910 txt_o = (sh_stext_t *)rdman_shape_stext_new(NULL, 100, 50, "hello world"); 910 txt_o = (sh_stext_t *)rdman_shape_stext_new(NULL, "hello world", 100, 50);
911 CU_ASSERT(txt_o != NULL); 911 CU_ASSERT(txt_o != NULL);
912 912
913 aggr = txt_o->shape.aggr; 913 aggr = txt_o->shape.aggr;
914 aggr[0] = 2; 914 aggr[0] = 2;
915 aggr[1] = 0; 915 aggr[1] = 0;