/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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/handle.h>
// INTERNAL INCLUDES
+#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/object/property-conditions.h>
#include <dali/public-api/object/property-notification.h>
+#include <dali/internal/event/animation/constraint-impl.h>
#include <dali/internal/event/common/object-impl.h>
#include <dali/integration-api/debug.h>
namespace Dali
{
-Handle::Handle(Dali::Internal::Object* handle)
- : BaseHandle(handle)
+Handle::Handle( Dali::Internal::Object* handle )
+: BaseHandle(handle)
{
}
+
Handle::Handle()
{
}
+Handle Handle::New()
+{
+ return Handle( Internal::Object::New().Get() );
+}
+
Handle::~Handle()
{
}
-Handle::Handle(const Handle& handle)
- : BaseHandle(handle)
+Handle::Handle( const Handle& handle )
+: BaseHandle( handle )
{
}
-Handle& Handle::operator=(const Handle& rhs)
+Handle& Handle::operator=( const Handle& rhs )
{
if( this != &rhs )
{
}
-bool Handle::Supports(Capability capability) const
+bool Handle::Supports( Capability capability ) const
{
return GetImplementation(*this).Supports( capability );
}
-unsigned int Handle::GetPropertyCount() const
+uint32_t Handle::GetPropertyCount() const
{
return GetImplementation(*this).GetPropertyCount();
}
-const std::string& Handle::GetPropertyName(Property::Index index) const
+std::string Handle::GetPropertyName( Property::Index index ) const
{
return GetImplementation(*this).GetPropertyName( index );
}
-Property::Index Handle::GetPropertyIndex(std::string name) const
+Property::Index Handle::GetPropertyIndex( const std::string& name ) const
{
return GetImplementation(*this).GetPropertyIndex( name );
}
-bool Handle::IsPropertyWritable(Property::Index index) const
+bool Handle::IsPropertyWritable( Property::Index index ) const
{
return GetImplementation(*this).IsPropertyWritable( index );
}
-bool Handle::IsPropertyAnimatable(Property::Index index) const
+bool Handle::IsPropertyAnimatable( Property::Index index ) const
{
return GetImplementation(*this).IsPropertyAnimatable( index );
}
-bool Handle::IsPropertyAConstraintInput(Property::Index index) const
+bool Handle::IsPropertyAConstraintInput( Property::Index index ) const
{
return GetImplementation(*this).IsPropertyAConstraintInput( index );
}
-Property::Type Handle::GetPropertyType(Property::Index index) const
+Property::Type Handle::GetPropertyType( Property::Index index ) const
{
return GetImplementation(*this).GetPropertyType( index );
}
-void Handle::SetProperty(Property::Index index, Property::Value propertyValue)
+void Handle::SetProperty( Property::Index index, const Property::Value& propertyValue )
{
GetImplementation(*this).SetProperty( index, propertyValue );
}
-Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue)
+Property::Index Handle::RegisterProperty( const std::string& name, const Property::Value& propertyValue )
{
return GetImplementation(*this).RegisterProperty( name, propertyValue );
}
-Property::Index Handle::RegisterProperty(std::string name, Property::Value propertyValue, Property::AccessMode accessMode)
+Property::Index Handle::RegisterProperty( const std::string& name, const Property::Value& propertyValue, Property::AccessMode accessMode )
{
return GetImplementation(*this).RegisterProperty( name, propertyValue, accessMode );
}
-Property::Value Handle::GetProperty(Property::Index index) const
+Property::Value Handle::GetProperty( Property::Index index ) const
{
return GetImplementation(*this).GetProperty( index );
}
+Property::Value Handle::GetCurrentProperty( Property::Index index ) const
+{
+ return GetImplementation(*this).GetCurrentProperty( index );
+}
+
void Handle::GetPropertyIndices( Property::IndexContainer& indices ) const
{
GetImplementation(*this).GetPropertyIndices( indices );
}
-Dali::PropertyNotification Handle::AddPropertyNotification(Property::Index index,
- const PropertyCondition& condition)
+Dali::PropertyNotification Handle::AddPropertyNotification( Property::Index index,
+ const PropertyCondition& condition )
{
return GetImplementation(*this).AddPropertyNotification( index, -1, condition );
}
-Dali::PropertyNotification Handle::AddPropertyNotification(Property::Index index,
- int componentIndex,
- const PropertyCondition& condition)
+Dali::PropertyNotification Handle::AddPropertyNotification( Property::Index index,
+ int componentIndex,
+ const PropertyCondition& condition )
{
return GetImplementation(*this).AddPropertyNotification( index, componentIndex, condition );
}
-void Handle::RemovePropertyNotification(Dali::PropertyNotification propertyNotification)
+void Handle::RemovePropertyNotification( Dali::PropertyNotification propertyNotification )
{
GetImplementation(*this).RemovePropertyNotification( propertyNotification );
}
GetImplementation(*this).RemovePropertyNotifications();
}
+void Handle::RemoveConstraints()
+{
+ GetImplementation(*this).RemoveConstraints();
+}
+
+void Handle::RemoveConstraints( uint32_t tag )
+{
+ GetImplementation(*this).RemoveConstraints( tag );
+}
+
+namespace WeightObject
+{
+
+const Property::Index WEIGHT = PROPERTY_CUSTOM_START_INDEX;
+
+Handle New()
+{
+ Handle handle = Handle::New();
+
+ handle.RegisterProperty( "weight", 0.0f );
+
+ return handle;
+}
+
+} // namespace WeightObject
+
} // namespace Dali