ran ecrustify on ecore. some manual fixing too.

SVN revision: 64238
This commit is contained in:
Carsten Haitzler 2011-10-21 05:40:39 +00:00
parent 8893a9ff35
commit 58cbf16625
24 changed files with 5756 additions and 4978 deletions

File diff suppressed because it is too large Load Diff

View File

@ -48,153 +48,155 @@
* use multiple values with the same parser.
*/
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
ECORE_GETOPT_ACTION_STORE,
ECORE_GETOPT_ACTION_STORE_CONST,
ECORE_GETOPT_ACTION_STORE_TRUE,
ECORE_GETOPT_ACTION_STORE_FALSE,
ECORE_GETOPT_ACTION_CHOICE,
ECORE_GETOPT_ACTION_APPEND,
ECORE_GETOPT_ACTION_COUNT,
ECORE_GETOPT_ACTION_CALLBACK,
ECORE_GETOPT_ACTION_HELP,
ECORE_GETOPT_ACTION_VERSION,
ECORE_GETOPT_ACTION_COPYRIGHT,
ECORE_GETOPT_ACTION_LICENSE
} Ecore_Getopt_Action;
typedef enum {
ECORE_GETOPT_ACTION_STORE,
ECORE_GETOPT_ACTION_STORE_CONST,
ECORE_GETOPT_ACTION_STORE_TRUE,
ECORE_GETOPT_ACTION_STORE_FALSE,
ECORE_GETOPT_ACTION_CHOICE,
ECORE_GETOPT_ACTION_APPEND,
ECORE_GETOPT_ACTION_COUNT,
ECORE_GETOPT_ACTION_CALLBACK,
ECORE_GETOPT_ACTION_HELP,
ECORE_GETOPT_ACTION_VERSION,
ECORE_GETOPT_ACTION_COPYRIGHT,
ECORE_GETOPT_ACTION_LICENSE
} Ecore_Getopt_Action;
typedef enum {
ECORE_GETOPT_TYPE_STR,
ECORE_GETOPT_TYPE_BOOL,
ECORE_GETOPT_TYPE_SHORT,
ECORE_GETOPT_TYPE_INT,
ECORE_GETOPT_TYPE_LONG,
ECORE_GETOPT_TYPE_USHORT,
ECORE_GETOPT_TYPE_UINT,
ECORE_GETOPT_TYPE_ULONG,
ECORE_GETOPT_TYPE_DOUBLE
} Ecore_Getopt_Type;
typedef enum {
ECORE_GETOPT_TYPE_STR,
ECORE_GETOPT_TYPE_BOOL,
ECORE_GETOPT_TYPE_SHORT,
ECORE_GETOPT_TYPE_INT,
ECORE_GETOPT_TYPE_LONG,
ECORE_GETOPT_TYPE_USHORT,
ECORE_GETOPT_TYPE_UINT,
ECORE_GETOPT_TYPE_ULONG,
ECORE_GETOPT_TYPE_DOUBLE
} Ecore_Getopt_Type;
typedef enum {
ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO = 0,
ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES = 1,
ECORE_GETOPT_DESC_ARG_REQUIREMENT_OPTIONAL = 3
} Ecore_Getopt_Desc_Arg_Requirement;
typedef enum {
ECORE_GETOPT_DESC_ARG_REQUIREMENT_NO = 0,
ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES = 1,
ECORE_GETOPT_DESC_ARG_REQUIREMENT_OPTIONAL = 3
} Ecore_Getopt_Desc_Arg_Requirement;
typedef union _Ecore_Getopt_Value Ecore_Getopt_Value;
typedef union _Ecore_Getopt_Value Ecore_Getopt_Value;
typedef struct _Ecore_Getopt_Desc_Store Ecore_Getopt_Desc_Store;
typedef struct _Ecore_Getopt_Desc_Callback Ecore_Getopt_Desc_Callback;
typedef struct _Ecore_Getopt_Desc Ecore_Getopt_Desc;
typedef struct _Ecore_Getopt Ecore_Getopt;
typedef struct _Ecore_Getopt_Desc_Store Ecore_Getopt_Desc_Store;
typedef struct _Ecore_Getopt_Desc_Callback Ecore_Getopt_Desc_Callback;
typedef struct _Ecore_Getopt_Desc Ecore_Getopt_Desc;
typedef struct _Ecore_Getopt Ecore_Getopt;
union _Ecore_Getopt_Value
{
char **strp;
unsigned char *boolp;
short *shortp;
int *intp;
long *longp;
unsigned short *ushortp;
unsigned int *uintp;
unsigned long *ulongp;
double *doublep;
Eina_List **listp;
void **ptrp;
};
union _Ecore_Getopt_Value
{
char **strp;
unsigned char *boolp;
short *shortp;
int *intp;
long *longp;
unsigned short *ushortp;
unsigned int *uintp;
unsigned long *ulongp;
double *doublep;
Eina_List **listp;
void **ptrp;
};
struct _Ecore_Getopt_Desc_Store
{
Ecore_Getopt_Type type; /**< type of data being handled */
Ecore_Getopt_Desc_Arg_Requirement arg_req;
union
{
const char *strv;
Eina_Bool boolv;
short shortv;
int intv;
long longv;
unsigned short ushortv;
unsigned int uintv;
unsigned long ulongv;
double doublev;
} def;
};
struct _Ecore_Getopt_Desc_Store
{
Ecore_Getopt_Type type; /**< type of data being handled */
Ecore_Getopt_Desc_Arg_Requirement arg_req;
union
{
const char *strv;
Eina_Bool boolv;
short shortv;
int intv;
long longv;
unsigned short ushortv;
unsigned int uintv;
unsigned long ulongv;
double doublev;
} def;
};
struct _Ecore_Getopt_Desc_Callback
{
Eina_Bool (*func)(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage);
const void *data;
Ecore_Getopt_Desc_Arg_Requirement arg_req;
const char *def;
};
struct _Ecore_Getopt_Desc_Callback
{
Eina_Bool (*func)(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc,
const char *str,
void *data,
Ecore_Getopt_Value *storage);
const void *data;
Ecore_Getopt_Desc_Arg_Requirement arg_req;
const char *def;
};
struct _Ecore_Getopt_Desc
{
char shortname; /**< used with a single dash */
const char *longname; /**< used with double dashes */
const char *help; /**< used by --help/ecore_getopt_help() */
const char *metavar; /**< used by ecore_getopt_help() with nargs > 0 */
struct _Ecore_Getopt_Desc
{
char shortname; /**< used with a single dash */
const char *longname; /**< used with double dashes */
const char *help; /**< used by --help/ecore_getopt_help() */
const char *metavar; /**< used by ecore_getopt_help() with nargs > 0 */
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;
} action_param;
};
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;
} action_param;
};
struct _Ecore_Getopt
{
const char *prog; /**< to be used when ecore_app_args_get() fails */
const char *usage; /**< usage example, %prog is replaced */
const char *version; /**< if exists, --version will work */
const char *copyright; /**< if exists, --copyright will work */
const char *license; /**< if exists, --license will work */
const char *description; /**< long description, possible multiline */
Eina_Bool strict : 1; /**< fail on errors */
const Ecore_Getopt_Desc descs[]; /* NULL terminated. */
};
struct _Ecore_Getopt
{
const char *prog; /**< to be used when ecore_app_args_get() fails */
const char *usage; /**< usage example, %prog is replaced */
const char *version; /**< if exists, --version will work */
const char *copyright; /**< if exists, --copyright will work */
const char *license; /**< if exists, --license will work */
const char *description; /**< long description, possible multiline */
Eina_Bool strict : 1; /**< fail on errors */
const Ecore_Getopt_Desc descs[]; /* NULL terminated. */
};
#define ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, type, arg_requirement, default_value) \
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_STORE, \
{.store = {type, arg_requirement, default_value}}}
{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, \
#define ECORE_GETOPT_STORE(shortname, longname, help, type) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, NULL, type, \
ECORE_GETOPT_DESC_ARG_REQUIREMENT_YES, {})
#define ECORE_GETOPT_STORE_STR(shortname, longname, help) \
#define ECORE_GETOPT_STORE_STR(shortname, longname, help) \
ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_STR)
#define ECORE_GETOPT_STORE_BOOL(shortname, longname, help) \
#define ECORE_GETOPT_STORE_BOOL(shortname, longname, help) \
ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_BOOL)
#define ECORE_GETOPT_STORE_SHORT(shortname, longname, help) \
#define ECORE_GETOPT_STORE_SHORT(shortname, longname, help) \
ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_SHORT)
#define ECORE_GETOPT_STORE_INT(shortname, longname, help) \
#define ECORE_GETOPT_STORE_INT(shortname, longname, help) \
ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_INT)
#define ECORE_GETOPT_STORE_LONG(shortname, longname, help) \
#define ECORE_GETOPT_STORE_LONG(shortname, longname, help) \
ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_LONG)
#define ECORE_GETOPT_STORE_USHORT(shortname, longname, help) \
#define ECORE_GETOPT_STORE_USHORT(shortname, longname, help) \
ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_USHORT)
#define ECORE_GETOPT_STORE_UINT(shortname, longname, help) \
#define ECORE_GETOPT_STORE_UINT(shortname, longname, help) \
ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_UINT)
#define ECORE_GETOPT_STORE_ULONG(shortname, longname, help) \
#define ECORE_GETOPT_STORE_ULONG(shortname, longname, help) \
ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_ULONG)
#define ECORE_GETOPT_STORE_DOUBLE(shortname, longname, help) \
#define ECORE_GETOPT_STORE_DOUBLE(shortname, longname, help) \
ECORE_GETOPT_STORE(shortname, longname, help, ECORE_GETOPT_TYPE_DOUBLE)
#define ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, type) \
ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, type, \
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) \
@ -216,7 +218,6 @@ extern "C" {
#define ECORE_GETOPT_STORE_METAVAR_DOUBLE(shortname, longname, help, metavar) \
ECORE_GETOPT_STORE_METAVAR(shortname, longname, help, metavar, ECORE_GETOPT_TYPE_DOUBLE)
#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, \
@ -262,7 +263,7 @@ extern "C" {
#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, \
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, \
@ -307,37 +308,36 @@ extern "C" {
#define ECORE_GETOPT_STORE_CONST(shortname, longname, help, value) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_CONST, \
{.store_const = value}}
{.store_const = value}}
#define ECORE_GETOPT_STORE_TRUE(shortname, longname, help) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_TRUE, \
{.dummy = NULL}}
{.dummy = NULL}}
#define ECORE_GETOPT_STORE_FALSE(shortname, longname, help) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_STORE_FALSE, \
{.dummy = NULL}}
{.dummy = NULL}}
#define ECORE_GETOPT_CHOICE(shortname, longname, help, choices_array) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_CHOICE, \
{.choices = choices_array}}
{.choices = choices_array}}
#define ECORE_GETOPT_CHOICE_METAVAR(shortname, longname, help, metavar, choices_array) \
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_CHOICE, \
{.choices = choices_array}}
{.choices = choices_array}}
#define ECORE_GETOPT_APPEND(shortname, longname, help, sub_type) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_APPEND, \
{.append_type = sub_type}}
{.append_type = sub_type}}
#define ECORE_GETOPT_APPEND_METAVAR(shortname, longname, help, metavar, type) \
{shortname, longname, help, metavar, ECORE_GETOPT_ACTION_APPEND, \
{.append_type = type}}
{.append_type = type}}
#define ECORE_GETOPT_COUNT(shortname, longname, help) \
{shortname, longname, help, NULL, ECORE_GETOPT_ACTION_COUNT, \
{.dummy = NULL}}
{.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}}}
{.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, \
@ -351,23 +351,23 @@ extern "C" {
#define ECORE_GETOPT_HELP(shortname, longname) \
{shortname, longname, "show this message.", NULL, \
ECORE_GETOPT_ACTION_HELP, \
{.dummy = NULL}}
ECORE_GETOPT_ACTION_HELP, \
{.dummy = NULL}}
#define ECORE_GETOPT_VERSION(shortname, longname) \
{shortname, longname, "show program version.", NULL, \
ECORE_GETOPT_ACTION_VERSION, \
{.dummy = NULL}}
ECORE_GETOPT_ACTION_VERSION, \
{.dummy = NULL}}
#define ECORE_GETOPT_COPYRIGHT(shortname, longname) \
{shortname, longname, "show copyright.", NULL, \
ECORE_GETOPT_ACTION_COPYRIGHT, \
{.dummy = NULL}}
ECORE_GETOPT_ACTION_COPYRIGHT, \
{.dummy = NULL}}
#define ECORE_GETOPT_LICENSE(shortname, longname) \
{shortname, longname, "show license.", NULL, \
ECORE_GETOPT_ACTION_LICENSE, \
{.dummy = NULL}}
ECORE_GETOPT_ACTION_LICENSE, \
{.dummy = NULL}}
#define ECORE_GETOPT_SENTINEL {0, NULL, NULL, NULL, 0, {.dummy = NULL}}
@ -383,19 +383,35 @@ extern "C" {
#define ECORE_GETOPT_VALUE_PTR(val) {.ptrp = &(val)}
#define ECORE_GETOPT_VALUE_PTR_CAST(val) {.ptrp = (void **)&(val)}
#define ECORE_GETOPT_VALUE_LIST(val) {.listp = &(val)}
#define ECORE_GETOPT_VALUE_NONE {.ptrp = NULL}
#define ECORE_GETOPT_VALUE_NONE {.ptrp = NULL}
EAPI void ecore_getopt_help(FILE *fp, const Ecore_Getopt *info);
EAPI void
ecore_getopt_help(FILE *fp,
const Ecore_Getopt *info);
EAPI Eina_Bool ecore_getopt_parser_has_duplicates(const Ecore_Getopt *parser);
EAPI int ecore_getopt_parse(const Ecore_Getopt *parser, Ecore_Getopt_Value *values, int argc, char **argv);
EAPI Eina_Bool
ecore_getopt_parser_has_duplicates(const Ecore_Getopt *parser);
EAPI int
ecore_getopt_parse(const Ecore_Getopt *parser,
Ecore_Getopt_Value *values,
int argc,
char **argv);
EAPI Eina_List *ecore_getopt_list_free(Eina_List *list);
/* helper functions to be used with ECORE_GETOPT_CALLBACK_*() */
EAPI Eina_Bool ecore_getopt_callback_geometry_parse(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage);
EAPI Eina_Bool ecore_getopt_callback_size_parse(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage);
EAPI Eina_List *ecore_getopt_list_free(Eina_List *list);
/* helper functions to be used with ECORE_GETOPT_CALLBACK_*() */
EAPI Eina_Bool
ecore_getopt_callback_geometry_parse(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc,
const char *str,
void *data,
Ecore_Getopt_Value *storage);
EAPI Eina_Bool
ecore_getopt_callback_size_parse(const Ecore_Getopt *parser,
const Ecore_Getopt_Desc *desc,
const char *str,
void *data,
Ecore_Getopt_Value *storage);
#ifdef __cplusplus
}

View File

@ -38,9 +38,9 @@
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)) \
Global = Local;
#define KEEP_MAX(Global, Local) \
if (Global < (Local)) \
Global = Local;
static Eina_Bool _ecore_memory_statistic(void *data);
static int _ecore_memory_max_total = 0;
@ -57,23 +57,25 @@ typedef struct _Ecore_Safe_Call Ecore_Safe_Call;
struct _Ecore_Safe_Call
{
union {
Ecore_Cb async;
Ecore_Cb async;
Ecore_Data_Cb sync;
} cb;
void *data;
void *data;
Eina_Lock m;
Eina_Lock m;
Eina_Condition c;
int current_id;
int current_id;
Eina_Bool sync : 1;
Eina_Bool suspend : 1;
Eina_Bool sync : 1;
Eina_Bool suspend : 1;
};
static void _ecore_main_loop_thread_safe_call(Ecore_Safe_Call *order);
static void _thread_safe_cleanup(void *data);
static void _thread_callback(void *data, void *buffer, unsigned int nbyte);
static void _thread_callback(void *data,
void *buffer,
unsigned int nbyte);
static Eina_List *_thread_cb = NULL;
static Ecore_Pipe *_thread_call = NULL;
static Eina_Lock _thread_safety;
@ -138,11 +140,11 @@ ecore_init(void)
setlocale(LC_CTYPE, "");
#endif
/*
if (strcmp(nl_langinfo(CODESET), "UTF-8"))
{
if (strcmp(nl_langinfo(CODESET), "UTF-8"))
{
WRN("Not a utf8 locale!");
}
*/
}
*/
#ifdef HAVE_EVIL
if (!evil_init())
return --_ecore_init_count;
@ -189,9 +191,9 @@ ecore_init(void)
return _ecore_init_count;
shutdown_log_dom:
shutdown_log_dom:
eina_shutdown();
shutdown_evil:
shutdown_evil:
#ifdef HAVE_EVIL
evil_shutdown();
#endif
@ -214,56 +216,56 @@ ecore_shutdown(void)
/*
* take a lock here because _ecore_event_shutdown() does callbacks
*/
_ecore_lock();
if (--_ecore_init_count != 0)
goto unlock;
_ecore_lock();
if (--_ecore_init_count != 0)
goto unlock;
ecore_pipe_del(_thread_call);
eina_lock_free(&_thread_safety);
eina_condition_free(&_thread_cond);
eina_lock_free(&_thread_mutex);
eina_condition_free(&_thread_feedback_cond);
eina_lock_free(&_thread_feedback_mutex);
eina_lock_free(&_thread_id_lock);
ecore_pipe_del(_thread_call);
eina_lock_free(&_thread_safety);
eina_condition_free(&_thread_cond);
eina_lock_free(&_thread_mutex);
eina_condition_free(&_thread_feedback_cond);
eina_lock_free(&_thread_feedback_mutex);
eina_lock_free(&_thread_id_lock);
if (_ecore_fps_debug) _ecore_fps_debug_shutdown();
_ecore_poller_shutdown();
_ecore_animator_shutdown();
_ecore_glib_shutdown();
_ecore_job_shutdown();
_ecore_thread_shutdown();
_ecore_exe_shutdown();
_ecore_idle_enterer_shutdown();
_ecore_idle_exiter_shutdown();
_ecore_idler_shutdown();
_ecore_timer_shutdown();
_ecore_event_shutdown();
_ecore_main_shutdown();
_ecore_signal_shutdown();
_ecore_main_loop_shutdown();
if (_ecore_fps_debug) _ecore_fps_debug_shutdown();
_ecore_poller_shutdown();
_ecore_animator_shutdown();
_ecore_glib_shutdown();
_ecore_job_shutdown();
_ecore_thread_shutdown();
_ecore_exe_shutdown();
_ecore_idle_enterer_shutdown();
_ecore_idle_exiter_shutdown();
_ecore_idler_shutdown();
_ecore_timer_shutdown();
_ecore_event_shutdown();
_ecore_main_shutdown();
_ecore_signal_shutdown();
_ecore_main_loop_shutdown();
#if HAVE_MALLINFO
if (getenv("ECORE_MEM_STAT"))
{
_ecore_memory_statistic(NULL);
if (getenv("ECORE_MEM_STAT"))
{
_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
eina_log_domain_unregister(_ecore_log_dom);
_ecore_log_dom = -1;
eina_shutdown();
eina_log_domain_unregister(_ecore_log_dom);
_ecore_log_dom = -1;
eina_shutdown();
#ifdef HAVE_EVIL
evil_shutdown();
evil_shutdown();
#endif
unlock:
_ecore_unlock();
_ecore_unlock();
return _ecore_init_count;
return _ecore_init_count;
}
/**
@ -273,20 +275,21 @@ unlock:
static int wakeup = 42;
EAPI void
ecore_main_loop_thread_safe_call_async(Ecore_Cb callback, void *data)
ecore_main_loop_thread_safe_call_async(Ecore_Cb callback,
void *data)
{
Ecore_Safe_Call *order;
if (!callback) return ;
if (!callback) return;
if (eina_main_loop_is())
{
callback(data);
return ;
return;
}
order = malloc(sizeof (Ecore_Safe_Call));
if (!order) return ;
if (!order) return;
order->cb.async = callback;
order->data = data;
@ -297,7 +300,8 @@ ecore_main_loop_thread_safe_call_async(Ecore_Cb callback, void *data)
}
EAPI void *
ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback, void *data)
ecore_main_loop_thread_safe_call_sync(Ecore_Data_Cb callback,
void *data)
{
Ecore_Safe_Call *order;
void *ret;
@ -354,7 +358,7 @@ ecore_thread_main_loop_begin(void)
if (order->current_id < 0)
{
_thread_id_max = 0;
order->current_id = ++_thread_id_max;
order->current_id = ++_thread_id_max;
}
eina_lock_release(&_thread_id_lock);
@ -414,7 +418,8 @@ ecore_thread_main_loop_end(void)
}
EAPI void
ecore_print_warning(const char *function, const char *sparam)
ecore_print_warning(const char *function,
const char *sparam)
{
WRN("***** Developer Warning ***** :\n"
"\tThis program is calling:\n\n"
@ -426,7 +431,10 @@ ecore_print_warning(const char *function, const char *sparam)
}
EAPI void
_ecore_magic_fail(const void *d, Ecore_Magic m, Ecore_Magic req_m, const char *fname)
_ecore_magic_fail(const void *d,
Ecore_Magic m,
Ecore_Magic req_m,
const char *fname)
{
ERR("\n"
"*** ECORE ERROR: Ecore Magic Check Failed!!!\n"
@ -441,9 +449,9 @@ _ecore_magic_fail(const void *d, Ecore_Magic m, Ecore_Magic req_m, const char *f
" 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!");
ERR("*** NAUGHTY PROGRAMMER!!!\n"
"*** SPANK SPANK SPANK!!!\n"
"*** Now go fix your code. Tut tut tut!");
if (getenv("ECORE_ERROR_ABORT")) abort();
}
@ -455,36 +463,46 @@ _ecore_magic_string_get(Ecore_Magic m)
case ECORE_MAGIC_NONE:
return "None (Freed Object)";
break;
case ECORE_MAGIC_EXE:
return "Ecore_Exe (Executable)";
break;
case ECORE_MAGIC_TIMER:
return "Ecore_Timer (Timer)";
break;
case ECORE_MAGIC_IDLER:
return "Ecore_Idler (Idler)";
break;
case ECORE_MAGIC_IDLE_ENTERER:
return "Ecore_Idle_Enterer (Idler Enterer)";
break;
case ECORE_MAGIC_IDLE_EXITER:
return "Ecore_Idle_Exiter (Idler Exiter)";
break;
case ECORE_MAGIC_FD_HANDLER:
return "Ecore_Fd_Handler (Fd Handler)";
break;
case ECORE_MAGIC_WIN32_HANDLER:
return "Ecore_Win32_Handler (Win32 Handler)";
break;
case ECORE_MAGIC_EVENT_HANDLER:
return "Ecore_Event_Handler (Event Handler)";
break;
case ECORE_MAGIC_EVENT:
return "Ecore_Event (Event)";
break;
default:
return "<UNKNOWN>";
};
}
}
/* fps debug calls - for debugging how much time your app actually spends */
@ -498,9 +516,9 @@ unsigned int *_ecore_fps_runtime_mmap = NULL;
void
_ecore_fps_debug_init(void)
{
char buf[PATH_MAX];
char buf[PATH_MAX];
const char *tmp;
int pid;
int pid;
_ecore_fps_debug_init_count++;
if (_ecore_fps_debug_init_count > 1) return;
@ -561,14 +579,14 @@ _ecore_fps_debug_shutdown(void)
{
char buf[4096];
const char *tmp;
int pid;
int pid;
#ifndef HAVE_EVIL
tmp = "/tmp";
tmp = "/tmp";
#else
tmp = (char *)evil_tmpdir_get ();
tmp = (char *)evil_tmpdir_get ();
#endif /* HAVE_EVIL */
pid = (int)getpid();
pid = (int)getpid();
snprintf(buf, sizeof(buf), "%s/.ecore_fps_debug-%i", tmp, pid);
unlink(buf);
if (_ecore_fps_runtime_mmap)
@ -611,12 +629,12 @@ _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);
HAS_CHANGED(fordblks, mi.fordblks);
@ -659,8 +677,8 @@ _thread_safe_cleanup(void *data)
}
static void
_thread_callback(void *data __UNUSED__,
void *buffer __UNUSED__,
_thread_callback(void *data __UNUSED__,
void *buffer __UNUSED__,
unsigned int nbyte __UNUSED__)
{
Ecore_Safe_Call *call;
@ -677,23 +695,23 @@ _thread_callback(void *data __UNUSED__,
{
eina_lock_take(&_thread_mutex);
eina_lock_take(&call->m);
_thread_id = call->current_id;
eina_lock_take(&call->m);
_thread_id = call->current_id;
eina_condition_broadcast(&call->c);
eina_lock_release(&call->m);
eina_lock_release(&call->m);
while (_thread_id_update != _thread_id)
eina_condition_wait(&_thread_cond);
while (_thread_id_update != _thread_id)
eina_condition_wait(&_thread_cond);
eina_lock_release(&_thread_mutex);
eina_main_loop_define();
eina_lock_take(&_thread_feedback_mutex);
eina_lock_take(&_thread_feedback_mutex);
_thread_id = -1;
_thread_id = -1;
eina_condition_broadcast(&_thread_feedback_cond);
eina_lock_release(&_thread_feedback_mutex);
eina_condition_broadcast(&_thread_feedback_cond);
eina_lock_release(&_thread_feedback_mutex);
_thread_safe_cleanup(call);
free(call);
@ -710,3 +728,4 @@ _thread_callback(void *data __UNUSED__,
}
}
}

View File

@ -8,38 +8,36 @@
#include "Ecore.h"
#include "ecore_private.h"
struct _Ecore_Animator
{
EINA_INLIST;
ECORE_MAGIC;
ECORE_MAGIC;
Ecore_Task_Cb func;
void *data;
Ecore_Task_Cb func;
void *data;
double start, run;
Ecore_Timeline_Cb run_func;
void *run_data;
double start, run;
Ecore_Timeline_Cb run_func;
void *run_data;
Eina_Bool delete_me : 1;
Eina_Bool suspended : 1;
Eina_Bool delete_me : 1;
Eina_Bool suspended : 1;
};
static Eina_Bool _ecore_animator_run(void *data);
static Eina_Bool _ecore_animator(void *data);
static int animators_delete_me = 0;
static Ecore_Animator *animators = NULL;
static double animators_frametime = 1.0 / 30.0;
static int animators_delete_me = 0;
static Ecore_Animator *animators = NULL;
static double animators_frametime = 1.0 / 30.0;
static Ecore_Animator_Source src = ECORE_ANIMATOR_SOURCE_TIMER;
static Ecore_Timer *timer = NULL;
static int ticking = 0;
static Ecore_Cb begin_tick_cb = NULL;
static const void *begin_tick_data = NULL;
static Ecore_Cb end_tick_cb = NULL;
static const void *end_tick_data = NULL;
static Ecore_Animator_Source src = ECORE_ANIMATOR_SOURCE_TIMER;
static Ecore_Timer *timer = NULL;
static int ticking = 0;
static Ecore_Cb begin_tick_cb = NULL;
static const void *begin_tick_data = NULL;
static Ecore_Cb end_tick_cb = NULL;
static const void *end_tick_data = NULL;
static void
_begin_tick(void)
@ -56,13 +54,15 @@ _begin_tick(void)
double d = -fmod(t_loop - sync_0, animators_frametime);
timer = _ecore_timer_loop_add(animators_frametime,
_ecore_animator, NULL);
_ecore_animator, NULL);
_ecore_timer_delay(timer, d);
}
break;
case ECORE_ANIMATOR_SOURCE_CUSTOM:
if (begin_tick_cb) begin_tick_cb((void *)begin_tick_data);
break;
default:
break;
}
@ -82,9 +82,11 @@ _end_tick(void)
timer = NULL;
}
break;
case ECORE_ANIMATOR_SOURCE_CUSTOM:
if (end_tick_cb) end_tick_cb((void *)end_tick_data);
break;
default:
break;
}
@ -109,15 +111,15 @@ _do_tick(void)
if (animators_delete_me)
{
Ecore_Animator *l;
for (l = animators; l;)
for (l = animators; l; )
{
animator = l;
l = (Ecore_Animator *) EINA_INLIST_GET(l)->next;
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));
eina_inlist_remove(EINA_INLIST_GET(animators),
EINA_INLIST_GET(animator));
ECORE_MAGIC_SET(animator, ECORE_MAGIC_NONE);
free(animator);
animators_delete_me--;
@ -134,7 +136,8 @@ _do_tick(void)
}
static Ecore_Animator *
_ecore_animator_add(Ecore_Task_Cb func, const void *data)
_ecore_animator_add(Ecore_Task_Cb func,
const void *data)
{
Ecore_Animator *animator = NULL;
@ -150,7 +153,8 @@ _ecore_animator_add(Ecore_Task_Cb func, const void *data)
}
EAPI Ecore_Animator *
ecore_animator_add(Ecore_Task_Cb func, const void *data)
ecore_animator_add(Ecore_Task_Cb func,
const void *data)
{
Ecore_Animator *animator;
@ -162,7 +166,9 @@ ecore_animator_add(Ecore_Task_Cb func, const void *data)
}
EAPI Ecore_Animator *
ecore_animator_timeline_add(double runtime, Ecore_Timeline_Cb func, const void *data)
ecore_animator_timeline_add(double runtime,
Ecore_Timeline_Cb func,
const void *data)
{
Ecore_Animator *animator;
@ -191,7 +197,8 @@ _pos_map_cos(double in)
}
static double
_pos_map_accel_factor(double pos, double v1)
_pos_map_accel_factor(double pos,
double v1)
{
int i, fact = (int)v1;
double p, o1 = pos, o2 = pos, v;
@ -208,7 +215,9 @@ _pos_map_accel_factor(double pos, double v1)
}
static double
_pos_map_pow(double pos, double divis, int p)
_pos_map_pow(double pos,
double divis,
int p)
{
double v = 1.0;
int i;
@ -217,7 +226,9 @@ _pos_map_pow(double pos, double divis, int p)
}
static double
_pos_map_spring(double pos, int bounces, double decfac)
_pos_map_spring(double pos,
int bounces,
double decfac)
{
int segnum, segpos, b1, b2;
double len, decay, decpos, p2;
@ -235,49 +246,63 @@ _pos_map_spring(double pos, int bounces, double decfac)
}
EAPI double
ecore_animator_pos_map(double pos, Ecore_Pos_Map map, double v1, double v2)
ecore_animator_pos_map(double pos,
Ecore_Pos_Map map,
double v1,
double v2)
{
/* purely functional - locking not required */
if (pos > 1.0) pos = 1.0;
else if (pos < 0.0) pos = 0.0;
switch (map)
{
case ECORE_POS_MAP_LINEAR:
return pos;
case ECORE_POS_MAP_ACCELERATE:
pos = 1.0 - _pos_map_sin((M_PI / 2.0) + ((pos * M_PI) / 2.0));
return pos;
case ECORE_POS_MAP_DECELERATE:
pos = _pos_map_sin((pos * M_PI) / 2.0);
return pos;
case ECORE_POS_MAP_SINUSOIDAL:
pos = (1.0 - _pos_map_cos(pos * M_PI)) / 2.0;
return pos;
case ECORE_POS_MAP_ACCELERATE_FACTOR:
pos = _pos_map_accel_factor(pos, v1);
return pos;
case ECORE_POS_MAP_DECELERATE_FACTOR:
pos = 1.0 - _pos_map_accel_factor(1.0 - pos, v1);
return pos;
case ECORE_POS_MAP_SINUSOIDAL_FACTOR:
if (pos < 0.5) pos = _pos_map_accel_factor(pos * 2.0, v1) / 2.0;
else pos = 1.0 - (_pos_map_accel_factor((1.0 - pos) * 2.0, v1) / 2.0);
return pos;
case ECORE_POS_MAP_DIVISOR_INTERP:
pos = _pos_map_pow(pos, v1, (int)v2);
return pos;
case ECORE_POS_MAP_BOUNCE:
pos = _pos_map_spring(pos, (int)v2, v1);
if (pos < 0.0) pos = -pos;
pos = 1.0 - pos;
return pos;
case ECORE_POS_MAP_SPRING:
pos = 1.0 - _pos_map_spring(pos, (int)v2, v1);
return pos;
default:
return pos;
}
return pos;
if (pos > 1.0) pos = 1.0;
else if (pos < 0.0)
pos = 0.0;
switch (map)
{
case ECORE_POS_MAP_LINEAR:
return pos;
case ECORE_POS_MAP_ACCELERATE:
pos = 1.0 - _pos_map_sin((M_PI / 2.0) + ((pos * M_PI) / 2.0));
return pos;
case ECORE_POS_MAP_DECELERATE:
pos = _pos_map_sin((pos * M_PI) / 2.0);
return pos;
case ECORE_POS_MAP_SINUSOIDAL:
pos = (1.0 - _pos_map_cos(pos * M_PI)) / 2.0;
return pos;
case ECORE_POS_MAP_ACCELERATE_FACTOR:
pos = _pos_map_accel_factor(pos, v1);
return pos;
case ECORE_POS_MAP_DECELERATE_FACTOR:
pos = 1.0 - _pos_map_accel_factor(1.0 - pos, v1);
return pos;
case ECORE_POS_MAP_SINUSOIDAL_FACTOR:
if (pos < 0.5) pos = _pos_map_accel_factor(pos * 2.0, v1) / 2.0;
else pos = 1.0 - (_pos_map_accel_factor((1.0 - pos) * 2.0, v1) / 2.0);
return pos;
case ECORE_POS_MAP_DIVISOR_INTERP:
pos = _pos_map_pow(pos, v1, (int)v2);
return pos;
case ECORE_POS_MAP_BOUNCE:
pos = _pos_map_spring(pos, (int)v2, v1);
if (pos < 0.0) pos = -pos;
pos = 1.0 - pos;
return pos;
case ECORE_POS_MAP_SPRING:
pos = 1.0 - _pos_map_spring(pos, (int)v2, v1);
return pos;
default:
return pos;
}
return pos;
}
EAPI void *
@ -376,7 +401,8 @@ ecore_animator_source_get(void)
}
EAPI void
ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func, const void *data)
ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func,
const void *data)
{
_ecore_lock();
begin_tick_cb = func;
@ -387,7 +413,8 @@ ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func, const void *
}
EAPI void
ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func, const void *data)
ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func,
const void *data)
{
_ecore_lock();
end_tick_cb = func;
@ -414,7 +441,7 @@ _ecore_animator_shutdown(void)
Ecore_Animator *animator;
animator = animators;
animators = (Ecore_Animator *) eina_inlist_remove(EINA_INLIST_GET(animators), EINA_INLIST_GET(animators));
animators = (Ecore_Animator *)eina_inlist_remove(EINA_INLIST_GET(animators), EINA_INLIST_GET(animators));
ECORE_MAGIC_SET(animator, ECORE_MAGIC_NONE);
free(animator);
}
@ -432,7 +459,8 @@ _ecore_animator_run(void *data)
{
pos = (t - animator->start) / animator->run;
if (pos > 1.0) pos = 1.0;
else if (pos < 0.0) pos = 0.0;
else if (pos < 0.0)
pos = 0.0;
}
run_ret = animator->run_func(animator->run_data, pos);
if (t >= (animator->start + animator->run)) run_ret = EINA_FALSE;
@ -448,3 +476,4 @@ _ecore_animator(void *data __UNUSED__)
_ecore_unlock();
return r;
}

View File

@ -35,7 +35,8 @@ static char **app_argv = NULL;
* for later use by ecore_app_restart() or ecore_app_args_get().
*/
EAPI void
ecore_app_args_set(int argc, const char **argv)
ecore_app_args_set(int argc,
const char **argv)
{
EINA_MAIN_LOOP_CHECK_RETURN;
@ -57,7 +58,8 @@ ecore_app_args_set(int argc, const char **argv)
* same set by ecore_app_args_set().
*/
EAPI void
ecore_app_args_get(int *argc, char ***argv)
ecore_app_args_get(int *argc,
char ***argv)
{
EINA_MAIN_LOOP_CHECK_RETURN;

View File

@ -12,40 +12,39 @@ static int inpurge = 0;
struct _Ecore_Event_Handler
{
EINA_INLIST;
ECORE_MAGIC;
int type;
ECORE_MAGIC;
int type;
Ecore_Event_Handler_Cb func;
void *data;
int references;
Eina_Bool delete_me : 1;
void *data;
int references;
Eina_Bool delete_me : 1;
};
struct _Ecore_Event_Filter
{
EINA_INLIST;
ECORE_MAGIC;
Ecore_Data_Cb func_start;
ECORE_MAGIC;
Ecore_Data_Cb func_start;
Ecore_Filter_Cb func_filter;
Ecore_End_Cb func_end;
void *loop_data;
void *data;
int references;
Eina_Bool delete_me : 1;
Ecore_End_Cb func_end;
void *loop_data;
void *data;
int references;
Eina_Bool delete_me : 1;
};
struct _Ecore_Event
{
EINA_INLIST;
ECORE_MAGIC;
int type;
void *event;
ECORE_MAGIC;
int type;
void *event;
Ecore_End_Cb func_free;
void *data;
int references;
Eina_Bool delete_me : 1;
void *data;
int references;
Eina_Bool delete_me : 1;
};
static int events_num = 0;
static Ecore_Event *events = NULL;
static Ecore_Event *event_current = NULL;
@ -65,13 +64,11 @@ static Ecore_Event *event_filter_event_current = NULL;
static int event_filters_delete_me = 0;
static int event_id_max = ECORE_EVENT_COUNT;
static int ecore_raw_event_type = ECORE_EVENT_NONE;
static void *ecore_raw_event_event = NULL;
static void *ecore_raw_event_event = NULL;
static void _ecore_event_purge_deleted(void);
static void _ecore_event_purge_deleted(void);
static void *_ecore_event_del(Ecore_Event *event);
/**
* @addtogroup Ecore_Event_Group
*
@ -102,7 +99,9 @@ static void *_ecore_event_del(Ecore_Event *event);
* been called, will not be.
*/
EAPI Ecore_Event_Handler *
ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, const void *data)
ecore_event_handler_add(int type,
Ecore_Event_Handler_Cb func,
const void *data)
{
Ecore_Event_Handler *eh = NULL;
@ -213,7 +212,8 @@ unlock:
* which was previously associated with @p eh by ecore_event_handler_add().
*/
EAPI void *
ecore_event_handler_data_set(Ecore_Event_Handler *eh, const void *data)
ecore_event_handler_data_set(Ecore_Event_Handler *eh,
const void *data)
{
void *old = NULL;
@ -232,7 +232,8 @@ unlock:
}
static void
_ecore_event_generic_free (void *data __UNUSED__, void *event)
_ecore_event_generic_free(void *data __UNUSED__,
void *event)
{
free (event);
}
@ -256,7 +257,10 @@ _ecore_event_generic_free (void *data __UNUSED__, void *event)
* func_free is passed @p data as its data parameter.
*/
EAPI Ecore_Event *
ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data)
ecore_event_add(int type,
void *ev,
Ecore_End_Cb func_free,
void *data)
{
Ecore_Event *event = NULL;
@ -345,7 +349,10 @@ ecore_event_type_new(void)
* and @p data pointer to clean up.
*/
EAPI Ecore_Event_Filter *
ecore_event_filter_add(Ecore_Data_Cb func_start, Ecore_Filter_Cb func_filter, Ecore_End_Cb func_end, const void *data)
ecore_event_filter_add(Ecore_Data_Cb func_start,
Ecore_Filter_Cb func_filter,
Ecore_End_Cb func_end,
const void *data)
{
Ecore_Event_Filter *ef = NULL;
@ -358,7 +365,7 @@ ecore_event_filter_add(Ecore_Data_Cb func_start, Ecore_Filter_Cb func_filter, Ec
ef->func_filter = func_filter;
ef->func_end = func_end;
ef->data = (void *)data;
event_filters = (Ecore_Event_Filter *) eina_inlist_append(EINA_INLIST_GET(event_filters), EINA_INLIST_GET(ef));
event_filters = (Ecore_Event_Filter *)eina_inlist_append(EINA_INLIST_GET(event_filters), EINA_INLIST_GET(ef));
unlock:
_ecore_unlock();
return ef;
@ -460,7 +467,7 @@ _ecore_event_shutdown(void)
{
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]));
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);
}
@ -473,7 +480,7 @@ _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));
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);
}
@ -492,7 +499,10 @@ _ecore_event_exist(void)
}
Ecore_Event *
_ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data)
_ecore_event_add(int type,
void *ev,
Ecore_End_Cb func_free,
void *data)
{
Ecore_Event *e;
@ -523,7 +533,7 @@ _ecore_event_del(Ecore_Event *event)
data = event->data;
if (event->func_free) _ecore_call_end_cb(event->func_free, event->data, event->event);
events = (Ecore_Event *) eina_inlist_remove(EINA_INLIST_GET(events), EINA_INLIST_GET(event));
events = (Ecore_Event *)eina_inlist_remove(EINA_INLIST_GET(events), EINA_INLIST_GET(event));
ECORE_MAGIC_SET(event, ECORE_MAGIC_NONE);
free(event);
events_num--;
@ -555,16 +565,15 @@ _ecore_event_purge_deleted(void)
static inline void
_ecore_event_filters_apply()
{
if (!event_filter_current)
{
/* regular main loop, start from head */
event_filter_current = event_filters;
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;
event_filter_current = (Ecore_Event_Filter *)EINA_INLIST_GET(event_filter_current)->next;
}
while (event_filter_current)
@ -580,13 +589,13 @@ _ecore_event_filters_apply()
if (!event_filter_event_current)
{
/* regular main loop, start from head */
event_filter_event_current = events;
/* 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;
/* 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)
@ -594,7 +603,7 @@ _ecore_event_filters_apply()
Ecore_Event *e = event_filter_event_current;
if (!_ecore_call_filter_cb(ef->func_filter, ef->data,
ef->loop_data, e->type, e->event))
ef->loop_data, e->type, e->event))
{
ecore_event_del(e);
}
@ -615,10 +624,10 @@ _ecore_event_filters_apply()
{
int deleted_in_use = 0;
Ecore_Event_Filter *l;
for (l = event_filters; l;)
for (l = event_filters; l; )
{
Ecore_Event_Filter *ef = l;
l = (Ecore_Event_Filter *) EINA_INLIST_GET(l)->next;
l = (Ecore_Event_Filter *)EINA_INLIST_GET(l)->next;
if (ef->delete_me)
{
if (ef->references)