[genlist] apply r71140 with local enhancement
[framework/uifw/elementary.git] / src / lib / elm_bg.c
index 4d507e0..df29d5b 100644 (file)
@@ -8,9 +8,10 @@ struct _Widget_Data
    Evas_Object *base, *rect, *img, *overlay;
    const char  *file, *group;
    Elm_Bg_Option option;
-   struct {
-      Evas_Coord w, h;
-   } load_opts;
+   struct
+     {
+        Evas_Coord w, h;
+     } load_opts;
 };
 
 static const char *widtype = NULL;
@@ -121,19 +122,16 @@ _content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
 {
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd;
-
    if (part && strcmp(part, "overlay")) return;
-
    wd = elm_widget_data_get(obj);
    if (!wd) return;
-   if (wd->overlay)
-     {
-        evas_object_del(wd->overlay);
-        wd->overlay = NULL;
-     }
+
+   if (content == wd->overlay) return;
+   if (wd->overlay) evas_object_del(wd->overlay);
+
+   wd->overlay = content;
    if (content)
      {
-        wd->overlay = content;
         edje_object_part_swallow(wd->base, "elm.swallow.content", content);
         elm_widget_sub_object_add(obj, content);
      }
@@ -243,28 +241,28 @@ elm_bg_file_set(Evas_Object *obj, const char *file, const char *group)
    return EINA_TRUE;
 }
 
-EAPI Eina_Bool
+EAPI void
 elm_bg_file_get(const Evas_Object *obj, const char **file, const char **group)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (file) *file = wd->file;
    if (group) *group = wd->group;
 
-   return EINA_TRUE;
+   return;
 }
 
-EAPI Eina_Bool
+EAPI void
 elm_bg_option_set(Evas_Object *obj, Elm_Bg_Option option)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd;
 
    wd = elm_widget_data_get(obj);
    wd->option = option;
    _custom_resize(wd, NULL, NULL, NULL);
 
-   return EINA_TRUE;
+   return;
 }
 
 EAPI Elm_Bg_Option
@@ -277,10 +275,10 @@ elm_bg_option_get(const Evas_Object *obj)
    return wd->option;
 }
 
-EAPI Eina_Bool
+EAPI void
 elm_bg_color_set(Evas_Object *obj, int r, int g, int b)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd;
 
    wd = elm_widget_data_get(obj);
@@ -293,34 +291,34 @@ elm_bg_color_set(Evas_Object *obj, int r, int g, int b)
      }
    evas_object_color_set(wd->rect, r, g, b, 255);
 
-   return EINA_TRUE;
+   return;
 }
 
-EAPI Eina_Bool
+EAPI void
 elm_bg_color_get(const Evas_Object *obj, int *r, int *g, int *b)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd;
 
    wd = elm_widget_data_get(obj);
    evas_object_color_get(wd->rect, r, g, b, NULL);
 
-   return EINA_TRUE;
+   return;
 }
 
-EAPI Eina_Bool
+EAPI void
 elm_bg_load_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
 {
-   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    const char *p;
-   if (!wd) return EINA_FALSE;
+   if (!wd) return;
    wd->load_opts.w = w;
    wd->load_opts.h = h;
-   if (!wd->img) return EINA_FALSE;
+   if (!wd->img) return;
    if (!(((p = strrchr(wd->file, '.'))) && (!strcasecmp(p, ".edj"))))
      evas_object_image_load_size_set(wd->img, w, h);
 
-   return EINA_TRUE;
+   return;
 }