jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4270cb032cb0d87e784f83779ffa3d9ee73b0f15

commit 4270cb032cb0d87e784f83779ffa3d9ee73b0f15
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Wed Aug 9 20:59:30 2017 +0900

    efl: Introduce Efl.Ui.Direction interface
    
    This introduces, but doesn't make any use of, two types:
     - EO interface Efl.Ui.Direction
     - Enum Efl.Ui.Dir
    
    This is to clean up inconsistencies with Efl.Orient values when used
    with widgets.
    
    Ref T5870
    
    @feature
---
 src/Makefile_Efl.am                          |  1 +
 src/lib/efl/Efl.h                            |  1 +
 src/lib/efl/interfaces/efl_common_internal.h |  2 +-
 src/lib/efl/interfaces/efl_input_types.eot   |  4 +--
 src/lib/efl/interfaces/efl_interfaces_main.c |  1 +
 src/lib/efl/interfaces/efl_orientation.eo    | 37 +++++++++++------------
 src/lib/efl/interfaces/efl_ui_direction.eo   | 44 ++++++++++++++++++++++++++++
 7 files changed, 69 insertions(+), 21 deletions(-)

diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am
index d615e27595..e95a40dc4b 100644
--- a/src/Makefile_Efl.am
+++ b/src/Makefile_Efl.am
@@ -47,6 +47,7 @@ efl_eolian_files = \
       lib/efl/interfaces/efl_vpath_core.eo \
       lib/efl/interfaces/efl_vpath_file_core.eo \
       lib/efl/interfaces/efl_ui_base.eo \
+      lib/efl/interfaces/efl_ui_direction.eo \
       lib/efl/interfaces/efl_ui_drag.eo \
       lib/efl/interfaces/efl_ui_spin.eo \
       lib/efl/interfaces/efl_ui_range.eo \
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index c1cc00e16c..9170c6c102 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -87,6 +87,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
 #include "interfaces/efl_orientation.eo.h"
 #include "interfaces/efl_flipable.eo.h"
 #include "interfaces/efl_ui_base.eo.h"
+#include "interfaces/efl_ui_direction.eo.h"
 #include "interfaces/efl_ui_drag.eo.h"
 #include "interfaces/efl_ui_spin.eo.h"
 #include "interfaces/efl_ui_range.eo.h"
diff --git a/src/lib/efl/interfaces/efl_common_internal.h 
b/src/lib/efl/interfaces/efl_common_internal.h
index cacb21a252..4a418cc314 100644
--- a/src/lib/efl/interfaces/efl_common_internal.h
+++ b/src/lib/efl/interfaces/efl_common_internal.h
@@ -40,8 +40,8 @@ struct _Efl_Input_Pointer_Data
     */
    Eina_Vector2    cur, prev, raw, norm;
    struct {
-      Efl_Orient   dir;
       int          z;
+      Eina_Bool    horizontal;
    } wheel;
    Efl_Gfx                    *source; /* could it be ecore? */
    Efl_Input_Device           *device;
diff --git a/src/lib/efl/interfaces/efl_input_types.eot 
b/src/lib/efl/interfaces/efl_input_types.eot
index fa1ae07fcf..a06f6044f7 100644
--- a/src/lib/efl/interfaces/efl_input_types.eot
+++ b/src/lib/efl/interfaces/efl_input_types.eot
@@ -132,8 +132,8 @@ enum Efl.Input.Value {
    wheel_delta, [[Delta movement of the wheel in discrete steps (int).
                   Default: 0.]]
    wheel_angle, [[Delta movement of the wheel in radians. Default: 0.]]
-   wheel_direction, [[Direction of the wheel (horizontal = 1 or vertical = 0).
-                      Default: 0. Prefer the property $wheel_direction to 
read.]]
+   wheel_horizontal, [[Direction of the wheel (horizontal = 1 or vertical = 0).
+                       Default: 0. Prefer the property $wheel_horizontal to 
read.]]
    slider,     [[Current position of the slider on the tool. Range: [-1, 1].
                  Default: 0.]]
 }
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c 
b/src/lib/efl/interfaces/efl_interfaces_main.c
index 202be589c7..a4ca74e593 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -51,6 +51,7 @@
 #include "interfaces/efl_orientation.eo.c"
 #include "interfaces/efl_flipable.eo.c"
 #include "interfaces/efl_ui_base.eo.c"
+#include "interfaces/efl_ui_direction.eo.c"
 #include "interfaces/efl_ui_drag.eo.c"
 #include "interfaces/efl_ui_spin.eo.c"
 #include "interfaces/efl_ui_range.eo.c"
diff --git a/src/lib/efl/interfaces/efl_orientation.eo 
b/src/lib/efl/interfaces/efl_orientation.eo
index ff7f207087..fb5f1d8056 100644
--- a/src/lib/efl/interfaces/efl_orientation.eo
+++ b/src/lib/efl/interfaces/efl_orientation.eo
@@ -1,35 +1,36 @@
+import efl_ui_direction; // For documentation references
+
 enum Efl.Orient
 {
-   [[Orientation
+   [[An orientation type, to rotate visual objects.
+
+     Not to be confused with @Efl.Ui.Dir which is meant for widgets, rather
+     than images and canvases. This enum is used to rotate images, videos and
+     the like.
 
-     See also @Efl.Orientation
+     See also @Efl.Orientation.
    ]]
-   none = 0, [[Default, same as up]]
-   up = 0, [[Orient up]]
-   right = 90, [[Orient right]]
-   down = 180, [[Orient down]]
-   left = 270, [[Orient left]]
+   none = 0,   [[Default, same as up]]
+   up = 0,     [[Orient up, do not rotate.]]
+   right = 90, [[Orient right, rotate 90 degrees counter clock-wise.]]
+   down = 180, [[Orient down, rotate 180 degrees.]]
+   left = 270, [[Orient left, rotate 90 degrees clock-wise.]]
    vertical = 0, [[Orient vertical]]
    horizontal = 90 [[Orient horizontal]]
-
 }
 
 interface Efl.Orientation
 {
    [[Efl orientation interface]]
    methods {
-       @property orientation{
-         [[Control the orientation of a given widget
+       @property orientation {
+         [[Control the orientation of a given object.
 
-           Use this function to change how your widget is to be
-           disposed: vertically or horizontally or inverted vertically
-           or inverted horizontally]]
-         set {
-         }
-         get {
-         }
+           This can be used to set the rotation on an image or a window, for
+           instance.
+         ]]
          values {
-            dir: Efl.Orient; [[Direction]]
+            dir: Efl.Orient(none); [[The rotation angle (CCW), see 
@Efl.Orient.]]
          }
       }
    }
diff --git a/src/lib/efl/interfaces/efl_ui_direction.eo 
b/src/lib/efl/interfaces/efl_ui_direction.eo
new file mode 100644
index 0000000000..4900ed2d5a
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_ui_direction.eo
@@ -0,0 +1,44 @@
+// FIXME: Documentation lacks proper references due to cyclic imports.
+// FIXME: What about AnyRTL? And other strange directions?
+
+enum Efl.Ui.Dir
+{
+   [[Direction for UI objects and layouts.
+
+     Not to be confused with $Efl.Orient which is for images and canvases. This
+     enum is used to define how widgets should expand and orient themselves,
+     not to rotate images.
+
+     See also @Efl.Ui.Direction.
+   ]]
+   default = 0,[[Default direction. Each widget may have a different default.]]
+   horizontal, [[Horizontal direction, along the X axis. Usually left-to-right,
+                 but may be inverted to right-to-left if mirroring is on.]]
+   vertical,   [[Vertical direction, along the Y axis. Usually downwards.]]
+   ltr,        [[Horizontal, left-to-right direction.]]
+   rtl,        [[Horizontal, right-to-left direction.]]
+   down,       [[Vertical, top-to-bottom direction.]]
+   up,         [[Vertical, bottom-to-top direction.]]
+}
+
+interface Efl.Ui.Direction
+{
+   [[EFL UI object direction interface]]
+   methods {
+       @property direction {
+         [[Control the direction of a given widget.
+
+           Use this function to change how your widget is to be disposed:
+           vertically or horizontally or inverted vertically or inverted
+           horizontally.
+
+           Mirroring as defined in @Efl.Ui.Base can invert the $horizontal
+           direction: it is $ltr by default, but becomes $rtl if the object
+           is mirrored.
+         ]]
+         values {
+            dir: Efl.Ui.Dir; [[Direction of the widget.]]
+         }
+      }
+   }
+}

-- 


Reply via email to