1 #include <Elementary.h>
5 #define NON_EXISTING (void *)-1
6 static const char *icon_theme = NULL;
12 * A standard icon that may be provided by the theme (delete, edit,
13 * arrows etc.) or a custom file (PNG, JPG, EDJE etc.) used for an
14 * icon. The Icon may scale or not and of course... support alpha
17 * Signals that you can add callbacks for are:
19 * "clicked" - This is called when a user has clicked the icon
22 typedef struct _Widget_Data Widget_Data;
28 Elm_Icon_Lookup_Order lookup_order;
30 #ifdef HAVE_ELEMENTARY_ETHUMB
39 Ethumb_Exists *exists;
41 Ecore_Event_Handler *eeh;
43 Ethumb_Thumb_Format format;
55 Eina_Bool scale_up : 1;
56 Eina_Bool scale_down : 1;
58 Eina_Bool fill_outside : 1;
59 Eina_Bool no_scale : 1;
62 #ifdef HAVE_ELEMENTARY_ETHUMB
63 static Eina_List *_elm_icon_retry = NULL;
64 static int _icon_pending_request = 0;
66 static void _icon_thumb_exists(Ethumb_Client *client __UNUSED__, Ethumb_Exists *thread, Eina_Bool exists, void *data);
69 static const char *widtype = NULL;
70 static void _del_hook(Evas_Object *obj);
71 static void _theme_hook(Evas_Object *obj);
72 static void _sizing_eval(Evas_Object *obj);
73 static void _mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
75 static Eina_Bool _icon_standard_set(Widget_Data *wd, Evas_Object *obj, const char *name);
76 static Eina_Bool _icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, int size);
78 static const char SIG_CLICKED[] = "clicked";
80 static const Evas_Smart_Cb_Description _signals[] = {
86 //FIXME: move this code to ecore
89 _path_is_absolute(const char *path)
91 //TODO: Check if this works with all absolute paths in windows
92 return ((isalpha (*path)) && (*(path + 1) == ':') && ((*(path + 2) == '\\') || (*(path + 2) == '/')));
96 _path_is_absolute(const char *path)
98 return (*path == '/');
103 _icon_size_min_get(Evas_Object *icon)
106 _els_smart_icon_size_get(icon, &size, NULL);
107 return (size < 32) ? 32 : size;
110 #ifdef HAVE_ELEMENTARY_ETHUMB
112 _icon_thumb_stop(Widget_Data *wd, void *ethumbd)
114 if (wd->thumb.id > 0)
116 ethumb_client_generate_cancel(ethumbd, wd->thumb.id, NULL, NULL, NULL);
118 _icon_pending_request--;
121 if (wd->thumb.exists)
123 ethumb_client_thumb_exists_cancel(wd->thumb.exists, _icon_thumb_exists, wd);
124 wd->thumb.exists = NULL;
125 _icon_pending_request--;
130 _elm_icon_retry = eina_list_remove(_elm_icon_retry, wd);
131 wd->thumb.retry = EINA_FALSE;
136 _icon_thumb_display(Widget_Data *wd)
138 Eina_Bool ret = EINA_FALSE;
140 if (wd->thumb.format == ETHUMB_THUMB_EET)
142 static const char *extensions[] = {
143 ".avi", ".mp4", ".ogv", ".mov", ".mpg", ".wmv", NULL
145 const char **ext, *ptr;
147 Eina_Bool video = EINA_FALSE;
149 prefix_size = eina_stringshare_strlen(wd->thumb.file.path) - 4;
150 if (prefix_size >= 0)
152 ptr = wd->thumb.file.path + prefix_size;
153 for (ext = extensions; *ext; ++ext)
154 if (!strcasecmp(ptr, *ext))
162 ret = _els_smart_icon_file_edje_set(wd->img, wd->thumb.thumb.path, "movie/thumb");
166 ret = _els_smart_icon_file_key_set(wd->img, wd->thumb.thumb.path, wd->thumb.thumb.key);
172 _icon_thumb_retry(Widget_Data *wd)
174 return _icon_thumb_display(wd);
178 _icon_thumb_cleanup(Ethumb_Client *ethumbd)
183 EINA_LIST_FOREACH_SAFE(_elm_icon_retry, l, ll, wd)
184 if (_icon_thumb_retry(wd))
186 _elm_icon_retry = eina_list_remove_list(_elm_icon_retry, l);
187 wd->thumb.retry = EINA_FALSE;
190 if (_icon_pending_request == 0)
191 EINA_LIST_FREE(_elm_icon_retry, wd)
192 _icon_thumb_stop(wd, ethumbd);
196 _icon_thumb_finish(Widget_Data *wd, Ethumb_Client *ethumbd)
198 const char *file = NULL, *group = NULL;
201 _els_smart_icon_file_get(wd->img, &file, &group);
202 file = eina_stringshare_ref(file);
203 group = eina_stringshare_ref(group);
205 ret = _icon_thumb_display(wd);
211 if (!wd->thumb.retry)
213 _elm_icon_retry = eina_list_append(_elm_icon_retry, wd);
214 wd->thumb.retry = EINA_TRUE;
217 /* Back to previous image */
218 if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj")))
219 _els_smart_icon_file_edje_set(wd->img, file, group);
221 _els_smart_icon_file_key_set(wd->img, file, group);
224 _icon_thumb_cleanup(ethumbd);
226 eina_stringshare_del(file);
227 eina_stringshare_del(group);
231 _icon_thumb_cb(void *data,
232 Ethumb_Client *ethumbd,
234 const char *file __UNUSED__,
235 const char *key __UNUSED__,
236 const char *thumb_path,
237 const char *thumb_key,
240 Widget_Data *wd = data;
242 EINA_SAFETY_ON_FALSE_RETURN(wd->thumb.id == id);
245 _icon_pending_request--;
249 eina_stringshare_replace(&wd->thumb.thumb.path, thumb_path);
250 eina_stringshare_replace(&wd->thumb.thumb.key, thumb_key);
251 wd->thumb.format = ethumb_client_format_get(ethumbd);
253 _icon_thumb_finish(wd, ethumbd);
257 ERR("could not generate thumbnail for %s (key: %s)", file, key);
258 _icon_thumb_cleanup(ethumbd);
263 _icon_thumb_exists(Ethumb_Client *client __UNUSED__, Ethumb_Exists *thread, Eina_Bool exists, void *data)
265 Widget_Data *wd = data;
266 Ethumb_Client *ethumbd;
268 if (ethumb_client_thumb_exists_check(thread))
271 wd->thumb.exists = NULL;
273 ethumbd = elm_thumb_ethumb_client_get();
277 const char *thumb_path, *thumb_key;
279 _icon_pending_request--;
280 ethumb_client_thumb_path_get(ethumbd, &thumb_path, &thumb_key);
281 eina_stringshare_replace(&wd->thumb.thumb.path, thumb_path);
282 eina_stringshare_replace(&wd->thumb.thumb.key, thumb_key);
283 wd->thumb.format = ethumb_client_format_get(ethumbd);
285 _icon_thumb_finish(wd, ethumbd);
287 else if ((wd->thumb.id = ethumb_client_generate(ethumbd, _icon_thumb_cb, wd, NULL)) == -1)
289 /* Failed to generate thumbnail */
290 _icon_pending_request--;
295 _icon_thumb_apply(Widget_Data *wd)
297 Ethumb_Client *ethumbd;
299 ethumbd = elm_thumb_ethumb_client_get();
301 _icon_thumb_stop(wd, ethumbd);
303 if (!wd->thumb.file.path) return ;
304 fprintf(stderr, "thumb\n");
306 _icon_pending_request++;
307 ethumb_client_file_set(ethumbd, wd->thumb.file.path, wd->thumb.file.key);
308 ethumb_client_size_set(ethumbd, _icon_size_min_get(wd->img), _icon_size_min_get(wd->img));
309 wd->thumb.exists = ethumb_client_thumb_exists(ethumbd, _icon_thumb_exists, wd);
313 _icon_thumb_apply_cb(void *data, int type __UNUSED__, void *ev __UNUSED__)
315 Widget_Data *wd = data;
317 _icon_thumb_apply(wd);
318 return ECORE_CALLBACK_RENEW;
323 _del_hook(Evas_Object *obj)
325 Widget_Data *wd = elm_widget_data_get(obj);
326 #ifdef HAVE_ELEMENTARY_ETHUMB
327 Ethumb_Client *ethumbd;
331 if (wd->stdicon) eina_stringshare_del(wd->stdicon);
333 #ifdef HAVE_ELEMENTARY_ETHUMB
334 ethumbd = elm_thumb_ethumb_client_get();
335 _icon_thumb_stop(wd, ethumbd);
337 eina_stringshare_del(wd->thumb.file.path);
338 eina_stringshare_del(wd->thumb.file.key);
339 eina_stringshare_del(wd->thumb.thumb.path);
340 eina_stringshare_del(wd->thumb.thumb.key);
343 ecore_event_handler_del(wd->thumb.eeh);
350 _theme_hook(Evas_Object *obj)
352 Widget_Data *wd = elm_widget_data_get(obj);
355 _elm_theme_object_icon_set(obj, wd->img, wd->stdicon, elm_widget_style_get(obj));
360 _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
362 Widget_Data *wd = elm_widget_data_get(obj);
364 Evas_Object *icon_edje;
365 icon_edje = _els_smart_icon_edje_get(wd->img);
366 if (!icon_edje) return;
367 edje_object_signal_emit(icon_edje, emission, source);
371 _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
373 Widget_Data *wd = elm_widget_data_get(obj);
375 Evas_Object *icon_edje;
376 icon_edje = _els_smart_icon_edje_get(wd->img);
377 if (!icon_edje) return;
378 edje_object_signal_callback_add(icon_edje, emission, source, func_cb, data);
382 _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
384 Widget_Data *wd = elm_widget_data_get(obj);
386 Evas_Object *icon_edje;
387 icon_edje = _els_smart_icon_edje_get(wd->img);
388 if (!icon_edje) return;
389 edje_object_signal_callback_del_full(icon_edje, emission, source, func_cb,
394 _sizing_eval(Evas_Object *obj)
396 Widget_Data *wd = elm_widget_data_get(obj);
398 Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
401 _els_smart_icon_size_get(wd->img, &w, &h);
403 if ((wd->freedesktop.use) && (!((w - wd->freedesktop.requested_size) % 16)))
405 /* This icon has been set to a freedesktop icon, and the requested
406 appears to have a different size than the requested size, so try to
407 request another, higher resolution, icon.
408 FIXME: Find a better heuristic to determine if there should be
409 an icon with a different resolution. */
410 _icon_freedesktop_set(wd, obj, wd->stdicon, w);
413 _els_smart_icon_scale_up_set(wd->img, wd->scale_up);
414 _els_smart_icon_scale_down_set(wd->img, wd->scale_down);
415 _els_smart_icon_smooth_scale_set(wd->img, wd->smooth);
416 _els_smart_icon_fill_inside_set(wd->img, !(wd->fill_outside));
417 if (wd->no_scale) _els_smart_icon_scale_set(wd->img, 1.0);
420 _els_smart_icon_scale_set(wd->img, elm_widget_scale_get(obj) *
422 _els_smart_icon_size_get(wd->img, &w, &h);
434 evas_object_size_hint_min_set(obj, minw, minh);
435 evas_object_size_hint_max_set(obj, maxw, maxh);
439 _mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
441 Evas_Event_Mouse_Up *ev = event_info;
442 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
443 evas_object_smart_callback_call(data, SIG_CLICKED, event_info);
447 * Add a new icon to the parent
449 * @param parent The parent object
450 * @return The new object or NULL if it cannot be created
455 elm_icon_add(Evas_Object *parent)
461 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
463 ELM_SET_WIDTYPE(widtype, "icon");
464 elm_widget_type_set(obj, "icon");
465 elm_widget_can_focus_set(obj, EINA_FALSE);
466 elm_widget_sub_object_add(parent, obj);
467 elm_widget_data_set(obj, wd);
468 elm_widget_del_hook_set(obj, _del_hook);
469 elm_widget_theme_hook_set(obj, _theme_hook);
470 elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
471 elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
472 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
474 wd->lookup_order = ELM_ICON_LOOKUP_THEME_FDO;
475 wd->img = _els_smart_icon_add(e);
476 evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP,
478 evas_object_repeat_events_set(wd->img, EINA_TRUE);
479 elm_widget_resize_object_set(obj, wd->img);
481 evas_object_smart_callbacks_descriptions_set(obj, _signals);
483 #ifdef HAVE_ELEMENTARY_ETHUMB
487 wd->smooth = EINA_TRUE;
488 wd->scale_up = EINA_TRUE;
489 wd->scale_down = EINA_TRUE;
496 * Set the file that will be used as icon
498 * @param obj The icon object
499 * @param file The path to file that will be used as icon
500 * @param group The group that the icon belongs in edje file
502 * @return (1 = success, 0 = error)
507 elm_icon_file_set(Evas_Object *obj, const char *file, const char *group)
509 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
510 Widget_Data *wd = elm_widget_data_get(obj);
514 if (!wd) return EINA_FALSE;
515 EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE);
516 if (wd->stdicon) eina_stringshare_del(wd->stdicon);
518 if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj")))
519 ret = _els_smart_icon_file_edje_set(wd->img, file, group);
521 ret = _els_smart_icon_file_key_set(wd->img, file, group);
527 * Get the file that will be used as icon
529 * @param obj The icon object
530 * @param file The path to file that will be used as icon
531 * @param group The group that the icon belongs in edje file
536 elm_icon_file_get(const Evas_Object *obj, const char **file, const char **group)
538 ELM_CHECK_WIDTYPE(obj, widtype);
539 Widget_Data *wd = elm_widget_data_get(obj);
541 _els_smart_icon_file_get(wd->img, file, group);
545 elm_icon_thumb_set(const Evas_Object *obj, const char *file, const char *group)
547 ELM_CHECK_WIDTYPE(obj, widtype);
548 Widget_Data *wd = elm_widget_data_get(obj);
551 #ifdef HAVE_ELEMENTARY_ETHUMB
552 eina_stringshare_replace(&wd->thumb.file.path, file);
553 eina_stringshare_replace(&wd->thumb.file.key, group);
555 if (elm_thumb_ethumb_client_connected())
557 _icon_thumb_apply(wd);
563 wd->thumb.eeh = ecore_event_handler_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, _icon_thumb_apply_cb, wd);
573 _icon_standard_set(Widget_Data *wd, Evas_Object *obj, const char *name)
575 if (_elm_theme_object_icon_set(obj, wd->img, name, "default"))
578 /* TODO: elm_unneed_efreet() */
579 wd->freedesktop.use = EINA_FALSE;
587 _icon_file_set(Widget_Data *wd, Evas_Object *obj, const char *path)
589 if (elm_icon_file_set(obj, path, NULL))
592 /* TODO: elm_unneed_efreet() */
593 wd->freedesktop.use = EINA_FALSE;
601 _icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, int size)
607 if (icon_theme == NON_EXISTING) return EINA_FALSE;
610 Efreet_Icon_Theme *theme;
611 /* TODO: Listen for EFREET_EVENT_ICON_CACHE_UPDATE */
612 theme = efreet_icon_theme_find(getenv("E_ICON_THEME"));
616 static const char *themes[] = {
617 "gnome", "Human", "oxygen", "hicolor", NULL
619 for (itr = themes; *itr; itr++)
621 theme = efreet_icon_theme_find(*itr);
628 icon_theme = NON_EXISTING;
632 icon_theme = eina_stringshare_add(theme->name.internal);
634 path = efreet_icon_path_find(icon_theme, name, size);
635 wd->freedesktop.use = !!path;
636 if (wd->freedesktop.use)
638 wd->freedesktop.requested_size = size;
639 elm_icon_file_set(obj, path, NULL);
647 _elm_icon_standard_set(Widget_Data *wd, Evas_Object *obj, const char *name, Eina_Bool *fdo)
652 /* try locating the icon using the specified lookup order */
653 switch (wd->lookup_order)
655 case ELM_ICON_LOOKUP_FDO:
656 ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img));
657 if (ret && fdo) *fdo = EINA_TRUE;
659 case ELM_ICON_LOOKUP_THEME:
660 ret = _icon_standard_set(wd, obj, name);
662 case ELM_ICON_LOOKUP_THEME_FDO:
663 ret = _icon_standard_set(wd, obj, name);
666 ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img));
667 if (ret && fdo) *fdo = EINA_TRUE;
670 case ELM_ICON_LOOKUP_FDO_THEME:
672 ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img));
674 ret = _icon_standard_set(wd, obj, name);
682 eina_stringshare_replace(&wd->stdicon, name);
687 if (_path_is_absolute(name))
688 return _icon_file_set(wd, obj, name);
690 /* if that fails, see if icon name is in the format size/name. if so,
691 try locating a fallback without the size specification */
692 if (!(tmp = strchr(name, '/'))) return EINA_FALSE;
694 if (*tmp) return elm_icon_standard_set(obj, tmp);
700 _elm_icon_standard_resize(void *data,
703 void *event_info __UNUSED__)
705 Widget_Data *wd = data;
706 const char *refup = eina_stringshare_ref(wd->stdicon);
707 Eina_Bool fdo = EINA_FALSE;
709 if (!_elm_icon_standard_set(wd, obj, wd->stdicon, &fdo) || (!fdo))
710 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
711 _elm_icon_standard_resize, wd);
712 #ifdef HAVE_ELEMENTARY_ETHUMB
713 if (wd->thumb.file.path)
714 elm_icon_thumb_set(obj, wd->thumb.file.path, wd->thumb.file.key);
717 eina_stringshare_del(refup);
721 * Set the theme, as standard, for an icon.
722 * If theme was not found and it is the absolute path of an image file, this
723 * image will be used.
725 * @param obj The icon object
726 * @param name The theme name
728 * @return (1 = success, 0 = error)
733 elm_icon_standard_set(Evas_Object *obj, const char *name)
735 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
736 Widget_Data *wd = elm_widget_data_get(obj);
737 Eina_Bool fdo = EINA_FALSE;
740 if ((!wd) || (!name)) return EINA_FALSE;
742 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
743 _elm_icon_standard_resize, wd);
745 ret = _elm_icon_standard_set(wd, obj, name, &fdo);
748 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
749 _elm_icon_standard_resize, wd);
755 * Get the theme, as standard, for an icon
757 * @param obj The icon object
758 * @return The theme name
763 elm_icon_standard_get(const Evas_Object *obj)
765 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
766 Widget_Data *wd = elm_widget_data_get(obj);
767 if (!wd) return NULL;
772 * Sets icon lookup order, used by elm_icon_standard_set().
774 * @param obj The icon object
775 * @param order The icon lookup order
780 elm_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order)
782 ELM_CHECK_WIDTYPE(obj, widtype);
783 Widget_Data *wd = elm_widget_data_get(obj);
784 if (wd) wd->lookup_order = order;
788 * Gets the icon lookup order.
790 * @param obj The icon object
791 * @return The icon lookup order
795 EAPI Elm_Icon_Lookup_Order
796 elm_icon_order_lookup_get(const Evas_Object *obj)
798 ELM_CHECK_WIDTYPE(obj, widtype) ELM_ICON_LOOKUP_THEME_FDO;
799 Widget_Data *wd = elm_widget_data_get(obj);
800 if (!wd) return ELM_ICON_LOOKUP_THEME_FDO;
801 return wd->lookup_order;
805 * Set the smooth effect for an icon
807 * @param obj The icon object
808 * @param smooth A bool to set (or no) smooth effect
809 * (1 = smooth, 0 = not smooth)
814 elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smooth)
816 ELM_CHECK_WIDTYPE(obj, widtype);
817 Widget_Data *wd = elm_widget_data_get(obj);
825 * Get the smooth effect for an icon
827 * @param obj The icon object
828 * @return If setted smooth effect
833 elm_icon_smooth_get(const Evas_Object *obj)
835 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
836 Widget_Data *wd = elm_widget_data_get(obj);
838 if (!wd) return EINA_FALSE;
843 * Set if the object is scalable
845 * @param obj The icon object
846 * @param no_scale A bool to set scale (or no)
847 * (1 = no_scale, 0 = scale)
852 elm_icon_no_scale_set(Evas_Object *obj, Eina_Bool no_scale)
854 ELM_CHECK_WIDTYPE(obj, widtype);
855 Widget_Data *wd = elm_widget_data_get(obj);
858 wd->no_scale = no_scale;
863 * Get if the object isn't scalable
865 * @param obj The icon object
866 * @return If isn't scalable
871 elm_icon_no_scale_get(const Evas_Object *obj)
873 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
874 Widget_Data *wd = elm_widget_data_get(obj);
875 if (!wd) return EINA_FALSE;
880 * Set if the object is (up/down) scalable
882 * @param obj The icon object
883 * @param scale_up A bool to set if the object is scalable up
884 * @param scale_down A bool to set if the object is scalable down
889 elm_icon_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down)
891 ELM_CHECK_WIDTYPE(obj, widtype);
892 Widget_Data *wd = elm_widget_data_get(obj);
895 wd->scale_up = scale_up;
896 wd->scale_down = scale_down;
901 * Get if the object is (up/down) scalable
903 * @param obj The icon object
904 * @param scale_up A bool to set if the object is scalable up
905 * @param scale_down A bool to set if the object is scalable down
910 elm_icon_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down)
912 ELM_CHECK_WIDTYPE(obj, widtype);
913 Widget_Data *wd = elm_widget_data_get(obj);
915 if (scale_up) *scale_up = wd->scale_up;
916 if (scale_down) *scale_down = wd->scale_down;
920 * Set if the object is filled outside
922 * @param obj The icon object
923 * @param fill_outside A bool to set if the object is filled outside
924 * (1 = filled, 0 = no filled)
929 elm_icon_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside)
931 ELM_CHECK_WIDTYPE(obj, widtype);
932 Widget_Data *wd = elm_widget_data_get(obj);
935 wd->fill_outside = fill_outside;
940 * Get if the object is filled outside
942 * @param obj The icon object
943 * @return If the object is filled outside
948 elm_icon_fill_outside_get(const Evas_Object *obj)
950 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
951 Widget_Data *wd = elm_widget_data_get(obj);
953 if (!wd) return EINA_FALSE;
954 return wd->fill_outside;
958 * Set the prescale size for the icon
960 * @param obj The icon object
961 * @param size The prescale size
966 elm_icon_prescale_set(Evas_Object *obj, int size)
968 ELM_CHECK_WIDTYPE(obj, widtype);
969 Widget_Data *wd = elm_widget_data_get(obj);
972 _els_smart_icon_scale_size_set(wd->img, size);
976 * Get the prescale size for the icon
978 * @param obj The icon object
979 * @return The prescale size
984 elm_icon_prescale_get(const Evas_Object *obj)
986 ELM_CHECK_WIDTYPE(obj, widtype) 0;
987 Widget_Data *wd = elm_widget_data_get(obj);
990 return _els_smart_icon_scale_size_get(wd->img);