[dali_1.2.43] Merge branch 'devel/master' 90/133290/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 9 Jun 2017 12:51:40 +0000 (13:51 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 9 Jun 2017 12:51:40 +0000 (13:51 +0100)
Change-Id: Ib0d6f756507484afb96aeddc8e7451acf95b24e8

44 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-ScrollBar.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
build/tizen/configure.ac
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.cpp [new file with mode: 0644]
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/file.list
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/scroll-bar/scroll-bar-impl.cpp
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-editor-impl.h
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/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/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 95b784d..f3a377c 100644 (file)
@@ -698,6 +698,20 @@ int UtcDaliToolkitScrollBarGetScrollPositionIntervalsP(void)
   DALI_TEST_EQUALS( positionIntervals[8], results[8], TEST_LOCATION );
   DALI_TEST_EQUALS( positionIntervals[9], results[9], TEST_LOCATION );
 
+  Property::Array resultArray = scrollBar.GetProperty<Property::Array>(Toolkit::ScrollBar::Property::SCROLL_POSITION_INTERVALS);
+
+  DALI_TEST_EQUALS( positionIntervals.Count(), resultArray.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[0], resultArray[0].Get<float>(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[1], resultArray[1].Get<float>(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[2], resultArray[2].Get<float>(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[3], resultArray[3].Get<float>(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[4], resultArray[4].Get<float>(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[5], resultArray[5].Get<float>(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[6], resultArray[6].Get<float>(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[7], resultArray[7].Get<float>(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[8], resultArray[8].Get<float>(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[9], resultArray[9].Get<float>(), TEST_LOCATION );
+
   END_TEST;
 }
 
index 5cacd19..c143510 100644 (file)
@@ -18,7 +18,6 @@
 #include <iostream>
 #include <stdlib.h>
 #include <unistd.h>
-
 #include <dali/public-api/rendering/renderer.h>
 #include <dali/devel-api/adaptor-framework/clipboard.h>
 #include <dali/integration-api/events/key-event-integ.h>
@@ -27,6 +26,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 +93,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
@@ -294,6 +298,31 @@ bool DaliTestCheckMaps( const Property::Map& fontStyleMapGet, const Property::Ma
   return true;
 }
 
+class ScrollStateChangeCallback : public Dali::ConnectionTracker
+{
+public:
+  ScrollStateChangeCallback(bool& startedCalled, bool& finishedCalled)
+  : mStartedCalled( startedCalled ),
+    mFinishedCalled( finishedCalled )
+  {
+  }
+
+  void Callback( TextEditor editor, DevelTextEditor::Scroll::Type type )
+  {
+    if( type == DevelTextEditor::Scroll::STARTED )
+    {
+      mStartedCalled = true;
+    }
+    else if( type == DevelTextEditor::Scroll::FINISHED )
+    {
+      mFinishedCalled = true;
+    }
+  }
+
+  bool& mStartedCalled;
+  bool& mFinishedCalled;
+};
+
 } // namespace
 
 int UtcDaliToolkitTextEditorConstructorP(void)
@@ -433,6 +462,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 +757,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 +1981,70 @@ 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;
+}
+
+int utcDaliTextEditorScrollStateChangedSignalTest(void)
+{
+
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliTextEditorScrollStateChangedSignalTest");
+
+  TextEditor editor = TextEditor::New();
+  DALI_TEST_CHECK( editor );
+
+  Stage::GetCurrent().Add( editor );
+
+  editor.SetProperty( TextEditor::Property::POINT_SIZE, 10.f );
+  editor.SetSize( 50.f, 50.f );
+  editor.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  editor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  editor.SetProperty( DevelTextEditor::Property::ENABLE_SCROLL_BAR, true );
+  editor.SetKeyboardFocusable(true);
+
+  bool startedCalled = false;
+  bool finishedCalled = false;
+
+  ScrollStateChangeCallback callback( startedCalled, finishedCalled );
+  DevelTextEditor::ScrollStateChangedSignal( editor ).Connect( &callback, &ScrollStateChangeCallback::Callback );
+
+  KeyboardFocusManager::Get().SetCurrentFocusActor( editor );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  editor.SetProperty( TextEditor::Property::TEXT, "Long enough message for TextEditor!");
+  application.SendNotification();
+  application.Render(6000);
+
+  application.SendNotification();
+  DALI_TEST_EQUALS( startedCalled, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( finishedCalled, true, TEST_LOCATION );
+
+  END_TEST;
+}
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 f12ab89..80e4a8f 100755 (executable)
@@ -89,7 +89,7 @@ fi
 
 # Tizen Profile options
 AC_ARG_ENABLE([profile],
-              [AC_HELP_STRING([--enable-profile=UBUNTU,MOBILE,WEARABLE,TV],
+              [AC_HELP_STRING([--enable-profile=UBUNTU,TIZEN],
                             [Select the variant of tizen])],
               [dali_profile=$enableval],
               [dali_profile=UBUNTU])
@@ -102,7 +102,7 @@ AC_ARG_WITH(style,
               [dali_style=480x800])
 
 # Ensure valid profile selected
-if test "x$dali_profile" != "xUBUNTU" -a "x$dali_profile" != "xMOBILE" -a "x$dali_profile" != "xWEARABLE" -a "x$dali_profile" != "xTV" ; then
+if test "x$dali_profile" != "xUBUNTU" -a "x$dali_profile" != "xTIZEN"; then
   AC_MSG_ERROR([$enable_profile is an invalid profile])
 fi
 
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 );
diff --git a/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.cpp b/dali-toolkit/devel-api/controls/text-controls/text-editor-devel.cpp
new file mode 100644 (file)
index 0000000..e9292bf
--- /dev/null
@@ -0,0 +1,43 @@
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
+
+// INTERNAL HEADER
+#include <dali-toolkit/internal/controls/text-controls/text-editor-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DevelTextEditor
+{
+
+ScrollStateChangedSignalType& ScrollStateChangedSignal( TextEditor textEditor )
+{
+  return Dali::Toolkit::GetImpl( textEditor ).ScrollStateChangedSignal();
+}
+
+} // namespace DevelText
+
+} // namespace Toolkit
+
+} // namespace Dali
index cff3a39..f95fc94 100644 (file)
@@ -109,11 +109,53 @@ 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
 
-} // namespace DevelText
+namespace Scroll
+{
+  enum Type
+  {
+    STARTED,   ///< Scrolling is started.
+    FINISHED   ///< Scrolling is finished.
+  };
+} // namespace Scroll
+
+typedef Signal< void ( TextEditor, Scroll::Type ) > ScrollStateChangedSignalType;
+
+/**
+ * @brief This signal is emitted when TextEditor scrolling is started or finished.
+ *
+ * A callback of the following type may be connected:
+ * @code
+ *   void YourCallbackName( ScrollState::Type type );
+ * @endcode
+ * type: Whether the scrolling is started or finished.
+ * @return The signal to connect to
+ */
+DALI_IMPORT_API ScrollStateChangedSignalType& ScrollStateChangedSignal( TextEditor textEditor );
+
+} // namespace DevelTextEditor
 
 } // namespace Toolkit
 
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 fa85816..fe8ef2b 100644 (file)
@@ -23,6 +23,7 @@ devel_api_src_files = \
   $(devel_api_src_dir)/controls/super-blur-view/super-blur-view.cpp \
   $(devel_api_src_dir)/controls/text-controls/text-selection-popup.cpp \
   $(devel_api_src_dir)/controls/text-controls/text-selection-toolbar.cpp \
+  $(devel_api_src_dir)/controls/text-controls/text-editor-devel.cpp \
   $(devel_api_src_dir)/controls/tool-bar/tool-bar.cpp \
   $(devel_api_src_dir)/focus-manager/keyinput-focus-manager.cpp \
   $(devel_api_src_dir)/focus-manager/keyboard-focus-manager-devel.cpp \
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 dd55010..4360f1e 100755 (executable)
@@ -769,17 +769,20 @@ Property::Value ScrollBar::GetProperty( BaseObject* object, Property::Index inde
       }
       case Toolkit::ScrollBar::Property::SCROLL_POSITION_INTERVALS:
       {
-        Property::Value value( Property::ARRAY );
-        Property::Array* array = value.GetArray();
+        Property::Value tempValue( Property::ARRAY );
+        Property::Array* array = tempValue.GetArray();
 
         if( array )
         {
           Dali::Vector<float> positions = scrollBarImpl.GetScrollPositionIntervals();
-          size_t positionCount( array->Count() );
+          size_t positionCount( positions.Count() );
+
           for( size_t i( 0 ); i != positionCount; ++i )
           {
             array->PushBack( positions[i] );
           }
+
+          value = tempValue;
         }
         break;
       }
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..1a918cd 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
   }
 
@@ -1034,6 +1091,11 @@ Toolkit::TextEditor::InputStyleChangedSignalType& TextEditor::InputStyleChangedS
   return mInputStyleChangedSignal;
 }
 
+Toolkit::DevelTextEditor::ScrollStateChangedSignalType& TextEditor::ScrollStateChangedSignal()
+{
+  return mScrollStateChangedSignal;
+}
+
 void TextEditor::OnInitialize()
 {
   Actor self = Self();
@@ -1438,6 +1500,14 @@ void TextEditor::UpdateScrollBar()
     return;
   }
 
+  // If scrolling is not started, start scrolling and emit ScrollStateChangedSignal
+  if( !mScrollStarted )
+  {
+    mScrollStarted = true;
+    Dali::Toolkit::TextEditor handle( GetOwner() );
+    mScrollStateChangedSignal.Emit( handle, DevelTextEditor::Scroll::STARTED );
+  }
+
   CustomActor self = Self();
   if( !mScrollBar )
   {
@@ -1459,6 +1529,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
@@ -1484,6 +1563,18 @@ void TextEditor::UpdateScrollBar()
   indicator.SetOpacity(1.0f);
   mAnimation.AnimateTo( Property( indicator, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunction::EASE_IN, mAnimationPeriod );
   mAnimation.Play();
+  mAnimation.FinishedSignal().Connect( this, &TextEditor::OnScrollIndicatorAnimationFinished );
+}
+
+void TextEditor::OnScrollIndicatorAnimationFinished( Animation& animation )
+{
+  // If animation is successfully ended, then emit ScrollStateChangedSignal
+  if( animation.GetCurrentProgress() == 0.0f )
+  {
+    mScrollStarted = false;
+    Dali::Toolkit::TextEditor handle( GetOwner() );
+    mScrollStateChangedSignal.Emit( handle, DevelTextEditor::Scroll::FINISHED );
+  }
 }
 
 void TextEditor::OnStageConnect( Dali::Actor actor )
@@ -1601,7 +1692,8 @@ TextEditor::TextEditor()
   mRenderingBackend( DEFAULT_RENDERING_BACKEND ),
   mHasBeenStaged( false ),
   mScrollAnimationEnabled( false ),
-  mScrollBarEnabled( false )
+  mScrollBarEnabled( false ),
+  mScrollStarted( false )
 {
 }
 
index cc864f1..3c2cec4 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/public-api/animation/animation.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/controls/text-controls/text-editor-devel.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
@@ -95,6 +96,11 @@ public:
    */
   Toolkit::TextEditor::InputStyleChangedSignalType& InputStyleChangedSignal();
 
+  /**
+   * @copydoc DevelTextEditor::ScrollStateChangedSignal()
+   */
+  Toolkit::DevelTextEditor::ScrollStateChangedSignalType& ScrollStateChangedSignal();
+
 private: // From Control
 
   /**
@@ -244,6 +250,13 @@ private: // Implementation
   void ApplyScrollPosition();
 
   /**
+   * @brief Callback function for ScrollBar indicator animation finished signal
+   *
+   * Emit ScrollBarStateChanged Signal and toggle mScrollStarted flag to false
+   */
+  void OnScrollIndicatorAnimationFinished( Animation& animation );
+
+  /**
    * Construct a new TextEditor.
    */
   TextEditor();
@@ -269,6 +282,7 @@ private: // Data
   // Signals
   Toolkit::TextEditor::TextChangedSignalType mTextChangedSignal;
   Toolkit::TextEditor::InputStyleChangedSignalType mInputStyleChangedSignal;
+  Toolkit::DevelTextEditor::ScrollStateChangedSignalType mScrollStateChangedSignal;
 
   ImfManager          mImfManager;
   Text::ControllerPtr mController;
@@ -290,6 +304,7 @@ private: // Data
   bool mHasBeenStaged:1;
   bool mScrollAnimationEnabled:1;
   bool mScrollBarEnabled:1;
+  bool mScrollStarted:1;
 };
 
 } // namespace Internal
index ff6fc79..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()
 
@@ -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;
+      }
     }
   }
 
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 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 7d9933d..590f919 100644 (file)
@@ -233,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 );
 }
 
@@ -310,6 +311,8 @@ void TextScroller::StopScrolling()
       case DevelTextLabel::AutoScrollStopMode::IMMEDIATE:
       {
         mScrollAnimation.Stop();
+        CleanUp();
+        mScrollerInterface.ScrollingFinished();
         break;
       }
       case DevelTextLabel::AutoScrollStopMode::FINISH_LOOP:
@@ -319,7 +322,7 @@ void TextScroller::StopScrolling()
       }
       default:
       {
-          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Undifined AutoScrollStopMode\n" );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Undifined AutoScrollStopMode\n" );
       }
     }
   }
@@ -363,8 +366,20 @@ void TextScroller::SetParameters( Actor sourceActor, const Size& controlSize, co
 
   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();
   }
 
@@ -439,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 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 a96fab6..d2ad3a6 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 = 42;
+const unsigned int TOOLKIT_MICRO_VERSION = 43;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index c34d9aa..8db8b94 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.2.42
+Version:    1.2.43
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT
@@ -34,21 +34,6 @@ BuildRequires:  pkgconfig(libtzplatform-config)
 %define profile %{tizen_profile_name}
 %endif
 
-%if "%{profile}" == "mobile"
-%define dali_toolkit_profile MOBILE
-%define dali_style_folder 720x1280
-# dali_style to be provided by build system as with dali_toolkit_profile or by passing --define 'dali_style 470x800' to the rpm build command
-%endif
-
-%if "%{profile}" == "tv"
-%define dali_toolkit_profile TV
-%define dali_style_folder 1920x1080
-%endif
-
-%if "%{?dali_style}"
-  %define dali_style_folder %{dali_style}
-%endif
-
 %description
 The OpenGLES Canvas Core Library Toolkit - a set of controls that provide
 user interface functionality.
@@ -144,8 +129,7 @@ autoreconf --install
 DALI_DATA_RW_DIR="%{dali_data_rw_dir}" ; export DALI_DATA_RW_DIR
 DALI_DATA_RO_DIR="%{dali_data_ro_dir}" ; export DALI_DATA_RO_DIR
 
-%configure --enable-profile=%{dali_toolkit_profile} \
-           --with-style=%{dali_style_folder} \
+%configure --enable-profile=TIZEN \
 %if 0%{?enable_debug}
            --enable-debug \
 %endif