summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
diff options
context:
space:
mode:
authorGuilherme Iscaro <iscaro@profusion.mobi>2016-11-22 16:14:03 -0200
committerBruno Dilly <bdilly@profusion.mobi>2016-12-20 18:34:39 -0200
commite5acc5604a5bb728f1affc0a839878de55f5dafc (patch)
tree2fde561e10fd4fbb0eef957939ffa155f9c5b940 /src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
parent2e527851cfdfaa6efc0e261cea978e5cf11afac2 (diff)
Ecore Evas: Add support to set cursor icon per mouse device.
Since Ecore Evas now supports multiple mouses new APIs were added in order to be able to set the cursor image to any device.
Diffstat (limited to 'src/modules/ecore_evas/engines/drm/ecore_evas_drm.c')
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c66
1 files changed, 2 insertions, 64 deletions
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index b1ab702a01..d69c43009c 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -434,68 +434,6 @@ _drm_size_step_set(Ecore_Evas *ee, int w, int h)
434} 434}
435 435
436static void 436static void
437_drm_object_cursor_del(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
438{
439 Ecore_Evas *ee;
440
441 ee = data;
442 if (ee) ee->prop.cursor.object = NULL;
443}
444
445static void
446_drm_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
447{
448 Evas_Object *old;
449 int x, y;
450
451 old = ee->prop.cursor.object;
452 if (!obj)
453 {
454 ee->prop.cursor.object = NULL;
455 ee->prop.cursor.layer = 0;
456 ee->prop.cursor.hot.x = 0;
457 ee->prop.cursor.hot.y = 0;
458 goto end;
459 }
460
461 ee->prop.cursor.object = obj;
462 ee->prop.cursor.layer = layer;
463 ee->prop.cursor.hot.x = hot_x;
464 ee->prop.cursor.hot.y = hot_y;
465
466 ecore_evas_pointer_xy_get(ee, &x, &y);
467
468 if (obj != old)
469 {
470 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
471 evas_object_pass_events_set(ee->prop.cursor.object, 1);
472 if (evas_pointer_inside_get(ee->evas))
473 evas_object_show(ee->prop.cursor.object);
474 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
475 _drm_object_cursor_del, ee);
476 }
477
478 evas_object_move(ee->prop.cursor.object, x - ee->prop.cursor.hot.x,
479 y - ee->prop.cursor.hot.y);
480
481end:
482 if ((old) && (obj != old))
483 {
484 evas_object_event_callback_del_full
485 (old, EVAS_CALLBACK_DEL, _drm_object_cursor_del, ee);
486 evas_object_del(old);
487 }
488}
489
490static void
491_drm_object_cursor_unset(Ecore_Evas *ee)
492{
493 evas_object_event_callback_del_full(ee->prop.cursor.object,
494 EVAS_CALLBACK_DEL,
495 _drm_object_cursor_del, ee);
496}
497
498static void
499_drm_layer_set(Ecore_Evas *ee, int layer) 437_drm_layer_set(Ecore_Evas *ee, int layer)
500{ 438{
501 if (layer < 1) layer = 1; 439 if (layer < 1) layer = 1;
@@ -747,8 +685,8 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func =
747 _drm_size_max_set, 685 _drm_size_max_set,
748 _drm_size_base_set, 686 _drm_size_base_set,
749 _drm_size_step_set, 687 _drm_size_step_set,
750 _drm_object_cursor_set, 688 NULL,
751 _drm_object_cursor_unset, 689 NULL,
752 _drm_layer_set, 690 _drm_layer_set,
753 NULL, //void (*fn_focus_set) (Ecore_Evas *ee, Eina_Bool on); 691 NULL, //void (*fn_focus_set) (Ecore_Evas *ee, Eina_Bool on);
754 _drm_iconified_set, 692 _drm_iconified_set,