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 };
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;
DALI_TEST_CHECK( gridLayoutCandidate );
END_TEST;
-}
\ No newline at end of file
+}
/*
- * 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.
if( signalFeedbackInfo.mHasHapticFeedbackInfo || signalFeedbackInfo.mHasSoundFeedbackInfo )
{
- AddSignalInfo( themeInfo, signalFeedbackInfo );
+ AddSignalInfo( themeInfo, std::move( signalFeedbackInfo ) );
}
}
}
} // 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 )
if( !updated )
{
- styleInfo.mSignalFeedbackInfoList.push_back( signalInfo );
+ styleInfo.mSignalFeedbackInfoList.emplace_back( std::move( signalInfo ) );
}
}
#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.
* @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.
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 ),
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 );
// 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",
} // namespace Internal
} // namespace Toolkit
-} // namespace Dali
\ No newline at end of file
+} // namespace Dali
* 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();
} // 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
-#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.
*/
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.
};
} // namespace Dali
-#endif // __DALI_TOOLKIT_TEXT_CHARACTER_RUN_H__
+#endif // DALI_TOOLKIT_TEXT_CHARACTER_RUN_H
-#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.
*/
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.
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
} // namespace Dali
-#endif // __DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H__
+#endif // DALI_TOOLKIT_TEXT_FONT_DESCRIPTION_RUN_H
{
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 ) &&
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
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