Ecore.h File Reference
The file that provides the program utility, main loop and timer functions. More...
Data Structures | |
struct | _Ecore_Event_Signal_User |
User signal event. More... | |
struct | _Ecore_Event_Signal_Hup |
Hup signal event. More... | |
struct | _Ecore_Event_Signal_Exit |
Exit request event. More... | |
struct | _Ecore_Event_Signal_Power |
Power event. More... | |
struct | _Ecore_Event_Signal_Realtime |
Realtime event. More... | |
struct | _Ecore_Exe_Event_Add |
Process add event. More... | |
struct | _Ecore_Exe_Event_Del |
Process exit event. More... | |
struct | _Ecore_Exe_Event_Data_Line |
< Lines from a child process More... | |
struct | _Ecore_Exe_Event_Data |
Data from a child process event. More... | |
Defines | |
#define | ECORE_CALLBACK_CANCEL 0 |
Return value to remove a callback. | |
#define | ECORE_CALLBACK_RENEW 1 |
Return value to keep a callback. | |
#define | ECORE_EVENT_SIGNAL_USER 1 |
User signal event. | |
#define | ECORE_EVENT_SIGNAL_HUP 2 |
Hup signal event. | |
#define | ECORE_EVENT_SIGNAL_EXIT 3 |
Exit signal event. | |
#define | ECORE_EVENT_SIGNAL_POWER 4 |
Power signal event. | |
#define | ECORE_EVENT_SIGNAL_REALTIME 5 |
Realtime signal event. | |
Typedefs | |
typedef void | Ecore_Exe |
A handle for spawned processes. | |
typedef void | Ecore_Timer |
A handle for timers. | |
typedef void | Ecore_Idler |
A handle for idlers. | |
typedef void | Ecore_Idle_Enterer |
A handle for idle enterers. | |
typedef void | Ecore_Idle_Exiter |
A handle for idle exiters. | |
typedef void | Ecore_Fd_Handler |
A handle for Fd hanlders. | |
typedef void | Ecore_Event_Handler |
A handle for an event handler. | |
typedef void | Ecore_Event_Filter |
A handle for an event filter. | |
typedef void | Ecore_Event |
A handle for an event. | |
typedef void | Ecore_Animator |
A handle for animators. | |
typedef void | Ecore_Pipe |
A handle for pipes. | |
typedef void | Ecore_Poller |
A handle for pollers. | |
typedef struct _Ecore_Event_Signal_User | Ecore_Event_Signal_User |
User signal event. | |
typedef struct _Ecore_Event_Signal_Hup | Ecore_Event_Signal_Hup |
Hup signal event. | |
typedef struct _Ecore_Event_Signal_Exit | Ecore_Event_Signal_Exit |
Exit signal event. | |
typedef struct _Ecore_Event_Signal_Power | Ecore_Event_Signal_Power |
Power signal event. | |
typedef struct _Ecore_Event_Signal_Realtime | Ecore_Event_Signal_Realtime |
Realtime signal event. | |
typedef struct _Ecore_Exe_Event_Add | Ecore_Exe_Event_Add |
Spawned Exe add event. | |
typedef struct _Ecore_Exe_Event_Del | Ecore_Exe_Event_Del |
Spawned Exe exit event. | |
typedef struct _Ecore_Exe_Event_Data_Line | Ecore_Exe_Event_Data_Line |
Lines from a child process. | |
typedef struct _Ecore_Exe_Event_Data | Ecore_Exe_Event_Data |
Data from a child process. | |
Enumerations | |
enum | _Ecore_Fd_Handler_Flags { ECORE_FD_READ = 1, ECORE_FD_WRITE = 2, ECORE_FD_ERROR = 4 } |
enum | _Ecore_Exe_Flags { ECORE_EXE_PIPE_READ = 1, ECORE_EXE_PIPE_WRITE = 2, ECORE_EXE_PIPE_ERROR = 4, ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, ECORE_EXE_PIPE_AUTO = 32, ECORE_EXE_RESPAWN = 64, ECORE_EXE_USE_SH = 128, ECORE_EXE_NOT_LEADER = 256 } |
enum | _Ecore_Poller_Type { ECORE_POLLER_CORE = 0 } |
Functions | |
EAPI int | ecore_init (void) |
Set up connections, signal handlers, sockets etc. | |
EAPI int | ecore_shutdown (void) |
Shut down connections, signal handlers sockets etc. | |
EAPI void | ecore_app_args_set (int argc, const char **argv) |
Set up the programs command-line arguments. | |
EAPI void | ecore_app_args_get (int *argc, char ***argv) |
Return the programs stored command-line arguments. | |
EAPI void | ecore_app_restart (void) |
Restart the program executable with the command-line arguments stored. | |
EAPI Ecore_Event_Handler * | ecore_event_handler_add (int type, int(*func)(void *data, int type, void *event), const void *data) |
Add an event handler. | |
EAPI void * | ecore_event_handler_del (Ecore_Event_Handler *event_handler) |
Delete an event handler. | |
EAPI Ecore_Event * | ecore_event_add (int type, void *ev, void(*func_free)(void *data, void *ev), void *data) |
Add an event to the event queue. | |
EAPI void * | ecore_event_del (Ecore_Event *event) |
Delete an event from the queue. | |
EAPI int | ecore_event_type_new (void) |
Allocate a new event type id sensibly and return the new id. | |
EAPI Ecore_Event_Filter * | ecore_event_filter_add (void *(*func_start)(void *data), int(*func_filter)(void *data, void *loop_data, int type, void *event), void(*func_end)(void *data, void *loop_data), const void *data) |
Add a filter the current event queue. | |
EAPI void * | ecore_event_filter_del (Ecore_Event_Filter *ef) |
Delete an event filter. | |
EAPI int | ecore_event_current_type_get (void) |
Return the current event type being handled. | |
EAPI void * | ecore_event_current_event_get (void) |
Return the current event type pointer handled. | |
EAPI void | ecore_exe_run_priority_set (int pri) |
Sets the priority at which to launch processes. | |
EAPI int | ecore_exe_run_priority_get (void) |
Gets the priority at which to launch processes. | |
EAPI Ecore_Exe * | ecore_exe_run (const char *exe_cmd, const void *data) |
Spawns a child process. | |
EAPI Ecore_Exe * | ecore_exe_pipe_run (const char *exe_cmd, Ecore_Exe_Flags flags, const void *data) |
Spawns a child process with its stdin/out available for communication. | |
EAPI int | ecore_exe_send (Ecore_Exe *exe, void *data, int size) |
Sends data to the given child process which it recieves on stdin. | |
EAPI void | ecore_exe_close_stdin (Ecore_Exe *exe) |
The stdin of the given child process will close when the write buffer is empty. | |
EAPI void | ecore_exe_auto_limits_set (Ecore_Exe *exe, int start_bytes, int end_bytes, int start_lines, int end_lines) |
Sets the auto pipe limits for the given process handle. | |
EAPI Ecore_Exe_Event_Data * | ecore_exe_event_data_get (Ecore_Exe *exe, Ecore_Exe_Flags flags) |
Gets the auto pipe data for the given process handle. | |
EAPI void | ecore_exe_event_data_free (Ecore_Exe_Event_Data *data) |
Frees the given event data. | |
EAPI void * | ecore_exe_free (Ecore_Exe *exe) |
Frees the given process handle. | |
EAPI pid_t | ecore_exe_pid_get (Ecore_Exe *exe) |
Retrieves the process ID of the given spawned process. | |
EAPI void | ecore_exe_tag_set (Ecore_Exe *exe, const char *tag) |
Sets the string tag for the given process handle. | |
EAPI char * | ecore_exe_tag_get (Ecore_Exe *exe) |
Retrieves the tag attached to the given process handle. | |
EAPI char * | ecore_exe_cmd_get (Ecore_Exe *exe) |
Retrieves the command of the given spawned process. | |
EAPI void * | ecore_exe_data_get (Ecore_Exe *exe) |
Retrieves the data attached to the given process handle. | |
EAPI void | ecore_exe_pause (Ecore_Exe *exe) |
Pauses the given process by sending it a SIGSTOP signal. | |
EAPI void | ecore_exe_continue (Ecore_Exe *exe) |
Continues the given paused process by sending it a SIGCONT signal. | |
EAPI void | ecore_exe_interrupt (Ecore_Exe *exe) |
Sends the given spawned process a interrupt (SIGINT ) signal. | |
EAPI void | ecore_exe_quit (Ecore_Exe *exe) |
Sends the given spawned process a quit (SIGQUIT ) signal. | |
EAPI void | ecore_exe_terminate (Ecore_Exe *exe) |
Sends the given spawned process a terminate (SIGTERM ) signal. | |
EAPI void | ecore_exe_kill (Ecore_Exe *exe) |
Kills the given spawned process by sending it a SIGKILL signal. | |
EAPI void | ecore_exe_signal (Ecore_Exe *exe, int num) |
Sends a SIGUSR signal to the given spawned process. | |
EAPI void | ecore_exe_hup (Ecore_Exe *exe) |
Sends a SIGHUP signal to the given spawned process. | |
EAPI Ecore_Idler * | ecore_idler_add (int(*func)(void *data), const void *data) |
Add an idler handler. | |
EAPI void * | ecore_idler_del (Ecore_Idler *idler) |
Delete an idler callback from the list to be executed. | |
EAPI Ecore_Idle_Enterer * | ecore_idle_enterer_add (int(*func)(void *data), const void *data) |
Add an idle enterer handler. | |
EAPI Ecore_Idle_Enterer * | ecore_idle_enterer_before_add (int(*func)(void *data), const void *data) |
Add an idle enterer handler at the start of the list so it gets called earlier than others. | |
EAPI void * | ecore_idle_enterer_del (Ecore_Idle_Enterer *idle_enterer) |
Delete an idle enterer callback. | |
EAPI Ecore_Idle_Exiter * | ecore_idle_exiter_add (int(*func)(void *data), const void *data) |
Add an idle exiter handler. | |
EAPI void * | ecore_idle_exiter_del (Ecore_Idle_Exiter *idle_exiter) |
Delete an idle exiter handler from the list to be run on exiting idle state. | |
EAPI void | ecore_main_loop_iterate (void) |
Runs a single iteration of the main loop to process everything on the queue. | |
EAPI void | ecore_main_loop_select_func_set (int(*func)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)) |
Sets the function to use when monitoring multiple file descriptors, and waiting until one of more of the file descriptors before ready for some class of I/O operation. | |
EAPI void * | ecore_main_loop_select_func_get (void) |
Gets the select function set by ecore_select_func_set(), or the native select function if none was set. | |
EAPI void | ecore_main_loop_begin (void) |
Runs the application main loop. | |
EAPI void | ecore_main_loop_quit (void) |
Quits the main loop once all the events currently on the queue have been processed. | |
EAPI Ecore_Fd_Handler * | ecore_main_fd_handler_add (int fd, Ecore_Fd_Handler_Flags flags, int(*func)(void *data, Ecore_Fd_Handler *fd_handler), const void *data, int(*buf_func)(void *buf_data, Ecore_Fd_Handler *fd_handler), const void *buf_data) |
Adds a callback for activity on the given file descriptor. | |
EAPI void * | ecore_main_fd_handler_del (Ecore_Fd_Handler *fd_handler) |
Deletes the given FD handler. | |
EAPI int | ecore_main_fd_handler_fd_get (Ecore_Fd_Handler *fd_handler) |
Retrieves the file descriptor that the given handler is handling. | |
EAPI int | ecore_main_fd_handler_active_get (Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags) |
Return if read, write or error, or a combination thereof, is active on the file descriptor of the given FD handler. | |
EAPI void | ecore_main_fd_handler_active_set (Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags) |
Set what active streams the given FD handler should be monitoring. | |
EAPI Ecore_Pipe * | ecore_pipe_add (void(*handler)(void *data, void *buffer, unsigned int nbyte), const void *data) |
Create two file descriptors (sockets on Windows). | |
EAPI void * | ecore_pipe_del (Ecore_Pipe *p) |
Free an Ecore_Pipe object created with ecore_pipe_add(). | |
EAPI int | ecore_pipe_write (Ecore_Pipe *p, const void *buffer, unsigned int nbytes) |
Write on the file descriptor the data passed as parameter. | |
EAPI void | ecore_pipe_write_close (Ecore_Pipe *p) |
Close the write end of an Ecore_Pipe object created with ecore_pipe_add(). | |
EAPI void | ecore_pipe_read_close (Ecore_Pipe *p) |
Close the read end of an Ecore_Pipe object created with ecore_pipe_add(). | |
EAPI double | ecore_time_get (void) |
Retrieves the current system time as a floating point value in seconds. | |
EAPI double | ecore_loop_time_get (void) |
Retrieves the time at which the last loop stopped waiting for timeouts or events. | |
EAPI Ecore_Timer * | ecore_timer_add (double in, int(*func)(void *data), const void *data) |
Creates a timer to call the given function in the given period of time. | |
EAPI Ecore_Timer * | ecore_timer_loop_add (double in, int(*func)(void *data), const void *data) |
Creates a timer to call the given function in the given period of time. | |
EAPI void * | ecore_timer_del (Ecore_Timer *timer) |
Delete the specified timer from the timer list. | |
EAPI void | ecore_timer_interval_set (Ecore_Timer *timer, double in) |
Change the interval the timer ticks of. | |
EAPI double | ecore_timer_interval_get (Ecore_Timer *timer) |
Get the interval the timer ticks on. | |
EAPI void | ecore_timer_delay (Ecore_Timer *timer, double add) |
Add some delay for the next occurence of a timer. | |
EAPI double | ecore_timer_pending_get (Ecore_Timer *timer) |
Get the pending time regarding a timer. | |
EAPI double | ecore_timer_precision_get (void) |
Retrieves the current precision used by timer infrastructure. | |
EAPI void | ecore_timer_precision_set (double precision) |
Sets the precision to be used by timer infrastructure. | |
EAPI Ecore_Animator * | ecore_animator_add (int(*func)(void *data), const void *data) |
Add a animator to tick off at every animaton tick during main loop execution. | |
EAPI void * | ecore_animator_del (Ecore_Animator *animator) |
Delete the specified animator from the animator list. | |
EAPI void | ecore_animator_frametime_set (double frametime) |
Set the animator call interval in seconds. | |
EAPI double | ecore_animator_frametime_get (void) |
Get the animator call interval in seconds. | |
EAPI void | ecore_poller_poll_interval_set (Ecore_Poller_Type type, double poll_time) |
Sets the time between ticks (in seconds) for the given ticker clock. | |
EAPI double | ecore_poller_poll_interval_get (Ecore_Poller_Type type) |
Gets the time between ticks (in seconds) for the given ticker clock. | |
EAPI Ecore_Poller * | ecore_poller_add (Ecore_Poller_Type type, int interval, int(*func)(void *data), const void *data) |
Creates a poller to call the given function at a particular tick interval. | |
EAPI void * | ecore_poller_del (Ecore_Poller *poller) |
Delete the specified poller from the timer list. | |
Variables | |
EAPI int | ECORE_EXE_EVENT_ADD |
A child process has been added. | |
EAPI int | ECORE_EXE_EVENT_DEL |
A child process has been deleted (it exited, naming consistant with the rest of ecore). | |
EAPI int | ECORE_EXE_EVENT_DATA |
Data from a child process. | |
EAPI int | ECORE_EXE_EVENT_ERROR |
Errors from a child process. |
Detailed Description
The file that provides the program utility, main loop and timer functions.This header provides the Ecore event handling loop. For more details, see Main Loop Functions.
For the main loop to be of any use, you need to be able to add events and event handlers. Events for file descriptor events are covered in File Event Handling Functions.
Time functions are covered in Ecore Time Functions.
There is also provision for callbacks for when the loop enters or exits an idle state. See Idle Handlers for more information.
Functions are also provided for spawning child processes using fork. See Process Spawning Functions and Spawned Process Signal Functions for more details.
Enumeration Type Documentation
enum _Ecore_Exe_Flags |
- Enumerator:
enum _Ecore_Poller_Type |
Function Documentation
EAPI Ecore_Animator* ecore_animator_add | ( | int(*)(void *data) | func, | |
const void * | data | |||
) |
Add a animator to tick off at every animaton tick during main loop execution.
- Parameters:
-
func The function to call when it ticks off data The data to pass to the function
- Returns:
- A handle to the new animator
func
will be called every N seconds where N is the frametime interval set by ecore_animator_frametime_set(). The function will be passed the data
pointer as its parameter.
When the animator func
is called, it must return a value of either 1 or 0. If it returns 1 (or ECORE_CALLBACK_RENEW), it will be called again at the next tick, or if it returns 0 (or ECORE_CALLBACK_CANCEL) it will be deleted automatically making any references/handles for it invalid.
References ecore_animator_add(), and ecore_timer_add().
Referenced by ecore_animator_add().
EAPI void* ecore_animator_del | ( | Ecore_Animator * | animator | ) |
Delete the specified animator from the animator list.
- Parameters:
-
animator The animator to delete
- Returns:
- The data pointer set for the animator
aqnimator
from the set of animators that are executed during main loop execution. This function returns the data parameter that was being passed to the callback on success, or NULL on failure. After this call returns the specified animator object animator
is invalid and should not be used again. It will not get called again after deletion.
References ecore_animator_del().
Referenced by ecore_animator_del().
EAPI double ecore_animator_frametime_get | ( | void | ) |
Get the animator call interval in seconds.
- Returns:
- The time in second in between animator ticks.
References ecore_animator_frametime_get().
Referenced by ecore_animator_frametime_get().
EAPI void ecore_animator_frametime_set | ( | double | frametime | ) |
Set the animator call interval in seconds.
- Parameters:
-
frametime The time in seconds in between animator ticks.
References ecore_animator_frametime_set(), ecore_timer_add(), and ecore_timer_del().
Referenced by ecore_animator_frametime_set().
EAPI void ecore_app_args_get | ( | int * | argc, | |
char *** | argv | |||
) |
Return the programs stored command-line arguments.
- Parameters:
-
argc A pointer to the return value to hold argc argv A pointer to the return value to hold argv
argc
will be filled, if the pointer is not NULL, and the string array pointer argv
will be filled also if the pointer is not NULL. The values they are filled with will be the same set by ecore_app_args_set().
References ecore_app_args_get().
Referenced by ecore_app_args_get(), ecore_config_args_parse(), ecore_getopt_help(), ecore_getopt_parse(), and ecore_x_window_defaults_set().
EAPI void ecore_app_args_set | ( | int | argc, | |
const char ** | argv | |||
) |
Set up the programs command-line arguments.
- Parameters:
-
argc The same as passed as argc to the programs main() function argv The same as passed as argv to the programs main() function
References ecore_app_args_set().
Referenced by ecore_app_args_set().
EAPI void ecore_app_restart | ( | void | ) |
Restart the program executable with the command-line arguments stored.
This function will restart & re-execute this program in place of itself using the command-line arguments stored by ecore_app_args_set(). This is an easy way for a program to restart itself for cleanup purposes, configuration reasons or in the event of a crash.
References ecore_app_restart().
Referenced by ecore_app_restart().
EAPI Ecore_Event* ecore_event_add | ( | int | type, | |
void * | ev, | |||
void(*)(void *data, void *ev) | func_free, | |||
void * | data | |||
) |
Add an event to the event queue.
- Parameters:
-
type The event type to add to the end of the event queue ev The private data structure for this event type func_free The function to be called to free this private structure data The data pointer to be passed to the free function
- Returns:
- A Handle for that event
type
will be added to the queue for processing by event handlers added by ecore_event_handler_add(). The ev
parameter will be a pointer to the event private data that is specific to that event type. When the event is no longer needed, func_free
will be called and passed the private structure pointer for cleaning up. If func_free
is NULL, free() will be called with the private structure pointer. func_free is passed data
as its data parameter.
References ecore_event_add().
Referenced by ecore_con_server_connect(), ecore_event_add(), ecore_exe_pipe_run(), ecore_imf_context_commit_event_add(), ecore_imf_context_delete_surrounding_event_add(), ecore_imf_context_preedit_changed_event_add(), ecore_imf_context_preedit_end_event_add(), ecore_imf_context_preedit_start_event_add(), and ecore_job_add().
EAPI void* ecore_event_current_event_get | ( | void | ) |
Return the current event type pointer handled.
- Returns:
- The current event pointer being handled if inside a handler callback
This is useful when certain Ecore modules such as Ecore_Evas "swallow" events and not all the original information is passed on. In special cases this extra information may be useful or needed and using this call can let the program access the event data if the type of the event is handled by the program.
References ecore_event_current_event_get().
Referenced by ecore_event_current_event_get().
EAPI int ecore_event_current_type_get | ( | void | ) |
Return the current event type being handled.
- Returns:
- The current event type being handled if inside a handler callback
This is useful when certain Ecore modules such as Ecore_Evas "swallow" events and not all the original information is passed on. In special cases this extra information may be useful or needed and using this call can let the program know if the event type being handled is one it wants to get more information about.
References ecore_event_current_type_get().
Referenced by ecore_event_current_type_get().
EAPI void* ecore_event_del | ( | Ecore_Event * | event | ) |
Delete an event from the queue.
- Parameters:
-
event The event handle to delete
- Returns:
- The data pointer originally set for the event free function
event
from the event queue, and returns the data
parameer originally set when adding it with ecore_event_add(). This does not immediately call the free function, and it may be called later on cleanup, and so if the free function depends on the data pointer to work, you should defer cleaning of this till the free function is called later.
References ecore_event_del().
Referenced by ecore_event_del(), and ecore_job_del().
EAPI Ecore_Event_Filter* ecore_event_filter_add | ( | void *(*)(void *data) | func_start, | |
int(*)(void *data, void *loop_data, int type, void *event) | func_filter, | |||
void(*)(void *data, void *loop_data) | func_end, | |||
const void * | data | |||
) |
Add a filter the current event queue.
- Parameters:
-
func_start Function to call just before filtering and return data func_filter Function to call on each event func_end Function to call after the queu has been filtered data Data to pass to the filter functions
- Returns:
- A filter handle
func_start
is called and passed the data
pointer. This function returns a pointer that is used as loop_data that is now passed to func_filter
as loop_data. func_filter
is also passed data
and the event type and private event structure. If this callback returns 0, the event is removed from the queue. If it returns 1, the event is kept. When processing is finished func_end
is called and is passed the loop_data and data
pointer to clean up.
References ecore_event_filter_add().
Referenced by ecore_event_filter_add(), and ecore_x_init().
EAPI void* ecore_event_filter_del | ( | Ecore_Event_Filter * | ef | ) |
Delete an event filter.
- Parameters:
-
ef The event filter handle
- Returns:
- The data set for the filter
ef
handle. On success this will return the data pointer set when this filter was added. On failure NULL is returned.
References ecore_event_filter_del().
Referenced by ecore_event_filter_del().
EAPI Ecore_Event_Handler* ecore_event_handler_add | ( | int | type, | |
int(*)(void *data, int type, void *event) | func, | |||
const void * | data | |||
) |
Add an event handler.
- Parameters:
-
type The type of the event this handler will get called for func The function to call when the event is found in the queue data A data pointer to pass to the called function func
- Returns:
- A new Event handler, or NULL on failure
type
parameter is the integer of the event type that will trigger this callback to be called. The callback func
is called when this event is processed and will be passed the event type, a pointer to the private event structure that is specific to that event type, and a data pointer that is provided in this call as the data
parameter.
When the callback func
is called, it must return 1 or 0. If it returns 1 (or ECORE_CALLBACK_RENEW), It will keep being called as per normal, for each handler set up for that event type. If it returns 0 (or ECORE_CALLBACK_CANCEL), it will cease processing handlers for that particular event, so all handler set to handle that event type that have not already been called, will not be.
References ecore_event_handler_add().
Referenced by ecore_event_handler_add(), and ecore_ipc_init().
EAPI void* ecore_event_handler_del | ( | Ecore_Event_Handler * | event_handler | ) |
Delete an event handler.
- Parameters:
-
event_handler Event handler handle to delete
- Returns:
- Data passed to handler
data
when the handler was added by ecore_event_handler_add(). On failure NULL will be returned. Once a handler is deleted it will no longer be called.
References ecore_event_handler_del().
Referenced by ecore_event_handler_del(), and ecore_ipc_shutdown().
EAPI int ecore_event_type_new | ( | void | ) |
Allocate a new event type id sensibly and return the new id.
- Returns:
- A new event type id.
References ecore_event_type_new().
Referenced by ecore_con_init(), ecore_con_url_init(), ecore_event_type_new(), ecore_fb_init(), ecore_imf_init(), ecore_ipc_init(), and ecore_x_init().
EAPI int ecore_init | ( | void | ) |
Set up connections, signal handlers, sockets etc.
- Returns:
- 1 or greater on success, 0 otherwise
#include <Ecore.h> int main(int argc, char **argv) { if (!ecore_init()) { printf("ERROR: Cannot init Ecore!\n"); return -1; } ecore_main_loop_begin(); ecore_shutdown(); }
References ecore_time_get().
EAPI Ecore_Poller* ecore_poller_add | ( | Ecore_Poller_Type type | __UNUSED__, | |
int | interval, | |||
int(*)(void *data) | func, | |||
const void * | data | |||
) |
Creates a poller to call the given function at a particular tick interval.
- Parameters:
-
type The ticker type to attach the poller to interval The poll interval func The given function. If func
returns 1, the poller is rescheduled for the next tick interval.data Data to pass to func
when it is called.
- Returns:
- A poller object on success.
NULL
on failure.
The type
parameter defines the poller tick type (there is a virtual clock ticking all the time - though ecore avoids making it tick when there will not be any work to do at that tick point). There is only one ticker at the moment - that is ECORE_POLLER_CORE. This is here for future expansion if multiple clocks with different frequencies are really required. The default time between ticks for the ECORE_POLLER_CORE ticker is 0.125 seconds.
The interval
is the number of ticker ticks that will pass by in between invocations of the func
callback. This must be between 1 and 32768 inclusive, and must be a power of 2 (i.e. 1, 2, 4, 8, 16, ... 16384, 32768). If it is 1, then the function will be called every tick. if it is 2, then it will be called every 2nd tick, if it is 8, then every 8th tick etc. Exactly which tick is undefined, as only the interval between calls can be defined. Ecore will endeavour to keep pollers synchronised and to call as many in 1 wakeup event as possible.
This function adds a poller and returns its handle on success and NULL on failure. The function func
will be called at tick intervals described above. The function will be passed the data
pointer as its parameter.
When the poller func
is called, it must return a value of either 1 (or ECORE_CALLBACK_RENEW) or 0 (or ECORE_CALLBACK_CANCEL). If it returns 1, it will be called again at the next tick, or if it returns 0 it will be deleted automatically making any references/handles for it invalid.
References ecore_poller_add().
Referenced by ecore_poller_add().
EAPI void* ecore_poller_del | ( | Ecore_Poller * | poller | ) |
Delete the specified poller from the timer list.
- Parameters:
-
poller The poller to delete.
- Returns:
- The data pointer set for the timer when ecore_poller_add was called.
NULL
is returned if the function is unsuccessful.
poller
must be a valid handle. If the poller function has already returned 0, the handle is no longer valid (and does not need to be delete).
References ecore_poller_del().
Referenced by ecore_poller_del().
EAPI double ecore_poller_poll_interval_get | ( | Ecore_Poller_Type type | __UNUSED__ | ) |
Gets the time between ticks (in seconds) for the given ticker clock.
- Parameters:
-
type The ticker type to query
- Returns:
- The time in seconds between ticks of the ticker clock
References ecore_poller_poll_interval_get().
Referenced by ecore_poller_poll_interval_get().
EAPI void ecore_poller_poll_interval_set | ( | Ecore_Poller_Type type | __UNUSED__, | |
double | poll_time | |||
) |
Sets the time between ticks (in seconds) for the given ticker clock.
- Parameters:
-
type The ticker type to adjust poll_time The time (in seconds) between ticks of the clock
type
to the time period defined by poll_time
.
References ecore_poller_poll_interval_set().
Referenced by ecore_poller_poll_interval_set().
EAPI int ecore_shutdown | ( | void | ) |
Shut down connections, signal handlers sockets etc.
This function shuts down all things set up in ecore_init() and cleans up all event queues, handlers, filters, timers, idlers, idle enterers/exiters etc. set up after ecore_init() was called.
Do not call this function from any callback that may be called from the main loop, as the main loop will then fall over and not function properly.
EAPI double ecore_timer_precision_get | ( | void | ) |
Retrieves the current precision used by timer infrastructure.
- See also:
- ecore_timer_precision_set()
References ecore_timer_precision_get().
Referenced by ecore_timer_precision_get().
EAPI void ecore_timer_precision_set | ( | double | value | ) |
Sets the precision to be used by timer infrastructure.
When system calculates time to expire the next timer we'll be able to delay the timer by the given amount so more timers will fit in the same dispatch, waking up the system less often and thus being able to save power.
Be aware that kernel may delay delivery even further, these delays are always possible due other tasks having higher priorities or other scheduler policies.
Example: We have 2 timers, one that expires in a 2.0s and another that expires in 2.1s, if precision is 0.1s, then the Ecore will request for the next expire to happen in 2.1s and not 2.0s and another one of 0.1 as it would before.
- Note:
- Ecore is smart enough to see if there are timers in the precision range, if it does not, in our example if no second timer in (T + precision) existed, then it would use the minimum timeout.
- Parameters:
-
value allowed introduced timeout delay, in seconds.
References ecore_timer_precision_set().
Referenced by ecore_timer_precision_set().
Variable Documentation
EAPI int ECORE_EXE_EVENT_DATA |
Data from a child process.
EAPI int ECORE_EXE_EVENT_DEL |
A child process has been deleted (it exited, naming consistant with the rest of ecore).
EAPI int ECORE_EXE_EVENT_ERROR |
Errors from a child process.