Eext.Floatingbutton: update to recent Eo grammar
authorSungtaek Hong <sth253.hong@samsung.com>
Wed, 24 Jan 2018 08:17:11 +0000 (17:17 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 19 Mar 2018 05:48:08 +0000 (14:48 +0900)
Change-Id: I21bc791bb0f163fc372913a877cfd60aa5ee4f56
Signed-off-by: Sungtaek Hong <sth253.hong@samsung.com>
inc/CMakeLists.txt
inc/mobile/eext_floatingbutton_eo.h
src/CMakeLists.txt
src/mobile/eext_floatingbutton.c
src/mobile/eext_floatingbutton.eo
src/mobile/eext_floatingbutton_part_content.eo [new file with mode: 0644]

index 234ceb49c5cef8d8e6c4216515d341407b0e5567..9db751212e96c443b8593617bc986a517e6d3ded 100644 (file)
@@ -40,6 +40,7 @@ SET(LIB_INCS
        mobile/eext_floatingbutton.eo.legacy.h
        mobile/eext_floatingbutton_eo.h
        mobile/eext_floatingbutton.eo.h
+       mobile/eext_floatingbutton_part_content.eo.h
        efl_extension.h
 )
 
index 7ebcd09951847c52ec3137530269f10fcecba1e8..3baa259cdac8ab6f015205b4e31f3452b58d7098 100644 (file)
@@ -15,3 +15,4 @@
  */
 
 #include "eext_floatingbutton.eo.h"
+#include "eext_floatingbutton_part_content.eo.h"
index d5139c9d222fbcec1cd99b35af04537433fbe03f..92fa9381c7e754b6f194d2c749a4c371be7f7f7f 100755 (executable)
@@ -11,6 +11,7 @@ SET(MOBILE_LIB_SRCS
        )
 SET(MOBILE_EO_FILES
        mobile/eext_floatingbutton.eo
+       mobile/eext_floatingbutton_part_content.eo
        )
 
 SET(WEARABLE_LIB_SRCS
@@ -43,13 +44,13 @@ SET(ALL_EO_FILES
 foreach(eo_file ${ALL_EO_FILES})
        GET_FILENAME_COMPONENT(dir ${eo_file} PATH)
        GET_FILENAME_COMPONENT(eo_file_name ${eo_file} NAME)
+       GET_FILENAME_COMPONENT(eo_name ${eo_file} NAME_WE)
        string(REPLACE .eo .eo.c out_c_file ${eo_file_name})
-       string(REPLACE .eo .c c_file ${eo_file_name})
        add_custom_command(
                OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${out_c_file}
-               COMMAND /usr/bin/eolian_gen -g c -I /usr/share/eolian/include -o "${dir}/${eo_file_name}" ${eo_file}
-               COMMAND /usr/bin/eolian_gen -g h -I /usr/share/eolian/include -o "../inc/${dir}/${eo_file_name}" ${eo_file}
-               COMMAND /usr/bin/eolian_gen -g l -I /usr/share/eolian/include -o "../inc/${dir}/${eo_file_name}" ${eo_file}
+               COMMAND /usr/bin/eolian_gen -g c -I /usr/share/eolian/include -o "${dir}/${eo_name}" ${eo_file}
+               COMMAND /usr/bin/eolian_gen -g h -I /usr/share/eolian/include -o "../inc/${dir}/${eo_name}" ${eo_file}
+               COMMAND /usr/bin/eolian_gen -g l -I /usr/share/eolian/include -o "../inc/${dir}/${eo_name}" ${eo_file}
                DEPENDS ${eo_file} ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*.eo
                COMMENT "Compiling Eo: ${eo_file}, Output eo : ${dir}/${out_c_file}"
                VERBATIM)
index dca51474a5d34904c9efc7e4a8235a1b16350ea9..992ee5d094d41dd625d5ca5bce38be6a97e1979b 100644 (file)
@@ -17,6 +17,7 @@
 #define ELM_INTERFACE_ATSPI_COMPONENT_PROTECTED
 #define ELM_INTERNAL_API_ARGESFSDFEFC 1
 #define ELM_WIDGET_PROTECTED
+#define EFL_UI_WIDGET_PROTECTED
 
 #include <Eo.h>
 
@@ -89,6 +90,14 @@ typedef struct _Eext_Floatingbutton_Data {
 
 } Eext_Floatingbutton_Data;
 
+
+typedef struct _Eext_Floatingbutton_Part_Data Eext_Floatingbutton_Part_Data;
+struct _Eext_Floatingbutton_Part_Data
+{
+   Eo             *obj;
+   Eina_Tmpstr    *part;
+};
+
 static void
 _signal_emit(Eo *obj, Eext_Floatingbutton_Data *sd)
 {
@@ -395,7 +404,7 @@ _on_mouse_up(void *data, Evas_Object *obj, const char *emission, const char *sou
 }
 
 EOLIAN static void
-_eext_floatingbutton_movement_block_set(Eo *obj, Eext_Floatingbutton_Data *sd, Eina_Bool block)
+_eext_floatingbutton_floatingbutton_movement_block_set(Eo *obj, Eext_Floatingbutton_Data *sd, Eina_Bool block)
 {
    char buf[200];
 
@@ -411,13 +420,13 @@ _eext_floatingbutton_movement_block_set(Eo *obj, Eext_Floatingbutton_Data *sd, E
 }
 
 EOLIAN static Eina_Bool
-_eext_floatingbutton_movement_block_get(Eo *obj EINA_UNUSED, Eext_Floatingbutton_Data *sd)
+_eext_floatingbutton_floatingbutton_movement_block_get(Eo *obj EINA_UNUSED, Eext_Floatingbutton_Data *sd)
 {
    return sd->block;
 }
 
 EOLIAN static Eina_Bool
-_eext_floatingbutton_pos_set(Eo *obj, Eext_Floatingbutton_Data *sd, Eext_Floatingbutton_Pos pos)
+_eext_floatingbutton_floatingbutton_pos_set(Eo *obj, Eext_Floatingbutton_Data *sd, Eext_Floatingbutton_Pos pos)
 {
    if ((pos < EEXT_FLOATINGBUTTON_LEFT_OUT) || (pos > EEXT_FLOATINGBUTTON_RIGHT_OUT))
      return EINA_FALSE;
@@ -433,13 +442,13 @@ _eext_floatingbutton_pos_set(Eo *obj, Eext_Floatingbutton_Data *sd, Eext_Floatin
 }
 
 EOLIAN static Eext_Floatingbutton_Pos
-_eext_floatingbutton_pos_get(Eo *obj EINA_UNUSED, Eext_Floatingbutton_Data *sd)
+_eext_floatingbutton_floatingbutton_pos_get(Eo *obj EINA_UNUSED, Eext_Floatingbutton_Data *sd)
 {
    return sd->pos;
 }
 
 EOLIAN static Eina_Bool
-_eext_floatingbutton_pos_bring_in(Eo *obj, Eext_Floatingbutton_Data *sd, Eext_Floatingbutton_Pos pos)
+_eext_floatingbutton_floatingbutton_pos_bring_in(Eo *obj, Eext_Floatingbutton_Data *sd, Eext_Floatingbutton_Pos pos)
 {
    if ((pos < EEXT_FLOATINGBUTTON_LEFT_OUT) || (pos > EEXT_FLOATINGBUTTON_RIGHT_OUT))
      return EINA_FALSE;
@@ -466,60 +475,64 @@ eext_floatingbutton_add(Evas_Object *parent)
 {
    if (!parent) return NULL;
    Evas_Object *obj = efl_add(MY_CLASS, parent);
-
+   //Evas_Object *obj = elm_legacy_add(MY_CLASS, parent);
    return obj;
 }
 
 EOLIAN static Eo *
-_eext_floatingbutton_efl_object_constructor(Eo *obj, Eext_Floatingbutton_Data *sd EINA_UNUSED)
+_eext_floatingbutton_efl_object_constructor(Eo *obj, Eext_Floatingbutton_Data *sd)
 {
+   if (!elm_widget_theme_klass_get(obj))
+     elm_widget_theme_klass_set(obj, "floatingbutton");
    obj = efl_constructor(efl_super(obj, MY_CLASS));
 
-   efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
+   //efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
    evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
 
-   return obj;
-}
-
-EOLIAN static void
-_eext_floatingbutton_efl_canvas_group_group_add(Eo *obj, Eext_Floatingbutton_Data *priv)
-{
-   efl_canvas_group_add(efl_super(obj, MY_CLASS));
    elm_widget_sub_object_parent_add(obj);
 
-   priv->obj = obj;
-   priv->pos = EEXT_FLOATINGBUTTON_RIGHT;
+   sd->obj = obj;
+   sd->pos = EEXT_FLOATINGBUTTON_RIGHT;
 
-   elm_layout_theme_set(obj, "floatingbutton", "base", elm_object_style_get(obj));
-   evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize_cb, priv);
-   evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb, priv);
+   ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
 
-   elm_layout_signal_callback_add(obj, "mouse,down,1", DRAGABLE_PART, _on_mouse_down, priv);
-   elm_layout_signal_callback_add(obj, "mouse,up,1", DRAGABLE_PART, _on_mouse_up, priv);
-   elm_layout_signal_callback_add(obj, "mouse,move", DRAGABLE_PART, _on_mouse_move, priv);
+   if (!elm_widget_theme_object_set(obj, wd->resize_obj,
+                                       elm_widget_theme_klass_get(obj),
+                                       elm_widget_theme_element_get(obj),
+                                       elm_widget_theme_style_get(obj)))
+     CRI("Failed to set layout!");
 
-   priv->vg = evas_object_vg_add(evas_object_evas_get(obj));
-   elm_layout_content_set(obj, "elm.swallow.vg", priv->vg);
-   Efl_VG *base_root = evas_object_vg_root_node_get(priv->vg);
-   priv->base_shape = evas_vg_shape_add(base_root);
-   evas_vg_node_color_set(priv->base_shape, 255, 255, 255, 255);
-   evas_object_event_callback_add(priv->vg, EVAS_CALLBACK_RESIZE, _vg_resize_cb, priv);
+   evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _resize_cb, sd);
+   evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb, sd);
 
-   priv->box = elm_box_add(obj);
-   elm_box_horizontal_set(priv->box, EINA_TRUE);
-   elm_box_padding_set(priv->box, EEXT_SCALE_SIZE(FLOATINGBUTTON_MID_WIDTH, obj), 0);
-   elm_object_part_content_set(obj, "elm.swallow.box", priv->box);
+   elm_layout_signal_callback_add(obj, "mouse,down,1", DRAGABLE_PART, _on_mouse_down, sd);
+   elm_layout_signal_callback_add(obj, "mouse,up,1", DRAGABLE_PART, _on_mouse_up, sd);
+   elm_layout_signal_callback_add(obj, "mouse,move", DRAGABLE_PART, _on_mouse_move, sd);
 
-   priv->block = EINA_FALSE;
+   sd->vg = evas_object_vg_add(evas_object_evas_get(obj));
+   elm_layout_content_set(obj, "elm.swallow.vg", sd->vg);
+   Efl_VG *base_root = evas_object_vg_root_node_get(sd->vg);
+   sd->base_shape = evas_vg_shape_add(base_root);
+   evas_vg_node_color_set(sd->base_shape, 255, 255, 255, 255);
+   evas_object_event_callback_add(sd->vg, EVAS_CALLBACK_RESIZE, _vg_resize_cb, sd);
 
-   priv->pos_table[EEXT_FLOATINGBUTTON_LEFT_OUT] = 0.0;
-   priv->pos_table[EEXT_FLOATINGBUTTON_CENTER] = 0.5;
-   priv->pos_table[EEXT_FLOATINGBUTTON_RIGHT_OUT] = 1.0;
+   sd->box = elm_box_add(obj);
+   elm_box_horizontal_set(sd->box, EINA_TRUE);
+   elm_box_padding_set(sd->box, EEXT_SCALE_SIZE(FLOATINGBUTTON_MID_WIDTH, obj), 0);
+   elm_object_part_content_set(obj, "elm.swallow.box", sd->box);
 
-   _pos_recalc(obj, priv);
-   _update_pos(obj, priv, EINA_FALSE);
+   sd->block = EINA_FALSE;
 
-   _threshold_update(obj, priv);
+   sd->pos_table[EEXT_FLOATINGBUTTON_LEFT_OUT] = 0.0;
+   sd->pos_table[EEXT_FLOATINGBUTTON_CENTER] = 0.5;
+   sd->pos_table[EEXT_FLOATINGBUTTON_RIGHT_OUT] = 1.0;
+
+   _pos_recalc(obj, sd);
+   _update_pos(obj, sd, EINA_FALSE);
+
+   _threshold_update(obj, sd);
+
+   return obj;
 }
 
 EOLIAN static void
@@ -544,12 +557,115 @@ _btn_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info
    _update_pos(obj, fbd, EINA_FALSE);
 }
 
+EOLIAN static Efl_Ui_Theme_Apply
+_eext_floatingbutton_efl_ui_widget_theme_apply(Eo *obj, Eext_Floatingbutton_Data *sd)
+{
+   Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
+   char buf[256];
+
+   int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
+   if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
+
+   snprintf(buf, sizeof(buf), "floatingbutton/%s", elm_object_style_get(obj));
+
+   if (sd->btn1) elm_object_style_set(sd->btn1, buf);
+   if (sd->btn2) elm_object_style_set(sd->btn2, buf);
+
+   _box_recalc(obj, sd);
+   _update_pos(obj, sd, EINA_FALSE);
+
+   return int_ret;
+}
+
+EOLIAN static void
+_eext_floatingbutton_floatingbutton_mode_set(Eo *obj,
+                              Eext_Floatingbutton_Data *sd,
+                              Eext_Floatingbutton_Mode mode)
+{
+   if (sd->mode == mode) return;
+
+   if ((mode < EEXT_FLOATINGBUTTON_MODE_DEFAULT) ||
+       (mode >= EEXT_FLOATINGBUTTON_MODE_LAST))
+     return;
+
+   sd->mode = mode;
+
+   switch(mode)
+     {
+      case EEXT_FLOATINGBUTTON_MODE_DEFAULT:
+        sd->pos_disabled[EEXT_FLOATINGBUTTON_LEFT_OUT] = 0;
+        sd->pos_disabled[EEXT_FLOATINGBUTTON_LEFT] = 0;
+        sd->pos_disabled[EEXT_FLOATINGBUTTON_CENTER] = 0;
+        sd->pos_disabled[EEXT_FLOATINGBUTTON_RIGHT] = 0;
+        sd->pos_disabled[EEXT_FLOATINGBUTTON_RIGHT_OUT] = 0;
+        break;
+      case EEXT_FLOATINGBUTTON_MODE_BOTH_SIDES:
+        sd->pos_disabled[EEXT_FLOATINGBUTTON_LEFT_OUT] = 1;
+        sd->pos_disabled[EEXT_FLOATINGBUTTON_LEFT] = 0;
+        sd->pos_disabled[EEXT_FLOATINGBUTTON_CENTER] = 1;
+        sd->pos_disabled[EEXT_FLOATINGBUTTON_RIGHT] = 0;
+        sd->pos_disabled[EEXT_FLOATINGBUTTON_RIGHT_OUT] = 1;
+        break;
+      case EEXT_FLOATINGBUTTON_MODE_LAST:
+        /* you must not reach here */
+        break;
+     }
+}
+
+EOLIAN static Eext_Floatingbutton_Mode
+_eext_floatingbutton_floatingbutton_mode_get(Eo *obj,
+                              Eext_Floatingbutton_Data *sd)
+{
+   return sd->mode;
+}
+
+/* TODO : there will be this definition once we rebase onto upstream/master
+EOLIAN static void
+_eext_floatingbutton_efl_access_component_extents_get(Eo *obj EINA_UNUSED, Eext_Floatingbutton_Data *sd, Eina_Bool screen_coords, int *x, int *y, int *w, int *h)
+{
+   int ee_x, ee_y;
+
+   if (!sd->box)
+     {
+        if (x) *x = -1;
+        if (y) *y = -1;
+        if (w) *w = -1;
+        if (h) *h = -1;
+        return;
+     }
+   evas_object_geometry_get(sd->box, x, y, w, h);
+
+   if (screen_coords)
+     {
+        Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(sd->box));
+        if (!ee) return;
+        ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
+        if (x) *x += ee_x;
+        if (y) *y += ee_y;
+     }
+}
+*/
+
 EOLIAN static Eina_Bool
-_eext_floatingbutton_efl_container_content_set(Eo *obj, Eext_Floatingbutton_Data *sd,Efl_Gfx *content)
+_eext_floatingbutton_efl_ui_base_mirrored_get(Eo *obj EINA_UNUSED, Eext_Floatingbutton_Data *sd EINA_UNUSED)
+{
+   return EINA_FALSE;
+}
+
+EOLIAN static void
+_eext_floatingbutton_efl_ui_base_mirrored_set(Eo *obj EINA_UNUSED, Eext_Floatingbutton_Data *sd EINA_UNUSED, Eina_Bool mirrored EINA_UNUSED)
+{
+
+}
+
+#include "eext_floatingbutton.eo.c"
+
+
+EOLIAN static Eina_Bool
+_eext_floatingbutton_content_set(Eo *obj, Eext_Floatingbutton_Data *sd, const char *part, Evas_Object *content)
 {
    Eina_Bool int_ret = EINA_FALSE;
    char buf[256];
-   char *part = "test";
 
    if ((!part) || (!content)) return int_ret;
 
@@ -586,7 +702,9 @@ _eext_floatingbutton_efl_container_content_set(Eo *obj, Eext_Floatingbutton_Data
         int_ret = EINA_TRUE;
      }
    else
-     int_ret = efl_content_set(obj, content);
+     {
+        int_ret = efl_content_set(efl_super(obj, EEXT_FLOATINGBUTTON_PART_CONTENT_CLASS), content);
+     }
 
    _box_recalc(obj, sd);
    _update_pos(obj, sd, EINA_TRUE);
@@ -595,12 +713,9 @@ _eext_floatingbutton_efl_container_content_set(Eo *obj, Eext_Floatingbutton_Data
 }
 
 EOLIAN static Efl_Gfx *
-_eext_floatingbutton_efl_container_content_get(Eo *obj, Eext_Floatingbutton_Data *sd)
+_eext_floatingbutton_content_get(Eo *obj, Eext_Floatingbutton_Data *sd, const char *part)
 {
    Evas_Object *ret = NULL;
-
-   char *part ="test";
-
    if (!part) return ret;
 
    if (!strcmp(part, BTN1_PART))
@@ -608,16 +723,15 @@ _eext_floatingbutton_efl_container_content_get(Eo *obj, Eext_Floatingbutton_Data
    else if (!strcmp(part, BTN2_PART))
      ret = sd->btn2;
    else
-     ret = efl_content_get(obj);
+     ret = efl_content_get(efl_super(obj, EEXT_FLOATINGBUTTON_PART_CONTENT_CLASS));
 
    return ret;
 }
 
 EOLIAN static Efl_Gfx *
-_eext_floatingbutton_efl_container_content_unset(Eo *obj, Eext_Floatingbutton_Data *sd)
+_eext_floatingbutton_content_unset(Eo *obj, Eext_Floatingbutton_Data *sd, const char *part)
 {
    Evas_Object *ret = NULL;
-   char *part = "test";
 
    if (!part) return ret;
 
@@ -638,7 +752,7 @@ _eext_floatingbutton_efl_container_content_unset(Eo *obj, Eext_Floatingbutton_Da
         sd->btn2 = NULL;
      }
    else
-     ret = efl_content_unset(obj);
+     ret = efl_content_unset(efl_super(obj, EEXT_FLOATINGBUTTON_PART_CONTENT_CLASS));
 
    _box_recalc(obj, sd);
    _update_pos(obj, sd, EINA_TRUE);
@@ -646,103 +760,62 @@ _eext_floatingbutton_efl_container_content_unset(Eo *obj, Eext_Floatingbutton_Da
    return ret;
 }
 
-EOLIAN static Efl_Ui_Theme_Apply
-_eext_floatingbutton_elm_widget_theme_apply(Eo *obj, Eext_Floatingbutton_Data *sd)
+EOLIAN static Eina_Bool
+_eext_floatingbutton_part_content_efl_content_content_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx *content)
 {
-   Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
-   char buf[256];
-
-   int_ret = elm_obj_widget_theme_apply(efl_super(obj, MY_CLASS));
-   if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
+   Eext_Floatingbutton_Part_Data *pd;
 
-   snprintf(buf, sizeof(buf), "floatingbutton/%s", elm_object_style_get(obj));
+   pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+   Eext_Floatingbutton_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
 
-   if (sd->btn1) elm_object_style_set(sd->btn1, buf);
-   if (sd->btn2) elm_object_style_set(sd->btn2, buf);
-
-   _box_recalc(obj, sd);
-   _update_pos(obj, sd, EINA_FALSE);
-
-   return int_ret;
+   return _eext_floatingbutton_content_set(pd->obj, sd, pd->part, content);
 }
 
-EOLIAN static void
-_eext_floatingbutton_mode_set(Eo *obj,
-                              Eext_Floatingbutton_Data *sd,
-                              Eext_Floatingbutton_Mode mode)
+EOLIAN static Efl_Gfx *
+_eext_floatingbutton_part_content_efl_content_content_get(Eo *obj, void *_pd EINA_UNUSED)
 {
-   if (sd->mode == mode) return;
-
-   if ((mode < EEXT_FLOATINGBUTTON_MODE_DEFAULT) ||
-       (mode >= EEXT_FLOATINGBUTTON_MODE_LAST))
-     return;
+   Eext_Floatingbutton_Part_Data *pd;
 
-   sd->mode = mode;
+   pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+   Eext_Floatingbutton_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
 
-   switch(mode)
-     {
-      case EEXT_FLOATINGBUTTON_MODE_DEFAULT:
-        sd->pos_disabled[EEXT_FLOATINGBUTTON_LEFT_OUT] = 0;
-        sd->pos_disabled[EEXT_FLOATINGBUTTON_LEFT] = 0;
-        sd->pos_disabled[EEXT_FLOATINGBUTTON_CENTER] = 0;
-        sd->pos_disabled[EEXT_FLOATINGBUTTON_RIGHT] = 0;
-        sd->pos_disabled[EEXT_FLOATINGBUTTON_RIGHT_OUT] = 0;
-        break;
-      case EEXT_FLOATINGBUTTON_MODE_BOTH_SIDES:
-        sd->pos_disabled[EEXT_FLOATINGBUTTON_LEFT_OUT] = 1;
-        sd->pos_disabled[EEXT_FLOATINGBUTTON_LEFT] = 0;
-        sd->pos_disabled[EEXT_FLOATINGBUTTON_CENTER] = 1;
-        sd->pos_disabled[EEXT_FLOATINGBUTTON_RIGHT] = 0;
-        sd->pos_disabled[EEXT_FLOATINGBUTTON_RIGHT_OUT] = 1;
-        break;
-      case EEXT_FLOATINGBUTTON_MODE_LAST:
-        /* you must not reach here */
-        break;
-     }
+   return _eext_floatingbutton_content_get(pd->obj, sd, pd->part);
 }
 
-EOLIAN static Eext_Floatingbutton_Mode
-_eext_floatingbutton_mode_get(Eo *obj,
-                              Eext_Floatingbutton_Data *sd)
+EOLIAN static Efl_Gfx *
+_eext_floatingbutton_part_content_efl_content_content_unset(Eo *obj, void *_pd EINA_UNUSED)
 {
-   return sd->mode;
-}
+   Eext_Floatingbutton_Part_Data *pd;
 
-EOLIAN static void
-_eext_floatingbutton_efl_access_component_extents_get(Eo *obj EINA_UNUSED, Eext_Floatingbutton_Data *sd, Eina_Bool screen_coords, int *x, int *y, int *w, int *h)
-{
-   int ee_x, ee_y;
+   pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
+   Eext_Floatingbutton_Data *sd = efl_data_scope_get(pd->obj, MY_CLASS);
 
-   if (!sd->box)
-     {
-        if (x) *x = -1;
-        if (y) *y = -1;
-        if (w) *w = -1;
-        if (h) *h = -1;
-        return;
-     }
-   evas_object_geometry_get(sd->box, x, y, w, h);
-
-   if (screen_coords)
-     {
-        Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(sd->box));
-        if (!ee) return;
-        ecore_evas_geometry_get(ee, &ee_x, &ee_y, NULL, NULL);
-        if (x) *x += ee_x;
-        if (y) *y += ee_y;
-     }
+   return _eext_floatingbutton_content_unset(pd->obj, sd, pd->part);
 }
 
-EOLIAN static Eina_Bool
-_eext_floatingbutton_efl_ui_base_mirrored_get(Eo *obj EINA_UNUSED, Eext_Floatingbutton_Data *sd EINA_UNUSED)
+static inline Eo *
+_eext_floatingbutton_part_initialize(Eo *proxy, Eo *obj, const char *part)
 {
-   return EINA_FALSE;
+   Eext_Floatingbutton_Part_Data *pd = efl_data_scope_get(proxy, EFL_UI_WIDGET_PART_CLASS);
+
+   EINA_SAFETY_ON_FALSE_RETURN_VAL(pd && obj && part, NULL);
+   efl_allow_parent_unref_set(proxy, 1);
+   ___efl_auto_unref_set(proxy, 1);
+   pd->part = eina_tmpstr_add(part);
+   pd->obj = obj;
+
+   return proxy;
 }
 
-EOLIAN static void
-_eext_floatingbutton_efl_ui_base_mirrored_set(Eo *obj EINA_UNUSED, Eext_Floatingbutton_Data *sd EINA_UNUSED, Eina_Bool mirrored EINA_UNUSED)
+EOLIAN Eo *
+_eext_floatingbutton_efl_part_part(const Eo *obj, Eext_Floatingbutton_Data *sd EINA_UNUSED, const char *part)
 {
+   if ((!part) || ((strcmp(part, BTN1_PART)) && (strcmp(part, BTN2_PART))))
+     return efl_part(efl_super(obj, MY_CLASS), part);
 
+   //TODO: change parent(NULL) when upstream changes its parent.
+   return efl_add(EEXT_FLOATINGBUTTON_PART_CONTENT_CLASS, NULL,
+                  _eext_floatingbutton_part_initialize(efl_added, (Eo *) obj, part));
 }
 
-#include "eext_floatingbutton.eo.c"
+#include "eext_floatingbutton_part_content.eo.c"
\ No newline at end of file
index 2fd071e4c4f164a7e52880c76876132e98f18f78..4c61f4bf91186673e6d1c546f160bc72ac3f02f1 100644 (file)
@@ -1,23 +1,25 @@
 
-enum Eext_Floatingbutton_Pos {
-   EEXT_FLOATINGBUTTON_LEFT_OUT = 0, /**< hides in the left, but small handler will show only */
-   EEXT_FLOATINGBUTTON_LEFT, /**< shows all of buttons, but lies on the left */
-   EEXT_FLOATINGBUTTON_CENTER, /**< shows all of buttons, but lies on the center */
-   EEXT_FLOATINGBUTTON_RIGHT, /**< shows all of buttons, but lies on the right */
-   EEXT_FLOATINGBUTTON_RIGHT_OUT, /**< hides in the right, but small handler will show only */
-   EEXT_FLOATINGBUTTON_LAST /**< indicates the last, do not use this **/
+enum Eext.Floatingbutton.Pos {
+   [[ Floating button position ]]
+   legacy: eext_floatingbutton;
+   left_out = 0, [[ hides in the left, but small handler will show only ]]
+   left,         [[ shows all of buttons, but lies on the left ]]
+   center,       [[ shows all of buttons, but lies on the center ]]
+   right,        [[ shows all of buttons, but lies on the right ]]
+   right_out,    [[ hides in the right, but small handler will show only ]]
+   last          [[ indicates the last, do not use this ]]
 }
 
-enum Eext_Floatingbutton_Mode {
-   EEXT_FLOATINGBUTTON_MODE_DEFAULT = 0, /**< allows all positions */
-   EEXT_FLOATINGBUTTON_MODE_BOTH_SIDES, /**< allows LEFT and RIGHT positions only */
-   EEXT_FLOATINGBUTTON_MODE_LAST /**< indicates the last, do not use this **/
+enum Eext.Floatingbutton.Mode {
+   [[ Floating button mode ]]
+   default = 0,  [[ allows all positions ]]
+   both_sides,   [[ allows LEFT and RIGHT positions only ]]
+   last          [[ indicates the last, do not use this ]]
 }
 
-class Eext.Floatingbutton (Efl.Ui.Layout, Efl.Container) {
-   eo_prefix: eext_obj_floatingbutton;
+class Eext.Floatingbutton (Efl.Ui.Layout) {
    methods {
-      @property pos {
+      @property floatingbutton_pos {
          set {
             [[
             Set the floatingbutton position
@@ -41,10 +43,10 @@ class Eext.Floatingbutton (Efl.Ui.Layout, Efl.Container) {
             ]]
          }
          values {
-            pos: Eext_Floatingbutton_Pos; [[ the floatingbutton position ]]
+            pos: Eext.Floatingbutton.Pos; [[ the floatingbutton position ]]
          }
       }
-      @property movement_block {
+      @property floatingbutton_movement_block {
          set {
             [[
             Set whether floatingbutton can be moved or not.
@@ -66,7 +68,7 @@ class Eext.Floatingbutton (Efl.Ui.Layout, Efl.Container) {
             block: bool; [[ the floatingbutton movability ]]
          }
       }
-      @property mode {
+      @property floatingbutton_mode {
          set {
             [[
             Set floatingbutton mode.
@@ -82,10 +84,10 @@ class Eext.Floatingbutton (Efl.Ui.Layout, Efl.Container) {
             ]]
          }
          values {
-            mode: Eext_Floatingbutton_Mode; [[ floatingbutton mode ]]
+            mode: Eext.Floatingbutton.Mode; [[ floatingbutton mode ]]
          }
       }
-      pos_bring_in {
+      floatingbutton_pos_bring_in {
          [[
          Set the floatingbutton position with animation
 
@@ -98,18 +100,16 @@ class Eext.Floatingbutton (Efl.Ui.Layout, Efl.Container) {
          ]]
          return: bool;
          params {
-            @in pos: const(Eext_Floatingbutton_Pos); [[ the floatingbutton position ]]
+            @in pos: const(Eext.Floatingbutton.Pos); [[ the floatingbutton position ]]
          }
       }
    }
    implements {
       class.constructor;
       Efl.Object.constructor;
-//      Efl.Canvas.Group.group_add;
-      Efl.Container.content { get; set; }
-      Efl.Container.content_unset;
       Efl.Ui.Base.mirrored { get; set; }
-      Elm.Widget.theme_apply;
+      Efl.Ui.Widget.theme_apply;
 //      Efl.Access.Component.extents.get; // TODO : there will be this definition once we rebase onto upstream/master
+      Efl.Part.part;
    }
 }
diff --git a/src/mobile/eext_floatingbutton_part_content.eo b/src/mobile/eext_floatingbutton_part_content.eo
new file mode 100644 (file)
index 0000000..ac71817
--- /dev/null
@@ -0,0 +1,9 @@
+class Eext.Floatingbutton.Part_Content (Efl.Ui.Layout.Part, Efl.Content)
+{
+   [[Eext Floatingbutton internal part class]]
+   data: null;
+   implements {
+      Efl.Content.content { get; set; }
+      Efl.Content.content_unset;
+   }
+}