X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fcontrol%2Fcontrol-data-impl.cpp;h=369c4097bb1e0187eafd6d5858a45ced67835a53;hb=76098a992229112954c7715a350856342b7576f9;hp=4f26d11436dd22692640d3016d6b35f395ef1d4d;hpb=be1b4b7c6c0e02c121a293cba7b22fa0353b3272;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/control/control-data-impl.cpp b/dali-toolkit/internal/controls/control/control-data-impl.cpp index 4f26d11..369c409 100644 --- a/dali-toolkit/internal/controls/control/control-data-impl.cpp +++ b/dali-toolkit/internal/controls/control/control-data-impl.cpp @@ -327,6 +327,9 @@ Control::Impl::Impl( Control& controlImpl ) mMargin( 0, 0, 0, 0 ), mPadding( 0, 0, 0, 0 ), mKeyEventSignal(), + mKeyInputFocusGainedSignal(), + mKeyInputFocusLostSignal(), + mResourceReadySignal(), mPinchGestureDetector(), mPanGestureDetector(), mTapGestureDetector(), @@ -486,9 +489,6 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base if( !visualReplaced ) // New registration entry { - // monitor when the visual resources are ready - StartObservingVisual( visual ); - // If we've not set the depth-index value, we have more than one visual and the visual does not have a depth index, then set it to be the highest if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) && ( mVisuals.Size() > 0 ) && @@ -525,12 +525,17 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base ( visualReplaced && enabled ) ) ; mVisuals.PushBack( newRegisteredVisual ); + Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual ); // Put on stage if enabled and the control is already on the stage - // Visual must be set on stage for the renderer to be created and the ResourceReady triggered. if( ( enabled == VisualState::ENABLED ) && self.OnStage() ) { - Toolkit::GetImplementation(visual).SetOnStage( self ); + visualImpl.SetOnStage( self ); + } + else if( visualImpl.IsResourceReady() ) // When not being staged, check if visual already 'ResourceReady' before it was Registered. ( Resource may have been loaded already ) + { + ResourceReady( visualImpl ); } + } DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::RegisterVisual() Registered %s(%d), enabled:%s\n", visual.GetName().c_str(), index, enabled?"true":"false" ); @@ -657,8 +662,11 @@ void Control::Impl::ResourceReady( Visual::Base& object) } } - // A visual is ready so control may need relayouting - mControlImpl.RelayoutRequest(); + // A visual is ready so control may need relayouting if staged + if ( self.OnStage() ) + { + mControlImpl.RelayoutRequest(); + } // Emit signal if all enabled visuals registered by the control are ready. if( IsResourceReady() ) @@ -686,6 +694,18 @@ bool Control::Impl::IsResourceReady() const return true; } +Toolkit::Visual::ResourceStatus Control::Impl::GetVisualResourceStatus( Property::Index index ) const +{ + RegisteredVisualContainer::Iterator iter; + if ( FindVisual( index, mVisuals, iter ) ) + { + const Toolkit::Visual::Base visual = (*iter)->visual; + const Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual ); + return visualImpl.GetResourceStatus( ); + } + + return Toolkit::Visual::ResourceStatus::PREPARING; +} Dali::Animation Control::Impl::CreateTransition( const Toolkit::TransitionData& handle ) { @@ -763,6 +783,15 @@ Dali::Animation Control::Impl::CreateTransition( const Toolkit::TransitionData& return transition; } +void Control::Impl::DoAction( Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes ) +{ + RegisteredVisualContainer::Iterator iter; + if ( FindVisual( visualIndex, mVisuals, iter ) ) + { + Toolkit::GetImplementation((*iter)->visual).DoAction( actionId, attributes ); + } +} + void Control::Impl::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value ) { Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );