SET(VERSION 0.1.0)
SET(SRCS
- src/ivug-vibration.c
src/ivug-ext-ug.c
)
elementary
dlog
ui-gadget-1 # Motion
- haptic
capi-system-sensor
)
+++ /dev/null
-/*
- * Copyright 2012 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __IVUG_VIBRATION_H__
-#define __IVUG_VIBRATION_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdbool.h>
-
-#define INVALID_HAPTIC_HANDLE (NULL)
-#define VIBRATION_DURATION (500) // 500 ms
-
-typedef void * vibration_h;
-
-/*
- If success, returns handle. otherwise NULL.
-*/
-vibration_h ivug_vibration_create(void);
-
-/*
- duration in ms
-*/
-bool ivug_vibration_play(vibration_h handle, int duration);
-
-bool ivug_vibration_stop(vibration_h handle);
-
-bool ivug_vibration_delete(vibration_h handle);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // __IVUG_VIBRATION_H__
-
+++ /dev/null
-/*
- * Copyright 2012 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ivug-vibration.h"
-#include "ivug-debug.h"
-
-#include <stdio.h>
-#include <haptic.h>
-
-static const char *_conver_error(int err)
-{
- switch(err)
- {
- case HAPTIC_ERROR_NONE:
- return "Successful";
- case HAPTIC_ERROR_INVALID_PARAMETER:
- return "Invalid parameter";
- case HAPTIC_ERROR_NOT_INITIALIZED:
- return "Not initialized";
- case HAPTIC_ERROR_OPERATION_FAILED:
- return "Operation failed";
- case HAPTIC_ERROR_NOT_SUPPORTED_DEVICE:
- return "Not supported device";
- default:
- {
- static char error[128];
- sprintf(error, "Unknow Error : %d(0x%08x)", err, err);
- return error;
- }
- }
-
- return NULL;
-
-}
-
-
-vibration_h ivug_vibration_create()
-{
- int ret = HAPTIC_ERROR_NONE;
- haptic_device_h handle = NULL;
-
- ret = haptic_open(HAPTIC_DEVICE_ALL, &handle);
-
- if (ret != HAPTIC_ERROR_NONE)
- {
- MSG_UTIL_ERROR("device_haptic_open failed. %s", _conver_error(ret));
- return NULL;
- }
-
- MSG_UTIL_HIGH("Vibration init. Handle=%x", handle);
-
- return (vibration_h)handle;
-}
-
-bool ivug_vibration_play(vibration_h v_handle, int duration)
-{
- IV_ASSERT(v_handle!=NULL);
- int ret = HAPTIC_ERROR_NONE;
- haptic_device_h handle = (haptic_device_h)v_handle;
-
- MSG_UTIL_HIGH("Vibration start. Handle=%x duration=%d", handle, duration);
-
- ret = haptic_vibrate_monotone(handle, duration, NULL);
-
- if (ret != HAPTIC_ERROR_NONE)
- {
- MSG_UTIL_ERROR("haptic_vibrate_monotone error Handle=%x. %s", handle, _conver_error(ret));
- return false;
- }
-
- return true;
-}
-
-bool ivug_vibration_stop(vibration_h v_handle)
-{
- IV_ASSERT(v_handle!=NULL);
- int ret = HAPTIC_ERROR_NONE;
- haptic_device_h handle = (haptic_device_h)v_handle;
-
- MSG_UTIL_HIGH("Vibration stop. Handle=%x", handle);
-
- ret = haptic_stop_all_effects(handle);
- if (ret != 0)
- {
- MSG_UTIL_ERROR("haptic_stop_device failed. %s", _conver_error(ret));
- }
-
- return true;
-}
-
-
-bool ivug_vibration_delete(vibration_h v_handle)
-{
- IV_ASSERT(v_handle!=NULL);
- int ret = HAPTIC_ERROR_NONE;
- haptic_device_h handle = (haptic_device_h)v_handle;
-
- MSG_UTIL_HIGH("Vibration deinit. Handle=%x", handle);
-
- ret = haptic_close(handle);
-
- if (ret != HAPTIC_ERROR_NONE)
- {
- MSG_UTIL_ERROR("device_haptic_close failed. %s", _conver_error(ret));
- }
-
- return true;
-}
-
-
*/
#include "ivug-popup.h"
-#include "ivug-vibration.h"
#define NOTIFY_TIMEOUT 3.0
Popup_Response response;
- vibration_h haptic_handle;
-
Evas_Smart_Cb callback;
void *data;
{
Ivug_Popup *iv_popup = calloc(1, sizeof(Ivug_Popup));
- iv_popup->haptic_handle = INVALID_HAPTIC_HANDLE;
-
return iv_popup;
}
static void ivug_popup_delete(Ivug_Popup *iv_popup)
{
- if ( iv_popup->haptic_handle != INVALID_HAPTIC_HANDLE )
- {
- ivug_vibration_stop(iv_popup->haptic_handle);
- ivug_vibration_delete(iv_popup->haptic_handle);
-
- iv_popup->haptic_handle = INVALID_HAPTIC_HANDLE;
- }
if(iv_popup->popup)
{
Ivug_Popup *iv_popup = (Ivug_Popup *)data;
IV_ASSERT(iv_popup != NULL);
- if ( iv_popup->haptic_handle == INVALID_HAPTIC_HANDLE )
- {
- iv_popup->haptic_handle = ivug_vibration_create();
- if ( iv_popup->haptic_handle == INVALID_HAPTIC_HANDLE )
- {
- MSG_IMAGEVIEW_ERROR( "ivug_vibration_create failed");
- return;
- }
- }
- else
- {
- ivug_vibration_stop(iv_popup->haptic_handle);
- }
-
- ivug_vibration_play(iv_popup->haptic_handle ,VIBRATION_DURATION);
-
+ //todo : show popup
}
Evas_Object *ivug_rename_popup_show(Evas_Object *parent, const char *filename, Evas_Smart_Cb response, void *data)
#include "ivug-common.h"
#include "ivug-media.h"
-#include "ivug-vibration.h"
typedef enum {
NAME_VIEW_RESPONSE_OK,
Evas_Object *entry;
Evas_Object *btn_done;
- vibration_h haptic_handle; // Null if invalid
-
FNResponse fnresponse;
void *clientdata;
void
ivug_slider_item_show_menu(Slide_Item* si);
-Eina_Bool
-ivug_slider_item_video_is_playing(Slide_Item* si);
-
-
Evas_Object *
ivug_slider_item_image_get(Slide_Item* si);
#include "ivug-popup.h"
#include "ivug-media.h"
-#include "ivug-vibration.h"
#include "ivug-util.h"
Ivug_NameView *pNameView = (Ivug_NameView *)data;
IV_ASSERT(pNameView != NULL);
- if ( pNameView->haptic_handle == INVALID_HAPTIC_HANDLE )
- {
- pNameView->haptic_handle = ivug_vibration_create();
- if ( pNameView->haptic_handle == INVALID_HAPTIC_HANDLE )
- {
- MSG_IMAGEVIEW_ERROR( "ivug_vibration_create failed");
- return;
- }
- }
- else
- {
- ivug_vibration_stop(pNameView->haptic_handle);
- }
-
- ivug_vibration_play(pNameView->haptic_handle ,VIBRATION_DURATION);
+ //todo : show popup
}
return NULL;
}
- pNameView->haptic_handle = INVALID_HAPTIC_HANDLE; // Invalid
-
MSG_IMAGEVIEW_HIGH( "Add Name View creation");
pNameView->layout = ivug_default_layout_add(parent);
MSG_IMAGEVIEW_HIGH( "Destroy Name View");
- if ( pNameView->haptic_handle != INVALID_HAPTIC_HANDLE )
- {
- ivug_vibration_stop(pNameView->haptic_handle);
- ivug_vibration_delete(pNameView->haptic_handle);
-
- pNameView->haptic_handle = INVALID_HAPTIC_HANDLE;
- }
-
-
if(pNameView->layout)
{
evas_object_del(pNameView->layout);
BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(capi-system-runtime-info)
BuildRequires: pkgconfig(capi-system-sensor)
-BuildRequires: pkgconfig(haptic)
BuildRequires: pkgconfig(capi-media-metadata-extractor)
BuildRequires: pkgconfig(capi-content-mime-type)
BuildRequires: pkgconfig(capi-content-media-content)