[dali_1.4.10] Merge branch 'devel/master' 20/201120/1
authorDaniel McEwen <d.mcewen@partner.samsung.com>
Fri, 8 Mar 2019 11:30:13 +0000 (11:30 +0000)
committerDaniel McEwen <d.mcewen@partner.samsung.com>
Fri, 8 Mar 2019 11:30:13 +0000 (11:30 +0000)
Change-Id: Iffdf85091d24e030653d8bebd8f195213e1abd7a

12 files changed:
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Shaping.cpp
automated-tests/src/dali-toolkit/utc-Dali-GridLayout.cpp
dali-toolkit/internal/feedback/feedback-style.cpp
dali-toolkit/internal/feedback/feedback-style.h
dali-toolkit/internal/layouting/grid-impl.cpp
dali-toolkit/internal/layouting/grid-locations.cpp
dali-toolkit/internal/layouting/grid-locations.h
dali-toolkit/internal/text/character-run.h
dali-toolkit/internal/text/font-description-run.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index b26d11b..9a7bf3f 100755 (executable)
@@ -551,15 +551,15 @@ int UtcDaliTextSoftwareStyling(void)
 
   struct GlyphInfoData glyphs01[] =
   {
-    { 2u, 4857u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, true, true },
-    { 2u, 7316u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, true, true },
-    { 2u, 4364u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, true, true },
+    { 2u, 21154u, 0.f, 0.f, 0.f, 0.f, 16.f, 0.f, true, true },
+    { 2u, 12298, 0.f, 0.f, 0.f, 0.f, 16.f, 0.f, true, true },
+    { 2u, 17828u, 0.f, 0.f, 0.f, 0.f, 16.f, 0.f, true, true },
   };
   struct GlyphInfoData glyphs02[] =
   {
-    { 2u, 4857u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, false, false },
-    { 2u, 7316u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, false, true },
-    { 2u, 4364u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, true,  false },
+    { 2u, 21154u, 0.f, 0.f, 0.f, 0.f, 16.f, 0.f, false, false },
+    { 2u, 12298, 0.f, 0.f, 0.f, 0.f, 16.f, 0.f, false, true },
+    { 2u, 17828u, 0.f, 0.f, 0.f, 0.f, 16.f, 0.f, true,  false },
   };
 
   CharacterIndex characterIndices[] = { 0u, 1u, 2u };
index 224c6f4..9438589 100644 (file)
@@ -44,6 +44,44 @@ void utc_dali_toolkit_grid_layouting_cleanup(void)
   test_return_value = TET_PASS;
 }
 
+int UtcDaliLayouting_GridLayout00(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliLayouting_GridLayout00 1 Column, 0 Items");
+
+  const auto NUMBER_OF_COLUMNS = 1;
+  const auto NUMBER_OF_ITEMS = 0;
+
+  tet_printf( "Testing %d columns with %d items\n", NUMBER_OF_COLUMNS, NUMBER_OF_ITEMS );
+
+  Stage stage = Stage::GetCurrent();
+
+  auto rootControl = Control::New();
+  auto absoluteLayout = AbsoluteLayout::New();
+  DevelControl::SetLayout( rootControl, absoluteLayout );
+  rootControl.SetName( "AbsoluteLayout" );
+  stage.Add( rootControl );
+
+  auto gridContainer = Control::New();
+  auto gridLayout = Grid::New();
+  gridLayout.SetNumberOfColumns( NUMBER_OF_COLUMNS );
+  gridContainer.SetName( "GridLayout");
+  DevelControl::SetLayout( gridContainer, gridLayout );
+  gridContainer.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
+  gridContainer.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  ChildLayoutData::WRAP_CONTENT );
+
+  rootControl.Add( gridContainer );
+
+  // Ensure layouting happens
+  application.SendNotification();
+  application.Render();
+
+  tet_printf( "Confirm number of columns is as set\n");
+  DALI_TEST_EQUALS( gridLayout.GetNumberOfColumns(), NUMBER_OF_COLUMNS, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliLayouting_GridLayout01(void)
 {
   ToolkitTestApplication application;
@@ -627,4 +665,4 @@ int UtcDaliLayouting_GridLayoutDownCast(void)
   DALI_TEST_CHECK( gridLayoutCandidate );
 
   END_TEST;
-}
\ No newline at end of file
+}
index b3d867c..4375a29 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -307,7 +307,7 @@ void FeedbackStyle::LoadFromString( const string& data )
 
             if( signalFeedbackInfo.mHasHapticFeedbackInfo || signalFeedbackInfo.mHasSoundFeedbackInfo )
             {
-              AddSignalInfo( themeInfo, signalFeedbackInfo );
+              AddSignalInfo( themeInfo, std::move( signalFeedbackInfo ) );
             }
           }
         }
@@ -320,10 +320,10 @@ void FeedbackStyle::LoadFromString( const string& data )
 
 } // LoadFromString()
 
-void FeedbackStyle::AddSignalInfo( FeedbackStyleInfo& styleInfo, SignalFeedbackInfo signalInfo )
+void FeedbackStyle::AddSignalInfo( FeedbackStyleInfo& styleInfo, SignalFeedbackInfo&& signalInfo )
 {
   bool updated = false;
-  std::vector<SignalFeedbackInfo>::iterator iter;
+  SignalFeedbackInfoContainer::iterator iter;
 
   // If info exists for the signal then update it, else add new
   for( iter = styleInfo.mSignalFeedbackInfoList.begin(); iter != styleInfo.mSignalFeedbackInfoList.end(); ++iter )
@@ -344,7 +344,7 @@ void FeedbackStyle::AddSignalInfo( FeedbackStyleInfo& styleInfo, SignalFeedbackI
 
   if( !updated )
   {
-    styleInfo.mSignalFeedbackInfoList.push_back( signalInfo );
+    styleInfo.mSignalFeedbackInfoList.emplace_back( std::move( signalInfo ) );
   }
 }
 
index bf6ea3f..3693369 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_INTERNAL_FEEDBACK_STYLE_H__
 
 /*
- * Copyright (c) 2014 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.
@@ -121,7 +121,7 @@ private:
    * @param [in] styleInfo The information will be stored here.
    * @param [in] signalInfo The information to add.
    */
-  void AddSignalInfo( FeedbackStyleInfo& styleInfo, SignalFeedbackInfo signalInfo );
+  void AddSignalInfo( FeedbackStyleInfo& styleInfo, SignalFeedbackInfo&& signalInfo );
 
   /**
    * Map a pattern string to feedback pattern ID.
index 09224ee..b633523 100644 (file)
@@ -196,7 +196,7 @@ void Grid::OnMeasure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasureSpe
   DetermineNumberOfColumns( availableContentWidth );
 
   // Locations define the start, end,top and bottom of each cell.
-  mLocations->CalculateLocations( mNumColumns, availableContentWidth.AsInteger(), availableContentHeight.AsInteger(), childCount, 0, 0 );
+  mLocations->CalculateLocations( mNumColumns, availableContentWidth.AsInteger(), availableContentHeight.AsInteger(), childCount );
 
 
   SetMeasuredDimensions( ResolveSizeAndState( widthSize, widthMeasureSpec, MeasuredSize::State::MEASURED_SIZE_OK ),
index a4d3060..847bcc1 100644 (file)
@@ -55,9 +55,7 @@ GridLocations::~GridLocations(){}
 void GridLocations::CalculateLocations( int numberOfColumns,
                                         unsigned int availableWidth,
                                         unsigned int availableHeight,
-                                        unsigned int numberOfCells,
-                                        unsigned int columnWidth,
-                                        unsigned int rowHeight )
+                                        unsigned int numberOfCells )
 {
   DALI_ASSERT_DEBUG( numberOfColumns > 0 && "number of columns should be greater than 0" );
   numberOfColumns = std::max ( numberOfColumns, 1 );
@@ -70,30 +68,14 @@ void GridLocations::CalculateLocations( int numberOfColumns,
   // If number of cells not cleanly dividable by colums, add another row to house remainder cells.
   numberOfRows += (numberOfCells%numberOfColumns)?1:0;
 
-  unsigned int maxColumnWidth = availableWidth / numberOfColumns;
+  // Safe as numberOfColumns is guaranteed to be > 0
+  unsigned int columnWidth = availableWidth / numberOfColumns;
 
-  if( columnWidth > 0 )
-  {
-    // Column width supplied so use this unless exceeds available width.
-    columnWidth = std::min( columnWidth, maxColumnWidth );
-  }
-  else
-  {
-    // Column width not supplied so use calculated value
-    columnWidth = maxColumnWidth;
-  }
+  unsigned int rowHeight = availableHeight;
 
-  unsigned int maxRowHeight = availableHeight / numberOfRows;
-
-  if( rowHeight > 0 )
-  {
-    // Column height supplied so use this unless exceeds available height.
-    rowHeight = std::min( rowHeight, maxRowHeight );
-  }
-  else
+  if( numberOfRows > 0 )
   {
-    // Column height not supplied so use calculated value
-    rowHeight = maxRowHeight;
+    rowHeight = availableHeight / numberOfRows;
   }
 
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "ColumWidth[%d] RowHeight[%d] NumberOfRows[%d] NumberOfColumns[%d]\n",
@@ -154,4 +136,4 @@ GridLocations::LocationVector GridLocations::GetLocations()
 } // namespace Internal
 
 } // namespace Toolkit
-} // namespace Dali
\ No newline at end of file
+} // namespace Dali
index 2bc4359..afc1437 100644 (file)
@@ -73,8 +73,7 @@ public:
    * Uses the given parameters to calculate the x,y coordinates of each cell and cell size.
    */
   void CalculateLocations( int numberOfColumns, unsigned int availableWidth,
-                           unsigned int availableHeight, unsigned int numberOfCells,
-                           unsigned int columnWidth, unsigned int rowHeight );
+                           unsigned int availableHeight, unsigned int numberOfCells );
 
   LocationVector GetLocations();
 
