e_input: added internal APIs to set/get relative_motion_hander
authorSungjin Park <sj76.park@samsung.com>
Tue, 25 Apr 2023 04:34:17 +0000 (13:34 +0900)
committerSungjin Park <sj76.park@samsung.com>
Tue, 25 Apr 2023 04:34:17 +0000 (13:34 +0900)
Signed-off-by: Sungjin Park <sj76.park@samsung.com>
src/bin/e_input.c
src/bin/e_input.h

index 4da5d38e8e0fb0e3b8da9918e1daa77ae16a1908..958e062b5da85a09da7d6bfd585c2fb8c0f4ecfe 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;
+}
+
+EINTERN Eina_Bool
+e_input_relative_motion_handler_set(e_input_pointer_relative_motion_cb handler)
+{
+   if (!e_input)
+     return EINA_FALSE;
+
+   e_input->relative_motion_handler = handler;
+   return EINA_TRUE;
+}
+
+EINTERN e_input_pointer_relative_motion_cb
+e_input_relative_motion_handler_get(void)
+{
+   if (e_input)
+     return e_input->relative_motion_handler;
+
+   return NULL;
 }
\ No newline at end of file
index 16ae632d15c663be0041a5564e35d7a638760629..b5f7ea8204fc308d94e81daa34414fb6b87033ef 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_pointer_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_pointer_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_pointer_relative_motion_cb handler);
+EINTERN e_input_pointer_relative_motion_cb e_input_relative_motion_handler_get(void);
 #endif
 #endif