Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_calendar.c ewl_filelist_column.c ewl_filelist_icon.c ewl_icon.c ewl_icon_theme.c ewl_icon_theme.h ewl_stock.c Log Message: - revert patch from last night. there's a better way to do it. - remove the unused stock images from the theme =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_calendar.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- ewl_calendar.c 13 Dec 2006 07:18:59 -0000 1.22 +++ ewl_calendar.c 13 Dec 2006 19:00:03 -0000 1.23 @@ -60,7 +60,6 @@ Ewl_Widget *w, *vbox, *top_hbox, *prev_button, *next_button; struct tm *ptr; time_t tm; - const char *path, *key; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("ib", ib, FALSE); @@ -84,16 +83,16 @@ ewl_container_child_append(EWL_CONTAINER(vbox), top_hbox); ewl_widget_show(top_hbox); - path = ewl_icon_theme_icon_path_get(EWL_ICON_GO_PREVIOUS, - EWL_ICON_SIZE_SMALL), - key = ewl_icon_theme_icon_key_get(path, EWL_ICON_GO_PREVIOUS); - prev_button = ewl_button_new(); ewl_container_child_append(EWL_CONTAINER(top_hbox), prev_button); ewl_object_fill_policy_set(EWL_OBJECT(prev_button), EWL_FLAG_FILL_NONE); ewl_object_alignment_set(EWL_OBJECT(prev_button), EWL_FLAG_ALIGN_LEFT); - ewl_button_image_set(EWL_BUTTON(prev_button), path, key); - ewl_callback_append(prev_button, EWL_CALLBACK_MOUSE_DOWN, ewl_calendar_prev_month_cb, ib); + ewl_button_image_set(EWL_BUTTON(prev_button), + ewl_icon_theme_icon_path_get(EWL_ICON_GO_PREVIOUS, + EWL_ICON_SIZE_SMALL), + EWL_ICON_GO_PREVIOUS); + ewl_callback_append(prev_button, EWL_CALLBACK_MOUSE_DOWN, + ewl_calendar_prev_month_cb, ib); ewl_widget_show(prev_button); ib->month_label = ewl_label_new(); @@ -105,15 +104,14 @@ ewl_label_text_set(EWL_LABEL(ib->month_label), "Disp"); ewl_widget_show(ib->month_label); - path = ewl_icon_theme_icon_path_get(EWL_ICON_GO_NEXT, - EWL_ICON_SIZE_SMALL), - key = ewl_icon_theme_icon_key_get(path, EWL_ICON_GO_NEXT); - next_button = ewl_button_new(); ewl_object_fill_policy_set(EWL_OBJECT(next_button), EWL_FLAG_FILL_NONE); ewl_object_alignment_set(EWL_OBJECT(next_button), EWL_FLAG_ALIGN_RIGHT); ewl_container_child_append(EWL_CONTAINER(top_hbox), next_button); - ewl_button_image_set(EWL_BUTTON(next_button), path, key); + ewl_button_image_set(EWL_BUTTON(next_button), + ewl_icon_theme_icon_path_get(EWL_ICON_GO_NEXT, + EWL_ICON_SIZE_SMALL), + EWL_ICON_GO_NEXT); ewl_callback_append(next_button, EWL_CALLBACK_MOUSE_DOWN, ewl_calendar_next_month_cb, ib); ewl_widget_show(next_button); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_column.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -3 -r1.20 -r1.21 --- ewl_filelist_column.c 13 Dec 2006 07:18:59 -0000 1.20 +++ ewl_filelist_column.c 13 Dec 2006 19:00:03 -0000 1.21 @@ -433,7 +433,7 @@ { Ewl_Filelist_Column *list; Ewl_Widget *icon; - const char *stock, *img, *key; + const char *stock, *img; char path[PATH_MAX]; DENTER_FUNCTION(DLEVEL_STABLE); @@ -461,8 +461,7 @@ stock = ewl_filelist_stock_icon_get(fl, path); img = ewl_icon_theme_icon_path_get(stock, NULL); - key = ewl_icon_theme_icon_key_get(img, stock); - if (img) ewl_icon_image_set(EWL_ICON(icon), img, key); + if (img) ewl_icon_image_set(EWL_ICON(icon), img, stock); ewl_container_child_append(EWL_CONTAINER(data), icon); ewl_widget_show(icon); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_icon.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- ewl_filelist_icon.c 13 Dec 2006 07:18:59 -0000 1.14 +++ ewl_filelist_icon.c 13 Dec 2006 19:00:03 -0000 1.15 @@ -242,7 +242,7 @@ { Ewl_Filelist_Icon *list; Ewl_Widget *icon; - const char *img, *stock, *key; + const char *img, *stock; char path[PATH_MAX]; DENTER_FUNCTION(DLEVEL_STABLE); @@ -268,8 +268,7 @@ stock = ewl_filelist_stock_icon_get(fl, path); img = ewl_icon_theme_icon_path_get(stock, NULL); - key = ewl_icon_theme_icon_key_get(img, stock); - if (img) ewl_icon_image_set(EWL_ICON(icon), img, key); + if (img) ewl_icon_image_set(EWL_ICON(icon), img, stock); ewl_container_child_append(EWL_CONTAINER(list->freebox), icon); ewl_widget_show(icon); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_icon.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- ewl_icon.c 13 Dec 2006 07:18:59 -0000 1.28 +++ ewl_icon.c 13 Dec 2006 19:00:03 -0000 1.29 @@ -229,14 +229,12 @@ ewl_icon_parts_update(icon); else if (!icon->alt) { - const char *path, *key; + const char *path; path = ewl_icon_theme_icon_path_get( EWL_ICON_IMAGE_LOADING, NULL), - key = ewl_icon_theme_icon_key_get(path, + ewl_image_file_set(EWL_IMAGE(icon->image), path, EWL_ICON_IMAGE_LOADING); - - ewl_image_file_set(EWL_IMAGE(icon->image), path, key); ewl_widget_show(icon->image); } else =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_icon_theme.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- ewl_icon_theme.c 13 Dec 2006 07:18:59 -0000 1.11 +++ ewl_icon_theme.c 13 Dec 2006 19:00:03 -0000 1.12 @@ -96,7 +96,7 @@ /* make sure we have an icon theme */ if (!icon_theme) - DRETURN_PTR(ewl_theme_path_get(), DLEVEL_STABLE); + DRETURN_PTR(NULL, DLEVEL_STABLE); /* if our theme is an edje just return the .edj file */ if (ewl_icon_theme_is_edje) @@ -119,39 +119,9 @@ } if (ret == EWL_THEME_KEY_NOMATCH) - ret = ewl_theme_path_get(); + ret = NULL; DRETURN_PTR(ret, DLEVEL_STABLE); -} - -/** - * @param path: The path to the icon - * @param icon: The name of the icon - * @return Returns the icon key. - * @brief Returns the icon key or NULL if icon not available - */ -const char * -ewl_icon_theme_icon_key_get(const char *path, const char *icon) -{ - int len; - - if (!path || !icon) - DRETURN_PTR(NULL, DLEVEL_STABLE); - - len = strlen(path); - if (!strcmp((path + len - 4), ".edj")) - { - char key[128]; - const char *ref; - - /* XXX this is a memory leak. We string share the string but - * the user won't be freeing it as it's const char *.... we - * end up leaking it */ - snprintf(key, sizeof(key), "/stock/icon/%s", icon); - DRETURN_PTR(ecore_string_instance(key), DLEVEL_STABLE); - } - - DRETURN_PTR(icon, DLEVEL_STABLE); } static void =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_icon_theme.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- ewl_icon_theme.h 13 Dec 2006 07:18:59 -0000 1.6 +++ ewl_icon_theme.h 13 Dec 2006 19:00:03 -0000 1.7 @@ -15,8 +15,6 @@ const char *ewl_icon_theme_icon_path_get(const char *icon, const char *size); -const char *ewl_icon_theme_icon_key_get(const char *path, - const char *icon); #define EWL_ICON_SIZE_SMALL "16x16" /**< 16x16 icons */ #define EWL_ICON_SIZE_MEDIUM "22x22" /**< 22x22 icons */ =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_stock.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- ewl_stock.c 13 Dec 2006 07:18:59 -0000 1.4 +++ ewl_stock.c 13 Dec 2006 19:00:03 -0000 1.5 @@ -106,16 +106,15 @@ /* set the image */ if (s->stock_funcs->image_set) { - const char *data, *key; + const char *data; /* check for an image key */ data = ewl_icon_theme_icon_path_get( ewl_stock_items[s->stock_type].image_key, EWL_ICON_SIZE_MEDIUM); - key = ewl_icon_theme_icon_key_get(data, - ewl_stock_items[s->stock_type].image_key); - s->stock_funcs->image_set(s, data, key); + s->stock_funcs->image_set(s, data, + ewl_stock_items[s->stock_type].image_key); } /* set the tooltip */ ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs