From d3ad06986abfa32af95ec4d20e3428a30a68e21a Mon Sep 17 00:00:00 2001 From: HeeJu Kang Date: Fri, 15 Mar 2013 13:27:31 +0900 Subject: [PATCH] Fixed Touch event and effect Change-Id: I63dfc2e39df16a7494da5feae88b7a4e87b0b3f5 Signed-off-by: HeeJu Kang --- src/FShell_LiveboxView.cpp | 28 ++++++++++++++++++++++++---- src/FShell_LiveboxView.h | 2 ++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/FShell_LiveboxView.cpp b/src/FShell_LiveboxView.cpp index 2d60def..556760f 100644 --- a/src/FShell_LiveboxView.cpp +++ b/src/FShell_LiveboxView.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include #include #include "FUi_TouchFlickGestureDetector.h" @@ -377,6 +379,24 @@ _LiveboxView::GetRemainingSpace(int& lower, int& upper) const SysLog(NID_UI_CTRL, "[%d %d]", lower, upper); } +bool +_LiveboxView::IsTouchEventEnabled(void) const +{ + unique_ptr pAppId(_StringConverter::CopyToCharArrayN(GetAppId())); + int ret = livebox_service_mouse_event(pAppId.get()); + + return ( ret == 1 ); +} + +bool +_LiveboxView::IsTouchEffectEnabled(void) const +{ + unique_ptr pAppId(_StringConverter::CopyToCharArrayN(GetAppId())); + int ret = livebox_service_touch_effect(pAppId.get()); + + return ( ret == 1 ); +} + result _LiveboxView::OnAttachedToMainTree(void) { @@ -428,7 +448,7 @@ bool _LiveboxView::OnTouchPressed(const _Control& source, const _TouchInfo& touchInfo) { int type = livebox_lb_type(__pLivebox); - if ((type == LB_TYPE_BUFFER) || (type == LB_TYPE_PIXMAP)) + if (((type == LB_TYPE_BUFFER) || (type == LB_TYPE_PIXMAP)) && IsTouchEventEnabled()) { double x = 0.0; double y = 0.0; @@ -449,7 +469,7 @@ _LiveboxView::OnTouchReleased(const _Control& source, const _TouchInfo& touchInf Point position(_CoordinateSystemUtils::ConvertToInteger(touchInfo.GetCurrentPosition())); FloatPoint floatPosition(static_cast(position.x), static_cast(position.y)); - if (clientBounds.Contains(floatPosition)) + if (clientBounds.Contains(floatPosition) && IsTouchEffectEnabled()) { PlayClickAnimation(); } @@ -459,7 +479,7 @@ _LiveboxView::OnTouchReleased(const _Control& source, const _TouchInfo& touchInf GetTouchPostion(floatPosition, x, y); int type = livebox_lb_type(__pLivebox); - if ((type == LB_TYPE_BUFFER) || (type == LB_TYPE_PIXMAP)) + if (((type == LB_TYPE_BUFFER) || (type == LB_TYPE_PIXMAP)) && IsTouchEventEnabled()) { livebox_content_event(__pLivebox, LB_MOUSE_UP, x, y); } @@ -473,7 +493,7 @@ bool _LiveboxView::OnTouchMoved(const _Control& source, const _TouchInfo& touchInfo) { int type = livebox_lb_type(__pLivebox); - if ((type == LB_TYPE_BUFFER) || (type == LB_TYPE_PIXMAP)) + if (((type == LB_TYPE_BUFFER) || (type == LB_TYPE_PIXMAP)) && IsTouchEventEnabled()) { double x = 0.0; double y = 0.0; diff --git a/src/FShell_LiveboxView.h b/src/FShell_LiveboxView.h index 478c3d9..7d2a448 100644 --- a/src/FShell_LiveboxView.h +++ b/src/FShell_LiveboxView.h @@ -98,6 +98,8 @@ private: void PlayClickAnimation(void); void PlayFlickAnimation(void); void GetRemainingSpace(int& lower, int& upper) const; + bool IsTouchEventEnabled(void) const; + bool IsTouchEffectEnabled(void) const; virtual result OnAttachedToMainTree(void); virtual result OnDetachingFromMainTree(void); -- 2.7.4