Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto
Dir : e17/proto/etk/src/lib Modified Files: Etk.h Makefile.am etk_main.c etk_theme.c etk_theme.h Log Message: add src/tools for various tools to come. add src/tools/etk_prefs, an application that allows the user to control several of etk's preferences. right now, it allows you to change themes placed in ~/.e/etk/themes or the global theme path. =================================================================== RCS file: /cvs/e/e17/proto/etk/src/lib/Etk.h,v retrieving revision 1.40 retrieving revision 1.41 diff -u -3 -r1.40 -r1.41 --- Etk.h 24 Aug 2006 18:09:16 -0000 1.40 +++ Etk.h 31 Aug 2006 17:32:06 -0000 1.41 @@ -19,8 +19,9 @@ #include "etk_string.h" #include "etk_type.h" #include "etk_types.h" +#include "etk_config.h" #include "etk_utils.h" - + #include "etk_alignment.h" #include "etk_bin.h" #include "etk_box.h" =================================================================== RCS file: /cvs/e/e17/proto/etk/src/lib/Makefile.am,v retrieving revision 1.44 retrieving revision 1.45 diff -u -3 -r1.44 -r1.45 --- Makefile.am 24 Aug 2006 18:09:16 -0000 1.44 +++ Makefile.am 31 Aug 2006 17:32:06 -0000 1.45 @@ -83,7 +83,8 @@ etk_utils.h \ etk_viewport.h \ etk_widget.h \ -etk_window.h +etk_window.h \ +etk_config.h libetk_la_SOURCES = \ etk_alignment.c \ @@ -152,6 +153,7 @@ etk_viewport.c \ etk_widget.c \ etk_window.c \ +etk_config.c \ $(ETKHEADERS) installed_headersdir = $(prefix)/include/etk =================================================================== RCS file: /cvs/e/e17/proto/etk/src/lib/etk_main.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -3 -r1.31 -r1.32 --- etk_main.c 21 Aug 2006 11:18:28 -0000 1.31 +++ etk_main.c 31 Aug 2006 17:32:06 -0000 1.32 @@ -16,6 +16,7 @@ #include "etk_object.h" #include "etk_toplevel_widget.h" #include "etk_utils.h" +#include "etk_config.h" #include "etk_theme.h" #include "etk_dnd.h" #include "etk_tooltips.h" @@ -90,12 +91,18 @@ } /* Initialize the subsystems of Etk */ - etk_theme_init(); if (!etk_engine_init()) { ETK_WARNING("Etk_Engine initialization failed!"); return 0; } + if (!etk_config_init()) + { + ETK_WARNING("Etk_Config initialization failed!"); + return 0; + } + etk_config_load(); + etk_theme_init(); if (!etk_engine_load(engine_name ? engine_name : "ecore_evas_software_x11")) { ETK_WARNING("Etk can not load the requested engine!"); @@ -140,6 +147,8 @@ etk_tooltips_shutdown(); etk_dnd_shutdown(); etk_engine_shutdown(); + /* TODO: do we want to save the config here? hmm... */ + etk_config_shutdown(); etk_theme_shutdown(); evas_list_free(_etk_main_toplevel_widgets); =================================================================== RCS file: /cvs/e/e17/proto/etk/src/lib/etk_theme.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- etk_theme.c 7 Apr 2006 15:36:11 -0000 1.5 +++ etk_theme.c 31 Aug 2006 17:32:06 -0000 1.6 @@ -7,6 +7,7 @@ #include <Edje.h> #include "etk_widget.h" #include "etk_string.h" +#include "etk_config.h" #include "config.h" #define ETK_THEME_PARENT_GET(widget) ((widget)->theme_parent ? (widget)->theme_parent : (widget)->parent) @@ -21,11 +22,11 @@ /** @brief Initializes the theming system of Etk. Do not call it manually, etk_init() calls it! */ void etk_theme_init() { - _etk_theme_default_widget_theme = _etk_theme_find("themes", "default"); + _etk_theme_default_widget_theme = _etk_theme_find("themes", etk_config_widget_theme_get()); _etk_theme_default_icon_theme = _etk_theme_find("icons", "default"); /* TODO: etk_config: add support of non default themes */ - etk_theme_widget_theme_set("default"); + etk_theme_widget_theme_set(etk_config_widget_theme_get()); etk_theme_icon_theme_set("default"); } @@ -80,6 +81,46 @@ const char *etk_theme_default_widget_theme_get() { return _etk_theme_default_widget_theme; +} + +/** + * @brief Gets the list of available widget themes + * @return Returns an Evas_List of available widget themes + */ +Evas_List *etk_theme_widget_theme_available_get() +{ + Ecore_List *files; + Evas_List *themes = NULL; + char *home; + char *path; + char *file; + + if ((home = getenv("HOME"))) + { + /* TODO: etk_config_dir_get? */ + path = malloc(strlen(home) + strlen("/.e/etk/themes/") + 1); + sprintf(path, "%s/.e/etk/themes/", home); + files = ecore_file_ls(path); + if (files) + { + ecore_list_goto_first(files); + while((file = ecore_list_next(files))) + themes = evas_list_append(themes, ecore_file_strip_ext(file)); + } + free(path); + } + + path = malloc(strlen(PACKAGE_DATA_DIR"/themes/") + 1); + sprintf(path, PACKAGE_DATA_DIR"/themes/"); + files = ecore_file_ls(path); + if (files) + { + ecore_list_goto_first(files); + while((file = ecore_list_next(files))) + themes = evas_list_append(themes, ecore_file_strip_ext(file)); + } + free(path); + return themes; } /** =================================================================== RCS file: /cvs/e/e17/proto/etk/src/lib/etk_theme.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- etk_theme.h 7 Apr 2006 15:36:11 -0000 1.3 +++ etk_theme.h 31 Aug 2006 17:32:06 -0000 1.4 @@ -16,6 +16,7 @@ const char *etk_theme_widget_theme_get(); Etk_Bool etk_theme_widget_theme_set(const char *theme_name); const char *etk_theme_default_widget_theme_get(); +Evas_List *etk_theme_widget_theme_available_get(); const char *etk_theme_icon_theme_get(); Etk_Bool etk_theme_icon_theme_set(const char *theme_name); ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs