(Builder) Set property without checking property type 87/66187/5
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 15 Apr 2016 16:31:18 +0000 (17:31 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 10 Jun 2016 17:29:49 +0000 (18:29 +0100)
Removed actor parent-origin & anchor point setup as well, as that is now done in Actor itself

Change-Id: I628369926380d23842a7a33251eff2faa2371adb

dali-toolkit/internal/builder/builder-actor.cpp [deleted file]
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/file.list

diff --git a/dali-toolkit/internal/builder/builder-actor.cpp b/dali-toolkit/internal/builder/builder-actor.cpp
deleted file mode 100644 (file)
index 8369c62..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2016 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-#include <dali/integration-api/debug.h>
-#include <dali/devel-api/scripting/scripting.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/builder/replacement.h>
-#include <dali-toolkit/internal/builder/builder-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-using namespace Dali::Scripting;
-extern void DeterminePropertyFromNode( const TreeNode& node, Property::Value& value, const Replacement& constant );
-
-/*
- * Handles special case actor configuration (anything thats not already a property)
- *
- */
-Actor SetupActor( const TreeNode& child, Actor& actor, const Replacement& constant )
-{
-  DALI_ASSERT_ALWAYS( actor && "Empty actor handle" );
-
-  // we allow enums strings for parent-origin and anchor-point but as with the current json
-  // strings always succeed if they exist then check its not vector. If they are Vec3s then
-  // this has already been set as a generic property.
-  if( !IsVector3( child, "parentOrigin") )
-  {
-    if( OptionalVector3 v = constant.IsVector3( IsChild(child, "parentOrigin") ) )
-    {
-      actor.SetParentOrigin( *v );
-    }
-    else if( OptionalString origin = constant.IsString( IsChild(child, "parentOrigin") ) )
-    {
-      actor.SetParentOrigin( GetAnchorConstant(*origin) );
-    }
-  }
-
-  if( !IsVector3(child, "anchorPoint") )
-  {
-    if( OptionalVector3 v = constant.IsVector3( IsChild(child, "anchorPoint") ) )
-    {
-      actor.SetAnchorPoint( *v );
-    }
-    else if( OptionalString anchor = constant.IsString( IsChild(child, "anchorPoint") ) )
-    {
-      actor.SetAnchorPoint( GetAnchorConstant(*anchor) );
-    }
-  }
-
-  return actor;
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
index 7e2f786..d9672bb 100644 (file)
@@ -58,7 +58,6 @@ class Replacement;
 extern Animation CreateAnimation(const TreeNode& child, const Replacement& replacements, const Dali::Actor searchRoot, Builder* const builder );
 extern Actor SetupSignalAction(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor, Dali::Toolkit::Internal::Builder* const builder);
 extern Actor SetupPropertyNotification(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor, Dali::Toolkit::Internal::Builder* const builder);
-extern Actor SetupActor( const TreeNode& node, Actor& actor, const Replacement& constant );
 
 #if defined(DEBUG_ENABLED)
 Integration::Log::Filter* gFilterScript  = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_SCRIPT");
@@ -180,9 +179,9 @@ void Builder::SetProperties( const TreeNode& node, Handle& handle, const Replace
           mapped = DeterminePropertyFromNode( keyChild.second, type, value, constant );
           if( ! mapped )
           {
-            // verbose as this might not be a problem
-            // eg parentOrigin can be a string which is picked up later
-            DALI_SCRIPT_VERBOSE("Could not convert property:%s\n", key.c_str());
+            // Just determine the property from the node and if it's valid, let the property object handle it
+            DeterminePropertyFromNode( keyChild.second, value, constant );
+            mapped = ( value.GetType() != Property::NONE );
           }
         }
         if( mapped )
@@ -240,8 +239,6 @@ void Builder::ApplyProperties( const TreeNode& root, const TreeNode& node,
 
     if( actor )
     {
-      SetupActor( node, actor, constant );
-
       // add signals
       SetupSignalAction( mSlotDelegate.GetConnectionTracker(), root, node, actor, this );
       SetupPropertyNotification( mSlotDelegate.GetConnectionTracker(), root, node, actor, this );
index 3c71f0b..fd19920 100644 (file)
@@ -1,7 +1,6 @@
 # Add local source files here
 
 toolkit_src_files = \
-   $(toolkit_src_dir)/builder/builder-actor.cpp \
    $(toolkit_src_dir)/builder/builder-animations.cpp \
    $(toolkit_src_dir)/builder/builder-impl.cpp \
    $(toolkit_src_dir)/builder/builder-impl-debug.cpp \