Merge "Add WebView SetTtsFocus" into devel/master
authorJIYUN YANG <ji.yang@samsung.com>
Mon, 12 Jul 2021 11:28:37 +0000 (11:28 +0000)
committerGerrit Code Review <gerrit@review>
Mon, 12 Jul 2021 11:28:37 +0000 (11:28 +0000)
38 files changed:
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Layout.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-reflection.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-reflection.h
automated-tests/src/dali-toolkit/utc-Dali-Transition.cpp
dali-toolkit/devel-api/controls/text-controls/text-editor-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/text/text-enumerations-devel.h
dali-toolkit/devel-api/text/text-utils-devel.cpp
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.h
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/graphics/shaders/color-visual-shader.frag
dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag
dali-toolkit/internal/graphics/shaders/image-visual-shader.frag
dali-toolkit/internal/text/bidirectional-support.cpp
dali-toolkit/internal/text/bidirectional-support.h
dali-toolkit/internal/text/layouts/layout-engine.cpp
dali-toolkit/internal/text/layouts/layout-engine.h
dali-toolkit/internal/text/rendering/text-typesetter.cpp
dali-toolkit/internal/text/rendering/text-typesetter.h
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller-relayouter.cpp
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-model.cpp
dali-toolkit/internal/text/text-model.h
dali-toolkit/internal/text/text-view.cpp
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 6028e02..b2a6f5a 100755 (executable)
@@ -323,7 +323,6 @@ void CreateTextModel( const std::string& text,
   // Set the layout parameters.
   textModel->mHorizontalAlignment = Text::HorizontalAlignment::BEGIN;
   textModel->mIgnoreSpacesAfterText = true;
-  textModel->mMatchSystemLanguageDirection = false;
   Layout::Parameters layoutParameters( textArea,
                                        textModel );
 
@@ -385,7 +384,7 @@ void ConfigureTextLabel( ControllerPtr controller )
   controller->SetTextElideEnabled( true );
 
   // Disable match system language direction
-  controller->SetMatchSystemLanguageDirection(false);
+  controller->SetMatchLayoutDirection(DevelText::MatchLayoutDirection::CONTENTS);
 }
 
 void ConfigureTextField( ControllerPtr controller )
@@ -417,7 +416,7 @@ void ConfigureTextField( ControllerPtr controller )
   controller->SetTextElideEnabled( false );
 
   // Disable match system language direction
-  controller->SetMatchSystemLanguageDirection(false);
+  controller->SetMatchLayoutDirection(DevelText::MatchLayoutDirection::CONTENTS);
 }
 
 void ConfigureTextEditor( ControllerPtr controller )
@@ -449,7 +448,7 @@ void ConfigureTextEditor( ControllerPtr controller )
   controller->SetTextElideEnabled( false );
 
   // Disable match system language direction
-  controller->SetMatchSystemLanguageDirection(false);
+  controller->SetMatchLayoutDirection(DevelText::MatchLayoutDirection::CONTENTS);
 }
 
 } // namespace Text
index 8bdecaa..ed8d620 100755 (executable)
@@ -162,7 +162,6 @@ bool LayoutTextTest( const LayoutTextData& data )
   textModel->mHorizontalAlignment = Text::HorizontalAlignment::BEGIN;
   textModel->mLineWrapMode = LineWrap::WORD;
   textModel->mIgnoreSpacesAfterText = true;
-  textModel->mMatchSystemLanguageDirection = false;
   Layout::Parameters layoutParameters( data.textArea,
                                        textModel );
 
index d59f29f..8493992 100644 (file)
@@ -240,9 +240,10 @@ bool TestGraphicsReflection::GetNamedUniform(const std::string& name, Dali::Grap
   return true;
 }
 
-std::vector<Dali::Graphics::UniformInfo> TestGraphicsReflection::GetSamplers() const
+const std::vector<Dali::Graphics::UniformInfo>& TestGraphicsReflection::GetSamplers() const
 {
-  return std::vector<Dali::Graphics::UniformInfo>{};
+  static std::vector<Dali::Graphics::UniformInfo> samplers{};
+  return samplers;
 }
 
 Graphics::ShaderLanguage TestGraphicsReflection::GetLanguage() const
index 7af052e..2147cae 100644 (file)
@@ -28,22 +28,22 @@ class TestGraphicsReflection : public Graphics::Reflection
 public:
   TestGraphicsReflection(TestGlAbstraction& gl, Property::Array& vertexFormats, const Graphics::ProgramCreateInfo& createInfo, std::vector<UniformData>& customUniforms);
 
-  uint32_t                                   GetVertexAttributeLocation(const std::string& name) const override;
-  Dali::Graphics::VertexInputAttributeFormat GetVertexAttributeFormat(uint32_t location) const override;
-  std::string                                GetVertexAttributeName(uint32_t location) const override;
-  std::vector<uint32_t>                      GetVertexAttributeLocations() const override;
-  uint32_t                                   GetUniformBlockCount() const override;
-  uint32_t                                   GetUniformBlockBinding(uint32_t index) const override;
-  uint32_t                                   GetUniformBlockSize(uint32_t index) const override;
-  bool                                       GetUniformBlock(uint32_t index, Dali::Graphics::UniformBlockInfo& out) const override;
-  std::vector<uint32_t>                      GetUniformBlockLocations() const override;
-  std::string                                GetUniformBlockName(uint32_t blockIndex) const override;
-  uint32_t                                   GetUniformBlockMemberCount(uint32_t blockIndex) const override;
-  std::string                                GetUniformBlockMemberName(uint32_t blockIndex, uint32_t memberLocation) const override;
-  uint32_t                                   GetUniformBlockMemberOffset(uint32_t blockIndex, uint32_t memberLocation) const override;
-  bool                                       GetNamedUniform(const std::string& name, Dali::Graphics::UniformInfo& out) const override;
-  std::vector<Dali::Graphics::UniformInfo>   GetSamplers() const override;
-  Graphics::ShaderLanguage                   GetLanguage() const override;
+  uint32_t                                        GetVertexAttributeLocation(const std::string& name) const override;
+  Dali::Graphics::VertexInputAttributeFormat      GetVertexAttributeFormat(uint32_t location) const override;
+  std::string                                     GetVertexAttributeName(uint32_t location) const override;
+  std::vector<uint32_t>                           GetVertexAttributeLocations() const override;
+  uint32_t                                        GetUniformBlockCount() const override;
+  uint32_t                                        GetUniformBlockBinding(uint32_t index) const override;
+  uint32_t                                        GetUniformBlockSize(uint32_t index) const override;
+  bool                                            GetUniformBlock(uint32_t index, Dali::Graphics::UniformBlockInfo& out) const override;
+  std::vector<uint32_t>                           GetUniformBlockLocations() const override;
+  std::string                                     GetUniformBlockName(uint32_t blockIndex) const override;
+  uint32_t                                        GetUniformBlockMemberCount(uint32_t blockIndex) const override;
+  std::string                                     GetUniformBlockMemberName(uint32_t blockIndex, uint32_t memberLocation) const override;
+  uint32_t                                        GetUniformBlockMemberOffset(uint32_t blockIndex, uint32_t memberLocation) const override;
+  bool                                            GetNamedUniform(const std::string& name, Dali::Graphics::UniformInfo& out) const override;
+  const std::vector<Dali::Graphics::UniformInfo>& GetSamplers() const override;
+  Graphics::ShaderLanguage                        GetLanguage() const override;
 
 public: // Test methods
   void SetAttributes(std::vector<std::string> locations)
index b694a69..955e15e 100755 (executable)
@@ -94,6 +94,9 @@ int UtcDaliTransitionSetGetProperty01(void)
   controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
   controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
   controlProperty1.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 50.f);
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 50.f);
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, 1.f);
   control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
 
   Control control2 = Control::New();
@@ -104,6 +107,9 @@ int UtcDaliTransitionSetGetProperty01(void)
   controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
   controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
   controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 30.f);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 30.f);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, -1.f);
   control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
 
   application.GetScene().Add(control1);
@@ -148,6 +154,9 @@ int UtcDaliTransitionSetGetProperty02(void)
   controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
   controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
   controlProperty1.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, Vector4(50.0f, 30.0f, 40.0f, 20.0f));
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 50.f);
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, -1.f);
   control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
 
   Control control2 = Control::New();
@@ -158,6 +167,9 @@ int UtcDaliTransitionSetGetProperty02(void)
   controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
   controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
   controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, Vector4(32.f, 54.0f, 24.0f, 42.0f));
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 30.f);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, -1.f);
   control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
 
   application.GetScene().Add(control1);
@@ -200,6 +212,9 @@ int UtcDaliTransitionBetweenControlPair(void)
   Vector4 destinationColor(1.0f, 0.5f, 1.0f, 0.8f);
   float destinationOpacity(0.8f);
   float destinationRadius(50.f);
