fontDescriptions10.PushBack( fontDescription1003 );
fontDescriptions10.PushBack( fontDescription1004 );
+ FontRun fontRun1101 =
+ {
+ {
+ 0u,
+ 22u
+ },
+ 5u
+ };
+ Vector<FontRun> fontRuns11;
+ fontRuns11.PushBack( fontRun1101 );
+
+ FontDescriptionRun fontDescription1101 =
+ {
+ {
+ 0,
+ 22u
+ },
+ const_cast<char*>( "TizenSans" ),
+ 9u,
+ TextAbstraction::FontWeight::NORMAL,
+ TextAbstraction::FontWidth::NORMAL,
+ TextAbstraction::FontSlant::NORMAL,
+ pointSize02,
+ true,
+ false,
+ false,
+ false,
+ true
+ };
+ Vector<FontDescriptionRun> fontDescriptions11;
+ fontDescriptions11.PushBack( fontDescription1101 );
+
const ValidateFontsData data[] =
{
{
fontDescriptions10,
fontRuns10
},
+ {
+ "Unknown script -> changed to LATIN",
+ "WRC – The Official App",
+ "/tizen/TizenSansRegular.ttf",
+ TextAbstraction::FontClient::DEFAULT_POINT_SIZE,
+ 0u,
+ 22u,
+ fontDescriptions11,
+ fontRuns11
+ },
};
- const unsigned int numberOfTests = 10u;
+ const unsigned int numberOfTests = 11u;
for( unsigned int index = 0u; index < numberOfTests; ++index )
{
END_TEST;
}
+
+int UtcDaliPushButtonSetButtonImageDeprecatedP(void)
+{
+ ToolkitTestApplication application;
+ Image setButtonImage = ResourceImage::New( TEST_IMAGE_ONE);
+ PushButton pushButton = PushButton::New();
+ pushButton.SetButtonImage( setButtonImage );
+ Image retreivedButtonImage = ImageView::DownCast(pushButton.GetButtonImage()).GetImage();
+ DALI_TEST_EQUALS( retreivedButtonImage, setButtonImage , TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetSelectedImageDeprecatedP(void)
+{
+ ToolkitTestApplication application;
+ Image setButtonImage = ResourceImage::New( TEST_IMAGE_ONE);
+ PushButton pushButton = PushButton::New();
+ pushButton.SetSelectedImage( setButtonImage );
+ Image retreivedButtonImage = ImageView::DownCast(pushButton.GetSelectedImage()).GetImage();
+ DALI_TEST_EQUALS( retreivedButtonImage, setButtonImage , TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonGetButtonImageURLDeprecatedP(void)
+{
+ tet_infoline(" UtcDaliPushButtonGetButtonImageURLDeprecatedP Testing mix use of API");
+
+ ToolkitTestApplication application;
+
+ PushButton pushButton = PushButton::New();
+ pushButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
+
+ ImageView retreivedButtonImageView = ImageView::DownCast(pushButton.GetButtonImage());
+ Image retreivedButtonImage = retreivedButtonImageView.GetImage();
+ ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
+
+ DALI_TEST_EQUALS( resourceImage.GetUrl(), TEST_IMAGE_ONE , TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonGetSelectedImageURLDeprecatedP(void)
+{
+ tet_infoline(" UtcDaliPushButtonGetSelectedImageURLDeprecatedP Testing mix use of API");
+
+ ToolkitTestApplication application;
+
+ PushButton pushButton = PushButton::New();
+
+ pushButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
+
+ Image retreivedButtonImage = ImageView::DownCast(pushButton.GetSelectedImage()).GetImage();
+ ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
+ DALI_TEST_EQUALS( resourceImage.GetUrl(), TEST_IMAGE_ONE , TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetSelectedImageWithActorDeprecatedP(void)
+{
+ tet_infoline(" UtcDaliPushButton SetSelectedImage With ImageView (Actor)");
+
+ ToolkitTestApplication application;
+
+ Image image = ResourceImage::New( TEST_IMAGE_ONE );
+
+ DALI_TEST_CHECK( image );
+
+ ImageView imgViewSet = ImageView::New(image);
+
+ DALI_TEST_CHECK(imgViewSet );
+
+ PushButton pushButton = PushButton::New();
+
+ DALI_TEST_CHECK( pushButton );
+
+ pushButton.SetSelectedImage( imgViewSet );
+
+ ImageView imageView = ImageView::DownCast( pushButton.GetSelectedImage());
+
+ DALI_TEST_CHECK( imageView );
+
+ Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+ Property::Map map;
+ value.Get( map );
+ DALI_TEST_CHECK( !map.Empty() );
+ DALI_TEST_EQUALS( map[ "filename" ].Get<std::string>(), TEST_IMAGE_ONE , TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetButtonImageWithActorDeprecatedP(void)
+{
+ tet_infoline(" UtcDaliPushButton SetButtonImage With ImageView (Actor)");
+
+ ToolkitTestApplication application;
+
+ Image image = ResourceImage::New( TEST_IMAGE_ONE );
+
+ DALI_TEST_CHECK( image );
+
+ ImageView imgViewSet = ImageView::New(image);
+
+ DALI_TEST_CHECK(imgViewSet );
+
+ PushButton pushButton = PushButton::New();
+
+ DALI_TEST_CHECK( pushButton );
+
+ pushButton.SetButtonImage( imgViewSet );
+
+ ImageView imageView = ImageView::DownCast( pushButton.GetButtonImage());
+
+ DALI_TEST_CHECK( imageView );
+
+ Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+ Property::Map map;
+ value.Get( map );
+ DALI_TEST_CHECK( !map.Empty() );
+ DALI_TEST_EQUALS( map[ "filename" ].Get<std::string>(), TEST_IMAGE_ONE , TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetBackgroundImageWithActorDeprecatedP(void)
+{
+ tet_infoline(" UtcDaliPushButton SetBackgroundImage With ImageView (Actor)");
+
+ ToolkitTestApplication application;
+
+ Image image = ResourceImage::New( TEST_IMAGE_ONE );
+
+ DALI_TEST_CHECK( image );
+
+ ImageView imgViewSet = ImageView::New(image);
+
+ DALI_TEST_CHECK(imgViewSet );
+
+ PushButton pushButton = PushButton::New();
+
+ DALI_TEST_CHECK( pushButton );
+
+ pushButton.SetBackgroundImage( imgViewSet );
+
+ ImageView imageView = ImageView::DownCast( pushButton.GetButtonImage());
+
+ DALI_TEST_CHECK( imageView );
+
+ Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+ Property::Map map;
+ value.Get( map );
+ DALI_TEST_CHECK( !map.Empty() );
+ DALI_TEST_EQUALS( map[ "filename" ].Get<std::string>(), TEST_IMAGE_ONE , TEST_LOCATION );
+
+ END_TEST;
+}
+
+
+int UtcDaliPushButtonSetSelectedBackgroundImageWithActorDeprecatedP(void)
+{
+ tet_infoline(" UtcDaliPushButton SetSelectedBackgroundImage With ImageView (Actor)");
+
+ ToolkitTestApplication application;
+
+ Image image = ResourceImage::New( TEST_IMAGE_ONE );
+
+ DALI_TEST_CHECK( image );
+
+ ImageView imgViewSet = ImageView::New(image);
+
+ DALI_TEST_CHECK(imgViewSet );
+
+ PushButton pushButton = PushButton::New();
+
+ DALI_TEST_CHECK( pushButton );
+
+ pushButton.SetSelectedBackgroundImage( imgViewSet );
+
+ ImageView imageView = ImageView::DownCast( pushButton.GetSelectedImage());
+
+ DALI_TEST_CHECK( imageView );
+
+ Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
+ Property::Map map;
+ value.Get( map );
+ DALI_TEST_CHECK( !map.Empty() );
+ DALI_TEST_EQUALS( map[ "filename" ].Get<std::string>(), TEST_IMAGE_ONE , TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledBackgroundImageWithActorDeprecatedP(void)
+{
+ tet_infoline(" UtcDaliPushButton SetDisabledBackgroundImage With ImageView (Actor)");
+
+ ToolkitTestApplication application;
+
+ Image image = ResourceImage::New( TEST_IMAGE_ONE );
+
+ DALI_TEST_CHECK( image );
+
+ ImageView imgViewSet = ImageView::New(image);
+
+ DALI_TEST_CHECK(imgViewSet );
+
+ PushButton pushButton = PushButton::New();
+
+ DALI_TEST_CHECK( pushButton );
+
+ pushButton.SetDisabledBackgroundImage( imgViewSet );
+
+ Property::Value value = pushButton.GetProperty( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL );
+ Property::Map map;
+ value.Get( map );
+
+ Property::Value* urlValue = map.Find( ImageVisual::Property::URL );
+
+ std::string urlString;
+ urlValue->Get( urlString );
+ DALI_TEST_EQUALS( urlString , TEST_IMAGE_ONE , TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledImageWithActorDeprecatedP(void)
+{
+ tet_infoline(" UtcDaliPushButton SetDisabledImage With ImageView (Actor)");
+
+ ToolkitTestApplication application;
+
+ Image image = ResourceImage::New( TEST_IMAGE_ONE );
+
+ DALI_TEST_CHECK( image );
+
+ ImageView imgViewSet = ImageView::New(image);
+
+ DALI_TEST_CHECK(imgViewSet );
+
+ PushButton pushButton = PushButton::New();
+
+ DALI_TEST_CHECK( pushButton );
+
+ pushButton.SetDisabledImage( imgViewSet );
+
+ Property::Value value = pushButton.GetProperty( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL );
+
+ Property::Map map;
+ value.Get( map );
+
+ Property::Value* urlValue = map.Find( ImageVisual::Property::URL );
+
+ std::string urlString;
+ urlValue->Get( urlString );
+ DALI_TEST_EQUALS( urlString , TEST_IMAGE_ONE , TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledSelectedImageWithActorDeprecatedP(void)
+{
+ tet_infoline(" UtcDaliPushButton SetDisabledSelectedImage With ImageView (Actor)");
+
+ ToolkitTestApplication application;
+
+ Image image = ResourceImage::New( TEST_IMAGE_ONE );
+
+ DALI_TEST_CHECK( image );
+
+ ImageView imgViewSet = ImageView::New(image);
+
+ DALI_TEST_CHECK(imgViewSet );
+
+ PushButton pushButton = PushButton::New();
+
+ DALI_TEST_CHECK( pushButton );
+
+ pushButton.SetDisabledSelectedImage( imgViewSet );
+
+ Property::Value value = pushButton.GetProperty( Toolkit::DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL );
+
+ Property::Map map;
+ value.Get( map );
+
+ Property::Value* urlValue = map.Find( ImageVisual::Property::URL );
+
+ std::string urlString;
+ urlValue->Get( urlString );
+ DALI_TEST_EQUALS( urlString , TEST_IMAGE_ONE , TEST_LOCATION );
+
+ END_TEST;
+}
END_TEST;
}
+
+int utcDaliTextEditorUnderPropertyStringP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorUnderPropertyStringP");
+ TextEditor editor = TextEditor::New();
+ DALI_TEST_CHECK( editor );
+
+ std::string underlineSettings1( "{\"enable\":\"true\",\"color\":\"red\",\"height\":\"1\"}" );
+
+ Stage::GetCurrent().Add( editor );
+
+ editor.SetProperty( TextEditor::Property::UNDERLINE, underlineSettings1 );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::UNDERLINE ), underlineSettings1, TEST_LOCATION );
+
+ tet_infoline("Set underline settings with a map");
+ // Check the input underline property
+ Property::Map underlineMapSet;
+ Property::Map underlineMapGet;
+ underlineMapSet.Insert( "enable", "true" );
+ underlineMapSet.Insert( "color", "blue" );
+ underlineMapSet.Insert( "height", "2" );
+
+ editor.SetProperty( TextEditor::Property::UNDERLINE, underlineMapSet );
+ underlineMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::UNDERLINE );
+ DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapSet, underlineMapGet ), true, TEST_LOCATION );
+
+ tet_infoline("Set underline settings with a string");
+ editor.SetProperty( TextEditor::Property::UNDERLINE, underlineSettings1 );
+ Property::Value value = editor.GetProperty( TextEditor::Property::UNDERLINE );
+ std::string result;
+ value.Get(result);
+ DALI_TEST_EQUALS( result , underlineSettings1, TEST_LOCATION );
+
+ tet_infoline("Trying to set invalid underline settings, should not update and stay at previous settings");
+ std::string underlineSettingsVoid( "{\"enable\":\"true\",\"coooolor\":\"blue\",\"heeeight\":\"4\"}" );
+ editor.SetProperty( TextEditor::Property::UNDERLINE, underlineSettingsVoid );
+ value = editor.GetProperty( TextEditor::Property::UNDERLINE );
+ value.Get(result);
+ DALI_TEST_EQUALS( result , underlineSettings1, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int utcDaliTextEditorShadowPropertyStringP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" utcDaliTextEditorUnderPropertyStringP Setting Shadow propeties by string");
+
+ TextEditor editor = TextEditor::New();
+
+ std::string shadowSettings( "{\"color\":\"green\",\"offset\":\"2 2\"}" );
+
+ Stage::GetCurrent().Add( editor );
+
+ editor.SetProperty( TextEditor::Property::SHADOW, "{\"color\":\"green\",\"offset\":\"2 2\"}" );
+
+ Property::Value value = editor.GetProperty<std::string>( TextEditor::Property::SHADOW );
+ std::string result;
+ value.Get(result);
+
+ DALI_TEST_EQUALS( result, shadowSettings, TEST_LOCATION );
+
+ END_TEST;
+}
const char* const PROPERTY_NAME_PIXEL_SIZE = "pixelSize";
const char* const PROPERTY_NAME_ELLIPSIS = "ellipsis";
+const char* const PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY = "autoScrollLoopDelay";
const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
const std::string DEFAULT_FONT_DIR( "/resources/fonts" );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_OUTLINE ) == TextLabel::Property::OUTLINE );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == DevelTextLabel::Property::PIXEL_SIZE );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS ) == DevelTextLabel::Property::ELLIPSIS );
+ DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY ) == DevelTextLabel::Property::AUTO_SCROLL_LOOP_DELAY );
END_TEST;
}
const int SCROLL_SPEED = 80;
const int SCROLL_LOOPS = 4;
const float SCROLL_GAP = 50.0f;
+ const float SCROLL_LOOP_DELAY = 0.3f;
+ const std::string STOP_IMMEDIATE = std::string( "IMMEDIATE" );
+ const std::string STOP_FINISH_LOOP = std::string( "FINISH_LOOP" );
+
label.SetProperty( TextLabel::Property::MULTI_LINE, false ); // Autoscroll only supported in single line
DALI_TEST_CHECK( !label.GetProperty<bool>( TextLabel::Property::ENABLE_AUTO_SCROLL ) );
label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
DALI_TEST_EQUALS( SCROLL_LOOPS, label.GetProperty<int>( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT ), TEST_LOCATION );
label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, SCROLL_GAP );
DALI_TEST_EQUALS( SCROLL_GAP, label.GetProperty<float>( TextLabel::Property::AUTO_SCROLL_GAP ), TEST_LOCATION );
+ label.SetProperty(DevelTextLabel::Property::AUTO_SCROLL_LOOP_DELAY, SCROLL_LOOP_DELAY );
+ DALI_TEST_EQUALS( SCROLL_LOOP_DELAY, label.GetProperty<float>( DevelTextLabel::Property::AUTO_SCROLL_LOOP_DELAY ), TEST_LOCATION );
+
+ //Check autoscroll stop type property
+ label.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE );
+ DALI_TEST_EQUALS( STOP_IMMEDIATE, label.GetProperty<std::string>( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE ), TEST_LOCATION );
+
+ label.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP );
+ DALI_TEST_EQUALS( STOP_FINISH_LOOP, label.GetProperty<std::string>( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE ), TEST_LOCATION );
+
// Check the line spacing property
DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::LINE_SPACING ), 0.0f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
{
ToolkitTestApplication application;
tet_infoline(" UtcDaliToolkitTextLabelScrollingP");
- TextLabel label = TextLabel::New("Some text to scroll");
- DALI_TEST_CHECK( label );
+ TextLabel labelImmediate = TextLabel::New("Some text to scroll");
+ TextLabel labelFinished = TextLabel::New("Some text to scroll");
+
+ DALI_TEST_CHECK( labelImmediate );
+ DALI_TEST_CHECK( labelFinished );
// Avoid a crash when core load gl resources.
application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
- Stage::GetCurrent().Add( label );
+ Stage::GetCurrent().Add( labelImmediate );
// Turn on all the effects
- label.SetProperty( TextLabel::Property::MULTI_LINE, false );
- label.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
- label.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
- label.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+ labelImmediate.SetProperty( TextLabel::Property::MULTI_LINE, false );
+ labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+ labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+ labelImmediate.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+ labelImmediate.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE );
+
+ Stage::GetCurrent().Add( labelFinished );
+ // Turn on all the effects
+ labelFinished.SetProperty( TextLabel::Property::MULTI_LINE, false );
+ labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+ labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+ labelFinished.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+ labelFinished.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP );
+
+
try
{
// Render some text with the shared atlas backend
- label.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+ labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+ labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
application.SendNotification();
application.Render();
+
+ labelImmediate.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+ labelFinished.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+ application.SendNotification();
+ application.Render();
+
}
catch( ... )
{
* @details name "ellipsis", type bool
*/
ELLIPSIS = OUTLINE + 2,
+
+ /**
+ * @brief delay starting time of auto scrolling and further loops
+ * @details name "autoScrollLoopDelay", type float.
+ */
+ AUTO_SCROLL_LOOP_DELAY = OUTLINE + 3,
+
+ /**
+ * @brief Auto scrolling stop behaviour.
+ * @details name "autoScrollStopMode", type [Type](@ref Dali::Toolkit::DevelTextLabel::AutoScrollStopMode::Type) (Property::INTEGER) or Property::STRING.
+ * values FINISH_LOOP, IMMEDIATE, defualt FINISH_LOOP
+ */
+ AUTO_SCROLL_STOP_MODE = OUTLINE + 4,
};
} // namespace Property
+/**
+* @brief The type for TextLabel::Property::AUTO_SCROLL_STOP_MODE
+*/
+namespace AutoScrollStopMode
+{
+/**
+* @ref Dali::Toolkit::DevelTextLabel::AutoScrollStopMode
+*/
+enum Type
+{
+ FINISH_LOOP = 0, ///< stop animation after current loop finished.
+ IMMEDIATE ///< stop animation immediatly and reset position.
+};
+} // namespace AutoScrollStopMode
+
} // namespace DevelText
} // namespace Toolkit
{
DALI_LOG_WARNING("Button::SetButtonImage @DEPRECATED_1_0.50\n");
SetUnselectedImage( GetUrlFromImage( image ) );
+ mSetButtonImage = image;
}
void Button::SetSelectedImage( Image image )
{
DALI_LOG_WARNING("Button::SetSelectedImage @DEPRECATED_1_0.50\n");
SetSelectedImage( GetUrlFromImage( image ) );
+ mSetSelectedImage = image;
}
Actor Button::GetButtonImage() const
{
+ // When deprecated ImageView API removed then this button API can be removed too.
DALI_LOG_WARNING("Button::GetButtonImage @DEPRECATED_1_0.50\n");
- Actor imageView = Toolkit::ImageView::New( GetUrlForImageVisual( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL ) );
+
+ Actor imageView;
+
+ if ( mSetButtonImage )
+ {
+ imageView = Toolkit::ImageView::New( mSetButtonImage );
+ }
+ else
+ {
+ ResourceImage image = ResourceImage::New( GetUrlForImageVisual( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL ) );
+ imageView = Toolkit::ImageView::New( image );
+ }
return imageView;
}
Actor Button::GetSelectedImage() const
{
+ // When deprecated ImageView API removed then this button API can be removed too.
DALI_LOG_WARNING("Button::GetSelectedImage @DEPRECATED_1_0.50\n");
- Actor imageView = Toolkit::ImageView::New( GetUrlForImageVisual( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL ) );
+ Actor imageView;
+
+ if ( mSetSelectedImage )
+ {
+ imageView = Toolkit::ImageView::New( mSetSelectedImage );
+ }
+ else
+ {
+ ResourceImage image = ResourceImage::New( GetUrlForImageVisual( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL ) );
+ imageView = Toolkit::ImageView::New( image );
+ }
return imageView;
}
// Actions
bool mClickActionPerforming; ///< Used to manage signal emissions during action
+
+ // Deprecated API support
+ Image mSetButtonImage; ///< Store set image if deprecated SetButtonImage used.
+ Image mSetSelectedImage; ///< Store set image if deprecated SetSelectedImage used.
+
};
} // namespace Internal
return value;
}
+// Deprecated API using Actor to set images
+
+void PushButton::SetButtonImage( Actor image )
+{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetButtonImage() is deprecated and will be removed from next release. Use Button.SetProperty UNSELECTED_STATE_IMAGE or Styling file instead.\n" );
+
+ Image retreivedButtonImage = Toolkit::ImageView::DownCast( image ).GetImage();
+ if ( retreivedButtonImage )
+ {
+ ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
+
+ if ( resourceImage )
+ {
+ Self().SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, resourceImage.GetUrl() );
+
+ }
+ }
+}
+
+void PushButton::SetBackgroundImage( Actor image )
+{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release.\n" );
+
+ SetButtonImage( image );
+
+}
+
+void PushButton::SetSelectedImage( Actor image )
+{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use Button.SetProperty SELECTED_STATE_IMAGE or Styling file instead.\n" );
+
+ Image retreivedButtonImage = Toolkit::ImageView::DownCast( image ).GetImage();
+ if ( retreivedButtonImage )
+ {
+ ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
+
+ if ( resourceImage )
+ {
+ Self().SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, resourceImage.GetUrl() );
+ }
+ }
+}
+
+void PushButton::SetSelectedBackgroundImage( Actor image )
+{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedBackgroundImage() is deprecated and will be removed from next release.\n" );
+
+ SetSelectedImage( image );
+}
+
+void PushButton::SetDisabledBackgroundImage( Actor image )
+{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledBackgroundImage() is deprecated and will be removed from next release.\n" );
+
+ Image retreivedButtonImage = Toolkit::ImageView::DownCast( image ).GetImage();
+ if ( retreivedButtonImage )
+ {
+ ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
+
+ if ( resourceImage )
+ {
+ Self().SetProperty( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, resourceImage.GetUrl() );
+ }
+ }
+}
+
+void PushButton::SetDisabledImage( Actor image )
+{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledImage() is deprecated and will be removed from next release. Use Button.SetProperty DISABLED_STATE_IMAGE or Styling file instead.\n" );
+
+ Image retreivedButtonImage = Toolkit::ImageView::DownCast( image ).GetImage();
+ if ( retreivedButtonImage )
+ {
+ ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
+
+ if ( resourceImage )
+ {
+ Self().SetProperty( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, resourceImage.GetUrl() );
+ }
+ }
+}
+
+void PushButton::SetDisabledSelectedImage( Actor image )
+{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledSelectedImage() is deprecated and will be removed from next release.\n" );
+
+ Image retreivedButtonImage = Toolkit::ImageView::DownCast( image ).GetImage();
+ if ( retreivedButtonImage )
+ {
+ ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
+
+ if ( resourceImage )
+ {
+ Self().SetProperty( Toolkit::DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL, resourceImage.GetUrl() );
+ }
+ }
+}
+
} // namespace Internal
} // namespace Toolkit
*/
static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
+ /**
+ * Deprecated API for Setting Pushbutton image using an Actor
+ * @param[in] image, Image Actor that has a url which can be used to create an image visual
+ */
+ void SetButtonImage( Actor image );
+
+ /**
+ * Deprecated API for Setting Pushbutton image using an Actor
+ * @param[in] image, Image Actor that has a url which can be used to create an image visual
+ */
+ void SetBackgroundImage( Actor image );
+
+ /**
+ * Deprecated API for Setting Pushbutton image using an Actor
+ * @param[in] image, Image Actor that has a url which can be used to create an image visual
+ */
+ void SetSelectedImage( Actor image );
+
+ /**
+ * Deprecated API for Setting Pushbutton image using an Actor
+ * @param[in] image, Image Actor that has a url which can be used to create an image visual
+ */
+ void SetSelectedBackgroundImage( Actor image );
+
+ /**
+ * Deprecated API for Setting Pushbutton image using an Actor
+ * @param[in] image, Image Actor that has a url which can be used to create an image visual
+ */
+ void SetDisabledBackgroundImage( Actor image );
+
+ /**
+ * Deprecated API for Setting Pushbutton image using an Actor
+ * @param[in] image, Image Actor that has a url which can be used to create an image visual
+ */
+ void SetDisabledImage( Actor image );
+
+ /**
+ * Deprecated API for Setting Pushbutton image using an Actor
+ * @param[in] image, Image Actor that has a url which can be used to create an image visual
+ */
+ void SetDisabledSelectedImage( Actor image );
+
private: // From Button
/**
Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, true, "LOG_TEXT_CONTROLS");
#endif
+const Scripting::StringEnum AUTO_SCROLL_STOP_MODE_TABLE[] =
+{
+ { "IMMEDIATE", Toolkit::DevelTextLabel::AutoScrollStopMode::IMMEDIATE },
+ { "FINISH_LOOP", Toolkit::DevelTextLabel::AutoScrollStopMode::FINISH_LOOP },
+};
+const unsigned int AUTO_SCROLL_STOP_MODE_TABLE_COUNT = sizeof( AUTO_SCROLL_STOP_MODE_TABLE ) / sizeof( AUTO_SCROLL_STOP_MODE_TABLE[0] );
+
const Scripting::StringEnum HORIZONTAL_ALIGNMENT_STRING_TABLE[] =
{
{ "BEGIN", Toolkit::Text::Layout::HORIZONTAL_ALIGN_BEGIN },
// Setup properties, signals and actions using the type-registry.
DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextLabel, Toolkit::Control, Create );
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "renderingBackend", INTEGER, RENDERING_BACKEND )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "text", STRING, TEXT )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontFamily", STRING, FONT_FAMILY )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontStyle", MAP, FONT_STYLE )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pointSize", FLOAT, POINT_SIZE )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "multiLine", BOOLEAN, MULTI_LINE )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "horizontalAlignment", STRING, HORIZONTAL_ALIGNMENT )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "verticalAlignment", STRING, VERTICAL_ALIGNMENT )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "textColor", VECTOR4, TEXT_COLOR )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowOffset", VECTOR2, SHADOW_OFFSET )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowColor", VECTOR4, SHADOW_COLOR )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineEnabled", BOOLEAN, UNDERLINE_ENABLED )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineColor", VECTOR4, UNDERLINE_COLOR )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineHeight", FLOAT, UNDERLINE_HEIGHT )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableMarkup", BOOLEAN, ENABLE_MARKUP )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableAutoScroll", BOOLEAN, ENABLE_AUTO_SCROLL )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollSpeed", INTEGER, AUTO_SCROLL_SPEED )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopCount", INTEGER, AUTO_SCROLL_LOOP_COUNT )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollGap", FLOAT, AUTO_SCROLL_GAP )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "lineSpacing", FLOAT, LINE_SPACING )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline", MAP, UNDERLINE )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadow", MAP, SHADOW )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "emboss", MAP, EMBOSS )
-DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "outline", MAP, OUTLINE )
-DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pixelSize", FLOAT, PIXEL_SIZE )
-DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "ellipsis", BOOLEAN, ELLIPSIS )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "renderingBackend", INTEGER, RENDERING_BACKEND )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "text", STRING, TEXT )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontFamily", STRING, FONT_FAMILY )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "fontStyle", MAP, FONT_STYLE )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pointSize", FLOAT, POINT_SIZE )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "multiLine", BOOLEAN, MULTI_LINE )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "horizontalAlignment", STRING, HORIZONTAL_ALIGNMENT )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "verticalAlignment", STRING, VERTICAL_ALIGNMENT )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "textColor", VECTOR4, TEXT_COLOR )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowOffset", VECTOR2, SHADOW_OFFSET )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadowColor", VECTOR4, SHADOW_COLOR )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineEnabled", BOOLEAN, UNDERLINE_ENABLED )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineColor", VECTOR4, UNDERLINE_COLOR )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underlineHeight", FLOAT, UNDERLINE_HEIGHT )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableMarkup", BOOLEAN, ENABLE_MARKUP )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "enableAutoScroll", BOOLEAN, ENABLE_AUTO_SCROLL )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollSpeed", INTEGER, AUTO_SCROLL_SPEED )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopCount", INTEGER, AUTO_SCROLL_LOOP_COUNT )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollGap", FLOAT, AUTO_SCROLL_GAP )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "lineSpacing", FLOAT, LINE_SPACING )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline", MAP, UNDERLINE )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadow", MAP, SHADOW )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "emboss", MAP, EMBOSS )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "outline", MAP, OUTLINE )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "pixelSize", FLOAT, PIXEL_SIZE )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "ellipsis", BOOLEAN, ELLIPSIS )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollLoopDelay", FLOAT, AUTO_SCROLL_LOOP_DELAY )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollStopMode", STRING, AUTO_SCROLL_STOP_MODE )
DALI_TYPE_REGISTRATION_END()
}
break;
}
+ case Toolkit::DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE:
+ {
+ if( !impl.mTextScroller )
+ {
+ impl.mTextScroller = Text::TextScroller::New( impl );
+ }
+ DevelTextLabel::AutoScrollStopMode::Type stopMode = impl.mTextScroller->GetStopMode();
+ if( Scripting::GetEnumerationProperty< Toolkit::DevelTextLabel::AutoScrollStopMode::Type >( value,
+ AUTO_SCROLL_STOP_MODE_TABLE,
+ AUTO_SCROLL_STOP_MODE_TABLE_COUNT,
+ stopMode ) )
+ {
+ impl.mTextScroller->SetStopMode( stopMode );
+ }
+ break;
+ }
case Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED:
{
if( !impl.mTextScroller )
impl.mTextScroller->SetLoopCount( value.Get<int>() );
break;
}
+ case Toolkit::DevelTextLabel::Property::AUTO_SCROLL_LOOP_DELAY:
+ {
+ if( !impl.mTextScroller )
+ {
+ impl.mTextScroller = Text::TextScroller::New( impl );
+ }
+ impl.mTextScroller->SetLoopDelay( value.Get<float>() );
+ break;
+ }
case Toolkit::TextLabel::Property::AUTO_SCROLL_GAP:
{
if( !impl.mTextScroller )
}
break;
}
+ case Toolkit::DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE:
+ {
+ if( impl.mTextScroller )
+ {
+ const char* mode = Scripting::GetEnumerationName< Toolkit::DevelTextLabel::AutoScrollStopMode::Type >( impl.mTextScroller->GetStopMode(),
+ AUTO_SCROLL_STOP_MODE_TABLE,
+ AUTO_SCROLL_STOP_MODE_TABLE_COUNT );
+ if( mode )
+ {
+ value = std::string( mode );
+ }
+ }
+ break;
+ }
case Toolkit::TextLabel::Property::AUTO_SCROLL_SPEED:
{
TextLabel& impl( GetImpl( label ) );
}
break;
}
+ case Toolkit::DevelTextLabel::Property::AUTO_SCROLL_LOOP_DELAY:
+ {
+ if( impl.mController )
+ {
+ TextLabel& impl( GetImpl( label ) );
+ if ( impl.mTextScroller )
+ {
+ value = impl.mTextScroller->GetLoopDelay();
+ }
+ }
+ break;
+ }
case Toolkit::TextLabel::Property::AUTO_SCROLL_GAP:
{
TextLabel& impl( GetImpl( label ) );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
currentFontId = fontId;
// Get the script for the current character.
- const Script script = GetScript( index,
- scriptRunIt,
- scriptRunEndIt );
+ Script script = GetScript( index,
+ scriptRunIt,
+ scriptRunEndIt );
#ifdef DEBUG_ENABLED
{
description.path.c_str() );
}
#endif
+ if (script == TextAbstraction::UNKNOWN)
+ {
+ script = TextAbstraction::LATIN;
+ }
// Validate whether the current character is supported by the given font.
bool isValidFont = false;
mMarkupProcessorEnabled( false ),
mClipboardHideEnabled( true ),
mIsAutoScrollEnabled( false ),
- mAutoScrollDirectionRTL( false )
+ mAutoScrollDirectionRTL( false ),
+ mUnderlineSetByString( false ),
+ mShadowSetByString( false )
{
mModel = Model::New();
bool mIsAutoScrollEnabled:1; ///< Whether auto text scrolling is enabled.
CharacterDirection mAutoScrollDirectionRTL:1; ///< Direction of auto scrolling, true if rtl
+ bool mUnderlineSetByString:1; ///< Set when underline is set by string (legacy) instead of map
+ bool mShadowSetByString:1; ///< Set when shadow is set by string (legacy) instead of map
};
} // namespace Text
return action;
}
+bool Controller::IsUnderlineSetByString()
+{
+ return mImpl->mUnderlineSetByString;
+}
+
+void Controller::UnderlineSetByString( bool setByString )
+{
+ mImpl->mUnderlineSetByString = setByString;
+}
+
+bool Controller::IsShadowSetByString()
+{
+ return mImpl->mShadowSetByString;
+}
+
+void Controller::ShadowSetByString( bool setByString )
+{
+ mImpl->mShadowSetByString = setByString;
+}
+
// public : Queries & retrieves.
Layout::Engine& Controller::GetLayoutEngine()
*/
NoTextTap::Action GetNoTextLongPressAction() const;
+ /**
+ * @brief Query if Underline settings were provided by string or map
+ * @return bool true if set by string
+ */
+ bool IsUnderlineSetByString();
+
+ /**
+ * Set method underline setting were set by
+ * @param[in] bool, true if set by string
+ */
+ void UnderlineSetByString( bool setByString );
+
+ /**
+ * @brief Query if shadow settings were provided by string or map
+ * @return bool true if set by string
+ */
+ bool IsShadowSetByString();
+
+ /**
+ * Set method shadow setting were set by
+ * @param[in] bool, true if set by string
+ */
+ void ShadowSetByString( bool setByString );
+
public: // Update.
/**
bool heightDefined = false;
float height = 0.f;
- const bool empty = ParseUnderlineProperties( propertiesMap,
- enabled,
- colorDefined,
- color,
- heightDefined,
- height );
+ bool empty = true;
+
+ if ( propertiesMap.Empty() )
+ {
+ // Map empty so check if a string provided
+ const std::string propertyString = value.Get<std::string>();
+
+ if ( !propertyString.empty() )
+ {
+ Property::Map parsedStringMap;
+ Text::ParsePropertyString( propertyString, parsedStringMap );
+
+ empty = ParseUnderlineProperties( parsedStringMap,
+ enabled,
+ colorDefined,
+ color,
+ heightDefined,
+ height );
+
+ controller->UnderlineSetByString( !empty);
+ }
+ }
+ else
+ {
+ empty = ParseUnderlineProperties( propertiesMap,
+ enabled,
+ colorDefined,
+ color,
+ heightDefined,
+ height );
+
+ controller->UnderlineSetByString( false );
+ }
if( !empty )
{
const Vector4& color = controller->GetUnderlineColor();
const float height = controller->GetUnderlineHeight();
- Property::Map map;
+ if ( controller->IsUnderlineSetByString() )
+ {
+ std::string underlineProperties = "{\"enable\":";
+ const std::string enabledStr = enabled ? "true" : "false";
+ underlineProperties += "\"" + enabledStr + "\",";
+
+ std::string colorStr;
+ Vector4ToColorString( color, colorStr );
+ underlineProperties += "\"color\":\"" + colorStr + "\",";
+
+ std::string heightStr;
+ FloatToString( height, heightStr );
+ underlineProperties += "\"height\":\"" + heightStr + "\"}";
+
+ value = underlineProperties;
+ }
+ else
+ {
+ Property::Map map;
- const std::string enabledStr = enabled ? TRUE_TOKEN : FALSE_TOKEN;
- map.Insert( ENABLE_KEY, enabledStr );
+ const std::string enabledStr = enabled ? TRUE_TOKEN : FALSE_TOKEN;
+ map.Insert( ENABLE_KEY, enabledStr );
- std::string colorStr;
- Vector4ToColorString( color, colorStr );
- map.Insert( COLOR_KEY, colorStr );
+ std::string colorStr;
+ Vector4ToColorString( color, colorStr );
+ map.Insert( COLOR_KEY, colorStr );
- std::string heightStr;
- FloatToString( height, heightStr );
- map.Insert( HEIGHT_KEY, heightStr );
+ std::string heightStr;
+ FloatToString( height, heightStr );
+ map.Insert( HEIGHT_KEY, heightStr );
+
+ value = map;
+ }
- value = map;
break;
}
case EffectStyle::INPUT:
bool offsetDefined = false;
Vector2 offset;
- const bool empty = ParseShadowProperties( propertiesMap,
- colorDefined,
- color,
- offsetDefined,
- offset );
+ bool empty = true;
+
+ if ( propertiesMap.Empty() )
+ {
+ // Map empty so check if a string provided
+ const std::string propertyString = value.Get<std::string>();
+
+ Property::Map parsedStringMap;
+ Text::ParsePropertyString( propertyString, parsedStringMap );
+
+ empty = ParseShadowProperties( parsedStringMap,
+ colorDefined,
+ color,
+ offsetDefined,
+ offset );
+
+ controller->ShadowSetByString( !empty );
+
+ }
+ else
+ {
+ empty = ParseShadowProperties( propertiesMap,
+ colorDefined,
+ color,
+ offsetDefined,
+ offset );
+
+ controller->ShadowSetByString( false );
+ }
if( !empty )
{
const Vector4& color = controller->GetShadowColor();
const Vector2& offset = controller->GetShadowOffset();
- Property::Map map;
+ if ( controller->IsShadowSetByString() )
+ {
+ std::string shadowProperties = "{";
- std::string colorStr;
- Vector4ToColorString( color, colorStr );
- map.Insert( COLOR_KEY, colorStr );
+ std::string colorStr;
+ Vector4ToColorString( color, colorStr );
+ shadowProperties += "\"color\":\"" + colorStr + "\",";
- std::string offsetStr;
- Vector2ToString( offset, offsetStr );
- map.Insert( OFFSET_KEY, offsetStr );
+ std::string offsetStr;
+ Vector2ToString( offset, offsetStr );
+ shadowProperties += "\"offset\":\"" + offsetStr + "\"}";
- value = map;
+ value = shadowProperties;
+ }
+ else
+ {
+ Property::Map map;
+
+ std::string colorStr;
+ Vector4ToColorString( color, colorStr );
+ map.Insert( COLOR_KEY, colorStr );
+
+ std::string offsetStr;
+ Vector2ToString( offset, offsetStr );
+ map.Insert( OFFSET_KEY, offsetStr );
+
+ value = map;
+ }
break;
}
case EffectStyle::INPUT:
if ( loopCount == 0 ) // Request to stop looping
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetLoopCount Single loop forced\n" );
- mScrollAnimation.SetLoopCount( 1 ); // As animation already playing this allows the current animation to finish instead of trying to stop mid-way
+ switch( mStopMode )
+ {
+ case DevelTextLabel::AutoScrollStopMode::IMMEDIATE:
+ {
+ mScrollAnimation.Stop();
+ break;
+ }
+ case DevelTextLabel::AutoScrollStopMode::FINISH_LOOP:
+ {
+ mScrollAnimation.SetLoopCount( 1 ); // As animation already playing this allows the current animation to finish instead of trying to stop mid-way
+ break;
+ }
+ default:
+ {
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Undifined AutoScrollStopMode\n" );
+ }
+ }
}
}
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetLoopCount [%d] Status[%s]\n", mLoopCount, (loopCount)?"looping":"stop" );
return mLoopCount;
}
+void TextScroller::SetLoopDelay( float delay )
+{
+ mLoopDelay = delay;
+}
+
+float TextScroller::GetLoopDelay() const
+{
+ return mLoopDelay;
+}
+
+void TextScroller::SetStopMode( DevelTextLabel::AutoScrollStopMode::Type stopMode )
+{
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetAutoScrollStopMode [%s]\n",(stopMode == DevelTextLabel::AutoScrollStopMode::IMMEDIATE)?"IMMEDIATE":"FINISH_LOOP" );
+ mStopMode = stopMode;
+}
+
+DevelTextLabel::AutoScrollStopMode::Type TextScroller::GetStopMode() const
+{
+ return mStopMode;
+}
+
Actor TextScroller::GetSourceCamera() const
{
return mOffscreenCameraActor;
mScrollDeltaIndex( Property::INVALID_INDEX ),
mScrollSpeed( MINIMUM_SCROLL_SPEED ),
mLoopCount( 1 ),
- mWrapGap( 0.0f )
+ mLoopDelay( 0.0f ),
+ mWrapGap( 0.0f ),
+ mStopMode( DevelTextLabel::AutoScrollStopMode::FINISH_LOOP )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller Default Constructor\n" );
}
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::StartScrolling scrollAmount[%f] scrollDuration[%f], loop[%d] speed[%d]\n", scrollAmount, scrollDuration, loopCount, mScrollSpeed );
mScrollAnimation = Animation::New( scrollDuration );
- mScrollAnimation.AnimateTo( Property( mScrollingTextActor, mScrollDeltaIndex ), scrollAmount );
+ mScrollAnimation.AnimateTo( Property( mScrollingTextActor, mScrollDeltaIndex ), scrollAmount, TimePeriod( mLoopDelay, scrollDuration ) );
mScrollAnimation.SetEndAction( Animation::Discard );
mScrollAnimation.SetLoopCount( loopCount );
mScrollAnimation.FinishedSignal().Connect( this, &TextScroller::AutoScrollAnimationFinished );
#include <dali/public-api/actors/camera-actor.h>
#include <dali/public-api/animation/animation.h>
#include <dali/public-api/render-tasks/render-task.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/text-definitions.h>
int GetLoopCount() const;
/**
+ * @brief Set the delay time of scroll animation loop
+ * @param[in] float delay time seconds of loops
+ */
+ void SetLoopDelay( float delay );
+
+ /**
+ * @brief Get the delay time of scroll
+ * @return float delay time seconds of loops
+ */
+ float GetLoopDelay() const;
+
+ /**
+ * @brief Set the mode of scrolling stop
+ * @param[in] stopMode type when text scrolling is stoped.
+ */
+ void SetStopMode( DevelTextLabel::AutoScrollStopMode::Type stopMode );
+
+ /**
+ * @brief Get the mode of scrolling stop
+ * @return stopMode type when text scrolling is stoped.
+ */
+ DevelTextLabel::AutoScrollStopMode::Type GetStopMode() const;
+
+ /**
* @brief Get the camera used to look at source, should be added to the parent of target actor.
* @return camera Actor
*/
Property::Index mScrollDeltaIndex; // Property used by shader to represent distance to scroll
Animation mScrollAnimation; // Animation used to update the mScrollDeltaIndex
- int mScrollSpeed; ///< Speed which text should automatically scroll at
- int mLoopCount; ///< Number of time the text should scroll
- float mWrapGap; ///< Gap before text wraps around when scrolling
+ int mScrollSpeed; ///< Speed which text should automatically scroll at
+ int mLoopCount; ///< Number of time the text should scroll
+ float mLoopDelay; ///< Time delay of loop start
+ float mWrapGap; ///< Gap before text wraps around when scrolling
+ DevelTextLabel::AutoScrollStopMode::Type mStopMode; ///< Stop mode of scrolling text, when loop count is 0.
}; // TextScroller class
{
DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetButtonImage() is deprecated and will be removed from next release. Use Button.SetProperty UNSELECTED_STATE_IMAGE or Styling file instead.\n" );
- // Passing Image as Actor not supported
+ Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
}
void PushButton::SetBackgroundImage( Actor image )
{
DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release.\n" );
- // Passing Image as Actor not supported}
+ Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
}
void PushButton::SetSelectedImage( Actor image )
{
DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use Button.SetProperty SELECTED_STATE_IMAGE or Styling file instead.\n" );
- // Passing Image as Actor not supported}
+ Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
}
void PushButton::SetSelectedBackgroundImage( Actor image )
{
DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedBackgroundImage() is deprecated and will be removed from next release.\n" );
- // Passing Image as Actor not supported}
+ Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( image );
}
void PushButton::SetDisabledBackgroundImage( Actor image )
{
DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledBackgroundImage() is deprecated and will be removed from next release.\n" );
- // Passing Image as Actor not supported}
+
+ Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
}
void PushButton::SetDisabledImage( Actor image )
{
DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledImage() is deprecated and will be removed from next release. Use Button.SetProperty DISABLED_STATE_IMAGE or Styling file instead.\n" );
- // Passing Image as Actor not supported
+
+ Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
}
void PushButton::SetDisabledSelectedImage( Actor image )
{
DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledSelectedImage() is deprecated and will be removed from next release.\n" );
- // Passing Image as Actor not supported
+
+ Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( image );
}
} // namespace Toolkit
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 38;
+const unsigned int TOOLKIT_MICRO_VERSION = 39;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.2.38
+Version: 1.2.39
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT