summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_evas
diff options
context:
space:
mode:
authorRafael Antognolli <antognolli@gmail.com>2012-11-07 16:12:14 +0000
committerRafael Antognolli <antognolli@gmail.com>2012-11-07 16:12:14 +0000
commit76f067b9fb59493f14d0148f402013f363983497 (patch)
treebe81bb51321ed5e49d27679883d9d8f35530c82c /legacy/ecore/src/lib/ecore_evas
parent5ba83e3cdcd198f42032ce7037f43748e6c76599 (diff)
ecore/wayland: Implement the object_cursor_set method for wayland.
This allows to specify an Evas_Object (e.g. an edje object) as cursor theme. SVN revision: 78971
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h1
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c45
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c2
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c2
4 files changed, 48 insertions, 2 deletions
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h b/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h
index 83080e7fb1..0c7b03043d 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h
@@ -424,6 +424,7 @@ void _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h);
424void _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h); 424void _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h);
425void _ecore_evas_wl_common_size_base_set(Ecore_Evas *ee, int w, int h); 425void _ecore_evas_wl_common_size_base_set(Ecore_Evas *ee, int w, int h);
426void _ecore_evas_wl_common_size_step_set(Ecore_Evas *ee, int w, int h); 426void _ecore_evas_wl_common_size_step_set(Ecore_Evas *ee, int w, int h);
427void _ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
427void _ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer); 428void _ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer);
428void _ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, int iconify); 429void _ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, int iconify);
429void _ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max); 430void _ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max);
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c
index 6a49b2f035..e1df083275 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c
@@ -580,6 +580,51 @@ _ecore_evas_wl_common_size_step_set(Ecore_Evas *ee, int w, int h)
580 ee->prop.step.h = h; 580 ee->prop.step.h = h;
581} 581}
582 582
583static void
584_ecore_evas_object_cursor_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
585{
586 Ecore_Evas *ee;
587
588 ee = data;
589 if (ee) ee->prop.cursor.object = NULL;
590}
591
592void
593_ecore_evas_wl_common_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
594{
595 int x, y;
596
597 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
598
599 if (!obj)
600 {
601 ee->prop.cursor.object = NULL;
602 ee->prop.cursor.layer = 0;
603 ee->prop.cursor.hot.x = 0;
604 ee->prop.cursor.hot.y = 0;
605 ecore_wl_window_cursor_default_restore(ee->engine.wl.win);
606 return;
607 }
608
609 ee->prop.cursor.object = obj;
610 ee->prop.cursor.layer = layer;
611 ee->prop.cursor.hot.x = hot_x;
612 ee->prop.cursor.hot.y = hot_y;
613
614 ecore_wl_window_pointer_set(ee->engine.wl.win, NULL, 0, 0);
615
616 evas_pointer_output_xy_get(ee->evas, &x, &y);
617 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
618 evas_object_move(ee->prop.cursor.object,
619 x - ee->prop.cursor.hot.x,
620 y - ee->prop.cursor.hot.y);
621 evas_object_pass_events_set(ee->prop.cursor.object, 1);
622 if (evas_pointer_inside_get(ee->evas))
623 evas_object_show(ee->prop.cursor.object);
624
625 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
626}
627
583void 628void
584_ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer) 629_ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer)
585{ 630{
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c
index 545c295d98..430da4b8cb 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c
@@ -70,7 +70,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
70 _ecore_evas_wl_common_size_max_set, 70 _ecore_evas_wl_common_size_max_set,
71 _ecore_evas_wl_common_size_base_set, 71 _ecore_evas_wl_common_size_base_set,
72 _ecore_evas_wl_common_size_step_set, 72 _ecore_evas_wl_common_size_step_set,
73 NULL, // object_cursor_set 73 _ecore_evas_wl_common_object_cursor_set,
74 _ecore_evas_wl_common_layer_set, 74 _ecore_evas_wl_common_layer_set,
75 NULL, // focus set 75 NULL, // focus set
76 _ecore_evas_wl_common_iconified_set, 76 _ecore_evas_wl_common_iconified_set,
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c
index d2cf1b8640..0a7584a795 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c
@@ -86,7 +86,7 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
86 _ecore_evas_wl_common_size_max_set, 86 _ecore_evas_wl_common_size_max_set,
87 _ecore_evas_wl_common_size_base_set, 87 _ecore_evas_wl_common_size_base_set,
88 _ecore_evas_wl_common_size_step_set, 88 _ecore_evas_wl_common_size_step_set,
89 NULL, // object_cursor_set 89 _ecore_evas_wl_common_object_cursor_set, // object_cursor_set
90 _ecore_evas_wl_common_layer_set, 90 _ecore_evas_wl_common_layer_set,
91 NULL, // focus set 91 NULL, // focus set
92 _ecore_evas_wl_common_iconified_set, 92 _ecore_evas_wl_common_iconified_set,