Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_config.c ewl_config.h ewl_filelist_column.c ewl_filelist_icon.c ewl_icon_theme.c Log Message: - make the default icon size user configurable (defaults to MEDIUM) - passing NULL in as the size for ewl_icon_theme_icon_path_get will use the default user size. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_config.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -3 -r1.13 -r1.14 --- ewl_config.c 16 Aug 2006 15:04:50 -0000 1.13 +++ ewl_config.c 6 Sep 2006 15:35:01 -0000 1.14 @@ -11,6 +11,7 @@ EWL_CONFIG_EVAS_FONT_CACHE, EWL_CONFIG_EVAS_IMAGE_CACHE, EWL_CONFIG_THEME_ICON_THEME_NAME, + EWL_CONFIG_THEME_ICON_THEME_SIZE, EWL_CONFIG_THEME_NAME, EWL_CONFIG_THEME_CACHE, EWL_CONFIG_THEME_COLOR_CLASSES_OVERRIDE, @@ -194,7 +195,8 @@ nc.evas.image_cache = ewl_config_int_get("/ewl/evas/image_cache"); nc.engine_name = ewl_config_str_get("/ewl/engine_name"); nc.theme.name = ewl_config_str_get("/ewl/theme/name"); - nc.theme.icon_theme = ewl_config_str_get("/ewl/theme/icon/name"); + nc.theme.icon.theme = ewl_config_str_get("/ewl/theme/icon/name"); + nc.theme.icon.size = ewl_config_str_get("/ewl/theme/icon/size"); nc.theme.cache = ewl_config_int_get("/ewl/theme/cache"); nc.theme.print_keys = ewl_config_int_get("/ewl/theme/print_keys"); nc.theme.print_signals = ewl_config_int_get("/ewl/theme/print_signals"); @@ -343,12 +345,19 @@ ewl_config.debug.level = nc.debug.level; ewl_config.evas.font_cache = nc.evas.font_cache; ewl_config.evas.image_cache = nc.evas.image_cache; + IF_FREE(ewl_config.engine_name); ewl_config.engine_name = nc.engine_name; + IF_FREE(ewl_config.theme.name); ewl_config.theme.name = nc.theme.name; - IF_FREE(ewl_config.theme.icon_theme); - ewl_config.theme.icon_theme = nc.theme.icon_theme; + + IF_FREE(ewl_config.theme.icon.theme); + ewl_config.theme.icon.theme = nc.theme.icon.theme; + + IF_FREE(ewl_config.theme.icon.size); + ewl_config.theme.icon.size = nc.theme.icon.size; + ewl_config.theme.cache = nc.theme.cache; ewl_config.theme.print_keys = nc.theme.print_keys; ewl_config.theme.print_signals = nc.theme.print_signals; @@ -369,6 +378,7 @@ ecore_config_int_default("/ewl/evas/image_cache", 8388608); ecore_config_theme_default("/ewl/theme/name", "default"); ecore_config_string_default("/ewl/theme/icon/name", "Tango"); + ecore_config_string_default("/ewl/theme/icon/size", EWL_ICON_SIZE_MEDIUM); ecore_config_int_default("/ewl/theme/cache", 0); ecore_config_int_default("/ewl/theme/color_classes/override", 0); ecore_config_int_default("/ewl/theme/print_keys", 0); @@ -386,6 +396,7 @@ "/ewl/evas/image_cache", "/ewl/theme/name", "/ewl/theme/icon/name", + "/ewl/theme/icon/size", "/ewl/theme/cache", "/ewl/theme/color_classes/override", "/ewl/theme/print_keys", @@ -413,6 +424,8 @@ ewl_config_listener, EWL_CONFIG_THEME_NAME, NULL); ecore_config_listen("ewl_theme_icon_name", "/ewl/theme/icon/name", ewl_config_listener, EWL_CONFIG_THEME_ICON_THEME_NAME, NULL); + ecore_config_listen("ewl_theme_icon_size", "/ewl/theme/icon/size", + ewl_config_listener, EWL_CONFIG_THEME_ICON_THEME_SIZE, NULL); ecore_config_listen("ewl_theme_cache", "/ewl/theme/cache", ewl_config_listener, EWL_CONFIG_THEME_CACHE, NULL); ecore_config_listen("ewl_theme_print_keys", "/ewl/theme/print_keys", @@ -463,9 +476,14 @@ break; case EWL_CONFIG_THEME_ICON_THEME_NAME: - IF_FREE(ewl_config.theme.icon_theme); - ewl_config.theme.icon_theme = ewl_config_str_get(key); + IF_FREE(ewl_config.theme.icon.theme); + ewl_config.theme.icon.theme = ewl_config_str_get(key); ewl_icon_theme_theme_change(); + break; + + case EWL_CONFIG_THEME_ICON_THEME_SIZE: + IF_FREE(ewl_config.theme.icon.size); + ewl_config.theme.icon.size = ewl_config_str_get(key); break; case EWL_CONFIG_THEME_CACHE: =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_config.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_config.h 16 Aug 2006 15:04:50 -0000 1.14 +++ ewl_config.h 6 Sep 2006 15:35:01 -0000 1.15 @@ -35,7 +35,12 @@ struct { char *name; /**< Theme name */ - char *icon_theme; /**< Icon theme name */ + + struct { + char *theme; /**< Icon theme name */ + char *size; /**< Icon theme size */ + } icon; /**< Icon theme settings */ + int cache; /**< Cache size */ int cclass_override; /**< Colour class override */ int print_keys; /**< Print theme keys as accessed */ =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_column.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- ewl_filelist_column.c 6 Sep 2006 15:16:11 -0000 1.15 +++ ewl_filelist_column.c 6 Sep 2006 15:35:01 -0000 1.16 @@ -460,7 +460,7 @@ ewl_filelist_column_cb_file_clicked, fl); stock = ewl_filelist_stock_icon_get(fl, path); - img = ewl_icon_theme_icon_path_get(stock, EWL_ICON_SIZE_MEDIUM); + img = ewl_icon_theme_icon_path_get(stock, NULL); ewl_icon_image_set(EWL_ICON(icon), img, stock); ewl_container_child_append(EWL_CONTAINER(data), icon); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_icon.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- ewl_filelist_icon.c 6 Sep 2006 15:16:11 -0000 1.9 +++ ewl_filelist_icon.c 6 Sep 2006 15:35:01 -0000 1.10 @@ -267,7 +267,7 @@ ewl_filelist_icon_cb_icon_clicked, fl); stock = ewl_filelist_stock_icon_get(fl, path); - img = ewl_icon_theme_icon_path_get(stock, EWL_ICON_SIZE_MEDIUM); + img = ewl_icon_theme_icon_path_get(stock, NULL); ewl_icon_image_set(EWL_ICON(icon), img, stock); ewl_container_child_append(EWL_CONTAINER(list->freebox), icon); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_icon_theme.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_icon_theme.c 16 Aug 2006 20:46:09 -0000 1.2 +++ ewl_icon_theme.c 6 Sep 2006 15:35:01 -0000 1.3 @@ -16,9 +16,9 @@ DENTER_FUNCTION(DLEVEL_STABLE); /* check if this is an edje theme */ - if (ewl_config.theme.icon_theme && - (!strncasecmp(ewl_config.theme.icon_theme + - (strlen(ewl_config.theme.icon_theme) - 4), + if (ewl_config.theme.icon.theme && + (!strncasecmp(ewl_config.theme.icon.theme + + (strlen(ewl_config.theme.icon.theme) - 4), ".edj", 4))) ewl_icon_theme_is_edje = 1; else @@ -31,7 +31,8 @@ /** * @param icon: The Icon Spec icon name to lookup - * @param size: The size of the icon to retrieve + * @param size: The size of the icon to retrieve. A NULL value will cause + * the default size to be used. * @return Returns the path to the icon we are looking for or NULL if none found * @brief Retrives the full path to the specified icon, or NULL if none found */ @@ -39,22 +40,29 @@ ewl_icon_theme_icon_path_get(const char *icon, const char *size) { const char *ret; + const char *icon_size; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("icon", icon, NULL); /* make sure we have an icon theme */ - if (!ewl_config.theme.icon_theme) + if (!ewl_config.theme.icon.theme) DRETURN_PTR(NULL, DLEVEL_STABLE); /* if our theme is an edje just return the .edj file */ if (ewl_icon_theme_is_edje) - DRETURN_PTR(ewl_config.theme.icon_theme, DLEVEL_STABLE);; + DRETURN_PTR(ewl_config.theme.icon.theme, DLEVEL_STABLE);; /* XXX Should store a hash of these here so we don't have to keep * looking it up. Just reset the hash on theme change */ - ret = ecore_desktop_icon_find(icon, size, ewl_config.theme.icon_theme); + if (!size) + icon_size = ewl_config.theme.icon.size; + else + icon_size = size; + + ret = ecore_desktop_icon_find(icon, icon_size, + ewl_config.theme.icon.theme); DRETURN_PTR(ret, DLEVEL_STABLE); } ------------------------------------------------------------------------- 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