aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/efl_ui_text.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_ui_text.c258
1 files changed, 0 insertions, 258 deletions
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index fbb882fae0..7440427b1c 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -2565,99 +2565,6 @@ _markup_filter_cb(void *data,
}
}
-/* This function is used to insert text by chunks in jobs */
-static Eina_Bool
-_text_append_idler(void *data)
-{
- int start;
- char backup;
- Evas_Object *obj = (Evas_Object *)data;
-
- EFL_UI_TEXT_DATA_GET(obj, sd);
-
- evas_event_freeze(evas_object_evas_get(obj));
- ELM_SAFE_FREE(sd->text, eina_stringshare_del);
- sd->changed = EINA_TRUE;
-
- start = sd->append_text_position;
- if ((start + EFL_UI_TEXT_CHUNK_SIZE) < sd->append_text_len)
- {
- int pos = start;
- int tag_start, esc_start;
-
- tag_start = esc_start = -1;
- /* Find proper markup cut place */
- while (pos - start < EFL_UI_TEXT_CHUNK_SIZE)
- {
- int prev_pos = pos;
- Eina_Unicode tmp =
- eina_unicode_utf8_next_get(sd->append_text_left, &pos);
-
- if (esc_start == -1)
- {
- if (tmp == '<')
- tag_start = prev_pos;
- else if (tmp == '>')
- tag_start = -1;
- }
- if (tag_start == -1)
- {
- if (tmp == '&')
- esc_start = prev_pos;
- else if (tmp == ';')
- esc_start = -1;
- }
- }
-
- if (tag_start >= 0)
- {
- sd->append_text_position = tag_start;
- }
- else if (esc_start >= 0)
- {
- sd->append_text_position = esc_start;
- }
- else
- {
- sd->append_text_position = pos;
- }
- }
- else
- {
- sd->append_text_position = sd->append_text_len;
- }
-
- backup = sd->append_text_left[sd->append_text_position];
- sd->append_text_left[sd->append_text_position] = '\0';
-
- edje_object_part_text_append
- (sd->entry_edje, "elm.text", sd->append_text_left + start);
-
- sd->append_text_left[sd->append_text_position] = backup;
-
- evas_event_thaw(evas_object_evas_get(obj));
- evas_event_thaw_eval(evas_object_evas_get(obj));
-
- _efl_ui_text_guide_update(obj, EINA_TRUE);
-
- /* If there's still more to go, renew the idler, else, cleanup */
- if (sd->append_text_position < sd->append_text_len)
- {
- return ECORE_CALLBACK_RENEW;
- }
- else
- {
- edje_object_part_text_cursor_pos_set(sd->entry_edje, "elm.text",
- EDJE_CURSOR_MAIN, sd->cursor_pos);
- free(sd->append_text_left);
- sd->append_text_left = NULL;
- sd->append_text_idler = NULL;
- efl_event_callback_legacy_call
- (obj, EFL_UI_TEXT_EVENT_TEXT_SET_DONE, NULL);
- return ECORE_CALLBACK_CANCEL;
- }
-}
-
EOLIAN static void
_efl_ui_text_elm_layout_signal_emit(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, const char *emission, const char *source)
{
@@ -2763,171 +2670,6 @@ _efl_ui_text_content_unset(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, const cha
}
#endif
-static void
-_entry_text_append(Evas_Object* obj, const char* entry, Eina_Bool set)
-{
- int len = 0;
- if (!entry) return;
-
- EFL_UI_TEXT_DATA_GET(obj, sd);
- len = strlen(entry);
-
- if (sd->append_text_left)
- {
- char *tmpbuf;
-
- tmpbuf = realloc(sd->append_text_left, sd->append_text_len + len + 1);
- if (!tmpbuf)
- {
- /* Do something */
- return;
- }
- sd->append_text_left = tmpbuf;
- memcpy(sd->append_text_left + sd->append_text_len, entry, len + 1);
- sd->append_text_len += len;
- }
- else
- {
- if (len > EFL_UI_TEXT_CHUNK_SIZE)
- {
- sd->append_text_left = (char *)malloc(len + 1);
- }
-
- if (sd->append_text_left)
- {
- memcpy(sd->append_text_left, entry, len + 1);
- sd->append_text_position = 0;
- sd->append_text_len = len;
- sd->append_text_idler = ecore_idler_add(_text_append_idler, obj);
- }
- else
- {
- if (set)
- {
- edje_object_part_text_set(sd->entry_edje, "elm.text", entry);
- }
- else
- {
- edje_object_part_text_append(sd->entry_edje, "elm.text", entry);
- }
- edje_object_part_text_cursor_pos_set(sd->entry_edje, "elm.text",
- EDJE_CURSOR_MAIN, sd->cursor_pos);
- efl_event_callback_legacy_call(obj, EFL_UI_TEXT_EVENT_TEXT_SET_DONE, NULL);
- }
- }
-}
-
-EOLIAN static Eina_Bool
-_efl_ui_text_elm_layout_text_set(Eo *obj, Efl_Ui_Text_Data *sd, const char *part, const char *entry)
-{
- int len = 0;
-
- if (!entry) entry = "";
- if (part)
- {
- if (!strcmp(part, "guide"))
- edje_object_part_text_set(sd->entry_edje, "elm.guide", entry);
- else
- edje_object_part_text_set(sd->entry_edje, part, entry);
-
- return EINA_TRUE;
- }
-
- evas_event_freeze(evas_object_evas_get(obj));
- ELM_SAFE_FREE(sd->text, eina_stringshare_del);
- sd->changed = EINA_TRUE;
-
- /* Clear currently pending job if there is one */
- if (sd->append_text_idler)
- {
- ecore_idler_del(sd->append_text_idler);
- ELM_SAFE_FREE(sd->append_text_left, free);
- sd->append_text_idler = NULL;
- }
-
- len = strlen(entry);
- if (sd->append_text_left)
- {
- free(sd->append_text_left);
- sd->append_text_left = NULL;
- }
-
- /* Need to clear the entry first */
- edje_object_part_text_set(sd->entry_edje, "elm.text", "");
- _entry_text_append(obj, entry, EINA_TRUE);
-
- if (len > 0)
- _efl_ui_text_guide_update(obj, EINA_TRUE);
- else
- _efl_ui_text_guide_update(obj, EINA_FALSE);
-
- evas_event_thaw(evas_object_evas_get(obj));
- evas_event_thaw_eval(evas_object_evas_get(obj));
- return EINA_TRUE;
-}
-
-EOLIAN static const char *
-_efl_ui_text_elm_layout_text_get(Eo *obj, Efl_Ui_Text_Data *sd, const char *item)
-{
- const char *text;
- Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
- sd->text_obj = text_obj;
-
- if (item)
- {
- if (!strcmp(item, "default")) goto proceed;
- else if (!strcmp(item, "guide"))
- {
- return edje_object_part_text_get(sd->entry_edje, "elm.guide");
- }
- else
- {
- return edje_object_part_text_get(sd->entry_edje, item);
- }
- }
-
-proceed:
-
- text = efl_text_get(text_obj);
- if (!text)
- {
- ERR("text=NULL for edje %p, part 'elm.text'", sd->entry_edje);
-
- return NULL;
- }
-
- if (sd->append_text_len > 0)
- {
- char *tmpbuf;
- size_t len, tlen;
-
- tlen = strlen(text);
- len = tlen + sd->append_text_len - sd->append_text_position;
- /* FIXME: need that or we do copy uninitialised data */
- tmpbuf = calloc(1, len + 1);
- if (!tmpbuf)
- {
- ERR("Failed to allocate memory for entry's text %p", obj);
- return NULL;
- }
- memcpy(tmpbuf, text, tlen);
-
- if (sd->append_text_left)
- memcpy(tmpbuf + tlen, sd->append_text_left
- + sd->append_text_position, sd->append_text_len
- - sd->append_text_position);
- tmpbuf[len] = '\0';
- eina_stringshare_replace(&sd->text, tmpbuf);
- free(tmpbuf);
- }
- else
- {
- eina_stringshare_replace(&sd->text, text);
- }
-
- return sd->text;
-}
-
static char *
_access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
{