summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-10-16 17:13:15 -0400
committerChris Michael <cp.michael@samsung.com>2014-10-16 17:13:15 -0400
commit379bbdaec368ad8499a8cf7bb973c84750085490 (patch)
tree988777bba1970ba03fa57b51ab421e84aeed591e
parentf7a905a836094e89f044d573d5577273d2da7f66 (diff)
downloadenlightenment-379bbdaec368ad8499a8cf7bb973c84750085490.tar.gz
add evas callbacks for mouse wheel event
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/bin/e_comp_wl.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 93b086a33a..60c9b35c19 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -278,6 +278,41 @@ _e_comp_wl_evas_cb_mouse_up(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
}
static void
+_e_comp_wl_evas_cb_mouse_wheel(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event)
+{
+ E_Client *ec;
+ Evas_Event_Mouse_Wheel *ev;
+ struct wl_resource *res;
+ struct wl_client *wc;
+ Eina_List *l;
+ uint32_t axis, dir;
+
+ ev = event;
+ if (!(ec = data)) return;
+ if (ec->cur_mouse_action) return;
+ if (e_object_is_del(E_OBJECT(ec))) return;
+ if (e_client_util_ignored_get(ec)) return;
+
+ if (ev->direction == 0)
+ axis = WL_POINTER_AXIS_VERTICAL_SCROLL;
+ else
+ axis = WL_POINTER_AXIS_HORIZONTAL_SCROLL;
+
+ if (ev->z < 0)
+ dir = -wl_fixed_from_int(abs(ev->z));
+ else
+ dir = wl_fixed_from_int(ev->z);
+
+ wc = wl_resource_get_client(ec->comp_data->surface);
+ EINA_LIST_FOREACH(ec->comp->wl_comp_data->ptr.resources, l, res)
+ {
+ if (!e_comp_wl_input_pointer_check(res)) continue;
+ if (wl_resource_get_client(res) != wc) continue;
+ wl_pointer_send_axis(res, ev->timestamp, axis, dir);
+ }
+}
+
+static void
_e_comp_wl_client_evas_init(E_Client *ec)
{
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW,
@@ -296,6 +331,8 @@ _e_comp_wl_client_evas_init(E_Client *ec)
_e_comp_wl_evas_cb_mouse_down, ec);
evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_UP,
_e_comp_wl_evas_cb_mouse_up, ec);
+ evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_MOUSE_WHEEL,
+ _e_comp_wl_evas_cb_mouse_wheel, ec);
ec->comp_data->evas_init = EINA_TRUE;
}