+  float destinationBorderlineWidth(80.0f);
+  Vector4 destinationBorderlineColor(0.5f, 1.0f, 0.5f, 0.3f);
+  float destinationBorderlineOffset(-1.0f);
   Vector4 destinationRadiusV4 = Vector4(destinationRadius, destinationRadius, destinationRadius, destinationRadius);
 
   Control control1 = Control::New();
@@ -214,6 +229,9 @@ int UtcDaliTransitionBetweenControlPair(void)
   controlProperty1.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
   controlProperty1.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
   controlProperty1.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 30.f);
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 60.f);
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, 1.f);
   control1.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty1);
 
   Control control2 = Control::New();
@@ -228,12 +246,21 @@ int UtcDaliTransitionBetweenControlPair(void)
   controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
   controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
   controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, destinationRadius);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, destinationBorderlineWidth);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, destinationBorderlineColor);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, destinationBorderlineOffset);
   control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
 
   DALI_TEST_EQUALS(destinationPosition, control2.GetProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
   Property::Map backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
   Vector4 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
   DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
+  float borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
+  DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
+  Vector4 borderlineColor = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR)->Get<Vector4>();
+  DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
+  float borderlineOffset = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET)->Get<float>();
+  DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
 
   application.GetScene().Add(control1);
   application.GetScene().Add(control2);
@@ -263,6 +290,15 @@ int UtcDaliTransitionBetweenControlPair(void)
   Property::Index index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
   cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
   DALI_TEST_NOT_EQUALS(destinationRadiusV4, cornerRadius, 0.00001f, TEST_LOCATION);
+  index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
+  borderlineWidth = renderer.GetCurrentProperty<float>(index);
+  DALI_TEST_NOT_EQUALS(destinationBorderlineWidth, borderlineWidth, 0.00001f, TEST_LOCATION);
+  index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
+  borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+  DALI_TEST_NOT_EQUALS(destinationBorderlineColor, borderlineColor, 0.00001f, TEST_LOCATION);
+  index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
+  borderlineOffset = renderer.GetCurrentProperty<float>(index);
+  DALI_TEST_NOT_EQUALS(destinationBorderlineOffset, borderlineOffset, 0.00001f, TEST_LOCATION);
 
   application.SendNotification();
   application.Render(700);
@@ -284,6 +320,15 @@ int UtcDaliTransitionBetweenControlPair(void)
   index = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
   cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
   DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
+  index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
+  borderlineWidth = renderer.GetCurrentProperty<float>(index);
+  DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
+  index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
+  borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+  DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
+  index = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
+  borderlineOffset = renderer.GetCurrentProperty<float>(index);
+  DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
 
   END_TEST;
 }
@@ -294,6 +339,9 @@ int UtcDaliTransitionBetweenControlPairWithoutEmptySourceBackground(void)
   tet_infoline(" UtcDaliTransitionBetweenControlPair");
 
   Vector4 destinationRadius(50.f, 30.f, 40.f, 0.f);
+  float   destinationBorderlineWidth(40.f);
+  Vector4 destinationBorderlineColor(1.0f, 0.5f, 0.2f, 0.8f);
+  float   destinationBorderlineOffset(1.f);
 
   Control control1 = Control::New();
   control1.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT);
@@ -308,11 +356,20 @@ int UtcDaliTransitionBetweenControlPairWithoutEmptySourceBackground(void)
   controlProperty2.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
   controlProperty2.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.0f, 0.5f));
   controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, destinationRadius);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, destinationBorderlineWidth);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, destinationBorderlineColor);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, destinationBorderlineOffset);
   control2.SetProperty(Toolkit::Control::Property::BACKGROUND, controlProperty2);
 
   Property::Map backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
   Vector4 cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
   DALI_TEST_EQUALS(destinationRadius, cornerRadius, TEST_LOCATION);
+  float borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
+  DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
+  Vector4 borderlineColor = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR)->Get<Vector4>();
+  DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
+  float borderlineOffset = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET)->Get<float>();
+  DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
 
   application.GetScene().Add(control1);
   application.GetScene().Add(control2);
@@ -339,6 +396,12 @@ int UtcDaliTransitionBetweenControlPairWithoutEmptySourceBackground(void)
   backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
   cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
   DALI_TEST_EQUALS(destinationRadius, cornerRadius, TEST_LOCATION);
+  borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
+  DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
+  borderlineColor = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR)->Get<Vector4>();
+  DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
+  borderlineOffset = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET)->Get<float>();
+  DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
 
   application.SendNotification();
   application.Render(700);
@@ -353,6 +416,12 @@ int UtcDaliTransitionBetweenControlPairWithoutEmptySourceBackground(void)
   backgroundMap = control2.GetProperty<Property::Map>(Toolkit::Control::Property::BACKGROUND);
   cornerRadius = backgroundMap.Find(Toolkit::DevelVisual::Property::CORNER_RADIUS)->Get<Vector4>();
   DALI_TEST_EQUALS(destinationRadius, cornerRadius, TEST_LOCATION);
+  borderlineWidth = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH)->Get<float>();
+  DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
+  borderlineColor = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_COLOR)->Get<Vector4>();
+  DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
+  borderlineOffset = backgroundMap.Find(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET)->Get<float>();
+  DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
 
   END_TEST;
 }
@@ -374,6 +443,9 @@ int UtcDaliTransitionBetweenImageViewPair(void)
   controlProperty1.Insert(Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
   controlProperty1.Insert(Toolkit::Visual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.5f, 0.5f));
   controlProperty1.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 50.f);
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 50.f);
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, 1.f);
   control1.SetProperty(Toolkit::ImageView::Property::IMAGE, controlProperty1);
 
   ImageView control2 = ImageView::New();
@@ -386,6 +458,9 @@ int UtcDaliTransitionBetweenImageViewPair(void)
   controlProperty2.Insert(Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
   controlProperty2.Insert(Toolkit::Visual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
   controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 30.f);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 30.f);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(0.0f, 1.0f, 1.0f, 0.5f));
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, -1.f);
   control2.SetProperty(Toolkit::ImageView::Property::IMAGE, controlProperty2);
 
   DALI_TEST_EQUALS(destinationPosition, control2.GetProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
@@ -456,6 +531,9 @@ int UtcDaliTransitionBetweenImageViewPairWithDelay(void)
   controlProperty1.Insert(Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
   controlProperty1.Insert(Toolkit::Visual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 0.5f, 0.5f));
   controlProperty1.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 50.f);
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 50.f);
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(1.0f, 0.0f, 0.0f, 1.0f));
+  controlProperty1.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, 1.f);
   control1.SetProperty(Toolkit::ImageView::Property::IMAGE, controlProperty1);
 
   ImageView control2 = ImageView::New();
@@ -468,6 +546,9 @@ int UtcDaliTransitionBetweenImageViewPairWithDelay(void)
   controlProperty2.Insert(Toolkit::ImageVisual::Property::URL, TEST_IMAGE_FILE_NAME);
   controlProperty2.Insert(Toolkit::Visual::Property::MIX_COLOR, Vector4(1.0f, 1.0f, 1.0f, 1.0f));
   controlProperty2.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, 30.f);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, 30.f);
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, Vector4(0.0f, 1.0f, 1.0f, 0.5f));
+  controlProperty2.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, -1.f);
   control2.SetProperty(Toolkit::ImageView::Property::IMAGE, controlProperty2);
 
   DALI_TEST_EQUALS(destinationPosition, control2.GetProperty<Vector3>(Actor::Property::POSITION), TEST_LOCATION);
index baa872f..fb96330 100644 (file)
@@ -112,7 +112,7 @@ enum Type
   /**
    * @brief Modifies the default text alignment to match the direction of the system language.
    * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write
-   * @note The default value is false
+   * @note The default value is true
    */
   MATCH_SYSTEM_LANGUAGE_DIRECTION,
 
index e1c18f0..f9f13dd 100644 (file)
@@ -100,7 +100,7 @@ enum
   /**
    * @brief Modifies the default text alignment to match the direction of the system language.
    * @details Name "matchSystemLanguageDirection", type (Property::BOOLEAN), Read/Write
-   * @note The default value is false
+   * @note The default value is true
    */
   MATCH_SYSTEM_LANGUAGE_DIRECTION = ELLIPSIS + 3,
 
index efdad10..eed77fd 100644 (file)
@@ -95,7 +95,7 @@ enum Type
   /**
      * @brief Modifies the default text alignment to match the direction of the system language.
      * @details Name "matchSystemLanguageDirection", type (Property::BOLEAN), Read/Write
-     * @note The default value is false
+     * @note The default value is true
      *
      * If MATCH_SYSTEM_LANGUAGE_DIRECTION property set true, the default text alignment to match the direction of the system language.
      *
@@ -105,10 +105,10 @@ enum Type
      *
      * | TextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION                 |
      * |-----------------------------------------------------------------------
-     * |        false (default)            |                true              |
+     * |               false               |          true (default)          |
      * |-----------------------------------|----------------------------------|
      * |                     Hello world   |                  Hello world     |
-     * |   ﻡﺮﺤﺑﺍ.                          |                      ﻡﺮﺤﺑﺍ.      |
+     * |   ﻡﺮﺤﺑﺍ.                     |                          ﻡﺮﺤﺑﺍ.      |
      *
      */
   MATCH_SYSTEM_LANGUAGE_DIRECTION,
@@ -154,6 +154,7 @@ enum Type
    *  - fontSize: 10pt, fontSizeScale: 1.5
    */
   FONT_SIZE_SCALE,
+
 };
 
 } // namespace Property
index a74af43..9eb668f 100644 (file)
@@ -56,6 +56,18 @@ enum Mode
 
 } // namespace LineWrap
 
+/**
+ * A enum for defining text layout directions.
+ * It can also be inherited (from a parent) or deduced from the default language script of a locale.
+ * And it can be the direction of the text ifself.
+ */
+enum class MatchLayoutDirection
+{
+  INHERIT, // The text layout direction is inherited. If you change the layout direction, it will be aligned with the changed layout direction.
+  LOCALE,  // The text layout direction is determined by the locale of the system language.
+  CONTENTS // The text layout direction is determined by the text itself.
+};
+
 } // namespace DevelText
 
 } // namespace Toolkit
index 99ff139..046d014 100644 (file)
@@ -1031,9 +1031,8 @@ Size LayoutText(const RendererParameters& textParameters, TextAbstraction::TextR
   // Resize the vector of positions to have the same size than the vector of glyphs.
   rendererParameters.positions.Resize(numberOfGlyphs);
 
-  textModel->mLineWrapMode                 = Text::LineWrap::WORD;
-  textModel->mIgnoreSpacesAfterText        = false;
-  textModel->mMatchSystemLanguageDirection = false;
+  textModel->mLineWrapMode          = Text::LineWrap::WORD;
+  textModel->mIgnoreSpacesAfterText = false;
   Text::Layout::Parameters layoutParameters(internalDataModel.textLayoutArea,
                                             textModel);
 
index 0af44fb..db346bd 100644 (file)
@@ -1843,30 +1843,51 @@ void Control::Impl::MakeVisualTransition(Dali::Animation& animation, Dali::Toolk
 
   Vector4 mixColor(1.0f, 1.0f, 1.0f, 1.0f);
   Vector4 cornerRadius(0.0f, 0.0f, 0.0f, 0.0f);
+  float   borderlineWidth(0.0f);
+  Vector4 borderlineColor(0.0f, 0.0f, 0.0f, 1.0f);
+  float   borderlineOffset(0.0f);
 
   if(!destinationMap.Empty())
   {
-    static auto findValue = [](const Property::Map& map, Property::Index index) -> Vector4 {
+    static auto findValueVector4 = [](const Property::Map& map, Property::Index index, const Vector4& defaultValue = Vector4()) -> Vector4 {
       Property::Value* propertyValue = map.Find(index);
       if(propertyValue)
       {
         return propertyValue->Get<Vector4>();
       }
-      return Vector4{};
+      return defaultValue;
     };
 
-    mixColor     = findValue(destinationMap, Dali::Toolkit::Visual::Property::MIX_COLOR);
-    cornerRadius = findValue(destinationMap, Toolkit::DevelVisual::Property::CORNER_RADIUS);
+    static auto findValueFloat = [](const Property::Map& map, Property::Index index, const float& defaultValue = 0.0f) -> float {
+      Property::Value* propertyValue = map.Find(index);
+      if(propertyValue)
+      {
+        return propertyValue->Get<float>();
+      }
+      return defaultValue;
+    };
+
+    mixColor         = findValueVector4(destinationMap, Dali::Toolkit::Visual::Property::MIX_COLOR, mixColor);
+    cornerRadius     = findValueVector4(destinationMap, Toolkit::DevelVisual::Property::CORNER_RADIUS, cornerRadius);
+    borderlineWidth  = findValueFloat(destinationMap, Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, borderlineWidth);
+    borderlineColor  = findValueVector4(destinationMap, Toolkit::DevelVisual::Property::BORDERLINE_COLOR, borderlineColor);
+    borderlineOffset = findValueFloat(destinationMap, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, borderlineOffset);
 
     if(sourceMap.Empty())
     {
       sourceMap.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
       sourceMap.Insert(Dali::Toolkit::Visual::Property::MIX_COLOR, Color::TRANSPARENT);
       sourceMap.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, cornerRadius);
+      sourceMap.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, borderlineWidth);
+      sourceMap.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, borderlineColor);
+      sourceMap.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, borderlineOffset);
     }
 
-    Vector4 sourceMixColor     = findValue(sourceMap, Dali::Toolkit::Visual::Property::MIX_COLOR);
-    Vector4 sourceCornerRadius = findValue(sourceMap, Toolkit::DevelVisual::Property::CORNER_RADIUS);
+    Vector4 sourceMixColor         = findValueVector4(sourceMap, Dali::Toolkit::Visual::Property::MIX_COLOR, mixColor);
+    Vector4 sourceCornerRadius     = findValueVector4(sourceMap, Toolkit::DevelVisual::Property::CORNER_RADIUS, cornerRadius);
+    float   sourceBorderlineWidth  = findValueFloat(sourceMap, Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, borderlineWidth);
+    Vector4 sourceBorderlineColor  = findValueVector4(sourceMap, Toolkit::DevelVisual::Property::BORDERLINE_COLOR, borderlineColor);
+    float   sourceBorderlineOffset = findValueFloat(sourceMap, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, borderlineOffset);
 
     std::vector<Dali::Property>                              properties;
     std::vector<std::pair<Property::Value, Property::Value>> values;
@@ -1889,6 +1910,24 @@ void Control::Impl::MakeVisualTransition(Dali::Animation& animation, Dali::Toolk
       values.push_back(std::make_pair(sourceCornerRadius, cornerRadius));
     }
 
+    if(sourceBorderlineWidth != borderlineWidth)
+    {
+      properties.push_back(GetVisualProperty(visualIndex, Dali::Toolkit::DevelVisual::Property::BORDERLINE_WIDTH));
+      values.push_back(std::make_pair(sourceBorderlineWidth, borderlineWidth));
+    }
+
+    if(sourceBorderlineColor != borderlineColor)
+    {
+      properties.push_back(GetVisualProperty(visualIndex, Dali::Toolkit::DevelVisual::Property::BORDERLINE_COLOR));
+      values.push_back(std::make_pair(sourceBorderlineColor, borderlineColor));
+    }
+
+    if(sourceBorderlineOffset != borderlineOffset)
+    {
+      properties.push_back(GetVisualProperty(visualIndex, Dali::Toolkit::DevelVisual::Property::BORDERLINE_OFFSET));
+      values.push_back(std::make_pair(sourceBorderlineOffset, borderlineOffset));
+    }
+
     for(uint32_t i = 0; i < properties.size(); ++i)
     {
       if(timePeriod.delaySeconds > 0.0f)
index f49f82d..e3701ec 100644 (file)
@@ -297,19 +297,34 @@ void ImageView::OnCreateTransitions(Dali::Animation& animation, Dali::Toolkit::C
 
   destinationVisual.CreatePropertyMap(destinationMap);
 
-  static auto findValue = [](const Property::Map& map, Property::Index index) -> Vector4 {
+  static auto findValueVector4 = [](const Property::Map& map, Property::Index index, const Vector4& defaultValue = Vector4()) -> Vector4 {
     Property::Value* propertyValue = map.Find(index);
     if(propertyValue)
     {
       return propertyValue->Get<Vector4>();
     }
-    return Vector4{};
+    return defaultValue;
+  };
+
+  static auto findValueFloat = [](const Property::Map& map, Property::Index index, const float& defaultValue = 0.0f) -> float {
+    Property::Value* propertyValue = map.Find(index);
+    if(propertyValue)
+    {
+      return propertyValue->Get<float>();
+    }
+    return defaultValue;
   };
 
   Vector4 sourceMixColor(0.0f, 0.0f, 0.0f, 0.0f);
   Vector4 sourceCornerRadius(0.0f, 0.0f, 0.0f, 0.0f);
-  Vector4 destinationMixColor     = findValue(destinationMap, Dali::Toolkit::Visual::Property::MIX_COLOR);
-  Vector4 destinationCornerRadius = findValue(destinationMap, Toolkit::DevelVisual::Property::CORNER_RADIUS);
+  float   sourceBorderlineWidth(0.0f);
+  Vector4 sourceBorderlineColor(0.0f, 0.0f, 0.0f, 1.0f);
+  float   sourceBorderlineOffset(0.0f);
+  Vector4 destinationMixColor         = findValueVector4(destinationMap, Dali::Toolkit::Visual::Property::MIX_COLOR, sourceMixColor);
+  Vector4 destinationCornerRadius     = findValueVector4(destinationMap, Toolkit::DevelVisual::Property::CORNER_RADIUS, sourceCornerRadius);
+  float   destinationBorderlineWidth  = findValueFloat(destinationMap, Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, sourceBorderlineWidth);
+  Vector4 destinationBorderlineColor  = findValueVector4(destinationMap, Toolkit::DevelVisual::Property::BORDERLINE_COLOR, sourceBorderlineColor);
+  float   destinationBorderlineOffset = findValueFloat(destinationMap, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, sourceBorderlineOffset);
 
   Dali::Toolkit::ImageView sourceHandle = Dali::Toolkit::ImageView::DownCast(source);
   Toolkit::Visual::Base    sourceVisual;
@@ -323,8 +338,11 @@ void ImageView::OnCreateTransitions(Dali::Animation& animation, Dali::Toolkit::C
   if(sourceVisual)
   {
     sourceVisual.CreatePropertyMap(sourceMap);
-    sourceMixColor     = findValue(sourceMap, Dali::Toolkit::Visual::Property::MIX_COLOR);
-    sourceCornerRadius = findValue(sourceMap, Toolkit::DevelVisual::Property::CORNER_RADIUS);
+    sourceMixColor         = findValueVector4(sourceMap, Dali::Toolkit::Visual::Property::MIX_COLOR, sourceMixColor);
+    sourceCornerRadius     = findValueVector4(sourceMap, Toolkit::DevelVisual::Property::CORNER_RADIUS, sourceCornerRadius);
+    sourceBorderlineWidth  = findValueFloat(sourceMap, Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, sourceBorderlineWidth);
+    sourceBorderlineColor  = findValueVector4(sourceMap, Toolkit::DevelVisual::Property::BORDERLINE_COLOR, sourceBorderlineColor);
+    sourceBorderlineOffset = findValueFloat(sourceMap, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, sourceBorderlineOffset);
   }
 
   std::vector<Dali::Property>                              properties;
@@ -345,6 +363,21 @@ void ImageView::OnCreateTransitions(Dali::Animation& animation, Dali::Toolkit::C
     properties.push_back(DevelControl::GetVisualProperty(destinationHandle, Toolkit::ImageView::Property::IMAGE, Toolkit::DevelVisual::Property::CORNER_RADIUS));
     values.push_back(std::make_pair(sourceCornerRadius, destinationCornerRadius));
   }
+  if(sourceBorderlineWidth != destinationBorderlineWidth)
+  {
+    properties.push_back(DevelControl::GetVisualProperty(destinationHandle, Toolkit::ImageView::Property::IMAGE, Toolkit::DevelVisual::Property::BORDERLINE_WIDTH));
+    values.push_back(std::make_pair(sourceBorderlineWidth, destinationBorderlineWidth));
+  }
+  if(sourceBorderlineColor != destinationBorderlineColor)
+  {
+    properties.push_back(DevelControl::GetVisualProperty(destinationHandle, Toolkit::ImageView::Property::IMAGE, Toolkit::DevelVisual::Property::BORDERLINE_COLOR));
+    values.push_back(std::make_pair(sourceBorderlineColor, destinationBorderlineColor));
+  }
+  if(sourceBorderlineOffset != destinationBorderlineOffset)
+  {
+    properties.push_back(DevelControl::GetVisualProperty(destinationHandle, Toolkit::ImageView::Property::IMAGE, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET));
+    values.push_back(std::make_pair(sourceBorderlineOffset, destinationBorderlineOffset));
+  }
 
   for(uint32_t i = 0; i < properties.size(); ++i)
   {
index 72503a5..eb05cf1 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/devel-api/actors/actor-devel.h>
-#include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/devel-api/common/stage.h>
 #include <dali/devel-api/object/property-helper-devel.h>
 #include <dali/integration-api/adaptor-framework/adaptor.h>
@@ -698,7 +697,7 @@ void TextEditor::SetProperty(BaseObject* object, Property::Index index, const Pr
       }
       case Toolkit::DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION:
       {
-        impl.mController->SetMatchSystemLanguageDirection(value.Get<bool>());
+        impl.mController->SetMatchLayoutDirection(value.Get<bool>() ? DevelText::MatchLayoutDirection::LOCALE : DevelText::MatchLayoutDirection::CONTENTS);
         break;
       }
       case Toolkit::DevelTextEditor::Property::MAX_LENGTH:
@@ -1119,7 +1118,7 @@ Property::Value TextEditor::GetProperty(BaseObject* object, Property::Index inde
       }
       case Toolkit::DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION:
       {
-        value = impl.mController->IsMatchSystemLanguageDirection();
+        value = impl.mController->GetMatchLayoutDirection() != DevelText::MatchLayoutDirection::CONTENTS;
         break;
       }
       case Toolkit::DevelTextEditor::Property::MAX_LENGTH:
@@ -1376,6 +1375,8 @@ void TextEditor::OnInitialize()
   Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>(stage.GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
   mController->SetLayoutDirection(layoutDirection);
 
+  self.LayoutDirectionChangedSignal().Connect(this, &TextEditor::OnLayoutDirectionChanged);
+
   // Forward input events to controller
   EnableGestureDetection(static_cast<GestureType::Value>(GestureType::TAP | GestureType::PAN | GestureType::LONG_PRESS));
   GetTapGestureDetector().SetMaximumTapsRequired(2);
@@ -1501,15 +1502,8 @@ void TextEditor::OnRelayout(const Vector2& size, RelayoutContainer& container)
   Vector2 contentSize(size.x - (padding.start + padding.end), size.y - (padding.top + padding.bottom));
 
   // Support Right-To-Left of padding
-  Dali::LayoutDirection::Type layoutDirection;
-  if(mController->IsMatchSystemLanguageDirection())
-  {
-    layoutDirection = static_cast<Dali::LayoutDirection::Type>(DevelWindow::Get(self).GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
-  }
-  else
-  {
-    layoutDirection = static_cast<Dali::LayoutDirection::Type>(self.GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
-  }
+  Dali::LayoutDirection::Type layoutDirection = mController->GetLayoutDirection(self);
+
   if(Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection)
   {
     std::swap(padding.start, padding.end);
@@ -2172,6 +2166,11 @@ void TextEditor::SetEditable(bool editable)
   }
 }
 
+void TextEditor::OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type type)
+{
+  mController->ChangedLayoutDirection();
+}
+
 TextEditor::TextEditor()
 : Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT)),
   mAnimationPeriod(0.0f, 0.0f),
index 6947faa..6b6c377 100644 (file)
@@ -382,6 +382,13 @@ private: // Implementation
   void OnScrollIndicatorAnimationFinished(Animation& animation);
 
   /**
+  * @brief Callback function for when the layout is changed.
+  * @param[in] actor The actor whose layoutDirection is changed.
+  * @param[in] type  The layoutDirection.
+  */
+  void OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type type);
+
+  /**
    * Construct a new TextEditor.
    */
   TextEditor();
index b1a85c7..f98093e 100644 (file)
@@ -21,7 +21,6 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/actors/actor-devel.h>
 #include <dali/devel-api/adaptor-framework/key-devel.h>
-#include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/devel-api/common/stage.h>
 #include <dali/devel-api/object/property-helper-devel.h>
 #include <dali/integration-api/debug.h>
@@ -696,7 +695,7 @@ void TextField::SetProperty(BaseObject* object, Property::Index index, const Pro
       }
       case Toolkit::DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION:
       {
-        impl.mController->SetMatchSystemLanguageDirection(value.Get<bool>());
+        impl.mController->SetMatchLayoutDirection(value.Get<bool>() ? DevelText::MatchLayoutDirection::LOCALE : DevelText::MatchLayoutDirection::CONTENTS);
         break;
       }
       case Toolkit::DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP:
@@ -1081,7 +1080,7 @@ Property::Value TextField::GetProperty(BaseObject* object, Property::Index index
       }
       case Toolkit::DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION:
       {
-        value = impl.mController->IsMatchSystemLanguageDirection();
+        value = impl.mController->GetMatchLayoutDirection() != DevelText::MatchLayoutDirection::CONTENTS;
         break;
       }
       case Toolkit::DevelTextField::Property::ENABLE_GRAB_HANDLE_POPUP:
@@ -1301,6 +1300,8 @@ void TextField::OnInitialize()
   Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>(stage.GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
   mController->SetLayoutDirection(layoutDirection);
 
+  self.LayoutDirectionChangedSignal().Connect(this, &TextField::OnLayoutDirectionChanged);
+
   // Forward input events to controller
   EnableGestureDetection(static_cast<GestureType::Value>(GestureType::TAP | GestureType::PAN | GestureType::LONG_PRESS));
   GetTapGestureDetector().SetMaximumTapsRequired(2);
@@ -1413,15 +1414,8 @@ void TextField::OnRelayout(const Vector2& size, RelayoutContainer& container)
   Vector2 contentSize(size.x - (padding.start + padding.end), size.y - (padding.top + padding.bottom));
 
   // Support Right-To-Left of padding
-  Dali::LayoutDirection::Type layoutDirection;
-  if(mController->IsMatchSystemLanguageDirection())
-  {
-    layoutDirection = static_cast<Dali::LayoutDirection::Type>(DevelWindow::Get(self).GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
-  }
-  else
-  {
-    layoutDirection = static_cast<Dali::LayoutDirection::Type>(self.GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
-  }
+  Dali::LayoutDirection::Type layoutDirection = mController->GetLayoutDirection(self);
+
   if(Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection)
   {
     std::swap(padding.start, padding.end);
@@ -1956,6 +1950,11 @@ bool TextField::OnTouched(Actor actor, const TouchEvent& touch)
   return false;
 }
 
+void TextField::OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type type)
+{
+  mController->ChangedLayoutDirection();
+}
+
 void TextField::OnIdleSignal()
 {
   // Emits the change of input style signals.
index 349ac26..85d50ef 100644 (file)
@@ -338,6 +338,13 @@ private: // Implementation
   void EmitTextChangedSignal();
 
   /**
+   * @brief Callback function for when the layout is changed.
+   * @param[in] actor The actor whose layoutDirection is changed.
+   * @param[in] type  The layoutDirection.
+   */
+  void OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type type);
+
+  /**
    * Construct a new TextField.
    */
   TextField();
index e4ba0ad..b6c02d7 100644 (file)
@@ -21,7 +21,6 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/actors/actor-devel.h>
 #include <dali/devel-api/adaptor-framework/image-loading.h>
-#include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/devel-api/common/stage.h>
 #include <dali/devel-api/object/property-helper-devel.h>
 #include <dali/integration-api/debug.h>
@@ -457,7 +456,7 @@ void TextLabel::SetProperty(BaseObject* object, Property::Index index, const Pro
       }
       case Toolkit::DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION:
       {
-        impl.mController->SetMatchSystemLanguageDirection(value.Get<bool>());
+        impl.mController->SetMatchLayoutDirection(value.Get<bool>() ? DevelText::MatchLayoutDirection::LOCALE : DevelText::MatchLayoutDirection::CONTENTS);
         break;
       }
       case Toolkit::DevelTextLabel::Property::TEXT_FIT:
@@ -688,7 +687,7 @@ Property::Value TextLabel::GetProperty(BaseObject* object, Property::Index index
       }
       case Toolkit::DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION:
       {
-        value = impl.mController->IsMatchSystemLanguageDirection();
+        value = impl.mController->GetMatchLayoutDirection() != DevelText::MatchLayoutDirection::CONTENTS;
         break;
       }
       case Toolkit::DevelTextLabel::Property::TEXT_FIT:
@@ -786,6 +785,8 @@ void TextLabel::OnInitialize()
   Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>(stage.GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
   mController->SetLayoutDirection(layoutDirection);
 
+  self.LayoutDirectionChangedSignal().Connect(this, &TextLabel::OnLayoutDirectionChanged);
+
   // Forward input events to controller
   EnableGestureDetection(static_cast<GestureType::Value>(GestureType::TAP));
   GetTapGestureDetector().SetMaximumTapsRequired(1);
@@ -899,8 +900,10 @@ void TextLabel::OnRelayout(const Vector2& size, RelayoutContainer& container)
 {
   DALI_LOG_INFO(gLogFilter, Debug::General, "TextLabel::OnRelayout\n");
 
+  Actor self = Self();
+
   Extents padding;
-  padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
+  padding = self.GetProperty<Extents>(Toolkit::Control::Property::PADDING);
 
   Vector2 contentSize(size.x - (padding.start + padding.end), size.y - (padding.top + padding.bottom));
 
@@ -911,15 +914,8 @@ void TextLabel::OnRelayout(const Vector2& size, RelayoutContainer& container)
   }
 
   // Support Right-To-Left
-  Dali::LayoutDirection::Type layoutDirection;
-  if(mController->IsMatchSystemLanguageDirection())
-  {
-    layoutDirection = static_cast<Dali::LayoutDirection::Type>(DevelWindow::Get(Self()).GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
-  }
-  else
-  {
-    layoutDirection = static_cast<Dali::LayoutDirection::Type>(Self().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
-  }
+  Dali::LayoutDirection::Type layoutDirection = mController->GetLayoutDirection(self);
+
   const Text::Controller::UpdateTextType updateTextType = mController->Relayout(contentSize, layoutDirection);
 
   if((Text::Controller::NONE_UPDATED != (Text::Controller::MODEL_UPDATED & updateTextType)) || mTextUpdateNeeded)
@@ -1048,6 +1044,11 @@ void TextLabel::ScrollingFinished()
   RequestTextRelayout();
 }
 
+void TextLabel::OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type type)
+{
+  mController->ChangedLayoutDirection();
+}
+
 TextLabel::TextLabel()
 : Control(ControlBehaviour(CONTROL_BEHAVIOUR_DEFAULT)),
   mRenderingBackend(DEFAULT_RENDERING_BACKEND),
index 01211c2..01e003b 100644 (file)
@@ -182,6 +182,13 @@ private:
     return mTextScroller;
   }
 
+  /**
+   * @brief Callback function for when the layout is changed.
+   * @param[in] actor The actor whose layoutDirection is changed.
+   * @param[in] type  The layoutDirection.
+   */
+  void OnLayoutDirectionChanged(Actor actor, LayoutDirection::Type type);
+
 private: // Data
   Text::ControllerPtr   mController;
   Text::TextScrollerPtr mTextScroller;
index 92b29a6..74e8f58 100644 (file)
@@ -140,8 +140,9 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
       textureColor = mix(textureColor, vec4(borderlineColor.xyz, 0.0), smoothstep(MinTexturelinePotential, MaxTexturelinePotential, potential));
     }
     borderlineOpacity *= borderlineColor.a;
+    return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity);
   }
-  return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity);
+  return mix(textureColor, borderlineColor, borderlineOpacity);
 }
 #endif
 
@@ -238,13 +239,13 @@ mediump float calculateBlurOpacity()
 
 void main()
 {
-  lowp vec4 targetColor = vec4(mixColor, 1.0) * uColor;
+  lowp vec4 targetColor = vec4(mixColor, 1.0);
 
 #if IS_REQUIRED_BLUR || IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
   // skip most potential calculate for performance
   if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
   {
-    OUT_COLOR = targetColor;
+    OUT_COLOR = targetColor * uColor;
     return;
   }
   PreprocessPotential();
@@ -253,7 +254,7 @@ void main()
 #if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE
   targetColor = convertBorderlineColor(targetColor);
 #endif
-  OUT_COLOR = targetColor;
+  OUT_COLOR = targetColor * uColor;
 
 #if IS_REQUIRED_BLUR
   mediump float opacity = calculateBlurOpacity();
index 9c897b4..f859a24 100644 (file)
@@ -139,8 +139,9 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
       textureColor = mix(textureColor, vec4(borderlineColor.xyz, 0.0), smoothstep(MinTexturelinePotential, MaxTexturelinePotential, potential));
     }
     borderlineOpacity *= borderlineColor.a;
+    return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity);
   }
-  return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity);
+  return mix(textureColor, borderlineColor, borderlineOpacity);
 }
 #endif
 
@@ -169,16 +170,16 @@ mediump float calculateCornerOpacity()
 void main()
 {
 #if RADIAL
-  lowp vec4 textureColor = TEXTURE(sTexture, vec2(length(vTexCoord), 0.5)) * vec4(mixColor, 1.0) * uColor;
+  lowp vec4 textureColor = TEXTURE(sTexture, vec2(length(vTexCoord), 0.5)) * vec4(mixColor, 1.0);
 #else
-  lowp vec4 textureColor = TEXTURE(sTexture, vec2(vTexCoord.y, 0.5)) * vec4(mixColor, 1.0) * uColor;
+  lowp vec4 textureColor = TEXTURE(sTexture, vec2(vTexCoord.y, 0.5)) * vec4(mixColor, 1.0);
 #endif
 
 #if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
   // skip most potential calculate for performance
   if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
   {
-    OUT_COLOR = textureColor;
+    OUT_COLOR = textureColor * uColor;
     return;
   }
   PreprocessPotential();
@@ -187,7 +188,7 @@ void main()
 #if IS_REQUIRED_BORDERLINE
   textureColor = convertBorderlineColor(textureColor);
 #endif
-  OUT_COLOR = textureColor;
+  OUT_COLOR = textureColor * uColor;
 
 #if IS_REQUIRED_ROUNDED_CORNER
   mediump float opacity = calculateCornerOpacity();
index b0dcfec..0bba311 100644 (file)
@@ -150,19 +150,22 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
     mediump float tCornerRadius = -gCenterPosition;
     mediump float MaxTexturelinePotential = tCornerRadius + gPotentialRange;
     mediump float MinTexturelinePotential = tCornerRadius - gPotentialRange;
+    lowp vec3 BorderlineColorRGB = borderlineColor.xyz;
+    BorderlineColorRGB *= mix(1.0, borderlineColor.a, preMultipliedAlpha);
     if(potential > MaxTexturelinePotential)
     {
       // potential is out of texture range. use borderline color instead of texture
-      textureColor = vec4(borderlineColor.xyz, 0.0);
+      textureColor = vec4(BorderlineColorRGB, 0.0);
     }
     else if(potential > MinTexturelinePotential)
     {
       // potential is in texture range
-      textureColor = mix(textureColor, vec4(borderlineColor.xyz, 0.0), smoothstep(MinTexturelinePotential, MaxTexturelinePotential, potential));
+      textureColor = mix(textureColor, vec4(BorderlineColorRGB, 0.0), smoothstep(MinTexturelinePotential, MaxTexturelinePotential, potential));
     }
     borderlineOpacity *= borderlineColor.a;
+    return mix(textureColor, vec4(BorderlineColorRGB, 1.0), borderlineOpacity);
   }
