Merge "Update cursor position when the default font style is changed" into devel...
authorVíctor Cebollada <v.cebollada@samsung.com>
Tue, 16 Jun 2020 09:02:11 +0000 (09:02 +0000)
committerGerrit Code Review <gerrit@review>
Tue, 16 Jun 2020 09:02:11 +0000 (09:02 +0000)
56 files changed:
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/dummy-visual.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h
automated-tests/src/dali-toolkit/utc-Dali-ArcVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ProgressBar.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.cpp [new file with mode: 0644]
dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.h [new file with mode: 0644]
dali-toolkit/devel-api/file.list
dali-toolkit/devel-api/visual-factory/visual-base.cpp
dali-toolkit/devel-api/visual-factory/visual-base.h
dali-toolkit/devel-api/visuals/arc-visual-actions-devel.h [new file with mode: 0644]
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.h
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.cpp
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.h
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp [changed mode: 0755->0644]
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp [changed mode: 0755->0644]
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/decorator/text-decorator.h
dali-toolkit/internal/text/rendering/atlas/atlas-manager.h
dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp
dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp
dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.h
dali-toolkit/internal/visuals/arc/arc-visual.cpp
dali-toolkit/internal/visuals/arc/arc-visual.h
dali-toolkit/internal/visuals/border/border-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/gradient/gradient-visual.cpp
dali-toolkit/internal/visuals/gradient/gradient.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/mesh/mesh-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/primitive/primitive-visual.cpp
dali-toolkit/internal/visuals/svg/svg-rasterize-thread.h
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/internal/visuals/visual-factory-cache.h
dali-toolkit/internal/visuals/wireframe/wireframe-visual.cpp
dali-toolkit/public-api/controls/image-view/image-view.cpp
dali-toolkit/public-api/controls/image-view/image-view.h
dali-toolkit/public-api/controls/progress-bar/progress-bar.h
dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json
dali-toolkit/styles/2048x1080/dali-toolkit-default-theme.json
dali-toolkit/styles/360x360/dali-toolkit-default-theme.json
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json

index c679479..651797e 100644 (file)
@@ -38,7 +38,7 @@ DummyVisualPtr DummyVisual::New( const Property::Map& properties )
 }
 
 DummyVisual::DummyVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::Type::COLOR ),
   mActionCounter( 0 )
 {
 }
index b9c8245..d76ce60 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -328,30 +328,6 @@ void ConstraintAppliedCheck::CheckSignalNotReceived()
   }
 }
 
-BufferImage CreateBufferImage(int32_t width, int32_t height, const Vector4& color)
-{
-  BufferImage image = BufferImage::New(width, height, Pixel::RGBA8888);
-
-  PixelBuffer* pixbuf = image.GetBuffer();
-
-  // Using a 4x4 image gives a better blend with the GL implementation
-  // than a 3x3 image
-  for(size_t i=0; i<16; i++)
-  {
-    pixbuf[i*4+0] = color.r*255;
-    pixbuf[i*4+1] = color.g*255;
-    pixbuf[i*4+2] = color.b*255;
-    pixbuf[i*4+3] = color.a*255;
-  }
-
-  return image;
-}
-
-BufferImage CreateBufferImage()
-{
-  return CreateBufferImage(4, 4, Color::WHITE);
-}
-
 void PrepareResourceImage( TestApplication& application, uint32_t imageWidth, uint32_t imageHeight, Pixel::Format pixelFormat )
 {
   TestPlatformAbstraction& platform = application.GetPlatform();
index 577ca36..94ef86a 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_SUITE_UTILS_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -393,12 +393,6 @@ struct DefaultFunctionCoverage
   }
 };
 
-
-// Helper to Create buffer image
-BufferImage CreateBufferImage();
-BufferImage CreateBufferImage(int32_t width, int32_t height, const Vector4& color);
-
-
 // Prepare a resource image to be loaded. Should be called before creating the ResourceImage
 void PrepareResourceImage( TestApplication& application, uint32_t imageWidth, uint32_t imageHeight, Pixel::Format pixelFormat );
 
index 2476e0b..d6c992e 100644 (file)
 
 #include <iostream>
 #include <stdlib.h>
-//#include <chrono>
-//#include <thread>
 #include <dali-toolkit-test-suite-utils.h>
-//#include <toolkit-timer.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/arc-visual-actions-devel.h>
 #include <dali/devel-api/rendering/renderer-devel.h>
 #include "dummy-control.h"
 
@@ -199,3 +197,77 @@ int UtcDaliArcVisualGetPropertyMap01(void)
 
   END_TEST;
 }
+
+int UtcDaliArcVisualUpdateProperty(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliArcVisualUpdateProperty" );
+
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+
+  float thickness = 20.0f;
+  float startAngle = 0.0f;
+  float sweepAngle = 90.0f;
+
+  Property::Map propertyMap;
+  propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ARC )
+             .Add( Visual::Property::MIX_COLOR, Color::RED )
+             .Add( DevelArcVisual::Property::THICKNESS, thickness )
+             .Add( DevelArcVisual::Property::START_ANGLE, startAngle )
+             .Add( DevelArcVisual::Property::SWEEP_ANGLE, sweepAngle );
+
+  Visual::Base visual = VisualFactory::Get().CreateVisual( propertyMap );
+  DALI_TEST_CHECK( visual );
+
+  DummyControl actor = DummyControl::New( true );
+  DummyControlImpl& dummyImpl = static_cast< DummyControlImpl& >( actor.GetImplementation() );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visual );
+
+  actor.SetProperty( Actor::Property::SIZE, Vector2( 200.0f, 200.0f ) );
+  Stage::GetCurrent().Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+  Property::Value* value = map.Find( DevelArcVisual::Property::THICKNESS, Property::FLOAT );
+  DALI_TEST_EQUALS( value->Get< float >(), thickness, TEST_LOCATION );
+  DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "thickness", thickness ), true, TEST_LOCATION );
+
+  value = map.Find( DevelArcVisual::Property::START_ANGLE, Property::FLOAT );
+  DALI_TEST_EQUALS( value->Get< float >(), startAngle, TEST_LOCATION );
+  DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "startAngle", startAngle ), true, TEST_LOCATION );
+
+  value = map.Find( DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT );
+  DALI_TEST_EQUALS( value->Get< float >(), sweepAngle, TEST_LOCATION );
+  DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "sweepAngle", sweepAngle ), true, TEST_LOCATION );
+
+  thickness = 10.0f;
+  startAngle = 90.0f;
+  sweepAngle = 180.0f;
+
+  Property::Map attributes;
+  attributes.Add( DevelArcVisual::Property::THICKNESS, thickness )
+            .Add( DevelArcVisual::Property::START_ANGLE, startAngle )
+            .Add( DevelArcVisual::Property::SWEEP_ANGLE, sweepAngle );
+
+  DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelArcVisual::Action::UPDATE_PROPERTY, attributes );
+
+  application.SendNotification();
+  application.Render();
+
+  map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+  value = map.Find( DevelArcVisual::Property::THICKNESS, Property::FLOAT );
+  DALI_TEST_EQUALS( value->Get< float >(), thickness, TEST_LOCATION );
+  DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "thickness", thickness ), true, TEST_LOCATION );
+
+  value = map.Find( DevelArcVisual::Property::START_ANGLE, Property::FLOAT );
+  DALI_TEST_EQUALS( value->Get< float >(), startAngle, TEST_LOCATION );
+  DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "startAngle", startAngle ), true, TEST_LOCATION );
+
+  value = map.Find( DevelArcVisual::Property::SWEEP_ANGLE, Property::FLOAT );
+  DALI_TEST_EQUALS( value->Get< float >(), sweepAngle, TEST_LOCATION );
+  DALI_TEST_EQUALS( gl.CheckUniformValue< float >( "sweepAngle", sweepAngle ), true, TEST_LOCATION );
+
+  END_TEST;
+}
index a8ce275..f812fe0 100644 (file)
@@ -23,7 +23,6 @@
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h>
 #include <dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h>
-#include <dali/public-api/images/buffer-image.h>
 #include <dali/devel-api/adaptor-framework/image-loading.h>
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
 
index 6829d98..d7aa177 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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,34 +52,6 @@ void utc_dali_toolkit_image_view_cleanup(void)
 namespace
 {
 
-const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
-  attribute mediump vec2 aPosition;\n
-  varying mediump vec2 vTexCoord;\n
-  uniform mediump mat4 uMvpMatrix;\n
-  uniform mediump vec3 uSize;\n
-  \n
-  void main()\n
-  {\n
-    mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);\n
-    vertexPosition.xyz *= uSize;\n
-    vertexPosition = uMvpMatrix * vertexPosition;\n
-    \n
-    vTexCoord = aPosition + vec2(0.5);\n
-    gl_Position = vertexPosition;\n
-  }\n
-);
-
-const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
-  varying mediump vec2 vTexCoord;\n
-  uniform sampler2D sTexture;\n
-  uniform lowp vec4 uColor;\n
-  \n
-  void main()\n
-  {\n
-    gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;\n
-  }\n
-);
-
 const char* TEST_IMAGE_FILE_NAME =  "gallery_image_01.jpg";
 const char* TEST_IMAGE_FILE_NAME2 =  "gallery_image_02.jpg";
 
@@ -96,62 +68,6 @@ const char* TEST_GIF_FILE_NAME = TEST_RESOURCE_DIR "/anim.gif";
 
 const char* TEST_VECTOR_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR  "/insta_camera.json";
 
-void TestImage( ImageView imageView, BufferImage image )
-{
-  Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
-
-  Property::Map map;
-  DALI_TEST_CHECK( value.Get( map ) );
-
-  DALI_TEST_CHECK( map.Find( "width" ) );
-  DALI_TEST_CHECK( map.Find( "height" ) );
-  DALI_TEST_CHECK( map.Find( "type" ) );
-
-  int width = 0;
-  DALI_TEST_CHECK( map[ "width" ].Get( width ) );
-  DALI_TEST_EQUALS( (unsigned int)width, image.GetWidth(), TEST_LOCATION );
-
-  int height = 0;
-  DALI_TEST_CHECK( map[ "height" ].Get( height ) );
-  DALI_TEST_EQUALS( (unsigned int)height, image.GetHeight(), TEST_LOCATION );
-
-  std::string type;
-  DALI_TEST_CHECK( map[ "type" ].Get( type ) );
-  DALI_TEST_EQUALS( type, "BufferImage", TEST_LOCATION );
-}
-
-void TestImage( ImageView imageView, ResourceImage image )
-{
-  Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
-
-  Property::Map map;
-  DALI_TEST_CHECK( value.Get( map ) );
-
-  if( map.Find( "width" ) )
-  {
-    int width = 0;
-    DALI_TEST_CHECK( map[ "width" ].Get( width ) );
-    DALI_TEST_EQUALS( (unsigned int)width, image.GetWidth(), TEST_LOCATION );
-  }
-
-  if( map.Find( "height" ) )
-  {
-    int height = 0;
-    DALI_TEST_CHECK( map[ "height" ].Get( height ) );
-    DALI_TEST_EQUALS( (unsigned int)height, image.GetHeight(), TEST_LOCATION );
-  }
-
-  DALI_TEST_CHECK( map.Find( "type" ) );
-
-  std::string type;
-  DALI_TEST_CHECK( map[ "type" ].Get( type ) );
-  DALI_TEST_EQUALS( type, "ResourceImage", TEST_LOCATION );
-
-  std::string filename;
-  DALI_TEST_CHECK( map[ "filename" ].Get( filename ) );
-  DALI_TEST_EQUALS( filename, image.GetUrl(), TEST_LOCATION );
-}
-
 void TestUrl( ImageView imageView, const std::string url )
 {
   Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
@@ -174,19 +90,6 @@ int UtcDaliImageViewNewP(void)
   END_TEST;
 }
 
-int UtcDaliImageViewNewImageP(void)
-{
-  ToolkitTestApplication application;
-
-  BufferImage image = CreateBufferImage( 100, 200, Vector4( 1.f, 1.f, 1.f, 1.f ) );
-  ImageView imageView = ImageView::New( image );
-
-  DALI_TEST_CHECK( imageView );
-  TestImage( imageView, image );
-
-  END_TEST;
-}
-
 int UtcDaliImageViewNewUrlP(void)
 {
   ToolkitTestApplication application;
@@ -302,83 +205,6 @@ int UtcDaliImageViewSetGetProperty01(void)
   END_TEST;
 }
 
-int UtcDaliImageViewSetGetProperty02(void)
-{
-  ToolkitTestApplication application;
-
-  Image image = CreateBufferImage( 10, 10, Color::WHITE );
-  ImageView imageView = ImageView::New(image);
-  Vector4 fullImageRect( 0.f, 0.f, 1.f, 1.f );
-
-  Stage::GetCurrent().Add( imageView );
-
-  application.SendNotification();
-  application.Render();
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-
-  Vector4 pixelAreaUniform;
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "pixelArea", pixelAreaUniform ) );
-  DALI_TEST_EQUALS( pixelAreaUniform, fullImageRect, TEST_LOCATION );
-
-  Property::Value value = imageView.GetProperty( ImageView::Property::PIXEL_AREA );
-  Vector4 pixelAreaValue;
-  DALI_TEST_CHECK( value.Get(pixelAreaValue) );
-  DALI_TEST_EQUALS( pixelAreaValue, fullImageRect, TEST_LOCATION );
-
-  Vector4 pixelAreaSet( 0.2f, 0.2f, 0.3f, 0.3f );
-  imageView.SetProperty( ImageView::Property::PIXEL_AREA, pixelAreaSet);
-
-  application.SendNotification();
-  application.Render();
-
-  value = imageView.GetProperty( ImageView::Property::PIXEL_AREA );
-  value.Get(pixelAreaValue);
-  DALI_TEST_EQUALS( pixelAreaValue, pixelAreaSet, TEST_LOCATION );
-
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "pixelArea", pixelAreaUniform ) );
-  DALI_TEST_EQUALS( pixelAreaUniform, pixelAreaSet, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliImageViewSetGetProperty03(void)
-{
-  ToolkitTestApplication application;
-
-  Image image = CreateBufferImage( 10, 10, Color::WHITE );
-  ImageView imageView = ImageView::New(image);
-  Stage::GetCurrent().Add( imageView );
-  application.SendNotification();
-  application.Render();
-
-  // conventional alpha blending
-  Renderer renderer = imageView.GetRendererAt( 0 );
-  Property::Value value = renderer.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
-  bool enable;
-  DALI_TEST_CHECK( value.Get( enable ) );
-  DALI_TEST_CHECK( !enable );
-
-  // pre-multiplied alpha blending
-  imageView.SetProperty( Toolkit::ImageView::Property::PRE_MULTIPLIED_ALPHA, true );
-  application.SendNotification();
-  application.Render();
-
-  int srcFactorRgb    = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_RGB );
-  int destFactorRgb   = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_RGB );
-  int srcFactorAlpha  = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_ALPHA );
-  int destFactorAlpha = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_ALPHA );
-  DALI_TEST_CHECK( srcFactorRgb == BlendFactor::ONE );
-  DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA );
-  DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE );
-  DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA );
-
-  value = renderer.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
-  DALI_TEST_CHECK( value.Get( enable ) );
-  DALI_TEST_CHECK( enable );
-
-  END_TEST;
-}
-
 int UtcDaliImageViewPreMultipliedAlphaPng(void)
 {
   ToolkitTestApplication application;
@@ -894,9 +720,8 @@ int UtcDaliImageViewSizeWithBackgroundAndImage(void)
 
   int widthBackground = 100;
   int heightBackground = 200;
-  int width = 300;
-  int height = 400;
-  Image image = CreateBufferImage( width, height, Vector4(1.f, 1.f, 1.f, 1.f) );
+  int width = 600;
+  int height = 600;
 
   ImageView imageView = ImageView::New();
 
@@ -909,7 +734,7 @@ int UtcDaliImageViewSizeWithBackgroundAndImage(void)
                           }
                        );
 
-  imageView.SetImage( image );
+  imageView.SetImage( gImage_600_RGB ); // 1 to 1 ratio, 600x600 pixels
 
   Stage::GetCurrent().Add( imageView );
   application.SendNotification();
@@ -958,9 +783,7 @@ int UtcDaliImageViewHeightForWidthBackgroundAndImage(void)
   int widthBackground = 100;
   int heightBackground = 200;
   int width = 300;
-  int height = 400;
-
-  Image image = CreateBufferImage( width, height, Vector4(1.f, 1.f, 1.f, 1.f) );
+  int height = 300;
 
   ImageView imageView = ImageView::New();
 
@@ -971,9 +794,9 @@ int UtcDaliImageViewHeightForWidthBackgroundAndImage(void)
                            { ImageVisual::Property::DESIRED_WIDTH, widthBackground },
                            { ImageVisual::Property::DESIRED_HEIGHT, heightBackground }
                          }
-                       );
+                       ); // 1 to 2 ratio
 
-  imageView.SetImage( image );
+  imageView.SetImage( gImage_600_RGB ); // 1 to 1 ratio
 
   Stage::GetCurrent().Add( imageView );
   application.SendNotification();
@@ -985,28 +808,6 @@ int UtcDaliImageViewHeightForWidthBackgroundAndImage(void)
   END_TEST;
 }
 
-int UtcDaliImageViewSetBufferImage(void)
-{
-  ToolkitTestApplication application;
-
-  int width1 = 300;
-  int height1 = 400;
-  BufferImage image1 = CreateBufferImage( width1, height1, Vector4( 1.f, 1.f, 1.f, 1.f ) );
-  ImageView imageView = ImageView::New();
-  imageView.SetImage( image1 );
-
-  TestImage( imageView, image1 );
-
-  int width2 = 600;
-  int height2 = 500;
-  BufferImage image2 = CreateBufferImage( width2, height2, Vector4( 1.f, 1.f, 1.f, 1.f ) );
-  imageView.SetImage( image2 );
-
-  TestImage( imageView, image2 );
-
-  END_TEST;
-}
-
 int UtcDaliImageViewSetImageUrl(void)
 {
   ToolkitTestApplication application;
@@ -1022,83 +823,6 @@ int UtcDaliImageViewSetImageUrl(void)
   END_TEST;
 }
 
-int UtcDaliImageViewSetImageOnstageP(void)
-{
-  ToolkitTestApplication application;
-
-  ImageView imageView = ImageView::New();
-
-  Stage::GetCurrent().Add( imageView );
-  application.SendNotification();
-  application.Render();
-
-  ResourceImage image1 = ResourceImage::New( TEST_IMAGE_FILE_NAME );
-  imageView.SetImage( image1 );
-  TestImage( imageView, image1 );
-
-  int width = 300;
-  int height = 400;
-  BufferImage image2 = CreateBufferImage( width, height, Vector4( 1.f, 1.f, 1.f, 1.f ) );
-  imageView.SetImage( image2 );
-  TestImage( imageView, image2 );
-
-  END_TEST;
-}
-
-int UtcDaliImageViewSetImageOnstageN(void)
-{
-  ToolkitTestApplication application;
-
-  ImageView imageView = ImageView::New();
-
-  Stage::GetCurrent().Add( imageView );
-  application.SendNotification();
-  application.Render();
-
-  ResourceImage image1 = ResourceImage::New( TEST_IMAGE_FILE_NAME );
-  imageView.SetImage( image1 );
-  TestImage( imageView, image1 );
-
-  Image image2;
-  imageView.SetImage( image2 );
-
-  Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
-
-  //the value should be empty
-  std::string url;
-  DALI_TEST_CHECK( !value.Get( url ) );
-
-  Property::Map map;
-  value.Get( map );
-  DALI_TEST_CHECK( map.Empty() );
-
-  END_TEST;
-}
-
-int UtcDaliImageViewSetImageOffstageP(void)
-{
-  ToolkitTestApplication application;
-
-  ImageView imageView = ImageView::New();
-
-  Stage::GetCurrent().Add( imageView );
-  application.SendNotification();
-  application.Render();
-  Stage::GetCurrent().Remove( imageView );
-
-  ResourceImage image1 = ResourceImage::New( TEST_IMAGE_FILE_NAME );
-  imageView.SetImage( image1 );
-  TestImage( imageView, image1 );
-
-  int width = 300;
-  int height = 400;
-  BufferImage image2 = CreateBufferImage( width, height, Vector4( 1.f, 1.f, 1.f, 1.f ) );
-  imageView.SetImage( image2 );
-  TestImage( imageView, image2 );
-
-  END_TEST;
-}
-
 bool gResourceReadySignalFired = false;
 Vector3 gNaturalSize;
 
@@ -1144,62 +868,6 @@ int UtcDaliImageViewCheckResourceReady(void)
   END_TEST;
 }
 
-int UtcDaliImageViewSetImageOffstageN(void)
-{
-  ToolkitTestApplication application;
-
-  ImageView imageView = ImageView::New();
-
-  Stage::GetCurrent().Add( imageView );
-  application.SendNotification();
-  application.Render();
-  Stage::GetCurrent().Remove( imageView );
-
-  ResourceImage image1 = ResourceImage::New( TEST_IMAGE_FILE_NAME );
-  imageView.SetImage( image1 );
-  TestImage( imageView, image1 );
-
-  Image image2;
-  imageView.SetImage( image2 );
-
-  Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
-
-  //the value should be empty
-  std::string url;
-  DALI_TEST_CHECK( !value.Get( url ) );
-
-  Property::Map map;
-  value.Get( map );
-  DALI_TEST_CHECK( map.Empty() );
-
-  END_TEST;
-}
-
-int UtcDaliImageViewSetImageN(void)
-{
-  ToolkitTestApplication application;
-
-  Image image1;
-  ImageView imageView = ImageView::New();
-  imageView.SetImage( image1 );
-
-  Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
-
-  //the value should be empty
-  std::string url;
-  DALI_TEST_CHECK( !value.Get( url ) );
-
-  Property::Map map;
-  value.Get( map );
-  DALI_TEST_CHECK( map.Empty() );
-
-  std::string resource_url;
-  Property::Value val = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
-  DALI_TEST_CHECK( !val.Get( resource_url ) );
-
-  END_TEST;
-}
-
 int UtcDaliImageViewSetImageTypeChangesP(void)
 {
   ToolkitTestApplication application;
@@ -1237,34 +905,6 @@ int UtcDaliImageViewSetImageTypeChangesP(void)
   DALI_TEST_CHECK( ! value.Get( map ) ); // Value should be empty
   DALI_TEST_CHECK( visual );             // Visual should be valid
 
-  // Set an empty Image
-  imageView.SetImage( Image() );
-
-  application.SendNotification();
-  application.Render( 16 );
-
-  value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
-  visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
-
-  DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
-  value.Get( map );
-  DALI_TEST_CHECK( map.Empty() );        // Value should be empty
-  DALI_TEST_CHECK( ! visual );           // Visual should be invalid
-
-  // Set an Image
-  ResourceImage image1 = ResourceImage::New( TEST_IMAGE_FILE_NAME );
-  imageView.SetImage( image1 );
-
-  application.SendNotification();
-  application.Render( 16 );
-
-  value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
-  visual = DevelControl::GetVisual( controlImpl, ImageView::Property::IMAGE );
-
-  DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
-  DALI_TEST_CHECK( value.Get( map ) );   // Value should NOT be empty
-  DALI_TEST_CHECK( visual );             // Visual should be valid
-
   // Set an empty URL
   imageView.SetImage( "" );
 
@@ -1338,340 +978,12 @@ int UtcDaliImageViewResourceUrlP(void)
   END_TEST;
 }
 
-// Scenarios 1: ImageView from regular image
-int UtcDaliImageViewSetImageBufferImage(void)
-{
-  ToolkitTestApplication application;
-
-  ImageView imageView = ImageView::New();
-  Stage::GetCurrent().Add( imageView );
-
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  gl.EnableTextureCallTrace( true );
-
-  std::vector< GLuint > ids;
-  ids.push_back( 23 );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
-
-  int width = 300;
-  int height = 400;
-  BufferImage image = CreateBufferImage( width, height, Color::WHITE );
-
-  imageView.SetImage( image );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethod("BindTexture") );
-
-  std::stringstream params;
-  params << GL_TEXTURE_2D << ", " << 23;
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethodAndParams("BindTexture", params.str()) );
-
-  END_TEST;
-}
-
-// Scenarios 2: ImageView from Native image
-int UtcDaliImageViewSetImageNativeImage(void)
-{
-  ToolkitTestApplication application;
-
-  ImageView imageView = ImageView::New();
-  Stage::GetCurrent().Add( imageView );
-
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  gl.EnableTextureCallTrace( true );
-
-  std::vector< GLuint > ids;
-  ids.push_back( 23 );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
-
-  int width = 200;
-  int height = 500;
-  TestNativeImagePointer nativeImageInterface = TestNativeImage::New( width, height );
-  NativeImage nativeImage = NativeImage::New( *(nativeImageInterface.Get()) );
-
-  imageView.SetImage( nativeImage );
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethod("BindTexture") );
-
-  std::stringstream params;
-  params << GL_TEXTURE_EXTERNAL_OES << ", " << 23;
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethodAndParams("BindTexture", params.str()) );
-
-  END_TEST;
-}
-
-// Scenarios 3: ImageView initially from regular image but then SetImage called with Native image
-int UtcDaliImageViewSetImageBufferImageToNativeImage(void)
-{
-  ToolkitTestApplication application;
-
-  int width = 300;
-  int height = 400;
-  BufferImage image = CreateBufferImage( width, height, Color::WHITE );
-
-  ImageView imageView = ImageView::New( image );
-  Stage::GetCurrent().Add( imageView );
-
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  gl.EnableTextureCallTrace( true );
-
-  std::vector< GLuint > ids;
-  ids.push_back( 23 );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethod("BindTexture") );
-
-  std::stringstream params;
-  params << GL_TEXTURE_2D << ", " << 23;
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethodAndParams("BindTexture", params.str()) );
-
-  width = 200;
-  height = 500;
-  TestNativeImagePointer nativeImageInterface = TestNativeImage::New( width, height );
-  NativeImage nativeImage = NativeImage::New( *(nativeImageInterface.Get()) );
-  imageView.SetImage( nativeImage );
-
-  ids.clear();
-  ids.push_back( 24 );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethod("BindTexture") );
-
-  std::stringstream nextTextureParams;
-  nextTextureParams << GL_TEXTURE_EXTERNAL_OES << ", " << 24;
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethodAndParams("BindTexture", nextTextureParams.str()) );
-
-  END_TEST;
-}
-
-// Scenarios 4: ImageView initially from Native image but then SetImage called with regular image
-int UtcDaliImageViewSetImageNativeImageToBufferImage(void)
-{
-  ToolkitTestApplication application;
-
-  int width = 300;
-  int height = 400;
-  TestNativeImagePointer nativeImageInterface = TestNativeImage::New( width, height );
-  NativeImage nativeImage = NativeImage::New( *(nativeImageInterface.Get()) );
-
-  ImageView imageView = ImageView::New( nativeImage );
-  Stage::GetCurrent().Add( imageView );
-
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  gl.EnableTextureCallTrace( true );
-
-  std::vector< GLuint > ids;
-  ids.push_back( 23 );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethod("BindTexture") );
-
-  std::stringstream params;
-  params << GL_TEXTURE_EXTERNAL_OES << ", " << 23;
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethodAndParams("BindTexture", params.str()) );
-
-  width = 200;
-  height = 500;
-  BufferImage image = CreateBufferImage( width, height, Color::WHITE );
-  imageView.SetImage( image );
-
-  ids.clear();
-  ids.push_back( 24 );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethod("BindTexture") );
-
-  std::stringstream nextTextureParams;
-  nextTextureParams << GL_TEXTURE_2D << ", " << 24;
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethodAndParams("BindTexture", nextTextureParams.str()) );
-
-  END_TEST;
-}
-
-// Scenarios 5: ImageView from Native image with custom shader
-int UtcDaliImageViewSetImageNativeImageWithCustomShader(void)
-{
-  ToolkitTestApplication application;
-
-  int width = 300;
-  int height = 400;
-
-  Property::Map customShader;
-  customShader.Insert( "vertexShader", VERTEX_SHADER );
-  customShader.Insert( "fragmentShader", FRAGMENT_SHADER );
-
-  Property::Array shaderHints;
-  shaderHints.PushBack( "requiresSelfDepthTest" );
-  shaderHints.PushBack( "outputIsTransparent" );
-  shaderHints.PushBack( "outputIsOpaque" );
-  shaderHints.PushBack( "modifiesGeometry" );
-
-  customShader.Insert( "hints", shaderHints );
-
-  Property::Map map;
-  map.Insert( "shader", customShader );
-
-  TestNativeImagePointer nativeImageInterface = TestNativeImage::New( width, height );
-  NativeImage nativeImage = NativeImage::New( *(nativeImageInterface.Get()) );
-
-  ImageView imageView = ImageView::New( nativeImage );
-  imageView.SetProperty( ImageView::Property::IMAGE, map );
-  Stage::GetCurrent().Add( imageView );
-
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  gl.EnableTextureCallTrace( true );
-
-  std::vector< GLuint > ids;
-  ids.push_back( 23 );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethod("BindTexture") );
-
-  std::stringstream params;
-  params << GL_TEXTURE_EXTERNAL_OES << ", " << 23;
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethodAndParams("BindTexture", params.str()) );
-
-  END_TEST;
-}
-
-// Scenarios 6: ImageView initially from regular image with custom shader but then SetImage called with Native
-int UtcDaliImageViewSetImageBufferImageWithCustomShaderToNativeImage(void)
-{
-  ToolkitTestApplication application;
-
-  int width = 300;
-  int height = 400;
-
-  Property::Map customShader;
-  customShader.Insert( "vertexShader", VERTEX_SHADER );
-  customShader.Insert( "fragmentShader", FRAGMENT_SHADER );
-
-  Property::Array shaderHints;
-  shaderHints.PushBack( "requiresSelfDepthTest" );
-  shaderHints.PushBack( "outputIsTransparent" );
-  shaderHints.PushBack( "outputIsOpaque" );
-  shaderHints.PushBack( "modifiesGeometry" );
-
-  customShader.Insert( "hints", shaderHints );
-
-  Property::Map map;
-  map.Insert( "shader", customShader );
-
-  BufferImage image = CreateBufferImage( width, height, Color::WHITE );
-
-  ImageView imageView = ImageView::New( image );
-  imageView.SetProperty( ImageView::Property::IMAGE, map );
-  Stage::GetCurrent().Add( imageView );
-
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  gl.EnableTextureCallTrace( true );
-
-  std::vector< GLuint > ids;
-  ids.push_back( 23 );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethod("BindTexture") );
-
-  std::stringstream params;
-  params << GL_TEXTURE_2D << ", " << 23;
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethodAndParams("BindTexture", params.str()) );
-
-  TestNativeImagePointer nativeImageInterface = TestNativeImage::New( width, height );
-  NativeImage nativeImage = NativeImage::New( *(nativeImageInterface.Get()) );
-  imageView.SetImage( nativeImage );
-
-  ids.clear();
-  ids.push_back( 24 );
-  application.GetGlAbstraction().SetNextTextureIds( ids );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethod("BindTexture") );
-
-  std::stringstream nativeImageParams;
-  nativeImageParams << GL_TEXTURE_EXTERNAL_OES << ", " << 24;
-  DALI_TEST_CHECK( gl.GetTextureTrace().FindMethodAndParams("BindTexture", nativeImageParams.str()) );
-
-
-  END_TEST;
-}
-
-int UtcDaliImageViewGetImageP1(void)
-{
-  ToolkitTestApplication application;
-
-  ImageView imageView = ImageView::New();
-  DALI_TEST_CHECK( ! imageView.GetImage() );
-
-  Image image = CreateBufferImage();
-  imageView.SetImage( image );
-  DALI_TEST_CHECK( imageView.GetImage() == image );
-
-  END_TEST;
-}
-
-int UtcDaliImageViewGetImageP2(void)
-{
-  ToolkitTestApplication application;
-
-  BufferImage image = CreateBufferImage();
-  ImageView imageView = ImageView::New( image );
-  DALI_TEST_CHECK( imageView.GetImage() == image );
-
-  END_TEST;
-}
-
-int UtcDaliImageViewGetImageN(void)
-{
-  ToolkitTestApplication application;
-
-  ImageView imageView = ImageView::New( TEST_IMAGE_FILE_NAME );
-  DALI_TEST_CHECK( ! imageView.GetImage() );
-
-  Image image = CreateBufferImage();
-  imageView.SetImage( image );
-  DALI_TEST_CHECK( imageView.GetImage() == image );
-
-  imageView.SetImage( TEST_IMAGE_FILE_NAME );
-  DALI_TEST_CHECK( ! imageView.GetImage() );
-
-  END_TEST;
-}
-
-
 int UtcDaliImageViewReplaceImage(void)
 {
   ToolkitTestApplication application;
 
   gResourceReadySignalFired = false;
 
-  int width = 100;
-  int height = 200;
-  Image image = CreateBufferImage( width, height, Vector4(1.f, 1.f, 1.f, 1.f) );
-
   // Check ImageView with background and main image, to ensure both visuals are marked as loaded
   ImageView imageView = ImageView::New( TEST_IMAGE_1 );
 
index 916fb13..d6f125d 100644 (file)
@@ -17,6 +17,9 @@
 
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.h>
+#include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali/devel-api/actors/actor-devel.h>
 
 using namespace Dali;
@@ -85,6 +88,22 @@ int UtcDaliProgressBarNew(void)
   END_TEST;
 }
 
+int UtcDaliProgressBarNew2(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliProgressBarNew2");
+
+  ProgressBar progressBar1 = DevelProgressBar::New( DevelProgressBar::Style::LINEAR );
+  DALI_TEST_CHECK( progressBar1 );
+
+  ProgressBar progressBar2 = DevelProgressBar::New( DevelProgressBar::Style::CIRCULAR );
+  DALI_TEST_CHECK( progressBar2 );
+
+  DALI_TEST_CHECK( progressBar1.GetStyleName() != progressBar2.GetStyleName() );
+
+  END_TEST;
+}
+
 int UtcDaliProgressBarDestructor(void)
 {
   ToolkitTestApplication application;
@@ -410,3 +429,104 @@ int UtcDaliProgressBarSetPropertyP2(void)
 
   END_TEST;
 }
+
+int UtcDaliProgressBarSetPropertyP3(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliProgressBarSetPropertyP3" );
+
+  ProgressBar progressBar = ProgressBar::New();
+  progressBar.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
+  progressBar.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::TOP_LEFT);
+  progressBar.SetProperty( Actor::Property::SIZE, Vector2( Stage::GetCurrent().GetSize().x, Stage::GetCurrent().GetSize().y ) );
+  Stage::GetCurrent().Add( progressBar );
+  application.SendNotification();
+  application.Render();
+
+  {
+    // Set arc visual to the SECONDARY_PROGRESS_VISUAL
+    const float expected = 180.0f;
+
+    Property::Map map;
+    map["visualType"] = "ARC";
+    map["thickness"] = 4.0f;
+    map["mixColor"] = Color::BLUE;
+    map["sweepAngle"] = 60;
+    progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VISUAL, map);
+    progressBar.SetProperty(ProgressBar::Property::SECONDARY_PROGRESS_VALUE, 0.5f); // This should change visual's sweep angle.
+
+    Property::Value value = progressBar.GetProperty( ProgressBar::Property::SECONDARY_PROGRESS_VISUAL );
+    Property::Map* resultMap = value.GetMap();
+    DALI_TEST_CHECK( resultMap );
+
+    Property::Value* sweepAngle = resultMap->Find( DevelArcVisual::Property::SWEEP_ANGLE );
+    float result = 0.0f;
+    sweepAngle->Get( result );
+    DALI_TEST_EQUALS( result, expected, TEST_LOCATION );
+  }
+
+  {
+    // Set arc visual to the PROGRESS_VISUAL
+    const float expected = 90.0f;
+
+    Property::Map map;
+    map["visualType"] = "ARC";
+    map["thickness"] = 4.0f;
+    map["mixColor"] = Color::RED;
+    map["sweepAngle"] = 60;
+    progressBar.SetProperty(ProgressBar::Property::PROGRESS_VISUAL, map);
+    progressBar.SetProperty(ProgressBar::Property::PROGRESS_VALUE, 0.25f); // This should change visual's sweep angle.
+
+    Property::Value value = progressBar.GetProperty( ProgressBar::Property::PROGRESS_VISUAL );
+    Property::Map* resultMap = value.GetMap();
+    DALI_TEST_CHECK( resultMap );
+
+    Property::Value* sweepAngle = resultMap->Find( DevelArcVisual::Property::SWEEP_ANGLE );
+    float result = 0.0f;
+    sweepAngle->Get( result );
+    DALI_TEST_EQUALS( result, expected, TEST_LOCATION );
+  }
+
+  {
+    // Set arc visual to the INDETERMINATE_VISUAL
+    const Vector4 expected = Color::GREEN;
+
+    Property::Map map;
+    map["visualType"] = "ARC";
+    map["thickness"] = 4.0f;
+    map["mixColor"] = expected;
+    progressBar.SetProperty(ProgressBar::Property::INDETERMINATE_VISUAL, map);
+
+    Property::Value value = progressBar.GetProperty( ProgressBar::Property::INDETERMINATE_VISUAL );
+    Property::Map* resultMap = value.GetMap();
+    DALI_TEST_CHECK( resultMap );
+
+    Property::Value* mixColor = resultMap->Find( Visual::Property::MIX_COLOR );
+    Vector4 result;
+    mixColor->Get( result );
+    DALI_TEST_EQUALS( result, expected, TEST_LOCATION );
+  }
+
+  {
+    // Set arc visual to the TRACK_VISUAL
+    const Vector4 expected = Color::YELLOW;
+
+    Property::Map map;
+    map["visualType"] = "ARC";
+    map["thickness"] = 0.4f;
+    map["mixColor"] = expected;
+    progressBar.SetProperty( ProgressBar::Property::TRACK_VISUAL, map );
+    progressBar.SetProperty( ProgressBar::Property::INDETERMINATE, true ); // This should not change track visual's properties.
+
+    Property::Value value = progressBar.GetProperty( ProgressBar::Property::TRACK_VISUAL );
+    Property::Map* resultMap = value.GetMap();
+    DALI_TEST_CHECK( resultMap );
+
+    Property::Value* mixColor = resultMap->Find( Visual::Property::MIX_COLOR );
+    Vector4 result;
+    mixColor->Get( result );
+    DALI_TEST_EQUALS( result, expected, TEST_LOCATION );
+  }
+
+  END_TEST;
+}
index a0151d2..59c34fa 100644 (file)
@@ -47,6 +47,7 @@ const char* TEST_NPATCH_FILE_NAME =  TEST_RESOURCE_DIR "/button-up.9.png";
 const char* TEST_SVG_FILE_NAME = TEST_RESOURCE_DIR "/svg1.svg";
 const char* TEST_OBJ_FILE_NAME = TEST_RESOURCE_DIR "/Cube.obj";
 const char* TEST_MTL_FILE_NAME = TEST_RESOURCE_DIR "/ToyRobot-Metal.mtl";
+const char* TEST_VECTOR_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR "/insta_camera.json";
 const char* TEST_RESOURCE_LOCATION = TEST_RESOURCE_DIR "/";
 
 
@@ -3772,3 +3773,139 @@ int UtcDaliColorVisualBlurRadius(void)
 
   END_TEST;
 }
+
+int UtcDaliVisualGetType(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliVisualGetType" );
+
+  VisualFactory factory = VisualFactory::Get();
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = Visual::BORDER;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == Visual::BORDER );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = Visual::COLOR;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == Visual::COLOR );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = Visual::GRADIENT;
+    properties[GradientVisual::Property::START_POSITION] = Vector2( -1.f, -1.f );
+    properties[GradientVisual::Property::END_POSITION] = Vector2( 1.f, 1.f );
+    properties[GradientVisual::Property::STOP_OFFSET] = Vector2(0.f, 1.f);
+    // propertyMap.Insert( GradientVisual::Property::SPREAD_METHOD, GradientVisual::SpreadMethod::REPEAT) ;
+    Property::Array stopColors;
+    stopColors.PushBack( Color::RED );
+    stopColors.PushBack( Color::GREEN );
+    properties[GradientVisual::Property::STOP_COLOR] = stopColors;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == Visual::GRADIENT );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = Visual::IMAGE;
+    properties.Insert( ImageVisual::Property::URL,  TEST_IMAGE_FILE_NAME );
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == Visual::IMAGE );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = Visual::MESH;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == Visual::MESH );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = Visual::PRIMITIVE;
+    properties[PrimitiveVisual::Property::SHAPE] = PrimitiveVisual::Shape::CUBE;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == Visual::PRIMITIVE );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = Visual::WIREFRAME;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == Visual::WIREFRAME );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = Visual::TEXT;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == Visual::TEXT );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = Visual::N_PATCH;
+    properties[ImageVisual::Property::URL] =  TEST_NPATCH_FILE_NAME;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == Visual::N_PATCH );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = Visual::SVG;
+    properties[ImageVisual::Property::URL] = TEST_SVG_FILE_NAME;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == Visual::SVG );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = Visual::ANIMATED_IMAGE;
+    properties[ImageVisual::Property::URL] = TEST_GIF_FILE_NAME;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == Visual::ANIMATED_IMAGE );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = DevelVisual::ANIMATED_GRADIENT;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == static_cast<Visual::Type>( DevelVisual::ANIMATED_GRADIENT ) );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = DevelVisual::ANIMATED_VECTOR_IMAGE;
+    properties[ImageVisual::Property::URL] = TEST_VECTOR_IMAGE_FILE_NAME;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == static_cast<Visual::Type>( DevelVisual::ANIMATED_VECTOR_IMAGE ) );
+  }
+
+  {
+    Property::Map properties;
+    properties[Visual::Property::TYPE] = DevelVisual::ARC;
+    Visual::Base visual = factory.CreateVisual( properties );
+
+    DALI_TEST_CHECK( visual.GetType() == static_cast<Visual::Type>( DevelVisual::ARC ) );
+  }
+
+  END_TEST;
+}
diff --git a/dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.cpp b/dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.cpp
new file mode 100644 (file)
index 0000000..f3951aa
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/progress-bar/progress-bar-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelProgressBar
+{
+
+Toolkit::ProgressBar New( Style progressBarStyle )
+{
+  return Internal::ProgressBar::New( progressBarStyle );
+}
+
+} // namespace DevelProgressBar
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.h b/dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.h
new file mode 100644 (file)
index 0000000..b9a04d4
--- /dev/null
@@ -0,0 +1,62 @@
+#ifndef DALI_TOOLKIT_PROGRESS_BAR_DEVEL_H
+#define DALI_TOOLKIT_PROGRESS_BAR_DEVEL_H
+
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/progress-bar/progress-bar.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelProgressBar
+{
+
+/**
+ * @brief Enumeration for the style of progress bar.
+ */
+enum class Style
+{
+  /**
+   * @brief Indicates a linear shape of progress bar.
+   */
+  LINEAR,
+
+  /**
+   * @brief Indicates a circular shape of progress bar.
+   */
+  CIRCULAR,
+};
+
+/**
+ * @brief Creates a new ProgressBar with predefined style.
+ * @param[in] progressBarStyle A style value that determines the visual properties for ProgressBar.
+ * @return A handle to the ProgressBar control.
+ */
+DALI_TOOLKIT_API Toolkit::ProgressBar New( Style progressBarStyle );
+
+} // namespace DevelProgressBar
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_PROGRESS_BAR_DEVEL_H
index 219fb28..5eb6d82 100755 (executable)
@@ -22,6 +22,7 @@ SET( devel_api_src_files
   ${devel_api_src_dir}/controls/page-turn-view/page-turn-view.cpp
   ${devel_api_src_dir}/controls/popup/confirmation-popup.cpp
   ${devel_api_src_dir}/controls/popup/popup.cpp
+  ${devel_api_src_dir}/controls/progress-bar/progress-bar-devel.cpp
   ${devel_api_src_dir}/controls/scene3d-view/scene3d-view.cpp
   ${devel_api_src_dir}/controls/shadow-view/shadow-view.cpp
   ${devel_api_src_dir}/controls/super-blur-view/super-blur-view.cpp
@@ -115,6 +116,10 @@ SET( devel_api_popup_header_files
   ${devel_api_src_dir}/controls/popup/popup.h
 )
 
+SET( devel_api_progress_bar_header_files
+  ${devel_api_src_dir}/controls/progress-bar/progress-bar-devel.h
+)
+
 SET( devel_api_visual_factory_header_files
   ${devel_api_src_dir}/visual-factory/transition-data.h
   ${devel_api_src_dir}/visual-factory/visual-factory.h
@@ -126,6 +131,7 @@ SET( devel_api_visuals_header_files
   ${devel_api_src_dir}/visuals/animated-image-visual-actions-devel.h
   ${devel_api_src_dir}/visuals/animated-vector-image-visual-actions-devel.h
   ${devel_api_src_dir}/visuals/animated-vector-image-visual-signals-devel.h
+  ${devel_api_src_dir}/visuals/arc-visual-actions-devel.h
   ${devel_api_src_dir}/visuals/arc-visual-properties-devel.h
   ${devel_api_src_dir}/visuals/color-visual-properties-devel.h
   ${devel_api_src_dir}/visuals/image-visual-properties-devel.h
@@ -234,6 +240,7 @@ SET( DEVEL_API_HEADERS ${DEVEL_API_HEADERS}
   ${devel_api_navigation_view_header_files}
   ${devel_api_page_turn_view_header_files}
   ${devel_api_popup_header_files}
+  ${devel_api_progress_bar_header_files}
   ${devel_api_visual_factory_header_files}
   ${devel_api_visuals_header_files}
   ${devel_api_scene3d_view_header_files}
index 7b20c60..c0c6d2b 100644 (file)
@@ -96,6 +96,11 @@ void Visual::Base::CreatePropertyMap( Dali::Property::Map& map ) const
   GetImplementation( *this ).CreatePropertyMap( map );
 }
 
+Visual::Type Visual::Base::GetType() const
+{
+  return GetImplementation( *this ).GetType();
+}
+
 
 
 
index 94db5c4..0d6fd9e 100755 (executable)
@@ -23,6 +23,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/dali-toolkit-common.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
 
 namespace Dali
 {
@@ -190,6 +191,13 @@ public:
    */
   void CreatePropertyMap( Dali::Property::Map& map ) const;
 
+  /**
+   * @brief Get the type of this visual.
+   *
+   * @return The the type of this visual.
+   */
+  Visual::Type GetType() const;
+
 public: // Not intended for application developers
 
   explicit DALI_INTERNAL Base(Internal::Visual::Base *impl);
diff --git a/dali-toolkit/devel-api/visuals/arc-visual-actions-devel.h b/dali-toolkit/devel-api/visuals/arc-visual-actions-devel.h
new file mode 100644 (file)
index 0000000..306821c
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef DALI_TOOLKIT_DEVEL_API_VISUALS_ARC_VISUAL_ACTIONS_DEVEL_H
+#define DALI_TOOLKIT_DEVEL_API_VISUALS_ARC_VISUAL_ACTIONS_DEVEL_H
+
+/*
+ * Copyright (c) 2020 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.
+ *
+ */
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelArcVisual
+{
+
+/**
+ * @brief Actions that the arc visual can perform.  These actions are called through the Visual::Base::DoAction API.
+ */
+namespace Action
+{
+/**
+ * @brief The available actions for this visual
+ */
+enum Type
+{
+  /**
+   * @brief Update the properties of the visual.
+   * @note DevelArcVisual::Property::THICKNESS, DevelArcVisual::Property::START_ANGLE and DevelArcVisual::Property::SWEEP_ANGLE can be updated.
+   */
+  UPDATE_PROPERTY = 0
+};
+
+} // namespace Actions
+
+} // namespace DevelArcVisual
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_DEVEL_API_VISUALS_ARC_VISUAL_ACTIONS_DEVEL_H
index 28cbfff..085d522 100755 (executable)
@@ -99,47 +99,11 @@ void ImageView::OnInitialize()
   handle.ResourceReadySignal().Connect( this, &ImageView::OnResourceReady );
 }
 
-void ImageView::SetImage( Image image )
-{
-  // Don't bother comparing if we had a visual previously, just drop old visual and create new one
-  mImage = image;
-  mUrl.clear();
-  mPropertyMap.Clear();
-
-  Toolkit::Visual::Base visual =  Toolkit::VisualFactory::Get().CreateVisual( image );
-  if( visual )
-  {
-    if( !mVisual )
-    {
-      mVisual = visual;
-    }
-
-    if( !mShaderMap.Empty() )
-    {
-      Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
-      visualImpl.SetCustomShader( mShaderMap );
-    }
-
-    DevelControl::RegisterVisual( *this, Toolkit::ImageView::Property::IMAGE, visual );
-  }
-  else
-  {
-    // Unregister the existing visual
-    DevelControl::UnregisterVisual( *this, Toolkit::ImageView::Property::IMAGE );
-
-    // Trigger a size negotiation request that may be needed when unregistering a visual.
-    RelayoutRequest();
-  }
-
-  // Signal that a Relayout may be needed
-}
-
 void ImageView::SetImage( const Property::Map& map )
 {
   // Comparing a property map is too expensive so just creating a new visual
   mPropertyMap = map;
   mUrl.clear();
-  mImage.Reset();
 
   Toolkit::Visual::Base visual =  Toolkit::VisualFactory::Get().CreateVisual( mPropertyMap );
   if( visual )
@@ -175,7 +139,6 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size )
   // Don't bother comparing if we had a visual previously, just drop old visual and create new one
   mUrl = url;
   mImageSize = size;
-  mImage.Reset();
   mPropertyMap.Clear();
 
   // Don't set mVisual until it is ready and shown. Getters will still use current visual.
@@ -207,11 +170,6 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size )
   // Signal that a Relayout may be needed
 }
 
-Image ImageView::GetImage() const
-{
-  return mImage;
-}
-
 void ImageView::EnablePreMultipliedAlpha( bool preMultipled )
 {
   if( mVisual )
@@ -504,10 +462,6 @@ void ImageView::SetProperty( BaseObject* object, Property::Index index, const Pr
                 {
                   impl.SetImage( impl.mUrl, impl.mImageSize );
                 }
-                else if( impl.mImage )
-                {
-                  impl.SetImage( impl.mImage );
-                }
                 else if( !impl.mPropertyMap.Empty() )
                 {
                   impl.SetImage( impl.mPropertyMap );
@@ -549,12 +503,6 @@ Property::Value ImageView::GetProperty( BaseObject* object, Property::Index prop
         {
           value = impl.mUrl;
         }
-        else if( impl.mImage )
-        {
-          Property::Map map;
-          Scripting::CreatePropertyMap( impl.mImage, map );
-          value = map;
-        }
         else
         {
           Property::Map map;
index 382feb8..8c69678 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_IMAGE_VIEW_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -58,11 +58,6 @@ public:
   static Toolkit::ImageView New();
 
   /**
-   * @copydoc Dali::Toolkit::SetImage
-   */
-  void SetImage( Image image );
-
-  /**
    * @brief Sets this ImageView from an Dali::Property::Map
    *
    * If the handle is empty, ImageView will display nothing
@@ -76,11 +71,6 @@ public:
   void SetImage( const std::string& imageUrl, ImageDimensions size );
 
   /**
-   * @copydoc Dali::Toolkit::GetImage
-   */
-  Image GetImage() const;
-
-  /**
    * @brief Set whether the Pre-multiplied Alpha Blending is required
    *
    * @param[in] preMultipled whether alpha is pre-multiplied.
@@ -184,7 +174,6 @@ private:
   Toolkit::Visual::Base  mVisual;
 
   std::string      mUrl;          ///< the url for the image if the image came from a URL, empty otherwise
-  Image            mImage;        ///< the Image if the image came from a Image, null otherwise
   Property::Map    mPropertyMap;  ///< the Property::Map if the image came from a Property::Map, empty otherwise
   Property::Map    mShaderMap;    ///< the Property::Map if the custom shader is set, empty otherwise
   ImageDimensions  mImageSize;    ///< the image size
index 2b89fed..4390792 100755 (executable)
@@ -28,6 +28,9 @@
 #include <dali-toolkit/public-api/align-enumerations.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-base.h>
+#include <dali-toolkit/internal/visuals/visual-base-impl.h>
+#include <dali-toolkit/internal/visuals/visual-string-constants.h>
+#include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 #include <dali-toolkit/public-api/visuals/text-visual-properties.h>
@@ -86,6 +89,35 @@ float DEFAULT_VALUE = 0.0f;
 float DEFAULT_LOWER_BOUND = 0.0f;
 float DEFAULT_UPPER_BOUND = 1.0f;
 float DEFAULT_FONT_SIZE = 12.0f;
+const char* CIRCULAR_PROGRESS_BAR_STYLE_NAME = "CircularProgressBar";
+
+
+void BackupVisualProperties( const Control* control, Property::Index index, Property::Map& map )
+{
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( *control, index );
+
+  if( visual )
+  {
+    map.Clear();
+    visual.CreatePropertyMap( map );
+  }
+}
+
+void RestoreVisualProperties( Control* control, Property::Index index, Property::Map& map, int depth )
+{
+  if( !map.Empty() )
+  {
+    Toolkit::Visual::Base visual = DevelControl::GetVisual( *control, index );
+
+    Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
+
+    visualImpl.SetProperties( map );
+
+    DevelControl::UnregisterVisual( *control, index );
+
+    DevelControl::RegisterVisual( *control, index, visual, true, depth );
+  }
+}
 
 } // Unnamed namespace
 
@@ -93,14 +125,26 @@ float DEFAULT_FONT_SIZE = 12.0f;
 // ProgressBar
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-Dali::Toolkit::ProgressBar ProgressBar::New()
+Dali::Toolkit::ProgressBar ProgressBar::New( DevelProgressBar::Style progressBarStyle )
 {
   // Create the implementation
   ProgressBarPtr progressBar( new ProgressBar() );
 
-  // Pass ownership to CustomActor via derived handle
   Dali::Toolkit::ProgressBar handle( *progressBar );
 
+  switch( progressBarStyle )
+  {
+    case DevelProgressBar::Style::CIRCULAR:
+    {
+      progressBar->SetStyleName( CIRCULAR_PROGRESS_BAR_STYLE_NAME );
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
   // Second-phase init of the implementation
   // This can only be done after the CustomActor connection has been made...
   progressBar->Initialize();
@@ -133,8 +177,6 @@ void ProgressBar::OnRelayout( const Vector2& size, RelayoutContainer& container
   trackSize.width = std::max( 0.0f, size.width ); // Ensure we don't go negative
 
   Toolkit::Visual::Base trackVisual = DevelControl::GetVisual( *this, Toolkit::ProgressBar::Property::TRACK_VISUAL );
-  Toolkit::Visual::Base secondProgressVisual = DevelControl::GetVisual( *this, Toolkit::ProgressBar::Property::SECONDARY_PROGRESS_VISUAL );
-  Toolkit::Visual::Base progressVisual = DevelControl::GetVisual( *this, Toolkit::ProgressBar::Property::PROGRESS_VISUAL );
   Toolkit::Visual::Base labelVisual = DevelControl::GetVisual( *this, Toolkit::ProgressBar::Property::LABEL_VISUAL );
   Toolkit::Visual::Base indeterminateVisual = DevelControl::GetVisual( *this, Toolkit::ProgressBar::Property::INDETERMINATE_VISUAL );
 
@@ -149,29 +191,9 @@ void ProgressBar::OnRelayout( const Vector2& size, RelayoutContainer& container
     trackVisual.SetTransformAndSize( visualTransform, trackSize );
   }
 
-  if( secondProgressVisual )
-  {
-    Property::Map visualTransform;
-
-    visualTransform.Add( Toolkit::Visual::Transform::Property::SIZE, Vector2( mDomain.from.x + mSecondaryProgressValue * ( mDomain.to.x - mDomain.from.x ), trackSize.height  ) )
-                   .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
-                   .Add( Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
-                   .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN )
-                   .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN );
-    secondProgressVisual.SetTransformAndSize( visualTransform, trackSize );
-  }
-
-  if( progressVisual )
-  {
-    Property::Map visualTransform;
+  ApplyProgressToVisualTransform( mSecondaryProgressValue, trackSize, Toolkit::ProgressBar::Property::SECONDARY_PROGRESS_VISUAL );
 
-    visualTransform.Add( Toolkit::Visual::Transform::Property::SIZE, Vector2( mDomain.from.x + mProgressValue * ( mDomain.to.x - mDomain.from.x ), trackSize.height ) )
-                   .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
-                   .Add( Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
-                   .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN )
-                   .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN );
-    progressVisual.SetTransformAndSize( visualTransform, trackSize );
-  }
+  ApplyProgressToVisualTransform( mProgressValue, trackSize, Toolkit::ProgressBar::Property::PROGRESS_VISUAL );
 
   if( labelVisual )
   {
@@ -240,6 +262,8 @@ void ProgressBar::SetProgressValue( float value )
   {
     mProgressValue = Clamp( value, DEFAULT_LOWER_BOUND, DEFAULT_UPPER_BOUND );
 
+    ApplyProgressToVisual( mProgressValue, Toolkit::ProgressBar::Property::PROGRESS_VISUAL, ProgressDepthIndex::PROGRESS_VISUAL );
+
     Toolkit::ProgressBar self = Toolkit::ProgressBar::DownCast( Self() );
     mValueChangedSignal.Emit( self, mProgressValue, mSecondaryProgressValue );
     RelayoutRequest();
@@ -261,6 +285,8 @@ void ProgressBar::SetSecondaryProgressValue( float value )
   {
     mSecondaryProgressValue = Clamp( value, DEFAULT_LOWER_BOUND, DEFAULT_UPPER_BOUND );
 
+    ApplyProgressToVisual( mSecondaryProgressValue, Toolkit::ProgressBar::Property::SECONDARY_PROGRESS_VISUAL, ProgressDepthIndex::SECONDARY_PROGRESS_VISUAL );
+
     Toolkit::ProgressBar self = Toolkit::ProgressBar::DownCast( Self() );
     mValueChangedSignal.Emit( self, mProgressValue, mSecondaryProgressValue );
 
@@ -292,6 +318,13 @@ void ProgressBar::SetIndeterminate( bool value )
     {
       mIndeterminateVisualAni.Stop();
     }
+
+    // Restore previous visual data after animation finished.
+    RestoreVisualProperties( this, Toolkit::ProgressBar::Property::TRACK_VISUAL, mTrackVisualMap, ProgressDepthIndex::TRACK_VISUAL );
+    RestoreVisualProperties( this, Toolkit::ProgressBar::Property::SECONDARY_PROGRESS_VISUAL, mSecondaryProgressVisualMap, ProgressDepthIndex::SECONDARY_PROGRESS_VISUAL );
+    RestoreVisualProperties( this, Toolkit::ProgressBar::Property::PROGRESS_VISUAL, mProgressVisualMap, ProgressDepthIndex::PROGRESS_VISUAL );
+
+    RelayoutRequest();
   }
 }
 
@@ -311,6 +344,11 @@ void ProgressBar::SetIndeterminateVisualTransition( Toolkit::TransitionData tran
 
 void ProgressBar::PlayIndeterminateVisualTransition()
 {
+  // Store current visual data before animation changes it.
+  BackupVisualProperties( this, Toolkit::ProgressBar::Property::TRACK_VISUAL, mTrackVisualMap );
+  BackupVisualProperties( this, Toolkit::ProgressBar::Property::SECONDARY_PROGRESS_VISUAL, mSecondaryProgressVisualMap );
+  BackupVisualProperties( this, Toolkit::ProgressBar::Property::PROGRESS_VISUAL, mProgressVisualMap );
+
   if( mIndeterminateVisualAni )
   {
     mIndeterminateVisualAni.Stop();
@@ -404,6 +442,47 @@ bool ProgressBar::GetPropertyMapForVisual( Property::Index visualIndex, Property
   return success;
 }
 
+
+void ProgressBar::ApplyProgressToVisual( float progress, Property::Index index, int depth )
+{
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( *this, index );
+
+  if( visual && static_cast<DevelVisual::Type>( visual.GetType() ) == DevelVisual::ARC && !mIndeterminate )
+  {
+    Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
+
+    Property::Map map;
+
+    map[ Toolkit::DevelArcVisual::Property::SWEEP_ANGLE ] = Property::Value( 360.0f * progress );
+
+    visualImpl.SetProperties( map );
+
+    DevelControl::UnregisterVisual( *this, index );
+    DevelControl::RegisterVisual( *this, index, visual, true, depth );
+  }
+}
+
+void ProgressBar::ApplyProgressToVisualTransform( float progress, Vector2 trackSize, Property::Index index )
+{
+  Toolkit::Visual::Base visual = DevelControl::GetVisual( *this, index );
+
+  if( visual )
+  {
+    Property::Map visualTransform;
+
+    if( static_cast<DevelVisual::Type>( visual.GetType() ) != DevelVisual::ARC )
+    {
+      visualTransform.Add( Toolkit::Visual::Transform::Property::SIZE, Vector2( mDomain.from.x + progress * ( mDomain.to.x - mDomain.from.x ), trackSize.height ) )
+                     .Add( Toolkit::Visual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
+                     .Add( Toolkit::Visual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::Visual::Transform::Policy::ABSOLUTE, Toolkit::Visual::Transform::Policy::ABSOLUTE ) )
+                     .Add( Toolkit::Visual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN )
+                     .Add( Toolkit::Visual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN );
+    }
+
+    visual.SetTransformAndSize( visualTransform, trackSize );
+  }
+}
+
 // Static class method to support script connecting signals
 bool ProgressBar::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
@@ -444,12 +523,14 @@ void ProgressBar::SetProperty( BaseObject* object, Property::Index propertyIndex
       case Toolkit::ProgressBar::Property::SECONDARY_PROGRESS_VISUAL:
       {
         progressBarImpl.CreateVisualsForComponent( propertyIndex, value, ProgressDepthIndex::SECONDARY_PROGRESS_VISUAL );
+        progressBarImpl.ApplyProgressToVisual( progressBarImpl.mSecondaryProgressValue, propertyIndex, ProgressDepthIndex::SECONDARY_PROGRESS_VISUAL );
         break;
       }
 
       case Toolkit::ProgressBar::Property::PROGRESS_VISUAL:
       {
         progressBarImpl.CreateVisualsForComponent( propertyIndex, value, ProgressDepthIndex::PROGRESS_VISUAL );
+        progressBarImpl.ApplyProgressToVisual( progressBarImpl.mProgressValue, propertyIndex, ProgressDepthIndex::PROGRESS_VISUAL );
         break;
       }
 
index 5b0ffd2..31ae483 100755 (executable)
  *
  */
 
-
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali/public-api/animation/animation.h>
 #include <dali-toolkit/public-api/controls/progress-bar/progress-bar.h>
+#include <dali-toolkit/devel-api/controls/progress-bar/progress-bar-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
 
 namespace Dali
@@ -46,11 +46,11 @@ class ProgressBar : public Control
 public:
 
   /**
-   * Create a new ProgressBar.
-   *
+   * Create a new ProgressBar with predefined style.
+   * @param[in] progressBarStyle A style value that determines the shape of the progress bar.
    * @return A public handle to the newly allocated ProgressBar.
    */
-  static Dali::Toolkit::ProgressBar New();
+  static Dali::Toolkit::ProgressBar New( DevelProgressBar::Style progressBarStyle = DevelProgressBar::Style::LINEAR );
 
 public:
 
@@ -233,6 +233,16 @@ private:
   bool GetPropertyMapForVisual( Property::Index visualIndex, Property::Map& retreivedMap ) const;
 
   /**
+   * Apply progress value to visual
+   */
+  void ApplyProgressToVisual( float progress, Property::Index index, int depth );
+
+  /**
+   * Apply progress value to visual transform
+   */
+  void ApplyProgressToVisualTransform( float progress, Vector2 trackSize, Property::Index index );
+
+  /**
    * Check if we should start animating
    */
   virtual void OnStageConnection( int depth );
@@ -256,6 +266,9 @@ private:
   float mProgressValue;                                               ///< Current value of ProgressBar
   float mSecondaryProgressValue;                                      ///< Current loading value of ProgressBar
   bool mIndeterminate;                                                ///< Whether the progress state is determined or not
+  Property::Map mTrackVisualMap;                                      ///< To backup visual properties when switching determinate/indeterminate.
+  Property::Map mProgressVisualMap;                                   ///< To backup visual properties when switching determinate/indeterminate.
+  Property::Map mSecondaryProgressVisualMap;                          ///< To backup visual properties when switching determinate/indeterminate.
 };
 
 } // namespace Internal
old mode 100755 (executable)
new mode 100644 (file)
index 0ddac75..68aac48
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -145,6 +145,24 @@ DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged",  SIGNAL_INPU
 
 DALI_TYPE_REGISTRATION_END()
 
+const char * const IMAGE_MAP_FILENAME_STRING = "filename";
+
+/// Retrieves a filename from a value that is a Property::Map
+std::string GetImageFileNameFromPropertyValue( const Property::Value& value )
+{
+  std::string filename;
+  const Property::Map* map = value.GetMap();
+  if( map )
+  {
+    const Property::Value* filenameValue = map->Find( IMAGE_MAP_FILENAME_STRING );
+    if( filenameValue )
+    {
+      filenameValue->Get( filename );
+    }
+  }
+  return filename;
+}
+
 } // namespace
 
 Toolkit::TextEditor TextEditor::New()
@@ -351,90 +369,90 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P
       }
       case Toolkit::TextEditor::Property::GRAB_HANDLE_IMAGE:
       {
-        const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor %p GRAB_HANDLE_IMAGE %s\n", impl.mController.Get(), image.GetUrl().c_str() );
+        const std::string imageFileName = value.Get< std::string >();
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor %p GRAB_HANDLE_IMAGE %s\n", impl.mController.Get(), imageFileName );
 
-        if( impl.mDecorator )
+        if( impl.mDecorator && imageFileName.size() )
         {
-          impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED, image );
+          impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED, imageFileName );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextEditor::Property::GRAB_HANDLE_PRESSED_IMAGE:
       {
-        const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor %p GRAB_HANDLE_PRESSED_IMAGE %s\n", impl.mController.Get(), image.GetUrl().c_str() );
+        const std::string imageFileName = value.Get< std::string >();
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor %p GRAB_HANDLE_PRESSED_IMAGE %s\n", impl.mController.Get(), imageFileName );
 
-        if( impl.mDecorator )
+        if( impl.mDecorator && imageFileName.size() )
         {
-          impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED, image );
+          impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED, imageFileName );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextEditor::Property::SELECTION_HANDLE_IMAGE_LEFT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
+          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, filename );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextEditor::Property::SELECTION_HANDLE_IMAGE_RIGHT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
+          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, filename );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
+          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, filename );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextEditor::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
+          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, filename );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextEditor::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, image );
+          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, filename );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextEditor::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, image );
+          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, filename );
           impl.RequestTextRelayout();
         }
         break;
