Merge "Remove profile build dependencies" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 7 Jun 2017 10:03:33 +0000 (10:03 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 7 Jun 2017 10:03:33 +0000 (10:03 +0000)
41 files changed:
automated-tests/src/dali-toolkit/utc-Dali-ControlWrapper.cpp
automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
dali-toolkit/devel-api/controls/control-devel.cpp
dali-toolkit/devel-api/controls/control-devel.h
dali-toolkit/devel-api/controls/control-wrapper-impl.cpp
dali-toolkit/devel-api/controls/control-wrapper-impl.h
dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h
dali-toolkit/devel-api/controls/text-controls/text-label-devel.h
dali-toolkit/devel-api/visual-factory/visual-base.cpp
dali-toolkit/devel-api/visual-factory/visual-base.h
dali-toolkit/devel-api/visuals/visual-properties-devel.h
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.h
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.cpp
dali-toolkit/internal/controls/progress-bar/progress-bar-impl.h
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/text/layouts/layout-alignment.h
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-scroller.cpp
dali-toolkit/internal/text/text-scroller.h
dali-toolkit/internal/visuals/visual-base-data-impl.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 8caf518..3ea0786 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -405,6 +405,43 @@ int UtcDaliControlWrapperRegisterVisualToSelf(void)
   END_TEST;
 }
 
+int UtcDaliControlWrapperRegisterVisualWithDepthIndexToSelf(void)
+{
+  ToolkitTestApplication application;
+
+  Test::ObjectDestructionTracker objectDestructionTracker;
+
+  {
+    Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
+    ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+
+    objectDestructionTracker.Start( controlWrapper );
+
+    Property::Index index = 1;
+
+    Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
+    Toolkit::Visual::Base visual;
+
+    Property::Map map;
+    map[Visual::Property::TYPE] = Visual::COLOR;
+    map[ColorVisual::Property::MIX_COLOR] = Color::RED;
+
+    visual = visualFactory.CreateVisual( map );
+    DALI_TEST_CHECK( visual );
+
+    // Register to self
+    controlWrapperImpl->RegisterVisual( index, visual, 4 );
+
+    DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), false, TEST_LOCATION ); // Control not destroyed yet
+    DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( index ), visual, TEST_LOCATION );
+    DALI_TEST_EQUALS( visual.GetDepthIndex(), 4, TEST_LOCATION );
+  }
+
+  DALI_TEST_EQUALS( objectDestructionTracker.IsDestroyed(), true, TEST_LOCATION ); // Should be destroyed
+
+  END_TEST;
+}
+
 int UtcDaliControlWrapperRegisterDisabledVisual(void)
 {
   ToolkitTestApplication application;
@@ -447,6 +484,49 @@ int UtcDaliControlWrapperRegisterDisabledVisual(void)
   END_TEST;
 }
 
+int UtcDaliControlWrapperRegisterDisabledVisualWithDepthIndex(void)
+{
+  ToolkitTestApplication application;
+
+  Impl::TestCustomControl* controlWrapperImpl = new ::Impl::TestCustomControl( Toolkit::Internal::ControlWrapper::CONTROL_BEHAVIOUR_DEFAULT );
+  ControlWrapper controlWrapper = ControlWrapper::New( customControlTypeName, *controlWrapperImpl );
+
+  Property::Index TEST_PROPERTY = 1;
+
+  Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
+  Toolkit::Visual::Base visual;
+
+  Property::Map map;
+  map[Visual::Property::TYPE] = Visual::COLOR;
+  map[ColorVisual::Property::MIX_COLOR] = Color::RED;
+
+  visual = visualFactory.CreateVisual( map );
+  DALI_TEST_CHECK(visual);
+
+  // Register index with a color visual
+  controlWrapperImpl->RegisterVisual( TEST_PROPERTY, visual, false, 10 );
+
+  DALI_TEST_EQUALS( controlWrapperImpl->GetVisual( TEST_PROPERTY ), visual, TEST_LOCATION );
+  DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
+  DALI_TEST_EQUALS( visual.GetDepthIndex(), 10, TEST_LOCATION );
+
+  Stage::GetCurrent().Add( controlWrapper );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), false, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( controlWrapper.OnStage(), true, TEST_LOCATION );
+
+  controlWrapperImpl->EnableVisual( TEST_PROPERTY, true );
+
+  DALI_TEST_EQUALS( controlWrapperImpl->IsVisualEnabled( TEST_PROPERTY ), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliControlWrapperRegisterUnregisterVisual(void)
 {
   ToolkitTestApplication application;
index 040fb1c..3b5cefb 100755 (executable)
@@ -45,7 +45,7 @@ void utc_dali_toolkit_item_view_cleanup(void)
 namespace
 {
 
-const unsigned int TOTAL_ITEM_NUMBER = 100;
+const unsigned int TOTAL_ITEM_NUMBER = 400;
 const char* TEST_IMAGE_FILE_NAME = "gallery_image_01.jpg";
 
 const int RENDER_FRAME_INTERVAL = 16;                     ///< Duration of each frame in ms. (at approx 60FPS)
@@ -423,13 +423,34 @@ int UtcDaliItemViewRemoveItem(void)
   // Remove the item with ID 2
   view.RemoveItem(2, 0.0f);
 
-  // Get the new item given the item ID 2
+  // Get the new item given the item ID 2 and 3
   Actor newItemActorID2 = view.GetItem(2);
+  Actor newItemActorID3 = view.GetItem(3);
 
   // Check the original item with item ID 2 was deleted and now item ID 2 represents the original item with ID 3
   DALI_TEST_CHECK(view.GetItemId(newItemActorID2) == 2);
   DALI_TEST_CHECK(oldItemActorID2 != newItemActorID2);
-  DALI_TEST_CHECK(newItemActorID2 = oldItemActorID3);
+  DALI_TEST_CHECK(newItemActorID2 == oldItemActorID3);
+
+  // scroll to the end of item view
+  view.ScrollToItem(TOTAL_ITEM_NUMBER - 1, 0.00f);
+
+  application.SendNotification();
+  application.Render(0);
+
+  // Refresh the item view
+  view.Refresh();
+
+  Actor itemActorID390 = view.GetItem(390);
+  DALI_TEST_CHECK(view.GetItemId(itemActorID390) == 390);
+
+  // Remove the item with ID 2 (which is now before the current item range)
+  view.RemoveItem(2, 0.0f);
+
+  // Check the original item with item ID 2 was deleted and now item ID 389 represents the original item with ID 390
+  DALI_TEST_CHECK(view.GetItemId(itemActorID390) == 389);
+  DALI_TEST_CHECK(view.GetItem(389) == itemActorID390);
+
   END_TEST;
 }
 
@@ -636,16 +657,16 @@ int UtcDaliItemViewInsertItemP(void)
   TestItemFactory factory;
   ItemView view = ItemView::New(factory);
 
-  // Create a depth layout and add it to ItemView
-  ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH);
-  depthLayout->SetOrientation(ControlOrientation::Left);
-  view.AddLayout(*depthLayout);
+  // Create a grid layout and add it to ItemView
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID);
+  gridLayout->SetOrientation(ControlOrientation::Left);
+  view.AddLayout(*gridLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
   Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
-  view.ActivateLayout(0, stageSize, 0.5f);
+  view.ActivateLayout(0, stageSize, 0.0f);
 
-  // Get the item given the item ID
+  // Get the specified item where new item to be inserted before that
   Actor itemActor = view.GetItem(2);
 
   ItemId id = view.GetItemId( itemActor );
@@ -655,9 +676,33 @@ int UtcDaliItemViewInsertItemP(void)
 
   Actor newActor = Actor::New();
 
-  view.InsertItem(Item(id, newActor), 0.5f);
+  view.InsertItem(Item(id, newActor), 0.0f);
 
   DALI_TEST_CHECK(view.GetItem(2) == newActor);
+
+  DALI_TEST_CHECK(view.GetItemId(itemActor) == 3);
+  DALI_TEST_CHECK(view.GetItem(3) == itemActor);
+
+  // scroll to the end of item view
+  view.ScrollToItem(TOTAL_ITEM_NUMBER - 1, 0.00f);
+
+  application.SendNotification();
+  application.Render(0);
+
+  // Refresh the item view
+  view.Refresh();
+
+  Actor itemActorID390 = view.GetItem(390);
+  DALI_TEST_CHECK(view.GetItemId(itemActorID390) == 390);
+
+  // Insert the item with ID 2 (which is now before the current item range)
+  Actor anotherNewActor = Actor::New();
+  view.InsertItem(Item(id, anotherNewActor), 0.0f);
+
+  // Check that item ID 391 now represents the original item with ID 390
+  DALI_TEST_CHECK(view.GetItemId(itemActorID390) == 391);
+  DALI_TEST_CHECK(view.GetItem(391) == itemActorID390);
+
   END_TEST;
 }
 
@@ -680,9 +725,15 @@ int UtcDaliItemViewInsertItemsP(void)
 
   unsigned int itemCount = view.GetChildCount();
 
+  // Get the specified item where new items to be inserted before that
+  Actor itemActor = view.GetItem(1);
+
+  // Check we are getting the correct Item ID given the specified item
+  DALI_TEST_CHECK(view.GetItemId(itemActor) == 1);
+
   ItemContainer insertList;
 
-  for( unsigned int i = 0u; i < 10; ++i )
+  for( unsigned int i = 1u; i < 11; ++i )
   {
     Actor child = view.GetChildAt( i );
     Actor newActor = Actor::New();
@@ -697,6 +748,10 @@ int UtcDaliItemViewInsertItemsP(void)
 
   DALI_TEST_CHECK(view.GetChildCount() == itemCount + 10);
 
+  // Check that new items are inserted in the correct positions
+  DALI_TEST_CHECK(view.GetItemId(itemActor) == 11);
+  DALI_TEST_CHECK(view.GetItem(11) == itemActor);
+
   ItemIdContainer removeList;
 
   for( unsigned int i = 0u; i < view.GetChildCount(); ++i )
@@ -715,6 +770,11 @@ int UtcDaliItemViewInsertItemsP(void)
   }
 
   DALI_TEST_CHECK(view.GetChildCount() == itemCount);
+
+  // Check that new items are removed correctly so that we are getting the correct Item ID given the specified item
+  DALI_TEST_CHECK(view.GetItemId(itemActor) == 1);
+  DALI_TEST_CHECK(view.GetItem(1) == itemActor);
+
   END_TEST;
 }
 
@@ -736,9 +796,10 @@ int UtcDaliItemViewReplaceItemP(void)
 
   Actor newActor = Actor::New();
 
-  view.ReplaceItem( Item( 0, newActor ), 0.5f );
+  view.ReplaceItem( Item( 5, newActor ), 0.5f );
+
+  DALI_TEST_CHECK(view.GetItem(5) == newActor);
 
-  DALI_TEST_CHECK(view.GetItem(0) == newActor);
   END_TEST;
 }
 
index 5cacd19..9fd6789 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali/integration-api/events/pan-gesture-event.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
 
 using namespace Dali;
@@ -93,9 +94,13 @@ const char* const PROPERTY_NAME_ENABLE_SCROLL_BAR                    = "enableSc
 const char* const PROPERTY_NAME_SCROLL_BAR_SHOW_DURATION             = "scrollBarShowDuration";
 const char* const PROPERTY_NAME_SCROLL_BAR_FADE_DURATION             = "scrollBarFadeDuration";
 const char* const PROPERTY_NAME_PIXEL_SIZE                           = "pixelSize";
+const char* const PROPERTY_NAME_LINE_COUNT                           = "lineCount";
+const char* const PROPERTY_NAME_PLACEHOLDER_TEXT                     = "placeholderText";
+const char* const PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR               = "placeholderTextColor";
 
 const int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
 
+const Vector4 PLACEHOLDER_TEXT_COLOR( 0.8f, 0.8f, 0.8f, 0.8f );
 const Dali::Vector4 LIGHT_BLUE( 0.75f, 0.96f, 1.f, 1.f ); // The text highlight color.
 
 const unsigned int CURSOR_BLINK_INTERVAL = 500u; // Cursor blink interval
@@ -433,6 +438,9 @@ int UtcDaliTextEditorGetPropertyP(void)
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SCROLL_BAR_SHOW_DURATION ) == DevelTextEditor::Property::SCROLL_BAR_SHOW_DURATION );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_SCROLL_BAR_FADE_DURATION ) == DevelTextEditor::Property::SCROLL_BAR_FADE_DURATION );
   DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == DevelTextEditor::Property::PIXEL_SIZE );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_LINE_COUNT) == DevelTextEditor::Property::LINE_COUNT );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT ) == DevelTextEditor::Property::PLACEHOLDER_TEXT );
+  DALI_TEST_CHECK( editor.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT_COLOR ) == DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR );
 
   END_TEST;
 }
@@ -725,6 +733,20 @@ int UtcDaliTextEditorSetPropertyP(void)
   editor.SetProperty( DevelTextEditor::Property::PIXEL_SIZE, 20.f );
   DALI_TEST_EQUALS( editor.GetProperty<float>( DevelTextEditor::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
+  // Check placeholder text properties.
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER_TEXT, "Setting Placeholder Text" );
+  DALI_TEST_EQUALS( editor.GetProperty<std::string>( DevelTextEditor::Property::PLACEHOLDER_TEXT ), std::string("Setting Placeholder Text"), TEST_LOCATION );
+
+  // Check placeholder text properties when focused.
+  editor.SetProperty( DevelControl::Property::STATE, "FOCUSED" );
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER_TEXT, "Setting Focused Placeholder Text" );
+  DALI_TEST_EQUALS( editor.GetProperty<int>( DevelControl::Property::STATE ), (int)DevelControl::FOCUSED, TEST_LOCATION );
+  DALI_TEST_EQUALS( editor.GetProperty<std::string>( DevelTextEditor::Property::PLACEHOLDER_TEXT ), std::string("Setting Focused Placeholder Text"), TEST_LOCATION );
+
+  // Check placeholder text's color property.
+  editor.SetProperty( DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR, Color::RED );
+  DALI_TEST_EQUALS( editor.GetProperty<Vector4>( DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR ), Color::RED, TEST_LOCATION );
+
   END_TEST;
 }
 
@@ -1935,3 +1957,28 @@ int utcDaliTextEditorFontStylePropertyStringP(void)
 
   END_TEST;
 }
+int utcDaliTextEditorGetPropertyLinecountP(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline(" utcDaliTextEditorGetPropertyLinecount getting line count property");
+
+  int lineCount =0 ;
+
+  TextEditor editor = TextEditor::New();
+  editor.SetProperty( TextEditor::Property::POINT_SIZE, 10) ;
+  editor.SetProperty( TextEditor::Property::TEXT,
+                       "TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST TEST ");
+
+  Stage::GetCurrent().Add( editor );
+
+  editor.SetSize( 100.0f, 100.0f );
+  lineCount =  editor.GetProperty<int>( DevelTextEditor::Property::LINE_COUNT );
+  DALI_TEST_EQUALS( lineCount, 14, TEST_LOCATION );
+
+  editor.SetSize( 50.0f, 100.0f );
+  lineCount =  editor.GetProperty<int>( DevelTextEditor::Property::LINE_COUNT );
+  DALI_TEST_EQUALS( lineCount, 28, TEST_LOCATION );
+
+  END_TEST;
+}
index 4c1e449..4e1fd0f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -559,7 +559,7 @@ int UtcDaliToolkitTextlabelScrollingP(void)
   ToolkitTestApplication application;
   tet_infoline(" UtcDaliToolkitTextLabelScrollingP");
   TextLabel labelImmediate = TextLabel::New("Some text to scroll");
-  TextLabel labelFinished = TextLabel::New("Some text to scroll");
+  TextLabel labelFinished = TextLabel::New("مرحبا بالعالم");
 
   DALI_TEST_CHECK( labelImmediate );
   DALI_TEST_CHECK( labelFinished );
@@ -605,6 +605,206 @@ int UtcDaliToolkitTextlabelScrollingP(void)
   END_TEST;
 }
 
+int UtcDaliToolkitTextlabelScrollingCenterAlignP(void)
+{
+  ToolkitTestApplication application;
+  TextLabel labelShort = TextLabel::New("Some text to scroll");
+  TextLabel labelLong = TextLabel::New("Some text to scroll that is greater than the width of the text. The quick brown fox jumps over the lazy dog. Hello World, we meet again!");
+
+  DALI_TEST_CHECK( labelShort );
+  DALI_TEST_CHECK( labelLong );
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  Stage::GetCurrent().Add( labelShort );
+  // Turn on all the effects
+  labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
+  labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+  labelShort.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE );
+
+  Stage::GetCurrent().Add( labelLong );
+  // Turn on all the effects
+  labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
+  labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+  labelLong.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP );
+
+  try
+  {
+    // Render some text with the shared atlas backend
+    labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+    labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+    application.SendNotification();
+    application.Render();
+
+    labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+    labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+    application.SendNotification();
+    application.Render();
+
+  }
+  catch( ... )
+  {
+    tet_result(TET_FAIL);
+  }
+
+  END_TEST;
+}
+
+int UtcDaliToolkitTextlabelScrollingCenterAlignRTLP(void)
+{
+  ToolkitTestApplication application;
+  TextLabel labelShort = TextLabel::New("مرحبا بالعالم");
+  TextLabel labelLong = TextLabel::New("لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار  النشوة وتمجيد الألم نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، فلا أحد يرفض أو يكره أو يتجنب الشعور بالسعادة، ولكن بفضل هؤلاء الأشخاص الذين لا يدركون بأن السعادة لا بد أن نستشعرها بصورة أكثر عقلانية ومنطقية فيعرضهم هذا لمواجهة الظروف الأليمة، وأكرر بأنه لا يوجد من يرغب في الحب ونيل المنال ويتلذذ بالآلام، الألم هو الألم ولكن نتيجة لظروف ما قد تكمن السعاده فيما نتحمله من كد وأسي");
+
+  DALI_TEST_CHECK( labelShort );
+  DALI_TEST_CHECK( labelLong );
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  Stage::GetCurrent().Add( labelShort );
+  // Turn on all the effects
+  labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
+  labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+  labelShort.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE );
+
+  Stage::GetCurrent().Add( labelLong );
+  // Turn on all the effects
+  labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
+  labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+  labelLong.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP );
+
+  try
+  {
+    // Render some text with the shared atlas backend
+    labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+    labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+    application.SendNotification();
+    application.Render();
+
+    labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+    labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+    application.SendNotification();
+    application.Render();
+
+  }
+  catch( ... )
+  {
+    tet_result(TET_FAIL);
+  }
+
+  END_TEST;
+}
+
+int UtcDaliToolkitTextlabelScrollingEndAlignP(void)
+{
+  ToolkitTestApplication application;
+  TextLabel labelShort = TextLabel::New("Some text to scroll");
+  TextLabel labelLong = TextLabel::New("Some text to scroll that is greater than the width of the text. The quick brown fox jumps over the lazy dog. Hello World, we meet again!");
+
+  DALI_TEST_CHECK( labelShort );
+  DALI_TEST_CHECK( labelLong );
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  Stage::GetCurrent().Add( labelShort );
+  // Turn on all the effects
+  labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
+  labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+  labelShort.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE );
+
+  Stage::GetCurrent().Add( labelLong );
+  // Turn on all the effects
+  labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
+  labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+  labelLong.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP );
+
+  try
+  {
+    // Render some text with the shared atlas backend
+    labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+    labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+    application.SendNotification();
+    application.Render();
+
+    labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+    labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+    application.SendNotification();
+    application.Render();
+
+  }
+  catch( ... )
+  {
+    tet_result(TET_FAIL);
+  }
+
+  END_TEST;
+}
+
+int UtcDaliToolkitTextlabelScrollingEndAlignRTLP(void)
+{
+  ToolkitTestApplication application;
+  TextLabel labelShort = TextLabel::New("مرحبا بالعالم");
+  TextLabel labelLong = TextLabel::New("لكن لا بد أن أوضح لك أن كل هذه الأفكار المغلوطة حول استنكار  النشوة وتمجيد الألم نشأت بالفعل، وسأعرض لك التفاصيل لتكتشف حقيقة وأساس تلك السعادة البشرية، فلا أحد يرفض أو يكره أو يتجنب الشعور بالسعادة، ولكن بفضل هؤلاء الأشخاص الذين لا يدركون بأن السعادة لا بد أن نستشعرها بصورة أكثر عقلانية ومنطقية فيعرضهم هذا لمواجهة الظروف الأليمة، وأكرر بأنه لا يوجد من يرغب في الحب ونيل المنال ويتلذذ بالآلام، الألم هو الألم ولكن نتيجة لظروف ما قد تكمن السعاده فيما نتحمله من كد وأسي");
+
+  DALI_TEST_CHECK( labelShort );
+  DALI_TEST_CHECK( labelLong );
+  // Avoid a crash when core load gl resources.
+  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+  Stage::GetCurrent().Add( labelShort );
+  // Turn on all the effects
+  labelShort.SetProperty( TextLabel::Property::MULTI_LINE, false );
+  labelShort.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+  labelShort.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+  labelShort.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::IMMEDIATE );
+
+  Stage::GetCurrent().Add( labelLong );
+  // Turn on all the effects
+  labelLong.SetProperty( TextLabel::Property::MULTI_LINE, false );
+  labelLong.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_GAP, 50.0f );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_LOOP_COUNT, 3 );
+  labelLong.SetProperty( TextLabel::Property::AUTO_SCROLL_SPEED, 80.0f );
+  labelLong.SetProperty( DevelTextLabel::Property::AUTO_SCROLL_STOP_MODE, DevelTextLabel::AutoScrollStopMode::FINISH_LOOP );
+
+  try
+  {
+    // Render some text with the shared atlas backend
+    labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+    labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, true );
+    application.SendNotification();
+    application.Render();
+
+    labelShort.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+    labelLong.SetProperty( TextLabel::Property::ENABLE_AUTO_SCROLL, false );
+    application.SendNotification();
+    application.Render();
+
+  }
+  catch( ... )
+  {
+    tet_result(TET_FAIL);
+  }
+
+  END_TEST;
+}
+
 int UtcDaliToolkitTextlabelScrollingInterruptedP(void)
 {
   ToolkitTestApplication application;
index fd9f77f..bec918e 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/public-api/rendering/texture-set.h>
 #include <dali/public-api/rendering/shader.h>
 #include <dali/devel-api/object/handle-devel.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visual-factory/transition-data.h>
 #include <dali-toolkit/devel-api/visuals/text-visual-properties.h>
@@ -53,8 +54,8 @@ Property::Map DefaultTransform()
   transformMap
     .Add( Toolkit::DevelVisual::Transform::Property::OFFSET, Vector2(0.0f, 0.0f) )
     .Add( Toolkit::DevelVisual::Transform::Property::SIZE, Vector2(1.0f, 1.0f) )
-    .Add( Toolkit::DevelVisual::Transform::Property::ORIGIN, Toolkit::Align::CENTER )
-    .Add( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT, Toolkit::Align::CENTER )
+    .Add( Toolkit::DevelVisual::Transform::Property::ORIGIN, Toolkit::Align::TOP_BEGIN )
+    .Add( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT, Toolkit::Align::TOP_BEGIN )
     .Add( Toolkit::DevelVisual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::DevelVisual::Transform::Policy::RELATIVE, Toolkit::DevelVisual::Transform::Policy::RELATIVE ) )
     .Add( Toolkit::DevelVisual::Transform::Property::SIZE_POLICY, Vector2( Toolkit::DevelVisual::Transform::Policy::RELATIVE, Toolkit::DevelVisual::Transform::Policy::RELATIVE ) );
   return transformMap;
@@ -202,7 +203,7 @@ int UtcDaliVisualSetGetDepthIndex(void)
   propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
   Visual::Base visual = factory.CreateVisual( propertyMap );
 
-  visual.SetDepthIndex( 1.f );
+  visual.SetDepthIndex( 1 );
 
   DummyControl dummyControl = DummyControl::New(true);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
@@ -214,12 +215,12 @@ int UtcDaliVisualSetGetDepthIndex(void)
 
   int depthIndex = dummyControl.GetRendererAt(0u).GetProperty<int>( Renderer::Property::DEPTH_INDEX );
   DALI_TEST_EQUALS( depthIndex, 1, TEST_LOCATION );
-  DALI_TEST_EQUALS( visual.GetDepthIndex(), 1.f, TEST_LOCATION );
+  DALI_TEST_EQUALS( visual.GetDepthIndex(), 1, TEST_LOCATION );
 
-  visual.SetDepthIndex( -1.f );
+  visual.SetDepthIndex( -1 );
   depthIndex = dummyControl.GetRendererAt(0u).GetProperty<int>( Renderer::Property::DEPTH_INDEX );
   DALI_TEST_EQUALS( depthIndex, -1, TEST_LOCATION );
-  DALI_TEST_EQUALS( visual.GetDepthIndex(), -1.f, TEST_LOCATION );
+  DALI_TEST_EQUALS( visual.GetDepthIndex(), -1, TEST_LOCATION );
 
   END_TEST;
 }
@@ -1437,12 +1438,12 @@ int UtcDaliVisualGetTransform(void)
   {
     Property::Value* typeValue = map->Find( Toolkit::DevelVisual::Transform::Property::ORIGIN );
     DALI_TEST_CHECK( typeValue );
-    DALI_TEST_CHECK( (Toolkit::Align::Type)typeValue->Get<int>() == Toolkit::Align::CENTER );
+    DALI_TEST_CHECK( (Toolkit::Align::Type)typeValue->Get<int>() == Toolkit::Align::TOP_BEGIN );
   }
   {
     Property::Value* typeValue = map->Find( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT );
     DALI_TEST_CHECK( typeValue );
-    DALI_TEST_CHECK( (Toolkit::Align::Type)typeValue->Get<int>() == Toolkit::Align::CENTER );
+    DALI_TEST_CHECK( (Toolkit::Align::Type)typeValue->Get<int>() == Toolkit::Align::TOP_BEGIN );
   }
 
   END_TEST;
@@ -1454,7 +1455,7 @@ static void TestTransform( ToolkitTestApplication& application, Visual::Base vis
   transform.Insert( DevelVisual::Transform::Property::OFFSET, Vector2(10.0f, 10.0f) );
   transform.Insert( DevelVisual::Transform::Property::SIZE, Vector2(0.2f, 0.2f) );
   transform.Insert( DevelVisual::Transform::Property::OFFSET_POLICY, Vector2( Toolkit::DevelVisual::Transform::Policy::ABSOLUTE, Toolkit::DevelVisual::Transform::Policy::ABSOLUTE ) );
-  transform.Insert( DevelVisual::Transform::Property::ORIGIN, "TOP_BEGIN" );
+  transform.Insert( DevelVisual::Transform::Property::ORIGIN, "CENTER" );
   transform.Insert( DevelVisual::Transform::Property::ANCHOR_POINT, Toolkit::Align::BOTTOM_END );
 
   visual.SetTransformAndSize( transform, Vector2(100, 100) );
@@ -1488,7 +1489,7 @@ static void TestTransform( ToolkitTestApplication& application, Visual::Base vis
   {
     Property::Value* typeValue = map->Find( Toolkit::DevelVisual::Transform::Property::ORIGIN );
     DALI_TEST_CHECK( typeValue );
-    DALI_TEST_EQUALS( (Toolkit::Align::Type)typeValue->Get<int>(), Toolkit::Align::TOP_BEGIN, TEST_LOCATION );
+    DALI_TEST_EQUALS( (Toolkit::Align::Type)typeValue->Get<int>(), Toolkit::Align::CENTER, TEST_LOCATION );
   }
   {
     Property::Value* typeValue = map->Find( Toolkit::DevelVisual::Transform::Property::ANCHOR_POINT );
@@ -1529,7 +1530,7 @@ static void TestTransform( ToolkitTestApplication& application, Visual::Base vis
   index = renderer.GetPropertyIndex( "origin" );
   DALI_TEST_CHECK( index != Property::INVALID_INDEX );
   Vector2 parentOrigin = renderer.GetProperty<Vector2>( index );
-  DALI_TEST_EQUALS( parentOrigin, Vector2(-0.5f,-0.5f), TEST_LOCATION );
+  DALI_TEST_EQUALS( parentOrigin, Vector2(0.0f,0.0f), TEST_LOCATION );
 
   index = renderer.GetPropertyIndex( "anchorPoint" );
   DALI_TEST_CHECK( index != Property::INVALID_INDEX );
@@ -1556,12 +1557,12 @@ static void TestTransform( ToolkitTestApplication& application, Visual::Base vis
   offsetSizeMode = renderer.GetProperty<Vector4>( renderer.GetPropertyIndex( "offsetSizeMode" ) );
   DALI_TEST_EQUALS( offsetSizeMode, Vector4(0.0f,0.0f,1.0f,1.0f), TEST_LOCATION );
 
-  //Parent origin and anchor point should have default values
+  //Parent origin and anchor point should have the default values
   parentOrigin = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "origin" ) );
-  DALI_TEST_EQUALS( parentOrigin, Vector2(0.0f,0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( parentOrigin, Vector2(-0.5f,-0.5f), TEST_LOCATION );
 
   anchorPoint = renderer.GetProperty<Vector2>( renderer.GetPropertyIndex( "anchorPoint" ) );
-  DALI_TEST_EQUALS( anchorPoint, Vector2(0.0f,0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( anchorPoint, Vector2(0.5f,0.5f), TEST_LOCATION );
 }
 
 int UtcDaliVisualSetTransform0(void)
@@ -1864,7 +1865,7 @@ int UtcDaliVisualRendererRemovalAndReAddition(void)
   propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
   Visual::Base visual = factory.CreateVisual( propertyMap );
 
-  visual.SetDepthIndex( 1.f );
+  visual.SetDepthIndex( 1 );
 
   DummyControl dummyControl = DummyControl::New(true);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
@@ -1926,7 +1927,7 @@ int UtcDaliVisualTextVisualRender(void)
   propertyMap.Insert( "verticalAlignment", "CENTER" );
   propertyMap.Insert( "textColor", Color::RED );
   Visual::Base textVisual = factory.CreateVisual( propertyMap );
-  textVisual.SetDepthIndex( 1.f );
+  textVisual.SetDepthIndex( 1 );
 
   DummyControl dummyControl = DummyControl::New(true);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
@@ -1953,7 +1954,7 @@ int UtcDaliVisualTextVisualRender(void)
   propertyMap.Insert( DevelVisual::Property::TRANSFORM, transformMap );
 
   textVisual = factory.CreateVisual( propertyMap );
-  textVisual.SetDepthIndex( 1.f );
+  textVisual.SetDepthIndex( 1 );
 
   dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, textVisual );
   dummyControl.SetSize( 720.f, 640.f );
@@ -1995,7 +1996,7 @@ int UtcDaliVisualTextVisualDisableEnable(void)
   propertyMap.Insert( "verticalAlignment", "CENTER" );
   propertyMap.Insert( "textColor", Color::RED );
   Visual::Base textVisual = factory.CreateVisual( propertyMap );
-  textVisual.SetDepthIndex( 1.f );
+  textVisual.SetDepthIndex( 1 );
 
   DummyControl dummyControl = DummyControl::New(true);
   Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
@@ -2080,3 +2081,97 @@ int UtcDaliVisualPremultipliedAlpha(void)
 
   END_TEST;
 }
+
+int UtcDaliRegisterVisualOrder(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "Register Visual Order" );
+
+  DummyControl dummyControl = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
+
+  tet_infoline( "Register visual, should have depth index of 0.0f" );
+  Visual::Base testVisual = factory.CreateVisual( propertyMap );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, testVisual );
+  DALI_TEST_EQUALS( testVisual.GetDepthIndex(), 0, TEST_LOCATION );
+
+  tet_infoline( "Register more visuals, each added one should have a depth index greater than previous" );
+
+  Visual::Base testVisual2 = factory.CreateVisual( propertyMap );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, testVisual2 );
+  DALI_TEST_CHECK( testVisual2.GetDepthIndex() > testVisual.GetDepthIndex() );
+
+  Visual::Base foregroundVisual = factory.CreateVisual( propertyMap );
+  dummyImpl.RegisterVisual( DummyControl::Property::FOREGROUND_VISUAL, foregroundVisual );
+  DALI_TEST_CHECK( foregroundVisual.GetDepthIndex() > testVisual2.GetDepthIndex() );
+
+  Visual::Base focusVisual = factory.CreateVisual( propertyMap );
+  dummyImpl.RegisterVisual( DummyControl::Property::FOCUS_VISUAL, focusVisual );
+  DALI_TEST_CHECK( focusVisual.GetDepthIndex() > foregroundVisual.GetDepthIndex() );
+
+  tet_infoline( "Set depth index on a new visual before registering, the depth index should not have been changed" );
+  Visual::Base labelVisual = factory.CreateVisual( propertyMap );
+  labelVisual.SetDepthIndex( -2000 );
+  dummyImpl.RegisterVisual( DummyControl::Property::LABEL_VISUAL, labelVisual );
+  DALI_TEST_EQUALS( labelVisual.GetDepthIndex(), -2000, TEST_LOCATION );
+
+  tet_infoline( "Replace visual, the depth index should be the same as what was previously set" );
+  const int testVisual2DepthIndex = testVisual2.GetDepthIndex();
+  Visual::Base testVisual2Replacement = factory.CreateVisual( propertyMap );
+  DALI_TEST_CHECK( testVisual2Replacement.GetDepthIndex() != testVisual2DepthIndex );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, testVisual2Replacement );
+  DALI_TEST_EQUALS( testVisual2Replacement.GetDepthIndex(), testVisual2DepthIndex, TEST_LOCATION );
+
+  tet_infoline( "Replace visual and set a depth index on the replacement, the depth index of the replacement should be honoured" );
+  Visual::Base anotherTestVisual2Replacement = factory.CreateVisual( propertyMap );
+  anotherTestVisual2Replacement.SetDepthIndex( 2000 );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL2, anotherTestVisual2Replacement );
+  DALI_TEST_EQUALS( anotherTestVisual2Replacement.GetDepthIndex(), 2000, TEST_LOCATION );
+
+  dummyControl.SetSize(200.f, 200.f);
+  Stage::GetCurrent().Add( dummyControl );
+
+  END_TEST;
+}
+
+int UtcDaliRegisterVisualWithDepthIndex(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "Register a Visual With Depth Index" );
+
+  DummyControl dummyControl = DummyControl::New(true);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(dummyControl.GetImplementation());
+
+  VisualFactory factory = VisualFactory::Get();
+  Property::Map propertyMap;
+  propertyMap.Insert(Visual::Property::TYPE,  Visual::COLOR);
+  propertyMap.Insert(ColorVisual::Property::MIX_COLOR,  Color::BLUE);
+
+  tet_infoline( "Register a visual with a depth index, it should be enabled by default too" );
+  Visual::Base testVisual = factory.CreateVisual( propertyMap );
+  DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL, testVisual, 203 );
+  DALI_TEST_EQUALS( testVisual.GetDepthIndex(), 203, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL ), true, TEST_LOCATION );
+
+  tet_infoline( "Register another visual with a depth index and it disabled" );
+  Visual::Base testVisual2 = factory.CreateVisual( propertyMap );
+  DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, testVisual2, false, 450 );
+  DALI_TEST_EQUALS( testVisual2.GetDepthIndex(), 450, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL2 ), false, TEST_LOCATION );
+
+  tet_infoline( "Register another visual with a depth index and it enabled using the enabled API" );
+  Visual::Base testVisual3 = factory.CreateVisual( propertyMap );
+  DevelControl::RegisterVisual( dummyImpl, DummyControl::Property::TEST_VISUAL2, testVisual3, true, 300 );
+  DALI_TEST_EQUALS( testVisual3.GetDepthIndex(), 300, TEST_LOCATION );
+  DALI_TEST_EQUALS( DevelControl::IsVisualEnabled( dummyImpl, DummyControl::Property::TEST_VISUAL2 ), true, TEST_LOCATION );
+
+  dummyControl.SetSize(200.f, 200.f);
+  Stage::GetCurrent().Add( dummyControl );
+
+  END_TEST;
+}
index 77b2368..59fd144 100644 (file)
@@ -57,12 +57,24 @@ void RegisterVisual( Internal::Control& control, Dali::Property::Index index, To
   controlImpl.RegisterVisual( index, visual );
 }
 
+void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
+{
+  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
+  controlImpl.RegisterVisual( index, visual, depthIndex );
+}
+
 void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled )
 {
   Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
   controlImpl.RegisterVisual( index, visual, enabled );
 }
 
+void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
+{
+  Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
+  controlImpl.RegisterVisual( index, visual, enabled, depthIndex );
+}
+
 void UnregisterVisual( Internal::Control& control, Dali::Property::Index index )
 {
   Internal::Control::Impl& controlImpl = Internal::Control::Impl::Get( control );
index 7795df1..233ef12 100644 (file)
@@ -139,34 +139,66 @@ DALI_IMPORT_API ResourceReadySignalType& ResourceReadySignal( Control& control )
 DALI_IMPORT_API bool IsResourceReady( const Control& control );
 
 /**
- * @brief Register a visual by Property Index, linking an Actor to visual when required.
- * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
- * No parenting is done during registration, this should be done by derived class.
+ * @brief Register a visual by Property Index.
  *
  * @param[in] control The control
  * @param[in] index The Property index of the visual, used to reference visual
  * @param[in] visual The visual to register
+ *
  * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
  *       Use below API with enabled set to false if derived class wishes to control when visual is staged.
+ * @note If the depth-index is not set on the visual, then it is set to be above the currently registered visuals.
+ * @note If replacing a visual, then the depth-index of the visual being replaced is used for the visual.
  */
 DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual );
 
 /**
- * @brief Register a visual by Property Index, linking an Actor to visual when required.
+ * @brief Register a visual by Property Index with a depth index.
+ *
+ * @param[in] control The control
+ * @param[in] index The Property index of the visual, used to reference visual
+ * @param[in] visual The visual to register
+ * @param[in] depthIndex The visual's depth-index is set to this
  *
- * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
- * If enabled is false then the visual is not set on stage until enabled by the derived class.
- * @see EnableVisual
+ * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
+ *       Use below API with enabled set to false if derived class wishes to control when visual is staged.
+ *
+ * @see Visual::Base::GetDepthIndex()
+ * @see Visual::Base::SetDepthIndex()
+ */
+DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, int depthIndex );
+
+/**
+ * @brief Register a visual by Property Index with the option of enabling/disabling it.
  *
  * @param[in] control The control
  * @param[in] index The Property index of the visual, used to reference visual
  * @param[in] visual The visual to register
  * @param[in] enabled false if derived class wants to control when visual is set on stage.
  *
+ * @note If the depth-index is not set on the visual, then it is set to be above the currently registered visuals.
+ * @note If replacing a visual, then the depth-index of the visual being replaced is used for the visual.
+ *
+ * @see EnableVisual()
  */
 DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled );
 
 /**
+ * @brief Register a visual by Property Index with a depth index with the option of enabling/disabling it.
+ *
+ * @param[in] control The control
+ * @param[in] index The Property index of the visual, used to reference visual
+ * @param[in] visual The visual to register
+ * @param[in] enabled false if derived class wants to control when visual is set on stage.
+ * @param[in] depthIndex The visual's depth-index is set to this
+ *
+ * @see EnableVisual()
+ * @see Visual::Base::GetDepthIndex()
+ * @see Visual::Base::SetDepthIndex()
+ */
+DALI_IMPORT_API void RegisterVisual( Internal::Control& control, Dali::Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex );
+
+/**
  * @brief Erase the entry matching the given index from the list of registered visuals
  *
  * @param[in] control The control
index fbbfa2e..8028707 100755 (executable)
@@ -125,11 +125,21 @@ void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Bas
   DevelControl::RegisterVisual( *this, index, visual );
 }
 
+void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
+{
+  DevelControl::RegisterVisual( *this, index, visual, depthIndex );
+}
+
 void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled )
 {
   DevelControl::RegisterVisual( *this, index, visual, enabled );
 }
 
+void ControlWrapper::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
+{
+  DevelControl::RegisterVisual( *this, index, visual, enabled, depthIndex );
+}
+
 void ControlWrapper::UnregisterVisual( Property::Index index )
 {
   DevelControl::UnregisterVisual( *this, index );
index 85bc26c..899a575 100755 (executable)
@@ -118,9 +118,19 @@ public: // From Control
   /**
    * @ref Dali::Toolkit::DevelControl::RegisterVisual()
    */
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex );
+
+  /**
+   * @ref Dali::Toolkit::DevelControl::RegisterVisual()
+   */
   void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled );
 
   /**
+   * @ref Dali::Toolkit::DevelControl::RegisterVisual()
+   */
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex );
+
+  /**
    * @ref Dali::Toolkit::DevelControl::UnregisterVisual()
    */
   void UnregisterVisual( Property::Index index );
index cff3a39..473adba 100644 (file)
@@ -109,7 +109,26 @@ namespace Property
        * @brief The size of font in pixels.
        * @details name "pixelSize", type float
        */
-      PIXEL_SIZE
+      PIXEL_SIZE,
+
+      /**
+       * @brief The line count of text.
+       * @details name "lineCount", type int
+       * @note this property is read-only.
+       */
+      LINE_COUNT,
+
+      /**
+       * @brief The text to display when the TextEditor is empty and inactive.
+       * @details name "placeholderText", type string
+       */
+      PLACEHOLDER_TEXT,
+
+      /**
+       * @brief The placeholder-text color.
+       * @details name "placeholderTextColor", type vector4
+       */
+      PLACEHOLDER_TEXT_COLOR
   };
 } // namespace Property
 
index 40c6c70..12e9c75 100644 (file)
@@ -83,6 +83,13 @@ namespace Property
        *          values FINISH_LOOP, IMMEDIATE, defualt FINISH_LOOP
        */
       AUTO_SCROLL_STOP_MODE = OUTLINE + 4,
+
+      /*
+       * @brief The line count of text.
+       * @details name "lineCount", type int
+       * @node this property is read-only.
+       */
+      LINE_COUNT = OUTLINE + 5
   };
 } // namespace Property
 
index 6a19c9b..b6a51fb 100644 (file)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2015 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.
@@ -81,12 +81,12 @@ void Visual::Base::GetNaturalSize(Vector2& naturalSize )
   GetImplementation( *this ).GetNaturalSize( naturalSize );
 }
 
-void Visual::Base::SetDepthIndex( float index )
+void Visual::Base::SetDepthIndex( int index )
 {
   GetImplementation( *this ).SetDepthIndex( index );
 }
 
-float Visual::Base::GetDepthIndex() const
+int Visual::Base::GetDepthIndex() const
 {
   return GetImplementation( *this ).GetDepthIndex();
 }
index 4e2e0f5..65fb275 100644 (file)
@@ -170,14 +170,14 @@ public:
    *
    * @param[in] index The depth index of this visual.
    */
-  void SetDepthIndex( float index );
+  void SetDepthIndex( int index );
 
   /**
    * @brief Get the depth index of this visual
    *
    * @return The depth index of this visual.
    */
-  float GetDepthIndex() const;
+  int GetDepthIndex() const;
 
   /**
    * @brief Create the property map representing this visual.
index adecf39..18362b6 100644 (file)
@@ -136,6 +136,7 @@ enum Type
    * @brief The origin of the visual within its control area.
    * @details Name "origin", type Align::Type (Property::INTEGER) or Property::STRING.
    * @see Toolkit::Align
+   * @note The default is Align::TOP_BEGIN.
    */
   ORIGIN,
 
@@ -143,6 +144,7 @@ enum Type
    * @brief The anchor-point of the visual
    * @details Name "anchorPoint", type Align::Type (Property::INTEGER) or Property::STRING.
    * @see Toolkit::Align
+   * @note The default is Align::TOP_BEGIN.
    */
   ANCHOR_POINT,
 
index b52e46c..149cb4a 100644 (file)
@@ -422,7 +422,7 @@ Button::Align Button::GetLabelAlignment()
  * 4) Unregister visual if empty map was provided. This is the method to remove a visual
  */
 
-void Button::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const float visualDepth )
+void Button::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth )
 {
   DALI_LOG_INFO( gLogButtonFilter, Debug::Verbose, "CreateVisualsForComponent index(%d)\n", index );
   Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
@@ -453,8 +453,7 @@ void Button::CreateVisualsForComponent( Property::Index index, const Property::V
   {
     DALI_LOG_INFO( gLogButtonFilter, Debug::Verbose, "CreateVisualsForComponent RegisterVisual index(%d) enabled(%s)\n",
                    index, DevelControl::IsVisualEnabled( *this, index )?"true":"false" );
-    buttonVisual.SetDepthIndex( visualDepth );
-    DevelControl::RegisterVisual( *this, index, buttonVisual, DevelControl::IsVisualEnabled( *this, index ) );
+    DevelControl::RegisterVisual( *this, index, buttonVisual, DevelControl::IsVisualEnabled( *this, index ), visualDepth );
   }
   else
   {
index 210246e..8b1417c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_BUTTON_H
 
 /*
- * Copyright (c) 2014 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.
@@ -588,7 +588,7 @@ protected:
    * @param[in] value the value to set on the component
    * @param[in] visualDepth the depth of the visual if overlapping another
    */
-  void CreateVisualsForComponent( Property::Index index ,const Property::Value& value, const float visualDepth );
+  void CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth );
 
   /**
    * @brief Get the Property map for the given Visual
index f20e489..304ba78 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <cstring>
+#include <limits>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
@@ -383,11 +384,26 @@ bool Control::Impl::IsResourceReady() const
 
 void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual )
 {
-  RegisterVisual( index, visual, true );
+  RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::NOT_SET );
+}
+
+void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex )
+{
+  RegisterVisual( index, visual, VisualState::ENABLED, DepthIndexValue::SET, depthIndex );
 }
 
 void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled )
 {
+  RegisterVisual( index, visual, ( enabled ? VisualState::ENABLED : VisualState::DISABLED ), DepthIndexValue::NOT_SET );
+}
+
+void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex )
+{
+  RegisterVisual( index, visual, ( enabled ? VisualState::ENABLED : VisualState::DISABLED ), DepthIndexValue::SET, depthIndex );
+}
+
+void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex )
+{
   bool visualReplaced ( false );
   Actor self = mControlImpl.Self();
 
@@ -402,10 +418,19 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
         Toolkit::GetImplementation((*iter)->visual).SetOffStage( self );
       }
 
+      // If we've not set the depth-index value and the new visual does not have a depth index applied to it, then use the previously set depth-index for this index
+      if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
+          ( visual.GetDepthIndex() == 0 ) )
+      {
+        const int currentDepthIndex = (*iter)->visual.GetDepthIndex();
+        visual.SetDepthIndex( currentDepthIndex );
+      }
+
       StopObservingVisual( (*iter)->visual );
       StartObservingVisual( visual );
 
       (*iter)->visual = visual;
+      (*iter)->enabled = ( enabled == VisualState::ENABLED ) ? true : false;
       visualReplaced = true;
     }
   }
@@ -433,16 +458,47 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base
 
   if( !visualReplaced ) // New registration entry
   {
-    mVisuals.PushBack( new RegisteredVisual( index, visual, enabled ) );
+    mVisuals.PushBack( new RegisteredVisual( index, visual, ( enabled == VisualState::ENABLED ? true : false ) ) );
 
     // monitor when the visuals resources are ready
     StartObservingVisual( visual );
 
+    // If we've not set the depth-index value, we have more than one visual and the visual does not have a depth index, then set it to be the highest
+    if( ( depthIndexValueSet == DepthIndexValue::NOT_SET ) &&
+        ( mVisuals.Size() > 1 ) &&
+        ( visual.GetDepthIndex() == 0 ) )
+    {
+      int maxDepthIndex = std::numeric_limits< int >::min();
+
+      RegisteredVisualContainer::ConstIterator iter;
+      const RegisteredVisualContainer::ConstIterator endIter = mVisuals.End();
+      for ( iter = mVisuals.Begin(); iter != endIter; iter++ )
+      {
+        const int visualDepthIndex = (*iter)->visual.GetDepthIndex();
+        if ( visualDepthIndex > maxDepthIndex )
+        {
+          maxDepthIndex = visualDepthIndex;
+        }
+      }
+
+      ++maxDepthIndex; // Add one to the current maximum depth index so that our added visual appears on top
+      visual.SetDepthIndex( maxDepthIndex );
+    }
   }
 
-  if( visual && self.OnStage() && enabled )
+  if( visual )
   {
-    Toolkit::GetImplementation(visual).SetOnStage( self );
+    // If the caller has set the depth-index, then set it here
+    if( depthIndexValueSet == DepthIndexValue::SET )
+    {
+      visual.SetDepthIndex( depthIndex );
+    }
+
+    // Put on stage if enabled and the control is already on the stage
+    if( ( enabled == VisualState::ENABLED ) && self.OnStage() )
+    {
+      Toolkit::GetImplementation(visual).SetOnStage( self );
+    }
   }
 
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::RegisterVisual() Registered %s(%d), enabled:%s\n",  visual.GetName().c_str(), index, enabled?"T":"F" );
@@ -737,8 +793,7 @@ void Control::Impl::SetProperty( BaseObject* object, Property::Index index, cons
           Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( url, ImageDimensions() );
           if( visual )
           {
-            controlImpl.mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual );
-            visual.SetDepthIndex( DepthIndex::BACKGROUND );
+            controlImpl.mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
           }
         }
         else if( value.Get( color ) )
index 2ee216f..eceaa31 100644 (file)
@@ -133,9 +133,19 @@ public:
   /**
    * @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
    */
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, int depthIndex );
+
+  /**
+   * @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
+   */
   void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled );
 
   /**
+   * @copydoc Dali::Toolkit::DevelControl::RegisterVisual()
+   */
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, bool enabled, int depthIndex );
+
+  /**
    * @copydoc Dali::Toolkit::DevelControl::UnregisterVisual()
    */
   void UnregisterVisual( Property::Index index );
@@ -249,6 +259,44 @@ public:
    */
   bool IsResourceReady() const;
 
+private:
+
+  /**
+   * Used as an alternative to boolean so that it is obvious whether a visual is enabled/disabled.
+   */
+  struct VisualState
+  {
+    enum Type
+    {
+      DISABLED = 0, ///< Visual disabled.
+      ENABLED = 1   ///< Visual enabled.
+    };
+  };
+
+  /**
+   * Used as an alternative to boolean so that it is obvious whether a visual's depth value has been set or not by the caller.
+   */
+  struct DepthIndexValue
+  {
+    enum Type
+    {
+      NOT_SET = 0, ///< Visual depth value not set by caller.
+      SET = 1      ///< Visual depth value set by caller.
+    };
+  };
+
+  /**
+   * @brief Adds the visual to the list of registered visuals.
+   * @param[in] index The Property index of the visual, used to reference visual
+   * @param[in] visual The visual to register
+   * @param[in] enabled false if derived class wants to control when visual is set on stage
+   * @param[in] depthIndexValueSet Set to true if the depthIndex has actually been set manually
+   * @param[in] depthIndex The visual's depth-index is set to this
+   */
+  void RegisterVisual( Property::Index index, Toolkit::Visual::Base& visual, VisualState::Type enabled, DepthIndexValue::Type depthIndexValueSet, int depthIndex = 0 );
+
+public:
+
   Control& mControlImpl;
   DevelControl::State mState;
   std::string mSubStateName;
index db76861..8adc19d 100644 (file)
@@ -428,8 +428,7 @@ void EffectsView::AllocateResources()
 
     mImageForChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
     Internal::InitializeVisual( self, mVisualForChildren, mImageForChildren );
-    DevelControl::RegisterVisual( *this, CHILD_VISUAL, mVisualForChildren );
-    mVisualForChildren.SetDepthIndex( DepthIndex::CONTENT+1 );
+    DevelControl::RegisterVisual( *this, CHILD_VISUAL, mVisualForChildren, DepthIndex::CONTENT + 1 );
 
     mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
     TextureSet textureSet = TextureSet::New();
index 24b1aa4..a537621 100755 (executable)
@@ -350,7 +350,7 @@ Toolkit::TransitionData ProgressBar::ConvertPropertyToTransition( const Property
  * 4) Unregister visual if empty map was provided. This is the method to remove a visual
  */
 
-void ProgressBar::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const float visualDepth )
+void ProgressBar::CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth )
 {
   Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get();
   Toolkit::Visual::Base progressVisual;
@@ -375,14 +375,13 @@ void ProgressBar::CreateVisualsForComponent( Property::Index index, const Proper
 
   if ( progressVisual )
   {
-    progressVisual.SetDepthIndex( visualDepth );
     if( index == Toolkit::ProgressBar::Property::INDETERMINATE_VISUAL )
     {
-      DevelControl::RegisterVisual( *this, index, progressVisual, mIndeterminate );
+      DevelControl::RegisterVisual( *this, index, progressVisual, mIndeterminate, visualDepth );
     }
     else
     {
-      DevelControl::RegisterVisual( *this, index, progressVisual, true );
+      DevelControl::RegisterVisual( *this, index, progressVisual, true, visualDepth );
     }
   }
   else
index b59c8b3..5c98cb0 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_PROGRESS_BAR_H
 
 /*
- * 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.
@@ -225,7 +225,7 @@ private:
   /**
    * Update progress bar label when progress value is changed
    */
-  void CreateVisualsForComponent( Property::Index index, const Property::Value& value, const float visualDepth );
+  void CreateVisualsForComponent( Property::Index index, const Property::Value& value, const int visualDepth );
 
   /**
    * Update progress bar label when progress value is changed
index 7f27217..9e4f57e 100755 (executable)
@@ -25,7 +25,6 @@
 
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
-#include <dali/devel-api/common/set-wrapper.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/wheel-event.h>
 #include <dali/public-api/events/touch-data.h>
@@ -45,7 +44,6 @@
 #include <dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h>
 
 using std::string;
-using std::set;
 using namespace Dali;
 
 namespace // Unnamed namespace
@@ -280,19 +278,29 @@ DALI_ACTION_REGISTRATION(              Toolkit, ItemView, "disableRefresh",
 
 DALI_TYPE_REGISTRATION_END()
 
-bool FindById( const ItemContainer& items, ItemId id )
+const ItemIter FindItemById( ItemContainer& items, ItemId id )
 {
-  for( ConstItemIter iter = items.begin(); items.end() != iter; ++iter )
+  for( ItemIter iter = items.begin(); items.end() != iter; ++iter )
   {
     if( iter->first == id )
     {
-      return true;
+      return iter;
     }
   }
 
-  return false;
+  return items.end();
 }
 
+void InsertToItemContainer( ItemContainer& items, Item item )
+{
+  if( items.end() == FindItemById( items, item.first ) )
+  {
+    ItemIter iterToInsert = std::lower_bound( items.begin(), items.end(), item );
+    items.insert( iterToInsert, item );
+  }
+}
+
+
 /**
   * Helper to apply size constraint to mOvershootOverlay
   * @param[in] overshootOverlay The overshootOverlay actor
@@ -427,7 +435,7 @@ void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSiz
 
   // Move the items to the new layout positions...
 
-  for (ConstItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
+  for (ConstItemIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
   {
     unsigned int itemId = iter->first;
     Actor actor = iter->second;
@@ -494,7 +502,7 @@ void ItemView::DeactivateCurrentLayout()
 {
   if (mActiveLayout)
   {
-    for (ConstItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
+    for (ConstItemIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
     {
       Actor actor = iter->second;
       actor.RemoveConstraints();
@@ -521,7 +529,7 @@ void ItemView::OnRefreshNotification(PropertyNotification& source)
 
 void ItemView::Refresh()
 {
-  for (ItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter )
+  for (ConstItemIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter )
   {
     ReleaseActor( iter->first, iter->second );
   }
@@ -622,10 +630,13 @@ Actor ItemView::GetItem(unsigned int itemId) const
 {
   Actor actor;
 
-  ConstItemPoolIter iter = mItemPool.find( itemId );
-  if( iter != mItemPool.end() )
+  for ( ConstItemIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter )
   {
-    actor = iter->second;
+    if( iter->first == itemId )
+    {
+      actor = iter->second;
+      break;
+    }
   }
 
   return actor;
@@ -635,7 +646,7 @@ unsigned int ItemView::GetItemId( Actor actor ) const
 {
   unsigned int itemId( 0 );
 
-  for ( ConstItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter )
+  for ( ConstItemIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter )
   {
     if( iter->second == actor )
     {
@@ -653,9 +664,9 @@ void ItemView::InsertItem( Item newItem, float durationSeconds )
   Vector3 layoutSize = Self().GetCurrentSize();
 
   Actor displacedActor;
-  ItemPoolIter afterDisplacedIter = mItemPool.end();
+  ItemIter afterDisplacedIter = mItemPool.end();
 
-  ItemPoolIter foundIter = mItemPool.find( newItem.first );
+  ItemIter foundIter = FindItemById( mItemPool, newItem.first );
   if( mItemPool.end() != foundIter )
   {
     SetupActor( newItem, layoutSize );
@@ -669,12 +680,12 @@ void ItemView::InsertItem( Item newItem, float durationSeconds )
   else
   {
     // Inserting before the existing item range?
-    ItemPoolIter iter = mItemPool.begin();
+    ItemIter iter = mItemPool.begin();
     if( iter != mItemPool.end() &&
         iter->first > newItem.first )
     {
       displacedActor = iter->second;
-      mItemPool.erase( iter++ ); // iter is still valid after the erase
+      iter = mItemPool.erase( iter ); // iter is still valid after the erase
 
       afterDisplacedIter = iter;
     }
@@ -683,7 +694,7 @@ void ItemView::InsertItem( Item newItem, float durationSeconds )
   if( displacedActor )
   {
     // Move the existing actors to make room
-    for( ItemPoolIter iter = afterDisplacedIter; mItemPool.end() != iter; ++iter )
+    for( ItemIter iter = afterDisplacedIter; mItemPool.end() != iter; ++iter )
     {
       Actor temp = iter->second;
       iter->second = displacedActor;
@@ -694,12 +705,12 @@ void ItemView::InsertItem( Item newItem, float durationSeconds )
     }
 
     // Create last item
-    ItemPool::reverse_iterator lastIter = mItemPool.rbegin();
+    ItemContainer::reverse_iterator lastIter = mItemPool.rbegin();
     if ( lastIter != mItemPool.rend() )
     {
       ItemId lastId = lastIter->first;
       Item lastItem( lastId + 1, displacedActor );
-      mItemPool.insert( lastItem );
+      InsertToItemContainer( mItemPool, lastItem );
 
       lastItem.second.RemoveConstraints();
       mActiveLayout->ApplyConstraints( lastItem.second, lastItem.first, layoutSize, Self() );
@@ -717,24 +728,21 @@ void ItemView::InsertItems( const ItemContainer& newItems, float durationSeconds
   Vector3 layoutSize = Self().GetCurrentSize();
 
   // Insert from lowest id to highest
-  std::set<Item> sortedItems;
-  for( ConstItemIter iter = newItems.begin(); newItems.end() != iter; ++iter )
-  {
-    sortedItems.insert( *iter );
-  }
+  ItemContainer sortedItems(newItems);
+  std::sort( sortedItems.begin(), sortedItems.end() );
 
-  for( std::set<Item>::iterator iter = sortedItems.begin(); sortedItems.end() != iter; ++iter )
+  for( ItemIter iter = sortedItems.begin(); sortedItems.end() != iter; ++iter )
   {
     Self().Add( iter->second );
 
-    ItemPoolIter foundIter = mItemPool.find( iter->first );
+    ItemIter foundIter = FindItemById( mItemPool, iter->first );
     if( mItemPool.end() != foundIter )
     {
       Actor moveMe = foundIter->second;
       foundIter->second = iter->second;
 
       // Move the existing actors to make room
-      for( ItemPoolIter iter = ++foundIter; mItemPool.end() != iter; ++iter )
+      for( ItemIter iter = ++foundIter; mItemPool.end() != iter; ++iter )
       {
         Actor temp = iter->second;
         iter->second = moveMe;
@@ -744,19 +752,19 @@ void ItemView::InsertItems( const ItemContainer& newItems, float durationSeconds
       // Create last item
       ItemId lastId = mItemPool.rbegin()->first;
       Item lastItem( lastId + 1, moveMe );
-      mItemPool.insert( lastItem );
+      InsertToItemContainer( mItemPool, lastItem );
     }
     else
     {
-      mItemPool.insert( *iter );
+      InsertToItemContainer( mItemPool, *iter );
     }
   }
 
   // Relayout everything
-  for (ItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
+  for (ItemIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
   {
     // If newly inserted
-    if( FindById( newItems, iter->first ) )
+    if( std::binary_search( sortedItems.begin(), sortedItems.end(), *iter ) )
     {
       SetupActor( *iter, layoutSize );
     }
@@ -788,13 +796,10 @@ void ItemView::RemoveItems( const ItemIdContainer& itemIds, float durationSecond
   bool actorsReordered( false );
 
   // Remove from highest id to lowest
-  set<ItemId> sortedItems;
-  for( ConstItemIdIter iter = itemIds.begin(); itemIds.end() != iter; ++iter )
-  {
-    sortedItems.insert( *iter );
-  }
+  ItemIdContainer sortedItems(itemIds);
+  std::sort( sortedItems.begin(), sortedItems.end() );
 
-  for( set<ItemId>::reverse_iterator iter = sortedItems.rbegin(); sortedItems.rend() != iter; ++iter )
+  for( ItemIdContainer::reverse_iterator iter = sortedItems.rbegin(); sortedItems.rend() != iter; ++iter )
   {
     if( RemoveActor( *iter ) )
     {
@@ -814,7 +819,7 @@ bool ItemView::RemoveActor(unsigned int itemId)
 {
   bool reordered( false );
 
-  ItemPoolIter removeIter = mItemPool.find( itemId );
+  ItemIter removeIter = FindItemById( mItemPool, itemId );
   if( removeIter != mItemPool.end() )
   {
     ReleaseActor(itemId, removeIter->second);
@@ -822,12 +827,12 @@ bool ItemView::RemoveActor(unsigned int itemId)
   else
   {
     // Removing before the existing item range?
-    ItemPoolIter iter = mItemPool.begin();
+    ItemIter iter = mItemPool.begin();
     if( iter != mItemPool.end() &&
         iter->first > itemId )
     {
       // In order to decrement the first visible item ID
-      mItemPool.insert( Item(iter->first - 1, Actor()) );
+      InsertToItemContainer( mItemPool, Item(iter->first - 1, Actor()) );
 
       removeIter = mItemPool.begin();
     }
@@ -843,11 +848,11 @@ bool ItemView::RemoveActor(unsigned int itemId)
     //     ID 2 - ActorB       ID 2 - ActorC (previously ID 3)
     //     ID 3 - ActorC       ID 3 - ActorB (previously ID 4)
     //     ID 4 - ActorD
-    for (ItemPoolIter iter = removeIter; iter != mItemPool.end(); ++iter)
+    for (ItemIter iter = removeIter; iter != mItemPool.end(); ++iter)
     {
       if( iter->first < mItemPool.rbegin()->first )
       {
-        iter->second = mItemPool[ iter->first + 1 ];
+        iter->second = ( iter + 1 )->second;
       }
       else
       {
@@ -868,7 +873,7 @@ void ItemView::ReplaceItem( Item replacementItem, float durationSeconds )
   SetupActor( replacementItem, layoutSize );
   Self().Add( replacementItem.second );
 
-  const ItemPoolIter iter = mItemPool.find( replacementItem.first );
+  const ItemIter iter = FindItemById( mItemPool, replacementItem.first );
   if( mItemPool.end() != iter )
   {
     ReleaseActor(iter->first, iter->second);
@@ -876,7 +881,7 @@ void ItemView::ReplaceItem( Item replacementItem, float durationSeconds )
   }
   else
   {
-    mItemPool.insert( replacementItem );
+    InsertToItemContainer( mItemPool, replacementItem );
   }
 
   CalculateDomainSize( layoutSize );
@@ -895,7 +900,7 @@ void ItemView::ReplaceItems( const ItemContainer& replacementItems, float durati
 void ItemView::RemoveActorsOutsideRange( ItemRange range )
 {
   // Remove unwanted actors from the ItemView & ItemPool
-  for (ItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); )
+  for (ItemIter iter = mItemPool.begin(); iter != mItemPool.end(); )
   {
     unsigned int current = iter->first;
 
@@ -903,7 +908,7 @@ void ItemView::RemoveActorsOutsideRange( ItemRange range )
     {
       ReleaseActor(iter->first, iter->second);
 
-      mItemPool.erase( iter++ ); // erase invalidates the return value of post-increment; iter remains valid
+      iter = mItemPool.erase( iter ); // iter is still valid after the erase
     }
     else
     {
@@ -941,7 +946,7 @@ void ItemView::AddNewActor( unsigned int itemId, const Vector3& layoutSize )
 {
   mAddingItems = true;
 
-  if( mItemPool.end() == mItemPool.find( itemId ) )
+  if( mItemPool.end() == FindItemById( mItemPool, itemId ) )
   {
     Actor actor = mItemFactory.NewItem( itemId );
 
@@ -949,7 +954,7 @@ void ItemView::AddNewActor( unsigned int itemId, const Vector3& layoutSize )
     {
       Item newItem( itemId, actor );
 
-      mItemPool.insert( newItem );
+      InsertToItemContainer( mItemPool, newItem );
 
       SetupActor( newItem, layoutSize );
       Self().Add( actor );
@@ -1073,7 +1078,7 @@ void ItemView::ReapplyAllConstraints()
 {
   Vector3 layoutSize = Self().GetCurrentSize();
 
-  for (ConstItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
+  for (ConstItemIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
   {
     unsigned int id = iter->first;
     Actor actor = iter->second;
@@ -1673,7 +1678,7 @@ void ItemView::SetItemsParentOrigin( const Vector3& parentOrigin )
   if( parentOrigin != mItemsParentOrigin )
   {
     mItemsParentOrigin = parentOrigin;
-    for (ItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
+    for (ItemIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
     {
       iter->second.SetParentOrigin(parentOrigin);
     }
@@ -1690,7 +1695,7 @@ void ItemView::SetItemsAnchorPoint( const Vector3& anchorPoint )
   if( anchorPoint != mItemsAnchorPoint )
   {
     mItemsAnchorPoint = anchorPoint;
-    for (ItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
+    for (ItemIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
     {
       iter->second.SetAnchorPoint(anchorPoint);
     }
index d0a2bf1..1bb4d2a 100755 (executable)
@@ -22,7 +22,6 @@
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/object/property-notification.h>
-#include <dali/devel-api/common/map-wrapper.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/object/property-array.h>
 
@@ -608,13 +607,9 @@ private:
 
 private:
 
-  typedef std::map<unsigned int, Actor> ItemPool;
-  typedef ItemPool::iterator            ItemPoolIter;
-  typedef ItemPool::const_iterator      ConstItemPoolIter;
-
   Property::Array mlayoutArray;
 
-  ItemPool mItemPool;
+  ItemContainer mItemPool;
   ItemFactory& mItemFactory;
   std::vector< ItemLayoutPtr > mLayouts;            ///< Container of Dali::Toolkit::ItemLayout objects
   Actor mOvershootOverlay;                          ///< The overlay actor for overshoot effect
index 581b87e..9721dcf 100644 (file)
@@ -174,8 +174,7 @@ void SuperBlurView::SetImage(Image inputImage)
   Actor self( Self() );
 
   mVisuals[0] = Toolkit::VisualFactory::Get().CreateVisual( mInputImage );
-  DevelControl::RegisterVisual( *this, 0, mVisuals[0] ); // Will clean up previously registered visuals for this index.
-  mVisuals[0].SetDepthIndex(0);
+  DevelControl::RegisterVisual( *this, 0, mVisuals[0], 0 ); // Will clean up previously registered visuals for this index.
   // custom shader is not applied on the original image.
 
   BlurImage( 0,  inputImage);
@@ -283,8 +282,7 @@ void SuperBlurView::OnSizeSet( const Vector3& targetSize )
                                                 GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT );
 
       mVisuals[i] = Toolkit::VisualFactory::Get().CreateVisual( mBlurredImage[i - 1] );
-      DevelControl::RegisterVisual( *this, i, mVisuals[i] ); // Will clean up existing visual with same index.
-      mVisuals[i].SetDepthIndex( i );
+      DevelControl::RegisterVisual( *this, i, mVisuals[i], int( i ) ); // Will clean up existing visual with same index.
       SetShaderEffect( mVisuals[i] );
     }
 
index 5be99a6..ca78a26 100644 (file)
@@ -32,6 +32,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/text/rendering-backend.h>
 #include <dali-toolkit/public-api/visuals/color-visual-properties.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
@@ -134,6 +135,9 @@ DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableScrollBar",
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "scrollBarShowDuration",          FLOAT,     SCROLL_BAR_SHOW_DURATION             )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "scrollBarFadeDuration",          FLOAT,     SCROLL_BAR_FADE_DURATION             )
 DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "pixelSize",                      FLOAT,     PIXEL_SIZE                           )
+DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextEditor, "lineCount",            INTEGER,   LINE_COUNT                           )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderText",                STRING,    PLACEHOLDER_TEXT                     )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderTextColor",           VECTOR4,   PLACEHOLDER_TEXT_COLOR               )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged",        SIGNAL_TEXT_CHANGED )
 DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged",  SIGNAL_INPUT_STYLE_CHANGED )
@@ -660,6 +664,32 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P
         }
         break;
       }
+      case Toolkit::DevelTextEditor::Property::PLACEHOLDER_TEXT:
+      {
+        if( impl.mController )
+        {
+          const std::string& text = value.Get< std::string >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor::OnPropertySet %p PLACEHOLDER_TEXT %s\n", impl.mController.Get(), text.c_str() );
+
+          impl.mController->SetPlaceholderText( text );
+        }
+        break;
+      }
+      case Toolkit::DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR:
+      {
+        if( impl.mController )
+        {
+          const Vector4& textColor = value.Get< Vector4 >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p PLACEHOLDER_TEXT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), textColor.r, textColor.g, textColor.b, textColor.a );
+
+          if( impl.mController->GetPlaceholderTextColor() != textColor )
+          {
+            impl.mController->SetPlaceholderTextColor( textColor );
+            impl.mRenderer.Reset();
+          }
+        }
+        break;
+      }
     } // switch
   } // texteditor
 }
@@ -994,6 +1024,33 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind
         }
         break;
       }
+      case Toolkit::DevelTextEditor::Property::LINE_COUNT:
+      {
+        if( impl.mController )
+        {
+          float width = textEditor.GetProperty( Actor::Property::SIZE_WIDTH ).Get<float>();
+          value = impl.mController->GetLineCount( width );
+        }
+        break;
+      }
+      case Toolkit::DevelTextEditor::Property::PLACEHOLDER_TEXT:
+      {
+        if( impl.mController )
+        {
+          std::string text;
+          impl.mController->GetPlaceholderText( text );
+          value = text;
+        }
+        break;
+      }
+      case Toolkit::DevelTextEditor::Property::PLACEHOLDER_TEXT_COLOR:
+      {
+        if( impl.mController )
+        {
+          value = impl.mController->GetPlaceholderTextColor();
+        }
+        break;
+      }
     } //switch
   }
 
@@ -1459,6 +1516,15 @@ void TextEditor::UpdateScrollBar()
 
     mScrollBar.SetScrollPropertySource(self, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
 
+    // Set style name of ScrollBar for styling
+    mScrollBar.SetStyleName("TextEditorScrollBar");
+    Toolkit::Control scrollIndicator = Toolkit::Control::DownCast( mScrollBar.GetScrollIndicator() );
+    if( scrollIndicator )
+    {
+      // Set style name of ScrollBarIndicator for styling
+      scrollIndicator.SetStyleName("TextEditorScrollBarIndicator");
+    }
+
     self.Add( mScrollBar );
   }
   else
index b1c031c..5f17f00 100644 (file)
@@ -117,7 +117,8 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "outline",                   MAP
 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_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "autoScrollStopMode",  STRING,  AUTO_SCROLL_STOP_MODE  )
+DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextLabel, "lineCount", INTEGER, LINE_COUNT             )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -349,7 +350,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr
              {
                if( impl.mTextScroller )
                {
-                 impl.mTextScroller->SetLoopCount( 0 ); // Causes the current animation to finish playing (0)
+                 impl.mTextScroller->StopScrolling();
                }
              }
              // If request is enable (true) then start autoscroll as not already running
@@ -736,6 +737,15 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde
         }
         break;
       }
+      case Toolkit::DevelTextLabel::Property::LINE_COUNT:
+      {
+        if( impl.mController )
+        {
+          float width = label.GetProperty( Actor::Property::SIZE_WIDTH ).Get<float>();
+          value = impl.mController->GetLineCount( width );
+        }
+        break;
+      }
     }
   }
 
@@ -881,7 +891,7 @@ void TextLabel::SetUpAutoScrolling()
     // If speed, loopCount or gap not set via property system then will need to create a TextScroller with defaults
     mTextScroller = Text::TextScroller::New( *this );
   }
-  mTextScroller->SetParameters( mRenderableActor, controlSize, offScreenSize, direction, alignmentOffset );
+  mTextScroller->SetParameters( mRenderableActor, controlSize, offScreenSize, direction, alignmentOffset, mController->GetHorizontalAlignment() );
 
   Actor self = Self();
   self.Add( mTextScroller->GetScrollingText() );
index 597fee1..c167f81 100644 (file)
@@ -850,8 +850,7 @@ void TextSelectionPopup::CreateBackgroundBorder( Property::Map& propertyMap )
 
     if( visual )
     {
-      DevelControl::RegisterVisual( *this, Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER, visual );
-      visual.SetDepthIndex( DepthIndex::CONTENT );
+      DevelControl::RegisterVisual( *this, Toolkit::TextSelectionPopup::Property::BACKGROUND_BORDER, visual, DepthIndex::CONTENT );
     }
   }
 }
index df61ff2..339b321 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_TEXT_LAYOUT_ALIGNMENT_H
 
 /*
- * 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.
@@ -53,6 +53,12 @@ enum VerticalAlignment
   VERTICAL_ALIGN_BOTTOM
 };
 
+enum AlignmentCount
+{
+  HORIZONTAL_ALIGN_COUNT = HORIZONTAL_ALIGN_END + 1,
+  VERTICAL_ALIGN_COUNT = VERTICAL_ALIGN_BOTTOM + 1
+};
+
 } // namespace Layout
 
 } // namespace Text
index d09e1ed..f119650 100644 (file)
@@ -70,6 +70,7 @@ namespace Text
 EventData::EventData( DecoratorPtr decorator )
 : mDecorator( decorator ),
   mImfManager(),
+  mPlaceholderText(),
   mPlaceholderTextActive(),
   mPlaceholderTextInactive(),
   mPlaceholderTextColor( 0.8f, 0.8f, 0.8f, 0.8f ),
index 3014edb..e9d99f1 100644 (file)
@@ -104,6 +104,7 @@ struct EventData
 
   DecoratorPtr       mDecorator;               ///< Pointer to the decorator.
   ImfManager         mImfManager;              ///< The Input Method Framework Manager.
+  std::string        mPlaceholderText;         ///< The text to display when the TextField is empty.
   std::string        mPlaceholderTextActive;   ///< The text to display when the TextField is empty with key-input focus.
   std::string        mPlaceholderTextInactive; ///< The text to display when the TextField is empty and inactive.
   Vector4            mPlaceholderTextColor;    ///< The in/active placeholder text color.
@@ -383,10 +384,9 @@ struct Controller::Impl
    */
   bool IsPlaceholderAvailable() const
   {
-    return ( mEventData &&
-             ( !mEventData->mPlaceholderTextInactive.empty() ||
-               !mEventData->mPlaceholderTextActive.empty() )
-           );
+    return ( mEventData && ( !mEventData->mPlaceholderText.empty() ||
+                             !mEventData->mPlaceholderTextInactive.empty() ||
+                             !mEventData->mPlaceholderTextActive.empty() ) );
   }
 
   bool IsShowingPlaceholderText() const
@@ -399,7 +399,8 @@ struct Controller::Impl
    */
   bool IsFocusedPlaceholderAvailable() const
   {
-    return ( mEventData && !mEventData->mPlaceholderTextActive.empty() );
+    return ( mEventData && ( !mEventData->mPlaceholderTextActive.empty() ||
+                             !mEventData->mPlaceholderText.empty() ) );
   }
 
   bool IsShowingRealText() const
index a502200..f9445b5 100644 (file)
@@ -512,6 +512,22 @@ void Controller::GetText( std::string& text ) const
   }
 }
 
