Added move semantics to TouchEvent & fixed some other internal event classes
[platform/core/uifw/dali-core.git] / dali / public-api / events / touch-event.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 2ec7411..d5cc27b
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 // CLASS HEADER
 #include <dali/public-api/events/touch-event.h>
 
-// EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-
 // INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/actors/actor.h>
+#include <dali/internal/event/events/touch-event-impl.h>
+
+#include <cstdio>
 
 namespace Dali
 {
 
-TouchEvent::TouchEvent()
-: time(0)
+TouchEvent::TouchEvent() = default;
+
+TouchEvent::TouchEvent( const TouchEvent& other ) = default;
+
+TouchEvent::TouchEvent( TouchEvent&& other ) = default;
+
+TouchEvent::~TouchEvent() = default;
+
+TouchEvent& TouchEvent::operator=( const TouchEvent& other ) = default;
+
+TouchEvent& TouchEvent::operator=( TouchEvent&& other ) = default;
+
+unsigned long TouchEvent::GetTime() const
+{
+  return GetImplementation( *this ).GetTime();
+}
+
+std::size_t TouchEvent::GetPointCount() const
+{
+  return GetImplementation( *this ).GetPointCount();
+}
+
+int32_t TouchEvent::GetDeviceId( std::size_t point ) const
+{
+  return GetImplementation( *this ).GetDeviceId( point );
+}
+
+PointState::Type TouchEvent::GetState( std::size_t point ) const
+{
+  return GetImplementation( *this ).GetState( point );
+}
+
+Actor TouchEvent::GetHitActor( std::size_t point ) const
+{
+  return GetImplementation( *this ).GetHitActor( point );
+}
+
+const Vector2& TouchEvent::GetLocalPosition( std::size_t point ) const
+{
+  return GetImplementation( *this ).GetLocalPosition( point );
+}
+
+const Vector2& TouchEvent::GetScreenPosition( std::size_t point ) const
+{
+  return GetImplementation( *this ).GetScreenPosition( point );
+}
+
+float TouchEvent::GetRadius( std::size_t point ) const
+{
+  return GetImplementation( *this ).GetRadius( point );
+}
+
+const Vector2& TouchEvent::GetEllipseRadius( std::size_t point ) const
+{
+  return GetImplementation( *this ).GetEllipseRadius( point );
+}
+
+float TouchEvent::GetPressure( std::size_t point ) const
+{
+  return GetImplementation( *this ).GetPressure( point );
+}
+
+Degree TouchEvent::GetAngle( std::size_t point ) const
 {
+  return GetImplementation( *this ).GetAngle( point );
 }
 
-TouchEvent::TouchEvent(unsigned long time)
-: time(time)
+Device::Class::Type TouchEvent::GetDeviceClass( std::size_t point ) const
 {
+  return GetImplementation( *this ).GetDeviceClass( point );
 }
 
-TouchEvent::~TouchEvent()
+Device::Subclass::Type TouchEvent::GetDeviceSubclass( std::size_t point ) const
 {
+  return GetImplementation( *this ).GetDeviceSubclass( point );
 }
 
-unsigned int TouchEvent::GetPointCount() const
+MouseButton::Type TouchEvent::GetMouseButton( std::size_t point ) const
 {
-  return points.size();
+  return GetImplementation( *this ).GetMouseButton( point );
 }
 
-const TouchPoint& TouchEvent::GetPoint(unsigned int point) const
+TouchEvent::TouchEvent( Internal::TouchEvent* internal )
+: BaseHandle( internal )
 {
-  DALI_ASSERT_ALWAYS( point < points.size() && "No point at index" );
-  return points[point];
 }
 
 } // namespace Dali