-  return mix(textureColor, vec4(borderlineColor.xyz, 1.0), borderlineOpacity);
+  return mix(textureColor, borderlineColor, borderlineOpacity);
 }
 #endif
 
@@ -199,13 +202,13 @@ void main()
   mediump vec2 texCoord = vTexCoord;
 #endif
 
-  lowp vec4 textureColor = TEXTURE( sTexture, texCoord ) * uColor * vec4( mixColor, 1.0 );
+  lowp vec4 textureColor = TEXTURE( sTexture, texCoord ) * vec4( mixColor, 1.0 );
 
 #if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
   // skip most potential calculate for performance
   if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
   {
-    OUT_COLOR = textureColor;
+    OUT_COLOR = textureColor * uColor;
     return;
   }
   PreprocessPotential();
@@ -214,7 +217,7 @@ void main()
 #if IS_REQUIRED_BORDERLINE
   textureColor = convertBorderlineColor(textureColor);
 #endif
-  OUT_COLOR = textureColor;
+  OUT_COLOR = textureColor * uColor;
 
 #if IS_REQUIRED_ROUNDED_CORNER
   mediump float opacity = calculateCornerOpacity();
index da8f961..90e8caf 100644 (file)
@@ -34,7 +34,7 @@ void SetBidirectionalInfo(const Vector<Character>&               text,
                           CharacterIndex                         startIndex,
                           Length                                 numberOfCharacters,
                           Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo,
-                          bool                                   matchSystemLanguageDirection,
+                          bool                                   matchLayoutDirection,
                           Dali::LayoutDirection::Type            layoutDirection)
 {
   // Find where to insert the new paragraphs.
@@ -113,7 +113,7 @@ void SetBidirectionalInfo(const Vector<Character>&               text,
         // Create the bidirectional info for the whole paragraph and store the index to the table with this info in the run.
         bidirectionalRun.bidirectionalInfoIndex = bidirectionalSupport.CreateInfo(textBuffer + bidirectionalRun.characterRun.characterIndex,
                                                                                   bidirectionalRun.characterRun.numberOfCharacters,
-                                                                                  matchSystemLanguageDirection,
+                                                                                  matchLayoutDirection,
                                                                                   layoutDirection);
 
         bidirectionalRun.direction = bidirectionalSupport.GetParagraphDirection(bidirectionalRun.bidirectionalInfoIndex);
index 46c368e..864f6a3 100644 (file)
@@ -43,8 +43,8 @@ namespace Text
  * @param[in] startIndex The character from where the bidirectional info is set.
  * @param[in] numberOfCharacters The number of characters.
  * @param[out] bidirectionalInfo Vector with the bidirectional infor for each paragraph.
- * @param[in] matchSystemLanguageDirection Whether match for system language direction or not.
- * @param[in] layoutDirection The direction of the system language.
+ * @param[in] matchLayoutDirection Whether match for layout direction or not.
+ * @param[in] layoutDirection The direction of the layout.
  */
 void SetBidirectionalInfo(const Vector<Character>&               text,
                           const Vector<ScriptRun>&               scripts,
@@ -52,8 +52,8 @@ void SetBidirectionalInfo(const Vector<Character>&               text,
                           CharacterIndex                         startIndex,
                           Length                                 numberOfCharacters,
                           Vector<BidirectionalParagraphInfoRun>& bidirectionalInfo,
-                          bool                                   matchSystemLanguageDirection = false,
-                          Dali::LayoutDirection::Type            layoutDirection              = LayoutDirection::LEFT_TO_RIGHT);
+                          bool                                   matchLayoutDirection = false,
+                          Dali::LayoutDirection::Type            layoutDirection      = LayoutDirection::LEFT_TO_RIGHT);
 
 /**
  * @brief Sets the visual to logical map table for a given line.
index 25f83d1..6baed98 100644 (file)
@@ -1474,7 +1474,7 @@ struct Engine::Impl
              Vector<LineRun>&                lines,
              float&                          alignmentOffset,
              Dali::LayoutDirection::Type     layoutDirection,
-             bool                            matchSystemLanguageDirection)
+             bool                            matchLayoutDirection)
   {
     const CharacterIndex lastCharacterPlusOne = startIndex + numberOfCharacters;
 
@@ -1510,7 +1510,7 @@ struct Engine::Impl
                                    horizontalAlignment,
                                    line,
                                    layoutDirection,
-                                   matchSystemLanguageDirection);
+                                   matchLayoutDirection);
 
       // Updates the alignment offset.
       alignmentOffset = std::min(alignmentOffset, line.alignmentOffset);
@@ -1521,7 +1521,7 @@ struct Engine::Impl
                                     HorizontalAlignment::Type   horizontalAlignment,
                                     LineRun&                    line,
                                     Dali::LayoutDirection::Type layoutDirection,
-                                    bool                        matchSystemLanguageDirection)
+                                    bool                        matchLayoutDirection)
   {
     line.alignmentOffset = 0.f;
     const bool isLineRTL = RTL == line.direction;
@@ -1532,7 +1532,7 @@ struct Engine::Impl
     float lineLength  = line.width;
 
     // match align for system language direction
-    if(matchSystemLanguageDirection)
+    if(matchLayoutDirection)
     {
       // Swap the alignment type if the line is right to left.
       isLayoutRTL = layoutDirection == LayoutDirection::RIGHT_TO_LEFT;
@@ -1680,7 +1680,7 @@ void Engine::Align(const Size&                     size,
                    Vector<LineRun>&                lines,
                    float&                          alignmentOffset,
                    Dali::LayoutDirection::Type     layoutDirection,
-                   bool                            matchSystemLanguageDirection)
+                   bool                            matchLayoutDirection)
 {
   mImpl->Align(size,
                startIndex,
@@ -1689,7 +1689,7 @@ void Engine::Align(const Size&                     size,
                lines,
                alignmentOffset,
                layoutDirection,
-               matchSystemLanguageDirection);
+               matchLayoutDirection);
 }
 
 void Engine::SetDefaultLineSpacing(float lineSpacing)
index 28e987c..46cc972 100644 (file)
@@ -121,8 +121,8 @@ public:
    * @param[in] horizontalAlignment The horizontal alignment.
    * @param[in,out] lines The laid-out lines.
    * @param[out] alignmentOffset The alignment offset.
-   * @param[in] layoutDirection The direction of the system language.
-   * @param[in] matchSystemLanguageDirection Whether match align for system language direction or not.
+   * @param[in] layoutDirection The direction of the layout.
+   * @param[in] matchLayoutDirection Whether match align for layout direction or not.
    */
   void Align(const Size&                     size,
              CharacterIndex                  startIndex,
@@ -131,7 +131,7 @@ public:
              Vector<LineRun>&                lines,
              float&                          alignmentOffset,
              Dali::LayoutDirection::Type     layoutDirection,
-             bool                            matchSystemLanguageDirection);
+             bool                            matchLayoutDirection);
 
   /**
    * @brief Sets the default line spacing.
index 17a5c61..6fadaed 100644 (file)
@@ -539,6 +539,24 @@ ViewModel* Typesetter::GetViewModel()
   return mModel;
 }
 
+Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth, const unsigned int bufferHeight, Pixel::Format pixelFormat)
+{
+  Devel::PixelBuffer imageBuffer = Devel::PixelBuffer::New(bufferWidth, bufferHeight, pixelFormat);
+
+  if(Pixel::RGBA8888 == pixelFormat)
+  {
+    const unsigned int bufferSizeInt  = bufferWidth * bufferHeight;
+    const unsigned int bufferSizeChar = 4u * bufferSizeInt;
+    memset(imageBuffer.GetBuffer(), 0u, bufferSizeChar);
+  }
+  else
+  {
+    memset(imageBuffer.GetBuffer(), 0, bufferWidth * bufferHeight);
+  }
+
+  return imageBuffer;
+}
+
 PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirection::Type textDirection, RenderBehaviour behaviour, bool ignoreHorizontalAlignment, Pixel::Format pixelFormat)
 {
   // @todo. This initial implementation for a TextLabel has only one visible page.
@@ -709,7 +727,7 @@ PixelData Typesetter::Render(const Vector2& size, Toolkit::DevelText::TextDirect
       }
       else
       {
-        backgroundImageBuffer = Devel::PixelBuffer::New(bufferWidth, bufferHeight, pixelFormat);
+        backgroundImageBuffer = CreateImageBuffer(bufferWidth, bufferHeight, pixelFormat);
       }
 
       if(backgroundMarkupSet)
@@ -755,20 +773,9 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const unsigned int bufferWidth,
   glyphData.verticalOffset   = verticalOffset;
   glyphData.width            = bufferWidth;
   glyphData.height           = bufferHeight;
-  glyphData.bitmapBuffer     = Devel::PixelBuffer::New(bufferWidth, bufferHeight, pixelFormat);
+  glyphData.bitmapBuffer     = CreateImageBuffer(bufferWidth, bufferHeight, pixelFormat);
   glyphData.horizontalOffset = 0;
 
-  if(Pixel::RGBA8888 == pixelFormat)
-  {
-    const unsigned int bufferSizeInt  = bufferWidth * bufferHeight;
-    const unsigned int bufferSizeChar = 4u * bufferSizeInt;
-    memset(glyphData.bitmapBuffer.GetBuffer(), 0u, bufferSizeChar);
-  }
-  else
-  {
-    memset(glyphData.bitmapBuffer.GetBuffer(), 0, bufferWidth * bufferHeight);
-  }
-
   // Get a handle of the font client. Used to retrieve the bitmaps of the glyphs.
   TextAbstraction::FontClient fontClient  = TextAbstraction::FontClient::Get();
   Length                      hyphenIndex = 0;
index c9cd4cc..ee57e29 100644 (file)
@@ -123,7 +123,7 @@ private:
   Typesetter& operator=(const Typesetter& handle);
 
   /**
-   * @brief Create the image buffer for the given range of the glyphs in the given style.
+   * @brief Create & draw the image buffer for the given range of the glyphs in the given style.
    *
    * Does the following operations:
    * - Retrieves the data buffers from the text model.
@@ -145,6 +145,19 @@ private:
   Devel::PixelBuffer CreateImageBuffer(const unsigned int bufferWidth, const unsigned int bufferHeight, Typesetter::Style style, bool ignoreHorizontalAlignment, Pixel::Format pixelFormat, int horizontalOffset, int verticalOffset, TextAbstraction::GlyphIndex fromGlyphIndex, TextAbstraction::GlyphIndex toGlyphIndex);
 
   /**
+   * @brief Create an initialized image buffer.
+   *
+   * Creates the pixel data used to generate the final image with the given size.
+   *
+   * @param[in] bufferWidth The width of the image buffer.
+   * @param[in] bufferHeight The height of the image buffer.
+   * @param[in] pixelFormat The format of the pixel in the image that the text is rendered as (i.e. either Pixel::BGRA8888 or Pixel::L8).
+   *
+   * @return An image buffer.
+   */
+  Devel::PixelBuffer CreateImageBuffer(const unsigned int bufferWidth, const unsigned int bufferHeight, Pixel::Format pixelFormat);
+
+  /**
    * @brief Combine the two RGBA image buffers together.
    *
    * The top layer buffer will blend over the bottom layer buffer:
index 12cdae7..279f23b 100644 (file)
@@ -797,7 +797,7 @@ bool Controller::Impl::UpdateModel(OperationsMask operationsRequired)
                          startIndex,
                          requestedNumberOfCharacters,
                          bidirectionalInfo,
-                         mModel->mMatchSystemLanguageDirection,
+                         (mModel->mMatchLayoutDirection != DevelText::MatchLayoutDirection::CONTENTS),
                          mLayoutDirection);
 
     if(0u != bidirectionalInfo.Count())
@@ -1737,7 +1737,7 @@ void Controller::Impl::GetCursorPosition(CharacterIndex logical,
     cursorInfo.primaryCursorHeight = cursorInfo.lineHeight;
 
     bool isRTL = false;
-    if(mModel->mMatchSystemLanguageDirection)
+    if(mModel->mMatchLayoutDirection != DevelText::MatchLayoutDirection::CONTENTS)
     {
       isRTL = mLayoutDirection == LayoutDirection::RIGHT_TO_LEFT;
     }
@@ -2106,8 +2106,10 @@ Actor Controller::Impl::CreateBackgroundActor()
 
       // Get the background color of the character.
       // The color index zero is reserved for the default background color (i.e. Color::TRANSPARENT)
-      const ColorIndex backgroundColorIndex = (nullptr == backgroundColorsBuffer) ? 0u : *(backgroundColorIndicesBuffer + i);
-      const Vector4&   backgroundColor      = (0u == backgroundColorIndex) ? defaultBackgroundColor : *(backgroundColorsBuffer + backgroundColorIndex - 1u);
+      const bool       isMarkupBackground       = mView.IsMarkupBackgroundColorSet();
+      const ColorIndex backgroundColorIndex     = isMarkupBackground ? *(backgroundColorIndicesBuffer + i) : 0u;
+      const bool       isDefaultBackgroundColor = (0u == backgroundColorIndex);
+      const Vector4&   backgroundColor          = isDefaultBackgroundColor ? defaultBackgroundColor : *(backgroundColorsBuffer + backgroundColorIndex - 1u);
 
       mModel->mVisualModel->GetNumberOfLines(i, 1, lineIndex, numberOfLines);
       Length lineHeight = lineRun[lineIndex].ascender + -(lineRun[lineIndex].descender) + lineRun[lineIndex].lineSpacing;
index 55184ef..f6681bd 100644 (file)
@@ -355,7 +355,8 @@ struct Controller::Impl
     mTextFitMaxSize(DEFAULT_TEXTFIT_MAX),
     mTextFitStepSize(DEFAULT_TEXTFIT_STEP),
     mTextFitEnabled(false),
-    mFontSizeScale(DEFAULT_FONT_SIZE_SCALE)
+    mFontSizeScale(DEFAULT_FONT_SIZE_SCALE),
+    mIsLayoutDirectionChanged(false)
   {
     mModel = Model::New();
 
@@ -834,11 +835,12 @@ public:
 
   Shader mShaderBackground; ///< The shader for text background.
 
-  float mTextFitMinSize;     ///< Minimum Font Size for text fit. Default 10
-  float mTextFitMaxSize;     ///< Maximum Font Size for text fit. Default 100
-  float mTextFitStepSize;    ///< Step Size for font intervalse. Default 1
-  bool  mTextFitEnabled : 1; ///< Whether the text's fit is enabled.
-  float mFontSizeScale;      ///< Scale value for Font Size. Default 1.0
+  float mTextFitMinSize;               ///< Minimum Font Size for text fit. Default 10
+  float mTextFitMaxSize;               ///< Maximum Font Size for text fit. Default 100
+  float mTextFitStepSize;              ///< Step Size for font intervalse. Default 1
+  bool  mTextFitEnabled : 1;           ///< Whether the text's fit is enabled.
+  float mFontSizeScale;                ///< Scale value for Font Size. Default 1.0
+  bool  mIsLayoutDirectionChanged : 1; ///< Whether the layout has changed.
 
 private:
   friend ControllerImplEventHandler;
index 062153d..decbfc1 100644 (file)
@@ -384,7 +384,7 @@ Controller::UpdateTextType Controller::Relayouter::Relayout(Controller& controll
     textUpdateInfo.mCharacterIndex     = 0u;
   }
 
-  if(model->mMatchSystemLanguageDirection && impl.mLayoutDirection != layoutDirection)
+  if(impl.mLayoutDirection != layoutDirection)
   {
     // Clear the update info. This info will be set the next time the text is updated.
     textUpdateInfo.mClearAll = true;
@@ -394,6 +394,7 @@ Controller::UpdateTextType Controller::Relayouter::Relayout(Controller& controll
                                                     GET_GLYPH_METRICS |
                                                     SHAPE_TEXT |
                                                     UPDATE_DIRECTION |
+                                                    ALIGN |
                                                     LAYOUT |
                                                     BIDI_INFO |
                                                     REORDER);
@@ -622,7 +623,7 @@ bool Controller::Relayouter::DoRelayout(Controller& controller, const Size& size
                              lines,
                              impl.mModel->mAlignmentOffset,
                              impl.mLayoutDirection,
-                             impl.mModel->mMatchSystemLanguageDirection);
+                             (impl.mModel->mMatchLayoutDirection != DevelText::MatchLayoutDirection::CONTENTS));
 
     viewUpdated = true;
   }
index b2b6550..d78f275 100644 (file)
@@ -19,6 +19,8 @@
 #include <dali-toolkit/internal/text/text-controller.h>
 
 // EXTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/integration-api/debug.h>
 #include <memory.h>
 #include <cmath>
@@ -382,14 +384,19 @@ void Controller::SetIgnoreSpacesAfterText(bool ignore)
   mImpl->mModel->mIgnoreSpacesAfterText = ignore;
 }
 
-bool Controller::IsMatchSystemLanguageDirection() const
+void Controller::ChangedLayoutDirection()
 {
-  return mImpl->mModel->mMatchSystemLanguageDirection;
+  mImpl->mIsLayoutDirectionChanged = true;
 }
 
-void Controller::SetMatchSystemLanguageDirection(bool match)
+void Controller::SetMatchLayoutDirection(DevelText::MatchLayoutDirection type)
 {
-  mImpl->mModel->mMatchSystemLanguageDirection = match;
+  mImpl->mModel->mMatchLayoutDirection = type;
+}
+
+DevelText::MatchLayoutDirection Controller::GetMatchLayoutDirection() const
+{
+  return mImpl->mModel->mMatchLayoutDirection;
 }
 
 void Controller::SetLayoutDirection(Dali::LayoutDirection::Type layoutDirection)
@@ -397,6 +404,19 @@ void Controller::SetLayoutDirection(Dali::LayoutDirection::Type layoutDirection)
   mImpl->mLayoutDirection = layoutDirection;
 }
 
+Dali::LayoutDirection::Type Controller::GetLayoutDirection(Dali::Actor& actor) const
+{
+  if(mImpl->mModel->mMatchLayoutDirection == DevelText::MatchLayoutDirection::LOCALE ||
+     (mImpl->mModel->mMatchLayoutDirection == DevelText::MatchLayoutDirection::INHERIT && !mImpl->mIsLayoutDirectionChanged))
+  {
+    return static_cast<Dali::LayoutDirection::Type>(DevelWindow::Get(actor).GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
+  }
+  else
+  {
+    return static_cast<Dali::LayoutDirection::Type>(actor.GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
+  }
+}
+
 bool Controller::IsShowingRealText() const
 {
   return mImpl->IsShowingRealText();
index 0802a77..5c1c9e2 100644 (file)
@@ -1441,24 +1441,36 @@ public: // Queries & retrieves.
   void SetIgnoreSpacesAfterText(bool ignore);
 
   /**
-   * @brief Retrieves matchSystemLanguageDirection value from model
-   * @return The value of matchSystemLanguageDirection
+   * @brief Sets SetMatchLayoutDirection value to model
+   * @param[in] match The value of matchLayoutDirection for the text
    */
-  bool IsMatchSystemLanguageDirection() const;
+  void SetMatchLayoutDirection(DevelText::MatchLayoutDirection type);
 
   /**
-   * @brief Sets matchSystemLanguageDirection value to model
-   * @param[in] match The value of matchSystemLanguageDirection for the text
+   * @brief Retrieves matchLayoutDirection value from model
+   * @return The value of matchLayoutDirection
    */
-  void SetMatchSystemLanguageDirection(bool match);
+  DevelText::MatchLayoutDirection GetMatchLayoutDirection() const;
 
   /**
-   * @brief Sets layoutDirection value
-   * @param[in] layoutDirection The value of system language direction
+   * @brief Sets layoutDirection type value.
+   * @param[in] layoutDirection The value of the layout direction type.
    */
   void SetLayoutDirection(Dali::LayoutDirection::Type layoutDirection);
 
   /**
+   * @brief Gets layoutDirection type value.
+   * @param[in] actor The actor which will get the layout direction type.
+   * @return The value of the layout direction type.
+   */
+  Dali::LayoutDirection::Type GetLayoutDirection(Dali::Actor& actor) const;
+
+  /**
+   * @brief Sets the layout direction changed.
+   */
+  void ChangedLayoutDirection();
+
+  /**
    * @brief Retrieves if showing real text or not.
    * @return The value of showing real text.
    */
index 3868979..afc9ed0 100644 (file)
@@ -129,7 +129,7 @@ const ColorIndex* const Model::GetBackgroundColorIndices() const
 
 bool const Model::IsMarkupBackgroundColorSet() const
 {
-  return (mVisualModel->mBackgroundColorIndices.Count() > 0);
+  return (mVisualModel->mBackgroundColors.Count() > 0);
 }
 
 const Vector4& Model::GetDefaultColor() const
@@ -229,14 +229,17 @@ Model::Model()
   mAlignmentOffset(0.0f),
   mElideEnabled(false),
   mIgnoreSpacesAfterText(true),
-  mMatchSystemLanguageDirection(true)
+  mMatchLayoutDirection(DevelText::MatchLayoutDirection::INHERIT)
 {
   mLogicalModel = LogicalModel::New();
   mVisualModel  = VisualModel::New();
 
   // Check environment variable for DALI_MATCH_SYSTEM_LANGUAGE_DIRECTION
-  auto match                    = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_MATCH_SYSTEM_LANGUAGE_DIRECTION);
-  mMatchSystemLanguageDirection = match ? (std::atoi(match) == 0 ? false : true) : mMatchSystemLanguageDirection;
+  auto match = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_MATCH_SYSTEM_LANGUAGE_DIRECTION);
+  if(match && (std::atoi(match) == 0))
+  {
+    mMatchLayoutDirection = DevelText::MatchLayoutDirection::CONTENTS;
+  }
 }
 
 Model::~Model()
