SVN revision: 52918
This commit is contained in:
Vincent Torri 2010-09-30 06:09:20 +00:00
parent 0aaad2d41e
commit 16263f52cc
19 changed files with 2648 additions and 2648 deletions

View File

@ -107,23 +107,23 @@ extern "C" {
enum _Ecore_Fd_Handler_Flags
{
ECORE_FD_READ = 1, /**< Fd Read mask */
ECORE_FD_WRITE = 2, /**< Fd Write mask */
ECORE_FD_ERROR = 4 /**< Fd Error mask */
ECORE_FD_READ = 1, /**< Fd Read mask */
ECORE_FD_WRITE = 2, /**< Fd Write mask */
ECORE_FD_ERROR = 4 /**< Fd Error mask */
};
typedef enum _Ecore_Fd_Handler_Flags Ecore_Fd_Handler_Flags;
enum _Ecore_Exe_Flags /* flags for executing a child with its stdin and/or stdout piped back */
{
ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */
ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */
ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */
ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a newline and delivered 1 event per line */
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until a newline and delivered 1 event per line */
ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatically */
ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */
ECORE_EXE_USE_SH = 128, /**< Use /bin/sh to run the command. */
ECORE_EXE_NOT_LEADER = 256 /**< Do not use setsid() to have the executed process be its own session leader */
ECORE_EXE_PIPE_READ = 1, /**< Exe Pipe Read mask */
ECORE_EXE_PIPE_WRITE = 2, /**< Exe Pipe Write mask */
ECORE_EXE_PIPE_ERROR = 4, /**< Exe Pipe error mask */
ECORE_EXE_PIPE_READ_LINE_BUFFERED = 8, /**< Reads are buffered until a newline and delivered 1 event per line */
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED = 16, /**< Errors are buffered until a newline and delivered 1 event per line */
ECORE_EXE_PIPE_AUTO = 32, /**< stdout and stderr are buffered automatically */
ECORE_EXE_RESPAWN = 64, /**< FIXME: Exe is restarted if it dies */
ECORE_EXE_USE_SH = 128, /**< Use /bin/sh to run the command. */
ECORE_EXE_NOT_LEADER = 256 /**< Do not use setsid() to have the executed process be its own session leader */
};
typedef enum _Ecore_Exe_Flags Ecore_Exe_Flags;
@ -140,7 +140,7 @@ extern "C" {
enum _Ecore_Poller_Type /* Poller types */
{
ECORE_POLLER_CORE = 0 /**< The core poller interval */
ECORE_POLLER_CORE = 0 /**< The core poller interval */
};
typedef enum _Ecore_Poller_Type Ecore_Poller_Type;
@ -244,85 +244,85 @@ extern "C" {
struct _Ecore_Event_Signal_User /** User signal event */
{
int number; /**< The signal number. Either 1 or 2 */
void *ext_data; /**< Extension data - not used */
int number; /**< The signal number. Either 1 or 2 */
void *ext_data; /**< Extension data - not used */
#ifndef _WIN32
siginfo_t data; /**< Signal info */
siginfo_t data; /**< Signal info */
#endif
};
struct _Ecore_Event_Signal_Hup /** Hup signal event */
{
void *ext_data; /**< Extension data - not used */
void *ext_data; /**< Extension data - not used */
#ifndef _WIN32
siginfo_t data; /**< Signal info */
siginfo_t data; /**< Signal info */
#endif
};
struct _Ecore_Event_Signal_Exit /** Exit request event */
{
unsigned int interrupt : 1; /**< Set if the exit request was an interrupt signal*/
unsigned int quit : 1; /**< set if the exit request was a quit signal */
unsigned int terminate : 1; /**< Set if the exit request was a terminate singal */
void *ext_data; /**< Extension data - not used */
unsigned int interrupt : 1; /**< Set if the exit request was an interrupt signal*/
unsigned int quit : 1; /**< set if the exit request was a quit signal */
unsigned int terminate : 1; /**< Set if the exit request was a terminate singal */
void *ext_data; /**< Extension data - not used */
#ifndef _WIN32
siginfo_t data; /**< Signal info */
siginfo_t data; /**< Signal info */
#endif
};
struct _Ecore_Event_Signal_Power /** Power event */
{
void *ext_data; /**< Extension data - not used */
void *ext_data; /**< Extension data - not used */
#ifndef _WIN32
siginfo_t data; /**< Signal info */
siginfo_t data; /**< Signal info */
#endif
};
struct _Ecore_Event_Signal_Realtime /** Realtime event */
{
int num; /**< The realtime signal's number */
int num; /**< The realtime signal's number */
#ifndef _WIN32
siginfo_t data; /**< Signal info */
siginfo_t data; /**< Signal info */
#endif
};
struct _Ecore_Exe_Event_Add /** Process add event */
{
Ecore_Exe *exe; /**< The handle to the added process */
void *ext_data; /**< Extension data - not used */
Ecore_Exe *exe; /**< The handle to the added process */
void *ext_data; /**< Extension data - not used */
};
struct _Ecore_Exe_Event_Del /** Process exit event */
{
pid_t pid; /**< The process ID of the process that exited */
int exit_code; /**< The exit code of the process */
Ecore_Exe *exe; /**< The handle to the exited process, or NULL if not found */
int exit_signal; /** < The signal that caused the process to exit */
unsigned int exited : 1; /** < set to 1 if the process exited of its own accord */
unsigned int signalled : 1; /** < set to 1 id the process exited due to uncaught signal */
void *ext_data; /**< Extension data - not used */
pid_t pid; /**< The process ID of the process that exited */
int exit_code; /**< The exit code of the process */
Ecore_Exe *exe; /**< The handle to the exited process, or NULL if not found */
int exit_signal; /** < The signal that caused the process to exit */
unsigned int exited : 1; /** < set to 1 if the process exited of its own accord */
unsigned int signalled : 1; /** < set to 1 id the process exited due to uncaught signal */
void *ext_data; /**< Extension data - not used */
#ifndef _WIN32
siginfo_t data; /**< Signal info */
siginfo_t data; /**< Signal info */
#endif
};
struct _Ecore_Exe_Event_Data_Line /**< Lines from a child process */
{
char *line;
int size;
int size;
};
struct _Ecore_Exe_Event_Data /** Data from a child process event */
{
Ecore_Exe *exe; /**< The handle to the process */
void *data; /**< the raw binary data from the child process that was received */
int size; /**< the size of this data in bytes */
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 */
Ecore_Exe *exe; /**< The handle to the process */
void *data; /**< the raw binary data from the child process that was received */
int size; /**< the size of this data in bytes */
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 */
};
EAPI int ecore_init(void);
@ -413,11 +413,11 @@ extern "C" {
Ecore_Cb,
const void *data);
EAPI Ecore_Thread *ecore_thread_feedback_run(Ecore_Thread_Heavy_Cb,
Ecore_Thread_Notify_Cb,
Ecore_Cb,
Ecore_Cb,
const void *data,
Eina_Bool try_no_queue);
Ecore_Thread_Notify_Cb,
Ecore_Cb,
Ecore_Cb,
const void *data,
Eina_Bool try_no_queue);
EAPI Eina_Bool ecore_thread_cancel(Ecore_Thread *thread);
EAPI Eina_Bool ecore_thread_check(Ecore_Thread *thread);
EAPI Eina_Bool ecore_thread_feedback(Ecore_Thread *thread, const void *msg_data);
@ -463,8 +463,8 @@ extern "C" {
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_thaw(Ecore_Animator *animator);
EAPI void ecore_animator_freeze(Ecore_Animator *animator);
EAPI void ecore_animator_thaw(Ecore_Animator *animator);
EAPI void ecore_animator_frametime_set(double frametime);
EAPI double ecore_animator_frametime_get(void);

View File

@ -114,15 +114,15 @@ extern "C" {
Ecore_Getopt_Desc_Arg_Requirement arg_req;
union
{
const char *strv;
unsigned char boolv;
short shortv;
int intv;
long longv;
unsigned short ushortv;
unsigned int uintv;
unsigned long ulongv;
double doublev;
const char *strv;
unsigned char boolv;
short shortv;
int intv;
long longv;
unsigned short ushortv;
unsigned int uintv;
unsigned long ulongv;
double doublev;
} def;
};
@ -144,12 +144,12 @@ extern "C" {
Ecore_Getopt_Action action; /**< define how to handle it */
union
{
const Ecore_Getopt_Desc_Store store;
const void *store_const;
const char *const *choices; /* NULL terminated. */
const Ecore_Getopt_Type append_type;
const Ecore_Getopt_Desc_Callback callback;
const void *dummy;
const Ecore_Getopt_Desc_Store store;
const void *store_const;
const char *const *choices; /* NULL terminated. */
const Ecore_Getopt_Type append_type;
const Ecore_Getopt_Desc_Callback callback;
const void *dummy;
} action_param;
};
@ -166,12 +166,12 @@ extern "C" {
};
#define ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, type, arg_requirement, default_value) \
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_STORE, \
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_STORE, \
{.store = {type, arg_requirement, default_value}}}
#define ECORE_GETOPT_STORE(shortname, longname, help, type) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, NULL, type, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES, {})
ECORE_GETOPT_STORE_FULL(shortname, longname, help, NULL, type, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES, {})
#define ECORE_GETOPT_STORE_STR(shortname, longname, help) \
ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_STR)
@ -194,8 +194,8 @@ extern "C" {
#define ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, type) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, type, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES, {})
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, type, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES, {})
#define ECORE_GETOPT_STORE_METAVAR_STR(shortname, longname, help, metavar) \
ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_STR)
@ -218,155 +218,155 @@ extern "C" {
#define ECORE_GETOPT_STORE_DEF(shortname, longname, help, type, default_value) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, NULL, type, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_OPTIONAL, \
default_value)
ECORE_GETOPT_STORE_FULL(shortname, longname, help, NULL, type, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_OPTIONAL, \
default_value)
#define ECORE_GETOPT_STORE_DEF_STR(shortname, longname, help, default_value) \
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_STR, \
{.strv = default_value})
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_STR, \
{.strv = default_value})
#define ECORE_GETOPT_STORE_DEF_BOOL(shortname, longname, help, default_value) \
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_BOOL, \
{.boolv = default_value})
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_BOOL, \
{.boolv = default_value})
#define ECORE_GETOPT_STORE_DEF_SHORT(shortname, longname, help, default_value) \
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_SHORT, \
{.shortv = default_value})
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_SHORT, \
{.shortv = default_value})
#define ECORE_GETOPT_STORE_DEF_INT(shortname, longname, help, default_value) \
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_INT, \
{.intv = default_value})
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_INT, \
{.intv = default_value})
#define ECORE_GETOPT_STORE_DEF_LONG(shortname, longname, help, default_value) \
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_LONG, \
{.longv = default_value})
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_LONG, \
{.longv = default_value})
#define ECORE_GETOPT_STORE_DEF_USHORT(shortname, longname, help, default_value) \
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_USHORT, \
{.ushortv = default_value})
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_USHORT, \
{.ushortv = default_value})
#define ECORE_GETOPT_STORE_DEF_UINT(shortname, longname, help, default_value) \
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_UINT, \
{.uintv = default_value})
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_UINT, \
{.uintv = default_value})
#define ECORE_GETOPT_STORE_DEF_ULONG(shortname, longname, help, default_value) \
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_ULONG, \
{.ulongv = default_value})
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_ULONG, \
{.ulongv = default_value})
#define ECORE_GETOPT_STORE_DEF_DOUBLE(shortname, longname, help, default_value) \
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_DOUBLE, \
{.doublev = default_value})
ECORE_GETOPT_STORE_DEF(shortname, longname, help, \
ECORE_GETOPT_TYPE_DOUBLE, \
{.doublev = default_value})
#define ECORE_GETOPT_STORE_FULL_STR(shortname, longname, help, metavar, arg_requirement, default_value) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_STR, \
arg_requirement, \
{.strv = default_value})
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_STR, \
arg_requirement, \
{.strv = default_value})
#define ECORE_GETOPT_STORE_FULL_BOOL(shortname, longname, help, metavar, arg_requirement, default_value) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_BOOL, \
arg_requirement, \
{.boolv = default_value})
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_BOOL, \
arg_requirement, \
{.boolv = default_value})
#define ECORE_GETOPT_STORE_FULL_SHORT(shortname, longname, help, metavar, arg_requirement, default_value) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_SHORT, \
arg_requirement, \
{.shortv = default_value})
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_SHORT, \
arg_requirement, \
{.shortv = default_value})
#define ECORE_GETOPT_STORE_FULL_INT(shortname, longname, help, metavar, arg_requirement, default_value) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_INT, \
arg_requirement, \
{.intv = default_value})
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_INT, \
arg_requirement, \
{.intv = default_value})
#define ECORE_GETOPT_STORE_FULL_LONG(shortname, longname, help, metavar, arg_requirement, default_value) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_LONG, \
arg_requirement, \
{.longv = default_value})
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_LONG, \
arg_requirement, \
{.longv = default_value})
#define ECORE_GETOPT_STORE_FULL_USHORT(shortname, longname, help, metavar, arg_requirement, default_value) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_USHORT, \
arg_requirement, \
{.ushortv = default_value})
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_USHORT, \
arg_requirement, \
{.ushortv = default_value})
#define ECORE_GETOPT_STORE_FULL_UINT(shortname, longname, help, metavar, arg_requirement, default_value) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_UINT, \
arg_requirement, \
{.uintv = default_value})
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_UINT, \
arg_requirement, \
{.uintv = default_value})
#define ECORE_GETOPT_STORE_FULL_ULONG(shortname, longname, help, metavar, arg_requirement, default_value) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_ULONG, \
arg_requirement, \
{.ulongv = default_value})
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_ULONG, \
arg_requirement, \
{.ulongv = default_value})
#define ECORE_GETOPT_STORE_FULL_DOUBLE(shortname, longname, help, metavar, arg_requirement, default_value) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_DOUBLE, \
arg_requirement, \
{.doublev = default_value})
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, \
ECORE_GETOPT_TYPE_DOUBLE, \
arg_requirement, \
{.doublev = default_value})
#define ECORE_GETOPT_STORE_CONST(shortname, longname, help, value) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_CONST, \
#define ECORE_GETOPT_STORE_CONST(shortname, longname, help, value) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_CONST, \
{.store_const = value}}
#define ECORE_GETOPT_STORE_TRUE(shortname, longname, help) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_TRUE, \
#define ECORE_GETOPT_STORE_TRUE(shortname, longname, help) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_TRUE, \
{.dummy = NULL}}
#define ECORE_GETOPT_STORE_FALSE(shortname, longname, help) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_FALSE, \
#define ECORE_GETOPT_STORE_FALSE(shortname, longname, help) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_FALSE, \
{.dummy = NULL}}
#define ECORE_GETOPT_CHOICE(shortname, longname, help, choices_array) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_CHOICE, \
#define ECORE_GETOPT_CHOICE(shortname, longname, help, choices_array) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_CHOICE, \
{.choices = choices_array}}
#define ECORE_GETOPT_CHOICE_METAVAR(shortname, longname, help, metavar, choices_array) \
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_CHOICE, \
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_CHOICE, \
{.choices = choices_array}}
#define ECORE_GETOPT_APPEND(shortname, longname, help, sub_type) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_APPEND, \
#define ECORE_GETOPT_APPEND(shortname, longname, help, sub_type) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_APPEND, \
{.append_type = sub_type}}
#define ECORE_GETOPT_APPEND_METAVAR(shortname, longname, help, metavar, type) \
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_APPEND, \
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_APPEND, \
{.append_type = type}}
#define ECORE_GETOPT_COUNT(shortname, longname, help) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_COUNT, \
#define ECORE_GETOPT_COUNT(shortname, longname, help) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_COUNT, \
{.dummy = NULL}}
#define ECORE_GETOPT_CALLBACK_FULL(shortname, longname, help, metavar, callback_func, callback_data, argument_requirement, default_value) \
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_CALLBACK, \
{.callback = {callback_func, callback_data, \
argument_requirement, default_value}}}
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_CALLBACK, \
{.callback = {callback_func, callback_data, \
argument_requirement, default_value}}}
#define ECORE_GETOPT_CALLBACK_NOARGS(shortname, longname, help, callback_func, callback_data) \
ECORE_GETOPT_CALLBACK_FULL(shortname, longname, help, NULL, \
callback_func, callback_data, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO, \
NULL)
ECORE_GETOPT_CALLBACK_FULL(shortname, longname, help, NULL, \
callback_func, callback_data, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO, \
NULL)
#define ECORE_GETOPT_CALLBACK_ARGS(shortname, longname, help, metavar, callback_func, callback_data) \
ECORE_GETOPT_CALLBACK_FULL(shortname, longname, help, metavar, \
callback_func, callback_data, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES, \
NULL)
ECORE_GETOPT_CALLBACK_FULL(shortname, longname, help, metavar, \
callback_func, callback_data, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES, \
NULL)
#define ECORE_GETOPT_HELP(shortname, longname) \
{shortname, longname, "show this message.", NULL, \
ECORE_GETOPT_ACTION_HELP, \
#define ECORE_GETOPT_HELP(shortname, longname) \
{shortname, longname, "show this message.", NULL, \
ECORE_GETOPT_ACTION_HELP, \
{.dummy = NULL}}
#define ECORE_GETOPT_VERSION(shortname, longname) \
{shortname, longname, "show program version.", NULL, \
ECORE_GETOPT_ACTION_VERSION, \
#define ECORE_GETOPT_VERSION(shortname, longname) \
{shortname, longname, "show program version.", NULL, \
ECORE_GETOPT_ACTION_VERSION, \
{.dummy = NULL}}
#define ECORE_GETOPT_COPYRIGHT(shortname, longname) \
{shortname, longname, "show copyright.", NULL, \
ECORE_GETOPT_ACTION_COPYRIGHT, \
#define ECORE_GETOPT_COPYRIGHT(shortname, longname) \
{shortname, longname, "show copyright.", NULL, \
ECORE_GETOPT_ACTION_COPYRIGHT, \
{.dummy = NULL}}
#define ECORE_GETOPT_LICENSE(shortname, longname) \
{shortname, longname, "show license.", NULL, \
ECORE_GETOPT_ACTION_LICENSE, \
#define ECORE_GETOPT_LICENSE(shortname, longname) \
{shortname, longname, "show license.", NULL, \
ECORE_GETOPT_ACTION_LICENSE, \
{.dummy = NULL}}
#define ECORE_GETOPT_SENTINEL {0, NULL, NULL, NULL, 0, {.dummy = NULL}}

View File

@ -38,8 +38,8 @@
static Ecore_Version _version = { VERS_MAJ, VERS_MIN, VERS_MIC, VERS_REV };
EAPI Ecore_Version *ecore_version = &_version;
#define KEEP_MAX(Global, Local) \
if (Global < (Local)) \
#define KEEP_MAX(Global, Local) \
if (Global < (Local)) \
Global = Local;
static Eina_Bool _ecore_memory_statistic(void *data);
@ -95,7 +95,7 @@ ecore_init(void)
/*
if (strcmp(nl_langinfo(CODESET), "UTF-8"))
{
WRN("Not a utf8 locale!");
WRN("Not a utf8 locale!");
}
*/
#ifdef HAVE_EVIL
@ -122,8 +122,8 @@ ecore_init(void)
#if HAVE_MALLINFO
if (getenv("ECORE_MEM_STAT"))
{
_ecore_memory_pid = getpid();
ecore_animator_add(_ecore_memory_statistic, NULL);
_ecore_memory_pid = getpid();
ecore_animator_add(_ecore_memory_statistic, NULL);
}
#endif
@ -177,12 +177,12 @@ ecore_shutdown(void)
#if HAVE_MALLINFO
if (getenv("ECORE_MEM_STAT"))
{
_ecore_memory_statistic(NULL);
_ecore_memory_statistic(NULL);
ERR("[%i] Memory MAX total: %i, free: %i",
_ecore_memory_pid,
_ecore_memory_max_total,
_ecore_memory_max_free);
ERR("[%i] Memory MAX total: %i, free: %i",
_ecore_memory_pid,
_ecore_memory_max_total,
_ecore_memory_max_free);
}
#endif
@ -220,13 +220,13 @@ _ecore_magic_fail(const void *d, Ecore_Magic m, Ecore_Magic req_m, const char *f
ERR(" Input handle has already been freed!");
else if (m != req_m)
ERR(" Input handle is wrong type\n"
" Expected: %08x - %s\n"
" Supplied: %08x - %s",
(unsigned int)req_m, _ecore_magic_string_get(req_m),
(unsigned int)m, _ecore_magic_string_get(m));
" Expected: %08x - %s\n"
" Supplied: %08x - %s",
(unsigned int)req_m, _ecore_magic_string_get(req_m),
(unsigned int)m, _ecore_magic_string_get(m));
ERR("*** NAUGHTY PROGRAMMER!!!\n"
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code. Tut tut tut!");
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code. Tut tut tut!");
if (getenv("ECORE_ERROR_ABORT")) abort();
}
@ -236,37 +236,37 @@ _ecore_magic_string_get(Ecore_Magic m)
switch (m)
{
case ECORE_MAGIC_NONE:
return "None (Freed Object)";
break;
return "None (Freed Object)";
break;
case ECORE_MAGIC_EXE:
return "Ecore_Exe (Executable)";
break;
return "Ecore_Exe (Executable)";
break;
case ECORE_MAGIC_TIMER:
return "Ecore_Timer (Timer)";
break;
return "Ecore_Timer (Timer)";
break;
case ECORE_MAGIC_IDLER:
return "Ecore_Idler (Idler)";
break;
return "Ecore_Idler (Idler)";
break;
case ECORE_MAGIC_IDLE_ENTERER:
return "Ecore_Idle_Enterer (Idler Enterer)";
break;
return "Ecore_Idle_Enterer (Idler Enterer)";
break;
case ECORE_MAGIC_IDLE_EXITER:
return "Ecore_Idle_Exiter (Idler Exiter)";
break;
return "Ecore_Idle_Exiter (Idler Exiter)";
break;
case ECORE_MAGIC_FD_HANDLER:
return "Ecore_Fd_Handler (Fd Handler)";
break;
return "Ecore_Fd_Handler (Fd Handler)";
break;
case ECORE_MAGIC_WIN32_HANDLER:
return "Ecore_Win32_Handler (Win32 Handler)";
break;
return "Ecore_Win32_Handler (Win32 Handler)";
break;
case ECORE_MAGIC_EVENT_HANDLER:
return "Ecore_Event_Handler (Event Handler)";
break;
return "Ecore_Event_Handler (Event Handler)";
break;
case ECORE_MAGIC_EVENT:
return "Ecore_Event (Event)";
break;
return "Ecore_Event (Event)";
break;
default:
return "<UNKNOWN>";
return "<UNKNOWN>";
};
}
@ -298,40 +298,40 @@ _ecore_fps_debug_init(void)
_ecore_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
if (_ecore_fps_debug_fd < 0)
{
unlink(buf);
_ecore_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
unlink(buf);
_ecore_fps_debug_fd = open(buf, O_CREAT | O_TRUNC | O_RDWR, 0644);
}
if (_ecore_fps_debug_fd >= 0)
{
unsigned int zero = 0;
char *buf = (char *)&zero;
ssize_t todo = sizeof(unsigned int);
unsigned int zero = 0;
char *buf = (char *)&zero;
ssize_t todo = sizeof(unsigned int);
while (todo > 0)
{
ssize_t r = write(_ecore_fps_debug_fd, buf, todo);
if (r > 0)
{
todo -= r;
buf += r;
}
else if ((r < 0) && (errno == EINTR))
continue;
else
{
ERR("could not write to file '%s' fd %d: %s",
tmp, _ecore_fps_debug_fd, strerror(errno));
close(_ecore_fps_debug_fd);
_ecore_fps_debug_fd = -1;
return;
}
}
_ecore_fps_runtime_mmap = mmap(NULL, sizeof(unsigned int),
PROT_READ | PROT_WRITE,
MAP_SHARED,
_ecore_fps_debug_fd, 0);
if (_ecore_fps_runtime_mmap == MAP_FAILED)
_ecore_fps_runtime_mmap = NULL;
while (todo > 0)
{
ssize_t r = write(_ecore_fps_debug_fd, buf, todo);
if (r > 0)
{
todo -= r;
buf += r;
}
else if ((r < 0) && (errno == EINTR))
continue;
else
{
ERR("could not write to file '%s' fd %d: %s",
tmp, _ecore_fps_debug_fd, strerror(errno));
close(_ecore_fps_debug_fd);
_ecore_fps_debug_fd = -1;
return;
}
}
_ecore_fps_runtime_mmap = mmap(NULL, sizeof(unsigned int),
PROT_READ | PROT_WRITE,
MAP_SHARED,
_ecore_fps_debug_fd, 0);
if (_ecore_fps_runtime_mmap == MAP_FAILED)
_ecore_fps_runtime_mmap = NULL;
}
}
@ -352,15 +352,15 @@ _ecore_fps_debug_shutdown(void)
tmp = (char *)evil_tmpdir_get ();
#endif /* HAVE_EVIL */
pid = (int)getpid();
snprintf(buf, sizeof(buf), "%s/.ecore_fps_debug-%i", tmp, pid);
unlink(buf);
if (_ecore_fps_runtime_mmap)
{
munmap(_ecore_fps_runtime_mmap, sizeof(int));
_ecore_fps_runtime_mmap = NULL;
}
close(_ecore_fps_debug_fd);
_ecore_fps_debug_fd = -1;
snprintf(buf, sizeof(buf), "%s/.ecore_fps_debug-%i", tmp, pid);
unlink(buf);
if (_ecore_fps_runtime_mmap)
{
munmap(_ecore_fps_runtime_mmap, sizeof(int));
_ecore_fps_runtime_mmap = NULL;
}
close(_ecore_fps_debug_fd);
_ecore_fps_debug_fd = -1;
}
}
@ -370,16 +370,16 @@ _ecore_fps_debug_runtime_add(double t)
if ((_ecore_fps_debug_fd >= 0) &&
(_ecore_fps_runtime_mmap))
{
unsigned int tm;
unsigned int tm;
tm = (unsigned int)(t * 1000000.0);
/* i know its not 100% theoretically guaranteed, but i'd say a write */
/* of an int could be considered atomic for all practical purposes */
/* oh and since this is cumulative, 1 second = 1,000,000 ticks, so */
/* this can run for about 4294 seconds becore looping. if you are */
/* doing performance testing in one run for over an hour... well */
/* time to restart or handle a loop condition :) */
*(_ecore_fps_runtime_mmap) += tm;
tm = (unsigned int)(t * 1000000.0);
/* i know its not 100% theoretically guaranteed, but i'd say a write */
/* of an int could be considered atomic for all practical purposes */
/* oh and since this is cumulative, 1 second = 1,000,000 ticks, so */
/* this can run for about 4294 seconds becore looping. if you are */
/* doing performance testing in one run for over an hour... well */
/* time to restart or handle a loop condition :) */
*(_ecore_fps_runtime_mmap) += tm;
}
}
@ -394,11 +394,11 @@ _ecore_memory_statistic(__UNUSED__ void *data)
mi = mallinfo();
#define HAS_CHANGED(Global, Local) \
if (Global != Local) \
{ \
Global = Local; \
changed = EINA_TRUE; \
#define HAS_CHANGED(Global, Local) \
if (Global != Local) \
{ \
Global = Local; \
changed = EINA_TRUE; \
}
HAS_CHANGED(uordblks, mi.uordblks);
@ -406,9 +406,9 @@ _ecore_memory_statistic(__UNUSED__ void *data)
if (changed)
ERR("[%i] Memory total: %i, free: %i",
_ecore_memory_pid,
mi.uordblks,
mi.fordblks);
_ecore_memory_pid,
mi.uordblks,
mi.fordblks);
KEEP_MAX(_ecore_memory_max_total, mi.uordblks);
KEEP_MAX(_ecore_memory_max_free, mi.fordblks);

