From 082f1a0ceb77619e10e912f16e537fe6c841e52e Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Sat, 5 Apr 2014 18:44:55 +0900 Subject: Sync with the latest commercial code. Add new event on-hold & on-scroll Change-Id: I2f516d66d68a93baebda2910e5410b14f0a4cc7c --- src/script_port.c | 51 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/script_port.c b/src/script_port.c index 88cfa2f..3ff1749 100644 --- a/src/script_port.c +++ b/src/script_port.c @@ -27,7 +27,6 @@ #include #include #include -#include //#include #include @@ -1178,6 +1177,7 @@ PUBLIC int script_feed_event(void *h, int event_type, int x, int y, int down, un } else if (event_type & LB_SCRIPT_MOUSE_EVENT) { double cur_timestamp; + unsigned int flags; #if defined(_USE_ECORE_TIME_GET) cur_timestamp = ecore_time_get(); @@ -1212,6 +1212,11 @@ PUBLIC int script_feed_event(void *h, int event_type, int x, int y, int down, un evas_event_feed_mouse_up(handle->e, 1, EVAS_BUTTON_NONE, (timestamp + 0.01f) * 1000, NULL); handle->is_mouse_down = 0; } + + flags = evas_event_default_flags_get(handle->e); + flags &= ~EVAS_EVENT_FLAG_ON_SCROLL; + flags &= ~EVAS_EVENT_FLAG_ON_HOLD; + evas_event_default_flags_set(handle->e, flags); break; case LB_SCRIPT_MOUSE_IN: evas_event_feed_mouse_in(handle->e, timestamp * 1000, NULL); @@ -1219,6 +1224,26 @@ PUBLIC int script_feed_event(void *h, int event_type, int x, int y, int down, un case LB_SCRIPT_MOUSE_OUT: evas_event_feed_mouse_out(handle->e, timestamp * 1000, NULL); break; + case LB_SCRIPT_MOUSE_ON_SCROLL: + flags = evas_event_default_flags_get(handle->e); + flags |= EVAS_EVENT_FLAG_ON_SCROLL; + evas_event_default_flags_set(handle->e, flags); + break; + case LB_SCRIPT_MOUSE_ON_HOLD: // To cancel the clicked, enable this + flags = evas_event_default_flags_get(handle->e); + flags |= EVAS_EVENT_FLAG_ON_HOLD; + evas_event_default_flags_set(handle->e, flags); + break; + case LB_SCRIPT_MOUSE_OFF_SCROLL: + flags = evas_event_default_flags_get(handle->e); + flags &= ~EVAS_EVENT_FLAG_ON_SCROLL; + evas_event_default_flags_set(handle->e, flags); + break; + case LB_SCRIPT_MOUSE_OFF_HOLD: + flags = evas_event_default_flags_get(handle->e); + flags &= ~EVAS_EVENT_FLAG_ON_HOLD; + evas_event_default_flags_set(handle->e, flags); + break; default: return LB_STATUS_ERROR_INVALID; } @@ -1351,7 +1376,9 @@ PUBLIC int script_update_script(void *h, const char *src_id, const char *target_ if (!elm_layout_file_set(obj, path, group)) { int err; err = edje_object_load_error_get(elm_layout_edje_get(obj)); - ErrPrint("Could not load %s from %s: %s\n", group, path, edje_load_error_str(err)); + if (err != EDJE_LOAD_ERROR_NONE) { + ErrPrint("Could not load %s from %s: %s\n", group, path, edje_load_error_str(err)); + } evas_object_del(obj); return LB_STATUS_ERROR_IO; } @@ -1775,7 +1802,9 @@ PUBLIC int script_load(void *_handle, int (*render_pre)(void *buffer_handle, voi int err; err = edje_object_load_error_get(elm_layout_edje_get(edje)); - ErrPrint("Could not load %s from %s: %s\n", handle->group, handle->file, edje_load_error_str(err)); + if (err != EDJE_LOAD_ERROR_NONE) { + ErrPrint("Could not load %s from %s: %s\n", handle->group, handle->file, edje_load_error_str(err)); + } evas_object_del(edje); evas_object_del(obj_info->parent); free(obj_info); @@ -1952,7 +1981,9 @@ PUBLIC int script_init(double scale, int premultiplied) DbgPrint("Scale is updated: %lf\n", scale); ret = vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, access_cb, NULL); - DbgPrint("TTS changed: %d\n", ret); + if (ret < 0) { + DbgPrint("TTS changed: %d\n", ret); + } ret = vconf_notify_key_changed("db/setting/accessibility/font_name", font_changed_cb, NULL); DbgPrint("System font is changed: %d\n", ret); @@ -1978,13 +2009,19 @@ PUBLIC int script_fini(void) } ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE); - DbgPrint("Unset font size change event callback: %d\n", ret); + if (ret < 0) { + DbgPrint("Unset font size change event callback: %d\n", ret); + } ret = vconf_ignore_key_changed("db/setting/accessibility/font_name", font_changed_cb); - DbgPrint("Unset font name change event callback: %d\n", ret); + if (ret < 0) { + DbgPrint("Unset font name change event callback: %d\n", ret); + } ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, access_cb); - DbgPrint("Unset tts: %d\n", ret); + if (ret < 0) { + DbgPrint("Unset tts: %d\n", ret); + } elm_shutdown(); -- cgit v1.2.3