efl_ui_widget_part: implement all the missing API
authorMarcel Hollerbach <mail@marcel-hollerbach.de>
Tue, 17 Sep 2019 13:51:54 +0000 (15:51 +0200)
committerJongmin Lee <jm105.lee@samsung.com>
Fri, 20 Sep 2019 21:08:45 +0000 (06:08 +0900)
Efl.Color and Efl.File cannot be done due to composition. Efl.Gfx.Image
can, so we can solve this via composition, this also resolves all the
other cases for Efl.Gfx.Image.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9991

src/lib/elementary/efl_ui_widget.c
src/lib/elementary/efl_ui_widget_part_bg.eo

index e131af1..1dd99f6 100644 (file)
@@ -6760,22 +6760,17 @@ _efl_ui_widget_part_bg_efl_gfx_color_color_get(const Eo *obj, void *pd EINA_UNUS
    efl_gfx_color_get(bg_obj, r, g, b, a);
 }
 
-EOLIAN static void
-_efl_ui_widget_part_bg_efl_gfx_image_scale_method_set(Eo *obj, void *pd EINA_UNUSED, Efl_Gfx_Image_Scale_Method scale_type)
+EOLIAN static Efl_Object*
+_efl_ui_widget_part_bg_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
 {
    Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
 
-   efl_gfx_image_scale_method_set(bg_obj, scale_type);
-}
+   efl_composite_attach(obj, bg_obj);
 
-EOLIAN static Efl_Gfx_Image_Scale_Method
-_efl_ui_widget_part_bg_efl_gfx_image_scale_method_get(const Eo *obj, void *pd EINA_UNUSED)
-{
-   Evas_Object *bg_obj = efl_ui_widget_part_bg_get(obj);
-
-   return efl_gfx_image_scale_method_get(bg_obj);
+   return efl_finalize(efl_super(obj, EFL_UI_WIDGET_PART_BG_CLASS));
 }
 
+
 typedef struct _Efl_Ui_Property_Bound Efl_Ui_Property_Bound;
 struct _Efl_Ui_Property_Bound
 {
index 8e0612e..d19b857 100644 (file)
@@ -1,4 +1,4 @@
-class @beta Efl.Ui.Widget_Part_Bg extends Efl.Ui.Widget_Part implements Efl.File, Efl.Gfx.Color, Efl.Gfx.Image
+class @beta Efl.Ui.Widget_Part_Bg extends Efl.Ui.Widget_Part implements Efl.File, Efl.Gfx.Color, Efl.Gfx.Image composite Efl.Gfx.Image
 {
    [[Elementary widget internal part background class
 
@@ -9,12 +9,12 @@ class @beta Efl.Ui.Widget_Part_Bg extends Efl.Ui.Widget_Part implements Efl.File
    ]]
    data: null;
    implements {
+      Efl.Object.finalize;
       Efl.File.file { get; set; }
       Efl.File.key { get; set; }
       Efl.File.mmap { get; set; }
       Efl.File.load;
       Efl.File.unload;
       Efl.Gfx.Color.color { set; get; }
-      Efl.Gfx.Image.scale_method { get; set; }
    }
 }