#include <cfloat>
// INTERNAL INCLUDES
+#include <dali/devel-api/actors/layer-devel.h>
#include <dali/public-api/common/dali-common.h>
#include <dali/public-api/common/constants.h>
#include <dali/public-api/events/touch-data.h>
#include <dali/public-api/math/vector3.h>
#include <dali/public-api/math/radian.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/devel-api/actors/actor-devel.h>
#include <dali/devel-api/scripting/scripting.h>
#include <dali/internal/common/internal-constants.h>
#include <dali/internal/event/common/event-thread-services.h>
DALI_PROPERTY( "maximumSize", VECTOR2, true, false, false, Dali::Actor::Property::MAXIMUM_SIZE )
DALI_PROPERTY( "inheritPosition", BOOLEAN, true, false, false, Dali::Actor::Property::INHERIT_POSITION )
DALI_PROPERTY( "clippingMode", STRING, true, false, false, Dali::Actor::Property::CLIPPING_MODE )
-DALI_PROPERTY( "batchParent", BOOLEAN, true, false, false, Dali::Actor::Property::BATCH_PARENT )
+DALI_PROPERTY( "batchParent", BOOLEAN, true, false, false, Dali::DevelActor::Property::BATCH_PARENT )
+DALI_PROPERTY( "siblingOrder", INTEGER, true, false, false, Dali::DevelActor::Property::SIBLING_ORDER )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
// Signals
return GetDimensionValue( values.GetVectorXY(), dimension );
}
+unsigned int GetDepthIndex( uint16_t depth, uint16_t siblingOrder )
+{
+ return depth * Dali::DevelLayer::TREE_DEPTH_MULTIPLIER + siblingOrder * Dali::DevelLayer::SIBLING_ORDER_MULTIPLIER;
+}
} // unnamed namespace
{
EnsureRelayoutData();
+ DALI_ASSERT_DEBUG( mRelayoutData && "mRelayoutData not created" );
+
mRelayoutData->relayoutEnabled = relayoutEnabled;
}
}
bool Actor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
{
bool connected( true );
- Actor* actor = dynamic_cast< Actor* >( object );
+ Actor* actor = static_cast< Actor* >( object ); // TypeRegistry guarantees that this is the correct type.
if( 0 == signalName.compare( SIGNAL_TOUCHED ) )
{
mName(),
mId( ++mActorCounter ), // actor ID is initialised to start from 1, and 0 is reserved
mDepth( 0u ),
+ mSiblingOrder(0u),
mIsRoot( ROOT_LAYER == derivedType ),
mIsLayer( LAYER == derivedType || ROOT_LAYER == derivedType ),
mIsOnStage( false ),
mIsOnStage = true;
mDepth = depth;
+ SetDepthIndexMessage( GetEventThreadServices(), *mNode, GetDepthIndex( mDepth, mSiblingOrder ) );
ConnectToSceneGraph();
break;
}
- case Dali::Actor::Property::BATCH_PARENT:
+ case Dali::DevelActor::Property::BATCH_PARENT:
{
bool value;
break;
}
+ case Dali::DevelActor::Property::SIBLING_ORDER:
+ {
+ int value;
+
+ if( property.Get( value ) )
+ {
+ if( static_cast<unsigned int>(value) != mSiblingOrder )
+ {
+ mSiblingOrder = value;
+ if( mIsOnStage )
+ {
+ SetDepthIndexMessage( GetEventThreadServices(), *mNode, GetDepthIndex( mDepth, mSiblingOrder ) );
+ }
+ }
+ }
+ break;
+ }
+
case Dali::Actor::Property::CLIPPING_MODE:
{
ClippingMode::Type convertedValue = mClippingMode;
default:
{
- DALI_ASSERT_ALWAYS( false && "Property type enumeration out of bounds" ); // should not come here
- break;
+ // nothing to do for other types
}
} // entry.GetType
}
{
Property::Value value;
+ if( index >= DEFAULT_PROPERTY_COUNT )
+ {
+ return value;
+ }
+
switch( index )
{
case Dali::Actor::Property::PARENT_ORIGIN:
break;
}
- case Dali::Actor::Property::BATCH_PARENT:
+ case Dali::DevelActor::Property::BATCH_PARENT:
{
value = mIsBatchParent;
break;
}
- case Dali::Actor::Property::CLIPPING_MODE:
+ case Dali::DevelActor::Property::SIBLING_ORDER:
{
- value = mClippingMode;
+ value = static_cast<int>(mSiblingOrder);
break;
}
- default:
+ case Dali::Actor::Property::CLIPPING_MODE:
{
- DALI_ASSERT_ALWAYS( false && "Actor Property index invalid" ); // should not come here
+ value = mClippingMode;
break;
}
}