#ifndef TEST_CUSTOM_ACTOR_H
#define TEST_CUSTOM_ACTOR_H
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
#include <dali/public-api/dali-core.h>
#include <dali/devel-api/object/property-helper-devel.h>
#include <dali/integration-api/scene.h>
virtual ~TestCustomActor();
Impl::TestCustomActor& GetImpl();
+ TestCustomActor( TestCustomActor&& rhs ) = default;
+ TestCustomActor& operator=( TestCustomActor&& rhs ) = default;
+
std::vector< std::string >& GetMethodsCalled();
void ResetCallStack();
void SetDaliProperty(std::string s);
END_TEST;
}
+int UtcDaliActorMoveConstructor(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ DALI_TEST_CHECK( actor );
+
+ int id = actor.GetProperty< int >( Actor::Property::ID );
+
+ Actor moved = std::move( actor);
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION );
+ DALI_TEST_CHECK( !actor );
+
+ END_TEST;
+}
+
+int UtcDaliActorMoveAssignment(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ DALI_TEST_CHECK( actor );
+
+ int id = actor.GetProperty< int >( Actor::Property::ID );
+
+ Actor moved;
+ moved = std::move( actor);
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION );
+ DALI_TEST_CHECK( !actor );
+
+ END_TEST;
+}
+
//& purpose: Testing Dali::Actor::GetName()
int UtcDaliActorGetName(void)
{
END_TEST;
}
+int UtcDaliAnimationMoveConstructor(void)
+{
+ TestApplication application;
+
+ //Animation
+
+ Animation animation = Animation::New( 1.0f );
+ DALI_TEST_CHECK( animation );
+ DALI_TEST_EQUALS( 1, animation.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1.0f, animation.GetDuration(), 0.001f, TEST_LOCATION );
+
+ Animation movedAnimation = std::move( animation );
+ DALI_TEST_CHECK( movedAnimation );
+ DALI_TEST_EQUALS( 1, movedAnimation.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1.0f, movedAnimation.GetDuration(), 0.001f, TEST_LOCATION );
+ DALI_TEST_CHECK( !animation );
+
+ // KeyFrames
+
+ KeyFrames keyframes = KeyFrames::New();
+ DALI_TEST_CHECK( keyframes );
+ DALI_TEST_EQUALS( 1, keyframes.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( Property::Type::NONE, keyframes.GetType(), TEST_LOCATION );
+
+ keyframes.Add( 0.0f, Vector3( 0.0f, 0.0f, 0.0f ) );
+ keyframes.Add( 1.0f, Vector3( 100.0f, 100.0f, 100.0f ) );
+ DALI_TEST_EQUALS( Property::Type::VECTOR3, keyframes.GetType(), TEST_LOCATION );
+
+ KeyFrames movedKeyFrames = std::move( keyframes );
+ DALI_TEST_CHECK( movedKeyFrames );
+ DALI_TEST_EQUALS( 1, movedKeyFrames.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( Property::Type::VECTOR3, movedKeyFrames.GetType(), TEST_LOCATION );
+ DALI_TEST_CHECK( !keyframes );
+
+ END_TEST;
+}
+
+int UtcDaliAnimationMoveAssignment(void)
+{
+ TestApplication application;
+
+ // Animation
+
+ Animation animation = Animation::New( 1.0f );
+ DALI_TEST_CHECK( animation );
+ DALI_TEST_EQUALS( 1, animation.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1.0f, animation.GetDuration(), 0.001f, TEST_LOCATION );
+
+ Animation move;
+ move = std::move( animation );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1.0f, move.GetDuration(), 0.001f, TEST_LOCATION );
+ DALI_TEST_CHECK( !animation );
+
+ // KeyFrames
+
+ KeyFrames keyframes = KeyFrames::New();
+ DALI_TEST_CHECK( keyframes );
+ DALI_TEST_EQUALS( 1, keyframes.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( Property::Type::NONE, keyframes.GetType(), TEST_LOCATION );
+
+ keyframes.Add( 0.0f, Vector3( 0.0f, 0.0f, 0.0f ) );
+ keyframes.Add( 1.0f, Vector3( 100.0f, 100.0f, 100.0f ) );
+ DALI_TEST_EQUALS( Property::Type::VECTOR3, keyframes.GetType(), TEST_LOCATION );
+
+ KeyFrames movedKeyFrames;
+ movedKeyFrames = std::move( keyframes );
+ DALI_TEST_CHECK( movedKeyFrames );
+ DALI_TEST_EQUALS( 1, movedKeyFrames.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( Property::Type::VECTOR3, movedKeyFrames.GetType(), TEST_LOCATION );
+ DALI_TEST_CHECK( !keyframes );
+
+ END_TEST;
+}
+
int UtcDaliAnimationSetDurationP(void)
{
TestApplication application;
/*
- * Copyright (c) 2014 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.
END_TEST;
}
+int UtcDaliBaseHandleMoveConstructor(void)
+{
+ TestApplication application;
+
+ // Initialize an object, ref count == 1
+ BaseHandle object = Actor::New();
+
+ DALI_TEST_EQUALS( 1, object.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ // Move the object, ref count == 1
+ BaseHandle move = std::move( object );
+ DALI_TEST_CHECK( move );
+
+ // Check that object is moved (not copied, so ref count keeps the same)
+ if ( move )
+ {
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ }
+ DALI_TEST_CHECK( !object );
+
+ END_TEST;
+}
+
+int UtcDaliBaseHandleMoveAssignment(void)
+{
+ TestApplication application;
+
+ // Initialize an object, ref count == 1
+ BaseHandle object = Actor::New();
+
+ DALI_TEST_EQUALS( 1, object.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ // Move the object, ref count == 1
+ BaseHandle move;
+ move = std::move( object );
+ DALI_TEST_CHECK( move );
+
+ // Check that object is moved (not copied, so ref count keeps the same)
+ if ( move )
+ {
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ }
+ DALI_TEST_CHECK( !object );
+
+ END_TEST;
+}
+
int UtcDaliBaseHandleGetBaseObject(void)
{
TestApplication application;
linearConstrainer.SetProperty( Dali::LinearConstrainer::Property::VALUE, points );
}
+static void VerifyLinearConstrainerUniformProgress( Dali::LinearConstrainer& linearConstrainer )
+{
+ Dali::Property::Array points;
+ points.Resize(3);
+ points[0] = 0.0f;
+ points[1] = 1.0f;
+ points[2] = 0.0f;
+
+ Property::Value value = linearConstrainer.GetProperty( Dali::LinearConstrainer::Property::VALUE );
+ Property::Array* array = value.GetArray();
+ DALI_TEST_CHECK( array );
+
+ const unsigned int noOfPoints = points.Size();
+ for( unsigned int i = 0; i < noOfPoints; ++i )
+ {
+ DALI_TEST_EQUALS( ( *array )[i].Get< float >(), points[i].Get< float >(), TEST_LOCATION );
+ }
+}
+
static void SetupLinearConstrainerNonUniformProgress( Dali::LinearConstrainer& linearConstrainer)
{
Dali::Property::Array points;
END_TEST;
}
+int UtcLinearConstrainerMoveConstructor(void)
+{
+ TestApplication application;
+
+ Dali::LinearConstrainer linearConstrainer = Dali::LinearConstrainer::New();
+ DALI_TEST_CHECK( linearConstrainer );
+ DALI_TEST_EQUALS( 1, linearConstrainer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ SetupLinearConstrainerUniformProgress( linearConstrainer );
+ VerifyLinearConstrainerUniformProgress( linearConstrainer );
+
+ Dali::LinearConstrainer moved = std::move( linearConstrainer );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ VerifyLinearConstrainerUniformProgress( moved );
+ DALI_TEST_CHECK( !linearConstrainer );
+
+ END_TEST;
+}
+
+int UtcLinearConstrainerMoveAssignment(void)
+{
+ TestApplication application;
+
+ Dali::LinearConstrainer linearConstrainer = Dali::LinearConstrainer::New();
+ DALI_TEST_CHECK( linearConstrainer );
+ DALI_TEST_EQUALS( 1, linearConstrainer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ SetupLinearConstrainerUniformProgress( linearConstrainer );
+ VerifyLinearConstrainerUniformProgress( linearConstrainer );
+
+ Dali::LinearConstrainer moved;
+ moved = std::move( linearConstrainer );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ VerifyLinearConstrainerUniformProgress( moved );
+ DALI_TEST_CHECK( !linearConstrainer );
+
+ END_TEST;
+}
+
int UtcLinearConstrainerApply(void)
{
TestApplication application;
}
///////////////////////////////////////////////////////////////////////////////
+int UtcDaliConstraintMoveConstructor(void)
+{
+ // Ensure copy constructor & assignment operators work
+
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ application.GetScene().Add( actor );
+
+ Constraint constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, &BasicFunction< Vector3 > );
+ DALI_TEST_CHECK( constraint );
+ DALI_TEST_EQUALS( 1, constraint.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( constraint.GetTargetObject() == actor );
+
+ Constraint moved = std::move( constraint );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetTargetObject() == actor );
+ DALI_TEST_CHECK( !constraint );
+
+ END_TEST;
+}
+
+int UtcDaliConstraintMoveAssignment(void)
+{
+ // Ensure copy constructor & assignment operators work
+
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ application.GetScene().Add( actor );
+
+ Constraint constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, &BasicFunction< Vector3 > );
+ DALI_TEST_CHECK( constraint );
+ DALI_TEST_EQUALS( 1, constraint.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( constraint.GetTargetObject() == actor );
+
+ Constraint moved;
+ moved = std::move( constraint );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( moved.GetTargetObject() == actor );
+ DALI_TEST_CHECK( !constraint );
+
+ END_TEST;
+}
+
///////////////////////////////////////////////////////////////////////////////
// Constraint::DownCast
///////////////////////////////////////////////////////////////////////////////
END_TEST;
}
+int UtcDaliCustomActorMoveConstructor(void)
+{
+ TestApplication application;
+
+ Test::TestCustomActor custom = Test::TestCustomActor::New();
+ DALI_TEST_CHECK( custom );
+ DALI_TEST_EQUALS( 1, custom.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ int id = custom.GetProperty< int >( Actor::Property::ID );
+
+ Test::TestCustomActor moved = std::move( custom );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !custom );
+
+ END_TEST;
+}
+
+int UtcDaliCustomActorMoveAssignment(void)
+{
+ TestApplication application;
+
+ Test::TestCustomActor custom = Test::TestCustomActor::New();
+ DALI_TEST_CHECK( custom );
+ DALI_TEST_EQUALS( 1, custom.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ int id = custom.GetProperty< int >( Actor::Property::ID );
+
+ Test::TestCustomActor moved;
+ moved = std::move( custom );
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( id, moved.GetProperty< int >( Actor::Property::ID ), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, moved.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !custom );
+
+ END_TEST;
+}
+
int UtcDaliCustomActorOnStageConnectionDisconnection(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliFrameBufferMoveConstructor(void)
+{
+ TestApplication application;
+
+ uint32_t width = 64;
+ uint32_t height = 64;
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::DEPTH_STENCIL );
+ DALI_TEST_CHECK( frameBuffer );
+ DALI_TEST_EQUALS( 1, frameBuffer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+ frameBuffer.AttachColorTexture( texture );
+ DALI_TEST_EQUALS( frameBuffer.GetColorTexture(), texture, TEST_LOCATION );
+
+ FrameBuffer move = std::move( frameBuffer );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetColorTexture(), texture, TEST_LOCATION );
+ DALI_TEST_CHECK( !frameBuffer );
+
+ END_TEST;
+}
+
+int UtcDaliFrameBufferMoveAssignment(void)
+{
+ TestApplication application;
+
+ uint32_t width = 64;
+ uint32_t height = 64;
+ FrameBuffer frameBuffer = FrameBuffer::New( width, height, FrameBuffer::Attachment::DEPTH_STENCIL );
+ DALI_TEST_CHECK( frameBuffer );
+ DALI_TEST_EQUALS( 1, frameBuffer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+ frameBuffer.AttachColorTexture( texture );
+ DALI_TEST_EQUALS( frameBuffer.GetColorTexture(), texture, TEST_LOCATION );
+
+ FrameBuffer move;
+ move = std::move( frameBuffer );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetColorTexture(), texture, TEST_LOCATION );
+ DALI_TEST_CHECK( !frameBuffer );
+
+ END_TEST;
+}
+
int UtcDaliFrameBufferDownCast01(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliGeometryMoveConstructor(void)
+{
+ TestApplication application;
+
+ Geometry geometry = Geometry::New();
+ DALI_TEST_CHECK( geometry );
+ DALI_TEST_EQUALS( 1, geometry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
+
+ PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
+ geometry.AddVertexBuffer( vertexBuffer );
+ DALI_TEST_EQUALS( 1u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
+
+ Geometry move = std::move( geometry );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1u, move.GetNumberOfVertexBuffers(), TEST_LOCATION );
+ DALI_TEST_CHECK( !geometry );
+
+ END_TEST;
+}
+
+int UtcDaliGeometryMoveAssignment(void)
+{
+ TestApplication application;
+
+ Geometry geometry = Geometry::New();
+ DALI_TEST_CHECK( geometry );
+ DALI_TEST_EQUALS( 1, geometry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
+
+ PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
+ geometry.AddVertexBuffer( vertexBuffer );
+ DALI_TEST_EQUALS( 1u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
+
+ Geometry move;
+ move = std::move( geometry );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1u, move.GetNumberOfVertexBuffers(), TEST_LOCATION );
+ DALI_TEST_CHECK( !geometry );
+
+ END_TEST;
+}
+
int UtcDaliGeometryDownCast01(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliHandleMoveConstructor(void)
+{
+ TestApplication application;
+
+ // Initialize a handle, ref count == 1
+ Handle handle = Actor::New();
+
+ DALI_TEST_EQUALS( 1, handle.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ int value( 20 );
+ Property::Index index = handle.RegisterProperty( "customProperty", value );
+ DALI_TEST_CHECK( handle.GetProperty<int>( index ) == value );
+
+ // Move the object, ref count == 1
+ Handle move = std::move( handle );
+ DALI_TEST_CHECK( move );
+
+ // Check that object is moved (not copied, so ref count keeps the same)
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( move.GetProperty<int>( index ) == value );
+ DALI_TEST_CHECK( !handle );
+
+ END_TEST;
+}
+
+int UtcDaliHandleMoveAssignment(void)
+{
+ TestApplication application;
+
+ // Initialize a handle, ref count == 1
+ Handle handle = Actor::New();
+
+ DALI_TEST_EQUALS( 1, handle.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ int value( 20 );
+ Property::Index index = handle.RegisterProperty( "customProperty", value );
+ DALI_TEST_CHECK( handle.GetProperty<int>( index ) == value );
+
+ // Move the object, ref count == 1
+ Handle move;
+ move = std::move( handle );
+ DALI_TEST_CHECK( move );
+
+ // Check that object is moved (not copied, so ref count keeps the same)
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( move.GetProperty<int>( index ) == value );
+ DALI_TEST_CHECK( !handle );
+
+ END_TEST;
+}
+
int UtcDaliHandleSupports(void)
{
tet_infoline("Positive Test Dali::Handle::Supports()");
END_TEST;
}
+int UtcDaliLayerMoveConstructor(void)
+{
+ TestApplication application;
+ Layer layer = Layer::New();
+ DALI_TEST_CHECK( layer );
+ DALI_TEST_EQUALS( 1, layer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0, layer.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+
+ application.GetScene().Add( layer );
+ DALI_TEST_EQUALS( 2, layer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, layer.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+
+ Layer move = std::move( layer );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, move.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+ DALI_TEST_CHECK( !layer );
+
+ END_TEST;
+}
+
+int UtcDaliLayerMoveAssignment(void)
+{
+ TestApplication application;
+ Layer layer = Layer::New();
+ DALI_TEST_CHECK( layer );
+ DALI_TEST_EQUALS( 1, layer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0, layer.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+
+ application.GetScene().Add( layer );
+ DALI_TEST_EQUALS( 2, layer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, layer.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+
+ Layer move;
+ move = std::move( layer );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, move.GetProperty< int >( Layer::Property::DEPTH ), TEST_LOCATION );
+ DALI_TEST_CHECK( !layer );
+
+ END_TEST;
+}
int UtcDaliLayerGetDepth(void)
{
/*
- * Copyright (c) 2014 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.
END_TEST;
}
+int UtcDaliObjectRegistryMoveConstructor(void)
+{
+ TestApplication application;
+
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
+ DALI_TEST_CHECK( registry );
+ DALI_TEST_EQUALS( 2, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ ObjectRegistry move = std::move( registry );
+ DALI_TEST_CHECK( move );
+
+ // Check that object is moved (not copied, so ref count keeps the same)
+ DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !registry );
+
+ END_TEST;
+}
+
+int UtcDaliObjectRegistryMoveAssignment(void)
+{
+ TestApplication application;
+
+ ObjectRegistry registry = application.GetCore().GetObjectRegistry();
+ DALI_TEST_CHECK( registry );
+ DALI_TEST_EQUALS( 2, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ ObjectRegistry move;
+ move = std::move( registry );
+ DALI_TEST_CHECK( move );
+
+ // Check that object is moved (not copied, so ref count keeps the same)
+ DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !registry );
+
+ END_TEST;
+}
+
int UtcDaliObjectRegistrySignalActorCreated(void)
{
tet_infoline("Testing GetObjectRegistry()");
/*
- * Copyright (c) 2018 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.
END_TEST;
}
+int UtcDaliPathMoveConstrcutor(void)
+{
+ TestApplication application;
+
+ Dali::Path path = Dali::Path::New();
+ DALI_TEST_CHECK( path );
+ DALI_TEST_EQUALS( 1, path.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ path.AddPoint(Vector3( 50.0, 50.0, 0.0));
+ DALI_TEST_EQUALS( path.GetPoint(0), Vector3( 50.0, 50.0, 0.0), TEST_LOCATION );
+
+ Dali::Path move = std::move( path );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetPoint(0), Vector3( 50.0, 50.0, 0.0), TEST_LOCATION );
+ DALI_TEST_CHECK( !path );
+
+ END_TEST;
+}
+
+int UtcDaliPathMoveAssignment(void)
+{
+ TestApplication application;
+
+ Dali::Path path = Dali::Path::New();
+ DALI_TEST_CHECK( path );
+ DALI_TEST_EQUALS( 1, path.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ path.AddPoint(Vector3( 50.0, 50.0, 0.0));
+ DALI_TEST_EQUALS( path.GetPoint(0), Vector3( 50.0, 50.0, 0.0), TEST_LOCATION );
+
+ Dali::Path move;
+ move = std::move( path );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetPoint(0), Vector3( 50.0, 50.0, 0.0), TEST_LOCATION );
+ DALI_TEST_CHECK( !path );
+
+ END_TEST;
+}
/*
- * 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.
END_TEST;
}
+int UtcDaliPixelDataMoveConstructor(void)
+{
+ TestApplication application;
+
+ unsigned int width = 10u;
+ unsigned int height = 10u;
+ unsigned int bufferSize = width*height*Pixel::GetBytesPerPixel( Pixel::L8 );
+ unsigned char* buffer = new unsigned char [ bufferSize ];
+
+ PixelData pixelData = PixelData::New( buffer, bufferSize, width, height, Pixel::L8, PixelData::DELETE_ARRAY );
+ DALI_TEST_CHECK( pixelData );
+ DALI_TEST_EQUALS( width, pixelData.GetWidth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( height, pixelData.GetHeight(), TEST_LOCATION );
+
+ PixelData moved = std::move( pixelData);
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( width, moved.GetWidth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( height, moved.GetHeight(), TEST_LOCATION );
+ DALI_TEST_CHECK( !pixelData );
+
+ END_TEST;
+}
+
+int UtcDaliPixelDataMoveAssignment(void)
+{
+ TestApplication application;
+
+ unsigned int width = 10u;
+ unsigned int height = 10u;
+ unsigned int bufferSize = width*height*Pixel::GetBytesPerPixel( Pixel::L8 );
+ unsigned char* buffer = new unsigned char [ bufferSize ];
+
+ PixelData pixelData = PixelData::New( buffer, bufferSize, width, height, Pixel::L8, PixelData::DELETE_ARRAY );
+ DALI_TEST_CHECK( pixelData );
+ DALI_TEST_EQUALS( width, pixelData.GetWidth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( height, pixelData.GetHeight(), TEST_LOCATION );
+
+ PixelData moved;
+ moved = std::move( pixelData);
+ DALI_TEST_CHECK( moved );
+ DALI_TEST_EQUALS( width, moved.GetWidth(), TEST_LOCATION );
+ DALI_TEST_EQUALS( height, moved.GetHeight(), TEST_LOCATION );
+ DALI_TEST_CHECK( !pixelData );
+
+ END_TEST;
+}
END_TEST;
}
+int UtcDaliPropertyBufferMoveConstructor(void)
+{
+ TestApplication application;
+
+ PropertyBuffer propertyBuffer = CreatePropertyBuffer();
+ DALI_TEST_CHECK( propertyBuffer );
+ DALI_TEST_EQUALS( 1, propertyBuffer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, propertyBuffer.GetSize(), TEST_LOCATION );
+
+ PropertyBuffer move = std::move( propertyBuffer );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, move.GetSize(), TEST_LOCATION );
+ DALI_TEST_CHECK( !propertyBuffer );
+
+ END_TEST;
+}
+
+int UtcDaliPropertyBufferMoveAssignment(void)
+{
+ TestApplication application;
+
+ PropertyBuffer propertyBuffer = CreatePropertyBuffer();
+ DALI_TEST_CHECK( propertyBuffer );
+ DALI_TEST_EQUALS( 1, propertyBuffer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, propertyBuffer.GetSize(), TEST_LOCATION );
+
+ PropertyBuffer move;
+ move = std::move( propertyBuffer );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, move.GetSize(), TEST_LOCATION );
+ DALI_TEST_CHECK( !propertyBuffer );
+
+ END_TEST;
+}
+
int UtcDaliPropertyBufferSetData01(void)
{
TestApplication application;
/*
- * Copyright (c) 2014 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.
END_TEST;
}
+int UtcDaliPropertyNotificationMoveConstructor(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+
+ PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::POSITION_X, GreaterThanCondition(100.0f));
+ DALI_TEST_CHECK( notification );
+ DALI_TEST_EQUALS( 2, notification.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ PropertyNotification movedNotification = std::move( notification );
+ DALI_TEST_CHECK( movedNotification );
+
+ // Check that object is moved (not copied, so ref count keeps the same)
+ DALI_TEST_EQUALS( 2, movedNotification.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !notification );
+
+ PropertyCondition condition = movedNotification.GetCondition();
+ DALI_TEST_CHECK( condition );
+ DALI_TEST_EQUALS( 2, condition.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, condition.GetArgumentCount(), TEST_LOCATION );
+
+ PropertyCondition movedCondition = std::move( condition );
+ DALI_TEST_CHECK( movedCondition );
+
+ // Check that object is moved (not copied, so ref count keeps the same)
+ DALI_TEST_EQUALS( 2, movedCondition.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, movedCondition.GetArgumentCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !condition );
+
+ END_TEST;
+}
+
+int UtcDaliPropertyNotificationMoveAssignment(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+
+ PropertyNotification notification = actor.AddPropertyNotification(Actor::Property::POSITION_X, GreaterThanCondition(100.0f));
+ DALI_TEST_CHECK( notification );
+ DALI_TEST_EQUALS( 2, notification.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ PropertyNotification movedNotification;
+ movedNotification = std::move( notification );
+ DALI_TEST_CHECK( movedNotification );
+
+ // Check that object is moved (not copied, so ref count keeps the same)
+ DALI_TEST_EQUALS( 2, movedNotification.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !notification );
+
+ PropertyCondition condition = movedNotification.GetCondition();
+ DALI_TEST_CHECK( condition );
+ DALI_TEST_EQUALS( 2, condition.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, condition.GetArgumentCount(), TEST_LOCATION );
+
+ PropertyCondition movedCondition;
+ movedCondition = std::move( condition );
+ DALI_TEST_CHECK( movedCondition );
+
+ // Check that object is moved (not copied, so ref count keeps the same)
+ DALI_TEST_EQUALS( 2, movedCondition.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 1, movedCondition.GetArgumentCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !condition );
+
+ END_TEST;
+}
+
int UtcDaliAddPropertyNotification(void)
{
TestApplication application; // Reset all test adapter return codes
END_TEST;
}
+
+int UtcDaliRenderTaskMoveConstrctor(void)
+{
+ TestApplication application;
+
+ Vector4 testColor( 1.0f, 2.0f, 3.0f, 4.0f );
+
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
+ RenderTask task = taskList.GetTask( 0u );
+ DALI_TEST_CHECK( task );
+ DALI_TEST_EQUALS( 2, task.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( task.GetClearColor() != testColor );
+
+ task.SetClearColor( testColor );
+
+ // Wait a frame.
+ Wait(application);
+
+ DALI_TEST_EQUALS( task.GetClearColor(), testColor, TEST_LOCATION );
+
+ RenderTask move = std::move( task );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetClearColor(), testColor, TEST_LOCATION );
+ DALI_TEST_CHECK( !task );
+
+ END_TEST;
+}
+
+int UtcDaliRenderTaskMoveAssignment(void)
+{
+ TestApplication application;
+
+ Vector4 testColor( 1.0f, 2.0f, 3.0f, 4.0f );
+
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
+ RenderTask task = taskList.GetTask( 0u );
+ DALI_TEST_CHECK( task );
+ DALI_TEST_EQUALS( 2, task.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( task.GetClearColor() != testColor );
+
+ task.SetClearColor( testColor );
+
+ // Wait a frame.
+ Wait(application);
+
+ DALI_TEST_EQUALS( task.GetClearColor(), testColor, TEST_LOCATION );
+
+ RenderTask move;
+ move = std::move( task );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetClearColor(), testColor, TEST_LOCATION );
+ DALI_TEST_CHECK( !task );
+
+ END_TEST;
+}
END_TEST;
}
+int UtcDaliRenderTaskListMoveConstructor(void)
+{
+ TestApplication application;
+
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
+ DALI_TEST_CHECK( taskList );
+ DALI_TEST_EQUALS( 2, taskList.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
+
+ RenderTaskList move = std::move( taskList );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( 1u == move.GetTaskCount() );
+ DALI_TEST_CHECK( !taskList );
+
+ END_TEST;
+}
+
+int UtcDaliRenderTaskListMoveAssignment(void)
+{
+ TestApplication application;
+
+ RenderTaskList taskList = application.GetScene().GetRenderTaskList();
+ DALI_TEST_CHECK( taskList );
+ DALI_TEST_EQUALS( 2, taskList.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( 1u == taskList.GetTaskCount() );
+
+ RenderTaskList move;
+ move = std::move( taskList );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 2, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( 1u == move.GetTaskCount() );
+ DALI_TEST_CHECK( !taskList );
+
+ END_TEST;
+}
int UtcDaliRenderTaskListDownCast(void)
{
END_TEST;
}
+int UtcDaliRendererMoveConstructor(void)
+{
+ TestApplication application;
+
+ Geometry geometry = CreateQuadGeometry();
+ Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
+ Renderer renderer = Renderer::New( geometry, shader );
+ DALI_TEST_CHECK( renderer );
+ DALI_TEST_EQUALS( 1, renderer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::TRANSPARENT, TEST_LOCATION );
+
+ renderer.SetProperty( Renderer::Property::BLEND_COLOR, Color::MAGENTA );
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+
+ Renderer move = std::move( renderer );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+ DALI_TEST_CHECK( !renderer );
+
+ END_TEST;
+}
+
+int UtcDaliRendererMoveAssignment(void)
+{
+ TestApplication application;
+
+ Geometry geometry = CreateQuadGeometry();
+ Shader shader = Shader::New( "vertexSrc", "fragmentSrc" );
+ Renderer renderer = Renderer::New( geometry, shader );
+ DALI_TEST_CHECK( renderer );
+ DALI_TEST_EQUALS( 1, renderer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::TRANSPARENT, TEST_LOCATION );
+
+ renderer.SetProperty( Renderer::Property::BLEND_COLOR, Color::MAGENTA );
+ application.SendNotification();
+ application.Render();
+ DALI_TEST_EQUALS( renderer.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+
+ Renderer move;
+ move = std::move( renderer );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetProperty<Vector4>( Renderer::Property::BLEND_COLOR ), Color::MAGENTA, TEST_LOCATION );
+ DALI_TEST_CHECK( !renderer );
+
+ END_TEST;
+}
+
int UtcDaliRendererDownCast01(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliSamplerMoveConstructor(void)
+{
+ TestApplication application;
+
+ Sampler sampler = Sampler::New();
+ DALI_TEST_CHECK( sampler );
+ DALI_TEST_EQUALS( 1, sampler.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ Sampler move = std::move( sampler );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !sampler );
+
+ END_TEST;
+}
+
+int UtcDaliSamplerMoveAssignment(void)
+{
+ TestApplication application;
+
+ Sampler sampler = Sampler::New();
+ DALI_TEST_CHECK( sampler );
+ DALI_TEST_EQUALS( 1, sampler.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ Sampler move;
+ move = std::move( sampler );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( !sampler );
+
+ END_TEST;
+}
+
int UtcDaliSamplerDownCast01(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliShaderMoveConstructor(void)
+{
+ TestApplication application;
+
+ Shader shader = Shader::New(VertexSource, FragmentSource);
+ DALI_TEST_CHECK( shader );
+ DALI_TEST_EQUALS( 1, shader.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ // Register a custom property
+ Vector2 vec( 1.0f, 2.0f );
+ Property::Index customIndex = shader.RegisterProperty( "custom", vec );
+ DALI_TEST_EQUALS( shader.GetProperty<Vector2>( customIndex ), vec, TEST_LOCATION );
+
+ Shader move = std::move( shader );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetProperty<Vector2>( customIndex ), vec, TEST_LOCATION );
+ DALI_TEST_CHECK( !shader );
+
+ END_TEST;
+}
+
+int UtcDaliShaderMoveAssignment(void)
+{
+ TestApplication application;
+
+ Shader shader = Shader::New(VertexSource, FragmentSource);
+ DALI_TEST_CHECK( shader );
+ DALI_TEST_EQUALS( 1, shader.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ // Register a custom property
+ Vector2 vec( 1.0f, 2.0f );
+ Property::Index customIndex = shader.RegisterProperty( "custom", vec );
+ DALI_TEST_EQUALS( shader.GetProperty<Vector2>( customIndex ), vec, TEST_LOCATION );
+
+ Shader move;
+ move = std::move( shader );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetProperty<Vector2>( customIndex ), vec, TEST_LOCATION );
+ DALI_TEST_CHECK( !shader );
+
+ END_TEST;
+}
+
int UtcDaliShaderDownCast01(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliTextureMoveConstructor(void)
+{
+ TestApplication application;
+
+ uint32_t width = 64;
+ uint32_t height = 64;
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+ DALI_TEST_CHECK( texture );
+ DALI_TEST_EQUALS( 1, texture.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( texture.GetWidth(), width, TEST_LOCATION );
+ DALI_TEST_EQUALS( texture.GetHeight(), height, TEST_LOCATION );
+
+ Texture move = std::move( texture );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetWidth(), width, TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetHeight(), height, TEST_LOCATION );
+ DALI_TEST_CHECK( !texture );
+
+ END_TEST;
+}
+
+int UtcDaliTextureMoveAssignment(void)
+{
+ TestApplication application;
+
+ uint32_t width = 64;
+ uint32_t height = 64;
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, width, height );
+ DALI_TEST_CHECK( texture );
+ DALI_TEST_EQUALS( 1, texture.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( texture.GetWidth(), width, TEST_LOCATION );
+ DALI_TEST_EQUALS( texture.GetHeight(), height, TEST_LOCATION );
+
+ Texture move;
+ move = std::move( texture );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetWidth(), width, TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetHeight(), height, TEST_LOCATION );
+ DALI_TEST_CHECK( !texture );
+
+ END_TEST;
+}
+
int UtcDaliTextureDownCast01(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliTextureSetMoveConstructor(void)
+{
+ TestApplication application;
+
+ TextureSet textureSet = TextureSet::New();
+ DALI_TEST_CHECK( textureSet );
+ DALI_TEST_EQUALS( 1, textureSet.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 32, 32 );
+ textureSet.SetTexture( 0u, texture );
+ DALI_TEST_EQUALS( textureSet.GetTexture( 0u ), texture, TEST_LOCATION );
+
+ TextureSet move = std::move( textureSet );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetTexture( 0u ), texture, TEST_LOCATION );
+ DALI_TEST_CHECK( !textureSet );
+
+ END_TEST;
+}
+
+int UtcDaliTextureSetMoveAssignment(void)
+{
+ TestApplication application;
+
+ TextureSet textureSet = TextureSet::New();
+ DALI_TEST_CHECK( textureSet );
+ DALI_TEST_EQUALS( 1, textureSet.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+
+ Texture texture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, 32, 32 );
+ textureSet.SetTexture( 0u, texture );
+ DALI_TEST_EQUALS( textureSet.GetTexture( 0u ), texture, TEST_LOCATION );
+
+ TextureSet move;
+ move = std::move( textureSet );
+ DALI_TEST_CHECK( move );
+ DALI_TEST_EQUALS( 1, move.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( move.GetTexture( 0u ), texture, TEST_LOCATION );
+ DALI_TEST_CHECK( !textureSet );
+
+ END_TEST;
+}
+
int UtcDaliTextureSetDownCast01(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliTypeRegistryMoveConstructor(void)
+{
+ TestApplication application;
+
+ TypeRegistry registry = TypeRegistry::Get();
+ DALI_TEST_CHECK( registry );
+ DALI_TEST_EQUALS( 16, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( registry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+
+ TypeRegistry movedRegistry = std::move( registry );
+ DALI_TEST_CHECK( movedRegistry );
+ DALI_TEST_EQUALS( 16, movedRegistry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( movedRegistry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+ DALI_TEST_CHECK( !registry );
+
+ Dali::TypeInfo info = movedRegistry.GetTypeInfo( "Actor" );
+ DALI_TEST_CHECK( info );
+ DALI_TEST_EQUALS( 2, info.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( info.GetName() == "Actor" );
+
+ Dali::TypeInfo movedInfo = std::move( info );
+ DALI_TEST_CHECK( movedInfo );
+ DALI_TEST_EQUALS( 2, movedInfo.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( movedInfo.GetName() == "Actor" );
+ DALI_TEST_CHECK( !info );
+
+ END_TEST;
+}
+
+int UtcDaliTypeRegistryMoveAssignment(void)
+{
+ TestApplication application;
+
+ TypeRegistry registry = TypeRegistry::Get();
+ DALI_TEST_CHECK( registry );
+ DALI_TEST_EQUALS( 16, registry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( registry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+
+ TypeRegistry movedRegistry;
+ movedRegistry = std::move( registry );
+ DALI_TEST_CHECK( movedRegistry );
+ DALI_TEST_EQUALS( 16, movedRegistry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( movedRegistry.GetTypeInfo( "Actor" ).GetName() == "Actor" );
+ DALI_TEST_CHECK( !registry );
+
+ Dali::TypeInfo info = movedRegistry.GetTypeInfo( "Actor" );
+ DALI_TEST_CHECK( info );
+ DALI_TEST_EQUALS( 2, info.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( info.GetName() == "Actor" );
+
+ Dali::TypeInfo movedInfo;
+ movedInfo = std::move( info );
+ DALI_TEST_CHECK( movedInfo );
+ DALI_TEST_EQUALS( 2, movedInfo.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_CHECK( movedInfo.GetName() == "Actor" );
+ DALI_TEST_CHECK( !info );
+
+ END_TEST;
+}
+
int UtcDaliTypeRegistryAssignP(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliWeakHandleBaseMoveConstructor(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+ WeakHandleBase object( actor );
+ DALI_TEST_CHECK( object.GetBaseHandle() == actor);
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+ WeakHandleBase move = std::move( object );
+ DALI_TEST_CHECK(move.GetBaseHandle() == actor );
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+ DALI_TEST_CHECK( !object.GetBaseHandle() ); // object moved
+
+ END_TEST;
+}
+
+int UtcDaliWeakHandleBaseMoveAssignment(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+ WeakHandleBase object( actor );
+ DALI_TEST_CHECK( object.GetBaseHandle() == actor);
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+ WeakHandleBase move;
+ move = std::move( object );
+ DALI_TEST_CHECK(move.GetBaseHandle() == actor );
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+ DALI_TEST_CHECK( !object.GetBaseHandle() ); // object moved
+
+ END_TEST;
+}
+
int UtcDaliWeakHandleBaseEqualityOperatorP(void)
{
TestApplication application;
END_TEST;
}
+int UtcDaliWeakHandleMoveConstructor(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+ WeakHandle<Actor> object( actor );
+ DALI_TEST_CHECK( object.GetHandle() == actor );
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+ WeakHandle<Actor> move = std::move( object );
+ DALI_TEST_CHECK( move.GetHandle() == actor );
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+ DALI_TEST_CHECK( !object.GetHandle() ); // object moved
+
+ END_TEST;
+}
+
+int UtcDaliWeakHandleMoveAssignment(void)
+{
+ TestApplication application;
+
+ Actor actor = Actor::New();
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+ WeakHandle<Actor> object( actor );
+ DALI_TEST_CHECK( object.GetHandle() == actor );
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+
+ WeakHandle<Actor> move;
+ move = std::move( object );
+ DALI_TEST_CHECK( move.GetHandle() == actor );
+ DALI_TEST_EQUALS( 1, actor.GetBaseObject().ReferenceCount(), TEST_LOCATION ); // reference count of the actor is not increased
+ DALI_TEST_CHECK( !object.GetHandle() ); // object moved
+
+ END_TEST;
+}
return *this;
}
+Actor::Actor( Actor&& rhs ) = default;
+
+Actor& Actor::operator=( Actor&& rhs ) = default;
+
Layer Actor::GetLayer()
{
return GetImplementation(*this).GetLayer();
*/
Actor& operator=(const Actor& rhs);
+ /**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the actor to move
+ */
+ Actor( Actor&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the actor to move
+ * @return A reference to this
+ */
+ Actor& operator=( Actor&& rhs );
+
// Containment
/**
/*
- * Copyright (c) 2015 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.
return *this;
}
+CustomActor::CustomActor( CustomActor&& rhs ) = default;
+
+CustomActor& CustomActor::operator=( CustomActor&& rhs ) = default;
+
CustomActorImpl& CustomActor::GetImplementation()
{
Internal::CustomActor& internal = GetImpl(*this);
#define DALI_CUSTOM_ACTOR_H
/*
- * Copyright (c) 2019 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.
*/
CustomActor& operator=(const CustomActor& rhs);
+ /**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs The actor to move
+ */
+ CustomActor( CustomActor&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs The actor to move
+ * @return A reference to this
+ */
+ CustomActor& operator=( CustomActor&& rhs );
+
public: // Not intended for application developers
/**
return *this;
}
+Layer::Layer( Layer&& rhs ) = default;
+
+Layer& Layer::operator=( Layer&& rhs ) = default;
+
void Layer::Raise()
{
GetImplementation(*this).Raise();
Layer& operator=(const Layer& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs The layer to move
+ */
+ Layer( Layer&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs The layer to move
+ * @return A reference to this
+ */
+ Layer& operator=( Layer&& rhs );
+
+ /**
* @brief Increments the depth of the layer.
*
* @SINCE_1_0.0
/*
- * Copyright (c) 2018 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.
return *this;
}
+Animation::Animation( Animation&& rhs ) = default;
+
+Animation& Animation::operator=( Animation&& rhs ) = default;
+
void Animation::SetDuration(float durationSeconds)
{
GetImplementation(*this).SetDuration(durationSeconds);
#define DALI_ANIMATION_H
/*
- * Copyright (c) 2018 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.
Animation& operator=(const Animation& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ Animation( Animation&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ Animation& operator=( Animation&& rhs );
+
+ /**
* @brief Sets the duration of an animation.
*
* @SINCE_1_0.0
/*
- * Copyright (c) 2018 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.
return *this;
}
+Constraint::Constraint( Constraint&& rhs ) = default;
+
+Constraint& Constraint::operator=( Constraint&& rhs ) = default;
+
Constraint Constraint::DownCast( BaseHandle baseHandle )
{
return Constraint( dynamic_cast< Dali::Internal::ConstraintBase* >( baseHandle.GetObjectPtr() ) );
#define DALI_CONSTRAINT_H
/*
- * Copyright (c) 2019 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.
Constraint& operator=( const Constraint& rhs );
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ Constraint( Constraint&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ Constraint& operator=( Constraint&& rhs );
+
+ /**
* @brief Downcasts a handle to Constraint handle.
*
* If handle points to a Constraint object, the downcast produces valid handle.
/*
- * Copyright (c) 2015 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.
return *this;
}
+KeyFrames::KeyFrames( KeyFrames&& rhs ) = default;
+
+KeyFrames& KeyFrames::operator=( KeyFrames&& rhs ) = default;
+
Property::Type KeyFrames::GetType() const
{
return GetImplementation(*this).GetType();
#define DALI_KEY_FRAMES_H
/*
- * Copyright (c) 2019 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.
KeyFrames& operator=(const KeyFrames& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ KeyFrames( KeyFrames&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ KeyFrames& operator=( KeyFrames&& rhs );
+
+ /**
* @brief Gets the type of the key frame.
*
* If no key frames have been added, this returns Property::NONE.
/*
- * Copyright (c) 2015 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.
return *this;
}
+LinearConstrainer::LinearConstrainer( LinearConstrainer&& rhs ) = default;
+
+LinearConstrainer& LinearConstrainer::operator=( LinearConstrainer&& rhs ) = default;
+
void LinearConstrainer::Apply( Dali::Property target, Dali::Property source, const Vector2& range, const Vector2& wrap )
{
GetImplementation(*this).Apply( target, source, range, wrap );
#define DALI_LINEAR_CONSTRAINER_H
/*
- * Copyright (c) 2019 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.
LinearConstrainer& operator=(const LinearConstrainer& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ LinearConstrainer( LinearConstrainer&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ LinearConstrainer& operator=( LinearConstrainer&& rhs );
+
+ /**
* @brief Applies the linear constraint to the target property.
*
* @SINCE_1_0.0
/*
- * Copyright (c) 2018 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.
return *this;
}
+Path::Path( Path&& rhs ) = default;
+
+Path& Path::operator=( Path&& rhs ) = default;
+
void Path::AddPoint(const Vector3& point )
{
GetImplementation(*this).AddPoint( point );
#define DALI_PATH_H
/*
- * Copyright (c) 2019 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.
Path& operator=(const Path& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ Path( Path&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ Path& operator=( Path&& rhs );
+
+ /**
* @brief Adds an interpolation point.
*
* @SINCE_1_0.0
/*
- * Copyright (c) 2018 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.
return *this;
}
+PixelData::PixelData( PixelData&& rhs ) = default;
+
+PixelData& PixelData::operator=( PixelData&& rhs ) = default;
+
uint32_t PixelData::GetWidth() const
{
return GetImplementation(*this).GetWidth();
#define DALI_PIXEL_DATA_H
/*
- * Copyright (c) 2018 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.
PixelData& operator=(const PixelData& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ PixelData( PixelData&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ PixelData& operator=( PixelData&& rhs );
+
+ /**
* @brief Gets the width of the buffer in pixels.
*
* @SINCE_1_1.43
/*
- * Copyright (c) 2015 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.
return *this;
}
+BaseHandle::BaseHandle( BaseHandle&& rhs )
+: mObjectHandle( rhs.mObjectHandle )
+{
+ rhs.mObjectHandle = nullptr;
+}
+
+BaseHandle& BaseHandle::operator=( BaseHandle&& rhs )
+{
+ if (this != &rhs)
+ {
+ mObjectHandle = rhs.mObjectHandle;
+ rhs.mObjectHandle = nullptr;
+ }
+
+ return *this;
+}
+
bool BaseHandle::DoAction(const std::string& command, const Property::Map& attributes)
{
return GetImplementation(*this).DoAction( command, attributes );
#define DALI_BASE_HANDLE_H
/*
- * Copyright (c) 2019 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.
BaseHandle& operator=(const BaseHandle& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ BaseHandle( BaseHandle&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ BaseHandle& operator=( BaseHandle&& rhs );
+
+ /**
* @brief Connects a void() functor to a specified signal.
*
* @SINCE_1_0.0
/*
- * Copyright (c) 2018 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.
return *this;
}
+Handle::Handle( Handle&& rhs ) = default;
+
+Handle& Handle::operator=( Handle&& rhs ) = default;
+
Handle Handle::DownCast( BaseHandle handle )
{
return Handle( dynamic_cast<Dali::Internal::Object*>(handle.GetObjectPtr()) );
}
-
bool Handle::Supports( Capability capability ) const
{
return GetImplementation(*this).Supports( capability );
#define DALI_HANDLE_H
/*
- * Copyright (c) 2019 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.
Handle& operator=( const Handle& rhs );
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ Handle( Handle&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ Handle& operator=( Handle&& rhs );
+
+ /**
* @brief Downcasts to a handle.
*
* If not, the returned handle is left uninitialized.
/*
- * Copyright (c) 2015 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.
return *this;
}
+ObjectRegistry::ObjectRegistry( ObjectRegistry&& rhs ) = default;
+
+ObjectRegistry& ObjectRegistry::operator=( ObjectRegistry&& rhs ) = default;
+
ObjectRegistry::ObjectCreatedSignalType& ObjectRegistry::ObjectCreatedSignal()
{
return GetImplementation(*this).ObjectCreatedSignal();
#define DALI_OBJECT_REGISTRY_H
/*
- * Copyright (c) 2019 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.
*/
ObjectRegistry& operator=(const ObjectRegistry& rhs);
+ /**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ ObjectRegistry( ObjectRegistry&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ ObjectRegistry& operator=( ObjectRegistry&& rhs );
+
public: // Signals
/**
/*
- * Copyright (c) 2015 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.
return *this;
}
+PropertyCondition::PropertyCondition( PropertyCondition&& rhs ) = default;
+
+PropertyCondition& PropertyCondition::operator=( PropertyCondition&& rhs ) = default;
+
std::size_t PropertyCondition::GetArgumentCount() const
{
return GetImplementation(*this).arguments.Count();
#define DALI_PROPERTY_CONDITIONS_H
/*
- * Copyright (c) 2019 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.
*/
PropertyCondition& operator=( const PropertyCondition& rhs );
+ /**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ PropertyCondition( PropertyCondition&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ PropertyCondition& operator=( PropertyCondition&& rhs );
+
public:
/**
/*
- * Copyright (c) 2015 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.
return *this;
}
+PropertyNotification::PropertyNotification( PropertyNotification&& rhs ) = default;
+
+PropertyNotification& PropertyNotification::operator=( PropertyNotification&& rhs ) = default;
+
PropertyCondition PropertyNotification::GetCondition()
{
return GetImplementation(*this).GetCondition();
#define DALI_PROPERTY_NOTIFICATION_H
/*
- * Copyright (c) 2019 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.
PropertyNotification& operator=(const PropertyNotification& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ PropertyNotification( PropertyNotification&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ PropertyNotification& operator=( PropertyNotification&& rhs );
+
+ /**
* @brief Gets the condition of this notification.
*
* @SINCE_1_0.0
/*
- * Copyright (c) 2018 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.
return *this;
}
+TypeInfo::TypeInfo( TypeInfo&& rhs ) = default;
+
+TypeInfo& TypeInfo::operator=( TypeInfo&& rhs ) = default;
+
const std::string& TypeInfo::GetName() const
{
return GetImplementation(*this).GetName();
#define DALI_TYPE_INFO_H
/*
- * Copyright (c) 2019 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.
TypeInfo& operator=(const TypeInfo& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ TypeInfo( TypeInfo&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ TypeInfo& operator=( TypeInfo&& rhs );
+
+ /**
* @brief Retrieves the type name for this type.
*
* @SINCE_1_0.0
/*
- * Copyright (c) 2018 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.
return *this;
}
+TypeRegistry::TypeRegistry( TypeRegistry&& rhs ) = default;
+
+TypeRegistry& TypeRegistry::operator=( TypeRegistry&& rhs ) = default;
+
TypeRegistry TypeRegistry::Get()
{
return TypeRegistry(Internal::TypeRegistry::Get());
#define DALI_TYPE_REGISTRY_H
/*
- * Copyright (c) 2019 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.
TypeRegistry& operator=(const TypeRegistry& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ TypeRegistry( TypeRegistry&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ TypeRegistry& operator=( TypeRegistry&& rhs );
+
+ /**
* @brief Gets TypeInfo for a registered type.
*
* @SINCE_1_0.0
return *this;
}
+WeakHandleBase::WeakHandleBase( WeakHandleBase&& rhs )
+: mImpl( rhs.mImpl )
+{
+ rhs.mImpl = nullptr;
+}
+
+WeakHandleBase& WeakHandleBase::operator=( WeakHandleBase&& rhs )
+{
+ if (this != &rhs)
+ {
+ mImpl = rhs.mImpl;
+ rhs.mImpl = nullptr;
+ }
+
+ return *this;
+}
+
bool WeakHandleBase::operator==( const WeakHandleBase& rhs ) const
{
return this->mImpl->mObject == rhs.mImpl->mObject;
BaseHandle WeakHandleBase::GetBaseHandle() const
{
- return BaseHandle( mImpl->mObject );
+ return mImpl ? BaseHandle( mImpl->mObject ) : BaseHandle();
}
void WeakHandleBase::Reset()
WeakHandleBase& operator=( const WeakHandleBase& rhs );
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ WeakHandleBase( WeakHandleBase&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ WeakHandleBase& operator=( WeakHandleBase&& rhs );
+
+ /**
* @brief Equality operator overload.
*
* @SINCE_1_2.60
}
/**
- * @copydoc Dali::WeakHandleBase::operator=()
+ * @copydoc Dali::WeakHandleBase::operator=(const WeakHandleBase& rhs)
*/
WeakHandle& operator=( const WeakHandle& rhs )
{
}
/**
+ * @copydoc Dali::WeakHandleBase::WeakHandleBase(WeakHandleBase&& rhs)
+ */
+ WeakHandle( WeakHandle&& rhs ) = default;
+
+ /**
+ * @copydoc Dali::WeakHandleBase::operator=(WeakHandleBase&& rhs)
+ */
+ WeakHandle& operator=( WeakHandle&& rhs ) = default;
+
+ /**
* @copydoc Dali::WeakHandleBase::operator==()
*/
bool operator==(const WeakHandle& rhs) const
/*
- * Copyright (c) 2018 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.
return *this;
}
+RenderTaskList::RenderTaskList( RenderTaskList&& rhs ) = default;
+
+RenderTaskList& RenderTaskList::operator=( RenderTaskList&& rhs ) = default;
+
RenderTask RenderTaskList::CreateTask()
{
return RenderTask( GetImplementation(*this).CreateTask().Get() );
#define DALI_RENDER_TASK_LIST_H
/*
- * Copyright (c) 2019 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.
RenderTaskList& operator=(const RenderTaskList& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ RenderTaskList( RenderTaskList&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ RenderTaskList& operator=( RenderTaskList&& rhs );
+
+ /**
* @brief Creates a new RenderTask.
*
* This will be appended to the list of render-tasks.
return *this;
}
+RenderTask::RenderTask( RenderTask&& rhs ) = default;
+
+RenderTask& RenderTask::operator=( RenderTask&& rhs ) = default;
+
void RenderTask::SetSourceActor( Actor actor )
{
// NULL handle is allowed
RenderTask& operator=(const RenderTask& rhs);
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ RenderTask( RenderTask&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ RenderTask& operator=( RenderTask&& rhs );
+
+ /**
* @brief Sets the actors to be rendered.
* @SINCE_1_0.0
* @param[in] actor This actor and its children will be rendered.
{
}
+FrameBuffer::FrameBuffer( FrameBuffer&& rhs ) = default;
+
+FrameBuffer& FrameBuffer::operator=( FrameBuffer&& rhs ) = default;
+
void FrameBuffer::AttachColorTexture( Texture& texture )
{
AttachColorTexture( texture, 0u, 0u );
FrameBuffer& operator=( const FrameBuffer& handle );
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ FrameBuffer( FrameBuffer&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ FrameBuffer& operator=( FrameBuffer&& rhs );
+
+ /**
* @brief Attach the base LOD of a 2D texture to the framebuffer for color rendering.
* @note This causes a color attachment to be added.
* @note Repeated calls to this method add textures as subsequent color attachments.
/*
- * Copyright (c) 2018 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.
return *this;
}
+Geometry::Geometry( Geometry&& rhs ) = default;
+
+Geometry& Geometry::operator=( Geometry&& rhs ) = default;
+
std::size_t Geometry::AddVertexBuffer( PropertyBuffer& vertexBuffer )
{
DALI_ASSERT_ALWAYS( vertexBuffer && "VertexBuffer is not initialized ");
#define DALI_GEOMETRY_H
/*
- * Copyright (c) 2018 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.
Geometry& operator=( const Geometry& handle );
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ Geometry( Geometry&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ Geometry& operator=( Geometry&& rhs );
+
+ /**
* @brief Adds a PropertyBuffer to be used as source of geometry vertices.
*
* @SINCE_1_1.43
/*
- * 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.
return *this;
}
+PropertyBuffer::PropertyBuffer( PropertyBuffer&& rhs ) = default;
+
+PropertyBuffer& PropertyBuffer::operator=( PropertyBuffer&& rhs ) = default;
+
void PropertyBuffer::SetData( const void* data, std::size_t size )
{
GetImplementation(*this).SetData( data, static_cast<uint32_t>( size ) ); // only support 4,294,967,295 bytes
#define DALI_PROPERTY_BUFFER_H
/*
- * Copyright (c) 2018 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.
PropertyBuffer& operator=( const PropertyBuffer& handle );
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ PropertyBuffer( PropertyBuffer&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ PropertyBuffer& operator=( PropertyBuffer&& rhs );
+
+ /**
* @brief Updates the whole buffer information.
*
* This function expects a pointer to an array of structures with the same
/*
- * 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.
return *this;
}
+Renderer::Renderer( Renderer&& rhs ) = default;
+
+Renderer& Renderer::operator=( Renderer&& rhs ) = default;
+
void Renderer::SetGeometry( Geometry& geometry )
{
DALI_ASSERT_ALWAYS( geometry && "Geometry handle not initialized" );
#define DALI_RENDERER_H
/*
- * Copyright (c) 2018 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.
Renderer& operator=( const Renderer& handle );
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ Renderer( Renderer&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ Renderer& operator=( Renderer&& rhs );
+
+ /**
* @brief Sets the geometry to be used by this renderer.
*
* @SINCE_1_1.43
/*
- * 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.
return *this;
}
+Sampler::Sampler( Sampler&& rhs ) = default;
+
+Sampler& Sampler::operator=( Sampler&& rhs ) = default;
void Sampler::SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter )
{
#define DALI_SAMPLER_H
/*
- * Copyright (c) 2018 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.
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ Sampler( Sampler&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ Sampler& operator=( Sampler&& rhs );
+
+ /**
* @brief Sets the filter modes for this sampler.
* Calling this function sets the properties MINIFICATION_FILTER and MAGNIFICATION_FILTER.
*
/*
- * 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.
return *this;
}
+Shader::Shader( Shader&& rhs ) = default;
+
+Shader& Shader::operator=( Shader&& rhs ) = default;
+
Shader::Shader( Internal::Shader* pointer )
: Handle( pointer )
{
#define DALI_SHADER_H
/*
- * Copyright (c) 2018 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.
*/
Shader& operator=( const Shader& handle );
+ /**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ Shader( Shader&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ Shader& operator=( Shader&& rhs );
+
public:
/**
/*
- * 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.
return *this;
}
+TextureSet::TextureSet( TextureSet&& rhs ) = default;
+
+TextureSet& TextureSet::operator=( TextureSet&& rhs ) = default;
+
void TextureSet::SetTexture( size_t index, Texture texture )
{
if( texture )
#define DALI_TEXTURE_SET_H
/*
- * Copyright (c) 2018 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.
TextureSet& operator=( const TextureSet& handle );
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ TextureSet( TextureSet&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ TextureSet& operator=( TextureSet&& rhs );
+
+ /**
* @brief Sets the texture at position "index".
*
* @SINCE_1_1.43
/*
- * Copyright (c) 2018 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.
return *this;
}
+Texture::Texture( Texture&& rhs ) = default;
+
+Texture& Texture::operator=( Texture&& rhs ) = default;
+
bool Texture::Upload( PixelData pixelData )
{
Internal::PixelData& internalPixelData = GetImplementation( pixelData );
#define DALI_TEXTURE_H
/*
- * Copyright (c) 2018 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.
Texture& operator=( const Texture& handle );
/**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ */
+ Texture( Texture&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.22
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this handle
+ */
+ Texture& operator=( Texture&& rhs );
+
+ /**
* @brief Uploads data to the texture from a PixelData object.
*
* @SINCE_1_1.43