}
};
+BaseHandle CreateNamedActorType()
+{
+ Actor actor = Actor::New();
+ actor.SetName( "NamedActor" );
+ return actor;
+}
+
+TypeRegistration namedActorType( "MyNamedActor", typeid(Dali::Actor), CreateNamedActorType );
+PropertyRegistration namedActorPropertyOne( namedActorType, "prop-name", PROPERTY_REGISTRATION_START_INDEX, Property::BOOLEAN, &SetProperty, &GetProperty );
+
} // Anonymous namespace
DALI_TEST_EQUALS(true, data.voidFunctorCalled, TEST_LOCATION);
END_TEST;
}
+
+int UtcDaliTypeRegistryNamedType(void)
+{
+ TestApplication application;
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+
+ // Create a normal actor
+ BaseHandle actorHandle = typeRegistry.GetTypeInfo( "Actor" ).CreateInstance();
+ DALI_TEST_CHECK( actorHandle );
+ Actor actor( Actor::DownCast( actorHandle ) );
+ DALI_TEST_CHECK( actor );
+ unsigned int actorPropertyCount( actor.GetPropertyCount() );
+
+ // Create Named Actor Type
+ BaseHandle namedHandle = typeRegistry.GetTypeInfo( "MyNamedActor" ).CreateInstance();
+ DALI_TEST_CHECK( namedHandle );
+ Actor namedActor( Actor::DownCast( namedHandle ) );
+ DALI_TEST_CHECK( namedActor );
+ unsigned int namedActorPropertyCount( namedActor.GetPropertyCount() );
+
+ DALI_TEST_CHECK( namedActorPropertyCount > actorPropertyCount );
+ END_TEST;
+}
+
*/
void RemoveConstraints( unsigned int tag );
+public: // Called by TypeInfo
+
+ /**
+ * Called by TypeInfo to set the type-info that this proxy-object is created by.
+ * @param[in] typeInfo The TypeInfo that creates this proxy-object.
+ */
+ void SetTypeInfo( TypeInfo* typeInfo );
+
protected:
/**
// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <dali/internal/event/common/type-registry-impl.h>
+#include <dali/internal/event/common/proxy-object.h>
using std::find_if;
if(mCreate)
{
ret = mCreate();
+
+ if ( ret )
+ {
+ BaseObject& handle = ret.GetBaseObject();
+ ProxyObject *proxyObject = dynamic_cast<Internal::ProxyObject*>(&handle);
+
+ if ( proxyObject )
+ {
+ proxyObject->SetTypeInfo( this );
+ }
+ }
}
return ret;
}