Merge "NativeImageSource with tbm_surface for tizen 3.0 wayland" into devel/master
authortaeyoon <taeyoon0.lee@samsung.com>
Tue, 2 Feb 2016 01:30:30 +0000 (17:30 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Tue, 2 Feb 2016 01:30:30 +0000 (17:30 -0800)
build/tizen/dali-toolkit/Makefile.am
dali-toolkit/devel-api/file.list
dali-toolkit/internal/builder/builder-actor.cpp
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/builder-set-property.cpp
dali-toolkit/internal/builder/builder-signals.cpp
dali-toolkit/public-api/controls/control-depth-index-ranges.h [deleted file]
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 0e36158..3d63299 100644 (file)
@@ -106,6 +106,7 @@ develapitoolbardir =            $(develapicontrolsdir)/tool-bar
 develapitextselectionpopupdir = $(develapicontrolsdir)/text-controls
 
 # devel headers
+develapicontrols_HEADERS =          $(devel_api_controls_header_files)
 develapibloomview_HEADERS =         $(devel_api_bloom_view_header_files)
 develapibubbleemitter_HEADERS =     $(devel_api_bubble_emitter_header_files)
 develapibuilder_HEADERS =           $(devel_api_builder_header_files)
@@ -126,44 +127,44 @@ develapitransitioneffects_HEADERS = $(devel_api_transition_effects_header_files)
 develapitextselectionpopup_HEADERS = $(devel_api_text_controls_header_files)
 
 # public api source
-publicapidir =                    $(topleveldir)/public-api
-publicapicontrolsdir =            $(publicapidir)/controls
-develapiaccessibilitymanagerdir = $(publicapidir)/accessibility-manager
-publicapialignmentdir =           $(publicapicontrolsdir)/alignment
-publicapibuttonsdir =             $(publicapicontrolsdir)/buttons
-publicapidefaultcontrolsdir =     $(publicapicontrolsdir)/default-controls
-publicapigaussianblurviewdir =    $(publicapicontrolsdir)/gaussian-blur-view
-publicapiimageviewdir =           $(publicapicontrolsdir)/image-view
-publicapimodel3dviewdir =         $(publicapicontrolsdir)/model3d-view
-publicapipageturnviewdir =        $(publicapicontrolsdir)/page-turn-view
-publicapiscrollbardir =           $(publicapicontrolsdir)/scroll-bar
-publicapiscrollabledir =          $(publicapicontrolsdir)/scrollable
-publicapiscrollviewdir =          $(publicapicontrolsdir)/scrollable/scroll-view
-publicapiitemviewdir =            $(publicapicontrolsdir)/scrollable/item-view
-publicapitableviewdir =           $(publicapicontrolsdir)/table-view
-publicapitextcontrolsdir =        $(publicapicontrolsdir)/text-controls
-publicapifocusmanagerdir =        $(publicapidir)/focus-manager
-publicapirenderingbackenddir =    $(publicapidir)/text
+publicapidir =                     $(topleveldir)/public-api
+publicapicontrolsdir =             $(publicapidir)/controls
+publicapiaccessibilitymanagerdir = $(publicapidir)/accessibility-manager
+publicapialignmentdir =            $(publicapicontrolsdir)/alignment
+publicapibuttonsdir =              $(publicapicontrolsdir)/buttons
+publicapidefaultcontrolsdir =      $(publicapicontrolsdir)/default-controls
+publicapigaussianblurviewdir =     $(publicapicontrolsdir)/gaussian-blur-view
+publicapiimageviewdir =            $(publicapicontrolsdir)/image-view
+publicapimodel3dviewdir =          $(publicapicontrolsdir)/model3d-view
+publicapipageturnviewdir =         $(publicapicontrolsdir)/page-turn-view
+publicapiscrollbardir =            $(publicapicontrolsdir)/scroll-bar
+publicapiscrollabledir =           $(publicapicontrolsdir)/scrollable
+publicapiscrollviewdir =           $(publicapicontrolsdir)/scrollable/scroll-view
+publicapiitemviewdir =             $(publicapicontrolsdir)/scrollable/item-view
+publicapitableviewdir =            $(publicapicontrolsdir)/table-view
+publicapitextcontrolsdir =         $(publicapicontrolsdir)/text-controls
+publicapifocusmanagerdir =         $(publicapidir)/focus-manager
+publicapirenderingbackenddir =     $(publicapidir)/text
 
 # public api headers
-publicapi_HEADERS =                    $(public_api_header_files)
-publicapicontrols_HEADERS =            $(public_api_controls_header_files)
-develapiaccessibilitymanager_HEADERS = $(public_api_accessibility_manager_header_files)
-publicapialignment_HEADERS =           $(public_api_alignment_header_files)
-publicapibuttons_HEADERS =             $(public_api_buttons_header_files)
-publicapidefaultcontrols_HEADERS =     $(public_api_default_controls_header_files)
-publicapigaussianblurview_HEADERS =    $(public_api_gaussian_blur_view_header_files)
-publicapiimageview_HEADERS =           $(public_api_image_view_header_files)
-publicapiitemview_HEADERS =            $(public_api_item_view_header_files)
-publicapimodel3dview_HEADERS =         $(public_api_model3d_view_header_files)
-publicapipageturnview_HEADERS =        $(public_api_page_turn_view_header_files)
-publicapiscrollbar_HEADERS =           $(public_api_scroll_bar_header_files)
-publicapiscrollable_HEADERS =          $(public_api_scrollable_header_files)
-publicapiscrollview_HEADERS =          $(public_api_scroll_view_header_files)
-publicapitableview_HEADERS =           $(public_api_table_view_header_files)
-publicapitextcontrols_HEADERS =        $(public_api_text_controls_header_files)
-publicapifocusmanager_HEADERS =        $(public_api_focus_manager_header_files)
-publicapirenderingbackend_HEADERS =    $(public_api_rendering_backend_header_files)
+publicapi_HEADERS =                     $(public_api_header_files)
+publicapicontrols_HEADERS =             $(public_api_controls_header_files)
+publicapiaccessibilitymanager_HEADERS = $(public_api_accessibility_manager_header_files)
+publicapialignment_HEADERS =            $(public_api_alignment_header_files)
+publicapibuttons_HEADERS =              $(public_api_buttons_header_files)
+publicapidefaultcontrols_HEADERS =      $(public_api_default_controls_header_files)
+publicapigaussianblurview_HEADERS =     $(public_api_gaussian_blur_view_header_files)
+publicapiimageview_HEADERS =            $(public_api_image_view_header_files)
+publicapiitemview_HEADERS =             $(public_api_item_view_header_files)
+publicapimodel3dview_HEADERS =          $(public_api_model3d_view_header_files)
+publicapipageturnview_HEADERS =         $(public_api_page_turn_view_header_files)
+publicapiscrollbar_HEADERS =            $(public_api_scroll_bar_header_files)
+publicapiscrollable_HEADERS =           $(public_api_scrollable_header_files)
+publicapiscrollview_HEADERS =           $(public_api_scroll_view_header_files)
+publicapitableview_HEADERS =            $(public_api_table_view_header_files)
+publicapitextcontrols_HEADERS =         $(public_api_text_controls_header_files)
+publicapifocusmanager_HEADERS =         $(public_api_focus_manager_header_files)
+publicapirenderingbackend_HEADERS =     $(public_api_rendering_backend_header_files)
 
 # package doxygen file (contains doxygen grouping information)
 packagedoxydir = $(topleveldir)/doc
index ff91aa7..a2220cd 100755 (executable)
@@ -30,6 +30,9 @@ devel_api_src_files = \
 
 # Add devel header files here
 
+devel_api_controls_header_files = \
+  $(devel_api_src_dir)/controls/control-depth-index-ranges.h
+
 devel_api_bloom_view_header_files = \
   $(devel_api_src_dir)/controls/bloom-view/bloom-view.h
 
index 69bf0e6..3807b08 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -34,7 +34,7 @@ namespace Internal
 {
 
 using namespace Dali::Scripting;
-extern bool SetPropertyFromNode( const TreeNode& node, Property::Value& value, const Replacement& constant );
+extern void DeterminePropertyFromNode( const TreeNode& node, Property::Value& value, const Replacement& constant );
 
 /*
  * Handles special case actor configuration (anything thats not already a property)
@@ -82,11 +82,9 @@ Actor SetupActor( const TreeNode& child, Actor& actor, const Replacement& consta
       std::string key( keyChild.first );
 
       Property::Value value;
-      if( SetPropertyFromNode( keyChild.second, value, constant ))
-      {
-        // Register/Set property.
-        actor.RegisterProperty( key, value, Property::READ_WRITE );
-      }
+      DeterminePropertyFromNode( keyChild.second, value, constant );
+      // Register/Set property.
+      actor.RegisterProperty( key, value, Property::READ_WRITE );
     }
   }
 
index de40d44..f7b89e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -52,10 +52,10 @@ namespace Internal
 class Replacement;
 
 extern Animation CreateAnimation(const TreeNode& child, const Replacement& replacements, const Dali::Actor searchRoot, Builder* const builder );
-extern bool SetPropertyFromNode( const TreeNode& node, Property::Value& value );
-extern bool SetPropertyFromNode( const TreeNode& node, Property::Value& value, const Replacement& replacements );
-extern bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value );
-extern bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value, const Replacement& replacements );
+extern void DeterminePropertyFromNode( const TreeNode& node, Property::Value& value );
+extern void DeterminePropertyFromNode( const TreeNode& node, Property::Value& value, const Replacement& replacements );
+extern bool DeterminePropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value );
+extern bool DeterminePropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value, const Replacement& replacements );
 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 );
@@ -298,7 +298,7 @@ void Builder::SetProperties( const TreeNode& node, Handle& handle, const Replace
         Property::Type type = propertyObject.GetPropertyType(index);
 
         Property::Value value;
-        if( !SetPropertyFromNode( keyChild.second, type, value, constant ) )
+        if( !DeterminePropertyFromNode( keyChild.second, type, value, constant ) )
         {
           // verbose as this might not be a problem
           // eg parentOrigin can be a string which is picked up later
@@ -677,7 +677,7 @@ ShaderEffect Builder::GetShaderEffect( const std::string &name, const Replacemen
       if( OptionalChild effect = IsChild( *effects, name ) )
       {
         Dali::Property::Value propertyMap(Property::MAP);
-        if( SetPropertyFromNode( *effect, Property::MAP, propertyMap, constant ) )
+        if( DeterminePropertyFromNode( *effect, Property::MAP, propertyMap, constant ) )
         {
           ret = Dali::Scripting::NewShaderEffect( propertyMap );
           mShaderEffectLut[ name ] = ret;
@@ -713,7 +713,7 @@ FrameBufferImage Builder::GetFrameBufferImage( const std::string &name, const Re
       if( OptionalChild image = IsChild( *images, name ) )
       {
         Dali::Property::Value property(Property::MAP);
-        if( SetPropertyFromNode( *image, Property::MAP, property, constant ) )
+        if( DeterminePropertyFromNode( *image, Property::MAP, property, constant ) )
         {
           Property::Map* map = property.GetMap();
 
@@ -752,7 +752,7 @@ Path Builder::GetPath( const std::string& name )
         if( OptionalChild pointsProperty = IsChild( *path, "points") )
         {
           Dali::Property::Value points(Property::ARRAY);
-          if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
+          if( DeterminePropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
           {
             ret = Path::New();
             ret.SetProperty( Path::Property::POINTS, points);
@@ -761,7 +761,7 @@ Path Builder::GetPath( const std::string& name )
             if( OptionalChild pointsProperty = IsChild( *path, "controlPoints") )
             {
               Dali::Property::Value points(Property::ARRAY);
-              if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
+              if( DeterminePropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
               {
                 ret.SetProperty( Path::Property::CONTROL_POINTS, points);
               }
@@ -826,7 +826,7 @@ PathConstrainer Builder::GetPathConstrainer( const std::string& name )
         if( OptionalChild pointsProperty = IsChild( *pathConstrainer, "points") )
         {
           Dali::Property::Value points(Property::ARRAY);
-          if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
+          if( DeterminePropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
           {
             ret = PathConstrainer::New();
             ret.SetProperty( PathConstrainer::Property::POINTS, points);
@@ -835,7 +835,7 @@ PathConstrainer Builder::GetPathConstrainer( const std::string& name )
             if( OptionalChild pointsProperty = IsChild( *pathConstrainer, "controlPoints") )
             {
               Dali::Property::Value points(Property::ARRAY);
-              if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
+              if( DeterminePropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
               {
                 ret.SetProperty( PathConstrainer::Property::CONTROL_POINTS, points);
               }
@@ -935,7 +935,7 @@ Dali::LinearConstrainer Builder::GetLinearConstrainer( const std::string& name )
         if( OptionalChild pointsProperty = IsChild( *linearConstrainer, "value") )
         {
           Dali::Property::Value points(Property::ARRAY);
-          if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
+          if( DeterminePropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
           {
             ret = Dali::LinearConstrainer::New();
             ret.SetProperty( LinearConstrainer::Property::VALUE, points);
@@ -944,7 +944,7 @@ Dali::LinearConstrainer Builder::GetLinearConstrainer( const std::string& name )
             if( OptionalChild pointsProperty = IsChild( *linearConstrainer, "progress") )
             {
               Dali::Property::Value points(Property::ARRAY);
-              if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
+              if( DeterminePropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
               {
                 ret.SetProperty( LinearConstrainer::Property::PROGRESS, points);
               }
@@ -1200,15 +1200,8 @@ void Builder::LoadConstants( const TreeNode& root, Property::Map& intoMap )
 #if defined(DEBUG_ENABLED)
         DALI_SCRIPT_VERBOSE("Constant set from json '%s'\n", (*iter).second.GetName());
 #endif
-        if( SetPropertyFromNode( (*iter).second, property, replacer ) )
-        {
-          intoMap[ (*iter).second.GetName() ] = property;
-        }
-        else
-        {
-          DALI_SCRIPT_WARNING("Cannot convert property for constant %s\n",
-                              (*iter).second.GetName() == NULL ? "no name?" : (*iter).second.GetName());
-        }
+        DeterminePropertyFromNode( (*iter).second, property, replacer );
+        intoMap[ (*iter).second.GetName() ] = property;
       }
     }
   }
index 7cd45b6..d17a392 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * 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.
@@ -38,22 +38,22 @@ namespace Internal
 
 /*
  * Set a property value from a tree node.
- * This function guesses the type of the property from the format of the string in the node.
- * This is not always possible and could be surprising.
+ * This function determines the type of the property from the format of the string in the node.
+ * This is not always possible and if the type cannot be determined then then the type will default to Array.
  * @param node  The node string to convert from
  * @param value The property value to set
- * @return true if the string could be converted.
  */
-bool SetPropertyFromNode( const TreeNode& node, Property::Value& value );
+void DeterminePropertyFromNode( const TreeNode& node, Property::Value& value );
 
 /*
  * Set a property value from a tree node as SetPropertyFromNode() above
+ * This function determines the type of the property from the format of the string in the node.
+ * This is not always possible and if the type cannot be determined then then the type will default to Array.
  * @param node  The node string to convert from
  * @param value The property value to set
  * @param replacement The overriding replacement map (if any)
- * @return true if the string could be converted.
  */
-bool SetPropertyFromNode( const TreeNode& node, Property::Value& value,
+void DeterminePropertyFromNode( const TreeNode& node, Property::Value& value,
                           const Replacement& replacement );
 
 /*
@@ -63,7 +63,7 @@ bool SetPropertyFromNode( const TreeNode& node, Property::Value& value,
  * @param value The property value to set
  * @return true if the string could be converted to the correct type.
  */
-bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value );
+bool DeterminePropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value );
 
 /*
  * Set a property value as the given type from a tree node as SetPropertyFromNode() above
@@ -73,7 +73,7 @@ bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::V
  * @param replacement The overriding replacement map (if any)
  * @return true if the string could be converted to the correct type.
  */
-bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value,
+bool DeterminePropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value,
                           const Replacement& replacement );
 
 