@@ -95,4 +94,4 @@ private:
 } // namespace Toolkit
 } // namespace Dali
 
-#endif // DALI_TOOLKIT_INTERNAL_LAYOUTING_GRID_LOCATIONS_H
\ No newline at end of file
+#endif // DALI_TOOLKIT_INTERNAL_LAYOUTING_GRID_LOCATIONS_H
index 221ecbd..eb354c9 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_TEXT_CHARACTER_RUN_H__
-#define __DALI_TOOLKIT_TEXT_CHARACTER_RUN_H__
+#ifndef DALI_TOOLKIT_TEXT_CHARACTER_RUN_H
+#define DALI_TOOLKIT_TEXT_CHARACTER_RUN_H
 
 /*
- * Copyright (c) 2015 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.
@@ -35,6 +35,16 @@ namespace Text
  */
 struct CharacterRun
 {
+  CharacterRun()
+  : characterIndex{ 0u },
+    numberOfCharacters{ 0u }
+  {}
+
+  CharacterRun( CharacterIndex characterIndex, Length numberOfCharacters )
+  : characterIndex{ characterIndex },
+    numberOfCharacters{ numberOfCharacters }
+  {}
+
   CharacterIndex characterIndex;     ///< Index to the first character.
   Length         numberOfCharacters; ///< Number of characters in the run.
 };
@@ -45,4 +55,4 @@ struct CharacterRun
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_TEXT_CHARACTER_RUN_H__
+#endif // DALI_TOOLKIT_TEXT_CHARACTER_RUN_H
index ada640c..b14ab1d 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H__
-#define __DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H__
+#ifndef DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H
+#define DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H
 
 /*
- * Copyright (c) 2016 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.
@@ -39,6 +39,50 @@ namespace Text
  */
 struct FontDescriptionRun
 {
+  /**
+   * Default constructor to set the default values of bitfields
+   */
+  FontDescriptionRun()
+  : characterRun{},
+    familyName{ nullptr },
+    familyLength{ 0u },
+    weight{ FontWeight::NONE },
+    width{ FontWidth::NONE },
+    slant{ FontSlant::NONE },
+    size{ 0u },
+    familyDefined{ false },
+    weightDefined{ false },
+    widthDefined{ false },
+    slantDefined{ false },
+    sizeDefined{ false }
+  {}
+
+  FontDescriptionRun( const CharacterRun& characterRun,
+                      char* familyName,
+                      Length familyLength,
+                      FontWeight weight,
+                      FontWidth width,
+                      FontSlant slant,
+                      PointSize26Dot6 size,
+                      bool familyDefined,
+                      bool weightDefined,
+                      bool widthDefined,
+                      bool slantDefined,
+                      bool sizeDefined )
+  : characterRun{ characterRun },
+    familyName{ familyName },
+    familyLength{ familyLength },
+    weight{ weight },
+    width{ width },
+    slant{ slant },
+    size{ size },
+    familyDefined{ familyDefined },
+    weightDefined{ weightDefined },
+    widthDefined{ widthDefined },
+    slantDefined{ slantDefined },
+    sizeDefined{ sizeDefined }
+  {}
+
   CharacterRun    characterRun; ///< The initial character index and the number of characters of the run.
   char*           familyName;   ///< The font's family name.
   Length          familyLength; ///< The length of the font's family name.
@@ -47,11 +91,11 @@ struct FontDescriptionRun
   FontSlant       slant;        ///< The font's slant.
   PointSize26Dot6 size;         ///< The font's size.
 
-  bool familyDefined : 1; ///< Whether the font's family is defined.
-  bool weightDefined : 1; ///< Whether the font's weight is defined.
-  bool widthDefined  : 1; ///< Whether the font's width is defined.
-  bool slantDefined  : 1; ///< Whether the font's slant is defined.
-  bool sizeDefined   : 1; ///< Whether the font's size is defined.
+  bool familyDefined : 1;       ///< Whether the font's family is defined.
+  bool weightDefined : 1;       ///< Whether the font's weight is defined.
+  bool widthDefined  : 1;       ///< Whether the font's width is defined.
+  bool slantDefined  : 1;       ///< Whether the font's slant is defined.
+  bool sizeDefined   : 1;       ///< Whether the font's size is defined.
 };
 
 } // namespace Text
@@ -60,4 +104,4 @@ struct FontDescriptionRun
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H__
+#endif // DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H
index 6e6bfaa..5e2c35a 100755 (executable)
@@ -2626,14 +2626,19 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
     {
       DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p keyString %s\n", this, keyString.c_str() );
 
-      // InputMethodContext is no longer handling key-events
-      mImpl->ClearPreEditFlag();
+      if( !keyString.empty() )
+      {
+        // InputMethodContext is no longer handling key-events
+        mImpl->ClearPreEditFlag();
 
-      InsertText( keyString, COMMIT );
-      textChanged = true;
+        InsertText( keyString, COMMIT );
+
+        textChanged = true;
+
+        // Will request for relayout.
+        relayoutNeeded = true;
+      }
 
-      // Will request for relayout.
-      relayoutNeeded = true;
     }
 
     if ( ( mImpl->mEventData->mState != EventData::INTERRUPTED ) &&
index 51b0eb9..1fa5040 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 4;
-const unsigned int TOOLKIT_MICRO_VERSION = 9;
+const unsigned int TOOLKIT_MICRO_VERSION = 10;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 4df6e91..d8b6dd4 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.4.9
+Version:    1.4.10
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT