From 88b085f3b44c7c123c1119bb0326cc54aae1ddea Mon Sep 17 00:00:00 2001 From: Xiangyin Ma Date: Tue, 26 Apr 2016 17:54:59 +0100 Subject: [PATCH] Remove ImageActor from Builder & some doxygen update Change-Id: I0c41dec882acda9dc9990b5a1db51d783d9cb03f --- .../src/dali-toolkit/utc-Dali-Builder.cpp | 137 +++++---------------- dali-toolkit/devel-api/builder/builder.cpp | 5 - dali-toolkit/devel-api/builder/builder.h | 9 -- .../devel-api/controls/shadow-view/shadow-view.h | 2 +- dali-toolkit/internal/builder/builder-actor.cpp | 17 --- .../internal/builder/builder-animations.cpp | 25 +--- dali-toolkit/internal/builder/builder-impl.cpp | 122 +++++------------- dali-toolkit/internal/builder/builder-impl.h | 15 +-- .../page-turn-view/page-turn-book-spine-effect.h | 2 +- .../controls/renderers/image/image-renderer.h | 36 +++--- .../cube-transition-effect-impl.h | 2 +- .../public-api/controls/table-view/table-view.h | 2 +- docs/content/example-code/properties.cpp | 6 +- docs/content/programming-guide/handle-body-idiom.h | 5 +- docs/content/programming-guide/properties.h | 12 +- docs/content/programming-guide/scroll-view.h | 3 +- plugins/dali-script-v8/docs/content/animation.js | 2 +- plugins/dali-script-v8/docs/content/image-view.js | 6 +- .../dali-script-v8/docs/content/item-factory.js | 2 +- 19 files changed, 102 insertions(+), 308 deletions(-) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp index 2fb0f0c..3dae0c1 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp @@ -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() == true ); + index = actor.GetPropertyIndex("newAnimatableproperty"); + DALI_TEST_CHECK( Property::INVALID_INDEX != index ); + value = actor.GetProperty(index); + DALI_TEST_CHECK( value.Get() == 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" diff --git a/dali-toolkit/devel-api/builder/builder.cpp b/dali-toolkit/devel-api/builder/builder.cpp index f89b622..4270b1e 100644 --- a/dali-toolkit/devel-api/builder/builder.cpp +++ b/dali-toolkit/devel-api/builder/builder.cpp @@ -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 ); diff --git a/dali-toolkit/devel-api/builder/builder.h b/dali-toolkit/devel-api/builder/builder.h index 39fed86..0526510 100644 --- a/dali-toolkit/devel-api/builder/builder.h +++ b/dali-toolkit/devel-api/builder/builder.h @@ -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. diff --git a/dali-toolkit/devel-api/controls/shadow-view/shadow-view.h b/dali-toolkit/devel-api/controls/shadow-view/shadow-view.h index bbe4f91..2df4978 100644 --- a/dali-toolkit/devel-api/controls/shadow-view/shadow-view.h +++ b/dali-toolkit/devel-api/controls/shadow-view/shadow-view.h @@ -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 ); diff --git a/dali-toolkit/internal/builder/builder-actor.cpp b/dali-toolkit/internal/builder/builder-actor.cpp index 3807b08..8369c62 100644 --- a/dali-toolkit/internal/builder/builder-actor.cpp +++ b/dali-toolkit/internal/builder/builder-actor.cpp @@ -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; } diff --git a/dali-toolkit/internal/builder/builder-animations.cpp b/dali-toolkit/internal/builder/builder-animations.cpp index 980fc90..beec9eb 100644 --- a/dali-toolkit/internal/builder/builder-animations.cpp +++ b/dali-toolkit/internal/builder/builder-animations.cpp @@ -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) diff --git a/dali-toolkit/internal/builder/builder-impl.cpp b/dali-toolkit/internal/builder/builder-impl.cpp index 2cf23db..f31bf5f 100644 --- a/dali-toolkit/internal/builder/builder-impl.cpp +++ b/dali-toolkit/internal/builder/builder-impl.cpp @@ -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 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 ); diff --git a/dali-toolkit/internal/builder/builder-impl.h b/dali-toolkit/internal/builder/builder-impl.h index a5d6f06..dc0ab41 100644 --- a/dali-toolkit/internal/builder/builder-impl.h +++ b/dali-toolkit/internal/builder/builder-impl.h @@ -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 ImageLut; ImageLut mFrameBufferImageLut; - typedef std::map ShaderEffectLut; - ShaderEffectLut mShaderEffectLut; - typedef std::map PathLut; PathLut mPathLut; diff --git a/dali-toolkit/internal/controls/page-turn-view/page-turn-book-spine-effect.h b/dali-toolkit/internal/controls/page-turn-view/page-turn-book-spine-effect.h index f9e87fb..73e8537 100644 --- a/dali-toolkit/internal/controls/page-turn-view/page-turn-book-spine-effect.h +++ b/dali-toolkit/internal/controls/page-turn-view/page-turn-book-spine-effect.h @@ -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. * diff --git a/dali-toolkit/internal/controls/renderers/image/image-renderer.h b/dali-toolkit/internal/controls/renderers/image/image-renderer.h index 1ae3e50..da7e100 100644 --- a/dali-toolkit/internal/controls/renderers/image/image-renderer.h +++ b/dali-toolkit/internal/controls/renderers/image/image-renderer.h @@ -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 diff --git a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h index 25d1e1c..35319bf 100644 --- a/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h +++ b/dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h @@ -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); diff --git a/dali-toolkit/public-api/controls/table-view/table-view.h b/dali-toolkit/public-api/controls/table-view/table-view.h index 88403ce..94257ee 100644 --- a/dali-toolkit/public-api/controls/table-view/table-view.h +++ b/dali-toolkit/public-api/controls/table-view/table-view.h @@ -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 diff --git a/docs/content/example-code/properties.cpp b/docs/content/example-code/properties.cpp index dcbb47f..d0f8923 100644 --- a/docs/content/example-code/properties.cpp +++ b/docs/content/example-code/properties.cpp @@ -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 diff --git a/docs/content/programming-guide/handle-body-idiom.h b/docs/content/programming-guide/handle-body-idiom.h index 6bd8a9b..05be5f1 100644 --- a/docs/content/programming-guide/handle-body-idiom.h +++ b/docs/content/programming-guide/handle-body-idiom.h @@ -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); diff --git a/docs/content/programming-guide/properties.h b/docs/content/programming-guide/properties.h index b445a2e..43d6419 100644 --- a/docs/content/programming-guide/properties.h +++ b/docs/content/programming-guide/properties.h @@ -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 } } ] diff --git a/docs/content/programming-guide/scroll-view.h b/docs/content/programming-guide/scroll-view.h index cd0307c..981e4da 100644 --- a/docs/content/programming-guide/scroll-view.h +++ b/docs/content/programming-guide/scroll-view.h @@ -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 diff --git a/plugins/dali-script-v8/docs/content/animation.js b/plugins/dali-script-v8/docs/content/animation.js index 931aee7..fbff9bd 100644 --- a/plugins/dali-script-v8/docs/content/animation.js +++ b/plugins/dali-script-v8/docs/content/animation.js @@ -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 }; diff --git a/plugins/dali-script-v8/docs/content/image-view.js b/plugins/dali-script-v8/docs/content/image-view.js index 19a0502..3b61fc2 100644 --- a/plugins/dali-script-v8/docs/content/image-view.js +++ b/plugins/dali-script-v8/docs/content/image-view.js @@ -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 }; diff --git a/plugins/dali-script-v8/docs/content/item-factory.js b/plugins/dali-script-v8/docs/content/item-factory.js index 228f745..8f0c3ed 100644 --- a/plugins/dali-script-v8/docs/content/item-factory.js +++ b/plugins/dali-script-v8/docs/content/item-factory.js @@ -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], -- 2.7.4