Merge "Add move semantics to toolkit Window" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 6 Aug 2020 16:01:12 +0000 (16:01 +0000)
committerGerrit Code Review <gerrit@review>
Thu, 6 Aug 2020 16:01:12 +0000 (16:01 +0000)
dali-toolkit/devel-api/controls/control-depth-index-ranges.h
dali-toolkit/devel-api/text/text-utils-devel.cpp
dali-toolkit/devel-api/text/text-utils-devel.h
docs/content/main.md

index 6c4ed30..f1bb8c3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_DEVEL_CONTROL_DEPTH_INDEX_RANGES_H
 
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/common/compile-time-assert.h>
 #include <dali/devel-api/actors/layer-devel.h>
 
 namespace Dali
@@ -48,11 +47,11 @@ enum Ranges
   FOREGROUND_EFFECT =  2 * DevelLayer::SIBLING_ORDER_MULTIPLIER/100
 };
 
-DALI_COMPILE_TIME_ASSERT( (unsigned int)DevelLayer::ACTOR_DEPTH_MULTIPLIER > (unsigned int)DevelLayer::SIBLING_ORDER_MULTIPLIER );
-DALI_COMPILE_TIME_ASSERT( BACKGROUND_EFFECT < BACKGROUND );
-DALI_COMPILE_TIME_ASSERT( BACKGROUND < CONTENT );
-DALI_COMPILE_TIME_ASSERT( CONTENT < DECORATION );
-DALI_COMPILE_TIME_ASSERT( DECORATION < FOREGROUND_EFFECT );
+static_assert( (unsigned int)DevelLayer::ACTOR_DEPTH_MULTIPLIER > (unsigned int)DevelLayer::SIBLING_ORDER_MULTIPLIER );
+static_assert( BACKGROUND_EFFECT < BACKGROUND );
+static_assert( BACKGROUND < CONTENT );
+static_assert( CONTENT < DECORATION );
+static_assert( DECORATION < FOREGROUND_EFFECT );
 
 } // namespace DepthIndex
 
index c39cb21..c3ca9fb 100755 (executable)
@@ -147,7 +147,6 @@ bool GetCircularAlignmentEnumeration(const Property::Value& propertyValue, Devel
   return Scripting::GetEnumerationProperty(propertyValue, CIRCULAR_ALIGNMENT_TYPE_TABLE, CIRCULAR_ALIGNMENT_TYPE_TABLE_COUNT, circularAlignment);
 }
 
-
 void ShapeTextPreprocess( const RendererParameters& textParameters, TextAbstraction::TextRenderer::Parameters& rendererParameters, InternalDataModel& internalDataModel )
 {
 
@@ -1001,6 +1000,9 @@ Size LayoutText( const RendererParameters& textParameters, TextAbstraction::Text
   const Text::Layout::Engine::Type horizontalLayout = ( Layout::MULTILINE == layout ) ? Text::Layout::Engine::MULTI_LINE_BOX : Text::Layout::Engine::SINGLE_LINE_BOX;
   layoutEngine.SetLayout( horizontalLayout ); // TODO: multi-line.
 
+  // Set minimun line size
+  layoutEngine.SetDefaultLineSize( textParameters.minLineSize );
+
   // Whether the layout is circular.
   const bool isCircularTextLayout = (Layout::CIRCULAR == layout);
   const bool isClockwise = isCircularTextLayout && ( 0.f < textParameters.incrementAngle );
@@ -1536,12 +1538,16 @@ Dali::Property::Array RenderForLastIndex( RendererParameters& textParameters )
   unsigned int numberOfLines = lines.Count();
   int numberOfCharacters = 0;
   float penY = 0.f;
+  float lineSize = internalData.layoutEngine.GetDefaultLineSize();
+  float lineOffset = 0.f;
   for( unsigned int index = 0u; index < numberOfLines; ++index  )
   {
     const LineRun& line = *( lines.Begin() + index );
     numberOfCharacters += line.characterRun.numberOfCharacters;
-    penY += ( line.ascender + -line.descender );
-    if( ( penY + ( line.ascender + -line.descender ) ) > boundingBox )
+
+    lineOffset = lineSize > 0.f ? lineSize : ( line.ascender + -line.descender );
+    penY += lineOffset;
+    if( ( penY + lineOffset ) > boundingBox )
     {
       offsetValues.PushBack( numberOfCharacters );
       penY = 0.f;
index 0670e8e..3440621 100755 (executable)
@@ -57,7 +57,8 @@ struct DALI_TOOLKIT_API RendererParameters
     incrementAngle{ 0.f },
     ellipsisEnabled{ true },
     markupEnabled{ false },
-    isTextColorSet{ false }
+    isTextColorSet{ false },
+    minLineSize{ 0.f }
   {}
 
   std::string text;                ///< The text to be rendered encoded in utf8.
@@ -86,6 +87,8 @@ struct DALI_TOOLKIT_API RendererParameters
   bool ellipsisEnabled:1;          ///< Whether the ellipsis layout option is enabled.
   bool markupEnabled:1;            ///< Whether the mark-up processor is enabled.
   bool isTextColorSet:1;           ///< Whether a default color has been set.
+
+  float minLineSize;               ///< The line's minimum size (in points).
 };
 
 /**
index b54806b..2bc8bdd 100644 (file)
@@ -1,4 +1,4 @@
-# DALi Introduction ajskdfajksd fhksja
+# DALi Introduction
 
 ### Introduction
  + [What is DALi?](@ref dali-introduction)