-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.8.2)
PROJECT(tct_coreapi_utc)
+SET(CMAKE_CXX_STANDARD 17)
INCLUDE(FindPkgConfig)
SET(BIN_DIR "/opt/usr/bin")
utc-Dali-PixelData.cpp
utc-Dali-Processors.cpp
utc-Dali-PropertyArray.cpp
- utc-Dali-PropertyBuffer.cpp
utc-Dali-PropertyMap.cpp
utc-Dali-PropertyNotification.cpp
utc-Dali-PropertyTypes.cpp
utc-Dali-Vector2.cpp
utc-Dali-Vector3.cpp
utc-Dali-Vector4.cpp
+ utc-Dali-VertexBuffer.cpp
utc-Dali-WeakHandle.cpp
utc-Dali-WheelEvent.cpp
)
dali2-core
)
+ADD_COMPILE_OPTIONS( -rdynamic )
ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror )
ADD_COMPILE_OPTIONS( ${${CAPI_LIB}_CFLAGS_OTHER} )
ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
TARGET_LINK_LIBRARIES(${EXEC_NAME}
${${CAPI_LIB}_LIBRARIES}
- -lpthread -ldl --coverage
+ -lpthread -ldl --coverage -rdynamic
)
# Path to installed precompiled addons
#define END_TEST \
return ((test_return_value>0)?1:0)
+extern "C"
+{
void tet_infoline(const char* str)
{
vfprintf(stderr, format, arg);
va_end(arg);
}
+}
+
bool operator==(TimePeriod a, TimePeriod b)
{
#include <dali/public-api/dali-core.h>
#include <test-compare-types.h>
+extern "C"
+{
void tet_infoline(const char*str);
void tet_printf(const char *format, ...);
+}
#include "test-application.h"
#include "test-actor-utils.h"
void DALI_TEST_EQUALS( const char* str1, const std::string &str2, const char* location);
/**
+ * Test if a property value type is equal to a trivial type.
+ */
+template<typename Type>
+inline void DALI_TEST_VALUE_EQUALS( Property::Value&& value1, Type value2, float epsilon, const char* location)
+{
+ Property::Value value2b(value2);
+ DALI_TEST_EQUALS(value1, value2b, epsilon, location);
+}
+
+
+/**
* Test whether one unsigned integer value is greater than another.
* Test succeeds if value1 > value2
* @param[in] value1 The first value
return textureSet;
}
-PropertyBuffer CreatePropertyBuffer()
+VertexBuffer CreateVertexBuffer()
{
Property::Map texturedQuadVertexFormat;
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer vertexData = PropertyBuffer::New( texturedQuadVertexFormat );
+ VertexBuffer vertexData = VertexBuffer::New( texturedQuadVertexFormat );
return vertexData;
}
Geometry CreateQuadGeometry(void)
{
- PropertyBuffer vertexData = CreatePropertyBuffer();
+ VertexBuffer vertexData = CreateVertexBuffer();
const float halfQuadSize = .5f;
struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
TexturedQuadVertex texturedQuadVertexData[4] = {
TextureSet CreateTextureSet();
TextureSet CreateTextureSet( Texture texture );
Geometry CreateQuadGeometry();
-PropertyBuffer CreatePropertyBuffer();
+VertexBuffer CreateVertexBuffer();
}
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
- animation.SetEndAction(Animation::Discard);
+ animation.SetEndAction(Animation::DISCARD);
// Start the animation
animation.SetLoopCount(3);
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
- animation.SetEndAction(Animation::Discard);
+ animation.SetEndAction(Animation::DISCARD);
float intervalSeconds = 3.0f;
Animation animation = Animation::New(durationSeconds);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
- animation.SetEndAction(Animation::Bake);
+ animation.SetEndAction(Animation::BAKE);
float intervalSeconds = 3.0f;
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- DALI_TEST_CHECK(animation.GetEndAction() == Animation::Bake);
+ DALI_TEST_CHECK(animation.GetEndAction() == Animation::BAKE);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Test BakeFinal, animate again, for half the duration
finishCheck.Reset();
- animation.SetEndAction(Animation::BakeFinal);
- DALI_TEST_CHECK(animation.GetEndAction() == Animation::BakeFinal);
+ animation.SetEndAction(Animation::BAKE_FINAL);
+ DALI_TEST_CHECK(animation.GetEndAction() == Animation::BAKE_FINAL);
animation.Play();
application.SendNotification();
// Test EndAction::Discard, animate again, but don't bake this time
finishCheck.Reset();
- animation.SetEndAction(Animation::Discard);
- DALI_TEST_CHECK(animation.GetEndAction() == Animation::Discard);
+ animation.SetEndAction(Animation::DISCARD);
+ DALI_TEST_CHECK(animation.GetEndAction() == Animation::DISCARD);
animation.Play();
application.SendNotification();
TestApplication application;
Animation animation = Animation::New(1.0f);
- DALI_TEST_CHECK(animation.GetEndAction() == Animation::Bake);
+ DALI_TEST_CHECK(animation.GetEndAction() == Animation::BAKE);
- animation.SetEndAction(Animation::Discard);
- DALI_TEST_CHECK(animation.GetEndAction() == Animation::Discard);
+ animation.SetEndAction(Animation::DISCARD);
+ DALI_TEST_CHECK(animation.GetEndAction() == Animation::DISCARD);
- animation.SetEndAction(Animation::BakeFinal);
- DALI_TEST_CHECK(animation.GetEndAction() == Animation::BakeFinal);
+ animation.SetEndAction(Animation::BAKE_FINAL);
+ DALI_TEST_CHECK(animation.GetEndAction() == Animation::BAKE_FINAL);
END_TEST;
}
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- DALI_TEST_CHECK(animation.GetDisconnectAction() == Animation::BakeFinal);
+ DALI_TEST_CHECK(animation.GetDisconnectAction() == Animation::BAKE_FINAL);
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- animation.SetDisconnectAction( Animation::Bake );
+ animation.SetDisconnectAction( Animation::BAKE );
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- animation.SetDisconnectAction( Animation::Discard );
+ animation.SetDisconnectAction( Animation::DISCARD );
Vector3 targetPosition(10.0f, 10.0f, 10.0f);
animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
{
TestApplication application;
Animation animation = Animation::New(1.0f);
- DALI_TEST_CHECK(animation.GetDisconnectAction() == Animation::BakeFinal); // default!
+ DALI_TEST_CHECK(animation.GetDisconnectAction() == Animation::BAKE_FINAL); // default!
- animation.SetDisconnectAction(Animation::Discard);
- DALI_TEST_CHECK(animation.GetDisconnectAction() == Animation::Discard);
+ animation.SetDisconnectAction(Animation::DISCARD);
+ DALI_TEST_CHECK(animation.GetDisconnectAction() == Animation::DISCARD);
- animation.SetDisconnectAction(Animation::Bake);
- DALI_TEST_CHECK(animation.GetDisconnectAction() == Animation::Bake);
+ animation.SetDisconnectAction(Animation::BAKE);
+ DALI_TEST_CHECK(animation.GetDisconnectAction() == Animation::BAKE);
END_TEST;
}
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- animation.SetDisconnectAction( Animation::Discard );
+ animation.SetDisconnectAction( Animation::DISCARD );
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- animation.SetDisconnectAction( Animation::Bake );
+ animation.SetDisconnectAction( Animation::BAKE );
Vector3 targetPosition(100.0f, 100.0f, 100.0f);
animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
keyFrames.Add(0.8f, 0.7f);
keyFrames.Add(1.0f, 0.9f);
- animation.AnimateBetween( Property(actor, Actor::Property::COLOR_ALPHA), keyFrames, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::COLOR_ALPHA), keyFrames, Animation::CUBIC );
// Start the animation
animation.Play();
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, Animation::CUBIC );
// Start the animation
animation.Play();
keyFrames.Add(1.0f, true);
//Cubic interpolation for boolean values should be ignored
- animation.AnimateBetween( Property(actor, Actor::Property::VISIBLE), keyFrames, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::VISIBLE), keyFrames, Animation::CUBIC );
// Start the animation
animation.Play();
keyFrames.Add(0.0f, AngleAxis(Degree(60), Vector3::ZAXIS));
//Cubic interpolation should be ignored for quaternions
- animation.AnimateBetween( Property(actor, Actor::Property::ORIENTATION), keyFrames, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::ORIENTATION), keyFrames, Animation::CUBIC );
// Start the animation
animation.Play();
keyFrames.Add(1.0f, AngleAxis(Degree(120), Vector3::YAXIS));
//Cubic interpolation should be ignored for quaternions
- animation.AnimateBetween( Property(actor, Actor::Property::ORIENTATION), keyFrames, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::ORIENTATION), keyFrames, Animation::CUBIC );
// Start the animation
animation.Play();
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunction::LINEAR, Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunction::LINEAR, Animation::CUBIC );
// Start the animation
animation.Play();
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, TimePeriod( delay, durationSeconds - delay ), Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, TimePeriod( delay, durationSeconds - delay ), Animation::CUBIC );
// Start the animation
animation.Play();
keyFrames.Add(0.5f, Vector4(0.9f, 0.8f, 0.7f, 0.6f));
keyFrames.Add(1.0f, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
- animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunction::LINEAR, TimePeriod( delay, durationSeconds - delay ), Animation::Cubic );
+ animation.AnimateBetween( Property(actor, Actor::Property::COLOR), keyFrames, AlphaFunction::LINEAR, TimePeriod( delay, durationSeconds - delay ), Animation::CUBIC );
// Start the animation
animation.Play();
ExpectedValue expectedValueTable[] =
{
- { Animation::Bake, halfWayToTarget }, // When baking, the current value is the final value.
- { Animation::BakeFinal, targetPosition }, // When BakeFinal, we should jump to the final value when clearing or stopping.
- { Animation::Discard, originalPosition }, // When discarding, we should jump back to the original value when clearing or stopping.
+ { Animation::BAKE, halfWayToTarget }, // When baking, the current value is the final value.
+ { Animation::BAKE_FINAL, targetPosition }, // When BakeFinal, we should jump to the final value when clearing or stopping.
+ { Animation::DISCARD, originalPosition }, // When discarding, we should jump back to the original value when clearing or stopping.
};
const auto expectedValueTableCount = sizeof( expectedValueTable ) / sizeof( ExpectedValue );
Animation::EndAction endActions[] =
{
- Animation::Bake,
- Animation::BakeFinal,
- Animation::Discard,
+ Animation::BAKE,
+ Animation::BAKE_FINAL,
+ Animation::DISCARD,
};
const auto endActionCount = sizeof( endActions ) / sizeof( endActions[0] );
Dali::Animation instance;
try
{
- Dali::Animation::EndAction arg1(Animation::Bake);
+ Dali::Animation::EndAction arg1(Animation::BAKE);
instance.SetEndAction(arg1);
DALI_TEST_CHECK(false); // Should not get here
}
{
Dali::Property arg1(actor, Actor::Property::POSITION);
Dali::KeyFrames arg2;
- Dali::Animation::Interpolation arg3(Animation::Linear);
+ Dali::Animation::Interpolation arg3(Animation::LINEAR);
instance.AnimateBetween(arg1,arg2,arg3);
DALI_TEST_CHECK(false); // Should not get here
}
Dali::Property arg1(actor, Actor::Property::POSITION);
Dali::KeyFrames arg2;
Dali::TimePeriod arg3(1.0f);
- Dali::Animation::Interpolation arg4(Animation::Linear);
+ Dali::Animation::Interpolation arg4(Animation::LINEAR);
instance.AnimateBetween(arg1,arg2,arg3,arg4);
DALI_TEST_CHECK(false); // Should not get here
}
Dali::Property arg1(actor, Actor::Property::POSITION);
Dali::KeyFrames arg2;
Dali::AlphaFunction arg3;
- Dali::Animation::Interpolation arg4(Animation::Linear);
+ Dali::Animation::Interpolation arg4(Animation::LINEAR);
instance.AnimateBetween(arg1,arg2,arg3,arg4);
DALI_TEST_CHECK(false); // Should not get here
}
Dali::KeyFrames arg2;
Dali::AlphaFunction arg3;
Dali::TimePeriod arg4(1.0f);
- Dali::Animation::Interpolation arg5(Animation::Linear);
+ Dali::Animation::Interpolation arg5(Animation::LINEAR);
instance.AnimateBetween(arg1,arg2,arg3,arg4,arg5);
DALI_TEST_CHECK(false); // Should not get here
}
Dali::Animation instance;
try
{
- Dali::Animation::EndAction arg1(Animation::Bake);
+ Dali::Animation::EndAction arg1(Animation::BAKE);
instance.SetDisconnectAction(arg1);
DALI_TEST_CHECK(false); // Should not get here
}
struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
-PropertyBuffer CreateVertexBuffer( const std::string& aPosition, const std::string& aTexCoord )
+VertexBuffer CreateVertexBuffer( const std::string& aPosition, const std::string& aTexCoord )
{
const float halfQuadSize = .5f;
TexturedQuadVertex texturedQuadVertexData[4] = {
vertexFormat[aPosition] = Property::VECTOR2;
vertexFormat[aTexCoord] = Property::VECTOR2;
- PropertyBuffer vertexData = PropertyBuffer::New( vertexFormat );
+ VertexBuffer vertexData = VertexBuffer::New( vertexFormat );
vertexData.SetData( texturedQuadVertexData, 4 );
return vertexData;
DALI_TEST_EQUALS( 1, geometry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
DALI_TEST_EQUALS( 0u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
- PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
+ VertexBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
geometry.AddVertexBuffer( vertexBuffer );
DALI_TEST_EQUALS( 1u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
DALI_TEST_EQUALS( 1, geometry.GetBaseObject().ReferenceCount(), TEST_LOCATION );
DALI_TEST_EQUALS( 0u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
- PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
+ VertexBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
geometry.AddVertexBuffer( vertexBuffer );
DALI_TEST_EQUALS( 1u, geometry.GetNumberOfVertexBuffers(), TEST_LOCATION );
tet_infoline("Test AddVertexBuffer");
- PropertyBuffer vertexBuffer1 = CreateVertexBuffer("aPosition1", "aTexCoord1" );
+ VertexBuffer vertexBuffer1 = CreateVertexBuffer("aPosition1", "aTexCoord1" );
Geometry geometry = Geometry::New();
geometry.AddVertexBuffer( vertexBuffer1 );
// add the second vertex buffer
application.GetGlAbstraction().ResetBufferDataCalls();
- PropertyBuffer vertexBuffer2 = CreateVertexBuffer( "aPosition2", "aTexCoord2" );
+ VertexBuffer vertexBuffer2 = CreateVertexBuffer( "aPosition2", "aTexCoord2" );
geometry.AddVertexBuffer( vertexBuffer2 );
application.SendNotification();
application.Render(0);
TestApplication application;
tet_infoline("Test GetNumberOfVertexBuffers");
- PropertyBuffer vertexBuffer1 = CreateVertexBuffer("aPosition1", "aTexCoord1" );
- PropertyBuffer vertexBuffer2 = CreateVertexBuffer("aPosition2", "aTexCoord2" );
- PropertyBuffer vertexBuffer3 = CreateVertexBuffer("aPosition3", "aTexCoord3" );
+ VertexBuffer vertexBuffer1 = CreateVertexBuffer("aPosition1", "aTexCoord1" );
+ VertexBuffer vertexBuffer2 = CreateVertexBuffer("aPosition2", "aTexCoord2" );
+ VertexBuffer vertexBuffer3 = CreateVertexBuffer("aPosition3", "aTexCoord3" );
Geometry geometry = Geometry::New();
geometry.AddVertexBuffer( vertexBuffer1 );
tet_infoline("Test RemoveVertexBuffer");
- PropertyBuffer vertexBuffer1 = CreateVertexBuffer("aPosition1", "aTexCoord1" );
- PropertyBuffer vertexBuffer2 = CreateVertexBuffer("aPosition2", "aTexCoord2" );
+ VertexBuffer vertexBuffer1 = CreateVertexBuffer("aPosition1", "aTexCoord1" );
+ VertexBuffer vertexBuffer2 = CreateVertexBuffer("aPosition2", "aTexCoord2" );
Geometry geometry = Geometry::New();
geometry.AddVertexBuffer( vertexBuffer1 );
tet_infoline("Test SetIndexBuffer");
- PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
+ VertexBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
Geometry geometry = Geometry::New();
geometry.AddVertexBuffer( vertexBuffer );
tet_infoline("Test SetType and GetType: without index buffer");
unsigned int numVertex = 4u;
- PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
+ VertexBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
Geometry geometry = Geometry::New();
geometry.AddVertexBuffer( vertexBuffer );
unsigned int numVertex = 4u;
unsigned int numIndex = 6u; // 6 unsigned short
- PropertyBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
+ VertexBuffer vertexBuffer = CreateVertexBuffer("aPosition", "aTexCoord" );
Geometry geometry = Geometry::New();
Dali::Geometry instance;
try
{
- Dali::PropertyBuffer arg1;
+ Dali::VertexBuffer arg1;
instance.AddVertexBuffer(arg1);
DALI_TEST_CHECK(false); // Should not get here
}
*/
#include <iostream>
-
+#include <typeinfo>
#include <stdlib.h>
#include <dali/public-api/dali-core.h>
#include <dali/devel-api/actors/actor-devel.h>
const float withFlake(99.f);
Property::Index index1 = actor.RegisterProperty( "MyPropertyOne", Vector3::ONE );
- Property::Index index2 = DevelHandle::RegisterProperty( actor, key1, "sideColor", testColor);
+ Property::Index index2 = actor.RegisterProperty( key1, "sideColor", testColor);
Property::Index index3 = actor.RegisterProperty( "MyPropertyTwo", Vector3::ONE );
- Property::Index index4 = DevelHandle::RegisterProperty( actor, key2, "iceCream", withFlake );
+ Property::Index index4 = actor.RegisterProperty( key2, "iceCream", withFlake );
Property::Index index5 = actor.RegisterProperty( "MyPropertyThree", Vector3::ONE );
application.SendNotification();
application.Render();
// Test that we can get the property index from the integer key
- Property::Index testIndex1 = DevelHandle::GetPropertyIndex( actor, key1 );
- Property::Index testIndex2 = DevelHandle::GetPropertyIndex( actor, key2 );
+ Property::Index testIndex1 = actor.GetPropertyIndex( key1 );
+ Property::Index testIndex2 = actor.GetPropertyIndex( key2 );
DALI_TEST_EQUALS( index2, testIndex1, TEST_LOCATION );
DALI_TEST_EQUALS( index4, testIndex2, TEST_LOCATION );
std::string myName("croydon");
Property::Index intKey = CORE_PROPERTY_MAX_INDEX+1;
Property::Value value( Color::GREEN );
- Property::Index myIndex = DevelHandle::RegisterProperty( actor, intKey, myName, value );
+ Property::Index myIndex = actor.RegisterProperty( intKey, myName, value );
- DALI_TEST_EQUALS( myIndex, DevelHandle::GetPropertyIndex( actor, intKey ), TEST_LOCATION );
+ DALI_TEST_EQUALS( myIndex, actor.GetPropertyIndex( intKey ), TEST_LOCATION );
Property::Key key1(myName);
Property::Key key2(intKey);
- DALI_TEST_EQUALS( myIndex, DevelHandle::GetPropertyIndex( actor, key1 ), TEST_LOCATION );
- DALI_TEST_EQUALS( myIndex, DevelHandle::GetPropertyIndex( actor, key2 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( myIndex, actor.GetPropertyIndex( key1 ), TEST_LOCATION );
+ DALI_TEST_EQUALS( myIndex, actor.GetPropertyIndex( key2 ), TEST_LOCATION );
END_TEST;
}
const float withFlake(99.f);
Property::Index index1 = actor.RegisterProperty( "MyPropertyOne", Vector3::ONE );
- Property::Index index2 = DevelHandle::RegisterProperty( actor, key1, "sideColor", testColor);
- Property::Index index3 = DevelHandle::RegisterProperty( actor, key2, "iceCream", withFlake );
+ Property::Index index2 = actor.RegisterProperty( key1, "sideColor", testColor);
+ Property::Index index3 = actor.RegisterProperty( key2, "iceCream", withFlake );
application.SendNotification();
application.Render();
Property::Index key2 = CORE_PROPERTY_MAX_INDEX+2;
actor.RegisterProperty( "MyPropertyOne", Vector3::ONE );
- DevelHandle::RegisterProperty( actor, key1, "sideColor", testColor);
+ actor.RegisterProperty( key1, "sideColor", testColor);
actor.RegisterProperty( "MyPropertyTwo", 1234 );
- Property::Index index4 = DevelHandle::RegisterProperty( actor, key2, "iceCream", withFlake );
+ Property::Index index4 = actor.RegisterProperty( key2, "iceCream", withFlake );
actor.RegisterProperty( "MyPropertyThree", Vector2(.2f,.7f) );
actor.GetPropertyIndices( indices );
Actor actor = Actor::New();
auto propertyIndex = actor.RegisterProperty("customProperty1", 1.0f);
- DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( actor, propertyIndex ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.DoesCustomPropertyExist( propertyIndex ), true, TEST_LOCATION );
END_TEST;
}
Actor actor = Actor::New();
auto propertyIndex = actor.RegisterProperty("customProperty1", 1.0f);
- DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( actor, propertyIndex+1 ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.DoesCustomPropertyExist( propertyIndex+1 ), false, TEST_LOCATION );
END_TEST;
}
tet_infoline( "Test that a default property does not show as a custom property on object" );
Actor actor = Actor::New();
- DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( actor, Actor::Property::POSITION ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.DoesCustomPropertyExist( Actor::Property::POSITION ), false, TEST_LOCATION );
END_TEST;
}
auto child = Actor::New();
container.Add( child ); // Resolve child properties (if any)
- DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( child, CHILD_PROPERTY ), false, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.DoesCustomPropertyExist( CHILD_PROPERTY ), false, TEST_LOCATION );
END_TEST;
}
container.Add( child ); // Resolve child properties (if any)
child.SetProperty( CHILD_PROPERTY, 2 );
- DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( child, CHILD_PROPERTY ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.DoesCustomPropertyExist( CHILD_PROPERTY ), true, TEST_LOCATION );
DALI_TEST_EQUALS( child.GetProperty<int>( CHILD_PROPERTY ), 2, TEST_LOCATION );
END_TEST;
}
child.RegisterProperty( CHILD_PROPERTY_NAME, Property::Value(3) );
container.Add( child ); // Resolve child properties (if any)
- DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( child, CHILD_PROPERTY ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.DoesCustomPropertyExist( CHILD_PROPERTY ), true, TEST_LOCATION );
DALI_TEST_EQUALS( child.GetProperty<int>( CHILD_PROPERTY ), 3, TEST_LOCATION );
END_TEST;
}
tet_infoline( "Test that setting a default property triggers a signal" );
auto actor = Actor::New();
- DevelHandle::PropertySetSignal(actor).Connect(&application, propertySetCheck);
+ actor.PropertySetSignal().Connect(&application, propertySetCheck);
actor.SetProperty( Actor::Property::POSITION, Vector3::XAXIS );
propertySetCheck.CheckSignalReceived();
tet_infoline( "Test that setting a custom property triggers a signal" );
auto actor = Actor::New();
- DevelHandle::PropertySetSignal(actor).Connect(&application, propertySetCheck);
+ actor.PropertySetSignal().Connect(&application, propertySetCheck);
auto propertyIndex = actor.RegisterProperty("propName", 3.0f);
actor.SetProperty( propertyIndex, 5.0f );
application.GetScene().Add( container );
auto child = Actor::New();
child.RegisterProperty( CHILD_PROPERTY_NAME, Property::Value(3) );
- DevelHandle::PropertySetSignal(child).Connect(&application, propertySetCheck);
+ child.PropertySetSignal().Connect(&application, propertySetCheck);
container.Add( child ); // Resolve child properties (if any)
- DALI_TEST_EQUALS( DevelHandle::DoesCustomPropertyExist( child, CHILD_PROPERTY ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( child.DoesCustomPropertyExist( CHILD_PROPERTY ), true, TEST_LOCATION );
DALI_TEST_EQUALS( child.GetProperty<int>( CHILD_PROPERTY ), 3, TEST_LOCATION );
child.SetProperty( CHILD_PROPERTY, 29 );
END_TEST;
}
+
+
+int UtcDaliHandlePropertySetSignal04(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ bool signalReceived(false);
+ Property::Value value;
+ PropertySetSignalCheck propertySetCheck(signalReceived, value);
+
+ tet_infoline( "Test that setting a property on a vanilla Object triggers a signal" );
+
+ constexpr Property::Index TEST_PROPERTY_KEY_INDEX = 1;
+ const std::string TEST_PROPERTY_KEY_NAME = "testProperty";
+
+ Handle vanillaObject = Handle::New();
+ auto propertyIndex = vanillaObject.RegisterProperty(
+ TEST_PROPERTY_KEY_INDEX,
+ TEST_PROPERTY_KEY_NAME,
+ Color::WHITE );
+
+ vanillaObject.PropertySetSignal().Connect(&application, propertySetCheck);
+
+ DALI_TEST_EQUALS( vanillaObject.DoesCustomPropertyExist( propertyIndex ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( vanillaObject.GetProperty<Vector4>( propertyIndex ), Color::WHITE, 0.001f, TEST_LOCATION );
+
+ vanillaObject[TEST_PROPERTY_KEY_NAME] = Color::RED;
+
+ propertySetCheck.CheckSignalReceived();
+ DALI_TEST_EQUALS( propertySetCheck.mValue, Property::Value( Color::RED ), 0.001f, TEST_LOCATION );
+ DALI_TEST_VALUE_EQUALS( vanillaObject[propertyIndex], Property::Value( Color::RED), 0.001f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+
int UtcDaliHandlePropertySetProperties(void)
{
TestApplication application;
const Vector4 color( 0.1f, 0.2, 0.3f, 0.4f );
Handle handle = Actor::New();
- DevelHandle::SetProperties(
- handle,
+ handle.SetProperties(
Property::Map
{
{ Actor::Property::SIZE, actorSize },
END_TEST;
}
-int UtcDaliHandleTemplateNew(void)
+int UtcDaliHandleTemplateNew01(void)
{
TestApplication application;
const Vector3 actorSize( 10.0f, 20.0f, 30.0f );
const Vector3 anchorPoint( 1.0f, 0.5f, 0.0f );
const Vector4 color( 0.1f, 0.2, 0.3f, 0.4f );
- Handle handle = DevelHandle::New< Actor >(
+ Handle handle = Handle::New< Actor >(
Property::Map
{
{ Actor::Property::SIZE, actorSize },
TestApplication application;
Handle handle = Actor::New();
- DevelHandle::SetProperties(
- handle,
+ handle.SetProperties(
Property::Map
{
{ Actor::Property::SIZE, Vector3( 400.0f, 200.0f, 100.0f ) },
);
Property::Map map;
- DevelHandle::GetProperties( handle, map );
+ handle.GetProperties( map );
// Get all the properties and ensure they match
// Add a custom property and ensure the count goes up by one.
const auto countBefore = map.Count();
handle.RegisterProperty( "tempProperty", Color::GREEN );
- DevelHandle::GetProperties( handle, map );
+ handle.GetProperties( map );
DALI_TEST_EQUALS( countBefore + 1, map.Count(), TEST_LOCATION );
END_TEST;
}
+
int UtcDaliHandleSetPropertyNegative(void)
{
TestApplication application;
}
END_TEST;
}
+
+
+int UtcDaliHandleIndexOperatorByIndexP01(void)
+{
+ TestApplication application;
+ Actor actor = Actor::New();
+
+ actor[Actor::Property::SIZE] = Vector3( 100.0f, 200.0f, 1.0f );
+
+ DALI_TEST_EQUALS( actor.GetProperty<Vector3>(Actor::Property::SIZE), Vector3( 100.0f, 200.0f, 1.0f ), 0.001f, TEST_LOCATION );
+
+
+ actor.SetProperty( Actor::Property::POSITION, Vector3( 10.0f, 20.0f, 0.0f ) );
+
+ Vector3 position = actor[ Actor::Property::POSITION ];
+ DALI_TEST_EQUALS( position, Vector3( 10.0f, 20.0f, 0.0f ), TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliHandleIndexOperatorByIndexP02(void)
+{
+ TestApplication application;
+ Actor actor = Actor::New();
+
+ const Vector4 defaultActorColor(1.0f, 1.0f, 1.0f, 1.0f);
+ actor.SetProperty(Actor::Property::COLOR, defaultActorColor);
+ actor[Actor::Property::COLOR_RED] = 0.5f;
+
+ DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), 0.5f, 0.001f, TEST_LOCATION);
+ DALI_TEST_EQUALS( actor.GetProperty<Vector4>(Actor::Property::COLOR), Vector4(0.5f, 1.0f, 1.0f, 1.0f), 0.001f, TEST_LOCATION);
+
+ actor.SetProperty( Actor::Property::POSITION, Vector3( 10.0f, 20.0f, 0.0f ) );
+
+ DALI_TEST_EQUALS( (float)actor[ Actor::Property::POSITION_Z ], 0.0f, 0.001f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliHandleIndexOperatorByIndexP03(void)
+{
+ TestApplication application;
+ Actor actor = Actor::New();
+
+ const Vector4 defaultActorColor(1.0f, 1.0f, 1.0f, 1.0f);
+ actor.SetProperty(Actor::Property::COLOR, defaultActorColor);
+
+ // Value under test is second to allow compiler to deduce type
+ DALI_TEST_VALUE_EQUALS( actor[Actor::Property::COLOR_RED], 1.0f, 0.001f, TEST_LOCATION);
+
+ actor.SetProperty( Actor::Property::POSITION, Vector3( 10.0f, 20.0f, 0.0f ) );
+
+ DALI_TEST_EQUALS( (float)actor[ Actor::Property::POSITION_Z ], 0.0f, 0.001f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliHandleIndexOperatorByNameP01(void)
+{
+ TestApplication application;
+ Actor actor = Actor::New();
+
+ actor["size"] = Vector3( 100.0f, 200.0f, 1.0f );
+
+ DALI_TEST_VALUE_EQUALS( actor.GetProperty(Actor::Property::SIZE), Vector3( 100.0f, 200.0f, 1.0f ), 0.001f, TEST_LOCATION );
+
+ actor.SetProperty( Actor::Property::POSITION, Vector3( 10.0f, 20.0f, 0.0f ) );
+ Vector3 position = actor[ "position" ];
+
+ DALI_TEST_EQUALS( position, Vector3( 10.0f, 20.0f, 0.0f ), 0.001f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+
+int UtcDaliHandleIndexOperatorByNameP02(void)
+{
+ TestApplication application;
+ Actor actor = Actor::New();
+
+ const Vector4 defaultActorColor(1.0f, 1.0f, 1.0f, 1.0f);
+ actor.SetProperty(Actor::Property::COLOR, defaultActorColor);
+ actor["colorRed"] = 0.5f;
+
+ DALI_TEST_VALUE_EQUALS( actor.GetProperty(Actor::Property::COLOR_RED), 0.5f, 0.001f, TEST_LOCATION);
+ DALI_TEST_VALUE_EQUALS( actor.GetProperty(Actor::Property::COLOR), Vector4(0.5f, 1.0f, 1.0f, 1.0f), 0.001f, TEST_LOCATION);
+
+ actor.SetProperty( Actor::Property::POSITION, Vector3( 10.0f, 20.0f, 0.0f ) );
+
+ float positionY = actor[ "positionY" ];
+ DALI_TEST_EQUALS( positionY, 20.0f, 0.001f, TEST_LOCATION );
+
+ // Should automatically promote IndirectValue to Property::Value rvalue.
+ DALI_TEST_VALUE_EQUALS( actor["positionZ"], 0.0f, 0.001f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+
+int UtcDaliHandleIndexOperatorNegative02(void)
+{
+ TestApplication application;
+
+ Actor actor;
+ try
+ {
+ Vector3 position = actor[Actor::Property::POSITION];
+ if( position == position )
+ {
+ DALI_TEST_CHECK(false); // Should throw before reaching here.
+ }
+ DALI_TEST_CHECK(false); // Should throw before reaching here.
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true); // Assert expected
+ }
+
+ END_TEST;
+}
{
functorCalled = false;
- receivedKeyEvent.keyModifier = 0;
- receivedKeyEvent.keyPressedName.clear();
- receivedKeyEvent.keyPressed.clear();
+ receivedKeyEvent.Reset();
keyedActor.Reset();
}
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0, KeyEvent::Down); // set name to test, key string to i and modifier to shift
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE); // set name to test, key string to i and modifier to shift
+ DALI_TEST_CHECK( event );
+
+ DALI_TEST_EQUALS(TEST_STRING_1, event.GetKeyName(), TEST_LOCATION); // check key name
+ DALI_TEST_EQUALS("I", event.GetLogicalKey(), TEST_LOCATION); // check logical key string
+ DALI_TEST_EQUALS("i", event.GetKeyString(), TEST_LOCATION); // check key string
+ DALI_TEST_EQUALS(99, event.GetKeyCode(), TEST_LOCATION); // check keyCode
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION); // check modifier
+ DALI_TEST_EQUALS(0lu, event.GetTime(), TEST_LOCATION); // check time
+ DALI_TEST_EQUALS(KeyEvent::DOWN, event.GetState(), TEST_LOCATION); // check state
+ DALI_TEST_EQUALS("", event.GetCompose(), TEST_LOCATION); // check compose
+ DALI_TEST_EQUALS("", event.GetDeviceName(), TEST_LOCATION); // check device name
+ DALI_TEST_EQUALS(Device::Class::NONE, event.GetDeviceClass(), TEST_LOCATION); // check device class
+ DALI_TEST_EQUALS(Device::Subclass::NONE, event.GetDeviceSubclass(), TEST_LOCATION); // check device subclass
- DALI_TEST_EQUALS(TEST_STRING_1, event.keyPressedName, TEST_LOCATION); // check key name
- DALI_TEST_EQUALS("i", event.keyPressed, TEST_LOCATION); // check key string
- DALI_TEST_EQUALS(99, event.keyCode, TEST_LOCATION); // check keyCode
- DALI_TEST_EQUALS(SHIFT_MODIFIER, event.keyModifier, TEST_LOCATION); // check modifier
- DALI_TEST_EQUALS(KeyEvent::Down, event.state, TEST_LOCATION); // check state
END_TEST;
}
-int UtcDaliKeyEventAssignment(void)
+int UtcDaliKeyEventCopyAssignment(void)
{
// Test Assignment operator
- KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0, KeyEvent::Down); // set name to test, key string to i and modifier to shift
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE); // set name to test, key string to i and modifier to shift
+ DALI_TEST_CHECK( event );
+
+ DALI_TEST_EQUALS(TEST_STRING_1, event.GetKeyName(), TEST_LOCATION); // check key name
+ DALI_TEST_EQUALS("I", event.GetLogicalKey(), TEST_LOCATION); // check logical key string
+ DALI_TEST_EQUALS("i", event.GetKeyString(), TEST_LOCATION); // check key string
+ DALI_TEST_EQUALS(99, event.GetKeyCode(), TEST_LOCATION); // check keyCode
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION); // check modifier
+ DALI_TEST_EQUALS(0lu, event.GetTime(), TEST_LOCATION); // check time
+ DALI_TEST_EQUALS(KeyEvent::DOWN, event.GetState(), TEST_LOCATION); // check state
+ DALI_TEST_EQUALS("", event.GetCompose(), TEST_LOCATION); // check compose
+ DALI_TEST_EQUALS("", event.GetDeviceName(), TEST_LOCATION); // check device name
+ DALI_TEST_EQUALS(Device::Class::NONE, event.GetDeviceClass(), TEST_LOCATION); // check device class
+ DALI_TEST_EQUALS(Device::Subclass::NONE, event.GetDeviceSubclass(), TEST_LOCATION); // check device subclass
+
+ Dali::KeyEvent event2 = DevelKeyEvent::New(TEST_STRING_1, "J", "j", 88, CTRL_MODIFIER, 0lu, KeyEvent::UP, "", "", Device::Class::USER, Device::Subclass::FINGER); // set name to test, key string to i and modifier to shift
+ DALI_TEST_CHECK( event2 );
+
+ DALI_TEST_EQUALS(TEST_STRING_1, event2.GetKeyName(), TEST_LOCATION); // check key name
+ DALI_TEST_EQUALS("J", event2.GetLogicalKey(), TEST_LOCATION); // check logical key string
+ DALI_TEST_EQUALS("j", event2.GetKeyString(), TEST_LOCATION); // check key string
+ DALI_TEST_EQUALS(88, event2.GetKeyCode(), TEST_LOCATION); // check keyCode
+ DALI_TEST_EQUALS(CTRL_MODIFIER, event2.GetKeyModifier(), TEST_LOCATION); // check modifier
+ DALI_TEST_EQUALS(0lu, event2.GetTime(), TEST_LOCATION); // check time
+ DALI_TEST_EQUALS(KeyEvent::UP, event2.GetState(), TEST_LOCATION); // check state
+ DALI_TEST_EQUALS("", event2.GetCompose(), TEST_LOCATION); // check compose
+ DALI_TEST_EQUALS("", event2.GetDeviceName(), TEST_LOCATION); // check device name
+ DALI_TEST_EQUALS(Device::Class::USER, event2.GetDeviceClass(), TEST_LOCATION); // check device class
+ DALI_TEST_EQUALS(Device::Subclass::FINGER, event2.GetDeviceSubclass(), TEST_LOCATION); // check device subclass
- DALI_TEST_EQUALS(TEST_STRING_1, event.keyPressedName, TEST_LOCATION); // check key name
- DALI_TEST_EQUALS("i", event.keyPressed, TEST_LOCATION); // check key string
- DALI_TEST_EQUALS(99, event.keyCode, TEST_LOCATION); // check keyCode
- DALI_TEST_EQUALS(SHIFT_MODIFIER, event.keyModifier, TEST_LOCATION); // check modifier
- DALI_TEST_EQUALS(KeyEvent::Down, event.state, TEST_LOCATION); // check state
-
- KeyEvent event2(TEST_STRING_1,"j", 88, CTRL_MODIFIER, 0, KeyEvent::Up); // set name to test, key string to i and modifier to shift
+ event = event2;
+ DALI_TEST_CHECK( event );
+
+ DALI_TEST_EQUALS(TEST_STRING_1, event.GetKeyName(), TEST_LOCATION); // check key name
+ DALI_TEST_EQUALS("J", event.GetLogicalKey(), TEST_LOCATION); // check logical key string
+ DALI_TEST_EQUALS("j", event.GetKeyString(), TEST_LOCATION); // check key string
+ DALI_TEST_EQUALS(88, event.GetKeyCode(), TEST_LOCATION); // check keyCode
+ DALI_TEST_EQUALS(CTRL_MODIFIER, event.GetKeyModifier(), TEST_LOCATION); // check modifier
+ DALI_TEST_EQUALS(0lu, event.GetTime(), TEST_LOCATION); // check time
+ DALI_TEST_EQUALS(KeyEvent::UP, event.GetState(), TEST_LOCATION); // check state
+ DALI_TEST_EQUALS("", event.GetCompose(), TEST_LOCATION); // check compose
+ DALI_TEST_EQUALS("", event.GetDeviceName(), TEST_LOCATION); // check device name
+ DALI_TEST_EQUALS(Device::Class::USER, event.GetDeviceClass(), TEST_LOCATION); // check device class
+ DALI_TEST_EQUALS(Device::Subclass::FINGER, event.GetDeviceSubclass(), TEST_LOCATION); // check device subclass
- DALI_TEST_EQUALS(TEST_STRING_1, event2.keyPressedName, TEST_LOCATION); // check key name
- DALI_TEST_EQUALS("j", event2.keyPressed, TEST_LOCATION); // check key string
- DALI_TEST_EQUALS(88, event2.keyCode, TEST_LOCATION); // check keyCode
- DALI_TEST_EQUALS(CTRL_MODIFIER, event2.keyModifier, TEST_LOCATION); // check modifier
- DALI_TEST_EQUALS(KeyEvent::Up, event2.state, TEST_LOCATION); // check state
+ END_TEST;
+}
- event = event2;
+int UtcDaliKeyEventCopyConstructor(void)
+{
+ // Test Assignment operator
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE); // set name to test, key string to i and modifier to shift
+ DALI_TEST_CHECK( event );
+
+ DALI_TEST_EQUALS(TEST_STRING_1, event.GetKeyName(), TEST_LOCATION); // check key name
+ DALI_TEST_EQUALS("I", event.GetLogicalKey(), TEST_LOCATION); // check logical key string
+ DALI_TEST_EQUALS("i", event.GetKeyString(), TEST_LOCATION); // check key string
+ DALI_TEST_EQUALS(99, event.GetKeyCode(), TEST_LOCATION); // check keyCode
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION); // check modifier
+ DALI_TEST_EQUALS(0lu, event.GetTime(), TEST_LOCATION); // check time
+ DALI_TEST_EQUALS(KeyEvent::DOWN, event.GetState(), TEST_LOCATION); // check state
+ DALI_TEST_EQUALS("", event.GetCompose(), TEST_LOCATION); // check compose
+ DALI_TEST_EQUALS("", event.GetDeviceName(), TEST_LOCATION); // check device name
+ DALI_TEST_EQUALS(Device::Class::NONE, event.GetDeviceClass(), TEST_LOCATION); // check device class
+ DALI_TEST_EQUALS(Device::Subclass::NONE, event.GetDeviceSubclass(), TEST_LOCATION); // check device subclass
- DALI_TEST_EQUALS(TEST_STRING_1, event.keyPressedName, TEST_LOCATION); // check key name
- DALI_TEST_EQUALS("j", event.keyPressed, TEST_LOCATION); // check key string
- DALI_TEST_EQUALS(88, event.keyCode, TEST_LOCATION); // check keyCode
- DALI_TEST_EQUALS(CTRL_MODIFIER, event.keyModifier, TEST_LOCATION); // check modifier
- DALI_TEST_EQUALS(KeyEvent::Up, event.state, TEST_LOCATION); // check state
+ KeyEvent event2( event );
+ DALI_TEST_CHECK( event2 );
+
+ DALI_TEST_EQUALS(TEST_STRING_1, event2.GetKeyName(), TEST_LOCATION); // check key name
+ DALI_TEST_EQUALS("I", event2.GetLogicalKey(), TEST_LOCATION); // check logical key string
+ DALI_TEST_EQUALS("i", event2.GetKeyString(), TEST_LOCATION); // check key string
+ DALI_TEST_EQUALS(99, event2.GetKeyCode(), TEST_LOCATION); // check keyCode
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, event2.GetKeyModifier(), TEST_LOCATION); // check modifier
+ DALI_TEST_EQUALS(0lu, event2.GetTime(), TEST_LOCATION); // check time
+ DALI_TEST_EQUALS(KeyEvent::DOWN, event2.GetState(), TEST_LOCATION); // check state
+ DALI_TEST_EQUALS("", event2.GetCompose(), TEST_LOCATION); // check compose
+ DALI_TEST_EQUALS("", event2.GetDeviceName(), TEST_LOCATION); // check device name
+ DALI_TEST_EQUALS(Device::Class::NONE, event2.GetDeviceClass(), TEST_LOCATION); // check device class
+ DALI_TEST_EQUALS(Device::Subclass::NONE, event2.GetDeviceSubclass(), TEST_LOCATION); // check device subclass
END_TEST;
}
-int UtcDaliKeyEventCopy(void)
+int UtcDaliKeyEventMoveAssignment(void)
{
// Test Assignment operator
- KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0, KeyEvent::Down); // set name to test, key string to i and modifier to shift
-
- DALI_TEST_EQUALS(TEST_STRING_1, event.keyPressedName, TEST_LOCATION); // check key name
- DALI_TEST_EQUALS("i", event.keyPressed, TEST_LOCATION); // check key string
- DALI_TEST_EQUALS(99, event.keyCode, TEST_LOCATION); // check keyCode
- DALI_TEST_EQUALS(SHIFT_MODIFIER, event.keyModifier, TEST_LOCATION); // check modifier
- DALI_TEST_EQUALS(KeyEvent::Down, event.state, TEST_LOCATION); // check state
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE); // set name to test, key string to i and modifier to shift
+ DALI_TEST_CHECK( event );
+
+ DALI_TEST_EQUALS(TEST_STRING_1, event.GetKeyName(), TEST_LOCATION); // check key name
+ DALI_TEST_EQUALS("I", event.GetLogicalKey(), TEST_LOCATION); // check logical key string
+ DALI_TEST_EQUALS("i", event.GetKeyString(), TEST_LOCATION); // check key string
+ DALI_TEST_EQUALS(99, event.GetKeyCode(), TEST_LOCATION); // check keyCode
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION); // check modifier
+ DALI_TEST_EQUALS(0lu, event.GetTime(), TEST_LOCATION); // check time
+ DALI_TEST_EQUALS(KeyEvent::DOWN, event.GetState(), TEST_LOCATION); // check state
+ DALI_TEST_EQUALS("", event.GetCompose(), TEST_LOCATION); // check compose
+ DALI_TEST_EQUALS("", event.GetDeviceName(), TEST_LOCATION); // check device name
+ DALI_TEST_EQUALS(Device::Class::NONE, event.GetDeviceClass(), TEST_LOCATION); // check device class
+ DALI_TEST_EQUALS(Device::Subclass::NONE, event.GetDeviceSubclass(), TEST_LOCATION); // check device subclass
+
+ KeyEvent move;
+ move = std::move( event );
+ DALI_TEST_CHECK( move );
+
+ DALI_TEST_EQUALS(TEST_STRING_1, move.GetKeyName(), TEST_LOCATION); // check key name
+ DALI_TEST_EQUALS("I", move.GetLogicalKey(), TEST_LOCATION); // check logical key string
+ DALI_TEST_EQUALS("i", move.GetKeyString(), TEST_LOCATION); // check key string
+ DALI_TEST_EQUALS(99, move.GetKeyCode(), TEST_LOCATION); // check keyCode
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, move.GetKeyModifier(), TEST_LOCATION); // check modifier
+ DALI_TEST_EQUALS(0lu, move.GetTime(), TEST_LOCATION); // check time
+ DALI_TEST_EQUALS(KeyEvent::DOWN, move.GetState(), TEST_LOCATION); // check state
+ DALI_TEST_EQUALS("", move.GetCompose(), TEST_LOCATION); // check compose
+ DALI_TEST_EQUALS("", move.GetDeviceName(), TEST_LOCATION); // check device name
+ DALI_TEST_EQUALS(Device::Class::NONE, move.GetDeviceClass(), TEST_LOCATION); // check device class
+ DALI_TEST_EQUALS(Device::Subclass::NONE, move.GetDeviceSubclass(), TEST_LOCATION); // check device subclass
+
+ DALI_TEST_CHECK( !event );
- KeyEvent event2( event );
+ END_TEST;
+}
- DALI_TEST_EQUALS(TEST_STRING_1, event2.keyPressedName, TEST_LOCATION); // check key name
- DALI_TEST_EQUALS("i", event2.keyPressed, TEST_LOCATION); // check key string
- DALI_TEST_EQUALS(99, event2.keyCode, TEST_LOCATION); // check keyCode
- DALI_TEST_EQUALS(SHIFT_MODIFIER, event2.keyModifier, TEST_LOCATION); // check modifier
- DALI_TEST_EQUALS(KeyEvent::Down, event2.state, TEST_LOCATION); // check state
+int UtcDaliKeyEventMoveConstructor(void)
+{
+ // Test Assignment operator
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE); // set name to test, key string to i and modifier to shift
+ DALI_TEST_CHECK( event );
+
+ DALI_TEST_EQUALS(TEST_STRING_1, event.GetKeyName(), TEST_LOCATION); // check key name
+ DALI_TEST_EQUALS("I", event.GetLogicalKey(), TEST_LOCATION); // check logical key string
+ DALI_TEST_EQUALS("i", event.GetKeyString(), TEST_LOCATION); // check key string
+ DALI_TEST_EQUALS(99, event.GetKeyCode(), TEST_LOCATION); // check keyCode
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION); // check modifier
+ DALI_TEST_EQUALS(0lu, event.GetTime(), TEST_LOCATION); // check time
+ DALI_TEST_EQUALS(KeyEvent::DOWN, event.GetState(), TEST_LOCATION); // check state
+ DALI_TEST_EQUALS("", event.GetCompose(), TEST_LOCATION); // check compose
+ DALI_TEST_EQUALS("", event.GetDeviceName(), TEST_LOCATION); // check device name
+ DALI_TEST_EQUALS(Device::Class::NONE, event.GetDeviceClass(), TEST_LOCATION); // check device class
+ DALI_TEST_EQUALS(Device::Subclass::NONE, event.GetDeviceSubclass(), TEST_LOCATION); // check device subclass
+
+ KeyEvent move = std::move( event );
+ DALI_TEST_CHECK( move );
+
+ DALI_TEST_EQUALS(TEST_STRING_1, move.GetKeyName(), TEST_LOCATION); // check key name
+ DALI_TEST_EQUALS("I", move.GetLogicalKey(), TEST_LOCATION); // check logical key string
+ DALI_TEST_EQUALS("i", move.GetKeyString(), TEST_LOCATION); // check key string
+ DALI_TEST_EQUALS(99, move.GetKeyCode(), TEST_LOCATION); // check keyCode
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, move.GetKeyModifier(), TEST_LOCATION); // check modifier
+ DALI_TEST_EQUALS(0lu, move.GetTime(), TEST_LOCATION); // check time
+ DALI_TEST_EQUALS(KeyEvent::DOWN, move.GetState(), TEST_LOCATION); // check state
+ DALI_TEST_EQUALS("", move.GetCompose(), TEST_LOCATION); // check compose
+ DALI_TEST_EQUALS("", move.GetDeviceName(), TEST_LOCATION); // check device name
+ DALI_TEST_EQUALS(Device::Class::NONE, move.GetDeviceClass(), TEST_LOCATION); // check device class
+ DALI_TEST_EQUALS(Device::Subclass::NONE, move.GetDeviceSubclass(), TEST_LOCATION); // check device subclass
+
+ DALI_TEST_CHECK( !event );
END_TEST;
}
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event;
- DALI_TEST_EQUALS(0, event.keyModifier, TEST_LOCATION);
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, CTRL_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE); // set name to test, key string to i and modifier to shift
+ DALI_TEST_CHECK( event );
+
+ DALI_TEST_EQUALS(CTRL_MODIFIER, event.GetKeyModifier(), TEST_LOCATION);
+ DALI_TEST_EQUALS(false, event.IsShiftModifier(), TEST_LOCATION); // check IsShiftModifier
- event.keyModifier = SHIFT_MODIFIER; // Set to Shift Modifier
+ DevelKeyEvent::SetKeyModifier( event, SHIFT_MODIFIER ); // Set to Shift Modifier
- DALI_TEST_EQUALS(SHIFT_MODIFIER, event.keyModifier, TEST_LOCATION); // check able to set
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION); // check able to set
DALI_TEST_EQUALS(true, event.IsShiftModifier(), TEST_LOCATION); // check IsShiftModifier
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event;
- DALI_TEST_EQUALS(0, event.keyModifier, TEST_LOCATION);
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE); // set name to test, key string to i and modifier to shift
+ DALI_TEST_CHECK( event );
- event.keyModifier = CTRL_MODIFIER; // Set to Ctrl Modifier
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION);
+ DALI_TEST_EQUALS(false, event.IsCtrlModifier(), TEST_LOCATION); // check IsCtrlModifier
- DALI_TEST_EQUALS(CTRL_MODIFIER, event.keyModifier, TEST_LOCATION); // check able to set
+ DevelKeyEvent::SetKeyModifier( event, CTRL_MODIFIER ); // Set to Ctrl Modifier
+
+ DALI_TEST_EQUALS(CTRL_MODIFIER, event.GetKeyModifier(), TEST_LOCATION); // check able to set
DALI_TEST_EQUALS(true, event.IsCtrlModifier(), TEST_LOCATION); // check IsCtrlModifier
END_TEST;
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event;
- DALI_TEST_EQUALS(0, event.keyModifier, TEST_LOCATION);
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE); // set name to test, key string to i and modifier to shift
+ DALI_TEST_CHECK( event );
+
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION);
+ DALI_TEST_EQUALS(false, event.IsAltModifier(), TEST_LOCATION); // check IsAltModifier
- event.keyModifier = ALT_MODIFIER; // Set to Alt Modifier
+ DevelKeyEvent::SetKeyModifier( event, ALT_MODIFIER ); // Set to Alt Modifier
- DALI_TEST_EQUALS(ALT_MODIFIER, event.keyModifier, TEST_LOCATION); // check able to set
+ DALI_TEST_EQUALS(ALT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION); // check able to set
DALI_TEST_EQUALS(true, event.IsAltModifier(), TEST_LOCATION); // IsAltModifier
END_TEST;
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event("i","i", 0, CTRL_MODIFIER, 0, KeyEvent::Down);
+ Dali::KeyEvent event = DevelKeyEvent::New("i", "I", "i", 0, CTRL_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE);
- DALI_TEST_EQUALS(CTRL_MODIFIER, event.keyModifier, TEST_LOCATION); // check different modifier used
+ DALI_TEST_EQUALS(CTRL_MODIFIER, event.GetKeyModifier(), TEST_LOCATION);
DALI_TEST_EQUALS(false, event.IsShiftModifier(), TEST_LOCATION);
END_TEST;
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event("i","i", 0, ALT_MODIFIER, 0, KeyEvent::Up);
+ Dali::KeyEvent event = DevelKeyEvent::New("i", "I", "i", 0, ALT_MODIFIER, 0lu, KeyEvent::UP, "", "", Device::Class::NONE, Device::Subclass::NONE);
- DALI_TEST_EQUALS(ALT_MODIFIER, event.keyModifier, TEST_LOCATION); // check different modifier used
+ DALI_TEST_EQUALS(ALT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION);
DALI_TEST_EQUALS(false, event.IsCtrlModifier(), TEST_LOCATION);
END_TEST;
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event("i","i", 0, SHIFT_MODIFIER, 0, KeyEvent::Up);
+ Dali::KeyEvent event = DevelKeyEvent::New("i", "I", "i", 0, SHIFT_MODIFIER, 0lu, KeyEvent::UP, "", "", Device::Class::NONE, Device::Subclass::NONE);
- DALI_TEST_EQUALS(SHIFT_MODIFIER, event.keyModifier, TEST_LOCATION); // check different modifier used
+ DALI_TEST_EQUALS(SHIFT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION);
DALI_TEST_EQUALS(false, event.IsAltModifier(), TEST_LOCATION);
END_TEST;
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event("i","i", 0, SHIFT_AND_CTRL_MODIFIER, 0, KeyEvent::Down);
+ Dali::KeyEvent event = DevelKeyEvent::New("i", "I", "i", 0, SHIFT_AND_CTRL_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE);
DALI_TEST_EQUALS(true, (bool)(event.IsCtrlModifier() & event.IsShiftModifier()), TEST_LOCATION);
- event.keyModifier = SHIFT_MODIFIER;
+ DevelKeyEvent::SetKeyModifier( event, SHIFT_MODIFIER ); // Set to Shift Modifier
DALI_TEST_EQUALS(false, (bool)(event.IsCtrlModifier() & event.IsShiftModifier()), TEST_LOCATION);
END_TEST;
{
TestApplication application; // Reset all test adapter return codes
- KeyEvent event("i","i", 0, SHIFT_AND_CTRL_MODIFIER, 0, KeyEvent::Down);
+ Dali::KeyEvent event = DevelKeyEvent::New("i", "I", "i", 0, SHIFT_AND_CTRL_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE);
DALI_TEST_EQUALS(true, (bool)(event.IsCtrlModifier() | event.IsAltModifier()), TEST_LOCATION);
- event.keyModifier = SHIFT_MODIFIER;
-
- DALI_TEST_EQUALS(false, (bool)(event.IsCtrlModifier() & event.IsAltModifier()), TEST_LOCATION);
- END_TEST;
-}
-
-// Positive test case for a method
-int UtcDaliKeyEventState(void)
-{
- TestApplication application; // Reset all test adapter return codes
-
- KeyEvent event("i","i", 0, SHIFT_AND_CTRL_MODIFIER, 0, KeyEvent::Down);
- DALI_TEST_EQUALS(true, (bool)(event.IsCtrlModifier() | event.IsAltModifier()), TEST_LOCATION);
-
- event.keyModifier = SHIFT_MODIFIER;
+ DevelKeyEvent::SetKeyModifier( event, SHIFT_MODIFIER ); // Set to Shift Modifier
DALI_TEST_EQUALS(false, (bool)(event.IsCtrlModifier() & event.IsAltModifier()), TEST_LOCATION);
END_TEST;
DALI_TEST_EQUALS( keyEvent.keyCode, -1, TEST_LOCATION );
DALI_TEST_EQUALS( keyEvent.keyModifier, 0, TEST_LOCATION );
DALI_TEST_EQUALS( keyEvent.time, 0lu, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.state, Integration::KeyEvent::Down, TEST_LOCATION);
+ DALI_TEST_EQUALS( keyEvent.state, Integration::KeyEvent::DOWN, TEST_LOCATION);
+ DALI_TEST_EQUALS( keyEvent.compose, std::string(), TEST_LOCATION);
+ DALI_TEST_EQUALS( keyEvent.deviceName, std::string(), TEST_LOCATION);
+ DALI_TEST_EQUALS( keyEvent.deviceClass, Device::Class::NONE, TEST_LOCATION);
+ DALI_TEST_EQUALS( keyEvent.deviceSubclass, Device::Subclass::NONE, TEST_LOCATION);
}
{
const int keyCode(333);
const int keyModifier(312);
const unsigned long timeStamp(132);
- const Integration::KeyEvent::State keyState(Integration::KeyEvent::Up);
+ const Integration::KeyEvent::State keyState(Integration::KeyEvent::UP);
const std::string compose("compose");
const std::string deviceName("hwKeyboard");
const Device::Class::Type deviceClass = Device::Class::KEYBOARD;
END_TEST;
}
-int UtcDaliIntegrationKeyEventConvertor(void)
+int UtcDaliKeyEventSetKeyName(void)
{
TestApplication application;
- KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::Down); // set name to test, key string to i and modifier to shift
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE);
- Integration::KeyEvent keyEvent( event );
+ DALI_TEST_EQUALS( TEST_STRING_1, event.GetKeyName(), TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.type, Integration::Event::Key, TEST_LOCATION );
- DALI_TEST_CHECK( keyEvent.keyName == TEST_STRING_1 );
- DALI_TEST_CHECK( keyEvent.logicalKey == "" );
- DALI_TEST_CHECK( keyEvent.keyString == "i" );
- DALI_TEST_EQUALS( keyEvent.keyCode, 99, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.keyModifier, SHIFT_MODIFIER, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.time, 0lu, TEST_LOCATION );
- DALI_TEST_EQUALS( keyEvent.state, Integration::KeyEvent::Down, TEST_LOCATION);
- DALI_TEST_EQUALS( keyEvent.compose, "", TEST_LOCATION);
- DALI_TEST_EQUALS( keyEvent.deviceName, "", TEST_LOCATION);
- DALI_TEST_EQUALS( keyEvent.deviceClass, Device::Class::NONE, TEST_LOCATION);
- DALI_TEST_EQUALS( keyEvent.deviceSubclass, Device::Subclass::NONE, TEST_LOCATION);
+ DevelKeyEvent::SetKeyName( event, "keyName" );
+ DALI_TEST_EQUALS( "keyName", event.GetKeyName(), TEST_LOCATION );
END_TEST;
}
-int UtcDaliKeyEventSetCompose(void)
+int UtcDaliKeyEventSetKeyString(void)
{
TestApplication application;
- KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::Down);
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE);
+
+ DALI_TEST_EQUALS( "i", event.GetKeyString(), TEST_LOCATION );
- DALI_TEST_EQUALS( event.GetCompose(), "", TEST_LOCATION);
+ DevelKeyEvent::SetKeyString( event, "keyString" );
+ DALI_TEST_EQUALS( "keyString", event.GetKeyString(), TEST_LOCATION );
END_TEST;
}
-int UtcDaliKeyEventSetDeviceName(void)
+int UtcDaliKeyEventSetKeyCode(void)
{
TestApplication application;
- KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::Down);
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE);
- DALI_TEST_EQUALS( event.GetDeviceName(), "", TEST_LOCATION);
+ DALI_TEST_EQUALS( 99, event.GetKeyCode(), TEST_LOCATION );
+
+ DevelKeyEvent::SetKeyCode( event, 88 );
+ DALI_TEST_EQUALS( 88, event.GetKeyCode(), TEST_LOCATION );
END_TEST;
}
-int UtcDaliKeyEventSetDeviceClass(void)
+int UtcDaliKeyEventSetKeyModifier(void)
{
TestApplication application;
- KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::Down);
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE);
+
+ DALI_TEST_EQUALS( SHIFT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION );
- DALI_TEST_EQUALS( event.GetDeviceClass(), Device::Class::NONE, TEST_LOCATION);
+ DevelKeyEvent::SetKeyModifier( event, ALT_MODIFIER );
+ DALI_TEST_EQUALS( ALT_MODIFIER, event.GetKeyModifier(), TEST_LOCATION );
END_TEST;
}
-int UtcDaliKeyEventSetDeviceSubclass(void)
+int UtcDaliKeyEventSetTime(void)
{
TestApplication application;
- KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::Down);
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE);
- DALI_TEST_EQUALS( event.GetDeviceSubclass(), Device::Subclass::NONE, TEST_LOCATION);
+ DALI_TEST_EQUALS( 0lu, event.GetTime(), TEST_LOCATION );
+
+ DevelKeyEvent::SetTime( event, 100lu );
+ DALI_TEST_EQUALS( 100lu, event.GetTime(), TEST_LOCATION );
END_TEST;
}
-int UtcDaliKeyEventSetLogicalKey(void)
+int UtcDaliKeyEventSetState(void)
{
TestApplication application;
- KeyEvent event(TEST_STRING_1,"i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::Down);
+ Dali::KeyEvent event = DevelKeyEvent::New(TEST_STRING_1, "I", "i", 99, SHIFT_MODIFIER, 0lu, KeyEvent::DOWN, "", "", Device::Class::NONE, Device::Subclass::NONE);
+
+ DALI_TEST_EQUALS( KeyEvent::DOWN, event.GetState(), TEST_LOCATION );
- DALI_TEST_EQUALS( DevelKeyEvent::GetLogicalKey( event ), "", TEST_LOCATION );
+ DevelKeyEvent::SetState( event, KeyEvent::UP );
+ DALI_TEST_EQUALS( KeyEvent::UP, event.GetState(), TEST_LOCATION );
END_TEST;
}
LongPressGestureDetector detector = LongPressGestureDetector::New();
- detector.SetTouchesRequired(2,2);
-
Actor actor = Actor::New();
actor.SetProperty( Actor::Property::SIZE, Vector2( 100.0f, 100.0f ) );
actor.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::TOP_LEFT);
application.Render();
detector.Attach(actor);
+ detector.SetTouchesRequired(2,2); // Set after we've attached forcing us to change things internally
SignalData data;
GestureReceivedFunctor functor(data);
*
* Check rendered vertex buffer is the right size for the initial property buffer
*
- * Check PropertyBuffer set via SetData can be read thru property system
- * Check PropertyBuffer property setters / getters
- * Check vertex PropertyBuffer set via properties renders as expected
- * Check Index propertyBuffer set via properties renders as expected
+ * Check VertexBuffer set via SetData renders as expected
+ * Check IndexBuffer set via properties renders as expected
*
* Check geometry type renders correctly as the matching GL draw call and type
*
};
Property::Map vertexFormat;
vertexFormat["aPosition"] = Property::VECTOR2;
- PropertyBuffer vertexBuffer = PropertyBuffer::New( vertexFormat );
+ VertexBuffer vertexBuffer = VertexBuffer::New( vertexFormat );
vertexBuffer.SetData( shapes, sizeof(shapes)/sizeof(shapes[0]));
// --------------------------------------------------------------------------
/*
- * 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.
#include <stdlib.h>
#include <dali/public-api/dali-core.h>
-#include <dali/devel-api/events/gesture-devel.h>
-#include <dali/devel-api/events/rotation-gesture.h>
#include <dali-test-suite-utils.h>
using namespace Dali;
RotationGesture gesture(Gesture::Started);
DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture.type, TEST_LOCATION);
RotationGesture gesture2(Gesture::Continuing);
DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture2.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture2.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture2.type, TEST_LOCATION);
RotationGesture gesture3(Gesture::Finished);
DALI_TEST_EQUALS(Gesture::Finished, gesture3.state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture3.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture3.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture3.type, TEST_LOCATION);
// Test copy constructor
gesture3.rotation = 3.0f;
RotationGesture rotation(gesture3);
DALI_TEST_EQUALS(Gesture::Finished, rotation.state, TEST_LOCATION);
DALI_TEST_EQUALS(3.0f, rotation.rotation.radian, TEST_LOCATION);
-DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( rotation.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, rotation.type, TEST_LOCATION);
END_TEST;
}
RotationGesture gesture(Gesture::Started);
DALI_TEST_EQUALS(Gesture::Started, gesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture.type, TEST_LOCATION);
RotationGesture gesture2(Gesture::Continuing);
DALI_TEST_EQUALS(Gesture::Continuing, gesture2.state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture2.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture2.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture2.type, TEST_LOCATION);
gesture2.rotation.radian = 3.0f;
gesture = gesture2;
DALI_TEST_EQUALS(Gesture::Continuing, gesture.state, TEST_LOCATION);
DALI_TEST_EQUALS(3.0f, gesture.rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture.type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture.type, TEST_LOCATION);
END_TEST;
}
RotationGesture* gesture = new RotationGesture( Gesture::Started );
DALI_TEST_EQUALS(Gesture::Started, gesture->state, TEST_LOCATION);
DALI_TEST_EQUALS(0.0f, gesture->rotation.radian, TEST_LOCATION);
- DALI_TEST_EQUALS(DevelGesture::Rotation, static_cast< DevelGesture::Type >( gesture->type ), TEST_LOCATION);
+ DALI_TEST_EQUALS(Gesture::Rotation, gesture->type, TEST_LOCATION);
delete gesture;
END_TEST;
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/render-task-list-integ.h>
-#include <dali/devel-api/events/gesture-devel.h>
-#include <dali/devel-api/events/rotation-gesture.h>
-#include <dali/devel-api/events/rotation-gesture-detector.h>
#include <dali-test-suite-utils.h>
#include <test-touch-event-utils.h>
#include <dali/public-api/dali-core.h>
#include <dali/integration-api/input-options.h>
#include <dali/integration-api/events/touch-event-integ.h>
-#include <dali/devel-api/events/rotation-gesture.h>
-#include <dali/devel-api/events/rotation-gesture-detector.h>
#include <dali-test-suite-utils.h>
{
functorCalled = false;
- receivedKeyEvent.keyModifier = 0;
- receivedKeyEvent.keyPressedName.clear();
- receivedKeyEvent.keyPressed.clear();
+ receivedKeyEvent.Reset();
}
bool functorCalled;
{
functorCalled = false;
- receivedKeyEvent.keyModifier = 0;
- receivedKeyEvent.keyPressedName.clear();
- receivedKeyEvent.keyPressed.clear();
+ receivedKeyEvent.Reset();
}
bool functorCalled;
KeyEventReceivedFunctor functor( data );
scene.KeyEventSignal().Connect( &application, functor );
- Integration::KeyEvent event( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Down, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event( "i", "", "i", 0, 0, 0, Integration::KeyEvent::DOWN, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Up, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::UP, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event2 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event2.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event2.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event2.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event2.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event2.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event2.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event3 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event3.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event3.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event3.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event3.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event3.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event3.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event4 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event4.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event4.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event4.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event4.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
END_TEST;
}
KeyEventGeneratedReceivedFunctor functor( data );
scene.KeyEventGeneratedSignal().Connect( &application, functor );
- Integration::KeyEvent event( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event( "a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Up, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::UP, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event2 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event2.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event2.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event2.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event2.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event2.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event2.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event3 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event3.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event3.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event3.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event3.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event3.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event3.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event4 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event4.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event4.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event4.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event4.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
END_TEST;
}
{
functorCalled = false;
- receivedKeyEvent.keyModifier = 0;
- receivedKeyEvent.keyPressedName.clear();
- receivedKeyEvent.keyPressed.clear();
+ receivedKeyEvent.Reset();
}
bool functorCalled;
{
functorCalled = false;
- receivedKeyEvent.keyModifier = 0;
- receivedKeyEvent.keyPressedName.clear();
- receivedKeyEvent.keyPressed.clear();
+ receivedKeyEvent.Reset();
}
bool functorCalled;
KeyEventGeneratedReceivedFunctor functor2( data2 );
GetImplementation( stage ).ConnectSignal( &application, "keyEventGenerated", functor2 );
- Integration::KeyEvent event( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event( "a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Up, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::UP, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event2 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event2.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event2.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event2.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event2.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event2.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event2.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event3 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event3.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event3.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event3.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event3.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event3.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event3.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event4 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event4.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event4.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event4.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event4.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
END_TEST;
}
KeyEventReceivedFunctor functor( data );
stage.KeyEventSignal().Connect( &application, functor );
- Integration::KeyEvent event( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Down, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event( "i", "", "i", 0, 0, 0, Integration::KeyEvent::DOWN, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::Up, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event2( "i", "", "i", 0, 0, 0, Integration::KeyEvent::UP, "i", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event2 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event2.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event2.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event2.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event2.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event2.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event2.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event2.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Down, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event3( "a", "", "a", 0, 0, 0, Integration::KeyEvent::DOWN, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event3 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event3.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event3.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event3.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event3.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event3.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event3.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event3.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
data.Reset();
- Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::Up, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
+ Integration::KeyEvent event4( "a", "", "a", 0, 0, 0, Integration::KeyEvent::UP, "a", DEFAULT_DEVICE_NAME, Device::Class::NONE, Device::Subclass::NONE );
application.ProcessEvent( event4 );
DALI_TEST_EQUALS( true, data.functorCalled, TEST_LOCATION );
- DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.keyModifier );
- DALI_TEST_CHECK( event4.keyName == data.receivedKeyEvent.keyPressedName );
- DALI_TEST_CHECK( event4.keyString == data.receivedKeyEvent.keyPressed );
- DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.state ) );
+ DALI_TEST_CHECK( event4.keyModifier == data.receivedKeyEvent.GetKeyModifier() );
+ DALI_TEST_CHECK( event4.keyName == data.receivedKeyEvent.GetKeyName() );
+ DALI_TEST_CHECK( event4.keyString == data.receivedKeyEvent.GetKeyString() );
+ DALI_TEST_CHECK( event4.state == static_cast<Integration::KeyEvent::State>( data.receivedKeyEvent.GetState() ) );
END_TEST;
}
#include <dali/internal/event/common/type-info-impl.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/hover-event-integ.h>
-#include <dali/devel-api/events/rotation-gesture-detector.h>
using namespace Dali;
#include <mesh-builder.h>
-void propertyBuffer_test_startup(void)
+void vertexBuffer_test_startup(void)
{
test_return_value = TET_UNDEF;
}
-void propertyBuffer_test_cleanup(void)
+void vertexBuffer_test_cleanup(void)
{
test_return_value = TET_PASS;
}
-int UtcDaliPropertyBufferNew01(void)
+int UtcDaliVertexBufferNew01(void)
{
TestApplication application;
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat );
+ VertexBuffer vertexBuffer = VertexBuffer::New( texturedQuadVertexFormat );
- DALI_TEST_EQUALS( (bool)propertyBuffer, true, TEST_LOCATION );
+ DALI_TEST_EQUALS( (bool)vertexBuffer, true, TEST_LOCATION );
END_TEST;
}
-int UtcDaliPropertyBufferNew02(void)
+int UtcDaliVertexBufferNew02(void)
{
TestApplication application;
- PropertyBuffer propertyBuffer;
- DALI_TEST_EQUALS( (bool)propertyBuffer, false, TEST_LOCATION );
+ VertexBuffer vertexBuffer;
+ DALI_TEST_EQUALS( (bool)vertexBuffer, false, TEST_LOCATION );
END_TEST;
}
-int UtcDaliPropertyBufferDownCast01(void)
+int UtcDaliVertexBufferDownCast01(void)
{
TestApplication application;
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat );
+ VertexBuffer vertexBuffer = VertexBuffer::New( texturedQuadVertexFormat );
- BaseHandle handle(propertyBuffer);
- PropertyBuffer propertyBuffer2 = PropertyBuffer::DownCast(handle);
- DALI_TEST_EQUALS( (bool)propertyBuffer2, true, TEST_LOCATION );
+ BaseHandle handle(vertexBuffer);
+ VertexBuffer vertexBuffer2 = VertexBuffer::DownCast(handle);
+ DALI_TEST_EQUALS( (bool)vertexBuffer2, true, TEST_LOCATION );
END_TEST;
}
-int UtcDaliPropertyBufferDownCast02(void)
+int UtcDaliVertexBufferDownCast02(void)
{
TestApplication application;
Handle handle = Handle::New(); // Create a custom object
- PropertyBuffer propertyBuffer = PropertyBuffer::DownCast(handle);
- DALI_TEST_EQUALS( (bool)propertyBuffer, false, TEST_LOCATION );
+ VertexBuffer vertexBuffer = VertexBuffer::DownCast(handle);
+ DALI_TEST_EQUALS( (bool)vertexBuffer, false, TEST_LOCATION );
END_TEST;
}
-int UtcDaliPropertyBufferCopyConstructor(void)
+int UtcDaliVertexBufferCopyConstructor(void)
{
TestApplication application;
- PropertyBuffer propertyBuffer = CreatePropertyBuffer();
+ VertexBuffer vertexBuffer = CreateVertexBuffer();
- PropertyBuffer propertyBufferCopy(propertyBuffer);
+ VertexBuffer vertexBufferCopy(vertexBuffer);
- DALI_TEST_EQUALS( (bool)propertyBufferCopy, true, TEST_LOCATION );
- DALI_TEST_EQUALS( propertyBufferCopy.GetSize(), 0u, TEST_LOCATION );
+ DALI_TEST_EQUALS( (bool)vertexBufferCopy, true, TEST_LOCATION );
+ DALI_TEST_EQUALS( vertexBufferCopy.GetSize(), 0u, TEST_LOCATION );
END_TEST;
}
-int UtcDaliPropertyBufferAssignmentOperator(void)
+int UtcDaliVertexBufferAssignmentOperator(void)
{
TestApplication application;
- PropertyBuffer propertyBuffer = CreatePropertyBuffer();
+ VertexBuffer vertexBuffer = CreateVertexBuffer();
- PropertyBuffer propertyBuffer2;
- DALI_TEST_EQUALS( (bool)propertyBuffer2, false, TEST_LOCATION );
+ VertexBuffer vertexBuffer2;
+ DALI_TEST_EQUALS( (bool)vertexBuffer2, false, TEST_LOCATION );
- propertyBuffer2 = propertyBuffer;
- DALI_TEST_EQUALS( (bool)propertyBuffer2, true, TEST_LOCATION );
- DALI_TEST_EQUALS( propertyBuffer2.GetSize(), 0u, TEST_LOCATION );
+ vertexBuffer2 = vertexBuffer;
+ DALI_TEST_EQUALS( (bool)vertexBuffer2, true, TEST_LOCATION );
+ DALI_TEST_EQUALS( vertexBuffer2.GetSize(), 0u, TEST_LOCATION );
END_TEST;
}
-int UtcDaliPropertyBufferMoveConstructor(void)
+int UtcDaliVertexBufferMoveConstructor(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 );
+ VertexBuffer vertexBuffer = CreateVertexBuffer();
+ DALI_TEST_CHECK( vertexBuffer );
+ DALI_TEST_EQUALS( 1, vertexBuffer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, vertexBuffer.GetSize(), TEST_LOCATION );
- PropertyBuffer move = std::move( propertyBuffer );
+ VertexBuffer move = std::move( vertexBuffer );
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 );
+ DALI_TEST_CHECK( !vertexBuffer );
END_TEST;
}
-int UtcDaliPropertyBufferMoveAssignment(void)
+int UtcDaliVertexBufferMoveAssignment(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 );
+ VertexBuffer vertexBuffer = CreateVertexBuffer();
+ DALI_TEST_CHECK( vertexBuffer );
+ DALI_TEST_EQUALS( 1, vertexBuffer.GetBaseObject().ReferenceCount(), TEST_LOCATION );
+ DALI_TEST_EQUALS( 0u, vertexBuffer.GetSize(), TEST_LOCATION );
- PropertyBuffer move;
- move = std::move( propertyBuffer );
+ VertexBuffer move;
+ move = std::move( vertexBuffer );
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 );
+ DALI_TEST_CHECK( !vertexBuffer );
END_TEST;
}
-int UtcDaliPropertyBufferSetData01(void)
+int UtcDaliVertexBufferSetData01(void)
{
TestApplication application;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
{
- PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat );
- DALI_TEST_EQUALS( (bool)propertyBuffer, true, TEST_LOCATION );
+ VertexBuffer vertexBuffer = VertexBuffer::New( texturedQuadVertexFormat );
+ DALI_TEST_EQUALS( (bool)vertexBuffer, true, TEST_LOCATION );
const float halfQuadSize = .5f;
struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
{ Vector2(-halfQuadSize, halfQuadSize), Vector2(0.f, 1.f) },
{ Vector2( halfQuadSize, halfQuadSize), Vector2(1.f, 1.f) } };
- propertyBuffer.SetData( texturedQuadVertexData, 4 );
+ vertexBuffer.SetData( texturedQuadVertexData, 4 );
Geometry geometry = Geometry::New();
- geometry.AddVertexBuffer( propertyBuffer );
+ geometry.AddVertexBuffer( vertexBuffer );
Shader shader = CreateShader();
Renderer renderer = Renderer::New(geometry, shader);
END_TEST;
}
-int UtcDaliPropertyBufferSetData02(void)
+int UtcDaliVertexBufferSetData02(void)
{
TestApplication application;
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat );
- DALI_TEST_EQUALS( (bool)propertyBuffer, true, TEST_LOCATION );
+ VertexBuffer vertexBuffer = VertexBuffer::New( texturedQuadVertexFormat );
+ DALI_TEST_EQUALS( (bool)vertexBuffer, true, TEST_LOCATION );
const float halfQuadSize = .5f;
struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
{ Vector2(-halfQuadSize, halfQuadSize), Vector2(0.f, 1.f) },
{ Vector2( halfQuadSize, halfQuadSize), Vector2(1.f, 1.f) } };
- propertyBuffer.SetData( texturedQuadVertexData, 4 );
+ vertexBuffer.SetData( texturedQuadVertexData, 4 );
Geometry geometry = Geometry::New();
- geometry.AddVertexBuffer( propertyBuffer );
+ geometry.AddVertexBuffer( vertexBuffer );
Shader shader = CreateShader();
Renderer renderer = Renderer::New(geometry, shader);
DALI_TEST_EQUALS( bufferDataCalls[0], sizeof(texturedQuadVertexData), TEST_LOCATION );
}
- // Re-upload the data on the propertyBuffer
- propertyBuffer.SetData( texturedQuadVertexData, 4 );
+ // Re-upload the data on the vertexBuffer
+ vertexBuffer.SetData( texturedQuadVertexData, 4 );
application.SendNotification();
application.Render(0);
END_TEST;
}
-int UtcDaliPropertyBufferInvalidTypeN(void)
+int UtcDaliVertexBufferInvalidTypeN(void)
{
TestApplication application;
try
{
- PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat );
+ VertexBuffer vertexBuffer = VertexBuffer::New( texturedQuadVertexFormat );
tet_result(TET_FAIL);
}
catch ( Dali::DaliException& e )
{
- DALI_TEST_ASSERT( e, "Property::Type not supported in PropertyBuffer", TEST_LOCATION );
+ DALI_TEST_ASSERT( e, "Property::Type not supported in VertexBuffer", TEST_LOCATION );
}
END_TEST;
}
-int UtcDaliPropertyBufferSetDataNegative(void)
+int UtcDaliVertexBufferSetDataNegative(void)
{
TestApplication application;
- Dali::PropertyBuffer instance;
+ Dali::VertexBuffer instance;
try
{
void* arg1(nullptr);
END_TEST;
}
-int UtcDaliPropertyBufferGetSizeNegative(void)
+int UtcDaliVertexBufferGetSizeNegative(void)
{
TestApplication application;
- Dali::PropertyBuffer instance;
+ Dali::VertexBuffer instance;
try
{
instance.GetSize();
struct Vector2;
struct Vector3;
struct Vector4;
-struct KeyEvent;
+class KeyEvent;
/**
* @brief The Stage is a top-level object used for displaying a tree of Actors.
/*\r
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.\r
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
namespace DevelKeyEvent\r
{\r
\r
-std::string GetLogicalKey( KeyEvent keyEvent )\r
+KeyEvent New( const std::string& keyName,\r
+ const std::string& logicalKey,\r
+ const std::string& keyString,\r
+ int keyCode,\r
+ int keyModifier,\r
+ unsigned long timeStamp,\r
+ const Dali::KeyEvent::State& keyState,\r
+ const std::string& compose,\r
+ const std::string& deviceName,\r
+ const Device::Class::Type deviceClass,\r
+ const Device::Subclass::Type deviceSubclass )\r
{\r
- return GetImplementation( &keyEvent )->GetLogicalKey();\r
+ Internal::KeyEventPtr internal = Internal::KeyEvent::New( keyName, logicalKey, keyString, keyCode, keyModifier, timeStamp, keyState, compose, deviceName, deviceClass, deviceSubclass );\r
+\r
+ return KeyEvent( internal.Get() );\r
+}\r
+\r
+void SetKeyName( KeyEvent keyEvent, const std::string& keyName )\r
+{\r
+ GetImplementation( keyEvent ).SetKeyName( keyName );\r
+}\r
+\r
+void SetKeyString( KeyEvent keyEvent, const std::string& keyString )\r
+{\r
+ GetImplementation( keyEvent ).SetKeyString( keyString );\r
+}\r
+\r
+void SetKeyCode( KeyEvent keyEvent, int32_t keyCode )\r
+{\r
+ GetImplementation( keyEvent ).SetKeyCode( keyCode );\r
+}\r
+\r
+void SetKeyModifier( KeyEvent keyEvent, int32_t keyModifier )\r
+{\r
+ GetImplementation( keyEvent ).SetKeyModifier( keyModifier );\r
+}\r
+\r
+void SetTime( KeyEvent keyEvent, unsigned long time )\r
+{\r
+ GetImplementation( keyEvent ).SetTime( time );\r
+}\r
+\r
+void SetState( KeyEvent keyEvent, const KeyEvent::State& state )\r
+{\r
+ GetImplementation( keyEvent ).SetState( state );\r
}\r
\r
} // namespace DevelKeyEvent\r
#define DALI_KEY_EVENT_DEVEL_H\r
\r
/*\r
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.\r
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
{\r
\r
/**\r
- * @brief Gets the logical key string.\r
+ * @brief Creates an initialized WheelEvent.\r
*\r
- * For example, when the user presses 'shift' key and '1' key together, the logical key is "exclamation".\r
- * Plus, the keyPressedName is "1", and the keyPressed is "!".\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.\r
+ * @param[in] logicalKey The logical key symbol (eg. shift + 1 == "exclamation")\r
+ * @param[in] keyString The string of input characters or key pressed\r
+ * @param[in] keyCode The unique key code for the key pressed.\r
+ * @param[in] keyModifier The key modifier for special keys like shift and alt\r
+ * @param[in] timeStamp The time (in ms) that the key event occurred.\r
+ * @param[in] keyState The state of the key event.\r
+ * @param[in] compose The key compose\r
+ * @param[in] deviceName The name of device the key event originated from\r
+ * @param[in] deviceClass The class of device the key event originated from\r
+ * @param[in] deviceSubclass The subclass of device the key event originated from\r
+ * @return A handle to a newly allocated Dali resource\r
+ */\r
+DALI_CORE_API KeyEvent New( const std::string& keyName,\r
+ const std::string& logicalKey,\r
+ const std::string& keyString,\r
+ int keyCode,\r
+ int keyModifier,\r
+ unsigned long timeStamp,\r
+ const Dali::KeyEvent::State& keyState,\r
+ const std::string& compose,\r
+ const std::string& deviceName,\r
+ const Device::Class::Type deviceClass,\r
+ const Device::Subclass::Type deviceSubclass );\r
+\r
+/**\r
+ * @brief Set the name given to the key pressed\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] keyName The name given to the key pressed.\r
+ */\r
+void SetKeyName( KeyEvent keyEvent, const std::string& keyName );\r
+\r
+/**\r
+ * @brief Set the actual string of input characters that should be used for input editors.\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] keyString The actual string of input characters\r
+ */\r
+void SetKeyString( KeyEvent keyEvent, const std::string& keyString );\r
+\r
+/**\r
+ * @brief Set the unique key code for the key pressed.\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] keyCode The unique key code for the key pressed\r
+ */\r
+void SetKeyCode( KeyEvent keyEvent, int32_t keyCode );\r
+\r
+/**\r
+ * @brief Set the key modifier for special keys like Shift, Alt and Ctrl which modify the next key pressed.\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] keyModifier The key modifier\r
+ */\r
+void SetKeyModifier( KeyEvent keyEvent, int32_t keyModifier );\r
+\r
+/**\r
+ * @brief Set the time (in ms) that the key event occurred.\r
+ *\r
+ * @SINCE_1_9.27\r
+ * @param[in] keyEvent The instance of KeyEvent.\r
+ * @param[in] time The time (in ms)\r
+ */\r
+void SetTime( KeyEvent keyEvent, unsigned long time );\r
+\r
+/**\r
+ * @brief Set the state of the key event.\r
*\r
+ * @SINCE_1_9.27\r
* @param[in] keyEvent The instance of KeyEvent.\r
- * @return The logical key symbol\r
+ * @param[in] state The state of the key event\r
*/\r
-DALI_CORE_API std::string GetLogicalKey( KeyEvent keyEvent );\r
+void SetState( KeyEvent keyEvent, const KeyEvent::State& state );\r
\r
} // namespace DevelKeyEvent\r
\r
${devel_api_src_dir}/common/stage.cpp
${devel_api_src_dir}/events/hit-test-algorithm.cpp
${devel_api_src_dir}/events/long-press-gesture-detector-devel.cpp
- ${devel_api_src_dir}/events/rotation-gesture.cpp
- ${devel_api_src_dir}/events/rotation-gesture-detector.cpp
${devel_api_src_dir}/events/key-event-devel.cpp
${devel_api_src_dir}/events/wheel-event-devel.cpp
${devel_api_src_dir}/images/distance-field.cpp
SET( devel_api_core_events_header_files
- ${devel_api_src_dir}/events/gesture-devel.h
${devel_api_src_dir}/events/hit-test-algorithm.h
${devel_api_src_dir}/events/long-press-gesture-detector-devel.h
- ${devel_api_src_dir}/events/rotation-gesture.h
- ${devel_api_src_dir}/events/rotation-gesture-detector.h
${devel_api_src_dir}/events/key-event-devel.h
${devel_api_src_dir}/events/wheel-event-devel.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.
namespace DevelHandle
{
-Property::Index GetPropertyIndex( const Handle& handle, Property::Index key )
-{
- return GetImplementation( handle ).GetPropertyIndex( key );
-}
-
-Property::Index GetPropertyIndex( const Handle& handle, Property::Key key )
-{
- return GetImplementation( handle ).GetPropertyIndex( key );
-}
-
-Property::Index RegisterProperty( Handle handle, Property::Index key, const std::string& name, const Property::Value& propertyValue )
-{
- return GetImplementation( handle ).RegisterProperty( name, key, propertyValue );
-}
-
-void SetProperties( Handle handle, const Property::Map& properties )
-{
- GetImplementation( handle ).SetProperties( properties );
-}
-
-void GetProperties( Handle handle, Property::Map& properties )
-{
- GetImplementation( handle ).GetProperties( properties );
-}
-
void SetTypeInfo( Handle& handle, const TypeInfo& typeInfo )
{
GetImplementation( handle ).SetTypeInfo( &GetImplementation( typeInfo ) );
}
-bool DoesCustomPropertyExist( Handle& handle, Property::Index index )
-{
- return GetImplementation( handle ).DoesCustomPropertyExist( index );
-}
-
-PropertySetSignalType& PropertySetSignal( Handle handle )
-{
- return GetImplementation( handle ).PropertySetSignal();
-}
-
} // namespace DevelHandle
} // namespace Dali
#define DALI_HANDLE_DEVEL_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.
{
/**
- * @brief Query the index of a custom property matching the given key.
- *
- * Returns the first custom property that matches the given integer key. This is
- * useful for other classes that know the key but not the name. Requires the property
- * to have been registered with the associated key.
- *
- * @note This key is not the same as the Property enum found in
- * objects such as Actor (which is a preset index).
- *
- * @param[in] handle The handle from where to retrieve the property index.
- * @param[in] key The integer key of the property
- *
- * @return The index of the property, or Property::INVALID_INDEX if no property exists with the given key.
- *
- * @note The key is not the same as the returned index, though it has the same type.
- */
-DALI_CORE_API Property::Index GetPropertyIndex( const Handle& handle, Property::Index key );
-
-/**
- * @brief Query the index of a property using the given key from a Property::Map
- *
- * @param[in] handle The handle from where to retrieve the property index.
- * @param[in] key The key of the property to search for.
- *
- * @return the matching property index of either the string key or the matching
- * custom property index of the index key, or Property::INVALID_INDEX if no
- * property matches the given key.
- *
- * @note See also, GetPropertyIndex(Property::Index) and GetPropertyIndex(const std::string&)
- */
-DALI_CORE_API Property::Index GetPropertyIndex( const Handle& handle, Property::Key key );
-
-/**
- * @brief Register a new animatable property with an integer key.
- *
- * @param[in] handle The handle where to register the property.
- * @param[in] key The integer key of the property.
- * @param[in] name The text key of the property.
- * @param[in] propertyValue The new value of the property.
- *
- * @return The index of the property or Property::INVALID_INDEX if registration failed
- *
- * @pre The object supports dynamic properties i.e. Supports(Handle::DYNAMIC_PROPERTIES) returns true.
- * Property names and keys are expected to be unique, but this is not enforced.
- * Property indices are unique to each registered custom property in a given object.
- *
- * @note Returns Property::INVALID_INDEX if registration failed. This can happen if you try to register
- * animatable property on an object that does not have scene graph object.
- *
- * @note The returned property index is not the same as the integer key (though it shares a type)
- *
- * This version of RegisterProperty associates both an integer key
- * and the text key with the property, allowing for lookup of the
- * property index by either key or name ( which is useful when other
- * classes know the key but not the name )
- *
- * @note Only the following types can be animated:
- * - Property::BOOLEAN
- * - Property::FLOAT
- * - Property::INTEGER
- * - Property::VECTOR2
- * - Property::VECTOR3
- * - Property::VECTOR4
- * - Property::MATRIX3
- * - Property::MATRIX
- * - Property::ROTATION
- * @note If a property with the desired name already exists, then the value given is just set.
- */
-DALI_CORE_API Property::Index RegisterProperty( Handle handle, Property::Index key, const std::string& name, const Property::Value& propertyValue );
-
-/**
- * @brief Sets all the properties in the given property map.
- *
- * @param[in] handle The handle to set the properties on
- * @param[in] properties The properties to set
- */
-DALI_CORE_API void SetProperties( Handle handle, const Property::Map& properties );
-
-/**
- * @brief Retrieves all the properties and the values for a handle.
- *
- * @param[in] handle The handle to retrieve properties from
- * @param[out] properties A map which is populated with the index-value pairs
- *
- * @note The properties map will be cleared by this method first.
- */
-DALI_CORE_API void GetProperties( Handle handle, Property::Map& properties );
-
-/**
* @brief Set the type-info that the object is created by.
*
* @note This is particularly useful to link C# custom control with its correct type-info in the native side
*/
DALI_CORE_API void SetTypeInfo( Handle& handle, const TypeInfo& typeInfo );
-
-/**
- * @brief Determine if the custom property index exists on this object without throwing a Dali::Exception.
- *
- * @note This does not check default properties.
- * @param[in] handle The handle to check
- * @param[in] index The index of the property to test for
- */
-DALI_CORE_API bool DoesCustomPropertyExist( Handle& handle, Property::Index index );
-
-/**
- * @brief PropertySetSignal function prototype for signal handler. Called when a property is set on this object.
- */
-using PropertySetSignalType = Signal< void( Handle& handle, Property::Index index, Property::Value value ) >;
-
-/**
- * @brief Get a signal when a property is set on this object through the API (i.e. not when animating)
- *
- * @param[in] handle The handle of the object to listen to.
- * @return The signal to attach a connection to.
- */
-DALI_CORE_API PropertySetSignalType& PropertySetSignal( Handle handle );
-
-/**
- * @brief Template to create a derived handle and set properties on it.
- *
- * @tparam T The derived class to create
- *
- * @param[in] properties The properties to set
- */
-template< typename T >
-DALI_INTERNAL T New( const Property::Map& properties )
-{
- T handle = T::New();
- SetProperties( handle, properties );
- return handle;
-}
-
} // namespace DevelHandle
} // namespace Dali
/*
- * Copyright (c) 2017 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.
keyCode( -1 ),
keyModifier( 0 ),
time( 0 ),
- state( KeyEvent::Down ),
+ state( KeyEvent::DOWN ),
compose( "" ),
deviceName( "" ),
deviceClass( Device::Class::NONE ),
{
}
-KeyEvent::KeyEvent( const Dali::KeyEvent& event )
-: Event( Key ),
- keyName( event.keyPressedName ),
- logicalKey( "" ),
- keyString( event.keyPressed ),
- keyCode( event.keyCode ),
- keyModifier( event.keyModifier ),
- time( event.time ),
- state( static_cast< Integration::KeyEvent::State >( event.state ) ),
- compose( "" ),
- deviceName( "" ),
- deviceClass( Device::Class::NONE ),
- deviceSubclass( Device::Subclass::NONE )
-{
- const Internal::KeyEventImpl* keyEventImpl = GetImplementation( &event );
- logicalKey = keyEventImpl->GetLogicalKey();
- compose = keyEventImpl->GetCompose();
- deviceName = keyEventImpl->GetDeviceName();
- deviceClass = keyEventImpl->GetDeviceClass();
- deviceSubclass = keyEventImpl->GetDeviceSubclass();
-}
-
KeyEvent::~KeyEvent()
{
}
#define DALI_INTEGRATION_KEY_EVENT_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.
// Specifies the state of the key event.
enum State
{
- Down, /**< Key down */
- Up, /**< Key up */
-
- Last
+ DOWN, /**< Key down */
+ UP, /**< Key up */
};
/**
/**
* Constructor
- * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
- * @param[in] logicalKey The logical key symbol (eg. shift + 1 == "exclamation")
- * @param[in] keyString A string of input characters or key pressed
- * @param[in] keyCode The unique key code for the key pressed.
- * @param[in] keyModifier The key modifier for special keys like shift and alt
- * @param[in] timeStamp The time (in ms) that the key event occurred.
- * @param[in] keyState The state of the key event.
- * @param[in] compose The key compose
- * @param[in] deviceName Name of device KeyEvent originated from
- * @param[in] deviceClass Class of device KeyEvent originated from
- * @param[in] deviceSubclass Subclass of device KeyEvent originated from
+ * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
+ * @param[in] logicalKey The logical key symbol (eg. shift + 1 == "exclamation")
+ * @param[in] keyString The string of input characters or key pressed
+ * @param[in] keyCode The unique key code for the key pressed.
+ * @param[in] keyModifier The key modifier for special keys like shift and alt
+ * @param[in] timeStamp The time (in ms) that the key event occurred.
+ * @param[in] keyState The state of the key event.
+ * @param[in] compose The key compose
+ * @param[in] deviceName The name of device KeyEvent originated from
+ * @param[in] deviceClass The class of device KeyEvent originated from
+ * @param[in] deviceSubclass The subclass of device KeyEvent originated from
*/
KeyEvent(const std::string& keyName,
const std::string& logicalKey,
const Device::Subclass::Type deviceSubclass );
/**
- * Constructor, creates a Integration::KeyEvent from a Dali::KeyEvent
- * @param[in] event Dali::KeyEvent to convert from
- */
- explicit KeyEvent( const Dali::KeyEvent& event );
-
- /**
* Virtual destructor
*/
virtual ~KeyEvent();
// Data
/**
- *@copydoc Dali::KeyEvent::keyPressedName
+ * The name of the key pressed or command from the IMF
*/
std::string keyName;
std::string logicalKey;
/**
- *@copydoc Dali::KeyEvent::keyPressed
+ * The string of input characters or key pressed
*/
std::string keyString;
/**
- * @copydoc Dali::KeyEvent::keyCode
+ * The unique key code for the key pressed.
*/
int keyCode;
/**
- *@copydoc Dali::KeyEvent::keyModifier
+ * The key modifier for special keys like shift and alt
*/
int keyModifier;
/**
- *@copydoc Dali::KeyEvent::time
+ * The time (in ms) that the key event occurred.
*/
unsigned long time;
State state;
/**
- * A string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one.
+ * If this keystroke has modified a string in the middle of being composed - this string replaces the previous one.
*/
std::string compose;
/**
- * Name of device KeyEvent originated from
+ * The name of device KeyEvent originated from
*/
std::string deviceName;
/**
- * Class of device KeyEvent originated from
+ * The class of device KeyEvent originated from
*/
Device::Class::Type deviceClass;
/**
- * Subclass of device KeyEvent originated from
+ * The subclass of device KeyEvent originated from
*/
Device::Subclass::Type deviceSubclass;
};
#include <dali/internal/update/rendering/scene-graph-renderer.h>
#include <dali/internal/render/renderers/render-geometry.h>
-#include <dali/internal/render/renderers/render-property-buffer.h>
+#include <dali/internal/render/renderers/render-vertex-buffer.h>
#include <dali/internal/render/renderers/render-renderer.h>
#include <dali/internal/render/renderers/render-sampler.h>
#include <dali/internal/update/render-tasks/scene-graph-camera.h>
sizeof( Internal::Geometry ) +
sizeof( Internal::Render::Geometry) );
const std::size_t PROPERTY_BUFFER_MEMORY_SIZE(
- sizeof( Internal::PropertyBuffer ) +
- sizeof( Internal::Render::PropertyBuffer ) );
+ sizeof( Internal::VertexBuffer ) +
+ sizeof( Internal::Render::VertexBuffer ) );
const std::size_t TEXTURE_SET_MEMORY_SIZE(
sizeof( Internal::TextureSet ) +
sizeof( Internal::SceneGraph::TextureSet ) );
{
class Actor;
-struct KeyEvent;
+class KeyEvent;
class Layer;
class RenderTaskList;
class TouchEvent;
return *mGestureData;
}
-bool Actor::IsGestureRequred( DevelGesture::Type type ) const
+bool Actor::IsGestureRequred( Gesture::Type type ) const
{
return mGestureData && mGestureData->IsGestureRequred( type );
}
#include <dali/public-api/math/viewport.h>
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/size-negotiation/relayout-container.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/common/memory-pool-object-allocator.h>
#include <dali/internal/event/actors/actor-declarations.h>
#include <dali/internal/event/common/object-impl.h>
namespace Dali
{
-struct KeyEvent;
+class KeyEvent;
class TouchData;
class TouchEvent;
class WheelEvent;
* @param[in] type The gesture type.
* @return True if the gesture is required, false otherwise.
*/
- bool IsGestureRequred( DevelGesture::Type type ) const;
+ bool IsGestureRequred( Gesture::Type type ) const;
// Signals
TypeAction action2( mType, ACTION_STOP, &Animation::DoAction );
TypeAction action3( mType, ACTION_PAUSE, &Animation::DoAction );
-const Dali::Animation::EndAction DEFAULT_END_ACTION( Dali::Animation::Bake );
-const Dali::Animation::EndAction DEFAULT_DISCONNECT_ACTION( Dali::Animation::BakeFinal );
-const Dali::Animation::Interpolation DEFAULT_INTERPOLATION( Dali::Animation::Linear );
+const Dali::Animation::EndAction DEFAULT_END_ACTION( Dali::Animation::BAKE );
+const Dali::Animation::EndAction DEFAULT_DISCONNECT_ACTION( Dali::Animation::BAKE_FINAL );
+const Dali::Animation::Interpolation DEFAULT_INTERPOLATION( Dali::Animation::LINEAR );
const Dali::AlphaFunction DEFAULT_ALPHA_FUNCTION( Dali::AlphaFunction::DEFAULT );
/**
StopAnimationMessage( mEventThreadServices.GetUpdateManager(), *mAnimation );
// Only notify the objects with the _stopped_, i.e. current values if the end action is set to BAKE
- if( mEndAction == EndAction::Bake )
+ if( mEndAction == EndAction::BAKE )
{
NotifyObjects( Notify::USE_CURRENT_VALUE );
}
DALI_ASSERT_DEBUG(mAnimation);
// Only notify the objects with the current values if the end action is set to BAKE
- if( mEndAction == EndAction::Bake )
+ if( mEndAction == EndAction::BAKE )
{
NotifyObjects( Notify::USE_CURRENT_VALUE );
}
void Animation::NotifyObjects( Animation::Notify notifyValueType )
{
// If the animation is discarded, then we do not want to change the target values unless we want to force the current values
- if( mEndAction != EndAction::Discard || notifyValueType == Notify::FORCE_CURRENT_VALUE )
+ if( mEndAction != EndAction::DISCARD || notifyValueType == Notify::FORCE_CURRENT_VALUE )
{
// Sort according to end time with earlier end times coming first, if the end time is the same, then the connectors are not moved
// Only do this if we're using the target value
{
float frameProgress = (progress - start->GetProgress()) / (end->GetProgress() - start->GetProgress());
- if( interpolation == Dali::Animation::Linear )
+ if( interpolation == Dali::Animation::LINEAR )
{
Interpolate(interpolatedV, start->GetValue(), end->GetValue(), frameProgress);
}
/*
- * 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.
return std::string();
}
-Property::Index Object::GetPropertyIndex( const std::string& name ) const
+Property::Index Object::GetPropertyIndex( Property::Key key ) const
{
Property::Index index = Property::INVALID_INDEX;
- const TypeInfo* typeInfo( GetTypeInfo() );
- if ( typeInfo )
- {
- index = typeInfo->GetPropertyIndex( name );
- }
- if( (index == Property::INVALID_INDEX)&&( mCustomProperties.Count() > 0 ) )
+ if( key.type == Property::Key::STRING )
{
- Property::Index count = PROPERTY_CUSTOM_START_INDEX;
- const auto end = mCustomProperties.End();
- for( auto iter = mCustomProperties.Begin(); iter != end; ++iter, ++count )
+ const TypeInfo* typeInfo( GetTypeInfo() );
+ if ( typeInfo )
{
- CustomPropertyMetadata* custom = static_cast<CustomPropertyMetadata*>(*iter);
- if ( custom->name == name )
- {
- if ( custom->childPropertyIndex != Property::INVALID_INDEX )
- {
- // If it is a child property, return the child property index
- index = custom->childPropertyIndex;
- }
- else
- {
- index = count;
- }
- break;
- }
+ index = typeInfo->GetPropertyIndex( key.stringKey );
}
}
- return index;
-}
-
-Property::Index Object::GetPropertyIndex( Property::Index key ) const
-{
- Property::Index index = Property::INVALID_INDEX;
-
- if( mCustomProperties.Count() > 0 )
+ if( (index == Property::INVALID_INDEX)&&( mCustomProperties.Count() > 0 ) )
{
Property::Index count = PROPERTY_CUSTOM_START_INDEX;
const auto end = mCustomProperties.End();
for( auto iter = mCustomProperties.Begin(); iter != end; ++iter, ++count )
{
CustomPropertyMetadata* custom = static_cast<CustomPropertyMetadata*>(*iter);
- if( custom->key == key )
+
+ if( ( key.type == Property::Key::STRING && custom->name == key.stringKey) ||
+ ( key.type == Property::Key::INDEX && custom->key == key.indexKey ) )
{
- if( custom->childPropertyIndex != Property::INVALID_INDEX )
+ if ( custom->childPropertyIndex != Property::INVALID_INDEX )
{
// If it is a child property, return the child property index
index = custom->childPropertyIndex;
return index;
}
-Property::Index Object::GetPropertyIndex( Property::Key key ) const
-{
- Property::Index index = Property::INVALID_INDEX;
- if( key.type == Property::Key::INDEX )
- {
- index = GetPropertyIndex( key.indexKey );
- }
- else
- {
- index = GetPropertyIndex( key.stringKey );
- }
- return index;
-}
-
bool Object::IsPropertyWritable( Property::Index index ) const
{
DALI_ASSERT_ALWAYS(index > Property::INVALID_INDEX && "Property index is out of bounds");
else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
{
// check whether the animatable property is registered already, if not then register one.
- // this is needed because property value may have been set as full property and get as a property component
+ // this is needed because property value may have been set as full property and get as a property component
AnimatablePropertyMetadata* animatableProperty = GetSceneAnimatableProperty( index, nullptr );
if( animatableProperty )
{
else if ( ( index >= ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX ) && ( index <= ANIMATABLE_PROPERTY_REGISTRATION_MAX_INDEX ) )
{
// check whether the animatable property is registered already, if not then register one.
- // this is needed because property value may have been set as full property and get as a property component
+ // this is needed because property value may have been set as full property and get as a property component
AnimatablePropertyMetadata* animatableProperty = GetSceneAnimatableProperty( index, nullptr );
if( animatableProperty )
{
// Iterating twice to get the value we want should still be fairly quick in a Property::Map.
const auto& key = properties.GetKeyAt( position );
- const auto propertyIndex = ( key.type == Property::Key::INDEX ) ? key.indexKey : GetPropertyIndex( key.stringKey );
+ const auto propertyIndex = ( key.type == Property::Key::INDEX ) ? key.indexKey : GetPropertyIndex( key );
if( propertyIndex != Property::INVALID_INDEX )
{
return componentIndex;
}
-DevelHandle::PropertySetSignalType& Object::PropertySetSignal()
+Handle::PropertySetSignalType& Object::PropertySetSignal()
{
return mPropertySetSignal;
}
#define DALI_INTERNAL_OBJECT_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.
/**
* @copydoc Dali::Handle::GetPropertyIndex()
*/
- Property::Index GetPropertyIndex( const std::string& name ) const;
-
- /**
- * @copydoc Dali::Handle::GetPropertyIndex()
- */
- Property::Index GetPropertyIndex( Property::Index key ) const;
-
- /**
- * @copydoc Dali::Handle::GetPropertyIndex()
- */
Property::Index GetPropertyIndex( Property::Key key ) const;
/**
/**
* @copydoc Dali::Handle::PropertySetSignal()
*/
- DevelHandle::PropertySetSignalType& PropertySetSignal();
+ Handle::PropertySetSignalType& PropertySetSignal();
protected:
using PropertyNotificationContainer = std::vector< Dali::PropertyNotification >;
PropertyNotificationContainer* mPropertyNotifications; ///< Container of owned property notifications.
- DevelHandle::PropertySetSignalType mPropertySetSignal;
+ Handle::PropertySetSignalType mPropertySetSignal;
};
} // namespace Internal
return mSceneObject;
}
-void Scene::EmitKeyEventSignal(const KeyEvent& event)
+void Scene::EmitKeyEventSignal(const Dali::KeyEvent& event)
{
if ( !mKeyEventSignal.Empty() )
{
}
}
-bool Scene::EmitKeyEventGeneratedSignal(const KeyEvent& event)
+bool Scene::EmitKeyEventGeneratedSignal(const Dali::KeyEvent& event)
{
// Emit the KeyEventGenerated signal when KeyEvent is generated
+ Dali::Integration::Scene handle( this );
return mKeyEventGeneratedSignal.Emit( event );
}
* Used by the EventProcessor to emit key event signals.
* @param[in] event The key event.
*/
- void EmitKeyEventSignal(const KeyEvent& event);
+ void EmitKeyEventSignal(const Dali::KeyEvent& event);
/**
* Used by the KeyEventProcessor to emit KeyEventGenerated signals.
* @param[in] event The key event.
* @return The return is true if KeyEvent is consumed, otherwise false.
*/
- bool EmitKeyEventGeneratedSignal(const KeyEvent& event);
+ bool EmitKeyEventGeneratedSignal(const Dali::KeyEvent& event);
/**
* Emits the event processing finished signal.
/*
- * 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 name;
}
-std::string TypeRegistry::Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo,
- Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit )
+std::string TypeRegistry::Register( const std::type_info& theTypeInfo,
+ const std::type_info& baseTypeInfo,
+ Dali::TypeInfo::CreateFunction createInstance,
+ bool callCreateOnInit )
{
std::string uniqueTypeName = DemangleClassName( theTypeInfo.name() );
return Register( uniqueTypeName, baseTypeInfo, createInstance, callCreateOnInit );
}
-std::string TypeRegistry::Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo,
- Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit,
- const Dali::PropertyDetails* defaultProperties, Property::Index defaultPropertyCount )
+std::string TypeRegistry::Register( const std::type_info& theTypeInfo,
+ const std::type_info& baseTypeInfo,
+ Dali::TypeInfo::CreateFunction createInstance,
+ bool callCreateOnInit,
+ const Dali::PropertyDetails* defaultProperties,
+ Property::Index defaultPropertyCount )
{
std::string uniqueTypeName = DemangleClassName( theTypeInfo.name() );
return Register( uniqueTypeName, baseTypeInfo, createInstance, callCreateOnInit, defaultProperties, defaultPropertyCount );
}
-std::string TypeRegistry::Register( const std::string& uniqueTypeName, const std::type_info& baseTypeInfo,
- Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit,
- const Dali::PropertyDetails* defaultProperties, Property::Index defaultPropertyCount )
+std::string TypeRegistry::Register( const std::string& uniqueTypeName,
+ const std::type_info& baseTypeInfo,
+ Dali::TypeInfo::CreateFunction createInstance,
+ bool callCreateOnInit,
+ const Dali::PropertyDetails* defaultProperties,
+ Property::Index defaultPropertyCount )
{
std::string baseTypeName = DemangleClassName( baseTypeInfo.name() );
}
}
- mRegistryLut.push_back( TypeRegistry::TypeInfoPointer( new Internal::TypeInfo( uniqueTypeName, baseTypeName, createInstance, defaultProperties, defaultPropertyCount ) ) );
+ mRegistryLut.push_back( TypeRegistry::TypeInfoPointer(
+ new Internal::TypeInfo( uniqueTypeName, baseTypeName, createInstance, defaultProperties, defaultPropertyCount ) ) );
DALI_LOG_INFO( gLogFilter, Debug::Concise, "Type Registration %s(%s)\n", uniqueTypeName.c_str(), baseTypeName.c_str() );
if( callCreateOnInit )
/*
- * 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.
{
ActorGestureData::ActorGestureData()
-: gesturesRequired( DevelGesture::Type( 0 ) ),
+: gesturesRequired( Gesture::Type( 0 ) ),
panDetectors( nullptr ),
pinchDetectors( nullptr ),
longPressDetectors( nullptr ),
void ActorGestureData::AddGestureDetector( GestureDetector& detector )
{
- const DevelGesture::Type type( detector.GetType() );
+ const Gesture::Type type( detector.GetType() );
GestureDetectorContainer*& containerPtr( GetContainerPtr( type ) );
if ( NULL == containerPtr )
}
containerPtr->push_back( &detector );
- gesturesRequired = DevelGesture::Type( gesturesRequired | type );
+ gesturesRequired = Gesture::Type( gesturesRequired | type );
}
void ActorGestureData::RemoveGestureDetector( GestureDetector& detector )
{
- const DevelGesture::Type type( detector.GetType() );
+ const Gesture::Type type( detector.GetType() );
GestureDetectorContainer*& containerPtr( GetContainerPtr( type ) );
DALI_ASSERT_DEBUG( containerPtr && "Container had not been created" );
if ( container.empty() )
{
- gesturesRequired = DevelGesture::Type( gesturesRequired & ~type );
+ gesturesRequired = Gesture::Type( gesturesRequired & ~type );
delete containerPtr;
containerPtr = NULL;
}
}
-GestureDetectorContainer& ActorGestureData::GetGestureDetectorContainer( DevelGesture::Type type )
+GestureDetectorContainer& ActorGestureData::GetGestureDetectorContainer( Gesture::Type type )
{
return *GetContainerPtr( type );
}
-GestureDetectorContainer*& ActorGestureData::GetContainerPtr( DevelGesture::Type type )
+GestureDetectorContainer*& ActorGestureData::GetContainerPtr( Gesture::Type type )
{
switch ( type )
{
- case DevelGesture::Pan:
+ case Gesture::Pan:
{
return panDetectors;
}
- case DevelGesture::Pinch:
+ case Gesture::Pinch:
{
return pinchDetectors;
}
- case DevelGesture::LongPress:
+ case Gesture::LongPress:
{
return longPressDetectors;
}
- case DevelGesture::Tap:
+ case Gesture::Tap:
{
return tapDetectors;
}
- case DevelGesture::Rotation:
+ case Gesture::Rotation:
{
return rotationDetectors;
}
#define DALI_INTERNAL_ACTOR_GESTURE_DATA_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.
*/
// INTERNAL INCLUDES
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/gesture-detector-impl.h>
namespace Dali
* @param[in] type The gesture type.
* @return true if the gesture is required, false otherwise.
*/
- inline bool IsGestureRequred( DevelGesture::Type type ) const
+ inline bool IsGestureRequred( Gesture::Type type ) const
{
return type & gesturesRequired;
}
* @param[in] type The container type required
* @pre Ensure IsGestureRequired() is used to check if the container is actually available.
*/
- GestureDetectorContainer& GetGestureDetectorContainer( DevelGesture::Type type );
+ GestureDetectorContainer& GetGestureDetectorContainer( Gesture::Type type );
private:
* Helper to retrieve the appropriate container type.
* @param[in] type The container type required.
*/
- inline GestureDetectorContainer*& GetContainerPtr( DevelGesture::Type type );
+ inline GestureDetectorContainer*& GetContainerPtr( Gesture::Type type );
private:
- DevelGesture::Type gesturesRequired; ///< Stores which gestures are required
+ Gesture::Type gesturesRequired; ///< Stores which gestures are required
GestureDetectorContainer* panDetectors; ///< Pointer to a container of pan-detectors
GestureDetectorContainer* pinchDetectors; ///< Pointer to a container of pinch-detectors
namespace Internal
{
-GestureDetector::GestureDetector( DevelGesture::Type type, const SceneGraph::PropertyOwner* sceneObject )
+GestureDetector::GestureDetector( Gesture::Type type, const SceneGraph::PropertyOwner* sceneObject )
: Object( sceneObject ),
mType( type ),
mGestureEventProcessor( ThreadLocalStorage::Get().GetGestureEventProcessor() )
{
}
-GestureDetector::GestureDetector( Gesture::Type type, const SceneGraph::PropertyOwner* sceneObject )
-: GestureDetector( static_cast< DevelGesture::Type >( type ), sceneObject )
-{
-}
-
GestureDetector::~GestureDetector()
{
if ( !mPendingAttachActors.empty() )
#define DALI_INTERNAL_GESTURE_DETECTOR_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.
* Retrieves the type of GestureDetector
* @return The GestureDetector Type
*/
- DevelGesture::Type GetType() const
+ Gesture::Type GetType() const
{
return mType;
}
* @param pointer to the scene object, nullptr if none
* by default GestureDetectors don't have our own scene object
*/
- GestureDetector( DevelGesture::Type type, const SceneGraph::PropertyOwner* sceneObject = nullptr );
-
- /**
- * @copydoc GestureDetector( DevelGesture::Type, const SceneGraph::PropertyOwner* )
- */
GestureDetector( Gesture::Type type, const SceneGraph::PropertyOwner* sceneObject = nullptr );
/**
protected:
- DevelGesture::Type mType; ///< The gesture detector will detect this type of gesture.
+ Gesture::Type mType; ///< The gesture detector will detect this type of gesture.
GestureDetectorActorContainer mAttachedActors; ///< Object::Observer is used to provide weak-pointer behaviour
GestureDetectorActorContainer mPendingAttachActors; ///< Object::Observer is used to provide weak-pointer behaviour
GestureEventProcessor& mGestureEventProcessor; ///< A reference to the gesture event processor.
/*
- * 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.
{
switch (gestureDetector->GetType())
{
- case DevelGesture::LongPress:
+ case Gesture::LongPress:
{
LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
mLongPressGestureProcessor.AddGestureDetector(longPress, scene);
break;
}
- case DevelGesture::Pan:
+ case Gesture::Pan:
{
PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
mPanGestureProcessor.AddGestureDetector(pan, scene, envOptionMinimumPanDistance, envOptionMinimumPanEvents);
break;
}
- case DevelGesture::Pinch:
+ case Gesture::Pinch:
{
PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
mPinchGestureProcessor.AddGestureDetector(pinch, scene);
break;
}
- case DevelGesture::Tap:
+ case Gesture::Tap:
{
TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
mTapGestureProcessor.AddGestureDetector(tap, scene);
break;
}
- case DevelGesture::Rotation:
+ case Gesture::Rotation:
{
RotationGestureDetector* rotation = static_cast<RotationGestureDetector*>(gestureDetector);
mRotationGestureProcessor.AddGestureDetector(rotation, scene);
{
switch (gestureDetector->GetType())
{
- case DevelGesture::LongPress:
+ case Gesture::LongPress:
{
LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
mLongPressGestureProcessor.RemoveGestureDetector(longPress);
break;
}
- case DevelGesture::Pan:
+ case Gesture::Pan:
{
PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
mPanGestureProcessor.RemoveGestureDetector(pan);
break;
}
- case DevelGesture::Pinch:
+ case Gesture::Pinch:
{
PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
mPinchGestureProcessor.RemoveGestureDetector(pinch);
break;
}
- case DevelGesture::Tap:
+ case Gesture::Tap:
{
TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
mTapGestureProcessor.RemoveGestureDetector(tap);
break;
}
- case DevelGesture::Rotation:
+ case Gesture::Rotation:
{
RotationGestureDetector* rotation = static_cast<RotationGestureDetector*>(gestureDetector);
mRotationGestureProcessor.RemoveGestureDetector(rotation);
{
switch (gestureDetector->GetType())
{
- case DevelGesture::LongPress:
+ case Gesture::LongPress:
{
LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
mLongPressGestureProcessor.GestureDetectorUpdated(longPress);
break;
}
- case DevelGesture::Pan:
+ case Gesture::Pan:
{
PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
mPanGestureProcessor.GestureDetectorUpdated(pan);
break;
}
- case DevelGesture::Pinch:
+ case Gesture::Pinch:
{
PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
mPinchGestureProcessor.GestureDetectorUpdated(pinch);
break;
}
- case DevelGesture::Tap:
+ case Gesture::Tap:
{
TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
mTapGestureProcessor.GestureDetectorUpdated(tap);
break;
}
- case DevelGesture::Rotation:
+ case Gesture::Rotation:
{
// Nothing to do
break;
void GestureEventProcessor::SetGestureProperties( const Gesture& gesture )
{
- bool requestUpdate = false;
+ DALI_ASSERT_DEBUG( gesture.type == Gesture::Pan && "Only PanGesture has a scene object\n" );
- switch ( static_cast< DevelGesture::Type >( gesture.type ) )
- {
- case DevelGesture::Pan:
- {
- const PanGesture& pan = static_cast< const PanGesture& >( gesture );
- requestUpdate = mPanGestureProcessor.SetPanGestureProperties( pan );
- break;
- }
-
- case DevelGesture::LongPress:
- case DevelGesture::Pinch:
- case DevelGesture::Tap:
- case DevelGesture::Rotation:
- {
- DALI_ASSERT_DEBUG( false && "Gesture type does not have scene object\n" );
- break;
- }
- }
-
- if( requestUpdate )
+ const PanGesture& pan = static_cast< const PanGesture& >( gesture );
+ if( mPanGestureProcessor.SetPanGestureProperties( pan ) )
{
// We may not be updating so we need to ask the render controller for an update.
mRenderController.RequestUpdate( false );
/*
- * 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.
{
}
-GestureEvent::GestureEvent( DevelGesture::Type gesture, Gesture::State gestureState )
+GestureEvent::GestureEvent( Gesture::Type gesture, Gesture::State gestureState )
: gestureType( gesture ),
state( gestureState ),
time( 0 )
{
}
-
-GestureEvent::GestureEvent(Gesture::Type gesture, Gesture::State gestureState)
-: GestureEvent( static_cast< DevelGesture::Type >( gesture ), gestureState )
-{
-}
} // namespace Internal
} // namespace Dali
#define DALI_INTERNAL_EVENT_GESTURE_EVENT_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.
// INTERNAL INCLUDES
#include <dali/public-api/events/gesture.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/integration-api/events/event.h>
namespace Dali
/**
* Gesture Type.
*/
- DevelGesture::Type gestureType;
+ Gesture::Type gestureType;
/**
* The state of the gesture.
* @param[in] gesture The type of gesture event.
* @param[in] gestureState The state of the gesture event.
*/
- GestureEvent( DevelGesture::Type gesture, Gesture::State gestureState);
-
- /**
- * @copydoc GestureEvent( DevelGesture::Type, Gesture::State )
- */
- GestureEvent( Gesture::Type gesture, Gesture::State gestureState );
+ GestureEvent( Gesture::Type gesture, Gesture::State gestureState);
};
} // namespace Internal
/*
- * 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.
*/
struct GestureHitTestCheck : public HitTestAlgorithm::HitTestInterface
{
- GestureHitTestCheck( DevelGesture::Type type )
- : mType( type )
- {
- }
-
GestureHitTestCheck( Gesture::Type type )
- : GestureHitTestCheck( static_cast< DevelGesture::Type >( type ) )
+ : mType( type )
{
}
return layer->IsTouchConsumed();
}
- DevelGesture::Type mType;
+ Gesture::Type mType;
};
} // unnamed namespace
-GestureProcessor::GestureProcessor( DevelGesture::Type type )
+GestureProcessor::GestureProcessor( Gesture::Type type )
: mGestureRecognizer(),
mNeedsUpdate( false ),
mType( type ),
{
}
-GestureProcessor::GestureProcessor( Gesture::Type type )
-: GestureProcessor( static_cast< DevelGesture::Type >( type ) )
-{
-}
-
-
GestureProcessor::~GestureProcessor()
{
ResetActor();
#define DALI_INTERNAL_GESTURE_PROCESSOR_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.
*/
// INTERNAL INCLUDES
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/gesture-detector-impl.h>
#include <dali/internal/event/events/hit-test-algorithm-impl.h>
#include <dali/internal/event/events/gesture-recognizer.h>
/**
* Protected constructor. Cannot create an instance of GestureProcessor
*/
- GestureProcessor( DevelGesture::Type type );
-
- /**
- * Protected constructor. Cannot create an instance of GestureProcessor
- */
GestureProcessor( Gesture::Type type );
/**
private: // Data
- DevelGesture::Type mType; ///< Type of GestureProcessor
+ Gesture::Type mType; ///< Type of GestureProcessor
Actor* mCurrentGesturedActor; ///< The current actor that has been gestured.
bool mGesturedActorDisconnected:1; ///< Indicates whether the gestured actor has been disconnected from the scene
};
#define DALI_INTERNAL_GESTURE_RECOGNIZER_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.
#include <dali/public-api/events/gesture.h>
#include <dali/public-api/math/vector2.h>
#include <dali/public-api/object/ref-object.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/gesture-event.h>
namespace Dali
* Returns the type of gesture detector.
* @return Type of gesture detector.
*/
- DevelGesture::Type GetType() const { return mType; }
+ Gesture::Type GetType() const { return mType; }
/**
* Called when we get a touch event.
* @param[in] screenSize The size of the screen.
* @param[in] detectorType The type of gesture detector.
*/
- GestureRecognizer( Vector2 screenSize, DevelGesture::Type detectorType )
+ GestureRecognizer( Vector2 screenSize, Gesture::Type detectorType )
: mScreenSize( screenSize ),
mType( detectorType ),
mScene( nullptr )
}
/**
- * copydoc GestureRecognizer( Vector2, DevelGesture::Type )
- */
- GestureRecognizer( Vector2 screenSize, Gesture::Type detectorType )
- : GestureRecognizer( screenSize, static_cast< DevelGesture::Type >( detectorType ) )
- {
- }
-
- /**
* Protected Constructor. Should only be able to create derived class objects.
*
* Use this constructor with the screen size is not used in the dereived class.
* @param[in] detectorType The type of gesture detector.
*/
- GestureRecognizer( DevelGesture::Type detectorType )
+ GestureRecognizer( Gesture::Type detectorType )
: GestureRecognizer( Vector2::ZERO, detectorType )
{
}
protected:
Vector2 mScreenSize;
- DevelGesture::Type mType;
+ Gesture::Type mType;
Scene* mScene;
};
#define DALI_INTERNAL_GESTURE_REQUESTS_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.
// INTERNAL INCLUDES
#include <dali/public-api/events/gesture.h>
-#include <dali/devel-api/events/gesture-devel.h>
namespace Dali
{
* Default Constructor
* @param[in] typeRequired The gesture type required
*/
- GestureRequest( DevelGesture::Type typeRequired )
- : type( typeRequired )
- {
- }
-
- /**
- * @copydoc GestureRequest( DevelGesture::Type )
- */
GestureRequest( Gesture::Type typeRequired )
- : GestureRequest( static_cast< DevelGesture::Type >( typeRequired ) )
+ : type( typeRequired )
{
}
// Data Members
- DevelGesture::Type type; ///< The type of gesture required.
+ Gesture::Type type; ///< The type of gesture required.
};
/**
/*
- * Copyright (c) 2017 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.
namespace
{
-/**
- * This container stores a mapping between public key event and impl as we cannot add data members in public one.
- * In practice this keeps the impl "alive" in between KeyEvent constructor and destructor calls so that getter
- * methods can be called to access the new data members. There is a 1:1 mapping between KeyEvent and KeyEventImpl.
- */
-struct KeyImplMapping
-{
- KeyEvent* keyEvent;
- Internal::KeyEventImpl* impl;
-};
-Vector< KeyImplMapping > gKeyEventToImplMapping;
-
+const uint32_t MODIFIER_SHIFT = 0x1;
+const uint32_t MODIFIER_CTRL = 0x2;
+const uint32_t MODIFIER_ALT = 0x4;
+const int32_t KEY_INVALID_CODE = -1;
}
namespace Internal
{
-KeyEventImpl::KeyEventImpl( KeyEvent* keyEvent )
-: mLogicalKey( "" ),
+KeyEvent::KeyEvent()
+: mKeyName( "" ),
+ mLogicalKey( "" ),
+ mKeyString( "" ),
+ mKeyCode( KEY_INVALID_CODE ),
+ mKeyModifier( 0 ),
+ mTime( 0 ),
+ mState( Dali::KeyEvent::DOWN ),
mCompose( "" ),
mDeviceName( "" ),
mDeviceClass( Device::Class::NONE ),
mDeviceSubclass( Device::Subclass::NONE )
{
- gKeyEventToImplMapping.PushBack( { keyEvent, this } );
}
-KeyEventImpl::~KeyEventImpl()
+KeyEvent::KeyEvent( const std::string& keyName,
+ const std::string& logicalKey,
+ const std::string& keyString,
+ int keyCode,
+ int keyModifier,
+ unsigned long timeStamp,
+ const Dali::KeyEvent::State& keyState,
+ const std::string& compose,
+ const std::string& deviceName,
+ const Device::Class::Type deviceClass,
+ const Device::Subclass::Type deviceSubclass )
+: mKeyName( keyName ),
+ mLogicalKey( logicalKey ),
+ mKeyString( keyString ),
+ mKeyCode( keyCode ),
+ mKeyModifier( keyModifier ),
+ mTime( timeStamp ),
+ mState( keyState ),
+ mCompose( compose ),
+ mDeviceName( deviceName ),
+ mDeviceClass( deviceClass ),
+ mDeviceSubclass( deviceSubclass )
{
- for( auto&& iter : gKeyEventToImplMapping )
- {
- if( this == iter.impl )
- {
- gKeyEventToImplMapping.Erase( &iter ); // iter is reference to KeyImplMapping, take address of it for Erase
- return;
- }
- }
}
-KeyEventImpl& KeyEventImpl::operator=( const KeyEventImpl& rhs )
+KeyEvent::~KeyEvent()
{
- if( this != &rhs )
- {
- mLogicalKey = rhs.mLogicalKey;
- mCompose = rhs.mCompose;
- mDeviceName = rhs.mDeviceName;
- mDeviceClass = rhs.mDeviceClass;
- mDeviceSubclass = rhs.mDeviceSubclass;
- }
+}
- return *this;
+KeyEventPtr KeyEvent::New( const std::string& keyName,
+ const std::string& logicalKey,
+ const std::string& keyString,
+ int keyCode,
+ int keyModifier,
+ unsigned long timeStamp,
+ const Dali::KeyEvent::State& keyState,
+ const std::string& compose,
+ const std::string& deviceName,
+ const Device::Class::Type deviceClass,
+ const Device::Subclass::Type deviceSubclass )
+{
+ KeyEventPtr keyEvent = new KeyEvent( keyName, logicalKey, keyString, keyCode, keyModifier, timeStamp, keyState, compose, deviceName, deviceClass, deviceSubclass );
+ return keyEvent;
}
-std::string KeyEventImpl::GetLogicalKey() const
+bool KeyEvent::IsShiftModifier() const
{
- return mLogicalKey;
+ return ( ( MODIFIER_SHIFT & mKeyModifier ) == MODIFIER_SHIFT );
}
-void KeyEventImpl::SetLogicalKey( const std::string& logicalKey )
+bool KeyEvent::IsCtrlModifier() const
{
- mLogicalKey = logicalKey;
+ return ( ( MODIFIER_CTRL & mKeyModifier ) == MODIFIER_CTRL );
}
-std::string KeyEventImpl::GetCompose() const
+bool KeyEvent::IsAltModifier() const
{
- return mCompose;
+ return ( ( MODIFIER_ALT & mKeyModifier ) == MODIFIER_ALT );
}
-void KeyEventImpl::SetCompose( const std::string& compose )
+const std::string& KeyEvent::GetCompose() const
{
- mCompose = compose;
+ return mCompose;
}
-std::string KeyEventImpl::GetDeviceName() const
+const std::string& KeyEvent::GetDeviceName() const
{
return mDeviceName;
}
-void KeyEventImpl::SetDeviceName( const std::string& deviceName )
+
+Device::Class::Type KeyEvent::GetDeviceClass() const
{
- mDeviceName = deviceName;
+ return mDeviceClass;
}
-Device::Class::Type KeyEventImpl::GetDeviceClass() const
+
+Device::Subclass::Type KeyEvent::GetDeviceSubclass() const
{
- return mDeviceClass;
+ return mDeviceSubclass;
}
-void KeyEventImpl::SetDeviceClass( Device::Class::Type deviceClass )
+
+const std::string& KeyEvent::GetKeyName() const
{
- mDeviceClass = deviceClass;
+ return mKeyName;
}
-Device::Subclass::Type KeyEventImpl::GetDeviceSubclass() const
+
+const std::string& KeyEvent::GetKeyString() const
{
- return mDeviceSubclass;
+ return mKeyString;
+}
+
+
+const std::string& KeyEvent::GetLogicalKey() const
+{
+ return mLogicalKey;
+}
+
+
+int32_t KeyEvent::GetKeyCode() const
+{
+ return mKeyCode;
+}
+
+
+int32_t KeyEvent::GetKeyModifier() const
+{
+ return mKeyModifier;
+}
+
+
+unsigned long KeyEvent::GetTime() const
+{
+ return mTime;
+}
+
+
+Dali::KeyEvent::State KeyEvent::GetState() const
+{
+ return mState;
+}
+
+
+void KeyEvent::SetKeyName( const std::string& keyName )
+{
+ mKeyName = keyName;
}
-void KeyEventImpl::SetDeviceSubclass( Device::Subclass::Type deviceSubclass )
+
+void KeyEvent::SetKeyString( const std::string& keyString )
{
- mDeviceSubclass = deviceSubclass;
+ mKeyString = keyString;
}
-} // namsespace Internal
-Internal::KeyEventImpl* GetImplementation( KeyEvent* keyEvent )
+void KeyEvent::SetKeyCode( int32_t keyCode )
{
- Internal::KeyEventImpl* impl( NULL );
- for( auto&& iter : gKeyEventToImplMapping )
- {
- if( iter.keyEvent == keyEvent )
- {
- impl = iter.impl;
- }
- }
- return impl;
+ mKeyCode = keyCode;
}
-const Internal::KeyEventImpl* GetImplementation( const KeyEvent* keyEvent )
+
+void KeyEvent::SetKeyModifier( int32_t keyModifier )
{
- Internal::KeyEventImpl* impl( NULL );
- for( auto&& iter : gKeyEventToImplMapping )
- {
- if( iter.keyEvent == keyEvent )
- {
- impl = iter.impl;
- }
- }
- return impl;
+ mKeyModifier = keyModifier;
}
+
+void KeyEvent::SetTime( unsigned long time )
+{
+ mTime = time;
+}
+
+
+void KeyEvent::SetState( const Dali::KeyEvent::State& state )
+{
+ mState = state;
+}
+
+} // namespace Internal
+
} // namespace Dali
#define DALI_INTERNAL_KEY_EVENT_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.
// INTERNAL INCLUDES
#include <dali/public-api/events/key-event.h>
+#include <dali/public-api/object/base-object.h>
namespace Dali
{
namespace Internal
{
-struct KeyEventImpl
+class KeyEvent;
+typedef IntrusivePtr< KeyEvent > KeyEventPtr;
+
+/**
+ * @copydoc Dali::KeyEvent
+ */
+class KeyEvent : public BaseObject
{
public:
/**
+ * @brief Default constructor.
+ */
+ KeyEvent();
+
+ /**
* @brief Constructor.
+ *
+ * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
+ * @param[in] logicalKey The logical key symbol (eg. shift + 1 == "exclamation")
+ * @param[in] keyString The string of input characters or key pressed
+ * @param[in] keyCode The unique key code for the key pressed.
+ * @param[in] keyModifier The key modifier for special keys like shift and alt
+ * @param[in] timeStamp The time (in ms) that the key event occurred.
+ * @param[in] keyState The state of the key event.
+ * @param[in] compose The key compose
+ * @param[in] deviceName The name of device the key event originated from
+ * @param[in] deviceClass The class of device the key event originated from
+ * @param[in] deviceSubclass The subclass of device the key event originated from
*/
- KeyEventImpl( Dali::KeyEvent* keyEvent );
+ KeyEvent( const std::string& keyName,
+ const std::string& logicalKey,
+ const std::string& keyString,
+ int keyCode,
+ int keyModifier,
+ unsigned long timeStamp,
+ const Dali::KeyEvent::State& keyState,
+ const std::string& compose,
+ const std::string& deviceName,
+ const Device::Class::Type deviceClass,
+ const Device::Subclass::Type deviceSubclass );
/**
* @brief Destructor.
*/
- ~KeyEventImpl();
+ ~KeyEvent();
/**
- * @brief Assignment operator.
- * @param[in] rhs A reference to the copied handle
- * @return A reference to this
+ * Create a new KeyEvent.
+ *
+ * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
+ * @param[in] logicalKey The logical key symbol (eg. shift + 1 == "exclamation")
+ * @param[in] keyString The string of input characters or key pressed
+ * @param[in] keyCode The unique key code for the key pressed.
+ * @param[in] keyModifier The key modifier for special keys like shift and alt
+ * @param[in] timeStamp The time (in ms) that the key event occurred.
+ * @param[in] keyState The state of the key event.
+ * @param[in] compose The key compose
+ * @param[in] deviceName The name of device the key event originated from
+ * @param[in] deviceClass The class of device the key event originated from
+ * @param[in] deviceSubclass The subclass of device the key event originated from
+ * @return A smart-pointer to the newly allocated KeyEvent.
*/
- KeyEventImpl& operator=( const KeyEventImpl& rhs );
+ static KeyEventPtr New( const std::string& keyName,
+ const std::string& logicalKey,
+ const std::string& keyString,
+ int keyCode,
+ int keyModifier,
+ unsigned long timeStamp,
+ const Dali::KeyEvent::State& keyState,
+ const std::string& compose,
+ const std::string& deviceName,
+ const Device::Class::Type deviceClass,
+ const Device::Subclass::Type deviceSubclass );
/**
- * @brief Get the key symbol string.
- * @return The key symbol
+ * @copydoc Dali::KeyEvent::IsShiftModifier()
*/
- std::string GetLogicalKey() const;
+ bool IsShiftModifier() const;
/**
- * @brief Set the key symbol string to the KeyEvent.
- * @param[in] key The key symbol to set
+ * @copydoc Dali::KeyEvent::IsCtrlModifier()
*/
- void SetLogicalKey( const std::string& logicalKey );
+ bool IsCtrlModifier() const;
/**
- * @brief Get the compose string.
- *
- * @return The compose string.
+ * @copydoc Dali::KeyEvent::IsAltModifier()
*/
- std::string GetCompose() const;
+ bool IsAltModifier() const;
/**
- * @brief Set the compose string to the KeyEvent
- * A string if this keystroke has modified a string in the middle of being composed,
- * this string replaces the previous one.
- *
- * @param[in] compose The compose string to set
+ * @copydoc Dali::KeyEvent::GetCompose()
+ */
+ const std::string& GetCompose() const;
+
+ /**
+ * @copydoc Dali::KeyEvent::GetDeviceName()
*/
- void SetCompose( const std::string& compose );
+ const std::string& GetDeviceName() const;
/**
- * @brief Get the device name the key event originated from
+ * @copydoc Dali::KeyEvent::GetDeviceClass()
+ */
+ Device::Class::Type GetDeviceClass() const;
+
+ /**
+ * @copydoc Dali::KeyEvent::GetDeviceSubclass()
+ */
+ Device::Subclass::Type GetDeviceSubclass() const;
+
+ /**
+ * @copydoc Dali::KeyEvent::GetKeyName()
+ */
+ const std::string& GetKeyName() const;
+
+ /**
+ * @copydoc Dali::KeyEvent::GetKeyString()
+ */
+ const std::string& GetKeyString() const;
+
+ /**
+ * @copydoc Dali::KeyEvent::GetLogicalKey()
+ */
+ const std::string& GetLogicalKey() const;
+
+ /**
+ * @copydoc Dali::KeyEvent::GetKeyCode()
+ */
+ int32_t GetKeyCode() const;
+
+ /**
+ * @copydoc Dali::KeyEvent::GetKeyModifier()
+ */
+ int32_t GetKeyModifier() const;
+
+ /**
+ * @copydoc Dali::KeyEvent::GetTime()
+ */
+ unsigned long GetTime() const;
+
+ /**
+ * @copydoc Dali::KeyEvent::GetState()
+ */
+ Dali::KeyEvent::State GetState() const;
+
+ /**
+ * @brief Set the name given to the key pressed
*
- * @return The device name
+ * @param[in] keyName The name given to the key pressed.
*/
- std::string GetDeviceName() const;
+ void SetKeyName( const std::string& keyName );
/**
- * @brief Set the device name to the KeyEvent
+ * @brief Set the actual string of input characters that should be used for input editors.
*
- * @param[in] deviceName Device name string to set
+ * @param[in] The actual string of input characters
*/
- void SetDeviceName( const std::string& deviceName );
+ void SetKeyString( const std::string& keyString );
/**
- * @brief Get the device class the key event originated from
+ * @brief Set the unique key code for the key pressed.
*
- * @return The device class
+ * @param[in] keyCode The unique key code for the key pressed
*/
- Device::Class::Type GetDeviceClass() const;
+ void SetKeyCode( int32_t keyCode );
/**
- * @brief Set the device class to the KeyEvent
+ * @brief Set the key modifier for special keys like Shift, Alt and Ctrl which modify the next key pressed.
*
- * @param[in] deviceClass Device class to set
+ * @param[in] keyModifier The key modifier
*/
- void SetDeviceClass( Device::Class::Type deviceClass );
+ void SetKeyModifier( int32_t keyModifier );
/**
- * @brief Get the device subclass the key event originated from
+ * @brief Set the time (in ms) that the key event occurred.
*
- * @return The device subclass
+ * @param[in] time The time (in ms)
*/
- Device::Subclass::Type GetDeviceSubclass() const;
+ void SetTime( unsigned long time );
/**
- * @brief Set the device subclass to the KeyEvent
+ * @brief Set the state of the key event.
*
- * @param[in] deviceClass Device subclass to set
+ * @param[in] state The state of the key event
*/
- void SetDeviceSubclass( Device::Subclass::Type deviceSubclass );
+ void SetState( const Dali::KeyEvent::State& state );
private:
- // Undefined
- KeyEventImpl();
+ // Not copyable or movable
- // Undefined
- KeyEventImpl( const KeyEventImpl& rhs );
+ KeyEvent( const KeyEvent& rhs ) = delete; ///< Deleted copy constructor
+ KeyEvent( KeyEvent&& rhs ) = delete; ///< Deleted move constructor
+ KeyEvent& operator=( const KeyEvent& rhs ) = delete; ///< Deleted copy assignment operator
+ KeyEvent& operator=( KeyEvent&& rhs ) = delete; ///< Deleted move assignment operator
private:
- std::string mLogicalKey;
- std::string mCompose;
- std::string mDeviceName;
- Device::Class::Type mDeviceClass;
- Device::Subclass::Type mDeviceSubclass;
+ std::string mKeyName; ///< The name of the key pressed
+ std::string mLogicalKey; ///< The logical key symbol
+ std::string mKeyString; ///< The string of input characters
+ int mKeyCode; ///< TThe unique key code
+ int mKeyModifier; ///< The key modifier
+ unsigned long mTime; ///< The time that the key event occurred.
+ Dali::KeyEvent::State mState; ///< The state of the key event.
+ std::string mCompose; ///< The key compose
+ std::string mDeviceName; ///< The name of device the key event originated from
+ Device::Class::Type mDeviceClass; ///< The class of device the key event originated from
+ Device::Subclass::Type mDeviceSubclass; ///< The subclass of device the key event originated from
};
} // namespace Internal
// Helpers for public-api forwarding methods
-Internal::KeyEventImpl* GetImplementation( KeyEvent* keyEvent );
+inline Internal::KeyEvent& GetImplementation( Dali::KeyEvent& keyEvent )
+{
+ DALI_ASSERT_ALWAYS( keyEvent && "Key Event handle is empty" );
+
+ BaseObject& object = keyEvent.GetBaseObject();
+
+ return static_cast< Internal::KeyEvent& >( object );
+}
+
+inline const Internal::KeyEvent& GetImplementation( const Dali::KeyEvent& keyEvent )
+{
+ DALI_ASSERT_ALWAYS( keyEvent && "Key Event handle is empty" );
+
+ const BaseObject& object = keyEvent.GetBaseObject();
-const Internal::KeyEventImpl* GetImplementation( const KeyEvent* keyEvent );
+ return static_cast< const Internal::KeyEvent& >( object );
+}
} // namespace Dali
/*
- * Copyright (c) 2017 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.
// INTERNAL INCLUDES
#include <dali/public-api/events/key-event.h>
#include <dali/internal/event/events/key-event-impl.h>
-#include <dali/internal/event/actors/actor-impl.h>
#include <dali/internal/event/common/scene-impl.h>
#include <dali/integration-api/events/key-event-integ.h>
void KeyEventProcessor::ProcessKeyEvent( const Integration::KeyEvent& event )
{
- KeyEvent keyEvent(event.keyName, event.keyString, event.keyCode, event.keyModifier, event.time, static_cast<Dali::KeyEvent::State>(event.state));
- GetImplementation( &keyEvent )->SetLogicalKey( event.logicalKey );
- GetImplementation( &keyEvent )->SetCompose( event.compose );
- GetImplementation( &keyEvent )->SetDeviceName( event.deviceName );
- GetImplementation( &keyEvent )->SetDeviceClass( event.deviceClass );
- GetImplementation( &keyEvent )->SetDeviceSubclass( event.deviceSubclass );
+ KeyEventPtr keyEvent( new KeyEvent( event.keyName, event.logicalKey, event.keyString, event.keyCode, event.keyModifier, event.time, static_cast<Dali::KeyEvent::State>( event.state ), event.compose, event.deviceName, event.deviceClass, event.deviceSubclass ) );
+ Dali::KeyEvent keyEventHandle( keyEvent.Get() );
// Emit the key event signal from the scene.
- bool consumed = mScene.EmitKeyEventGeneratedSignal( keyEvent );
+ bool consumed = mScene.EmitKeyEventGeneratedSignal( keyEventHandle );
if( !consumed )
{
- mScene.EmitKeyEventSignal(keyEvent);
+ mScene.EmitKeyEventSignal( keyEventHandle );
}
}
/*
- * 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.
#include <cstring> // for strcmp
// INTERNAL INCLUDES
+#include <dali/public-api/events/rotation-gesture.h>
#include <dali/public-api/object/type-registry.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/gesture-event-processor.h>
#include <dali/integration-api/debug.h>
-#include <dali/devel-api/events/rotation-gesture.h>
namespace Dali
{
}
RotationGestureDetector::RotationGestureDetector()
-: GestureDetector( DevelGesture::Rotation )
+: GestureDetector( Gesture::Rotation )
{
}
#define DALI_INTERNAL_ROTATION_GESTURE_DETECTOR_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.
*/
// INTERNAL INCLUDES
+#include <dali/public-api/events/rotation-gesture-detector.h>
#include <dali/internal/event/events/gesture-detector-impl.h>
-#include <dali/devel-api/events/rotation-gesture-detector.h>
namespace Dali
{
#define DALI_INTERNAL_EVENT_ROTATION_GESTURE_EVENT_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.
// INTERNAL INCLUDES
#include <dali/public-api/math/radian.h>
#include <dali/public-api/math/vector2.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/gesture-event.h>
namespace Dali
* @param[in] state The state of the gesture
*/
RotationGestureEvent( Gesture::State state )
- : GestureEvent( DevelGesture::Rotation, state )
+ : GestureEvent( Gesture::Rotation, state )
{
}
// INTERNAL INCLUDES
#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/events/rotation-gesture.h>
#include <dali/public-api/math/vector2.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/internal/event/events/rotation-gesture/rotation-gesture-event.h>
#include <dali/integration-api/debug.h>
#include <dali/internal/event/common/scene-impl.h>
#include <dali/internal/event/render-tasks/render-task-impl.h>
#include <dali/internal/event/events/rotation-gesture/rotation-gesture-recognizer.h>
#include <dali/internal/event/events/gesture-requests.h>
-#include <dali/devel-api/events/rotation-gesture.h>
namespace Dali
{
} // unnamed namespace
RotationGestureProcessor::RotationGestureProcessor()
-: GestureProcessor( DevelGesture::Rotation ),
+: GestureProcessor( Gesture::Rotation ),
mRotationGestureDetectors(),
mCurrentRotationEmitters(),
mCurrentRotationEvent( nullptr ),
// INTERNAL INCLUDES
#include <dali/public-api/events/touch-point.h>
#include <dali/public-api/math/vector2.h>
-#include <dali/devel-api/events/gesture-devel.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/internal/event/events/rotation-gesture/rotation-gesture-event.h>
#include <dali/internal/event/common/scene-impl.h>
} // unnamed namespace
RotationGestureRecognizer::RotationGestureRecognizer( Observer& observer, uint32_t minimumTouchEvents, uint32_t minimumTouchEventsAfterStart )
-: GestureRecognizer( DevelGesture::Rotation ),
+: GestureRecognizer( Gesture::Rotation ),
mObserver( observer ),
mState( Clear ),
mTouchEvents(),
/*
- * 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.
return geometry;
}
-uint32_t Geometry::AddVertexBuffer( PropertyBuffer& vertexBuffer )
+uint32_t Geometry::AddVertexBuffer( VertexBuffer& vertexBuffer )
{
mVertexBuffers.push_back( &vertexBuffer );
SceneGraph::AttachVertexBufferMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, *vertexBuffer.GetRenderObject() );
void Geometry::RemoveVertexBuffer( uint32_t index )
{
- const Render::PropertyBuffer& renderPropertyBuffer = static_cast<const Render::PropertyBuffer&>( *(mVertexBuffers[index]->GetRenderObject()) );
- SceneGraph::RemoveVertexBufferMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, renderPropertyBuffer );
+ const Render::VertexBuffer& renderVertexBuffer = static_cast<const Render::VertexBuffer&>( *(mVertexBuffers[index]->GetRenderObject()) );
+ SceneGraph::RemoveVertexBufferMessage( mEventThreadServices.GetUpdateManager(), *mRenderObject, renderVertexBuffer );
mVertexBuffers.erase( mVertexBuffers.begin() + index );
}
#define DALI_INTERNAL_GEOMETRY_H
/*
- * 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.
#include <dali/internal/event/common/connectable.h> // Dali::Internal::Connectable
#include <dali/internal/event/common/object-connector.h> // Dali::Internal::ObjectConnector
#include <dali/internal/event/common/object-impl.h> // Dali::Internal::Object
-#include <dali/internal/event/common/property-buffer-impl.h> // Dali::Internal::PropertyBuffer
+#include <dali/internal/event/rendering/vertex-buffer-impl.h> // Dali::Internal::VertexBuffer
#include <dali/internal/render/renderers/render-geometry.h>
namespace Dali
/**
* @copydoc Dali::Geometry::AddVertexBuffer()
*/
- uint32_t AddVertexBuffer( PropertyBuffer& vertexBuffer );
+ uint32_t AddVertexBuffer( VertexBuffer& vertexBuffer );
/**
* @copydoc Dali::Geometry::GetNumberOfVertexBuffers()
EventThreadServices& mEventThreadServices; ///<Used to send messages to the render thread via update thread
Render::Geometry* mRenderObject;
- std::vector<PropertyBufferPtr> mVertexBuffers; ///< Vector of intrusive pointers to vertex buffers
+ std::vector<VertexBufferPtr> mVertexBuffers; ///< Vector of intrusive pointers to vertex buffers
Dali::Geometry::Type mType; ///< Geometry type (cached)
};
#include <dali/public-api/common/intrusive-ptr.h> // Dali::IntrusivePtr
#include <dali/public-api/rendering/texture-set.h> // Dali::TextureSet
#include <dali/internal/event/common/object-impl.h> // Dali::Internal::Object
-#include <dali/internal/event/common/property-buffer-impl.h> // Dali::Internal::PropertyBuffer
#include <dali/internal/event/rendering/sampler-impl.h> // Dali::Internal::Sampler
-#include <dali/internal/event/rendering/texture-impl.h> // Dali::Internal::Texture
#include <dali/internal/event/rendering/shader-impl.h> // Dali::Internal::Shader
+#include <dali/internal/event/rendering/texture-impl.h> // Dali::Internal::Texture
+
namespace Dali
{
/*
- * 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.
*/
// CLASS HEADER
-#include <dali/internal/event/common/property-buffer-impl.h>
+#include <dali/internal/event/rendering/vertex-buffer-impl.h>
// INTERNAL INCLUDES
-#include <dali/public-api/rendering/property-buffer.h>
+#include <dali/public-api/rendering/vertex-buffer.h>
#include <dali/internal/update/manager/update-manager.h>
#if defined (ANDROID) || defined(WIN32)
} // unnamed namespace
-PropertyBufferPtr PropertyBuffer::New( Dali::Property::Map& format )
+VertexBufferPtr VertexBuffer::New( Dali::Property::Map& format )
{
DALI_ASSERT_ALWAYS( format.Count() && "Format cannot be empty." );
- PropertyBufferPtr propertyBuffer( new PropertyBuffer() );
- propertyBuffer->Initialize( format );
+ VertexBufferPtr vertexBuffer( new VertexBuffer() );
+ vertexBuffer->Initialize( format );
- return propertyBuffer;
+ return vertexBuffer;
}
-void PropertyBuffer::SetData( const void* data, uint32_t size )
+void VertexBuffer::SetData( const void* data, uint32_t size )
{
mSize = size; // size is the number of elements
uint32_t bufferSize = mBufferFormatSize * mSize;
// create a new DALi vector to store the buffer data
- // the heap allocated vector will end up being owned by Render::PropertyBuffer
+ // the heap allocated vector will end up being owned by Render::VertexBuffer
OwnerPointer< Vector<uint8_t> > bufferCopy = new Dali::Vector<uint8_t>();
bufferCopy->Resize( bufferSize );
std::copy( source, source + bufferSize, destination );
// Ownership of the bufferCopy is passed to the message ( uses an owner pointer )
- SceneGraph::SetPropertyBufferData( mEventThreadServices.GetUpdateManager(), *mRenderObject, bufferCopy, mSize );
+ SceneGraph::SetVertexBufferData( mEventThreadServices.GetUpdateManager(), *mRenderObject, bufferCopy, mSize );
}
-uint32_t PropertyBuffer::GetSize() const
+uint32_t VertexBuffer::GetSize() const
{
return mSize;
}
-const Render::PropertyBuffer* PropertyBuffer::GetRenderObject() const
+const Render::VertexBuffer* VertexBuffer::GetRenderObject() const
{
return mRenderObject;
}
-PropertyBuffer::~PropertyBuffer()
+VertexBuffer::~VertexBuffer()
{
if( EventThreadServices::IsCoreRunning() && mRenderObject)
{
- SceneGraph::RemovePropertyBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject );
+ SceneGraph::RemoveVertexBuffer( mEventThreadServices.GetUpdateManager(), *mRenderObject );
}
}
-PropertyBuffer::PropertyBuffer()
+VertexBuffer::VertexBuffer()
: mEventThreadServices( EventThreadServices::Get() ),
mRenderObject( NULL ),
mBufferFormatSize( 0 ),
{
}
-void PropertyBuffer::Initialize( Dali::Property::Map& formatMap )
+void VertexBuffer::Initialize( Dali::Property::Map& formatMap )
{
- mRenderObject = new Render::PropertyBuffer();
- OwnerPointer< Render::PropertyBuffer > transferOwnership( mRenderObject );
- SceneGraph::AddPropertyBuffer( mEventThreadServices.GetUpdateManager(), transferOwnership );
+ mRenderObject = new Render::VertexBuffer();
+ OwnerPointer< Render::VertexBuffer > transferOwnership( mRenderObject );
+ SceneGraph::AddVertexBuffer( mEventThreadServices.GetUpdateManager(), transferOwnership );
uint32_t numComponents = static_cast<uint32_t>( formatMap.Count() );
// Create the format
- OwnerPointer< Render::PropertyBuffer::Format> format = new Render::PropertyBuffer::Format();
+ OwnerPointer< Render::VertexBuffer::Format> format = new Render::VertexBuffer::Format();
format->components.resize( numComponents );
uint32_t currentAlignment = 0u;
( type == Property::ARRAY ) ||
( type == Property::MAP ) )
{
- DALI_ABORT( "Property::Type not supported in PropertyBuffer" );
+ DALI_ABORT( "Property::Type not supported in VertexBuffer" );
}
uint32_t elementSize = GetPropertyImplementationSize( type );
uint32_t elementAlignment = GetPropertyImplementationAlignment( type );
mBufferFormatSize = format->size;
- SceneGraph::SetPropertyBufferFormat(mEventThreadServices.GetUpdateManager(), *mRenderObject, format );
+ SceneGraph::SetVertexBufferFormat(mEventThreadServices.GetUpdateManager(), *mRenderObject, format );
}
uint32_t GetPropertyImplementationSize( Property::Type& propertyType )
-#ifndef DALI_INTERNAL_PROPERTY_BUFFER_H
-#define DALI_INTERNAL_PROPERTY_BUFFER_H
+#ifndef DALI_INTERNAL_VERTEX_BUFFER_H
+#define DALI_INTERNAL_VERTEX_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.
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/object/property-map.h> // Dali::Property::Map
#include <dali/internal/event/common/event-thread-services.h>
-#include <dali/internal/render/renderers/render-property-buffer.h>
+#include <dali/internal/render/renderers/render-vertex-buffer.h>
namespace Dali
{
namespace Internal
{
-class PropertyBuffer;
-typedef IntrusivePtr<PropertyBuffer> PropertyBufferPtr;
+class VertexBuffer;
+typedef IntrusivePtr<VertexBuffer> VertexBufferPtr;
/**
- * PropertyBuffer is an object that contains an array of structures of values that
+ * VertexBuffer is an object that contains an array of structures of values that
* can be accessed as properties.
*/
-class PropertyBuffer : public BaseObject
+class VertexBuffer : public BaseObject
{
public:
/**
* @copydoc PropertBuffer::New()
*/
- static PropertyBufferPtr New( Dali::Property::Map& format );
+ static VertexBufferPtr New( Dali::Property::Map& format );
/**
* @copydoc PropertBuffer::SetData()
public: // Default property extensions from Object
/**
- * @brief Get the render thread side of the PropertyBuffer
+ * @brief Get the render thread side of the VertexBuffer
*
- * @return The render thread side of this PropertyBuffer
+ * @return The render thread side of this VertexBuffer
*/
- const Render::PropertyBuffer* GetRenderObject() const;
+ const Render::VertexBuffer* GetRenderObject() const;
protected:
/**
* @brief Destructor
*/
- ~PropertyBuffer();
+ ~VertexBuffer();
private: // implementation
/**
* @brief Default constructor
*/
- PropertyBuffer();
+ VertexBuffer();
/**
* Second stage initialization
void Initialize( Dali::Property::Map& format );
private: // unimplemented methods
- PropertyBuffer( const PropertyBuffer& );
- PropertyBuffer& operator=( const PropertyBuffer& );
+ VertexBuffer( const VertexBuffer& );
+ VertexBuffer& operator=( const VertexBuffer& );
private: // data
EventThreadServices& mEventThreadServices; ///<Used to send messages to the render thread via update thread
- Render::PropertyBuffer* mRenderObject; ///<Render side object
+ Render::VertexBuffer* mRenderObject; ///<Render side object
uint32_t mBufferFormatSize;
uint32_t mSize; ///< Number of elements in the buffer
};
*/
template<Property::Type type> struct PropertyImplementationType
{
- // typedef ... Type; not defined, only support types declared bellow
+ // typedef ... Type; not defined, only support types declared below
};
template<> struct PropertyImplementationType< Property::BOOLEAN > { typedef bool Type; };
template<> struct PropertyImplementationType< Property::FLOAT > { typedef float Type; };
} // namespace Internal
// Helpers for public-api forwarding methods
-inline Internal::PropertyBuffer& GetImplementation(Dali::PropertyBuffer& handle)
+inline Internal::VertexBuffer& GetImplementation(Dali::VertexBuffer& handle)
{
- DALI_ASSERT_ALWAYS(handle && "PropertyBuffer handle is empty");
+ DALI_ASSERT_ALWAYS(handle && "VertexBuffer handle is empty");
BaseObject& object = handle.GetBaseObject();
- return static_cast<Internal::PropertyBuffer&>(object);
+ return static_cast<Internal::VertexBuffer&>(object);
}
-inline const Internal::PropertyBuffer& GetImplementation(const Dali::PropertyBuffer& handle)
+inline const Internal::VertexBuffer& GetImplementation(const Dali::VertexBuffer& handle)
{
- DALI_ASSERT_ALWAYS(handle && "PropertyBuffer handle is empty");
+ DALI_ASSERT_ALWAYS(handle && "VertexBuffer handle is empty");
const BaseObject& object = handle.GetBaseObject();
- return static_cast<const Internal::PropertyBuffer&>(object);
+ return static_cast<const Internal::VertexBuffer&>(object);
}
} // namespace Dali
-#endif // DALI_INTERNAL_PROPERTY_BUFFER_H
+#endif // DALI_INTERNAL_VERTEX_BUFFER_H
${internal_src_dir}/event/common/object-impl.cpp
${internal_src_dir}/event/common/object-registry-impl.cpp
${internal_src_dir}/event/common/projection.cpp
- ${internal_src_dir}/event/common/property-buffer-impl.cpp
${internal_src_dir}/event/common/property-conditions-impl.cpp
${internal_src_dir}/event/common/property-metadata.cpp
${internal_src_dir}/event/common/property-notification-impl.cpp
${internal_src_dir}/event/rendering/renderer-impl.cpp
${internal_src_dir}/event/rendering/sampler-impl.cpp
${internal_src_dir}/event/rendering/shader-impl.cpp
+ ${internal_src_dir}/event/rendering/vertex-buffer-impl.cpp
${internal_src_dir}/event/size-negotiation/memory-pool-relayout-container.cpp
${internal_src_dir}/event/size-negotiation/relayout-controller-impl.cpp
${internal_src_dir}/render/queue/render-queue.cpp
${internal_src_dir}/render/renderers/render-frame-buffer.cpp
${internal_src_dir}/render/renderers/render-geometry.cpp
- ${internal_src_dir}/render/renderers/render-property-buffer.cpp
+ ${internal_src_dir}/render/renderers/render-vertex-buffer.cpp
${internal_src_dir}/render/renderers/render-renderer.cpp
${internal_src_dir}/render/renderers/render-texture.cpp
${internal_src_dir}/render/shaders/program.cpp
OwnerContainer< Render::Sampler* > samplerContainer; ///< List of owned samplers
OwnerContainer< Render::Texture* > textureContainer; ///< List of owned textures
OwnerContainer< Render::FrameBuffer* > frameBufferContainer; ///< List of owned framebuffers
- OwnerContainer< Render::PropertyBuffer* > propertyBufferContainer; ///< List of owned property buffers
+ OwnerContainer< Render::VertexBuffer* > vertexBufferContainer; ///< List of owned vertex buffers
OwnerContainer< Render::Geometry* > geometryContainer; ///< List of owned Geometries
bool lastFrameWasRendered; ///< Keeps track of the last frame being rendered due to having render instructions
frameBuffer->AttachDepthStencilTexture( mImpl->context, texture, mipmapLevel );
}
-void RenderManager::AddPropertyBuffer( OwnerPointer< Render::PropertyBuffer >& propertyBuffer )
+void RenderManager::AddVertexBuffer( OwnerPointer< Render::VertexBuffer >& vertexBuffer )
{
- mImpl->propertyBufferContainer.PushBack( propertyBuffer.Release() );
+ mImpl->vertexBufferContainer.PushBack( vertexBuffer.Release() );
}
-void RenderManager::RemovePropertyBuffer( Render::PropertyBuffer* propertyBuffer )
+void RenderManager::RemoveVertexBuffer( Render::VertexBuffer* vertexBuffer )
{
- mImpl->propertyBufferContainer.EraseObject( propertyBuffer );
+ mImpl->vertexBufferContainer.EraseObject( vertexBuffer );
}
-void RenderManager::SetPropertyBufferFormat( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format )
+void RenderManager::SetVertexBufferFormat( Render::VertexBuffer* vertexBuffer, OwnerPointer< Render::VertexBuffer::Format>& format )
{
- propertyBuffer->SetFormat( format.Release() );
+ vertexBuffer->SetFormat( format.Release() );
}
-void RenderManager::SetPropertyBufferData( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
+void RenderManager::SetVertexBufferData( Render::VertexBuffer* vertexBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
{
- propertyBuffer->SetData( data.Release(), size );
+ vertexBuffer->SetData( data.Release(), size );
}
void RenderManager::SetIndexBuffer( Render::Geometry* geometry, Dali::Vector<uint16_t>& indices )
mImpl->geometryContainer.EraseObject( geometry );
}
-void RenderManager::AttachVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer )
+void RenderManager::AttachVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer )
{
DALI_ASSERT_DEBUG( NULL != geometry );
{
if ( iter == geometry )
{
- iter->AddPropertyBuffer( propertyBuffer );
+ iter->AddVertexBuffer( vertexBuffer );
break;
}
}
}
-void RenderManager::RemoveVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer )
+void RenderManager::RemoveVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer )
{
DALI_ASSERT_DEBUG( NULL != geometry );
{
if ( iter == geometry )
{
- iter->RemovePropertyBuffer( propertyBuffer );
+ iter->RemoveVertexBuffer( vertexBuffer );
break;
}
}
#include <dali/public-api/math/rect.h>
#include <dali/integration-api/core-enumerations.h>
#include <dali/internal/common/shader-saver.h>
-#include <dali/internal/render/gl-resources/gpu-buffer.h>
-#include <dali/internal/render/renderers/render-property-buffer.h>
#include <dali/internal/event/rendering/texture-impl.h>
+#include <dali/internal/render/gl-resources/gpu-buffer.h>
+#include <dali/internal/render/renderers/render-vertex-buffer.h>
namespace Dali
{
class RenderInstruction;
class RenderInstructionContainer;
class Shader;
-class PropertyBufferDataProvider;
class Scene;
/**
/**
* Add a property buffer to the render manager.
- * @param[in] propertyBuffer The property buffer to add.
+ * @param[in] vertexBuffer The property buffer to add.
* @post propertBuffer is owned by RenderManager
*/
- void AddPropertyBuffer( OwnerPointer< Render::PropertyBuffer >& propertyBuffer );
+ void AddVertexBuffer( OwnerPointer< Render::VertexBuffer >& vertexBuffer );
/**
* Remove a property buffer from the render manager.
- * @param[in] propertyBuffer The property buffer to remove.
- * @post propertyBuffer is destroyed.
+ * @param[in] vertexBuffer The property buffer to remove.
+ * @post vertexBuffer is destroyed.
*/
- void RemovePropertyBuffer( Render::PropertyBuffer* propertyBuffer );
+ void RemoveVertexBuffer( Render::VertexBuffer* vertexBuffer );
/**
* Add a geometry to the render manager.
/**
* Adds a property buffer to a geometry from the render manager.
* @param[in] geometry The geometry
- * @param[in] propertyBuffer The property buffer to remove.
+ * @param[in] vertexBuffer The property buffer to remove.
*/
- void AttachVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
+ void AttachVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer );
/**
* Remove a property buffer from a Render::Geometry from the render manager.
* @param[in] geometry The geometry
- * @param[in] propertyBuffer The property buffer to remove.
+ * @param[in] vertexBuffer The property buffer to remove.
* @post property buffer is destroyed.
*/
- void RemoveVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
+ void RemoveVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer );
/**
* Sets the format of an existing property buffer
- * @param[in] propertyBuffer The property buffer.
+ * @param[in] vertexBuffer The property buffer.
* @param[in] format The new format of the buffer
*/
- void SetPropertyBufferFormat( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format );
+ void SetVertexBufferFormat( Render::VertexBuffer* vertexBuffer, OwnerPointer< Render::VertexBuffer::Format>& format );
/**
* Sets the data of an existing property buffer
- * @param[in] propertyBuffer The property buffer.
+ * @param[in] vertexBuffer The property buffer.
* @param[in] data The new data of the buffer
* @param[in] size The new size of the buffer
*/
- void SetPropertyBufferData( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size );
+ void SetVertexBufferData( Render::VertexBuffer* vertexBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size );
/**
* Sets the data for the index buffer of an existing geometry
+++ /dev/null
-#ifndef DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_DATA_PROVIDER_H
-#define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_DATA_PROVIDER_H
-
-/*
- * Copyright (c) 2017 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.
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/object/property.h>
-#include <dali/internal/common/buffer-index.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace SceneGraph
-{
-
-class PropertyBufferDataProvider
-{
-public:
-
- /**
- * Type for the data contained in the buffer
- */
- typedef Dali::Vector< char > BufferType;
-
-public:
- /**
- * Constructor
- */
- PropertyBufferDataProvider()
- {
- }
-
- /**
- * Get the number of attributes
- * @param[in] bufferIndex Index to access double buffered values
- * @return the number of attributes
- */
- virtual unsigned int GetAttributeCount( BufferIndex bufferIndex ) const = 0;
-
- /**
- * Get the name of an attribute
- * @param[in] bufferIndex Index to access double buffered values
- * @param[in] index Index of the attribute
- * @return the name of the attribute
- */
- virtual const std::string& GetAttributeName( BufferIndex bufferIndex, unsigned int index ) const = 0;
-
- /**
- * Get the byte size of an attribute
- * @param[in] bufferIndex Index to access double buffered values
- * @param[in] index Index of the attribute
- * @return the byte size of the attribute
- */
- virtual size_t GetAttributeSize( BufferIndex bufferIndex, unsigned int index ) const = 0;
-
- /**
- * Get the type of an attribute
- * @param[in] bufferIndex Index to access double buffered values
- * @param[in] index Index of the attribute
- * @return the type of the attribute
- */
- virtual Property::Type GetAttributeType( BufferIndex bufferIndex, unsigned int index ) const = 0;
-
- /**
- * Get the byte offset of an attribute
- * @param[in] bufferIndex Index to access double buffered values
- * @param[in] index Index of the attribute
- * @return the byte offset of the attribute
- */
- virtual size_t GetAttributeOffset( BufferIndex bufferIndex, unsigned int index ) const = 0;
-
- /**
- * Get the property buffer data
- * @param[in] bufferIndex Index to access double buffered values
- * @return the property buffer's data array
- */
- virtual const BufferType& GetData( BufferIndex bufferIndex ) const = 0;
-
- /**
- * Get the size of the property buffer in bytes
- * @param[in] bufferIndex Index to access double buffered values
- * @return the size in bytes
- */
- virtual size_t GetDataSize( BufferIndex bufferIndex ) const = 0;
-
- /**
- * Get the size of an element of the buffer in bytes
- * @param[in] bufferIndex Index to access double buffered values
- * @return the element size in bytes
- */
- virtual size_t GetElementSize( BufferIndex bufferIndex ) const = 0;
-
- /**
- * Get the number of elements
- * @param[in] bufferIndex Index to access double buffered values
- * @return the number of elements
- */
- virtual unsigned int GetElementCount( BufferIndex bufferIndex ) const = 0;
-
- /**
- * Get Id of the GPU buffer associated with this propertyBuffer
- * @param[in] bufferIndex Index to access double buffered values
- * @return the Id
- */
- virtual unsigned int GetGpuBufferId( BufferIndex bufferIndex ) const = 0;
-
- /**
- * Checks if data in the PropertyBuffer has changed repect previous frame
- * @param[in] bufferIndex Index to access double buffered values
- * @return true if data has changed, false otherwise
- */
- virtual bool HasDataChanged( BufferIndex bufferIndex ) const = 0;
-
-protected:
- /**
- * No deletion through this interface
- */
- virtual ~PropertyBufferDataProvider()
- {
- }
-};
-
-} // namespace SceneGraph
-} // namespace Internal
-} // namespace Dali
-
-#endif // DALI_INTERNAL_SCENE_GRAPH_PROPERTY_BUFFER_DATA_PROVIDER_H
#define DALI_INTERNAL_SCENE_GRAPH_RENDER_DATA_PROVIDER_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.
#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/rendering/renderer.h>
#include <dali/internal/render/data-providers/node-data-provider.h>
-#include <dali/internal/render/data-providers/property-buffer-data-provider.h>
#include <dali/internal/render/data-providers/uniform-map-data-provider.h>
#include <dali/internal/render/renderers/render-sampler.h>
#include <dali/internal/render/renderers/render-texture.h>
namespace SceneGraph
{
-class PropertyBuffer;
class Shader;
class Renderer;
class RenderDataProvider
{
public:
- typedef Dali::Vector< const PropertyBufferDataProvider* > VertexBuffers;
typedef std::vector< Render::Sampler* > Samplers;
/**
/*
- * 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.
#include <dali/internal/common/buffer-index.h>
#include <dali/internal/render/gl-resources/context.h>
#include <dali/internal/render/gl-resources/gpu-buffer.h>
-#include <dali/internal/render/renderers/render-property-buffer.h>
+#include <dali/internal/render/renderers/render-vertex-buffer.h>
#include <dali/internal/render/shaders/program.h>
namespace Dali
{
}
-void Geometry::AddPropertyBuffer( Render::PropertyBuffer* propertyBuffer )
+void Geometry::AddVertexBuffer( Render::VertexBuffer* vertexBuffer )
{
- mVertexBuffers.PushBack( propertyBuffer );
+ mVertexBuffers.PushBack( vertexBuffer );
mAttributesChanged = true;
}
mIndicesChanged = true;
}
-void Geometry::RemovePropertyBuffer( const Render::PropertyBuffer* propertyBuffer )
+void Geometry::RemoveVertexBuffer( const Render::VertexBuffer* vertexBuffer )
{
const auto&& end = mVertexBuffers.End();
for( auto&& iter = mVertexBuffers.Begin(); iter != end; ++iter )
{
- if( *iter == propertyBuffer )
+ if( *iter == vertexBuffer )
{
- //This will delete the gpu buffer associated to the RenderPropertyBuffer if there is one
+ //This will delete the gpu buffer associated to the RenderVertexBuffer if there is one
mVertexBuffers.Remove( iter );
mAttributesChanged = true;
break;
#define DALI_INTERNAL_RENDER_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.
namespace Render
{
-class PropertyBuffer;
+class VertexBuffer;
/**
* This class encapsulates the GPU buffers. It is used to upload vertex data
/**
* Adds a property buffer to the geometry
- * @param[in] dataProvider The PropertyBuffer data provider
+ * @param[in] dataProvider The VertexBuffer data provider
*/
- void AddPropertyBuffer( Render::PropertyBuffer* propertyBuffer );
+ void AddVertexBuffer( Render::VertexBuffer* vertexBuffer );
/**
* Set the data for the index buffer to be used by the geometry
void SetIndexBuffer( Dali::Vector<uint16_t>& indices );
/**
- * Removes a PropertyBuffer from the geometry
- * @param[in] propertyBuffer The property buffer to be removed
+ * Removes a VertexBuffer from the geometry
+ * @param[in] vertexBuffer The property buffer to be removed
*/
- void RemovePropertyBuffer( const Render::PropertyBuffer* propertyBuffer );
+ void RemoveVertexBuffer( const Render::VertexBuffer* vertexBuffer );
/**
* Gets the attribute locations on the shader for the attributes defined in the geometry RenderBuffers
private:
- // PropertyBuffers
- Vector< Render::PropertyBuffer* > mVertexBuffers;
+ // VertexBuffers
+ Vector< Render::VertexBuffer* > mVertexBuffers;
Dali::Vector< uint16_t > mIndices;
OwnerPointer< GpuBuffer > mIndexBuffer;
/*
- * 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.
*
*/
-#include <dali/internal/render/renderers/render-property-buffer.h>
-#include <dali/internal/event/common/property-buffer-impl.h> // Dali::Internal::PropertyBuffer
+#include <dali/internal/render/renderers/render-vertex-buffer.h>
+#include <dali/internal/event/rendering/vertex-buffer-impl.h> // Dali::Internal::VertexBuffer
namespace
{
namespace Render
{
-PropertyBuffer::PropertyBuffer()
+VertexBuffer::VertexBuffer()
:mFormat(NULL),
mData(NULL),
mGpuBuffer(NULL),
{
}
-PropertyBuffer::~PropertyBuffer()
+VertexBuffer::~VertexBuffer()
{
}
-void PropertyBuffer::SetFormat( PropertyBuffer::Format* format )
+void VertexBuffer::SetFormat( VertexBuffer::Format* format )
{
mFormat = format;
mDataChanged = true;
}
-void PropertyBuffer::SetData( Dali::Vector<uint8_t>* data, uint32_t size )
+void VertexBuffer::SetData( Dali::Vector<uint8_t>* data, uint32_t size )
{
mData = data;
mSize = size;
mDataChanged = true;
}
-bool PropertyBuffer::Update( Context& context )
+bool VertexBuffer::Update( Context& context )
{
if( !mData || !mFormat || !mSize )
{
return true;
}
-void PropertyBuffer::BindBuffer( Context& context, GpuBuffer::Target target )
+void VertexBuffer::BindBuffer( Context& context, GpuBuffer::Target target )
{
if(mGpuBuffer)
{
}
}
-uint32_t PropertyBuffer::EnableVertexAttributes( Context& context, Vector<GLint>& vAttributeLocation, uint32_t locationBase )
+uint32_t VertexBuffer::EnableVertexAttributes( Context& context, Vector<GLint>& vAttributeLocation, uint32_t locationBase )
{
const uint32_t attributeCount = static_cast<uint32_t>( mFormat->components.size() );
-#ifndef DALI_INTERNAL_RENDER_PROPERTY_BUFFER_H
-#define DALI_INTERNAL_RENDER_PROPERTY_BUFFER_H
+#ifndef DALI_INTERNAL_RENDER_VERTEX_BUFFER_H
+#define DALI_INTERNAL_RENDER_VERTEX_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.
namespace Render
{
-class PropertyBuffer
+class VertexBuffer
{
public:
};
/**
- * Structure that holds the meta-data of the format of PropertyBuffer.
+ * Structure that holds the meta-data of the format of VertexBuffer.
*/
struct Format
{
/**
* @brief Default constructor
*/
- PropertyBuffer();
+ VertexBuffer();
/**
* @brief Destructor
*/
- ~PropertyBuffer();
+ ~VertexBuffer();
/**
* @brief Set the format of the buffer
*
* This function takes ownership of the pointer
*
- * @param[in] format The format for the PropertyBuffer
+ * @param[in] format The format for the VertexBuffer
*/
- void SetFormat( PropertyBuffer::Format* format );
+ void SetFormat( VertexBuffer::Format* format );
/**
- * @brief Set the data of the PropertyBuffer
+ * @brief Set the data of the VertexBuffer
*
* This function takes ownership of the pointer
- * @param[in] data The new data of the PropertyBuffer
+ * @param[in] data The new data of the VertexBuffer
* @param[in] size The new size of the buffer
*/
void SetData( Dali::Vector<uint8_t>* data, uint32_t size );
return reinterpret_cast<T*>( &data->operator[]( 0 ) );
}
- inline const PropertyBuffer::Format* GetFormat() const
+ inline const VertexBuffer::Format* GetFormat() const
{
return mFormat.Get();
}
private:
- OwnerPointer< PropertyBuffer::Format > mFormat; ///< Format of the buffer
+ OwnerPointer< VertexBuffer::Format > mFormat; ///< Format of the buffer
OwnerPointer< Dali::Vector< uint8_t > > mData; ///< Data
- OwnerPointer< GpuBuffer > mGpuBuffer; ///< Pointer to the GpuBuffer associated with this RenderPropertyBuffer
+ OwnerPointer< GpuBuffer > mGpuBuffer; ///< Pointer to the GpuBuffer associated with this RenderVertexBuffer
uint32_t mSize; ///< Number of Elements in the buffer
bool mDataChanged; ///< Flag to know if data has changed in a frame
} // namespace Dali
-#endif // DALI_INTERNAL_RENDER_PROPERTY_BUFFER_H
+#endif // DALI_INTERNAL_RENDER_VERTEX_BUFFER_H
void Animation::Bake(BufferIndex bufferIndex, EndAction action)
{
- if( action == Dali::Animation::BakeFinal )
+ if( action == Dali::Animation::BAKE_FINAL )
{
if( mSpeedFactor > 0.0f )
{
{
animationFinished = true; // The actor-thread should be notified of this
- if( mEndAction != Dali::Animation::Discard )
+ if( mEndAction != Dali::Animation::DISCARD )
{
Bake( bufferIndex, mEndAction );
{
if (mState == Playing || mState == Paused)
{
- if (mEndAction != Dali::Animation::Discard)
+ if (mEndAction != Dali::Animation::DISCARD)
{
Bake( bufferIndex, mEndAction );
// Make elapsed second as edge of range forcely.
mElapsedSeconds = edgeRangeSeconds + signSpeedFactor * Math::MACHINE_EPSILON_10;
- UpdateAnimators(bufferIndex, finished && (mEndAction != Dali::Animation::Discard), finished );
+ UpdateAnimators(bufferIndex, finished && (mEndAction != Dali::Animation::DISCARD), finished );
// After update animation, mElapsedSeconds must be begin of value
mElapsedSeconds = playRangeStartSeconds + playRangeEndSeconds - edgeRangeSeconds;
mCurrentProgress( 0.f ),
mLoopCount( 1 ),
mAlphaFunction( alphaFunction ),
- mDisconnectAction( Dali::Animation::BakeFinal ),
+ mDisconnectAction( Dali::Animation::BAKE_FINAL ),
mAnimationPlaying( false ),
mEnabled( true ),
mConnectedToSceneGraph( false ),
void PropertyOwnerDisconnected( BufferIndex bufferIndex, PropertyOwner& owner ) override final
{
// If we are active, then bake the value if required
- if ( mAnimationPlaying && mDisconnectAction != Dali::Animation::Discard )
+ if ( mAnimationPlaying && mDisconnectAction != Dali::Animation::DISCARD )
{
// Bake to target-value if BakeFinal, otherwise bake current value
- Update( bufferIndex, ( mDisconnectAction == Dali::Animation::Bake ? mCurrentProgress : 1.0f ), true );
+ Update( bufferIndex, ( mDisconnectAction == Dali::Animation::BAKE ? mCurrentProgress : 1.0f ), true );
}
mEnabled = false;
{
if(mKeyFrames->IsActive(progress))
{
- return mKeyFrames->GetValue(progress, Dali::Animation::Linear);
+ return mKeyFrames->GetValue(progress, Dali::Animation::LINEAR);
}
return property;
}
{
if(mKeyFrames->IsActive(progress))
{
- return mKeyFrames->GetValue(progress, Dali::Animation::Linear);
+ return mKeyFrames->GetValue(progress, Dali::Animation::LINEAR);
}
return property;
}
#define DALI_INTERNAL_SCENE_GRAPH_RENDER_MESSAGE_DISPATCHER_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.
// INTERNAL INCLUDES
#include <dali/internal/update/common/scene-graph-buffers.h>
-#include <dali/internal/render/gl-resources/gpu-buffer.h>
#include <dali/internal/render/renderers/render-renderer.h>
-#include <dali/internal/render/renderers/render-property-buffer.h>
namespace Dali
{
{
class RenderTracker;
}
+
namespace SceneGraph
{
class RenderManager;
class RenderQueue;
-class PropertyBufferDataProvider;
+
/**
* A utility class for sending messages to the render-thread.
*/
#include <dali/internal/render/common/render-instruction-container.h>
#include <dali/internal/render/shaders/scene-graph-shader.h>
#include <dali/internal/render/renderers/render-renderer.h>
-#include <dali/internal/render/renderers/render-property-buffer.h>
#include <dali/internal/update/nodes/scene-graph-layer.h>
namespace
new (slot) DerivedType( &mImpl->renderManager, &RenderManager::SetWrapMode, sampler, rWrapMode, sWrapMode, tWrapMode );
}
-void UpdateManager::AddPropertyBuffer( OwnerPointer< Render::PropertyBuffer >& propertyBuffer )
+void UpdateManager::AddVertexBuffer( OwnerPointer< Render::VertexBuffer >& vertexBuffer )
{
// Message has ownership of format while in transit from update -> render
- typedef MessageValue1< RenderManager, OwnerPointer< Render::PropertyBuffer > > DerivedType;
+ typedef MessageValue1< RenderManager, OwnerPointer< Render::VertexBuffer > > DerivedType;
// Reserve some memory inside the render queue
uint32_t* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
// Construct message in the render queue memory; note that delete should not be called on the return value
- new (slot) DerivedType( &mImpl->renderManager, &RenderManager::AddPropertyBuffer, propertyBuffer );
+ new (slot) DerivedType( &mImpl->renderManager, &RenderManager::AddVertexBuffer, vertexBuffer );
}
-void UpdateManager::RemovePropertyBuffer( Render::PropertyBuffer* propertyBuffer )
+void UpdateManager::RemoveVertexBuffer( Render::VertexBuffer* vertexBuffer )
{
- typedef MessageValue1< RenderManager, Render::PropertyBuffer* > DerivedType;
+ typedef MessageValue1< RenderManager, Render::VertexBuffer* > DerivedType;
// Reserve some memory inside the render queue
uint32_t* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
// Construct message in the render queue memory; note that delete should not be called on the return value
- new (slot) DerivedType( &mImpl->renderManager, &RenderManager::RemovePropertyBuffer, propertyBuffer );
+ new (slot) DerivedType( &mImpl->renderManager, &RenderManager::RemoveVertexBuffer, vertexBuffer );
}
-void UpdateManager::SetPropertyBufferFormat( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format )
+void UpdateManager::SetVertexBufferFormat( Render::VertexBuffer* vertexBuffer, OwnerPointer< Render::VertexBuffer::Format>& format )
{
// Message has ownership of format while in transit from update -> render
- typedef MessageValue2< RenderManager, Render::PropertyBuffer*, OwnerPointer< Render::PropertyBuffer::Format > > DerivedType;
+ typedef MessageValue2< RenderManager, Render::VertexBuffer*, OwnerPointer< Render::VertexBuffer::Format > > DerivedType;
// Reserve some memory inside the render queue
uint32_t* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
// Construct message in the render queue memory; note that delete should not be called on the return value
- new (slot) DerivedType( &mImpl->renderManager, &RenderManager::SetPropertyBufferFormat, propertyBuffer, format );
+ new (slot) DerivedType( &mImpl->renderManager, &RenderManager::SetVertexBufferFormat, vertexBuffer, format );
}
-void UpdateManager::SetPropertyBufferData( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
+void UpdateManager::SetVertexBufferData( Render::VertexBuffer* vertexBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
{
// Message has ownership of format while in transit from update -> render
- typedef MessageValue3< RenderManager, Render::PropertyBuffer*, OwnerPointer< Dali::Vector<uint8_t> >, uint32_t > DerivedType;
+ typedef MessageValue3< RenderManager, Render::VertexBuffer*, OwnerPointer< Dali::Vector<uint8_t> >, uint32_t > DerivedType;
// Reserve some memory inside the render queue
uint32_t* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
// Construct message in the render queue memory; note that delete should not be called on the return value
- new (slot) DerivedType( &mImpl->renderManager, &RenderManager::SetPropertyBufferData, propertyBuffer, data, size );
+ new (slot) DerivedType( &mImpl->renderManager, &RenderManager::SetVertexBufferData, vertexBuffer, data, size );
}
void UpdateManager::AddGeometry( OwnerPointer< Render::Geometry >& geometry )
new (slot) DerivedType( &mImpl->renderManager, geometry, indices );
}
-void UpdateManager::RemoveVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer )
+void UpdateManager::RemoveVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer )
{
- typedef MessageValue2< RenderManager, Render::Geometry*, Render::PropertyBuffer* > DerivedType;
+ typedef MessageValue2< RenderManager, Render::Geometry*, Render::VertexBuffer* > DerivedType;
// Reserve some memory inside the render queue
uint32_t* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
// Construct message in the render queue memory; note that delete should not be called on the return value
- new (slot) DerivedType( &mImpl->renderManager, &RenderManager::RemoveVertexBuffer, geometry, propertyBuffer );
+ new (slot) DerivedType( &mImpl->renderManager, &RenderManager::RemoveVertexBuffer, geometry, vertexBuffer );
}
-void UpdateManager::AttachVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer )
+void UpdateManager::AttachVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer )
{
- typedef MessageValue2< RenderManager, Render::Geometry*, Render::PropertyBuffer* > DerivedType;
+ typedef MessageValue2< RenderManager, Render::Geometry*, Render::VertexBuffer* > DerivedType;
// Reserve some memory inside the render queue
uint32_t* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
// Construct message in the render queue memory; note that delete should not be called on the return value
- new (slot) DerivedType( &mImpl->renderManager, &RenderManager::AttachVertexBuffer, geometry, propertyBuffer );
+ new (slot) DerivedType( &mImpl->renderManager, &RenderManager::AttachVertexBuffer, geometry, vertexBuffer );
}
void UpdateManager::AddTexture( OwnerPointer< Render::Texture >& texture )
#include <dali/internal/update/render-tasks/scene-graph-camera.h>
#include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
#include <dali/internal/render/shaders/scene-graph-shader.h> // for OwnerPointer< Shader >
-#include <dali/internal/render/renderers/render-property-buffer.h>
+#include <dali/internal/render/renderers/render-vertex-buffer.h>
#include <dali/internal/event/rendering/texture-impl.h>
namespace Dali
class RenderTaskList;
class RenderTaskProcessor;
class RenderQueue;
-class PropertyBuffer;
+class VertexBuffer;
struct NodeDepthPair
{
* @post Sends a message to RenderManager to add the property buffer.
* The property buffer will be owned by RenderManager
*/
- void AddPropertyBuffer( OwnerPointer< Render::PropertyBuffer >& propertryBuffer );
+ void AddVertexBuffer( OwnerPointer< Render::VertexBuffer >& propertryBuffer );
/**
- * Removes an existing PropertyBuffer from RenderManager
+ * Removes an existing VertexBuffer from RenderManager
* @param[in] propertryBuffer The property buffer to remove
* @post The property buffer will be destroyed in the render thread
*/
- void RemovePropertyBuffer( Render::PropertyBuffer* propertryBuffer );
+ void RemoveVertexBuffer( Render::VertexBuffer* propertryBuffer );
/**
* Sets the format of an existing property buffer
- * @param[in] propertyBuffer The property buffer.
+ * @param[in] vertexBuffer The property buffer.
* @param[in] format The new format of the buffer
* @post Sends a message to RenderManager to set the new format to the property buffer.
*/
- void SetPropertyBufferFormat( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format );
+ void SetVertexBufferFormat( Render::VertexBuffer* vertexBuffer, OwnerPointer< Render::VertexBuffer::Format>& format );
/**
* Sets the data of an existing property buffer
- * @param[in] propertyBuffer The property buffer.
+ * @param[in] vertexBuffer The property buffer.
* @param[in] data The new data of the buffer
* @param[in] size The new size of the buffer
* @post Sends a message to RenderManager to set the new data to the property buffer.
*/
- void SetPropertyBufferData( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size );
+ void SetVertexBufferData( Render::VertexBuffer* vertexBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size );
/**
* Adds a geometry to the RenderManager
/**
* Adds a vertex buffer to a geometry
* @param[in] geometry The geometry
- * @param[in] propertyBuffer The property buffer
+ * @param[in] vertexBuffer The property buffer
*/
- void AttachVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
+ void AttachVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer );
/**
* Removes a vertex buffer from a geometry
* @param[in] geometry The geometry
- * @param[in] propertyBuffer The property buffer
+ * @param[in] vertexBuffer The property buffer
*/
- void RemoveVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
+ void RemoveVertexBuffer( Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer );
/**
* Adds a texture to the render manager
new (slot) LocalType( &manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode );
}
-inline void AddPropertyBuffer( UpdateManager& manager, OwnerPointer< Render::PropertyBuffer >& propertyBuffer )
+inline void AddVertexBuffer( UpdateManager& manager, OwnerPointer< Render::VertexBuffer >& vertexBuffer )
{
- // Message has ownership of propertyBuffer while in transit from event -> update
- typedef MessageValue1< UpdateManager, OwnerPointer< Render::PropertyBuffer > > LocalType;
+ // Message has ownership of vertexBuffer while in transit from event -> update
+ typedef MessageValue1< UpdateManager, OwnerPointer< Render::VertexBuffer > > LocalType;
// Reserve some memory inside the message queue
uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
- new (slot) LocalType( &manager, &UpdateManager::AddPropertyBuffer, propertyBuffer );
+ new (slot) LocalType( &manager, &UpdateManager::AddVertexBuffer, vertexBuffer );
}
-inline void RemovePropertyBuffer( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer )
+inline void RemoveVertexBuffer( UpdateManager& manager, Render::VertexBuffer& vertexBuffer )
{
- typedef MessageValue1< UpdateManager, Render::PropertyBuffer* > LocalType;
+ typedef MessageValue1< UpdateManager, Render::VertexBuffer* > LocalType;
// Reserve some memory inside the message queue
uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
- new (slot) LocalType( &manager, &UpdateManager::RemovePropertyBuffer, &propertyBuffer );
+ new (slot) LocalType( &manager, &UpdateManager::RemoveVertexBuffer, &vertexBuffer );
}
-inline void SetPropertyBufferFormat( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format )
+inline void SetVertexBufferFormat( UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer< Render::VertexBuffer::Format>& format )
{
- // Message has ownership of PropertyBuffer::Format while in transit from event -> update
- typedef MessageValue2< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Render::PropertyBuffer::Format> > LocalType;
+ // Message has ownership of VertexBuffer::Format while in transit from event -> update
+ typedef MessageValue2< UpdateManager, Render::VertexBuffer*, OwnerPointer< Render::VertexBuffer::Format> > LocalType;
// Reserve some memory inside the message queue
uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
- new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferFormat, &propertyBuffer, format );
+ new (slot) LocalType( &manager, &UpdateManager::SetVertexBufferFormat, &vertexBuffer, format );
}
-inline void SetPropertyBufferData( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
+inline void SetVertexBufferData( UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
{
- // Message has ownership of PropertyBuffer data while in transit from event -> update
- typedef MessageValue3< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Vector<uint8_t> >, uint32_t > LocalType;
+ // Message has ownership of VertexBuffer data while in transit from event -> update
+ typedef MessageValue3< UpdateManager, Render::VertexBuffer*, OwnerPointer< Vector<uint8_t> >, uint32_t > LocalType;
// Reserve some memory inside the message queue
uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
- new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferData, &propertyBuffer, data, size );
+ new (slot) LocalType( &manager, &UpdateManager::SetVertexBufferData, &vertexBuffer, data, size );
}
inline void AddGeometry( UpdateManager& manager, OwnerPointer< Render::Geometry >& geometry )
new (slot) LocalType( &manager, &UpdateManager::RemoveGeometry, &geometry );
}
-inline void AttachVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
+inline void AttachVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer )
{
- typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
+ typedef MessageValue2< UpdateManager, Render::Geometry*, Render::VertexBuffer* > LocalType;
// Reserve some memory inside the message queue
uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
- new (slot) LocalType( &manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
+ new (slot) LocalType( &manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer) );
}
-inline void RemoveVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
+inline void RemoveVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer )
{
- typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
+ typedef MessageValue2< UpdateManager, Render::Geometry*, Render::VertexBuffer* > LocalType;
// Reserve some memory inside the message queue
uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
// Construct message in the message queue memory; note that delete should not be called on the return value
- new (slot) LocalType( &manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
+ new (slot) LocalType( &manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer) );
}
// Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
class CustomActor;
class CustomActorImpl;
class RelayoutContainer;
-struct KeyEvent;
+class KeyEvent;
class HoverEvent;
class WheelEvent;
struct Vector2;
LAST_ACTOR_FLAG ///< Special marker for last actor flag @SINCE_1_0.0
};
- static const int32_t ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1; ///< Value for deriving classes to continue on the flag enum
+ static constexpr int32_t ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1; ///< Value for deriving classes to continue on the flag enum
/**
* @brief Creates a CustomActorImpl.
*/
enum EndAction
{
- Bake, ///< When the animation ends, the animated property values are saved. @SINCE_1_0.0
- Discard, ///< When the animation ends, the animated property values are forgotten. @SINCE_1_0.0
- BakeFinal ///< If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Bake. @SINCE_1_0.0
+ BAKE, ///< When the animation ends, the animated property values are saved. @SINCE_1_0.0
+ DISCARD, ///< When the animation ends, the animated property values are forgotten. @SINCE_1_0.0
+ BAKE_FINAL ///< If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Bake. @SINCE_1_0.0
};
/**
*/
enum Interpolation
{
- Linear, ///< Values in between key frames are interpolated using a linear polynomial. (Default) @SINCE_1_0.0
- Cubic ///< Values in between key frames are interpolated using a cubic polynomial. @SINCE_1_0.0
+ LINEAR, ///< Values in between key frames are interpolated using a linear polynomial. (Default) @SINCE_1_0.0
+ CUBIC ///< Values in between key frames are interpolated using a cubic polynomial. @SINCE_1_0.0
};
/**
+++ /dev/null
-/*
- * Copyright (c) 2015 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/public-api/common/constants.h>
-
-// EXTERNAL INCLUDES
-#include <string>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/math/compile-time-math.h>
-#include <dali/public-api/math/degree.h>
-
-namespace Dali
-{
-
-const Vector3 ParentOrigin::TOP_LEFT (0.0f, 0.0f, 0.5f);
-const Vector3 ParentOrigin::TOP_CENTER (0.5f, 0.0f, 0.5f);
-const Vector3 ParentOrigin::TOP_RIGHT (1.0f, 0.0f, 0.5f);
-const Vector3 ParentOrigin::CENTER_LEFT (0.0f, 0.5f, 0.5f);
-const Vector3 ParentOrigin::CENTER (0.5f, 0.5f, 0.5f);
-const Vector3 ParentOrigin::CENTER_RIGHT (1.0f, 0.5f, 0.5f);
-const Vector3 ParentOrigin::BOTTOM_LEFT (0.0f, 1.0f, 0.5f);
-const Vector3 ParentOrigin::BOTTOM_CENTER(0.5f, 1.0f, 0.5f);
-const Vector3 ParentOrigin::BOTTOM_RIGHT (1.0f, 1.0f, 0.5f);
-
-const Vector3 ParentOrigin::DEFAULT( ParentOrigin::TOP_LEFT );
-
-const Vector3 AnchorPoint::TOP_LEFT (0.0f, 0.0f, 0.5f);
-const Vector3 AnchorPoint::TOP_CENTER (0.5f, 0.0f, 0.5f);
-const Vector3 AnchorPoint::TOP_RIGHT (1.0f, 0.0f, 0.5f);
-const Vector3 AnchorPoint::CENTER_LEFT (0.0f, 0.5f, 0.5f);
-const Vector3 AnchorPoint::CENTER (0.5f, 0.5f, 0.5f);
-const Vector3 AnchorPoint::CENTER_RIGHT (1.0f, 0.5f, 0.5f);
-const Vector3 AnchorPoint::BOTTOM_LEFT (0.0f, 1.0f, 0.5f);
-const Vector3 AnchorPoint::BOTTOM_CENTER(0.5f, 1.0f, 0.5f);
-const Vector3 AnchorPoint::BOTTOM_RIGHT (1.0f, 1.0f, 0.5f);
-
-const Vector3 AnchorPoint::DEFAULT( AnchorPoint::CENTER );
-
-const Vector4 Color::BLACK( 0.0f, 0.0f, 0.0f, 1.0f );
-const Vector4 Color::WHITE( 1.0f, 1.0f, 1.0f, 1.0f );
-
-const Vector4 Color::RED( 1.0f, 0.0f, 0.0f, 1.0f );
-const Vector4 Color::GREEN( 0.0f, 1.0f, 0.0f, 1.0f );
-const Vector4 Color::BLUE( 0.0f, 0.0f, 1.0f, 1.0f );
-
-const Vector4 Color::YELLOW( 1.0f, 1.0f, 0.0f, 1.0f );
-const Vector4 Color::MAGENTA( 1.0f, 0.0f, 1.0f, 1.0f );
-const Vector4 Color::CYAN( 0.0f, 1.0f, 1.0f, 1.0f );
-
-const Vector4 Color::TRANSPARENT( 0.0f, 0.0f, 0.0f, 0.0f );
-
-// epsilon constants
-const float Math::MACHINE_EPSILON_0 = Epsilon<0>::value;
-const float Math::MACHINE_EPSILON_1 = Epsilon<1>::value;
-const float Math::MACHINE_EPSILON_10 = Epsilon<10>::value;
-const float Math::MACHINE_EPSILON_100 = Epsilon<100>::value;
-const float Math::MACHINE_EPSILON_1000 = Epsilon<1000>::value;
-const float Math::MACHINE_EPSILON_10000 = Epsilon<10000>::value;
-
-} // namespace Dali
#define DALI_CONSTANTS_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.
#include <math.h> // M_PI
// INTERNAL INCLUDES
+#include <dali/public-api/math/compile-time-math.h>
#include <dali/public-api/math/vector3.h>
#include <dali/public-api/math/vector4.h>
*/
namespace ParentOrigin
{
-extern const Vector3 DEFAULT; ///< TOP_LEFT
-static const float TOP = 0.0f;
-static const float BOTTOM = 1.0f;
-static const float LEFT = 0.0f;
-static const float RIGHT = 1.0f;
-static const float MIDDLE = 0.5f;
-
-DALI_CORE_API extern const Vector3 TOP_LEFT; ///< 0.0f, 0.0f, 0.5f
-DALI_CORE_API extern const Vector3 TOP_CENTER; ///< 0.5f, 0.0f, 0.5f
-DALI_CORE_API extern const Vector3 TOP_RIGHT; ///< 1.0f, 0.0f, 0.5f
-DALI_CORE_API extern const Vector3 CENTER_LEFT; ///< 0.0f, 0.5f, 0.5f
-DALI_CORE_API extern const Vector3 CENTER; ///< 0.5f, 0.5f, 0.5f
-DALI_CORE_API extern const Vector3 CENTER_RIGHT; ///< 1.0f, 0.5f, 0.5f
-DALI_CORE_API extern const Vector3 BOTTOM_LEFT; ///< 0.0f, 1.0f, 0.5f
-DALI_CORE_API extern const Vector3 BOTTOM_CENTER; ///< 0.5f, 1.0f, 0.5f
-DALI_CORE_API extern const Vector3 BOTTOM_RIGHT; ///< 1.0f, 1.0f, 0.5f
-
+static constexpr float TOP = 0.0f;
+static constexpr float BOTTOM = 1.0f;
+static constexpr float LEFT = 0.0f;
+static constexpr float RIGHT = 1.0f;
+static constexpr float MIDDLE = 0.5f;
+static constexpr Vector3 TOP_LEFT (0.0f, 0.0f, 0.5f);
+static constexpr Vector3 TOP_CENTER (0.5f, 0.0f, 0.5f);
+static constexpr Vector3 TOP_RIGHT (1.0f, 0.0f, 0.5f);
+static constexpr Vector3 CENTER_LEFT (0.0f, 0.5f, 0.5f);
+static constexpr Vector3 CENTER (0.5f, 0.5f, 0.5f);
+static constexpr Vector3 CENTER_RIGHT (1.0f, 0.5f, 0.5f);
+static constexpr Vector3 BOTTOM_LEFT (0.0f, 1.0f, 0.5f);
+static constexpr Vector3 BOTTOM_CENTER(0.5f, 1.0f, 0.5f);
+static constexpr Vector3 BOTTOM_RIGHT (1.0f, 1.0f, 0.5f);
+static constexpr Vector3 DEFAULT( TOP_LEFT );
}
/**
*/
namespace AnchorPoint
{
-static const float TOP = 0.0f;
-static const float BOTTOM = 1.0f;
-static const float LEFT = 0.0f;
-static const float RIGHT = 1.0f;
-static const float MIDDLE = 0.5f;
-
-extern const Vector3 DEFAULT; ///< CENTER
-DALI_CORE_API extern const Vector3 TOP_LEFT; ///< 0.0f, 0.0f, 0.5f
-DALI_CORE_API extern const Vector3 TOP_CENTER; ///< 0.5f, 0.0f, 0.5f
-DALI_CORE_API extern const Vector3 TOP_RIGHT; ///< 1.0f, 0.0f, 0.5f
-DALI_CORE_API extern const Vector3 CENTER_LEFT; ///< 0.0f, 0.5f, 0.5f
-DALI_CORE_API extern const Vector3 CENTER; ///< 0.5f, 0.5f, 0.5f
-DALI_CORE_API extern const Vector3 CENTER_RIGHT; ///< 1.0f, 0.5f, 0.5f
-DALI_CORE_API extern const Vector3 BOTTOM_LEFT; ///< 0.0f, 1.0f, 0.5f
-DALI_CORE_API extern const Vector3 BOTTOM_CENTER; ///< 0.5f, 1.0f, 0.5f
-DALI_CORE_API extern const Vector3 BOTTOM_RIGHT; ///< 1.0f, 1.0f, 0.5f
-
+static constexpr float TOP = 0.0f;
+static constexpr float BOTTOM = 1.0f;
+static constexpr float LEFT = 0.0f;
+static constexpr float RIGHT = 1.0f;
+static constexpr float MIDDLE = 0.5f;
+static constexpr Vector3 TOP_LEFT (0.0f, 0.0f, 0.5f);
+static constexpr Vector3 TOP_CENTER (0.5f, 0.0f, 0.5f);
+static constexpr Vector3 TOP_RIGHT (1.0f, 0.0f, 0.5f);
+static constexpr Vector3 CENTER_LEFT (0.0f, 0.5f, 0.5f);
+static constexpr Vector3 CENTER (0.5f, 0.5f, 0.5f);
+static constexpr Vector3 CENTER_RIGHT (1.0f, 0.5f, 0.5f);
+static constexpr Vector3 BOTTOM_LEFT (0.0f, 1.0f, 0.5f);
+static constexpr Vector3 BOTTOM_CENTER(0.5f, 1.0f, 0.5f);
+static constexpr Vector3 BOTTOM_RIGHT (1.0f, 1.0f, 0.5f);
+static constexpr Vector3 DEFAULT( CENTER );
}
*/
namespace Color
{
-DALI_CORE_API extern const Vector4 BLACK; ///< Pure black (0.0f, 0.0f, 0.0f, 1.0f);
-DALI_CORE_API extern const Vector4 WHITE; ///< Pure white (1.0f, 1.0f, 1.0f, 1.0f);
-
-DALI_CORE_API extern const Vector4 RED; ///< Pure red (1.0f, 0.0f, 0.0f, 1.0f);
-DALI_CORE_API extern const Vector4 GREEN; ///< Pure green (0.0f, 1.0f, 0.0f, 1.0f);
-DALI_CORE_API extern const Vector4 BLUE; ///< Pure blue (0.0f, 0.0f, 1.0f, 1.0f);
-
-DALI_CORE_API extern const Vector4 YELLOW; ///< Pure yellow (1.0f, 1.0f, 0.0f, 1.0f);
-DALI_CORE_API extern const Vector4 MAGENTA; ///< Pure magenta (1.0f, 0.0f, 1.0f, 1.0f);
-DALI_CORE_API extern const Vector4 CYAN; ///< Pure cyan (0.0f, 1.0f, 1.0f, 1.0f);
-
-DALI_CORE_API extern const Vector4 TRANSPARENT; ///< Black transparent (0.0f, 0.0f, 0.0f, 0.0f);
+static constexpr Vector4 BLACK( 0.0f, 0.0f, 0.0f, 1.0f );
+static constexpr Vector4 WHITE( 1.0f, 1.0f, 1.0f, 1.0f );
+static constexpr Vector4 RED( 1.0f, 0.0f, 0.0f, 1.0f );
+static constexpr Vector4 GREEN( 0.0f, 1.0f, 0.0f, 1.0f );
+static constexpr Vector4 BLUE( 0.0f, 0.0f, 1.0f, 1.0f );
+static constexpr Vector4 YELLOW( 1.0f, 1.0f, 0.0f, 1.0f );
+static constexpr Vector4 MAGENTA( 1.0f, 0.0f, 1.0f, 1.0f );
+static constexpr Vector4 CYAN( 0.0f, 1.0f, 1.0f, 1.0f );
+static constexpr Vector4 TRANSPARENT( 0.0f, 0.0f, 0.0f, 0.0f );
} // namespace Color
*/
namespace Math
{
-DALI_CORE_API extern const float MACHINE_EPSILON_0; ///< Epsilon for values near zero
-DALI_CORE_API extern const float MACHINE_EPSILON_1; ///< Epsilon for values near 1
-DALI_CORE_API extern const float MACHINE_EPSILON_10; ///< Epsilon for values near 10
-DALI_CORE_API extern const float MACHINE_EPSILON_100; ///< Epsilon for values near 100
-DALI_CORE_API extern const float MACHINE_EPSILON_1000; ///< Epsilon for values near 1000
-DALI_CORE_API extern const float MACHINE_EPSILON_10000; ///< Epsilon for values near 10000
+static constexpr float MACHINE_EPSILON_0 = Epsilon<0>::value;
+static constexpr float MACHINE_EPSILON_1 = Epsilon<1>::value;
+static constexpr float MACHINE_EPSILON_10 = Epsilon<10>::value;
+static constexpr float MACHINE_EPSILON_100 = Epsilon<100>::value;
+static constexpr float MACHINE_EPSILON_1000 = Epsilon<1000>::value;
+static constexpr float MACHINE_EPSILON_10000 = Epsilon<10000>::value;
// float is preferred to double for performance on ARM targets
-static const float PI = static_cast<float>(M_PI); ///< Constant representing PI
-static const float PI_2 = static_cast<float>(M_PI_2); ///< Constant representing PI/2
-static const float PI_4 = static_cast<float>(M_PI_4); ///< Constant representing PI/4
-static const float PI_OVER_180 = Dali::Math::PI/180.0f; ///< Constant used to convert degree to radian
-static const float ONE80_OVER_PI = 180.0f/Dali::Math::PI; ///< Constant used to convert radian to degree
+static constexpr float PI = static_cast<float>(M_PI); ///< Pi
+static constexpr float PI_2 = static_cast<float>(M_PI_2); ///< Pi/2
+static constexpr float PI_4 = static_cast<float>(M_PI_4); ///< Pi/4
+static constexpr float PI_OVER_180 = Dali::Math::PI/180.0f; ///< Constant used to convert degree to radian
+static constexpr float ONE80_OVER_PI = 180.0f/Dali::Math::PI; ///< Constant used to convert radian to degree
} // namespace Math
#if __GNUC__ >= 4
# ifndef HIDE_DALI_INTERNALS
# define DALI_EXPORT_API
+# define DALI_NO_EXPORT_API
# define DALI_IMPORT_API
# define DALI_CORE_API
# define DALI_INTERNAL
# else
# define DALI_EXPORT_API __attribute__ ((visibility ("default")))
+# define DALI_NO_EXPORT_API __attribute__ ((visibility ("hidden")))
# define DALI_IMPORT_API __attribute__ ((visibility ("default")))
# define DALI_CORE_API __attribute__ ((visibility ("default")))
# define DALI_INTERNAL __attribute__ ((visibility ("hidden")))
#endif
/** Visibility attribute to hide declarations */
# define DALI_INTERNAL
+# define DALI_NO_EXPORT_API
#endif
#ifdef DEPRECATION_WARNING
}
/**
+ * @brief Resizes the vector without initializing the data.
+ *
+ * Can be used as a data container for reading whole file content.
+ * @SINCE_1_9.27
+ * @param[in] count Count to resize to
+ */
+ void ResizeUninitialized( SizeType count )
+ {
+ Reserve( count );
+ VectorBase::SetCount( count );
+ }
+
+ /**
* @brief Resizes the vector. Does not change capacity.
*
* @SINCE_1_0.0
const uint32_t CORE_MAJOR_VERSION = 1;
const uint32_t CORE_MINOR_VERSION = 9;
-const uint32_t CORE_MICRO_VERSION = 26;
+const uint32_t CORE_MICRO_VERSION = 27;
const char * const CORE_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
#include <dali/public-api/events/pinch-gesture-detector.h>
#include <dali/public-api/events/pinch-gesture.h>
#include <dali/public-api/events/point-state.h>
+#include <dali/public-api/events/rotation-gesture-detector.h>
+#include <dali/public-api/events/rotation-gesture.h>
#include <dali/public-api/events/tap-gesture-detector.h>
#include <dali/public-api/events/tap-gesture.h>
#include <dali/public-api/events/touch-event.h>
#include <dali/public-api/rendering/frame-buffer.h>
#include <dali/public-api/rendering/geometry.h>
-#include <dali/public-api/rendering/property-buffer.h>
#include <dali/public-api/rendering/renderer.h>
#include <dali/public-api/rendering/sampler.h>
#include <dali/public-api/rendering/shader.h>
#include <dali/public-api/rendering/texture.h>
#include <dali/public-api/rendering/texture-set.h>
+#include <dali/public-api/rendering/vertex-buffer.h>
#include <dali/public-api/signals/base-signal.h>
#include <dali/public-api/signals/callback.h>
#define DALI_GESTURE_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.
Pinch = 1 << 0, ///< When two touch points move away or towards each other. @SINCE_1_0.0
Pan = 1 << 1, ///< When the user drags their finger(s) in a particular direction. @SINCE_1_0.0
Tap = 1 << 2, ///< When the user taps the screen. @SINCE_1_0.0
- LongPress = 1 << 3 ///< When the user continues to touch the same area on the screen for the device configured time. @SINCE_1_0.0
+ LongPress = 1 << 3, ///< When the user continues to touch the same area on the screen for the device configured time. @SINCE_1_0.0
+ Rotation = 1 << 4, ///< When the user rotates two fingers around a particular ares of the screen. @SINCE_1_9.27
};
/**
/*
- * 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.
namespace Dali
{
-namespace
+KeyEvent::KeyEvent()
+: BaseHandle()
{
-const uint32_t MODIFIER_SHIFT = 0x1;
-const uint32_t MODIFIER_CTRL = 0x2;
-const uint32_t MODIFIER_ALT = 0x4;
-const int32_t KEY_INVALID_CODE = -1;
}
-KeyEvent::KeyEvent()
-: keyPressedName(""),
- keyPressed(""),
- keyCode(KEY_INVALID_CODE),
- keyModifier(0),
- time(0),
- state(KeyEvent::Down)
+KeyEvent::KeyEvent( const KeyEvent& rhs ) = default;
+
+KeyEvent::KeyEvent( KeyEvent&& rhs ) = default;
+
+KeyEvent::~KeyEvent()
{
- new Internal::KeyEventImpl( this );
}
-KeyEvent::KeyEvent(const std::string& keyName, const std::string& keyString, int32_t keyCode, int32_t keyModifier,unsigned long timeStamp, const State& keyState)
-: keyPressedName(keyName),
- keyPressed(keyString),
- keyCode(keyCode),
- keyModifier(keyModifier),
- time(timeStamp),
- state(keyState)
+KeyEvent& KeyEvent::operator=( const KeyEvent& rhs ) = default;
+
+KeyEvent& KeyEvent::operator=( KeyEvent&& rhs ) = default;
+
+bool KeyEvent::IsShiftModifier() const
{
- new Internal::KeyEventImpl( this );
+ return GetImplementation( *this ).IsShiftModifier();
}
-KeyEvent::KeyEvent( const KeyEvent& rhs )
-: keyPressedName( rhs.keyPressedName ),
- keyPressed( rhs.keyPressed ),
- keyCode( rhs.keyCode ),
- keyModifier( rhs.keyModifier ),
- time( rhs.time ),
- state( rhs.state )
+bool KeyEvent::IsCtrlModifier() const
{
- Internal::KeyEventImpl* impl = new Internal::KeyEventImpl( this );
- *impl = *GetImplementation( &rhs );
+ return GetImplementation( *this ).IsCtrlModifier();
}
-KeyEvent& KeyEvent::operator=( const KeyEvent& rhs )
+bool KeyEvent::IsAltModifier() const
{
- if( this != &rhs )
- {
- keyPressedName = rhs.keyPressedName;
- keyPressed = rhs.keyPressed;
- keyCode = rhs.keyCode;
- keyModifier = rhs.keyModifier;
- time = rhs.time;
- state = rhs.state;
-
- *GetImplementation( this ) = *GetImplementation( &rhs );
- }
-
- return *this;
+ return GetImplementation( *this ).IsAltModifier();
}
-KeyEvent::~KeyEvent()
+const std::string& KeyEvent::GetCompose() const
{
- delete GetImplementation( this );
+ return GetImplementation( *this ).GetCompose();
}
-bool KeyEvent::IsShiftModifier() const
+const std::string& KeyEvent::GetDeviceName() const
{
- if ((MODIFIER_SHIFT & keyModifier) == MODIFIER_SHIFT)
- {
- return true;
- }
+ return GetImplementation( *this ).GetDeviceName();
+}
- return false;
+Device::Class::Type KeyEvent::GetDeviceClass() const
+{
+ return GetImplementation( *this ).GetDeviceClass();
}
-bool KeyEvent::IsCtrlModifier() const
+Device::Subclass::Type KeyEvent::GetDeviceSubclass() const
{
- if ((MODIFIER_CTRL & keyModifier) == MODIFIER_CTRL)
- {
- return true;
- }
+ return GetImplementation( *this ).GetDeviceSubclass();
+}
- return false;
+const std::string& KeyEvent::GetKeyName() const
+{
+ return GetImplementation( *this ).GetKeyName();
}
-bool KeyEvent::IsAltModifier() const
+const std::string& KeyEvent::GetKeyString() const
{
- if ((MODIFIER_ALT & keyModifier) == MODIFIER_ALT)
- {
- return true;
- }
+ return GetImplementation( *this ).GetKeyString();
+}
- return false;
+const std::string& KeyEvent::GetLogicalKey() const
+{
+ return GetImplementation( *this ).GetLogicalKey();
}
-std::string KeyEvent::GetCompose() const
+int32_t KeyEvent::GetKeyCode() const
{
- return GetImplementation( this )->GetCompose();
+ return GetImplementation( *this ).GetKeyCode();
}
-std::string KeyEvent::GetDeviceName() const
+int32_t KeyEvent::GetKeyModifier() const
{
- return GetImplementation( this )->GetDeviceName();
+ return GetImplementation( *this ).GetKeyModifier();
}
-Device::Class::Type KeyEvent::GetDeviceClass() const
+unsigned long KeyEvent::GetTime() const
{
- return GetImplementation( this )->GetDeviceClass();
+ return GetImplementation( *this ).GetTime();
}
-Device::Subclass::Type KeyEvent::GetDeviceSubclass() const
+KeyEvent::State KeyEvent::GetState() const
{
- return GetImplementation( this )->GetDeviceSubclass();
+ return GetImplementation( *this ).GetState();
}
+KeyEvent::KeyEvent( Internal::KeyEvent* internal )
+: BaseHandle( internal )
+{
+}
} // namespace Dali
#define DALI_KEY_EVENT_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.
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/object/base-handle.h>
#include <dali/public-api/events/device.h>
namespace Dali
{
+
+namespace Internal DALI_INTERNAL
+{
+class KeyEvent;
+}
+
/**
* @addtogroup dali_core_events
* @{
*/
/**
- * @brief The key event structure is used to store a key press.
+ * @brief The key event class is used to store a key press.
*
* It facilitates processing of these key presses and passing to other
* libraries like Toolkit. The keyString is the actual character you
* module.
* @SINCE_1_0.0
*/
-struct DALI_CORE_API KeyEvent
+class DALI_CORE_API KeyEvent : public BaseHandle
{
+
+public:
+
// Enumerations
/**
* @brief Enumeration for specifying the state of the key event.
- * @SINCE_1_0.0
+ * @SINCE_1_9.27
*/
enum State
{
- Down, ///< Key down @SINCE_1_0.0
- Up, ///< Key up @SINCE_1_0.0
- Last
+ DOWN, ///< Key down @SINCE_1_9.27
+ UP, ///< Key up @SINCE_1_9.27
};
/**
- * @brief Default constructor.
- * @SINCE_1_0.0
- */
- KeyEvent();
-
- /**
- * @brief Constructor.
+ * @brief An uninitialized KeyEvent instance.
*
+ * Calling member functions with an uninitialized KeyEvent handle is not allowed.
* @SINCE_1_0.0
- * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed
- * @param[in] keyString A string of input characters or key pressed
- * @param[in] keyCode The unique key code for the key pressed
- * @param[in] keyModifier The key modifier for special keys like shift and alt
- * @param[in] timeStamp The time (in ms) that the key event occurred
- * @param[in] keyState The state of the key event
*/
- KeyEvent(const std::string& keyName, const std::string& keyString, int32_t keyCode, int32_t keyModifier, unsigned long timeStamp, const State& keyState);
+ KeyEvent();
/**
* @brief Copy constructor.
KeyEvent( const KeyEvent& rhs );
/**
- * @brief Assignment operator.
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.27
+ * @param[in] rhs A reference to the moved handle
+ */
+ KeyEvent( KeyEvent&& rhs );
+
+ /**
+ * @brief Copy assignment operator.
* @SINCE_1_2.36
* @param[in] rhs A reference to the copied handle
* @return A reference to this
KeyEvent& operator=( const KeyEvent& rhs );
/**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.27
+ * @param[in] rhs A reference to the moved handle
+ * @return A reference to this
+ */
+ KeyEvent& operator=( KeyEvent&& rhs );
+
+ /**
* @brief Destructor.
* @SINCE_1_0.0
*/
/**
* @brief Get the key compose string.
*
- * @SINCE_1_3.22
+ * @SINCE_1_9.27
* @return The compose string
*/
- std::string GetCompose() const;
+ const std::string& GetCompose() const;
/**
* @brief Get the device name the key event originated from.
*
- * @SINCE_1_2.60
+ * @SINCE_1_9.27
* @return The device name
*/
- std::string GetDeviceName() const;
+ const std::string& GetDeviceName() const;
/**
* @brief Get the device class the key event originated from.
*/
Device::Subclass::Type GetDeviceSubclass() const;
- // Data
+ /**
+ * @brief Get the name given to the key pressed or command from the IMF
+ *
+ * @SINCE_1_9.27
+ * @return The name given to the key pressed.
+ */
+ const std::string& GetKeyName() const;
/**
- * @brief Name given to the key pressed.
+ * @brief Get the actual string of input characters that should be used for input editors.
+ *
+ * @SINCE_1_9.27
+ * @return The actual string of input characters
*/
- std::string keyPressedName;
+ const std::string& GetKeyString() const;
/**
- * @brief The actual string returned that should be used for input editors.
+ * @brief Gets the logical key string.
+ *
+ * For example, when the user presses 'shift' key and '1' key together, the logical key is "exclamation".
+ * Plus, the key name is "1", and the key string is "!".
+ *
+ * @SINCE_1_9.27
+ * @return The logical key symbol
*/
- std::string keyPressed;
+ const std::string& GetLogicalKey() const;
/**
- * @brief Keycode for the key pressed.
+ * @brief Get the unique key code for the key pressed.
+ *
+ * @SINCE_1_9.27
+ * @return The unique key code for the key pressed
*
- * @remarks We recommend not to use this key code value
- * directly because its meaning might be changed in the future. Currently, it means a
- * platform-specific key code. You need to use IsKey() to know what a key event means
- * instead of direct comparison of key code value.
+ * @remarks We recommend not to use this key code value directly because its meaning
+ * might be changed in the future. Currently, it means a platform-specific key code.
+ * You need to use IsKey() to know what a key event means instead of direct comparison
+ * of key code value.
*/
- int32_t keyCode;
+ int32_t GetKeyCode() const;
/**
- * @brief special keys like shift, alt and control which modify the next key pressed.
+ * @brief Return the key modifier for special keys like Shift, Alt and Ctrl which modify the next key pressed.
+ *
+ * @SINCE_1_9.27
+ * @return The key modifier
*/
- int32_t keyModifier;
+ int32_t GetKeyModifier() const;
/**
- * @brief The time (in ms) that the key event occurred.
+ * @brief Get the time (in ms) that the key event occurred.
+ *
+ * @SINCE_1_9.27
+ * @return The time (in ms)
*/
- unsigned long time;
+ unsigned long GetTime() const;
/**
- * @brief State of the key event.
+ * @brief Get the state of the key event.
*
* @see State
+ *
+ * @SINCE_1_9.27
+ * @return The state of the key event
*/
- State state;
+ State GetState() const;
+public: // Not intended for application developers
+
+ /// @cond internal
+ /**
+ * @brief This constructor is used internally to Create an initialized KeyEvent handle.
+ *
+ * @SINCE_1_9.27
+ * @param[in] keyEvent A pointer to a newly allocated Dali resource
+ */
+ explicit DALI_INTERNAL KeyEvent( Internal::KeyEvent* keyEvent );
+ /// @endcond
};
/**
/*
- * 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.
*/
// CLASS HEADER
-#include <dali/devel-api/events/rotation-gesture-detector.h>
+#include <dali/public-api/events/rotation-gesture-detector.h>
// INTERNAL INCLUDES
#include <dali/internal/event/events/rotation-gesture/rotation-gesture-detector-impl.h>
#define DALI_ROTATION_GESTURE_DETECTOR_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.
* | %Signal Name | Method |
* |-------------------|-----------------------|
* | rotationDetected | @ref DetectedSignal() |
+ *
+ * @SINCE_1_9.27
*/
class DALI_CORE_API RotationGestureDetector : public GestureDetector
{
/**
* @brief Creates an uninitialized RotationGestureDetector; this can be initialized with RotationGestureDetector::New().
*
+ * @SINCE_1_9.27
* Calling member functions with an uninitialized RotationGestureDetector handle is not allowed.
*/
RotationGestureDetector();
/**
* @brief Creates an initialized RotationGestureDetector.
*
+ * @SINCE_1_9.27
* @return A handle to a newly allocated Dali resource
*/
static RotationGestureDetector New();
/**
* @brief Downcasts a handle to RotationGestureDetector handle.
*
+ * @SINCE_1_9.27
* If handle points to a RotationGestureDetector object, the
* downcast produces valid handle. If not, the returned handle is left uninitialized.
* @param[in] handle Handle to an object
/**
* @brief Destructor.
*
+ * @SINCE_1_9.27
* This is non-virtual since derived Handle types must not contain data or virtual methods.
*/
~RotationGestureDetector();
/**
* @brief This copy constructor is required for (smart) pointer semantics.
*
+ * @SINCE_1_9.27
* @param[in] handle A reference to the copied handle
*/
RotationGestureDetector(const RotationGestureDetector& handle);
/**
* @brief This assignment operator is required for (smart) pointer semantics.
*
+ * @SINCE_1_9.27
* @param[in] rhs A reference to the copied handle
* @return A reference to this
*/
* @code
* void YourCallbackName( Actor actor, const RotationGesture& gesture );
* @endcode
+ * @SINCE_1_9.27
* @return The signal to connect to
* @pre The gesture detector has been initialized.
*/
/**
* @brief This constructor is used by RotationGestureDetector::New() methods.
*
+ * @SINCE_1_9.27
* @param[in] internal A pointer to a newly allocated Dali resource
*/
explicit DALI_INTERNAL RotationGestureDetector(Internal::RotationGestureDetector* internal);
/*
- * 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.
*/
// CLASS HEADER
-#include <dali/devel-api/events/rotation-gesture.h>
+#include <dali/public-api/events/rotation-gesture.h>
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
-#include <dali/devel-api/events/gesture-devel.h>
namespace Dali
{
RotationGesture::RotationGesture( Gesture::State state )
-: Gesture( static_cast< Gesture::Type >( DevelGesture::Rotation ), state )
+: Gesture( Gesture::Rotation, state )
{
}
#define DALI_ROTATION_GESTURE_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.
*
* A rotation gesture will continue to be sent to the actor under the center point of the rotation
* until the rotation ends.
+ * @SINCE_1_9.27
*/
struct DALI_CORE_API RotationGesture: public Gesture
{
/**
* @brief Default Constructor.
- *
+ * @SINCE_1_9.27
* @param[in] state The state of the gesture
*/
RotationGesture( Gesture::State state );
/**
* @brief Copy constructor.
+ * @SINCE_1_9.27
* @param[in] rhs A reference to the copied handle
*/
RotationGesture( const RotationGesture& rhs );
/**
* @brief Assignment operator.
+ * @SINCE_1_9.27
* @param[in] rhs A reference to the copied handle
* @return A reference to this
*/
/**
* @brief Virtual destructor.
+ * @SINCE_1_9.27
*/
virtual ~RotationGesture();
/**
* @brief The overall rotation from the start of the rotation gesture till the latest rotation gesture.
+ * @SINCE_1_9.27
*/
Radian rotation;
/**
* @brief The center point of the two points that caused the rotation gesture in screen coordinates.
+ * @SINCE_1_9.27
*/
Vector2 screenCenterPoint;
/**
* @brief The center point of the two points that caused the rotation gesture in local actor coordinates.
+ * @SINCE_1_9.27
*/
Vector2 localCenterPoint;
};
${public_api_src_dir}/animation/linear-constrainer.cpp
${public_api_src_dir}/animation/path.cpp
${public_api_src_dir}/animation/time-period.cpp
- ${public_api_src_dir}/common/constants.cpp
${public_api_src_dir}/common/dali-common.cpp
${public_api_src_dir}/common/dali-vector.cpp
${public_api_src_dir}/common/extents.cpp
${public_api_src_dir}/events/pan-gesture-detector.cpp
${public_api_src_dir}/events/pinch-gesture.cpp
${public_api_src_dir}/events/pinch-gesture-detector.cpp
+ ${public_api_src_dir}/events/rotation-gesture.cpp
+ ${public_api_src_dir}/events/rotation-gesture-detector.cpp
${public_api_src_dir}/events/tap-gesture.cpp
${public_api_src_dir}/events/tap-gesture-detector.cpp
${public_api_src_dir}/events/touch-point.cpp
${public_api_src_dir}/math/matrix.cpp
${public_api_src_dir}/math/matrix3.cpp
${public_api_src_dir}/math/quaternion.cpp
+ ${public_api_src_dir}/math/rect.cpp
${public_api_src_dir}/math/vector2.cpp
${public_api_src_dir}/math/vector3.cpp
${public_api_src_dir}/math/vector4.cpp
${public_api_src_dir}/object/any.cpp
${public_api_src_dir}/object/base-handle.cpp
- ${public_api_src_dir}/object/handle.cpp
${public_api_src_dir}/object/base-object.cpp
+ ${public_api_src_dir}/object/handle.cpp
+ ${public_api_src_dir}/object/indirect-value.cpp
${public_api_src_dir}/object/object-registry.cpp
${public_api_src_dir}/object/property.cpp
${public_api_src_dir}/object/property-array.cpp
${public_api_src_dir}/render-tasks/render-task-list.cpp
${public_api_src_dir}/rendering/frame-buffer.cpp
${public_api_src_dir}/rendering/geometry.cpp
- ${public_api_src_dir}/rendering/property-buffer.cpp
+ ${public_api_src_dir}/rendering/vertex-buffer.cpp
${public_api_src_dir}/rendering/texture.cpp
${public_api_src_dir}/rendering/texture-set.cpp
${public_api_src_dir}/rendering/renderer.cpp
${public_api_src_dir}/events/pinch-gesture.h
${public_api_src_dir}/events/pinch-gesture-detector.h
${public_api_src_dir}/events/point-state.h
+ ${public_api_src_dir}/events/rotation-gesture.h
+ ${public_api_src_dir}/events/rotation-gesture-detector.h
${public_api_src_dir}/events/tap-gesture.h
${public_api_src_dir}/events/tap-gesture-detector.h
${public_api_src_dir}/events/touch-point.h
${public_api_src_dir}/object/base-handle.h
${public_api_src_dir}/object/base-object.h
${public_api_src_dir}/object/handle.h
+ ${public_api_src_dir}/object/indirect-value.h
${public_api_src_dir}/object/object-registry.h
${public_api_src_dir}/object/property-array.h
${public_api_src_dir}/object/property-conditions.h
SET( public_api_core_rendering_header_files
${public_api_src_dir}/rendering/frame-buffer.h
${public_api_src_dir}/rendering/geometry.h
- ${public_api_src_dir}/rendering/property-buffer.h
+ ${public_api_src_dir}/rendering/vertex-buffer.h
${public_api_src_dir}/rendering/texture.h
${public_api_src_dir}/rendering/texture-set.h
${public_api_src_dir}/rendering/renderer.h
/*
- * 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.
{
}
-const Radian ANGLE_360 = Radian( Math::PI * 2.f ); ///< 360 degree turn in radians
-const Radian ANGLE_315 = Radian( Math::PI * 1.75f ); ///< 315 degree turn in radians
-const Radian ANGLE_270 = Radian( Math::PI * 1.5f ); ///< 270 degree turn in radians
-const Radian ANGLE_225 = Radian( Math::PI * 1.25f ); ///< 225 degree turn in radians
-const Radian ANGLE_180 = Radian( Math::PI ); ///< 180 degree turn in radians
-const Radian ANGLE_135 = Radian( Math::PI * 0.75f ); ///< 135 degree turn in radians
-const Radian ANGLE_120 = Radian( Math::PI * 2.f/3.f ); ///< 120 degree turn in radians
-const Radian ANGLE_90 = Radian( Math::PI_2 ); ///< 90 degree turn in radians
-const Radian ANGLE_60 = Radian( Math::PI / 3.f ); ///< 60 degree turn in radians
-const Radian ANGLE_45 = Radian( Math::PI_4 ); ///< 45 degree turn in radians
-const Radian ANGLE_30 = Radian( Math::PI / 6.f ); ///< 30 degree turn in radians
-const Radian ANGLE_0 = Radian( 0.0f ); ///< 0 degree turn in radians
-
} // namespace Dali
* @SINCE_1_0.0
* @param[in] value The initial value in degrees
*/
- explicit Degree( float value )
+ explicit constexpr Degree( float value )
: degree( value )
{ }
// compiler generated destructor, copy constructor and assignment operators are ok as this class is POD
-// useful constant angles
-DALI_CORE_API extern const Radian ANGLE_360; ///< 360 degree turn in radians
-DALI_CORE_API extern const Radian ANGLE_315; ///< 315 degree turn in radians
-DALI_CORE_API extern const Radian ANGLE_270; ///< 270 degree turn in radians
-DALI_CORE_API extern const Radian ANGLE_225; ///< 225 degree turn in radians
-DALI_CORE_API extern const Radian ANGLE_180; ///< 180 degree turn in radians
-DALI_CORE_API extern const Radian ANGLE_135; ///< 135 degree turn in radians
-DALI_CORE_API extern const Radian ANGLE_120; ///< 120 degree turn in radians
-DALI_CORE_API extern const Radian ANGLE_90; ///< 90 degree turn in radians
-DALI_CORE_API extern const Radian ANGLE_60; ///< 60 degree turn in radians
-DALI_CORE_API extern const Radian ANGLE_45; ///< 45 degree turn in radians
-DALI_CORE_API extern const Radian ANGLE_30; ///< 30 degree turn in radians
-DALI_CORE_API extern const Radian ANGLE_0; ///< 0 degree turn in radians
/**
* @brief Compares equality between two degrees.
* @SINCE_1_0.0
* @param[in] value The initial value in radians
*/
- explicit Radian( float value )
+ explicit constexpr Radian( float value )
: radian( value )
{ }
return Radian( Clamp<float>( angle.radian, min, max ) );
}
+// useful constant angles
+inline constexpr Radian ANGLE_360( Math::PI * 2.f );
+inline constexpr Radian ANGLE_315( Math::PI * 1.75f );
+inline constexpr Radian ANGLE_270( Math::PI * 1.5f );
+inline constexpr Radian ANGLE_225( Math::PI * 1.25f );
+inline constexpr Radian ANGLE_180( Math::PI );
+inline constexpr Radian ANGLE_135( Math::PI * 0.75f );
+inline constexpr Radian ANGLE_120( Math::PI * 2.f/3.f );
+inline constexpr Radian ANGLE_90 ( Math::PI_2 );
+inline constexpr Radian ANGLE_60 ( Math::PI / 3.f );
+inline constexpr Radian ANGLE_45 ( Math::PI_4 );
+inline constexpr Radian ANGLE_30 ( Math::PI / 6.f );
+inline constexpr Radian ANGLE_0 ( 0.0f );
+
/**
* @}
*/
-#ifndef DALI_GESTURE_DEVEL_H
-#define DALI_GESTURE_DEVEL_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.
*
*/
-#include <dali/public-api/events/gesture.h>
+// CLASS HEADER
+#include <dali/public-api/math/rect.h>
namespace Dali
{
-
-namespace DevelGesture
-{
-
-/**
- * @copydoc Dali::Gesture::Type
- */
-enum Type
-{
- Pinch = Gesture::Pinch,
- Pan = Gesture::Pan,
- Tap = Gesture::Tap,
- LongPress = Gesture::LongPress,
-
- // Devel Gesture Types
- Rotation = 1 << 4, ///< When the user rotates two fingers around a particular ares of the screen.
-};
-
-} // namespace DevelGesture
-
+// Ensure Rect is maintained as a trivially copyable type
+static_assert(std::is_trivially_copyable<Rect<float>>::value);
} // namespace Dali
-#endif // DALI_GESTURE_DEVEL_H
* @brief Template class to create and operate on rectangles.
* @SINCE_1_0.0
*/
-
template< typename T = float >
struct Rect
{
}
/**
- * @brief Copy constructor.
+ * @brief Default copy constructor.
*
- * @SINCE_1_0.0
+ * @SINCE_1_9.27
* @param[in] rhs The original object
*/
- Rect(const Rect<T>& rhs)
- {
- x = rhs.x;
- y = rhs.y;
- width = rhs.width;
- height = rhs.height;
- }
+ Rect( const Rect<T>& rhs ) = default;
/**
- * @brief Copy assignment operator.
+ * @brief Default copy assignment operator.
*
- * @SINCE_1_0.0
+ * @SINCE_1_9.27
* @param[in] rhs The original object
* @return Reference to this
*/
- Rect<T>& operator= (const Rect<T>& rhs)
- {
- if (this != &rhs)
- {
- x = rhs.x;
- y = rhs.y;
- width = rhs.width;
- height = rhs.height;
- }
-
- return *this;
- }
+ Rect<T>& operator=( const Rect<T>& rhs ) = default;
/**
- * @brief Move constructor.
+ * @brief Default move constructor.
*
- * @SINCE_1_9.21
+ * @SINCE_1_9.27
* @param[in] rhs The original object
*/
- Rect<T>( Rect<T>&& rhs )
- : x( rhs.x ),
- y( rhs.y ),
- width( rhs.width ),
- height( rhs.height )
- {
- }
+ Rect<T>( Rect<T>&& rhs ) = default;
/**
- * @brief Move assignment operator.
+ * @brief Default move assignment operator.
*
- * @SINCE_1_9.21
+ * @SINCE_1_9.27
* @param[in] rhs The original object
* @return Reference to this
*/
- Rect<T>& operator=( Rect<T>&& rhs )
- {
- if (this != &rhs)
- {
- x = rhs.x;
- y = rhs.y;
- width = rhs.width;
- height = rhs.height;
- }
-
- return *this;
- }
+ Rect<T>& operator=( Rect<T>&& rhs ) = default;
/**
* @brief Assignment operator.
* @param[in] vec4 The Vector4 to assign
* @return Reference to this
*/
- Rect<T>& operator= (const Vector4& vec4)
+ Rect<T>& operator=(const Vector4& vec4)
{
x = vec4.x;
y = vec4.y;
* @param[in] x x or width component
* @param[in] y y or height component
*/
- explicit Vector2(float x, float y)
+ explicit constexpr Vector2(float x, float y)
: x(x), y(y)
{
}
* @param[in] y (or height) component
* @param[in] z (or depth) component
*/
- explicit Vector3(float x, float y, float z)
+ explicit constexpr Vector3(float x, float y, float z)
: x(x),
y(y),
z(z)
* @param[in] z z (or b/p) component
* @param[in] w w (or a/q) component
*/
- explicit Vector4(float x, float y, float z, float w)
+ explicit constexpr Vector4(float x, float y, float z, float w)
: x(x),
y(y),
z(z),
namespace Dali
{
+
Handle::Handle( Dali::Internal::Object* handle )
: BaseHandle(handle)
{
}
-
Handle::Handle()
{
}
return GetImplementation(*this).GetPropertyName( index );
}
-Property::Index Handle::GetPropertyIndex( const std::string& name ) const
+Property::Index Handle::GetPropertyIndex( Property::Key key ) const
{
- return GetImplementation(*this).GetPropertyIndex( name );
+ return GetImplementation( *this ).GetPropertyIndex( key );
}
bool Handle::IsPropertyWritable( Property::Index index ) const
return GetImplementation(*this).RegisterProperty( name, propertyValue );
}
+Property::Index Handle::RegisterProperty( Property::Index key, const std::string& name, const Property::Value& propertyValue )
+{
+ return GetImplementation( *this ).RegisterProperty( name, key, propertyValue );
+}
+
Property::Index Handle::RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode )
{
return GetImplementation(*this).RegisterProperty( name, propertyValue, accessMode );
return GetImplementation(*this).GetCurrentProperty( index );
}
+void Handle::SetProperties( const Property::Map& properties )
+{
+ GetImplementation( *this ).SetProperties( properties );
+}
+
+void Handle::GetProperties( Property::Map& properties )
+{
+ GetImplementation( *this ).GetProperties( properties );
+}
+
void Handle::GetPropertyIndices( Property::IndexContainer& indices ) const
{
GetImplementation(*this).GetPropertyIndices( indices );
}
+bool Handle::DoesCustomPropertyExist( Property::Index index )
+{
+ return GetImplementation( *this ).DoesCustomPropertyExist( index );
+}
+
Dali::PropertyNotification Handle::AddPropertyNotification( Property::Index index,
const PropertyCondition& condition )
{
GetImplementation(*this).RemoveConstraints( tag );
}
+IndirectValue Handle::operator[]( Property::Index index )
+{
+ // Will assert on access if handle is empty
+ return IndirectValue(*this, index);
+}
+
+IndirectValue Handle::operator[]( const std::string& name )
+{
+ // Will assert immediately when GetPropertyIndex is called if handle is empty
+ return IndirectValue(*this, GetPropertyIndex(name));
+}
+
+Handle::PropertySetSignalType& Handle::PropertySetSignal()
+{
+ return GetImplementation( *this ).PropertySetSignal();
+}
+
+
namespace WeightObject
{
// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/object/indirect-value.h>
+#include <dali/public-api/object/property-key.h>
#include <dali/public-api/object/property-types.h>
#include <dali/public-api/object/property-value.h>
#include <dali/public-api/object/property-notification-declarations.h>
#include <dali/public-api/object/ref-object.h>
+#include <dali/public-api/signals/dali-signal.h>
+
namespace Dali
{
DYNAMIC_PROPERTIES = 0x01,
};
+ /**
+ * @brief PropertySetSignal function prototype for signal handler. Called when a property is set on this object.
+ */
+ using PropertySetSignalType = Signal< void( Handle& handle, Property::Index index, Property::Value value ) >;
+
public:
/**
static Handle New();
/**
+ * @brief Template to create a derived handle and set properties on it.
+ *
+ * Marked as DALI_NO_EXPORT_API to prevent internal usage exporting symbols.
+ * @SINCE_1_9.27
+ * @tparam T The derived class to create
+ * @param[in] properties The properties to set
+ */
+ template< typename Type >
+ static DALI_NO_EXPORT_API Type New( const Property::Map& properties )
+ {
+ Type handle = Type::New();
+ handle.SetProperties( properties );
+ return handle;
+ }
+
+ /**
* @brief Dali::Handle is intended as a base class.
*
* This is non-virtual since derived Handle types must not contain data or virtual methods.
std::string GetPropertyName( Property::Index index ) const;
/**
- * @brief Queries the index of a property.
+ * @brief Query the index of a property using the given key.
*
- * Returns the first property index that matches the given name exactly.
- *
- * @SINCE_1_0.0
- * @param[in] name The name of the property
- * @return The index of the property, or Property::INVALID_INDEX if no property exists with the given name
+ * @SINCE_1_9.27
+ * @param[in] key The key of the property to search for. (The name or integer key provided to
+ * RegisterProperty()).
+ * @return the matching property index of the key, or Property::INVALID_INDEX if no
+ * property matches the given key.
*/
- Property::Index GetPropertyIndex( const std::string& name ) const;
+ Property::Index GetPropertyIndex( Property::Key key ) const;
/**
* @brief Queries whether a property can be set using SetProperty().
Property::Index RegisterProperty( const std::string& name, const Property::Value& propertyValue );
/**
+ * @brief Register a new animatable property with an integer key.
+ *
+ * @SINCE_1_9.27
+ * @param[in] key The integer key of the property.
+ * @param[in] name The text key of the property.
+ * @param[in] propertyValue The new value of the property.
+ *
+ * @return The index of the property or Property::INVALID_INDEX if registration failed
+ *
+ * @pre The object supports dynamic properties
+ * i.e. Supports(Handle::DYNAMIC_PROPERTIES) returns true. Property names and keys
+ * are expected to be unique, but this is not enforced. Property indices are unique
+ * to each registered custom property in a given object.
+ *
+ * @note Returns Property::INVALID_INDEX if registration failed. This can happen if
+ * you try to register animatable property on an object that does not have scene graph
+ * object.
+ *
+ * @note The returned property index is not the same as the integer key (though it
+ * shares a type)
+ *
+ * This version of RegisterProperty associates both an integer key and the text key
+ * with the property, allowing for lookup of the property index by either key or name
+ * ( which is useful when other classes know the key but not the name )
+ *
+ * @note Only the following types can be animated:
+ * - Property::BOOLEAN
+ * - Property::FLOAT
+ * - Property::INTEGER
+ * - Property::VECTOR2
+ * - Property::VECTOR3
+ * - Property::VECTOR4
+ * - Property::MATRIX3
+ * - Property::MATRIX
+ * - Property::ROTATION
+ * @note If a property with the desired name already exists, then the value given is just set.
+ */
+ Property::Index RegisterProperty( Property::Index key,
+ const std::string& name,
+ const Property::Value& propertyValue );
+
+ /**
* @brief Registers a new property.
*
* Properties can be set as non animatable using property attributes.
}
/**
+ * @brief Sets all the properties in the given property map.
+ *
+ * @SINCE_1_9.27
+ * @param[in] properties The properties to set
+ */
+ void SetProperties( const Property::Map& properties );
+
+ /**
+ * @brief Retrieves all the properties and the values for this object
+ *
+ * @SINCE_1_9.27
+ * @param[out] properties A map which is populated with the index-value pairs
+ *
+ * @note The properties map will be cleared by this method first.
+ */
+ void GetProperties( Property::Map& properties );
+
+ /**
* @brief Retrieves all the property indices for this object (including custom properties).
*
* @SINCE_1_0.0
void GetPropertyIndices( Property::IndexContainer& indices ) const;
/**
+ * @brief Determine if the custom property index exists on this object without throwing a Dali::Exception.
+ *
+ * @SINCE_1_9.27
+ * @note This does not check default properties.
+ * @param[in] index The index of the property to test for
+ */
+ bool DoesCustomPropertyExist( Property::Index index );
+
+ /**
* @brief Adds a property notification to this object.
*
* @SINCE_1_0.0
* @pre The Object has been initialized.
*/
void RemoveConstraints( uint32_t tag );
+
+ /**
+ * @brief Index operator, using integer lookup.
+ *
+ * Returns an object that can be assigned to or cast from, enabling
+ * the indexed property to be either read or written.
+ *
+ * @param[in] index The index of the property to access.
+ * @return indirect value. Should have shorter scope than the handle
+ */
+ IndirectValue operator[]( Property::Index index );
+
+ /**
+ * @brief Index operator, using name lookup.
+ *
+ * Returns an object that can be assigned to or cast from, enabling
+ * the named property to be either read or written.
+ *
+ * @param[in] name The name of the property to access.
+ * @return indirect value. Should have shorter scope than the handle
+ */
+ IndirectValue operator[]( const std::string& name );
+
+public: // Signals
+ /**
+ * @brief Get a signal when a property is set on this object through the API (i.e. not when animating)
+ *
+ * @SINCE_1_9.27
+ * @return The signal to attach a connection to.
+ */
+ PropertySetSignalType& PropertySetSignal();
};
/**
--- /dev/null
+/*
+ * 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/object/indirect-value.h>
+#include <dali/public-api/object/handle.h>
+#include <dali/internal/event/common/object-impl.h>
+
+namespace Dali
+{
+
+IndirectValue::IndirectValue( Handle& handle, Property::Index index )
+: mHandle(handle.GetObjectPtr()),
+ mIndex(index),
+ mExtension(nullptr)
+{
+}
+
+void IndirectValue::operator= (Property::Value value)
+{
+ Handle(static_cast<Dali::Internal::Object*>(mHandle.Get())).SetProperty(mIndex, value);
+}
+
+Property::Value IndirectValue::GetProperty()
+{
+ return Handle(static_cast<Dali::Internal::Object*>(mHandle.Get())).GetProperty(mIndex);
+}
+
+IndirectValue& IndirectValue::operator=( IndirectValue&& ) = default;
+
+IndirectValue::IndirectValue( IndirectValue&& ) = default;
+
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_INDIRECT_VALUE_H
+#define DALI_INDIRECT_VALUE_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/common/intrusive-ptr.h>
+#include <dali/public-api/object/property.h>
+#include <dali/public-api/object/property-value.h>
+#include <dali/public-api/object/ref-object.h>
+
+namespace Dali
+{
+/**
+ * @addtogroup dali_core_object
+ * @{
+ */
+
+class Handle;
+
+
+/**
+ * @brief Dali::IndirectValue is an intermediate object that enables a simpler
+ * syntax for addressing properties.
+ *
+ * @SINCE_1_9.27
+ * object["property"] = value;
+ * float value = object["property"];
+ *
+ * It is not intended to be directly instantiated, instead, any Handle type
+ * will generate a temporary object using the above syntax.
+ */
+class DALI_CORE_API IndirectValue
+{
+public:
+ /**
+ * @brief Assignment operator
+ *
+ * @SINCE_1_9.27
+ * Enables "handle[property] = value" syntax.
+ * @param[in] value The value to assign
+ */
+ void operator=(Property::Value value);
+
+ /**
+ * @brief Explicit cast operator for property value.
+ *
+ * @SINCE_1_9.27
+ * Enables implicit promotion of this to a Property::Value type parameter
+ * @return The property value
+ */
+ operator Property::Value()
+ {
+ return GetProperty();
+ }
+
+ /**
+ * @brief Cast operator
+ *
+ * @SINCE_1_9.27
+ * Enables "value = handle[property]" syntax.
+ * @tparam Type The type of the associated property
+ * @return The associated property cast to the desired type
+ */
+ template <typename Type>
+ inline operator Type()
+ {
+ Property::Value value = GetProperty();
+ return value.Get<Type>();
+ }
+
+private:
+ /// @cond internal
+
+ /**
+ * @brief Move constructor.
+ *
+ * @SINCE_1_9.27
+ * Making this private to prevent construction of auto type or IndirectValue type.
+ * @param[in] rhs The object to move
+ */
+ DALI_INTERNAL IndirectValue( IndirectValue&& rhs );
+
+ /**
+ * @brief Move assignment operator.
+ *
+ * @SINCE_1_9.27
+ * Making this private to prevent assignment to auto type or IndirectValue type.
+ * @param[in] rhs The object to move
+ */
+ DALI_INTERNAL IndirectValue& operator=( IndirectValue&& rhs );
+
+ /**
+ * @brief Accessor for handle property.
+ *
+ * @SINCE_1_9.27
+ * @return The handle's property value
+ * @note Asserts if the handle is empty
+ */
+ Property::Value GetProperty();
+
+ friend class Handle; ///< Only Handle types can construct this object
+
+ /**
+ * @brief Private constructor
+ *
+ * @SINCE_1_9.27
+ * @param[in] handle A reference to the associated handle
+ * @param[in] index The index to the associated property
+ */
+ DALI_INTERNAL IndirectValue( Handle& handle, Property::Index index );
+private:
+ IntrusivePtr<Dali::RefObject> mHandle; ///< A handle to the property owner
+ Property::Index mIndex; ///< Index of the property in the property owner.
+
+ struct Extension; ///< Reserved for future use
+ Extension* mExtension; ///< Reserved for future use
+
+ /// @endcond
+};
+
+/**
+ * @}
+ */
+} // Namespace Dali
+
+#endif // DALI_INDIRECT_VALUE_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.
namespace Dali
{
-const int32_t Property::INVALID_INDEX = -1;
-const int32_t Property::INVALID_KEY = -1;
-const int32_t Property::INVALID_COMPONENT_INDEX = -1;
-
Property::Property(Handle& obj, Property::Index propIndex)
: object(obj),
propertyIndex(propIndex),
#define DALI_PROPERTY_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.
*/
typedef int32_t Index;
- static const int32_t INVALID_INDEX; ///< -1 is not a valid property index
- static const int32_t INVALID_KEY; ///< -1 is not a valid property key
- static const int32_t INVALID_COMPONENT_INDEX; ///< -1 is not a valid property index
+ static constexpr int32_t INVALID_INDEX{-1}; ///< -1 is not a valid property index
+ static constexpr int32_t INVALID_KEY{-1}; ///< -1 is not a valid property key
+ static constexpr int32_t INVALID_COMPONENT_INDEX{-1}; ///< -1 is not a valid property index
typedef Dali::Vector< Index > IndexContainer; ///< A vector of property indices @SINCE_1_0.0
Geometry& Geometry::operator=( Geometry&& rhs ) = default;
-std::size_t Geometry::AddVertexBuffer( PropertyBuffer& vertexBuffer )
+std::size_t Geometry::AddVertexBuffer( VertexBuffer& vertexBuffer )
{
DALI_ASSERT_ALWAYS( vertexBuffer && "VertexBuffer is not initialized ");
return GetImplementation(*this).AddVertexBuffer( GetImplementation( vertexBuffer ) );
// INTERNAL INCLUDES
#include <dali/public-api/object/handle.h> // Dali::Handle
#include <dali/public-api/object/property-index-ranges.h> // DEFAULT_DERIVED_HANDLE_PROPERTY_START_INDEX
-#include <dali/public-api/rendering/property-buffer.h> // Dali::PropertyBuffer
+#include <dali/public-api/rendering/vertex-buffer.h> // Dali::VertexBuffer
namespace Dali
{
Geometry& operator=( Geometry&& rhs );
/**
- * @brief Adds a PropertyBuffer to be used as source of geometry vertices.
+ * @brief Adds a VertexBuffer to be used as source of geometry vertices.
*
- * @SINCE_1_1.43
- * @param[in] vertexBuffer PropertyBuffer to be used as source of geometry vertices
+ * @SINCE_1_9.27
+ * @param[in] vertexBuffer VertexBuffer to be used as source of geometry vertices
* @return Index of the newly added buffer, can be used with RemoveVertexBuffer to remove
* this buffer if no longer required
*/
- std::size_t AddVertexBuffer( PropertyBuffer& vertexBuffer );
+ std::size_t AddVertexBuffer( VertexBuffer& vertexBuffer );
/**
* @brief Retrieves the number of vertex buffers that have been added to this geometry.
*
- * @SINCE_1_1.43
+ * @SINCE_1_9.27
* @return Number of vertex buffers that have been added to this geometry
*/
std::size_t GetNumberOfVertexBuffers() const;
* @brief Removes a vertex buffer.
* The index must be between 0 and GetNumberOfVertexBuffers().
*
- * @SINCE_1_1.43
+ * @SINCE_1_9.27
* @param[in] index Index to the vertex buffer to remove
*/
void RemoveVertexBuffer( std::size_t index );
+++ /dev/null
-/*
- * 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.
- *
- */
-
-// CLASS HEADER
-#include <dali/public-api/rendering/property-buffer.h>
-
-// INTERNAL INCLUDES
-#include <dali/public-api/object/property-map.h> // Dali::Property::Map
-#include <dali/internal/event/common/property-buffer-impl.h> // Dali::Internal::PropertyBuffer
-
-namespace Dali
-{
-
-PropertyBuffer PropertyBuffer::New( Dali::Property::Map& bufferFormat )
-{
- Internal::PropertyBufferPtr propertyBuffer = Internal::PropertyBuffer::New( bufferFormat );
-
- return PropertyBuffer( propertyBuffer.Get() );
-}
-
-PropertyBuffer::PropertyBuffer()
-{
-}
-
-PropertyBuffer::~PropertyBuffer()
-{
-}
-
-PropertyBuffer::PropertyBuffer( const PropertyBuffer& handle ) = default;
-
-PropertyBuffer PropertyBuffer::DownCast( BaseHandle handle )
-{
- return PropertyBuffer( dynamic_cast<Dali::Internal::PropertyBuffer*>(handle.GetObjectPtr()));
-}
-
-PropertyBuffer& PropertyBuffer::operator=( const PropertyBuffer& handle ) = default;
-
-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
-}
-
-std::size_t PropertyBuffer::GetSize() const
-{
- return GetImplementation(*this).GetSize();
-}
-
-
-PropertyBuffer::PropertyBuffer( Internal::PropertyBuffer* pointer )
-: BaseHandle( pointer )
-{
-}
-
-} // namespace Dali
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/public-api/rendering/vertex-buffer.h>
+
+// INTERNAL INCLUDES
+#include <dali/public-api/object/property-map.h> // Dali::Property::Map
+#include <dali/internal/event/rendering/vertex-buffer-impl.h> // Dali::Internal::VertexBuffer
+
+namespace Dali
+{
+
+VertexBuffer VertexBuffer::New( Dali::Property::Map& bufferFormat )
+{
+ Internal::VertexBufferPtr vertexBuffer = Internal::VertexBuffer::New( bufferFormat );
+
+ return VertexBuffer( vertexBuffer.Get() );
+}
+
+VertexBuffer::VertexBuffer()
+{
+}
+
+VertexBuffer::~VertexBuffer()
+{
+}
+
+VertexBuffer::VertexBuffer( const VertexBuffer& handle ) = default;
+
+VertexBuffer VertexBuffer::DownCast( BaseHandle handle )
+{
+ return VertexBuffer( dynamic_cast<Dali::Internal::VertexBuffer*>(handle.GetObjectPtr()));
+}
+
+VertexBuffer& VertexBuffer::operator=( const VertexBuffer& handle ) = default;
+
+VertexBuffer::VertexBuffer( VertexBuffer&& rhs ) = default;
+
+VertexBuffer& VertexBuffer::operator=( VertexBuffer&& rhs ) = default;
+
+void VertexBuffer::SetData( const void* data, std::size_t size )
+{
+ GetImplementation(*this).SetData( data, static_cast<uint32_t>( size ) ); // only support 4,294,967,295 bytes
+}
+
+std::size_t VertexBuffer::GetSize() const
+{
+ return GetImplementation(*this).GetSize();
+}
+
+
+VertexBuffer::VertexBuffer( Internal::VertexBuffer* pointer )
+: BaseHandle( pointer )
+{
+}
+
+} // namespace Dali
-#ifndef DALI_PROPERTY_BUFFER_H
-#define DALI_PROPERTY_BUFFER_H
+#ifndef DALI_VERTEX_BUFFER_H
+#define DALI_VERTEX_BUFFER_H
/*
* Copyright (c) 2020 Samsung Electronics Co., Ltd.
namespace Internal DALI_INTERNAL
{
-class PropertyBuffer;
+class VertexBuffer;
}
/**
- * @brief PropertyBuffer is a handle to an object that contains a buffer of structured properties.
+ * @brief VertexBuffer is a handle to an object that contains a buffer of structured data.
*
- * PropertyBuffers can be used to provide data to Geometry objects.
+ * VertexBuffers can be used to provide data to Geometry objects.
*
* Example:
*
* Property::Map texturedQuadVertexFormat;
* texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
* texturedQuadVertexFormat["aTexCoord"] = Property::VECTOR2;
- * PropertyBuffer texturedQuadVertices = PropertyBuffer::New( texturedQuadVertexFormat );
+ * VertexBuffer texturedQuadVertices = VertexBuffer::New( texturedQuadVertexFormat );
* texturedQuadVertices.SetData( texturedQuadVertexData, 4 );
*
* // Create indices
*
* @SINCE_1_1.43
*/
-class DALI_CORE_API PropertyBuffer : public BaseHandle
+class DALI_CORE_API VertexBuffer : public BaseHandle
{
public:
/**
- * @brief Creates a PropertyBuffer.
- * Static property buffers use less memory.
+ * @brief Creates a VertexBuffer.
*
- * @SINCE_1_1.43
+ * @SINCE_1_9.27
* @param[in] bufferFormat Map of names and types that describes the components of the buffer
- * @return Handle to a newly allocated PropertyBuffer
+ * @return Handle to a newly allocated VertexBuffer
*/
- static PropertyBuffer New( Dali::Property::Map& bufferFormat );
+ static VertexBuffer New( Dali::Property::Map& bufferFormat );
/**
* @brief Default constructor, creates an empty handle.
*
- * @SINCE_1_1.43
+ * @SINCE_1_9.27
*/
- PropertyBuffer();
+ VertexBuffer();
/**
* @brief Destructor.
*
- * @SINCE_1_1.43
+ * @SINCE_1_9.27
*/
- ~PropertyBuffer();
+ ~VertexBuffer();
/**
* @brief Copy constructor, creates a new handle to the same object.
*
- * @SINCE_1_1.43
+ * @SINCE_1_9.27
* @param[in] handle Handle to an object
*/
- PropertyBuffer( const PropertyBuffer& handle );
+ VertexBuffer( const VertexBuffer& handle );
/**
* @brief Downcasts to a property buffer handle.
* If not, a property buffer the returned property buffer handle is left uninitialized.
*
- * @SINCE_1_1.43
+ * @SINCE_1_9.27
* @param[in] handle Handle to an object
* @return Property buffer handle or an uninitialized handle
*/
- static PropertyBuffer DownCast( BaseHandle handle );
+ static VertexBuffer DownCast( BaseHandle handle );
/**
* @brief Assignment operator, changes this handle to point at the same object.
*
- * @SINCE_1_1.43
+ * @SINCE_1_9.27
* @param[in] handle Handle to an object
* @return Reference to the assigned object
*/
- PropertyBuffer& operator=( const PropertyBuffer& handle );
+ VertexBuffer& operator=( const VertexBuffer& handle );
/**
* @brief Move constructor.
*
- * @SINCE_1_9.22
+ * @SINCE_1_9.27
* @param[in] rhs A reference to the moved handle
*/
- PropertyBuffer( PropertyBuffer&& rhs );
+ VertexBuffer( VertexBuffer&& rhs );
/**
* @brief Move assignment operator.
*
- * @SINCE_1_9.22
+ * @SINCE_1_9.27
* @param[in] rhs A reference to the moved handle
* @return A reference to this handle
*/
- PropertyBuffer& operator=( PropertyBuffer&& rhs );
+ VertexBuffer& operator=( VertexBuffer&& rhs );
/**
* @brief Updates the whole buffer information.
* Dali::Vector2 uv;
* };
* Vertex vertices[ 10 ] = { ... };
- * propertyBuffer.SetData( vertices );
+ * vertexBuffer.SetData( vertices );
* </pre>
*
- * @SINCE_1_1.43
+ * @SINCE_1_9.27
* @param[in] data A pointer to the data that will be copied to the buffer
* @param[in] size Number of elements to expand or contract the buffer
*/
/**
* @brief Gets the number of elements in the buffer.
*
- * @SINCE_1_1.43
+ * @SINCE_1_9.27
* @return Number of elements to expand or contract the buffer
*/
std::size_t GetSize() const;
/**
* @brief The constructor.
* @note Not intended for application developers.
- * @SINCE_1_1.43
- * @param[in] pointer A pointer to a newly allocated PropertyBuffer
+ * @SINCE_1_9.27
+ * @param[in] pointer A pointer to a newly allocated VertexBuffer
*/
- explicit DALI_INTERNAL PropertyBuffer( Internal::PropertyBuffer* pointer );
+ explicit DALI_INTERNAL VertexBuffer( Internal::VertexBuffer* pointer );
};
/**
*/
} // namespace Dali
-#endif // DALI_PROPERTY_BUFFER_H
+#endif // DALI_VERTEX_BUFFER_H
Name: dali2
Summary: DALi 3D Engine
-Version: 1.9.26
+Version: 1.9.27
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT