forked from enlightenment/efl
elementary: move to use Eina_Future based timeout.
This commit is contained in:
parent
9fac52134c
commit
2e9e751638
|
@ -13,7 +13,7 @@ typedef struct {
|
||||||
Eo *evdown, *evup, *evmove, *evkeydown, *evkeyup;
|
Eo *evdown, *evup, *evmove, *evkeydown, *evkeyup;
|
||||||
Eo *win, *button, *text;
|
Eo *win, *button, *text;
|
||||||
int id;
|
int id;
|
||||||
Efl_Future *f;
|
Eina_Future *f;
|
||||||
} testdata;
|
} testdata;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -68,12 +68,17 @@ _key_down(void *data, const Efl_Event *ev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static Eina_Value
|
||||||
_ecore_timeout_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
_ecore_timeout_cb(void *data,
|
||||||
|
const Eina_Value t,
|
||||||
|
const Eina_Future *dead EINA_UNUSED)
|
||||||
{
|
{
|
||||||
testdata *td = data;
|
testdata *td = data;
|
||||||
|
|
||||||
elm_object_text_set(td->text, DEFAULT_TEXT);
|
elm_object_text_set(td->text, DEFAULT_TEXT);
|
||||||
|
td->f = NULL;
|
||||||
|
|
||||||
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -87,9 +92,9 @@ _key_up(void *data, const Efl_Event *ev)
|
||||||
td->evkeyup = efl_dup(ev->info);
|
td->evkeyup = efl_dup(ev->info);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (td->f) efl_future_cancel(td->f);
|
if (td->f) eina_future_cancel(td->f);
|
||||||
efl_future_use(&td->f, efl_loop_timeout(efl_provider_find(ev->object, EFL_LOOP_CLASS), 0.5, NULL));
|
td->f = efl_loop_Eina_FutureXXX_timeout(efl_provider_find(ev->object, EFL_LOOP_CLASS), 0.5);
|
||||||
efl_future_then(td->f, _ecore_timeout_cb, NULL, NULL, td);
|
eina_future_then(td->f, _ecore_timeout_cb, td);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue