lib/ecore/ecore_poll.eo.c \
lib/ecore/ecore_poll.eo.h \
lib/ecore/ecore_job.eo.c \
- lib/ecore/ecore_job.eo.h
-
+ lib/ecore/ecore_job.eo.h \
+ lib/ecore/ecore_idler.eo.c \
+ lib/ecore/ecore_idler.eo.h
+
ecoreeolianfilesdir = $(datadir)/eolian/include/ecore-@VMAJ@
ecoreeolianfiles_DATA = \
lib/ecore/ecore_timer.eo \
lib/ecore/ecore_poll.eo \
- lib/ecore/ecore_job.eo
+ lib/ecore/ecore_job.eo \
+ lib/ecore/ecore_idler.eo
EXTRA_DIST += \
${ecoreeolianfiles_DATA}
nodist_installed_ecoremainheaders_DATA = \
lib/ecore/ecore_timer.eo.h \
lib/ecore/ecore_poll.eo.h \
- lib/ecore/ecore_job.eo.h
+ lib/ecore/ecore_job.eo.h \
+ lib/ecore/ecore_idler.eo.h
lib_ecore_libecore_la_SOURCES = \
lib/ecore/ecore.c \
#define MY_CLASS_NAME "Ecore_Idler"
-EAPI Eo_Op ECORE_IDLER_BASE_ID = EO_NOOP;
-
-struct _Ecore_Idler_Private_Data
+struct _Ecore_Idler_Data
{
EINA_INLIST;
Ecore_Idler *obj;
Eina_Bool delete_me : 1;
};
-typedef struct _Ecore_Idler_Private_Data Ecore_Idler_Private_Data;
-static Ecore_Idler_Private_Data *idlers = NULL;
-static Ecore_Idler_Private_Data *idler_current = NULL;
+typedef struct _Ecore_Idler_Data Ecore_Idler_Data;
+static Ecore_Idler_Data *idlers = NULL;
+static Ecore_Idler_Data *idler_current = NULL;
static int idlers_delete_me = 0;
static void *
return ie;
}
-static void
-_idler_constructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+EOLIAN static void
+_ecore_idler_constructor(Eo *obj, Ecore_Idler_Data *ie, Ecore_Task_Cb func, const void *data)
{
- Ecore_Task_Cb func = va_arg(*list, Ecore_Task_Cb);
- const void *data = va_arg(*list, const void *);
-
if (EINA_UNLIKELY(!eina_main_loop_is()))
{
eo_error_set(obj);
EINA_MAIN_LOOP_CHECK_RETURN;
}
- Ecore_Idler_Private_Data *ie = _pd;
-
ie->obj = obj;
eo_do_super(obj, MY_CLASS, eo_constructor());
eo_manual_free_set(obj, EINA_TRUE);
ie->func = func;
ie->data = (void *)data;
- idlers = (Ecore_Idler_Private_Data *)eina_inlist_append(EINA_INLIST_GET(idlers), EINA_INLIST_GET(ie));
+ idlers = (Ecore_Idler_Data *)eina_inlist_append(EINA_INLIST_GET(idlers), EINA_INLIST_GET(ie));
}
-
-static void
-_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
+EOLIAN static void
+_ecore_idler_eo_base_constructor(Eo *obj, Ecore_Idler_Data *_pd EINA_UNUSED)
{
eo_error_set(obj);
ERR("only custom constructor can be used with '%s' class", MY_CLASS_NAME);
static void *
_ecore_idler_del(Ecore_Idler *obj)
{
- Ecore_Idler_Private_Data *idler = eo_data_scope_get(obj, MY_CLASS);
+ Ecore_Idler_Data *idler = eo_data_scope_get(obj, MY_CLASS);
EINA_SAFETY_ON_TRUE_RETURN_VAL(idler->delete_me, NULL);
idler->delete_me = 1;
idlers_delete_me = 1;
return idler->data;
}
-static void
-_destructor(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+EOLIAN static void
+_ecore_idler_eo_base_destructor(Eo *obj, Ecore_Idler_Data *idler)
{
- Ecore_Idler_Private_Data *idler = _pd;
-
idler->delete_me = 1;
idlers_delete_me = 1;
void
_ecore_idler_shutdown(void)
{
- Ecore_Idler_Private_Data *ie;
+ Ecore_Idler_Data *ie;
while ((ie = idlers))
{
- idlers = (Ecore_Idler_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(idlers), EINA_INLIST_GET(idlers));
+ idlers = (Ecore_Idler_Data *)eina_inlist_remove(EINA_INLIST_GET(idlers), EINA_INLIST_GET(idlers));
eo_do(ie->obj, eo_parent_set(NULL));
if (eo_destructed_is(ie->obj))
else
{
/* recursive main loop, continue from where we were */
- idler_current = (Ecore_Idler_Private_Data *)EINA_INLIST_GET(idler_current)->next;
+ idler_current = (Ecore_Idler_Data *)EINA_INLIST_GET(idler_current)->next;
}
while (idler_current)
{
- Ecore_Idler_Private_Data *ie = (Ecore_Idler_Private_Data *)idler_current;
+ Ecore_Idler_Data *ie = (Ecore_Idler_Data *)idler_current;
if (!ie->delete_me)
{
ie->references++;
ie->references--;
}
if (idler_current) /* may have changed in recursive main loops */
- idler_current = (Ecore_Idler_Private_Data *)EINA_INLIST_GET(idler_current)->next;
+ idler_current = (Ecore_Idler_Data *)EINA_INLIST_GET(idler_current)->next;
}
if (idlers_delete_me)
{
- Ecore_Idler_Private_Data *l;
+ Ecore_Idler_Data *l;
int deleted_idlers_in_use = 0;
for (l = idlers; l; )
{
- Ecore_Idler_Private_Data *ie = l;
- l = (Ecore_Idler_Private_Data *)EINA_INLIST_GET(l)->next;
+ Ecore_Idler_Data *ie = l;
+ l = (Ecore_Idler_Data *)EINA_INLIST_GET(l)->next;
if (ie->delete_me)
{
if (ie->references)
continue;
}
- idlers = (Ecore_Idler_Private_Data *)eina_inlist_remove(EINA_INLIST_GET(idlers), EINA_INLIST_GET(ie));
+ idlers = (Ecore_Idler_Data *)eina_inlist_remove(EINA_INLIST_GET(idlers), EINA_INLIST_GET(ie));
eo_do(ie->obj, eo_parent_set(NULL));
if (eo_destructed_is(ie->obj))
return 0;
}
-static void
-_class_constructor(Eo_Class *klass)
-{
- const Eo_Op_Func_Description func_desc[] = {
- EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_CONSTRUCTOR), _constructor),
- EO_OP_FUNC(EO_BASE_ID(EO_BASE_SUB_ID_DESTRUCTOR), _destructor),
-
- EO_OP_FUNC(ECORE_IDLER_ID(ECORE_IDLER_SUB_ID_CONSTRUCTOR), _idler_constructor),
- EO_OP_FUNC_SENTINEL
- };
-
- eo_class_funcs_set(klass, func_desc);
-}
-
-static const Eo_Op_Description op_desc[] = {
- EO_OP_DESCRIPTION(ECORE_IDLER_SUB_ID_CONSTRUCTOR, "Add an idler handler."),
- EO_OP_DESCRIPTION_SENTINEL
-};
-
-static const Eo_Class_Description class_desc = {
- EO_VERSION,
- MY_CLASS_NAME,
- EO_CLASS_TYPE_REGULAR,
- EO_CLASS_DESCRIPTION_OPS(&ECORE_IDLER_BASE_ID, op_desc, ECORE_IDLER_SUB_ID_LAST),
- NULL,
- sizeof(Ecore_Idler_Private_Data),
- _class_constructor,
- NULL
-};
-
-EO_DEFINE_CLASS(ecore_idler_class_get, &class_desc, EO_BASE_CLASS, NULL)
+#include "ecore_idler.eo.c"
\ No newline at end of file