This example shows when Ecore_Idler, Ecore_Idle_Enterer and Ecore_Idle_Exiter are called. See the explanation here.
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Ecore.h>
#include <Eo.h>
#include <unistd.h>
struct context
{
int count;
};
static int _event_type = 0;
{
printf("IDLE ENTERER: Ecore entering in idle state.\n");
}
{
printf("IDLE EXITER: Ecore exiting idle state.\n");
}
_idler_cb(void *data)
{
struct context *ctxt = data;
printf("IDLER: executing idler callback while in idle state.\n");
ctxt->count++;
if ((ctxt->count % 10) == 0)
}
{
struct context *ctxt = data;
printf("EVENT: processing callback for the event received.\n");
if (ctxt->count > 100)
{
ctxt->enterer = NULL;
ctxt->exiter = NULL;
ctxt->idler = NULL;
if (ctxt->timer)
{
ctxt->timer = NULL;
}
}
}
_timer_cb(void *data)
{
struct context *ctxt = data;
printf("TIMER: timer callback called.\n");
if (ctxt->timer)
ctxt->timer = NULL;
}
int
main(void)
{
struct context ctxt = {0};
{
printf("ERROR: Cannot init Ecore!\n");
return -1;
}
_event_handler_cb,
&ctxt);
return 0;
}