Rename function name to get timestamp 76/290276/1 accepted/tizen/7.0/unified/20230328.140140
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 22 Mar 2023 07:28:20 +0000 (16:28 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 22 Mar 2023 08:05:20 +0000 (17:05 +0900)
The function to get timestamp can be used generally.

Change-Id: Iff1e7db62724d15731dab2971d06ff5b317b21aa
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/bin/e_comp_wl.c
src/bin/e_comp_wl_rsm.c
src/bin/e_devicemgr_input.c
src/bin/e_devicemgr_inputgen.c
src/bin/e_input.c
src/bin/e_input.h
src/bin/e_keyrouter_events.c
src/bin/e_utils.c
src/bin/e_utils.h
src/bin/services/e_service_gesture.c

index 5558022becb64dad45a47f3b8e6265a9359ed1c4..b671dfa1dbd97b82bcc9c16b1988f9c4481a9f4a 100644 (file)
@@ -5386,7 +5386,7 @@ e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *d
 
    wc = wl_resource_get_client(ec->comp_data->surface);
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
-   if (!time) time = e_input_timestamp_get();
+   if (!time) time = e_util_timestamp_get();
    if (pressed) state = WL_KEYBOARD_KEY_STATE_PRESSED;
    else state = WL_KEYBOARD_KEY_STATE_RELEASED;
 
@@ -5437,7 +5437,7 @@ e_comp_wl_key_cancel(E_Client *ec, int keycode, Ecore_Device *dev, uint32_t time
 
    wc = wl_resource_get_client(ec->comp_data->surface);
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
-   if (!time) time = e_input_timestamp_get();
+   if (!time) time = e_util_timestamp_get();
 
    comp_conf = e_comp_config_get();
    e_keyrouter_event_surface_send(ec, keycode);
@@ -5477,7 +5477,7 @@ e_comp_wl_touch_send(E_Client *ec, int idx, int x, int y, Eina_Bool pressed, Eco
    if (!dev) device = _e_comp_wl_device_last_device_get(ECORE_DEVICE_CLASS_TOUCH);
 
    wc = wl_resource_get_client(ec->comp_data->surface);
-   if (!time) time = e_input_timestamp_get();
+   if (!time) time = e_util_timestamp_get();
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
    if (dev)
@@ -5514,7 +5514,7 @@ e_comp_wl_touch_update_send(E_Client *ec, int idx, int x, int y, Ecore_Device *d
    if (!dev) device = _e_comp_wl_device_last_device_get(ECORE_DEVICE_CLASS_TOUCH);
 
    wc = wl_resource_get_client(ec->comp_data->surface);
-   if (!time) time = e_input_timestamp_get();
+   if (!time) time = e_util_timestamp_get();
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
    if (dev)
@@ -5560,8 +5560,7 @@ e_comp_wl_mouse_button_send(E_Client *ec, int buttons, Eina_Bool pressed, Ecore_
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
 
    wc = wl_resource_get_client(ec->comp_data->surface);
-   if (!time) time = e_input_timestamp_get();
-   INF("timestamp = %u", time);
+   if (!time) time = e_util_timestamp_get();
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
    if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
@@ -5589,7 +5588,7 @@ e_comp_wl_mouse_move_send(E_Client *ec, int x, int y, Ecore_Device *dev, uint32_
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
 
    wc = wl_resource_get_client(ec->comp_data->surface);
-   if (!time) time = e_input_timestamp_get();
+   if (!time) time = e_util_timestamp_get();
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
    if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
@@ -5615,7 +5614,7 @@ e_comp_wl_mouse_wheel_send(E_Client *ec, int direction, int z, Ecore_Device *dev
    EINA_SAFETY_ON_NULL_RETURN_VAL(e_comp_wl, EINA_FALSE);
 
    wc = wl_resource_get_client(ec->comp_data->surface);
-   if (!time) time = e_input_timestamp_get();
+   if (!time) time = e_util_timestamp_get();
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
    if (e_config->use_cursor_timer)
index c03eff417cad792091028949f00e4ff3a38bccc5..ef261969baa3ac2a92ae53302d3ce4350279fa04 100644 (file)
@@ -684,13 +684,13 @@ _remote_surface_changed_buff_protocol_send(E_Comp_Wl_Remote_Surface *rs,
                                                       tbm,
                                                       img_file_fd,
                                                       img_file_size,
-                                                      e_input_timestamp_get(),
+                                                      e_util_timestamp_get(),
                                                       add_opts ? &opts : NULL);
           }
         else
           tizen_remote_surface_send_update_buffer(rs->resource,
                                                   tbm,
-                                                  e_input_timestamp_get());
+                                                  e_util_timestamp_get());
      }
 
    if (add_opts)
index c7c6a6f53f85e999d9b584c3e53210b17efd9f5e..c3e6c8b96aa57aaa16dbf30d241ced05d84a14f4 100644 (file)
@@ -160,7 +160,7 @@ _e_devicemgr_input_mouse_button_remap(Ecore_Event_Mouse_Button *ev, Eina_Bool pr
    ev_key->key = (char *)eina_stringshare_add("XF86Back");
    ev_key->keyname = (char *)eina_stringshare_add(ev_key->key);
    ev_key->compose = (char *)eina_stringshare_add(ev_key->key);
-   ev_key->timestamp = e_input_timestamp_get();
+   ev_key->timestamp = e_util_timestamp_get();
    ev_key->same_screen = 1;
 
    ev_key->window = e_comp->ee_win;
index 3b55edd5a6c0ef05ef2b8c1e9aa21bb642bd0334..a299876d954a4e11e86a14f654bf7a9589d705e4 100644 (file)
@@ -90,7 +90,7 @@ e_devicemgr_inputgen_key_event_add(const char *key, Eina_Bool pressed, char *ide
    e->window = e_comp->ee_win;
    e->event_window = e_comp->ee_win;
    e->root_window = e_comp->ee_win;
-   e->timestamp = e_input_timestamp_get();
+   e->timestamp = e_util_timestamp_get();
    e->same_screen = 1;
    e->keycode = keycode;
    key_data = E_NEW(E_Keyrouter_Event_Data, 1);
@@ -135,7 +135,7 @@ _e_devicemgr_inputgen_mouse_button_event(Eina_Bool state, int x, int y, int butt
    e->window = e_comp->ee_win;
    e->event_window = e_comp->ee_win;
    e->root_window = e_comp->ee_win;
-   e->timestamp = e_input_timestamp_get();
+   e->timestamp = e_util_timestamp_get();
    e->same_screen = 1;
 
    e->x = x;
@@ -188,7 +188,7 @@ _e_devicemgr_inputgen_mouse_move_event(int x, int y, char *identifier)
    e->window = e_comp->ee_win;
    e->event_window = e_comp->ee_win;
    e->root_window = e_comp->ee_win;
-   e->timestamp = e_input_timestamp_get();
+   e->timestamp = e_util_timestamp_get();
    e->same_screen = 1;
 
    e->x = x;
@@ -238,7 +238,7 @@ _e_devicemgr_inputgen_mouse_wheel_event(unsigned int type, int value, E_Devicemg
    e->window = e_comp->ee_win;
    e->event_window = e_comp->ee_win;
    e->root_window = e_comp->ee_win;
-   e->timestamp = e_input_timestamp_get();
+   e->timestamp = e_util_timestamp_get();
    e->same_screen = 1;
 
    /* FIXME: set current coords */
@@ -350,7 +350,7 @@ _e_devicemgr_inputgen_touch_event(uint32_t type, uint32_t x, uint32_t y, uint32_
    e->window = e_comp->ee_win;
    e->event_window = e_comp->ee_win;
    e->root_window = e_comp->ee_win;
-   e->timestamp = e_input_timestamp_get();
+   e->timestamp = e_util_timestamp_get();
    e->same_screen = 1;
 
    e->x = x;
@@ -410,7 +410,7 @@ _e_devicemgr_inputgen_touch_update_event(uint32_t x, uint32_t y, uint32_t finger
    e->window = e_comp->ee_win;
    e->event_window = e_comp->ee_win;
    e->root_window = e_comp->ee_win;
-   e->timestamp = e_input_timestamp_get();
+   e->timestamp = e_util_timestamp_get();
    e->same_screen = 1;
 
    e->x = x;
index adabafba4ca526615137b5faaf3fecf12210f3db..4da5d38e8e0fb0e3b8da9918e1daa77ae16a1908 100644 (file)
@@ -245,14 +245,6 @@ e_input_ecore_evas_get(E_Input *ei)
    return NULL;
 }
 
-E_API unsigned int e_input_timestamp_get(void)
-{
-   struct timespec ts;
-   clock_gettime(CLOCK_MONOTONIC, &ts);
-
-   return (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);
-}
-
 E_API unsigned int
 e_input_touch_max_count_get()
 {
index 9f4c5ef9fb30f465afd4e83d4f6249ca49aa01de..16ae632d15c663be0041a5564e35d7a638760629 100644 (file)
@@ -100,8 +100,6 @@ EINTERN Eina_Bool e_input_evdev_mouse_accel_speed_set(E_Input_Evdev *edev, doubl
 EINTERN Eina_Bool e_input_evdev_mouse_accel_enable(E_Input_Evdev *edev, Eina_Bool enable);
 EINTERN unsigned int e_input_evdev_touch_pressed_get(E_Input_Evdev *edev);
 
-E_API unsigned int e_input_timestamp_get(void);
-
 E_API const Eina_List *e_input_devices_get(void);
 E_API Eina_Bool e_input_device_pointer_warp(E_Input_Device *dev, int x, int y);
 E_API Eina_Bool e_input_device_mouse_accel_speed_set(E_Input_Device *dev, double speed);
index 24f5e32ff0980dd44c5f77ac2d20f0568fe602b0..f87a49f0708ea8d260f56e1f70adc4f71246bacb 100644 (file)
@@ -106,7 +106,7 @@ _e_keyrouter_key_create(char *keyname)
    ev_key->key = (char *)eina_stringshare_add(keyname);
    ev_key->keyname = (char *)eina_stringshare_add(ev_key->key);
    ev_key->compose = (char *)eina_stringshare_add(ev_key->key);
-   ev_key->timestamp = e_input_timestamp_get();
+   ev_key->timestamp = e_util_timestamp_get();
    ev_key->same_screen = 1;
 
    ev_key->window = e_comp->ee_win;
@@ -277,7 +277,7 @@ _e_keyrouter_composition_key_event(Eina_Bool pressed)
    ev->keys[0] = krt->composition_key.key[0];
    ev->keys[1] = krt->composition_key.key[1];
 
-   ev->timestamp = e_input_timestamp_get();
+   ev->timestamp = e_util_timestamp_get();
 
    KLINF("COMPOSITION_KEY : %s(%d) and %s(%d) composition key %s event is generated (time: %d).\n",
          krt->HardKeys[ev->keys[0]].keyname, ev->keys[0],
index de662e44a863b37c7a850fc0c67a902098b46084..86b10f5f6f2a9c56b64f7bacfc847623e00d4443 100644 (file)
@@ -1358,3 +1358,11 @@ e_util_file_monitor_add(const char *path, void *data)
 
    return 0;
 }
+
+E_API unsigned int e_util_timestamp_get(void)
+{
+   struct timespec ts;
+   clock_gettime(CLOCK_MONOTONIC, &ts);
+
+   return (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);
+}
\ No newline at end of file
index 29e36f62af46b0176250762c9b197d9210dbd38c..d2b77c30eba6d9c2efca084a7efe45cd9156432f 100644 (file)
@@ -98,6 +98,8 @@ E_API void e_util_file_monitor_init(void);
 E_API int e_util_file_monitor_shutdown(void);
 E_API int e_util_file_monitor_add(const char *path, void *data);
 
+E_API unsigned int e_util_timestamp_get(void);
+
 static inline void
 e_util_pointer_center(const E_Client *ec)
 {
index c9843448164f4515b09e88ae099b17a2100475bb..71830628bba2926773a761562b99523641d198de 100644 (file)
@@ -235,7 +235,7 @@ _gesture_waiting_timer(void *data)
 
    if (gesture->set_fingers & (1 << gesture->pressed_fingers))
      {
-        timestamp = e_input_timestamp_get();
+        timestamp = e_util_timestamp_get();
         gesture->status = _gesture_check(gesture, gesture->obj, gesture->c_start.x, gesture->c_start.y, timestamp);
         if (gesture->status == POL_GESTURE_STATUS_ACTIVE)
           {