efl_access_text: remove ptr usage in eo files
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11907
This commit is contained in:
parent
5ca1a8c8a7
commit
ff3d3b1944
|
@ -66,12 +66,12 @@ interface @beta Efl.Access.Text
|
||||||
}
|
}
|
||||||
keys {
|
keys {
|
||||||
granularity: Efl.Access.Text_Granularity; [[Text granularity]]
|
granularity: Efl.Access.Text_Granularity; [[Text granularity]]
|
||||||
start_offset: ptr(int); [[Offset indicating start of string according to given granularity.
|
|
||||||
-1 in case of error.]]
|
|
||||||
end_offset: ptr(int); [[Offset indicating end of string according to given granularity.
|
|
||||||
-1 in case of error.]]
|
|
||||||
}
|
}
|
||||||
values {
|
values {
|
||||||
|
start_offset: int; [[Offset indicating start of string according to given granularity.
|
||||||
|
-1 in case of error.]]
|
||||||
|
end_offset: int; [[Offset indicating end of string according to given granularity.
|
||||||
|
-1 in case of error.]]
|
||||||
string: mstring @move; [[Newly allocated UTF-8 encoded string. Must be free by a user.]]
|
string: mstring @move; [[Newly allocated UTF-8 encoded string. Must be free by a user.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,10 +105,10 @@ interface @beta Efl.Access.Text
|
||||||
}
|
}
|
||||||
keys {
|
keys {
|
||||||
name: string; [[Text attribute name]]
|
name: string; [[Text attribute name]]
|
||||||
start_offset: ptr(int); [[Position in text from which given attribute is set.]]
|
|
||||||
end_offset: ptr(int); [[Position in text to which given attribute is set.]]
|
|
||||||
}
|
}
|
||||||
values {
|
values {
|
||||||
|
start_offset: int; [[Position in text from which given attribute is set.]]
|
||||||
|
end_offset: int; [[Position in text to which given attribute is set.]]
|
||||||
value: mstring @move; [[Value of text attribute. Should be free()]]
|
value: mstring @move; [[Value of text attribute. Should be free()]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,11 +116,9 @@ interface @beta Efl.Access.Text
|
||||||
[[Gets list of all text attributes.]]
|
[[Gets list of all text attributes.]]
|
||||||
get {
|
get {
|
||||||
}
|
}
|
||||||
keys {
|
|
||||||
start_offset: ptr(int); [[Start offset]]
|
|
||||||
end_offset: ptr(int); [[End offset]]
|
|
||||||
}
|
|
||||||
values {
|
values {
|
||||||
|
start_offset: int; [[Start offset]]
|
||||||
|
end_offset: int; [[End offset]]
|
||||||
attributes: list<Efl.Access.Text_Attribute> @move; [[List of text attributes]]
|
attributes: list<Efl.Access.Text_Attribute> @move; [[List of text attributes]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2099,11 +2099,13 @@ _efl_ui_textbox_efl_access_text_character_count_get(const Eo *obj, Efl_Ui_Textbo
|
||||||
return eina_unicode_utf8_get_len(txt);
|
return eina_unicode_utf8_get_len(txt);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static char*
|
EOLIAN static void
|
||||||
_efl_ui_textbox_efl_access_text_string_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *pd, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset)
|
_efl_ui_textbox_efl_access_text_string_get(const Eo *obj EINA_UNUSED, Efl_Ui_Textbox_Data *pd, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset, char **ret EFL_TRANSFER_OWNERSHIP)
|
||||||
{
|
{
|
||||||
Evas_Textblock_Cursor *cur = NULL, *cur2 = NULL;
|
Evas_Textblock_Cursor *cur = NULL, *cur2 = NULL;
|
||||||
char *ret = NULL;
|
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(ret);
|
||||||
|
*ret = NULL;
|
||||||
|
|
||||||
cur = evas_object_textblock_cursor_new(pd->text_obj);
|
cur = evas_object_textblock_cursor_new(pd->text_obj);
|
||||||
cur2 = evas_object_textblock_cursor_new(pd->text_obj);
|
cur2 = evas_object_textblock_cursor_new(pd->text_obj);
|
||||||
|
@ -2158,26 +2160,26 @@ _efl_ui_textbox_efl_access_text_string_get(const Eo *obj EINA_UNUSED, Efl_Ui_Tex
|
||||||
|
|
||||||
if (end_offset) *end_offset = evas_textblock_cursor_pos_get(cur2);
|
if (end_offset) *end_offset = evas_textblock_cursor_pos_get(cur2);
|
||||||
|
|
||||||
ret = evas_textblock_cursor_range_text_get(cur, cur2, EVAS_TEXTBLOCK_TEXT_PLAIN);
|
*ret = evas_textblock_cursor_range_text_get(cur, cur2, EVAS_TEXTBLOCK_TEXT_PLAIN);
|
||||||
|
|
||||||
evas_textblock_cursor_free(cur);
|
evas_textblock_cursor_free(cur);
|
||||||
evas_textblock_cursor_free(cur2);
|
evas_textblock_cursor_free(cur2);
|
||||||
|
|
||||||
if (ret && efl_text_password_get(obj))
|
if (*ret && efl_text_password_get(obj))
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (ret[i] != '\0')
|
while (*ret[i] != '\0')
|
||||||
ret[i++] = ENTRY_PASSWORD_MASK_CHARACTER;
|
*ret[i++] = ENTRY_PASSWORD_MASK_CHARACTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (start_offset) *start_offset = -1;
|
if (start_offset) *start_offset = -1;
|
||||||
if (end_offset) *end_offset = -1;
|
if (end_offset) *end_offset = -1;
|
||||||
if (cur) evas_textblock_cursor_free(cur);
|
if (cur) evas_textblock_cursor_free(cur);
|
||||||
if (cur2) evas_textblock_cursor_free(cur2);
|
if (cur2) evas_textblock_cursor_free(cur2);
|
||||||
return NULL;
|
*ret = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static char*
|
EOLIAN static char*
|
||||||
|
@ -2453,23 +2455,26 @@ _efl_ui_textbox_efl_access_text_attribute_get(const Eo *obj, Efl_Ui_Textbox_Data
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_List*
|
EOLIAN static void
|
||||||
_efl_ui_textbox_efl_access_text_text_attributes_get(const Eo *obj, Efl_Ui_Textbox_Data *pd EINA_UNUSED, int *start_offset, int *end_offset)
|
_efl_ui_textbox_efl_access_text_text_attributes_get(const Eo *obj, Efl_Ui_Textbox_Data *pd EINA_UNUSED, int *start_offset, int *end_offset, Eina_List **ret EFL_TRANSFER_OWNERSHIP)
|
||||||
{
|
{
|
||||||
Efl_Text_Cursor_Object *cur1, *cur2;
|
Efl_Text_Cursor_Object *cur1, *cur2;
|
||||||
Eina_List *ret = NULL;
|
|
||||||
Efl_Access_Text_Attribute *attr;
|
Efl_Access_Text_Attribute *attr;
|
||||||
Eina_Iterator *annotations;
|
Eina_Iterator *annotations;
|
||||||
Efl_Text_Attribute_Handle *an;
|
Efl_Text_Attribute_Handle *an;
|
||||||
Eo *mobj = (Eo *)obj;
|
Eo *mobj = (Eo *)obj;
|
||||||
|
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(ret);
|
||||||
|
*ret = NULL;
|
||||||
|
|
||||||
cur1 = efl_ui_textbox_cursor_create(mobj);
|
cur1 = efl_ui_textbox_cursor_create(mobj);
|
||||||
if (!cur1) return NULL;
|
if (!cur1) return;
|
||||||
|
|
||||||
cur2 = efl_ui_textbox_cursor_create(mobj);
|
cur2 = efl_ui_textbox_cursor_create(mobj);
|
||||||
if (!cur2)
|
if (!cur2)
|
||||||
{
|
{
|
||||||
efl_del(cur1);
|
efl_del(cur1);
|
||||||
return NULL;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
efl_text_cursor_object_position_set(cur1, *start_offset);
|
efl_text_cursor_object_position_set(cur1, *start_offset);
|
||||||
|
@ -2480,17 +2485,15 @@ _efl_ui_textbox_efl_access_text_text_attributes_get(const Eo *obj, Efl_Ui_Textbo
|
||||||
efl_del(cur1);
|
efl_del(cur1);
|
||||||
efl_del(cur2);
|
efl_del(cur2);
|
||||||
|
|
||||||
if (!annotations) return NULL;
|
if (!annotations) return;
|
||||||
|
|
||||||
EINA_ITERATOR_FOREACH(annotations, an)
|
EINA_ITERATOR_FOREACH(annotations, an)
|
||||||
{
|
{
|
||||||
attr = _textblock_node_format_to_atspi_text_attr(an);
|
attr = _textblock_node_format_to_atspi_text_attr(an);
|
||||||
if (!attr) continue;
|
if (!attr) continue;
|
||||||
ret = eina_list_append(ret, attr);
|
*ret = eina_list_append(*ret, attr);
|
||||||
}
|
}
|
||||||
eina_iterator_free(annotations);
|
eina_iterator_free(annotations);
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_List*
|
EOLIAN static Eina_List*
|
||||||
|
|
|
@ -1357,7 +1357,7 @@ _text_string_at_offset_get(const Eldbus_Service_Interface *iface, const Eldbus_M
|
||||||
}
|
}
|
||||||
else if (efl_isa(obj, EFL_ACCESS_TEXT_INTERFACE))
|
else if (efl_isa(obj, EFL_ACCESS_TEXT_INTERFACE))
|
||||||
{
|
{
|
||||||
str = efl_access_text_string_get(obj, gran, &start, &end);
|
efl_access_text_string_get(obj, gran, &start, &end, &str);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1635,7 +1635,8 @@ _text_attributes_get(const Eldbus_Service_Interface *iface, const Eldbus_Message
|
||||||
}
|
}
|
||||||
else if (efl_isa(obj, EFL_ACCESS_TEXT_INTERFACE))
|
else if (efl_isa(obj, EFL_ACCESS_TEXT_INTERFACE))
|
||||||
{
|
{
|
||||||
Eina_List *attrs = efl_access_text_attributes_get(obj, &start, &end);
|
Eina_List *attrs = NULL;
|
||||||
|
efl_access_text_attributes_get(obj, &start, &end, &attrs);
|
||||||
EINA_LIST_FREE(attrs, attr)
|
EINA_LIST_FREE(attrs, attr)
|
||||||
{
|
{
|
||||||
eldbus_message_iter_arguments_append(iter_array, "ss", attr->name, attr->value);
|
eldbus_message_iter_arguments_append(iter_array, "ss", attr->name, attr->value);
|
||||||
|
@ -2224,7 +2225,7 @@ _text_run_attributes_get(const Eldbus_Service_Interface *iface, const Eldbus_Mes
|
||||||
iter_array = eldbus_message_iter_container_new(iter, 'a', "{ss}");
|
iter_array = eldbus_message_iter_container_new(iter, 'a', "{ss}");
|
||||||
EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
|
EINA_SAFETY_ON_NULL_GOTO(iter_array, fail);
|
||||||
|
|
||||||
attrs = efl_access_text_attributes_get(obj, &start, &end);
|
efl_access_text_attributes_get(obj, &start, &end, &attrs);
|
||||||
|
|
||||||
if (incl_def)
|
if (incl_def)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5691,12 +5691,14 @@ _elm_entry_efl_access_text_character_count_get(const Eo *obj, Elm_Entry_Data *_p
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static char*
|
EOLIAN static void
|
||||||
_elm_entry_efl_access_text_string_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset)
|
_elm_entry_efl_access_text_string_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset, char **ret EFL_TRANSFER_OWNERSHIP)
|
||||||
{
|
{
|
||||||
Evas_Textblock_Cursor *cur = NULL, *cur2 = NULL;
|
Evas_Textblock_Cursor *cur = NULL, *cur2 = NULL;
|
||||||
Evas_Object *tblk;
|
Evas_Object *tblk;
|
||||||
char *ret = NULL;
|
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(ret);
|
||||||
|
*ret = NULL;
|
||||||
|
|
||||||
tblk = elm_entry_textblock_get(obj);
|
tblk = elm_entry_textblock_get(obj);
|
||||||
if (!tblk) goto fail;
|
if (!tblk) goto fail;
|
||||||
|
@ -5754,26 +5756,26 @@ _elm_entry_efl_access_text_string_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UN
|
||||||
|
|
||||||
if (end_offset) *end_offset = evas_textblock_cursor_pos_get(cur2);
|
if (end_offset) *end_offset = evas_textblock_cursor_pos_get(cur2);
|
||||||
|
|
||||||
ret = evas_textblock_cursor_range_text_get(cur, cur2, EVAS_TEXTBLOCK_TEXT_PLAIN);
|
*ret = evas_textblock_cursor_range_text_get(cur, cur2, EVAS_TEXTBLOCK_TEXT_PLAIN);
|
||||||
|
|
||||||
evas_textblock_cursor_free(cur);
|
evas_textblock_cursor_free(cur);
|
||||||
evas_textblock_cursor_free(cur2);
|
evas_textblock_cursor_free(cur2);
|
||||||
|
|
||||||
if (ret && _pd->password)
|
if (*ret && _pd->password)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (ret[i] != '\0')
|
while (*ret[i] != '\0')
|
||||||
ret[i++] = ENTRY_PASSWORD_MASK_CHARACTER;
|
*ret[i++] = ENTRY_PASSWORD_MASK_CHARACTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (start_offset) *start_offset = -1;
|
if (start_offset) *start_offset = -1;
|
||||||
if (end_offset) *end_offset = -1;
|
if (end_offset) *end_offset = -1;
|
||||||
if (cur) evas_textblock_cursor_free(cur);
|
if (cur) evas_textblock_cursor_free(cur);
|
||||||
if (cur2) evas_textblock_cursor_free(cur2);
|
if (cur2) evas_textblock_cursor_free(cur2);
|
||||||
return NULL;
|
*ret = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static char*
|
EOLIAN static char*
|
||||||
|
@ -6067,26 +6069,29 @@ _elm_entry_efl_access_text_attribute_get(const Eo *obj, Elm_Entry_Data *_pd EINA
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_List*
|
EOLIAN static void
|
||||||
_elm_entry_efl_access_text_text_attributes_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int *start_offset, int *end_offset)
|
_elm_entry_efl_access_text_text_attributes_get(const Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int *start_offset, int *end_offset, Eina_List **ret EFL_TRANSFER_OWNERSHIP)
|
||||||
{
|
{
|
||||||
Evas_Object *txtblk;
|
Evas_Object *txtblk;
|
||||||
Evas_Textblock_Cursor *cur1, *cur2;
|
Evas_Textblock_Cursor *cur1, *cur2;
|
||||||
Eina_List *formats, *ret = NULL, *l;
|
Eina_List *formats, *l;
|
||||||
Evas_Object_Textblock_Node_Format *format;
|
Evas_Object_Textblock_Node_Format *format;
|
||||||
Efl_Access_Text_Attribute *attr;
|
Efl_Access_Text_Attribute *attr;
|
||||||
|
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(ret);
|
||||||
|
*ret = NULL;
|
||||||
|
|
||||||
txtblk = elm_entry_textblock_get(obj);
|
txtblk = elm_entry_textblock_get(obj);
|
||||||
if (!txtblk) return NULL;
|
if (!txtblk) return;
|
||||||
|
|
||||||
cur1 = evas_object_textblock_cursor_new(txtblk);
|
cur1 = evas_object_textblock_cursor_new(txtblk);
|
||||||
if (!cur1) return NULL;
|
if (!cur1) return;
|
||||||
|
|
||||||
cur2 = evas_object_textblock_cursor_new(txtblk);
|
cur2 = evas_object_textblock_cursor_new(txtblk);
|
||||||
if (!cur2)
|
if (!cur2)
|
||||||
{
|
{
|
||||||
evas_textblock_cursor_free(cur1);
|
evas_textblock_cursor_free(cur1);
|
||||||
return NULL;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
evas_textblock_cursor_pos_set(cur1, *start_offset);
|
evas_textblock_cursor_pos_set(cur1, *start_offset);
|
||||||
|
@ -6097,16 +6102,14 @@ _elm_entry_efl_access_text_text_attributes_get(const Eo *obj, Elm_Entry_Data *_p
|
||||||
evas_textblock_cursor_free(cur1);
|
evas_textblock_cursor_free(cur1);
|
||||||
evas_textblock_cursor_free(cur2);
|
evas_textblock_cursor_free(cur2);
|
||||||
|
|
||||||
if (!formats) return NULL;
|
if (!formats) return;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(formats, l , format)
|
EINA_LIST_FOREACH(formats, l , format)
|
||||||
{
|
{
|
||||||
attr = _textblock_node_format_to_atspi_text_attr(format);
|
attr = _textblock_node_format_to_atspi_text_attr(format);
|
||||||
if (!attr) continue;
|
if (!attr) continue;
|
||||||
ret = eina_list_append(ret, attr);
|
*ret = eina_list_append(*ret, attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN static Eina_List*
|
EOLIAN static Eina_List*
|
||||||
|
|
|
@ -904,13 +904,13 @@ const char *_elm_entry_efl_access_object_i18n_name_get(const Eo *obj, Elm_Entry_
|
||||||
char *_elm_entry_efl_access_text_access_text_get(const Eo *obj, Elm_Entry_Data *pd, int start_offset, int end_offset);
|
char *_elm_entry_efl_access_text_access_text_get(const Eo *obj, Elm_Entry_Data *pd, int start_offset, int end_offset);
|
||||||
|
|
||||||
|
|
||||||
char *_elm_entry_efl_access_text_string_get(const Eo *obj, Elm_Entry_Data *pd, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset);
|
void _elm_entry_efl_access_text_string_get(const Eo *obj, Elm_Entry_Data *pd, Efl_Access_Text_Granularity granularity, int *start_offset, int *end_offset, char **ret EFL_TRANSFER_OWNERSHIP);
|
||||||
|
|
||||||
|
|
||||||
Eina_Bool _elm_entry_efl_access_text_attribute_get(const Eo *obj, Elm_Entry_Data *pd, const char *name, int *start_offset, int *end_offset, char **value);
|
Eina_Bool _elm_entry_efl_access_text_attribute_get(const Eo *obj, Elm_Entry_Data *pd, const char *name, int *start_offset, int *end_offset, char **value);
|
||||||
|
|
||||||
|
|
||||||
Eina_List *_elm_entry_efl_access_text_text_attributes_get(const Eo *obj, Elm_Entry_Data *pd, int *start_offset, int *end_offset);
|
void _elm_entry_efl_access_text_text_attributes_get(const Eo *obj, Elm_Entry_Data *pd, int *start_offset, int *end_offset, Eina_List **attributes);
|
||||||
|
|
||||||
|
|
||||||
Eina_List *_elm_entry_efl_access_text_default_attributes_get(const Eo *obj, Elm_Entry_Data *pd);
|
Eina_List *_elm_entry_efl_access_text_default_attributes_get(const Eo *obj, Elm_Entry_Data *pd);
|
||||||
|
|
|
@ -155,28 +155,28 @@ EFL_START_TEST(elm_entry_atspi_text_string_get_char)
|
||||||
elm_object_text_set(entry, txt);
|
elm_object_text_set(entry, txt);
|
||||||
|
|
||||||
start = 1;
|
start = 1;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_CHAR, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_CHAR, &start, &end, &val);
|
||||||
ck_assert_str_eq(val, "o");
|
ck_assert_str_eq(val, "o");
|
||||||
ck_assert(start == 1);
|
ck_assert(start == 1);
|
||||||
ck_assert(end == 2);
|
ck_assert(end == 2);
|
||||||
if (val) free(val);
|
if (val) free(val);
|
||||||
|
|
||||||
start = 8;
|
start = 8;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_CHAR, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_CHAR, &start, &end, &val);
|
||||||
ck_assert_str_eq(val, "ś");
|
ck_assert_str_eq(val, "ś");
|
||||||
ck_assert(start == 8);
|
ck_assert(start == 8);
|
||||||
ck_assert(end == 9);
|
ck_assert(end == 9);
|
||||||
if (val) free(val);
|
if (val) free(val);
|
||||||
|
|
||||||
start = 11;
|
start = 11;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_CHAR, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_CHAR, &start, &end, &val);
|
||||||
ck_assert_str_eq(val, " ");
|
ck_assert_str_eq(val, " ");
|
||||||
ck_assert(start == 11);
|
ck_assert(start == 11);
|
||||||
ck_assert(end == 12);
|
ck_assert(end == 12);
|
||||||
if (val) free(val);
|
if (val) free(val);
|
||||||
|
|
||||||
start = 111;
|
start = 111;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_CHAR, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_CHAR, &start, &end, &val);
|
||||||
ck_assert(start == -1);
|
ck_assert(start == -1);
|
||||||
ck_assert(end == -1);
|
ck_assert(end == -1);
|
||||||
ck_assert(val == NULL);
|
ck_assert(val == NULL);
|
||||||
|
@ -198,28 +198,28 @@ EFL_START_TEST(elm_entry_atspi_text_string_get_word)
|
||||||
elm_object_text_set(entry, txt);
|
elm_object_text_set(entry, txt);
|
||||||
|
|
||||||
start = 1;
|
start = 1;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_WORD, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_WORD, &start, &end, &val);
|
||||||
ck_assert_str_eq(val, "Lorem");
|
ck_assert_str_eq(val, "Lorem");
|
||||||
ck_assert(start == 0);
|
ck_assert(start == 0);
|
||||||
ck_assert(end == 5);
|
ck_assert(end == 5);
|
||||||
if (val) free(val);
|
if (val) free(val);
|
||||||
|
|
||||||
start = 6;
|
start = 6;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_WORD, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_WORD, &start, &end, &val);
|
||||||
ck_assert_str_eq(val, "ipśum");
|
ck_assert_str_eq(val, "ipśum");
|
||||||
ck_assert(start == 6);
|
ck_assert(start == 6);
|
||||||
ck_assert(end == 11);
|
ck_assert(end == 11);
|
||||||
if (val) free(val);
|
if (val) free(val);
|
||||||
|
|
||||||
start = 19;
|
start = 19;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_WORD, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_WORD, &start, &end, &val);
|
||||||
ck_assert_str_eq(val, "dolor");
|
ck_assert_str_eq(val, "dolor");
|
||||||
ck_assert(start == 14);
|
ck_assert(start == 14);
|
||||||
ck_assert(end == 19);
|
ck_assert(end == 19);
|
||||||
if (val) free(val);
|
if (val) free(val);
|
||||||
|
|
||||||
start = 111;
|
start = 111;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_WORD, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_WORD, &start, &end, &val);
|
||||||
ck_assert(start == -1);
|
ck_assert(start == -1);
|
||||||
ck_assert(end == -1);
|
ck_assert(end == -1);
|
||||||
ck_assert(val == NULL);
|
ck_assert(val == NULL);
|
||||||
|
@ -242,28 +242,28 @@ EFL_START_TEST(elm_entry_atspi_text_string_get_paragraph)
|
||||||
elm_object_text_set(entry, txt);
|
elm_object_text_set(entry, txt);
|
||||||
|
|
||||||
start = 1;
|
start = 1;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_PARAGRAPH, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_PARAGRAPH, &start, &end, &val);
|
||||||
ck_assert_str_eq(val, "Lorem ipśum");
|
ck_assert_str_eq(val, "Lorem ipśum");
|
||||||
ck_assert(start == 0);
|
ck_assert(start == 0);
|
||||||
ck_assert(end == 11);
|
ck_assert(end == 11);
|
||||||
if (val) free(val);
|
if (val) free(val);
|
||||||
|
|
||||||
start = 20;
|
start = 20;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_PARAGRAPH, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_PARAGRAPH, &start, &end, &val);
|
||||||
ck_assert_str_eq(val, " dolor sit");
|
ck_assert_str_eq(val, " dolor sit");
|
||||||
ck_assert(start == 12);
|
ck_assert(start == 12);
|
||||||
ck_assert(end == 24);
|
ck_assert(end == 24);
|
||||||
if (val) free(val);
|
if (val) free(val);
|
||||||
|
|
||||||
start = 25;
|
start = 25;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_PARAGRAPH, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_PARAGRAPH, &start, &end, &val);
|
||||||
ck_assert_str_eq(val, " amęt");
|
ck_assert_str_eq(val, " amęt");
|
||||||
ck_assert(start == 25);
|
ck_assert(start == 25);
|
||||||
ck_assert(end == 30);
|
ck_assert(end == 30);
|
||||||
if (val) free(val);
|
if (val) free(val);
|
||||||
|
|
||||||
start = 111;
|
start = 111;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_WORD, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_WORD, &start, &end, &val);
|
||||||
ck_assert(start == -1);
|
ck_assert(start == -1);
|
||||||
ck_assert(end == -1);
|
ck_assert(end == -1);
|
||||||
ck_assert(val == NULL);
|
ck_assert(val == NULL);
|
||||||
|
@ -288,7 +288,7 @@ EFL_START_TEST(elm_entry_atspi_text_string_get_line)
|
||||||
elm_object_text_set(entry, txt);
|
elm_object_text_set(entry, txt);
|
||||||
|
|
||||||
start = 1;
|
start = 1;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_LINE, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_LINE, &start, &end, &val);
|
||||||
|
|
||||||
ck_assert_str_eq(val, "Lorem ipśum");
|
ck_assert_str_eq(val, "Lorem ipśum");
|
||||||
ck_assert(start == 0);
|
ck_assert(start == 0);
|
||||||
|
@ -296,7 +296,7 @@ EFL_START_TEST(elm_entry_atspi_text_string_get_line)
|
||||||
if (val) free(val);
|
if (val) free(val);
|
||||||
|
|
||||||
start = 13;
|
start = 13;
|
||||||
val = efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_LINE, &start, &end);
|
efl_access_text_string_get(entry, EFL_ACCESS_TEXT_GRANULARITY_LINE, &start, &end, &val);
|
||||||
ck_assert_str_eq(val, " dolor sit amęt");
|
ck_assert_str_eq(val, " dolor sit amęt");
|
||||||
ck_assert(start == 12);
|
ck_assert(start == 12);
|
||||||
ck_assert(end == 29);
|
ck_assert(end == 29);
|
||||||
|
|
Loading…
Reference in New Issue