1 #include <Elementary.h>
5 #define NON_EXISTING (void *)-1
6 static const char *icon_theme = NULL;
13 * A standard icon that may be provided by the theme (delete, edit,
14 * arrows etc.) or a custom file (PNG, JPG, EDJE etc.) used for an
15 * icon. The Icon may scale or not and of course... support alpha
18 * Signals that you can add callbacks for are:
20 * "clicked" - This is called when a user has clicked the icon
23 typedef struct _Widget_Data Widget_Data;
29 Elm_Icon_Lookup_Order lookup_order;
31 #ifdef HAVE_ELEMENTARY_ETHUMB
40 Ethumb_Exists *exists;
42 Ecore_Event_Handler *eeh;
44 Ethumb_Thumb_Format format;
56 Eina_Bool scale_up : 1;
57 Eina_Bool scale_down : 1;
59 Eina_Bool fill_outside : 1;
60 Eina_Bool no_scale : 1;
63 #ifdef HAVE_ELEMENTARY_ETHUMB
64 static Eina_List *_elm_icon_retry = NULL;
65 static int _icon_pending_request = 0;
67 static void _icon_thumb_exists(Ethumb_Client *client __UNUSED__, Ethumb_Exists *thread, Eina_Bool exists, void *data);
70 static const char *widtype = NULL;
71 static void _del_hook(Evas_Object *obj);
72 static void _theme_hook(Evas_Object *obj);
73 static void _sizing_eval(Evas_Object *obj);
74 static void _mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
76 static Eina_Bool _icon_standard_set(Widget_Data *wd, Evas_Object *obj, const char *name);
77 static Eina_Bool _icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, int size);
79 static const char SIG_CLICKED[] = "clicked";
81 static const Evas_Smart_Cb_Description _signals[] = {
87 //FIXME: move this code to ecore
90 _path_is_absolute(const char *path)
92 //TODO: Check if this works with all absolute paths in windows
93 return ((isalpha (*path)) && (*(path + 1) == ':') && ((*(path + 2) == '\\') || (*(path + 2) == '/')));
97 _path_is_absolute(const char *path)
99 return (*path == '/');
104 _icon_size_min_get(Evas_Object *icon)
107 _els_smart_icon_size_get(icon, &size, NULL);
108 return (size < 32) ? 32 : size;
111 #ifdef HAVE_ELEMENTARY_ETHUMB
113 _icon_thumb_stop(Widget_Data *wd, void *ethumbd)
115 if (wd->thumb.id >= 0)
117 ethumb_client_generate_cancel(ethumbd, wd->thumb.id, NULL, NULL, NULL);
119 _icon_pending_request--;
122 if (wd->thumb.exists)
124 ethumb_client_thumb_exists_cancel(wd->thumb.exists, _icon_thumb_exists, wd);
125 wd->thumb.exists = NULL;
126 _icon_pending_request--;
131 _elm_icon_retry = eina_list_remove(_elm_icon_retry, wd);
132 wd->thumb.retry = EINA_FALSE;
137 _icon_thumb_display(Widget_Data *wd)
139 Eina_Bool ret = EINA_FALSE;
141 if (wd->thumb.format == ETHUMB_THUMB_EET)
143 static const char *extensions[] = {
144 ".avi", ".mp4", ".ogv", ".mov", ".mpg", ".wmv", NULL
146 const char **ext, *ptr;
148 Eina_Bool video = EINA_FALSE;
150 prefix_size = eina_stringshare_strlen(wd->thumb.file.path) - 4;
151 if (prefix_size >= 0)
153 ptr = wd->thumb.file.path + prefix_size;
154 for (ext = extensions; *ext; ++ext)
155 if (!strcasecmp(ptr, *ext))
163 ret = _els_smart_icon_file_edje_set(wd->img, wd->thumb.thumb.path, wd->thumb.thumb.key);
167 ret = _els_smart_icon_file_key_set(wd->img, wd->thumb.thumb.path, wd->thumb.thumb.key);
173 _icon_thumb_retry(Widget_Data *wd)
175 return _icon_thumb_display(wd);
179 _icon_thumb_cleanup(Ethumb_Client *ethumbd)
184 EINA_LIST_FOREACH_SAFE(_elm_icon_retry, l, ll, wd)
185 if (_icon_thumb_retry(wd))
187 _elm_icon_retry = eina_list_remove_list(_elm_icon_retry, l);
188 wd->thumb.retry = EINA_FALSE;
191 if (_icon_pending_request == 0)
192 EINA_LIST_FREE(_elm_icon_retry, wd)
193 _icon_thumb_stop(wd, ethumbd);
197 _icon_thumb_finish(Widget_Data *wd, Ethumb_Client *ethumbd)
199 const char *file = NULL, *group = NULL;
202 _els_smart_icon_file_get(wd->img, &file, &group);
203 file = eina_stringshare_ref(file);
204 group = eina_stringshare_ref(group);
206 ret = _icon_thumb_display(wd);
212 if (!wd->thumb.retry)
214 _elm_icon_retry = eina_list_append(_elm_icon_retry, wd);
215 wd->thumb.retry = EINA_TRUE;
218 /* Back to previous image */
219 if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj")))
220 _els_smart_icon_file_edje_set(wd->img, file, group);
222 _els_smart_icon_file_key_set(wd->img, file, group);
225 _icon_thumb_cleanup(ethumbd);
227 eina_stringshare_del(file);
228 eina_stringshare_del(group);
232 _icon_thumb_cb(void *data,
233 Ethumb_Client *ethumbd,
235 const char *file __UNUSED__,
236 const char *key __UNUSED__,
237 const char *thumb_path,
238 const char *thumb_key,
241 Widget_Data *wd = data;
243 EINA_SAFETY_ON_FALSE_RETURN(wd->thumb.id == id);
246 _icon_pending_request--;
250 eina_stringshare_replace(&wd->thumb.thumb.path, thumb_path);
251 eina_stringshare_replace(&wd->thumb.thumb.key, thumb_key);
252 wd->thumb.format = ethumb_client_format_get(ethumbd);
254 _icon_thumb_finish(wd, ethumbd);
258 ERR("could not generate thumbnail for %s (key: %s)", file, key);
259 _icon_thumb_cleanup(ethumbd);
264 _icon_thumb_exists(Ethumb_Client *client __UNUSED__, Ethumb_Exists *thread, Eina_Bool exists, void *data)
266 Widget_Data *wd = data;
267 Ethumb_Client *ethumbd;
269 if (ethumb_client_thumb_exists_check(thread))
272 wd->thumb.exists = NULL;
274 ethumbd = elm_thumb_ethumb_client_get();
278 const char *thumb_path, *thumb_key;
280 _icon_pending_request--;
281 ethumb_client_thumb_path_get(ethumbd, &thumb_path, &thumb_key);
282 eina_stringshare_replace(&wd->thumb.thumb.path, thumb_path);
283 eina_stringshare_replace(&wd->thumb.thumb.key, thumb_key);
284 wd->thumb.format = ethumb_client_format_get(ethumbd);
286 _icon_thumb_finish(wd, ethumbd);
288 else if ((wd->thumb.id = ethumb_client_generate(ethumbd, _icon_thumb_cb, wd, NULL)) == -1)
290 ERR("Generate was unable to start !");
291 /* Failed to generate thumbnail */
292 _icon_pending_request--;
297 _icon_thumb_apply(Widget_Data *wd)
299 Ethumb_Client *ethumbd;
301 ethumbd = elm_thumb_ethumb_client_get();
303 _icon_thumb_stop(wd, ethumbd);
305 if (!wd->thumb.file.path) return ;
307 _icon_pending_request++;
308 if (!ethumb_client_file_set(ethumbd, wd->thumb.file.path, wd->thumb.file.key)) return ;
309 ethumb_client_size_set(ethumbd, _icon_size_min_get(wd->img), _icon_size_min_get(wd->img));
310 wd->thumb.exists = ethumb_client_thumb_exists(ethumbd, _icon_thumb_exists, wd);
314 _icon_thumb_apply_cb(void *data, int type __UNUSED__, void *ev __UNUSED__)
316 Widget_Data *wd = data;
318 _icon_thumb_apply(wd);
319 return ECORE_CALLBACK_RENEW;
324 _del_hook(Evas_Object *obj)
326 Widget_Data *wd = elm_widget_data_get(obj);
328 #ifdef HAVE_ELEMENTARY_ETHUMB
329 Ethumb_Client *ethumbd;
333 if (wd->stdicon) eina_stringshare_del(wd->stdicon);
335 #ifdef HAVE_ELEMENTARY_ETHUMB
336 ethumbd = elm_thumb_ethumb_client_get();
337 _icon_thumb_stop(wd, ethumbd);
339 eina_stringshare_del(wd->thumb.file.path);
340 eina_stringshare_del(wd->thumb.file.key);
341 eina_stringshare_del(wd->thumb.thumb.path);
342 eina_stringshare_del(wd->thumb.thumb.key);
345 ecore_event_handler_del(wd->thumb.eeh);
352 _theme_hook(Evas_Object *obj)
354 Widget_Data *wd = elm_widget_data_get(obj);
357 _elm_theme_object_icon_set(obj, wd->img, wd->stdicon, elm_widget_style_get(obj));
362 _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
364 Widget_Data *wd = elm_widget_data_get(obj);
366 Evas_Object *icon_edje;
367 icon_edje = _els_smart_icon_edje_get(wd->img);
368 if (!icon_edje) return;
369 edje_object_signal_emit(icon_edje, emission, source);
373 _signal_callback_add_hook(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
375 Widget_Data *wd = elm_widget_data_get(obj);
377 Evas_Object *icon_edje;
378 icon_edje = _els_smart_icon_edje_get(wd->img);
379 if (!icon_edje) return;
380 edje_object_signal_callback_add(icon_edje, emission, source, func_cb, data);
384 _signal_callback_del_hook(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
386 Widget_Data *wd = elm_widget_data_get(obj);
388 Evas_Object *icon_edje;
389 icon_edje = _els_smart_icon_edje_get(wd->img);
390 if (!icon_edje) return;
391 edje_object_signal_callback_del_full(icon_edje, emission, source, func_cb,
396 _sizing_eval(Evas_Object *obj)
398 Widget_Data *wd = elm_widget_data_get(obj);
400 Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
403 _els_smart_icon_size_get(wd->img, &w, &h);
405 if ((wd->freedesktop.use) && (!((w - wd->freedesktop.requested_size) % 16)))
407 /* This icon has been set to a freedesktop icon, and the requested
408 appears to have a different size than the requested size, so try to
409 request another, higher resolution, icon.
410 FIXME: Find a better heuristic to determine if there should be
411 an icon with a different resolution. */
412 _icon_freedesktop_set(wd, obj, wd->stdicon, w);
415 _els_smart_icon_scale_up_set(wd->img, wd->scale_up);
416 _els_smart_icon_scale_down_set(wd->img, wd->scale_down);
417 _els_smart_icon_smooth_scale_set(wd->img, wd->smooth);
418 _els_smart_icon_fill_inside_set(wd->img, !(wd->fill_outside));
419 if (wd->no_scale) _els_smart_icon_scale_set(wd->img, 1.0);
422 _els_smart_icon_scale_set(wd->img, elm_widget_scale_get(obj) *
424 _els_smart_icon_size_get(wd->img, &w, &h);
436 evas_object_size_hint_min_set(obj, minw, minh);
437 evas_object_size_hint_max_set(obj, maxw, maxh);
441 _mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
443 Evas_Event_Mouse_Up *ev = event_info;
444 if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
445 evas_object_smart_callback_call(data, SIG_CLICKED, event_info);
449 * Add a new icon to the parent
451 * @param parent The parent object
452 * @return The new object or NULL if it cannot be created
457 elm_icon_add(Evas_Object *parent)
463 ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
465 ELM_SET_WIDTYPE(widtype, "icon");
466 elm_widget_type_set(obj, "icon");
467 elm_widget_can_focus_set(obj, EINA_FALSE);
468 elm_widget_sub_object_add(parent, obj);
469 elm_widget_data_set(obj, wd);
470 elm_widget_del_hook_set(obj, _del_hook);
471 elm_widget_theme_hook_set(obj, _theme_hook);
472 elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
473 elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
474 elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
476 wd->lookup_order = ELM_ICON_LOOKUP_THEME_FDO;
477 wd->img = _els_smart_icon_add(e);
478 evas_object_event_callback_add(wd->img, EVAS_CALLBACK_MOUSE_UP,
480 evas_object_repeat_events_set(wd->img, EINA_TRUE);
481 elm_widget_resize_object_set(obj, wd->img);
483 evas_object_smart_callbacks_descriptions_set(obj, _signals);
485 #ifdef HAVE_ELEMENTARY_ETHUMB
489 wd->smooth = EINA_TRUE;
490 wd->scale_up = EINA_TRUE;
491 wd->scale_down = EINA_TRUE;
498 * Set the file that will be used as icon
500 * @param obj The icon object
501 * @param file The path to file that will be used as icon
502 * @param group The group that the icon belongs in edje file
504 * @return (1 = success, 0 = error)
509 elm_icon_file_set(Evas_Object *obj, const char *file, const char *group)
511 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
512 Widget_Data *wd = elm_widget_data_get(obj);
516 if (!wd) return EINA_FALSE;
517 EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE);
518 if (wd->stdicon) eina_stringshare_del(wd->stdicon);
520 if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj")))
521 ret = _els_smart_icon_file_edje_set(wd->img, file, group);
523 ret = _els_smart_icon_file_key_set(wd->img, file, group);
529 * Get the file that will be used as icon
531 * @param obj The icon object
532 * @param file The path to file that will be used as icon
533 * @param group The group that the icon belongs in edje file
538 elm_icon_file_get(const Evas_Object *obj, const char **file, const char **group)
540 ELM_CHECK_WIDTYPE(obj, widtype);
541 Widget_Data *wd = elm_widget_data_get(obj);
543 _els_smart_icon_file_get(wd->img, file, group);
547 elm_icon_thumb_set(const Evas_Object *obj, const char *file, const char *group)
549 ELM_CHECK_WIDTYPE(obj, widtype);
550 Widget_Data *wd = elm_widget_data_get(obj);
553 #ifdef HAVE_ELEMENTARY_ETHUMB
554 eina_stringshare_replace(&wd->thumb.file.path, file);
555 eina_stringshare_replace(&wd->thumb.file.key, group);
557 if (elm_thumb_ethumb_client_connected())
559 _icon_thumb_apply(wd);
565 wd->thumb.eeh = ecore_event_handler_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, _icon_thumb_apply_cb, wd);
575 _icon_standard_set(Widget_Data *wd, Evas_Object *obj, const char *name)
577 if (_elm_theme_object_icon_set(obj, wd->img, name, "default"))
580 /* TODO: elm_unneed_efreet() */
581 wd->freedesktop.use = EINA_FALSE;
589 _icon_file_set(Widget_Data *wd, Evas_Object *obj, const char *path)
591 if (elm_icon_file_set(obj, path, NULL))
594 /* TODO: elm_unneed_efreet() */
595 wd->freedesktop.use = EINA_FALSE;
603 _icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, int size)
609 if (icon_theme == NON_EXISTING) return EINA_FALSE;
612 Efreet_Icon_Theme *theme;
613 /* TODO: Listen for EFREET_EVENT_ICON_CACHE_UPDATE */
614 theme = efreet_icon_theme_find(getenv("E_ICON_THEME"));
618 static const char *themes[] = {
619 "gnome", "Human", "oxygen", "hicolor", NULL
621 for (itr = themes; *itr; itr++)
623 theme = efreet_icon_theme_find(*itr);
630 icon_theme = NON_EXISTING;
634 icon_theme = eina_stringshare_add(theme->name.internal);
636 path = efreet_icon_path_find(icon_theme, name, size);
637 wd->freedesktop.use = !!path;
638 if (wd->freedesktop.use)
640 wd->freedesktop.requested_size = size;
641 elm_icon_file_set(obj, path, NULL);
649 _elm_icon_standard_set(Widget_Data *wd, Evas_Object *obj, const char *name, Eina_Bool *fdo)
654 /* try locating the icon using the specified lookup order */
655 switch (wd->lookup_order)
657 case ELM_ICON_LOOKUP_FDO:
658 ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img));
659 if (ret && fdo) *fdo = EINA_TRUE;
661 case ELM_ICON_LOOKUP_THEME:
662 ret = _icon_standard_set(wd, obj, name);
664 case ELM_ICON_LOOKUP_THEME_FDO:
665 ret = _icon_standard_set(wd, obj, name);
668 ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img));
669 if (ret && fdo) *fdo = EINA_TRUE;
672 case ELM_ICON_LOOKUP_FDO_THEME:
674 ret = _icon_freedesktop_set(wd, obj, name, _icon_size_min_get(wd->img));
676 ret = _icon_standard_set(wd, obj, name);
684 eina_stringshare_replace(&wd->stdicon, name);
689 if (_path_is_absolute(name))
690 return _icon_file_set(wd, obj, name);
692 /* if that fails, see if icon name is in the format size/name. if so,
693 try locating a fallback without the size specification */
694 if (!(tmp = strchr(name, '/'))) return EINA_FALSE;
696 if (*tmp) return elm_icon_standard_set(obj, tmp);
702 _elm_icon_standard_resize(void *data,
705 void *event_info __UNUSED__)
707 Widget_Data *wd = data;
708 const char *refup = eina_stringshare_ref(wd->stdicon);
709 Eina_Bool fdo = EINA_FALSE;
711 if (!_elm_icon_standard_set(wd, obj, wd->stdicon, &fdo) || (!fdo))
712 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
713 _elm_icon_standard_resize, wd);
714 #ifdef HAVE_ELEMENTARY_ETHUMB
715 if (wd->thumb.file.path)
716 elm_icon_thumb_set(obj, wd->thumb.file.path, wd->thumb.file.key);
719 eina_stringshare_del(refup);
723 * Set the theme, as standard, for an icon.
724 * If theme was not found and it is the absolute path of an image file, this
725 * image will be used.
727 * @param obj The icon object
728 * @param name The theme name
730 * @return (1 = success, 0 = error)
735 elm_icon_standard_set(Evas_Object *obj, const char *name)
737 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
738 Widget_Data *wd = elm_widget_data_get(obj);
739 Eina_Bool fdo = EINA_FALSE;
742 if ((!wd) || (!name)) return EINA_FALSE;
744 evas_object_event_callback_del_full(obj, EVAS_CALLBACK_RESIZE,
745 _elm_icon_standard_resize, wd);
747 ret = _elm_icon_standard_set(wd, obj, name, &fdo);
750 evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
751 _elm_icon_standard_resize, wd);
757 * Get the theme, as standard, for an icon
759 * @param obj The icon object
760 * @return The theme name
765 elm_icon_standard_get(const Evas_Object *obj)
767 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
768 Widget_Data *wd = elm_widget_data_get(obj);
769 if (!wd) return NULL;
774 * Sets icon lookup order, used by elm_icon_standard_set().
776 * @param obj The icon object
777 * @param order The icon lookup order
782 elm_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order)
784 ELM_CHECK_WIDTYPE(obj, widtype);
785 Widget_Data *wd = elm_widget_data_get(obj);
786 if (wd) wd->lookup_order = order;
790 * Gets the icon lookup order.
792 * @param obj The icon object
793 * @return The icon lookup order
797 EAPI Elm_Icon_Lookup_Order
798 elm_icon_order_lookup_get(const Evas_Object *obj)
800 ELM_CHECK_WIDTYPE(obj, widtype) ELM_ICON_LOOKUP_THEME_FDO;
801 Widget_Data *wd = elm_widget_data_get(obj);
802 if (!wd) return ELM_ICON_LOOKUP_THEME_FDO;
803 return wd->lookup_order;
807 * Set the smooth effect for an icon
809 * @param obj The icon object
810 * @param smooth A bool to set (or no) smooth effect
811 * (1 = smooth, 0 = not smooth)
816 elm_icon_smooth_set(Evas_Object *obj, Eina_Bool smooth)
818 ELM_CHECK_WIDTYPE(obj, widtype);
819 Widget_Data *wd = elm_widget_data_get(obj);
827 * Get the smooth effect for an icon
829 * @param obj The icon object
830 * @return If setted smooth effect
835 elm_icon_smooth_get(const Evas_Object *obj)
837 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
838 Widget_Data *wd = elm_widget_data_get(obj);
840 if (!wd) return EINA_FALSE;
845 * Set if the object is scalable
847 * @param obj The icon object
848 * @param no_scale A bool to set scale (or no)
849 * (1 = no_scale, 0 = scale)
854 elm_icon_no_scale_set(Evas_Object *obj, Eina_Bool no_scale)
856 ELM_CHECK_WIDTYPE(obj, widtype);
857 Widget_Data *wd = elm_widget_data_get(obj);
860 wd->no_scale = no_scale;
865 * Get if the object isn't scalable
867 * @param obj The icon object
868 * @return If isn't scalable
873 elm_icon_no_scale_get(const Evas_Object *obj)
875 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
876 Widget_Data *wd = elm_widget_data_get(obj);
877 if (!wd) return EINA_FALSE;
882 * Set if the object is (up/down) scalable
884 * @param obj The icon object
885 * @param scale_up A bool to set if the object is scalable up
886 * @param scale_down A bool to set if the object is scalable down
891 elm_icon_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down)
893 ELM_CHECK_WIDTYPE(obj, widtype);
894 Widget_Data *wd = elm_widget_data_get(obj);
897 wd->scale_up = scale_up;
898 wd->scale_down = scale_down;
903 * Get if the object is (up/down) scalable
905 * @param obj The icon object
906 * @param scale_up A bool to set if the object is scalable up
907 * @param scale_down A bool to set if the object is scalable down
912 elm_icon_scale_get(const Evas_Object *obj, Eina_Bool *scale_up, Eina_Bool *scale_down)
914 ELM_CHECK_WIDTYPE(obj, widtype);
915 Widget_Data *wd = elm_widget_data_get(obj);
917 if (scale_up) *scale_up = wd->scale_up;
918 if (scale_down) *scale_down = wd->scale_down;
922 * Set if the object is filled outside
924 * @param obj The icon object
925 * @param fill_outside A bool to set if the object is filled outside
926 * (1 = filled, 0 = no filled)
931 elm_icon_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside)
933 ELM_CHECK_WIDTYPE(obj, widtype);
934 Widget_Data *wd = elm_widget_data_get(obj);
937 wd->fill_outside = fill_outside;
942 * Get if the object is filled outside
944 * @param obj The icon object
945 * @return If the object is filled outside
950 elm_icon_fill_outside_get(const Evas_Object *obj)
952 ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
953 Widget_Data *wd = elm_widget_data_get(obj);
955 if (!wd) return EINA_FALSE;
956 return wd->fill_outside;
960 * Set the prescale size for the icon
962 * @param obj The icon object
963 * @param size The prescale size
968 elm_icon_prescale_set(Evas_Object *obj, int size)
970 ELM_CHECK_WIDTYPE(obj, widtype);
971 Widget_Data *wd = elm_widget_data_get(obj);
974 _els_smart_icon_scale_size_set(wd->img, size);
978 * Get the prescale size for the icon
980 * @param obj The icon object
981 * @return The prescale size
986 elm_icon_prescale_get(const Evas_Object *obj)
988 ELM_CHECK_WIDTYPE(obj, widtype) 0;
989 Widget_Data *wd = elm_widget_data_get(obj);
992 return _els_smart_icon_scale_size_get(wd->img);