Evas font-engine: Fixed *props_info_create to accept a const string.

We don't want to have to alloc just for the engine. We want to be able to
pass our own const copy.

SVN revision: 58618
This commit is contained in:
Tom Hacohen 2011-04-13 08:36:54 +00:00
parent 680c4354ba
commit 682c7dcdc5
2 changed files with 11 additions and 7 deletions

View File

@ -686,7 +686,7 @@ struct _Evas_Func
void (*image_content_hint_set) (void *data, void *surface, int hint);
int (*image_content_hint_get) (void *data, void *surface);
int (*font_pen_coords_get) (void *data, void *font, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
Eina_Bool (*font_text_props_info_create) (void *data __UNUSED__, void *font, Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len);
Eina_Bool (*font_text_props_info_create) (void *data __UNUSED__, void *font, const Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len);
int (*font_right_inset_get) (void *data, void *font, const Evas_Text_Props *text_props);
/* EFL-GL Glue Layer */

View File

@ -772,18 +772,22 @@ eng_font_pen_coords_get(void *data __UNUSED__, void *font, const Evas_Text_Props
}
static Eina_Bool
eng_font_text_props_info_create(void *data __UNUSED__, void *font, Eina_Unicode *text, Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len)
eng_font_text_props_info_create(void *data __UNUSED__, void *font, const Eina_Unicode *text, Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len)
{
(void) font;
(void) text;
(void) text_props;
Eina_Bool ret;
(void) par_props;
(void) pos;
(void) len;
#if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
Eina_Unicode *tmp = eina_unicode_strndup(text, len);
text = tmp;
evas_bidi_shape_string(text, par_props, pos, len);
#endif
return evas_common_text_props_content_create(font, text, text_props, len);
ret = evas_common_text_props_content_create(font, text, text_props, len);
#if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
free(tmp);
#endif
return ret;
}
static int