#include <stdlib.h>
#include <dali/public-api/dali-core.h>
+#include <dali/devel-api/actors/custom-actor-devel.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali/integration-api/events/hover-event-integ.h>
#include <dali/integration-api/events/wheel-event-integ.h>
END_TEST;
}
+
+
+int utcDaliActorGetTypeInfo(void)
+{
+ TestApplication application;
+ tet_infoline( "Get the type info of a derived actor" );
+
+ Test::TestCustomActor customActor = Test::TestCustomActor::New();
+
+ Dali::TypeInfo typeInfo = Dali::DevelCustomActor::GetTypeInfo( customActor );
+
+ DALI_TEST_EQUALS( typeInfo.GetName(), std::string("TestCustomActor"), TEST_LOCATION );
+
+ END_TEST;
+}
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/actors/custom-actor-devel.h>
+#include <dali/internal/event/actors/custom-actor-internal.h>
+#include <dali/public-api/actors/custom-actor-impl.h>
+#include <dali/public-api/object/type-info.h>
+
+namespace Dali
+{
+
+namespace DevelCustomActor
+{
+
+const Dali::TypeInfo GetTypeInfo( CustomActor actor )
+{
+ return actor.GetImplementation().GetOwner()->GetTypeInfo();
+}
+
+} // namespace DevelCustomActor
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_CUSTOM_ACTOR_DEVEL_H
+#define DALI_CUSTOM_ACTOR_DEVEL_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/public-api/actors/custom-actor.h>
+
+namespace Dali
+{
+
+namespace DevelCustomActor
+{
+
+/**
+ * Get the type info for the CustomActor.
+ * This is useful when the type information has been set via
+ * DevelHandle::SetTypeInfo() for this object.
+ * @param[in] actor The custom actor of which to get the type information
+ * @return the TypeInfo of this actor
+ */
+DALI_IMPORT_API const Dali::TypeInfo GetTypeInfo( CustomActor actor );
+
+} // namespace DevelCustomActor
+
+} // namespace Dali
+
+#endif // DALI_CUSTOM_ACTOR_DEVEL_H
# Add devel source files here for DALi internal developer files used by Adaptor & Toolkit
devel_api_src_files = \
$(devel_api_src_dir)/actors/actor-devel.cpp \
+ $(devel_api_src_dir)/actors/custom-actor-devel.cpp \
$(devel_api_src_dir)/animation/animation-data.cpp \
$(devel_api_src_dir)/animation/animation-devel.cpp \
$(devel_api_src_dir)/animation/path-constrainer.cpp \
devel_api_core_actors_header_files = \
$(devel_api_src_dir)/actors/actor-devel.h \
+ $(devel_api_src_dir)/actors/custom-actor-devel.h \
$(devel_api_src_dir)/actors/layer-devel.h
devel_api_core_animation_header_files = \
// CLASS HEADER
#include <dali/internal/event/actors/custom-actor-internal.h>
+#include <dali/public-api/object/type-info.h>
namespace Dali
{
{
}
+Dali::TypeInfo CustomActor::GetTypeInfo()
+{
+ Dali::TypeInfo handle ( const_cast<Dali::Internal::TypeInfo*>(Object::GetTypeInfo()) );
+ return handle;
+}
+
} // namespace Internal
} // namespace Dali
return *mImpl;
}
+ /**
+ * Get the type info associated with this object.
+ *
+ * @return The type info
+ */
+ Dali::TypeInfo GetTypeInfo();
+
protected:
/**