summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-10 13:38:50 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-10 14:42:08 +0900
commit63f599a47e507c39aa5596efcf3d2f3d790b7866 (patch)
tree138178e8dc0429eb26f6f39f297295fd2199ce82
parent3c390b3969a711c6853f4939fc6cc8697df9791d (diff)
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
-rw-r--r--src/bin/elementary/test_separator.c2
-rw-r--r--src/lib/elementary/elm_separator.c47
-rw-r--r--src/lib/elementary/elm_separator.eo16
-rw-r--r--src/lib/elementary/elm_separator_legacy.h20
-rw-r--r--src/lib/elementary/elm_widget_separator.h2
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
28 evas_object_show(bt); 28 evas_object_show(bt);
29 29
30 sp = elm_separator_add(win); 30 sp = elm_separator_add(win);
31 elm_separator_horizontal_set(sp, EINA_TRUE); 31 elm_separator_horizontal_set(sp, EINA_TRUE); // by default, separator is vertical, we must set it horizontal
32 elm_box_pack_end(bx, sp); 32 elm_box_pack_end(bx, sp);
33 evas_object_show(sp); 33 evas_object_show(sp);
34 34
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
22 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED; 22 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
23 EFL_UI_LAYOUT_DATA_GET(obj, ld); 23 EFL_UI_LAYOUT_DATA_GET(obj, ld);
24 24
25 if (sd->orientation == EFL_ORIENT_HORIZONTAL) 25 if (sd->horizontal)
26 eina_stringshare_replace(&ld->group, "horizontal"); 26 eina_stringshare_replace(&ld->group, "horizontal");
27 else 27 else
28 eina_stringshare_replace(&ld->group, "vertical"); 28 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
52 elm_widget_sub_object_parent_add(obj); 52 elm_widget_sub_object_parent_add(obj);
53 elm_widget_can_focus_set(obj, EINA_FALSE); 53 elm_widget_can_focus_set(obj, EINA_FALSE);
54 54
55 sd->orientation = EFL_ORIENT_VERTICAL;
56
57 if (!elm_layout_theme_set 55 if (!elm_layout_theme_set
58 (obj, "separator", "vertical", elm_widget_style_get(obj))) 56 (obj, "separator", "vertical", elm_widget_style_get(obj)))
59 CRI("Failed to set layout!"); 57 CRI("Failed to set layout!");
@@ -68,32 +66,6 @@ elm_separator_add(Evas_Object *parent)
68 return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added)); 66 return efl_add(MY_CLASS, parent, efl_canvas_object_legacy_ctor(efl_added));
69} 67}
70 68
71EAPI void
72elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
73{
74 Efl_Orient orient;
75
76 if (horizontal)
77 orient = EFL_ORIENT_HORIZONTAL;
78 else
79 orient = EFL_ORIENT_VERTICAL;
80
81 if (orient == efl_orientation_get(obj)) return;
82
83 efl_orientation_set(obj, orient);
84}
85
86EAPI Eina_Bool
87elm_separator_horizontal_get(const Evas_Object *obj)
88{
89 ELM_SEPARATOR_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE);
90
91 if (sd->orientation == EFL_ORIENT_VERTICAL)
92 return EINA_FALSE;
93 else
94 return EINA_TRUE;
95}
96
97EOLIAN static Eo * 69EOLIAN static Eo *
98_elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED) 70_elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *sd EINA_UNUSED)
99{ 71{
@@ -105,23 +77,20 @@ _elm_separator_efl_object_constructor(Eo *obj, Elm_Separator_Data *sd EINA_UNUSE
105} 77}
106 78
107EOLIAN static void 79EOLIAN static void
108_elm_separator_efl_orientation_orientation_set(Eo *obj, Elm_Separator_Data *sd, Efl_Orient dir) 80_elm_separator_horizontal_set(Eo *obj, Elm_Separator_Data *sd, Eina_Bool horizontal)
109{ 81{
110 if (dir != EFL_ORIENT_VERTICAL && 82 horizontal = !!horizontal;
111 dir != EFL_ORIENT_HORIZONTAL) 83 if (sd->horizontal == horizontal) return;
112 return;
113
114 if (sd->orientation == dir) return;
115 84
116 sd->orientation = dir; 85 sd->horizontal = horizontal;
117 86
118 elm_obj_widget_theme_apply(obj); 87 elm_obj_widget_theme_apply(obj);
119} 88}
120 89
121EOLIAN static Efl_Orient 90EOLIAN static Eina_Bool
122_elm_separator_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, Elm_Separator_Data *sd) 91_elm_separator_horizontal_get(Eo *obj EINA_UNUSED, Elm_Separator_Data *sd)
123{ 92{
124 return sd->orientation; 93 return sd->horizontal;
125} 94}
126 95
127EOLIAN static Eina_Bool 96EOLIAN 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 @@
1class Elm.Separator (Efl.Ui.Layout, Efl.Orientation) 1class Elm.Separator (Efl.Ui.Layout)
2{ 2{
3 [[Elementary separator class]] 3 [[Elementary separator class]]
4 legacy_prefix: elm_separator; 4 legacy_prefix: elm_separator;
5 eo_prefix: elm_obj_separator; 5 eo_prefix: elm_obj_separator;
6 methods {
7 @property horizontal {
8 set {
9 [[Set the horizontal mode of a separator object]]
10 }
11 get {
12 [[Get the horizontal mode of a separator object]]
13 }
14 values {
15 horizontal: bool; [[If true, the separator is horizontal]]
16 }
17 }
18 }
6 implements { 19 implements {
7 class.constructor; 20 class.constructor;
8 Efl.Object.constructor; 21 Efl.Object.constructor;
9 Elm.Widget.focus_next_manager_is; 22 Elm.Widget.focus_next_manager_is;
10 Elm.Widget.focus_direction_manager_is; 23 Elm.Widget.focus_direction_manager_is;
11 Elm.Widget.theme_apply; 24 Elm.Widget.theme_apply;
12 Efl.Orientation.orientation { get; set; }
13 } 25 }
14} 26}
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 @@
9 */ 9 */
10EAPI Evas_Object *elm_separator_add(Evas_Object *parent); 10EAPI Evas_Object *elm_separator_add(Evas_Object *parent);
11 11
12/** 12#include "elm_separator.eo.legacy.h" \ No newline at end of file
13 * @brief Set the horizontal mode of a separator object
14 *
15 * @param[in] horizontal If true, the separator is horizontal
16 *
17 * @ingroup Elm_Separator
18 */
19EAPI void elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
20
21/**
22 * @brief Get the horizontal mode of a separator object
23 *
24 * @return If true, the separator is horizontal
25 *
26 * @ingroup Elm_Separator
27 */
28EAPI Eina_Bool elm_separator_horizontal_get(const Evas_Object *obj);
29
30#include "elm_separator.eo.legacy.h"
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 @@
26typedef struct _Elm_Separator_Data Elm_Separator_Data; 26typedef struct _Elm_Separator_Data Elm_Separator_Data;
27struct _Elm_Separator_Data 27struct _Elm_Separator_Data
28{ 28{
29 Efl_Orient orientation; 29 Eina_Bool horizontal : 1;
30}; 30};
31 31
32/** 32/**