forked from enlightenment/efl
efl.ui.textbox: replace ecore_job with Efl_Future
This patch will replace the use of ecore_job with Efl_Future Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11216
This commit is contained in:
parent
d53f83571a
commit
64232138ef
|
@ -43,7 +43,7 @@ struct _Efl_Ui_Textbox_Data
|
||||||
Eo *cursor_bidi;
|
Eo *cursor_bidi;
|
||||||
Evas_Object *start_handler;
|
Evas_Object *start_handler;
|
||||||
Evas_Object *end_handler;
|
Evas_Object *end_handler;
|
||||||
Ecore_Job *deferred_decoration_job;
|
Eina_Future *deferred_decoration_job;
|
||||||
/* for deferred appending */
|
/* for deferred appending */
|
||||||
int append_text_position;
|
int append_text_position;
|
||||||
int append_text_len;
|
int append_text_len;
|
||||||
|
@ -1735,7 +1735,6 @@ _efl_ui_textbox_efl_object_destructor(Eo *obj, Efl_Ui_Textbox_Data *sd)
|
||||||
|
|
||||||
entries = eina_list_remove(entries, obj);
|
entries = eina_list_remove(entries, obj);
|
||||||
eina_stringshare_del(sd->text);
|
eina_stringshare_del(sd->text);
|
||||||
ecore_job_del(sd->deferred_decoration_job);
|
|
||||||
eina_stringshare_del(sd->anchor_hover.hover_style);
|
eina_stringshare_del(sd->anchor_hover.hover_style);
|
||||||
|
|
||||||
efl_event_thaw(obj);
|
efl_event_thaw(obj);
|
||||||
|
@ -1749,9 +1748,6 @@ _efl_ui_textbox_efl_object_destructor(Eo *obj, Efl_Ui_Textbox_Data *sd)
|
||||||
_anchors_free(sd);
|
_anchors_free(sd);
|
||||||
_clear_text_selection(sd);
|
_clear_text_selection(sd);
|
||||||
|
|
||||||
ecore_job_del(sd->deferred_decoration_job);
|
|
||||||
sd->deferred_decoration_job = NULL;
|
|
||||||
|
|
||||||
if (sd->item_factory) efl_unref(sd->item_factory);
|
if (sd->item_factory) efl_unref(sd->item_factory);
|
||||||
|
|
||||||
efl_destructor(efl_super(obj, MY_CLASS));
|
efl_destructor(efl_super(obj, MY_CLASS));
|
||||||
|
@ -3136,23 +3132,24 @@ _update_decorations(Eo *obj)
|
||||||
efl_event_thaw(sd->text_obj);
|
efl_event_thaw(sd->text_obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static Eina_Value
|
||||||
_deferred_decoration_job(void *data)
|
_deferred_decoration_job(Eo *o, void *data EINA_UNUSED, const Eina_Value value EINA_UNUSED)
|
||||||
{
|
{
|
||||||
EFL_UI_TEXT_DATA_GET(data, sd);
|
EFL_UI_TEXT_DATA_GET(o, sd);
|
||||||
_update_decorations(data);
|
_update_decorations(o);
|
||||||
sd->deferred_decoration_job = NULL;
|
sd->deferred_decoration_job = NULL;
|
||||||
|
|
||||||
|
return EINA_VALUE_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_decoration_defer(Eo *obj)
|
_decoration_defer(Eo *obj)
|
||||||
{
|
{
|
||||||
EFL_UI_TEXT_DATA_GET(obj, sd);
|
EFL_UI_TEXT_DATA_GET(obj, sd);
|
||||||
if (!sd->deferred_decoration_job)
|
if (sd->deferred_decoration_job) return;
|
||||||
{
|
|
||||||
sd->deferred_decoration_job =
|
Eina_Future *f = efl_loop_job(efl_main_loop_get());
|
||||||
ecore_job_add(_deferred_decoration_job, obj);
|
sd->deferred_decoration_job = efl_future_then(obj, f, _deferred_decoration_job);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue