X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fbuilder%2Fbuilder-impl.cpp;h=11b92f6ceec734f7c621ece4f9577b9a042452d4;hp=ca264ab7e988b7e25b79e1477e67ebaa1f96825d;hb=ddc61b05fccb7c1a96ca677276914a0e1dde827b;hpb=36a298758d1b6244b7846a0102b528d76002dbda diff --git a/dali-toolkit/internal/builder/builder-impl.cpp b/dali-toolkit/internal/builder/builder-impl.cpp index ca264ab..11b92f6 100644 --- a/dali-toolkit/internal/builder/builder-impl.cpp +++ b/dali-toolkit/internal/builder/builder-impl.cpp @@ -67,6 +67,8 @@ Integration::Log::Filter* gFilterScript = Integration::Log::Filter::New(Debug:: namespace { +#define TOKEN_STRING(x) #x + const std::string KEYNAME_STYLES = "styles"; const std::string KEYNAME_TYPE = "type"; const std::string KEYNAME_ACTORS = "actors"; @@ -122,11 +124,6 @@ std::string PropertyValueToString( const Property::Value& value ) ret = ToString( value.Get() ); break; } - case Property::UNSIGNED_INTEGER: - { - ret = ToString( value.Get() ); - break; - } case Property::VECTOR2: { ret = ToString( value.Get() ); @@ -176,11 +173,6 @@ std::string PropertyValueToString( const Property::Value& value ) ret = std::string("Map Size=") + ToString( value.Get().Count() ); break; } - case Property::TYPE_COUNT: - { - ret = ""; - break; - } } return ret; @@ -263,7 +255,7 @@ void Builder::SetProperties( const TreeNode& node, Handle& handle, const Replace // special field 'effect' references the shader effect instances if(key == "effect") { - RenderableActor actor = RenderableActor::DownCast(handle); + ImageActor actor = ImageActor::DownCast(handle); if( actor ) { OptionalString str = constant.IsString( keyChild.second ); @@ -287,7 +279,7 @@ void Builder::SetProperties( const TreeNode& node, Handle& handle, const Replace if( Property::INVALID_INDEX == index ) { - RenderableActor actor = RenderableActor::DownCast(handle); + ImageActor actor = ImageActor::DownCast(handle); if( actor ) { if( ShaderEffect effect = actor.GetShaderEffect() ) @@ -725,9 +717,13 @@ FrameBufferImage Builder::GetFrameBufferImage( const std::string &name, const Re if( SetPropertyFromNode( *image, Property::MAP, property, constant ) ) { Property::Map* map = property.GetMap(); - (*map)[ KEYNAME_TYPE ] = Property::Value(std::string("FrameBufferImage") ); - ret = FrameBufferImage::DownCast( Dali::Scripting::NewImage( property ) ); - mFrameBufferImageLut[ name ] = ret; + + if( map ) + { + (*map)[ KEYNAME_TYPE ] = Property::Value(std::string("FrameBufferImage") ); + ret = FrameBufferImage::DownCast( Dali::Scripting::NewImage( property ) ); + mFrameBufferImageLut[ name ] = ret; + } } } } @@ -1362,6 +1358,14 @@ Builder::Builder() : mSlotDelegate( this ) { mParser = Dali::Toolkit::JsonParser::New(); + + Property::Map defaultDirs; + defaultDirs[ TOKEN_STRING(DALI_IMAGE_DIR) ] = DALI_IMAGE_DIR; + defaultDirs[ TOKEN_STRING(DALI_SOUND_DIR) ] = DALI_SOUND_DIR; + defaultDirs[ TOKEN_STRING(DALI_STYLE_DIR) ] = DALI_STYLE_DIR; + defaultDirs[ TOKEN_STRING(DALI_STYLE_IMAGE_DIR) ] = DALI_STYLE_IMAGE_DIR; + + AddConstants( defaultDirs ); } Builder::~Builder()