e_input: added internal APIs to set/get pointer relative motion handler 10/292010/1
authorSungjin Park <sj76.park@samsung.com>
Tue, 25 Apr 2023 11:36:53 +0000 (20:36 +0900)
committerSungjin Park <sj76.park@samsung.com>
Wed, 26 Apr 2023 07:01:16 +0000 (16:01 +0900)
Change-Id: I5e95285611c1f52b9531b1388dc96e3fd325bc40
Signed-off-by: Sungjin Park <sj76.park@samsung.com>
src/bin/e_input.c
src/bin/e_input.h

index 4da5d38e8e0fb0e3b8da9918e1daa77ae16a1908..f55d814bb88541c49f6c3ce9192518d64a3c258b 100644 (file)
@@ -259,4 +259,23 @@ e_input_touch_max_count_set(unsigned int max_count)
 {
    if (e_input)
      e_input->touch_max_count = max_count;
-}
\ No newline at end of file
+}
+
+EINTERN Eina_Bool
+e_input_relative_motion_handler_set(e_input_relative_motion_cb handler)
+{
+   if (!e_input)
+     return EINA_FALSE;
+
+   e_input->relative_motion_handler = handler;
+   return EINA_TRUE;
+}
+
+EINTERN e_input_relative_motion_cb
+e_input_relative_motion_handler_get(void)
+{
+   if (e_input)
+     return e_input->relative_motion_handler;
+
+   return NULL;
+}
index 16ae632d15c663be0041a5564e35d7a638760629..77238cef6b138ad5ca7256ef358cc67d6f88fdc6 100644 (file)
@@ -36,6 +36,8 @@ typedef struct _E_Input_Evdev E_Input_Evdev;
 typedef struct _E_Input_Seat E_Input_Seat;
 typedef struct _E_Input_Coord E_Input_Coord;
 
+typedef void (*e_input_relative_motion_cb)(double dx[2], double dy[2], uint64_t time_us);
+
 struct _E_Input
 {
    Ecore_Window window;
@@ -47,6 +49,8 @@ struct _E_Input
    Eina_Bool use_thread : 1;
    unsigned int touch_max_count;
    unsigned int touch_device_count;
+
+   e_input_relative_motion_cb relative_motion_handler;
 };
 
 struct _E_Input_Device
@@ -121,5 +125,8 @@ EINTERN Eina_Bool e_input_device_output_name_set(E_Input_Device *dev, const char
 EINTERN const char *e_input_device_output_name_get(E_Input_Device *dev, const char *input);
 
 EINTERN Eina_Bool e_input_device_seat_name_set(E_Input_Device *dev, const char *input, const char *seat_name);
+
+EINTERN Eina_Bool e_input_relative_motion_handler_set(e_input_relative_motion_cb handler);
+EINTERN e_input_relative_motion_cb e_input_relative_motion_handler_get(void);
 #endif
 #endif