(Touch) Add Pressure, radius & angle information 75/74975/4
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 16 Jun 2016 07:47:37 +0000 (08:47 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 17 Jun 2016 07:46:22 +0000 (08:46 +0100)
Change-Id: I9b86385cd3da84719d39ba60841c4e7540c7fa01

20 files changed:
adaptors/base/interfaces/window-event-interface.h
adaptors/common/accessibility-adaptor-impl.cpp
adaptors/common/events/event-handler.h
adaptors/common/events/long-press-gesture-detector.cpp
adaptors/common/events/pan-gesture-detector-base.cpp
adaptors/common/events/pinch-gesture-detector.cpp
adaptors/common/events/tap-gesture-detector.cpp
adaptors/common/events/tap-gesture-detector.h
adaptors/ecore/common/ecore-indicator-impl.cpp
adaptors/ecore/wayland/event-handler-ecore-wl.cpp
adaptors/emscripten/sdl-application.cpp
adaptors/wayland/event-handler-wl.cpp
adaptors/wayland/input-manager.cpp
adaptors/x11/ecore-x-event-handler.cpp
adaptors/x11/x-event-handler.cpp
adaptors/x11/x-events/x-input2.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/mesh-builder.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-actor-utils.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-gl-abstraction.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-touch-utils.h

index b689d58..92c9aa1 100644 (file)
@@ -19,9 +19,9 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/events/touch-point.h>
 #include <dali/public-api/events/key-event.h>
 #include <dali/public-api/events/wheel-event.h>
+#include <dali/integration-api/events/point.h>
 
 namespace Dali
 {
@@ -46,7 +46,7 @@ public:
    * @param[in] point touch point
    * @param[in] timeStamp time stamp
    */
-  virtual void TouchEvent( Dali::TouchPoint& point, unsigned long timeStamp ) = 0;
+  virtual void TouchEvent( Dali::Integration::Point& point, unsigned long timeStamp ) = 0;
 
   /**
    * @brief Key Event callback
index 1729b15..5ec6078 100644 (file)
@@ -263,7 +263,7 @@ bool AccessibilityAdaptor::HandleActionScrollEvent(const TouchPoint& point, unsi
 
   Integration::TouchEvent touchEvent;
   Integration::HoverEvent hoverEvent;
-  Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent);
+  Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent( Integration::Point( point ), timeStamp, touchEvent, hoverEvent );
   if( type == Integration::TouchEventCombiner::DispatchTouch || type == Integration::TouchEventCombiner::DispatchBoth ) // hover event is ignored
   {
     // Process the touch event in accessibility gesture detector
index 57ea135..c7b7684 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/integration-api/events/point.h>
 #include <dali/integration-api/events/touch-event-combiner.h>
 #include <style-monitor.h>
 
@@ -123,7 +124,7 @@ private:
    * @param[in]  point      The touch point information.
    * @param[in]  timeStamp  The time the touch occurred.
    */
-  void SendEvent(TouchPoint& point, unsigned long timeStamp);
+  void SendEvent(Integration::Point& point, unsigned long timeStamp);
 
   /**
    * Send key event to core.
index 5c35825..15d8f61 100644 (file)
@@ -76,12 +76,12 @@ void LongPressGestureDetector::SendEvent(const Integration::TouchEvent& event)
     // Clear: Wait till one point touches the screen before starting timer.
     case Clear:
     {
-      const TouchPoint& point = event.points[0];
+      const Integration::Point& point = event.points[0];
 
-      if ( point.state == TouchPoint::Down )
+      if ( point.GetState() == PointState::DOWN )
       {
         mTouchPositions.clear();
-        mTouchPositions[point.deviceId] = point.screen;
+        mTouchPositions[point.GetDeviceId()] = point.GetScreenPosition();
 
         mTouchTime = event.time;
 
@@ -111,21 +111,21 @@ void LongPressGestureDetector::SendEvent(const Integration::TouchEvent& event)
 
       bool endLoop(false);
 
-      for (std::vector<TouchPoint>::const_iterator iter = event.points.begin(), endIter = event.points.end();
+      for ( Integration::PointContainerConstIterator iter = event.points.begin(), endIter = event.points.end();
            iter != endIter && !endLoop; ++iter)
       {
-        switch( iter->state )
+        switch( iter->GetState() )
         {
           // add point.
-          case TouchPoint::Down:
+          case PointState::DOWN:
           {
-            mTouchPositions[iter->deviceId] = iter->screen;
+            mTouchPositions[iter->GetDeviceId()] = iter->GetScreenPosition();
             break;
           }
 
           // remove point.
-          case TouchPoint::Up:
-          case TouchPoint::Interrupted:
+          case PointState::UP:
+          case PointState::INTERRUPTED:
           {
             // System has interrupted us, long press is not possible, inform Core
             EmitGesture( Gesture::Cancelled );
@@ -136,9 +136,9 @@ void LongPressGestureDetector::SendEvent(const Integration::TouchEvent& event)
             break;
           }
 
-          case TouchPoint::Motion:
+          case PointState::MOTION:
           {
-            const Vector2 touchPosition( mTouchPositions[iter->deviceId] - iter->screen );
+            const Vector2 touchPosition( mTouchPositions[iter->GetDeviceId()] - iter->GetScreenPosition() );
             float distanceSquared = touchPosition.LengthSquared();
 
             if (distanceSquared > ( MAXIMUM_MOTION_ALLOWED * MAXIMUM_MOTION_ALLOWED ) )
@@ -152,9 +152,8 @@ void LongPressGestureDetector::SendEvent(const Integration::TouchEvent& event)
             break;
           }
 
-          case TouchPoint::Stationary:
-          case TouchPoint::Leave:
-          case TouchPoint::Last:
+          case PointState::STATIONARY:
+          case PointState::LEAVE:
           {
             break;
           }
@@ -170,9 +169,9 @@ void LongPressGestureDetector::SendEvent(const Integration::TouchEvent& event)
       // eventually the final touch point will be removed, marking the end of this gesture.
       if ( pointCount == 1 )
       {
-        TouchPoint::State primaryPointState = event.points[0].state;
+        PointState::Type primaryPointState = event.points[0].GetState();
 
-        if ( (primaryPointState == TouchPoint::Up) || (primaryPointState == TouchPoint::Interrupted) )
+        if ( (primaryPointState == PointState::UP) || (primaryPointState == PointState::INTERRUPTED) )
         {
           if(mState == Finished)
           {
index 9c27caf..ab2b53c 100644 (file)
@@ -86,9 +86,9 @@ PanGestureDetectorBase::~PanGestureDetectorBase()
 
 void PanGestureDetectorBase::SendEvent(const Integration::TouchEvent& event)
 {
-  TouchPoint::State primaryPointState(event.points[0].state);
+  PointState::Type primaryPointState(event.points[0].GetState());
 
-  if (primaryPointState == TouchPoint::Interrupted)
+  if (primaryPointState == PointState::INTERRUPTED)
   {
     if ( ( mState == Started ) || ( mState == Possible ) )
     {
@@ -105,9 +105,9 @@ void PanGestureDetectorBase::SendEvent(const Integration::TouchEvent& event)
     {
       case Clear:
       {
-        if (primaryPointState == TouchPoint::Down)
+        if (primaryPointState == PointState::DOWN)
         {
-          mPrimaryTouchDownLocation = event.points[0].screen;
+          mPrimaryTouchDownLocation = event.points[0].GetScreenPosition();
           mPrimaryTouchDownTime = event.time;
           mMotionEvents = 0;
           if (event.GetPointCount() == mMinimumTouchesRequired)
@@ -127,12 +127,12 @@ void PanGestureDetectorBase::SendEvent(const Integration::TouchEvent& event)
         unsigned int pointCount(event.GetPointCount());
         if ( (pointCount >= mMinimumTouchesRequired)&&(pointCount <= mMaximumTouchesRequired) )
         {
-          if (primaryPointState == TouchPoint::Motion)
+          if (primaryPointState == PointState::MOTION)
           {
             mTouchEvents.push_back(event);
             mMotionEvents++;
 
-            Vector2 delta(event.points[0].screen - mPrimaryTouchDownLocation);
+            Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
 
             if ( ( mMotionEvents >= mMinimumMotionEvents ) &&
                  ( delta.LengthSquared() >= mMinimumDistanceSquared ) )
@@ -142,9 +142,9 @@ void PanGestureDetectorBase::SendEvent(const Integration::TouchEvent& event)
               SendPan(Gesture::Started, event);
             }
           }
-          else if (primaryPointState == TouchPoint::Up)
+          else if (primaryPointState == PointState::UP)
           {
-            Vector2 delta(event.points[0].screen - mPrimaryTouchDownLocation);
+            Vector2 delta(event.points[0].GetScreenPosition() - mPrimaryTouchDownLocation);
             if(delta.LengthSquared() >= mMinimumDistanceSquared)
             {
               SendPan(Gesture::Started, event);
@@ -165,7 +165,7 @@ void PanGestureDetectorBase::SendEvent(const Integration::TouchEvent& event)
           // We do not satisfy pan conditions, tell Core our Gesture has been cancelled.
           SendPan(Gesture::Cancelled, event);
 
-          if (pointCount == 1 && primaryPointState == TouchPoint::Up)
+          if (pointCount == 1 && primaryPointState == PointState::UP)
           {
             // If we have lifted the primary touch point, then change our state to Clear...
             mState = Clear;
@@ -189,25 +189,25 @@ void PanGestureDetectorBase::SendEvent(const Integration::TouchEvent& event)
         {
           switch (primaryPointState)
           {
-            case TouchPoint::Motion:
+            case PointState::MOTION:
               // Pan is continuing, tell Core.
               SendPan(Gesture::Continuing, event);
               break;
 
-            case TouchPoint::Up:
+            case PointState::UP:
               // Pan is finally finished when our primary point is lifted, tell Core and change our state to Clear.
               SendPan(Gesture::Finished, event);
               mState = Clear;
               mTouchEvents.clear();
               break;
 
-            case TouchPoint::Stationary:
+            case PointState::STATIONARY:
               if (pointCount == mMinimumTouchesRequired)
               {
-                std::vector<TouchPoint>::const_iterator iter = event.points.begin() + 1; // We already know the state of the first point
+                Integration::PointContainerConstIterator iter = event.points.begin() + 1; // We already know the state of the first point
                 for(; iter != event.points.end(); ++iter)
                 {
-                  if(iter->state == TouchPoint::Up)
+                  if(iter->GetState() == PointState::UP)
                   {
                     // The number of touch points will be less than the minimum required.  Inform core and change our state to Finished.
                     SendPan(Gesture::Finished, event);
@@ -227,7 +227,7 @@ void PanGestureDetectorBase::SendEvent(const Integration::TouchEvent& event)
           // We have gone outside of the pan requirements, inform Core that the gesture is finished.
           SendPan(Gesture::Finished, event);
 
-          if (pointCount == 1 && primaryPointState == TouchPoint::Up)
+          if (pointCount == 1 && primaryPointState == PointState::UP)
           {
             // If this was the primary point being released, then we change our state back to Clear...
             mState = Clear;
@@ -245,7 +245,7 @@ void PanGestureDetectorBase::SendEvent(const Integration::TouchEvent& event)
       case Finished:
       case Failed:
       {
-        if (primaryPointState == TouchPoint::Up)
+        if (primaryPointState == PointState::UP)
         {
           // Change our state back to clear when the primary touch point is released.
           mState = Clear;
@@ -268,7 +268,7 @@ void PanGestureDetectorBase::Update(const Integration::GestureRequest& request)
 void PanGestureDetectorBase::SendPan(Gesture::State state, const Integration::TouchEvent& currentEvent)
 {
   Integration::PanGestureEvent gesture(state);
-  gesture.currentPosition = currentEvent.points[0].screen;
+  gesture.currentPosition = currentEvent.points[0].GetScreenPosition();
   gesture.numberOfTouches = currentEvent.GetPointCount();
 
   if ( mTouchEvents.size() > 1 )
index 5c9c34f..f5101bb 100644 (file)
@@ -44,22 +44,15 @@ namespace
 const unsigned int MINIMUM_TOUCH_EVENTS_REQUIRED = 4;
 const unsigned int MINIMUM_TOUCH_EVENTS_REQUIRED_AFTER_START = 4;
 
-inline float GetDistance(const TouchPoint& point1, const TouchPoint& point2)
+inline float GetDistance(const Integration::Point& point1, const Integration::Point& point2)
 {
-  Vector2 vector(point1.screen - point2.screen);
+  Vector2 vector(point1.GetScreenPosition() - point2.GetScreenPosition());
   return vector.Length();
 }
 
-inline float GetGradient(const TouchPoint& point1, const TouchPoint& point2)
+inline Vector2 GetCenterPoint(const Integration::Point& point1, const Integration::Point& point2)
 {
-  return (point2.screen.y - point1.screen.y)
-         /
-         (point2.screen.x - point1.screen.x);
-}
-
-inline Vector2 GetCenterPoint(const TouchPoint& point1, const TouchPoint& point2)
-{
-  return Vector2(point1.screen + point2.screen) * 0.5f;
+  return Vector2(point1.GetScreenPosition() + point2.GetScreenPosition()) * 0.5f;
 }
 
 } // unnamed namespace
@@ -110,10 +103,10 @@ void PinchGestureDetector::SendEvent(const Integration::TouchEvent& event)
       }
       else
       {
-        const TouchPoint& currentPoint1 = event.points[0];
-        const TouchPoint& currentPoint2 = event.points[1];
+        const Integration::Point& currentPoint1 = event.points[0];
+        const Integration::Point& currentPoint2 = event.points[1];
 
-        if (currentPoint1.state == TouchPoint::Up || currentPoint2.state == TouchPoint::Up)
+        if (currentPoint1.GetState() == PointState::UP || currentPoint2.GetState() == PointState::UP)
         {
           // One of our touch points has an Up event so change our state back to Clear.
           mState = Clear;
@@ -126,8 +119,8 @@ void PinchGestureDetector::SendEvent(const Integration::TouchEvent& event)
           // We can only determine a pinch after a certain number of touch points have been collected.
           if (mTouchEvents.size() >= MINIMUM_TOUCH_EVENTS_REQUIRED)
           {
-            const TouchPoint& firstPoint1 = mTouchEvents[0].points[0];
-            const TouchPoint& firstPoint2 = mTouchEvents[0].points[1];
+            const Integration::Point& firstPoint1 = mTouchEvents[0].points[0];
+            const Integration::Point& firstPoint2 = mTouchEvents[0].points[1];
 
             float firstDistance = GetDistance(firstPoint1, firstPoint2);
             float currentDistance = GetDistance(currentPoint1, currentPoint2);
@@ -176,10 +169,10 @@ void PinchGestureDetector::SendEvent(const Integration::TouchEvent& event)
       }
       else
       {
-        const TouchPoint& currentPoint1 = event.points[0];
-        const TouchPoint& currentPoint2 = event.points[1];
+        const Integration::Point& currentPoint1 = event.points[0];
+        const Integration::Point& currentPoint2 = event.points[1];
 
-        if (currentPoint1.state == TouchPoint::Up || currentPoint2.state == TouchPoint::Up)
+        if (currentPoint1.GetState() == PointState::UP || currentPoint2.GetState() == PointState::UP)
         {
           mTouchEvents.push_back(event);
           // Send pinch finished event
@@ -230,10 +223,10 @@ void PinchGestureDetector::SendPinch(Gesture::State state, const Integration::To
       event = *mTouchEvents.rbegin();
     }
 
-    const TouchPoint& firstPoint1( firstEvent.points[0] );
-    const TouchPoint& firstPoint2( firstEvent.points[1] );
-    const TouchPoint& currentPoint1( event.points[0] );
-    const TouchPoint& currentPoint2( event.points[1] );
+    const Integration::Point& firstPoint1( firstEvent.points[0] );
+    const Integration::Point& firstPoint2( firstEvent.points[1] );
+    const Integration::Point& currentPoint1( event.points[0] );
+    const Integration::Point& currentPoint2( event.points[1] );
 
     float firstDistance = GetDistance(firstPoint1, firstPoint2);
     float currentDistance = GetDistance(currentPoint1, currentPoint2);
index af7949b..247aa37 100644 (file)
@@ -66,14 +66,14 @@ void TapGestureDetector::SendEvent(const Integration::TouchEvent& event)
 {
   if (event.GetPointCount() == 1)
   {
-    const TouchPoint& point = event.points[0];
-    TouchPoint::State pointState = point.state;
+    const Integration::Point& point = event.points[0];
+    PointState::Type pointState = point.GetState();
 
     switch (mState)
     {
       case Clear:
       {
-        if (pointState == TouchPoint::Down)
+        if (pointState == PointState::DOWN)
         {
           SetupForTouchDown( event, point );
         }
@@ -84,7 +84,7 @@ void TapGestureDetector::SendEvent(const Integration::TouchEvent& event)
       {
         unsigned long deltaBetweenTouchDownTouchUp = abs( event.time - mTouchTime ) ;
 
-        if ( pointState == TouchPoint::Up )
+        if ( pointState == PointState::UP )
         {
           if ( deltaBetweenTouchDownTouchUp < MAXIMUM_TIME_ALLOWED )
           {
@@ -97,7 +97,7 @@ void TapGestureDetector::SendEvent(const Integration::TouchEvent& event)
             mState = Clear;
           }
         }
-        else if (pointState == TouchPoint::Interrupted)
+        else if (pointState == PointState::INTERRUPTED)
         {
           mState = Clear;
         }
@@ -106,7 +106,7 @@ void TapGestureDetector::SendEvent(const Integration::TouchEvent& event)
 
       case Registered:
       {
-        if ( pointState == TouchPoint::Up )
+        if ( pointState == PointState::UP )
         {
           unsigned long deltaBetweenTouchDownTouchUp = abs( event.time - mTouchTime ) ;
 
@@ -132,10 +132,11 @@ void TapGestureDetector::SendEvent(const Integration::TouchEvent& event)
             mState = Clear;
           }
         }
-        else if (pointState == TouchPoint::Down)
+        else if (pointState == PointState::DOWN)
         {
-          Vector2 distanceDelta(abs(mTouchPosition.x - point.screen.x),
-                                abs(mTouchPosition.y - point.screen.y));
+          const Vector2& screen( point.GetScreenPosition() );
+          Vector2 distanceDelta(abs(mTouchPosition.x - screen.x),
+                                abs(mTouchPosition.y - screen.y));
 
           unsigned long timeDelta = abs( event.time - mLastTapTime );
 
@@ -170,10 +171,9 @@ void TapGestureDetector::SendEvent(const Integration::TouchEvent& event)
   }
 }
 
-void TapGestureDetector::SetupForTouchDown( const Integration::TouchEvent& event, const TouchPoint& point )
+void TapGestureDetector::SetupForTouchDown( const Integration::TouchEvent& event, const Integration::Point& point )
 {
-  mTouchPosition.x = point.screen.x;
-  mTouchPosition.y = point.screen.y;
+  mTouchPosition = point.GetScreenPosition();
   mTouchTime = event.time;
   mLastTapTime = 0u;
   mTapsRegistered = 0;
@@ -209,11 +209,12 @@ void TapGestureDetector::EmitGesture( Gesture::State state, unsigned int time )
   }
 }
 
-void TapGestureDetector::EmitSingleTap( unsigned int time, const TouchPoint& point )
+void TapGestureDetector::EmitSingleTap( unsigned int time, const Integration::Point& point )
 {
   Integration::TapGestureEvent event( Gesture::Started );
-  Vector2 distanceDelta(abs(mTouchPosition.x - point.screen.x),
-                        abs(mTouchPosition.y - point.screen.y));
+  const Vector2& screen( point.GetScreenPosition() );
+  Vector2 distanceDelta(abs(mTouchPosition.x - screen.x),
+                        abs(mTouchPosition.y - screen.y));
 
   if (distanceDelta.x > MAXIMUM_MOTION_ALLOWED ||
       distanceDelta.y > MAXIMUM_MOTION_ALLOWED )
index 8182784..5bff69a 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/integration-api/events/tap-gesture-event.h>
 #include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/events/touch-point.h>
+#include <dali/integration-api/events/point.h>
 
 // INTERNAL INCLUDES
 #include <events/gesture-detector.h>
@@ -91,7 +91,7 @@ private:
    * @param[in] event registered touch event
    * @param[in] point position touch event occurred
    */
-  void SetupForTouchDown( const Integration::TouchEvent& event, const TouchPoint& point );
+  void SetupForTouchDown( const Integration::TouchEvent& event, const Integration::Point& point );
 
   /**
    * Emit a touch down event for hit testing
@@ -106,7 +106,7 @@ private:
    * @param[in] time time of this latest touch event
    * @param[in] point position touch event occurred
     */
-  void EmitSingleTap( unsigned int time, const TouchPoint& point );
+  void EmitSingleTap( unsigned int time, const Integration::Point& point );
 
   /**
    * Emit a tap event
index 6caa395..7cbe669 100644 (file)
@@ -576,7 +576,7 @@ bool Indicator::OnTouched(Dali::Actor indicator, const Dali::TouchEvent& touchEv
     {
       switch( touchPoint.state )
       {
-        case Dali::TouchPoint::Down:
+        case Dali::PointState::DOWN:
         {
           IpcDataEvMouseMove ipcMove( touchPoint, touchEvent.time );
           IpcDataEvMouseDown ipcDown( touchEvent.time );
@@ -591,14 +591,14 @@ bool Indicator::OnTouched(Dali::Actor indicator, const Dali::TouchEvent& touchEv
         }
         break;
 
-        case Dali::TouchPoint::Motion:
+        case Dali::PointState::MOTION:
         {
           IpcDataEvMouseMove ipcMove( touchPoint, touchEvent.time );
           mServerConnection->SendEvent( OP_EV_MOUSE_MOVE, &ipcMove, sizeof(ipcMove) );
         }
         break;
 
-        case Dali::TouchPoint::Up:
+        case Dali::PointState::UP:
         {
           IpcDataEvMouseUp ipcUp( touchEvent.time );
           mServerConnection->SendEvent( OP_EV_MOUSE_UP, &ipcUp, sizeof(ipcUp) );
@@ -1440,7 +1440,7 @@ void Indicator::OnStageTouched(const Dali::TouchEvent& touchEvent)
   {
     switch( touchPoint.state )
     {
-      case Dali::TouchPoint::Down:
+      case Dali::PointState::DOWN:
       {
         ShowIndicator( HIDE_NOW );
         break;
index 415dea4..419e880 100644 (file)
@@ -228,17 +228,23 @@ struct EventHandler::Impl
 
     if ( touchEvent->window == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
     {
-      TouchPoint::State state ( TouchPoint::Down );
+      PointState::Type state ( PointState::DOWN );
 
       // Check if the buttons field is set and ensure it's the primary touch button.
       // If this event was triggered by buttons other than the primary button (used for touch), then
       // just send an interrupted event to Core.
       if ( touchEvent->buttons && (touchEvent->buttons != PRIMARY_TOUCH_BUTTON_ID ) )
       {
-        state = TouchPoint::Interrupted;
+        state = PointState::INTERRUPTED;
       }
 
-      TouchPoint point( touchEvent->multi.device, state, touchEvent->x, touchEvent->y );
+      Integration::Point point;
+      point.SetDeviceId( touchEvent->multi.device );
+      point.SetState( state );
+      point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
+      point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
+      point.SetPressure( touchEvent->multi.pressure );
+      point.SetAngle( Degree( touchEvent->multi.angle ) );
       handler->SendEvent( point, touchEvent->timestamp );
     }
 
@@ -255,7 +261,13 @@ struct EventHandler::Impl
 
     if ( touchEvent->window == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
     {
-      TouchPoint point( touchEvent->multi.device, TouchPoint::Up, touchEvent->x, touchEvent->y );
+      Integration::Point point;
+      point.SetDeviceId( touchEvent->multi.device );
+      point.SetState( PointState::UP );
+      point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
+      point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
+      point.SetPressure( touchEvent->multi.pressure );
+      point.SetAngle( Degree( touchEvent->multi.angle ) );
       handler->SendEvent( point, touchEvent->timestamp );
     }
 
@@ -290,7 +302,13 @@ struct EventHandler::Impl
 
     if ( touchEvent->window == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
     {
-      TouchPoint point( touchEvent->multi.device, TouchPoint::Motion, touchEvent->x, touchEvent->y );
+      Integration::Point point;
+      point.SetDeviceId( touchEvent->multi.device );
+      point.SetState( PointState::MOTION );
+      point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
+      point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
+      point.SetPressure( touchEvent->multi.pressure );
+      point.SetAngle( Degree( touchEvent->multi.angle ) );
       handler->SendEvent( point, touchEvent->timestamp );
     }
 
@@ -687,7 +705,7 @@ EventHandler::~EventHandler()
   mGestureManager.Stop();
 }
 
-void EventHandler::SendEvent(TouchPoint& point, unsigned long timeStamp)
+void EventHandler::SendEvent(Integration::Point& point, unsigned long timeStamp)
 {
   if(timeStamp < 1)
   {
@@ -773,7 +791,8 @@ void EventHandler::SendRotationRequestEvent( )
 
 void EventHandler::FeedTouchPoint( TouchPoint& point, int timeStamp)
 {
-  SendEvent(point, timeStamp);
+  Integration::Point convertedPoint( point );
+  SendEvent(convertedPoint, timeStamp);
 }
 
 void EventHandler::FeedWheelEvent( WheelEvent& wheelEvent )
@@ -798,7 +817,8 @@ void EventHandler::Reset()
 
   // Any touch listeners should be told of the interruption.
   Integration::TouchEvent event;
-  TouchPoint point(0, TouchPoint::Interrupted, 0, 0);
+  Integration::Point point;
+  point.SetState( PointState::INTERRUPTED );
   event.AddPoint( point );
 
   // First the touch event & related gesture events are queued
index 62ddcc2..8cca15d 100644 (file)
@@ -213,25 +213,25 @@ void SdlApplication::DoRender()
 
 void SdlApplication::SendTouchEvent(double x, double y, int mouseState)
 {
-  TouchPoint::State state = TouchPoint::Up;
+  PointState::Type state = PointState::UP;
   if( 0 == mouseState )
   {
-    state = TouchPoint::Down;
+    state = PointState::DOWN;
   }
   else if( 1 == mouseState )
   {
-    state = TouchPoint::Up;
+    state = PointState::UP;
   }
   else if( 2 == mouseState )
   {
-    state = TouchPoint::Motion;
+    state = PointState::MOTION;
   }
 
   Dali::Integration::TouchEvent e;
-  e.AddPoint( TouchPoint( 0,
-                          state,
-                          static_cast<float>(x),
-                          static_cast<float>(y) ) );
+  Dali::Integration::Point point;
+  point.SetState( state );
+  point.SetScreenPosition( Vector2( static_cast<float>(x), static_cast<float>(y) ) );
+  e.AddPoint( point );
 
   mCore->QueueEvent(e);
 }
index 636de86..bc7d900 100644 (file)
@@ -72,7 +72,7 @@ struct EventHandler::Impl : public WindowEventInterface
   {
   }
   // @todo Consider allowing the EventHandler class to inherit from WindowEventInterface directly
-  virtual void TouchEvent( Dali::TouchPoint& point, unsigned long timeStamp )
+  virtual void TouchEvent( Dali::Integration::Point& point, unsigned long timeStamp )
   {
     mHandler->SendEvent( point, timeStamp );
   }
@@ -139,7 +139,7 @@ EventHandler::~EventHandler()
   mGestureManager.Stop();
 }
 
-void EventHandler::SendEvent(TouchPoint& point, unsigned long timeStamp)
+void EventHandler::SendEvent(Integration::Point& point, unsigned long timeStamp)
 {
 
   Integration::TouchEvent touchEvent;
@@ -221,7 +221,8 @@ void EventHandler::SendRotationRequestEvent( )
 
 void EventHandler::FeedTouchPoint( TouchPoint& point, int timeStamp)
 {
-  SendEvent(point, timeStamp);
+  Integration::Point convertedPoint( point );
+  SendEvent(convertedPoint, timeStamp);
 }
 
 void EventHandler::FeedWheelEvent( WheelEvent& wheelEvent )
@@ -246,7 +247,8 @@ void EventHandler::Reset()
 
   // Any touch listeners should be told of the interruption.
   Integration::TouchEvent event;
-  TouchPoint point(0, TouchPoint::Interrupted, 0, 0);
+  Integration::Point point;
+  point.SetState( PointState::INTERRUPTED );
   event.AddPoint( point );
 
   // First the touch event & related gesture events are queued
index 4cff5c7..6f90b32 100644 (file)
@@ -126,7 +126,10 @@ void InputManager::PointerMotion( Seat* seat, unsigned int timestamp, float x, f
 {
   if( mWindowEventInterface )
   {
-    TouchPoint point ( POINTER_DEVICE_ID, TouchPoint::Motion, x , y);
+    Integration::Point point;
+    point.SetDeviceId( POINTER_DEVICE_ID );
+    point.SetState( PointState::MOTION );
+    point.SetScreenPosition( Vector2( x , y ) );
     mWindowEventInterface->TouchEvent( point, timestamp );
   }
 }
@@ -138,11 +141,19 @@ void InputManager::PointerButton( Seat* seat, unsigned int serial, unsigned int
   {
     const Dali::Vector2& pointer( seat->GetLastPointerPosition() );
 
-    TouchPoint point ( POINTER_DEVICE_ID, TouchPoint::Up,  pointer.x,  pointer.y );
-    if( state == 1)
+    Integration::Point point;
+    point.SetDeviceId( POINTER_DEVICE_ID );
+    point.SetScreenPosition( pointer );
+
+    if( state == 1 )
+    {
+      point.SetState( PointState::DOWN );
+    }
+    else
     {
-      point.state = TouchPoint::Down;
+      point.SetState( PointState::UP );
     }
+
     mWindowEventInterface->TouchEvent( point, timestamp );
   }
 }
@@ -212,7 +223,10 @@ void InputManager::TouchDown( Seat* seat, unsigned int serial, unsigned int time
   {
     const Dali::Vector2& pointer( seat->GetLastPointerPosition() );
 
-    TouchPoint point ( touchId, TouchPoint::Down,  pointer.x,  pointer.y );
+    Integration::Point point;
+    point.SetDeviceId( touchId );
+    point.SetState( PointState::DOWN );
+    point.SetScreenPosition( pointer );
     mWindowEventInterface->TouchEvent( point, timestamp );
   }
 }
@@ -224,7 +238,10 @@ void InputManager::TouchUp( Seat* seat, unsigned int serial, unsigned int timest
   {
     const Dali::Vector2& pointer( seat->GetLastPointerPosition() );
 
-    TouchPoint point ( touchId, TouchPoint::Up,  pointer.x,  pointer.y );
+    Integration::Point point;
+    point.SetDeviceId( touchId );
+    point.SetState( PointState::UP );
+    point.SetScreenPosition( pointer );
     mWindowEventInterface->TouchEvent( point, timestamp );
   }
 }
@@ -235,7 +252,10 @@ void InputManager::TouchMotion( Seat* seat, unsigned int timestamp, int touchId,
   {
     const Dali::Vector2& pointer( seat->GetLastPointerPosition() );
 
-    TouchPoint point ( touchId, TouchPoint::Motion,  pointer.x,  pointer.y );
+    Integration::Point point;
+    point.SetDeviceId( touchId );
+    point.SetState( PointState::MOTION );
+    point.SetScreenPosition( pointer );
     mWindowEventInterface->TouchEvent( point, timestamp );
   }
 }
@@ -253,7 +273,9 @@ void InputManager::TouchCancel( Seat* seat )
 
     // it looks like DALi just checks the first touch point for interruption
     // so touchId can be zero
-    TouchPoint point ( 0, TouchPoint::Interrupted,  pointer.x,  pointer.y );
+    Integration::Point point;
+    point.SetState( PointState::INTERRUPTED );
+    point.SetScreenPosition( pointer );
     mWindowEventInterface->TouchEvent( point, 0 );
   }
 }
index 29b89b2..f5f08b8 100644 (file)
@@ -481,17 +481,23 @@ struct EventHandler::Impl
 
     if ( touchEvent->window == handler->mImpl->mWindow )
     {
-      TouchPoint::State state ( TouchPoint::Down );
+      PointState::Type state ( PointState::DOWN );
 
       // Check if the buttons field is set and ensure it's the primary touch button.
       // If this event was triggered by buttons other than the primary button (used for touch), then
       // just send an interrupted event to Core.
       if ( touchEvent->buttons && (touchEvent->buttons != PRIMARY_TOUCH_BUTTON_ID ) )
       {
-        state = TouchPoint::Interrupted;
+        state = PointState::INTERRUPTED;
       }
 
-      TouchPoint point( touchEvent->multi.device, state, touchEvent->x, touchEvent->y );
+      Integration::Point point;
+      point.SetDeviceId( touchEvent->multi.device );
+      point.SetState( state );
+      point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
+      point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
+      point.SetPressure( touchEvent->multi.pressure );
+      point.SetAngle( Degree( touchEvent->multi.angle ) );
       handler->SendEvent( point, touchEvent->timestamp );
     }
 
@@ -508,7 +514,13 @@ struct EventHandler::Impl
 
     if ( touchEvent->window == handler->mImpl->mWindow )
     {
-      TouchPoint point( touchEvent->multi.device, TouchPoint::Up, touchEvent->x, touchEvent->y );
+      Integration::Point point;
+      point.SetDeviceId( touchEvent->multi.device );
+      point.SetState( PointState::UP );
+      point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
+      point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
+      point.SetPressure( touchEvent->multi.pressure );
+      point.SetAngle( Degree( touchEvent->multi.angle ) );
       handler->SendEvent( point, touchEvent->timestamp );
     }
 
@@ -525,7 +537,13 @@ struct EventHandler::Impl
 
     if ( touchEvent->window == handler->mImpl->mWindow )
     {
-      TouchPoint point( touchEvent->multi.device, TouchPoint::Motion, touchEvent->x, touchEvent->y );
+      Integration::Point point;
+      point.SetDeviceId( touchEvent->multi.device );
+      point.SetState( PointState::MOTION );
+      point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
+      point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
+      point.SetPressure( touchEvent->multi.pressure );
+      point.SetAngle( Degree( touchEvent->multi.angle ) );
       handler->SendEvent( point, touchEvent->timestamp );
     }
 
@@ -1712,7 +1730,7 @@ EventHandler::~EventHandler()
   mGestureManager.Stop();
 }
 
-void EventHandler::SendEvent(TouchPoint& point, unsigned long timeStamp)
+void EventHandler::SendEvent(Integration::Point& point, unsigned long timeStamp)
 {
   if(timeStamp < 1)
   {
@@ -1724,7 +1742,7 @@ void EventHandler::SendEvent(TouchPoint& point, unsigned long timeStamp)
   Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent);
   if(type != Integration::TouchEventCombiner::DispatchNone )
   {
-    DALI_LOG_INFO(gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.deviceId, point.state, point.local.x, point.local.y);
+    DALI_LOG_INFO(gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetScreenPosition().x, point.GetScreenPosition().y);
 
     // First the touch and/or hover event & related gesture events are queued
     if(type == Integration::TouchEventCombiner::DispatchTouch || type == Integration::TouchEventCombiner::DispatchBoth)
@@ -1798,7 +1816,9 @@ void EventHandler::SendRotationRequestEvent( )
 
 void EventHandler::FeedTouchPoint( TouchPoint& point, int timeStamp)
 {
-  SendEvent(point, timeStamp);
+  Integration::Point convertedPoint( point );
+
+  SendEvent(convertedPoint, timeStamp);
 }
 
 void EventHandler::FeedWheelEvent( WheelEvent& wheelEvent )
@@ -1823,7 +1843,8 @@ void EventHandler::Reset()
 
   // Any touch listeners should be told of the interruption.
   Integration::TouchEvent event;
-  TouchPoint point(0, TouchPoint::Interrupted, 0, 0);
+  Integration::Point point;
+  point.SetState( PointState::INTERRUPTED );
   event.AddPoint( point );
 
   // First the touch event & related gesture events are queued
index 39bb9b3..5243dd9 100644 (file)
@@ -141,7 +141,7 @@ struct EventHandler::Impl : public WindowEventInterface
   {
   }
   // @todo Consider allowing the EventHandler class to inherit from WindowEventInterface directly
-  virtual void TouchEvent( Dali::TouchPoint& point, unsigned long timeStamp )
+  virtual void TouchEvent( Dali::Integration::Point& point, unsigned long timeStamp )
   {
     mHandler->SendEvent( point, timeStamp );
   }
@@ -208,7 +208,7 @@ EventHandler::~EventHandler()
   mGestureManager.Stop();
 }
 
-void EventHandler::SendEvent(TouchPoint& point, unsigned long timeStamp)
+void EventHandler::SendEvent(Dali::Integration::Point& point, unsigned long timeStamp)
 {
   if(timeStamp < 1)
   {
@@ -294,7 +294,8 @@ void EventHandler::SendRotationRequestEvent( )
 
 void EventHandler::FeedTouchPoint( TouchPoint& point, int timeStamp)
 {
-  SendEvent(point, timeStamp);
+  Integration::Point convertedPoint( point );
+  SendEvent( convertedPoint, timeStamp );
 }
 
 void EventHandler::FeedWheelEvent( WheelEvent& wheelEvent )
@@ -319,7 +320,8 @@ void EventHandler::Reset()
 
   // Any touch listeners should be told of the interruption.
   Integration::TouchEvent event;
-  TouchPoint point(0, TouchPoint::Interrupted, 0, 0);
+  Integration::Point point;
+  point.SetState( PointState::INTERRUPTED );
   event.AddPoint( point );
 
   // First the touch event & related gesture events are queued
index d015c91..e634331 100644 (file)
@@ -180,7 +180,9 @@ void XInput2::ProcessGenericEvent( XGenericEventCookie* cookie )
     return;
   }
 
-  TouchPoint point ( deviceEvent->deviceid, TouchPoint::Last, deviceEvent->event_x, deviceEvent->event_y );
+  Integration::Point point;
+  point.SetDeviceId( deviceEvent->deviceid );
+  point.SetScreenPosition( Vector2( deviceEvent->event_x, deviceEvent->event_y ) );
   Time time( deviceEvent->time ); // X is using uint32 for time field ( see XI2proto.h )
 
   switch( cookie->evtype)
@@ -188,21 +190,21 @@ void XInput2::ProcessGenericEvent( XGenericEventCookie* cookie )
     case XI_TouchUpdate:
     case XI_Motion:
     {
-      point.state = TouchPoint::Motion;
+      point.SetState( PointState::MOTION );
       mEventInterface->TouchEvent( point, time );
       break;
     }
     case XI_TouchBegin:
     case XI_ButtonPress:
     {
-      point.state = TouchPoint::Down;
+      point.SetState( PointState::DOWN );
       mEventInterface->TouchEvent( point, time );
       break;
     }
     case XI_TouchEnd:
     case XI_ButtonRelease:
     {
-      point.state = TouchPoint::Up;
+      point.SetState( PointState::UP );
       mEventInterface->TouchEvent( point, time );
       break;
     }
index 391bcc4..e157338 100644 (file)
@@ -31,7 +31,6 @@ Shader CreateShader();
 TextureSet CreateTextureSet();
 TextureSet CreateTextureSet( Image image );
 PropertyBuffer CreatePropertyBuffer();
-
 }
 
 #endif // MESH_BUILDER_H
index fb50bf5..9be97bc 100644 (file)
@@ -28,8 +28,6 @@ namespace Dali
 
 namespace
 {
-const char * const TEXTURE_UNIFORM_NAME( "sTexture" );
-
 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   attribute mediump vec2 aPosition;\n
   uniform mediump mat4 uMvpMatrix;\n
index 1fe97c1..f910d51 100644 (file)
@@ -389,6 +389,9 @@ public:
 
   inline void DepthFunc(GLenum func)
   {
+    std::stringstream out;
+    out << func;
+    mDepthFunctionTrace.PushCall("DepthFunc", out.str());
   }
 
   inline void DepthMask(GLboolean flag)
@@ -488,6 +491,9 @@ public:
 
   inline void GenerateMipmap(GLenum target)
   {
+    std::stringstream out;
+    out<<target;
+    mTextureTrace.PushCall("GenerateMipmap", out.str());
   }
 
   inline void GenFramebuffers(GLsizei n, GLuint* framebuffers)
@@ -881,7 +887,7 @@ public:
   inline void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels)
   {
     std::stringstream out;
-    out << width << ", " << height;
+    out << target<<", "<<level<<", "<<width << ", " << height;
     mTextureTrace.PushCall("TexImage2D", out.str());
   }
 
@@ -916,7 +922,7 @@ public:
   inline void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels)
   {
     std::stringstream out;
-    out << xoffset << ", " << yoffset << ", " << width << ", " << height;
+    out << target << ", "<<level <<", " << xoffset << ", " << yoffset << ", " << width << ", " << height;
     mTextureTrace.PushCall("TexSubImage2D", out.str());
   }
 
@@ -1634,6 +1640,11 @@ public: // TEST FUNCTIONS
   inline void ResetDrawCallStack() { mDrawTrace.Reset(); }
   inline TraceCallStack& GetDrawTrace() { return mDrawTrace; }
 
+  //Methods for Depth function verification
+  inline void EnableDepthFunctionCallTrace(bool enable) { mDepthFunctionTrace.Enable(enable); }
+  inline void ResetDepthFunctionCallStack() { mDepthFunctionTrace.Reset(); }
+  inline TraceCallStack& GetDepthFunctionTrace() { return mDepthFunctionTrace; }
+
   template <typename T>
   inline bool GetUniformValue( const char* name, T& value ) const
   {
@@ -1850,6 +1861,7 @@ private:
   TraceCallStack mTextureTrace;
   TraceCallStack mTexParamaterTrace;
   TraceCallStack mDrawTrace;
+  TraceCallStack mDepthFunctionTrace;
 
   // Shaders & Uniforms
   GLuint mLastShaderIdUsed;
index ebae313..28caca9 100644 (file)
@@ -62,10 +62,13 @@ struct TouchEventDataFunctor
   }
 
   // Generate a touch-event
-  Integration::TouchEvent GenerateSingleTouch( TouchPoint::State state, Vector2 screenPosition ) const
+  Integration::TouchEvent GenerateSingleTouch( PointState::Type state, const Vector2& screenPosition ) const
   {
     Integration::TouchEvent touchEvent;
-    touchEvent.points.push_back( TouchPoint ( 0, state, screenPosition.x, screenPosition.y ) );
+    Integration::Point point;
+    point.SetState( state );
+    point.SetScreenPosition( screenPosition );
+    touchEvent.points.push_back( point );
     return touchEvent;
   }