This function returns the current position of the main input
pointer (mouse, pen, etc...).
]]
+ return: bool; [[$true if a pointer exists for the given seat, otherwise $false.]]
+ }
+ keys {
+ seat: Efl.Input.Device; [[The seat, or $null to use the default.]]
}
- /* FIXME: missing keys { seat } */
values {
pos: Eina.Position2D; [[The pointer position in pixels.]]
}
else _efl_ui_win_hide(obj, sd);
}
-EOLIAN static Eina_Position2D
-_efl_ui_win_efl_canvas_scene_pointer_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
+EOLIAN static Eina_Bool
+_efl_ui_win_efl_canvas_scene_pointer_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eo *dev, Eina_Position2D *pos)
{
- Eina_Position2D pos;
- evas_pointer_canvas_xy_get(sd->evas, &pos.x, &pos.y);
- return pos;
+ return efl_canvas_scene_pointer_position_get(sd->evas, dev, pos);
}
EOLIAN static Eina_Bool
Efl.Canvas.Scene.device { get; }
Efl.Canvas.Scene.seat { get; }
Efl.Canvas.Scene.seat_default { get; }
+ Efl.Canvas.Scene.pointer_position { get; }
Efl.Canvas.Scene.image_max_size { get; }
Efl.Canvas.Scene.objects_at_xy_get;
Efl.Canvas.Scene.object_top_at_xy_get;
return eina_array_data_get(e->cur_device, num - 1);
}
+EOLIAN Eina_Bool
+_evas_canvas_efl_canvas_scene_pointer_position_get(const Eo *eo_e, Evas_Public_Data *e, Efl_Input_Device *seat, Eina_Position2D *pos)
+{
+ Eina_Iterator *it;
+ Eo *child;
+
+ if (pos) *pos = EINA_POSITION2D(0, 0);
+ if (!e->default_seat) return EINA_FALSE;
+ if (!seat)
+ {
+ evas_pointer_canvas_xy_get(eo_e, &pos->x, &pos->y);
+ return EINA_TRUE;
+ }
+ it = efl_input_device_children_iterate(seat);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(it, EINA_FALSE);
+
+ EINA_ITERATOR_FOREACH(it, child)
+ if (_is_pointer(efl_input_device_type_get(child)))
+ break;
+ if (child)
+ *pos = efl_input_pointer_position_get(child);
+ eina_iterator_free(it);
+ return !!child;
+}
+
//TIZEN_ONLY(20171220): send a hw device for pointer events
EAPI Evas_Device *
evas_device_top_get(const Evas *eo_e)
}
//
+//TIZEN_ONLY
EAPI Evas_Device *
evas_device_default_get(const Evas *eo_e, Evas_Device_Class clas)
{
return NULL;
}
+//
+
fail_if(cnt != 2); // 2 moves (in the list), 2 ups (gone)
fail_if(!efl_canvas_pointer_inside_get(win, NULL));
- pos = efl_canvas_scene_pointer_position_get(win);
+ efl_canvas_scene_pointer_position_get(win, NULL, &pos);
ck_assert_int_eq(pos.x, points[1][0].x);
ck_assert_int_eq(pos.y, points[1][0].y);