index 751f230..139b8a3 100644 (file)
@@ -257,16 +257,16 @@ public:
    * 0,0 means that the top-left corner of the layout matches the top-left corner of the UI control.
    * Typically this will have a negative value with scrolling occurs.
    */
-  Vector2                                mScrollPosition;                   ///< The text is offset by this position when scrolling.
-  Vector2                                mScrollPositionLast;               ///< The last offset value of mScrollPosition
-  HorizontalAlignment::Type              mHorizontalAlignment;              ///< The layout's horizontal alignment.
-  VerticalAlignment::Type                mVerticalAlignment;                ///< The layout's vertical alignment.
-  DevelText::VerticalLineAlignment::Type mVerticalLineAlignment;            ///< The layout's vertical line alignment.
-  Text::LineWrap::Mode                   mLineWrapMode;                     ///< The text wrap mode
-  float                                  mAlignmentOffset;                  ///< The alignment offset.
-  bool                                   mElideEnabled : 1;                 ///< Whether the text's elide is enabled.
-  bool                                   mIgnoreSpacesAfterText : 1;        ///< Whether ignoring spaces after text or not. Default is true.
-  bool                                   mMatchSystemLanguageDirection : 1; ///< Whether match align for system language direction or not. Default is false.
+  Vector2                                mScrollPosition;            ///< The text is offset by this position when scrolling.
+  Vector2                                mScrollPositionLast;        ///< The last offset value of mScrollPosition
+  HorizontalAlignment::Type              mHorizontalAlignment;       ///< The layout's horizontal alignment.
+  VerticalAlignment::Type                mVerticalAlignment;         ///< The layout's vertical alignment.
+  DevelText::VerticalLineAlignment::Type mVerticalLineAlignment;     ///< The layout's vertical line alignment.
+  Text::LineWrap::Mode                   mLineWrapMode;              ///< The text wrap mode
+  float                                  mAlignmentOffset;           ///< The alignment offset.
+  bool                                   mElideEnabled : 1;          ///< Whether the text's elide is enabled.
+  bool                                   mIgnoreSpacesAfterText : 1; ///< Whether ignoring spaces after text or not. Default is true.
+  DevelText::MatchLayoutDirection        mMatchLayoutDirection;      ///< Whether to match text alignment with layout direction or not.
 };
 
 } // namespace Text
