jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=63f599a47e507c39aa5596efcf3d2f3d790b7866

commit 63f599a47e507c39aa5596efcf3d2f3d790b7866
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Thu Aug 10 13:38:50 2017 +0900

    separator: Remove orientation API use (EO)
    
    Revert "Separtor: use orientation APIs"
    
    This reverts commit f043c3be617f7257001b9fc779b64cebf4370781.
    Separator is not part of EO API so no need to use Orientation or
    Direction API here.
    
    Ref T5870
---
 src/bin/elementary/test_separator.c       |  2 +-
 src/lib/elementary/elm_separator.c        | 47 ++++++-------------------------
 src/lib/elementary/elm_separator.eo       | 16 +++++++++--
 src/lib/elementary/elm_separator_legacy.h | 20 +------------
 src/lib/elementary/elm_widget_separator.h |  2 +-
 5 files changed, 25 insertions(+), 62 deletions(-)

diff --git a/src/bin/elementary/test_separator.c 
b/src/bin/elementary/test_separator.c
index 1d6f516420..00d9985c42 100644
--- a/src/bin/elementary/test_separator.c
+++ b/src/bin/elementary/test_separator.c
@@ -28,7 +28,7 @@ test_separator(void *data EINA_UNUSED, Evas_Object *obj 
EINA_UNUSED, void *event
    evas_object_show(bt);
 
    sp = elm_separator_add(win);
-   elm_separator_horizontal_set(sp, EINA_TRUE);
+   elm_separator_horizontal_set(sp, EINA_TRUE); // by default, separator is 
vertical, we must set it horizontal
    elm_box_pack_end(bx, sp);
    evas_object_show(sp);
 
diff --git a/src/lib/elementary/elm_separator.c 
b/src/lib/elementary/elm_separator.c
index e9d3952c99..bb0e8f59ba 100644
--- a/src/lib/elementary/elm_separator.c
+++ b/src/lib/elementary/elm_separator.c
@@ -22,7 +22,7 @@ _elm_separator_elm_widget_theme_apply(Eo *obj, 
Elm_Separator_Data *sd EINA_UNUSE
    Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
    EFL_UI_LAYOUT_DATA_GET(obj, ld);
 
-   if (sd->orientation == EFL_ORIENT_HORIZONTAL)
+   if (sd->horizontal)
      eina_stringshare_replace(&ld->group, "horizontal");
    else
      eina_stringshare_replace(&ld->group, "vertical");
@@ -52,8 +52,6 @@ _elm_separator_efl_canvas_group_group_add(Eo *obj, 
Elm_Separator_Data *sd EINA_U
    elm_widget_sub_object_parent_add(obj);
    elm_widget_can_focus_set(obj, EINA_FALSE);
 
-   sd->orientation = EFL_ORIENT_VERTICAL;
-
    if (!elm_layout_theme_set
        (obj, "separator", "vertical", elm_widget_style_get(obj)))
      CRI("Failed to set layout!");
@@ -68,32 +66,6 @@ elm_separator_add(Evas_Object *parent)
    return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
 }
 
-EAPI void
-elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
-{
-   Efl_Orient orient;
-
-   if (horizontal)
-     orient = EFL_ORIENT_HORIZONTAL;
-   else
-     orient = EFL_ORIENT_VERTICAL;
-
-   if (orient == efl_orientation_get(obj)) return;
-
-   efl_orientation_set(obj, orient);
-}
-
-EAPI Eina_Bool
-elm_separator_horizontal_get(const Evas_Object *obj)
-{
-   ELM_SEPARATOR_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
-
-   if (sd->orientation == EFL_ORIENT_VERTICAL)
-     return EINA_FALSE;
-   else
-     return EINA_TRUE;
-}
-
 EOLIAN static Eo *
 _elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *sd 
EINA_UNUSED)
 {
@@ -105,23 +77,20 @@ _elm_separator_efl_object_constructor(Eo *obj, 
Elm_Separator_Data *sd EINA_UNUSE
 }
 
 EOLIAN static void
-_elm_separator_efl_orientation_orientation_set(Eo *obj, Elm_Separator_Data 
*sd, Efl_Orient dir)
+_elm_separator_horizontal_set(Eo *obj, Elm_Separator_Data *sd, Eina_Bool 
horizontal)
 {
-   if (dir != EFL_ORIENT_VERTICAL &&
-       dir != EFL_ORIENT_HORIZONTAL)
-     return;
-
-   if (sd->orientation == dir) return;
+   horizontal = !!horizontal;
+   if (sd->horizontal == horizontal) return;
 
-   sd->orientation = dir;
+   sd->horizontal = horizontal;
 
    elm_obj_widget_theme_apply(obj);
 }
 
-EOLIAN static Efl_Orient
-_elm_separator_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, 
Elm_Separator_Data *sd)
+EOLIAN static Eina_Bool
+_elm_separator_horizontal_get(Eo *obj EINA_UNUSED, Elm_Separator_Data *sd)
 {
-   return sd->orientation;
+   return sd->horizontal;
 }
 
 EOLIAN static Eina_Bool
diff --git a/src/lib/elementary/elm_separator.eo 
b/src/lib/elementary/elm_separator.eo
index ba4e585e4d..76813b02bc 100644
--- a/src/lib/elementary/elm_separator.eo
+++ b/src/lib/elementary/elm_separator.eo
@@ -1,14 +1,26 @@
-class Elm.Separator (Efl.Ui.Layout, Efl.Orientation)
+class Elm.Separator (Efl.Ui.Layout)
 {
    [[Elementary separator class]]
    legacy_prefix: elm_separator;
    eo_prefix: elm_obj_separator;
+   methods {
+      @property horizontal {
+         set {
+            [[Set the horizontal mode of a separator object]]
+         }
+         get {
+            [[Get the horizontal mode of a separator object]]
+         }
+         values {
+            horizontal: bool; [[If true, the separator is horizontal]]
+         }
+      }
+   }
    implements {
       class.constructor;
       Efl.Object.constructor;
       Elm.Widget.focus_next_manager_is;
       Elm.Widget.focus_direction_manager_is;
       Elm.Widget.theme_apply;
-      Efl.Orientation.orientation { get; set; }
    }
 }
diff --git a/src/lib/elementary/elm_separator_legacy.h 
b/src/lib/elementary/elm_separator_legacy.h
index 6581d53f2d..82cf44ee0b 100644
--- a/src/lib/elementary/elm_separator_legacy.h
+++ b/src/lib/elementary/elm_separator_legacy.h
@@ -9,22 +9,4 @@
  */
 EAPI Evas_Object *elm_separator_add(Evas_Object *parent);
 
-/**
- * @brief Set the horizontal mode of a separator object
- *
- * @param[in] horizontal If true, the separator is horizontal
- *
- * @ingroup Elm_Separator
- */
-EAPI void elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
-
-/**
- * @brief Get the horizontal mode of a separator object
- *
- * @return If true, the separator is horizontal
- *
- * @ingroup Elm_Separator
- */
-EAPI Eina_Bool elm_separator_horizontal_get(const Evas_Object *obj);
-
-#include "elm_separator.eo.legacy.h"
+#include "elm_separator.eo.legacy.h"
\ No newline at end of file
diff --git a/src/lib/elementary/elm_widget_separator.h 
b/src/lib/elementary/elm_widget_separator.h
index 7351abd9d6..7044b58502 100644
--- a/src/lib/elementary/elm_widget_separator.h
+++ b/src/lib/elementary/elm_widget_separator.h
@@ -26,7 +26,7 @@
 typedef struct _Elm_Separator_Data Elm_Separator_Data;
 struct _Elm_Separator_Data
 {
-   Efl_Orient  orientation;
+   Eina_Bool             horizontal : 1;
 };
 
 /**

-- 


Reply via email to