This example shows how to setup and use a poller.
#include <Ecore.h>
#include <unistd.h>
static double _initial_time = 0;
_poller_print_cb(void *data)
{
char *str = data;
printf("Ecore Poller '%s' callback called after %0.3f seconds.\n",
}
{
}
int
main(void)
{
double interval = 0.3;
Ecore_Poller *poller1, *poller2, *poller3;
char *str1 = "poller1";
char *str2 = "poller2";
char *str3 = "poller3";
{
printf("ERROR: Cannot init Ecore!\n");
return -1;
}
printf("changing poller2 interval to 16\n");
}
EAPI int ecore_shutdown(void)
Shuts down connections, signal handlers sockets etc.
Definition: ecore.c:371
EAPI int ecore_init(void)
Sets up connections, signal handlers, sockets etc.
Definition: ecore.c:230
#define ECORE_CALLBACK_RENEW
Return value to keep a callback.
Definition: Ecore_Common.h:153
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:1321
void ecore_main_loop_begin(void)
Runs the application main loop.
Definition: ecore_main.c:1311
void ecore_poller_poll_interval_set(Ecore_Poller_Type type, double poll_time)
Sets the time(in seconds) between ticks for the given poller type.
Definition: ecore_poller.c:215
void * ecore_poller_del(Ecore_Poller *poller)
Deletes the specified poller from the timer list.
Definition: ecore_poller.c:332
Ecore_Poller * ecore_poller_add(Ecore_Poller_Type type, int interval, Ecore_Task_Cb func, const void *data)
Creates a poller to call the given function at a particular tick interval.
Definition: ecore_poller.c:238
Eina_Bool ecore_poller_poller_interval_set(Ecore_Poller *obj, int interval)
Polling interval rate of the poller.
Definition: ecore_poller.c:282
@ ECORE_POLLER_CORE
The core poller interval.
Definition: Ecore_Legacy.h:11
double ecore_time_get(void)
Retrieves the current system time as a floating point value in seconds.
Definition: ecore_time.c:33
#define EINA_TRUE
boolean value TRUE (numerical value 1)
Definition: eina_types.h:539
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