Ecore is a library of convenience functions.
The Ecore library provides the following modules:
-@li @link Ecore.h Ecore - Main Loop and Job Functions. @endlink
+@li @ref Ecore_Group
@li @ref Ecore_Con_Group
@li @link Ecore_Evas.h Ecore_Evas - Evas convenience functions. @endlink
@li @ref Ecore_FB_Group
that are used.
*/
-// GROUP DEFINITIONS
-
-/**
-@defgroup Ecore_Timer_Group Ecore Timer
-
-The timer allows callbacks to be called at specific intervals.
- */
-
-/**
-@defgroup Ecore_Job_Group Ecore Jobs
-
-You can queue jobs that are to be done by the main loop when the current
-event is dealt with.
-*/
-
-/**
-@defgroup Idle_Group Idle Handlers
-
-Callbacks that are called when the program enters or exits an idle state.
-
-The ecore main loop enters an idle state when it is waiting for timers
-to time out, data to come in on a file descriptor or any other event
-to occur. You can set callbacks to be called when the main loop
-enters an idle state, during an idle state or just after the program
-wakes up.
-
-Enterer callbacks are good for updating your program's state, if it
-has a state engine. Once all of the enterer handlers are called, the
-program will enter a "sleeping" state.
-
-Idler callbacks are called when the main loop has called all enterer
-handlers. They are useful for interfaces that require polling and
-timers would be too slow to use.
-
-If no idler callbacks are specified, then the process literally goes
-to sleep. Otherwise, the idler callbacks are called continuously
-while the loop is "idle", using as much CPU as is available to the
-process.
-
-Exiter callbacks are called when the main loop wakes up from an idle
-state.
-
-*/
-
-/*
-@defgroup Ecore_Config_Create_Group Ecore Config Create Functions
-
-Convenience functions that set default values, bounds, option values and
-descriptions in one call.
-*/
-
-/**
-@defgroup Ecore_Config_File_Group Ecore Config File Functions
-
-Functions that are used to load and save properties from and to files.
-*/
-
// EXAMPLES
/**
# endif
#endif /* ! _WIN32 */
-/**
- * @file Ecore.h
- * @brief The file that provides the program utility, main loop and timer
- * functions.
- *
- * This header provides the Ecore event handling loop. For more
- * details, see @ref Ecore_Main_Loop_Group.
- *
- * 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
- * @ref Ecore_FD_Handler_Group.
- *
- * Time functions are covered in @ref Ecore_Time_Group.
- *
- * There is also provision for callbacks for when the loop enters or
- * exits an idle state. See @ref Idle_Group for more information.
- *
- * Functions are also provided for spawning child processes using fork.
- * See @ref Ecore_Exe_Basic_Group and @ref Ecore_Exe_Signal_Group for
- * more details.
- */
-
#ifdef _WIN32
# include <winsock2.h>
#elif (defined (__FreeBSD__) && (__FreeBSD_version >= 420001)) || defined (__OpenBSD__)
extern "C" {
#endif
+ /**
+ * @defgroup Ecore_Group Ecore - Main Loop and Job Functions.
+ * @brief The file that provides the program utility, main loop and timer
+ * functions.
+ *
+ * This header provides the Ecore event handling loop. For more
+ * details, see @ref Ecore_Main_Loop_Group.
+ *
+ * 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
+ * @ref Ecore_FD_Handler_Group.
+ *
+ * Time functions are covered in @ref Ecore_Time_Group.
+ *
+ * There is also provision for callbacks for when the loop enters or
+ * exits an idle state. See @ref Idle_Group for more information.
+ *
+ * Functions are also provided for spawning child processes using fork.
+ * See @ref Ecore_Exe_Group for more details.
+ *
+ * @{
+ */
+
#define ECORE_VERSION_MAJOR 1
#define ECORE_VERSION_MINOR 0
typedef void (*Ecore_Thread_Heavy_Cb) (Ecore_Thread *thread, void *data);
/**
* @typedef Ecore_Thread_Notify_Cb Ecore_Thread_Notify_Cb
- * A callback used by the main loop to receive data sent by an @ref Ecore_Thread.
+ * A callback used by the main loop to receive data sent by an @ref Ecore_Thread_Group.
*/
typedef void (*Ecore_Thread_Notify_Cb) (Ecore_Thread *thread, void *msg_data, void *data);
/**
Ecore_Exe_Event_Data_Line *lines; /**< an array of line data if line buffered, the last one has it's line member set to NULL */
};
+ /**
+ * @defgroup Ecore_Init_Group Ecore initialisation and shutdown functions.
+ */
+
EAPI int ecore_init(void);
EAPI int ecore_shutdown(void);
+ /**
+ * @}
+ */
+
+ /**
+ * @defgroup Ecore_Application_Group Ecore Application functions
+ *
+ * @{
+ */
+
EAPI void ecore_app_args_set(int argc, const char **argv);
EAPI void ecore_app_args_get(int *argc, char ***argv);
EAPI void ecore_app_restart(void);
+ /**
+ * @}
+ */
+
+ /**
+ * @defgroup Ecore_Event_Group Ecore Event functions
+ *
+ * @{
+ */
+
EAPI Ecore_Event_Handler *ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, const void *data);
EAPI void *ecore_event_handler_del(Ecore_Event_Handler *event_handler);
EAPI Ecore_Event *ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data);
EAPI int ecore_event_current_type_get(void);
EAPI void *ecore_event_current_event_get(void);
+ /**
+ * @}
+ */
+
+ /**
+ * @defgroup Ecore_Exe_Group Process Spawning Functions
+ *
+ * @{
+ */
EAPI void ecore_exe_run_priority_set(int pri);
EAPI int ecore_exe_run_priority_get(void);
EAPI void ecore_exe_signal(Ecore_Exe *exe, int num);
EAPI void ecore_exe_hup(Ecore_Exe *exe);
+ /**
+ * @}
+ */
+
+ /**
+ * @defgroup Ecore_Idle_Group Ecore Idle functions
+ *
+ * @{
+ */
+
EAPI Ecore_Idler *ecore_idler_add(Ecore_Task_Cb func, const void *data);
EAPI void *ecore_idler_del(Ecore_Idler *idler);
EAPI Ecore_Idle_Exiter *ecore_idle_exiter_add(Ecore_Task_Cb func, const void *data);
EAPI void *ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter);
+ /**
+ * @}
+ */
+
+ /**
+ * @defgroup Ecore_Main Loop_Group Ecore Main Loop functions
+ *
+ * @{
+ */
+
EAPI void ecore_main_loop_iterate(void);
EAPI void ecore_main_loop_select_func_set(Ecore_Select_Function func);
EAPI Ecore_Win32_Handler *ecore_main_win32_handler_add(void *h, Ecore_Fd_Win32_Cb func, const void *data);
EAPI void *ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler);
+ /**
+ * @}
+ */
+
+ /**
+ * @defgroup Ecore_Pipe_Group Pipe wrapper
+ *
+ * @{
+ */
+
EAPI Ecore_Pipe *ecore_pipe_add(Ecore_Pipe_Cb handler, const void *data);
EAPI void *ecore_pipe_del(Ecore_Pipe *p);
EAPI Eina_Bool ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes);
EAPI void ecore_pipe_write_close(Ecore_Pipe *p);
EAPI void ecore_pipe_read_close(Ecore_Pipe *p);
+ /**
+ * @}
+ */
+ /**
+ * @defgroup Ecore_Thread_Group Ecore Thread functions
+ *
+ * @{
+ */
EAPI Ecore_Thread *ecore_thread_run(Ecore_Thread_Heavy_Cb func_blocking,
Ecore_Cb func_end,
EAPI void ecore_thread_max_set(int num);
EAPI void ecore_thread_max_reset(void);
EAPI int ecore_thread_available_get(void);
-
EAPI Eina_Bool ecore_thread_local_data_add(Ecore_Thread *thread, const char *key, void *value, Eina_Free_Cb cb, Eina_Bool direct);
EAPI void *ecore_thread_local_data_set(Ecore_Thread *thread, const char *key, void *value, Eina_Free_Cb cb);
- EAPI void *ecore_thread_local_data_find(Ecore_Thread *thread, const char *key);
+ EAPI void *ecore_thread_local_data_find(Ecore_Thread *thread, const char *key);
EAPI Eina_Bool ecore_thread_local_data_del(Ecore_Thread *thread, const char *key);
EAPI Eina_Bool ecore_thread_global_data_add(const char *key, void *value, Eina_Free_Cb cb, Eina_Bool direct);
EAPI void *ecore_thread_global_data_set(const char *key, void *value, Eina_Free_Cb cb);
- EAPI void *ecore_thread_global_data_find(const char *key);
+ EAPI void *ecore_thread_global_data_find(const char *key);
EAPI Eina_Bool ecore_thread_global_data_del(const char *key);
- EAPI void *ecore_thread_global_data_wait(const char *key, double seconds);
-
+ EAPI void *ecore_thread_global_data_wait(const char *key, double seconds);
+ /**
+ * @}
+ */
+ /**
+ * @defgroup Ecore_Time_Group Ecore Time functions
+ *
+ * @{
+ */
EAPI double ecore_time_get(void);
EAPI double ecore_time_unix_get(void);
EAPI void ecore_timer_thaw(Ecore_Timer *timer);
EAPI void ecore_timer_delay(Ecore_Timer *timer, double add);
EAPI double ecore_timer_pending_get(Ecore_Timer *timer);
-
EAPI double ecore_timer_precision_get(void);
EAPI void ecore_timer_precision_set(double precision);
+ /**
+ * @}
+ */
+
+ /**
+ * @defgroup Ecore_Animator_Group Ecore Animator functions
+ *
+ * @{
+ */
+
EAPI Ecore_Animator *ecore_animator_add(Ecore_Task_Cb func, const void *data);
EAPI void *ecore_animator_del(Ecore_Animator *animator);
EAPI void ecore_animator_freeze(Ecore_Animator *animator);
EAPI void ecore_animator_frametime_set(double frametime);
EAPI double ecore_animator_frametime_get(void);
+ /**
+ * @}
+ */
+
+ /**
+ * @defgroup Ecore_Poller_Group Ecore Poll functions
+ *
+ * @{
+ */
+
EAPI void ecore_poller_poll_interval_set(Ecore_Poller_Type type, double poll_time);
EAPI double ecore_poller_poll_interval_get(Ecore_Poller_Type type);
EAPI Eina_Bool ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval);
EAPI Ecore_Poller *ecore_poller_add(Ecore_Poller_Type type, int interval, Ecore_Task_Cb func, const void *data);
EAPI void *ecore_poller_del(Ecore_Poller *poller);
+ /**
+ * @}
+ */
+
+ /**
+ * @defgroup Ecore_Job_Group Ecore Job functions
+ *
+ * @{
+ */
+
EAPI Ecore_Job *ecore_job_add(Ecore_Cb func, const void *data);
EAPI void *ecore_job_del(Ecore_Job *job);
+ /**
+ * @}
+ */
+
+ /**
+ * @}
+ */
+
#ifdef __cplusplus
}
#endif
#endif
/**
+ * @addtogroup Ecore_Init_Group Ecore initialisation and shutdown functions.
+ *
+ * @{
+ */
+
+/**
* Set up connections, signal handlers, sockets etc.
* @return 1 or greater on success, 0 otherwise
*
return _ecore_init_count;
}
+/**
+ * @}
+ */
+
EAPI void
ecore_print_warning(const char *function, const char *sparam)
{
return ECORE_CALLBACK_RENEW;
}
+
#endif
static double animators_frametime = 1.0 / 30.0;
/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Animator_Group Ecore Animator functions
+ *
+ * @{
+ */
+
+/**
* Add a animator to tick off at every animaton tick during main loop execution.
* @param func The function to call when it ticks off
* @param data The data to pass to the function
* @return A handle to the new animator
- * @ingroup Ecore_Animator_Group
*
* This function adds a animator and returns its handle on success and NULL on
* failure. The function @p func will be called every N seconds where N is the
* Delete the specified animator from the animator list.
* @param animator The animator to delete
* @return The data pointer set for the animator
- * @ingroup Ecore_Animator_Group
*
* Delete the specified @p aqnimator from the set of animators that are executed
* during main loop execution. This function returns the data parameter that
/**
* Suspend the specified animator.
* @param animator The animator to delete
- * @ingroup Ecore_Animator_Group
*
* The specified @p animator will be temporarly removed from the set of animators
* that are executed during main loop execution.
/**
* Restore execution of the specified animator.
* @param animator The animator to delete
- * @ingroup Ecore_Animator_Group
*
* The specified @p animator will be put back in the set of animators
* that are executed during main loop execution.
}
return ECORE_CALLBACK_RENEW;
}
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
static char **app_argv = NULL;
/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Application_Group Ecore Application functions
+ *
+ * @{
+ */
+
+/**
* Set up the programs command-line arguments.
* @param argc The same as passed as argc to the programs main() function
* @param argv The same as passed as argv to the programs main() function
args[i] = NULL;
execvp(app_argv[0], args);
}
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Event_Group Ecore Event functions
+ *
+ * @{
+ */
+
+/**
* Add an event handler.
* @param type The type of the event this handler will get called for
* @param func The function to call when the event is found in the queue
return ecore_raw_event_event;
}
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
void
_ecore_event_shutdown(void)
{
return result;
}
+
+/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
/**
- * @defgroup Ecore_Exe_Basic_Group Process Spawning Functions
+ * @addtogroup Ecore_Exe_Group Process Spawning Functions
+ *
+ * Functions that deal with and send signals to spawned processes.
*
- * Functions that deal with spawned processes.
+ * @{
*/
static int run_pri = ECORE_EXE_PRIORITY_INHERIT;
*
* @param pri value a Ecore_Exe_Win32_Priority value on Windows, -20
* to 19 or ECORE_EXE_PRIORITY_INHERIT on other OS.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI void
ecore_exe_run_priority_set(int pri)
* by this call.
*
* @return the value set by ecore_exe_run_priority_set()
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI int
ecore_exe_run_priority_get(void)
* @param exe_cmd The command to run with @c /bin/sh.
* @param data Data to attach to the returned process handle.
* @return A process handle to the spawned process.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI Ecore_Exe *
ecore_exe_run(const char *exe_cmd, const void *data)
* @param flags The flag parameters for how to deal with inter-process I/O
* @param data Data to attach to the returned process handle.
* @return A process handle to the spawned process.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI Ecore_Exe *
ecore_exe_pipe_run(const char *exe_cmd, Ecore_Exe_Flags flags, const void *data)
* @param data The data to send
* @param size The size of the data to send, in bytes
* @return EINA_TRUE if successful, EINA_FALSE on failure.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI Eina_Bool
ecore_exe_send(Ecore_Exe * exe, const void *data, int size)
* The stdin of the given child process will close when the write buffer is empty.
*
* @param exe The child process
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI void
ecore_exe_close_stdin(Ecore_Exe *exe)
* @param end_bytes limit of bytes at end of output to buffer.
* @param start_lines limit of lines at start of output to buffer.
* @param end_lines limit of lines at end of output to buffer.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI void
ecore_exe_auto_limits_set(Ecore_Exe *exe, int start_bytes, int end_bytes, int start_lines, int end_lines)
*
* @param exe The given process handle.
* @param flags Is this a ECORE_EXE_PIPE_READ or ECORE_EXE_PIPE_ERROR?
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI Ecore_Exe_Event_Data *
ecore_exe_event_data_get(Ecore_Exe *exe, Ecore_Exe_Flags flags)
*
* @param exe The given process handle.
* @param tag The string tag to set on the process handle.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI void
ecore_exe_tag_set(Ecore_Exe *exe, const char *tag)
* @return The string attached to @p exe. It is a handle to existing
* internal string and should not be modified, use
* ecore_exe_tag_set() to change it. It might be @c NULL.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI const char *
ecore_exe_tag_get(const Ecore_Exe *exe)
* @param exe The given process handle.
* @return The data attached to the handle when @ref ecore_exe_run was
* called.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI void *
ecore_exe_free(Ecore_Exe *exe)
* Frees the given event data.
*
* @param e The given event data.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI void
ecore_exe_event_data_free(Ecore_Exe_Event_Data *e)
* Retrieves the process ID of the given spawned process.
* @param exe Handle to the given spawned process.
* @return The process ID on success. @c -1 otherwise.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI pid_t
ecore_exe_pid_get(const Ecore_Exe *exe)
* @return The command on success. NULL otherwise. This string is the
* pointer to the internal value and must not be modified in
* any way.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI const char *
ecore_exe_cmd_get(const Ecore_Exe *exe)
* @param exe The given process handle.
* @return The data pointer attached to @p exe Given to
* ecore_exe_run() or ecore_exe_pipe_run()
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI void *
ecore_exe_data_get(const Ecore_Exe *exe)
* Retrieves the flags attached to the given process handle.
* @param exe The given process handle.
* @return The flags attached to @p exe.
- * @ingroup Ecore_Exe_Basic_Group
*/
EAPI Ecore_Exe_Flags
ecore_exe_flags_get(const Ecore_Exe *exe)
}
/**
- * @defgroup Ecore_Exe_Signal_Group Spawned Process Signal Functions
- *
- * Functions that send signals to spawned processes.
- */
-
-/**
* Pauses the given process by sending it a @c SIGSTOP signal.
* @param exe Process handle to the given process.
- * @ingroup Ecore_Exe_Signal_Group
*/
EAPI void
ecore_exe_pause(Ecore_Exe *exe)
/**
* Continues the given paused process by sending it a @c SIGCONT signal.
* @param exe Process handle to the given process.
- * @ingroup Ecore_Exe_Signal_Group
*/
EAPI void
ecore_exe_continue(Ecore_Exe *exe)
/**
* Sends the given spawned process a interrupt (@c SIGINT) signal.
* @param exe Process handle to the given process.
- * @ingroup Ecore_Exe_Signal_Group
*/
EAPI void
ecore_exe_interrupt(Ecore_Exe *exe)
/**
* Sends the given spawned process a quit (@c SIGQUIT) signal.
* @param exe Process handle to the given process.
- * @ingroup Ecore_Exe_Signal_Group
*/
EAPI void
ecore_exe_quit(Ecore_Exe *exe)
/**
* Sends the given spawned process a terminate (@c SIGTERM) signal.
* @param exe Process handle to the given process.
- * @ingroup Ecore_Exe_Signal_Group
*/
EAPI void
ecore_exe_terminate(Ecore_Exe *exe)
/**
* Kills the given spawned process by sending it a @c SIGKILL signal.
* @param exe Process handle to the given process.
- * @ingroup Ecore_Exe_Signal_Group
*/
EAPI void
ecore_exe_kill(Ecore_Exe *exe)
* @param exe Process handle to the given process.
* @param num The number user signal to send. Must be either 1 or 2, or
* the signal will be ignored.
- * @ingroup Ecore_Exe_Signal_Group
*/
EAPI void
ecore_exe_signal(Ecore_Exe *exe, int num)
/**
* Sends a @c SIGHUP signal to the given spawned process.
* @param exe Process handle to the given process.
- * @ingroup Ecore_Exe_Signal_Group
*/
EAPI void
ecore_exe_hup(Ecore_Exe *exe)
kill(exe->pid, SIGHUP);
}
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
static Ecore_Exe *
_ecore_exe_is_it_alive(pid_t pid)
{
}
/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Main_Loop_Group Ecore Main Loop functions
+ *
+ * @}
+ */
+
+/**
* Request ecore to integrate GLib's main loop.
*
* This will add a small overhead during every main loop interaction
{
_ecore_glib_always_integrate = 0;
}
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
static int idle_enterers_delete_me = 0;
/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Idle_Group Ecore Idle functions
+ *
+ * @{
+ */
+
+/**
* Add an idle enterer handler.
* @param func The function to call when entering an idle state.
* @param data The data to be passed to the @p func call
* @return A handle to the idle enterer callback if successful. Otherwise,
* NULL is returned.
- * @ingroup Idle_Group
*/
EAPI Ecore_Idle_Enterer *
ecore_idle_enterer_add(Ecore_Task_Cb func, const void *data)
* @param data The data to be passed to the @p func call
* @return A handle to the idle enterer callback if successful. Otherwise,
* NULL is returned.
- * @ingroup Idle_Group
*/
EAPI Ecore_Idle_Enterer *
ecore_idle_enterer_before_add(Ecore_Task_Cb func, const void *data)
* @param idle_enterer The idle enterer to delete
* @return The data pointer passed to the idler enterer callback on success.
* NULL otherwise.
- * @ingroup Idle_Group
*/
EAPI void *
ecore_idle_enterer_del(Ecore_Idle_Enterer *idle_enterer)
return idle_enterer->data;
}
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
void
_ecore_idle_enterer_shutdown(void)
{
static int idle_exiters_delete_me = 0;
/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Idle_Group Ecore Idle functions
+ *
+ * @{
+ */
+
+/**
* Add an idle exiter handler.
* @param func The function to call when exiting an idle state.
* @param data The data to be passed to the @p func call
* @return A handle to the idle exiter callback on success. NULL otherwise.
- * @ingroup Idle_Group
*/
EAPI Ecore_Idle_Exiter *
ecore_idle_exiter_add(Ecore_Task_Cb func, const void *data)
* @param idle_exiter The idle exiter to delete
* @return The data pointer that was being being passed to the handler if
* successful. NULL otherwise.
- * @ingroup Idle_Group
*/
EAPI void *
ecore_idle_exiter_del(Ecore_Idle_Exiter *idle_exiter)
return idle_exiter->data;
}
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
void
_ecore_idle_exiter_shutdown(void)
{
static int idlers_delete_me = 0;
/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Idle_Group Ecore Idle functions
+ *
+Callbacks that are called when the program enters or exits an idle state.
+
+The ecore main loop enters an idle state when it is waiting for timers
+to time out, data to come in on a file descriptor or any other event
+to occur. You can set callbacks to be called when the main loop
+enters an idle state, during an idle state or just after the program
+wakes up.
+
+Enterer callbacks are good for updating your program's state, if it
+has a state engine. Once all of the enterer handlers are called, the
+program will enter a "sleeping" state.
+
+Idler callbacks are called when the main loop has called all enterer
+handlers. They are useful for interfaces that require polling and
+timers would be too slow to use.
+
+If no idler callbacks are specified, then the process literally goes
+to sleep. Otherwise, the idler callbacks are called continuously
+while the loop is "idle", using as much CPU as is available to the
+process.
+
+Exiter callbacks are called when the main loop wakes up from an idle
+state.
+ * @{
+ */
+
+/**
* Add an idler handler.
* @param func The function to call when idling.
* @param data The data to be passed to this @p func call.
* @return A idler handle if successfully added. NULL otherwise.
- * @ingroup Idle_Group
*
* Add an idler handle to the event loop, returning a handle on success and
* NULL otherwise. The function @p func will be called repeatedly while
* @param idler The handle of the idler callback to delete
* @return The data pointer passed to the idler callback on success. NULL
* otherwise.
- * @ingroup Idle_Group
*/
EAPI void *
ecore_idler_del(Ecore_Idler *idler)
return idler->data;
}
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
void
_ecore_idler_shutdown(void)
{
}
/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Job_Group Ecore Job functions
+ *
+ * You can queue jobs that are to be done by the main loop when the current
+ * event is dealt with.
+ *
+ * @{
+ */
+
+/**
* Add a job to the event queue.
* @param func The function to call when the job gets handled.
* @param data Data pointer to be passed to the job function when the job is
* handled.
* @return The handle of the job. @c NULL is returned if the job could not be
* added to the queue.
- * @ingroup Ecore_Job_Group
* @note Once the job has been executed, the job handle is invalid.
*/
EAPI Ecore_Job *
* Delete a queued job that has not yet been executed.
* @param job Handle of the job to delete.
* @return The data pointer that was to be passed to the job.
- * @ingroup Ecore_Job_Group
*/
EAPI void *
ecore_job_del(Ecore_Job *job)
return data;
}
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
static Eina_Bool
_ecore_job_event_handler(void *data __UNUSED__, int type __UNUSED__, void *ev)
{
#endif
}
+/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
/**
- * @defgroup Ecore_Main_Loop_Group Main Loop Functions
+ * @addtogroup Ecore_Main_Loop_Group Ecore Main Loop functions
*
* These functions control the Ecore event handling loop. This loop is
* designed to work on embedded systems all the way to large and
*
* For examples of setting up and using a main loop, see
* @ref event_handler_example.c and @ref timer_example.c.
+ *
+ * @{
*/
/**
* Runs a single iteration of the main loop to process everything on the
* queue.
- * @ingroup Ecore_Main_Loop_Group
*/
EAPI void
ecore_main_loop_iterate(void)
*
* This function will not return until @ref ecore_main_loop_quit is called.
*
- * @ingroup Ecore_Main_Loop_Group
*/
EAPI void
ecore_main_loop_begin(void)
/**
* Quits the main loop once all the events currently on the queue have
* been processed.
- * @ingroup Ecore_Main_Loop_Group
*/
EAPI void
ecore_main_loop_quit(void)
*
* @warning you don't know how to use, don't even try to use it.
*
- * @ingroup Ecore_Main_Loop_Group
*/
EAPI void
ecore_main_loop_select_func_set(Ecore_Select_Function func)
* Gets the select function set by ecore_select_func_set(),
* or the native select function if none was set.
*
- * @ingroup Ecore_Main_Loop_Group
*/
EAPI void *
ecore_main_loop_select_func_get(void)
}
}
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
void
_ecore_main_shutdown(void)
{
static Eina_Bool _ecore_pipe_read(void *data, Ecore_Fd_Handler *fd_handler);
/**
- * @defgroup Ecore_Pipe_Group Pipe wrapper
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Pipe_Group Pipe wrapper
*
* These functions wrap the pipe / write / read functions to
* easily integrate a loop that is in its own thread to the ecore
* @param data Data to pass to @p handler when it is called.
* @return A newly created Ecore_Pipe object if successful.
* @c NULL otherwise.
- * @ingroup Ecore_Pipe_Group
*/
EAPI Ecore_Pipe *
ecore_pipe_add(Ecore_Pipe_Cb handler, const void *data)
*
* @param p The Ecore_Pipe object to be freed.
* @return The pointer to the private data
- * @ingroup Ecore_Pipe_Group
*/
EAPI void *
ecore_pipe_del(Ecore_Pipe *p)
* Close the read end of an Ecore_Pipe object created with ecore_pipe_add().
*
* @param p The Ecore_Pipe object.
- * @ingroup Ecore_Pipe_Group
*/
EAPI void
ecore_pipe_read_close(Ecore_Pipe *p)
* Close the write end of an Ecore_Pipe object created with ecore_pipe_add().
*
* @param p The Ecore_Pipe object.
- * @ingroup Ecore_Pipe_Group
*/
EAPI void
ecore_pipe_write_close(Ecore_Pipe *p)
* @param buffer The data to write into the pipe.
* @param nbytes The size of the @p buffer in bytes
* @return Returns EINA_TRUE on a successful write, EINA_FALSE on an error
- * @ingroup Ecore_Pipe_Group
*/
EAPI Eina_Bool
ecore_pipe_write(Ecore_Pipe *p, const void *buffer, unsigned int nbytes)
return EINA_FALSE;
}
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
/* Private function */
static void
_ecore_pipe_unhandle(Ecore_Pipe *p)
}
/**
- * @defgroup Ecore_Poll_Group Ecore Poll Functions
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Poller_Group Ecore Poll functions
*
* These functions are for the need to poll information, but provide a shared
* abstracted API to pool such polling to minimise wakeup and ensure all the
* polling happens in as few spots as possible areound a core poll interval.
* For now only 1 core poller type is supprted: ECORE_POLLER_CORE
+ *
+ * @{
*/
* Sets the time between ticks (in seconds) for the given ticker clock.
* @param type The ticker type to adjust
* @param poll_time The time (in seconds) between ticks of the clock
- * @ingroup Ecore_Poller_Group
*
* This will adjust the time between ticks of the given ticker type defined
* by @p type to the time period defined by @p poll_time.
* Gets the time between ticks (in seconds) for the given ticker clock.
* @param type The ticker type to query
* @return The time in seconds between ticks of the ticker clock
- * @ingroup Ecore_Poller_Group
*
* This will get the time between ticks of the specifider ticker clock.
*/
* rescheduled for the next tick interval.
* @param data Data to pass to @p func when it is called.
* @return A poller object on success. @c NULL on failure.
- * @ingroup Ecore_Poller_Group
*
* This function adds a poller callback that is to be called regularly
* along with all other poller callbacks so the pollers are synchronized with
*
* This allows the changing of a poller's polling interval. It is useful when you want to alter
* a poll rate without deleting and re-creating a poller.
- * @ingroup Ecore_Poller_Group
*/
EAPI Eina_Bool
ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval)
* @return Returns the interval, in ticks, that @p poller polls at
*
* This returns a poller's polling interval, or 0 on error.
- * @ingroup Ecore_Poller_Group
*/
EAPI int
ecore_poller_poller_interval_get(Ecore_Poller *poller)
* @param poller The poller to delete.
* @return The data pointer set for the timer when @ref ecore_poller_add was
* called. @c NULL is returned if the function is unsuccessful.
- * @ingroup Ecore_Poller_Group
*
* Note: @p 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).
return data;
}
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
void
_ecore_poller_shutdown(void)
{
del_handler = NULL;
#endif
}
+
+/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
/**
- * @addtogroup Ecore_Thread Ecore Thread Functions
+ * @addtogroup Ecore_Thread_Group Ecore Thread functions
+ *
* These functions allow for ecore-managed threads which integrate with ecore's main loop.
+ *
* @{
*/
/**
* @}
*/
+
+/**
+ * @}
+ */
double _ecore_time_loop_time = -1.0;
/**
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Time_Group Ecore Time functions
+ *
+ * @{
+ */
+
+/**
* Retrieves the current system time as a floating point value in seconds.
*
* This uses a monotonic clock and thus never goes back in time while
* when the machine was booted, unix time, etc), all it is
* defined is that it never goes backwards (unless you got big critical
* messages when the application started).
- * @ingroup Ecore_Time_Group
*/
EAPI double
ecore_time_get(void)
* @see ecore_loop_time_get().
*
* @return The number of seconds since 12.00AM 1st January 1970.
- * @ingroup Ecore_Time_Group
*/
EAPI double
ecore_time_unix_get(void)
* when the machine was booted, unix time, etc), all it is
* defined is that it never goes backwards (unless you got big critical
* messages when the application started).
- * @ingroup Ecore_Time_Group
*/
EAPI double
ecore_loop_time_get(void)
return _ecore_time_loop_time;
}
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
/********************** Internal methods ********************************/
static double precision = 10.0 / 1000000.0;
/**
- * @defgroup Ecore_Time_Group Ecore Time Functions
+ * @addtogroup Ecore_Group Ecore - Main Loop and Job Functions.
+ *
+ * @{
+ */
+
+/**
+ * @addtogroup Ecore_Time_Group Ecore Time functions
*
* Functions that deal with time. These functions include those that simply
* retrieve it in a given format, and those that create events based on it.
+ *
+ * The timer allows callbacks to be called at specific intervals.
+ *
+ * @{
*/
/**
* rescheduled for the next interval @p in.
* @param data Data to pass to @p func when it is called.
* @return A timer object on success. @c NULL on failure.
- * @ingroup Ecore_Time_Group
*
* This function adds a timer and returns its handle on success and NULL on
* failure. The function @p func will be called every @p in seconds. The
* rescheduled for the next interval @p in.
* @param data Data to pass to @p func when it is called.
* @return A timer object on success. @c NULL on failure.
- * @ingroup Ecore_Time_Group
*
* This is the same as ecore_timer_add(), but "now" is the time from
* ecore_loop_time_get() not ecore_time_get() as ecore_timer_add() uses. See
* @param timer The timer to delete.
* @return The data pointer set for the timer when @ref ecore_timer_add was
* called. @c NULL is returned if the function is unsuccessful.
- * @ingroup Ecore_Time_Group
*
* Note: @p timer must be a valid handle. If the timer function has already
* returned 0, the handle is no longer valid (and does not need to be delete).
*
* @param timer The timer to change.
* @param in The interval in seconds.
- * @ingroup Ecore_Time_Group
*/
EAPI void
ecore_timer_interval_set(Ecore_Timer *timer, double in)
*
* @param timer The timer to retrieve the interval from
* @return The interval on success. -1 on failure.
- * @ingroup Ecore_Time_Group
*/
EAPI double
ecore_timer_interval_get(Ecore_Timer *timer)
*
* @param timer The timer to change.
* @param add The dalay to add to the next iteration.
- * @ingroup Ecore_Time_Group
*/
EAPI void
ecore_timer_delay(Ecore_Timer *timer, double add)
_ecore_timer_set(timer, timer->pending + now, timer->in, timer->func, timer->data);
}
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
void
_ecore_timer_shutdown(void)
{