Evas bidi: Add len parameter to evas_bidi_paragraph_props_get

SVN revision: 58631
This commit is contained in:
Tom Hacohen 2011-04-13 12:21:54 +00:00
parent 18ecece5f3
commit f9936b341f
4 changed files with 19 additions and 11 deletions

View File

@ -563,7 +563,7 @@ _evas_object_text_layout(Evas_Object *obj, Evas_Object_Text *o, const Eina_Unico
int len = eina_unicode_strlen(text);
#ifdef BIDI_SUPPORT
evas_bidi_paragraph_props_unref(o->bidi_par_props);
o->bidi_par_props = evas_bidi_paragraph_props_get(text);
o->bidi_par_props = evas_bidi_paragraph_props_get(text, len);
evas_bidi_props_reorder_line(NULL, 0, len, o->bidi_par_props, &v_to_l);
#endif
visual_pos = pos = 0;

View File

@ -4721,7 +4721,8 @@ _evas_textblock_nodes_merge(Evas_Object_Textblock *o, Evas_Object_Textblock_Node
#ifdef BIDI_SUPPORT
evas_bidi_paragraph_props_unref(to->bidi_props);
to->bidi_props = evas_bidi_paragraph_props_get(
eina_ustrbuf_string_get(to->unicode));
eina_ustrbuf_string_get(to->unicode),
eina_ustrbuf_length_get(to->unicode));
#endif
_evas_textblock_cursors_set_node(o, from, to);
@ -6082,11 +6083,13 @@ _evas_textblock_cursor_break_paragraph(Evas_Textblock_Cursor *cur,
#ifdef BIDI_SUPPORT
evas_bidi_paragraph_props_unref(n->bidi_props);
n->bidi_props = evas_bidi_paragraph_props_get(
eina_ustrbuf_string_get(n->unicode));
eina_ustrbuf_string_get(n->unicode),
eina_ustrbuf_length_get(n->unicode));
evas_bidi_paragraph_props_unref(cur->node->bidi_props);
cur->node->bidi_props = evas_bidi_paragraph_props_get(
eina_ustrbuf_string_get(cur->node->unicode));
eina_ustrbuf_string_get(cur->node->unicode),
eina_ustrbuf_length_get(cur->node->unicode));
#endif
}
else
@ -6278,7 +6281,9 @@ evas_textblock_cursor_text_append(Evas_Textblock_Cursor *cur, const char *_text)
fnode->offset += len;
#ifdef BIDI_SUPPORT
evas_bidi_paragraph_props_unref(n->bidi_props);
n->bidi_props = evas_bidi_paragraph_props_get(eina_ustrbuf_string_get(n->unicode));
n->bidi_props = evas_bidi_paragraph_props_get(
eina_ustrbuf_string_get(n->unicode),
eina_ustrbuf_length_get(n->unicode));
#endif
_evas_textblock_changed(o, cur->obj);
n->dirty = EINA_TRUE;
@ -6453,7 +6458,8 @@ evas_textblock_cursor_format_append(Evas_Textblock_Cursor *cur, const char *form
#ifdef BIDI_SUPPORT
evas_bidi_paragraph_props_unref(cur->node->bidi_props);
cur->node->bidi_props = evas_bidi_paragraph_props_get(
eina_ustrbuf_string_get(cur->node->unicode));
eina_ustrbuf_string_get(cur->node->unicode),
eina_ustrbuf_length_get(cur->node->unicode));
#endif
}
}
@ -6542,7 +6548,9 @@ evas_textblock_cursor_char_delete(Evas_Textblock_Cursor *cur)
}
#ifdef BIDI_SUPPORT
evas_bidi_paragraph_props_unref(n->bidi_props);
n->bidi_props = evas_bidi_paragraph_props_get(eina_ustrbuf_string_get(n->unicode));
n->bidi_props = evas_bidi_paragraph_props_get(
eina_ustrbuf_string_get(n->unicode),
eina_ustrbuf_length_get(n->unicode));
#endif
if (cur->pos == eina_ustrbuf_length_get(n->unicode))
@ -6645,7 +6653,8 @@ evas_textblock_cursor_range_delete(Evas_Textblock_Cursor *cur1, Evas_Textblock_C
#ifdef BIDI_SUPPORT
evas_bidi_paragraph_props_unref(n1->bidi_props);
n1->bidi_props = evas_bidi_paragraph_props_get(
eina_ustrbuf_string_get(n1->unicode));
eina_ustrbuf_string_get(n1->unicode),
eina_ustrbuf_length_get(n1->unicode));
#endif
evas_textblock_cursor_copy(cur1, cur2);

View File

@ -155,14 +155,13 @@ evas_bidi_shape_string(Eina_Unicode *eina_ustr, const Evas_BiDi_Paragraph_Props
*/
Evas_BiDi_Paragraph_Props *
evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr)
evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len)
{
Evas_BiDi_Paragraph_Props *bidi_props = NULL;
EvasBiDiCharType *char_types = NULL;
EvasBiDiLevel *embedding_levels = NULL;
const FriBidiChar *ustr;
FriBidiChar *base_ustr = NULL;
size_t len;
if (!eina_ustr)
return NULL;

View File

@ -120,7 +120,7 @@ Eina_Bool
evas_bidi_props_reorder_line(Eina_Unicode *eina_ustr, size_t start, size_t len, const Evas_BiDi_Paragraph_Props *props, EvasBiDiStrIndex **_v_to_l);
Evas_BiDi_Paragraph_Props *
evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr) EINA_ARG_NONNULL(1) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len) EINA_ARG_NONNULL(1) EINA_MALLOC EINA_WARN_UNUSED_RESULT;
void
evas_bidi_props_copy_and_ref(const Evas_BiDi_Props *src, Evas_BiDi_Props *dst);