inwin: Fix inwin (default content set/get/unset)
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 25 Sep 2017 02:29:24 +0000 (11:29 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Mon, 25 Sep 2017 02:30:28 +0000 (11:30 +0900)
Thanks @JackDanielZ for the report!
This makes efl_content_set/get/unset APIs work on the inwin, even though
this is a legacy-only widget (at least right now).

src/lib/elementary/elm_inwin.c
src/lib/elementary/elm_inwin.eo

index 67cea5f87d0a7c6366d5d576d40fcffb9f08a114..82a134643c4ac95a8e09e16d3b9da38b1b240ce2 100644 (file)
@@ -12,6 +12,7 @@
 #include "elm_inwin.eo.h"
 #include "elm_widget_inwin.h"
 #include "elm_widget_layout.h"
+#include "elm_part_helper.h"
 
 #define MY_CLASS ELM_INWIN_CLASS
 #define MY_CLASS_PFX elm_inwin
@@ -188,6 +189,23 @@ _elm_inwin_efl_ui_focus_manager_move(Eo *obj, Elm_Inwin_Data *pd, Efl_Ui_Focus_D
    return efl_ui_focus_manager_focus_get(obj);
 }
 
+EOLIAN static Eina_Bool
+_elm_inwin_efl_container_content_set(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED, Efl_Gfx *content)
+{
+   return efl_content_set(efl_part(obj, "default"), content);
+}
+
+EOLIAN static Efl_Gfx *
+_elm_inwin_efl_container_content_get(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED)
+{
+   return efl_content_get(efl_part(obj, "default"));
+}
+
+EOLIAN static Efl_Gfx *
+_elm_inwin_efl_container_content_unset(Eo *obj, Elm_Inwin_Data *pd EINA_UNUSED)
+{
+   return efl_content_unset(efl_part(obj, "default"));
+}
 
 EAPI void
 elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content)
@@ -218,11 +236,13 @@ _elm_inwin_class_constructor(Efl_Class *klass)
 
 /* Internal EO APIs and hidden overrides */
 
-ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(MY_CLASS_PFX)
+ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(elm_inwin)
+ELM_PART_CONTENT_DEFAULT_SET(elm_inwin, "default")
 
 #define ELM_INWIN_EXTRA_OPS \
    EFL_CANVAS_GROUP_ADD_OPS(elm_inwin), \
    ELM_LAYOUT_SIZING_EVAL_OPS(elm_inwin), \
-   ELM_LAYOUT_CONTENT_ALIASES_OPS(MY_CLASS_PFX)
+   ELM_LAYOUT_CONTENT_ALIASES_OPS(elm_inwin), \
+   ELM_PART_CONTENT_DEFAULT_OPS(elm_inwin)
 
 #include "elm_inwin.eo.c"
index 52fcd2c1c6bcfd0375e4abbd8802f48e4d3ceee0..5c1eeba409ea1cb4d7d4a72d5585122a96dee030 100644 (file)
@@ -1,4 +1,4 @@
-class Elm.Inwin (Efl.Ui.Layout, Efl.Ui.Focus.Manager)
+class Elm.Inwin (Efl.Ui.Layout, Efl.Ui.Focus.Manager, Efl.Container)
 {
    [[Elementary inwin class]]
    legacy_prefix: elm_inwin;
@@ -27,5 +27,7 @@ class Elm.Inwin (Efl.Ui.Layout, Efl.Ui.Focus.Manager)
       Elm.Widget.focus_manager_create;
       Efl.Gfx.visible { set; }
       Efl.Ui.Focus.Manager.move;
+      Efl.Container.content { get; set; }
+      Efl.Container.content_unset;
    }
 }