aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-09-10 13:21:29 -0400
committerChris Michael <cp.michael@samsung.com>2015-12-03 12:02:40 -0500
commit08594f2b3c87e68872f65c8e9d69b6a8078fd484 (patch)
treef3d65f4c368b7c2e871c72d4410c0c4f4878c84a /src/lib/ecore_wl2/ecore_wl2_input.c
parentecore-wl2: Add function to find a window based on surface (diff)
downloadefl-08594f2b3c87e68872f65c8e9d69b6a8078fd484.tar.gz
ecore-wl2: Add start of pointer handling code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_input.c')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c70
1 files changed, 65 insertions, 5 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 9843e8ed9f..d32895e565 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -4,13 +4,73 @@
#include "ecore_wl2_private.h"
+static void
+_pointer_cb_enter(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface, wl_fixed_t sx, wl_fixed_t sy)
+{
+ Ecore_Wl2_Input *input;
+ Ecore_Wl2_Window *window;
+
+ input = data;
+ if (!input) return;
+
+ /* trap for a surface that was just destroyed */
+ if (!surface) return;
+
+ input->pointer.enter_serial = serial;
+ input->pointer.sx = wl_fixed_to_double(sx);
+ input->pointer.sy = wl_fixed_to_double(sy);
+
+ /* find the window which this surface belongs to */
+ window = _ecore_wl2_display_window_surface_find(input->display, surface);
+ if (!window) return;
+
+ input->focus.pointer = window;
+ /* TODO: send mouse in event */
+}
+
+static void
+_pointer_cb_leave(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, struct wl_surface *surface)
+{
+ Ecore_Wl2_Input *input;
+
+ input = data;
+ if (!input) return;
+}
+
+static void
+_pointer_cb_motion(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, wl_fixed_t sx, wl_fixed_t sy)
+{
+ Ecore_Wl2_Input *input;
+
+ input = data;
+ if (!input) return;
+}
+
+static void
+_pointer_cb_button(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int serial, unsigned int timestamp, unsigned int button, unsigned int state)
+{
+ Ecore_Wl2_Input *input;
+
+ input = data;
+ if (!input) return;
+}
+
+static void
+_pointer_cb_axis(void *data, struct wl_pointer *pointer EINA_UNUSED, unsigned int timestamp, unsigned int axis, wl_fixed_t value)
+{
+ Ecore_Wl2_Input *input;
+
+ input = data;
+ if (!input) return;
+}
+
static const struct wl_pointer_listener _pointer_listener =
{
- NULL, // pointer enter
- NULL, // pointer leave
- NULL, // pointer motion
- NULL, // pointer button
- NULL, // pointer axis
+ _pointer_cb_enter,
+ _pointer_cb_leave,
+ _pointer_cb_motion,
+ _pointer_cb_button,
+ _pointer_cb_axis,
};
static const struct wl_keyboard_listener _keyboard_listener =