From: Jihoon Kim Date: Wed, 22 Mar 2023 07:28:20 +0000 (+0900) Subject: Rename function name to get timestamp X-Git-Tag: accepted/tizen/7.0/unified/20230328.140140^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf6ea4a34dbf34f71831ee0d76248d6ac63f8144;p=platform%2Fupstream%2Fenlightenment.git Rename function name to get timestamp The function to get timestamp can be used generally. Change-Id: Iff1e7db62724d15731dab2971d06ff5b317b21aa Signed-off-by: Jihoon Kim --- diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 5558022bec..b671dfa1db 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -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) diff --git a/src/bin/e_comp_wl_rsm.c b/src/bin/e_comp_wl_rsm.c index c03eff417c..ef261969ba 100644 --- a/src/bin/e_comp_wl_rsm.c +++ b/src/bin/e_comp_wl_rsm.c @@ -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) diff --git a/src/bin/e_devicemgr_input.c b/src/bin/e_devicemgr_input.c index c7c6a6f53f..c3e6c8b96a 100644 --- a/src/bin/e_devicemgr_input.c +++ b/src/bin/e_devicemgr_input.c @@ -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; diff --git a/src/bin/e_devicemgr_inputgen.c b/src/bin/e_devicemgr_inputgen.c index 3b55edd5a6..a299876d95 100644 --- a/src/bin/e_devicemgr_inputgen.c +++ b/src/bin/e_devicemgr_inputgen.c @@ -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; diff --git a/src/bin/e_input.c b/src/bin/e_input.c index adabafba4c..4da5d38e8e 100644 --- a/src/bin/e_input.c +++ b/src/bin/e_input.c @@ -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() { diff --git a/src/bin/e_input.h b/src/bin/e_input.h index 9f4c5ef9fb..16ae632d15 100644 --- a/src/bin/e_input.h +++ b/src/bin/e_input.h @@ -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); diff --git a/src/bin/e_keyrouter_events.c b/src/bin/e_keyrouter_events.c index 24f5e32ff0..f87a49f070 100644 --- a/src/bin/e_keyrouter_events.c +++ b/src/bin/e_keyrouter_events.c @@ -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], diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index de662e44a8..86b10f5f6f 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -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 diff --git a/src/bin/e_utils.h b/src/bin/e_utils.h index 29e36f62af..d2b77c30eb 100644 --- a/src/bin/e_utils.h +++ b/src/bin/e_utils.h @@ -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) { diff --git a/src/bin/services/e_service_gesture.c b/src/bin/services/e_service_gesture.c index c984344816..71830628bb 100644 --- a/src/bin/services/e_service_gesture.c +++ b/src/bin/services/e_service_gesture.c @@ -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) {