summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_icon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/elementary/elm_icon.c')
-rw-r--r--src/lib/elementary/elm_icon.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/src/lib/elementary/elm_icon.c b/src/lib/elementary/elm_icon.c
index 2d612af..819f549 100644
--- a/src/lib/elementary/elm_icon.c
+++ b/src/lib/elementary/elm_icon.c
@@ -9,7 +9,7 @@
9#include "elm_priv.h" 9#include "elm_priv.h"
10#include "elm_widget_icon.h" 10#include "elm_widget_icon.h"
11#include "efl_ui_widget_image.h" 11#include "efl_ui_widget_image.h"
12#include "elm_icon.eo.h" 12#include "elm_icon_eo.h"
13 13
14#define NON_EXISTING (void *)-1 14#define NON_EXISTING (void *)-1
15 15
@@ -312,22 +312,25 @@ _edje_signals_free(Elm_Icon_Data *sd)
312 } 312 }
313} 313}
314 314
315EOLIAN static Eina_Bool 315EOLIAN static Eina_Error
316_elm_icon_efl_file_file_set(Eo *obj, Elm_Icon_Data *sd, const char *file, const char *key) 316_elm_icon_efl_file_load(Eo *obj, Elm_Icon_Data *sd)
317{ 317{
318 Evas_Object *pclip; 318 Evas_Object *pclip;
319 const char *key;
320 Eina_Error err;
319 321
322 if (efl_file_loaded_get(obj)) return 0;
323 err = efl_file_load(efl_super(obj, MY_CLASS));
324 if (err) return err;
325
320 Efl_Ui_Image_Data *id = efl_data_scope_get(obj, EFL_UI_IMAGE_CLASS); 326 Efl_Ui_Image_Data *id = efl_data_scope_get(obj, EFL_UI_IMAGE_CLASS);
321 327
322 EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE);
323
324 _edje_signals_free(sd); 328 _edje_signals_free(sd);
325 329
326 if (!sd->freedesktop.use) 330 if (!sd->freedesktop.use)
327 ELM_SAFE_FREE(sd->stdicon, eina_stringshare_del); 331 ELM_SAFE_FREE(sd->stdicon, eina_stringshare_del);
328 332
329 if (!sd->is_video) 333 if (!sd->is_video) return 0;
330 return efl_file_set(efl_super(obj, MY_CLASS), file, key);
331 334
332 /* parent's edje file setting path replicated here (we got .eet 335 /* parent's edje file setting path replicated here (we got .eet
333 * extension, so bypassing it) */ 336 * extension, so bypassing it) */
@@ -346,30 +349,33 @@ _elm_icon_efl_file_file_set(Eo *obj, Elm_Icon_Data *sd, const char *file, const
346 evas_object_clip_set(id->img, pclip); 349 evas_object_clip_set(id->img, pclip);
347 id->edje = EINA_TRUE; 350 id->edje = EINA_TRUE;
348 } 351 }
349 352 key = efl_file_key_get(obj);
350 if (!edje_object_file_set(id->img, file, key)) 353 efl_file_key_set(id->img, key);
354 err = efl_file_mmap_set(id->img, efl_file_mmap_get(obj));
355 if (!err) err = efl_file_load(id->img);
356 if (err)
351 { 357 {
352 ERR("failed to set edje file '%s', group '%s': %s", file, key, 358 ERR("failed to set edje file '%s', group '%s': %s", efl_file_get(id->img), key,
353 edje_load_error_str 359 edje_load_error_str
354 (edje_object_load_error_get(id->img))); 360 (edje_object_load_error_get(id->img)));
355 return EINA_FALSE; 361 return err;
356 } 362 }
357 363
358 evas_object_geometry_set(id->img, id->img_x, id->img_y, id->img_w, id->img_h); 364 evas_object_geometry_set(id->img, id->img_x, id->img_y, id->img_w, id->img_h);
359 365
360 return EINA_TRUE; 366 return 0;
361} 367}
362 368
363EOLIAN static Efl_Ui_Theme_Apply_Result 369EOLIAN static Eina_Error
364_elm_icon_efl_ui_widget_theme_apply(Eo *obj, Elm_Icon_Data *sd) 370_elm_icon_efl_ui_widget_theme_apply(Eo *obj, Elm_Icon_Data *sd)
365{ 371{
366 Efl_Ui_Theme_Apply_Result int_ret = EFL_UI_THEME_APPLY_RESULT_FAIL; 372 Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC;
367 373
368 if (sd->stdicon) 374 if (sd->stdicon)
369 _elm_theme_object_icon_set(obj, sd->stdicon, elm_widget_style_get(obj)); 375 _elm_theme_object_icon_set(obj, sd->stdicon, elm_widget_style_get(obj));
370 376
371 int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); 377 int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
372 if (!int_ret) return EFL_UI_THEME_APPLY_RESULT_FAIL; 378 if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret;
373 379
374 return int_ret; 380 return int_ret;
375} 381}
@@ -652,7 +658,7 @@ elm_icon_file_set(Evas_Object *obj,
652 ELM_ICON_CHECK(obj) EINA_FALSE; 658 ELM_ICON_CHECK(obj) EINA_FALSE;
653 EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE); 659 EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE);
654 660
655 return efl_file_set(obj, file, group); 661 return efl_file_simple_load(obj, file, group);
656} 662}
657 663
658EAPI void 664EAPI void
@@ -917,4 +923,4 @@ elm_icon_order_lookup_get(const Evas_Object *obj EINA_UNUSED)
917#define ELM_ICON_EXTRA_OPS \ 923#define ELM_ICON_EXTRA_OPS \
918 EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_icon) 924 EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_icon)
919 925
920#include "elm_icon.eo.c" 926#include "elm_icon_eo.c"