X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fimage-view%2Fimage-view-impl.cpp;h=d9f105a48d1661e4b5481733edb3cf7ad0887c70;hb=740028773fa9283948b365e6b46913d7db1ee2f1;hp=5e520d87832b071686dad7f165d2dc632a9697f5;hpb=1f995b81544e37cf808ff1b04470e851a414cc50;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp index 5e520d8..d9f105a 100755 --- a/dali-toolkit/internal/controls/image-view/image-view-impl.cpp +++ b/dali-toolkit/internal/controls/image-view/image-view-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -120,14 +120,14 @@ void ImageView::SetImage( Image image ) } else { - // Unregister the exsiting visual + // Unregister the existing visual DevelControl::UnregisterVisual( *this, Toolkit::ImageView::Property::IMAGE ); // Trigger a size negotiation request that may be needed when unregistering a visual. RelayoutRequest(); } - Toolkit::DevelControl::RequestLayout( *this ); + // Signal that a Relayout may be needed } void ImageView::SetImage( const Property::Map& map ) @@ -163,7 +163,7 @@ void ImageView::SetImage( const Property::Map& map ) RelayoutRequest(); } - Toolkit::DevelControl::RequestLayout( *this ); + // Signal that a Relayout may be needed } void ImageView::SetImage( const std::string& url, ImageDimensions size ) @@ -200,7 +200,7 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size ) RelayoutRequest(); } - Toolkit::DevelControl::RequestLayout( *this ); + // Signal that a Relayout may be needed } Image ImageView::GetImage() const @@ -233,6 +233,22 @@ void ImageView::SetDepthIndex( int depthIndex ) } } +void ImageView::OnStageConnection( int depth ) +{ + if( mImage ) + { + mImage.UploadedSignal().Emit( mImage ); + } + + Dali::ResourceImage resourceImage = Dali::ResourceImage::DownCast( mImage ); + if( resourceImage ) + { + resourceImage.LoadingFinishedSignal().Emit( resourceImage ); + } + + Control::OnStageConnection( depth ); // Enabled visuals will be put on stage +} + Vector3 ImageView::GetNaturalSize() { if( mVisual ) @@ -344,7 +360,7 @@ void ImageView::OnResourceReady( Toolkit::Control control ) { // Visual ready so update visual attached to this ImageView, following call to RelayoutRequest will use this visual. mVisual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE ); - Toolkit::DevelControl::RequestLayout( *this ); + // Signal that a Relayout may be needed } /////////////////////////////////////////////////////////// @@ -394,19 +410,23 @@ void ImageView::SetProperty( BaseObject* object, Property::Index index, const Pr // the property map contains only the custom shader else if( ( map->Count() == 1u )&&( shaderValue ) ) { - impl.mShaderMap = *( shaderValue->GetMap() ); - - if( !impl.mUrl.empty() ) - { - impl.SetImage( impl.mUrl, impl.mImageSize ); - } - else if( impl.mImage ) - { - impl.SetImage( impl.mImage ); - } - else if( !impl.mPropertyMap.Empty() ) + Property::Map* shaderMap = shaderValue->GetMap(); + if( shaderMap ) { - impl.SetImage( impl.mPropertyMap ); + impl.mShaderMap = *shaderMap; + + if( !impl.mUrl.empty() ) + { + impl.SetImage( impl.mUrl, impl.mImageSize ); + } + else if( impl.mImage ) + { + impl.SetImage( impl.mImage ); + } + else if( !impl.mPropertyMap.Empty() ) + { + impl.SetImage( impl.mPropertyMap ); + } } } } @@ -459,9 +479,15 @@ Property::Value ImageView::GetProperty( BaseObject* object, Property::Index prop Scripting::CreatePropertyMap( impl.mImage, map ); value = map; } - else if( !impl.mPropertyMap.Empty() ) + else { - value = impl.mPropertyMap; + Property::Map map; + Toolkit::Visual::Base visual = DevelControl::GetVisual( impl, Toolkit::ImageView::Property::IMAGE ); + if( visual ) + { + visual.CreatePropertyMap( map ); + } + value = map; } break; }