forked from enlightenment/efl
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
This commit is contained in:
parent
46d4df4962
commit
4270cb032c
|
@ -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 \
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.]]
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,35 +1,36 @@
|
|||
import efl_ui_direction; // For documentation references
|
||||
|
||||
enum Efl.Orient
|
||||
{
|
||||
[[Orientation
|
||||
[[An orientation type, to rotate visual objects.
|
||||
|
||||
See also @Efl.Orientation
|
||||
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.
|
||||
]]
|
||||
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.]]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.]]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue