DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() );
END_TEST;
}
+
+int UtcDaliBloomCopyAndAssignment(void)
+{
+ ToolkitTestApplication application;
+
+ BloomView view = Toolkit::BloomView::New();
+ DALI_TEST_CHECK( view );
+
+ BloomView copy( view );
+ DALI_TEST_CHECK( view == copy );
+
+ BloomView assign;
+ DALI_TEST_CHECK( ! assign );
+
+ assign = copy;
+ DALI_TEST_CHECK( assign == view );
+
+ END_TEST;
+}
+
+int UtcDaliBloomTypeRegistry(void)
+{
+ ToolkitTestApplication application;
+
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+ DALI_TEST_CHECK( typeRegistry );
+
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( "BloomView" );
+ DALI_TEST_CHECK( typeInfo );
+
+ BaseHandle handle = typeInfo.CreateInstance();
+ DALI_TEST_CHECK( handle );
+
+ BloomView view = BloomView::DownCast( handle );
+ DALI_TEST_CHECK( view );
+
+ END_TEST;
+}
+
+int UtcDaliBloomOnSizeSet(void)
+{
+ ToolkitTestApplication application;
+
+ BloomView view = Toolkit::BloomView::New();
+
+ Stage::GetCurrent().Add( view );
+
+ application.SendNotification();
+ application.Render();
+
+ Vector3 size( 200.0f, 300.0f, 200.0f );
+ view.SetSize( size );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( view.GetCurrentSize(), size, TEST_LOCATION );
+
+ END_TEST;
+}
#include <iostream>
#include <stdlib.h>
+#include <sstream>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
END_TEST;
}
+
+int UtcDaliTableViewGetChildAtN(void)
+{
+ ToolkitTestApplication application;
+
+ TableView tableView = TableView::New(10,10);
+
+ Actor actor = tableView.GetChildAt( TableView::CellPosition( 200, 200 ) );
+ DALI_TEST_CHECK( !actor );
+
+ END_TEST;
+}
+
+int UtcDaliTableViewAddChildN(void)
+{
+ ToolkitTestApplication application;
+
+ TableView tableView = TableView::New(10,10);
+ DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 ) ) );
+ DALI_TEST_CHECK( ! tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 ) ) );
+
+ END_TEST;
+}
+
+int UtcDaliTableViewInsertRowAtZero(void)
+{
+ ToolkitTestApplication application;
+
+ TableView tableView = TableView::New(10,10);
+ DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
+ tableView.InsertRow(0);
+
+ DALI_TEST_CHECK( tableView.GetRows() == 11 );
+
+ END_TEST;
+}
+
+int UtcDaliTableViewDeleteRowAtZero(void)
+{
+ ToolkitTestApplication application;
+
+ TableView tableView = TableView::New(10,10);
+ DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
+ tableView.DeleteRow(0);
+
+ DALI_TEST_CHECK( tableView.GetRows() == 9 );
+
+ END_TEST;
+}
+
+int UtcDaliTableViewInsertColumnAtZero(void)
+{
+ ToolkitTestApplication application;
+
+ TableView tableView = TableView::New(10,10);
+ DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
+ tableView.InsertColumn(0);
+
+ DALI_TEST_CHECK( tableView.GetColumns() == 11 );
+
+ END_TEST;
+}
+
+int UtcDaliTableViewDeleteColumnAtZero(void)
+{
+ ToolkitTestApplication application;
+
+ TableView tableView = TableView::New(10,10);
+ DALI_TEST_CHECK( tableView.AddChild( Actor::New(), TableView::CellPosition( 0, 0 , 10, 10 ) ) );
+ tableView.DeleteColumn(0);
+
+ DALI_TEST_CHECK( tableView.GetColumns() == 9 );
+
+ END_TEST;
+}
+
+int UtcDaliTableViewTypeRegistry(void)
+{
+ ToolkitTestApplication application;
+
+ TypeRegistry typeRegistry = TypeRegistry::Get();
+ DALI_TEST_CHECK( typeRegistry );
+
+ TypeInfo typeInfo = typeRegistry.GetTypeInfo( "TableView" );
+ DALI_TEST_CHECK( typeInfo );
+
+ BaseHandle handle = typeInfo.CreateInstance();
+ DALI_TEST_CHECK( handle );
+
+ TableView view = TableView::DownCast( handle );
+ DALI_TEST_CHECK( view );
+
+ END_TEST;
+}
+
+int UtcDaliTableViewKeyboardFocus(void)
+{
+ ToolkitTestApplication application;
+
+ TableView tableView = TableView::New(4,4);
+ tableView.SetKeyboardFocusable( true );
+ tableView.SetName( "TableView");
+
+ for ( int row = 0; row < 4; ++row )
+ {
+ for ( int col = 0; col < 4; ++col )
+ {
+ Control control = Control::New();
+ std::ostringstream str;
+ str << row << "-" << col;
+ control.SetName( str.str() );
+ control.SetKeyboardFocusable( true );
+ tableView.AddChild( control, TableView::CellPosition( row, col ) );
+ }
+ }
+
+ Stage::GetCurrent().Add( tableView );
+
+ application.SendNotification();
+ application.Render();
+
+ Actor firstFocusActor = Toolkit::Internal::GetImplementation( tableView ).GetNextKeyboardFocusableActor( Actor(), Control::KeyboardFocus::RIGHT, true );
+ DALI_TEST_CHECK( firstFocusActor );
+ DALI_TEST_CHECK( firstFocusActor.GetName() == "0-0" );
+
+ KeyboardFocusManager manager = KeyboardFocusManager::Get();
+ manager.SetFocusGroupLoop( true );
+ manager.SetCurrentFocusActor( firstFocusActor );
+
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-0" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-2" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-3" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-0" );
+
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-3" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-2" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-0" );
+ manager.MoveFocus( Control::KeyboardFocus::LEFT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "3-3" );
+
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-0" );
+ manager.MoveFocus( Control::KeyboardFocus::RIGHT );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
+
+ manager.MoveFocus( Control::KeyboardFocus::DOWN );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1" );
+ manager.MoveFocus( Control::KeyboardFocus::DOWN );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-1" );
+ manager.MoveFocus( Control::KeyboardFocus::DOWN );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "3-1" );
+ manager.MoveFocus( Control::KeyboardFocus::DOWN );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
+
+ manager.MoveFocus( Control::KeyboardFocus::UP );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "3-1" );
+ manager.MoveFocus( Control::KeyboardFocus::UP );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "2-1" );
+ manager.MoveFocus( Control::KeyboardFocus::UP );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "1-1" );
+ manager.MoveFocus( Control::KeyboardFocus::UP );
+ DALI_TEST_CHECK( manager.GetCurrentFocusActor().GetName() == "0-1" );
+
+ END_TEST;
+}
return script;
}
-/**
- * @brief Whether the character is valid for all scripts. i.e. the white space.
- *
- * @param[in] character The character.
- *
- * @return @e true if the character is valid for all scripts.
- */
-bool IsValidForAllScripts( Character character )
-{
- return ( TextAbstraction::IsWhiteSpace( character ) ||
- TextAbstraction::IsZeroWidthNonJoiner( character ) ||
- TextAbstraction::IsZeroWidthJoiner( character ) ||
- TextAbstraction::IsZeroWidthSpace( character ) ||
- TextAbstraction::IsLeftToRightMark( character ) ||
- TextAbstraction::IsRightToLeftMark( character ) ||
- TextAbstraction::IsThinSpace( character ) );
-}
-
bool ValidateFontsPerScript::FindValidFont( FontId fontId ) const
{
for( Vector<FontId>::ConstIterator it = mValidFonts.Begin(),
// Skip those characters valid for many scripts like white spaces or '\n'.
bool endOfText = index == numberOfCharacters;
while( !endOfText &&
- IsValidForAllScripts( character ) )
+ TextAbstraction::IsCommonScript( character ) )
{
// Count all these characters to be added into a script.
++numberOfAllScriptCharacters;
const Vector<ScriptRun>& scripts,
Vector<FontRun>& fonts )
{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->MultilanguageSupport::ValidateFonts\n" );
const Length numberOfCharacters = text.Count();
if( 0u == numberOfCharacters )
{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--MultilanguageSupport::ValidateFonts\n" );
// Nothing to do if there are no characters.
return;
}
scriptRunIt,
scriptRunEndIt );
+#ifdef DEBUG_ENABLED
+ {
+ Dali::TextAbstraction::FontDescription description;
+ fontClient.GetDescription( fontId, description );
+
+ DALI_LOG_INFO( gLogFilter,
+ Debug::Verbose,
+ " Initial font set\n Character : %x, Script : %s, Font : %s \n",
+ character,
+ Dali::TextAbstraction::ScriptName[script],
+ description.path.c_str() );
+ }
+#endif
+
if( TextAbstraction::UNKNOWN == script )
{
DALI_LOG_WARNING( "MultilanguageSupport::ValidateFonts. Unknown script!" );
// Whether the font being validated is a default one not set by the user.
const bool isDefault = ( 0u == fontId );
+ DALI_LOG_INFO( gLogFilter,
+ Debug::Verbose,
+ " Is a default font : %s\n",
+ ( isDefault ? "true" : "false" ) );
+
// The default font point size.
PointSize26Dot6 pointSize = TextAbstraction::FontClient::DEFAULT_POINT_SIZE;
else
{
// Add the font to the valid font cache.
+
+ // At this point the validated font supports the given character. However, characters
+ // common for all scripts, like white spaces or new paragraph characters, need to be
+ // processed differently.
+ //
+ // i.e. A white space can have assigned a DEVANAGARI script but the font assigned may not
+ // support none of the DEVANAGARI glyphs. This font can't be added to the cache as a valid
+ // font for the DEVANAGARI script but the COMMON one.
+ if( TextAbstraction::IsCommonScript( character ) )
+ {
+ validateFontsPerScript = *( validFontsPerScriptCacheBuffer + TextAbstraction::COMMON );
+
+ if( NULL == validateFontsPerScript )
+ {
+ validateFontsPerScript = new ValidateFontsPerScript();
+
+ *( validFontsPerScriptCacheBuffer + TextAbstraction::COMMON ) = validateFontsPerScript;
+ }
+ }
+
validateFontsPerScript->mValidFonts.PushBack( fontId );
}
}
fontId = fontClient.FindDefaultFont( UTF32_A, pointSize );
}
-#ifdef DEBUG_ENABLED
- Dali::TextAbstraction::FontDescription description;
- fontClient.GetDescription( fontId, description );
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "Script: %s; Selected font: %s\n", Dali::TextAbstraction::ScriptName[script], description.path.c_str() );
-#endif
// Cache the font.
*( defaultFontPerScriptCacheBuffer + script ) = fontId;
}
}
+#ifdef DEBUG_ENABLED
+ {
+ Dali::TextAbstraction::FontDescription description;
+ fontClient.GetDescription( fontId, description );
+ DALI_LOG_INFO( gLogFilter,
+ Debug::Verbose,
+ " Validated font set\n Character : %x, Script : %s, Font : %s \n",
+ character,
+ Dali::TextAbstraction::ScriptName[script],
+ description.path.c_str() );
+ }
+#endif
+
// The font is now validated.
if( ( fontId != currentFontRun.fontId ) ||
// Store the last run.
fonts.PushBack( currentFontRun );
}
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--MultilanguageSupport::ValidateFonts\n" );
}
void MultilanguageSupport::ValidateFonts( LogicalModel& model,