Merge "Moved StyleManager to the public API" into devel/master
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Thu, 28 Apr 2016 12:33:32 +0000 (05:33 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 28 Apr 2016 12:33:32 +0000 (05:33 -0700)
29 files changed:
automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp
build/tizen/docs/dali.doxy.in
dali-toolkit/devel-api/builder/builder.cpp
dali-toolkit/devel-api/builder/builder.h
dali-toolkit/devel-api/controls/flex-container/flex-container.h
dali-toolkit/devel-api/controls/popup/popup.h
dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h
dali-toolkit/devel-api/controls/shadow-view/shadow-view.h
dali-toolkit/devel-api/image-atlas/image-atlas.h
dali-toolkit/devel-api/shader-effects/dissolve-effect.h
dali-toolkit/devel-api/shader-effects/motion-blur-effect.h
dali-toolkit/internal/builder/builder-actor.cpp
dali-toolkit/internal/builder/builder-animations.cpp
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/builder-impl.h
dali-toolkit/internal/controls/flex-container/flex-container-impl.h
dali-toolkit/internal/controls/page-turn-view/page-turn-book-spine-effect.h
dali-toolkit/internal/controls/renderers/image/image-renderer.h
dali-toolkit/internal/controls/renderers/svg/nanosvg/nanosvg.cc
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h
dali-toolkit/public-api/controls/table-view/table-view.h
doc/dali-toolkit-doc.h
docs/content/example-code/properties.cpp
docs/content/programming-guide/handle-body-idiom.h
docs/content/programming-guide/properties.h
docs/content/programming-guide/scroll-view.h
plugins/dali-script-v8/docs/content/animation.js
plugins/dali-script-v8/docs/content/image-view.js
plugins/dali-script-v8/docs/content/item-factory.js

index 2fb0f0c..3dae0c1 100644 (file)
@@ -432,7 +432,7 @@ int UtcDaliBuilderConstantsP(void)
       "  \"parentOrigin\": \"TOP_LEFT\","
       "  \"anchorPoint\": \"{ANCHOR}\","
       "  \"padding\": \"{PADDING}\","
-      "  \"image\": { \"imageUrl\": \"dir/{IMAGE_PATH}\" },"
+      "  \"image\": { \"url\": \"dir/{IMAGE_PATH}\" },"
       "  \"sizeWidth\": \"{WIDTH}\","
       "  \"signals\": [{"
       "    \"name\": \"touched\","
@@ -863,9 +863,12 @@ int UtcDaliBuilderCustomPropertyP(void)
       "      \"name\": \"touched\",\n"
       "      \"action\": \"quit\"\n"
       "    }],\n"
-      "    \"customProperties\": {\n"
+      "    \"properties\": {\n"
       "      \"newproperty\": true\n"
       "    },\n"
+      "    \"animatableProperties\": {\n"
+      "      \"newAnimatableproperty\": 3\n"
+      "    },\n"
       "    \"actors\": [\n"
       "      {\n"
       "        \"type\":\"ImageView\",\n"
@@ -889,10 +892,15 @@ int UtcDaliBuilderCustomPropertyP(void)
   Property::Value value = actor.GetProperty(index);
   DALI_TEST_CHECK( value.Get<bool>() == true );
 
+  index = actor.GetPropertyIndex("newAnimatableproperty");
+  DALI_TEST_CHECK( Property::INVALID_INDEX != index );
+  value = actor.GetProperty(index);
+  DALI_TEST_CHECK( value.Get<int>() == 3 );
+
   END_TEST;
 }
 
-int UtcDaliBuilderShaderEffectP(void)
+int UtcDaliBuilderCustomShaderP(void)
 {
   ToolkitTestApplication application;
 
@@ -912,11 +920,16 @@ int UtcDaliBuilderShaderEffectP(void)
     "      \"size\": [200, 200, 0],\n"
     "      \"effect\": \"Ripple2D\",\n"
     "      \"image\": {\n"
-    "        \"filename\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\",\n"
-    "        \"width\": 200,\n"
-    "        \"height\": 80,\n"
-    "        \"loadPolicy\": \"IMMEDIATE\",\n"
-    "        \"releasePolicy\": \"NEVER\"\n"
+    "        \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\",\n"
+    "        \"desiredWidth\": 200,\n"
+    "        \"desiredHeight\": 80,\n"
+    "        \"shader\": {\n"
+    "           \"fragmentShader\": \"precision mediump float;\\nuniform sampler2D sTexture;\\nuniform vec4 uColor;\\nuniform float uAmplitude;\\nuniform float uTime;\\nvarying vec2 vTexCoord;\\nvoid main()\\n{\\n  highp vec2 pos = -1.0 + 2.0 * vTexCoord;\\n  highp float len = length(pos);\\n  highp vec2 texCoord = vTexCoord + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude;\\n  gl_FragColor = texture2D(sTexture, texCoord) * uColor;}\\n\\n\"\n"
+    "        }\n"
+    "      },\n"
+    "      \"customAnimatableProperties\": {\n"
+    "         \"uAmplitude\": 0.02,\n"
+    "         \"uTime\": 0.0\n"
     "      },\n"
     "      \"signals\": [\n"
     "        {\n"
@@ -927,7 +940,6 @@ int UtcDaliBuilderShaderEffectP(void)
     "      ]\n"
     "    }\n"
     "  ],\n"
-    "  \"paths\": {},\n"
     "  \"animations\": {\n"
     "    \"Animation_1\": {\n"
     "      \"loop\":true,\n"
@@ -940,27 +952,10 @@ int UtcDaliBuilderShaderEffectP(void)
     "          \"timePeriod\": {\n"
     "            \"delay\": 0,\n"
     "            \"duration\": 10.0\n"
-    "          },\n"
-    "          \"gui-builder-timeline-color\": \"#8dc0da\"\n"
+    "          }\n"
     "        }\n"
     "      ]\n"
     "    }\n"
-    "  },\n"
-    "  \"shaderEffects\": {\n"
-    "    \"Ripple2D\": {\n"
-    "      \"program\": {\n"
-    "        \"vertexPrefix\": \"\",\n"
-    "        \"vertex\": \"void main(void)\\n{\\n  gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);\\n  vTexCoord = aTexCoord;\\n}\\n\\n\",\n"
-    "        \"fragmentPrefix\": \"\",\n"
-    "        \"fragment\": \"precision mediump float;\\nuniform float uAmplitude; // 0.02; (< 1)\\nuniform float uTime;\\nvoid main()\\n{\\n  highp vec2 textureSize = sTextureRect.zw - sTextureRect.xy;\\n  highp vec2 pos = -1.0 + 2.0 * vTexCoord.st/textureSize;\\n  highp float len = length(pos);\\n  highp vec2 texCoord = vTexCoord.st/textureSize + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude; \\n  gl_FragColor = texture2D(sTexture, texCoord) * uColor;\\n}\\n\\n\\n\",\n"
-    "        \"geometryType\": \"GEOMETRY_TYPE_IMAGE\"\n"
-    "      },\n"
-    "      \"geometryHints\": \"HINT_NONE\",\n"
-    "      \"gridDensity\": 0,\n"
-    "      \"loop\": true,\n"
-    "      \"uAmplitude\": 0.02,\n"
-    "      \"uTime\": 0.0\n"
-    "    }\n"
     "  }\n"
     "}\n"
 
@@ -969,10 +964,16 @@ int UtcDaliBuilderShaderEffectP(void)
   Builder builder = Builder::New();
   builder.LoadFromString( json );
 
-  ShaderEffect effect = builder.GetShaderEffect("Ripple2D");
+  builder.AddActors ( "stage", Stage::GetCurrent().GetRootLayer() );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  Actor actor = Stage::GetCurrent().GetRootLayer().FindChildByName("Image1");
 
   // coverage
-  DALI_TEST_CHECK( effect );
+  DALI_TEST_CHECK( actor );
 
   END_TEST;
 }
@@ -1018,80 +1019,6 @@ int UtcDaliBuilderLoadFromStringN(void)
   END_TEST;
 }
 
-int UtcDaliBuilderShaderEffect2P(void)
-{
-  ToolkitTestApplication application;
-
-  // JSON with a quit event when the actor is touched
-  std::string json(
-    "{\n"
-    "\"templates\":\n"
-    "{\n"
-    "  \"imageTree\": { \n"
-    "    \"type\": \"ImageView\",\n"
-    "    \"size\": [100,100,1],\n"
-    "    \"parentOrigin\": [0.5, 0.5, 0.5],\n"
-    "    \"position\": [\n"
-    "      0.40461349487305,\n"
-    "      0.9150390625,\n"
-    "      0.0\n"
-    "    ],\n"
-    "    \"signals\": [{\n"
-    "      \"name\": \"touched\",\n"
-    "      \"action\": \"quit\"\n"
-    "    }],\n"
-    "    \"actors\": [\n"
-    "      {\n"
-    "        \"type\":\"ImageView\",\n"
-    "        \"name\":\"childImage\" \n"
-    "      }\n"
-    "    ]\n"
-    "  }\n"
-    "},\n"
-    "  \"stage\": [\n"
-    "    {\n"
-    "      \"type\": \"imageTree\",\n"
-    "      \"name\": \"Image1\",\n"
-    "      \"effect\": \"Ripple2D\",\n"
-    "      \"image\": \"offscreen\""
-    "    }\n"
-    "  ],\n"
-    "  \"shaderEffects\": {\n"
-    "    \"Ripple2D\": {\n"
-    "      \"program\": {\n"
-    "        \"vertexPrefix\": \"\",\n"
-    "        \"vertex\": \"void main(void)\\n{\\n  gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);\\n  vTexCoord = aTexCoord;\\n}\\n\\n\",\n"
-    "        \"fragmentPrefix\": \"\",\n"
-    "        \"fragment\": \"precision mediump float;\\nuniform float uAmplitude; // 0.02; (< 1)\\nuniform float uTime;\\nvoid main()\\n{\\n  highp vec2 textureSize = sTextureRect.zw - sTextureRect.xy;\\n  highp vec2 pos = -1.0 + 2.0 * vTexCoord.st/textureSize;\\n  highp float len = length(pos);\\n  highp vec2 texCoord = vTexCoord.st/textureSize + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude; \\n  gl_FragColor = texture2D(sTexture, texCoord) * uColor;\\n}\\n\\n\\n\",\n"
-    "        \"geometryType\": \"GEOMETRY_TYPE_IMAGE\"\n"
-    "      },\n"
-    "      \"geometryHints\": \"HINT_NONE\",\n"
-    "      \"gridDensity\": 0,\n"
-    "      \"loop\": true,\n"
-    "      \"uAmplitude\": 0.02,\n"
-    "      \"uTime\": 0.0\n"
-    "    }\n"
-    "  },\n"
-    "  \"frameBufferImages\": {\n"
-    "    \"offscreen\": {\n"
-    "      \"type\": \"FrameBufferImage\","
-    "      \"pixelFormat\":\"RGBA8888\","
-    "      \"width\": 400,"
-    "      \"height\": 400"
-    "    }"
-    "   }"
-    "}\n"
-
-  );
-
-  Builder builder = Builder::New();
-  builder.LoadFromString( json );
-
-  // coverage
-  DALI_TEST_CHECK( true );
-
-  END_TEST;
-}
 
 int UtcDaliBuilderAddActorsP(void)
 {
@@ -1173,7 +1100,7 @@ int UtcDaliBuilderFrameBufferP(void)
     "      \"parentOrigin\": [0.5, 0.5, 0.5],\n"
     "      \"effect\": \"Ripple2D\",\n"
     "      \"image\": {\n"
-    "        \"imageUrl\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
+    "        \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
     "      },\n"
     "      \"signals\": [\n"
     "        {\n"
@@ -1296,7 +1223,7 @@ int UtcDaliBuilderPathConstraintsP(void)
     "      \"parentOrigin\": [0.5, 0.5, 0.5],\n"
     "      \"effect\": \"Ripple2D\",\n"
     "      \"image\": {\n"
-    "        \"imageUrl\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
+    "        \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
     "      },\n"
     "      \"signals\": [\n"
     "        {\n"
index 72ed846..b14f125 100644 (file)
@@ -891,9 +891,11 @@ WARN_LOGFILE           =
 INPUT                  = @DOXYGEN_DOCS_DIR@/content \
                          @prefix@/include/dali/doc/dali-core-doc.h \
                          @prefix@/include/dali/doc/dali-adaptor-doc.h \
-                         ../../../../dali-toolkit/doc/dali-toolkit-doc.h \
+                         ../../../doc/dali-toolkit-doc.h \
                          @prefix@/include/dali/public-api \
-                         ../../../../dali-toolkit/dali-toolkit/public-api \
+                         @prefix@/include/dali/devel-api \
+                         ../../../dali-toolkit/public-api \
+                         ../../../dali-toolkit/devel-api \
                          ../../../automated-tests/README.md
 
 # This tag can be used to specify the character encoding of the source files
index f89b622..4270b1e 100644 (file)
@@ -134,11 +134,6 @@ void Builder::CreateRenderTask( const std::string &name )
   GetImpl(*this).CreateRenderTask( name );
 }
 
-ShaderEffect Builder::GetShaderEffect( const std::string &name )
-{
-  return GetImpl(*this).GetShaderEffect( name );
-}
-
 FrameBufferImage Builder::GetFrameBufferImage( const std::string &name )
 {
   return GetImpl(*this).GetFrameBufferImage( name );
index 39fed86..0526510 100644 (file)
@@ -384,15 +384,6 @@ class DALI_IMPORT_API Builder : public BaseHandle
   void CreateRenderTask( const std::string &name );
 
   /**
-   * Get or create ShaderEffect from the ShaderEffect instance library.
-   * An empty handle is returned otherwise.
-   * @pre The Builder has been initialized.
-   * @param name The name of a ShaderEffect in the loaded representation
-   * @return A handle to a ShaderEffect if found, otherwise empty
-   */
-  ShaderEffect GetShaderEffect( const std::string &name );
-
-  /**
    * Get or create FrameBufferImage from the FrameBufferImage instance library.
    * An empty handle is returned otherwise.
    * @pre The Builder has been initialized.
index b8540e9..97a9bdb 100644 (file)
@@ -53,12 +53,13 @@ class FlexContainer;
  * Below is an illustration of the various directions and terms as applied to a flex
  * container with the "flex direction" defined as "row".
  *
+ * @code
  *     flex container
  *    --------------------------------------------------------------- cross start
  *    | ------------------ --------|--------------------------- |
  *    | |                | |       |                          | |
  *    | |                | |       |                          | |
- *    | |  flex item 1   | |       |    flex item 2           | |  main axis
+ *    | |  flex item 1   | |       |    flex item 2           | | main axis
  *    |-|----------------|-|-------|--------------------------|-|------------>
  *    | |                | |       |                          | |
  *    | |                | |       |                          | |
@@ -69,6 +70,7 @@ class FlexContainer;
  *    | main start                 | cross axis                 | main end
  *    |                            |                            |
  *                                 v
+ * @endcode
  *
  * @nosubgrouping
  * <h3>Per-child Custom properties for script supporting:</h3>
index b0bf93d..6251c01 100644 (file)
@@ -215,7 +215,7 @@ public:
   /**
    * @brief Sets the actor to use for a footer in this Popup.
    *
-   * @param[in] control The footer actor to be added to this Popup
+   * @param[in] footer The footer actor to be added to this Popup
    */
   void SetFooter( Actor footer );
 
index be5db96..fe31a7e 100644 (file)
@@ -99,7 +99,7 @@ public:
    * Depth-index controls draw-order for overlapping renderers.
    * Renderer with higher depth indices are rendered in front of other renderer with smaller values
    *
-   * @param[in] depthIndex The depth index of this renderer.
+   * @param[in] index The depth index of this renderer.
    */
   void SetDepthIndex( float index );
 
index bbe4f91..2df4978 100644 (file)
@@ -69,7 +69,7 @@ class ShadowView;
  *  ImageView imageView = ImageView::New(image);
  *  imageView.SetParentOrigin( ParentOrigin::CENTER );
  *  imageView.SetAnchorPoint( AnchorPoint::CENTER );
- *  shadowView.Add(imageActor);\n Add the renderable actor to the shadow view
+ *  shadowView.Add(imageView);\n Add the renderable actor to the shadow view
  *
  *  ImageView shadowPlaneBg = ImageView::New(); //This will be the shadow plane
  *  shadowPlaneBg.SetParentOrigin( ParentOrigin::CENTER );
index 315584a..395615d 100644 (file)
@@ -83,7 +83,7 @@ public:
   /**
    * @brief This assignment operator is required for (smart) pointer semantics.
    *
-   * @param [in] rhs  A reference to the copied handle
+   * @param [in] handle  A reference to the copied handle
    * @return A reference to this
    */
   ImageAtlas& operator=( const ImageAtlas& handle );
index 0825a5d..5c929b9 100644 (file)
@@ -35,9 +35,10 @@ namespace Toolkit
  * As we use the texture coordinate as pixel position to calculate random offset,
  * the line should passing through rectangle {(0,0),(0,1),(1,0),(1,1)},
  * so make the position parameter with two component values between 0.0 to 1.0
+ * @param[in] actor The actor that registers the uniform properties
  * @param[in] position The point ( locates within rectangle {(0,0),(0,1),(1,0),(1,1)} ) passed through by the central line
  * @param[in] displacement The direction of the central line
- * @param[in] initialProgress, the normalised initial progress of the shader
+ * @param[in] initialProgress The normalised initial progress of the shader
  */
 inline void DissolveEffectSetCentralLine( Actor& actor, const Vector2& position, const Vector2& displacement, float initialProgress )
 {
index 310e3ce..8e71791 100644 (file)
@@ -30,7 +30,8 @@ namespace Toolkit
 /**
  * @brief Set the properties for the motion blur
  *
- * @param numBlurSamples Number of samples used by the shader
+ * @param[in] actor The actor that registers the uniform properties
+ * @param[in] numBlurSamples Number of samples used by the shader
  */
 inline void SetMotionBlurProperties( Actor& actor, unsigned int numBlurSamples = 8 )
 {
index 3807b08..8369c62 100644 (file)
@@ -71,23 +71,6 @@ Actor SetupActor( const TreeNode& child, Actor& actor, const Replacement& consta
     }
   }
 
-  // Add custom properties
-  if( OptionalChild customPropertiesChild = IsChild(child,  "customProperties") )
-  {
-    const TreeNode& customPropertiesNode = *customPropertiesChild;
-    const TreeConstIter endIter = customPropertiesNode.CEnd();
-    for( TreeConstIter iter = customPropertiesNode.CBegin(); endIter != iter; ++iter )
-    {
-      const TreeNode::KeyNodePair& keyChild = *iter;
-      std::string key( keyChild.first );
-
-      Property::Value value;
-      DeterminePropertyFromNode( keyChild.second, value, constant );
-      // Register/Set property.
-      actor.RegisterProperty( key, value, Property::READ_WRITE );
-    }
-  }
-
   return actor;
 }
 
index 980fc90..beec9eb 100644 (file)
@@ -229,31 +229,8 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D
         // to allow animating shader uniforms
         if( propIndex == Property::INVALID_INDEX )
         {
-          ImageActor imageActor = ImageActor::DownCast( targetHandle );
-          if( imageActor )
-          {
-            // A limitation here is that its possible that between creation of animation
-            // and running it the ShaderEffect of the actor has been changed.
-            // However this is a unlikely use case especially when using scripts.
-            if( ShaderEffect effect = imageActor.GetShaderEffect() )
-            {
-              propIndex = effect.GetPropertyIndex( *property );
-              if(propIndex != Property::INVALID_INDEX)
-              {
-                targetHandle = effect;
-              }
-              else
-              {
-                DALI_SCRIPT_WARNING( "Cannot find property on object or ShaderEffect\n" );
-                continue;
-              }
-            }
-          }
-          else
-          {
-            DALI_SCRIPT_WARNING( "Cannot find property on object or ShaderEffect\n" );
+            DALI_SCRIPT_WARNING( "Cannot find property on object\n" );
             continue;
-          }
         }
 
         if( propIndex == Property::INVALID_INDEX)
index 2cf23db..f31bf5f 100644 (file)
@@ -79,6 +79,9 @@ const std::string KEYNAME_TEMPLATES = "templates";
 const std::string KEYNAME_INCLUDES  = "includes";
 const std::string KEYNAME_MAPPINGS  = "mappings";
 
+const std::string PROPERTIES = "properties";
+const std::string ANIMATABLE_PROPERTIES = "animatableProperties";
+
 typedef std::vector<const TreeNode*> TreeNodeList;
 
 
@@ -153,68 +156,10 @@ void Builder::SetProperties( const TreeNode& node, Handle& handle, const Replace
         continue;
       }
 
-      // special field 'image' usually contains an json object description
-      // although sometimes refers to a framebuffer
-      if( key == "image" )
-      {
-        if( 0 == keyChild.second.Size() )
-        {
-          ImageActor imageActor = ImageActor::DownCast(handle);
-          if(imageActor)
-          {
-            if( OptionalString s = constant.IsString( keyChild.second ) )
-            {
-              FrameBufferImage fb = GetFrameBufferImage(*s, constant);
-              if(fb)
-              {
-                imageActor.SetImage( fb );
-              }
-            }
-          }
-        }
-      }
-
-      // special field 'effect' references the shader effect instances
-      if( key == "effect" )
-      {
-        ImageActor actor = ImageActor::DownCast(handle);
-        if( actor )
-        {
-          OptionalString str = constant.IsString( keyChild.second );
-          if( str )
-          {
-            ShaderEffect effect = GetShaderEffect( *str, constant );
-            actor.SetShaderEffect(effect);
-          }
-        }
-        else
-        {
-          DALI_SCRIPT_WARNING("Could not find or set shader effect\n");
-        }
-
-        continue;
-      }
-
       Handle propertyObject( handle );
 
       Dali::Property::Index index = propertyObject.GetPropertyIndex( key );
 
-      if( Property::INVALID_INDEX == index )
-      {
-        ImageActor actor = ImageActor::DownCast(handle);
-        if( actor )
-        {
-          if( ShaderEffect effect = actor.GetShaderEffect() )
-          {
-            index = effect.GetPropertyIndex( key );
-            if(index != Property::INVALID_INDEX)
-            {
-              propertyObject = effect;
-            }
-          }
-        }
-      }
-
       if( Property::INVALID_INDEX != index )
       {
         Property::Type type = propertyObject.GetPropertyType(index);
@@ -253,6 +198,10 @@ void Builder::SetProperties( const TreeNode& node, Handle& handle, const Replace
         DALI_SCRIPT_VERBOSE("SetProperty INVALID '%s' Index=:%d\n", key.c_str(), index);
       }
 
+      // Add custom properties
+      SetCustomProperties(node, handle, constant, PROPERTIES, Property::READ_WRITE);
+      SetCustomProperties(node, handle, constant, ANIMATABLE_PROPERTIES, Property::ANIMATABLE);
+
     } // for property nodes
   }
   else
