Merge "Add the logical key to Integration::KeyEvent" into devel/master
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 14 Jan 2019 05:13:41 +0000 (05:13 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 14 Jan 2019 05:13:41 +0000 (05:13 +0000)
54 files changed:
automated-tests/src/dali-toolkit-third-party/utc-Dali-Flexbox-Layout.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h
automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-LayoutingAnimation.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
build/tizen/docs/dali.doxy.in
dali-toolkit/devel-api/controls/control-devel.cpp
dali-toolkit/devel-api/controls/control-devel.h
dali-toolkit/devel-api/controls/text-controls/text-field-devel.h
dali-toolkit/devel-api/controls/text-controls/text-label-devel.h
dali-toolkit/devel-api/file.list
dali-toolkit/devel-api/layouting/layout-group-impl.cpp
dali-toolkit/devel-api/layouting/layout-item-impl.cpp
dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h
dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h [new file with mode: 0644]
dali-toolkit/devel-api/visuals/image-visual-properties-devel.h
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/layouting/layout-controller-impl.cpp
dali-toolkit/internal/layouting/layout-controller-impl.h
dali-toolkit/internal/layouting/layout-item-data-impl.cpp
dali-toolkit/internal/layouting/layout-item-data-impl.h
dali-toolkit/internal/layouting/layout-transition-data-impl.cpp
dali-toolkit/internal/layouting/layout-transition-data-impl.h
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp [changed mode: 0644->0755]
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp
dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h
dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.cpp
dali-toolkit/internal/visuals/animated-vector-image/vector-rasterize-thread.h
dali-toolkit/internal/visuals/svg/svg-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-event-observer.h [new file with mode: 0644]
dali-toolkit/internal/visuals/visual-resource-observer.h [deleted file]
dali-toolkit/public-api/controls/text-controls/text-field.h
dali-toolkit/public-api/controls/text-controls/text-label.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/visuals/visual-properties.h
dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json
node-addon/javascript-application-options.cpp
packaging/dali-toolkit.spec
plugins/dali-script-v8/src/constants/constants-wrapper.cpp

index 832d73e..465e7f3 100644 (file)
@@ -15,6 +15,8 @@
  *
  */
 
+#include <cstdlib>
+
 #include <dali-toolkit-test-suite-utils.h>
 // GTest fails to compile with "error: return-statement with a value, in function returning 'void'" error
 // if using dali assert function so define new assert with returning void.
@@ -26,7 +28,7 @@
         fprintf(stderr, \
             "Following expression is not true:\n" \
                 "%s\n", #exp); \
-        return; \
+        std::abort(); \
     }
 #include <gtest/gtest.h>
 #undef GTEST_HAS_DEATH_TEST
 
 int UtcDaliFlexboxLayoutTest(void)
 {
-  ToolkitTestApplication application;
   tet_infoline("UtcDaliFlexboxLayoutTest");
-  int argc = 0;
-  testing::InitGoogleTest( &argc, static_cast<char**>(nullptr) );
+  int argc = 1;
+  const char* argv = "yoga-gtest";
+  testing::InitGoogleTest( &argc,  const_cast< char** >( &argv ) );
 
   // The test function is a 3rd party function that should return true if the test passes
   if( !RUN_ALL_TESTS() )
index 96699ec..b8ddd29 100644 (file)
@@ -188,7 +188,17 @@ void DummyControlImpl::SetProperty( BaseObject* object, Dali::Property::Index in
 
 Property::Value DummyControlImpl::GetProperty( BaseObject* object, Dali::Property::Index propertyIndex )
 {
-  Dali::Property::Value value;
+  Toolkit::DummyControl control = Toolkit::DummyControl::DownCast( Dali::BaseHandle( object ) );
+  DummyControlImpl& dummyImpl = static_cast<DummyControlImpl&>( control.GetImplementation() );
+
+  Visual::Base visual = dummyImpl.GetVisual( propertyIndex );
+  Property::Map map;
+  if( visual )
+  {
+    visual.CreatePropertyMap( map );
+  }
+  Dali::Property::Value value = map;
+
   return value;
 }
 
@@ -201,6 +211,8 @@ Toolkit::DummyControl Impl::DummyControl::New()
   return control;
 }
 
+int Impl::DummyControl::constructorCount;
+int Impl::DummyControl::destructorCount;
 
 Impl::DummyControl::DummyControl()
 : DummyControlImpl(),
@@ -227,10 +239,13 @@ Impl::DummyControl::DummyControl()
   keyInputFocusGained(false),
   keyInputFocusLost(false)
 {
+  ++constructorCount;
 }
 
-Impl::DummyControl::~DummyControl() { }
-
+Impl::DummyControl::~DummyControl()
+{
+  ++destructorCount;
+}
 
 void Impl::DummyControl::OnInitialize() { initializeCalled = true; }
 bool Impl::DummyControl::OnAccessibilityActivated() { activatedCalled = true; return true; }
index 5988284..d991a82 100644 (file)
@@ -207,6 +207,8 @@ public:
   bool keyEventCalled;
   bool keyInputFocusGained;
   bool keyInputFocusLost;
+  static int constructorCount;
+  static int destructorCount;
 
   Property::Map mLayouts;
   RelayoutCallbackFunc mRelayoutCallback;
index c0fee41..4c80bf2 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 #include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
 #include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-actions-devel.h>
+#include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h>
 #include "dummy-control.h"
 
 using namespace Dali;
@@ -45,6 +46,16 @@ namespace
 
 const char* TEST_VECTOR_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR  "/insta_camera.json";
 
+bool gAnimationFinishedSignalFired = false;
+
+void VisualEventSignal( Control control, Dali::Property::Index visualIndex, Dali::Property::Index signalId )
+{
+  if( visualIndex == DummyControl::Property::TEST_VISUAL && signalId == DevelAnimatedVectorImageVisual::Signal::ANIMATION_FINISHED )
+  {
+    gAnimationFinishedSignalFired = true;
+  }
+}
+
 }
 
 int UtcDaliVisualFactoryGetAnimatedVectorImageVisual01(void)
@@ -273,7 +284,9 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void)
 
     DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
 
-    // test
+    Property::Map map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+    Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_STATE );
+    DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::PLAYING ) );
 
     tet_infoline( "Test Pause action" );
     DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PAUSE, attributes );
@@ -281,15 +294,19 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void)
     application.SendNotification();
     application.Render(16);
 
-    // test
+    map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+    value = map.Find( DevelImageVisual::Property::PLAY_STATE );
+    DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::PAUSED ) );
 
-    tet_infoline( "Test Resume action" );
-    DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::RESUME, attributes );
+    tet_infoline( "Test Play action" );
+    DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
 
     application.SendNotification();
     application.Render(16);
 
-    // test
+    map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+    value = map.Find( DevelImageVisual::Property::PLAY_STATE );
+    DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::PLAYING ) );
 
     tet_infoline( "Test Stop action" );
     DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes );
@@ -297,7 +314,9 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void)
     application.SendNotification();
     application.Render(16);
 
-    // test
+    map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+    value = map.Find( DevelImageVisual::Property::PLAY_STATE );
+    DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::STOPPED ) );
 
     tet_infoline( "Test Stop action again" );
     DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::STOP, attributes );
@@ -305,7 +324,9 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void)
     application.SendNotification();
     application.Render(16);
 
-    // test
+    map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+    value = map.Find( DevelImageVisual::Property::PLAY_STATE );
+    DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::STOPPED ) );
 
     tet_infoline( "Test Play action" );
     DevelControl::DoAction( dummyControl, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
@@ -313,15 +334,20 @@ int UtcDaliAnimatedVectorImageVisualPlayback(void)
     application.SendNotification();
     application.Render(16);
 
-    // test
+    map = dummyControl.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+    value = map.Find( DevelImageVisual::Property::PLAY_STATE );
+    DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::PLAYING ) );
 
-    dummyControl.SetSize( 100.0f, 100.0f );
+    // Change Size
+    Vector3 newSize( 100.0f, 100.0f, 0.0f );
+    dummyControl.SetSize( newSize );
 
     application.SendNotification();
     application.Render(16);
 
-    // test
     // Size should be changed
+    Vector3 naturalSize = dummyControl.GetNaturalSize();
+    DALI_TEST_CHECK( naturalSize == newSize );
 
     dummyControl.Unparent();
   }
@@ -439,7 +465,8 @@ int UtcDaliAnimatedVectorImageVisualLoopCount(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+  // Trigger count is 2 - resource ready and animation finished
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
 
   // renderer is added to actor
   DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
@@ -488,3 +515,45 @@ int UtcDaliAnimatedVectorImageVisualPlayRange(void)
 
   END_TEST;
 }
+
+int UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliAnimatedVectorImageVisualAnimationFinishedSignal" );
+
+  Property::Map propertyMap;
+  propertyMap.Add( Toolkit::Visual::Property::TYPE, DevelVisual::ANIMATED_VECTOR_IMAGE )
+             .Add( ImageVisual::Property::URL, TEST_VECTOR_IMAGE_FILE_NAME  )
+             .Add( DevelImageVisual::Property::LOOP_COUNT, 3  );
+
+  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 );
+
+  DevelControl::VisualEventSignal( actor ).Connect( &VisualEventSignal );
+
+  Vector2 controlSize( 20.f, 30.f );
+  actor.SetSize( controlSize );
+
+  Stage::GetCurrent().Add( actor );
+
+  Property::Map attributes;
+  DevelControl::DoAction( actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes );
+
+  application.SendNotification();
+  application.Render();
+
+  // Wait for animation finish
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 2 ), true, TEST_LOCATION );
+
+  Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
+  Property::Value* value = map.Find( DevelImageVisual::Property::PLAY_STATE );
+  DALI_TEST_CHECK( value->Get< int >() == static_cast< int >( DevelImageVisual::PlayState::STOPPED ) );
+
+  DALI_TEST_EQUALS( gAnimationFinishedSignalFired, true, TEST_LOCATION );
+
+  END_TEST;
+}
index 98ff461..29370b7 100644 (file)
@@ -836,7 +836,8 @@ int UtcDaliImageViewSetImageOnstageN(void)
   DALI_TEST_CHECK( !value.Get( url ) );
 
   Property::Map map;
-  DALI_TEST_CHECK( !value.Get( map ) );
+  value.Get( map );
+  DALI_TEST_CHECK( map.Empty() );
 
   END_TEST;
 }
@@ -931,7 +932,8 @@ int UtcDaliImageViewSetImageOffstageN(void)
   DALI_TEST_CHECK( !value.Get( url ) );
 
   Property::Map map;
-  DALI_TEST_CHECK( !value.Get( map ) );
+  value.Get( map );
+  DALI_TEST_CHECK( map.Empty() );
 
   END_TEST;
 }
@@ -951,7 +953,8 @@ int UtcDaliImageViewSetImageN(void)
   DALI_TEST_CHECK( !value.Get( url ) );
 
   Property::Map map;
-  DALI_TEST_CHECK( !value.Get( map ) );
+  value.Get( map );
+  DALI_TEST_CHECK( map.Empty() );
 
   std::string resource_url;
   Property::Value val = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
@@ -980,7 +983,8 @@ int UtcDaliImageViewSetImageTypeChangesP(void)
   application.Render( 16 );
 
   DALI_TEST_CHECK( ! value.Get( url ) ); // Value should be empty
-  DALI_TEST_CHECK( ! value.Get( map ) ); // 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 a URL
@@ -1006,7 +1010,8 @@ int UtcDaliImageViewSetImageTypeChangesP(void)
   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 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
@@ -1033,7 +1038,8 @@ int UtcDaliImageViewSetImageTypeChangesP(void)
   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 be empty
+  value.Get( map );
+  DALI_TEST_CHECK( map.Empty() );        // Value should be empty
   DALI_TEST_CHECK( ! visual );           // Visual should be invalid
 
   // Set a URL in property map
index 2bf827a..9750070 100644 (file)
@@ -30,6 +30,7 @@
 #include <dali-toolkit/devel-api/layouting/layout-group-impl.h>
 
 #include <../custom-layout.h>
+#include <dummy-control.h>
 
 #include <layout-utils.h>
 
@@ -1797,3 +1798,72 @@ int UtcDaliLayouting_DefaultTransition01(void)
   END_TEST;
 }
 
+int UtcDaliLayouting_CheckResourceLeak01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliLayouting_CheckResourceLeak01 - Remove animating layout and add child to stage" );
+
+  Dali::Toolkit::Impl::DummyControl::constructorCount = 0;
+  Dali::Toolkit::Impl::DummyControl::destructorCount = 0;
+
+  Stage stage = Stage::GetCurrent();
+  auto container = Control::New();
+  auto linearLayout = LinearLayout::New();
+  linearLayout.SetAnimateLayout( true );
+
+  DevelControl::SetLayout( container, linearLayout );
+  container.SetName( "Container" );
+
+  stage.Add( container );
+
+  DummyControl control = DummyControl::New( true );
+  control.SetName( "DummyControl01" );
+  control.SetSize( 100, 100 );
+  container.Add( control );
+
+  control = DummyControl::New( true );
+  control.SetName( "DummyControl02" );
+  control.SetSize( 100, 100 );
+  container.Add( control );
+
+  linearLayout.SetAnimateLayout( true );
+
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 0, TEST_LOCATION );
+
+  // Initial rendering done
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
+
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 0, TEST_LOCATION );
+
+  stage.Remove( container );
+  container.Reset();
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
+
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 1, TEST_LOCATION );
+
+  Stage::GetCurrent().Add( control );
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
+
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 1, TEST_LOCATION );
+
+  stage.Remove( control );
+  control.Reset();
+
+  application.SendNotification();
+  application.Render(static_cast<unsigned int>( 0.5f * 1000.0f ) + 1u /*just after the end of the animation*/ );
+
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::constructorCount, 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( Dali::Toolkit::Impl::DummyControl::destructorCount, 2, TEST_LOCATION );
+
+  END_TEST;
+}
+
index a7ae439..8c1eecd 100755 (executable)
@@ -60,8 +60,6 @@ const char* const PROPERTY_NAME_HORIZONTAL_ALIGNMENT                 = "horizont
 const char* const PROPERTY_NAME_VERTICAL_ALIGNMENT                   = "verticalAlignment";
 const char* const PROPERTY_NAME_TEXT_COLOR                           = "textColor";
 const char* const PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR               = "placeholderTextColor";
-const char* const PROPERTY_NAME_SHADOW_OFFSET                        = "shadowOffset";
-const char* const PROPERTY_NAME_SHADOW_COLOR                         = "shadowColor";
 const char* const PROPERTY_NAME_PRIMARY_CURSOR_COLOR                 = "primaryCursorColor";
 const char* const PROPERTY_NAME_SECONDARY_CURSOR_COLOR               = "secondaryCursorColor";
 const char* const PROPERTY_NAME_ENABLE_CURSOR_BLINK                  = "enableCursorBlink";
@@ -510,8 +508,6 @@ int UtcDaliTextFieldGetPropertyP(void)
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_VERTICAL_ALIGNMENT ) == TextField::Property::VERTICAL_ALIGNMENT );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_TEXT_COLOR ) == TextField::Property::TEXT_COLOR );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR ) == TextField::Property::PLACEHOLDER_TEXT_COLOR );
-  DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_SHADOW_OFFSET ) == TextField::Property::SHADOW_OFFSET );
-  DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_SHADOW_COLOR ) == TextField::Property::SHADOW_COLOR );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_PRIMARY_CURSOR_COLOR ) == TextField::Property::PRIMARY_CURSOR_COLOR );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_SECONDARY_CURSOR_COLOR ) == TextField::Property::SECONDARY_CURSOR_COLOR );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_ENABLE_CURSOR_BLINK ) == TextField::Property::ENABLE_CURSOR_BLINK );
@@ -679,12 +675,6 @@ int UtcDaliTextFieldSetPropertyP(void)
   field.SetProperty( TextField::Property::PLACEHOLDER_TEXT_COLOR, Color::RED );
   DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::PLACEHOLDER_TEXT_COLOR ), Color::RED, TEST_LOCATION );
 
-  // Check shadow properties.
-  field.SetProperty( TextField::Property::SHADOW_OFFSET, Vector2( 1.f, 1.f ) );
-  DALI_TEST_EQUALS( field.GetProperty<Vector2>( TextField::Property::SHADOW_OFFSET ), Vector2( 1.f, 1.f ), TEST_LOCATION );
-  field.SetProperty( TextField::Property::SHADOW_COLOR, Color::GREEN );
-  DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::SHADOW_COLOR ), Color::GREEN, TEST_LOCATION );
-
   // Check cursor properties
   field.SetProperty( TextField::Property::PRIMARY_CURSOR_COLOR, Color::RED );
   DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::PRIMARY_CURSOR_COLOR ), Color::RED, TEST_LOCATION );
index b1ae269..1087e13 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -49,11 +49,6 @@ const char* const PROPERTY_NAME_MULTI_LINE =  "multiLine";
 const char* const PROPERTY_NAME_HORIZONTAL_ALIGNMENT = "horizontalAlignment";
 const char* const PROPERTY_NAME_VERTICAL_ALIGNMENT = "verticalAlignment";
 const char* const PROPERTY_NAME_TEXT_COLOR = "textColor";
-const char* const PROPERTY_NAME_SHADOW_OFFSET = "shadowOffset";
-const char* const PROPERTY_NAME_SHADOW_COLOR = "shadowColor";
-const char* const PROPERTY_NAME_UNDERLINE_ENABLED = "underlineEnabled";
-const char* const PROPERTY_NAME_UNDERLINE_COLOR = "underlineColor";
-const char* const PROPERTY_NAME_UNDERLINE_HEIGHT = "underlineHeight";
 const char* const PROPERTY_NAME_ENABLE_MARKUP = "enableMarkup";
 const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL = "enableAutoScroll";
 const char* const PROPERTY_NAME_ENABLE_AUTO_SCROLL_SPEED = "autoScrollSpeed";
@@ -241,11 +236,6 @@ int UtcDaliToolkitTextLabelGetPropertyP(void)
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_HORIZONTAL_ALIGNMENT ) == TextLabel::Property::HORIZONTAL_ALIGNMENT );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_VERTICAL_ALIGNMENT ) == TextLabel::Property::VERTICAL_ALIGNMENT );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_TEXT_COLOR ) == TextLabel::Property::TEXT_COLOR );
-  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_SHADOW_OFFSET ) == TextLabel::Property::SHADOW_OFFSET );
-  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_SHADOW_COLOR ) == TextLabel::Property::SHADOW_COLOR );
-  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE_ENABLED ) == TextLabel::Property::UNDERLINE_ENABLED );
-  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE_COLOR ) == TextLabel::Property::UNDERLINE_COLOR );
-  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE_HEIGHT) == TextLabel::Property::UNDERLINE_HEIGHT );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_MARKUP) == TextLabel::Property::ENABLE_MARKUP );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL ) == TextLabel::Property::ENABLE_AUTO_SCROLL );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ENABLE_AUTO_SCROLL_SPEED ) == TextLabel::Property::AUTO_SCROLL_SPEED );
@@ -359,8 +349,6 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   // Check that text color can be properly set
   label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
   DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ), Color::BLUE, TEST_LOCATION );
-  // The underline color is changed as well.
-  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::UNDERLINE_COLOR ), Color::BLUE, TEST_LOCATION );
 
   Property::Map underlineMapSet;
   Property::Map underlineMapGet;
@@ -373,20 +361,6 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
   DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet ), true, TEST_LOCATION );
 
-  // Check that shadow parameters can be correctly set
-  label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 3.0f, 3.0f ) );
-  DALI_TEST_EQUALS( label.GetProperty<Vector2>( TextLabel::Property::SHADOW_OFFSET ), Vector2( 3.0f, 3.0f ), TEST_LOCATION );
-  label.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLUE );
-  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::SHADOW_COLOR ), Color::BLUE, TEST_LOCATION );
-
-  // Check that underline parameters can be correctly set
-  label.SetProperty( TextLabel::Property::UNDERLINE_ENABLED, true );
-  DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::UNDERLINE_ENABLED ), true, TEST_LOCATION );
-  label.SetProperty( TextLabel::Property::UNDERLINE_COLOR, Color::RED );
-  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::UNDERLINE_COLOR ), Color::RED, TEST_LOCATION );
-  label.SetProperty( TextLabel::Property::UNDERLINE_HEIGHT, 1.0f );
-  DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::UNDERLINE_HEIGHT ), 1.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-
   TextLabel label2 = TextLabel::New( "New text" );
   DALI_TEST_CHECK( label2 );
   DALI_TEST_EQUALS( label2.GetProperty<std::string>( TextLabel::Property::TEXT ), std::string("New text"), TEST_LOCATION );
@@ -434,25 +408,36 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   // test natural size with multi-line and line spacing
   {
     TextLabel label3 = TextLabel::New("Some text here\nend there\nend here");
-    Vector3 expected0(414.f, 192.f, 0.0f);
-    Vector3 expected1(414.f, 252.f, 0.0f);
+    Vector3 oneLineNaturalSize = label3.GetNaturalSize();
     label3.SetProperty(TextLabel::Property::MULTI_LINE, true);
     label3.SetProperty(TextLabel::Property::LINE_SPACING, 0);
-    DALI_TEST_EQUALS(expected0, label3.GetNaturalSize(), TEST_LOCATION);
-    label3.SetProperty(TextLabel::Property::LINE_SPACING, 20);
-    DALI_TEST_EQUALS(expected1, label3.GetNaturalSize(), TEST_LOCATION);
+    Vector3 multiLineNaturalSize = label3.GetNaturalSize();
+
+    // The width of the text when multi-line is enabled will be smaller (lines separated on '\n')
+    // The height of the text when multi-line is enabled will be larger
+    DALI_TEST_CHECK( oneLineNaturalSize.width > multiLineNaturalSize.width );
+    DALI_TEST_CHECK( oneLineNaturalSize.height < multiLineNaturalSize.height );
+
+    // Change line spacing, meaning height will increase by 3 times the amount specified as we have three lines
+    // Everything else will remain the same
+    int lineSpacing = 20;
+    label3.SetProperty( TextLabel::Property::LINE_SPACING, lineSpacing );
+    Vector3 expectedAfterLineSpacingApplied( multiLineNaturalSize );
+    expectedAfterLineSpacingApplied.height += 3 * lineSpacing;
+    DALI_TEST_EQUALS( expectedAfterLineSpacingApplied, label3.GetNaturalSize(), TEST_LOCATION );
   }
 
-  // single line, line spacing must not affect natural size
+  // single line, line spacing must not affect natural size of the text, only add the spacing to the height
   {
-    const Vector3 expected0(948.f, 64.f, 0.0f);
-    const Vector3 expected1(948.f, 84.f, 0.0f);
     TextLabel label3 = TextLabel::New("Some text here end there end here");
     label3.SetProperty(TextLabel::Property::MULTI_LINE, false);
     label3.SetProperty(TextLabel::Property::LINE_SPACING, 0);
-    DALI_TEST_EQUALS(expected0, label3.GetNaturalSize(), TEST_LOCATION);
-    label3.SetProperty(TextLabel::Property::LINE_SPACING, 20);
-    DALI_TEST_EQUALS(expected1, label3.GetNaturalSize(), TEST_LOCATION);
+    Vector3 textNaturalSize = label3.GetNaturalSize();
+    int lineSpacing = 20;
+    label3.SetProperty( TextLabel::Property::LINE_SPACING, lineSpacing );
+    Vector3 expectedNaturalSizeWithLineSpacing( textNaturalSize );
+    expectedNaturalSizeWithLineSpacing.height += lineSpacing;
+    DALI_TEST_EQUALS( expectedNaturalSizeWithLineSpacing, label3.GetNaturalSize(), TEST_LOCATION );
   }
   // Check the line spacing property
   DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::LINE_SPACING ), 0.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
@@ -582,10 +567,16 @@ int UtcDaliToolkitTextlabelAtlasRenderP(void)
   // Turn on all the effects
   label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
   label.SetProperty( TextLabel::Property::MULTI_LINE, true );
-  label.SetProperty( TextLabel::Property::UNDERLINE_ENABLED, true );
-  label.SetProperty( TextLabel::Property::UNDERLINE_COLOR, Color::RED );
-  label.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 1.0f, 1.0f ) );
-  label.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLUE );
+
+  Property::Map underlineMap;
+  underlineMap.Insert( "enable", "true" );
+  underlineMap.Insert( "color", "red" );
+  label.SetProperty( TextLabel::Property::UNDERLINE, underlineMap );
+
+  Property::Map shadowMap;
+  shadowMap.Insert( "color", Color::BLUE );
+  shadowMap.Insert( "offset", Vector2( 1.0f, 1.0f ) );
+  label.SetProperty( TextLabel::Property::SHADOW, shadowMap );
 
   try
   {
index a88c763..301685b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -276,7 +276,7 @@ int UtcDaliVisualSetGetDepthIndex(void)
 int UtcDaliVisualSize(void)
 {
   ToolkitTestApplication application;
-  tet_infoline( "UtcDaliVisualGetNaturalSize" );
+  tet_infoline( "UtcDaliVisualSize" );
 
   VisualFactory factory = VisualFactory::Get();
   Vector2 controlSize( 20.f, 30.f );
@@ -373,15 +373,15 @@ int UtcDaliVisualSize(void)
   propertyMap.Clear();
   propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::TEXT );
   propertyMap.Insert( TextVisual::Property::ENABLE_MARKUP, true );
-  propertyMap.Insert( TextVisual::Property::TEXT, "<font family='TizenSans' size='12'>Hello world</font>" );
+  propertyMap.Insert( TextVisual::Property::TEXT, "<font family='TizenSansRegular' size='12'>Hello world</font>" );
   propertyMap.Insert( TextVisual::Property::MULTI_LINE, true );
 
   Visual::Base textVisual = factory.CreateVisual( propertyMap );
   textVisual.GetNaturalSize( naturalSize );
-  DALI_TEST_EQUALS( naturalSize, Size( 80.f, 20.f ), TEST_LOCATION );
+  DALI_TEST_EQUALS( naturalSize, Size( 86.f, 20.f ), TEST_LOCATION );
 
   const float height = textVisual.GetHeightForWidth( 40.f );
-  DALI_TEST_EQUALS( height, 40.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( height, 57.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   //AnimatedImageVisual
   Visual::Base animatedImageVisual = factory.CreateVisual( TEST_GIF_FILE_NAME, ImageDimensions() );
index 98106dc..4fcf095 100755 (executable)
@@ -346,6 +346,7 @@ ALIASES += SINCE_1_0="@since 1.0"
 ALIASES += SINCE_1_1="@since 1.1"
 ALIASES += SINCE_1_2="@since 1.2"
 ALIASES += SINCE_1_3="@since 1.3"
+ALIASES += SINCE_1_4="@since 1.4"
 
 # Extra tags for Tizen 3.0
 ALIASES += SINCE_1_2_2="@since 1.2.2"
@@ -367,6 +368,7 @@ ALIASES += DEPRECATED_1_2_8="@deprecated Deprecated since 1.2.8"
 ALIASES += DEPRECATED_1_2_10="@deprecated Deprecated since 1.2.10"
 ALIASES += DEPRECATED_1_2="@deprecated Deprecated since 1.2"
 ALIASES += DEPRECATED_1_3="@deprecated Deprecated since 1.3"
+ALIASES += DEPRECATED_1_4="@deprecated Deprecated since 1.4"
 
 ALIASES += PLATFORM=""
 ALIASES += PRIVLEVEL_PLATFORM=""
@@ -384,6 +386,7 @@ ALIASES += REMARK_RAWVIDEO=""
 #ALIASES += SINCE_1_1="\par Since:\n 3.0, DALi version 1.1"
 #ALIASES += SINCE_1_2="\par Since:\n 4.0, DALi version 1.2"
 #ALIASES += SINCE_1_3="\par Since:\n 5.0, DALi version 1.3"
+#ALIASES += SINCE_1_4="\par Since:\n 6.0, DALi version 1.4"
 
 ## Extra tags for Tizen 3.0
 #ALIASES += SINCE_1_2_2="\par Since:\n 3.0, DALi version 1.2.2"
@@ -407,6 +410,7 @@ ALIASES += REMARK_RAWVIDEO=""
 #ALIASES += DEPRECATED_1_2_10="@deprecated Deprecated since 3.0, DALi version 1.2.10"
 #ALIASES += DEPRECATED_1_2="@deprecated Deprecated since 4.0, DALi version 1.2"
 #ALIASES += DEPRECATED_1_3="@deprecated Deprecated since 5.0, DALi version 1.3"
+#ALIASES += DEPRECATED_1_4="@deprecated Deprecated since 6.0, DALi version 1.4"
 
 #ALIASES += PLATFORM="@platform"
 #ALIASES += PRIVLEVEL_PLATFORM="\par Privilege Level:\n platform"
index c17b944..01548d1 100755 (executable)
@@ -166,6 +166,13 @@ bool IsLayoutingRequired( Control control )
   return controlDataImpl.IsLayoutingRequired();
 }
 
+VisualEventSignalType& VisualEventSignal( Control control )
+{
+  Internal::Control& internalControl = Toolkit::Internal::GetImplementation( control );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
+  return controlDataImpl.VisualEventSignal();
+}
+
 } // namespace DevelControl
 
 } // namespace Toolkit
index 404a9ec..dad426f 100755 (executable)
@@ -270,14 +270,14 @@ DALI_TOOLKIT_API void DoAction( Control& control, Dali::Property::Index visualIn
  */
 DALI_TOOLKIT_API void SetInputMethodContext( Internal::Control& control, InputMethodContext& inputMethodContext );
 
-/*
+/**
  * @brief Get the layout associated with this control, if any.
  *
  * @return A handle to the layout, or empty.
  */
 DALI_TOOLKIT_API Toolkit::LayoutItem GetLayout( Internal::Control& control );
 
-/*
+/**
  * @brief Get the layout associated with a control, if any.
  *
  * @return A handle to the layout, or empty.
@@ -328,6 +328,22 @@ DALI_TOOLKIT_API void SetLayoutingRequired( Control control, bool layoutingRequi
  */
 DALI_TOOLKIT_API bool IsLayoutingRequired( Control control );
 
+/**
+ * @brief Visual Event signal type
+ */
+using VisualEventSignalType = Signal< void ( Control, Dali::Property::Index, Dali::Property::Index ) >;
+
+/**
+ * @brief This signal is emitted when a visual has an event to notify.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName( Control control, Dali::Property::Index visualIndex, Dali::Property::Index signalId );
+ * @endcode
+ * @return The signal to connect to
+ */
+DALI_TOOLKIT_API VisualEventSignalType& VisualEventSignal( Control control );
+
 } // namespace DevelControl
 
 } // namespace Toolkit
index 7608577..4c6e4d6 100755 (executable)
@@ -49,8 +49,6 @@ namespace Property
       VERTICAL_ALIGNMENT = Dali::Toolkit::TextField::Property::VERTICAL_ALIGNMENT,
       TEXT_COLOR = Dali::Toolkit::TextField::Property::TEXT_COLOR,
       PLACEHOLDER_TEXT_COLOR = Dali::Toolkit::TextField::Property::PLACEHOLDER_TEXT_COLOR,
-      SHADOW_OFFSET = Dali::Toolkit::TextField::Property::SHADOW_OFFSET,
-      SHADOW_COLOR = Dali::Toolkit::TextField::Property::SHADOW_COLOR,
       PRIMARY_CURSOR_COLOR = Dali::Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR,
       SECONDARY_CURSOR_COLOR = Dali::Toolkit::TextField::Property::SECONDARY_CURSOR_COLOR,
       ENABLE_CURSOR_BLINK = Dali::Toolkit::TextField::Property::ENABLE_CURSOR_BLINK,
index ec6b935..e0e877c 100755 (executable)
@@ -43,11 +43,6 @@ namespace Property
     HORIZONTAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT,
     VERTICAL_ALIGNMENT = Dali::Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT,
     UNUSED_PROPERTY_TEXT_COLOR = Dali::Toolkit::TextLabel::Property::UNUSED_PROPERTY_TEXT_COLOR,
-    SHADOW_OFFSET = Dali::Toolkit::TextLabel::Property::SHADOW_OFFSET,
-    SHADOW_COLOR = Dali::Toolkit::TextLabel::Property::SHADOW_COLOR,
-    UNDERLINE_ENABLED = Dali::Toolkit::TextLabel::Property::UNDERLINE_ENABLED,
-    UNDERLINE_COLOR = Dali::Toolkit::TextLabel::Property::UNDERLINE_COLOR,
-    UNDERLINE_HEIGHT = Dali::Toolkit::TextLabel::Property::UNDERLINE_HEIGHT,
     ENABLE_MARKUP = Dali::Toolkit::TextLabel::Property::ENABLE_MARKUP,
     ENABLE_AUTO_SCROLL = Dali::Toolkit::TextLabel::Property::ENABLE_AUTO_SCROLL,
     AUTO_SCROLL_SPEED = Dali::Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED,
index ebb9631..9fe075e 100755 (executable)
@@ -132,6 +132,7 @@ devel_api_visuals_header_files = \
   $(devel_api_src_dir)/visuals/animated-gradient-visual-properties-devel.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/color-visual-properties-devel.h \
   $(devel_api_src_dir)/visuals/image-visual-properties-devel.h \
   $(devel_api_src_dir)/visuals/image-visual-actions-devel.h \
index a8927f9..a27f060 100644 (file)
@@ -59,6 +59,7 @@ LayoutGroup::~LayoutGroup()
 {
   // An object with a unique_ptr to an opaque structure must define it's destructor in the translation unit
   // where the opaque structure is defined. It cannot use the default method in the header file.
+  RemoveAll();
 }
 
 Toolkit::LayoutGroup::LayoutId LayoutGroup::Add( LayoutItem& child )
@@ -613,7 +614,7 @@ void LayoutGroup::ChildRemovedFromOwner( Actor child )
     if( childLayout )
     {
       Remove( *childLayout.Get() );
-      RequestLayout( Dali::Toolkit::LayoutTransitionData::Type::ON_CHILD_REMOVE, child, Actor() );
+      RequestLayout( Dali::Toolkit::LayoutTransitionData::Type::ON_CHILD_REMOVE, Actor(), child );
     }
   }
 }
index fe26362..a41a13e 100644 (file)
@@ -66,14 +66,14 @@ LayoutItemPtr LayoutItem::New( Handle& owner )
 
 void LayoutItem::Initialize( Handle& owner, const std::string& containerType )
 {
-  mImpl->mOwner = &(owner.GetBaseObject());
+  mImpl->mOwner = owner;
   RegisterChildProperties( containerType );
   OnInitialize(); // Ensure direct deriving class gets initialized
 }
 
 Handle LayoutItem::GetOwner() const
 {
-  return Handle::DownCast(BaseHandle(mImpl->mOwner));
+  return mImpl->mOwner.GetHandle();
 }
 
 void LayoutItem::Unparent()
@@ -92,7 +92,7 @@ void LayoutItem::Unparent()
   SetParent(nullptr);
 
   // Last, clear owner
-  mImpl->mOwner = NULL;
+  mImpl->mOwner.Reset();
 }
 
 LayoutTransitionDataPtr LayoutItem::GetDefaultTransition()
@@ -317,7 +317,7 @@ void LayoutItem::SetMinimumHeight( LayoutLength minimumHeight )
 
 Extents LayoutItem::GetPadding() const
 {
-  Toolkit::Control control = Toolkit::Control::DownCast( mImpl->mOwner );
+  Toolkit::Control control = Toolkit::Control::DownCast( GetOwner() );
   if( control )
   {
     Extents padding = control.GetProperty<Extents>( Toolkit::Control::Property::PADDING );
@@ -336,7 +336,7 @@ Extents LayoutItem::GetPadding() const
 
 Extents LayoutItem::GetMargin() const
 {
-  Toolkit::Control control = Toolkit::Control::DownCast( mImpl->mOwner );
+  Toolkit::Control control = Toolkit::Control::DownCast( GetOwner() );
   if ( control )
   {
     return control.GetProperty<Extents>( Toolkit::Control::Property::MARGIN );
@@ -415,44 +415,47 @@ LayoutParent* LayoutItem::GetParent()
 
 void LayoutItem::RequestLayout()
 {
-  Toolkit::Control control = Toolkit::Control::DownCast( mImpl->mOwner );
+  Toolkit::Control control = Toolkit::Control::DownCast( GetOwner() );
   if( control )
   {
     DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::RequestLayout control(%s)\n",
         control.GetName().c_str() );
+
+    // @todo Enforce failure if called in Measure/Layout passes.
+    mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
+    Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
+    layoutController.RequestLayout( Toolkit::LayoutItem( this ) );
   }
-  // @todo Enforce failure if called in Measure/Layout passes.
-  mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
-  Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
-  layoutController.RequestLayout( Toolkit::LayoutItem( this ) );
 }
 
 void LayoutItem::RequestLayout( Dali::Toolkit::LayoutTransitionData::Type layoutAnimationType )
 {
-  Toolkit::Control control = Toolkit::Control::DownCast( mImpl->mOwner );
+  Toolkit::Control control = Toolkit::Control::DownCast( GetOwner() );
   if ( control )
   {
     DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::RequestLayout control(%s) layoutTranstionType(%d)\n",
         control.GetName().c_str(), (int)layoutAnimationType );
+
+    // @todo Enforce failure if called in Measure/Layout passes.
+    mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
+    Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
+    layoutController.RequestLayout( Toolkit::LayoutItem(this), layoutAnimationType );
   }
-  // @todo Enforce failure if called in Measure/Layout passes.
-  mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
-  Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
-  layoutController.RequestLayout( Toolkit::LayoutItem(this), layoutAnimationType );
 }
 
 void LayoutItem::RequestLayout( Dali::Toolkit::LayoutTransitionData::Type layoutAnimationType, Actor gainedChild, Actor lostChild )
 {
-  Toolkit::Control control = Toolkit::Control::DownCast( mImpl->mOwner );
+  Toolkit::Control control = Toolkit::Control::DownCast( GetOwner() );
   if ( control )
   {
     DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::RequestLayout control(%s) layoutTranstionType(%d)\n",
         control.GetName().c_str(), (int)layoutAnimationType );
+
+    // @todo Enforce failure if called in Measure/Layout passes.
+    mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
+    Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
+    layoutController.RequestLayout( Toolkit::LayoutItem(this), layoutAnimationType, gainedChild, lostChild );
   }
-  // @todo Enforce failure if called in Measure/Layout passes.
-  mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_FORCE_LAYOUT );
-  Toolkit::LayoutController layoutController = Toolkit::LayoutController::Get();
-  layoutController.RequestLayout( Toolkit::LayoutItem(this), layoutAnimationType, gainedChild, lostChild );
 }
 
 bool LayoutItem::IsLayoutRequested() const
@@ -517,7 +520,7 @@ MeasuredSize LayoutItem::GetMeasuredHeightAndState() const
 LayoutLength LayoutItem::GetSuggestedMinimumWidth() const
 {
   auto owner = GetOwner();
-  auto actor = Actor::DownCast(owner);
+  auto actor = Actor::DownCast( owner );
   auto naturalSize = actor ? actor.GetNaturalSize() : Vector3::ZERO;
 
   return std::max( mImpl->mMinimumSize.GetWidth(), LayoutLength( naturalSize.width ) );
@@ -526,7 +529,7 @@ LayoutLength LayoutItem::GetSuggestedMinimumWidth() const
 LayoutLength LayoutItem::GetSuggestedMinimumHeight() const
 {
   auto owner = GetOwner();
-  auto actor = Actor::DownCast(owner);
+  auto actor = Actor::DownCast( owner );
   auto naturalSize = actor ? actor.GetNaturalSize() : Vector3::ZERO;
 
   return std::max( mImpl->mMinimumSize.GetHeight(), LayoutLength( naturalSize.height ) );
index 6e40c69..1f05bd7 100644 (file)
@@ -39,7 +39,6 @@ enum Type
 {
   PLAY,        ///< Play the animated vector image.
   PAUSE,       ///< Pause the animated vector image.
-  RESUME,      ///< Resume the animated vector image.
   STOP         ///< Stop the animated vector image. This is also Default playback mode.
 };
 
diff --git a/dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h b/dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h
new file mode 100644 (file)
index 0000000..3ab14e1
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef DALI_TOOLKIT_DEVEL_API_VISUALS_ANIMATED_VECTOR_IMAGE_VISUAL_SIGNALS_DEVEL_H
+#define DALI_TOOLKIT_DEVEL_API_VISUALS_ANIMATED_VECTOR_IMAGE_VISUAL_SIGNALS_DEVEL_H
+
+/*
+ * Copyright (c) 2018 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 DevelAnimatedVectorImageVisual
+{
+
+/**
+ * @brief Signal that the animated vector image visual can emit.
+ */
+namespace Signal
+{
+/**
+ * @brief The available signals for this visual
+ */
+enum Type
+{
+  ANIMATION_FINISHED      ///< Animation has finished.
+};
+
+} // namespace Signal
+
+} // namespace DevelAnimatedVectorImageVisual
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_DEVEL_API_VISUALS_ANIMATED_VECTOR_IMAGE_VISUAL_SIGNALS_DEVEL_H
index eb39aa6..2ae2726 100644 (file)
@@ -92,12 +92,29 @@ enum Type
    * @details Name "playRange", Type Property::VECTOR2, between 0 and 1
    * @note Default 0 and 1
    */
-  PLAY_RANGE = ORIENTATION_CORRECTION + 4
+  PLAY_RANGE = ORIENTATION_CORRECTION + 4,
+
+  /**
+   * @brief The playing state the AnimatedVectorImageVisual will use.
+   * @details Name "playState", type PlayState (Property::INTEGER)
+   * @note This property is read-only.
+   */
+  PLAY_STATE = ORIENTATION_CORRECTION + 5
 
 };
 
 } //namespace Property
 
+/**
+ * @brief Enumeration for what state the animation is in.
+ */
+enum class PlayState
+{
+  STOPPED,   ///< Animation has stopped
+  PLAYING,   ///< The animation is playing
+  PAUSED     ///< The animation is paused
+};
+
 } // namespace DevelImageVisual
 
 } // namespace Toolkit
index 8c35f25..3207f9b 100644 (file)
@@ -445,7 +445,8 @@ void Button::CreateVisualsForComponent( Property::Index index, const Property::V
                    index, DevelControl::IsVisualEnabled( *this, index )?"true":"false" );
     // enable the visual if needed for current state
     const bool enabled = ( ( index == VISUAL_INDEX_FOR_STATE[ mButtonState ][ BACKGROUND ] )||
-                           ( index == VISUAL_INDEX_FOR_STATE[ mButtonState ][ FOREGROUND ] ) );
+                           ( index == VISUAL_INDEX_FOR_STATE[ mButtonState ][ FOREGROUND ] )||
+                           ( index == Toolkit::Button::Property::LABEL ) );
     DevelControl::RegisterVisual( *this, index, buttonVisual, enabled, visualDepth );
   }
   else
index 0ecae06..ccc515d 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -305,8 +305,17 @@ const std::vector<std::string>& ToggleButton::GetToggleTooltips() const
 
 void ToggleButton::PrepareVisual(Property::Index index, Toolkit::Visual::Base& visual)
 {
-  DevelControl::RegisterVisual( *this, index, visual, true );
-  DevelControl::EnableVisual( *this, index, false );
+  bool enabled = false; // Disabled by default
+
+  // Unregister the visual with the given index if registered previously
+  if( DevelControl::GetVisual( *this, index ) )
+  {
+    // Check whether it was enabled to ensure we do the same with the new visual we're registering
+    enabled = DevelControl::IsVisualEnabled( *this, index );
+    DevelControl::UnregisterVisual( *this, index );
+  }
+
+  DevelControl::RegisterVisual( *this, index, visual, enabled );
 }
 
 void ToggleButton::RelayoutVisual( Property::Index index, const Vector2& size )
index 5e94e8f..0367037 100755 (executable)
@@ -334,6 +334,7 @@ Control::Impl::Impl( Control& controlImpl )
   mKeyInputFocusGainedSignal(),
   mKeyInputFocusLostSignal(),
   mResourceReadySignal(),
+  mVisualEventSignal(),
   mPinchGestureDetector(),
   mPanGestureDetector(),
   mTapGestureDetector(),
@@ -626,15 +627,15 @@ void Control::Impl::StopObservingVisual( Toolkit::Visual::Base& visual )
   Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
 
   // Stop observing the visual
-  visualImpl.RemoveResourceObserver( *this );
+  visualImpl.RemoveEventObserver( *this );
 }
 
 void Control::Impl::StartObservingVisual( Toolkit::Visual::Base& visual)
 {
   Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual );
 
-  // start observing the visual for resource ready
-  visualImpl.AddResourceObserver( *this );
+  // start observing the visual for events
+  visualImpl.AddEventObserver( *this );
 }
 
 // Called by a Visual when it's resource is ready
@@ -680,6 +681,20 @@ void Control::Impl::ResourceReady( Visual::Base& object)
   }
 }
 
+void Control::Impl::NotifyVisualEvent( Visual::Base& object, Property::Index signalId )
+{
+  for( auto registeredIter = mVisuals.Begin(),  end = mVisuals.End(); registeredIter != end; ++registeredIter )
+  {
+    Internal::Visual::Base& registeredVisualImpl = Toolkit::GetImplementation( (*registeredIter)->visual );
+    if( &object == &registeredVisualImpl )
+    {
+      Dali::Toolkit::Control handle( mControlImpl.GetOwner() );
+      mVisualEventSignal.Emit( handle, (*registeredIter)->index, signalId );
+      break;
+    }
+  }
+}
+
 bool Control::Impl::IsResourceReady() const
 {
   // Iterate through and check all the enabled visuals are ready
@@ -1489,6 +1504,11 @@ bool Control::Impl::IsLayoutingRequired()
   return mControlImpl.mImpl->mIsLayoutingRequired;
 }
 
+DevelControl::VisualEventSignalType& Control::Impl::VisualEventSignal()
+{
+  return mVisualEventSignal;
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index 1afa0a2..634e7f6 100755 (executable)
@@ -24,7 +24,7 @@
 #include <string>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/visuals/visual-resource-observer.h>
+#include <dali-toolkit/internal/visuals/visual-event-observer.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali/devel-api/common/owner-container.h>
 #include <dali-toolkit/devel-api/layouting/layout-item-impl.h>
@@ -65,7 +65,7 @@ typedef Dali::OwnerContainer< RegisteredVisual* > RegisteredVisualContainer;
 /**
  * @brief Holds the Implementation for the internal control class
  */
-class Control::Impl : public ConnectionTracker, public Visual::ResourceObserver
+class Control::Impl : public ConnectionTracker, public Visual::EventObserver
 {
 
 public:
@@ -124,9 +124,17 @@ public:
   /**
    * @brief Called when a resource is ready.
    * @param[in] object The visual whose resources are ready
-   * @note Overriding method in Visual::ResourceObserver.
+   * @note Overriding method in Visual::EventObserver.
    */
-  virtual void ResourceReady( Visual::Base& object );
+  virtual void ResourceReady( Visual::Base& object ) override;
+
+  /**
+   * @brief Called when an event occurs.
+   * @param[in] object The visual whose events occur
+   * @param[in] signalId The signal to emit. See Visual to find supported signals
+   * @note Overriding method in Visual::EventObserver.
+   */
+  virtual void NotifyVisualEvent( Visual::Base& object, Property::Index signalId ) override;
 
   /**
    * @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
@@ -355,6 +363,11 @@ public:
    */
   bool IsLayoutingRequired();
 
+  /**
+   * @copydoc DevelControl::VisualEventSignal()
+   */
+  DevelControl::VisualEventSignalType& VisualEventSignal();
+
 private:
 
   /**
@@ -418,6 +431,7 @@ public:
   Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusGainedSignal;
   Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusLostSignal;
   Toolkit::Control::ResourceReadySignalType mResourceReadySignal;
+  DevelControl::VisualEventSignalType mVisualEventSignal;
 
   // Gesture Detection
   PinchGestureDetector mPinchGestureDetector;
index 890312c..96b1b78 100755 (executable)
@@ -463,9 +463,15 @@ Property::Value ImageView::GetProperty( BaseObject* object, Property::Index prop
           Scripting::CreatePropertyMap( impl.mImage, map );
           value = map;
         }
-        else if( !impl.mPropertyMap.Empty() )
+        else
         {
-          value = impl.mPropertyMap;
+          Property::Map map;
+          Toolkit::Visual::Base visual = DevelControl::GetVisual( impl, Toolkit::ImageView::Property::IMAGE );
+          if( visual )
+          {
+            visual.CreatePropertyMap( map );
+          }
+          value = map;
         }
         break;
       }
index 2b76083..7168031 100755 (executable)
@@ -91,8 +91,6 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "horizontalAlignment",
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "verticalAlignment",                    STRING,    VERTICAL_ALIGNMENT                   )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "textColor",                            VECTOR4,   TEXT_COLOR                           )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholderTextColor",                 VECTOR4,   PLACEHOLDER_TEXT_COLOR               )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadowOffset",                         VECTOR2,   SHADOW_OFFSET                        )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadowColor",                          VECTOR4,   SHADOW_COLOR                         )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "primaryCursorColor",                   VECTOR4,   PRIMARY_CURSOR_COLOR                 )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "secondaryCursorColor",                 VECTOR4,   SECONDARY_CURSOR_COLOR               )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "enableCursorBlink",                    BOOLEAN,   ENABLE_CURSOR_BLINK                  )
@@ -340,36 +338,6 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
-      case Toolkit::TextField::Property::SHADOW_OFFSET:
-      {
-        if( impl.mController )
-        {
-          const Vector2& shadowOffset = value.Get< Vector2 >();
-          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SHADOW_OFFSET %f,%f\n", impl.mController.Get(), shadowOffset.x, shadowOffset.y );
-
-          if ( impl.mController->GetShadowOffset() != shadowOffset )
-          {
-            impl.mController->SetShadowOffset( shadowOffset );
-            impl.mRenderer.Reset();
-          }
-        }
-        break;
-      }
-      case Toolkit::TextField::Property::SHADOW_COLOR:
-      {
-        if( impl.mController )
-        {
-          const Vector4& shadowColor = value.Get< Vector4 >();
-          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SHADOW_COLOR %f,%f,%f,%f\n", impl.mController.Get(), shadowColor.r, shadowColor.g, shadowColor.b, shadowColor.a );
-
-          if ( impl.mController->GetShadowColor() != shadowColor )
-          {
-            impl.mController->SetShadowColor( shadowColor );
-            impl.mRenderer.Reset();
-          }
-        }
-        break;
-      }
       case Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR:
       {
         if( impl.mDecorator )
@@ -922,22 +890,6 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
         }
         break;
       }
-      case Toolkit::TextField::Property::SHADOW_OFFSET:
-      {
-        if ( impl.mController )
-        {
-          value = impl.mController->GetShadowOffset();
-        }
-        break;
-      }
-      case Toolkit::TextField::Property::SHADOW_COLOR:
-      {
-        if ( impl.mController )
-        {
-          value = impl.mController->GetShadowColor();
-        }
-        break;
-      }
       case Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR:
       {
         if( impl.mDecorator )
index 473730d..62e221c 100755 (executable)
@@ -108,11 +108,6 @@ DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "multiLine",
 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "horizontalAlignment",       STRING,  HORIZONTAL_ALIGNMENT       )
 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "verticalAlignment",         STRING,  VERTICAL_ALIGNMENT         )
 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "unusedPropertyTextColor",   VECTOR4, UNUSED_PROPERTY_TEXT_COLOR )
-DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "shadowOffset",              VECTOR2, SHADOW_OFFSET              )
-DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "shadowColor",               VECTOR4, SHADOW_COLOR               )
-DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "underlineEnabled",          BOOLEAN, UNDERLINE_ENABLED          )
-DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "underlineColor",            VECTOR4, UNDERLINE_COLOR            )
-DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "underlineHeight",           FLOAT,   UNDERLINE_HEIGHT           )
 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "enableMarkup",              BOOLEAN, ENABLE_MARKUP              )
 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "enableAutoScroll",          BOOLEAN, ENABLE_AUTO_SCROLL         )
 DALI_PROPERTY_REGISTRATION( Toolkit,           TextLabel, "autoScrollSpeed",           INTEGER, AUTO_SCROLL_SPEED          )
@@ -269,73 +264,6 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr
         impl.mTextUpdateNeeded = true;
         break;
       }
-
-      case Toolkit::TextLabel::Property::SHADOW_OFFSET:
-      {
-        if( impl.mController )
-        {
-          const Vector2& shadowOffset = value.Get< Vector2 >();
-          if ( impl.mController->GetShadowOffset() != shadowOffset )
-          {
-            impl.mController->SetShadowOffset( shadowOffset );
-            impl.mTextUpdateNeeded = true;
-          }
-        }
-        break;
-      }
-      case Toolkit::TextLabel::Property::SHADOW_COLOR:
-      {
-        if( impl.mController )
-        {
-          const Vector4& shadowColor = value.Get< Vector4 >();
-          if ( impl.mController->GetShadowColor() != shadowColor )
-          {
-            impl.mController->SetShadowColor( shadowColor );
-            impl.mTextUpdateNeeded = true;
-          }
-        }
-        break;
-      }
-      case Toolkit::TextLabel::Property::UNDERLINE_COLOR:
-      {
-        if( impl.mController )
-        {
-          const Vector4& color = value.Get< Vector4 >();
-          if ( impl.mController->GetUnderlineColor() != color )
-          {
-            impl.mController->SetUnderlineColor( color );
-            impl.mTextUpdateNeeded = true;
-          }
-        }
-        break;
-      }
-      case Toolkit::TextLabel::Property::UNDERLINE_ENABLED:
-      {
-        if( impl.mController )
-        {
-          const bool enabled = value.Get< bool >();
-          if ( impl.mController->IsUnderlineEnabled() != enabled )
-          {
-            impl.mController->SetUnderlineEnabled( enabled );
-            impl.mTextUpdateNeeded = true;
-          }
-        }
-        break;
-      }
-
-      case Toolkit::TextLabel::Property::UNDERLINE_HEIGHT:
-      {
-        if( impl.mController )
-        {
-          float height = value.Get< float >();
-          if( fabsf( impl.mController->GetUnderlineHeight() - height ) > Math::MACHINE_EPSILON_1000 )
-          {
-            impl.mController->SetUnderlineHeight( height );
-            impl.mTextUpdateNeeded = true;
-          }
-        }
-        break;
-      }
       case Toolkit::TextLabel::Property::ENABLE_MARKUP:
       {
         if( impl.mController )
@@ -649,46 +577,6 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
         value = label.GetProperty( Toolkit::TextLabel::Property::TEXT_COLOR );
         break;
       }
-      case Toolkit::TextLabel::Property::SHADOW_OFFSET:
-      {
-        if ( impl.mController )
-        {
-          value = impl.mController->GetShadowOffset();
-        }
-        break;
-      }
-      case Toolkit::TextLabel::Property::SHADOW_COLOR:
-      {
-        if ( impl.mController )
-        {
-          value = impl.mController->GetShadowColor();
-        }
-        break;
-      }
-      case Toolkit::TextLabel::Property::UNDERLINE_COLOR:
-      {
-        if ( impl.mController )
-        {
-          value = impl.mController->GetUnderlineColor();
-        }
-        break;
-      }
-      case Toolkit::TextLabel::Property::UNDERLINE_ENABLED:
-      {
-        if ( impl.mController )
-        {
-          value = impl.mController->IsUnderlineEnabled();
-        }
-        break;
-      }
-      case Toolkit::TextLabel::Property::UNDERLINE_HEIGHT:
-      {
-        if ( impl.mController )
-        {
-          value = impl.mController->GetUnderlineHeight();
-        }
-        break;
-      }
       case Toolkit::TextLabel::Property::ENABLE_MARKUP:
       {
         if( impl.mController )
index 746e8e5..9d0b947 100644 (file)
@@ -82,7 +82,10 @@ void LayoutController::RequestLayout( LayoutItem& layoutItem, int layoutTransiti
   auto actor = Actor::DownCast( layoutItem.GetOwner() );
   if ( actor )
   {
-    DALI_LOG_INFO( gLogFilter, Debug::Concise, "LayoutController::RequestLayout owner[%s] layoutItem[%p] layoutTransitionType(%d)\n", actor.GetName().c_str(), &layoutItem, layoutTransitionType );
+    DALI_LOG_INFO( gLogFilter, Debug::Concise, "LayoutController::RequestLayout owner[%s] layoutItem[%p] layoutTransitionType(%d) gainedChild[%s] lostChild[%s]\n",
+      actor.GetName().c_str(), &layoutItem, layoutTransitionType,
+      gainedChild ? gainedChild.GetName().c_str() : "",
+      lostChild ? lostChild.GetName().c_str() : "");
   }
   else
   {
@@ -236,16 +239,19 @@ void LayoutController::UpdateMeasureHierarchyForAnimation( LayoutData& layoutDat
       continue;
     }
 
-    Actor actor = Actor::DownCast( layoutDataElement.handle );
-    LayoutDataAnimator animator = layoutData.layoutAnimatorArray[ layoutDataElement.animatorIndex ];
-    float width = actor.GetProperty<int>( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION );
-    float height = actor.GetProperty<int>( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION );
-
-    if( layoutDataElement.AdjustMeasuredSize( width, height, animator.animatorType ) )
+    Actor actor = layoutDataElement.handle.GetHandle();
+    if( actor )
     {
-      mActorSizeSpecs.push_back( ActorSizeSpec( actor ) );
-      actor.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, static_cast<int>( width ) );
-      actor.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, static_cast<int>( height ) );
+      LayoutDataAnimator animator = layoutData.layoutAnimatorArray[ layoutDataElement.animatorIndex ];
+      float width = actor.GetProperty<int>( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION );
+      float height = actor.GetProperty<int>( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION );
+
+      if( layoutDataElement.AdjustMeasuredSize( width, height, animator.animatorType ) )
+      {
+        mActorSizeSpecs.push_back( ActorSizeSpec( actor ) );
+        actor.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, static_cast<int>( width ) );
+        actor.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, static_cast<int>( height ) );
+      }
     }
   }
 
@@ -294,9 +300,12 @@ void LayoutController::RestoreActorsSpecs()
 {
   for( auto& actorSizeSpec : mActorSizeSpecs )
   {
-    Actor actor = actorSizeSpec.actor;
-    actor.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, actorSizeSpec.widthSpec );
-    actor.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, actorSizeSpec.heightSpec );
+    Actor actor = actorSizeSpec.actor.GetHandle();
+    if( actor )
+    {
+      actor.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, actorSizeSpec.widthSpec );
+      actor.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, actorSizeSpec.heightSpec );
+    }
   }
 }
 
@@ -333,10 +342,10 @@ void LayoutController::PerformLayoutPositioning( LayoutPositionDataArray& layout
 
   for( auto layoutPositionData : layoutPositionDataArray )
   {
-    Actor actor = Actor::DownCast( layoutPositionData.handle );
+    Actor actor = layoutPositionData.handle.GetHandle();
     if( actor && ( !layoutPositionData.animated || all ) )
     {
-      if ( !layoutPositionData.animated )
+      if( !layoutPositionData.animated )
       {
         actor.SetPosition( layoutPositionData.left, layoutPositionData.top );
         actor.SetSize( layoutPositionData.right - layoutPositionData.left, layoutPositionData.bottom - layoutPositionData.top );
@@ -365,7 +374,7 @@ void LayoutController::PerformLayoutAnimation( LayoutTransition& layoutTransitio
   {
     if( layoutDataElement.animatorIndex >= 0 )
     {
-      Actor actor = Actor::DownCast( layoutDataElement.handle );
+      Actor actor = layoutDataElement.handle.GetHandle();
       if ( actor )
       {
         LayoutDataAnimator animator = layoutAnimatorArray[ layoutDataElement.animatorIndex ];
index 7443776..8f78c32 100644 (file)
@@ -101,7 +101,7 @@ private:
     {
     }
 
-    Actor actor;
+    WeakHandle<Actor> actor;
     int widthSpec;
     int heightSpec;
   };
@@ -129,7 +129,7 @@ private:
     {
       layoutController.PerformLayoutPositioning( layoutDataPositionArray, true );
       layoutController.mAnimationFinishedFunctors.pop_front();
-      if (layoutTransitionType != -1)
+      if( layoutTransitionType != -1 )
       {
         LayoutTransitionDataPtr layoutTransitionDataPtr = layoutItem->GetTransitionData( layoutTransitionType );
         layoutTransitionDataPtr->EmitSignalFinish( layoutTransitionType );
index c97a8df..e6e41b6 100644 (file)
@@ -30,7 +30,7 @@ bool LayoutItem::Impl::sUseZeroUnspecifiedMeasureSpec = false;
 LayoutData* LayoutItem::Impl::sLayoutData = nullptr;
 
 LayoutItem::Impl::Impl()
-: mOwner( nullptr ),
+: mOwner(),
   mLayoutParent( nullptr ),
   mOldWidthMeasureSpec( 0 ),
   mOldHeightMeasureSpec( 0 ),
index 0b415ad..e7b2819 100644 (file)
@@ -16,7 +16,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
+#include <dali/public-api/object/weak-handle.h>
 #include <dali-toolkit/devel-api/layouting/layout-item-impl.h>
 #include <dali-toolkit/devel-api/layouting/layout-controller.h>
 #include <dali-toolkit/devel-api/layouting/layout-size.h>
@@ -35,7 +35,7 @@ public:
   Impl();
 
 public:
-  BaseObject* mOwner; ///< Control or Visual that owns this layout. Raw pointer to prevent cyclic references
+  WeakHandle<Handle> mOwner; ///< Control or Visual that owns this layout. Weak pointer to prevent cyclic references
   LayoutParent* mLayoutParent; ///< The containing layout parent.
 
   MeasureSpec mOldWidthMeasureSpec;
index fa24192..07a32ca 100644 (file)
@@ -88,7 +88,7 @@ bool LayoutDataElement::AdjustMeasuredSize( float& width, float& height, Toolkit
     return false;
   }
 
-  Actor actor = Actor::DownCast( handle );
+  Actor actor = handle.GetHandle();
   float animateByMultiplier = ( animatorType == Toolkit::LayoutTransitionData::Animator::Type::ANIMATE_BY ) ? 1.0f : 0.0f;
   Vector3 size = actor.GetCurrentSize();
 
@@ -164,10 +164,13 @@ bool LayoutDataElement::AdjustMeasuredSize( float& width, float& height, Toolkit
 
 void LayoutDataElement::UpdatePropertyIndex()
 {
-  if( propertyIndex == -1 && handle && !propertyName.empty() )
+  if( propertyIndex == -1 && !propertyName.empty() )
   {
-    Actor actor = Actor::DownCast( handle );
-    propertyIndex = DevelHandle::GetPropertyIndex( actor, Property::Key( propertyName ) );
+    Actor actor = handle.GetHandle();
+    if( actor )
+    {
+      propertyIndex = DevelHandle::GetPropertyIndex( actor, Property::Key( propertyName ) );
+    }
   }
 }
 
@@ -223,7 +226,7 @@ LayoutTransitionDataPtr LayoutTransitionData::New()
 }
 
 LayoutTransitionData::PropertyAnimator::PropertyAnimator( )
-  : handle( Actor( ) )
+  : handle()
   , map()
   , interpolation( Animation::Linear )
 {
@@ -638,38 +641,41 @@ void LayoutTransitionData::CollectChildrenLayoutDataElements( Actor child, Layou
   // Add the children animators
   for( const LayoutDataElement& iter : layoutData.childrenLayoutDataArray )
   {
-    if( iter.handle != nullptr && iter.handle != child )
+    Actor actor = iter.handle.GetHandle();
+    if( actor && actor != child )
     {
       continue;
     }
 
     LayoutDataElement layoutDataElement = iter;
+    Actor gainedChild = layoutData.layoutTransition.gainedChild.GetHandle();
+    Actor lostChild = layoutData.layoutTransition.lostChild.GetHandle();
     switch ( layoutDataElement.condition )
     {
       case Dali::Toolkit::LayoutTransitionData::Condition::ON_ADD:
         if ( layoutData.layoutTransition.layoutTransitionType != Dali::Toolkit::LayoutTransitionData::ON_CHILD_ADD
-            || layoutData.layoutTransition.gainedChild != child )
+            || gainedChild != child )
         {
           continue;
         }
         break;
       case Dali::Toolkit::LayoutTransitionData::Condition::ON_REMOVE:
         if( layoutData.layoutTransition.layoutTransitionType != Dali::Toolkit::LayoutTransitionData::ON_CHILD_REMOVE
-            || layoutData.layoutTransition.lostChild != child )
+            || lostChild != child )
         {
           continue;
         }
         break;
       case Dali::Toolkit::LayoutTransitionData::Condition::ON_FOCUS_GAINED:
         if( layoutData.layoutTransition.layoutTransitionType != Dali::Toolkit::LayoutTransitionData::ON_CHILD_FOCUS
-            || layoutData.layoutTransition.gainedChild != child )
+            || gainedChild != child )
         {
           continue;
         }
         break;
       case Dali::Toolkit::LayoutTransitionData::Condition::ON_FOCUS_LOST:
         if( layoutData.layoutTransition.layoutTransitionType != Dali::Toolkit::LayoutTransitionData::ON_CHILD_FOCUS
-            || layoutData.layoutTransition.lostChild != child )
+            || lostChild != child )
         {
           continue;
         }
@@ -713,7 +719,8 @@ void LayoutTransitionData::CollectLayoutDataElements( Actor owner, LayoutData& l
   // Collect the transition animators
   for( const LayoutDataElement& iter : mLayoutDataElements )
   {
-    if( iter.handle == nullptr || iter.handle != owner )
+    Actor actor = iter.handle.GetHandle();
+    if( !actor || actor != owner )
     {
       layoutData.childrenLayoutDataArray.push_back( iter );
       continue;
index 348f2d9..354a1bd 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/weak-handle.h>
 #include <dali/public-api/actors/actor-enumerations.h>
 #include <dali/public-api/animation/animation.h>
 
@@ -60,8 +61,8 @@ struct LayoutTransition
 
   LayoutItemPtr layoutItem;
   int layoutTransitionType;
-  Actor gainedChild;
-  Actor lostChild;
+  WeakHandle<Actor> gainedChild;
+  WeakHandle<Actor> lostChild;
 };
 
 const float DEFAULT_TRANSITION_DURATION( 0.5f );
@@ -92,12 +93,12 @@ using LayoutAnimatorArray = std::vector< LayoutDataAnimator >;
 
 struct LayoutPositionData
 {
-  LayoutPositionData( Handle handle, float left, float top, float right, float bottom, bool animated ) :
+  LayoutPositionData( Actor handle, float left, float top, float right, float bottom, bool animated ) :
       handle( handle ), left( left ), top( top ), right( right ), bottom( bottom ), animated( animated ), updateWithCurrentSize(false)
   {
   };
 
-  BaseHandle handle;
+  WeakHandle<Actor> handle;
   float left;
   float top;
   float right;
@@ -124,7 +125,7 @@ struct LayoutDataElement
   void UpdateAnimatorIndex( const LayoutAnimatorArray& animators );
   void UpdatePositionDataIndex( LayoutData& layoutData );
 
-  BaseHandle handle;
+  WeakHandle<Actor> handle;
   std::string propertyName;
   Property::Index propertyIndex;
   Property::Value initialValue;
@@ -154,7 +155,7 @@ public:
     PropertyAnimator( Actor actor, Property::Map map, Path path, Vector3 forward );
     PropertyAnimator( Actor actor, Property::Map map, KeyFrames keyFrames, Animation::Interpolation interpolation );
 
-    BaseHandle handle;
+    WeakHandle<Actor> handle;
 
     Property::Map map;
 
old mode 100644 (file)
new mode 100755 (executable)
index 2fa2c8b..e06b958
@@ -49,7 +49,7 @@ attribute mediump vec2    aPosition;
 attribute mediump vec2    aTexCoord;
 attribute mediump vec4    aColor;
 uniform   mediump vec2    uOffset;
-uniform   mediump mat4    uMvpMatrix;
+uniform     highp mat4    uMvpMatrix;
 varying   mediump vec2    vTexCoord;
 varying   mediump vec4    vColor;
 
index 6849f33..1468941 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -361,6 +361,9 @@ void Controller::SetMultiLineEnabled( bool enable )
     mImpl->mTextUpdateInfo.mFullRelayoutNeeded = true;
     mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending | layoutOperations );
 
+    // Need to recalculate natural size
+    mImpl->mRecalculateNaturalSize = true;
+
     mImpl->RequestRelayout();
   }
 }
index 96c7ddd..f4a733b 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
 #include <dali-toolkit/public-api/visuals/visual-properties.h>
 #include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
+#include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h>
 #include <dali-toolkit/internal/visuals/image-visual-shader-factory.h>
 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
@@ -99,6 +100,15 @@ void AnimatedVectorImageVisual::DoCreatePropertyMap( Property::Map& map ) const
   }
   map.Insert( Toolkit::DevelImageVisual::Property::LOOP_COUNT, static_cast< int >( mLoopCount ) );
   map.Insert( Toolkit::DevelImageVisual::Property::PLAY_RANGE, static_cast< Vector2 >( mPlayRange ) );
+
+  if( mVectorRasterizeThread )
+  {
+    map.Insert( Toolkit::DevelImageVisual::Property::PLAY_STATE, static_cast< int >( mVectorRasterizeThread->GetPlayState() ) );
+  }
+  else
+  {
+    map.Insert( Toolkit::DevelImageVisual::Property::PLAY_STATE, static_cast< int >( DevelImageVisual::PlayState::STOPPED ) );
+  }
 }
 
 void AnimatedVectorImageVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
@@ -250,6 +260,7 @@ void AnimatedVectorImageVisual::OnSetTransform()
         mVectorRasterizeThread = std::unique_ptr< VectorRasterizeThread >( new VectorRasterizeThread( mUrl.GetUrl(), mImpl->mRenderer, width, height ) );
 
         mVectorRasterizeThread->SetResourceReadyCallback( new EventThreadCallback( MakeCallback( this, &AnimatedVectorImageVisual::OnResourceReady ) ) );
+        mVectorRasterizeThread->SetAnimationFinishedCallback( new EventThreadCallback( MakeCallback( this, &AnimatedVectorImageVisual::OnAnimationFinished ) ) );
         mVectorRasterizeThread->SetLoopCount( mLoopCount );
         mVectorRasterizeThread->SetPlayRange( mPlayRange );
 
@@ -279,11 +290,6 @@ void AnimatedVectorImageVisual::OnSetTransform()
 
 void AnimatedVectorImageVisual::OnDoAction( const Property::Index actionId, const Property::Value& attributes )
 {
-  if( actionId == mActionStatus )
-  {
-    return;
-  }
-
   // Check if action is valid for this visual type and perform action if possible
   switch( actionId )
   {
@@ -310,22 +316,23 @@ void AnimatedVectorImageVisual::OnDoAction( const Property::Index actionId, cons
       mActionStatus = DevelAnimatedVectorImageVisual::Action::PAUSE;
       break;
     }
-    case DevelAnimatedVectorImageVisual::Action::RESUME:
-    {
-      if( mVectorRasterizeThread )
-      {
-        mVectorRasterizeThread->ResumeAnimation();
-        DevelStage::SetRenderingBehavior( Stage::GetCurrent(), DevelStage::Rendering::CONTINUOUSLY );
-      }
-      mActionStatus = DevelAnimatedVectorImageVisual::Action::RESUME;
-      break;
-    }
     case DevelAnimatedVectorImageVisual::Action::STOP:
     {
       if( mVectorRasterizeThread )
       {
+        bool emitSignal = false;
+        if( mVectorRasterizeThread->GetPlayState() != DevelImageVisual::PlayState::STOPPED )
+        {
+          emitSignal = true;
+        }
+
         mVectorRasterizeThread->StopAnimation();
         DevelStage::SetRenderingBehavior( Stage::GetCurrent(), DevelStage::Rendering::IF_REQUIRED );
+
+        if( emitSignal )
+        {
+          OnAnimationFinished();
+        }
       }
       mActionStatus = DevelAnimatedVectorImageVisual::Action::STOP;
       break;
@@ -347,6 +354,14 @@ void AnimatedVectorImageVisual::OnResourceReady()
   }
 }
 
+void AnimatedVectorImageVisual::OnAnimationFinished()
+{
+  if( mImpl->mEventObserver )
+  {
+    mImpl->mEventObserver->NotifyVisualEvent( *this, DevelAnimatedVectorImageVisual::Signal::ANIMATION_FINISHED );
+  }
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index 268cb06..28d79a4 100644 (file)
@@ -150,6 +150,11 @@ private:
    */
   void OnResourceReady();
 
+  /**
+   * @brief Event callback from rasterize thread. This is called after the animation is finished.
+   */
+  void OnAnimationFinished();
+
   // Undefined
   AnimatedVectorImageVisual( const AnimatedVectorImageVisual& visual ) = delete;
 
index 52c6541..536c208 100644 (file)
@@ -50,8 +50,10 @@ VectorRasterizeThread::VectorRasterizeThread( const std::string& url, Renderer r
   mVectorRenderer(),
   mConditionalWait(),
   mMutex(),
-  mResourceReadyTrigger( NULL ),
+  mResourceReadyTrigger(),
+  mAnimationFinishedTrigger(),
   mPlayRange( 0.0f, 1.0f ),
+  mPlayState( DevelImageVisual::PlayState::STOPPED ),
   mCurrentFrame( 0 ),
   mTotalFrame( 0 ),
   mStartFrame( 0 ),
@@ -61,8 +63,6 @@ VectorRasterizeThread::VectorRasterizeThread( const std::string& url, Renderer r
   mLoopCount( LOOP_FOREVER ),
   mCurrentLoop( 0 ),
   mNeedRender( false ),
-  mPlaying( false ),
-  mPaused( false ),
   mDestroyThread( false ),
   mResourceReady( false ),
   mLogFactory( Dali::Adaptor::Get().GetLogFactory() )
@@ -85,8 +85,6 @@ VectorRasterizeThread::~VectorRasterizeThread()
   DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::~VectorRasterizeThread: Join\n" );
 
   Join();
-
-  delete mResourceReadyTrigger;
 }
 
 void VectorRasterizeThread::Run()
@@ -114,10 +112,16 @@ void VectorRasterizeThread::SetSize( uint32_t width, uint32_t height )
 void VectorRasterizeThread::StartAnimation()
 {
   ConditionalWait::ScopedLock lock( mConditionalWait );
-  if( !mPlaying )
+  if( mPlayState != DevelImageVisual::PlayState::PLAYING )
   {
-    mPlaying = true;
-    mPaused = false;
+    if( mPlayState == DevelImageVisual::PlayState::STOPPED )
+    {
+      // Reset the current frame and the current loop
+      mCurrentFrame = mStartFrame;
+      mCurrentLoop = 0;
+    }
+
+    mPlayState = DevelImageVisual::PlayState::PLAYING;
     mConditionalWait.Notify( lock );
 
     DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::StartAnimation: Start\n" );
@@ -127,10 +131,9 @@ void VectorRasterizeThread::StartAnimation()
 void VectorRasterizeThread::StopAnimation()
 {
   ConditionalWait::ScopedLock lock( mConditionalWait );
-  if( mPlaying )
+  if( mPlayState != DevelImageVisual::PlayState::STOPPED )
   {
-    mPlaying = false;
-    mPaused = false;
+    mPlayState = DevelImageVisual::PlayState::STOPPED;
 
     DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::StopAnimation: Stop\n" );
   }
@@ -139,26 +142,14 @@ void VectorRasterizeThread::StopAnimation()
 void VectorRasterizeThread::PauseAnimation()
 {
   ConditionalWait::ScopedLock lock( mConditionalWait );
-  if( mPlaying && !mPaused )
+  if( mPlayState == DevelImageVisual::PlayState::PLAYING )
   {
-    mPaused = true;
+    mPlayState = DevelImageVisual::PlayState::PAUSED;
 
     DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::PauseAnimation: Pause\n" );
   }
 }
 
-void VectorRasterizeThread::ResumeAnimation()
-{
-  ConditionalWait::ScopedLock lock( mConditionalWait );
-  if( mPlaying && mPaused )
-  {
-    mPaused = false;
-    mConditionalWait.Notify( lock );
-
-    DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::ResumeAnimation: Resume\n" );
-  }
-}
-
 void VectorRasterizeThread::RenderFrame()
 {
   ConditionalWait::ScopedLock lock( mConditionalWait );
@@ -171,7 +162,13 @@ void VectorRasterizeThread::RenderFrame()
 void VectorRasterizeThread::SetResourceReadyCallback( EventThreadCallback* callback )
 {
   ConditionalWait::ScopedLock lock( mConditionalWait );
-  mResourceReadyTrigger = callback;
+  mResourceReadyTrigger = std::unique_ptr< EventThreadCallback >( callback );
+}
+
+void VectorRasterizeThread::SetAnimationFinishedCallback( EventThreadCallback* callback )
+{
+  ConditionalWait::ScopedLock lock( mConditionalWait );
+  mAnimationFinishedTrigger = std::unique_ptr< EventThreadCallback >( callback );
 }
 
 void VectorRasterizeThread::SetLoopCount( int16_t count )
@@ -198,20 +195,19 @@ void VectorRasterizeThread::SetPlayRange( Vector2 range )
   }
 }
 
+DevelImageVisual::PlayState VectorRasterizeThread::GetPlayState()
+{
+  return mPlayState;
+}
+
 bool VectorRasterizeThread::IsThreadReady()
 {
   ConditionalWait::ScopedLock lock( mConditionalWait );
 
-  if( ( !mPlaying || mPaused ) && !mNeedRender && !mDestroyThread )
+  if( mPlayState != DevelImageVisual::PlayState::PLAYING && !mNeedRender && !mDestroyThread )
   {
     DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::IsThreadReady: Wait\n" );
 
-    if( !mPlaying )
-    {
-      mCurrentFrame = mStartFrame;
-      mCurrentLoop = 0;
-    }
-
     mConditionalWait.Wait( lock );
   }
 
@@ -243,7 +239,7 @@ void VectorRasterizeThread::Rasterize()
   // Rasterize
   mVectorRenderer.Render( mCurrentFrame );
 
-  if( mPlaying && !mPaused )
+  if( mPlayState == DevelImageVisual::PlayState::PLAYING )
   {
     if( ++mCurrentFrame >= mEndFrame )
     {
@@ -258,7 +254,11 @@ void VectorRasterizeThread::Rasterize()
         if( mCurrentLoop >= mLoopCount )
         {
           // Animation is finished
-          mPlaying = false;
+          mPlayState = DevelImageVisual::PlayState::STOPPED;
+
+          mAnimationFinishedTrigger->Trigger();
+
+          DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::Rasterize: Animation is finished\n" );
         }
         else
         {
index f05f8b6..8ee52be 100644 (file)
 #include <dali/devel-api/threading/thread.h>
 #include <dali/integration-api/adaptors/log-factory-interface.h>
 #include <string>
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
 
 namespace Dali
 {
@@ -81,11 +85,6 @@ public:
   void PauseAnimation();
 
   /**
-   * @brief Resume the vector animation.
-   */
-  void ResumeAnimation();
-
-  /**
    * @brief Render one frame. The current frame number will be increased.
    */
   void RenderFrame();
@@ -97,6 +96,12 @@ public:
   void SetResourceReadyCallback( EventThreadCallback* callback );
 
   /**
+   * @brief This callback is called after the animation is finished.
+   * @param[in] callback The animation finished callback
+   */
+  void SetAnimationFinishedCallback( EventThreadCallback* callback );
+
+  /**
    * @brief Enable looping for 'count' repeats. -1 means to repeat forever.
    * @param[in] count The number of times to loop
    */
@@ -109,6 +114,12 @@ public:
    */
   void SetPlayRange( Vector2 range );
 
+  /**
+   * @brief Get the play state
+   * @return The play state
+   */
+  DevelImageVisual::PlayState GetPlayState();
+
 protected:
 
   /**
@@ -143,25 +154,25 @@ private:
 
 private:
 
-  std::string                mUrl;
-  VectorAnimationRenderer    mVectorRenderer;
-  ConditionalWait            mConditionalWait;
-  Dali::Mutex                mMutex;
-  EventThreadCallback*       mResourceReadyTrigger;
-  Vector2                    mPlayRange;
-  uint32_t                   mCurrentFrame;
-  uint32_t                   mTotalFrame;
-  uint32_t                   mStartFrame;
-  uint32_t                   mEndFrame;
-  uint32_t                   mWidth;
-  uint32_t                   mHeight;
-  int16_t                    mLoopCount;
-  int16_t                    mCurrentLoop;
-  bool                       mNeedRender;
-  bool                       mPlaying;
-  bool                       mPaused;
-  bool                       mDestroyThread;  ///< Whether the thread be destroyed
-  bool                       mResourceReady;
+  std::string                 mUrl;
+  VectorAnimationRenderer     mVectorRenderer;
+  ConditionalWait             mConditionalWait;
+  Dali::Mutex                 mMutex;
+  std::unique_ptr< EventThreadCallback > mResourceReadyTrigger;
+  std::unique_ptr< EventThreadCallback > mAnimationFinishedTrigger;
+  Vector2                     mPlayRange;
+  DevelImageVisual::PlayState mPlayState;
+  uint32_t                    mCurrentFrame;
+  uint32_t                    mTotalFrame;
+  uint32_t                    mStartFrame;
+  uint32_t                    mEndFrame;
+  uint32_t                    mWidth;
+  uint32_t                    mHeight;
+  int16_t                     mLoopCount;
+  int16_t                     mCurrentLoop;
+  bool                        mNeedRender;
+  bool                        mDestroyThread;  ///< Whether the thread be destroyed
+  bool                        mResourceReady;
   const Dali::LogFactoryInterface& mLogFactory; ///< The log factory
 
 };
index f59901c..d9ca38b 100644 (file)
@@ -300,6 +300,11 @@ void SvgVisual::OnSetTransform()
       mVisualSize = visualSize;
     }
   }
+
+  if(mImpl->mRenderer)
+  {
+    mImpl->mTransform.RegisterUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
+  }
 }
 
 } // namespace Internal
index 0e7f396..3702aa3 100644 (file)
@@ -117,7 +117,7 @@ bool GetPolicyFromValue( const Property::Value& value, Vector2& policy )
 Internal::Visual::Base::Impl::Impl(FittingMode fittingMode)
 : mCustomShader( NULL ),
   mBlendSlotDelegate( NULL ),
-  mResourceObserver( NULL ),
+  mEventObserver( NULL ),
   mTransform(),
   mMixColor( Color::WHITE ),
   mControlSize( Vector2::ZERO ),
index 1f59ec0..4adcc5a 100644 (file)
@@ -24,7 +24,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
-#include <dali-toolkit/internal/visuals/visual-resource-observer.h>
+#include <dali-toolkit/internal/visuals/visual-event-observer.h>
 #include <dali-toolkit/public-api/align-enumerations.h>
 #include <dali-toolkit/public-api/visuals/visual-properties.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
@@ -119,7 +119,7 @@ struct Base::Impl
   Renderer        mRenderer;
   CustomShader*   mCustomShader;
   SlotDelegate<Visual::Base>* mBlendSlotDelegate; ///< Used to own mix color animation connection
-  ResourceObserver* mResourceObserver;  ///< Allows controls to observe when the visual resources are loaded and ready
+  EventObserver*  mEventObserver;  ///< Allows controls to observe when the visual has events to notify
   std::string     mName;
   Transform       mTransform;
   Vector4         mMixColor;
index 1ae6411..d14dcd3 100755 (executable)
@@ -435,14 +435,14 @@ const Vector4& Visual::Base::GetMixColor() const
   return mImpl->mMixColor;
 }
 
-void Visual::Base::AddResourceObserver( Visual::ResourceObserver& observer)
+void Visual::Base::AddEventObserver( Visual::EventObserver& observer)
 {
-  mImpl->mResourceObserver = &observer;
+  mImpl->mEventObserver = &observer;
 }
 
-void Visual::Base::RemoveResourceObserver( Visual::ResourceObserver& observer )
+void Visual::Base::RemoveEventObserver( Visual::EventObserver& observer )
 {
-  mImpl->mResourceObserver = NULL;
+  mImpl->mEventObserver = NULL;
 }
 
 void Visual::Base::ResourceReady(Toolkit::Visual::ResourceStatus resourceStatus)
@@ -451,10 +451,10 @@ void Visual::Base::ResourceReady(Toolkit::Visual::ResourceStatus resourceStatus)
   {
     mImpl->mResourceStatus = resourceStatus;
 
-    if( mImpl->mResourceObserver )
+    if( mImpl->mEventObserver )
     {
       // observer is currently a control impl
-      mImpl->mResourceObserver->ResourceReady( *this );
+      mImpl->mEventObserver->ResourceReady( *this );
     }
   }
 }
index 02419d2..754c838 100644 (file)
@@ -47,7 +47,7 @@ namespace Internal
 namespace Visual
 {
 
-class ResourceObserver;
+class EventObserver;
 
 using FittingMode = DevelVisual::FittingMode;
 
@@ -227,16 +227,15 @@ public:
                         Internal::TransitionData::Animator& animator );
 
   /**
-   * @brief Add an observer to watch for when the Visuals resources are loaded.
+   * @brief Add an observer to watch for when the Visuals have events to notify
    * Currently only supports a single observer
-   *
    */
-  void AddResourceObserver( Visual::ResourceObserver& observer );
+  void AddEventObserver( Visual::EventObserver& observer );
 
   /**
    * @brief Remove an observer
    */
-  void RemoveResourceObserver( Visual::ResourceObserver& observer );
+  void RemoveEventObserver( Visual::EventObserver& observer );
 
   /**
    * @brief Called when the visuals resources are loaded / ready
diff --git a/dali-toolkit/internal/visuals/visual-event-observer.h b/dali-toolkit/internal/visuals/visual-event-observer.h
new file mode 100644 (file)
index 0000000..d816c34
--- /dev/null
@@ -0,0 +1,82 @@
+#ifndef DALI_INTERNAL_TOOLKIT_VISUAL_EVENT_OBSERVER_H
+#define DALI_INTERNAL_TOOLKIT_VISUAL_EVENT_OBSERVER_H
+
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/property-value.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+namespace Visual
+{
+
+class Base;
+
+/**
+ * Observer to be informed when visuals have events.
+ */
+class EventObserver
+{
+public:
+
+  /**
+   * Inform the observer of the object when a resource is ready.
+   * @param[in] object The connection owner
+   */
+  virtual void ResourceReady( Visual::Base& object ) = 0;
+
+  /**
+   * Inform the observer of the object when an event occurs.
+   * @param[in] object The connection owner
+   * @param[in] signalId The signal to emit. See Visual to find supported signals
+   */
+  virtual void NotifyVisualEvent( Visual::Base& object, Property::Index signalId ) = 0;
+
+protected:
+
+  /**
+   * constructor
+   */
+  EventObserver()
+  {
+  }
+
+  /**
+   * virtual destructor
+   */
+  virtual ~EventObserver()
+  {
+  }
+
+  // Undefined copy constructor.
+  EventObserver( const EventObserver& ) = delete;
+
+  // Undefined assignment operator.
+  EventObserver& operator=( const EventObserver& ) = delete;
+};
+
+} // Visual
+} // Internal
+} // Toolkit
+} // Dali
+
+#endif // DALI_INTERNAL_TOOLKIT_VISUAL_EVENT_OBSERVER_H
diff --git a/dali-toolkit/internal/visuals/visual-resource-observer.h b/dali-toolkit/internal/visuals/visual-resource-observer.h
deleted file mode 100644 (file)
index f671adc..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef DALI_INTERNAL_TOOLKIT_VISUAL_RESOURCE_OBSERVER_H
-#define DALI_INTERNAL_TOOLKIT_VISUAL_RESOURCE_OBSERVER_H
-
-/*
- * Copyright (c) 2017 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 Internal
-{
-namespace Visual
-{
-
-class Base;
-
-
-/**
- * Observer to be informed when a visuals resources are ready.
- */
-class ResourceObserver
-{
-  public:
-
-    /**
-     * Inform the observer of the object that it's connections have changed
-     * @param[in] object The connection owner
-     */
-    virtual void ResourceReady( Visual::Base& object) = 0;
-
-  protected:
-
-    /**
-     * constructor
-     */
-    ResourceObserver()
-    {
-    };
-
-    /**
-     * virtual destructor
-     */
-    virtual ~ResourceObserver()
-    {
-    };
-
-    // Undefined copy constructor.
-    ResourceObserver( const ResourceObserver& );
-
-    // Undefined assignment operator.
-    ResourceObserver& operator=( const ResourceObserver& );
-};
-} // Visual
-} // Internal
-} // Toolkit
-} // Dali
-
-#endif // DALI_INTERNAL_TOOLKIT_VISUAL_RESOURCE_OBSERVER_H
index 8940fe8..f641303 100644 (file)
@@ -169,22 +169,6 @@ public:
       PLACEHOLDER_TEXT_COLOR,
 
       /**
-       * @DEPRECATED_1_1.37 Use SHADOW instead.
-       * @brief The drop shadow offset 0 indicates no shadow.
-       * @details Name "shadowOffset", type Property::VECTOR2.
-       * @SINCE_1_0.0
-       */
-      SHADOW_OFFSET,
-
-      /**
-       * @DEPRECATED_1_1.37 Use SHADOW instead.
-       * @brief The color of a drop shadow.
-       * @details Name "shadowColor", type Property::VECTOR4.
-       * @SINCE_1_0.0
-       */
-      SHADOW_COLOR,
-
-      /**
        * @brief The color to apply to the primary cursor.
        * @details Name "primaryCursorColor", type Property::VECTOR4.
        * @SINCE_1_0.0
index be95d30..c0010f4 100644 (file)
@@ -169,41 +169,6 @@ public:
       UNUSED_PROPERTY_TEXT_COLOR,
 
       /**
-       * @DEPRECATED_1_1.37 Use SHADOW instead
-       * @brief The drop shadow offset 0 indicates no shadow.
-       * @details Name "shadowOffset", type Property::VECTOR2.
-       */
-      SHADOW_OFFSET,
-
-      /**
-       * @DEPRECATED_1_1.37 Use SHADOW instead
-       * @brief The color of a drop shadow.
-       * @details Name "shadowColor", type Property::VECTOR4
-       */
-      SHADOW_COLOR,
-
-      /**
-       * @DEPRECATED_1_1.37 Use UNDERLINE instead
-       * @brief The underline enabled flag.
-       * @details Name "underlineEnabled", type Property::BOOLEAN.
-       */
-      UNDERLINE_ENABLED,
-
-      /**
-       * @DEPRECATED_1_1.37 Use UNDERLINE instead
-       * @brief The color of the underline.
-       * @details Name "underlineColor", type Property::VECTOR4.
-       */
-      UNDERLINE_COLOR,
-
-      /**
-       * @DEPRECATED_1_1.37 Use UNDERLINE instead
-       * @brief Overrides the underline height from font metrics.
-       * @details Name "underlineHeight", type Property::FLOAT.
-       */
-      UNDERLINE_HEIGHT,
-
-      /**
        * @brief Whether the mark-up processing is enabled.
        * @details Name "enableMarkup", type Property::BOOLEAN.
        * @SINCE_1_0.0
index 5b6ff25..ea22350 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -30,8 +30,8 @@ namespace Toolkit
 {
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
-const unsigned int TOOLKIT_MINOR_VERSION = 3;
-const unsigned int TOOLKIT_MICRO_VERSION = 54;
+const unsigned int TOOLKIT_MINOR_VERSION = 4;
+const unsigned int TOOLKIT_MICRO_VERSION = 2;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index cb36f29..dd1447b 100644 (file)
@@ -129,7 +129,7 @@ enum
 } // namespace Property
 
 /**
- * @brief Visual Transfrom for the offset or size.
+ * @brief Visual Transform for the offset or size.
  * @SINCE_1_2.60
  */
 namespace Transform
@@ -162,7 +162,7 @@ namespace Property
 {
 
 /**
- * @brief Enumeration for the type of Transfrom Property.
+ * @brief Enumeration for the type of Transform Property.
  * @SINCE_1_2.60
  */
 enum Type
index 4322001..43bd4e5 100755 (executable)
@@ -67,8 +67,7 @@
       "autoScrollLoopCount":2,
       "autoScrollGap":50,
       "autoScrollSpeed":80,
-      "ignoreSpacesAfterText":false,
-      "matchSystemLanguageDirection":true
+      "ignoreSpacesAfterText":false
     },
 
     "TextLabelFontSize0":
       "grabHandleImage" : "{DALI_STYLE_IMAGE_DIR}cursor_handler_drop_center.png",
       "selectionHandleImageLeft" : {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_left.png" },
       "selectionHandleImageRight": {"filename":"{DALI_STYLE_IMAGE_DIR}selection_handle_drop_right.png" },
-      "enableSelection":false,
-      "matchSystemLanguageDirection":true
+      "enableSelection":false
     },
 
     "TextFieldFontSize0":
       "enableScrollBar":true,
       "scrollBarShowDuration":0.8,
       "scrollBarFadeDuration":0.5,
-      "enableSelection":false,
-      "matchSystemLanguageDirection":true
+      "enableSelection":false
     },
     "ProgressBar":
     {
index fbfbb3f..eea3e9e 100644 (file)
@@ -39,7 +39,6 @@ StereoInfo StereoModeTable[] = {
     { "mono",                 Dali::MONO},
     { "stereoHorizontal",     Dali::STEREO_HORIZONTAL },
     { "stereoVertical",       Dali::STEREO_VERTICAL },
-    { "stereoInterlaced",     Dali::STEREO_INTERLACED },
 };
 
 const unsigned int numberViewModes = sizeof( StereoModeTable ) / sizeof( StereoModeTable[0] );
index 763a9e9..ad3021b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.3.54
+Version:    1.4.2
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
index ea4e120..355b207 100644 (file)
@@ -150,11 +150,6 @@ const IntegerPair EnumTable[] =
     { "COLOR_MODE_USE_OWN_MULTIPLY_PARENT_ALPHA",              USE_OWN_MULTIPLY_PARENT_ALPHA    },
 
 
-    { "POSITION_INHERITANCE_INHERIT_PARENT_POSITION",                    INHERIT_PARENT_POSITION                    },
-    { "POSITION_INHERITANCE_USE_PARENT_POSITION",                        USE_PARENT_POSITION                        },
-    { "POSITION_INHERITANCE_USE_PARENT_POSITION_PLUS_LOCAL_POSITION",    USE_PARENT_POSITION_PLUS_LOCAL_POSITION    },
-    { "POSITION_INHERITANCE_DONT_INHERIT_POSITION",                      DONT_INHERIT_POSITION                      },
-
     { "DRAW_MODE_NORMAL",                                   DrawMode::NORMAL     },
     { "DRAW_MODE_OVERLAY_2D",                               DrawMode::OVERLAY_2D },