index 74a83f5..8439927 100644 (file)
@@ -347,7 +347,7 @@ bool const View::IsMarkupBackgroundColorSet() const
 {
   if(mImpl->mVisualModel)
   {
-    return (mImpl->mVisualModel->mBackgroundColorIndices.Count() > 0);
+    return (mImpl->mVisualModel->mBackgroundColors.Count() > 0);
   }
 
   return false;
index 870ac09..19ecb5c 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/image-loading.h>
-#include <dali/devel-api/adaptor-framework/window-devel.h>
 #include <dali/devel-api/images/pixel-data-devel.h>
 #include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
@@ -474,15 +473,7 @@ void TextVisual::UpdateRenderer()
     return;
   }
 
-  Dali::LayoutDirection::Type layoutDirection;
-  if(mController->IsMatchSystemLanguageDirection())
-  {
-    layoutDirection = static_cast<Dali::LayoutDirection::Type>(DevelWindow::Get(control).GetRootLayer().GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
-  }
-  else
-  {
-    layoutDirection = static_cast<Dali::LayoutDirection::Type>(control.GetProperty(Dali::Actor::Property::LAYOUT_DIRECTION).Get<int>());
-  }
+  Dali::LayoutDirection::Type layoutDirection = mController->GetLayoutDirection(control);
 
   const Text::Controller::UpdateTextType updateTextType = mController->Relayout(relayoutSize, layoutDirection);
 
index 02d0628..e63d53f 100644 (file)
@@ -29,7 +29,7 @@ namespace Toolkit
 {
 const unsigned int TOOLKIT_MAJOR_VERSION = 2;
 const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 33;
+const unsigned int TOOLKIT_MICRO_VERSION = 34;
 const char* const  TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index d4c7bdc..5b056cb 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    2.0.33
+Version:    2.0.34
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT