forked from enlightenment/efl
Evas.Canvas: Move some event_feed to legacy
Paving the way to Efl.Pointer.Event...
This commit is contained in:
parent
645a7b7d6c
commit
fb35171186
|
@ -93,7 +93,7 @@ class Efl.Pointer.Event (Eo.Base, Efl.Event)
|
||||||
@property device {
|
@property device {
|
||||||
[[Pointing device that originated this event.]]
|
[[Pointing device that originated this event.]]
|
||||||
values {
|
values {
|
||||||
dev: Efl.Input.Device*;
|
dev: Efl.Input.Device;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@property source {
|
@property source {
|
||||||
|
@ -101,7 +101,7 @@ class Efl.Pointer.Event (Eo.Base, Efl.Event)
|
||||||
propagation or repetition of the event.
|
propagation or repetition of the event.
|
||||||
]]
|
]]
|
||||||
values {
|
values {
|
||||||
src: Efl.Gfx*;
|
src: Efl.Gfx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* FIXME: why not double_click() and triple_click() */
|
/* FIXME: why not double_click() and triple_click() */
|
||||||
|
|
|
@ -336,6 +336,77 @@ EAPI int evas_event_freeze_get(const Evas *e) EINA_WARN_UNUSED_RESU
|
||||||
* out on new objects if the state change demands it.
|
* out on new objects if the state change demands it.
|
||||||
*/
|
*/
|
||||||
EAPI void evas_event_thaw_eval(Evas *e) EINA_ARG_NONNULL(1);
|
EAPI void evas_event_thaw_eval(Evas *e) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Mouse move event feed.
|
||||||
|
*
|
||||||
|
* This function will set some evas properties that is necessary when the mouse
|
||||||
|
* is moved from its last position. It prepares information to be treated by
|
||||||
|
* the callback function.
|
||||||
|
*
|
||||||
|
* @param[in] y The vertical position of the mouse pointer.
|
||||||
|
* @param[in] timestamp The timestamp of the mouse up event.
|
||||||
|
* @param[in] data The data for canvas.
|
||||||
|
*/
|
||||||
|
EAPI void evas_event_feed_mouse_move(Evas *obj, int x, int y, unsigned int timestamp, const void *data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Mouse move event feed from input.
|
||||||
|
*
|
||||||
|
* Similar to the @ref evas_event_feed_mouse_move, this function will inform
|
||||||
|
* Evas about mouse move events which were received by the input system,
|
||||||
|
* relative to the 0,0 of the window, not to the canvas 0,0. It will take care
|
||||||
|
* of doing any special transformation like adding the framespace offset to the
|
||||||
|
* mouse event.
|
||||||
|
*
|
||||||
|
* @param[in] y The vertical position of the mouse pointer relative to the 0,0
|
||||||
|
* of the window/surface.
|
||||||
|
* @param[in] timestamp The timestamp of the mouse move event.
|
||||||
|
* @param[in] data The data for canvas.
|
||||||
|
*
|
||||||
|
* @since 1.8
|
||||||
|
*/
|
||||||
|
EAPI void evas_event_input_mouse_move(Evas *obj, int x, int y, unsigned int timestamp, const void *data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Mouse up event feed.
|
||||||
|
*
|
||||||
|
* This function will set some evas properties that is necessary when the mouse
|
||||||
|
* button is released. It prepares information to be treated by the callback
|
||||||
|
* function.
|
||||||
|
*
|
||||||
|
* @param[in] flags Evas button flags.
|
||||||
|
* @param[in] timestamp The timestamp of the mouse up event.
|
||||||
|
* @param[in] data The data for canvas.
|
||||||
|
*/
|
||||||
|
EAPI void evas_event_feed_mouse_up(Evas *obj, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Mouse down event feed.
|
||||||
|
*
|
||||||
|
* This function will set some evas properties that is necessary when the mouse
|
||||||
|
* button is pressed. It prepares information to be treated by the callback
|
||||||
|
* function.
|
||||||
|
*
|
||||||
|
* @param[in] flags Evas button flags.
|
||||||
|
* @param[in] timestamp The timestamp of the mouse up event.
|
||||||
|
* @param[in] data The data for canvas.
|
||||||
|
*/
|
||||||
|
EAPI void evas_event_feed_mouse_down(Evas *obj, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Mouse wheel event feed.
|
||||||
|
*
|
||||||
|
* This function will set some evas properties that is necessary when the mouse
|
||||||
|
* wheel is scrolled up or down. It prepares information to be treated by the
|
||||||
|
* callback function.
|
||||||
|
*
|
||||||
|
* @param[in] z How much mouse wheel was scrolled up or down.
|
||||||
|
* @param[in] timestamp The timestamp of the mouse up event.
|
||||||
|
* @param[in] data The data for canvas.
|
||||||
|
*/
|
||||||
|
EAPI void evas_event_feed_mouse_wheel(Evas *obj, int direction, int z, unsigned int timestamp, const void *data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -503,8 +503,7 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
|
||||||
any host system's pointing device abilities.
|
any host system's pointing device abilities.
|
||||||
|
|
||||||
A canvas by default begins with no mouse buttons being
|
A canvas by default begins with no mouse buttons being
|
||||||
pressed and only calls to @.event_feed_mouse_down
|
pressed and only calls to @.event_feed can alter that.
|
||||||
and @.event_feed_mouse_up will alter that.
|
|
||||||
|
|
||||||
The least significant bit corresponds to the first mouse
|
The least significant bit corresponds to the first mouse
|
||||||
button (button 1) and the most significant bit corresponds
|
button (button 1) and the most significant bit corresponds
|
||||||
|
@ -547,20 +546,6 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
|
||||||
@in y: int; [[The vertical coordinate of the position.]]
|
@in y: int; [[The vertical coordinate of the position.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event_feed_mouse_wheel {
|
|
||||||
[[Mouse wheel event feed.
|
|
||||||
|
|
||||||
This function will set some evas properties that is necessary
|
|
||||||
when the mouse wheel is scrolled up or down. It prepares
|
|
||||||
information to be treated by the callback function.
|
|
||||||
]]
|
|
||||||
params {
|
|
||||||
@in direction: int; [[The wheel mouse direction.]]
|
|
||||||
@in z: int; [[How much mouse wheel was scrolled up or down.]]
|
|
||||||
@in timestamp: uint; [[The timestamp of the mouse up event.]]
|
|
||||||
@in data: const(void)*; [[The data for canvas.]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
key_lock_on {
|
key_lock_on {
|
||||||
[[Enables or turns on programmatically the lock key with name
|
[[Enables or turns on programmatically the lock key with name
|
||||||
$keyname.
|
$keyname.
|
||||||
|
@ -661,20 +646,6 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
|
||||||
@in data: const(void)*; [[The data for canvas.]]
|
@in data: const(void)*; [[The data for canvas.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event_feed_mouse_move {
|
|
||||||
[[Mouse move event feed.
|
|
||||||
|
|
||||||
This function will set some evas properties that is necessary
|
|
||||||
when the mouse is moved from its last position. It prepares
|
|
||||||
information to be treated by the callback function.
|
|
||||||
]]
|
|
||||||
params {
|
|
||||||
@in x: int; [[The horizontal position of the mouse pointer.]]
|
|
||||||
@in y: int; [[The vertical position of the mouse pointer.]]
|
|
||||||
@in timestamp: uint; [[The timestamp of the mouse up event.]]
|
|
||||||
@in data: const(void)*; [[The data for canvas.]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
event_feed_key_up {
|
event_feed_key_up {
|
||||||
[[Key up event feed.
|
[[Key up event feed.
|
||||||
|
|
||||||
|
@ -833,26 +804,6 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
|
||||||
focus_out {
|
focus_out {
|
||||||
[[Inform to the evas that it lost the focus.]]
|
[[Inform to the evas that it lost the focus.]]
|
||||||
}
|
}
|
||||||
event_input_mouse_move {
|
|
||||||
[[Mouse move event feed from input.
|
|
||||||
|
|
||||||
Similar to the @.event_feed_mouse_move, this function will
|
|
||||||
inform Evas about mouse move events which were received by
|
|
||||||
the input system, relative to the 0,0 of the window, not to the
|
|
||||||
canvas 0,0. It will take care of doing any special transformation
|
|
||||||
like adding the framespace offset to the mouse event.
|
|
||||||
|
|
||||||
@since 1.8
|
|
||||||
]]
|
|
||||||
params {
|
|
||||||
@in x: int; [[The horizontal position of the mouse pointer
|
|
||||||
relative to the 0,0 of the window/surface.]]
|
|
||||||
@in y: int; [[The vertical position of the mouse pointer
|
|
||||||
relative to the 0,0 of the window/surface.]]
|
|
||||||
@in timestamp: uint; [[The timestamp of the mouse move event.]]
|
|
||||||
@in data: const(void)*; [[The data for canvas.]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
norender {
|
norender {
|
||||||
[[Update the canvas internal objects but not triggering immediate
|
[[Update the canvas internal objects but not triggering immediate
|
||||||
renderization.
|
renderization.
|
||||||
|
@ -986,34 +937,6 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
|
||||||
@in keyname: const(char)* @nonull; [[The name of the modifier to enable.]]
|
@in keyname: const(char)* @nonull; [[The name of the modifier to enable.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event_feed_mouse_up {
|
|
||||||
[[Mouse up event feed.
|
|
||||||
|
|
||||||
This function will set some evas properties that is necessary
|
|
||||||
when the mouse button is released. It prepares information to
|
|
||||||
be treated by the callback function.
|
|
||||||
]]
|
|
||||||
params {
|
|
||||||
@in b: int; [[The button number.]]
|
|
||||||
@in flags: Evas.Button_Flags; [[Evas button flags.]]
|
|
||||||
@in timestamp: uint; [[The timestamp of the mouse up event.]]
|
|
||||||
@in data: const(void)*; [[The data for canvas.]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
event_feed_mouse_down {
|
|
||||||
[[Mouse down event feed.
|
|
||||||
|
|
||||||
This function will set some evas properties that is necessary
|
|
||||||
when the mouse button is pressed. It prepares information to
|
|
||||||
be treated by the callback function.
|
|
||||||
]]
|
|
||||||
params {
|
|
||||||
@in b: int; [[The button number.]]
|
|
||||||
@in flags: Evas.Button_Flags; [[Evas button flags.]]
|
|
||||||
@in timestamp: uint; [[The timestamp of the mouse up event.]]
|
|
||||||
@in data: const(void)*; [[The data for canvas.]]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
event_refeed_event {
|
event_refeed_event {
|
||||||
[[Re feed event.
|
[[Re feed event.
|
||||||
|
|
||||||
|
@ -1480,8 +1403,7 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
|
||||||
event_feed_mouse_cancel {
|
event_feed_mouse_cancel {
|
||||||
[[Mouse cancel event feed.
|
[[Mouse cancel event feed.
|
||||||
|
|
||||||
This function will call @.event_feed_mouse_up when a
|
This function will call generate a mouse up event.
|
||||||
mouse cancel event happens.
|
|
||||||
]]
|
]]
|
||||||
params {
|
params {
|
||||||
@in timestamp: uint; [[The timestamp of the mouse up event.]]
|
@in timestamp: uint; [[The timestamp of the mouse up event.]]
|
||||||
|
@ -1630,6 +1552,13 @@ class Evas.Canvas (Eo.Base, Evas.Common_Interface, Efl.Animator)
|
||||||
@in data: const(void)*; [[Data for canvas.]]
|
@in data: const(void)*; [[Data for canvas.]]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
event_feed {
|
||||||
|
[[Feed an input event.]]
|
||||||
|
legacy: null;
|
||||||
|
params {
|
||||||
|
event: const(Efl.Pointer.Event);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
implements {
|
implements {
|
||||||
Eo.Base.constructor;
|
Eo.Base.constructor;
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#include "evas_common_private.h"
|
#include "evas_common_private.h"
|
||||||
#include "evas_private.h"
|
#include "evas_private.h"
|
||||||
|
|
||||||
|
#define EFL_INTERNAL_UNSTABLE
|
||||||
|
#include "interfaces/efl_common_internal.h"
|
||||||
|
|
||||||
static Eina_List *
|
static Eina_List *
|
||||||
_evas_event_object_list_in_get(Evas *eo_e, Eina_List *in,
|
_evas_event_object_list_in_get(Evas *eo_e, Eina_List *in,
|
||||||
const Eina_Inlist *list, Evas_Object *stop,
|
const Eina_Inlist *list, Evas_Object *stop,
|
||||||
|
@ -1008,9 +1011,10 @@ evas_event_thaw_eval(Evas *eo_e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN void
|
EAPI void
|
||||||
_evas_canvas_event_feed_mouse_down(Eo *eo_e, Evas_Public_Data *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
|
evas_event_feed_mouse_down(Eo *eo_e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
|
||||||
{
|
{
|
||||||
|
Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
||||||
Eina_List *l, *copy;
|
Eina_List *l, *copy;
|
||||||
Evas_Event_Mouse_Down ev;
|
Evas_Event_Mouse_Down ev;
|
||||||
Evas_Object *eo_obj;
|
Evas_Object *eo_obj;
|
||||||
|
@ -1230,9 +1234,10 @@ _post_up_handle(Evas *eo_e, unsigned int timestamp, const void *data)
|
||||||
return post_called;
|
return post_called;
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN void
|
EAPI void
|
||||||
_evas_canvas_event_feed_mouse_up(Eo *eo_e, Evas_Public_Data *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
|
evas_event_feed_mouse_up(Eo *eo_e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data)
|
||||||
{
|
{
|
||||||
|
Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
||||||
Eina_List *l, *copy;
|
Eina_List *l, *copy;
|
||||||
|
|
||||||
INF("ButtonEvent:up time=%u x=%d y=%d button=%d downs=%d", timestamp, e->pointer.x, e->pointer.y, b, e->pointer.downs);
|
INF("ButtonEvent:up time=%u x=%d y=%d button=%d downs=%d", timestamp, e->pointer.x, e->pointer.y, b, e->pointer.downs);
|
||||||
|
@ -1359,9 +1364,10 @@ _evas_canvas_event_feed_mouse_cancel(Eo *eo_e, Evas_Public_Data *e, unsigned int
|
||||||
_evas_unwalk(e);
|
_evas_unwalk(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN void
|
EAPI void
|
||||||
_evas_canvas_event_feed_mouse_wheel(Eo *eo_e, Evas_Public_Data *e, int direction, int z, unsigned int timestamp, const void *data)
|
evas_event_feed_mouse_wheel(Eo *eo_e, int direction, int z, unsigned int timestamp, const void *data)
|
||||||
{
|
{
|
||||||
|
Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
||||||
Eina_List *l, *copy;
|
Eina_List *l, *copy;
|
||||||
Evas_Event_Mouse_Wheel ev;
|
Evas_Event_Mouse_Wheel ev;
|
||||||
Evas_Object *eo_obj;
|
Evas_Object *eo_obj;
|
||||||
|
@ -1904,15 +1910,17 @@ nogrep:
|
||||||
_evas_unwalk(e);
|
_evas_unwalk(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN void
|
EAPI void
|
||||||
_evas_canvas_event_input_mouse_move(Eo *eo_e, Evas_Public_Data *e, int x, int y, unsigned int timestamp, const void *data)
|
evas_event_input_mouse_move(Eo *eo_e, int x, int y, unsigned int timestamp, const void *data)
|
||||||
{
|
{
|
||||||
|
Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
||||||
_canvas_event_feed_mouse_move_internal(eo_e, e, x - e->framespace.x, y - e->framespace.y, timestamp, data);
|
_canvas_event_feed_mouse_move_internal(eo_e, e, x - e->framespace.x, y - e->framespace.y, timestamp, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
EOLIAN void
|
EAPI void
|
||||||
_evas_canvas_event_feed_mouse_move(Eo *eo_e, Evas_Public_Data *e, int x, int y, unsigned int timestamp, const void *data)
|
evas_event_feed_mouse_move(Eo *eo_e, int x, int y, unsigned int timestamp, const void *data)
|
||||||
{
|
{
|
||||||
|
Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
|
||||||
_canvas_event_feed_mouse_move_internal(eo_e, e, x, y, timestamp, data);
|
_canvas_event_feed_mouse_move_internal(eo_e, e, x, y, timestamp, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1984,7 +1992,6 @@ _evas_canvas_event_feed_mouse_in(Eo *eo_e, Evas_Public_Data *e, unsigned int tim
|
||||||
EOLIAN void
|
EOLIAN void
|
||||||
_evas_canvas_event_feed_mouse_out(Eo *eo_e, Evas_Public_Data *e, unsigned int timestamp, const void *data)
|
_evas_canvas_event_feed_mouse_out(Eo *eo_e, Evas_Public_Data *e, unsigned int timestamp, const void *data)
|
||||||
{
|
{
|
||||||
|
|
||||||
Evas_Event_Mouse_Out ev;
|
Evas_Event_Mouse_Out ev;
|
||||||
int event_id = 0;
|
int event_id = 0;
|
||||||
|
|
||||||
|
@ -3025,3 +3032,10 @@ _evas_canvas_event_down_count_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
||||||
{
|
{
|
||||||
return e->pointer.downs;
|
return e->pointer.downs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EOLIAN void
|
||||||
|
_evas_canvas_event_feed(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, const Efl_Pointer_Event *event)
|
||||||
|
{
|
||||||
|
Efl_Pointer_Event_Data *ev = eo_data_scope_get(event, EFL_POINTER_EVENT_CLASS);
|
||||||
|
/* TODO */
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue