}
DummyVisual::DummyVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::Type::COLOR ),
mActionCounter( 0 )
{
}
/*
- * 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.
TestDebugVisual( borderVisual, Visual::BORDER, Vector2::ZERO );
// Test that image visual is replaced with debug visual
- Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME);
- Visual::Base imageVisual = factory.CreateVisual( image );
+ map.Clear();
+ map[ Toolkit::Visual::Property::TYPE ] = Visual::IMAGE;
+ map[ ImageVisual::Property::URL ] = TEST_IMAGE_FILE_NAME;
+ Visual::Base imageVisual = factory.CreateVisual( map );
DALI_TEST_CHECK( imageVisual );
TestDebugVisual( imageVisual, Visual::IMAGE, Vector2::ZERO);
#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"
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;
+}
}
-int UtcDaliImageVisualImageHandle(void)
-{
- ToolkitTestApplication application;
- tet_infoline( "Request image visual with an image handle" );
-
- VisualFactory factory = VisualFactory::Get();
- DALI_TEST_CHECK( factory );
-
- Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME);
- Visual::Base visual = factory.CreateVisual( image );
-
- // For tesing the LoadResourceFunc is called, a big image size should be set, so the atlasing is not applied.
- // Image with a size smaller than 512*512 will be uploaded as a part of the atlas.
-
- const int width=512;
- const int height=513;
-
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
- bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, width, height,width, height );
-
- TestGlAbstraction& gl = application.GetGlAbstraction();
- TraceCallStack& textureTrace = gl.GetTextureTrace();
- textureTrace.Enable(true);
-
- DummyControl actor = DummyControl::New();
- TestVisualRender( application, actor, visual, 1u,
- ImageDimensions(width, height),
- Integration::ResourcePointer(bitmap) );
-
- DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
- END_TEST;
-}
-
int UtcDaliImageVisualCustomWrapModePixelArea(void)
{
ToolkitTestApplication application;
#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;
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;
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;
+}
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 "/";
return true;
}
-void PrepareResourceImage( ToolkitTestApplication& application, unsigned int imageWidth, unsigned int imageHeight, Pixel::Format pixelFormat )
-{
- TestPlatformAbstraction& platform = application.GetPlatform();
- platform.SetClosestImageSize(Vector2( imageWidth, imageHeight));
-
- Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_RETAIN );
- Integration::PixelBuffer* pixbuffer = bitmap->GetPackedPixelsProfile()->ReserveBuffer( pixelFormat, imageWidth, imageHeight, imageWidth, imageHeight );
- unsigned int bytesPerPixel = GetBytesPerPixel( pixelFormat );
- unsigned int initialColor = 0xFF;
- memset( pixbuffer, initialColor, imageHeight*imageWidth*bytesPerPixel);
-
- Integration::ResourcePointer resourcePtr(bitmap);
- platform.SetSynchronouslyLoadedResource( resourcePtr );
-}
} //namespace
void dali_visual_startup(void)
DALI_TEST_EQUALS( naturalSize, Vector2::ZERO, TEST_LOCATION );
// image visual
- PrepareResourceImage( application, 100u, 200u, Pixel::RGBA8888 );
- Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
- Visual::Base imageVisual = factory.CreateVisual( image );
+ map.Clear();
+ map[Toolkit::Visual::Property::TYPE] = Toolkit::Visual::IMAGE;
+ map[Toolkit::ImageVisual::Property::URL] = TEST_IMAGE_FILE_NAME;
+ map[Toolkit::ImageVisual::Property::DESIRED_WIDTH] = 100.0f;
+ map[Toolkit::ImageVisual::Property::DESIRED_HEIGHT] = 200.0f;
+ Visual::Base imageVisual = factory.CreateVisual( map );
imageVisual.SetTransformAndSize(DefaultTransform(), controlSize );
imageVisual.GetNaturalSize(naturalSize);
DALI_TEST_CHECK( value );
DALI_TEST_CHECK( value->Get<bool>() == true );
- // Get an image visual with an image handle, and test the default property values
- PrepareResourceImage( application, 100u, 200u, Pixel::RGBA8888 );
- Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
- imageVisual = factory.CreateVisual(image);
- imageVisual.CreatePropertyMap( resultMap );
-
- value = resultMap.Find( Toolkit::Visual::Property::TYPE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == Visual::IMAGE );
-
- value = resultMap.Find( ImageVisual::Property::URL, Property::STRING );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<std::string>() == TEST_IMAGE_FILE_NAME );
-
- value = resultMap.Find( ImageVisual::Property::FITTING_MODE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == FittingMode::DEFAULT );
-
- value = resultMap.Find( ImageVisual::Property::SAMPLING_MODE, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == SamplingMode::BOX );
-
- value = resultMap.Find( ImageVisual::Property::DESIRED_WIDTH, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == 100 );
-
- value = resultMap.Find( ImageVisual::Property::DESIRED_HEIGHT, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == 200 );
-
- value = resultMap.Find( ImageVisual::Property::PIXEL_AREA, Property::VECTOR4 );
- DALI_TEST_CHECK( value );
- DALI_TEST_EQUALS( value->Get<Vector4>(), Vector4( 0.f, 0.f, 1.f, 1.f ), Math::MACHINE_EPSILON_100, TEST_LOCATION );
-
- value = resultMap.Find( ImageVisual::Property::WRAP_MODE_U, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == WrapMode::DEFAULT);
-
- value = resultMap.Find( ImageVisual::Property::WRAP_MODE_V, Property::INTEGER );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<int>() == WrapMode::DEFAULT);
-
- value = resultMap.Find( "synchronousLoading", Property::BOOLEAN );
- DALI_TEST_CHECK( value );
- DALI_TEST_CHECK( value->Get<bool>() == false );
-
END_TEST;
}
int UtcDaliVisualSetTransform5(void)
{
ToolkitTestApplication application;
- tet_infoline( "UtcDaliVisualSetTransform: ImageVisual from Image" );
-
- VisualFactory factory = VisualFactory::Get();
- Image image = ResourceImage::New(TEST_IMAGE_FILE_NAME, ImageDimensions(100, 200));
- Visual::Base visual = factory.CreateVisual(image);
- TestTransform( application, visual );
- TestMixColor( visual, Visual::Property::MIX_COLOR, Color::WHITE );
-
- END_TEST;
-}
-
-int UtcDaliVisualSetTransform6(void)
-{
- ToolkitTestApplication application;
tet_infoline( "UtcDaliVisualSetTransform: ImageVisual for URL " );
VisualFactory factory = VisualFactory::Get();
END_TEST;
}
-int UtcDaliVisualSetTransform7(void)
+int UtcDaliVisualSetTransform6(void)
{
ToolkitTestApplication application;
tet_infoline( "UtcDaliVisualSetTransform: NPatch visual" );
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;
+}
--- /dev/null
+/*
+ * 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
--- /dev/null
+#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
${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
${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
${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
${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}
GetImplementation( *this ).CreatePropertyMap( map );
}
+Visual::Type Visual::Base::GetType() const
+{
+ return GetImplementation( *this ).GetType();
+}
+
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/dali-toolkit-common.h>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
namespace Dali
{
*/
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);
/*
- * 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.
return GetImplementation( *this ).CreateVisual( propertyMap );
}
-Visual::Base VisualFactory::CreateVisual( const Image& image )
-{
- return GetImplementation( *this ).CreateVisual( image );
-}
-
Visual::Base VisualFactory::CreateVisual( const std::string& url, ImageDimensions size )
{
return GetImplementation( *this ).CreateVisual( url, size );
#define DALI_TOOLKIT_VISUAL_FACTORY_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.
Visual::Base CreateVisual( const Property::Map& propertyMap );
/**
- * @brief Request the visual to render the image.
- *
- * @param[in] image The image to be rendered.
- * @return The pointer pointing to the visual
- */
- Visual::Base CreateVisual( const Image& image );
-
- /**
* @brief Request the visual to render the given resource at the url.
*
* @param[in] url The URL to the resource to be rendered.
--- /dev/null
+#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
#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>
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
// 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();
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 );
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 )
{
{
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();
{
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 );
{
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();
}
}
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();
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 )
{
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;
}
*
*/
-
// 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
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:
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 );
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
/*
- * 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.
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
namespace Dali
mUrl = url;
if( mWebEngine )
{
- Dali::Image image = Dali::NativeImage::New( *mWebEngine.GetNativeImageSource() );
- mVisual = Toolkit::VisualFactory::Get().CreateVisual( image );
+ Texture texture = Dali::Texture::New( *mWebEngine.GetNativeImageSource() );
+ const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture( texture );
+ mVisual = Toolkit::VisualFactory::Get().CreateVisual(
+ { { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE } ,
+ { Toolkit::ImageVisual::Property::URL, nativeImageUrl } } );
if( mVisual )
{
{
if( mWebEngine )
{
- Dali::Image image = Dali::NativeImage::New( *mWebEngine.GetNativeImageSource() );
- mVisual = Toolkit::VisualFactory::Get().CreateVisual( image );
+ Texture texture = Dali::Texture::New( *mWebEngine.GetNativeImageSource() );
+ const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture( texture );
+
+ mVisual = Toolkit::VisualFactory::Get().CreateVisual(
+ { { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE } ,
+ { Toolkit::ImageVisual::Property::URL, nativeImageUrl } } );
if( mVisual )
{
DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::SetDefaultFontFamily %s\n", defaultFontFamily.c_str());
mImpl->mFontDefaults->familyDefined = !defaultFontFamily.empty();
+ if( mImpl->mEventData )
+ {
+ // Update the cursor position if it's in editing mode
+ if( EventData::IsEditingState( mImpl->mEventData->mState ) )
+ {
+ mImpl->mEventData->mDecoratorUpdated = true;
+ mImpl->mEventData->mUpdateCursorPosition = true; // Cursor position should be updated when the font family is updated.
+ }
+ }
+
// Clear the font-specific data
ClearFontData();
mImpl->mFontDefaults->mFontDescription.weight = weight;
mImpl->mFontDefaults->weightDefined = true;
+ if( mImpl->mEventData )
+ {
+ // Update the cursor position if it's in editing mode
+ if( EventData::IsEditingState( mImpl->mEventData->mState ) )
+ {
+ mImpl->mEventData->mDecoratorUpdated = true;
+ mImpl->mEventData->mUpdateCursorPosition = true; // Cursor position should be updated when the font weight is updated.
+ }
+ }
+
// Clear the font-specific data
ClearFontData();
mImpl->mFontDefaults->mFontDescription.width = width;
mImpl->mFontDefaults->widthDefined = true;
+ if( mImpl->mEventData )
+ {
+ // Update the cursor position if it's in editing mode
+ if( EventData::IsEditingState( mImpl->mEventData->mState ) )
+ {
+ mImpl->mEventData->mDecoratorUpdated = true;
+ mImpl->mEventData->mUpdateCursorPosition = true; // Cursor position should be updated when the font width is updated.
+ }
+ }
+
// Clear the font-specific data
ClearFontData();
mImpl->mFontDefaults->mFontDescription.slant = slant;
mImpl->mFontDefaults->slantDefined = true;
+ if( mImpl->mEventData )
+ {
+ // Update the cursor position if it's in editing mode
+ if( EventData::IsEditingState( mImpl->mEventData->mState ) )
+ {
+ mImpl->mEventData->mDecoratorUpdated = true;
+ mImpl->mEventData->mUpdateCursorPosition = true; // Cursor position should be updated when the font slant is updated.
+ }
+ }
+
// Clear the font-specific data
ClearFontData();
}
}
+ if( mImpl->mEventData )
+ {
+ // Update the cursor position if it's in editing mode
+ if( EventData::IsEditingState( mImpl->mEventData->mState ) )
+ {
+ mImpl->mEventData->mDecoratorUpdated = true;
+ mImpl->mEventData->mUpdateCursorPosition = true; // Cursor position should be updated when the font size is updated.
+ }
+ }
+
// Clear the font-specific data
ClearFontData();
}
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();
}
}
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 ),
}
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() ) ),
mForward( true ),
mUpdateFrameNumber( false ),
mNeedAnimationFinishedTrigger( true ),
- mAnimationDataUpdated( false )
+ mAnimationDataUpdated( false ),
+ mDestroyTask( false )
{
Initialize();
}
}
mVectorRenderer.Finalize();
+
+ mDestroyTask = true;
}
void VectorAnimationTask::SetRenderer( Renderer renderer )
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 )
bool mUpdateFrameNumber;
bool mNeedAnimationFinishedTrigger;
bool mAnimationDataUpdated;
-
+ bool mDestroyTask;
};
} // namespace Internal
//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>
}
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 )
{
}
{
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 );
{
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 );
{
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 );
}
}
+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 );
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 );
*/
void OnSetTransform() override;
+ /**
+ * @copydoc Visual::Base::OnDoAction
+ */
+ void OnDoAction( const Property::Index actionId, const Property::Value& attributes ) override;
+
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.
};
}
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 ),
}
ColorVisual::ColorVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::COLOR ),
mBlurRadius( 0.0f ),
mRenderIfTransparent( false )
{
}
GradientVisual::GradientVisual( VisualFactoryCache& factoryCache )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::GRADIENT ),
mGradientType( LINEAR ),
mIsOpaque( true )
{
#include <cstring> // for strlen()
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/common/stage.h>
-#include <dali/public-api/images/resource-image.h>
-#include <dali/public-api/images/native-image.h>
#include <dali/devel-api/images/texture-set-image.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
#include <dali/devel-api/scripting/enum-helper.h>
const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
-const char* DEFAULT_SAMPLER_TYPENAME = "sampler2D";
-
const float PIXEL_ALIGN_ON = 1.0f;
const float PIXEL_ALIGN_OFF = 0.0f;
return new ImageVisual( factoryCache, shaderFactory, imageUrl, size, fittingMode, samplingMode );
}
-ImageVisualPtr ImageVisual::New( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const Image& image )
-{
- return new ImageVisual( factoryCache, shaderFactory, image );
-}
-
ImageVisual::ImageVisual( VisualFactoryCache& factoryCache,
ImageVisualShaderFactory& shaderFactory,
const VisualUrl& imageUrl,
ImageDimensions size,
FittingMode::Type fittingMode,
Dali::SamplingMode::Type samplingMode )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
- mImage(),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::IMAGE ),
mPixelArea( FULL_TEXTURE_RECT ),
mPlacementActor(),
mImageUrl( imageUrl ),
EnablePreMultipliedAlpha( mFactoryCache.GetPreMultiplyOnLoad() );
}
-ImageVisual::ImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const Image& image )
-: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
- mImage( image ),
- mPixelArea( FULL_TEXTURE_RECT ),
- mPlacementActor(),
- mImageUrl(),
- mMaskingData( ),
- mDesiredSize(),
- mTextureId( TextureManager::INVALID_TEXTURE_ID ),
- mTextures(),
- mImageVisualShaderFactory( shaderFactory ),
- mFittingMode( FittingMode::DEFAULT ),
- mSamplingMode( SamplingMode::DEFAULT ),
- mWrapModeU( WrapMode::DEFAULT ),
- mWrapModeV( WrapMode::DEFAULT ),
- mLoadPolicy( Toolkit::ImageVisual::LoadPolicy::ATTACHED ),
- mReleasePolicy( Toolkit::ImageVisual::ReleasePolicy::DESTROYED ),
- mAtlasRect( 0.0f, 0.0f, 0.0f, 0.0f ),
- mAttemptAtlasing( false ),
- mLoading( false ),
- mOrientationCorrection( true )
-{
- // PreMultiplied alpha should be disabled when the Image is used.
- EnablePreMultipliedAlpha( false );
-}
-
ImageVisual::~ImageVisual()
{
if( Stage::IsInstalled() )
void ImageVisual::GetNaturalSize( Vector2& naturalSize )
{
- if(mImage)
- {
- naturalSize.x = mImage.GetWidth();
- naturalSize.y = mImage.GetHeight();
- return;
- }
- else if( mDesiredSize.GetWidth()>0 && mDesiredSize.GetHeight()>0)
+ if( mDesiredSize.GetWidth()>0 && mDesiredSize.GetHeight()>0)
{
naturalSize.x = mDesiredSize.GetWidth();
naturalSize.y = mDesiredSize.GetHeight();
EnablePreMultipliedAlpha( IsPreMultipliedAlphaEnabled() );
}
-void ImageVisual::CreateNativeImageRenderer( NativeImage& nativeImage )
-{
- Geometry geometry;
- Shader shader;
-
- std::string fragmentShader;
- const char* fragmentPreFix = nativeImage.GetCustomFragmentPreFix();
- const char* customSamplerTypename = nativeImage.GetCustomSamplerTypename();
-
- if( fragmentPreFix )
- {
- fragmentShader = fragmentPreFix;
- fragmentShader += "\n";
- }
-
- if( mImpl->mCustomShader && !mImpl->mCustomShader->mFragmentShader.empty() )
- {
- fragmentShader += mImpl->mCustomShader->mFragmentShader;
- }
- else
- {
- fragmentShader += mImageVisualShaderFactory.GetFragmentShaderSource();
- }
-
- if( customSamplerTypename )
- {
- fragmentShader.replace( fragmentShader.find( DEFAULT_SAMPLER_TYPENAME ), strlen( DEFAULT_SAMPLER_TYPENAME ), customSamplerTypename );
- }
-
- if( !mImpl->mCustomShader )
- {
- geometry = CreateGeometry( mFactoryCache, ImageDimensions( 1, 1 ) );
-
- shader = Shader::New( mImageVisualShaderFactory.GetVertexShaderSource(), fragmentShader );
- shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
- }
- else
- {
- geometry = CreateGeometry( mFactoryCache, mImpl->mCustomShader->mGridSize );
- shader = Shader::New( mImpl->mCustomShader->mVertexShader.empty() ? mImageVisualShaderFactory.GetVertexShaderSource() : mImpl->mCustomShader->mVertexShader,
- fragmentShader,
- mImpl->mCustomShader->mHints );
- if( mImpl->mCustomShader->mVertexShader.empty() )
- {
- shader.RegisterProperty( PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT );
- }
- }
-
- mImpl->mRenderer = Renderer::New( geometry, shader );
-
- //Register transform properties
- mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
-}
-
void ImageVisual::LoadTexture( bool& atlasing, Vector4& atlasRect, TextureSet& textures, bool orientationCorrection,
TextureManager::ReloadPolicy forceReload )
{
}
}
-void ImageVisual::InitializeRenderer( const Image& image )
-{
- TextureSet textures = TextureSet::New();
-
- NativeImage nativeImage = NativeImage::DownCast( image );
- if( nativeImage )
- {
- CreateNativeImageRenderer( nativeImage );
- DALI_ASSERT_DEBUG( textures );
- mImpl->mRenderer.SetTextures( textures );
- }
- else
- {
- // reuse existing code for regular images
- CreateRenderer( textures ); // Textures will be retreived from Image
- }
- ApplyImageToSampler( image );
-}
-
void ImageVisual::DoSetOnStage( Actor& actor )
{
if( mImageUrl.IsValid() )
{
InitializeRenderer();
}
- else if( mImage )
- {
- InitializeRenderer( mImage );
- }
if( !mImpl->mRenderer )
{
mImpl->mResourceStatus = Toolkit::Visual::ResourceStatus::PREPARING;
}
- if( mImageUrl.IsValid() )
- {
- // Legacy support for deprecated Dali::Image
- mImage.Reset();
- }
mLoading = false;
mImpl->mRenderer.Reset();
mPlacementActor.Reset();
map.Insert( Toolkit::ImageVisual::Property::DESIRED_WIDTH, mDesiredSize.GetWidth() );
map.Insert( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, mDesiredSize.GetHeight() );
}
- else if( mImage )
- {
- map.Insert( Toolkit::ImageVisual::Property::DESIRED_WIDTH, static_cast<int>(mImage.GetWidth()) );
- map.Insert( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, static_cast<int>(mImage.GetHeight()) );
-
- ResourceImage resourceImage = ResourceImage::DownCast(mImage);
- if( resourceImage )
- {
- map.Insert( Toolkit::ImageVisual::Property::URL, resourceImage.GetUrl() );
- }
- }
map.Insert( Toolkit::ImageVisual::Property::FITTING_MODE, mFittingMode );
map.Insert( Toolkit::ImageVisual::Property::SAMPLING_MODE, mSamplingMode );
map.Insert( Toolkit::ImageVisual::Property::DESIRED_WIDTH, mDesiredSize.GetWidth() );
map.Insert( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, mDesiredSize.GetHeight() );
}
- else if( mImage )
- {
- map.Insert( Toolkit::ImageVisual::Property::DESIRED_WIDTH, static_cast<int>(mImage.GetWidth()) );
- map.Insert( Toolkit::ImageVisual::Property::DESIRED_HEIGHT, static_cast<int>(mImage.GetHeight()) );
- }
}
void ImageVisual::OnDoAction( const Dali::Property::Index actionName, const Dali::Property::Value& attributes )
mImpl->mResourceStatus == Toolkit::Visual::ResourceStatus::FAILED );
}
-void ImageVisual::ApplyImageToSampler( const Image& image )
-{
- if( image )
- {
- TextureSet textureSet = mImpl->mRenderer.GetTextures();
- DALI_ASSERT_DEBUG( textureSet ); // texture set should always exist by this time
-
- TextureSetImage( textureSet, 0u, image );
- Sampler sampler = Sampler::New();
- sampler.SetWrapMode( mWrapModeU, mWrapModeV );
- textureSet.SetSampler( 0u, sampler );
- }
-}
-
// From existing atlas manager
void ImageVisual::UploadCompleted()
{
textureSet = TextureSet::New();
mImpl->mRenderer.SetTextures( textureSet );
-
- ApplyImageToSampler( brokenImage );
+ TextureSetImage( textureSet, 0u, brokenImage );
+ Sampler sampler = Sampler::New();
+ sampler.SetWrapMode( mWrapModeU, mWrapModeV );
+ textureSet.SetSampler( 0u, sampler );
}
}
FittingMode::Type fittingMode = FittingMode::DEFAULT,
Dali::SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR );
- /**
- * @brief Create a new image visual with an Image type.
- *
- * @param[in] factoryCache The VisualFactoryCache object
- * @param[in] shaderFactory The ImageVisualShaderFactory object
- * @param[in] image The image to use
- */
- static ImageVisualPtr New( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const Image& image );
-
public: // from Visual
/**
Dali::SamplingMode::Type samplingMode );
/**
- * @brief Constructor with an Image type.
- *
- * @param[in] factoryCache The VisualFactoryCache object
- * @param[in] shaderFactory The ImageVisualShaderFactory object
- * @param[in] image The image to use
- */
- ImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const Image& image );
-
- /**
* @brief A reference counted object may only be deleted by calling Unreference().
*/
virtual ~ImageVisual();
void AllocateMaskData();
/**
- * @brief Applies the image to the texture set used for this renderer
- *
- * @param[in] image The Image to apply to the texture set used for this renderer
- */
- void ApplyImageToSampler( const Image& image );
-
- /**
* @brief Load the texture, will try to atlas unless unable or param set to false.
* @param[in, out] atlasing flag if the image has been put in a atlas (true), passing false will not atlas even if possible.
* @param[out] atlasRect if atlasing is used this the texture area of the image in the atlas.
void InitializeRenderer();
/**
- * @brief Initializes the Dali::Renderer from an image handle
- *
- * @param[in] image The image handle to intialize this ImageVisual from
- */
- void InitializeRenderer( const Image& image );
-
- /**
* @brief Creates the Dali::Renderer (potentially from the renderer cache), initializing it
* @param[in] textures to use
*/
void CreateRenderer( TextureSet& textures );
/**
- * @brief Creates the Dali::Renderer for NativeImage with custom sampler type and prefix, initializing it
- * @param NativeImageRenderer
- */
- void CreateNativeImageRenderer( NativeImage& nativeImage );
-
- /**
* Creates the texture set and adds the texture to it
* @param[out] textureRect The texture area of the texture in the atlas.
* @param[in] url The URL of the image resource to use.
private:
- Image mImage;
Vector4 mPixelArea;
WeakHandle<Actor> mPlacementActor;
VisualUrl mImageUrl;
}
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 ),
}
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(),
}
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 ),
}
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 ),
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 ),
} // 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 ),
mCornerRadiusIndex( Property::INVALID_INDEX ),
mFittingMode( fittingMode ),
mFlags( 0 ),
- mResourceStatus( Toolkit::Visual::ResourceStatus::PREPARING )
+ mResourceStatus( Toolkit::Visual::ResourceStatus::PREPARING ),
+ mType( type )
{
}
/**
* 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
FittingMode mFittingMode; //< How the contents should fit the view
int mFlags;
Toolkit::Visual::ResourceStatus mResourceStatus;
+ const Toolkit::Visual::Type mType;
};
} // namespace Visual
} // 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 )
{
}
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;
*/
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().
return Toolkit::Visual::Base( visualPtr.Get() );
}
-Toolkit::Visual::Base VisualFactory::CreateVisual( const Image& image )
-{
- Visual::BasePtr visualPtr;
-
- if( image )
- {
- visualPtr = ImageVisual::New(GetFactoryCache(), GetImageVisualShaderFactory(), image );
- }
-
- if( mDebugEnabled )
- {
- //Create a WireframeVisual if we have debug enabled
- visualPtr = WireframeVisual::New( GetFactoryCache(), visualPtr );
- }
-
- return Toolkit::Visual::Base( visualPtr.Get() );
-}
-
Toolkit::Visual::Base VisualFactory::CreateVisual( const std::string& url, ImageDimensions size )
{
Visual::BasePtr visualPtr;
#define DALI_TOOLKIT_VISUAL_FACTORY_IMPL_H
/*
- * Copyright (c) 2017 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.
Toolkit::Visual::Base CreateVisual( const Property::Map& propertyMap );
/**
- * @copydoc Toolkit::VisualFactory::CreateVisual( const Image& )
- */
- Toolkit::Visual::Base CreateVisual( const Image& image );
-
- /**
* @copydoc Toolkit::VisualFactory::CreateVisual( const std::string&, ImageDimensions )
*/
Toolkit::Visual::Base CreateVisual( const std::string& image, ImageDimensions size );
}
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 )
{
}
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
*/
"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"],
"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"],
"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,
"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"],
"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,