From 569bbddf712c856b418fac64baecc922923eb480 Mon Sep 17 00:00:00 2001 From: Arnaud Renevier Date: Wed, 1 Oct 2014 10:55:39 -0700 Subject: [PATCH] Build efl_webview_app and mini_browser with tizen 2.3 This patch modifies app.c and mini_browser.c so that they can build with tizen2.3. The modifications are related to the api of haptic being different Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=5477 Change-Id: I38e50b4caf8ed0b472f879b5a9f4c2b2b5bab91f Signed-off-by: Arnaud Renevier --- tizen_src/ewk/efl_webview_app/app.c | 28 ++++++++++++++++++++++++++++ tizen_src/ewk/efl_webview_app/mini_browser.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/tizen_src/ewk/efl_webview_app/app.c b/tizen_src/ewk/efl_webview_app/app.c index 2b13adf..35189b5 100644 --- a/tizen_src/ewk/efl_webview_app/app.c +++ b/tizen_src/ewk/efl_webview_app/app.c @@ -21,8 +21,12 @@ #include #if defined(OS_TIZEN_MOBILE) +#ifndef TIZEN_LEGACY_V_2_2_1 +#include +#else #include #endif +#endif #include #include @@ -1208,8 +1212,13 @@ Eina_Bool __vibration_timeout_cb(void *data) { g_haptic_timer_id = NULL; if (g_haptic_handle) { +#ifndef TIZEN_LEGACY_V_2_2_1 + device_haptic_stop(g_haptic_handle, g_haptic_effect); + device_haptic_close(g_haptic_handle); +#else haptic_stop_effect(g_haptic_handle, g_haptic_effect); haptic_close(g_haptic_handle); +#endif g_haptic_handle = NULL; } @@ -1229,17 +1238,31 @@ void __vibration_on_cb(uint64_t vibration_time, void *data) } if (g_haptic_handle) { +#ifndef TIZEN_LEGACY_V_2_2_1 + device_haptic_stop(g_haptic_handle, g_haptic_effect); + device_haptic_close(g_haptic_handle); +#else haptic_stop_effect(g_haptic_handle, g_haptic_effect); haptic_close(g_haptic_handle); +#endif g_haptic_handle = NULL; } +#ifndef TIZEN_LEGACY_V_2_2_1 + if (device_haptic_open(0, &g_haptic_handle) != DEVICE_ERROR_NONE) { + printf("__vibration_on_cb:device_haptic_open failed"); +#else if (haptic_open(HAPTIC_DEVICE_0, &g_haptic_handle) != HAPTIC_ERROR_NONE) { printf("__vibration_on_cb:haptic_open failed"); +#endif return; } +#ifndef TIZEN_LEGACY_V_2_2_1 + device_haptic_vibrate(g_haptic_handle, duration, 100, &g_haptic_effect); +#else haptic_vibrate_monotone(g_haptic_handle, duration, &g_haptic_effect); +#endif double in = (double)((double)(duration) / (double)(1000)); printf("__vibration_on_cb:duration=%f", in); @@ -1257,8 +1280,13 @@ void __vibration_off_cb(void *data) } if (g_haptic_handle) { +#ifndef TIZEN_LEGACY_V_2_2_1 + device_haptic_stop(g_haptic_handle, g_haptic_effect); + device_haptic_close(g_haptic_handle); +#else haptic_stop_effect(g_haptic_handle, g_haptic_effect); haptic_close(g_haptic_handle); +#endif g_haptic_handle = NULL; } #endif diff --git a/tizen_src/ewk/efl_webview_app/mini_browser.c b/tizen_src/ewk/efl_webview_app/mini_browser.c index 3f0d0ca..71f84eb 100755 --- a/tizen_src/ewk/efl_webview_app/mini_browser.c +++ b/tizen_src/ewk/efl_webview_app/mini_browser.c @@ -17,8 +17,12 @@ #include #if defined(OS_TIZEN_MOBILE) +#ifndef TIZEN_LEGACY_V_2_2_1 +#include +#else #include #endif +#endif #include "public/ewk_context.h" #include "public/ewk_context_menu.h" @@ -1356,8 +1360,13 @@ Eina_Bool __vibration_timeout_cb(void *data) { s_haptic_timer_id = NULL; if (s_haptic_handle) { +#ifndef TIZEN_LEGACY_V_2_2_1 + device_haptic_stop(s_haptic_handle, s_haptic_effect); + device_haptic_close(s_haptic_handle); +#else haptic_stop_effect(s_haptic_handle, s_haptic_effect); haptic_close(s_haptic_handle); +#endif s_haptic_handle = NULL; } @@ -1377,17 +1386,31 @@ void __vibration_on_cb(uint64_t vibration_time, void *data) } if (s_haptic_handle) { +#ifndef TIZEN_LEGACY_V_2_2_1 + device_haptic_stop(s_haptic_handle, s_haptic_effect); + device_haptic_close(s_haptic_handle); +#else haptic_stop_effect(s_haptic_handle, s_haptic_effect); haptic_close(s_haptic_handle); +#endif s_haptic_handle = NULL; } +#ifndef TIZEN_LEGACY_V_2_2_1 + if (device_haptic_open(0, &s_haptic_handle) != DEVICE_ERROR_NONE) { + printf("[%s][%d][%s] ERROR: __vibration_on_cb:device_haptic_open failed\n", __FUNCTION__, __LINE__, "vibration"); +#else if (haptic_open(HAPTIC_DEVICE_0, &s_haptic_handle) != HAPTIC_ERROR_NONE) { printf("[%s][%d][%s] ERROR: __vibration_on_cb:haptic_open failed\n", __FUNCTION__, __LINE__, "vibration"); +#endif return; } +#ifndef TIZEN_LEGACY_V_2_2_1 + device_haptic_vibrate(s_haptic_handle, duration, 100, &s_haptic_effect); +#else haptic_vibrate_monotone(s_haptic_handle, duration, &s_haptic_effect); +#endif double in = (double)((double)(duration) / (double)(1000)); printf("[%s][%d][%s] __vibration_on_cb:duration=%f\n", __FUNCTION__, __LINE__, "vibration", in); @@ -1405,8 +1428,13 @@ void __vibration_off_cb(void *data) } if (s_haptic_handle) { +#ifndef TIZEN_LEGACY_V_2_2_1 + device_haptic_stop(s_haptic_handle, s_haptic_effect); + device_haptic_close(s_haptic_handle); +#else haptic_stop_effect(s_haptic_handle, s_haptic_effect); haptic_close(s_haptic_handle); +#endif s_haptic_handle = NULL; } } -- 2.7.4