struct _Widget_Data
{
Evas_Object *img;
- Eina_Bool scale_up : 1;
- Eina_Bool scale_down : 1;
- Eina_Bool smooth : 1;
- Eina_Bool fill_outside : 1;
- Eina_Bool no_scale : 1;
+ Eina_Bool scale_up : 1;
+ Eina_Bool scale_down : 1;
+ Eina_Bool smooth : 1;
+ Eina_Bool fill_outside : 1;
+ Eina_Bool no_scale : 1;
};
static void _del_hook(Evas_Object *obj);
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
evas_object_del(wd->img);
free(wd);
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
_sizing_eval(obj);
}
_sizing_eval(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1;
int w, h;
+ if (!wd) return;
_els_smart_icon_size_get(wd->img, &w, &h);
_els_smart_icon_scale_up_set(wd->img, wd->scale_up);
_els_smart_icon_scale_down_set(wd->img, wd->scale_down);
{
Widget_Data *wd = elm_widget_data_get(obj);
Eina_Bool ret;
- if (!wd) return EINA_FALSE;
const char *p;
- if (!file) return EINA_FALSE;
+ if ((!wd) || (!file)) return EINA_FALSE;
if (((p = strrchr(file, '.'))) && (!strcasecmp(p, ".edj")))
ret = _els_smart_icon_file_edje_set(wd->img, file, group);
else
elm_image_smooth_set(Evas_Object *obj, Eina_Bool smooth)
{
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
wd->smooth = smooth;
_sizing_eval(obj);
elm_image_object_size_get(const Evas_Object *obj, int *w, int *h)
{
Widget_Data *wd = elm_widget_data_get(obj);
+
_els_smart_icon_size_get(wd->img, w, h);
}
elm_image_no_scale_set(Evas_Object *obj, Eina_Bool no_scale)
{
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
wd->no_scale = no_scale;
_sizing_eval(obj);
elm_image_scale_set(Evas_Object *obj, Eina_Bool scale_up, Eina_Bool scale_down)
{
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
wd->scale_up = scale_up;
wd->scale_down = scale_down;
elm_image_fill_outside_set(Evas_Object *obj, Eina_Bool fill_outside)
{
Widget_Data *wd = elm_widget_data_get(obj);
+
if (!wd) return;
wd->fill_outside = fill_outside;
_sizing_eval(obj);
elm_image_prescale_set(Evas_Object *obj, int size)
{
Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
+ if (!wd) return;
_els_smart_icon_scale_size_set(wd->img, size);
}
elm_image_orient_set(Evas_Object *obj, Elm_Image_Orient orient)
{
Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
+ if (!wd) return;
_els_smart_icon_orient_set(wd->img, orient);
}