*/
// 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
{
* @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
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
*/
// EXTERNAL INCLUDES
+#include <dali/integration-api/events/point.h>
#include <dali/integration-api/events/touch-event-combiner.h>
#include <style-monitor.h>
* @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.
// 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;
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 );
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 ) )
break;
}
- case TouchPoint::Stationary:
- case TouchPoint::Leave:
- case TouchPoint::Last:
+ case PointState::STATIONARY:
+ case PointState::LEAVE:
{
break;
}
// 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)
{
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 ) )
{
{
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)
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 ) )
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);
// 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;
{
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);
// 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;
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;
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 )
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
}
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;
// 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);
}
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
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);
{
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 );
}
{
unsigned long deltaBetweenTouchDownTouchUp = abs( event.time - mTouchTime ) ;
- if ( pointState == TouchPoint::Up )
+ if ( pointState == PointState::UP )
{
if ( deltaBetweenTouchDownTouchUp < MAXIMUM_TIME_ALLOWED )
{
mState = Clear;
}
}
- else if (pointState == TouchPoint::Interrupted)
+ else if (pointState == PointState::INTERRUPTED)
{
mState = Clear;
}
case Registered:
{
- if ( pointState == TouchPoint::Up )
+ if ( pointState == PointState::UP )
{
unsigned long deltaBetweenTouchDownTouchUp = abs( event.time - mTouchTime ) ;
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 );
}
}
-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;
}
}
-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 )
// 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>
* @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
* @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
{
switch( touchPoint.state )
{
- case Dali::TouchPoint::Down:
+ case Dali::PointState::DOWN:
{
IpcDataEvMouseMove ipcMove( touchPoint, touchEvent.time );
IpcDataEvMouseDown ipcDown( touchEvent.time );
}
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) );
{
switch( touchPoint.state )
{
- case Dali::TouchPoint::Down:
+ case Dali::PointState::DOWN:
{
ShowIndicator( HIDE_NOW );
break;
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 );
}
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 );
}
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 );
}
mGestureManager.Stop();
}
-void EventHandler::SendEvent(TouchPoint& point, unsigned long timeStamp)
+void EventHandler::SendEvent(Integration::Point& point, unsigned long timeStamp)
{
if(timeStamp < 1)
{
void EventHandler::FeedTouchPoint( TouchPoint& point, int timeStamp)
{
- SendEvent(point, timeStamp);
+ Integration::Point convertedPoint( point );
+ SendEvent(convertedPoint, timeStamp);
}
void EventHandler::FeedWheelEvent( WheelEvent& wheelEvent )
// 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
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);
}
{
}
// @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 );
}
mGestureManager.Stop();
}
-void EventHandler::SendEvent(TouchPoint& point, unsigned long timeStamp)
+void EventHandler::SendEvent(Integration::Point& point, unsigned long timeStamp)
{
Integration::TouchEvent touchEvent;
void EventHandler::FeedTouchPoint( TouchPoint& point, int timeStamp)
{
- SendEvent(point, timeStamp);
+ Integration::Point convertedPoint( point );
+ SendEvent(convertedPoint, timeStamp);
}
void EventHandler::FeedWheelEvent( WheelEvent& wheelEvent )
// 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
{
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 );
}
}
{
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 );
}
}
{
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 );
}
}
{
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 );
}
}
{
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 );
}
}
// 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 );
}
}
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 );
}
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 );
}
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 );
}
mGestureManager.Stop();
}
-void EventHandler::SendEvent(TouchPoint& point, unsigned long timeStamp)
+void EventHandler::SendEvent(Integration::Point& point, unsigned long timeStamp)
{
if(timeStamp < 1)
{
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)
void EventHandler::FeedTouchPoint( TouchPoint& point, int timeStamp)
{
- SendEvent(point, timeStamp);
+ Integration::Point convertedPoint( point );
+
+ SendEvent(convertedPoint, timeStamp);
}
void EventHandler::FeedWheelEvent( WheelEvent& wheelEvent )
// 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
{
}
// @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 );
}
mGestureManager.Stop();
}
-void EventHandler::SendEvent(TouchPoint& point, unsigned long timeStamp)
+void EventHandler::SendEvent(Dali::Integration::Point& point, unsigned long timeStamp)
{
if(timeStamp < 1)
{
void EventHandler::FeedTouchPoint( TouchPoint& point, int timeStamp)
{
- SendEvent(point, timeStamp);
+ Integration::Point convertedPoint( point );
+ SendEvent( convertedPoint, timeStamp );
}
void EventHandler::FeedWheelEvent( WheelEvent& wheelEvent )
// 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
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)
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;
}
TextureSet CreateTextureSet();
TextureSet CreateTextureSet( Image image );
PropertyBuffer CreatePropertyBuffer();
-
}
#endif // MESH_BUILDER_H
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
inline void DepthFunc(GLenum func)
{
+ std::stringstream out;
+ out << func;
+ mDepthFunctionTrace.PushCall("DepthFunc", out.str());
}
inline void DepthMask(GLboolean flag)
inline void GenerateMipmap(GLenum target)
{
+ std::stringstream out;
+ out<<target;
+ mTextureTrace.PushCall("GenerateMipmap", out.str());
}
inline void GenFramebuffers(GLsizei n, GLuint* framebuffers)
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());
}
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());
}
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
{
TraceCallStack mTextureTrace;
TraceCallStack mTexParamaterTrace;
TraceCallStack mDrawTrace;
+ TraceCallStack mDepthFunctionTrace;
// Shaders & Uniforms
GLuint mLastShaderIdUsed;
}
// 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;
}