+void Controller::SetPlaceholderText( const std::string& text )
+{
+  if( NULL != mImpl->mEventData )
+  {
+    mImpl->mEventData->mPlaceholderText = text;
+
+    // Update placeholder if there is no text
+    if( mImpl->IsShowingPlaceholderText() ||
+        ( 0u == mImpl->mModel->mLogicalModel->mText.Count() ) )
+    {
+      ShowPlaceholderText();
+    }
+  }
+}
+
+// This is overloading function for PLACEHOLDER_TEXT_FOCUSED in text-field
 void Controller::SetPlaceholderText( PlaceholderType type, const std::string& text )
 {
   if( NULL != mImpl->mEventData )
@@ -534,6 +550,15 @@ void Controller::SetPlaceholderText( PlaceholderType type, const std::string& te
   }
 }
 
+void Controller::GetPlaceholderText( std::string& text ) const
+{
+  if( NULL != mImpl->mEventData )
+  {
+    text = mImpl->mEventData->mPlaceholderText;
+  }
+}
+
+// This is overloading function for PLACEHOLDER_TEXT_FOCUSED in text-field
 void Controller::GetPlaceholderText( PlaceholderType type, std::string& text ) const
 {
   if( NULL != mImpl->mEventData )
@@ -1599,6 +1624,13 @@ float Controller::GetHeightForWidth( float width )
   return layoutSize.height;
 }
 
