END_TEST;
}
+
+int UtcDaliTouchEventCopyConstructorWithPointP(void)
+{
+ Dali::Integration::Point point;
+
+ Vector2 touchPoint( 10.0, 20.0 );
+ point.SetDeviceId( 1 );
+ point.SetState( PointState::DOWN );
+ point.SetScreenPosition( Vector2( touchPoint.x, touchPoint.y ) );
+
+ TouchEvent touchEvent = Integration::NewTouchEvent(123u, point);
+ DALI_TEST_CHECK( touchEvent );
+
+ const auto refCount = touchEvent.GetBaseObject().ReferenceCount();
+
+ TouchEvent touchEvent2( touchEvent );
+ DALI_TEST_CHECK( touchEvent );
+ DALI_TEST_CHECK( touchEvent2 );
+ DALI_TEST_EQUALS( touchEvent, touchEvent2, TEST_LOCATION );
+ DALI_TEST_EQUALS( refCount + 1, touchEvent.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliTouchEventMoveConstructorWithPointP(void)
+{
+ Dali::Integration::Point point;
+
+ Vector2 touchPoint( 10.0, 20.0 );
+ point.SetDeviceId( 1 );
+ point.SetState( PointState::DOWN );
+ point.SetScreenPosition( Vector2( touchPoint.x, touchPoint.y ) );
+
+ TouchEvent touchEvent = Integration::NewTouchEvent(123u, point);
+ DALI_TEST_CHECK( touchEvent );
+
+ const auto refCount = touchEvent.GetBaseObject().ReferenceCount();
+
+ TouchEvent touchEvent2( std::move(touchEvent) );
+ DALI_TEST_CHECK( !touchEvent );
+ DALI_TEST_CHECK( touchEvent2 );
+ DALI_TEST_EQUALS( refCount, touchEvent2.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ END_TEST;
+}
namespace Integration
{
-Dali::TouchEvent NewTouchEvent(uint32_t timestamp, const TouchPoint& point)
+Dali::TouchEvent NewTouchEvent(uint32_t timeStamp, const TouchPoint& point)
{
- Internal::TouchEventPtr touchEventImpl( new Internal::TouchEvent(timestamp) );
- touchEventImpl->AddPoint(Integration::Point(point));
- Dali::TouchEvent handle(touchEventImpl.Get());
+ return NewTouchEvent( timeStamp, Integration::Point( point ) );
+}
+
+Dali::TouchEvent NewTouchEvent( uint32_t timeStamp, const Dali::Integration::Point& point )
+{
+ Internal::TouchEventPtr touchEventImpl( new Internal::TouchEvent( timeStamp ) );
+ touchEventImpl->AddPoint( point );
+ Dali::TouchEvent handle( touchEventImpl.Get() );
return handle;
}
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/devel-api/events/touch-point.h>
+#include <dali/integration-api/events/point.h>
namespace Dali
{
/**
* Create a new touch data handle from timestamp and touch point.
*
- * @param[in] timestamp The timestamp of the touch event.
+ * @param[in] timeStamp The time stamp of the touch event.
* @param[in] point The point on screen where the touch occurred.
* @return A new touch data handle.
*/
-DALI_CORE_API Dali::TouchEvent NewTouchEvent(uint32_t timestamp, const TouchPoint& point);
+DALI_CORE_API Dali::TouchEvent NewTouchEvent(uint32_t timeStamp, const TouchPoint& point);
+
+/**
+ * Create a new touch data handle from timestamp and point.
+ *
+ * @param[in] timeStamp The time stamp of the touch event.
+ * @param[in] point The point on screen where the touch occurred.
+ * @return A new touch data handle.
+ */
+DALI_CORE_API Dali::TouchEvent NewTouchEvent( uint32_t timeStamp, const Dali::Integration::Point& point );
} // namespace Integration