forked from enlightenment/efl
Evas: Add support for per mouse pointer mode/properties.
This patch introduces the possibility to set the pointer mode and query other properties like current position per pointer device. The old API will still works, however it will only act on the default seat.
This commit is contained in:
parent
5442e9c908
commit
484dae76e6
|
@ -21,6 +21,18 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator,
|
|||
type: string; [[The type of the object.]]
|
||||
}
|
||||
}
|
||||
@property pointer_mode_by_device {
|
||||
[[Low-level pointer behaviour by device.
|
||||
See @.pointer_mode.get and @.pointer_mode.set for more explanation.
|
||||
@since 1.19
|
||||
]]
|
||||
keys {
|
||||
dev: Efl.Input.Device; [[The pointer device to set/get the mode. Use $null for the default pointer.]]
|
||||
}
|
||||
values {
|
||||
pointer_mode: Efl.Input.Object_Pointer_Mode; [[The pointer mode]]
|
||||
}
|
||||
}
|
||||
@property pointer_mode {
|
||||
[[Low-level pointer behaviour.
|
||||
|
||||
|
@ -37,6 +49,8 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator,
|
|||
will be emitted just when inside this object area.
|
||||
|
||||
The default value is @Efl.Input.Object_Pointer_Mode.auto_grab.
|
||||
See also: @.pointer_mode_by_device.get and @.pointer_mode_by_device.set
|
||||
Note: This function will only set/get the mode for the default pointer.
|
||||
]]
|
||||
values {
|
||||
pointer_mode: Efl.Input.Object_Pointer_Mode; [[Input pointer mode]]
|
||||
|
@ -47,7 +61,7 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator,
|
|||
|
||||
This shall be true between pointer,in and pointer,out events (coming
|
||||
in matching numbers). Note that group objects may receive multiple
|
||||
pointer,in in a row.
|
||||
pointer,in in a row. See algo @.pointer_device_in.get
|
||||
|
||||
@since 1.19
|
||||
]]
|
||||
|
@ -56,6 +70,23 @@ abstract Efl.Canvas.Object (Efl.Object, Efl.Gfx, Efl.Gfx.Stack, Efl.Animator,
|
|||
in: bool; [[If $true the main pointer has entered this object.]]
|
||||
}
|
||||
}
|
||||
@property pointer_device_in {
|
||||
[[Read-only value indicating whether a pointer is in the object.
|
||||
|
||||
This shall be true between pointer,in and pointer,out events (coming
|
||||
in matching numbers). Note that group objects may receive multiple
|
||||
pointer,in in a row.
|
||||
|
||||
@since 1.19
|
||||
]]
|
||||
get {}
|
||||
keys {
|
||||
pointer: Efl.Input.Device; [[The pointer. Use $null for the defaul pointer]]
|
||||
}
|
||||
values {
|
||||
in: bool; [[If $true the pointer has entered this object.]]
|
||||
}
|
||||
}
|
||||
@property render_op {
|
||||
[[Render mode to be used for compositing the Evas object.
|
||||
|
||||
|
|
|
@ -211,9 +211,20 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface)
|
|||
]]
|
||||
}
|
||||
}
|
||||
@property pointer_canvas_xy_by_device {
|
||||
[[This function returns the current known default pointer coordinates. @since 1.19]]
|
||||
get {}
|
||||
keys {
|
||||
dev: Efl.Input.Device; [[The pointer device.]]
|
||||
}
|
||||
values {
|
||||
x: Evas.Coord; [[The pointer to a Evas_Coord to be filled in.]]
|
||||
y: Evas.Coord; [[The pointer to a Evas_Coord to be filled in.]]
|
||||
}
|
||||
}
|
||||
@property pointer_canvas_xy {
|
||||
get {
|
||||
[[This function returns the current known pointer coordinates
|
||||
[[This function returns the current known default pointer coordinates
|
||||
|
||||
This function returns the current known canvas unit
|
||||
coordinates of the mouse pointer and sets the contents of
|
||||
|
@ -291,9 +302,20 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface)
|
|||
return: bool; [[$true if changed, $false otherwise]]
|
||||
}
|
||||
}
|
||||
@property pointer_output_xy_by_device {
|
||||
[[This function returns the current known pointer coordinates. @since 1.19]]
|
||||
get {}
|
||||
keys {
|
||||
dev: Efl.Input.Device; [[The mouse device.]]
|
||||
}
|
||||
values {
|
||||
x: int; [[The pointer to an integer to be filled in.]]
|
||||
y: int; [[The pointer to an integer to be filled in.]]
|
||||
}
|
||||
}
|
||||
@property pointer_output_xy {
|
||||
get {
|
||||
[[This function returns the current known pointer coordinates.
|
||||
[[This function returns the current known default pointer coordinates.
|
||||
|
||||
This function returns the current known screen/output
|
||||
coordinates of the mouse pointer and sets the contents of
|
||||
|
@ -317,9 +339,20 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface)
|
|||
y: int; [[The pointer to an integer to be filled in.]]
|
||||
}
|
||||
}
|
||||
@property pointer_inside_by_device {
|
||||
[[Returns whether the mouse pointer is logically inside the
|
||||
canvas. @since 1.19]]
|
||||
keys {
|
||||
dev: Efl.Input.Device; [[The pointer device.]]
|
||||
}
|
||||
get {}
|
||||
values {
|
||||
in: bool; [[$true if the pointer is inside, $false otherwise.]]
|
||||
}
|
||||
}
|
||||
@property pointer_inside {
|
||||
get {
|
||||
[[Returns whether the mouse pointer is logically inside the
|
||||
[[Returns whether the default mouse pointer is logically inside the
|
||||
canvas.
|
||||
|
||||
When this function is called it will return a value of either
|
||||
|
@ -405,9 +438,20 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface)
|
|||
]]
|
||||
}
|
||||
}
|
||||
@property pointer_button_down_mask_by_device {
|
||||
[[Returns a bitmask with the mouse buttons currently pressed,
|
||||
set to 1.]]
|
||||
keys {
|
||||
dev: Efl.Input.Device; [[The mouse device.]]
|
||||
}
|
||||
get {}
|
||||
values {
|
||||
mask: uint; [[A bitmask of the currently depressed buttons on the canvas.]]
|
||||
}
|
||||
}
|
||||
@property pointer_button_down_mask {
|
||||
get {
|
||||
[[Returns a bitmask with the mouse buttons currently pressed,
|
||||
[[Returns a bitmask with the default mouse buttons currently pressed,
|
||||
set to 1.
|
||||
|
||||
Calling this function will return a 32-bit integer with the
|
||||
|
|
|
@ -396,14 +396,11 @@ _efl_canvas_object_clip_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas_Ob
|
|||
if ((!obj->is_smart) &&
|
||||
(!((obj->map->cur.map) && (obj->map->cur.usemap))))
|
||||
{
|
||||
if (evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1))
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
_evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas,
|
||||
eo_obj,
|
||||
obj, 1, 1,
|
||||
EINA_FALSE,
|
||||
NULL);
|
||||
}
|
||||
evas_object_clip_across_check(eo_obj, obj);
|
||||
}
|
||||
|
@ -447,14 +444,11 @@ _clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
|||
if ((!obj->is_smart) &&
|
||||
(!((obj->map->cur.map) && (obj->map->cur.usemap))))
|
||||
{
|
||||
if (evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1))
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
_evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas,
|
||||
eo_obj,
|
||||
obj, 1, 1,
|
||||
EINA_FALSE,
|
||||
NULL);
|
||||
}
|
||||
evas_object_clip_across_check(eo_obj, obj);
|
||||
}
|
||||
|
|
|
@ -29,8 +29,9 @@ _is_pointer(Evas_Device_Class clas)
|
|||
{
|
||||
if (clas == EVAS_DEVICE_CLASS_MOUSE ||
|
||||
clas == EVAS_DEVICE_CLASS_TOUCH ||
|
||||
clas == EVAS_DEVICE_CLASS_WAND ||
|
||||
clas == EVAS_DEVICE_CLASS_PEN)
|
||||
clas == EVAS_DEVICE_CLASS_PEN ||
|
||||
clas == EVAS_DEVICE_CLASS_POINTER ||
|
||||
clas == EVAS_DEVICE_CLASS_WAND)
|
||||
return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
@ -86,6 +87,7 @@ _del_cb(void *data, const Efl_Event *ev)
|
|||
else if (e->default_keyboard == ev->object)
|
||||
e->default_keyboard = _new_default_device_find(e, ev->object);
|
||||
|
||||
_evas_pointer_data_remove(e, ev->object);
|
||||
efl_event_callback_call(e->evas, EFL_CANVAS_EVENT_DEVICE_REMOVED,
|
||||
ev->object);
|
||||
}
|
||||
|
@ -128,8 +130,17 @@ evas_device_add_full(Evas *eo_e, const char *name, const char *desc,
|
|||
e->default_seat = dev;
|
||||
else if (!e->default_keyboard && clas == EVAS_DEVICE_CLASS_KEYBOARD)
|
||||
e->default_keyboard = dev;
|
||||
else if (!e->default_mouse && _is_pointer(clas))
|
||||
e->default_mouse = dev;
|
||||
else if (_is_pointer(clas))
|
||||
{
|
||||
if (!_evas_pointer_data_add(e, dev))
|
||||
{
|
||||
efl_del(dev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!e->default_mouse)
|
||||
e->default_mouse = dev;
|
||||
}
|
||||
|
||||
e->devices = eina_list_append(e->devices, dev);
|
||||
efl_event_callback_add(dev, EFL_EVENT_DEL, _del_cb, e);
|
||||
|
@ -255,8 +266,19 @@ evas_device_class_set(Evas_Device *dev, Evas_Device_Class clas)
|
|||
SAFETY_CHECK(dev, EFL_INPUT_DEVICE_CLASS);
|
||||
|
||||
Efl_Input_Device_Data *d = efl_data_scope_get(dev, EFL_INPUT_DEVICE_CLASS);
|
||||
Evas_Public_Data *edata = efl_data_scope_get(d->evas, EVAS_CANVAS_CLASS);
|
||||
|
||||
if (d->klass == clas)
|
||||
return;
|
||||
|
||||
if (_is_pointer(d->klass))
|
||||
_evas_pointer_data_remove(edata, dev);
|
||||
|
||||
efl_input_device_type_set(dev, clas);
|
||||
|
||||
if (_is_pointer(clas))
|
||||
_evas_pointer_data_add(edata, dev);
|
||||
|
||||
evas_event_callback_call(d->evas, EVAS_CALLBACK_DEVICE_CHANGED, dev);
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -37,12 +37,16 @@ efl_input_pointer_legacy_info_fill(Evas *eo_evas, Efl_Input_Key *eo_ev, Evas_Cal
|
|||
{
|
||||
Efl_Input_Pointer_Data *ev = efl_data_scope_get(eo_ev, EFL_INPUT_POINTER_CLASS);
|
||||
Evas_Public_Data *evas = efl_data_scope_get(eo_evas, EVAS_CANVAS_CLASS);
|
||||
Evas_Pointer_Data *pdata;
|
||||
|
||||
if (!ev || !evas) return NULL;
|
||||
|
||||
#define COORD_DUP(e) do { (e)->output.x = evas->pointer.x; (e)->output.y = evas->pointer.y; } while (0)
|
||||
#define COORD_DUP_CUR(e) do { (e)->cur.output.x = evas->pointer.x; (e)->cur.output.y = evas->pointer.y; } while (0)
|
||||
#define COORD_DUP_PREV(e) do { (e)->prev.output.x = evas->pointer.prev.x; (e)->prev.output.y = evas->pointer.prev.y; } while (0)
|
||||
pdata = _evas_pointer_data_by_device_get(evas, ev->device);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
|
||||
|
||||
#define COORD_DUP(e) do { (e)->output.x = pdata->x; (e)->output.y = pdata->y; } while (0)
|
||||
#define COORD_DUP_CUR(e) do { (e)->cur.output.x = pdata->x; (e)->cur.output.y = pdata->y; } while (0)
|
||||
#define COORD_DUP_PREV(e) do { (e)->prev.output.x = pdata->prev.x; (e)->prev.output.y = pdata->prev.y; } while (0)
|
||||
#define TYPE_CHK(typ) do { if (type != EVAS_CALLBACK_ ## typ) return NULL; } while (0)
|
||||
|
||||
switch (ev->action)
|
||||
|
|
|
@ -248,18 +248,11 @@ _efl_canvas_object_efl_gfx_stack_layer_set(Eo *eo_obj,
|
|||
return;
|
||||
}
|
||||
evas_object_change(eo_obj, obj);
|
||||
if (!obj->is_smart)
|
||||
if (!obj->is_smart && obj->cur->visible)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1) &&
|
||||
obj->cur->visible)
|
||||
if (eina_list_data_find(obj->layer->evas->pointer.object.in, obj))
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
_evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas, eo_obj, obj,
|
||||
1, 1, EINA_TRUE,
|
||||
NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -262,6 +262,7 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
|
|||
Evas_Out *evo;
|
||||
int i;
|
||||
Eina_Bool del;
|
||||
Evas_Pointer_Data *pdata;
|
||||
|
||||
evas_canvas_async_block(e);
|
||||
if (e->walking_list == 0) evas_render_idle_flush(eo_e);
|
||||
|
@ -320,7 +321,6 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
|
|||
e->walking_list--;
|
||||
|
||||
evas_font_path_clear(eo_e);
|
||||
e->pointer.object.in = eina_list_free(e->pointer.object.in);
|
||||
|
||||
if (e->name_hash) eina_hash_free(e->name_hash);
|
||||
e->name_hash = NULL;
|
||||
|
@ -378,6 +378,12 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
|
|||
_evas_device_cleanup(eo_e);
|
||||
e->focused_by = eina_list_free(e->focused_by);
|
||||
|
||||
EINA_LIST_FREE(e->pointers, pdata)
|
||||
{
|
||||
eina_list_free(pdata->object.in);
|
||||
free(pdata);
|
||||
}
|
||||
|
||||
eina_lock_free(&(e->lock_objects));
|
||||
eina_spinlock_free(&(e->render.lock));
|
||||
|
||||
|
@ -501,29 +507,88 @@ evas_object_image_extension_can_load_fast_get(const char *file)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_evas_canvas_pointer_output_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int *x, int *y)
|
||||
_evas_canvas_pointer_output_xy_by_device_get(Eo *eo_e EINA_UNUSED,
|
||||
Evas_Public_Data *e,
|
||||
Efl_Input_Device *dev,
|
||||
int *x, int *y)
|
||||
{
|
||||
if (x) *x = e->pointer.x;
|
||||
if (y) *y = e->pointer.y;
|
||||
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev);
|
||||
|
||||
if (!pdata)
|
||||
{
|
||||
if (x) *x = 0;
|
||||
if (y) *y = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x) *x = pdata->x;
|
||||
if (y) *y = pdata->y;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_evas_canvas_pointer_canvas_xy_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord *x, Evas_Coord *y)
|
||||
_evas_canvas_pointer_canvas_xy_by_device_get(Eo *eo_e EINA_UNUSED,
|
||||
Evas_Public_Data *e,
|
||||
Efl_Input_Device *dev,
|
||||
int *x, int *y)
|
||||
{
|
||||
if (x) *x = e->pointer.x;
|
||||
if (y) *y = e->pointer.y;
|
||||
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev);
|
||||
|
||||
if (!pdata)
|
||||
{
|
||||
if (x) *x = 0;
|
||||
if (y) *y = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (x) *x = pdata->x;
|
||||
if (y) *y = pdata->y;
|
||||
}
|
||||
}
|
||||
|
||||
EOLIAN static unsigned int
|
||||
_evas_canvas_pointer_button_down_mask_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
||||
_evas_canvas_pointer_button_down_mask_by_device_get(Eo *eo_e EINA_UNUSED,
|
||||
Evas_Public_Data *e,
|
||||
Efl_Input_Device *dev)
|
||||
{
|
||||
return e->pointer.button;
|
||||
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev);
|
||||
if (!pdata) return 0;
|
||||
return pdata->button;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_evas_canvas_pointer_inside_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
|
||||
_evas_canvas_pointer_inside_by_device_get(Eo *eo_e EINA_UNUSED,
|
||||
Evas_Public_Data *e,
|
||||
Efl_Input_Device *dev)
|
||||
{
|
||||
return e->pointer.inside;
|
||||
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev);
|
||||
if (!pdata) return EINA_FALSE;
|
||||
return pdata->inside;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_evas_canvas_pointer_output_xy_get(Eo *eo_e, Evas_Public_Data *e, int *x, int *y)
|
||||
{
|
||||
return _evas_canvas_pointer_output_xy_by_device_get(eo_e, e, NULL, x, y);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_evas_canvas_pointer_canvas_xy_get(Eo *eo_e, Evas_Public_Data *e, Evas_Coord *x, Evas_Coord *y)
|
||||
{
|
||||
return _evas_canvas_pointer_canvas_xy_by_device_get(eo_e, e, NULL, x, y);
|
||||
}
|
||||
|
||||
EOLIAN static unsigned int
|
||||
_evas_canvas_pointer_button_down_mask_get(Eo *eo_e, Evas_Public_Data *e)
|
||||
{
|
||||
return _evas_canvas_pointer_button_down_mask_by_device_get(eo_e, e, NULL);
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_evas_canvas_pointer_inside_get(Eo *eo_e, Evas_Public_Data *e)
|
||||
{
|
||||
return _evas_canvas_pointer_inside_by_device_get(eo_e, e, NULL);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
|
@ -1004,4 +1069,70 @@ evas_output_viewport_get(const Evas *eo_e, Evas_Coord *x, Evas_Coord *y, Evas_Co
|
|||
if (h) *h = e->viewport.h;
|
||||
}
|
||||
|
||||
Evas_Pointer_Data *
|
||||
_evas_pointer_data_by_device_get(Evas_Public_Data *edata, Efl_Input_Device *pointer)
|
||||
{
|
||||
Eina_List *l;
|
||||
Evas_Pointer_Data *pdata;
|
||||
|
||||
if (!pointer)
|
||||
pointer = edata->default_mouse;
|
||||
|
||||
EINA_LIST_FOREACH(edata->pointers, l, pdata)
|
||||
{
|
||||
if (pdata->pointer == pointer)
|
||||
return pdata;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
_evas_pointer_data_add(Evas_Public_Data *edata, Efl_Input_Device *pointer)
|
||||
{
|
||||
Evas_Pointer_Data *pdata;
|
||||
|
||||
pdata = calloc(1, sizeof(Evas_Pointer_Data));
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, EINA_FALSE);
|
||||
|
||||
pdata->pointer = pointer;
|
||||
edata->pointers = eina_list_append(edata->pointers, pdata);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
_evas_pointer_data_remove(Evas_Public_Data *edata, Efl_Input_Device *pointer)
|
||||
{
|
||||
Eina_List *l;
|
||||
Evas_Pointer_Data *pdata;
|
||||
|
||||
EINA_LIST_FOREACH(edata->pointers, l, pdata)
|
||||
{
|
||||
if (pdata->pointer == pointer)
|
||||
{
|
||||
edata->pointers = eina_list_remove_list(edata->pointers, l);
|
||||
eina_list_free(pdata->object.in);
|
||||
free(pdata);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Eina_List *
|
||||
_evas_pointer_list_in_rect_get(Evas_Public_Data *edata, Evas_Object *obj,
|
||||
Evas_Object_Protected_Data *obj_data,
|
||||
int w, int h)
|
||||
{
|
||||
Eina_List *l, *list = NULL;
|
||||
Evas_Pointer_Data *pdata;
|
||||
|
||||
EINA_LIST_FOREACH(edata->pointers, l, pdata)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(obj, obj_data, pdata->x,
|
||||
pdata->y, w, h))
|
||||
list = eina_list_append(list, pdata);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
#include "canvas/evas_canvas.eo.c"
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
static void
|
||||
_evas_map_calc_geom_change(Evas_Object *eo_obj)
|
||||
{
|
||||
int is, was = 0;
|
||||
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
if (!obj) return;
|
||||
evas_object_change(eo_obj, obj);
|
||||
|
@ -13,17 +12,10 @@ _evas_map_calc_geom_change(Evas_Object *eo_obj)
|
|||
if (!(obj->layer->evas->is_frozen))
|
||||
{
|
||||
evas_object_recalc_clippees(obj);
|
||||
if (!obj->is_smart)
|
||||
if (!obj->is_smart && obj->cur->visible)
|
||||
{
|
||||
is = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
if ((is ^ was) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, NULL, eo_obj, obj, 1, 1,
|
||||
EINA_TRUE, NULL);
|
||||
}
|
||||
}
|
||||
evas_object_inform_call_move(eo_obj, obj);
|
||||
|
|
|
@ -108,7 +108,7 @@ _evas_line_xy_set(Eo *eo_obj, Evas_Line_Data *_pd, Evas_Coord x1, Evas_Coord y1,
|
|||
|
||||
Evas_Line_Data *o = _pd;
|
||||
Evas_Coord min_x, max_x, min_y, max_y;
|
||||
int is, was = 0;
|
||||
Eina_List *was = NULL;
|
||||
|
||||
MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ);
|
||||
return;
|
||||
|
@ -127,10 +127,8 @@ _evas_line_xy_set(Eo *eo_obj, Evas_Line_Data *_pd, Evas_Coord x1, Evas_Coord y1,
|
|||
if (!evas_event_passes_through(eo_obj, obj) &&
|
||||
!evas_event_freezes_through(eo_obj, obj) &&
|
||||
!evas_object_is_source_invisible(eo_obj, obj))
|
||||
was = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1);
|
||||
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj, obj,
|
||||
1, 1);
|
||||
}
|
||||
if (x1 < x2)
|
||||
{
|
||||
|
@ -171,23 +169,13 @@ _evas_line_xy_set(Eo *eo_obj, Evas_Line_Data *_pd, Evas_Coord x1, Evas_Coord y1,
|
|||
evas_object_change(eo_obj, obj);
|
||||
evas_object_coords_recalc(eo_obj, obj);
|
||||
evas_object_clip_dirty(eo_obj, obj);
|
||||
if (!(obj->layer->evas->is_frozen))
|
||||
{
|
||||
is = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
if (!evas_event_passes_through(eo_obj, obj) &&
|
||||
!evas_event_freezes_through(eo_obj, obj) &&
|
||||
!evas_object_is_source_invisible(eo_obj, obj))
|
||||
{
|
||||
if ((is ^ was) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
if (!(obj->layer->evas->is_frozen) &&
|
||||
!evas_event_passes_through(eo_obj, obj) &&
|
||||
!evas_event_freezes_through(eo_obj, obj) &&
|
||||
!evas_object_is_source_invisible(eo_obj, obj) &&
|
||||
obj->cur->visible)
|
||||
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_TRUE, NULL);
|
||||
eina_list_free(was);
|
||||
evas_object_inform_call_move(eo_obj, obj);
|
||||
evas_object_inform_call_resize(eo_obj);
|
||||
}
|
||||
|
|
|
@ -81,6 +81,60 @@ _init_cow(void)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
_evas_device_del_cb(void *data, const Efl_Event *ev)
|
||||
{
|
||||
Evas_Object_Protected_Data *obj = data;
|
||||
|
||||
eina_hash_del_by_key(obj->pointer_grabs, &ev->object);
|
||||
}
|
||||
|
||||
static void
|
||||
_evas_object_pointer_grab_del(Evas_Object_Pointer_Data *pdata)
|
||||
{
|
||||
if ((pdata->mouse_grabbed > 0) && (pdata->obj->layer) && (pdata->obj->layer->evas))
|
||||
pdata->evas_pdata->mouse_grabbed -= pdata->mouse_grabbed;
|
||||
if (((pdata->mouse_in) || (pdata->mouse_grabbed > 0)) &&
|
||||
(pdata->obj->layer) && (pdata->obj->layer->evas))
|
||||
pdata->evas_pdata->object.in = eina_list_remove(pdata->evas_pdata->object.in, pdata->obj->object);
|
||||
efl_event_callback_del(pdata->evas_pdata->pointer, EFL_EVENT_DEL,
|
||||
_evas_device_del_cb, pdata->obj);
|
||||
free(pdata);
|
||||
}
|
||||
|
||||
static Evas_Object_Pointer_Data *
|
||||
_evas_object_pointer_data_add(Evas_Pointer_Data *evas_pdata,
|
||||
Evas_Object_Protected_Data *obj,
|
||||
Efl_Input_Device *pointer)
|
||||
{
|
||||
Evas_Object_Pointer_Data *pdata;
|
||||
|
||||
pdata = calloc(1, sizeof(Evas_Object_Pointer_Data));
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
|
||||
pdata->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
|
||||
pdata->obj = obj;
|
||||
pdata->evas_pdata = evas_pdata;
|
||||
efl_event_callback_priority_add(pointer, EFL_EVENT_DEL,
|
||||
EFL_CALLBACK_PRIORITY_BEFORE,
|
||||
_evas_device_del_cb, obj);
|
||||
eina_hash_add(obj->pointer_grabs, &pointer, pdata);
|
||||
return pdata;
|
||||
}
|
||||
|
||||
Evas_Object_Pointer_Data *
|
||||
_evas_object_pointer_data_get(Evas_Pointer_Data *evas_pdata,
|
||||
Evas_Object_Protected_Data *obj,
|
||||
Efl_Input_Device *pointer)
|
||||
{
|
||||
Evas_Object_Pointer_Data *pdata;
|
||||
|
||||
pdata = eina_hash_find(obj->pointer_grabs, &pointer);
|
||||
//The pointer does not exist yet - create one.
|
||||
if (!pdata)
|
||||
return _evas_object_pointer_data_add(evas_pdata, obj, pointer);
|
||||
return pdata;
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
_efl_canvas_object_efl_object_constructor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
|
||||
{
|
||||
|
@ -108,6 +162,7 @@ _efl_canvas_object_efl_object_constructor(Eo *eo_obj, Evas_Object_Protected_Data
|
|||
obj->prev = eina_cow_alloc(evas_object_state_cow);
|
||||
obj->data_3d = eina_cow_alloc(evas_object_3d_cow);
|
||||
obj->mask = eina_cow_alloc(evas_object_mask_cow);
|
||||
obj->pointer_grabs = eina_hash_pointer_new(EINA_FREE_CB(_evas_object_pointer_grab_del));
|
||||
|
||||
evas_object_inject(eo_obj, obj, evas);
|
||||
evas_object_callback_init(eo_obj, obj);
|
||||
|
@ -855,15 +910,10 @@ _efl_canvas_object_efl_object_destructor(Eo *eo_obj, Evas_Object_Protected_Data
|
|||
if ((obj->layer) && (obj->layer->evas))
|
||||
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
|
||||
}
|
||||
eina_hash_free(obj->pointer_grabs);
|
||||
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_DEL, NULL, _evas_object_event_new(), NULL);
|
||||
if ((obj->layer) && (obj->layer->evas))
|
||||
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas);
|
||||
if ((obj->mouse_grabbed > 0) && (obj->layer) && (obj->layer->evas))
|
||||
obj->layer->evas->pointer.mouse_grabbed -= obj->mouse_grabbed;
|
||||
if (((obj->mouse_in) || (obj->mouse_grabbed > 0)) && (obj->layer) && (obj->layer->evas))
|
||||
obj->layer->evas->pointer.object.in = eina_list_remove(obj->layer->evas->pointer.object.in, eo_obj);
|
||||
obj->mouse_grabbed = 0;
|
||||
obj->mouse_in = 0;
|
||||
if (obj->name) evas_object_name_set(eo_obj, NULL);
|
||||
if (!obj->layer)
|
||||
{
|
||||
|
@ -953,10 +1003,9 @@ EOLIAN static void
|
|||
_efl_canvas_object_efl_gfx_position_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
||||
Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
|
||||
Eina_Bool is, was = EINA_FALSE;
|
||||
Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE;
|
||||
Eina_Bool source_invisible = EINA_FALSE;
|
||||
Eina_List *was = NULL;
|
||||
|
||||
evas_object_async_block(obj);
|
||||
if (_evas_object_intercept_call(eo_obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 1, x, y))
|
||||
|
@ -977,9 +1026,8 @@ _efl_canvas_object_efl_gfx_position_set(Eo *eo_obj, Evas_Object_Protected_Data *
|
|||
freeze = evas_event_freezes_through(eo_obj, obj);
|
||||
source_invisible = evas_object_is_source_invisible(eo_obj, obj);
|
||||
if ((!pass) && (!freeze) && (!source_invisible))
|
||||
was = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj, obj,
|
||||
1, 1);
|
||||
}
|
||||
obj->doing.in_move++;
|
||||
|
||||
|
@ -1003,22 +1051,10 @@ _efl_canvas_object_efl_gfx_position_set(Eo *eo_obj, Evas_Object_Protected_Data *
|
|||
if (!(obj->layer->evas->is_frozen))
|
||||
{
|
||||
evas_object_recalc_clippees(obj);
|
||||
if (!pass)
|
||||
{
|
||||
if (!obj->is_smart)
|
||||
{
|
||||
is = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
if ((is ^ was) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
if (!pass && !obj->is_smart && obj->cur->visible)
|
||||
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_TRUE, NULL);
|
||||
}
|
||||
eina_list_free(was);
|
||||
evas_object_inform_call_move(eo_obj, obj);
|
||||
}
|
||||
|
||||
|
@ -1052,9 +1088,9 @@ EOLIAN static void
|
|||
_efl_canvas_object_efl_gfx_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
||||
Evas_Coord w, Evas_Coord h)
|
||||
{
|
||||
Eina_Bool is, was = EINA_FALSE;
|
||||
Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE;
|
||||
Eina_Bool source_invisible = EINA_FALSE;
|
||||
Eina_List *was = NULL;
|
||||
|
||||
if (w < 0) w = 0;
|
||||
if (h < 0) h = 0;
|
||||
|
@ -1068,9 +1104,8 @@ _efl_canvas_object_efl_gfx_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
|||
freeze = evas_event_freezes_through(eo_obj, obj);
|
||||
source_invisible = evas_object_is_source_invisible(eo_obj, obj);
|
||||
if ((!pass) && (!freeze) && (!source_invisible))
|
||||
was = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj,
|
||||
obj, 1, 1);
|
||||
}
|
||||
obj->doing.in_resize++;
|
||||
|
||||
|
@ -1097,22 +1132,10 @@ _efl_canvas_object_efl_gfx_size_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
|
|||
evas_object_recalc_clippees(obj);
|
||||
|
||||
// if (obj->func->coords_recalc) obj->func->coords_recalc(eo_obj);
|
||||
if (!pass)
|
||||
{
|
||||
if (!obj->is_smart)
|
||||
{
|
||||
is = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
if ((is ^ was) && (obj->cur->visible))
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
if (!pass && !obj->is_smart && obj->cur->visible)
|
||||
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_TRUE, NULL);
|
||||
}
|
||||
eina_list_free(was);
|
||||
evas_object_inform_call_resize(eo_obj);
|
||||
}
|
||||
|
||||
|
@ -1492,14 +1515,11 @@ _show(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
|||
{
|
||||
if (!obj->is_smart)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1))
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
_evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas,
|
||||
eo_obj,
|
||||
obj, 1, 1,
|
||||
EINA_FALSE,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1554,17 +1574,17 @@ _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
|||
if ((!obj->is_smart) ||
|
||||
((obj->map->cur.map) && (obj->map->cur.map->count == 4) && (obj->map->cur.usemap)))
|
||||
{
|
||||
if (!obj->mouse_grabbed)
|
||||
Eina_Iterator *itr = eina_hash_iterator_data_new(obj->pointer_grabs);
|
||||
Evas_Object_Pointer_Data *obj_pdata;
|
||||
EINA_ITERATOR_FOREACH(itr, obj_pdata)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1))
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
if (!obj_pdata->mouse_grabbed &&
|
||||
evas_object_is_in_output_rect(eo_obj, obj, obj_pdata->evas_pdata->x,
|
||||
obj_pdata->evas_pdata->y,
|
||||
1, 1))
|
||||
_evas_canvas_event_pointer_move_event_dispatch(obj->layer->evas, obj_pdata->evas_pdata, NULL);
|
||||
}
|
||||
eina_iterator_free(itr);
|
||||
/* this is at odds to handling events when an obj is moved out of the mouse
|
||||
* ore resized out or clipped out. if mouse is grabbed - regardless of
|
||||
* visibility, mouse move events should keep happening and mouse up.
|
||||
|
@ -2019,7 +2039,10 @@ evas_object_top_at_pointer_get(const Evas *eo_e)
|
|||
Evas_Public_Data *e = efl_isa(eo_e, EVAS_CANVAS_CLASS) ?
|
||||
efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS) : NULL;
|
||||
if (!e) return NULL;
|
||||
return evas_canvas_object_top_at_xy_get((Eo *)eo_e, e->pointer.x, e->pointer.y, EINA_TRUE, EINA_TRUE);
|
||||
|
||||
Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, NULL);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
|
||||
return evas_canvas_object_top_at_xy_get((Eo *)eo_e, pdata->x, pdata->y, EINA_TRUE, EINA_TRUE);
|
||||
}
|
||||
|
||||
EOLIAN Evas_Object*
|
||||
|
|
|
@ -105,7 +105,7 @@ _efl_canvas_polygon_point_add(Eo *eo_obj, Efl_Canvas_Polygon_Data *_pd, Evas_Coo
|
|||
Efl_Canvas_Polygon_Data *o = _pd;
|
||||
Efl_Canvas_Polygon_Point *p;
|
||||
Evas_Coord min_x, max_x, min_y, max_y;
|
||||
int is, was = 0;
|
||||
Eina_List *was = NULL;
|
||||
|
||||
evas_object_async_block(obj);
|
||||
if (!obj->layer->evas->is_frozen)
|
||||
|
@ -113,10 +113,8 @@ _efl_canvas_polygon_point_add(Eo *eo_obj, Efl_Canvas_Polygon_Data *_pd, Evas_Coo
|
|||
if (!evas_event_passes_through(eo_obj, obj) &&
|
||||
!evas_event_freezes_through(eo_obj, obj) &&
|
||||
!evas_object_is_source_invisible(eo_obj, obj))
|
||||
was = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1);
|
||||
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj, obj,
|
||||
1, 1);
|
||||
}
|
||||
if (!o->points)
|
||||
{
|
||||
|
@ -184,23 +182,13 @@ _efl_canvas_polygon_point_add(Eo *eo_obj, Efl_Canvas_Polygon_Data *_pd, Evas_Coo
|
|||
evas_object_change(eo_obj, obj);
|
||||
evas_object_clip_dirty(eo_obj, obj);
|
||||
evas_object_coords_recalc(eo_obj, obj);
|
||||
if (!obj->layer->evas->is_frozen)
|
||||
{
|
||||
is = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
if (!evas_event_passes_through(eo_obj, obj) &&
|
||||
!evas_event_freezes_through(eo_obj, obj) &&
|
||||
!evas_object_is_source_invisible(eo_obj, obj))
|
||||
{
|
||||
if ((is ^ was) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
if (!obj->layer->evas->is_frozen &&
|
||||
!evas_event_passes_through(eo_obj, obj) &&
|
||||
!evas_event_freezes_through(eo_obj, obj) &&
|
||||
!evas_object_is_source_invisible(eo_obj, obj) &&
|
||||
obj->cur->visible)
|
||||
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_TRUE, NULL);
|
||||
eina_list_free(was);
|
||||
evas_object_inform_call_move(eo_obj, obj);
|
||||
evas_object_inform_call_resize(eo_obj);
|
||||
}
|
||||
|
@ -211,12 +199,11 @@ _efl_canvas_polygon_points_clear(Eo *eo_obj, Efl_Canvas_Polygon_Data *_pd)
|
|||
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
Efl_Canvas_Polygon_Data *o = _pd;
|
||||
void *list_data;
|
||||
int is, was;
|
||||
Eina_List *was;
|
||||
|
||||
evas_object_async_block(obj);
|
||||
was = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj, obj, 1, 1);
|
||||
|
||||
EINA_LIST_FREE(o->points, list_data)
|
||||
{
|
||||
free(list_data);
|
||||
|
@ -236,15 +223,9 @@ _efl_canvas_polygon_points_clear(Eo *eo_obj, Efl_Canvas_Polygon_Data *_pd)
|
|||
evas_object_change(eo_obj, obj);
|
||||
evas_object_clip_dirty(eo_obj, obj);
|
||||
evas_object_coords_recalc(eo_obj, obj);
|
||||
is = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
if ((is || was) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
if (obj->cur->visible)
|
||||
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_FALSE, NULL);
|
||||
eina_list_free(was);
|
||||
evas_object_inform_call_move(eo_obj, obj);
|
||||
evas_object_inform_call_resize(eo_obj);
|
||||
}
|
||||
|
|
|
@ -422,10 +422,10 @@ EOLIAN static void
|
|||
_evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const char *font, Evas_Font_Size size)
|
||||
{
|
||||
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
Eina_Bool is, was = EINA_FALSE;
|
||||
Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE;
|
||||
Eina_Bool source_invisible = EINA_FALSE;
|
||||
Evas_Font_Description *fdesc;
|
||||
Eina_List *was = NULL;
|
||||
|
||||
|
||||
if ((!font) || (size <= 0)) return;
|
||||
|
@ -461,9 +461,8 @@ _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const cha
|
|||
freeze = evas_event_freezes_through(eo_obj, obj);
|
||||
source_invisible = evas_object_is_source_invisible(eo_obj, obj);
|
||||
if ((!pass) && (!freeze) && (!source_invisible))
|
||||
was = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj, obj,
|
||||
1, 1);
|
||||
}
|
||||
|
||||
/* DO IT */
|
||||
|
@ -489,22 +488,9 @@ _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const cha
|
|||
evas_object_change(eo_obj, obj);
|
||||
evas_object_clip_dirty(eo_obj, obj);
|
||||
evas_object_coords_recalc(eo_obj, obj);
|
||||
if (!(obj->layer->evas->is_frozen))
|
||||
{
|
||||
if ((!pass) && (!freeze))
|
||||
{
|
||||
is = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1);
|
||||
if ((is ^ was) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
if (!obj->layer->evas->is_frozen && !pass && !freeze && obj->cur->visible)
|
||||
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_TRUE, NULL);
|
||||
eina_list_free(was);
|
||||
evas_object_inform_call_resize(eo_obj);
|
||||
}
|
||||
|
||||
|
@ -1073,8 +1059,9 @@ EOLIAN static void
|
|||
_evas_text_efl_text_text_set(Eo *eo_obj, Evas_Text_Data *o, const char *_text)
|
||||
{
|
||||
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
int is, was, len;
|
||||
int len;
|
||||
Eina_Unicode *text;
|
||||
Eina_List *was = NULL;
|
||||
|
||||
if ((o->cur.utf8_text) && (_text) && (!strcmp(o->cur.utf8_text, _text)))
|
||||
return;
|
||||
|
@ -1082,9 +1069,7 @@ _evas_text_efl_text_text_set(Eo *eo_obj, Evas_Text_Data *o, const char *_text)
|
|||
text = eina_unicode_utf8_to_unicode(_text, &len);
|
||||
|
||||
if (!text) text = eina_unicode_strdup(EINA_UNICODE_EMPTY_STRING);
|
||||
was = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj, obj, 1, 1);
|
||||
/* DO II */
|
||||
/*Update bidi_props*/
|
||||
|
||||
|
@ -1102,15 +1087,9 @@ _evas_text_efl_text_text_set(Eo *eo_obj, Evas_Text_Data *o, const char *_text)
|
|||
evas_object_change(eo_obj, obj);
|
||||
evas_object_clip_dirty(eo_obj, obj);
|
||||
evas_object_coords_recalc(eo_obj, obj);
|
||||
is = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
if ((is || was) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
if (obj->cur->visible)
|
||||
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_FALSE, NULL);
|
||||
eina_list_free(was);
|
||||
evas_object_inform_call_resize(eo_obj);
|
||||
}
|
||||
|
||||
|
@ -2219,14 +2198,12 @@ _evas_object_text_rehint(Evas_Object *eo_obj)
|
|||
{
|
||||
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
Evas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
|
||||
int is, was;
|
||||
Eina_List *was = NULL;
|
||||
|
||||
if (!o->font) return;
|
||||
evas_font_load_hinting_set(obj->layer->evas->evas, o->font,
|
||||
obj->layer->evas->hinting);
|
||||
was = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj, obj, 1, 1);
|
||||
/* DO II */
|
||||
_evas_object_text_recalc(eo_obj, o->cur.text);
|
||||
o->changed = 1;
|
||||
|
@ -2235,15 +2212,9 @@ _evas_object_text_rehint(Evas_Object *eo_obj)
|
|||
evas_object_change(eo_obj, obj);
|
||||
evas_object_clip_dirty(eo_obj, obj);
|
||||
evas_object_coords_recalc(eo_obj, obj);
|
||||
is = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y, 1, 1);
|
||||
if ((is || was) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
if (obj->cur->visible)
|
||||
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_FALSE, NULL);
|
||||
eina_list_free(was);
|
||||
evas_object_inform_call_resize(eo_obj);
|
||||
}
|
||||
|
||||
|
|
|
@ -1054,10 +1054,10 @@ _evas_textgrid_efl_text_properties_font_set(Eo *eo_obj,
|
|||
Evas_Font_Size font_size)
|
||||
{
|
||||
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
Eina_Bool is, was = EINA_FALSE;
|
||||
Eina_Bool pass = EINA_FALSE, freeze = EINA_FALSE;
|
||||
Eina_Bool source_invisible = EINA_FALSE;
|
||||
Evas_Font_Description *fdesc;
|
||||
Eina_List *was = NULL;
|
||||
|
||||
if ((!font_name) || (!*font_name) || (font_size <= 0))
|
||||
return;
|
||||
|
@ -1090,10 +1090,8 @@ _evas_textgrid_efl_text_properties_font_set(Eo *eo_obj,
|
|||
freeze = evas_event_freezes_through(eo_obj, obj);
|
||||
source_invisible = evas_object_is_source_invisible(eo_obj, obj);
|
||||
if ((!pass) && (!freeze) && (!source_invisible))
|
||||
was = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1);
|
||||
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj, obj,
|
||||
1, 1);
|
||||
}
|
||||
|
||||
if (o->font_normal)
|
||||
|
@ -1229,22 +1227,9 @@ _evas_textgrid_efl_text_properties_font_set(Eo *eo_obj,
|
|||
evas_object_change(eo_obj, obj);
|
||||
evas_object_clip_dirty(eo_obj, obj);
|
||||
evas_object_coords_recalc(eo_obj, obj);
|
||||
if (!(obj->layer->evas->is_frozen))
|
||||
{
|
||||
if ((!pass) && (!freeze))
|
||||
{
|
||||
is = evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1);
|
||||
if ((is ^ was) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
if (!obj->layer->evas->is_frozen && !pass && !freeze && obj->cur->visible)
|
||||
_evas_canvas_event_pointer_in_list_mouse_move_feed(obj->layer->evas, was, eo_obj, obj, 1, 1, EINA_TRUE, NULL);
|
||||
eina_list_free(was);
|
||||
evas_object_inform_call_resize(eo_obj);
|
||||
o->changed = 1;
|
||||
o->core_change = 1;
|
||||
|
|
|
@ -75,17 +75,13 @@ _efl_canvas_object_efl_gfx_stack_raise(Eo *eo_obj, Evas_Object_Protected_Data *o
|
|||
(!evas_event_freezes_through(eo_obj, obj)) &&
|
||||
(!evas_object_is_source_invisible(eo_obj, obj)))
|
||||
{
|
||||
if (!obj->is_smart)
|
||||
if (!obj->is_smart && obj->cur->visible)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
_evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas,
|
||||
eo_obj,
|
||||
obj, 1, 1,
|
||||
EINA_FALSE,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,17 +125,13 @@ _efl_canvas_object_efl_gfx_stack_lower(Eo *eo_obj, Evas_Object_Protected_Data *o
|
|||
(!evas_event_freezes_through(eo_obj, obj)) &&
|
||||
(!evas_object_is_source_invisible(eo_obj, obj)))
|
||||
{
|
||||
if (!obj->is_smart)
|
||||
if (!obj->is_smart && obj->cur->visible)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
_evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas,
|
||||
eo_obj,
|
||||
obj, 1, 1,
|
||||
EINA_FALSE,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -211,17 +203,13 @@ _efl_canvas_object_efl_gfx_stack_stack_above(Eo *eo_obj, Evas_Object_Protected_D
|
|||
(!evas_event_freezes_through(eo_obj, obj)) &&
|
||||
(!evas_object_is_source_invisible(eo_obj, obj)))
|
||||
{
|
||||
if (!obj->is_smart)
|
||||
if (!obj->is_smart && obj->cur->visible)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
_evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas,
|
||||
eo_obj,
|
||||
obj, 1, 1,
|
||||
EINA_FALSE,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -293,17 +281,13 @@ _efl_canvas_object_efl_gfx_stack_stack_below(Eo *eo_obj, Evas_Object_Protected_D
|
|||
(!evas_event_freezes_through(eo_obj, obj)) &&
|
||||
(!evas_object_is_source_invisible(eo_obj, obj)))
|
||||
{
|
||||
if (!obj->is_smart)
|
||||
if (!obj->is_smart && obj->cur->visible)
|
||||
{
|
||||
if (evas_object_is_in_output_rect(eo_obj, obj,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
1, 1) && obj->cur->visible)
|
||||
evas_event_feed_mouse_move(obj->layer->evas->evas,
|
||||
obj->layer->evas->pointer.x,
|
||||
obj->layer->evas->pointer.y,
|
||||
obj->layer->evas->last_timestamp,
|
||||
NULL);
|
||||
_evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas,
|
||||
eo_obj,
|
||||
obj, 1, 1,
|
||||
EINA_FALSE,
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ typedef struct _Evas_Object_Map_Data Evas_Object_Map_Data;
|
|||
typedef struct _Evas_Proxy_Render_Data Evas_Proxy_Render_Data;
|
||||
typedef struct _Evas_Object_3D_Data Evas_Object_3D_Data;
|
||||
typedef struct _Evas_Object_Mask_Data Evas_Object_Mask_Data;
|
||||
typedef struct _Evas_Object_Pointer_Data Evas_Object_Pointer_Data;
|
||||
|
||||
typedef struct _Evas_Smart_Data Evas_Smart_Data;
|
||||
|
||||
|
@ -93,6 +94,7 @@ typedef struct _Evas_Object_Protected_Data Evas_Object_Protected_Data;
|
|||
typedef struct _Evas_Filter_Program Evas_Filter_Program;
|
||||
typedef struct _Evas_Object_Filter_Data Evas_Object_Filter_Data;
|
||||
typedef struct _Evas_Filter_Data_Binding Evas_Filter_Data_Binding;
|
||||
typedef struct _Evas_Pointer_Data Evas_Pointer_Data;
|
||||
|
||||
// 3D stuff
|
||||
|
||||
|
@ -798,6 +800,21 @@ typedef struct
|
|||
Evas_Object_Protected_Data *obj;
|
||||
} Evas_Active_Entry;
|
||||
|
||||
struct _Evas_Pointer_Data
|
||||
{
|
||||
Evas_Device *pointer;
|
||||
struct {
|
||||
Eina_List *in;
|
||||
} object;
|
||||
DATA32 button;
|
||||
Evas_Coord x, y;
|
||||
Evas_Point prev;
|
||||
int mouse_grabbed;
|
||||
int downs;
|
||||
int nogrep;
|
||||
unsigned char inside : 1;
|
||||
};
|
||||
|
||||
struct _Evas_Public_Data
|
||||
{
|
||||
EINA_INLIST;
|
||||
|
@ -805,18 +822,7 @@ struct _Evas_Public_Data
|
|||
DATA32 magic;
|
||||
Evas *evas;
|
||||
|
||||
struct {
|
||||
unsigned char inside : 1;
|
||||
int mouse_grabbed;
|
||||
int downs;
|
||||
DATA32 button;
|
||||
Evas_Coord x, y;
|
||||
Evas_Point prev;
|
||||
int nogrep;
|
||||
struct {
|
||||
Eina_List *in;
|
||||
} object;
|
||||
} pointer;
|
||||
Eina_List *pointers;
|
||||
|
||||
struct {
|
||||
Evas_Coord x, y, w, h;
|
||||
|
@ -1083,6 +1089,14 @@ struct _Evas_Object_Protected_State
|
|||
Eina_Bool snapshot : 1;
|
||||
};
|
||||
|
||||
struct _Evas_Object_Pointer_Data {
|
||||
Evas_Object_Protected_Data *obj;
|
||||
Evas_Pointer_Data *evas_pdata;
|
||||
Evas_Object_Pointer_Mode pointer_mode;
|
||||
int mouse_grabbed;
|
||||
Eina_Bool mouse_in;
|
||||
};
|
||||
|
||||
struct _Evas_Object_Protected_Data
|
||||
{
|
||||
EINA_INLIST;
|
||||
|
@ -1123,6 +1137,7 @@ struct _Evas_Object_Protected_Data
|
|||
const Evas_Object_3D_Data *data_3d;
|
||||
const Evas_Object_Mask_Data *mask;
|
||||
Eina_List *focused_by_seats;
|
||||
Eina_Hash *pointer_grabs;
|
||||
|
||||
// Pointer to the Evas_Object itself
|
||||
Evas_Object *object;
|
||||
|
@ -1131,7 +1146,6 @@ struct _Evas_Object_Protected_Data
|
|||
|
||||
int last_mouse_down_counter;
|
||||
int last_mouse_up_counter;
|
||||
int mouse_grabbed;
|
||||
|
||||
// Daniel: Added because the destructor can't take parameters, at least for the moment
|
||||
int clean_layer;
|
||||
|
@ -1152,6 +1166,7 @@ struct _Evas_Object_Protected_Data
|
|||
|
||||
Eina_Bool render_pre : 1;
|
||||
Eina_Bool rect_del : 1;
|
||||
|
||||
Eina_Bool is_active : 1;
|
||||
Eina_Bool changed : 1;
|
||||
Eina_Bool restack : 1;
|
||||
|
@ -1173,8 +1188,6 @@ struct _Evas_Object_Protected_Data
|
|||
Eina_Bool pre_render_done : 1;
|
||||
Eina_Bool precise_is_inside : 1;
|
||||
Eina_Bool is_static_clip : 1;
|
||||
Eina_Bool mouse_in : 1;
|
||||
Evas_Object_Pointer_Mode pointer_mode : 2;
|
||||
|
||||
Eina_Bool in_layer : 1;
|
||||
Eina_Bool is_frame : 1;
|
||||
|
@ -1576,6 +1589,7 @@ void evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj);
|
|||
void evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj, Evas_Object_Protected_Data *pd);
|
||||
void evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v);
|
||||
void evas_rects_return_difference_rects(Eina_Array *rects, int x, int y, int w, int h, int xx, int yy, int ww, int hh);
|
||||
Evas_Object_Pointer_Data *_evas_object_pointer_data_get(Evas_Pointer_Data *evas_pdata, Evas_Object_Protected_Data *obj, Efl_Input_Device *pointer);
|
||||
|
||||
void evas_object_clip_dirty(Evas_Object *obj, Evas_Object_Protected_Data *pd);
|
||||
void evas_object_recalc_clippees(Evas_Object_Protected_Data *pd);
|
||||
|
@ -1904,7 +1918,22 @@ struct _Evas_Proxy_Render_Data
|
|||
|
||||
void _evas_canvas_event_init(Evas *eo_e, Evas_Public_Data *e);
|
||||
void _evas_canvas_event_shutdown(Evas *eo_e, Evas_Public_Data *e);
|
||||
|
||||
void _evas_canvas_event_pointer_in_rect_mouse_move_feed(Evas_Public_Data *edata,
|
||||
Evas_Object *obj,
|
||||
Evas_Object_Protected_Data *obj_data,
|
||||
int w, int h,
|
||||
Eina_Bool in_objects_list,
|
||||
void *data);
|
||||
void _evas_canvas_event_pointer_in_list_mouse_move_feed(Evas_Public_Data *edata,
|
||||
Eina_List *was,
|
||||
Evas_Object *obj,
|
||||
Evas_Object_Protected_Data *obj_data,
|
||||
int w, int h,
|
||||
Eina_Bool xor_rule,
|
||||
void *data);
|
||||
void _evas_canvas_event_pointer_move_event_dispatch(Evas_Public_Data *edata,
|
||||
Evas_Pointer_Data *pdata,
|
||||
void *data);
|
||||
int evas_async_events_init(void);
|
||||
int evas_async_events_shutdown(void);
|
||||
int evas_async_target_del(const void *target);
|
||||
|
@ -1969,6 +1998,13 @@ Eina_Bool _evas_image_proxy_source_clip_get(const Eo *eo_obj);
|
|||
|
||||
void _evas_focus_dispatch_event(Evas_Object_Protected_Data *obj,
|
||||
Efl_Input_Device *seat, Eina_Bool in);
|
||||
Evas_Pointer_Data *_evas_pointer_data_by_device_get(Evas_Public_Data *edata, Efl_Input_Device *pointer);
|
||||
Eina_Bool _evas_pointer_data_add(Evas_Public_Data *edata, Efl_Input_Device *pointer);
|
||||
void _evas_pointer_data_remove(Evas_Public_Data *edata, Efl_Input_Device *pointer);
|
||||
Eina_List *_evas_pointer_list_in_rect_get(Evas_Public_Data *edata,
|
||||
Evas_Object *obj,
|
||||
Evas_Object_Protected_Data *obj_data,
|
||||
int w, int h);
|
||||
|
||||
extern Eina_Cow *evas_object_proxy_cow;
|
||||
extern Eina_Cow *evas_object_map_cow;
|
||||
|
|
Loading…
Reference in New Issue