aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_wl2/ecore_wl2_input.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-09-20 15:54:39 -0400
committerChris Michael <cp.michael@samsung.com>2015-12-03 12:02:40 -0500
commit7eabcd955e4634667368dfc57e1f1e03881c480d (patch)
treec6161b57a7fc9da26682450c225b8cdb85fafb0d /src/lib/ecore_wl2/ecore_wl2_input.c
parentecore-wl2: Add initial support for keyboard events (diff)
downloadefl-7eabcd955e4634667368dfc57e1f1e03881c480d.tar.gz
ecore-wl2: Add placeholders for touch listener functions
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.c64
1 files changed, 59 insertions, 5 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 1060819054..db89f35c28 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -393,13 +393,67 @@ static const struct wl_keyboard_listener _keyboard_listener =
_keyboard_cb_repeat_setup
};
+static void
+_touch_cb_down(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, struct wl_surface *surface, int id, wl_fixed_t x, wl_fixed_t y)
+{
+ Ecore_Wl2_Input *input;
+ Ecore_Wl2_Window *window;
+
+ input = data;
+ if (!input) return;
+
+ /* find the window which this surface belongs to */
+ window = _ecore_wl2_display_window_surface_find(input->display, surface);
+ if (!window) return;
+
+ input->focus.touch = window;
+
+ /* TODO: Finish sending ecore events */
+}
+
+static void
+_touch_cb_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial, unsigned int timestamp, int id)
+{
+ Ecore_Wl2_Input *input;
+
+ input = data;
+ if (!input) return;
+ if (!input->focus.touch) return;
+
+ /* TODO: Send ecore mouse up event and do input ungrab */
+}
+
+static void
+_touch_cb_motion(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int timestamp, int id, wl_fixed_t x, wl_fixed_t y)
+{
+ Ecore_Wl2_Input *input;
+
+ input = data;
+ if (!input) return;
+ if (!input->focus.touch) return;
+
+ /* TODO: Send ecore mouse move event */
+}
+
+static void
+_touch_cb_frame(void *data EINA_UNUSED, struct wl_touch *touch EINA_UNUSED)
+{
+
+}
+
+static void
+_touch_cb_cancel(void *data EINA_UNUSED, struct wl_touch *tough EINA_UNUSED)
+{
+
+}
+
static const struct wl_touch_listener _touch_listener =
{
- NULL, // touch down
- NULL, // touch up
- NULL, // touch motion
- NULL, // touch frame
- NULL, // touch cancel
+ _touch_cb_down,
+ _touch_cb_up,
+ _touch_cb_motion,
+ _touch_cb_frame,
+ _touch_cb_cancel
};
static const struct wl_data_device_listener _data_listener =