View File

@ -18,7 +18,7 @@ struct _Ecore_Animator
void *data;
Eina_Bool delete_me : 1;
Eina_Bool suspended : 1;
Eina_Bool suspended : 1;
};
@ -87,9 +87,9 @@ ecore_animator_del(Ecore_Animator *animator)
{
if (!ECORE_MAGIC_CHECK(animator, ECORE_MAGIC_ANIMATOR))
{
ECORE_MAGIC_FAIL(animator, ECORE_MAGIC_ANIMATOR,
"ecore_animator_del");
return NULL;
ECORE_MAGIC_FAIL(animator, ECORE_MAGIC_ANIMATOR,
"ecore_animator_del");
return NULL;
}
if (animator->delete_me) return animator->data;
animator->delete_me = EINA_TRUE;
@ -111,8 +111,8 @@ ecore_animator_frametime_set(double frametime)
animators_frametime = frametime;
if (timer)
{
ecore_timer_del(timer);
timer = NULL;
ecore_timer_del(timer);
timer = NULL;
}
if (animators)
timer = ecore_timer_add(animators_frametime, _ecore_animator, NULL);
@ -143,9 +143,9 @@ ecore_animator_freeze(Ecore_Animator *animator)
{
if (!ECORE_MAGIC_CHECK(animator, ECORE_MAGIC_ANIMATOR))
{
ECORE_MAGIC_FAIL(animator, ECORE_MAGIC_ANIMATOR,
"ecore_animator_del");
return;
ECORE_MAGIC_FAIL(animator, ECORE_MAGIC_ANIMATOR,
"ecore_animator_del");
return;
}
if (animator->delete_me) return;
animator->suspended = EINA_TRUE;
@ -164,9 +164,9 @@ ecore_animator_thaw(Ecore_Animator *animator)
{
if (!ECORE_MAGIC_CHECK(animator, ECORE_MAGIC_ANIMATOR))
{
ECORE_MAGIC_FAIL(animator, ECORE_MAGIC_ANIMATOR,
"ecore_animator_del");
return;
ECORE_MAGIC_FAIL(animator, ECORE_MAGIC_ANIMATOR,
"ecore_animator_del");
return;
}
if (animator->delete_me) return;
animator->suspended = EINA_FALSE;
@ -177,17 +177,17 @@ _ecore_animator_shutdown(void)
{
if (timer)
{
ecore_timer_del(timer);
timer = NULL;
ecore_timer_del(timer);
timer = NULL;
}
while (animators)
{
Ecore_Animator *animator;
Ecore_Animator *animator;
animator = animators;
animators = (Ecore_Animator *) eina_inlist_remove(EINA_INLIST_GET(animators), EINA_INLIST_GET(animators));
ECORE_MAGIC_SET(animator, ECORE_MAGIC_NONE);
free(animator);
animator = animators;
animators = (Ecore_Animator *) eina_inlist_remove(EINA_INLIST_GET(animators), EINA_INLIST_GET(animators));
ECORE_MAGIC_SET(animator, ECORE_MAGIC_NONE);
free(animator);
}
}
@ -198,36 +198,36 @@ _ecore_animator(void *data __UNUSED__)
EINA_INLIST_FOREACH(animators, animator)
{
if (!animator->delete_me && !animator->suspended)
{
if (!animator->func(animator->data))
{
animator->delete_me = EINA_TRUE;
animators_delete_me++;
}
}
if (!animator->delete_me && !animator->suspended)
{
if (!animator->func(animator->data))
{
animator->delete_me = EINA_TRUE;
animators_delete_me++;
}
}
}
if (animators_delete_me)
{
Ecore_Animator *l;
for(l = animators; l;)
{
animator = l;
l = (Ecore_Animator *) EINA_INLIST_GET(l)->next;
if (animator->delete_me)
{
animators = (Ecore_Animator *) eina_inlist_remove(EINA_INLIST_GET(animators), EINA_INLIST_GET(animator));
ECORE_MAGIC_SET(animator, ECORE_MAGIC_NONE);
free(animator);
animators_delete_me--;
if (animators_delete_me == 0) break;
}
}
Ecore_Animator *l;
for(l = animators; l;)
{
animator = l;
l = (Ecore_Animator *) EINA_INLIST_GET(l)->next;
if (animator->delete_me)
{
animators = (Ecore_Animator *) eina_inlist_remove(EINA_INLIST_GET(animators), EINA_INLIST_GET(animator));
ECORE_MAGIC_SET(animator, ECORE_MAGIC_NONE);
free(animator);
animators_delete_me--;
if (animators_delete_me == 0) break;
}
}
}
if (!animators)
{
timer = NULL;
return ECORE_CALLBACK_CANCEL;
timer = NULL;
return ECORE_CALLBACK_CANCEL;
}
return ECORE_CALLBACK_RENEW;
}

View File

@ -108,26 +108,26 @@ ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, const void *data)
eh->data = (void *)data;
if (type >= (event_handlers_num - 1))
{
int p_alloc_num;
int p_alloc_num;
p_alloc_num = event_handlers_alloc_num;
event_handlers_num = type + 1;
if (event_handlers_num > event_handlers_alloc_num)
{
Ecore_Event_Handler **new_handlers;
int i;
p_alloc_num = event_handlers_alloc_num;
event_handlers_num = type + 1;
if (event_handlers_num > event_handlers_alloc_num)
{
Ecore_Event_Handler **new_handlers;
int i;
event_handlers_alloc_num = ((event_handlers_num + 16) / 16) * 16;
new_handlers = realloc(event_handlers, event_handlers_alloc_num * sizeof(Ecore_Event_Handler *));
if (!new_handlers)
{
free(eh);
return NULL;
}
event_handlers = new_handlers;
for (i = p_alloc_num; i < event_handlers_alloc_num; i++)
event_handlers[i] = NULL;
}
event_handlers_alloc_num = ((event_handlers_num + 16) / 16) * 16;
new_handlers = realloc(event_handlers, event_handlers_alloc_num * sizeof(Ecore_Event_Handler *));
if (!new_handlers)
{
free(eh);
return NULL;
}
event_handlers = new_handlers;
for (i = p_alloc_num; i < event_handlers_alloc_num; i++)
event_handlers[i] = NULL;
}
}
event_handlers[type] = (Ecore_Event_Handler *) eina_inlist_append(EINA_INLIST_GET(event_handlers[type]), EINA_INLIST_GET(eh));
return eh;
@ -148,9 +148,9 @@ ecore_event_handler_del(Ecore_Event_Handler *event_handler)
{
if (!ECORE_MAGIC_CHECK(event_handler, ECORE_MAGIC_EVENT_HANDLER))
{
ECORE_MAGIC_FAIL(event_handler, ECORE_MAGIC_EVENT_HANDLER,
"ecore_event_handler_del");
return NULL;
ECORE_MAGIC_FAIL(event_handler, ECORE_MAGIC_EVENT_HANDLER,
"ecore_event_handler_del");
return NULL;
}
EINA_SAFETY_ON_TRUE_RETURN_VAL(event_handler->delete_me, NULL);
event_handler->delete_me = 1;
@ -208,8 +208,8 @@ ecore_event_del(Ecore_Event *event)
{
if (!ECORE_MAGIC_CHECK(event, ECORE_MAGIC_EVENT))
{
ECORE_MAGIC_FAIL(event, ECORE_MAGIC_EVENT, "ecore_event_del");
return NULL;
ECORE_MAGIC_FAIL(event, ECORE_MAGIC_EVENT, "ecore_event_del");
return NULL;
}
EINA_SAFETY_ON_TRUE_RETURN_VAL(event->delete_me, NULL);
event->delete_me = 1;
@ -284,8 +284,8 @@ ecore_event_filter_del(Ecore_Event_Filter *ef)
{
if (!ECORE_MAGIC_CHECK(ef, ECORE_MAGIC_EVENT_FILTER))
{
ECORE_MAGIC_FAIL(ef, ECORE_MAGIC_EVENT_FILTER, "ecore_event_filter_del");
return NULL;
ECORE_MAGIC_FAIL(ef, ECORE_MAGIC_EVENT_FILTER, "ecore_event_filter_del");
return NULL;
}
EINA_SAFETY_ON_TRUE_RETURN_VAL(ef->delete_me, NULL);
ef->delete_me = 1;
@ -344,12 +344,12 @@ _ecore_event_shutdown(void)
event_current = NULL;
for (i = 0; i < event_handlers_num; i++)
{
while ((eh = event_handlers[i]))
{
event_handlers[i] = (Ecore_Event_Handler *) eina_inlist_remove(EINA_INLIST_GET(event_handlers[i]), EINA_INLIST_GET(event_handlers[i]));
ECORE_MAGIC_SET(eh, ECORE_MAGIC_NONE);
if (!eh->delete_me) free(eh);
}
while ((eh = event_handlers[i]))
{
event_handlers[i] = (Ecore_Event_Handler *) eina_inlist_remove(EINA_INLIST_GET(event_handlers[i]), EINA_INLIST_GET(event_handlers[i]));
ECORE_MAGIC_SET(eh, ECORE_MAGIC_NONE);
if (!eh->delete_me) free(eh);
}
}
EINA_LIST_FREE(event_handlers_delete_list, eh)
free(eh);
@ -359,9 +359,9 @@ _ecore_event_shutdown(void)
event_handlers_alloc_num = 0;
while ((ef = event_filters))
{
event_filters = (Ecore_Event_Filter *) eina_inlist_remove(EINA_INLIST_GET(event_filters), EINA_INLIST_GET(event_filters));
ECORE_MAGIC_SET(ef, ECORE_MAGIC_NONE);
free(ef);
event_filters = (Ecore_Event_Filter *) eina_inlist_remove(EINA_INLIST_GET(event_filters), EINA_INLIST_GET(event_filters));
ECORE_MAGIC_SET(ef, ECORE_MAGIC_NONE);
free(ef);
}
event_filters_delete_me = 0;
event_filter_current = NULL;
@ -424,10 +424,10 @@ _ecore_event_purge_deleted(void)
inpurge++;
while (itr)
{
Ecore_Event *next = (Ecore_Event *)EINA_INLIST_GET(itr)->next;
if ((!itr->references) && (itr->delete_me))
_ecore_event_del(itr);
itr = next;
Ecore_Event *next = (Ecore_Event *)EINA_INLIST_GET(itr)->next;
if ((!itr->references) && (itr->delete_me))
_ecore_event_del(itr);
itr = next;
}
inpurge--;
while (purge_events)
@ -444,82 +444,82 @@ _ecore_event_filters_apply()
if (!event_filter_current)
{
/* regular main loop, start from head */
event_filter_current = event_filters;
/* regular main loop, start from head */
event_filter_current = event_filters;
}
else
{
/* recursive main loop, continue from where we were */
event_filter_current = (Ecore_Event_Filter *)EINA_INLIST_GET(event_filter_current)->next;
/* recursive main loop, continue from where we were */
event_filter_current = (Ecore_Event_Filter *)EINA_INLIST_GET(event_filter_current)->next;
}
while (event_filter_current)
{
Ecore_Event_Filter *ef = event_filter_current;
Ecore_Event_Filter *ef = event_filter_current;
if (!ef->delete_me)
{
ef->references++;
if (!ef->delete_me)
{
ef->references++;
if (ef->func_start)
ef->loop_data = ef->func_start(ef->data);
if (ef->func_start)
ef->loop_data = ef->func_start(ef->data);
if (!event_filter_event_current)
{
/* regular main loop, start from head */
event_filter_event_current = events;
}
else
{
/* recursive main loop, continue from where we were */
event_filter_event_current = (Ecore_Event *)EINA_INLIST_GET(event_filter_event_current)->next;
}
if (!event_filter_event_current)
{
/* regular main loop, start from head */
event_filter_event_current = events;
}
else
{
/* recursive main loop, continue from where we were */
event_filter_event_current = (Ecore_Event *)EINA_INLIST_GET(event_filter_event_current)->next;
}
while (event_filter_event_current)
{
Ecore_Event *e = event_filter_event_current;
while (event_filter_event_current)
{
Ecore_Event *e = event_filter_event_current;
if (!ef->func_filter(ef->data, ef->loop_data,
e->type, e->event))
{
ecore_event_del(e);
}
if (!ef->func_filter(ef->data, ef->loop_data,
e->type, e->event))
{
ecore_event_del(e);
}
if (event_filter_event_current) /* may have changed in recursive main loops */
event_filter_event_current = (Ecore_Event *)EINA_INLIST_GET(event_filter_event_current)->next;
}
if (ef->func_end)
ef->func_end(ef->data, ef->loop_data);
if (event_filter_event_current) /* may have changed in recursive main loops */
event_filter_event_current = (Ecore_Event *)EINA_INLIST_GET(event_filter_event_current)->next;
}
if (ef->func_end)
ef->func_end(ef->data, ef->loop_data);
ef->references--;
}
ef->references--;
}
if (event_filter_current) /* may have changed in recursive main loops */
event_filter_current = (Ecore_Event_Filter *)EINA_INLIST_GET(event_filter_current)->next;
if (event_filter_current) /* may have changed in recursive main loops */
event_filter_current = (Ecore_Event_Filter *)EINA_INLIST_GET(event_filter_current)->next;
}
if (event_filters_delete_me)
{
int deleted_in_use = 0;
Ecore_Event_Filter *l;
for (l = event_filters; l;)
{
Ecore_Event_Filter *ef = l;
l = (Ecore_Event_Filter *) EINA_INLIST_GET(l)->next;
if (ef->delete_me)
{
if (ef->references)
{
deleted_in_use++;
continue;
}
int deleted_in_use = 0;
Ecore_Event_Filter *l;
for (l = event_filters; l;)
{
Ecore_Event_Filter *ef = l;
l = (Ecore_Event_Filter *) EINA_INLIST_GET(l)->next;
if (ef->delete_me)
{
if (ef->references)
{
deleted_in_use++;
continue;
}
event_filters = (Ecore_Event_Filter *) eina_inlist_remove(EINA_INLIST_GET(event_filters), EINA_INLIST_GET(ef));
ECORE_MAGIC_SET(ef, ECORE_MAGIC_NONE);
free(ef);
}
}
if (!deleted_in_use)
event_filters_delete_me = 0;
event_filters = (Ecore_Event_Filter *) eina_inlist_remove(EINA_INLIST_GET(event_filters), EINA_INLIST_GET(ef));
ECORE_MAGIC_SET(ef, ECORE_MAGIC_NONE);
free(ef);
}
}
if (!deleted_in_use)
event_filters_delete_me = 0;
}
}
void
@ -532,71 +532,71 @@ _ecore_event_call(void)
if (!event_current)
{
/* regular main loop, start from head */
event_current = events;
event_handler_current = NULL;
/* regular main loop, start from head */
event_current = events;
event_handler_current = NULL;
}
while (event_current)
{
Ecore_Event *e = event_current;
int handle_count = 0;
Ecore_Event *e = event_current;
int handle_count = 0;
if (e->delete_me)
{
event_current = (Ecore_Event *)EINA_INLIST_GET(event_current)->next;
continue;
}
if (e->delete_me)
{
event_current = (Ecore_Event *)EINA_INLIST_GET(event_current)->next;
continue;
}
ecore_raw_event_type = e->type;
ecore_raw_event_event = e->event;
e->references++;
if ((e->type >= 0) && (e->type < event_handlers_num))
{
if (!event_handler_current)
{
/* regular main loop, start from head */
event_handler_current = event_handlers[e->type];
}
else
{
/* recursive main loop, continue from where we were */
event_handler_current = (Ecore_Event_Handler *)EINA_INLIST_GET(event_handler_current)->next;
}
ecore_raw_event_type = e->type;
ecore_raw_event_event = e->event;
e->references++;
if ((e->type >= 0) && (e->type < event_handlers_num))
{
if (!event_handler_current)
{
/* regular main loop, start from head */
event_handler_current = event_handlers[e->type];
}
else
{
/* recursive main loop, continue from where we were */
event_handler_current = (Ecore_Event_Handler *)EINA_INLIST_GET(event_handler_current)->next;
}
while ((event_handler_current) && (!e->delete_me))
{
Ecore_Event_Handler *eh = event_handler_current;
if (!eh->delete_me)
{
Eina_Bool ret;
while ((event_handler_current) && (!e->delete_me))
{
Ecore_Event_Handler *eh = event_handler_current;
if (!eh->delete_me)
{
Eina_Bool ret;
handle_count++;
handle_count++;
eh->references++;
ret = eh->func(eh->data, e->type, e->event);
eh->references--;
eh->references++;
ret = eh->func(eh->data, e->type, e->event);
eh->references--;
if (!ret)
{
event_handler_current = NULL;
break; /* 0 == "call no further handlers" */
}
}
if (!ret)
{
event_handler_current = NULL;
break; /* 0 == "call no further handlers" */
}
}
if (event_handler_current) /* may have changed in recursive main loops */
event_handler_current = (Ecore_Event_Handler *)EINA_INLIST_GET(event_handler_current)->next;
}
}
/* if no handlers were set for EXIT signal - then default is */
/* to quit the main loop */
if ((e->type == ECORE_EVENT_SIGNAL_EXIT) && (handle_count == 0))
ecore_main_loop_quit();
e->references--;
e->delete_me = 1;
if (event_handler_current) /* may have changed in recursive main loops */
event_handler_current = (Ecore_Event_Handler *)EINA_INLIST_GET(event_handler_current)->next;
}
}
/* if no handlers were set for EXIT signal - then default is */
/* to quit the main loop */
if ((e->type == ECORE_EVENT_SIGNAL_EXIT) && (handle_count == 0))
ecore_main_loop_quit();
e->references--;
e->delete_me = 1;
if (event_current) /* may have changed in recursive main loops */
event_current = (Ecore_Event *)EINA_INLIST_GET(event_current)->next;
if (event_current) /* may have changed in recursive main loops */
event_current = (Ecore_Event *)EINA_INLIST_GET(event_current)->next;
}
ecore_raw_event_type = ECORE_EVENT_NONE;
@ -606,13 +606,13 @@ _ecore_event_call(void)
EINA_LIST_FOREACH_SAFE(event_handlers_delete_list, l, l_next, eh)
{
if (eh->references) continue;
if (eh->references) continue;
event_handlers_delete_list = eina_list_remove_list(event_handlers_delete_list, l);
event_handlers_delete_list = eina_list_remove_list(event_handlers_delete_list, l);
event_handlers[eh->type] = (Ecore_Event_Handler *) eina_inlist_remove(EINA_INLIST_GET(event_handlers[eh->type]), EINA_INLIST_GET(eh));
ECORE_MAGIC_SET(eh, ECORE_MAGIC_NONE);
free(eh);
event_handlers[eh->type] = (Ecore_Event_Handler *) eina_inlist_remove(EINA_INLIST_GET(event_handlers[eh->type]), EINA_INLIST_GET(eh));
ECORE_MAGIC_SET(eh, ECORE_MAGIC_NONE);
free(eh);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff