#include <Elementary.h>
#if defined(OS_TIZEN_MOBILE)
+#ifndef TIZEN_LEGACY_V_2_2_1
+#include <device/haptic.h>
+#else
#include <haptic/haptic.h>
#endif
+#endif
#include <unistd.h>
#include <stdlib.h>
{
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;
}
}
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);
}
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
#include <string.h>
#if defined(OS_TIZEN_MOBILE)
+#ifndef TIZEN_LEGACY_V_2_2_1
+#include <device/haptic.h>
+#else
#include <haptic/haptic.h>
#endif
+#endif
#include "public/ewk_context.h"
#include "public/ewk_context_menu.h"
{
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;
}
}
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);
}
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;
}
}