{
unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
Property::Map indexFormat;
- indexFormat["indices"] = Property::UNSIGNED_INTEGER; // Should be Unsigned Short
+ indexFormat["indices"] = Property::INTEGER;
PropertyBuffer indices = PropertyBuffer::New( indexFormat, 3 );
indices.SetData(indexData);
texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
texturedQuadVertexFormat["aVertexCoord"] = Property::VECTOR2;
- unsigned int size = 5u;
+ int size = 5u;
PropertyBuffer propertyBuffer = PropertyBuffer::New( texturedQuadVertexFormat, size );
- DALI_TEST_EQUALS( propertyBuffer.GetProperty<unsigned int>(PropertyBuffer::Property::SIZE), size, TEST_LOCATION );
+ DALI_TEST_EQUALS( propertyBuffer.GetProperty<int>(PropertyBuffer::Property::SIZE), size, TEST_LOCATION );
DALI_TEST_EQUALS( propertyBuffer.GetSize(), size, TEST_LOCATION );
size += 3u;
propertyBuffer.SetSize( size );
- DALI_TEST_EQUALS( propertyBuffer.GetProperty<unsigned int>(PropertyBuffer::Property::SIZE), size, TEST_LOCATION );
+ DALI_TEST_EQUALS( propertyBuffer.GetProperty<int>(PropertyBuffer::Property::SIZE), size, TEST_LOCATION );
DALI_TEST_EQUALS( propertyBuffer.GetSize(), size, TEST_LOCATION );
size += 2u;
// Create indices
unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
Property::Map indexFormat;
- indexFormat["indices"] = Property::UNSIGNED_INTEGER;
+ indexFormat["indices"] = Property::INTEGER;
PropertyBuffer indices = PropertyBuffer::New( indexFormat, sizeof(indexData)/sizeof(indexData[0]) );
indices.SetData(indexData);
unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
Property::Map indexFormat;
- indexFormat["indices"] = Property::UNSIGNED_INTEGER;
+ indexFormat["indices"] = Property::INTEGER;
PropertyBuffer indices = PropertyBuffer::New( indexFormat, sizeof(indexData)/sizeof(indexData[0]) );
indices.SetData(indexData);
END_TEST;
}
-int UtcDaliAnimationCustomUnsignedIntProperty(void)
+int UtcDaliAnimationCustomIntProperty(void)
{
TestApplication application;
Actor actor = Actor::New();
Stage::GetCurrent().Add(actor);
- unsigned int startValue(0u);
+ int startValue(0u);
Property::Index index = actor.RegisterProperty("an-index", startValue);
- DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), startValue, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<int>(index), startValue, TEST_LOCATION );
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
- animation.AnimateTo( Property(actor, index), 20u );
+ animation.AnimateTo( Property(actor, index), 20 );
// Start the animation
animation.Play();
// We didn't expect the animation to finish yet
application.SendNotification();
finishCheck.CheckSignalNotReceived();
- DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), 10u, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<int>(index), 10, TEST_LOCATION );
application.SendNotification();
application.Render(static_cast<unsigned int>(durationSeconds*500.0f) + 1u/*just beyond the animation duration*/);
// We did expect the animation to finish
application.SendNotification();
finishCheck.CheckSignalReceived();
- DALI_TEST_EQUALS( actor.GetProperty<unsigned int>(index), 20u, TEST_LOCATION );
+ DALI_TEST_EQUALS( actor.GetProperty<int>(index), 20, TEST_LOCATION );
END_TEST;
}
END_TEST;
}
-int UtcDaliConstraintTestPropertyTypesN(void)
-{
- // unsigned int not supported so we should assert
-
- try
- {
- TestPropertyTypes::Execute< unsigned int >( 0u );
- DALI_TEST_CHECK( false ); // Should not come here
- }
- catch( ... )
- {
- DALI_TEST_CHECK( true );
- }
-
-
- END_TEST;
-}
///////////////////////////////////////////////////////////////////////////////
static const bool BOOLEAN_VALUE;
static const float FLOAT_VALUE;
static const int INTEGER_VALUE;
- static const unsigned int UNSIGNED_INTEGER_VALUE;
static const Vector2 VECTOR2_VALUE;
static const Vector3 VECTOR3_VALUE;
static const Vector4 VECTOR4_VALUE;
virtual const bool& GetBoolean() const { return BOOLEAN_VALUE; }
virtual const float& GetFloat() const { return FLOAT_VALUE; }
virtual const int& GetInteger() const { return INTEGER_VALUE; }
- virtual const unsigned int& GetUnsignedInteger() const { return UNSIGNED_INTEGER_VALUE; }
virtual const Vector2& GetVector2() const { return VECTOR2_VALUE; }
virtual const Vector3& GetVector3() const { return VECTOR3_VALUE; }
virtual const Vector4& GetVector4() const { return VECTOR4_VALUE; }
const bool PropertyInputImpl::BOOLEAN_VALUE = true;
const float PropertyInputImpl::FLOAT_VALUE = 123.0f;
const int PropertyInputImpl::INTEGER_VALUE = 456;
-const unsigned int PropertyInputImpl::UNSIGNED_INTEGER_VALUE = 789u;
const Vector2 PropertyInputImpl::VECTOR2_VALUE = Vector2( 10.0f, 20.0f );
const Vector3 PropertyInputImpl::VECTOR3_VALUE = Vector3( 30.0f, 40.0f, 50.0f );
const Vector4 PropertyInputImpl::VECTOR4_VALUE = Vector4( 60.0f, 70.0f, 80.0f, 90.0f );
{
tet_infoline("Positive Test Dali::Handle::GetPropertyType()");
TestApplication application;
- unsigned int unsingedIntTest = 33;
Actor actor = Actor::New();
DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( Actor::Property::PARENT_ORIGIN ) );
Property::Index boolIndex = actor.RegisterProperty( "bool-property", bool(true) );
Property::Index floatIndex = actor.RegisterProperty( "float-property", float(123.0f) );
Property::Index intIndex = actor.RegisterProperty( "int-property", 123 );
- Property::Index unsignedIntIndex = actor.RegisterProperty( "unsigned-int-property", 456u );
Property::Index vector2Index = actor.RegisterProperty( "vector2-property", Vector2(1.0f, 2.0f) );
Property::Index vector3Index = actor.RegisterProperty( "vector3-property", Vector3(1.0f, 2.0f, 3.0f) );
Property::Index vector4Index = actor.RegisterProperty( "vector4-property", Vector4(1.0f, 2.0f, 3.0f, 4.0f) );
DALI_TEST_CHECK( Property::BOOLEAN == actor.GetPropertyType( boolIndex ) );
DALI_TEST_CHECK( Property::FLOAT == actor.GetPropertyType( floatIndex ) );
DALI_TEST_CHECK( Property::INTEGER == actor.GetPropertyType( intIndex ) );
- DALI_TEST_CHECK( Property::UNSIGNED_INTEGER == actor.GetPropertyType( unsignedIntIndex ) );
DALI_TEST_CHECK( Property::VECTOR2 == actor.GetPropertyType( vector2Index ) );
DALI_TEST_CHECK( Property::VECTOR3 == actor.GetPropertyType( vector3Index ) );
DALI_TEST_CHECK( Property::VECTOR4 == actor.GetPropertyType( vector4Index ) );
Property::Index nonAnimBooleanIndex = actor.RegisterProperty( "bool", true, Property::READ_WRITE);
Property::Index nonAnimFloatIndex = actor.RegisterProperty( "float", 0.f, Property::READ_WRITE);
Property::Index nonAnimIntegerIndex = actor.RegisterProperty( "int", 0, Property::READ_WRITE);
- Property::Index nonAnimUnsignedIntIndex = actor.RegisterProperty( "unsinged-int", unsingedIntTest, Property::READ_WRITE);
DALI_TEST_CHECK( nonAnimStringIndex != Property::INVALID_INDEX );
DALI_TEST_CHECK( nonAnimV2Index != Property::INVALID_INDEX );
DALI_TEST_CHECK( nonAnimBooleanIndex != Property::INVALID_INDEX );
DALI_TEST_CHECK( nonAnimFloatIndex != Property::INVALID_INDEX );
DALI_TEST_CHECK( nonAnimIntegerIndex != Property::INVALID_INDEX );
- DALI_TEST_CHECK( nonAnimUnsignedIntIndex != Property::INVALID_INDEX );
DALI_TEST_CHECK( Property::STRING == actor.GetPropertyType( nonAnimStringIndex ) );
DALI_TEST_CHECK( Property::VECTOR2 == actor.GetPropertyType( nonAnimV2Index ) );
DALI_TEST_CHECK( Property::BOOLEAN == actor.GetPropertyType( nonAnimBooleanIndex ) );
DALI_TEST_CHECK( Property::FLOAT == actor.GetPropertyType( nonAnimFloatIndex ) );
DALI_TEST_CHECK( Property::INTEGER == actor.GetPropertyType( nonAnimIntegerIndex ) );
- DALI_TEST_CHECK( Property::UNSIGNED_INTEGER == actor.GetPropertyType( nonAnimUnsignedIntIndex ) );
DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimStringIndex ) );
DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimV2Index ) );
DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimBooleanIndex ) );
DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimFloatIndex ) );
DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimIntegerIndex ) );
- DALI_TEST_CHECK( !actor.IsPropertyAnimatable( nonAnimUnsignedIntIndex ) );
DALI_TEST_EQUALS( "yes" , actor.GetProperty( nonAnimStringIndex ).Get<std::string>(), TEST_LOCATION );
DALI_TEST_EQUALS( Vector2(1.f, 2.f) , actor.GetProperty( nonAnimV2Index ).Get<Vector2>(), TEST_LOCATION );
DALI_TEST_EQUALS( true, actor.GetProperty( nonAnimBooleanIndex ).Get<bool>(), TEST_LOCATION );
DALI_TEST_EQUALS( 0.f, actor.GetProperty( nonAnimFloatIndex ).Get<float>(), TEST_LOCATION );
DALI_TEST_EQUALS( 0, actor.GetProperty( nonAnimIntegerIndex ).Get<int>(), TEST_LOCATION );
- DALI_TEST_EQUALS( unsingedIntTest, actor.GetProperty( nonAnimUnsignedIntIndex ).Get<unsigned int>(), TEST_LOCATION );
END_TEST;
}
{ "Property::BOOLEAN", true, true },
{ "Property::FLOAT", 1.0f, true },
{ "Property::INTEGER", 1, true },
- { "Property::UNSIGNED_INTEGER", 1u, true },
{ "Property::VECTOR2", Vector2::ONE, true },
{ "Property::VECTOR3", Vector3::ONE, true },
{ "Property::VECTOR4", Vector4::ONE, true },
DALI_TEST_EQUALS( "BOOLEAN", Dali::PropertyTypes::GetName(Property::BOOLEAN ), TEST_LOCATION );
DALI_TEST_EQUALS( "FLOAT", Dali::PropertyTypes::GetName(Property::FLOAT ), TEST_LOCATION );
DALI_TEST_EQUALS( "INTEGER", Dali::PropertyTypes::GetName(Property::INTEGER ), TEST_LOCATION );
- DALI_TEST_EQUALS( "UNSIGNED_INTEGER", Dali::PropertyTypes::GetName(Property::UNSIGNED_INTEGER ), TEST_LOCATION );
DALI_TEST_EQUALS( "VECTOR2", Dali::PropertyTypes::GetName(Property::VECTOR2 ), TEST_LOCATION );
DALI_TEST_EQUALS( "VECTOR3", Dali::PropertyTypes::GetName(Property::VECTOR3 ), TEST_LOCATION );
DALI_TEST_EQUALS( "VECTOR4", Dali::PropertyTypes::GetName(Property::VECTOR4 ), TEST_LOCATION );
END_TEST;
}
-int UtcDaliPropertyTypesGet05P(void)
-{
- DALI_TEST_CHECK( Dali::PropertyTypes::Get<unsigned int>() == Property::UNSIGNED_INTEGER );
- END_TEST;
-}
-
int UtcDaliPropertyTypesGet06P(void)
{
DALI_TEST_CHECK( Dali::PropertyTypes::Get<Dali::Vector2>() == Property::VECTOR2 );
DALI_TEST_CHECK( "INTEGER" == std::string(PropertyTypes::GetName( type ) ) );
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- DALI_TEST_CHECK( "UNSIGNED_INTEGER" == std::string(PropertyTypes::GetName( type ) ) );
- break;
- }
case Property::VECTOR2:
{
DALI_TEST_CHECK( "VECTOR2" == std::string(PropertyTypes::GetName( type ) ) );
END_TEST;
}
-int UtcDaliPropertyValueConstructorsUnsignedIntP(void)
-{
- Property::Value value(1u);
-
- DALI_TEST_CHECK( value.GetType() == Property::UNSIGNED_INTEGER );
- DALI_TEST_CHECK( value.Get<unsigned int>() == 1u );
-
- END_TEST;
-}
-
-int UtcDaliPropertyValueConstructorsUnsignedIntTypeP(void)
-{
- Property::Value value( Property::UNSIGNED_INTEGER );
-
- DALI_TEST_CHECK( value.GetType() == Property::UNSIGNED_INTEGER );
- DALI_TEST_CHECK( value.Get<unsigned int>() == 0u );
-
- END_TEST;
-}
-
int UtcDaliPropertyValueConstructorsVector2P(void)
{
Vector2 v(1,1);
END_TEST;
}
-int UtcDaliPropertyValueCopyConstructorUnsignedIntP(void)
-{
- CheckCopyCtorP<unsigned int> check(1u);
- END_TEST;
-}
-
int UtcDaliPropertyValueCopyConstructoVector2P(void)
{
CheckCopyCtorP<Vector2> check( Vector2(2,1) );
END_TEST;
}
-int UtcDaliPropertyValueAssignmentOperatorUnsignedIntP(void)
-{
- Property::Value value;
- value = Property::Value(10U); // type mismatch
- DALI_TEST_CHECK( 10U == value.Get<unsigned int>() );
- Property::Value copy( 123U);
- copy = value; // type match
- DALI_TEST_CHECK( 10U == copy.Get<unsigned int>() );
- END_TEST;
-}
-
int UtcDaliPropertyValueAssignmentOperatorFloatP(void)
{
Property::Value value;
END_TEST;
}
-int UtcDaliPropertyValueGetUnsignedIntP(void)
-{
- Property::Value value(123u);
- unsigned int result( 10u );
- DALI_TEST_EQUALS( 123u, value.Get<unsigned int>(), TEST_LOCATION );
- DALI_TEST_EQUALS( true, value.Get( result ), TEST_LOCATION );
- DALI_TEST_EQUALS( 123u, result, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliPropertyValueGetUnsignedIntN(void)
-{
- Property::Value value;
- unsigned int result( 10u );
- DALI_TEST_EQUALS( 0u, value.Get<unsigned int>(), TEST_LOCATION );
- DALI_TEST_EQUALS( false, value.Get( result ), TEST_LOCATION );
- DALI_TEST_EQUALS( 10u, result, TEST_LOCATION );
- Property::Value value2("");
- DALI_TEST_EQUALS( false, value2.Get( result ), TEST_LOCATION );
- DALI_TEST_EQUALS( 10u, result, TEST_LOCATION ); // result is not modified
- END_TEST;
-}
-
int UtcDaliPropertyValueGetRectP(void)
{
Property::Value value( Rect<int>(1,2,3,4) );
}
{
- value = Property::Value(25U);
- std::ostringstream stream;
- stream << value;
- DALI_TEST_CHECK( stream.str() == "25" )
- }
-
- {
value = Property::Value( Vector2(1.f,1.f) );
std::ostringstream stream;
stream << value;
* // Create indices
* unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
* Property::Map indexFormat;
- * indexFormat["indices"] = Property::UNSIGNED_INTEGER;
+ * indexFormat["indices"] = Property::INTEGER;
* PropertyBuffer indices = PropertyBuffer::New( indexFormat, 6 );
* indices.SetData(indexData);
*
{
enum
{
- SIZE = DEFAULT_OBJECT_PROPERTY_START_INDEX, ///< name "size", type UNSIGNED_INT
+ SIZE = DEFAULT_OBJECT_PROPERTY_START_INDEX, ///< name "size", type INTEGER
BUFFER_FORMAT, ///< name "buffer-format", type MAP
};
};
*
* This function expects a pointer to an array of structures with the same
* format that was given in the construction, and the number of elements to
- * be the sane as the size of the buffer.
+ * be the same as the size of the buffer.
*
* If the initial structure was: { { "position", VECTOR3}, { "uv", VECTOR2 } }
* and a size of 10 elements, this function should be called with a pointer equivalent to:
enum
{
PROGRAM = DEFAULT_OBJECT_PROPERTY_START_INDEX, ///< name "program", type MAP; {"vertex-prefix":"","fragment-prefix":"","vertex":"","fragment":""}
- SHADER_HINTS, ///< name "shader-hints", type UNSIGNED_INTEGER; (bitfield) values from enum Shader::Hints
+ SHADER_HINTS, ///< name "shader-hints", type INTEGER; (bitfield) values from enum Shader::Hints
};
};
// Width and height can be set individually. Dali derives the unspecified
// dimension from the aspect ratio of the raw image.
- unsigned int width = 0, height = 0;
+ int width = 0, height = 0;
value = map->Find( "width" );
if( value )
{
if( value->GetType() == Property::FLOAT )
{
- height = static_cast<unsigned int>( value->Get<float>() );
+ height = static_cast<int>( value->Get<float>() );
}
else
{
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- const AnimatableProperty< unsigned int >* property = dynamic_cast< const AnimatableProperty< unsigned int >* >( entry.GetSceneGraphProperty() );
- DALI_ASSERT_DEBUG( NULL != property );
-
- // property is being used in a separate thread; queue a message to set the property
- SceneGraph::NodePropertyMessage<unsigned int>::Send( GetEventThreadServices(), mNode, property, &AnimatableProperty<unsigned int>::Bake, value.Get<unsigned int>() );
-
- break;
- }
-
case Property::FLOAT:
{
const AnimatableProperty< float >* property = dynamic_cast< const AnimatableProperty< float >* >( entry.GetSceneGraphProperty() );
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- AddAnimatorConnector( AnimatorConnector<unsigned int>::New( object,
- target.propertyIndex,
- target.componentIndex,
- new AnimateByUnsignedInteger(relativeValue.Get<unsigned int>()),
- alpha,
- period ) );
- break;
- }
-
case Property::FLOAT:
{
AddAnimatorConnector( AnimatorConnector<float>::New( object,
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- AddAnimatorConnector( AnimatorConnector<unsigned int>::New( targetObject,
- targetPropertyIndex,
- componentIndex,
- new AnimateToUnsignedInteger( destinationValue.Get<unsigned int>() ),
- alpha,
- period ) );
- break;
- }
-
case Property::FLOAT:
{
if ( ( Dali::Actor::Property::SIZE_WIDTH == targetPropertyIndex )||
break;
}
- case Dali::Property::UNSIGNED_INTEGER:
- {
- const KeyFrameUnsignedInteger* kf;
- GetSpecialization(keyFrames, kf);
- KeyFrameUnsignedIntegerPtr kfCopy = KeyFrameUnsignedInteger::Clone(*kf);
- AddAnimatorConnector( AnimatorConnector<int>::New( object,
- target.propertyIndex,
- target.componentIndex,
- new KeyFrameUnsignedIntegerFunctor(kfCopy,interpolation),
- alpha,
- period ) );
- break;
- }
-
case Dali::Property::FLOAT:
{
const KeyFrameNumber* kf;
switch(type)
{
case Property::BOOLEAN:
+ {
mKeyFrames = Internal::KeyFrameBoolean::New();
break;
+ }
case Property::INTEGER:
+ {
mKeyFrames = Internal::KeyFrameInteger::New();
break;
- case Property::UNSIGNED_INTEGER:
- mKeyFrames = Internal::KeyFrameUnsignedInteger::New();
- break;
+ }
case Property::FLOAT:
+ {
mKeyFrames = Internal::KeyFrameNumber::New();
break;
+ }
case Property::VECTOR2:
+ {
mKeyFrames = Internal::KeyFrameVector2::New();
break;
+ }
case Property::VECTOR3:
+ {
mKeyFrames = Internal::KeyFrameVector3::New();
break;
+ }
case Property::VECTOR4:
+ {
mKeyFrames = Internal::KeyFrameVector4::New();
break;
+ }
case Property::ROTATION:
+ {
mKeyFrames = Internal::KeyFrameQuaternion::New();
break;
+ }
default:
+ {
DALI_ASSERT_DEBUG(!"Type not supported");
break;
+ }
}
}
kf->AddKeyFrame(time, value.Get<int>(), alpha);
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- Internal::KeyFrameUnsignedInteger* kf = static_cast<Internal::KeyFrameUnsignedInteger*>(mKeyFrames.Get());
- kf->AddKeyFrame(time, value.Get<unsigned int>(), alpha);
- break;
- }
case Property::FLOAT:
{
Internal::KeyFrameNumber* kf = static_cast<Internal::KeyFrameNumber*>(mKeyFrames.Get());
typedef KeyFrameBaseSpec<float> KeyFrameNumber;
typedef KeyFrameBaseSpec<bool> KeyFrameBoolean;
typedef KeyFrameBaseSpec<int> KeyFrameInteger;
-typedef KeyFrameBaseSpec<unsigned int> KeyFrameUnsignedInteger;
typedef KeyFrameBaseSpec<Vector2> KeyFrameVector2;
typedef KeyFrameBaseSpec<Vector3> KeyFrameVector3;
typedef KeyFrameBaseSpec<Vector4> KeyFrameVector4;
typedef IntrusivePtr<KeyFrameBoolean> KeyFrameBooleanPtr;
typedef IntrusivePtr<KeyFrameNumber> KeyFrameNumberPtr;
typedef IntrusivePtr<KeyFrameInteger> KeyFrameIntegerPtr;
-typedef IntrusivePtr<KeyFrameUnsignedInteger> KeyFrameUnsignedIntegerPtr;
typedef IntrusivePtr<KeyFrameVector2> KeyFrameVector2Ptr;
typedef IntrusivePtr<KeyFrameVector3> KeyFrameVector3Ptr;
typedef IntrusivePtr<KeyFrameVector4> KeyFrameVector4Ptr;
keyFrameSpec = static_cast<const Internal::KeyFrameInteger*>(keyFrames.GetKeyFramesBase());
}
-inline void GetSpecialization(Internal::KeyFrames& keyFrames, Internal::KeyFrameUnsignedInteger*& keyFrameSpec)
-{
- keyFrameSpec = static_cast<Internal::KeyFrameUnsignedInteger*>(keyFrames.GetKeyFramesBase());
-}
-
-inline void GetSpecialization(const Internal::KeyFrames& keyFrames, const Internal::KeyFrameUnsignedInteger*& keyFrameSpec)
-{
- keyFrameSpec = static_cast<const Internal::KeyFrameUnsignedInteger*>(keyFrames.GetKeyFramesBase());
-}
-
inline void GetSpecialization(Internal::KeyFrames& keyFrames, Internal::KeyFrameVector2*& keyFrameSpec)
{
keyFrameSpec = static_cast<Internal::KeyFrameVector2*>(keyFrames.GetKeyFramesBase());
typedef ProgressValue<int> ProgressInteger;
typedef std::vector<ProgressInteger> ProgressIntegerContainer;
-typedef ProgressValue<unsigned int> ProgressUnsignedInteger;
-typedef std::vector<ProgressUnsignedInteger> ProgressUnsignedIntegerContainer;
-
typedef ProgressValue<float> ProgressNumber;
typedef std::vector<ProgressNumber> ProgressNumberContainer;
}
/**
- * @copydoc Dali::Internal::PropertyInputImpl::GetConstraintInputUnsignedInteger() const
- */
- const unsigned int& GetConstraintInputUnsignedInteger( BufferIndex updateBufferIndex ) const
- {
- DALI_ASSERT_DEBUG( mComponentIndex < 0 && "Did not expect valid component index" );
-
- return mInput->GetConstraintInputUnsignedInteger( updateBufferIndex );
- }
-
- /**
* @copydoc Dali::Internal::PropertyInputImpl::GetConstraintInputFloat()
*/
const float& GetConstraintInputFloat( BufferIndex updateBufferIndex ) const
}
/**
- * @copydoc Dali::Internal::PropertyInput::GetUnsignedInteger()
- */
- virtual const unsigned int& GetUnsignedInteger() const
- {
- return mInput->GetConstraintInputUnsignedInteger( mBufferIndex );
- }
-
- /**
* @copydoc Dali::Internal::PropertyInput::GetFloat()
*/
virtual const float& GetFloat() const
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- newProperty = new AnimatableProperty<unsigned int>( propertyValue.Get<unsigned int>() );
- break;
- }
-
case Property::FLOAT:
{
newProperty = new AnimatableProperty<float>( propertyValue.Get<float>() );
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- const AnimatableProperty<unsigned int>* property = dynamic_cast< const AnimatableProperty<unsigned int>* >( entry->GetSceneGraphProperty() );
- DALI_ASSERT_DEBUG( NULL != property );
-
- value = (*property)[ bufferIndex ];
- break;
- }
-
case Property::FLOAT:
{
const AnimatableProperty<float>* property = dynamic_cast< const AnimatableProperty<float>* >( entry->GetSceneGraphProperty() );
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- const AnimatableProperty<unsigned int>* property = dynamic_cast< const AnimatableProperty<unsigned int>* >( entry.GetSceneGraphProperty() );
- DALI_ASSERT_DEBUG( NULL != property );
-
- // property is being used in a separate thread; queue a message to set the property
- BakeMessage<unsigned int>( GetEventThreadServices(), *property, value.Get<unsigned int>() );
- break;
- }
-
case Property::FLOAT:
{
const AnimatableProperty<float>* property = dynamic_cast< const AnimatableProperty<float>* >( entry.GetSceneGraphProperty() );
* |name |type |writable|animatable|constraint-input|enum for index-checking|
*/
DALI_PROPERTY_TABLE_BEGIN
-DALI_PROPERTY( "size", UNSIGNED_INTEGER, true, false, true, Dali::PropertyBuffer::Property::SIZE )
-DALI_PROPERTY( "buffer-format", MAP, false, false, false, Dali::PropertyBuffer::Property::BUFFER_FORMAT )
+DALI_PROPERTY( "size", INTEGER, true, false, true, Dali::PropertyBuffer::Property::SIZE )
+DALI_PROPERTY( "buffer-format", MAP, false, false, false, Dali::PropertyBuffer::Property::BUFFER_FORMAT )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
const ObjectImplHelper<DEFAULT_PROPERTY_COUNT> PROPERTY_BUFFER_IMPL = { DEFAULT_PROPERTY_DETAILS };
alignment = PropertyImplementationTypeAlignment< Property::INTEGER >::VALUE;
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- alignment = PropertyImplementationTypeAlignment< Property::UNSIGNED_INTEGER >::VALUE;
- break;
- }
case Property::FLOAT:
{
alignment = PropertyImplementationTypeAlignment< Property::FLOAT >::VALUE;
{
case Dali::PropertyBuffer::Property::SIZE:
{
- SetSize( propertyValue.Get<unsigned int>() );
+ SetSize( propertyValue.Get<int>() );
break;
}
case Dali::PropertyBuffer::Property::BUFFER_FORMAT:
{
case Dali::PropertyBuffer::Property::SIZE:
{
- value = static_cast<unsigned int>( GetSize() ); // @todo MESH_REWORK Add a size_t type to PropertyValue
+ value = static_cast<int>( GetSize() );
break;
}
case Dali::PropertyBuffer::Property::BUFFER_FORMAT:
size = sizeof( PropertyImplementationType< Property::INTEGER >::Type );
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- size = sizeof( PropertyImplementationType< Property::UNSIGNED_INTEGER >::Type );
- break;
- }
case Property::FLOAT:
{
size = sizeof( PropertyImplementationType< Property::FLOAT >::Type );
template<> struct PropertyImplementationType< Property::BOOLEAN > { typedef bool Type; };
template<> struct PropertyImplementationType< Property::FLOAT > { typedef float Type; };
template<> struct PropertyImplementationType< Property::INTEGER > { typedef int Type; };
-template<> struct PropertyImplementationType< Property::UNSIGNED_INTEGER > { typedef unsigned int Type; };
template<> struct PropertyImplementationType< Property::VECTOR2 > { typedef Vector2 Type; };
template<> struct PropertyImplementationType< Property::VECTOR3 > { typedef Vector3 Type; };
template<> struct PropertyImplementationType< Property::VECTOR4 > { typedef Vector4 Type; };
static const bool DUMMY_BOOLEAN_VALUE( false );
static const float DUMMY_FLOAT_VALUE( 0.0f );
static const int DUMMY_INTEGER_VALUE( 0 );
-static const unsigned int DUMMY_UNSIGNED_INTEGER_VALUE( 0u );
static const Vector2 DUMMY_VECTOR2_VALUE( 0.0f, 0.0f );
static const Vector3 DUMMY_VECTOR3_VALUE( 0.0f, 0.0f, 0.0f );
static const Vector4 DUMMY_VECTOR4_VALUE( 0.0f, 0.0f, 0.0f, 0.0f );
}
/**
- * Retrieve an integer value.
- * @pre GetType() returns Property::UNSIGNED_INTEGER.
- * @param[in] bufferIndex The buffer to read from.
- * @return The integer value.
- */
- virtual const unsigned int& GetUnsignedInteger( BufferIndex bufferIndex ) const
- {
- DALI_ASSERT_ALWAYS( false && "Property type mismatch" );
- return DUMMY_UNSIGNED_INTEGER_VALUE;
- }
-
- /**
* Retrieve a float value.
* @pre GetType() returns Property::FLOAT.
* @param[in] bufferIndex The buffer to read from.
}
/**
- * Retrieve an unsigned integer input for a constraint function.
- * @note For inherited properties, this method should be overriden to return the value
- * from the previous frame i.e. not from the current update buffer.
- * @pre GetType() returns Property::UNSIGNED_INTEGER.
- * @param[in] updateBufferIndex The current update buffer index.
- * @return The integer value.
- */
- virtual const unsigned int& GetConstraintInputUnsignedInteger( BufferIndex updateBufferIndex ) const
- {
- return GetUnsignedInteger( updateBufferIndex );
- }
-
- /**
* Retrieve a float input for a constraint function.
* @note For inherited properties, this method should be overriden to return the value
* from the previous frame i.e. not from the current update buffer.
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- debugStream << GetUnsignedInteger( bufferIndex );
- break;
- }
-
case Property::FLOAT:
{
debugStream << GetFloat( bufferIndex );
{
/**
- * |name |type |writable|animatable|constraint-input|enum for index-checking|
+ * |name |type |writable|animatable|constraint-input|enum for index-checking|
*/
DALI_PROPERTY_TABLE_BEGIN
-DALI_PROPERTY( "program", MAP, true, false, false, Dali::Shader::Property::PROGRAM )
-DALI_PROPERTY( "shader-hints", UNSIGNED_INTEGER, true, false, true, Dali::Shader::Property::SHADER_HINTS )
+DALI_PROPERTY( "program", MAP, true, false, false, Dali::Shader::Property::PROGRAM )
+DALI_PROPERTY( "shader-hints", INTEGER, true, false, true, Dali::Shader::Property::SHADER_HINTS )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
const ObjectImplHelper<DEFAULT_PROPERTY_COUNT> SHADER_IMPL = { DEFAULT_PROPERTY_DETAILS };
break;
}
case Property::INTEGER:
- case Property::UNSIGNED_INTEGER:
{
type = GL_SHORT;
break;
break;
}
case Property::INTEGER:
- case Property::UNSIGNED_INTEGER:
{
size = 2u;
break;
program.SetUniform1i( loc, property.GetInteger( bufferIndex ) );
break;
}
- case Property::UNSIGNED_INTEGER :
- {
- program.SetUniform1i( loc, property.GetUnsignedInteger( bufferIndex ) );
- break;
- }
case Property::FLOAT :
{
program.SetUniform1f( loc, property.GetFloat( bufferIndex ) );
int mTarget;
};
-struct AnimateByUnsignedInteger : public AnimatorFunctionBase
-{
- AnimateByUnsignedInteger(const unsigned int& relativeValue)
- : mRelative(relativeValue)
- {
- }
-
- float operator()(float alpha, const unsigned int& property)
- {
- return static_cast<unsigned int>(property + mRelative * alpha + 0.5f );
- }
-
- unsigned int mRelative;
-};
-
-struct AnimateToUnsignedInteger : public AnimatorFunctionBase
-{
- AnimateToUnsignedInteger(const unsigned int& targetValue)
- : mTarget(targetValue)
- {
- }
-
- float operator()(float alpha, const unsigned int& property)
- {
- return static_cast<unsigned int>(property + ((mTarget - property) * alpha) + 0.5f);
- }
-
- unsigned int mTarget;
-};
-
struct AnimateByFloat : public AnimatorFunctionBase
{
AnimateByFloat(const float& relativeValue)
Interpolation mInterpolation;
};
-struct KeyFrameUnsignedIntegerFunctor : public AnimatorFunctionBase
-{
- KeyFrameUnsignedIntegerFunctor(KeyFrameUnsignedIntegerPtr keyFrames, Interpolation interpolation)
- : mKeyFrames(keyFrames),mInterpolation(interpolation)
- {
- }
-
- float operator()(float progress, const unsigned int& property)
- {
- if(mKeyFrames->IsActive(progress))
- {
- return mKeyFrames->GetValue(progress, mInterpolation);
- }
- return property;
- }
-
- KeyFrameUnsignedIntegerPtr mKeyFrames;
- Interpolation mInterpolation;
-};
-
struct KeyFrameNumberFunctor : public AnimatorFunctionBase
{
KeyFrameNumberFunctor(KeyFrameNumberPtr keyFrames, Interpolation interpolation)
};
/**
- * An unsigned integer animatable property of a scene-graph object.
- */
-template <>
-class AnimatableProperty<unsigned int> : public AnimatablePropertyBase
-{
-public:
-
- /**
- * Create an animatable property.
- * @param [in] initialValue The initial value of the property.
- */
- AnimatableProperty( unsigned int initialValue )
- : mValue( initialValue ),
- mBaseValue( initialValue )
- {
- }
-
- /**
- * Virtual destructor.
- */
- virtual ~AnimatableProperty()
- {
- }
-
- /**
- * @copydoc Dali::Internal::SceneGraph::PropertyBase::GetType()
- */
- virtual Dali::Property::Type GetType() const
- {
- return Dali::PropertyTypes::Get<unsigned int>();
- }
-
- /**
- * @copydoc Dali::Internal::SceneGraph::PropertyBase::ResetToBaseValue()
- */
- virtual void ResetToBaseValue(BufferIndex updateBufferIndex)
- {
- if (CLEAN_FLAG != mDirtyFlags)
- {
- mValue[updateBufferIndex] = mBaseValue;
-
- mDirtyFlags = ( mDirtyFlags >> 1 );
- }
- }
-
- /**
- * @copydoc Dali::Internal::PropertyInputImpl::GetUnsignedInteger()
- */
- virtual const unsigned int& GetUnsignedInteger( BufferIndex bufferIndex ) const
- {
- return mValue[ bufferIndex ];
- }
-
- /**
- * Set the property value. This will only persist for the current frame; the property
- * will be reset with the base value, at the beginning of the next frame.
- * @param[in] bufferIndex The buffer to write.
- * @param[in] value The new property value.
- */
- void Set(BufferIndex bufferIndex, unsigned int value)
- {
- mValue[bufferIndex] = value;
-
- OnSet();
- }
-
- /**
- * Change the property value by a relative amount.
- * @param[in] bufferIndex The buffer to write.
- * @param[in] delta The property will change by this amount.
- */
- void SetRelative(BufferIndex bufferIndex, unsigned int delta)
- {
- mValue[bufferIndex] = mValue[bufferIndex] + delta;
-
- OnSet();
- }
-
- /**
- * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
- */
- unsigned int& Get(size_t bufferIndex)
- {
- return mValue[bufferIndex];
- }
-
- /**
- * @copydoc Dali::SceneGraph::AnimatableProperty::Get()
- */
- const unsigned int& Get(size_t bufferIndex) const
- {
- return mValue[bufferIndex];
- }
-
- /**
- * Retrieve the property value.
- * @param[in] bufferIndex The buffer to read.
- * @return The property value.
- */
- unsigned int& operator[](size_t bufferIndex)
- {
- return mValue[bufferIndex];
- }
-
- /**
- * Retrieve the property value.
- * @param[in] bufferIndex The buffer to read.
- * @return The property value.
- */
- const unsigned int& operator[](size_t bufferIndex) const
- {
- return mValue[bufferIndex];
- }
-
- /**
- * Set both the property value & base value.
- * @param[in] bufferIndex The buffer to write for the property value.
- * @param[in] value The new property value.
- */
- void Bake(BufferIndex bufferIndex, unsigned int value)
- {
- mValue[bufferIndex] = value;
- mBaseValue = mValue[bufferIndex];
-
- OnBake();
- }
-
- /**
- * Change the property value & base value by a relative amount.
- * @param[in] bufferIndex The buffer to write for the local property value.
- * @param[in] delta The property will change by this amount.
- */
- void BakeRelative(BufferIndex bufferIndex, unsigned int delta)
- {
- mValue[bufferIndex] = mValue[bufferIndex] + delta;
- mBaseValue = mValue[bufferIndex];
-
- OnBake();
- }
-
- /**
- * Sets both double-buffered values & the base value.
- * This should only be used when the owning object has not been connected to the scene-graph.
- * @param[in] value The new property value.
- */
- void SetInitial(const unsigned int& value)
- {
- mValue[0] = value;
- mValue[1] = mValue[0];
- mBaseValue = mValue[0];
- }
-
- /**
- * Change both double-buffered values & the base value by a relative amount.
- * This should only be used when the owning object has not been connected to the scene-graph.
- * @param[in] delta The property will change by this amount.
- */
- void SetInitialRelative(const unsigned int& delta)
- {
- mValue[0] = mValue[0] + delta;
- mValue[1] = mValue[0];
- mBaseValue = mValue[0];
- }
-
-private:
-
- // Undefined
- AnimatableProperty(const AnimatableProperty& property);
-
- // Undefined
- AnimatableProperty& operator=(const AnimatableProperty& rhs);
-
-private:
- DoubleBuffered<unsigned int> mValue; ///< The double-buffered property value
- unsigned int mBaseValue; ///< Reset to this base value at the beginning of each frame
-};
-
-
-/**
* An float animatable property of a scene-graph object.
*/
template <>
};
template<>
-class DoubleBufferedProperty<unsigned int> : public DoubleBufferedPropertyImpl<unsigned int>
-{
-public:
- /**
- * Constructor
- */
- DoubleBufferedProperty( unsigned int value ) : DoubleBufferedPropertyImpl( value ) {};
-
- /**
- * copydoc PropertyInputImpl::GetUnsignedInteger
- */
- virtual const unsigned int& GetUnsignedInteger( BufferIndex bufferIndex ) const
- {
- return mValue[bufferIndex];
- }
-};
-
-template<>
class DoubleBufferedProperty<float> : public DoubleBufferedPropertyImpl<float>
{
public:
function = LessThan::EvalInteger;
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- function = LessThan::EvalUnsignedInteger;
- break;
- }
case Property::FLOAT:
{
function = LessThan::EvalFloat;
return (value.GetInteger() < arg0);
}
-bool LessThan::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
-{
- const unsigned int arg0 = arg[0];
- return (value.GetUnsignedInteger() < arg0);
-}
-
bool LessThan::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float arg0 = arg[0];
function = GreaterThan::EvalInteger;
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- function = GreaterThan::EvalUnsignedInteger;
- break;
- }
case Property::FLOAT:
{
function = GreaterThan::EvalFloat;
return (value.GetInteger() > arg0);
}
-bool GreaterThan::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
-{
- const unsigned int arg0 = arg[0];
- return (value.GetUnsignedInteger() > arg0);
-}
-
bool GreaterThan::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float arg0 = arg[0];
function = Inside::EvalInteger;
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- function = Inside::EvalUnsignedInteger;
- break;
- }
case Property::FLOAT:
{
function = Inside::EvalFloat;
return ( (valueInteger > arg[0]) && (valueInteger < arg[1]) );
}
-bool Inside::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
-{
- const unsigned int valueUInt = value.GetUnsignedInteger();
- return ( (valueUInt > arg[0]) && (valueUInt < arg[1]) );
-}
-
bool Inside::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float valueFloat = value.GetFloat();
function = Outside::EvalInteger;
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- function = Outside::EvalUnsignedInteger;
- break;
- }
case Property::FLOAT:
{
function = Outside::EvalFloat;
return ( (valueInteger < arg[0]) || (valueInteger > arg[1]) );
}
-bool Outside::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
-{
- const unsigned int valueUInt = value.GetUnsignedInteger();
- return ( (valueUInt < arg[0]) || (valueUInt > arg[1]) );
-}
-
bool Outside::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float valueFloat = value.GetFloat();
static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if unsigned integer is LessThan
- * @param[in] value The value being examined.
- * @param[in] arg The supplied arguments for the condition.
- * @return Condition result (true if condition met, false if not)
- */
- static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
-
- /**
* Checks if float is LessThan
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if unsigned integer is GreaterThan
- * @param[in] value The value being examined.
- * @param[in] arg The supplied arguments for the condition.
- * @return Condition result (true if condition met, false if not)
- */
- static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
-
- /**
* Checks if float is GreaterThan
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if unsigned integer is Inside
- * @param[in] value The value being examined.
- * @param[in] arg The supplied arguments for the condition.
- * @return Condition result (true if condition met, false if not)
- */
- static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
-
- /**
* Checks if float is Inside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if unsigned integer is Outside
- * @param[in] value The value being examined.
- * @param[in] arg The supplied arguments for the condition.
- * @return Condition result (true if condition met, false if not)
- */
- static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
-
- /**
* Checks if float is Outside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
function = EvalInteger;
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- function = EvalUnsignedInteger;
- break;
- }
case Property::FLOAT:
{
function = EvalFloat;
return Evaluate( propertyValue, arg );
}
-bool Step::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
-{
- const float propertyValue = static_cast<float>( value.GetUnsignedInteger() );
- return Evaluate( propertyValue, arg );
-}
-
bool Step::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float propertyValue = value.GetFloat();
static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if unsigned integer is Outside
- * @param[in] value The value being examined.
- * @param[in] arg The supplied arguments for the condition.
- * @return Condition result (true if condition met, false if not)
- */
- static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
-
- /**
* Checks if float is Outside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
function = EvalInteger;
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- function = EvalUnsignedInteger;
- break;
- }
case Property::FLOAT:
{
function = EvalFloat;
return Evaluate( propertyValue, arg );
}
-bool VariableStep::EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
-{
- const float propertyValue = static_cast<float>( value.GetUnsignedInteger() );
- return Evaluate( propertyValue, arg );
-}
-
bool VariableStep::EvalFloat( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg )
{
const float propertyValue = value.GetFloat();
static bool EvalInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
/**
- * Checks if unsigned integer is Outside
- * @param[in] value The value being examined.
- * @param[in] arg The supplied arguments for the condition.
- * @return Condition result (true if condition met, false if not)
- */
- static bool EvalUnsignedInteger( const Dali::PropertyInput& value, PropertyNotification::RawArgumentContainer& arg );
-
- /**
* Checks if float is Outside
* @param[in] value The value being examined.
* @param[in] arg The supplied arguments for the condition.
DoubleBuffered< OwnerPointer<PropertyBufferDataProvider::BufferType> > mBufferData; ///< Data
DoubleBuffered< bool > mDataChanged; ///< Flag to know if data has changed in a frame
- DoubleBufferedProperty<unsigned int> mSize; ///< Number of Elements in the buffer
+ DoubleBufferedProperty<int> mSize; ///< Number of Elements in the buffer
};
inline void SetFormatMessage( EventThreadServices& eventThreadServices,
mVWrapMode( Dali::Sampler::CLAMP_TO_EDGE ),
mAffectsTransparency( true ),
mTextureUnitUniformName( textureUnitUniformName ),
- mTextureId( 0u ),
mFullyOpaque(true)
{
+ mTextureId[ 0 ] = mTextureId[ 1 ] = 0u;
}
Sampler::~Sampler()
{
if( mTextureId[bufferIndex] != textureId )
{
- mTextureId.Set( bufferIndex, textureId );
+ mTextureId[ bufferIndex ] = textureId;
mConnectionObservers.ConnectionsChanged(*this);
}
}
void Sampler::ResetDefaultProperties( BufferIndex bufferIndex )
{
- mTextureId.CopyPrevious( bufferIndex );
+ mTextureId[ bufferIndex ] = mTextureId[ 1 - bufferIndex ];
mMinFilter.CopyPrevious( bufferIndex );
mMagFilter.CopyPrevious( bufferIndex );
mUWrapMode.CopyPrevious( bufferIndex );
private:
std::string mTextureUnitUniformName; ///< The name of the uniform of the texture unit
- DoubleBufferedProperty<unsigned int> mTextureId;
+ Integration::ResourceId mTextureId[ 2 ]; //< double buffered
ConnectionChangePropagator mConnectionObservers; ///< Connection observers that will be informed when textures change.
bool mFullyOpaque; // Update only flag - no need for double buffering
};
* - Property::BOOLEAN
* - Property::FLOAT
* - Property::INTEGER
- * - Property::UNSIGNED_INTEGER
* - Property::VECTOR2
* - Property::VECTOR3
* - Property::VECTOR4
* - Property::BOOLEAN
* - Property::FLOAT
* - Property::INTEGER
- * - Property::UNSIGNED_INTEGER
* - Property::VECTOR2
* - Property::VECTOR3
* - Property::VECTOR4
virtual const int& GetInteger() const = 0;
/**
- * @brief Retrieve an integer value.
- *
- * @pre GetType() returns Property::UNSIGNED_INTEGER.
- * @return The integer value.
- */
- virtual const unsigned int& GetUnsignedInteger() const = 0;
-
- /**
* @brief Retrieve a Vector2 value.
*
* @pre GetType() returns Property::VECTOR2.
"BOOLEAN",
"FLOAT",
"INTEGER",
- "UNSIGNED_INTEGER",
"VECTOR2",
"VECTOR3",
"VECTOR4",
namespace PropertyTypes
{
-DALI_EXPORT_API
-const char* GetName(Property::Type type)
+DALI_EXPORT_API const char* GetName(Property::Type type)
{
if (type < PROPERTY_TYPE_NAMES_COUNT )
{
template <>
inline Property::Type Get<int>() { return Property::INTEGER; }
template <>
-inline Property::Type Get<unsigned int>() { return Property::UNSIGNED_INTEGER; }
-template <>
inline Property::Type Get<Vector2>() { return Property::VECTOR2; }
template <>
inline Property::Type Get<Vector3>() { return Property::VECTOR3; }
namespace
{
/**
- * Helper to check if the property value can be read as int/unsigned int/bool
+ * Helper to check if the property value can be read as int/bool
*/
inline bool IsIntegerType( Property::Type type )
{
- return ( Property::BOOLEAN == type )||( Property::INTEGER == type )||(Property::UNSIGNED_INTEGER == type );
+ return ( Property::BOOLEAN == type )||( Property::INTEGER == type );
}
}
integerValue( integerValue )
{ }
- Impl( unsigned int unsignedIntegerValue )
- : type( Property::UNSIGNED_INTEGER ),
- unsignedIntegerValue( unsignedIntegerValue )
- { }
-
Impl( const Vector2& vectorValue )
: type( Property::VECTOR2 ),
vector2Value( new Vector2( vectorValue ) )
case Property::NONE : // FALLTHROUGH
case Property::BOOLEAN : // FALLTHROUGH
case Property::FLOAT : // FALLTHROUGH
- case Property::INTEGER : // FALLTHROUGH
- case Property::UNSIGNED_INTEGER :
+ case Property::INTEGER :
{
break; // nothing to do
}
{
int integerValue;
float floatValue;
- unsigned int unsignedIntegerValue;
// must use pointers for any class value pre c++ 11
Vector2* vector2Value;
Vector3* vector3Value;
{
}
-Property::Value::Value( unsigned int unsignedIntegerValue )
-: mImpl( new Impl( unsignedIntegerValue ) )
-{
-}
-
Property::Value::Value( const Vector2& vectorValue )
: mImpl( new Impl( vectorValue ) )
{
mImpl = new Impl( 0 );
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- mImpl = new Impl( 0U );
- break;
- }
case Property::VECTOR2:
{
mImpl = new Impl( Vector2::ZERO );
mImpl->integerValue = value.mImpl->integerValue;
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- mImpl->unsignedIntegerValue = value.mImpl->unsignedIntegerValue;
- break;
- }
case Property::VECTOR2:
{
*mImpl->vector2Value = *value.mImpl->vector2Value; // type cannot change in mImpl so vector is allocated
newImpl = new Impl( value.mImpl->integerValue );
break;
}
- case Property::UNSIGNED_INTEGER:
- {
- newImpl = new Impl( value.mImpl->unsignedIntegerValue );
- break;
- }
case Property::VECTOR2:
{
newImpl = new Impl( *value.mImpl->vector2Value ); // type cannot change in mImpl so vector is allocated
return converted;
}
-bool Property::Value::Get( unsigned int& unsignedIntegerValue ) const
-{
- bool converted = false;
- if( mImpl && IsIntegerType( mImpl->type ) )
- {
- unsignedIntegerValue = mImpl->unsignedIntegerValue;
- converted = true;
- }
- return converted;
-}
-
bool Property::Value::Get( Vector2& vectorValue ) const
{
bool converted = false;
stream << impl.integerValue;
break;
}
- case Dali::Property::UNSIGNED_INTEGER:
- {
- stream << impl.unsignedIntegerValue;
- break;
- }
case Dali::Property::VECTOR2:
{
stream << *impl.vector2Value;
Value( int integerValue );
/**
- * @brief Create an unsigned integer property value.
- *
- * @param [in] unsignedIntegerValue An unsigned integer value.
- */
- Value( unsigned int unsignedIntegerValue );
-
- /**
* @brief Create a float property value.
*
* @param [in] floatValue A floating-point value.
bool Get( int& integerValue ) const;
/**
- * @brief Retrieve an unsigned integer value.
- *
- * @pre GetType() returns Property::UNSIGNED_INTEGER.
- * @param [out] unsignedIntegerValue On return, an unsigned integer value.
- * @return true if the value is successfully retrieved, false if the type is not convertible
- */
- bool Get( unsigned int& unsignedIntegerValue ) const;
-
- /**
* @brief Retrieve an integer rectangle.
*
* @pre GetType() returns Property::RECTANGLE.
BOOLEAN, ///< A boolean type
FLOAT, ///< A float type
INTEGER, ///< An integer type
- UNSIGNED_INTEGER,///< An unsigned integer type
VECTOR2, ///< a vector array of size=2 with float precision
VECTOR3, ///< a vector array of size=3 with float precision
VECTOR4, ///< a vector array of size=4 with float precision