const char* const SIGNAL_ON_SCENE = "onScene";
const char* const SIGNAL_OFF_SCENE = "offScene";
const char* const SIGNAL_ON_RELAYOUT = "onRelayout";
-const char* const SIGNAL_TOUCH = "touch";
+const char* const SIGNAL_TOUCHED = "touched";
const char* const SIGNAL_VISIBILITY_CHANGED = "visibilityChanged";
const char* const SIGNAL_LAYOUT_DIRECTION_CHANGED = "layoutDirectionChanged";
const char* const SIGNAL_CHILD_ADDED = "childAdded";
SignalConnectorType signalConnector4( mType, SIGNAL_ON_SCENE, &Actor::DoConnectSignal );
SignalConnectorType signalConnector5( mType, SIGNAL_OFF_SCENE, &Actor::DoConnectSignal );
SignalConnectorType signalConnector6( mType, SIGNAL_ON_RELAYOUT, &Actor::DoConnectSignal );
-SignalConnectorType signalConnector7( mType, SIGNAL_TOUCH, &Actor::DoConnectSignal );
+SignalConnectorType signalConnector7( mType, SIGNAL_TOUCHED, &Actor::DoConnectSignal );
SignalConnectorType signalConnector8( mType, SIGNAL_VISIBILITY_CHANGED, &Actor::DoConnectSignal );
SignalConnectorType signalConnector9( mType, SIGNAL_LAYOUT_DIRECTION_CHANGED, &Actor::DoConnectSignal );
SignalConnectorType signalConnector10( mType, SIGNAL_CHILD_ADDED, &Actor::DoConnectSignal );
}
// Find the immediate Layer parent
- for( Actor* parent = mParent; !layer && parent != NULL; parent = parent->GetParent() )
+ for( Actor* parent = mParent; !layer && parent != nullptr; parent = parent->GetParent() )
{
if( parent->IsLayer() )
{
mChildren->erase( iter );
DALI_ASSERT_DEBUG( actor->GetParent() == this );
- actor->SetParent( NULL );
+ actor->SetParent( nullptr );
break;
}
uint32_t Actor::GetChildCount() const
{
- return ( NULL != mChildren ) ? static_cast<uint32_t>( mChildren->size() ) : 0; // only 4,294,967,295 children per actor
+ return ( nullptr != mChildren ) ? static_cast<uint32_t>( mChildren->size() ) : 0; // only 4,294,967,295 children per actor
}
ActorPtr Actor::GetChildAt( uint32_t index ) const
ActorPtr Actor::FindChildByName( const std::string& actorName )
{
- ActorPtr child = 0;
+ ActorPtr child = nullptr;
if( actorName == mName )
{
child = this;
ActorPtr Actor::FindChildById( const uint32_t id )
{
- ActorPtr child = 0;
+ ActorPtr child = nullptr;
if( id == GetId() )
{
child = this;
bool Actor::GetTouchRequired() const
{
- return !mTouchSignal.Empty() || mDerivedRequiresTouch;
+ return !mTouchedSignal.Empty();
}
bool Actor::GetHoverRequired() const
{
- return !mHoveredSignal.Empty() || mDerivedRequiresHover;
+ return !mHoveredSignal.Empty();
}
bool Actor::GetWheelEventRequired() const
{
- return !mWheelEventSignal.Empty() || mDerivedRequiresWheelEvent;
+ return !mWheelEventSignal.Empty();
}
bool Actor::IsHittable() const
{
// Likely scenario is that once gesture-data is created for this actor, the actor will require
// that gesture for its entire life-time so no need to destroy it until the actor is destroyed
- if( NULL == mGestureData )
+ if( nullptr == mGestureData )
{
mGestureData = new ActorGestureData;
}
return *mGestureData;
}
-bool Actor::IsGestureRequred( DevelGesture::Type type ) const
+bool Actor::IsGestureRequired( GestureType::Value type ) const
{
- return mGestureData && mGestureData->IsGestureRequred( type );
+ return mGestureData && mGestureData->IsGestureRequired( type );
}
bool Actor::EmitTouchEventSignal( const Dali::TouchEvent& touch )
{
bool consumed = false;
- if( !mTouchSignal.Empty() )
+ if( !mTouchedSignal.Empty() )
{
Dali::Actor handle( this );
- consumed = mTouchSignal.Emit( handle, touch );
+ consumed = mTouchedSignal.Emit( handle, touch );
}
return consumed;
consumed = mHoveredSignal.Emit( handle, event );
}
- if( !consumed )
- {
- // Notification for derived classes
- consumed = OnHoverEvent( event );
- }
-
return consumed;
}
-bool Actor::EmitWheelEventSignal( const WheelEvent& event )
+bool Actor::EmitWheelEventSignal( const Dali::WheelEvent& event )
{
bool consumed = false;
consumed = mWheelEventSignal.Emit( handle, event );
}
- if( !consumed )
- {
- // Notification for derived classes
- consumed = OnWheelEvent( event );
- }
-
return consumed;
}
}
}
-Dali::Actor::TouchEventSignalType& Actor::TouchSignal()
+Dali::Actor::TouchEventSignalType& Actor::TouchedSignal()
{
- return mTouchSignal;
+ return mTouchedSignal;
}
Dali::Actor::HoverSignalType& Actor::HoveredSignal()
{
actor->OnRelayoutSignal().Connect( tracker, functor );
}
- else if( 0 == signalName.compare( SIGNAL_TOUCH ) )
+ else if( 0 == signalName.compare( SIGNAL_TOUCHED ) )
{
- actor->TouchSignal().Connect( tracker, functor );
+ actor->TouchedSignal().Connect( tracker, functor );
}
else if( 0 == signalName.compare( SIGNAL_VISIBILITY_CHANGED ) )
{
Actor::Actor( DerivedType derivedType, const SceneGraph::Node& node )
: Object( &node ),
mScene( nullptr ),
- mParent( NULL ),
- mChildren( NULL ),
- mRenderers( NULL ),
- mParentOrigin( NULL ),
- mAnchorPoint( NULL ),
- mRelayoutData( NULL ),
- mGestureData( NULL ),
- mTouchSignal(),
+ mParent( nullptr ),
+ mChildren( nullptr ),
+ mRenderers( nullptr ),
+ mParentOrigin( nullptr ),
+ mAnchorPoint( nullptr ),
+ mRelayoutData( nullptr ),
+ mGestureData( nullptr ),
+ mTouchedSignal(),
mHoveredSignal(),
mWheelEventSignal(),
mOnSceneSignal(),
mSensitive( true ),
mLeaveRequired( false ),
mKeyboardFocusable( false ),
- mDerivedRequiresTouch( false ),
- mDerivedRequiresHover( false ),
- mDerivedRequiresWheelEvent( false ),
mOnSceneSignalled( false ),
mInsideOnSizeSet( false ),
mInheritPosition( true ),
ActorConstIter endIter = mChildren->end();
for( ActorIter iter = mChildren->begin(); iter != endIter; ++iter )
{
- (*iter)->SetParent( NULL );
+ (*iter)->SetParent( nullptr );
}
}
delete mChildren;
const PropertyBase* Actor::GetSceneObjectAnimatableProperty( Property::Index index ) const
{
- const PropertyBase* property( NULL );
+ const PropertyBase* property( nullptr );
switch( index )
{
const PropertyInputImpl* Actor::GetSceneObjectInputProperty( Property::Index index ) const
{
- const PropertyInputImpl* property( NULL );
+ const PropertyInputImpl* property( nullptr );
switch( index )
{
return componentIndex;
}
+bool Actor::IsAnimationPossible() const
+{
+ return OnScene();
+}
+
void Actor::SetParent( Actor* parent )
{
if( parent )
}
else // parent being set to NULL
{
- DALI_ASSERT_ALWAYS( mParent != NULL && "Actor should have a parent" );
+ DALI_ASSERT_ALWAYS( mParent != nullptr && "Actor should have a parent" );
- mParent = NULL;
+ mParent = nullptr;
if ( EventThreadServices::IsCoreRunning() && // Don't emit signals or send messages during Core destruction
OnScene() )