END_TEST;
}
+
+int UtcDaliHandleSetTypeInfo(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( "Actor" );
+ DALI_TEST_CHECK( typeInfo );
+
+ Actor actor = Actor::DownCast(typeInfo.CreateInstance());
+ DALI_TEST_CHECK( actor );
+
+ DevelHandle::SetTypeInfo(actor, typeInfo);
+
+ TypeInfo newTypeInfo;
+ bool success = actor.GetTypeInfo( newTypeInfo );
+ DALI_TEST_CHECK( success );
+
+ DALI_TEST_CHECK(typeInfo.GetName() == newTypeInfo.GetName());
+ DALI_TEST_CHECK(typeInfo.GetBaseName() == newTypeInfo.GetBaseName());
+
+ END_TEST;
+}
+
// INTERNAL INCLUDES
#include <dali/public-api/object/property-key.h>
#include <dali/internal/event/common/object-impl.h>
+#include <dali/internal/event/common/type-info-impl.h>
namespace Dali
{
return GetImplementation( handle ).RegisterProperty( name, key, propertyValue );
}
+void SetTypeInfo( Handle& handle, const TypeInfo& typeInfo )
+{
+ GetImplementation( handle ).SetTypeInfo( &GetImplementation( typeInfo ) );
+}
+
} // namespace DevelHandle
} // namespace Dali
*/
DALI_IMPORT_API Property::Index RegisterProperty( Handle handle, Property::Index key, const std::string& name, const Property::Value& propertyValue );
+/**
+ * @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
+ *
+ * @param[in] handle The handle created by this TypeInfo.
+ * @param[in] typeInfo The TypeInfo that creates the handle.
+ */
+DALI_IMPORT_API void SetTypeInfo( Handle& handle, const TypeInfo& typeInfo );
+
} // namespace DevelHandle
} // namespace Dali