@@ -123,43 +123,43 @@ bool Disambiguated(const TreeNode& child, // ConstantLut& constantLut,
     // type-cast and value keys. If they do then a work around is to add a bogus key to not run this case.
     if(*childType == "boolean")
     {
-      return SetPropertyFromNode( *childValue, Dali::Property::BOOLEAN, value, replacement);
+      return DeterminePropertyFromNode( *childValue, Dali::Property::BOOLEAN, value, replacement);
     }
     else if(*childType == "float")
     {
-      return SetPropertyFromNode( *childValue, Dali::Property::FLOAT, value, replacement);
+      return DeterminePropertyFromNode( *childValue, Dali::Property::FLOAT, value, replacement);
     }
     else if(*childType == "vector2")
     {
-      return SetPropertyFromNode( *childValue, Dali::Property::VECTOR2, value, replacement);
+      return DeterminePropertyFromNode( *childValue, Dali::Property::VECTOR2, value, replacement);
     }
     else if(*childType == "vector3")
     {
-      return SetPropertyFromNode( *childValue, Dali::Property::VECTOR3, value, replacement);
+      return DeterminePropertyFromNode( *childValue, Dali::Property::VECTOR3, value, replacement);
     }
     else if(*childType == "vector4")
     {
-      return SetPropertyFromNode( *childValue, Dali::Property::VECTOR4, value, replacement);
+      return DeterminePropertyFromNode( *childValue, Dali::Property::VECTOR4, value, replacement);
     }
     else if(*childType == "rotation")
     {
-      return SetPropertyFromNode( *childValue, Dali::Property::ROTATION, value, replacement);
+      return DeterminePropertyFromNode( *childValue, Dali::Property::ROTATION, value, replacement);
     }
     else if(*childType == "rect")
     {
-      return SetPropertyFromNode( *childValue, Dali::Property::RECTANGLE, value, replacement);
+      return DeterminePropertyFromNode( *childValue, Dali::Property::RECTANGLE, value, replacement);
     }
     else if(*childType == "string")
     {
-      return SetPropertyFromNode( *childValue, Dali::Property::STRING, value, replacement);
+      return DeterminePropertyFromNode( *childValue, Dali::Property::STRING, value, replacement);
     }
     else if(*childType == "map")
     {
-      return SetPropertyFromNode( *childValue, Dali::Property::MAP, value, replacement);
+      return DeterminePropertyFromNode( *childValue, Dali::Property::MAP, value, replacement);
     }
     else if(*childType == "array")
     {
-      return SetPropertyFromNode( *childValue, Dali::Property::ARRAY, value, replacement);
+      return DeterminePropertyFromNode( *childValue, Dali::Property::ARRAY, value, replacement);
     }
   }
 
@@ -168,13 +168,13 @@ bool Disambiguated(const TreeNode& child, // ConstantLut& constantLut,
 }
 
 
-bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value)
+bool DeterminePropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value)
 {
   Replacement noReplacement;
-  return SetPropertyFromNode( node, type, value, noReplacement );
+  return DeterminePropertyFromNode( node, type, value, noReplacement );
 }
 
-bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value,
+bool DeterminePropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value,
                           const Replacement& replacer )
 {
   bool done = false;
@@ -352,20 +352,11 @@ bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::V
           for( ; i < node.Size(); ++i, ++iter)
           {
             Property::Value childValue;
-            if( SetPropertyFromNode( (*iter).second, childValue, replacer ) )
-            {
-              array->PushBack( childValue );
-            }
+            DeterminePropertyFromNode( (*iter).second, childValue, replacer );
+            array->PushBack( childValue );
           }
 
-          if( array->Count() == node.Size() )
-          {
-            done = true;
-          }
-          else
-          {
-            done = false;
-          }
+          done = ( array->Count() == node.Size() );
         }
       }
       break;
@@ -389,20 +380,11 @@ bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::V
           for( ; i < node.Size(); ++i, ++iter)
           {
             Property::Value childValue;
-            if( SetPropertyFromNode( (*iter).second, childValue, replacer ) )
-            {
-              map->Insert( (*iter).first, childValue );
-            }
+            DeterminePropertyFromNode( (*iter).second, childValue, replacer );
+            map->Insert( (*iter).first, childValue );
           }
 