@@ -261,6 +210,27 @@ void Builder::SetProperties( const TreeNode& node, Handle& handle, const Replace
   }
 }
 
+void Builder::SetCustomProperties( const TreeNode& node, Handle& handle, const Replacement& constant,
+                          const std::string& childName, Property::AccessMode accessMode )
+{
+  // Add custom properties
+  if( OptionalChild customPropertiesChild = IsChild(node, childName) )
+  {
+    const TreeNode& customPropertiesNode = *customPropertiesChild;
+    const TreeConstIter endIter = customPropertiesNode.CEnd();
+    for( TreeConstIter iter = customPropertiesNode.CBegin(); endIter != iter; ++iter )
+    {
+      const TreeNode::KeyNodePair& keyChild = *iter;
+      std::string key( keyChild.first );
+
+      Property::Value value;
+      DeterminePropertyFromNode( keyChild.second, value, constant );
+      // Register/Set property.
+      handle.RegisterProperty( key, value, accessMode );
+    }
+  }
+}
+
 // Set properties from node on handle.
 void Builder::ApplyProperties( const TreeNode& root, const TreeNode& node,
                                Dali::Handle& handle, const Replacement& constant )
@@ -590,42 +560,6 @@ void Builder::CreateRenderTask( const std::string &name )
   }
 }
 
-ShaderEffect Builder::GetShaderEffect( const std::string &name)
-{
-  Replacement constant( mReplacementMap );
-  return GetShaderEffect( name, constant );
-}
-
-ShaderEffect Builder::GetShaderEffect( const std::string &name, const Replacement& constant )
-{
-  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
-
-  ShaderEffect ret;
-
-  ShaderEffectLut::const_iterator iter( mShaderEffectLut.find( name ) );
-  if( iter != mShaderEffectLut.end() )
-  {
-    ret = iter->second;
-  }
-  else
-  {
-    if( OptionalChild effects = IsChild( *mParser.GetRoot(), "shaderEffects") )
-    {
-      if( OptionalChild effect = IsChild( *effects, name ) )
-      {
-        Dali::Property::Value propertyMap(Property::MAP);
-        if( DeterminePropertyFromNode( *effect, Property::MAP, propertyMap, constant ) )
-        {
-          ret = Dali::Scripting::NewShaderEffect( propertyMap );
-          mShaderEffectLut[ name ] = ret;
-        }
-      }
-    }
-  }
-
-  return ret;
-}
-
 FrameBufferImage Builder::GetFrameBufferImage( const std::string &name )
 {
   Replacement constant( mReplacementMap );
index a5d6f06..dc0ab41 100644 (file)
@@ -163,16 +163,6 @@ public:
   void CreateRenderTask( const std::string &name );
 
   /**
-   * @copydoc Toolkit::Builder::GetShaderEffect
-   */
-  ShaderEffect GetShaderEffect( const std::string &name );
-
-  /**
-   * @copydoc Toolkit::Builder::GetShaderEffect
-   */
-  ShaderEffect GetShaderEffect( const std::string &name, const Replacement& constant );
-
-  /**
    * @copydoc Toolkit::Builder::GetFrameBufferImage
    */
   FrameBufferImage GetFrameBufferImage( const std::string &name );
@@ -234,15 +224,14 @@ private:
 
   void SetupTask( RenderTask& task, const Toolkit::TreeNode& node, const Replacement& replacement );
 
+  void SetCustomProperties( const TreeNode& node, Handle& handle, const Replacement& constant, const std::string& childName, Property::AccessMode accessMode );
+
 private:
   Toolkit::JsonParser mParser;
 
   typedef std::map<const std::string, FrameBufferImage> ImageLut;
   ImageLut mFrameBufferImageLut;
 
-  typedef std::map<const std::string, ShaderEffect> ShaderEffectLut;
-  ShaderEffectLut mShaderEffectLut;
-
   typedef std::map<const std::string, Path> PathLut;
   PathLut mPathLut;
 
index 58c25b6..17ea2b6 100644 (file)
@@ -250,20 +250,20 @@ private: // Data
 
 // Helpers for public-api forwarding methods
 
-inline Toolkit::Internal::FlexContainer& GetImpl( Toolkit::FlexContainer& tableView )
+inline Toolkit::Internal::FlexContainer& GetImpl( Toolkit::FlexContainer& flexContainer )
 {
-  DALI_ASSERT_ALWAYS(tableView);
+  DALI_ASSERT_ALWAYS(flexContainer);
 
-  Dali::RefObject& handle = tableView.GetImplementation();
+  Dali::RefObject& handle = flexContainer.GetImplementation();
 
   return static_cast<Toolkit::Internal::FlexContainer&>(handle);
 }
 
-inline const Toolkit::Internal::FlexContainer& GetImpl( const Toolkit::FlexContainer& tableView )
+inline const Toolkit::Internal::FlexContainer& GetImpl( const Toolkit::FlexContainer& flexContainer )
 {
-  DALI_ASSERT_ALWAYS(tableView);
+  DALI_ASSERT_ALWAYS(flexContainer);
 
-  const Dali::RefObject& handle = tableView.GetImplementation();
+  const Dali::RefObject& handle = flexContainer.GetImplementation();
 
   return static_cast<const Toolkit::Internal::FlexContainer&>(handle);
 }
index f9e87fb..73e8537 100644 (file)
@@ -35,7 +35,7 @@ namespace Internal
  *
  * When the page is turned over in landscape, call
  * SetIsBackImageVisible(true), this effect can display the back image
- * correctly after the imageActor been rotated 180 degrees.  To
+ * correctly after the page been rotated 180 degrees.  To
  * display the pages visually consistent with its turning state,
  * please set the uniforms with the same values as the PageTurnEffect.
  *
index 1ae3e50..da7e100 100644 (file)
@@ -48,28 +48,28 @@ typedef IntrusivePtr< ImageRenderer > ImageRendererPtr;
  *
  * | %Property Name          | Type             |
  * |-------------------------|------------------|
- * | imageUrl                | STRING           |
- * | imageFittingMode        | STRING           |
- * | imageSamplingMode       | STRING           |
- * | imageDesiredWidth       | INT              |
- * | imageDesiredHeight      | INT              |
+ * | url                | STRING           |
+ * | fittingMode        | STRING           |
+ * | samplingMode       | STRING           |
+ * | desiredWidth       | INT              |
+ * | desiredHeight      | INT              |
  *
  * where imageFittingMode should be one of the following fitting modes:
- *   "shrinkToFit"
- *   "scaleToFill"
- *   "fitWidth"
- *   "fitHeight"
- *   "default"
+ *   "SHRINK_TO_FIT"
+ *   "SCALE_TO_FIT"
+ *   "FIT_WIDTH"
+ *   "FIT_HEIGHT"
+ *   "DEFAULT"
  *
  * where imageSamplingMode should be one of the following sampling modes:
- *   "box"
- *   "nearest"
- *   "linear"
- *   "boxThenNearest"
- *   "boxThenLinear"
- *   "noFilter"
- *   "dontCare"
- *   "default"
+ *   "BOX"
+ *   "NEAREST"
+ *   "LINEAR"
+ *   "BOX_THEN_NEAREST"
+ *   "BOX_THEN_LINEAR"
+ *   "NO_FILTER"
+ *   "DONT_CARE"
+ *   "DEFAULT"
  *
  */
 class ImageRenderer: public ControlRenderer, public ConnectionTracker
index 820e619..e52cb15 100644 (file)
@@ -1244,7 +1244,12 @@ static NSVGcoordinate nsvg__parseCoordinateRaw(const char* str)
 {
     NSVGcoordinate coord = {0, NSVG_UNITS_USER};
     char units[32]="";
-    sscanf(str, "%f%s", &coord.value, units);
+
+    /**
+     * In the original file, the formatted data reading did not specify the string with width limitation.
+     * To prevent the possible overflow, we replace '%s' with '%32s' here.
+     */
+    sscanf(str, "%f%32s", &coord.value, units);
     coord.units = nsvg__parseUnits(units);
     return coord;
 }
index 25d1e1c..35319bf 100644 (file)
@@ -166,7 +166,7 @@ private:
 
   /**
    * Callback function of transition animation finished
-   * Hide transition layer, show current imageActor, and set isAnimating flag to false
+   * Hide transition layer, show current image, and set isAnimating flag to false
    * @param[in] source The cube transition animation
    */
   void OnTransitionFinished(Animation& source);
index 88403ce..94257ee 100644 (file)
@@ -73,7 +73,7 @@ class TableView;
  * "image": {
  *    "url": "{DALI_IMAGE_DIR}gallery-small-1.jpg"
  *  },
- *  "customProperties": {
+ *  "properties": {
  *     "cellIndex":[1,1],  // property to specify the top-left cell this child occupies, if not set, the first available cell is used
  *     "rowSpan":3,        // property to specify how many rows this child occupies, if not set, default value is 1
  *     "columnSpan": 2,    // property to specify how many columns this child occupies, if nor set, default value is 1
index 784cb4d..d390f9a 100644 (file)
  *     @defgroup dali_toolkit_controls_text_controls Text Controls
  *     @brief Controls for displaying text or text input.
 
+ *     @defgroup dali_toolkit_controls_flex_container Flex Container
+ *     @brief FlexContainer is a container for Flexbox layout.
+
  *   @}
 
  *   @defgroup dali_toolkit_managers Managers
index dcbb47f..d0f8923 100644 (file)
@@ -67,9 +67,9 @@ public:
     // Set another property to set the image-map
     Property::Map imageMap;
     imageMap[ "rendererType" ] = "image";
-    imageMap[ "imageUrl" ]     = IMAGE_CARDS;
-    imageMap[ "width" ]        = 100;
-    imageMap[ "height" ]       = 100;
+    imageMap[ "url" ]          = IMAGE_CARDS;
+    imageMap[ "desiredWidth" ]        = 100;
+    imageMap[ "desiredHeight" ]       = 100;
     mImageView.SetProperty( ImageView::Property::IMAGE, imageMap );
 
     // Add the image view to the stage
index 6bd8a9b..05be5f1 100644 (file)
@@ -51,9 +51,8 @@ A common example is when an actor is added to a container with Dali::Actor::Add(
 // At this point we own a Dali::Actor named "container"
 // Enter a code block
 {
-  // Create an image actor
-  Image img = Image::New(SomeImageFile);
-  Actor actor = ImageActor::New(img);
+  // Create an image view
+  Actor actor = Toolkit::ImageView::New(SomeImageFile);
 
   // Add the image actor to a container
   container.Add(actor);
index b445a2e..43d6419 100644 (file)
@@ -224,9 +224,9 @@ imageView.parentOrigin = dali.CENTER;
 // Set an image view property
 imageView.image = {
   "rendererType" : "image",
-  "imageUrl" : "images/icon-0.png",
-  "width" : 100,
-  "height" : 100
+  "url": "images/icon-0.png",
+  "desiredWidth" : 100,
+  "desiredHeight" : 100
 };
 
 // add to the stage
@@ -253,9 +253,9 @@ This is a basic example of a button defined in JSON by setting the default prope
       "image":
       {
         "rendererType" : "image",
-        "imageUrl" : "images/icon-0.png",
-        "width" : 100,
-        "height" : 100
+        "url" : "images/icon-0.png",
+        "desiredWidth" : 100,
+        "desiredHeight" : 100
       }
     }
   ]
index cd0307c..981e4da 100644 (file)
@@ -31,8 +31,7 @@
 
    Add Actors to this ScrollView
    @code
-   Image image = Image::New(DALI_IMAGE_DIR "button-background.png");
-   ImageActor imageActor = ImageActor::New(image);
+   ImageView imageActor = Toolkit::ImageView::New(DALI_IMAGE_DIR "button-background.png");
    myScrollView.Add( imageActor );
    @endcode
 
index 931aee7..fbff9bd 100644 (file)
@@ -191,7 +191,7 @@ var shader = createColorShiftAndZoomEffect();
   
 var image = {
     "rendererType" : "image",
-    "imageUrl" : getImageDirectory()+"gallery-medium-50.jpg",
+    "url" : getImageDirectory()+"gallery-medium-50.jpg",
     "shader" : shader
 };
   
index 19a0502..3b61fc2 100644 (file)
@@ -46,9 +46,9 @@ dali.stage.add( imageView );
   
 var image = {
     "rendererType" : "image",
-    "imageUrl" : "myImage.jpg",
-    "width" : desiredWidth,   // The desired image width while loading (optional but preferable to set for efficiency)
-    "height" : desiredHeight,   // The desired image height while loading (optional but preferable to set for efficiency)
+    "url" : "myImage.jpg",
+    "desiredWidth" : desiredWidth,   // The desired image width while loading (optional but preferable to set for efficiency)
+    "desiredHeight" : desiredHeight,   // The desired image height while loading (optional but preferable to set for efficiency)
     "shader" : shader  // Optional
 };
   
index 228f745..8f0c3ed 100644 (file)
@@ -31,7 +31,7 @@
             "image":
             {
               "rendererType" : "image",
-              "imageUrl": "{icon_path}"
+              "url": "{icon_path}"
             },
             "position":[20.0, 0.0, 0.0],
             "size":[70.0, 70.0, 0.0],