2009-01-31 10:33:39 -08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2012-11-18 22:26:48 -08:00
|
|
|
#include <Eo.h>
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
#include "Ecore.h"
|
2009-12-22 13:15:12 -08:00
|
|
|
#include "ecore_private.h"
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2016-08-15 06:44:41 -07:00
|
|
|
EFL_CALLBACKS_ARRAY_DEFINE(ecore_idle_enterer_callbacks,
|
2016-04-21 15:11:32 -07:00
|
|
|
{ EFL_LOOP_EVENT_IDLE_ENTER, _ecore_factorized_idle_process },
|
2016-08-10 07:23:04 -07:00
|
|
|
{ EFL_EVENT_DEL, _ecore_factorized_idle_event_del });
|
2012-10-10 01:19:58 -07:00
|
|
|
|
|
|
|
|
2006-01-06 09:58:12 -08:00
|
|
|
EAPI Ecore_Idle_Enterer *
|
2011-10-20 22:40:39 -07:00
|
|
|
ecore_idle_enterer_add(Ecore_Task_Cb func,
|
|
|
|
const void *data)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2016-04-21 14:07:16 -07:00
|
|
|
return _ecore_factorized_idle_add(ecore_idle_enterer_callbacks(), func, data);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
2008-01-10 23:33:57 -08:00
|
|
|
EAPI Ecore_Idle_Enterer *
|
2011-10-20 22:40:39 -07:00
|
|
|
ecore_idle_enterer_before_add(Ecore_Task_Cb func,
|
|
|
|
const void *data)
|
2008-01-10 23:33:57 -08:00
|
|
|
{
|
2011-07-28 05:01:16 -07:00
|
|
|
Ecore_Idle_Enterer *ie = NULL;
|
2016-04-21 14:07:16 -07:00
|
|
|
ie = _ecore_factorized_idle_add(ecore_idle_enterer_callbacks(), func, data);
|
2012-10-10 01:19:58 -07:00
|
|
|
|
2016-04-21 14:07:16 -07:00
|
|
|
// This avoid us duplicating code and should only be slightly slower
|
|
|
|
// due to a useless cycle of callback registration
|
2018-02-26 21:10:12 -08:00
|
|
|
efl_event_callback_array_del(_mainloop_singleton, ecore_idle_enterer_callbacks(), ie);
|
|
|
|
efl_event_callback_array_priority_add(_mainloop_singleton, ecore_idle_enterer_callbacks(), EFL_CALLBACK_PRIORITY_BEFORE, ie);
|
2012-10-10 01:19:58 -07:00
|
|
|
|
2016-04-21 14:07:16 -07:00
|
|
|
return ie;
|
2012-10-10 01:19:58 -07:00
|
|
|
}
|
|
|
|
|
2006-01-06 09:58:12 -08:00
|
|
|
EAPI void *
|
2003-09-23 01:09:32 -07:00
|
|
|
ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer)
|
|
|
|
{
|
2016-04-21 14:07:16 -07:00
|
|
|
return _ecore_factorized_idle_del(idle_enterer);
|
2015-05-20 06:56:45 -07:00
|
|
|
}
|