summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-09 20:59:30 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-10 14:42:08 +0900
commit4270cb032cb0d87e784f83779ffa3d9ee73b0f15 (patch)
treefbb02c339ae22ff949451dfb6890b70d0a2e61b8
parent46d4df4962a723f12723a901b0d2ae2966ebb7ad (diff)
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
-rw-r--r--src/Makefile_Efl.am1
-rw-r--r--src/lib/efl/Efl.h1
-rw-r--r--src/lib/efl/interfaces/efl_common_internal.h2
-rw-r--r--src/lib/efl/interfaces/efl_input_types.eot4
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c1
-rw-r--r--src/lib/efl/interfaces/efl_orientation.eo37
-rw-r--r--src/lib/efl/interfaces/efl_ui_direction.eo44
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 = \
47 lib/efl/interfaces/efl_vpath_core.eo \ 47 lib/efl/interfaces/efl_vpath_core.eo \
48 lib/efl/interfaces/efl_vpath_file_core.eo \ 48 lib/efl/interfaces/efl_vpath_file_core.eo \
49 lib/efl/interfaces/efl_ui_base.eo \ 49 lib/efl/interfaces/efl_ui_base.eo \
50 lib/efl/interfaces/efl_ui_direction.eo \
50 lib/efl/interfaces/efl_ui_drag.eo \ 51 lib/efl/interfaces/efl_ui_drag.eo \
51 lib/efl/interfaces/efl_ui_spin.eo \ 52 lib/efl/interfaces/efl_ui_spin.eo \
52 lib/efl/interfaces/efl_ui_range.eo \ 53 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;
87#include "interfaces/efl_orientation.eo.h" 87#include "interfaces/efl_orientation.eo.h"
88#include "interfaces/efl_flipable.eo.h" 88#include "interfaces/efl_flipable.eo.h"
89#include "interfaces/efl_ui_base.eo.h" 89#include "interfaces/efl_ui_base.eo.h"
90#include "interfaces/efl_ui_direction.eo.h"
90#include "interfaces/efl_ui_drag.eo.h" 91#include "interfaces/efl_ui_drag.eo.h"
91#include "interfaces/efl_ui_spin.eo.h" 92#include "interfaces/efl_ui_spin.eo.h"
92#include "interfaces/efl_ui_range.eo.h" 93#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
40 */ 40 */
41 Eina_Vector2 cur, prev, raw, norm; 41 Eina_Vector2 cur, prev, raw, norm;
42 struct { 42 struct {
43 Efl_Orient dir;
44 int z; 43 int z;
44 Eina_Bool horizontal;
45 } wheel; 45 } wheel;
46 Efl_Gfx *source; /* could it be ecore? */ 46 Efl_Gfx *source; /* could it be ecore? */
47 Efl_Input_Device *device; 47 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 {
132 wheel_delta, [[Delta movement of the wheel in discrete steps (int). 132 wheel_delta, [[Delta movement of the wheel in discrete steps (int).
133 Default: 0.]] 133 Default: 0.]]
134 wheel_angle, [[Delta movement of the wheel in radians. Default: 0.]] 134 wheel_angle, [[Delta movement of the wheel in radians. Default: 0.]]
135 wheel_direction, [[Direction of the wheel (horizontal = 1 or vertical = 0). 135 wheel_horizontal, [[Direction of the wheel (horizontal = 1 or vertical = 0).
136 Default: 0. Prefer the property $wheel_direction to read.]] 136 Default: 0. Prefer the property $wheel_horizontal to read.]]
137 slider, [[Current position of the slider on the tool. Range: [-1, 1]. 137 slider, [[Current position of the slider on the tool. Range: [-1, 1].
138 Default: 0.]] 138 Default: 0.]]
139} 139}
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 @@
51#include "interfaces/efl_orientation.eo.c" 51#include "interfaces/efl_orientation.eo.c"
52#include "interfaces/efl_flipable.eo.c" 52#include "interfaces/efl_flipable.eo.c"
53#include "interfaces/efl_ui_base.eo.c" 53#include "interfaces/efl_ui_base.eo.c"
54#include "interfaces/efl_ui_direction.eo.c"
54#include "interfaces/efl_ui_drag.eo.c" 55#include "interfaces/efl_ui_drag.eo.c"
55#include "interfaces/efl_ui_spin.eo.c" 56#include "interfaces/efl_ui_spin.eo.c"
56#include "interfaces/efl_ui_range.eo.c" 57#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 @@
1import efl_ui_direction; // For documentation references
2
1enum Efl.Orient 3enum Efl.Orient
2{ 4{
3 [[Orientation 5 [[An orientation type, to rotate visual objects.
6
7 Not to be confused with @Efl.Ui.Dir which is meant for widgets, rather
8 than images and canvases. This enum is used to rotate images, videos and
9 the like.
4 10
5 See also @Efl.Orientation 11 See also @Efl.Orientation.
6 ]] 12 ]]
7 none = 0, [[Default, same as up]] 13 none = 0, [[Default, same as up]]
8 up = 0, [[Orient up]] 14 up = 0, [[Orient up, do not rotate.]]
9 right = 90, [[Orient right]] 15 right = 90, [[Orient right, rotate 90 degrees counter clock-wise.]]
10 down = 180, [[Orient down]] 16 down = 180, [[Orient down, rotate 180 degrees.]]
11 left = 270, [[Orient left]] 17 left = 270, [[Orient left, rotate 90 degrees clock-wise.]]
12 vertical = 0, [[Orient vertical]] 18 vertical = 0, [[Orient vertical]]
13 horizontal = 90 [[Orient horizontal]] 19 horizontal = 90 [[Orient horizontal]]
14
15} 20}
16 21
17interface Efl.Orientation 22interface Efl.Orientation
18{ 23{
19 [[Efl orientation interface]] 24 [[Efl orientation interface]]
20 methods { 25 methods {
21 @property orientation{ 26 @property orientation {
22 [[Control the orientation of a given widget 27 [[Control the orientation of a given object.
23 28
24 Use this function to change how your widget is to be 29 This can be used to set the rotation on an image or a window, for
25 disposed: vertically or horizontally or inverted vertically 30 instance.
26 or inverted horizontally]] 31 ]]
27 set {
28 }
29 get {
30 }
31 values { 32 values {
32 dir: Efl.Orient; [[Direction]] 33 dir: Efl.Orient(none); [[The rotation angle (CCW), see @Efl.Orient.]]
33 } 34 }
34 } 35 }
35 } 36 }
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 @@
1// FIXME: Documentation lacks proper references due to cyclic imports.
2// FIXME: What about AnyRTL? And other strange directions?
3
4enum Efl.Ui.Dir
5{
6 [[Direction for UI objects and layouts.
7
8 Not to be confused with $Efl.Orient which is for images and canvases. This
9 enum is used to define how widgets should expand and orient themselves,
10 not to rotate images.
11
12 See also @Efl.Ui.Direction.
13 ]]
14 default = 0,[[Default direction. Each widget may have a different default.]]
15 horizontal, [[Horizontal direction, along the X axis. Usually left-to-right,
16 but may be inverted to right-to-left if mirroring is on.]]
17 vertical, [[Vertical direction, along the Y axis. Usually downwards.]]
18 ltr, [[Horizontal, left-to-right direction.]]
19 rtl, [[Horizontal, right-to-left direction.]]
20 down, [[Vertical, top-to-bottom direction.]]
21 up, [[Vertical, bottom-to-top direction.]]
22}
23
24interface Efl.Ui.Direction
25{
26 [[EFL UI object direction interface]]
27 methods {
28 @property direction {
29 [[Control the direction of a given widget.
30
31 Use this function to change how your widget is to be disposed:
32 vertically or horizontally or inverted vertically or inverted
33 horizontally.
34
35 Mirroring as defined in @Efl.Ui.Base can invert the $horizontal
36 direction: it is $ltr by default, but becomes $rtl if the object
37 is mirrored.
38 ]]
39 values {
40 dir: Efl.Ui.Dir; [[Direction of the widget.]]
41 }
42 }
43 }
44}