From: Jean-Philippe Andre Date: Wed, 9 Aug 2017 11:59:30 +0000 (+0900) Subject: efl: Introduce Efl.Ui.Direction interface X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~3210 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4270cb032cb0d87e784f83779ffa3d9ee73b0f15;p=platform%2Fupstream%2Fefl.git 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 --- diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index d615e27..e95a40d 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 c1cc00e..9170c6c 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 cacb21a..4a418cc 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 fa1ae07..a06f604 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 202be58..a4ca74e 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 ff7f207..fb5f1d8 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 0000000..4900ed2 --- /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.]] + } + } + } +}