+int Controller::GetLineCount( float width )
+{
+  GetHeightForWidth( width );
+  int numberofLines = mImpl->mModel->GetNumberOfLines();
+  return numberofLines;
+}
+
 const ModelInterface* const Controller::GetTextModel() const
 {
   return mImpl->mModel.Get();
@@ -3195,17 +3227,27 @@ void Controller::ShowPlaceholderText()
     const char* text( NULL );
     size_t size( 0 );
 
-    // TODO - Switch placeholder text styles when changing state
-    if( ( EventData::INACTIVE != mImpl->mEventData->mState ) &&
-        ( 0u != mImpl->mEventData->mPlaceholderTextActive.c_str() ) )
+    if( !mImpl->mEventData->mPlaceholderTextActive.empty() || !mImpl->mEventData->mPlaceholderTextInactive.empty() )
     {
-      text = mImpl->mEventData->mPlaceholderTextActive.c_str();
-      size = mImpl->mEventData->mPlaceholderTextActive.size();
+      if( ( EventData::INACTIVE != mImpl->mEventData->mState ) &&
+          ( 0u != mImpl->mEventData->mPlaceholderTextActive.c_str() ) )
+      {
+        text = mImpl->mEventData->mPlaceholderTextActive.c_str();
+        size = mImpl->mEventData->mPlaceholderTextActive.size();
+      }
+      else
+      {
+        text = mImpl->mEventData->mPlaceholderTextInactive.c_str();
+        size = mImpl->mEventData->mPlaceholderTextInactive.size();
+      }
     }
     else
     {
-      text = mImpl->mEventData->mPlaceholderTextInactive.c_str();
-      size = mImpl->mEventData->mPlaceholderTextInactive.size();
+      if( 0u != mImpl->mEventData->mPlaceholderText.c_str() )
+      {
+        text = mImpl->mEventData->mPlaceholderText.c_str();
+        size = mImpl->mEventData->mPlaceholderText.size();
+      }
     }
 
     mImpl->mTextUpdateInfo.mCharacterIndex = 0u;
index 7562394..c6b01a4 100644 (file)
@@ -454,6 +454,13 @@ public: // Update.
   /**
    * @brief Replaces any placeholder text previously set.
    *
+   * @param[in] text A string of UTF-8 characters.
+   */
+  void SetPlaceholderText( const std::string& text );
+
+  /**
+   * @brief Replaces any placeholder text previously set.
+   *
    * @param[in] type Different placeholder-text can be shown when the control is active/inactive.
    * @param[in] text A string of UTF-8 characters.
    */
@@ -462,6 +469,13 @@ public: // Update.
   /**
    * @brief Retrieve any placeholder text previously set.
    *
+   * @param[out] A string of UTF-8 characters.
+   */
+  void GetPlaceholderText( std::string& text ) const;
+
+  /**
+   * @brief Retrieve any placeholder text previously set.
+   *
    * @param[in] type Different placeholder-text can be shown when the control is active/inactive.
    * @param[out] A string of UTF-8 characters.
    */
@@ -910,6 +924,13 @@ public: // Queries & retrieves.
   float GetHeightForWidth( float width );
 
   /**
+   * @brief Retrieves the text's number of lines for a given width.
+   * @param[in] width The width of the text's area.
+   * @ return The number of lines.
+   */
+  int GetLineCount( float width );
+
+  /**
    * @brief Retrieves the text's model.
    *
    * @return A pointer to the text's model.
index c80cf7d..590f919 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -58,7 +58,7 @@ const char* VERTEX_SHADER_SCROLL = DALI_COMPOSE_SHADER(
   uniform mediump float uDelta;\n
   uniform mediump vec2 uTextureSize;
   uniform mediump float uGap;\n
-  uniform mediump float uRtl;\n
+  uniform mediump float uAlign;\n
   \n
   void main()\n
   {\n
@@ -70,7 +70,7 @@ const char* VERTEX_SHADER_SCROLL = DALI_COMPOSE_SHADER(
       float smallTextPadding = max(uSize.x - uTextureSize.x, 0. );\n
       float gap = max( uGap, smallTextPadding );\n
       float delta = floor ( uDelta ) + 0.5;
-      vTexCoord.x = ( delta  + ( uRtl * ( uTextureSize.x - uSize.x ) ) + (  aPosition.x * uSize.x ) )/ ( uTextureSize.x + gap );\n
+      vTexCoord.x = ( delta  + ( uAlign * ( uTextureSize.x - uSize.x ) ) + (  aPosition.x * uSize.x ) )/ ( uTextureSize.x + gap );\n
       vTexCoord.y = ( 0.5 + floor(  aPosition.y * uSize.y ) )/ ( uTextureSize.y ) ;\n
       vRatio = uTextureSize.x / ( uTextureSize.x + gap );\n
       gl_Position = uProjection * vertexPosition;
@@ -96,6 +96,54 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
 );
 
 /**
+ * @brief How the text should be aligned when scrolling the text.
+ *
+ * 0.0f aligns the text to the left, 1.0f aligns the text to the right.
+ * The final alignment depends on three factors:
+ *   1) The alignment value of the text label (Use Text::Layout::HorizontalAlignment enumerations).
+ *   2) The text direction, i.e. whether it's LTR or RTL (0 = LTR, 1 = RTL).
+ *   3) Whether the text is greater than the size of the control ( 0 = Text width <= Control width, 1 = Text width > Control width ).
+ */
+const float ALIGNMENT_TABLE[ Text::Layout::HORIZONTAL_ALIGN_COUNT ][ 2 ][ 2 ] =
+{
+  // HORIZONTAL_ALIGN_BEGIN
+  {
+    { // LTR
+      0.0f, // Text width <= Control width
+      0.0f  // Text width >  Control width
+    },
+    { // RTL
+      1.0f, // Text width <= Control width
+      1.0f  // Text width >  Control width
+    }
+  },
+
+  // HORIZONTAL_ALIGN_CENTER
+  {
+    { // LTR
+      0.5f, // Text width <= Control width
+      0.0f  // Text width >  Control width
+    },
+    { // RTL
+      0.5f, // Text width <= Control width
+      1.0f  // Text width >  Control width
+    }
+  },
+
+  // HORIZONTAL_ALIGN_END
+  {
+    { // LTR
+      1.0f, // Text width <= Control width
+      0.0f  // Text width >  Control width
+    },
+    { // RTL
+      0.0f, // Text width <= Control width
+      1.0f  // Text width >  Control width
+    }
+  }
+};
+
+/**
  * @brief Create and set up a camera for the render task to use
  *
  * @param[in] sizeOfTarget size of the source camera to look at
@@ -185,6 +233,7 @@ void CreateRenderer( FrameBufferImage frameBufferImage, Dali::Renderer& renderer
   CreateGeometry( meshGeometry );
 
   renderer = Renderer::New( meshGeometry, shader );
+  renderer.SetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, true );
   renderer.SetTextures( textureSet );
 }
 
@@ -224,35 +273,11 @@ int TextScroller::GetSpeed() const
 
 void TextScroller::SetLoopCount( int loopCount )
 {
-  if ( loopCount > 0 )
+  if ( loopCount >= 0 )
   {
     mLoopCount = loopCount;
   }
 
-  if (  mScrollAnimation && mScrollAnimation.GetState() == Animation::PLAYING )
-  {
-    if ( loopCount == 0 ) // Request to stop looping
-    {
-      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetLoopCount Single loop forced\n" );
-      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" );
 }
 
@@ -277,6 +302,32 @@ void TextScroller::SetStopMode( DevelTextLabel::AutoScrollStopMode::Type stopMod
   mStopMode = stopMode;
 }
 
+void TextScroller::StopScrolling()
+{
+  if ( mScrollAnimation && mScrollAnimation.GetState() == Animation::PLAYING )
+  {
+    switch( mStopMode )
+    {
+      case DevelTextLabel::AutoScrollStopMode::IMMEDIATE:
+      {
+        mScrollAnimation.Stop();
+        CleanUp();
+        mScrollerInterface.ScrollingFinished();
+        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" );
+      }
+    }
+  }
+}
+
 DevelTextLabel::AutoScrollStopMode::Type TextScroller::GetStopMode() const
 {
   return mStopMode;
@@ -308,15 +359,27 @@ TextScroller::~TextScroller()
   CleanUp();
 }
 
-void TextScroller::SetParameters( Actor sourceActor, const Size& controlSize, const Size& offScreenSize, CharacterDirection direction, float alignmentOffset )
+void TextScroller::SetParameters( Actor sourceActor, const Size& controlSize, const Size& offScreenSize, CharacterDirection direction, float alignmentOffset, Layout::HorizontalAlignment horizontalAlignment )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters controlSize[%f,%f] offscreenSize[%f,%f] direction[%d] alignmentOffset[%f]\n",
                  controlSize.x, controlSize.y, offScreenSize.x, offScreenSize.y, direction, alignmentOffset );
 
   CleanUp(); //  If already scrolling then restart with new parameters
 
+  float animationProgress = 0.0f;
+  int   remainedLoop = mLoopCount;
   if ( mScrollAnimation )
   {
+    if( mScrollAnimation.GetState() == Animation::PLAYING )
+    {
+      animationProgress = mScrollAnimation.GetCurrentProgress();
+
+      if( mLoopCount > 0 ) // If not a ininity loop, then calculate remained loop
+      {
+        remainedLoop = mLoopCount - ( mScrollAnimation.GetCurrentLoop() );
+        remainedLoop = ( remainedLoop <= 0 ? 1 : remainedLoop );
+      }
+    }
     mScrollAnimation.Clear();
   }
 
@@ -327,24 +390,58 @@ void TextScroller::SetParameters( Actor sourceActor, const Size& controlSize, co
   CreateRenderer( offscreenRenderTargetForText, renderer );
   CreateRenderTask( sourceActor, mOffscreenCameraActor, offscreenRenderTargetForText, mRenderTask );
 
-  // Reposition camera to match alignment of target, RTL text has direction=true
-  if ( direction )
-  {
-    mOffscreenCameraActor.SetX( alignmentOffset + offScreenSize.width*0.5f );
-  }
-  else
+  float xPosition = 0.0f;
+  switch( horizontalAlignment )
   {
-    mOffscreenCameraActor.SetX( offScreenSize.width * 0.5f );
+    case Layout::HORIZONTAL_ALIGN_BEGIN:
+    {
+      // Reposition camera to match alignment of target, RTL text has direction=true
+      if ( direction )
+      {
+        xPosition = alignmentOffset + offScreenSize.width * 0.5f;
+      }
+      else
+      {
+        xPosition = offScreenSize.width * 0.5f;
+      }
+      break;
+    }
+
+    case Layout::HORIZONTAL_ALIGN_CENTER:
+    {
+      xPosition = controlSize.width * 0.5f;
+      break;
+    }
+
+    case Layout::HORIZONTAL_ALIGN_END:
+    {
+      // Reposition camera to match alignment of target, RTL text has direction=true
+      if ( direction )
+      {
+        xPosition = offScreenSize.width * 0.5f;
+      }
+      else
+      {
+        xPosition = alignmentOffset + offScreenSize.width * 0.5f;
+      }
+      break;
+    }
   }
 
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters xPosition[%f]\n", xPosition );
+
+  mOffscreenCameraActor.SetX( xPosition );
   mOffscreenCameraActor.SetY( offScreenSize.height * 0.5f );
 
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters mWrapGap[%f]\n", mWrapGap )
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters mWrapGap[%f]\n", mWrapGap );
+
+  const float align = ALIGNMENT_TABLE[ horizontalAlignment ][ direction ][ offScreenSize.width > controlSize.width ];
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextScroller::SetParameters align[%f]\n", align );
 
   mScrollingTextActor = Actor::New();
   mScrollingTextActor.AddRenderer( renderer );
   mScrollingTextActor.RegisterProperty( "uTextureSize", offScreenSize );
-  mScrollingTextActor.RegisterProperty( "uRtl", ((direction)?1.0f:0.0f) );
+  mScrollingTextActor.RegisterProperty( "uAlign", align );
   mScrollingTextActor.RegisterProperty( "uGap", mWrapGap );
   mScrollingTextActor.SetSize( controlSize.width, std::min( offScreenSize.height, controlSize.height ) );
   mScrollDeltaIndex = mScrollingTextActor.RegisterProperty( "uDelta", 0.0f );
@@ -357,7 +454,8 @@ void TextScroller::SetParameters( Actor sourceActor, const Size& controlSize, co
      scrollAmount = -scrollAmount; // reverse direction of scrollung
   }
 
-  StartScrolling( scrollAmount, scrollDuration, mLoopCount );
+  StartScrolling( scrollAmount, scrollDuration, remainedLoop );
+  mScrollAnimation.SetCurrentProgress(animationProgress);
 }
 
 void TextScroller::AutoScrollAnimationFinished( Dali::Animation& animation )
index f6c0b87..2d611bb 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_TEXT_SCROLLER_H__
 
 /*
- * 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.
 #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/devel-api/controls/text-controls/text-label-devel.h>
 #include <dali-toolkit/internal/text/text-definitions.h>
+#include <dali-toolkit/internal/text/layouts/layout-alignment.h>
 
 namespace Dali
 {
@@ -66,7 +67,7 @@ public:
    * @param[in] alignmentOffset alignment of source text
    *
    */
-  void SetParameters( Actor sourceActor, const Size& controlSize, const Size& offScreenSize, CharacterDirection direction, float alignmentOffset );
+  void SetParameters( Actor sourceActor, const Size& controlSize, const Size& offScreenSize, CharacterDirection direction, float alignmentOffset, Layout::HorizontalAlignment horizontalAlignment );
 
   /**
    * @brief Set the gap distance to elapse before the text wraps around
@@ -123,6 +124,11 @@ public:
   void SetStopMode( DevelTextLabel::AutoScrollStopMode::Type stopMode );
 
   /**
+   * @brief Stop the auto scrolling.
+   */
+  void StopScrolling();
+
+  /**
    * @brief Get the mode of scrolling stop
    * @return stopMode type when text scrolling is stoped.
    */
index 4b14eca..16af15d 100644 (file)
@@ -241,8 +241,8 @@ Internal::Visual::Base::Impl::Transform::Transform()
 : mOffset( 0.0f,0.0f ),
   mSize( 1.0f,1.0f ),
   mOffsetSizeMode( 0.0f,0.0f,0.0f,0.0f ),
-  mOrigin( Toolkit::Align::CENTER ),
-  mAnchorPoint( Toolkit::Align::CENTER )
+  mOrigin( Toolkit::Align::TOP_BEGIN ),
+  mAnchorPoint( Toolkit::Align::TOP_BEGIN )
 {
 }
 
@@ -252,8 +252,8 @@ void Internal::Visual::Base::Impl::Transform::SetPropertyMap( const Property::Ma
   mOffset = Vector2( 0.0f,0.0f );
   mSize = Vector2( 1.0f,1.0f );
   mOffsetSizeMode = Vector4( 0.0f,0.0f,0.0f,0.0f );
-  mOrigin = Toolkit::Align::CENTER;
-  mAnchorPoint = Toolkit::Align::CENTER;
+  mOrigin = Toolkit::Align::TOP_BEGIN;
+  mAnchorPoint = Toolkit::Align::TOP_BEGIN;
 
   UpdatePropertyMap( map );
 }
index c31037f..ca311e1 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_VISUAL_BASE_DATA_IMPL_H
 
 /*
- * 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.
@@ -121,7 +121,7 @@ struct Base::Impl
   Transform       mTransform;
   Vector4         mMixColor;
   Size            mControlSize;
-  float           mDepthIndex;
+  int             mDepthIndex;
   Property::Index mMixColorIndex;
   Property::Index mOpacityIndex;
   int             mFlags;
index d483ef5..7add024 100644 (file)
@@ -221,7 +221,7 @@ void Visual::Base::GetNaturalSize( Vector2& naturalSize )
   naturalSize = Vector2::ZERO;
 }
 
-void Visual::Base::SetDepthIndex( float index )
+void Visual::Base::SetDepthIndex( int index )
 {
   mImpl->mDepthIndex = index;
   if( mImpl->mRenderer )
@@ -230,7 +230,7 @@ void Visual::Base::SetDepthIndex( float index )
   }
 }
 
-float Visual::Base::GetDepthIndex() const
+int Visual::Base::GetDepthIndex() const
 {
   return mImpl->mDepthIndex;
 }
index b671c15..d580d8f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_VISUAL_H
 
 /*
- * 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.
@@ -109,12 +109,12 @@ public:
   /**
    * @copydoc Toolkit::Visual::Base::SetDepthIndex
    */
-  void SetDepthIndex( float index );
+  void SetDepthIndex( int index );
 
   /**
    * @copydoc Toolkit::Visual::Base::GetDepthIndex
    */
-  float GetDepthIndex() const;
+  int GetDepthIndex() const;
 
   /**
    * @copydoc Toolkit::Visual::Base::SetOnStage
index a41a6f3..0dfc002 100644 (file)
@@ -124,8 +124,7 @@ void Control::SetBackground( const Property::Map& map )
   Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( map );
   if( visual )
   {
-    mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual );
-    visual.SetDepthIndex( DepthIndex::BACKGROUND );
+    mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
 
     // Trigger a size negotiation request that may be needed by the new visual to relayout its contents.
     RelayoutRequest();
@@ -137,8 +136,7 @@ void Control::SetBackgroundImage( Image image )
   Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( image );
   if( visual )
   {
-    mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual );
-    visual.SetDepthIndex( DepthIndex::BACKGROUND );
+    mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
   }
 }
 
index c4d336c..a96fab6 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 2;
-const unsigned int TOOLKIT_MICRO_VERSION = 41;
+const unsigned int TOOLKIT_MICRO_VERSION = 42;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index b389379..10133ee 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.41
+Version:    1.2.42
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT