#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;
}
 
struct _Ecore_Event_Handler Ecore_Event_Handler
A handle for an event handler.
Definition: Ecore_Common.h:576
int ecore_event_type_new(void)
Allocates a new event type id sensibly and returns the new id.
Definition: ecore_events.c:80
Ecore_Event * ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data)
Adds an event to the event queue.
Definition: ecore_events.c:52
Ecore_Event_Handler * ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, const void *data)
Adds an event handler.
Definition: ecore_events.c:13
Ecore_Idler * ecore_idler_add(Ecore_Task_Cb func, const void *data)
Adds an idler handler.
Definition: ecore_idler.c:109
Ecore_Idle_Enterer * ecore_idle_enterer_add(Ecore_Task_Cb func, const void *data)
Adds an idle enterer handler.
Definition: ecore_idle_enterer.c:18
Ecore_Idle_Exiter * ecore_idle_exiter_add(Ecore_Task_Cb func, const void *data)
Adds an idle exiter handler.
Definition: ecore_idle_exiter.c:17
void * ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer)
Deletes an idle enterer callback.
Definition: ecore_idle_enterer.c:40
void * ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter)
Deletes an idle exiter handler from the list to be run on exiting idle state.
Definition: ecore_idle_exiter.c:24
struct _Ecore_Factorized_Idle Ecore_Idle_Exiter
A handle for idle exiters.
Definition: Ecore_Common.h:3175
struct _Ecore_Factorized_Idle Ecore_Idle_Enterer
A handle for idle enterers.
Definition: Ecore_Common.h:3170
struct _Ecore_Factorized_Idle Ecore_Idler
A handle for idlers.
Definition: Ecore_Common.h:3165
EAPI int ecore_shutdown(void)
Shuts down connections, signal handlers sockets etc.
Definition: ecore.c:366
EAPI int ecore_init(void)
Sets up connections, signal handlers, sockets etc.
Definition: ecore.c:225
#define ECORE_CALLBACK_RENEW
Return value to keep a callback.
Definition: Ecore_Common.h:153
#define ECORE_CALLBACK_DONE
Return value to stop event handling.
Definition: Ecore_Common.h:156
void ecore_main_loop_quit(void)
Quits the main loop once all the events currently on the queue have been processed.
Definition: ecore_main.c:1308
#define ECORE_CALLBACK_CANCEL
Return value to remove a callback.
Definition: Ecore_Common.h:152
void ecore_main_loop_begin(void)
Runs the application main loop.
Definition: ecore_main.c:1298
Ecore_Timer * ecore_timer_add(double in, Ecore_Task_Cb func, const void *data)
Creates a timer to call the given function in the given period of time.
Definition: ecore_timer.c:189
void * ecore_timer_del(Ecore_Timer *timer)
Deletes the specified timer from the timer list.
Definition: ecore_timer.c:238
Eo Ecore_Timer
A handle for timers.
Definition: Ecore_Common.h:3065
unsigned char Eina_Bool
Type to mimic a boolean.
Definition: eina_types.h:527
#define EINA_UNUSED
Used to indicate that a function parameter is purposely unused.
Definition: eina_types.h:339