win: Move pointer "xy" and "inside" to input interface

Those two properties aren't related to a "drawing" canvas
but to the current state of input.

Note: both Efl.Input.Pointer (pointer input event data) and
Efl.Input.Interface (common interface for input handling objects)
expose a pointer position API. Not sure what to do about that.
This commit is contained in:
Jean-Philippe Andre 2016-08-31 14:24:14 +09:00
parent b675571bd8
commit e61b7139ff
6 changed files with 43 additions and 45 deletions

View File

@ -2,43 +2,6 @@ interface Efl.Canvas ()
{
[[Common interface for Window and some internal classes in EFL.]]
methods {
@property pointer_canvas_xy {
get {
[[This function returns the current known pointer coordinates
This function returns the current known canvas unit
coordinates of the mouse pointer and sets the contents of
the Evas_Coords pointed to by $x and $y to contain these
coordinates. If $e is not a valid canvas the results of
this function are undefined.
]]
}
values {
x: int; [[The pointer to hold the return value of pointer's x position.]]
y: int; [[The pointer to hold the return value of pointer's y position.]]
}
}
@property pointer_inside {
get {
[[Returns whether the mouse pointer is logically inside the
canvas.
When this function is called it will return a value of either
$false or $true, depending on if event_feed_mouse_in or
event_feed_mouse_out have been called to feed in a mouse
enter event into the canvas.
A return value of $true indicates the mouse is logically
inside the canvas, and $false implies it is logically
outside the canvas.
A canvas begins with the mouse being assumed outside ($false).
If $e is not a valid canvas, the return value is undefined.
]]
return: bool @warn_unused;
}
}
@property image_max_size {
get {
[[Get the maximum image size evas can possibly handle.
@ -187,8 +150,8 @@ interface Efl.Canvas ()
events {
focus,in;
focus,out;
object,focus,in: Efl.Gfx;
object,focus,out: Efl.Gfx;
object,focus,in: Efl.Canvas.Object;
object,focus,out: Efl.Canvas.Object;
render,pre;
render,post;
device,changed: Efl.Input.Device;

View File

@ -2146,13 +2146,13 @@ _efl_ui_win_efl_canvas_group_group_hide(Eo *obj, Efl_Ui_Win_Data *sd)
}
EOLIAN static void
_efl_ui_win_efl_canvas_pointer_canvas_xy_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int *x, int *y)
_efl_ui_win_efl_input_interface_pointer_xy_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int *x, int *y)
{
evas_pointer_canvas_xy_get(sd->evas, x, y);
}
EOLIAN static Eina_Bool
_efl_ui_win_efl_canvas_pointer_inside_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
_efl_ui_win_efl_input_interface_pointer_inside_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
{
return evas_pointer_inside_get(sd->evas);
}

View File

@ -844,8 +844,8 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Elm.Interface.Atspi.Window,
Efl.Gfx.Size.Hint.hint_aspect.get;
Efl.Text.text.set;
Efl.Text.text.get;
Efl.Canvas.pointer_canvas_xy.get;
Efl.Canvas.pointer_inside.get;
Efl.Input.Interface.pointer_xy.get;
Efl.Input.Interface.pointer_inside.get;
Efl.Canvas.image_max_size.get;
Efl.Canvas.smart_objects_calculate;
Efl.Canvas.objects_at_xy_get;

View File

@ -21,7 +21,43 @@ interface Efl.Input.Interface ()
@since 1.19
]]
eo_prefix: efl_input;
event_prefix: efl;
methods {
@property pointer_xy {
get {
[[This function returns the current known pointer coordinates
This function returns the current known canvas unit
coordinates of the mouse pointer and sets the contents of
the Evas_Coords pointed to by $x and $y to contain these
coordinates.
]]
}
values {
x: int; [[The pointer to hold the return value of pointer's x position.]]
y: int; [[The pointer to hold the return value of pointer's y position.]]
}
}
@property pointer_inside {
get {
[[Returns whether the mouse pointer is logically inside the
canvas.
When this function is called it will return a value of either
$false or $true, depending on whether a pointer,in or pointer,out
event has been called previously.
A return value of $true indicates the mouse is logically
inside the canvas, and $false implies it is logically
outside the canvas.
A canvas begins with the mouse being assumed outside ($false).
]]
return: bool;
}
}
}
events {
pointer,move: Efl.Input.Pointer; [[Main pointer move (current and previous positions are known).]]
pointer,down: Efl.Input.Pointer; [[Main pointer button pressed (button id is known).]]

View File

@ -1,7 +1,7 @@
import efl_orientation;
import efl_input_types;
class Efl.Input.Pointer (Efl.Object, Efl.Input.Event, Efl.Input.State, Efl.Input.Event)
class Efl.Input.Pointer (Efl.Object, Efl.Input.Event, Efl.Input.State)
{
[[Event data carried over with any pointer event (mouse, touch, pen, ...)

View File

@ -2,7 +2,6 @@ interface Efl.Input.State ()
{
eo_prefix: efl_input;
methods {
/* FIXME: legacy name was 'modifier_is_set' */
@property modifier_enabled {
[[Indicates whether a key modifier is on, such as Ctrl, Shift,...]]
get {}