@@ -892,11 +910,7 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind
       {
         if( impl.mDecorator )
         {
-          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED ) );
-          if( image )
-          {
-            value = image.GetUrl();
-          }
+          value = impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED );
         }
         break;
       }
@@ -904,11 +918,7 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind
       {
         if( impl.mDecorator )
         {
-          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED ) );
-          if( image )
-          {
-            value = image.GetUrl();
-          }
+          value = impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED );
         }
         break;
       }
@@ -1772,14 +1782,9 @@ void TextEditor::GetHandleImagePropertyValue(  Property::Value& value, Text::Han
 {
   if( mDecorator )
   {
-    ResourceImage image = ResourceImage::DownCast( mDecorator->GetHandleImage( handleType, handleImageType ) );
-
-    if ( image )
-    {
-      Property::Map map;
-      Scripting::CreatePropertyMap( image, map );
-      value = map;
-    }
+    Property::Map map;
+    map[ IMAGE_MAP_FILENAME_STRING ] = mDecorator->GetHandleImage( handleType, handleImageType );
+    value = map;
   }
 }
 
old mode 100755 (executable)
new mode 100644 (file)
index 7e2d143..d496944
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -143,6 +143,24 @@ DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "inputStyleChanged",  SIGNAL_INPUT
 
 DALI_TYPE_REGISTRATION_END()
 
+const char * const IMAGE_MAP_FILENAME_STRING = "filename";
+
+/// Retrieves a filename from a value that is a Property::Map
+std::string GetImageFileNameFromPropertyValue( const Property::Value& value )
+{
+  std::string filename;
+  const Property::Map* map = value.GetMap();
+  if( map )
+  {
+    const Property::Value* filenameValue = map->Find( IMAGE_MAP_FILENAME_STRING );
+    if( filenameValue )
+    {
+      filenameValue->Get( filename );
+    }
+  }
+  return filename;
+}
+
 } // namespace
 
 Toolkit::TextField TextField::New()
@@ -415,24 +433,24 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       }
       case Toolkit::TextField::Property::GRAB_HANDLE_IMAGE:
       {
-        const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p GRAB_HANDLE_IMAGE %s\n", impl.mController.Get(), image.GetUrl().c_str() );
+        const std::string imageFileName = value.Get< std::string >();
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p GRAB_HANDLE_IMAGE %s\n", impl.mController.Get(), imageFileName );
 
-        if( impl.mDecorator )
+        if( impl.mDecorator && imageFileName.size() )
         {
-          impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED, image );
+          impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED, imageFileName );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE:
       {
-        const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p GRAB_HANDLE_PRESSED_IMAGE %s\n", impl.mController.Get(), image.GetUrl().c_str() );
+        const std::string imageFileName = value.Get< std::string >();
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p GRAB_HANDLE_PRESSED_IMAGE %s\n", impl.mController.Get(), imageFileName );
 
-        if( impl.mDecorator )
+        if( impl.mDecorator && imageFileName.size() )
         {
-          impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED, image );
+          impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED, imageFileName );
           impl.RequestTextRelayout();
         }
         break;
@@ -461,66 +479,66 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
+          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, filename );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
+          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, filename );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
+          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, filename );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
+          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, filename );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_LEFT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, image );
+          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, filename );
           impl.RequestTextRelayout();
         }
         break;
       }
       case Toolkit::TextField::Property::SELECTION_HANDLE_MARKER_IMAGE_RIGHT:
       {
-        const Image image = Scripting::NewImage( value );
+        const std::string filename = GetImageFileNameFromPropertyValue( value );
 
-        if( impl.mDecorator && image )
+        if( impl.mDecorator && filename.size() )
         {
-          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, image );
+          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE_MARKER, HANDLE_IMAGE_RELEASED, filename );
           impl.RequestTextRelayout();
         }
         break;
@@ -967,11 +985,7 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
       {
         if( impl.mDecorator )
         {
-          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED ) );
-          if( image )
-          {
-            value = image.GetUrl();
-          }
+          value = impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED );
         }
         break;
       }
@@ -979,11 +993,7 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
       {
         if( impl.mDecorator )
         {
-          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED ) );
-          if( image )
-          {
-            value = image.GetUrl();
-          }
+          value = impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED );
         }
         break;
       }
@@ -1800,14 +1810,9 @@ void TextField::GetHandleImagePropertyValue(  Property::Value& value, Text::Hand
 {
   if( mDecorator )
   {
-    ResourceImage image = ResourceImage::DownCast( mDecorator->GetHandleImage( handleType, handleImageType ) );
-
-    if ( image )
-    {
-      Property::Map map;
-      Scripting::CreatePropertyMap( image, map );
-      value = map;
-    }
+    Property::Map map;
+    map[ IMAGE_MAP_FILENAME_STRING ] = mDecorator->GetHandleImage( handleType, handleImageType );
+    value = map;
   }
 }
 
index 66f747e..504e453 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <cfloat>
-#include <dali/public-api/images/buffer-image.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector4.h>
 #include <dali/public-api/object/property-map.h>
index 65a5f68..5eafd84 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -29,6 +29,7 @@
 #include <dali/public-api/object/property-notification.h>
 #include <dali/public-api/rendering/geometry.h>
 #include <dali/public-api/rendering/renderer.h>
+#include <dali/devel-api/adaptor-framework/image-loading.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
@@ -795,7 +796,7 @@ struct Decorator::Impl : public ConnectionTracker
     HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
     if( !grabHandle.actor )
     {
-      if( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] )
+      if( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED].size() )
       {
         grabHandle.actor = ImageView::New( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] );
         GetImpl( grabHandle.actor).SetDepthIndex( DepthIndex::DECORATION );
@@ -848,9 +849,9 @@ struct Decorator::Impl : public ConnectionTracker
     }
   }
 
-  void CreateHandleMarker( HandleImpl& handle, Image& image, HandleType handleType )
+  void CreateHandleMarker( HandleImpl& handle, const std::string& image, HandleType handleType )
   {
-    if( image )
+    if( image.size() )
     {
       handle.markerActor = ImageView::New( image );
       handle.markerActor.SetProperty( Actor::Property::COLOR, mHandleColor );
@@ -876,7 +877,7 @@ struct Decorator::Impl : public ConnectionTracker
     HandleImpl& primary = mHandle[ LEFT_SELECTION_HANDLE ];
     if( !primary.actor )
     {
-      if( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
+      if( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED].size() )
       {
         primary.actor = ImageView::New( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
 #ifdef DECORATOR_DEBUG
@@ -920,7 +921,7 @@ struct Decorator::Impl : public ConnectionTracker
     HandleImpl& secondary = mHandle[ RIGHT_SELECTION_HANDLE ];
     if( !secondary.actor )
     {
-      if( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
+      if( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED].size() )
       {
         secondary.actor = ImageView::New( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
 #ifdef DECORATOR_DEBUG
@@ -1121,7 +1122,7 @@ struct Decorator::Impl : public ConnectionTracker
     // Chooses between the released or pressed image. It checks whether the pressed image exists.
     if( handle.actor )
     {
-      const HandleImageType imageType = ( handle.pressed ? ( mHandleImages[type][HANDLE_IMAGE_PRESSED] ? HANDLE_IMAGE_PRESSED : HANDLE_IMAGE_RELEASED ) : HANDLE_IMAGE_RELEASED );
+      const HandleImageType imageType = ( handle.pressed ? ( mHandleImages[type][HANDLE_IMAGE_PRESSED].size() ? HANDLE_IMAGE_PRESSED : HANDLE_IMAGE_RELEASED ) : HANDLE_IMAGE_RELEASED );
 
       handle.actor.SetImage( mHandleImages[type][imageType] );
     }
@@ -1130,7 +1131,7 @@ struct Decorator::Impl : public ConnectionTracker
     {
       if( handle.markerActor )
       {
-        const HandleImageType markerImageType = ( handle.pressed ? ( mHandleImages[markerType][HANDLE_IMAGE_PRESSED] ? HANDLE_IMAGE_PRESSED : HANDLE_IMAGE_RELEASED ) : HANDLE_IMAGE_RELEASED );
+        const HandleImageType markerImageType = ( handle.pressed ? ( mHandleImages[markerType][HANDLE_IMAGE_PRESSED].size() ? HANDLE_IMAGE_PRESSED : HANDLE_IMAGE_RELEASED ) : HANDLE_IMAGE_RELEASED );
         handle.markerActor.SetImage( mHandleImages[markerType][markerImageType] );
       }
     }
@@ -1755,12 +1756,14 @@ struct Decorator::Impl : public ConnectionTracker
     mPopupBottomExceedNotification.NotifySignal().Connect( this, &Decorator::Impl::PopUpLeavesBottomBoundary );
   }
 
-  void SetHandleImage( HandleType handleType, HandleImageType handleImageType, Dali::Image image )
+  void SetHandleImage( HandleType handleType, HandleImageType handleImageType, const std::string& imageFileName )
   {
+    ImageDimensions dimensions = Dali::GetOriginalImageSize( imageFileName );
+
     HandleImpl& handle = mHandle[handleType];
-    handle.size = Size( image.GetWidth(), image.GetHeight() );
+    handle.size = Size( dimensions.GetWidth(), dimensions.GetHeight() );
 
-    mHandleImages[handleType][handleImageType] = image;
+    mHandleImages[handleType][handleImageType] = imageFileName;
   }
 
   void SetScrollThreshold( float threshold )
@@ -1898,7 +1901,7 @@ struct Decorator::Impl : public ConnectionTracker
   TextSelectionPopup::Buttons mEnabledPopupButtons; /// Bit mask of currently enabled Popup buttons
   TextSelectionPopupCallbackInterface& mTextSelectionPopupCallbackInterface;
 
-  Image               mHandleImages[HANDLE_TYPE_COUNT][HANDLE_IMAGE_TYPE_COUNT];
+  std::string         mHandleImages[HANDLE_TYPE_COUNT][HANDLE_IMAGE_TYPE_COUNT];
   Vector4             mHandleColor;
 
   CursorImpl          mCursor[CURSOR_COUNT];
@@ -2109,11 +2112,11 @@ void Decorator::SetHandleActive( HandleType handleType, bool active )
     // The problem is the handle actor does not receive the touch event with the Interrupt
     // state when the power button is pressed and the application goes to background.
     mImpl->mHandle[handleType].pressed = false;
-    Image imageReleased = mImpl->mHandleImages[handleType][HANDLE_IMAGE_RELEASED];
+    const bool imageReleased = mImpl->mHandleImages[handleType][HANDLE_IMAGE_RELEASED].size();
     ImageView imageView = mImpl->mHandle[handleType].actor;
     if( imageReleased && imageView )
     {
-      imageView.SetImage( imageReleased );
+      imageView.SetImage( mImpl->mHandleImages[handleType][HANDLE_IMAGE_RELEASED] );
     }
   }
 
@@ -2124,12 +2127,12 @@ bool Decorator::IsHandleActive( HandleType handleType ) const
   return mImpl->mHandle[handleType].active ;
 }
 
-void Decorator::SetHandleImage( HandleType handleType, HandleImageType handleImageType, Dali::Image image )
+void Decorator::SetHandleImage( HandleType handleType, HandleImageType handleImageType, const std::string& imageFileName )
 {
-  mImpl->SetHandleImage( handleType, handleImageType, image );
+  mImpl->SetHandleImage( handleType, handleImageType, imageFileName );
 }
 
-Dali::Image Decorator::GetHandleImage( HandleType handleType, HandleImageType handleImageType ) const
+const std::string& Decorator::GetHandleImage( HandleType handleType, HandleImageType handleImageType ) const
 {
   return mImpl->mHandleImages[handleType][handleImageType];
 }
index 36adee4..8d0894f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_DECORATOR_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -353,23 +353,23 @@ public:
   bool IsHandleActive( HandleType handleType ) const;
 
   /**
-   * @brief Sets the image for one of the handles.
+   * @brief Sets the image file name for one of the handles.
    *
    * @param[in] handleType One of the handles.
    * @param[in] handleImageType A different image can be set for the pressed/released states.
-   * @param[in] image The image to use.
+   * @param[in] imageFileName The image filename to use.
    */
-  void SetHandleImage( HandleType handleType, HandleImageType handleImageType, Dali::Image image );
+  void SetHandleImage( HandleType handleType, HandleImageType handleImageType, const std::string& imageFileName );
 
   /**
-   * @brief Retrieves the image for one of the handles.
+   * @brief Retrieves the file name of the image for one of the handles.
    *
    * @param[in] handleType One of the handles.
    * @param[in] handleImageType A different image can be set for the pressed/released states.
    *
-   * @return The grab handle image.
+   * @return The grab handle image string.
    */
-  Dali::Image GetHandleImage( HandleType handleType, HandleImageType handleImageType ) const;
+  const std::string& GetHandleImage( HandleType handleType, HandleImageType handleImageType ) const;
 
   /**
    * @brief Sets the color of the handles
index 3b567ef..044b9e3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_ATLAS_MANAGER_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -20,7 +20,6 @@
 // EXTERNAL INCLUDES
 #include <stdint.h>
 #include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/images/buffer-image.h>
 #include <dali/public-api/rendering/texture-set.h>
 
 namespace Dali
@@ -189,7 +188,7 @@ public:
                          bool addReference = true );
 
   /**
-   * @brief Get the BufferImage containing an atlas
+   * @brief Get the Texture containing an atlas
    *
    * @param[in] atlas AtlasId returned when atlas was created
    *
index d4e2f6e..d871c87 100755 (executable)
@@ -216,7 +216,7 @@ AnimatedGradientVisualPtr AnimatedGradientVisual::New( VisualFactoryCache& facto
 }
 
 AnimatedGradientVisual::AnimatedGradientVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL )
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, static_cast<Toolkit::Visual::Type>( Toolkit::DevelVisual::ANIMATED_GRADIENT ) )
 {
   SetupDefaultValue();
 }
index a0ebe45..386013a 100755 (executable)
@@ -168,7 +168,7 @@ void AnimatedImageVisual::InitializeGif( const VisualUrl& imageUrl )
 }
 
 AnimatedImageVisual::AnimatedImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory )
-: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ),
+: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO, Toolkit::Visual::ANIMATED_IMAGE ),
   mFrameDelayTimer(),
   mPlacementActor(),
   mImageVisualShaderFactory( shaderFactory ),
index bf3b519..e7255ea 100644 (file)
@@ -84,7 +84,7 @@ AnimatedVectorImageVisualPtr AnimatedVectorImageVisual::New( VisualFactoryCache&
 }
 
 AnimatedVectorImageVisual::AnimatedVectorImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, static_cast<Toolkit::Visual::Type>( Toolkit::DevelVisual::ANIMATED_VECTOR_IMAGE ) ),
   mUrl( imageUrl ),
   mAnimationData(),
   mVectorAnimationTask( new VectorAnimationTask( factoryCache, imageUrl.GetUrl() ) ),
index 6072ce5..55968e1 100644 (file)
@@ -74,7 +74,8 @@ VectorAnimationTask::VectorAnimationTask( VisualFactoryCache& factoryCache, cons
   mForward( true ),
   mUpdateFrameNumber( false ),
   mNeedAnimationFinishedTrigger( true ),
-  mAnimationDataUpdated( false )
+  mAnimationDataUpdated( false ),
+  mDestroyTask( false )
 {
   Initialize();
 }
@@ -95,6 +96,8 @@ void VectorAnimationTask::Finalize()
   }
 
   mVectorRenderer.Finalize();
+
+  mDestroyTask = true;
 }
 
 void VectorAnimationTask::SetRenderer( Renderer renderer )
@@ -372,6 +375,15 @@ bool VectorAnimationTask::Rasterize()
   bool stopped = false;
   uint32_t currentFrame;
 
+  {
+    ConditionalWait::ScopedLock lock( mConditionalWait );
+    if( mDestroyTask )
+    {
+      // The task will be destroyed. We don't need rasterization.
+      return false;
+    }
+  }
+
   ApplyAnimationData();
 
   if( mPlayState == PlayState::PLAYING && mUpdateFrameNumber )
index 8e91788..79c3ee2 100644 (file)
@@ -314,7 +314,7 @@ private:
   bool                                   mUpdateFrameNumber;
   bool                                   mNeedAnimationFinishedTrigger;
   bool                                   mAnimationDataUpdated;
-
+  bool                                   mDestroyTask;
 };
 
 } // namespace Internal
index a1eb02a..71bb538 100644 (file)
@@ -23,6 +23,7 @@
 
 //INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/arc-visual-actions-devel.h>
 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
@@ -153,12 +154,15 @@ ArcVisualPtr ArcVisual::New( VisualFactoryCache& factoryCache, const Property::M
 }
 
 ArcVisual::ArcVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, static_cast<Toolkit::Visual::Type>( Toolkit::DevelVisual::ARC ) ),
   mThickness( 0.0f ),
   mRadius( 0.0f ),
   mStartAngle( 0.0f ),
   mSweepAngle( 360.0f ),
   mRadiusIndex( Property::INVALID_INDEX ),
+  mThicknessIndex( Property::INVALID_INDEX ),
+  mStartAngleIndex( Property::INVALID_INDEX ),
+  mSweepAngleIndex( Property::INVALID_INDEX ),
   mCapType( DevelArcVisual::Cap::BUTT )
 {
 }
@@ -176,6 +180,16 @@ void ArcVisual::DoSetProperties( const Property::Map& propertyMap )
     {
       DALI_LOG_ERROR( "ArcVisual:DoSetProperties:: THICKNESS property has incorrect type: %d\n", thicknessValue->GetType() );
     }
+    else
+    {
+      if( mImpl->mRenderer )
+      {
+        mImpl->mRenderer.SetProperty( mThicknessIndex, mThickness );
+
+        // Need to calculate radius again
+        OnSetTransform();
+      }
+    }
   }
 
   Property::Value* startAngleValue = propertyMap.Find( Toolkit::DevelArcVisual::Property::START_ANGLE, START_ANGLE_NAME );
@@ -185,6 +199,13 @@ void ArcVisual::DoSetProperties( const Property::Map& propertyMap )
     {
       DALI_LOG_ERROR( "ArcVisual:DoSetProperties:: START_ANGLE property has incorrect type: %d\n", startAngleValue->GetType() );
     }
+    else
+    {
+      if( mImpl->mRenderer )
+      {
+        mImpl->mRenderer.SetProperty( mStartAngleIndex, mStartAngle );
+      }
+    }
   }
 
   Property::Value* sweepAngleValue = propertyMap.Find( Toolkit::DevelArcVisual::Property::SWEEP_ANGLE, SWEEP_ANGLE_NAME );
@@ -194,6 +215,13 @@ void ArcVisual::DoSetProperties( const Property::Map& propertyMap )
     {
       DALI_LOG_ERROR( "ArcVisual:DoSetProperties:: SWEEP_ANGLE property has incorrect type: %d\n", sweepAngleValue->GetType() );
     }
+    else
+    {
+      if( mImpl->mRenderer )
+      {
+        mImpl->mRenderer.SetProperty( mSweepAngleIndex, mSweepAngle );
+      }
+    }
   }
 
   Property::Value* capValue = propertyMap.Find( Toolkit::DevelArcVisual::Property::CAP, CAP_NAME );
@@ -241,6 +269,23 @@ void ArcVisual::OnSetTransform()
   }
 }
 
+void ArcVisual::OnDoAction( const Property::Index actionId, const Property::Value& attributes )
+{
+  // Check if action is valid for this visual type and perform action if possible
+  switch( actionId )
+  {
+    case DevelArcVisual::Action::UPDATE_PROPERTY:
+    {
+      Property::Map* map = attributes.GetMap();
+      if( map )
+      {
+        DoSetProperties( *map );
+      }
+      break;
+    }
+  }
+}
+
 void ArcVisual::InitializeRenderer()
 {
   Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY );
@@ -267,10 +312,9 @@ void ArcVisual::InitializeRenderer()
 
   mImpl->mRenderer = Renderer::New( geometry, shader );
 
-  mImpl->mRenderer.RegisterProperty( THICKNESS_NAME, mThickness );
-  mImpl->mRenderer.RegisterProperty( START_ANGLE_NAME, mStartAngle );
-  mImpl->mRenderer.RegisterProperty( SWEEP_ANGLE_NAME, mSweepAngle );
-  mImpl->mRenderer.RegisterProperty( CAP_NAME, 0.0f );
+  mThicknessIndex = mImpl->mRenderer.RegisterProperty( THICKNESS_NAME, mThickness );
+  mStartAngleIndex = mImpl->mRenderer.RegisterProperty( START_ANGLE_NAME, mStartAngle );
+  mSweepAngleIndex = mImpl->mRenderer.RegisterProperty( SWEEP_ANGLE_NAME, mSweepAngle );
 
   mRadiusIndex = mImpl->mRenderer.RegisterProperty( RADIUS_NAME, mRadius );
 
index e9fa083..3de0473 100644 (file)
@@ -103,6 +103,11 @@ protected:
    */
   void OnSetTransform() override;
 
+  /**
+   * @copydoc Visual::Base::OnDoAction
+   */
+  void OnDoAction( const Property::Index actionId, const Property::Value& attributes ) override;
+
 private:
 
   /**
@@ -125,6 +130,9 @@ private:
   float mStartAngle;                   ///< The start angle of the arc.
   float mSweepAngle;                   ///< The sweep angle of the arc.
   Property::Index mRadiusIndex;        ///< The index of the radius property.
+  Property::Index mThicknessIndex;     ///< The index of the thickness property.
+  Property::Index mStartAngleIndex;    ///< The index of the start angle property.
+  Property::Index mSweepAngleIndex;    ///< The index of the sweep angle property.
   DevelArcVisual::Cap::Type mCapType;  ///< The cap type.
 };
 
index c1ba93b..259b005 100644 (file)
@@ -125,7 +125,7 @@ BorderVisualPtr BorderVisual::New( VisualFactoryCache& factoryCache, const Prope
 }
 
 BorderVisual::BorderVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::BORDER ),
   mBorderColor( Color::TRANSPARENT ),
   mBorderSize( 0.f ),
   mBorderColorIndex( Property::INVALID_INDEX ),
index e2a30bd..cb2b447 100644 (file)
@@ -183,7 +183,7 @@ ColorVisualPtr ColorVisual::New( VisualFactoryCache& factoryCache, const Propert
 }
 
 ColorVisual::ColorVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::COLOR ),
   mBlurRadius( 0.0f ),
   mRenderIfTransparent( false )
 {
index e1959e7..9c19049 100644 (file)
@@ -22,7 +22,6 @@
 #include <typeinfo>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/images/buffer-image.h>
 #include <dali/public-api/object/property-array.h>
 #include <dali/devel-api/scripting/enum-helper.h>
 #include <dali/devel-api/scripting/scripting.h>
@@ -319,7 +318,7 @@ GradientVisualPtr GradientVisual::New( VisualFactoryCache& factoryCache, const P
 }
 
 GradientVisual::GradientVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::GRADIENT ),
   mGradientType( LINEAR ),
   mIsOpaque( true )
 {
index d6dd7f4..f6e77ba 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_GRADIENT_H
 
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/images/buffer-image.h>
 #include <dali/public-api/math/matrix3.h>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/rendering/texture.h>
index 07ead87..eb5713e 100644 (file)
@@ -157,7 +157,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache,
                           ImageDimensions size,
                           FittingMode::Type fittingMode,
                           Dali::SamplingMode::Type samplingMode )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::IMAGE ),
   mImage(),
   mPixelArea( FULL_TEXTURE_RECT ),
   mPlacementActor(),
@@ -183,7 +183,7 @@ ImageVisual::ImageVisual( VisualFactoryCache& factoryCache,
 }
 
 ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const Image& image )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::IMAGE ),
   mImage( image ),
   mPixelArea( FULL_TEXTURE_RECT ),
   mPlacementActor(),
index 7fbb28e..3b918e2 100644 (file)
@@ -351,7 +351,7 @@ MeshVisualPtr MeshVisual::New( VisualFactoryCache& factoryCache, const Property:
 }
 
 MeshVisual::MeshVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ),
+: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO, Toolkit::Visual::MESH ),
   mShadingMode( Toolkit::MeshVisual::ShadingMode::TEXTURED_WITH_DETAILED_SPECULAR_LIGHTING ),
   mUseTexture( true ),
   mUseMipmapping( true ),
index c4dc4df..0c89731 100755 (executable)
@@ -19,8 +19,6 @@
 #include "npatch-visual.h"
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/images/buffer-image.h>
-#include <dali/public-api/images/resource-image.h>
 #include <dali/devel-api/object/handle-devel.h>
 #include <dali/devel-api/images/texture-set-image.h>
 #include <dali/devel-api/adaptor-framework/image-loading.h>
@@ -456,7 +454,7 @@ void NPatchVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
 }
 
 NPatchVisual::NPatchVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::N_PATCH ),
   mPlacementActor(),
   mLoader( factoryCache.GetNPatchLoader() ),
   mImageUrl(),
index 8b2346c..9a9c06f 100644 (file)
@@ -173,7 +173,7 @@ PrimitiveVisualPtr PrimitiveVisual::New( VisualFactoryCache& factoryCache, const
 }
 
 PrimitiveVisual::PrimitiveVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ),
+: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO, Toolkit::Visual::PRIMITIVE ),
   mScaleDimensions( Vector3::ONE ),
   mScaleTopRadius( DEFAULT_SCALE_TOP_RADIUS ),
   mScaleBottomRadius( DEFAULT_SCALE_BOTTOM_RADIUS ),
index b7bdbfd..e01020e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_SVG_RASTERIZE_THREAD_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -22,7 +22,6 @@
 #include <dali/devel-api/threading/conditional-wait.h>
 #include <dali/devel-api/threading/mutex.h>
 #include <dali/devel-api/threading/thread.h>
-#include <dali/public-api/images/buffer-image.h>
 #include <dali/public-api/images/pixel-data.h>
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali/public-api/common/vector-wrapper.h>
index 9330bdb..32ff3ea 100644 (file)
@@ -68,7 +68,7 @@ SvgVisualPtr SvgVisual::New( VisualFactoryCache& factoryCache, ImageVisualShader
 }
 
 SvgVisual::SvgVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::SVG ),
   mImageVisualShaderFactory( shaderFactory ),
   mAtlasRect( FULL_TEXTURE_RECT ),
   mImageUrl( imageUrl ),
index 9ddbf3b..a3057c3 100755 (executable)
@@ -383,7 +383,7 @@ void TextVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
 
 
 TextVisual::TextVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ),
+: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO, Toolkit::Visual::TEXT ),
   mController( Text::Controller::New() ),
   mTypesetter( Text::Typesetter::New( mController->GetTextModel() ) ),
   mAnimatableTextColorPropertyIndex( Property::INVALID_INDEX ),
index 4bb7634..41040ef 100644 (file)
@@ -115,7 +115,7 @@ bool GetPolicyFromValue( const Property::Value& value, Vector2& policy )
 
 } // unnamed namespace
 
-Internal::Visual::Base::Impl::Impl(FittingMode fittingMode)
+Internal::Visual::Base::Impl::Impl( FittingMode fittingMode, Toolkit::Visual::Type type )
 : mCustomShader( NULL ),
   mBlendSlotDelegate( NULL ),
   mEventObserver( NULL ),
@@ -128,7 +128,8 @@ Internal::Visual::Base::Impl::Impl(FittingMode fittingMode)
   mCornerRadiusIndex( Property::INVALID_INDEX ),
   mFittingMode( fittingMode ),
   mFlags( 0 ),
-  mResourceStatus( Toolkit::Visual::ResourceStatus::PREPARING )
+  mResourceStatus( Toolkit::Visual::ResourceStatus::PREPARING ),
+  mType( type )
 {
 }
 
index 839971b..1b6afa3 100644 (file)
@@ -46,8 +46,9 @@ struct Base::Impl
   /**
    * Constructor
    * @param [in] fittingMode that the derived class prefers
+   * @param [in] type The type of the this visual
    */
-  Impl(FittingMode fittingMode);
+  Impl( FittingMode fittingMode, Toolkit::Visual::Type type );
 
   /**
    * Destructor
@@ -132,6 +133,7 @@ struct Base::Impl
   FittingMode     mFittingMode;  //< How the contents should fit the view
   int             mFlags;
   Toolkit::Visual::ResourceStatus  mResourceStatus;
+  const Toolkit::Visual::Type      mType;
 };
 
 } // namespace Visual
index 2cbca7d..c63a9e2 100755 (executable)
@@ -67,8 +67,8 @@ DALI_ENUM_TO_STRING_TABLE_END( VISUAL_FITTING_MODE )
 
 } // namespace
 
-Visual::Base::Base( VisualFactoryCache& factoryCache, FittingMode fittingMode )
-: mImpl( new Impl(fittingMode) ),
+Visual::Base::Base( VisualFactoryCache& factoryCache, FittingMode fittingMode, Toolkit::Visual::Type type )
+: mImpl( new Impl( fittingMode, type ) ),
   mFactoryCache( factoryCache )
 {
 }
@@ -502,6 +502,11 @@ bool Visual::Base::IsSynchronousLoadingRequired() const
   return ( mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING );
 }
 
+Toolkit::Visual::Type Visual::Base::GetType() const
+{
+  return mImpl->mType;
+}
+
 Toolkit::Visual::ResourceStatus Visual::Base::GetResourceStatus() const
 {
   return mImpl->mResourceStatus;
index a04fa1f..6105867 100644 (file)
@@ -272,14 +272,23 @@ public:
    */
   bool IsSynchronousLoadingRequired() const;
 
+  /**
+   * @brief Get the type of this visual.
+   *
+   * @return The the type of this visual.
+   */
+  Toolkit::Visual::Type GetType() const;
+
  protected:
 
   /**
    * @brief Constructor.
    *
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
+   * @param[in] fittingMode The value that determines how the visual should be fit to the view
+   * @param[in] type The type of the this visual
    */
-  Base( VisualFactoryCache& factoryCache, FittingMode fittingMode );
+  Base( VisualFactoryCache& factoryCache, FittingMode fittingMode, Toolkit::Visual::Type type );
 
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().
index 1202d1c..5364de2 100644 (file)
@@ -106,7 +106,7 @@ WireframeVisualPtr WireframeVisual::New( VisualFactoryCache& factoryCache, Visua
 }
 
 WireframeVisual::WireframeVisual( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, actualVisual ? actualVisual->GetType() : Toolkit::Visual::WIREFRAME ),
   mActualVisual( actualVisual )
 {
 }
index 02d3e0d..78e7f39 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -59,15 +59,6 @@ ImageView ImageView::New()
   return Internal::ImageView::New();
 }
 
-ImageView ImageView::New( Image image )
-{
-  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: New() is deprecated and will be removed from next release. use New( const std::string& ) instead.\n" );
-
-  ImageView imageView = Internal::ImageView::New();
-  imageView.SetImage( image );
-  return imageView;
-}
-
 ImageView ImageView::New( const std::string& url )
 {
   ImageView imageView = Internal::ImageView::New();
@@ -87,13 +78,6 @@ ImageView ImageView::DownCast( BaseHandle handle )
   return Control::DownCast<ImageView, Internal::ImageView>( handle );
 }
 
-void ImageView::SetImage( Image image )
-{
-  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetImage() is deprecated and will be removed from next release. Use SetImage( const std::string& ) instead.\n" );
-
-  Dali::Toolkit::GetImpl( *this ).SetImage( image );
-}
-
 void ImageView::SetImage( const std::string& url )
 {
   Dali::Toolkit::GetImpl( *this ).SetImage( url, ImageDimensions() );
@@ -104,13 +88,6 @@ void ImageView::SetImage( const std::string& url, ImageDimensions size )
   Dali::Toolkit::GetImpl( *this ).SetImage( url, size );
 }
 
-Image ImageView::GetImage() const
-{
-  DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetImage() is deprecated and will be removed from next release.\n" );
-
-  return Dali::Toolkit::GetImpl( *this ).GetImage();
-}
-
 ImageView::ImageView( Internal::ImageView& implementation )
  : Control( implementation )
 {
index c6d0b2a..76c6f54 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_IMAGE_VIEW_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -150,19 +150,6 @@ public:
   static ImageView New();
 
   /**
-   * @DEPRECATED_1_2_8, use New( const std::string& ) instead.
-   *
-   * @brief Creates an initialized ImageView from an Image instance.
-   *
-   * If the handle is empty, ImageView will not display anything.
-   *
-   * @SINCE_1_0.0
-   * @param[in] image The Image instance to display
-   * @return A handle to a newly allocated ImageView
-   */
-  static ImageView New( Image image ) DALI_DEPRECATED_API;
-
-  /**
    * @brief Creates an initialized ImageView from an URL to an image resource.
    *
    * If the string is empty, ImageView will not display anything.
@@ -230,17 +217,6 @@ public:
   static ImageView DownCast( BaseHandle handle );
 
   /**
-   * @DEPRECATED_1_2_8, use SetImage( const std::string& ) instead.
-   *
-   * @brief Sets this ImageView from an Image instance.
-   *
-   * If the handle is empty, ImageView will display nothing
-   * @SINCE_1_0.0
-   * @param[in] image The Image instance to display.
-   */
-  void SetImage( Image image ) DALI_DEPRECATED_API;
-
-  /**
    * @brief Sets this ImageView from the given URL.
    *
    * If the URL is empty, ImageView will not display anything.
@@ -265,17 +241,6 @@ public:
    */
   void SetImage( const std::string& url, ImageDimensions size );
 
-  /**
-   * @DEPRECATED_1_1.4
-   * @brief Gets the Image instance handle used by the ImageView.
-   *
-   * A valid handle will be returned only if this instance was created with New(Image) or SetImage(Image) was called.
-   *
-   * @SINCE_1_0.0
-   * @return The Image instance currently used by the ImageView
-   */
-  Image GetImage() const DALI_DEPRECATED_API;
-
 public: // Not intended for application developers
 
   /// @cond internal
index a7b87c2..407e026 100644 (file)
@@ -158,7 +158,7 @@ public:
 public:
 
   /**
-   * @brief Creates the ProgressBar control.
+   * @brief Creates the ProgressBar control. It creates a horizontal linear shape of progress bar.
    * @SINCE_1_2.60
    * @return A handle to the ProgressBar control
    */
index 43bd4e5..35dec78 100755 (executable)
       "secondaryProgressValue":0.0,
       "indeterminate": false
     },
+    "CircularProgressBar":
+    {
+      "size":[64,64],
+      "trackVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.165,0.302,1.0],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "progressVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.549,1.0,1.0],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "secondaryProgressVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.549,1.0,0.3],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "indeterminateVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.02,0.71,0.525,1.0],
+        "thickness":4.0,
+        "startAngle":267.0,
+        "sweepAngle":75.0,
+        "cap":"ROUND"
+      },
+      "indeterminateVisualAnimation":
+      [
+        {
+          "target":"trackVisual",
+          "property":"opacity",
+          "targetValue": 0,
+          "animator":
+          {
+            "alphaFunction":"DEFAULT",
+            "timePeriod":
+            {
+              "duration":0,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"secondaryProgressVisual",
+          "property":"opacity",
+          "targetValue": 0,
+          "animator":
+          {
+            "alphaFunction":"DEFAULT",
+            "timePeriod":
+            {
+              "duration":0,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"sweepAngle",
+          "initialValue": 75,
+          "targetValue": 180,
+          "animator":
+          {
+            "alphaFunction":[0.439, 0.0, 0.718, 0.428],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"sweepAngle",
+          "targetValue": 75,
+          "animator":
+          {
+            "alphaFunction":[0.224, 0.571, 0.53, 1.0],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":2.0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"startAngle",
+          "initialValue": 87,
+          "targetValue": 1887,
+          "animator":
+          {
+            "alphaFunction":[0.33, 0.0, 0.3, 1.0],
+            "timePeriod":
+            {
+              "duration":3.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"sweepAngle",
+          "initialValue": 75,
+          "targetValue": 180,
+          "animator":
+          {
+            "alphaFunction":[0.439, 0.0, 0.718, 0.428],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"sweepAngle",
+          "targetValue": 75,
+          "animator":
+          {
+            "alphaFunction":[0.224, 0.571, 0.53, 1.0],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":2.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"startAngle",
+          "initialValue": 267,
+          "targetValue": 2067,
+          "animator":
+          {
+            "alphaFunction":[0.33, 0.0, 0.3, 1.0],
+            "timePeriod":
+            {
+              "duration":3.0,
+              "delay":0.0
+            }
+          }
+        }
+      ],
+      "labelVisual":{
+        "visualType": "TEXT",
+        "textColor": [ 1.0, 1.0, 1.0, 1.0 ],
+        "pointSize" : 12.0, // Point size must always be provided to Text Visual
+        "horizontalAlignment": "CENTER",
+        "verticalAlignment": "CENTER"
+      },
+      "progressValue": 0.2,
+      "secondaryProgressValue":0.4,
+      "indeterminate": false
+    },
     "Button":
     {
       "styles":["Tooltip"],
index 2028c16..d055427 100755 (executable)
       "secondaryProgressValue":0.0,
       "indeterminate": false
     },
+    "CircularProgressBar":
+    {
+      "size":[64,64],
+      "trackVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.165,0.302,1.0],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "progressVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.549,1.0,1.0],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "secondaryProgressVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.549,1.0,0.3],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "indeterminateVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.02,0.71,0.525,1.0],
+        "thickness":4.0,
+        "startAngle":267.0,
+        "sweepAngle":75.0,
+        "cap":"ROUND"
+      },
+      "indeterminateVisualAnimation":
+      [
+        {
+          "target":"trackVisual",
+          "property":"opacity",
+          "targetValue": 0,
+          "animator":
+          {
+            "alphaFunction":"DEFAULT",
+            "timePeriod":
+            {
+              "duration":0,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"secondaryProgressVisual",
+          "property":"opacity",
+          "targetValue": 0,
+          "animator":
+          {
+            "alphaFunction":"DEFAULT",
+            "timePeriod":
+            {
+              "duration":0,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"sweepAngle",
+          "initialValue": 75,
+          "targetValue": 180,
+          "animator":
+          {
+            "alphaFunction":[0.439, 0.0, 0.718, 0.428],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"sweepAngle",
+          "targetValue": 75,
+          "animator":
+          {
+            "alphaFunction":[0.224, 0.571, 0.53, 1.0],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":2.0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"startAngle",
+          "initialValue": 87,
+          "targetValue": 1887,
+          "animator":
+          {
+            "alphaFunction":[0.33, 0.0, 0.3, 1.0],
+            "timePeriod":
+            {
+              "duration":3.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"sweepAngle",
+          "initialValue": 75,
+          "targetValue": 180,
+          "animator":
+          {
+            "alphaFunction":[0.439, 0.0, 0.718, 0.428],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"sweepAngle",
+          "targetValue": 75,
+          "animator":
+          {
+            "alphaFunction":[0.224, 0.571, 0.53, 1.0],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":2.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"startAngle",
+          "initialValue": 267,
+          "targetValue": 2067,
+          "animator":
+          {
+            "alphaFunction":[0.33, 0.0, 0.3, 1.0],
+            "timePeriod":
+            {
+              "duration":3.0,
+              "delay":0.0
+            }
+          }
+        }
+      ],
+      "labelVisual":{
+        "visualType": "TEXT",
+        "textColor": [ 1.0, 1.0, 1.0, 1.0 ],
+        "pointSize" : 12.0, // Point size must always be provided to Text Visual
+        "horizontalAlignment": "CENTER",
+        "verticalAlignment": "CENTER"
+      },
+      "progressValue": 0.2,
+      "secondaryProgressValue":0.4,
+      "indeterminate": false
+    },
     "Button":
     {
       "styles":["Tooltip"],
index 36db9a1..14fdc1e 100644 (file)
       "secondaryProgressValue":0.0,
       "indeterminate": false
     },
+    "CircularProgressBar":
+    {
+      "size":[64,64],
+      "trackVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.165,0.302,1.0],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "progressVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.549,1.0,1.0],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "secondaryProgressVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.549,1.0,0.3],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "indeterminateVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.02,0.71,0.525,1.0],
+        "thickness":4.0,
+        "startAngle":267.0,
+        "sweepAngle":75.0,
+        "cap":"ROUND"
+      },
+      "indeterminateVisualAnimation":
+      [
+        {
+          "target":"trackVisual",
+          "property":"opacity",
+          "targetValue": 0,
+          "animator":
+          {
+            "alphaFunction":"DEFAULT",
+            "timePeriod":
+            {
+              "duration":0,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"secondaryProgressVisual",
+          "property":"opacity",
+          "targetValue": 0,
+          "animator":
+          {
+            "alphaFunction":"DEFAULT",
+            "timePeriod":
+            {
+              "duration":0,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"sweepAngle",
+          "initialValue": 75,
+          "targetValue": 180,
+          "animator":
+          {
+            "alphaFunction":[0.439, 0.0, 0.718, 0.428],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"sweepAngle",
+          "targetValue": 75,
+          "animator":
+          {
+            "alphaFunction":[0.224, 0.571, 0.53, 1.0],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":2.0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"startAngle",
+          "initialValue": 87,
+          "targetValue": 1887,
+          "animator":
+          {
+            "alphaFunction":[0.33, 0.0, 0.3, 1.0],
+            "timePeriod":
+            {
+              "duration":3.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"sweepAngle",
+          "initialValue": 75,
+          "targetValue": 180,
+          "animator":
+          {
+            "alphaFunction":[0.439, 0.0, 0.718, 0.428],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"sweepAngle",
+          "targetValue": 75,
+          "animator":
+          {
+            "alphaFunction":[0.224, 0.571, 0.53, 1.0],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":2.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"startAngle",
+          "initialValue": 267,
+          "targetValue": 2067,
+          "animator":
+          {
+            "alphaFunction":[0.33, 0.0, 0.3, 1.0],
+            "timePeriod":
+            {
+              "duration":3.0,
+              "delay":0.0
+            }
+          }
+        }
+      ],
+      "labelVisual":{
+        "visualType": "TEXT",
+        "textColor": [ 1.0, 1.0, 1.0, 1.0 ],
+        "pointSize" : 12.0, // Point size must always be provided to Text Visual
+        "horizontalAlignment": "CENTER",
+        "verticalAlignment": "CENTER"
+      },
+      "progressValue": 0.2,
+      "secondaryProgressValue":0.4,
+      "indeterminate": false
+    },
     "Button":
     {
       "initialAutoRepeatingDelay":2.0,
index f35f988..a5d23aa 100644 (file)
       "secondaryProgressValue":0.0,
       "indeterminate": false
     },
+    "CircularProgressBar":
+    {
+      "size":[64,64],
+      "trackVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.165,0.302,1.0],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "progressVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.549,1.0,1.0],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "secondaryProgressVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.549,1.0,0.3],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "indeterminateVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.02,0.71,0.525,1.0],
+        "thickness":4.0,
+        "startAngle":267.0,
+        "sweepAngle":75.0,
+        "cap":"ROUND"
+      },
+      "indeterminateVisualAnimation":
+      [
+        {
+          "target":"trackVisual",
+          "property":"opacity",
+          "targetValue": 0,
+          "animator":
+          {
+            "alphaFunction":"DEFAULT",
+            "timePeriod":
+            {
+              "duration":0,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"secondaryProgressVisual",
+          "property":"opacity",
+          "targetValue": 0,
+          "animator":
+          {
+            "alphaFunction":"DEFAULT",
+            "timePeriod":
+            {
+              "duration":0,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"sweepAngle",
+          "initialValue": 75,
+          "targetValue": 180,
+          "animator":
+          {
+            "alphaFunction":[0.439, 0.0, 0.718, 0.428],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"sweepAngle",
+          "targetValue": 75,
+          "animator":
+          {
+            "alphaFunction":[0.224, 0.571, 0.53, 1.0],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":2.0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"startAngle",
+          "initialValue": 87,
+          "targetValue": 1887,
+          "animator":
+          {
+            "alphaFunction":[0.33, 0.0, 0.3, 1.0],
+            "timePeriod":
+            {
+              "duration":3.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"sweepAngle",
+          "initialValue": 75,
+          "targetValue": 180,
+          "animator":
+          {
+            "alphaFunction":[0.439, 0.0, 0.718, 0.428],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"sweepAngle",
+          "targetValue": 75,
+          "animator":
+          {
+            "alphaFunction":[0.224, 0.571, 0.53, 1.0],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":2.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"startAngle",
+          "initialValue": 267,
+          "targetValue": 2067,
+          "animator":
+          {
+            "alphaFunction":[0.33, 0.0, 0.3, 1.0],
+            "timePeriod":
+            {
+              "duration":3.0,
+              "delay":0.0
+            }
+          }
+        }
+      ],
+      "labelVisual":{
+        "visualType": "TEXT",
+        "textColor": [ 1.0, 1.0, 1.0, 1.0 ],
+        "pointSize" : 12.0, // Point size must always be provided to Text Visual
+        "horizontalAlignment": "CENTER",
+        "verticalAlignment": "CENTER"
+      },
+      "progressValue": 0.2,
+      "secondaryProgressValue":0.4,
+      "indeterminate": false
+    },
     "Button":
     {
       "styles":["Tooltip"],
index 1a9d7ab..3627ef4 100644 (file)
       "secondaryProgressValue":0.0,
       "indeterminate": false
     },
+    "CircularProgressBar":
+    {
+      "size":[64,64],
+      "trackVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.165,0.302,1.0],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "progressVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.549,1.0,1.0],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "secondaryProgressVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.0,0.549,1.0,0.3],
+        "thickness":4.0,
+        "startAngle":0.0,
+        "cap":"ROUND"
+      },
+      "indeterminateVisual":{
+        "visualType":"ARC",
+        "mixColor":[0.02,0.71,0.525,1.0],
+        "thickness":4.0,
+        "startAngle":267.0,
+        "sweepAngle":75.0,
+        "cap":"ROUND"
+      },
+      "indeterminateVisualAnimation":
+      [
+        {
+          "target":"trackVisual",
+          "property":"opacity",
+          "targetValue": 0,
+          "animator":
+          {
+            "alphaFunction":"DEFAULT",
+            "timePeriod":
+            {
+              "duration":0,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"secondaryProgressVisual",
+          "property":"opacity",
+          "targetValue": 0,
+          "animator":
+          {
+            "alphaFunction":"DEFAULT",
+            "timePeriod":
+            {
+              "duration":0,
+              "delay":0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"sweepAngle",
+          "initialValue": 75,
+          "targetValue": 180,
+          "animator":
+          {
+            "alphaFunction":[0.439, 0.0, 0.718, 0.428],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"sweepAngle",
+          "targetValue": 75,
+          "animator":
+          {
+            "alphaFunction":[0.224, 0.571, 0.53, 1.0],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":2.0
+            }
+          }
+        },
+        {
+          "target":"progressVisual",
+          "property":"startAngle",
+          "initialValue": 87,
+          "targetValue": 1887,
+          "animator":
+          {
+            "alphaFunction":[0.33, 0.0, 0.3, 1.0],
+            "timePeriod":
+            {
+              "duration":3.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"sweepAngle",
+          "initialValue": 75,
+          "targetValue": 180,
+          "animator":
+          {
+            "alphaFunction":[0.439, 0.0, 0.718, 0.428],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":0.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"sweepAngle",
+          "targetValue": 75,
+          "animator":
+          {
+            "alphaFunction":[0.224, 0.571, 0.53, 1.0],
+            "timePeriod":
+            {
+              "duration":1.0,
+              "delay":2.0
+            }
+          }
+        },
+        {
+          "target":"indeterminateVisual",
+          "property":"startAngle",
+          "initialValue": 267,
+          "targetValue": 2067,
+          "animator":
+          {
+            "alphaFunction":[0.33, 0.0, 0.3, 1.0],
+            "timePeriod":
+            {
+              "duration":3.0,
+              "delay":0.0
+            }
+          }
+        }
+      ],
+      "labelVisual":{
+        "visualType": "TEXT",
+        "textColor": [ 1.0, 1.0, 1.0, 1.0 ],
+        "pointSize" : 12.0, // Point size must always be provided to Text Visual
+        "horizontalAlignment": "CENTER",
+        "verticalAlignment": "CENTER"
+      },
+      "progressValue": 0.2,
+      "secondaryProgressValue":0.4,
+      "indeterminate": false
+    },
     "Button":
     {
       "initialAutoRepeatingDelay":2.0,