From 5c48d67a4edf0c90a570d94ad472fc827e731cb3 Mon Sep 17 00:00:00 2001 From: barbieri Date: Sat, 20 Dec 2008 15:19:48 +0000 Subject: [PATCH] Oops! ecore must not depend on ecore-evas! move helper function inside ecore-evas. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@38250 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore/Ecore_Getopt.h | 2 -- src/lib/ecore/ecore_getopt.c | 39 ------------------------------------ src/lib/ecore_evas/Ecore_Evas.h | 4 ++++ src/lib/ecore_evas/ecore_evas_util.c | 39 ++++++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 41 deletions(-) diff --git a/src/lib/ecore/Ecore_Getopt.h b/src/lib/ecore/Ecore_Getopt.h index 2f2e8b7..a8b579d 100644 --- a/src/lib/ecore/Ecore_Getopt.h +++ b/src/lib/ecore/Ecore_Getopt.h @@ -381,8 +381,6 @@ extern "C" { EAPI Eina_List *ecore_getopt_list_free(Eina_List *list); /* helper functions to be used with ECORE_GETOPT_CALLBACK_*() */ - - EAPI unsigned char ecore_getopt_callback_ecore_evas_list_engines(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage); EAPI unsigned char ecore_getopt_callback_geometry_parse(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage); diff --git a/src/lib/ecore/ecore_getopt.c b/src/lib/ecore/ecore_getopt.c index f38c7fa..44c0297 100644 --- a/src/lib/ecore/ecore_getopt.c +++ b/src/lib/ecore/ecore_getopt.c @@ -1641,45 +1641,6 @@ ecore_getopt_list_free(Eina_List *list) } /** - * Helper ecore_getopt callback to list available Ecore_Evas engines. - * - * This will list all available engines except buffer, this is useful - * for applications to let user choose how they should create windows - * with ecore_evas_new(). - * - * @c callback_data value is used as @c FILE* and says where to output - * messages, by default it is @c stdout. You can specify this value - * with ECORE_GETOPT_CALLBACK_FULL() or ECORE_GETOPT_CALLBACK_ARGS(). - * - * If there is a boolean storage provided, then it is marked with 1 - * when this option is executed. - */ -unsigned char -ecore_getopt_callback_ecore_evas_list_engines(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage) -{ - Eina_List *lst, *n; - const char *engine; - FILE *fp = data; - - if (!fp) - fp = stdout; - - lst = ecore_evas_engines_get(); - - fputs("supported engines:\n", fp); - EINA_LIST_FOREACH(lst, n, engine) - if (strcmp(engine, "buffer") != 0) - fprintf(fp, "\t%s\n", engine); - - ecore_evas_engines_free(lst); - - if (storage->boolp) - *storage->boolp = 1; - - return 1; -} - -/** * Helper ecore_getopt callback to parse geometry (x:y:w:h). * * Storage must be a pointer to @c Eina_Rectangle and will be used to diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h index 51f152b..12b7b86 100644 --- a/src/lib/ecore_evas/Ecore_Evas.h +++ b/src/lib/ecore_evas/Ecore_Evas.h @@ -49,6 +49,7 @@ */ #include +#include #ifdef __cplusplus extern "C" { @@ -318,6 +319,9 @@ EAPI int ecore_evas_object_associate(Ecore_Evas *ee, Evas_Object *obj, EAPI int ecore_evas_object_dissociate(Ecore_Evas *ee, Evas_Object *obj); EAPI Evas_Object *ecore_evas_object_associate_get(const Ecore_Evas *ee); +/* helper function to be used with ECORE_GETOPT_CALLBACK_*() */ +EAPI unsigned char ecore_getopt_callback_ecore_evas_list_engines(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage); + #ifdef __cplusplus } #endif diff --git a/src/lib/ecore_evas/ecore_evas_util.c b/src/lib/ecore_evas/ecore_evas_util.c index 9b03401..51eec3a 100644 --- a/src/lib/ecore_evas/ecore_evas_util.c +++ b/src/lib/ecore_evas/ecore_evas_util.c @@ -431,3 +431,42 @@ _ecore_evas_object_dissociate(Ecore_Evas *ee, Evas_Object *obj) _evas_object_associate_del(obj); } + +/** + * Helper ecore_getopt callback to list available Ecore_Evas engines. + * + * This will list all available engines except buffer, this is useful + * for applications to let user choose how they should create windows + * with ecore_evas_new(). + * + * @c callback_data value is used as @c FILE* and says where to output + * messages, by default it is @c stdout. You can specify this value + * with ECORE_GETOPT_CALLBACK_FULL() or ECORE_GETOPT_CALLBACK_ARGS(). + * + * If there is a boolean storage provided, then it is marked with 1 + * when this option is executed. + */ +unsigned char +ecore_getopt_callback_ecore_evas_list_engines(const Ecore_Getopt *parser, const Ecore_Getopt_Desc *desc, const char *str, void *data, Ecore_Getopt_Value *storage) +{ + Eina_List *lst, *n; + const char *engine; + FILE *fp = data; + + if (!fp) + fp = stdout; + + lst = ecore_evas_engines_get(); + + fputs("supported engines:\n", fp); + EINA_LIST_FOREACH(lst, n, engine) + if (strcmp(engine, "buffer") != 0) + fprintf(fp, "\t%s\n", engine); + + ecore_evas_engines_free(lst); + + if (storage->boolp) + *storage->boolp = 1; + + return 1; +} -- 2.7.4