efl: Introduce Efl.Ui.Direction interface
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 9 Aug 2017 11:59:30 +0000 (20:59 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Thu, 10 Aug 2017 05:42:08 +0000 (14:42 +0900)
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
src/lib/efl/Efl.h
src/lib/efl/interfaces/efl_common_internal.h
src/lib/efl/interfaces/efl_input_types.eot
src/lib/efl/interfaces/efl_interfaces_main.c
src/lib/efl/interfaces/efl_orientation.eo
src/lib/efl/interfaces/efl_ui_direction.eo [new file with mode: 0644]

index d615e27..e95a40d 100644 (file)
@@ -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 \
index c1cc00e..9170c6c 100644 (file)
@@ -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"
index cacb21a..4a418cc 100644 (file)
@@ -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;
index fa1ae07..a06f604 100644 (file)
@@ -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.]]
 }
index 202be58..a4ca74e 100644 (file)
@@ -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"
index ff7f207..fb5f1d8 100644 (file)
@@ -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 (file)
index 0000000..4900ed2
--- /dev/null
@@ -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.]]
+         }
+      }
+   }
+}