#include <dali-toolkit/internal/visuals/animated-image/animated-image-visual.h>
#include <dali-toolkit/internal/visuals/wireframe/wireframe-visual.h>
#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
-#include <dali-toolkit/internal/visuals/visual-factory-resolve-url.h>
+#include <dali-toolkit/internal/visuals/visual-url.h>
#include <dali-toolkit/internal/visuals/visual-string-constants.h>
namespace Dali
{
Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
std::string imageUrl;
- if( imageURLValue && imageURLValue->Get( imageUrl ) )
+ if( imageURLValue )
{
- // first resolve url type to know which visual to create
- UrlType::Type type = ResolveUrlType( imageUrl );
- if( UrlType::N_PATCH == type )
- {
- visualPtr = NPatchVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
- }
- else if( UrlType::SVG == type )
- {
- visualPtr = SvgVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
- }
- else if( UrlType::GIF == type )
+ if( imageURLValue->Get( imageUrl ) )
{
- visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ VisualUrl visualUrl( imageUrl );
+
+ switch( visualUrl.GetType() )
+ {
+ case VisualUrl::N_PATCH:
+ {
+ visualPtr = NPatchVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap );
+ break;
+ }
+ case VisualUrl::SVG:
+ {
+ visualPtr = SvgVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap );
+ break;
+ }
+ case VisualUrl::GIF:
+ {
+ visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap );
+ break;
+ }
+ case VisualUrl::REGULAR_IMAGE:
+ {
+ visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), visualUrl, propertyMap );
+ break;
+ }
+ }
}
- else // Regular image
+ else
{
- visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ Property::Array* array = imageURLValue->GetArray();
+ if( array )
+ {
+ visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), *array, propertyMap );
+ }
}
}
-
break;
}
{
Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME );
std::string imageUrl;
- if( imageURLValue && imageURLValue->Get( imageUrl ) )
+ if( imageURLValue )
{
- visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ if( imageURLValue->Get( imageUrl ) )
+ {
+ visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), imageUrl, propertyMap );
+ }
+ else
+ {
+ Property::Array* array = imageURLValue->GetArray();
+ if( array )
+ {
+ visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), *array, propertyMap );
+ }
+ }
}
break;
}
Visual::BasePtr visualPtr;
// first resolve url type to know which visual to create
- UrlType::Type type = ResolveUrlType( url );
- if( UrlType::N_PATCH == type )
- {
- visualPtr = NPatchVisual::New( *( mFactoryCache.Get() ), url );
- }
- else if( UrlType::SVG == type )
+ VisualUrl visualUrl( url );
+ switch( visualUrl.GetType() )
{
- visualPtr = SvgVisual::New( *( mFactoryCache.Get() ), url );
- }
- else if( UrlType::GIF == type )
- {
- visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), url );
- }
- else // Regular image
- {
- visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), url, size );
+ case VisualUrl::N_PATCH:
+ {
+ visualPtr = NPatchVisual::New( *( mFactoryCache.Get() ), visualUrl );
+ break;
+ }
+ case VisualUrl::SVG:
+ {
+ visualPtr = SvgVisual::New( *( mFactoryCache.Get() ), visualUrl );
+ break;
+ }
+ case VisualUrl::GIF:
+ {
+ visualPtr = AnimatedImageVisual::New( *( mFactoryCache.Get() ), visualUrl );
+ break;
+ }
+ case VisualUrl::REGULAR_IMAGE:
+ {
+ visualPtr = ImageVisual::New( *( mFactoryCache.Get() ), visualUrl, size );
+ break;
+ }
}
if( mDebugEnabled )