// INTERNAL INCLUDES
#include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/object/type-registry.h>
#include <dali/internal/common/event-to-update.h>
#include <dali/internal/event/actors/actor-impl.h>
#include <dali/internal/event/actors/camera-actor-impl.h>
namespace // For internal properties
{
-const std::string DEFAULT_PROPERTY_NAMES[] =
+// Signals
+
+const char* const SIGNAL_FINISHED = "finished";
+
+TypeRegistration mType( typeid( Dali::RenderTask ), typeid( Dali::BaseHandle ), NULL );
+
+SignalConnectorType signalConnector1( mType, SIGNAL_FINISHED, &RenderTask::DoConnectSignal );
+
+const char* DEFAULT_PROPERTY_NAMES[] =
{
"viewport-position",
"viewport-size",
"clear-color"
};
-const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_NAMES ) / sizeof( std::string );
+const int DEFAULT_PROPERTY_COUNT = sizeof( DEFAULT_PROPERTY_NAMES ) / sizeof( DEFAULT_PROPERTY_NAMES[0]);
const Property::Type DEFAULT_PROPERTY_TYPES[DEFAULT_PROPERTY_COUNT] =
{
}// unnamed namespace
-RenderTask::DefaultPropertyLookup* RenderTask::sDefaultPropertyLookup = NULL;
-
RenderTask* RenderTask::New( bool isSystemLevel )
{
RenderTask* task( new RenderTask( ThreadLocalStorage::Get().GetEventToUpdate(), isSystemLevel ) );
********************************************************************************
********************************************************************************/
-bool RenderTask::IsSceneObjectRemovable() const
-{
- return false; // The scene object is permanently "on stage" whilst this object is alive
-}
-
unsigned int RenderTask::GetDefaultPropertyCount() const
{
return DEFAULT_PROPERTY_COUNT;
}
}
-const std::string& RenderTask::GetDefaultPropertyName( Property::Index index ) const
+const char* RenderTask::GetDefaultPropertyName( Property::Index index ) const
{
if( index < DEFAULT_PROPERTY_COUNT )
{
}
else
{
- // index out of range..return empty string
- static const std::string INVALID_PROPERTY_NAME;
- return INVALID_PROPERTY_NAME;
+ return NULL;
}
}
{
Property::Index index = Property::INVALID_INDEX;
- // Lazy initialization of static sDefaultPropertyLookup
- if (!sDefaultPropertyLookup)
+ // Look for name in default properties
+ for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
{
- sDefaultPropertyLookup = new DefaultPropertyLookup();
-
- for (int i=0; i<DEFAULT_PROPERTY_COUNT; ++i)
+ if( 0 == strcmp( name.c_str(), DEFAULT_PROPERTY_NAMES[ i ] ) ) // dont want to convert rhs to string
{
- (*sDefaultPropertyLookup)[DEFAULT_PROPERTY_NAMES[i]] = i;
+ index = i;
+ break;
}
}
- DALI_ASSERT_DEBUG( NULL != sDefaultPropertyLookup );
-
- // Look for name in default properties
- DefaultPropertyLookup::const_iterator result = sDefaultPropertyLookup->find( name );
- if ( sDefaultPropertyLookup->end() != result )
- {
- index = result->second;
- }
return index;
}
bool RenderTask::IsDefaultPropertyWritable(Property::Index index) const
{
- return true;
+ return true; // all properties writable
}
bool RenderTask::IsDefaultPropertyAnimatable(Property::Index index) const
{
- return true;
+ return true; // all properties animatable
}
bool RenderTask::IsDefaultPropertyAConstraintInput( Property::Index index ) const
{
- return true;
+ return true; // all properties can be used as constraint input
}
Property::Type RenderTask::GetDefaultPropertyType(Property::Index index) const
SetClearColor( property.Get<Vector4>() );
break;
}
-
default:
{
- DALI_ASSERT_ALWAYS(false && "RenderTask property index out of range"); // should not come here
+ // nothing to do
break;
}
}
}
-void RenderTask::SetCustomProperty( Property::Index /*index*/, const CustomProperty& /*entry*/, const Property::Value& /*value*/ )
-{
- // TODO: support them, it doesn't hurt.
- DALI_ASSERT_ALWAYS( 0 && "RenderTask does not support custom properties");
-}
-
Property::Value RenderTask::GetDefaultProperty(Property::Index index) const
{
Property::Value value;
return value;
}
-void RenderTask::InstallSceneObjectProperty( SceneGraph::PropertyBase& newProperty, const std::string& name, unsigned int index )
-{
- // TODO: support them, it doesn't hurt.
- DALI_ASSERT_ALWAYS( 0 && "RenderTask does not support custom properties" );
-}
-
const SceneGraph::PropertyOwner* RenderTask::GetSceneObject() const
{
return mSceneObject;
{
DALI_LOG_INFO(gLogRender, Debug::General, "RenderTask::EmitSignalFinish(this:%p)\n", this);
- if( !mSignalFinishedV2.Empty() )
+ if( !mSignalFinished.Empty() )
{
Dali::RenderTask handle( this );
- mSignalFinishedV2.Emit(handle );
+ mSignalFinished.Emit(handle );
}
}
-Dali::RenderTask::RenderTaskSignalV2& RenderTask::FinishedSignal()
+Dali::RenderTask::RenderTaskSignalType& RenderTask::FinishedSignal()
{
- return mSignalFinishedV2;
+ return mSignalFinished;
}
bool RenderTask::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
bool connected( true );
RenderTask* renderTask = dynamic_cast<RenderTask*>(object);
- if ( Dali::RenderTask::SIGNAL_FINISHED == signalName )
+ if ( 0 == strcmp( signalName.c_str(), SIGNAL_FINISHED ) )
{
renderTask->FinishedSignal().Connect( tracker, functor );
}
}
}
-void RenderTask::Connector::SceneObjectAdded( ProxyObject& proxy )
+void RenderTask::Connector::SceneObjectAdded( Object& object )
{
UpdateRenderTask();
}
-void RenderTask::Connector::SceneObjectRemoved( ProxyObject& proxy )
+void RenderTask::Connector::SceneObjectRemoved( Object& object )
{
UpdateRenderTask();
}
-void RenderTask::Connector::ProxyDestroyed( ProxyObject& proxy )
+void RenderTask::Connector::ObjectDestroyed( Object& object )
{
mActor = NULL;