-          if( map->Count() == node.Size() )
-          {
-            done = true;
-          }
-          else
-          {
-            done = false;
-          }
+          done = ( map->Count() == node.Size() );
         }
       }
       break;
@@ -416,164 +398,107 @@ bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::V
   return done;
 }
 
-bool SetPropertyFromNode( const TreeNode& node, Property::Value& value )
+void DeterminePropertyFromNode( const TreeNode& node, Property::Value& value )
 
 {
   Replacement replacer;
-  return SetPropertyFromNode( node, value, replacer );
+  DeterminePropertyFromNode( node, value, replacer );
 }
 
-bool SetPropertyFromNode( const TreeNode& node, Property::Value& value,
+void DeterminePropertyFromNode( const TreeNode& node, Property::Value& value,
                           const Replacement& replacer )
 {
-  bool done = false;
 
-  // some values are ambiguous as we have no Property::Type but can be disambiguated in the json
+  TreeNode::NodeType nodeType = node.GetType();
 
-  // Currently Rotations and Rectangle must always be disambiguated when a type isnt available
-  if( Disambiguated( node, value, replacer ) )
-  {
-    done = true;
-  }
-  else
+  // Some values are ambiguous as we have no Property::Type but can be disambiguated in the JSON.
+  // Currently Rotations and Rectangle must always be disambiguated when a type isn't available
+  if( !Disambiguated( node, value, replacer ) )
   {
+    bool done = false;
+
+    // Here, nodes are handled with the following precedence order:
+    // 1) Nodes with children, that have type ARRAY: Checked for array types including vectors and matrices.
+    // 2) Nodes without children, that do not have type ARRAY OR OBJECT: Checked for primitive types (int / float /etc).
+    // 3) If no match so far; If type is OBJECT: attempt to create as a Property::Map.
+    // 4) If no match still; Create as array.
+
+    // First handle nodes with children.
     if( node.Size() )
     {
-      // our current heuristic for deciding an array is actually a vector and not say a map
-      // is to check if the values are all floats
-      bool allNumbers = true;
-      for(TreeConstIter iter = node.CBegin(); iter != node.CEnd(); ++iter)
+      // Handle array types.
+      if( nodeType == TreeNode::ARRAY )
       {
-        OptionalFloat f = IsFloat((*iter).second);
-        if(!f)
+        // our current heuristic for deciding an array is actually a vector and not say a map
+        // is to check if the values are all floats
+        bool allNumbers = true;
+        for( TreeConstIter iter = node.CBegin(); iter != node.CEnd(); ++iter )
         {
-          allNumbers = false;
-          break;
+          OptionalFloat checkFloat = IsFloat( ( *iter ).second );
+          if( !checkFloat )
+          {
+            allNumbers = false;
+            break;
+          }
         }
-      }
 
-      if( allNumbers )
-      {
-        // prefer finding vectors over presuming composite Property::Array...
-        if( OptionalMatrix v = IsMatrix(node) )
-        {
-          value = *v;
-          done = true;
-        }
-        else if( OptionalMatrix3 v = IsMatrix3(node) )
-        {
-          value = *v;
-          done = true;
-        }
-        else if( OptionalVector4 v = IsVector4(node) )
-        {
-          value = *v;
-          done = true;
-        }
-        else if( OptionalVector3 v = IsVector3(node) )
-        {
-          value = *v;
-          done = true;
-        }
-        else if( OptionalVector2 v = IsVector2(node) )
-        {
-          value = *v;
-          done = true;
-        }
-        else if( 4 == node.Size() )
+        if( allNumbers )
         {
-          if( OptionalVector4 v = IsVector4(node) )
+          // prefer finding vectors over presuming composite Property::Array...
+          if( OptionalMatrix v = IsMatrix( node ) )
           {
             value = *v;
             done = true;
           }
-        }
-        else
-        {
-          value = Property::Value(Property::ARRAY);
-          Property::Array* array = value.GetArray();
-
-          if( array )
+          else if( OptionalMatrix3 v = IsMatrix3( node ) )
           {
-            for(TreeConstIter iter = node.CBegin(); iter != node.CEnd(); ++iter)
-            {
-              Property::Value childValue;
-              if( SetPropertyFromNode( (*iter).second, childValue, replacer ) )
-              {
-                array->PushBack( childValue );
-                done = true;
-              }
-            }
+            value = *v;
+            done = true;
           }
-        }
-      }
-
-      if(!done)
-      {
-        // presume an array or map
-        // container of size 1
-        TreeNode::ConstIterator iter = node.CBegin();
-
-        // its seems legal with current json parser for a map to have an empty key
-        // but here we take that to mean the structure is a list
-        if( ((*iter).first) == 0 )
-        {
-          value = Property::Value(Property::ARRAY);
-          Property::Array* array = value.GetArray();
-
-          if( array )
+          else if( OptionalVector4 v = IsVector4( node ) )
           {
-            for(unsigned int i = 0; i < node.Size(); ++i, ++iter)
-            {
-              Property::Value childValue;
-              if( SetPropertyFromNode( (*iter).second, childValue, replacer ) )
-              {
-                array->PushBack( childValue );
-                done = true;
-              }
-            }
+            value = *v;
+            done = true;
           }
-        }
-        else
-        {
-          value = Property::Value(Property::MAP);
-          Property::Map* map = value.GetMap();
-
-          if( map )
+          else if( OptionalVector3 v = IsVector3( node ) )
           {
-            for(unsigned int i = 0; i < node.Size(); ++i, ++iter)
+            value = *v;
+            done = true;
+          }
+          else if( OptionalVector2 v = IsVector2( node ) )
+          {
+            value = *v;
+            done = true;
+          }
+          else if( 4 == node.Size() )
+          {
+            if( OptionalVector4 v = IsVector4( node ) )
             {
-              Property::Value childValue;
-              if( SetPropertyFromNode( (*iter).second, childValue, replacer ) )
-              {
-                map->Insert( (*iter).first, childValue );
-                done = true;
-              }
+              value = *v;
+              done = true;
             }
           }
         }
-      } // if!done
+      }
     } // if node.size()
-    else // if( 0 == node.size() )
+    else if( ( nodeType != TreeNode::OBJECT ) && ( nodeType != TreeNode::ARRAY ) )
     {
       // no children so either one of bool, float, integer, string
-      OptionalBoolean aBool    = replacer.IsBoolean(node);
-      OptionalInteger anInt    = replacer.IsInteger(node);
-      OptionalFloat   aFloat   = replacer.IsFloat(node);
-      OptionalString  aString  = replacer.IsString(node);
+      OptionalBoolean aBool    = replacer.IsBoolean( node );
+      OptionalInteger anInt    = replacer.IsInteger( node );
+      OptionalFloat   aFloat   = replacer.IsFloat( node );
+      OptionalString  aString  = replacer.IsString( node );
 
-      if(aBool)
+      if( aBool )
       {
         // a bool is also an int but here we presume int
-        if(anInt)
+        if( anInt )
         {
           value = *anInt;
-          done = true;
         }
         else
         {
           value = *aBool;
-          done = true;
         }
       }
       else
@@ -582,31 +507,71 @@ bool SetPropertyFromNode( const TreeNode& node, Property::Value& value,
         // {"value":"123"}
         // {"value":123}
         // This means we can't have a string with purely numeric content without disambiguation.
-        if(aFloat)
+        if( aFloat )
         {
           value = *aFloat;
-          done = true;
         }
-        else if(anInt)
+        else if( anInt )
         {
           value = *anInt;
-          done = true;
         }
         else
         {
           // string always succeeds with the current json parser so its last
           value = *aString;
-          done = true;
         }
-
       } // if aBool
 
+      done = true;
     } // if( node.size() )
 
-  } // if Disambiguated()
+    // If we have not created a value so far, attempt to create a Map or Array.
+    if( !done )
+    {
+      // We are guaranteed to have at least one entry as this has been checked already.
+      TreeConstIter containerIterator = node.CBegin();
+      TreeConstIter containerEnd = node.CEnd();
 
-  return done;
-} // bool SetPropertyFromNode( const TreeNode& node, Property::Value& value )
+      // The TreeNode::OBJECT type implies a Property::Map.
+      if( nodeType == TreeNode::OBJECT )
+      {
+        // We have a key, treat container as a Map.
+        value = Property::Value( Property::MAP );
+        Property::Map* map = value.GetMap();
+
+        if( map )
+        {
+          // Iterate through container to add all entries.
+          for( ; containerIterator != containerEnd; ++containerIterator )
+          {
+            Property::Value childValue;
+            DeterminePropertyFromNode( ( *containerIterator ).second, childValue, replacer );
+            map->Insert( ( *containerIterator ).first, childValue );
+          }
+        }
+      }
+      else
+      {
+        // We don't have a key, treat container as an array.
+        // Note: We don't check if the node type is array here, as we want to cope with unknowns by creating an array also.
+        // This is the fall-back if no other types could be created.
+        value = Property::Value( Property::ARRAY );
+        Property::Array* array = value.GetArray();
+
+        if( array )
+        {
+          // Iterate through container to add all entries.
+          for( ; containerIterator != containerEnd; ++containerIterator )
+          {
+            Property::Value childValue;
+            DeterminePropertyFromNode( ( *containerIterator ).second, childValue, replacer );
+            array->PushBack( childValue );
+          }
+        }
+      }
+    } // if !done
+  } // if !Disambiguated()
+}
 
 
 } // namespace Internal
