- // apply style on top as they need the children to exist
- ApplyAllStyleProperties( root, node, actor, replacements );
-
- // then add to parent
- if( parent )
- {
- parent.Add( actor );
- }
- }
- else
- {
- ApplyProperties( root, node, handle, replacements );
- }
- }
- else
- {
- DALI_SCRIPT_WARNING("Cannot create handle from type '%s'\n", typeInfo.GetName().c_str());
- }
- }
-
- return baseHandle;
-}
-
-void Builder::SetupTask( RenderTask& task, const TreeNode& node, const Replacement& constant )
-{
- const Stage& stage = Stage::GetCurrent();
- Layer root = stage.GetRootLayer();
-
- if( OptionalString s = constant.IsString( IsChild(node, "sourceActor") ) )
- {
- Actor actor = root.FindChildByName(*s);
- if(actor)
- {
- task.SetSourceActor( actor );
- }
- else
- {
- DALI_SCRIPT_WARNING("Cannot find source actor on stage for render task called '%s'\n", (*s).c_str() );
- }
- }
-
- if( OptionalString s = constant.IsString( IsChild(node, "cameraActor") ) )
- {
- CameraActor actor = CameraActor::DownCast( root.FindChildByName(*s) );
- if(actor)
- {
- task.SetCameraActor( actor );
- }
- else
- {
- DALI_SCRIPT_WARNING("Cannot find camera actor on stage for render task called '%s'\n", (*s).c_str() );
- }
- }
-
- 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)
- {
- task.SetScreenToFrameBufferFunction( RenderTask::DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION );
- }
- else if("FULLSCREEN_FRAMEBUFFER_FUNCTION" == *s)
- {
- task.SetScreenToFrameBufferFunction( RenderTask::FULLSCREEN_FRAMEBUFFER_FUNCTION );
- }
- else
- {
- DALI_SCRIPT_WARNING("todo");
- }
- }
-
- // other setup is via the property system
- SetProperties( node, task, constant );
-}
-
-void Builder::CreateRenderTask( const std::string &name )
-{
- DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
-
- Replacement constant(mReplacementMap);