fix touch event delivery problem
authorjungmin76.park <jungmin76.park@samsung.com>
Thu, 28 Mar 2013 07:50:00 +0000 (16:50 +0900)
committerjungmin76.park <jungmin76.park@samsung.com>
Thu, 28 Mar 2013 07:50:00 +0000 (16:50 +0900)
Change-Id: I6a04caaf907dbcc341897b928a9dcb6c5103c532
Signed-off-by: jungmin76.park <jungmin76.park@samsung.com>
src/FShell_AppWidgetProviderManagerImpl.cpp
src/inc/FShell_AppWidgetProviderManagerImpl.h

index 6df029f..9cb5c47 100644 (file)
@@ -95,8 +95,6 @@ _AppWidgetProviderManagerImpl::_AppWidgetProviderManagerImpl()
        ,__pAppWidgetPopupProviderFactory(null)
        ,__pAppWidgetPopupProvider(null)
        ,__AppWidgetPopupTouchEventListener(null)
-       ,__isAppWidgetFrameReady(false)
-       ,__pPendingTouchEvent(null)
 {
        SysLog(NID_APP, "");
 }
@@ -206,11 +204,11 @@ _AppWidgetProviderManagerImpl::RequestUpdate(const Tizen::App::AppId& appId, con
 {
 
        SysLog(NID_APP, "Enter.");
-       /*if( appId == App::App::GetInstance()->GetAppId())
-       {
-                //TODO: optimizing for local request
-       }
-       else*/
+//     if( appId == App::App::GetInstance()->GetAppId())
+//     {
+//              //TODO: optimizing for local request
+//     }
+//     else
        {
                _AppWidgetManagerProxy* pProxy = _AppWidgetManagerProxy::GetInstance();
                SysTryReturnResult(NID_APP, pProxy, E_SYSTEM, "Failed to get proxy instance!");
@@ -453,36 +451,29 @@ _AppWidgetProviderManagerImpl::HandleAppWidgetRequest(const Tizen::Base::String&
        }
        else if (operationId == APPWIDGET_ON_TOUCH)
        {
-               int eventType = 0;
-               double  timeStamp = 0.0f;
-               double  x = 0.0f;
-               double  y = 0.0f;
-
-               const String* pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_EVENT_TYPE));
-               SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_EVENT_TYPE.GetPointer() );
-               Integer::Parse(*pValue, eventType);
-
-               pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_TIME_STAMP));
-               SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_TIME_STAMP.GetPointer() );
-               Double::Parse(*pValue, timeStamp);
-
-               pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_X));
-               SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_X.GetPointer() );
-               Double::Parse(*pValue, x);
-
-               pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_Y));
-               SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_Y.GetPointer() );
-               Double::Parse(*pValue, y);
-
-               if( __isAppWidgetFrameReady == false )
-               {
-                       delete __pPendingTouchEvent;
-                       __pPendingTouchEvent = new PendingTouchEvent(eventType, timeStamp, x, y);
-               }
-               else
-               {
-                       this->ForwardTouchEvent(*pInstanceId, eventType, timeStamp, x, y);
-               }
+               SysLog(NID_APP, "[APPWIDGET_ON_TOUCH] touch events will be delivered after provider is initialized");
+//             int eventType = 0;
+//             double  timeStamp = 0.0f;
+//             double  x = 0.0f;
+//             double  y = 0.0f;
+
+//             const String* pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_EVENT_TYPE));
+//             SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_EVENT_TYPE.GetPointer() );
+//             Integer::Parse(*pValue, eventType);
+//
+//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_TIME_STAMP));
+//             SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_TIME_STAMP.GetPointer() );
+//             Double::Parse(*pValue, timeStamp);
+//
+//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_X));
+//             SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_X.GetPointer() );
+//             Double::Parse(*pValue, x);
+//
+//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_Y));
+//             SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_Y.GetPointer() );
+//             Double::Parse(*pValue, y);
+//
+//             this->ForwardTouchEvent(*pInstanceId, eventType, timeStamp, x, y);
        }
        SysLog(NID_APP, "Exit");
        return E_SUCCESS;
@@ -540,30 +531,31 @@ _AppWidgetProviderManagerImpl::HandleAppWidgetPopupRequest(const Tizen::Base::St
        }
        else if (operationId == APPWIDGET_POPUP_ON_TOUCH)
        {
-               SysAssertf(pArgs->GetCount() == 6, "invalid argc(%d)", pArgs->GetCount() );
-
-               int eventType = 0;
-               double  timeStamp = 0.0f;
-               double  x = 0.0f;
-               double  y = 0.0f;
-
-               const String* pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_EVENT_TYPE));
-               SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_EVENT_TYPE.GetPointer() );
-               Integer::Parse(*pValue, eventType);
-
-               pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_TIME_STAMP));
-               SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_TIME_STAMP.GetPointer() );
-               Double::Parse(*pValue, timeStamp);
-
-               pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_X));
-               SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_X.GetPointer() );
-               Double::Parse(*pValue, x);
-
-               pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_Y));
-               SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_Y.GetPointer() );
-               Double::Parse(*pValue, y);
-
-               ForwardTouchEventForPD(*pInstanceId, eventType, timeStamp, x, y);
+               SysAssertf(false, "[Invalid state]");
+//             SysAssertf(pArgs->GetCount() == 6, "invalid argc(%d)", pArgs->GetCount() );
+//
+//             int eventType = 0;
+//             double  timeStamp = 0.0f;
+//             double  x = 0.0f;
+//             double  y = 0.0f;
+//
+//             const String* pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_EVENT_TYPE));
+//             SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_EVENT_TYPE.GetPointer() );
+//             Integer::Parse(*pValue, eventType);
+//
+//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_TIME_STAMP));
+//             SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_TIME_STAMP.GetPointer() );
+//             Double::Parse(*pValue, timeStamp);
+//
+//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_X));
+//             SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_X.GetPointer() );
+//             Double::Parse(*pValue, x);
+//
+//             pValue =  dynamic_cast<const String*>(pArgs->GetValue(ARG_KEY_Y));
+//             SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_Y.GetPointer() );
+//             Double::Parse(*pValue, y);
+//
+//             ForwardTouchEventForPD(*pInstanceId, eventType, timeStamp, x, y);
        }
        else
        {
@@ -756,17 +748,6 @@ _AppWidgetProviderManagerImpl::RequestSyncSharedMemory(const Tizen::Base::String
 
        result r = pProxy->RequestSyncSharedMemory(instanceId, width, height);
 
-       if( __isAppWidgetFrameReady == false)
-       {
-               __isAppWidgetFrameReady = true;
-               if( __pPendingTouchEvent)
-               {
-                       this->ForwardTouchEvent(instanceId, __pPendingTouchEvent->eventType, __pPendingTouchEvent->timeStamp, __pPendingTouchEvent->x, __pPendingTouchEvent->y);
-                       delete __pPendingTouchEvent;
-                       __pPendingTouchEvent = null;
-               }
-       }
-
        return r;
 }
 
index cf31f3f..0d28d60 100644 (file)
@@ -101,18 +101,6 @@ private:
        result HandleAppWidgetRequest(const Tizen::Base::String& operationId, const Tizen::Base::Collection::IMap* pArgs);
        result HandleAppWidgetPopupRequest(const Tizen::Base::String& operationId, const Tizen::Base::Collection::IMap* pArgs);
 
-       struct PendingTouchEvent
-       {
-       public:
-               PendingTouchEvent(int eventType, double timeStamp, double       x, double       y)
-                : eventType(eventType), timeStamp(timeStamp), x(x), y(y) {  }
-
-               int eventType;
-               double  timeStamp;
-               double  x;
-               double  y;
-       };
-
 private:
        // for AppWidget
        IAppWidgetProviderFactory* __pAppWidgetFactory;
@@ -123,9 +111,6 @@ private:
        IAppWidgetPopupProviderFactory* __pAppWidgetPopupProviderFactory;
        AppWidgetPopupProvider* __pAppWidgetPopupProvider;
        _IAppWidgetTouchEventListener* __AppWidgetPopupTouchEventListener;
-
-       bool __isAppWidgetFrameReady;
-       PendingTouchEvent* __pPendingTouchEvent;
 };
 
 }} // Tizen::Shell