X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-factory-impl.cpp;h=dc35220642843148aab619ca8ef78e541be05856;hp=d30729bd76b9fc6a5c37f004030be18a0ce856a1;hb=d82f43904668532387d5c796aad7aa265d5536d6;hpb=d77eb8256291852ab373718df3fc8fd937150974 diff --git a/dali-toolkit/internal/visuals/visual-factory-impl.cpp b/dali-toolkit/internal/visuals/visual-factory-impl.cpp index d30729b..dc35220 100644 --- a/dali-toolkit/internal/visuals/visual-factory-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-factory-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -26,6 +26,7 @@ #include // INTERNAL INCLUDES +#include #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +62,10 @@ namespace Internal namespace { +#if defined(DEBUG_ENABLED) +Debug::Filter* gLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_CONTROL_VISUALS"); +#endif + BaseHandle Create() { BaseHandle handle = Toolkit::VisualFactory::Get(); @@ -69,7 +75,7 @@ BaseHandle Create() DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::VisualFactory, Dali::BaseHandle, Create, true ) DALI_TYPE_REGISTRATION_END() -const char * const BROKEN_IMAGE_URL( DALI_IMAGE_DIR "broken.png" ); ///< URL For the broken image +const char* const BROKEN_IMAGE_FILE_NAME = "broken.png"; ///< The file name of the broken image. } // namespace @@ -90,7 +96,8 @@ void VisualFactory::OnStyleChangedSignal( Toolkit::StyleManager styleManager, St { if( type == StyleChange::THEME_CHANGE ) { - std::string brokenImageUrl(BROKEN_IMAGE_URL); + const std::string imageDirPath = AssetManager::GetDaliImagePath(); + std::string brokenImageUrl = imageDirPath + BROKEN_IMAGE_FILE_NAME; Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager ); config["brokenImageUrl"].Get( brokenImageUrl ); @@ -271,11 +278,31 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property } break; } + + case Toolkit::DevelVisual::ARC: + { + visualPtr = ArcVisual::New( GetFactoryCache(), propertyMap ); + break; + } } + DALI_LOG_INFO( gLogFilter, Debug::Concise, "VisualFactory::CreateVisual( VisualType:%s %s%s)\n", + Scripting::GetEnumerationName( visualType, + VISUAL_TYPE_TABLE, + VISUAL_TYPE_TABLE_COUNT ), + ( visualType == Toolkit::DevelVisual::IMAGE ) ? "url:" : "", + ( visualType == Toolkit::DevelVisual::IMAGE ) ? + ( ([&] (){ + // Return URL if present in PropertyMap else return "not found message" + Property::Value* imageURLValue = propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME ); + return ( imageURLValue ) ? imageURLValue->Get().c_str() : "url not found in PropertyMap"; + })() + ) + : "" ); + if( !visualPtr ) { - DALI_LOG_ERROR( "Renderer type unknown\n" ); + DALI_LOG_ERROR( "VisualType unknown\n" ); } if( mDebugEnabled && visualType != Toolkit::DevelVisual::WIREFRAME ) @@ -385,7 +412,9 @@ Internal::VisualFactoryCache& VisualFactory::GetFactoryCache() { mFactoryCache = std::unique_ptr( new VisualFactoryCache( mPreMultiplyOnLoad ) ); - std::string brokenImageUrl(BROKEN_IMAGE_URL); + const std::string imageDirPath = AssetManager::GetDaliImagePath(); + std::string brokenImageUrl = imageDirPath + BROKEN_IMAGE_FILE_NAME; + Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get(); if( styleManager ) {