index ed22ef3..55809bd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
@@ -35,7 +35,7 @@ namespace Toolkit
 namespace Internal
 {
 extern Animation CreateAnimation( const TreeNode& child, Dali::Toolkit::Internal::Builder* const builder  );
-extern bool SetPropertyFromNode( const TreeNode& node, Property::Value& value );
+extern bool DeterminePropertyFromNode( const TreeNode& node, Property::Value& value );
 }
 }
 }
@@ -342,7 +342,7 @@ Property::Value GetPropertyValue(const TreeNode &child)
   if(0 == nChildren)
   {
     // cast away unused return for static analyzers
-    static_cast<void>( Dali::Toolkit::Internal::SetPropertyFromNode( child, ret ) );
+    static_cast<void>( Dali::Toolkit::Internal::DeterminePropertyFromNode( child, ret ) );
   }
   else if(1 == nChildren)
   {
@@ -484,10 +484,7 @@ void SetActionOnSignal(const TreeNode &root, const TreeNode &child, Actor actor,
       action.actorName       = *actorName;
       action.propertyName    = *propertyName;
       // actor may not exist yet so we can't check the property type
-      if( !Dali::Toolkit::Internal::SetPropertyFromNode( *valueChild, action.value ) )
-      {
-        DALI_SCRIPT_WARNING("Cannot set property for set property action\n");
-      }
+      Dali::Toolkit::Internal::DeterminePropertyFromNode( *valueChild, action.value );
       connector.Connect( action );
     }
     else
diff --git a/dali-toolkit/public-api/controls/control-depth-index-ranges.h b/dali-toolkit/public-api/controls/control-depth-index-ranges.h
deleted file mode 100644 (file)
index 684d258..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef __DALI_TOOLKIT_CONTROL_DEPTH_INDEX_RANGES_H__
-#define __DALI_TOOLKIT_CONTROL_DEPTH_INDEX_RANGES_H__
-
-/*
- * 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 <dali/public-api/actors/layer.h>
-
-namespace Dali
-{
-namespace Toolkit
-{
-/**
- * @addtogroup dali_toolkit_controls
- * @{
- */
-
-/**
- * @DEPRECATED_1_1.16
- *
- * @brief These depth indices should not be used.
- * @SINCE_1_0.0
- */
-enum DepthIndexRanges
-{
-    BACKGROUND_DEPTH_INDEX    = static_cast<int>( -Dali::Layer::TREE_DEPTH_MULTIPLIER * 0.1f ), ///< @DEPRECATED_1_1.16 @SINCE_1_0.0
-    CONTENT_DEPTH_INDEX       = 0,                                                              ///< @DEPRECATED_1_1.16 @SINCE_1_0.0
-    DECORATION_DEPTH_INDEX    = static_cast<int>( Dali::Layer::TREE_DEPTH_MULTIPLIER * 0.1f )   ///< @DEPRECATED_1_1.16 @SINCE_1_0.0
-};
-
-/**
- * @}
- */
-}
-
-}
-
-#endif
index afebe0a..5586f32 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 18;
+const unsigned int TOOLKIT_MICRO_VERSION = 19;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index d326e26..e96c57d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.1.18
+Version:    1.1.19
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT