modify touch position for popup which added indicator area and add E_UNSUPPORTED_OPER...
authorminkyu kim <imetjade.kim@samsung.com>
Thu, 11 Apr 2013 11:41:53 +0000 (20:41 +0900)
committerminkyu kim <imetjade.kim@samsung.com>
Thu, 11 Apr 2013 11:41:53 +0000 (20:41 +0900)
Change-Id: Id7ef72462a5fb90b0ea41508ad08322b5c788420

inc/FUiTouchPinchGestureDetector.h
src/ui/FUi_Control.cpp
src/ui/FUi_EflUiEventManager.cpp

index b6c6a63..746fe70 100644 (file)
@@ -68,11 +68,21 @@ public:
         * Initializes this instance of %TouchPinchGestureDetector.
         *
         * @since 2.0
-        * @exception   E_SUCCESS                                       The method is successful.
-        * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
-        */
+        * @feature     %http://tizen.org/feature/multi_point_touch.pinch_zoom
+        *
+        * @return                                                  An error code
+        * @exception    E_SUCCESS                             The method is successful.
+        * @exception    E_OUT_OF_MEMORY                  The memory is insufficient.
+        * @exception    E_UNSUPPORTED_OPERATION    The Emulator or target device does not support the required feature. @b Since: @b 2.1
+        *                                      For more information, see
+        *                                      <a href=?../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm?>
+        *                                      Application Filtering</a>.
+        * @remarks     Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue()
+        *              methods.
+       */
        result Construct(void);
 
+
        /**
        * Adds the ITouchPinchGestureEventListener instance to the pinch gesture detector instance. @n
        * The added listener gets notified when a gesture is recognized.
index f02801b..9e09b79 100644 (file)
@@ -53,6 +53,7 @@
 #include "FUiCtrl_Form.h"\r
 #include "FUiCtrl_Frame.h"\r
 #include "FUi_ContainerImpl.h"\r
+#include "FUiCtrl_Popup.h"\r
 \r
 using namespace std;\r
 using namespace Tizen::Base;\r
@@ -61,6 +62,7 @@ using namespace Tizen::Base::Runtime;
 using namespace Tizen::Graphics;\r
 using namespace Tizen::Ui;\r
 using namespace Tizen::Ui::Animations;\r
+using namespace Tizen::Ui::Controls;\r
 \r
 namespace {\r
 \r
@@ -3537,8 +3539,22 @@ _Control::GetAbsoluteBounds(void) const
        {\r
                Point winPoint = pWindow->GetPosition();\r
 \r
-               accumPoint.x += winPoint.x;\r
-               accumPoint.y += winPoint.y;\r
+               Rectangle popupRect(0, 0, 0, 0);\r
+               _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);\r
+               if (pPopup)\r
+               {\r
+                       if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)\r
+                       {\r
+                               popupRect = pPopup->GetNativeBounds(true);\r
+                       }\r
+                       else\r
+                       {\r
+                               popupRect = pPopup->GetNativeBounds(false);\r
+                       }\r
+               }\r
+\r
+               accumPoint.x = accumPoint.x + winPoint.x + popupRect.x;\r
+               accumPoint.y = accumPoint.y + winPoint.y + popupRect.y;\r
        }\r
 \r
        absoluteBounds.x = accumPoint.x;\r
@@ -3580,8 +3596,22 @@ _Control::GetAbsoluteBoundsF(void) const
        {\r
                FloatPoint winPoint = pWindow->GetPositionF();\r
 \r
-               accumPoint.x += winPoint.x;\r
-               accumPoint.y += winPoint.y;\r
+               Rectangle popupRect(0, 0, 0, 0);\r
+               _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);\r
+               if (pPopup)\r
+               {\r
+                       if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)\r
+                       {\r
+                               popupRect = pPopup->GetNativeBounds(true);\r
+                       }\r
+                       else\r
+                       {\r
+                               popupRect = pPopup->GetNativeBounds(false);\r
+                       }\r
+               }\r
+\r
+               accumPoint.x = accumPoint.x + winPoint.x + _CoordinateSystemUtils::ConvertToFloat(popupRect).x;\r
+               accumPoint.y = accumPoint.y + winPoint.y + _CoordinateSystemUtils::ConvertToFloat(popupRect).y;\r
        }\r
 \r
        absoluteBounds.x = accumPoint.x;\r
index dcbe33d..7ef7090 100644 (file)
 #include "FUiAnim_ControlVisualElement.h"
 #include "FUiAnim_RootVisualElement.h"
 #include "FUiAnim_EflLayer.h"
+#include "FUiCtrl_Popup.h"
 
 using namespace std;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Animations;
+using namespace Tizen::Ui::Controls;
 using namespace Tizen::Graphics;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Base;
@@ -719,10 +721,24 @@ private:
                        pWindow = pControlManager->GetTouchedWindow();
                        SysTryReturn(NID_UI, pWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
+                       Rectangle popupRect(0, 0, 0, 0);
+                       _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
+                       if (pPopup)
+                       {
+                               if (pPopup->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
+                               {
+                                       popupRect = pPopup->GetNativeBounds(true);
+                               }
+                               else
+                               {
+                                       popupRect = pPopup->GetNativeBounds(false);
+                               }
+                       }
+
                        Rectangle winBounds = pWindow->GetBounds();
 
-                       ptf.x = static_cast<float>(x - winBounds.x);
-                       ptf.y = static_cast<float>(y - winBounds.y);
+                       ptf.x = static_cast<float>(x - winBounds.x - popupRect.x);
+                       ptf.y = static_cast<float>(y - winBounds.y - popupRect.y);
 
                        pRootControlElement = dynamic_cast <_ControlVisualElement*>(pWindow->GetVisualElement());
                }