/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
}
}
-FrameBufferImage Builder::GetFrameBufferImage( const std::string &name )
-{
- Replacement constant( mReplacementMap );
- return GetFrameBufferImage(name, constant);
-}
-
-FrameBufferImage Builder::GetFrameBufferImage( const std::string &name, const Replacement& constant )
-{
- DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
-
- FrameBufferImage ret;
-
- ImageLut::const_iterator iter( mFrameBufferImageLut.find( name ) );
- if( iter != mFrameBufferImageLut.end() )
- {
- ret = iter->second;
- }
- else
- {
- if( OptionalChild images = IsChild( *mParser.GetRoot(), "frameBufferImages") )
- {
- if( OptionalChild image = IsChild( *images, name ) )
- {
- Dali::Property::Value property(Property::MAP);
- if( DeterminePropertyFromNode( *image, Property::MAP, property, constant ) )
- {
- Property::Map* map = property.GetMap();
-
- if( map )
- {
- (*map)[ KEYNAME_TYPE ] = Property::Value(std::string("FrameBufferImage") );
- ret = FrameBufferImage::DownCast( Dali::Scripting::NewImage( property ) );
- mFrameBufferImageLut[ name ] = ret;
- }
- }
- }
- }
- }
-
- return ret;
-}
-
Path Builder::GetPath( const std::string& name )
{
DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
// try to find other "{","}" pair after current left position.
pos = leftPos+1;
- for( unsigned int i = 0; i < mReplacementMap.Count() ; i++ )
+ for( uint32_t i = 0; i < mReplacementMap.Count() ; i++ )
{
- std::string constant = mReplacementMap.GetKey(i);
+ Property::Key constant = mReplacementMap.GetKeyAt(i);
// Compare string which is between "{" and "}" with constant string
// If they are same, change string in stringConfigValue to mapped constant value.
- if ( stringConfigValue.compare( leftPos+1, rightPos-leftPos-1,constant) == 0 )
+ if ( 0 == stringConfigValue.compare( leftPos+1, rightPos-leftPos-1, constant.stringKey ) )
{
std::string replaceString;
mReplacementMap.GetValue(i).Get( replaceString );
}
}
- if( OptionalString s = constant.IsString( IsChild(node, "targetFrameBuffer") ) )
- {
- FrameBufferImage fb = GetFrameBufferImage( *s, constant );
- if(fb)
- {
- task.SetTargetFrameBuffer( fb );
- }
- else
- {
- DALI_SCRIPT_WARNING("Cannot find target frame buffer '%s'\n", (*s).c_str() );
- }
- }
-
if( OptionalString s = constant.IsString( IsChild(node, "screenToFrameBufferFunction") ) )
{
if("DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION" == *s)