[dali_1.0.36] Merge branch 'tizen' 31/37731/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 3 Apr 2015 05:51:42 +0000 (06:51 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 3 Apr 2015 05:51:42 +0000 (06:51 +0100)
Change-Id: Ia35f4d238d9232e7e85935a4851513507cb82f3c

153 files changed:
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-internal/utc-Dali-TextView.cpp [deleted file]
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp
automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp
automated-tests/src/dali-toolkit/utc-Dali-Button.cpp
automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-Control.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp
automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp
automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp
automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp
automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextInput.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-TextView.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-ToolBar.cpp
automated-tests/src/dali-toolkit/utc-Dali-View.cpp
build/tizen/plugins/Makefile.am
dali-toolkit/images/00_popup_bg.9.png [new file with mode: 0644]
dali-toolkit/images/00_popup_bg.png
dali-toolkit/internal/builder/builder-animations.cpp
dali-toolkit/internal/builder/builder-declarations.h
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/builder-impl.h
dali-toolkit/internal/builder/builder-set-property.cpp
dali-toolkit/internal/builder/builder-signals.cpp
dali-toolkit/internal/controls/alignment/alignment-impl.cpp
dali-toolkit/internal/controls/alignment/alignment-impl.h
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.h
dali-toolkit/internal/controls/buttons/check-box-button-impl.cpp
dali-toolkit/internal/controls/buttons/check-box-button-impl.h
dali-toolkit/internal/controls/buttons/push-button-impl.cpp
dali-toolkit/internal/controls/buttons/push-button-impl.h
dali-toolkit/internal/controls/buttons/radio-button-impl.cpp
dali-toolkit/internal/controls/buttons/radio-button-impl.h
dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp
dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp
dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.h
dali-toolkit/internal/controls/popup/popup-style-impl.cpp
dali-toolkit/internal/controls/relayout-controller-impl.cpp [deleted file]
dali-toolkit/internal/controls/relayout-controller-impl.h [deleted file]
dali-toolkit/internal/controls/relayout-controller.cpp [deleted file]
dali-toolkit/internal/controls/relayout-controller.h [deleted file]
dali-toolkit/internal/controls/relayout-helper.cpp [deleted file]
dali-toolkit/internal/controls/relayout-helper.h [deleted file]
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-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/scrollable/scroll-view/scroll-base-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp
dali-toolkit/internal/controls/scrollable/scrollable-impl.h
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/table-view/table-view-impl.h
dali-toolkit/internal/controls/text-input/text-input-handles-impl.cpp
dali-toolkit/internal/controls/text-input/text-input-impl.cpp
dali-toolkit/internal/controls/text-input/text-input-impl.h
dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp
dali-toolkit/internal/controls/text-view/relayout-utilities.cpp
dali-toolkit/internal/controls/text-view/text-view-impl.cpp
dali-toolkit/internal/controls/text-view/text-view-impl.h
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/controls/view/view-impl.cpp
dali-toolkit/internal/controls/view/view-impl.h
dali-toolkit/internal/file.list
dali-toolkit/internal/filters/blur-two-pass-filter.cpp
dali-toolkit/internal/focus-manager/focus-manager-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/scripting/script-impl.h
dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-fold-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-wave-effect-impl.cpp
dali-toolkit/public-api/controls/buttons/push-button.cpp
dali-toolkit/public-api/controls/buttons/push-button.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
dali-toolkit/public-api/controls/control.cpp
dali-toolkit/public-api/controls/control.h
dali-toolkit/public-api/controls/popup/popup.cpp
dali-toolkit/public-api/controls/popup/popup.h
dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.cpp
dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.cpp
dali-toolkit/public-api/controls/scrollable/item-view/item-view.cpp
dali-toolkit/public-api/controls/scrollable/item-view/item-view.h
dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h
dali-toolkit/public-api/controls/scrollable/scrollable.cpp
dali-toolkit/public-api/controls/scrollable/scrollable.h
dali-toolkit/public-api/controls/table-view/table-view.cpp
dali-toolkit/public-api/controls/table-view/table-view.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/scripting/script.h
docs/content/images/size-negotiation/Algorithm1.png [deleted file]
docs/content/images/size-negotiation/Algorithm10.png [deleted file]
docs/content/images/size-negotiation/Algorithm2.png [deleted file]
docs/content/images/size-negotiation/Algorithm3.png [deleted file]
docs/content/images/size-negotiation/Algorithm4.png [deleted file]
docs/content/images/size-negotiation/Algorithm8.png [deleted file]
docs/content/images/size-negotiation/Algorithm9.png [deleted file]
docs/content/images/size-negotiation/FixedWidthFlexibleHeight.png [deleted file]
docs/content/images/size-negotiation/FixedWidthFlexibleHeight2.png [deleted file]
docs/content/images/size-negotiation/FixedWidthHeight.png [deleted file]
docs/content/images/size-negotiation/FixedWidthHeight2.png [deleted file]
docs/content/images/size-negotiation/FlexibleWidthFixedHeight.png [deleted file]
docs/content/images/size-negotiation/FlexibleWidthFixedHeight2.png [deleted file]
docs/content/images/size-negotiation/FlexibleWidthHeight.png [deleted file]
docs/content/images/size-negotiation/Popup.png [new file with mode: 0644]
docs/content/images/size-negotiation/PopupExample.png [new file with mode: 0644]
docs/content/images/size-negotiation/ResizePolicies.png [new file with mode: 0644]
docs/content/images/size-negotiation/ResizePoliciesExample.png [new file with mode: 0644]
docs/content/images/size-negotiation/SizeNegotiationExample_After.png [new file with mode: 0644]
docs/content/images/size-negotiation/SizeNegotiationExample_Before.png [new file with mode: 0644]
docs/content/main-page.h
docs/content/programming-guide/animation-example.h
docs/content/programming-guide/animation-rotation.h
docs/content/programming-guide/dynamics-bodies.h
docs/content/programming-guide/size-negotiation-controls.h [new file with mode: 0644]
docs/content/programming-guide/size-negotiation.h
packaging/dali-toolkit.spec
plugins/dali-script-v8/file.list
plugins/dali-script-v8/src/actors/actor-api.cpp
plugins/dali-script-v8/src/actors/actor-api.h
plugins/dali-script-v8/src/actors/actor-wrapper.cpp
plugins/dali-script-v8/src/animation/path-constraint-wrapper.cpp [new file with mode: 0644]
plugins/dali-script-v8/src/animation/path-constraint-wrapper.h [new file with mode: 0644]
plugins/dali-script-v8/src/constants/constants-wrapper.cpp
plugins/dali-script-v8/src/dali-wrapper.cpp
plugins/dali-script-v8/src/shared/base-wrapped-object.h
plugins/dali-script-v8/src/utils/v8-utils.h

index 5a88e73..029c12d 100644 (file)
@@ -12,7 +12,6 @@ SET(TC_SOURCES
  utc-Dali-TextView-Processor-Types.cpp
  utc-Dali-TextView-Processor.cpp
  utc-Dali-TextView-Relayout-Utilities.cpp
- utc-Dali-TextView.cpp
 )
 
 # Append list of test harness files (Won't get parsed for test cases)
diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-TextView.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-TextView.cpp
deleted file mode 100644 (file)
index 91dcc57..0000000
+++ /dev/null
@@ -1,2168 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-#include <iostream>
-#include <stdlib.h>
-#include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-
-// Internal headers are allowed here
-#include <dali-toolkit/internal/controls/text-view/text-view-processor.h>
-#include <dali-toolkit/internal/controls/text-view/text-view-processor-dbg.h>
-#include <dali-toolkit/internal/controls/text-view/text-view-paragraph-processor.h>
-#include <dali-toolkit/internal/controls/text-view/text-view-word-processor.h>
-#include <dali-toolkit/internal/controls/text-view/relayout-utilities.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-using namespace Dali::Toolkit::Internal;
-
-void dali_text_view_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void dali_text_view_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-
-namespace
-{
-
-const Toolkit::Internal::TextView::LayoutParameters DEFAULT_LAYOUT_PARAMETERS;
-const Toolkit::Internal::TextView::VisualParameters DEFAULT_VISUAL_PARAMETERS;
-
-// Data structures used to create an 'experiment' in TET cases
-
-struct SplitWordTest
-{
-  std::string description;
-  std::string input;
-  std::size_t position;
-  std::string firstResult;
-  std::string lastResult;
-};
-
-struct SplitParagraphTest
-{
-  std::string description;
-  std::string input;
-  std::size_t wordIndex;
-  std::size_t characterIndex;
-  std::size_t characterParagraphIndex;
-  float       lineHeightOffset;
-  std::string firstResult;
-  std::string lastResult;
-};
-
-struct MergeWordsTest
-{
-  std::string description;
-  std::string inputFirst;
-  std::string inputLast;
-  std::string result;
-};
-
-struct MergeParagraphsTest
-{
-  std::string description;
-  std::string inputFirst;
-  std::string inputLast;
-  float       lineHeightOffset;
-  std::string result;
-};
-
-struct RemoveCharactersFromWordTest
-{
-  std::string description;
-  std::string input;
-  std::size_t position;
-  std::size_t numberOfCharacters;
-  std::string result;
-};
-
-struct RemoveWordsFromParagraphTest
-{
-  std::string description;
-  std::string input;
-  std::size_t wordIndex;
-  std::size_t numberOfWords;
-  float       lineHeightOffset;
-  std::string result;
-};
-
-enum UpdateTextInfoOperation
-{
-  Insert,
-  Remove,
-  Replace
-};
-
-struct UpdateTextInfoTest
-{
-  std::string             description;
-  UpdateTextInfoOperation operation;
-  std::string             input;
-  std::size_t             position;
-  std::size_t             numberOfCharacters;
-  std::string             inputText;
-  float                   lineHeightOffset;
-  std::string             result;
-};
-
-// Useful Print functions when something goes wrong.
-
-void Print( const TextViewProcessor::CharacterLayoutInfo& character )
-{
-  std::cout << "             height : " << character.mSize.height << std::endl;
-  std::cout << "            advance : " << character.mSize.width << std::endl;
-  std::cout << "            bearing : " << character.mBearing << std::endl;
-  std::cout << "           ascender : " << character.mAscender << std::endl;
-  std::cout << "           position : " << character.mPosition << std::endl;
-
-  TextActor textActor = TextActor::DownCast( character.mGlyphActor );
-  if( textActor )
-  {
-    std::cout << "[" << textActor.GetText() << "]";
-  }
-}
-
-void Print( const TextViewProcessor::WordLayoutInfo& word )
-{
-  std::cout << "[";
-  std::cout << "              mSize : " << word.mSize << std::endl;
-  std::cout << "          mAscender : " << word.mAscender << std::endl;
-  std::cout << "              mType : " << word.mType << std::endl;
-  std::cout << "mNumberOfCharacters : " << word.mCharactersLayoutInfo.size() << std::endl;
-  std::cout << "[";
-  for( TextViewProcessor::CharacterLayoutInfoContainer::const_iterator it = word.mCharactersLayoutInfo.begin(), endIt = word.mCharactersLayoutInfo.end(); it != endIt; ++it )
-  {
-    Print( *it );
-  }
-  std::cout << "]"; std::cout << std::endl;
-  std::cout << "]"; std::cout << std::endl;
-}
-
-void Print( const TextViewProcessor::ParagraphLayoutInfo& paragraph )
-{
-  std::cout << "<";
-  std::cout << "              mSize : " << paragraph.mSize << std::endl;
-  std::cout << "          mAscender : " << paragraph.mAscender << std::endl;
-  std::cout << "mNumberOfCharacters : " << paragraph.mNumberOfCharacters << std::endl;
-  for( TextViewProcessor::WordLayoutInfoContainer::const_iterator it = paragraph.mWordsLayoutInfo.begin(), endIt = paragraph.mWordsLayoutInfo.end(); it != endIt; ++it )
-  {
-    Print( *it );
-  }
-  std::cout << ">" << std::endl;
-}
-
-void Print( const TextViewProcessor::TextLayoutInfo& text )
-{
-  std::cout << "||";
-  for( TextViewProcessor::ParagraphLayoutInfoContainer::const_iterator it = text.mParagraphsLayoutInfo.begin(), endIt = text.mParagraphsLayoutInfo.end(); it != endIt; ++it )
-  {
-    Print( *it );
-  }
-  std::cout << "||" << std::endl;
-}
-
-std::string GetText( const TextViewProcessor::WordLayoutInfo& word, const Text& paragraphText )
-{
-  Text text;
-
-  paragraphText.GetSubText( word.mFirstCharacter, word.mFirstCharacter + word.mCharactersLayoutInfo.size() - 1u, text );
-
-  return text.GetText();
-}
-
-std::string GetText( const TextViewProcessor::ParagraphLayoutInfo& paragraph )
-{
-  std::string text;
-
-  for( TextViewProcessor::WordLayoutInfoContainer::const_iterator it = paragraph.mWordsLayoutInfo.begin(), endIt = paragraph.mWordsLayoutInfo.end(); it != endIt; ++it )
-  {
-    text += GetText( *it, paragraph.mText );
-  }
-
-  return text;
-}
-
-// Test functions used to check if two data structures are equal.
-
-bool TestEqual( float x, float y )
-{
-  return ( fabsf( x - y ) < 0.001f );
-}
-
-bool TestEqual( const TextViewProcessor::CharacterLayoutInfo& character1,
-                const TextViewProcessor::CharacterLayoutInfo& character2 )
-{
-  if( !TestEqual( character1.mSize.height, character2.mSize.height ) )
-  {
-    return false;
-  }
-  if( !TestEqual( character1.mSize.width, character2.mSize.width ) )
-  {
-    return false;
-  }
-  if( !TestEqual( character1.mBearing, character2.mBearing ) )
-  {
-    return false;
-  }
-
-  if( !TestEqual( character1.mPosition.x, character2.mPosition.x ) )
-  {
-    return false;
-  }
-  if( !TestEqual( character1.mPosition.y, character2.mPosition.y ) )
-  {
-    return false;
-  }
-
-  if( !TestEqual( character1.mAscender, character2.mAscender ) )
-  {
-    return false;
-  }
-
-  if( character1.mGlyphActor && !character2.mGlyphActor )
-  {
-    return false;
-  }
-
-  if( !character1.mGlyphActor && character2.mGlyphActor )
-  {
-    return false;
-  }
-
-  std::string text1;
-  std::string text2;
-  TextStyle style1;
-  TextStyle style2;
-
-  TextActor textActor1 = TextActor::DownCast( character1.mGlyphActor );
-  TextActor textActor2 = TextActor::DownCast( character2.mGlyphActor );
-  if( textActor1 )
-  {
-    text1 = textActor1.GetText();
-    style1 = textActor1.GetTextStyle();
-
-    text2 = textActor2.GetText();
-    style2 = textActor2.GetTextStyle();
-  }
-
-  if( text1 != text2 )
-  {
-    return false;
-  }
-
-  if( style1 != style2 )
-  {
-    return false;
-  }
-
-  return true;
-}
-
-bool TestEqual( const TextViewProcessor::WordLayoutInfo& word1,
-                const TextViewProcessor::WordLayoutInfo& word2 )
-{
-  if( !TestEqual( word1.mSize.x, word2.mSize.x ) )
-  {
-    return false;
-  }
-  if( !TestEqual( word1.mSize.y, word2.mSize.y ) )
-  {
-    return false;
-  }
-
-  if( !TestEqual( word1.mAscender, word2.mAscender ) )
-  {
-    return false;
-  }
-
-  if( word1.mType != word2.mType )
-  {
-    return false;
-  }
-
-  if( word1.mCharactersLayoutInfo.size() != word2.mCharactersLayoutInfo.size() )
-  {
-    return false;
-  }
-
-  for( TextViewProcessor::CharacterLayoutInfoContainer::const_iterator it1 = word1.mCharactersLayoutInfo.begin(), endIt1 = word1.mCharactersLayoutInfo.end(),
-         it2 = word2.mCharactersLayoutInfo.begin(), endIt2 = word2.mCharactersLayoutInfo.end();
-       ( it1 != endIt1 ) && ( it2 != endIt2 );
-       ++it1, ++it2 )
-  {
-    if( !TestEqual( *it1, *it2 ) )
-    {
-      return false;
-    }
-  }
-
-  return true;
-}
-
-bool TestEqual( const TextViewProcessor::ParagraphLayoutInfo& paragraph1,
-                const TextViewProcessor::ParagraphLayoutInfo& paragraph2 )
-{
-  if( !TestEqual( paragraph1.mSize.x, paragraph2.mSize.x ) )
-  {
-    return false;
-  }
-  if( !TestEqual( paragraph1.mSize.y, paragraph2.mSize.y ) )
-  {
-    return false;
-  }
-
-  if( !TestEqual( paragraph1.mAscender, paragraph2.mAscender ) )
-  {
-    return false;
-  }
-
-  if( paragraph1.mNumberOfCharacters != paragraph2.mNumberOfCharacters )
-  {
-    return false;
-  }
-
-  if( paragraph1.mWordsLayoutInfo.size() != paragraph2.mWordsLayoutInfo.size() )
-  {
-    return false;
-  }
-
-  for( TextViewProcessor::WordLayoutInfoContainer::const_iterator it1 = paragraph1.mWordsLayoutInfo.begin(), endIt1 = paragraph1.mWordsLayoutInfo.end(),
-         it2 = paragraph2.mWordsLayoutInfo.begin(), endIt2 = paragraph2.mWordsLayoutInfo.end();
-       ( it1 != endIt1 ) && ( it2 != endIt2 );
-       ++it1, ++it2 )
-  {
-    if( !TestEqual( *it1, *it2 ) )
-    {
-      return false;
-    }
-  }
-
-  return true;
-}
-
-bool TestEqual( const TextViewProcessor::TextLayoutInfo& text1,
-                const TextViewProcessor::TextLayoutInfo& text2 )
-{
-  if( !TestEqual( text1.mWholeTextSize.x, text2.mWholeTextSize.x ) )
-  {
-    return false;
-  }
-  if( !TestEqual( text1.mWholeTextSize.y, text2.mWholeTextSize.y ) )
-  {
-    return false;
-  }
-
-  if( !TestEqual( text1.mMaxWordWidth, text2.mMaxWordWidth ) )
-  {
-    return false;
-  }
-
-  if( text1.mNumberOfCharacters != text2.mNumberOfCharacters )
-  {
-    return false;
-  }
-
-  if( text1.mParagraphsLayoutInfo.size() != text2.mParagraphsLayoutInfo.size() )
-  {
-    return false;
-  }
-
-  for( TextViewProcessor::ParagraphLayoutInfoContainer::const_iterator it1 = text1.mParagraphsLayoutInfo.begin(), endIt1 = text1.mParagraphsLayoutInfo.end(),
-         it2 = text2.mParagraphsLayoutInfo.begin(), endIt2 = text2.mParagraphsLayoutInfo.end();
-       ( it1 != endIt1 ) && ( it2 != endIt2 );
-       ++it1, ++it2 )
-  {
-    if( !TestEqual( *it1, *it2 ) )
-    {
-      return false;
-    }
-  }
-
-  return true;
-}
-
-/**
- * Splits the \e input word in two by the given \e position and checks the results with \e firstResult and \e lastResult.
- *
- * If the test fails it prints a short description and the line where this function was called.
- *
- * @param description Short description of the experiment. i.e. "Split the word from the beginning. (position 0)".
- * @param input The input word.
- * @param position Where to split the word.
- * @param firstResult First part of the split word.
- * @param lastResult Last part of the split word.
- * @param location Where this function has been called.
- *
- * @return \e true if the experiment is successful. Otherwise returns \e false.
- */
-bool TestSplitWord( const std::string& description, const std::string& input, const size_t position, const std::string& firstResult, const std::string& lastResult, const char* location )
-{
-  tet_printf( "%s\n", description.c_str() );
-
-  // Create layout info for the input word.
-  Toolkit::Internal::TextView::RelayoutData relayoutData;
-  TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputStyledText;
-  MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData );
-
-  // Get the input word
-  TextViewProcessor::WordLayoutInfo inputWordLayout;
-
-  if( !inputLayout.mParagraphsLayoutInfo.empty() )
-  {
-    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *inputLayout.mParagraphsLayoutInfo.begin() );
-    if( !paragraph.mWordsLayoutInfo.empty() )
-    {
-      inputWordLayout = *( *inputLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-    }
-  }
-
-  // Create layout info for the first part of the result (after split the word)
-
-  Toolkit::Internal::TextView::RelayoutData firstRelayoutData;
-  TextViewProcessor::TextLayoutInfo& firstResultLayout( firstRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray firstResultStyledText;
-  MarkupProcessor::GetStyledTextArray( firstResult, firstResultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( firstResultStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     firstRelayoutData );
-
-  // Get the first result word
-  TextViewProcessor::WordLayoutInfo firstResultWordLayout;
-
-  if( !firstResultLayout.mParagraphsLayoutInfo.empty() )
-  {
-   const TextViewProcessor::ParagraphLayoutInfo& paragraph( *firstResultLayout.mParagraphsLayoutInfo.begin() );
-    if( !paragraph.mWordsLayoutInfo.empty() )
-    {
-      firstResultWordLayout = *( *firstResultLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-    }
-  }
-
-  // Create layout info for the last part of the result (after split the word)
-
-  Toolkit::Internal::TextView::RelayoutData lastRelayoutData;
-  TextViewProcessor::TextLayoutInfo& lastResultLayout( lastRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray lastResultStyledText;
-  MarkupProcessor::GetStyledTextArray( lastResult, lastResultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( lastResultStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     lastRelayoutData );
-
-  // Get the last result word
-  TextViewProcessor::WordLayoutInfo lastResultWordLayout;
-
-  if( !lastResultLayout.mParagraphsLayoutInfo.empty() )
-  {
-    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *lastResultLayout.mParagraphsLayoutInfo.begin() );
-    if( !paragraph.mWordsLayoutInfo.empty() )
-    {
-      lastResultWordLayout = *( *lastResultLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-    }
-  }
-
-  // Split the word.
-
-  TextViewProcessor::WordLayoutInfo lastWordLayoutInfo;
-
-  SplitWord( position,
-             inputWordLayout,
-             lastWordLayoutInfo );
-
-  // Test results
-  if( !TestEqual( inputWordLayout, firstResultWordLayout ) )
-  {
-    tet_printf( "Fail. different layout info. %s\n", location );
-    return false;
-  }
-
-  if( !TestEqual( lastWordLayoutInfo, lastResultWordLayout ) )
-  {
-    tet_printf( "Fail. different layout info. %s\n", location );
-    return false;
-  }
-
-  return true;
-}
-
-/**
- * Splits the \e input paragraph in two by the given \e wordIndex and \e characterIndex and checks the results with \e firstResult and \e lastResult.
- *
- * If the test fails it prints a short description and the line where this function was called.
- *
- * @param description Short description of the experiment. i.e. "Split the paragraph from the beginning. (wordIndex 0 and characterIndex 0)".
- * @param input The input word.
- * @param wordIndex Index to the word within the paragraph where to split it.
- * @param characterIndex Where to split the word.
- * @param characterIndex Character index within the paragraph.
- * @param lineHeightOffset Offset between lines.
- * @param firstResult First part of the split paragraph.
- * @param lastResult Last part of the split paragraph.
- * @param location Where this function has been called.
- *
- * @return \e true if the experiment is successful. Otherwise returns \e false.
- */
-bool TestSplitParagraph( const std::string& description,
-                         const std::string& input,
-                         size_t wordIndex,
-                         size_t characterIndex,
-                         size_t characterParagraphIndex,
-                         float lineHeightOffset,
-                         const std::string& firstResult,
-                         const std::string& lastResult,
-                         const char* location )
-{
-  tet_printf( "%s\n", description.c_str() );
-
-  // Create layout info for the input paragraph.
-  Toolkit::Internal::TextView::RelayoutData relayoutData;
-  TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputStyledText;
-  MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputStyledText,
-                                     Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
-                                                                                    Toolkit::TextView::Center,
-                                                                                    PointSize( lineHeightOffset ),
-                                                                                    true ),
-                                     relayoutData );
-
-  // Get the input paragraph
-  TextViewProcessor::ParagraphLayoutInfo inputParagraphLayout;
-
-  if( !inputLayout.mParagraphsLayoutInfo.empty() )
-  {
-    inputParagraphLayout = *inputLayout.mParagraphsLayoutInfo.begin();
-  }
-
-  // Create layout info for the first part of the result (after split the paragraph)
-
-  Toolkit::Internal::TextView::RelayoutData firstRelayoutData;
-  TextViewProcessor::TextLayoutInfo& firstResultLayout( firstRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray firstResultStyledText;
-  MarkupProcessor::GetStyledTextArray( firstResult, firstResultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( firstResultStyledText,
-                                     Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
-                                                                                    Toolkit::TextView::Center,
-                                                                                    PointSize( lineHeightOffset ),
-                                                                                    true ),
-                                     firstRelayoutData );
-
-  // Get the first result paragraph
-  TextViewProcessor::ParagraphLayoutInfo firstResultParagraphLayout;
-
-  if( !firstResultLayout.mParagraphsLayoutInfo.empty() )
-  {
-    firstResultParagraphLayout = *firstResultLayout.mParagraphsLayoutInfo.begin();
-  }
-
-  // Create layout info for the last part of the result (after split the paragraph)
-
-  Toolkit::Internal::TextView::RelayoutData lastRelayoutData;
-  TextViewProcessor::TextLayoutInfo& lastResultLayout( lastRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray lastResultStyledText;
-  MarkupProcessor::GetStyledTextArray( lastResult, lastResultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( lastResultStyledText,
-                                     Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
-                                                                                    Toolkit::TextView::Center,
-                                                                                    PointSize( lineHeightOffset ),
-                                                                                    true ),
-                                     lastRelayoutData );
-
-  // Get the last result paragraph
-  TextViewProcessor::ParagraphLayoutInfo lastResultParagraphLayout;
-
-  if( !lastResultLayout.mParagraphsLayoutInfo.empty() )
-  {
-    lastResultParagraphLayout = *lastResultLayout.mParagraphsLayoutInfo.begin();
-  }
-
-  // Split the paragraph.
-
-  TextViewProcessor::ParagraphLayoutInfo lastParagraphLayoutInfo;
-
-  TextViewProcessor::TextInfoIndices indices( 0, wordIndex, characterIndex );
-  indices.mCharacterParagraphIndex = characterParagraphIndex;
-
-  SplitParagraph( indices,
-                  PointSize( lineHeightOffset ),
-                  inputParagraphLayout,
-                  lastParagraphLayoutInfo );
-
-  // Test results
-  if( !TestEqual( inputParagraphLayout, firstResultParagraphLayout ) )
-  {
-    tet_printf( "Fail. different first layout info. %s\n", location );
-    return false;
-  }
-
-  if( !TestEqual( lastParagraphLayoutInfo, lastResultParagraphLayout ) )
-  {
-    tet_printf( "Fail. different last layout info. %s\n", location );
-    return false;
-  }
-
-  return true;
-}
-
-/**
- * Merges the \e inputFirst word and the \e inputLast word, and checks the results with \e result.
- *
- * If the test fails it prints a short description and the line where this function was called.
- *
- * @param description Short description of the experiment. i.e. "Merge two words with same style".
- * @param inputFirst The first part of the word.
- * @param inputLast The last part of the word.
- * @param result The merged word.
- * @param location Where this function has been called.
- *
- * @return \e true if the experiment is successful. Otherwise returns \e false.
- */
-bool TestMergeWords( const std::string& description, const std::string& inputFirst, const std::string& inputLast, const std::string& result, const char* location )
-{
-  tet_printf( "%s\n", description.c_str() );
-
-  // Create layout info for the inputFirst word.
-  Toolkit::Internal::TextView::RelayoutData firstRelayoutData;
-  TextViewProcessor::TextLayoutInfo& inputFirstLayout( firstRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputFirstStyledText;
-  MarkupProcessor::GetStyledTextArray( inputFirst, inputFirstStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputFirstStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     firstRelayoutData );
-
-  // Get the input word
-  TextViewProcessor::WordLayoutInfo inputFirstWordLayout;
-
-  if( !inputFirstLayout.mParagraphsLayoutInfo.empty() )
-  {
-    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *inputFirstLayout.mParagraphsLayoutInfo.begin() );
-    if( !paragraph.mWordsLayoutInfo.empty() )
-    {
-      inputFirstWordLayout = *( *inputFirstLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-    }
-  }
-
-  // Create layout info for the inputLast word.
-  Toolkit::Internal::TextView::RelayoutData lastRelayoutData;
-  TextViewProcessor::TextLayoutInfo& inputLastLayout( lastRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputLastStyledText;
-  MarkupProcessor::GetStyledTextArray( inputLast, inputLastStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputLastStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     lastRelayoutData );
-
-  // Get the input word
-  TextViewProcessor::WordLayoutInfo inputLastWordLayout;
-
-  if( !inputLastLayout.mParagraphsLayoutInfo.empty() )
-  {
-    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *inputLastLayout.mParagraphsLayoutInfo.begin() );
-    if( !paragraph.mWordsLayoutInfo.empty() )
-    {
-      inputLastWordLayout = *( *inputLastLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-    }
-  }
-
-  // Create layout info for the result word.
-  Toolkit::Internal::TextView::RelayoutData resultRelayoutData;
-  TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray resultStyledText;
-  MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( resultStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     resultRelayoutData );
-
-  // Get the result word
-  TextViewProcessor::WordLayoutInfo resultWordLayout;
-
-  if( !resultLayout.mParagraphsLayoutInfo.empty() )
-  {
-    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *resultLayout.mParagraphsLayoutInfo.begin() );
-    if( !paragraph.mWordsLayoutInfo.empty() )
-    {
-      resultWordLayout = *( *resultLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-    }
-  }
-
-  MergeWord( inputFirstWordLayout,
-             inputLastWordLayout );
-
-  if( !TestEqual( inputFirstWordLayout, resultWordLayout ) )
-  {
-    tet_printf( "Fail. different layout info. %s\n", location );
-    return false;
-  }
-
-  return true;
-}
-
-/**
- * Merges the \e inputFirst paragraph and the \e inputLast paragraph, and checks the results with \e result.
- *
- * If the test fails it prints a short description and the line where this function was called.
- *
- * @param description Short description of the experiment.
- * @param inputFirst The first part of the paragraph.
- * @param inputLast The last part of the paragraph.
- * @param lineHeightOffset Offset between lines.
- * @param result The merged paragraph.
- * @param location Where this function has been called.
- *
- * @return \e true if the experiment is successful. Otherwise returns \e false.
- */
-bool TestMergeParagraphs( const std::string& description, const std::string& inputFirst, const std::string& inputLast, const float lineHeightOffset, const std::string& result, const char* location )
-{
-  tet_printf( "%s\n", description.c_str() );
-
-  // Create layout info for the inputFirst paragraph.
-  Toolkit::Internal::TextView::RelayoutData firstRelayoutData;
-  TextViewProcessor::TextLayoutInfo& inputFirstLayout( firstRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputFirstStyledText;
-  MarkupProcessor::GetStyledTextArray( inputFirst, inputFirstStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputFirstStyledText,
-                                     Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
-                                                                                    Toolkit::TextView::Center,
-                                                                                    PointSize( lineHeightOffset ),
-                                                                                    true ),
-                                     firstRelayoutData );
-
-  // Get the input word
-  TextViewProcessor::ParagraphLayoutInfo inputFirstParagraphLayout;
-
-  if( !inputFirstLayout.mParagraphsLayoutInfo.empty() )
-  {
-    inputFirstParagraphLayout = *inputFirstLayout.mParagraphsLayoutInfo.begin();
-  }
-
-  // Create layout info for the inputLast paragraph.
-  Toolkit::Internal::TextView::RelayoutData lastRelayoutData;
-  TextViewProcessor::TextLayoutInfo& inputLastLayout( lastRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputLastStyledText;
-  MarkupProcessor::GetStyledTextArray( inputLast, inputLastStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputLastStyledText,
-                                     Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
-                                                                                    Toolkit::TextView::Center,
-                                                                                    PointSize( lineHeightOffset ),
-                                                                                    true ),
-                                     lastRelayoutData );
-
-  // Get the input word
-  TextViewProcessor::ParagraphLayoutInfo inputLastParagraphLayout;
-
-  if( !inputLastLayout.mParagraphsLayoutInfo.empty() )
-  {
-    inputLastParagraphLayout = *inputLastLayout.mParagraphsLayoutInfo.begin();
-  }
-
-  // Create layout info for the result word.
-  Toolkit::Internal::TextView::RelayoutData resultRelayoutData;
-  TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray resultStyledText;
-  MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( resultStyledText,
-                                     Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
-                                                                                    Toolkit::TextView::Center,
-                                                                                    PointSize( lineHeightOffset ),
-                                                                                    true ),
-                                     resultRelayoutData );
-
-  // Get the result word
-  TextViewProcessor::ParagraphLayoutInfo resultParagraphLayout;
-
-  if( !resultLayout.mParagraphsLayoutInfo.empty() )
-  {
-    resultParagraphLayout = *resultLayout.mParagraphsLayoutInfo.begin();
-  }
-
-  MergeParagraph( inputFirstParagraphLayout,
-                  inputLastParagraphLayout );
-
-  if( !TestEqual( inputFirstParagraphLayout, resultParagraphLayout ) )
-  {
-    tet_printf( "Fail. different layout info. %s\n", location );
-    return false;
-  }
-
-  return true;
-}
-
-/**
- * Removes from the \e input word the \e numberOfCharacters characters starting from the given \e position and checks the results with \e result.
- *
- * If the test fails it prints a short description and the line where this function was called.
- *
- * @param description Short description of the experiment. i.e. "Remove a whole word. Merge".
- * @param input The input word.
- * @param position Where to start to remove characters
- * @param numberOfCharacters The number of characters to remove.
- * @param result The word without the removed characters.
- * @param location Where this function has been called.
- *
- * @return \e true if the experiment is successful. Otherwise returns \e false.
- */
-bool TestRemoveCharactersFromWord( const std::string& description, const std::string& input, const std::size_t position, const std::size_t numberOfCharacters, const std::string& result, const char* location )
-{
-  tet_printf( "%s\n", description.c_str() );
-
-  // Create layout info for the input word.
-  Toolkit::Internal::TextView::RelayoutData relayoutData;
-  TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputStyledText;
-  MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData );
-
-  // Get the input word
-  TextViewProcessor::WordLayoutInfo inputWordLayout;
-
-  if( !inputLayout.mParagraphsLayoutInfo.empty() )
-  {
-    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *inputLayout.mParagraphsLayoutInfo.begin() );
-    if( !paragraph.mWordsLayoutInfo.empty() )
-    {
-      inputWordLayout = *( *inputLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-    }
-  }
-
-  // Create layout info for the result word.
-  Toolkit::Internal::TextView::RelayoutData resultRelayoutData;
-  TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray resultStyledText;
-  MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( resultStyledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     resultRelayoutData );
-
-  // Get the result word
-  TextViewProcessor::WordLayoutInfo resultWordLayout;
-
-  if( !resultLayout.mParagraphsLayoutInfo.empty() )
-  {
-    const TextViewProcessor::ParagraphLayoutInfo& paragraph( *resultLayout.mParagraphsLayoutInfo.begin() );
-    if( !paragraph.mWordsLayoutInfo.empty() )
-    {
-      resultWordLayout = *( *resultLayout.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-    }
-  }
-
-  RemoveCharactersFromWord( position,
-                            numberOfCharacters,
-                            inputWordLayout );
-
-  if( !TestEqual( inputWordLayout, resultWordLayout ) )
-  {
-    tet_printf( "Fail. different layout info. %s\n", location );
-    return false;
-  }
-
-  return true;
-}
-
-/**
- * Removes from the \e input paragraph the \e numberOfWords words starting from the given \e wordIndex and checks the results with \e result.
- *
- * If the test fails it prints a short description and the line where this function was called.
- *
- * @param description Short description of the experiment.
- * @param input The input paragraph.
- * @param wordIndex Index within the paragraph where to start to remove words.
- * @param numberOfWords The number of words to remove.
- * @param lineHeightOffset Offset between lines.
- * @param result The paragraph without the removed words.
- * @param location Where this function has been called.
- *
- * @return \e true if the experiment is successful. Otherwise returns \e false.
- */
-bool TestRemoveWordsFromParagraph( const std::string& description, const std::string& input, const std::size_t wordIndex, const std::size_t numberOfWords, const float lineHeightOffset, const std::string& result, const char* location )
-{
-  tet_printf( "%s\n", description.c_str() );
-
-  // Create layout info for the input paragraph.
-  Toolkit::Internal::TextView::RelayoutData relayoutData;
-  TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputStyledText;
-  MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputStyledText,
-                                     Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
-                                                                                    Toolkit::TextView::Center,
-                                                                                    PointSize( lineHeightOffset ),
-                                                                                    true ),
-                                     relayoutData );
-
-  // Get the input paragraph
-  TextViewProcessor::ParagraphLayoutInfo inputParagraphLayout;
-
-  if( !inputLayout.mParagraphsLayoutInfo.empty() )
-  {
-    inputParagraphLayout = *inputLayout.mParagraphsLayoutInfo.begin();
-  }
-
-  // Create layout info for the result paragraph.
-  Toolkit::Internal::TextView::RelayoutData resultRelayoutData;
-  TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray resultStyledText;
-  MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( resultStyledText,
-                                     Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
-                                                                                    Toolkit::TextView::Center,
-                                                                                    PointSize( lineHeightOffset ),
-                                                                                    true ),
-                                     resultRelayoutData );
-
-  // Get the result paragraph
-  TextViewProcessor::ParagraphLayoutInfo resultParagraphLayout;
-
-  if( !resultLayout.mParagraphsLayoutInfo.empty() )
-  {
-    resultParagraphLayout = *resultLayout.mParagraphsLayoutInfo.begin();
-  }
-
-  RemoveWordsFromParagraph( wordIndex,
-                            numberOfWords,
-                            lineHeightOffset,
-                            inputParagraphLayout );
-
-  if( !TestEqual( inputParagraphLayout, resultParagraphLayout ) )
-  {
-    tet_printf( "Fail. different layout info. %s\n", location );
-    tet_printf( "            input : [%s]\n", input.c_str() );
-    tet_printf( "           result : [%s]\n", GetText( resultParagraphLayout ).c_str() );
-    tet_printf( "  expected result : [%s]\n\n", result.c_str() );
-
-    Print(inputParagraphLayout); std::cout << std::endl << std::endl;
-    Print(resultParagraphLayout); std::cout << std::endl;
-    return false;
-  }
-
-  return true;
-}
-
-/**
- * Tests inserts, removes and updates operation in the given \e input text and checks with the given \e result.
- *
- * If the test fails it prints a short description and the line where this function was called.
- *
- * @param description Short description of the experiment.
- * @param operation Type of update operation (insert, remove, replace)
- * @param input The input text.
- * @param position Where to insert, remove or replace text.
- * @param numberOfCharacters Number of characters to remove or replace.
- * @param inputText Inserted or updated text.
- * @param lineHeightOffset Offset between lines.
- * @param result Expected result.
- * @param location Where this function has been called.
- *
- * @return \e true if the experiment is successful. Otherwise returns \e false.
- */
-bool TestUpdateTextInfo( const std::string& description,
-                         UpdateTextInfoOperation operation,
-                         const std::string& input,
-                         std::size_t position,
-                         std::size_t numberOfCharacters,
-                         const std::string& inputText,
-                         float lineHeightOffset,
-                         const std::string& result,
-                         const char* location )
-{
-  tet_printf( "%s\n", description.c_str() );
-
-  // Create layout info for the input.
-  Toolkit::Internal::TextView::RelayoutData relayoutData;
-  TextViewProcessor::TextLayoutInfo& inputLayout( relayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray inputStyledText;
-  MarkupProcessor::GetStyledTextArray( input, inputStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( inputStyledText,
-                                     Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
-                                                                                    Toolkit::TextView::Center,
-                                                                                    PointSize( lineHeightOffset ),
-                                                                                    true ),
-                                     relayoutData );
-
-  // Create layout info for the result.
-  Toolkit::Internal::TextView::RelayoutData resultRelayoutData;
-  TextViewProcessor::TextLayoutInfo& resultLayout( resultRelayoutData.mTextLayoutInfo );
-
-  MarkupProcessor::StyledTextArray resultStyledText;
-  MarkupProcessor::GetStyledTextArray( result, resultStyledText, true );
-
-  TextViewProcessor::CreateTextInfo( resultStyledText,
-                                     Toolkit::Internal::TextView::LayoutParameters( Toolkit::TextView::SplitByNewLineChar,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    Toolkit::TextView::Original,
-                                                                                    static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
-                                                                                    Toolkit::TextView::Center,
-                                                                                    PointSize( lineHeightOffset ),
-                                                                                    true ),
-                                     resultRelayoutData );
-
-  // Choose operation and call appropiate UpdateTextInfo() method.
-  const Toolkit::Internal::TextView::LayoutParameters layoutParameters( Toolkit::TextView::SplitByNewLineChar,
-                                                                        Toolkit::TextView::Original,
-                                                                        Toolkit::TextView::Original,
-                                                                        static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ),
-                                                                        Toolkit::TextView::Center,
-                                                                        PointSize( lineHeightOffset ),
-                                                                        true );
-
-  switch( operation )
-  {
-    case Insert:
-    {
-      MarkupProcessor::StyledTextArray inputStyledText;
-      MarkupProcessor::GetStyledTextArray( inputText, inputStyledText, true );
-
-      TextViewProcessor::UpdateTextInfo( position,
-                                         inputStyledText,
-                                         layoutParameters,
-                                         relayoutData );
-      break;
-    }
-    case Remove:
-    {
-      TextViewProcessor::UpdateTextInfo( position,
-                                         numberOfCharacters,
-                                         layoutParameters,
-                                         relayoutData,
-                                         TextViewProcessor::CLEAR_TEXT );
-      break;
-    }
-    case Replace:
-    {
-      MarkupProcessor::StyledTextArray inputStyledText;
-      MarkupProcessor::GetStyledTextArray( inputText, inputStyledText, true );
-
-      TextViewProcessor::UpdateTextInfo( position,
-                                         numberOfCharacters,
-                                         inputStyledText,
-                                         layoutParameters,
-                                         relayoutData );
-      break;
-    }
-    default:
-    {
-      tet_printf( "TestUpdateTextInfo: unknown update operation. %s\n", location );
-      return false;
-    }
-  }
-
-  if( !TestEqual( inputLayout, resultLayout ) )
-  {
-    tet_printf( "Fail. different layout info. %s\n", location );
-
-    // std::cout << "          result : "; Print( inputLayout );
-    // std::cout << " expected result : "; Print( resultLayout );
-    return false;
-  }
-
-  return true;
-}
-
-} // namespace
-
-
-int UtcDaliTextViewCreateTextInfo(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewCreateTextInfo : ");
-
-  // Metrics for characters
-
-  // Font size = 10
-  //     size : [9.48351, 9.48351]
-  //  advance : 9.48351
-  //  bearing : 8.53516
-  // ascender : 8.53516
-
-  // Font size = 12
-  //     size : [11.3802, 11.3802]
-  //  advance : 11.3802
-  //  bearing : 10.2422
-  // ascender : 10.2422
-
-  // Font size = 14
-  //     size : [13.2769, 13.2769]
-  //  advance : 13.2769
-  //  bearing : 11.9492
-  // ascender : 11.9492
-
-  const float HEIGHT_10( 9.48351f );
-  const float ADVANCE_10( 9.48351f );
-  const float BEARING_10( 8.53516f );
-  const float ASCENDER_10( 8.53516f );
-
-  const float HEIGHT_12( 11.3802f );
-  const float ADVANCE_12( 11.3802f );
-  const float BEARING_12( 10.2422f );
-  const float ASCENDER_12( 10.2422f );
-
-
-  // Generate a text.
-  Toolkit::Internal::TextView::RelayoutData relayoutData;
-  TextViewProcessor::TextLayoutInfo& textLayoutInfo( relayoutData.mTextLayoutInfo );
-
-  std::string text( "Hel<font size='10'>lo wo</font>rld!\n"
-                    "\n" );
-
-  MarkupProcessor::StyledTextArray styledText;
-  MarkupProcessor::GetStyledTextArray( text, styledText, true );
-
-  TextViewProcessor::CreateTextInfo( styledText,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData );
-
-
-  // Build the text info with metric values.
-
-  // Characters
-
-  TextViewProcessor::CharacterLayoutInfo layoutInfo10; // ( [lo wo])
-  layoutInfo10.mSize.height = HEIGHT_10;
-  layoutInfo10.mSize.width = ADVANCE_10;
-  layoutInfo10.mBearing = BEARING_10;
-  layoutInfo10.mAscender = ASCENDER_10;
-  TextViewProcessor::CharacterLayoutInfo layoutInfo12; // ( [Hel], [rld!] and [CR])
-  layoutInfo12.mSize.height = HEIGHT_12;
-  layoutInfo12.mSize.width = ADVANCE_12;
-  layoutInfo12.mBearing = BEARING_12;
-  layoutInfo12.mAscender = ASCENDER_12;
-
-  // Words
-
-  TextViewProcessor::WordLayoutInfo wordLayout1, wordLayout2, wordLayout3, wordLayout4;
-
-  // Hello
-  wordLayout1.mSize = Size( 3.f * ADVANCE_12 + 2.f * ADVANCE_10, HEIGHT_12 );
-  wordLayout1.mAscender = ASCENDER_12;
-  wordLayout1.mType = TextViewProcessor::NoSeparator;
-
-  wordLayout1.mCharactersLayoutInfo.push_back( layoutInfo12 ); // H
-  wordLayout1.mCharactersLayoutInfo.push_back( layoutInfo12 ); // e
-  wordLayout1.mCharactersLayoutInfo.push_back( layoutInfo12 ); // l
-  wordLayout1.mCharactersLayoutInfo.push_back( layoutInfo10 ); // l
-  wordLayout1.mCharactersLayoutInfo.push_back( layoutInfo10 ); // o
-
-  // (white space)
-  wordLayout2.mSize = Size( ADVANCE_10, HEIGHT_10 );
-  wordLayout2.mAscender = ASCENDER_10;
-  wordLayout2.mType = TextViewProcessor::WordSeparator;
-  wordLayout2.mCharactersLayoutInfo.push_back( layoutInfo10 ); // (white space)
-
-  // world!
-  wordLayout3.mSize = Size( 2.f * ADVANCE_10 + 4.f * ADVANCE_12, HEIGHT_12 );
-  wordLayout3.mAscender = ASCENDER_12;
-  wordLayout3.mType = TextViewProcessor::NoSeparator;
-  wordLayout3.mCharactersLayoutInfo.push_back( layoutInfo10 ); // w
-  wordLayout3.mCharactersLayoutInfo.push_back( layoutInfo10 ); // o
-  wordLayout3.mCharactersLayoutInfo.push_back( layoutInfo12 ); // r
-  wordLayout3.mCharactersLayoutInfo.push_back( layoutInfo12 ); // l
-  wordLayout3.mCharactersLayoutInfo.push_back( layoutInfo12 ); // d
-  wordLayout3.mCharactersLayoutInfo.push_back( layoutInfo12 ); // !
-
-  // (new paragraph character)
-  wordLayout4.mSize = Size( 0.f, HEIGHT_12 );
-  wordLayout4.mAscender = ASCENDER_12;
-  wordLayout4.mType = TextViewProcessor::ParagraphSeparator;
-  layoutInfo12.mSize.width = 0.f;
-  wordLayout4.mCharactersLayoutInfo.push_back( layoutInfo12 ); // (new paragraph char)
-
-  // Paragraphs
-
-  TextViewProcessor::ParagraphLayoutInfo paragraphLayout1, paragraphLayout2, paragraphLayout3;
-
-  paragraphLayout1.mSize = Size( 5.f * ADVANCE_10 + 7.f * ADVANCE_12, HEIGHT_12 );
-  paragraphLayout1.mAscender = ASCENDER_12;
-  paragraphLayout1.mNumberOfCharacters = 13;
-  paragraphLayout1.mWordsLayoutInfo.push_back( wordLayout1 );
-  paragraphLayout1.mWordsLayoutInfo.push_back( wordLayout2 );
-  paragraphLayout1.mWordsLayoutInfo.push_back( wordLayout3 );
-  paragraphLayout1.mWordsLayoutInfo.push_back( wordLayout4 );
-
-  paragraphLayout2.mSize = Size( 0.f, HEIGHT_12 );
-  paragraphLayout2.mAscender = ASCENDER_12;
-  paragraphLayout2.mNumberOfCharacters = 1;
-  paragraphLayout2.mWordsLayoutInfo.push_back( wordLayout4 );
-
-  paragraphLayout3.mSize = Size( 0.f, HEIGHT_12 );
-
-  // Text (layout)
-  TextViewProcessor::TextLayoutInfo textLayout;
-
-  textLayout.mWholeTextSize = Size( 5.f * ADVANCE_10 + 7.f * ADVANCE_12, 3.f * HEIGHT_12 );
-  textLayout.mMaxWordWidth = 2.f * ADVANCE_10 + 4.f * ADVANCE_12;
-  textLayout.mNumberOfCharacters = 14;
-  textLayout.mParagraphsLayoutInfo.push_back( paragraphLayout1 );
-  textLayout.mParagraphsLayoutInfo.push_back( paragraphLayout2 );
-  textLayout.mParagraphsLayoutInfo.push_back( paragraphLayout3 );
-
-  if(!TestEqual( textLayout, textLayoutInfo ))
-  {
-    std::cout << "Layout fails" << std::endl;
-    Print(textLayout); std::cout << std::endl;
-    Print(textLayoutInfo); std::cout << std::endl;
-  }
-
-  DALI_TEST_CHECK( TestEqual( textLayout, textLayoutInfo ) );
-  END_TEST;
-}
-
-int UtcDaliTextViewSplitWord(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewSplitWord : ");
-
-  struct SplitWordTest splitWordTests[] =
-  {
-    {
-      std::string( "Split word, position 0." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo</font>" ),
-      0,
-      std::string( "" ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo</font>" ),
-    },
-    {
-      std::string( "Split word, position 8." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo</font>" ),
-      8,
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo</font>" ),
-      std::string( "" ),
-    },
-    {
-      std::string( "Split word, position 2." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo</font>" ),
-      2,
-      std::string( "<font size='10'>He</font>" ),
-      std::string( "<font size='12'>ll</font><font size='10'>oooo</font>" ),
-    },
-    {
-      std::string( "Split word, position 3." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo</font>" ),
-      3,
-      std::string( "<font size='10'>He</font><font size='12'>l</font>" ),
-      std::string( "<font size='12'>l</font><font size='10'>oooo</font>" ),
-    },
-    {
-      std::string( "Split word, position 4." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo</font>" ),
-      4,
-      std::string( "<font size='10'>He</font><font size='12'>ll</font>" ),
-      std::string( "<font size='10'>oooo</font>" ),
-    },
-  };
-  const std::size_t numberOfTests( 5u );
-
-  for( std::size_t index = 0u; index < numberOfTests; ++index )
-  {
-    const SplitWordTest& test = splitWordTests[index];
-
-    if( !TestSplitWord( test.description, test.input, test.position, test.firstResult, test.lastResult, TEST_LOCATION ) )
-    {
-      tet_result( TET_FAIL );
-    }
-  }
-
-  tet_result( TET_PASS );
-  END_TEST;
-}
-
-int UtcDaliTextViewUpdateTextInfo(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewUpdateTextInfo : ");
-
-  struct UpdateTextInfoTest updateTextInfoTest[] =
-  {
-    // Remove operations
-
-    {
-      std::string( "Remove from new paragraph character to first character next paragraph." ),
-      Remove,
-      std::string("Hello world\nhello world."),
-      11,
-      2,
-      std::string(""),
-      0.f,
-      std::string("Hello worldello world."),
-    },
-    {
-      std::string( "Replace style from new paragraph character to first character next paragraph." ),
-      Replace,
-      std::string("Hello world\nhello world."),
-      11,
-      2,
-      std::string("<b>\nh</b>"),
-      0.f,
-      std::string("Hello world<b>\nh</b>ello world."),
-    },
-    {
-      std::string( "Remove from the beginning to the middle of last word." ),
-      Remove,
-      std::string("Hello world, hello world."),
-      0,
-      22,
-      std::string(), // Not used.
-      0.f,
-      std::string("ld."),
-    },
-    {
-      std::string( "Remove from the beginning to the middle of the text." ),
-      Remove,
-      std::string("Hello world hello world."),
-      0,
-      12,
-      std::string(), // Not used.
-      0.f,
-      std::string("hello world."),
-    },
-    // Remove within the same word:
-    // * within the same group of characters with same style.
-    {
-      std::string( "Remove within the same word, within the same group of characters with same style" ),
-      Remove,
-      std::string("Hello <font size='30'>world\nhello</font> world"),
-      7,
-      3,
-      std::string(), // Not used.
-      0.f,
-      std::string( "Hello <font size='30'>wd\nhello</font> world" )
-    },
-    // * whole group of characters (merge adjacent group of characters)
-    {
-      std::string( "Remove within the same word, whole group of characters (merge adjacent group of characters)" ),
-      Remove,
-      std::string("Hello <font size='30'>w<font size='20'>orl</font>d\nhello</font> world"),
-      7,
-      3,
-      std::string(), // Not used.
-      0.f,
-      std::string( "Hello <font size='30'>wd\nhello</font> world" )
-    },
-    // * whole group of characters (don't merge adjacent gtoup of characters)
-    {
-      std::string( "Remove within the same word, whole group of characters (don't merge adjacent gtoup of characters)" ),
-      Remove,
-      std::string("Hello <font size='30'>w</font>orl<font size='10'>d\nhello</font> world"),
-      7,
-      3,
-      std::string(), // Not used.
-      0.f,
-      std::string( "Hello <font size='30'>w</font><font size='10'>d\nhello</font> world" )
-    },
-    // * Remove whole word (merge words)
-    {
-      std::string( "Remove within the same word, whole word (merge words)" ),
-      Remove,
-      std::string("Hello <font size='30'>w</font>orl<font size='10'>d\nhello</font> world"),
-      5,
-      1,
-      std::string(), // Not used.
-      0.f,
-      std::string( "Hello<font size='30'>w</font>orl<font size='10'>d\nhello</font> world" )
-    },
-    // * Remove whole word (don't merge words)
-    {
-      std::string( "Remove within the same word, whole word (don't merge words)" ),
-      Remove,
-      std::string("Hello <font size='30'>w</font>orl<font size='10'>d\nhello</font> world"),
-      6,
-      5,
-      std::string(), // Not used.
-      0.f,
-      std::string( "Hello <font size='10'>\nhello</font> world" )
-    },
-    // * Remove whole word (merge paragraphs)
-    {
-      std::string( "Remove within the same word, whole word (merge paragraphs)" ),
-      Remove,
-      std::string("Hello <font size='30'>w</font>orl<font size='10'>d\nhello</font> world"),
-      11,
-      1,
-      std::string(), // Not used.
-      0.f,
-      std::string( "Hello <font size='30'>w</font>orl<font size='10'>dhello</font> world" )
-    },
-    // * Remove RTL text within LTR
-    {
-      std::string( "Remove within the same paragraph, RTL text within LTR." ),
-      Remove,
-      std::string("Hello world, שלום עולם, hello world"),
-      10,
-      15,
-      std::string(), // Not used.
-      0.f,
-      std::string( "Hello worlello world" )
-    },
-    // * Remove whole paragraph
-    {
-      std::string( "Remove whole paragraph" ),
-      Remove,
-      std::string("Hello world, hello world\n"
-                  "Hello world, hello world\n"
-                  "Hello world, hello world\n"
-                  "Hello world, hello world\n"),
-      25,
-      25,
-      std::string(), // Not used.
-      0.f,
-      std::string("Hello world, hello world\n"
-                  "Hello world, hello world\n"
-                  "Hello world, hello world\n"),
-    },
-    {
-      std::string( "Remove whole paragraph" ),
-      Remove,
-      std::string("Hello world, hello world\n"
-                  "H"),
-      25,
-      1,
-      std::string(), // Not used.
-      0.f,
-      std::string("Hello world, hello world\n"),
-    },
-
-
-    // Insert operations
-    {
-      std::string( "insert some text" ),
-      Insert,
-      std::string("inpuext"),
-      4,
-      0,             // Not used
-      std::string( "t t" ),
-      0.f,
-      std::string( "input text" )
-    },
-    {
-      std::string( "Insert text at the end" ),
-      Insert,
-      std::string("touch "),
-      6,
-      0,
-      std::string("me\nhello"),
-      0.f,
-      std::string("touch me\nhello")
-    },
-
-    // Replace operations.
-    {
-      std::string( "Replace style from the beginning to some point in the middle of the text." ),
-      Replace,
-      std::string( "Hello <font color='green'>world</font>" ),
-      0,
-      7,
-      std::string( "<font color='red'>Hello w</font>" ),
-      0.f,
-      std::string( "<font color='red'>Hello w</font><font color='green'>orld</font>" )
-    },
-    {
-      std::string( "Replace style from the middle of the text to the end." ),
-      Replace,
-      std::string( "Touch me\nhello" ),
-      6,
-      8,
-      std::string( "<b>me\nhello</b>" ),
-      0.f,
-      std::string( "Touch <b>me\nhello</b>" )
-    },
-    {
-      std::string( "Remove characters from text. Previous next test:Replace style from the middle of the text 1." ),
-      Remove,
-      std::string( "Touch me\nhello\nworld" ),
-      6,
-      8,
-      std::string( "" ),
-      0.f,
-      std::string( "Touch \nworld" )
-    },
-    {
-      std::string( "Insert styled text in the middle of a text. Previous: Replace style from the middle of the text 1." ),
-      Insert,
-      std::string( "Touch \nworld" ),
-      6,
-      0,
-      std::string( "<b>me\nhello</b>" ),
-      0.f,
-      std::string( "Touch <b>me\nhello</b>\nworld" )
-    },
-    {
-      std::string( "Replace style from the middle of the text 1." ),
-      Replace,
-      std::string( "Touch me\nhello\nworld" ),
-      6,
-      8,
-      std::string( "<b>me\nhello</b>" ),
-      0.f,
-      std::string( "Touch <b>me\nhello</b>\nworld" )
-    },
-    {
-      std::string( "Remove characters from text. Previous next test:Replace style from the middle of the text 2." ),
-      Remove,
-      std::string( "Touch me\nhello\nworld" ),
-      6,
-      9,
-      std::string( "" ),
-      0.f,
-      std::string( "Touch world" )
-    },
-    {
-      std::string( "Replace style from the middle of the text 2." ),
-      Replace,
-      std::string( "Touch me\nhello\nworld" ),
-      6,
-      9,
-      std::string( "<b>me\nhello\n</b>" ),
-      0.f,
-      std::string( "Touch <b>me\nhello\n</b>world" )
-    },
-  };
-  const std::size_t numberOfTests( 22u );
-
-  for( std::size_t index = 0u; index < numberOfTests; ++index )
-  {
-    const UpdateTextInfoTest& test = updateTextInfoTest[index];
-
-    if( !TestUpdateTextInfo( test.description, test.operation, test.input, test.position, test.numberOfCharacters, test.inputText, test.lineHeightOffset, test.result, TEST_LOCATION ) )
-    {
-      tet_result( TET_FAIL );
-    }
-  }
-
-  tet_result( TET_PASS );
-  END_TEST;
-}
-
-int UtcDaliTextViewSplitParagraph(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewSplitParagraph : ");
-
-  struct SplitParagraphTest splitParagraphTests[] =
-  {
-    {
-      std::string( "Split paragraph, wordPosition 0, position 0." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
-      0,
-      0,
-      0,
-      3.f,
-      std::string( "" ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
-    },
-    {
-      std::string( "Split paragraph, wordPosition 10, position 4." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
-      10,
-      4,
-      36,
-      0.f,
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
-      std::string( "" ),
-    },
-    {
-     std::string( "Split paragraph, wordPosition 2, position 4." ),
-      std::string("<font size='10'>Hello </font>wor<font size='12'>ld, hello wo</font>rld"),
-      2,
-      4,
-      10,
-      0.f,
-      std::string("<font size='10'>Hello </font>wor<font size='12'>l</font>"),
-      std::string("<font size='12'>d, hello wo</font>rld")
-    },
-    {
-      std::string( "Split paragraph, wordPosition 6, position 0." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
-      6,
-      0,
-      21,
-      0.f,
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום " ),
-      std::string( "עולם text text" ),
-    },
-    {
-      std::string( "Split paragraph, wordPosition 4, position 0." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
-      4,
-      0,
-      17,
-      0.f,
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> " ),
-      std::string( "שלום עולם text text" ),
-    },
-    {
-      std::string( "Split paragraph2, wordPosition 8, position 0." ),
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם text text" ),
-      8,
-      0,
-      27,
-      6.f,
-      std::string( "<font size='10'>He<font size='12'>ll</font>oooo wooorld</font> שלום עולם " ),
-      std::string( "text text" ),
-    },
-  };
-  const std::size_t numberOfTests( 6u );
-
-  for( std::size_t index = 0u; index < numberOfTests; ++index )
-  {
-    const SplitParagraphTest& test = splitParagraphTests[index];
-
-    if( !TestSplitParagraph( test.description,
-                             test.input,
-                             test.wordIndex,
-                             test.characterIndex,
-                             test.characterParagraphIndex,
-                             test.lineHeightOffset,
-                             test.firstResult,
-                             test.lastResult,
-                             TEST_LOCATION ) )
-    {
-      tet_result( TET_FAIL );
-    }
-  }
-
-  tet_result( TET_PASS );
-  END_TEST;
-}
-
-int UtcDaliTextViewMergeWord01(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewMergeWord01 : ");
-
-  struct MergeWordsTest mergeWordsTests[] =
-  {
-    {
-      std::string( "Merge words with same style." ),
-      std::string( "Hel" ),
-      std::string( "lo" ),
-      std::string( "Hello" ),
-    },
-    {
-      std::string( "Merge words with different styles." ),
-      std::string( "<font size='10>Hel</font>" ),
-      std::string( "<font size='20'>lo</font>" ),
-      std::string( "<font size='10'>Hel</font><font size='20'>lo</font>" )
-    },
-  };
-  const std::size_t numberOfTests( 2u );
-
-  for( std::size_t index = 0u; index < numberOfTests; ++index )
-  {
-    const MergeWordsTest& test = mergeWordsTests[index];
-
-    if( !TestMergeWords( test.description, test.inputFirst, test.inputLast, test.result, TEST_LOCATION ) )
-    {
-      tet_result( TET_FAIL );
-    }
-  }
-
-  tet_result( TET_PASS );
-  END_TEST;
-}
-
-int UtcDaliTextViewMergeWord02(void)
-{
-  // Negative test.
-  // It test white spaces and new paragraph characters can't be merged to other words.
-
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewMergeWord02 : ");
-
-  // Generate three words
-
-  Toolkit::Internal::TextView::RelayoutData relayoutData01;
-  Toolkit::Internal::TextView::RelayoutData relayoutData02;
-  Toolkit::Internal::TextView::RelayoutData relayoutData03;
-  TextViewProcessor::TextLayoutInfo& textLayoutInfo01( relayoutData01.mTextLayoutInfo );
-  TextViewProcessor::TextLayoutInfo& textLayoutInfo02( relayoutData02.mTextLayoutInfo );
-  TextViewProcessor::TextLayoutInfo& textLayoutInfo03( relayoutData03.mTextLayoutInfo );
-
-  std::string text01( " " );
-  std::string text02( "\n" );
-  std::string text03( "a" );
-  MarkupProcessor::StyledTextArray styledText01;
-  MarkupProcessor::StyledTextArray styledText02;
-  MarkupProcessor::StyledTextArray styledText03;
-  MarkupProcessor::GetStyledTextArray( text01, styledText01, true );
-  MarkupProcessor::GetStyledTextArray( text02, styledText02, true );
-  MarkupProcessor::GetStyledTextArray( text03, styledText03, true );
-
-  TextViewProcessor::CreateTextInfo( styledText01,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData01 );
-
-  TextViewProcessor::WordLayoutInfo wordLayoutInfo01;
-
-  wordLayoutInfo01 = *( *textLayoutInfo01.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-
-  TextViewProcessor::CreateTextInfo( styledText02,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData02 );
-
-  TextViewProcessor::WordLayoutInfo wordLayoutInfo02;
-
-  wordLayoutInfo02 = *( *textLayoutInfo02.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-
-  TextViewProcessor::CreateTextInfo( styledText03,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData03 );
-
-  TextViewProcessor::WordLayoutInfo wordLayoutInfo03;
-
-  wordLayoutInfo03 = *( *textLayoutInfo03.mParagraphsLayoutInfo.begin() ).mWordsLayoutInfo.begin();
-
-  // Test MergeWord() asserts if white spaces or new paragraph chars are merged.
-  bool assert1 = false;
-  bool assert2 = false;
-  bool assert3 = false;
-  bool assert4 = false;
-  bool assert5 = false;
-  bool assert6 = false;
-
-  try
-  {
-    MergeWord( wordLayoutInfo01,
-               wordLayoutInfo02 );
-  }
-  catch( Dali::DaliException& e )
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
-    assert1 = true;
-  }
-  try
-  {
-    MergeWord( wordLayoutInfo01,
-               wordLayoutInfo03 );
-  }
-  catch( Dali::DaliException& e )
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
-    assert2 = true;
-  }
-  try
-  {
-    MergeWord( wordLayoutInfo02,
-               wordLayoutInfo01 );
-  }
-  catch( Dali::DaliException& e )
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
-    assert3 = true;
-  }
-  try
-  {
-    MergeWord( wordLayoutInfo02,
-               wordLayoutInfo03 );
-  }
-  catch( Dali::DaliException& e )
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
-    assert4 = true;
-  }
-  try
-  {
-    MergeWord( wordLayoutInfo03,
-               wordLayoutInfo01 );
-  }
-  catch( Dali::DaliException& e )
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
-    assert5 = true;
-  }
-  try
-  {
-    MergeWord( wordLayoutInfo03,
-               wordLayoutInfo02 );
-  }
-  catch( Dali::DaliException& e )
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeWord(). ERROR: White spaces or new paragraph characters can't be merged with other words.\"", TEST_LOCATION );
-    assert6 = true;
-  }
-
-  if( assert1 && assert2 && assert3 && assert4 && assert5 && assert6 )
-  {
-    tet_result( TET_PASS );
-  }
-  else
-  {
-    tet_result( TET_FAIL );
-  }
-  END_TEST;
-}
-
-int UtcDaliTextViewMergeParagraph01(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewMergeParagraph01 : ");
-
-  struct MergeParagraphsTest mergeParagraphsTests[] =
-  {
-    {
-      std::string( "Merge a void first paragraph." ),
-      std::string( "" ),
-      std::string( "Hello world, this is a whole paragraph" ),
-      2.f,
-      std::string( "Hello world, this is a whole paragraph" )
-    },
-    {
-      std::string( "Merge a void last paragraph." ),
-      std::string( "Hello world, this is a whole paragraph" ),
-      std::string( "" ),
-      0.f,
-      std::string( "Hello world, this is a whole paragraph" )
-    },
-    {
-      std::string( "Merge paragraphs: last starting with RTL text and first ending with RTL" ),
-      std::string( "Hello world, שלום" ),
-      std::string( " עולם, hello world." ),
-      6.f,
-      std::string( "Hello world, שלום עולם, hello world." )
-    },
-    {
-      std::string( "Merge paragraphs and don't merge last and first words." ),
-      std::string( "Hello world, " ),
-      std::string( "שלום עולם, hello world." ),
-      3.f,
-      std::string( "Hello world, שלום עולם, hello world." )
-    },
-    {
-      std::string( "Merge paragraphs. Don't merge words" ),
-      std::string( "Hello world," ),
-      std::string( " this is a whole paragraph" ),
-      0.f,
-      std::string( "Hello world, this is a whole paragraph" )
-    },
-    {
-      std::string( "Merge paragraphs. Merge words" ),
-      std::string( "Hello world, th" ),
-      std::string( "is is a whole paragraph" ),
-      0.f,
-      std::string( "Hello world, this is a whole paragraph" )
-    },
-  };
-  const std::size_t numberOfTests( 6u );
-
-  for( std::size_t index = 0u; index < numberOfTests; ++index )
-  {
-    const MergeParagraphsTest& test = mergeParagraphsTests[index];
-
-    if( !TestMergeParagraphs( test.description, test.inputFirst, test.inputLast, test.lineHeightOffset, test.result, TEST_LOCATION ) )
-    {
-      tet_result( TET_FAIL );
-    }
-  }
-
-  tet_result( TET_PASS );
-  END_TEST;
-}
-
-int UtcDaliTextViewMergeParagraph02(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewMergeParagraph02 : ");
-
-  Toolkit::Internal::TextView::RelayoutData relayoutData01;
-  Toolkit::Internal::TextView::RelayoutData relayoutData02;
-  TextViewProcessor::TextLayoutInfo& textLayoutInfo01( relayoutData01.mTextLayoutInfo );
-  TextViewProcessor::TextLayoutInfo& textLayoutInfo02( relayoutData02.mTextLayoutInfo );
-
-  std::string text01( "Hello world\n" );
-  std::string text02( "hello world" );
-  MarkupProcessor::StyledTextArray styledText01;
-  MarkupProcessor::StyledTextArray styledText02;
-  MarkupProcessor::GetStyledTextArray( text01, styledText01, true );
-  MarkupProcessor::GetStyledTextArray( text02, styledText02, true );
-
-  TextViewProcessor::CreateTextInfo( styledText01,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData01 );
-
-  TextViewProcessor::ParagraphLayoutInfo paragraphLayoutInfo01;
-
-  paragraphLayoutInfo01 = *textLayoutInfo01.mParagraphsLayoutInfo.begin();
-
-  TextViewProcessor::CreateTextInfo( styledText02,
-                                     DEFAULT_LAYOUT_PARAMETERS,
-                                     relayoutData02 );
-
-  TextViewProcessor::ParagraphLayoutInfo paragraphLayoutInfo02;
-
-  paragraphLayoutInfo02 = *textLayoutInfo02.mParagraphsLayoutInfo.begin();
-
-  bool assert1 = false;
-
-  try
-  {
-    MergeParagraph( paragraphLayoutInfo01,
-                    paragraphLayoutInfo02 );
-  }
-  catch( Dali::DaliException& e )
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS( e.condition, "!\"TextViewProcessor::MergeParagraph(). ERROR: A paragraph can't be merged to another paragraph which finishes with a new paragraph character.\"", TEST_LOCATION );
-    assert1 = true;
-  }
-
-  if( assert1 )
-  {
-    tet_result( TET_PASS );
-  }
-  else
-  {
-    tet_result( TET_FAIL );
-  }
-  END_TEST;
-}
-
-int UtcDaliTextViewRemoveCharactersFromWord(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewMergeWord02 : ");
-
-  struct RemoveCharactersFromWordTest removeCharactersFromWordTests[] =
-  {
-    {
-      std::string( "Delete 0 characters." ),
-      std::string( "Hello" ),
-      3,
-      0,
-      std::string( "Hello" ),
-    },
-    {
-      std::string( "Delete within the same group of characters. Starting from the beginning" ),
-      std::string( "Hello" ),
-      0,
-      3,
-      std::string( "lo" ),
-    },
-    {
-      std::string( "Delete within the same group of characters. Somewhere in the middle" ),
-      std::string( "Hello" ),
-      2,
-      2,
-      std::string( "Heo" ),
-    },
-    {
-      std::string( "Delete within the same group of characters. Starting somewhere in the middle to the end" ),
-      std::string( "Hello" ),
-      3,
-      2,
-      std::string( "Hel" ),
-    },
-    {
-      std::string( "Delete within the same group of characters. Finish just before a new one." ),
-      std::string( "<font size='10'>Hel</font><font size='20'>loWo</font><font size='30'>rld</font>" ),
-      1,
-      2,
-      std::string( "<font size='10'>H</font><font size='20'>loWo</font><font size='30'>rld</font>" ),
-    },
-    {
-      std::string( "Delete starting in one group of characters and finishing in a different one. No merge of groups." ),
-      std::string( "<font size='10'>Hel</font><font size='20'>loWo</font><font size='30'>rld</font>" ),
-      2,
-      3,
-      std::string( "<font size='10'>He</font><font size='20'>Wo</font><font size='30'>rld</font>" ),
-    },
-    {
-      std::string( "Delete within the same group of characters. Starting just after a different one." ),
-      std::string( "<font size='10'>Hel</font><font size='20'>loWo</font><font size='30'>rld</font>" ),
-      7,
-      2,
-      std::string( "<font size='10'>Hel</font><font size='20'>loWo</font><font size='30'>d</font>" ),
-    },
-    {
-      std::string( "Delete whole group of characters. No merge" ),
-      std::string( "<font size='10'>Hel</font><font size='20'>loWo</font><font size='30'>rld</font>" ),
-      3,
-      4,
-      std::string( "<font size='10'>Hel</font><font size='30'>rld</font>" ),
-    },
-    {
-      std::string( "Delete whole group of characters and part of the adjacent ones. No merge" ),
-      std::string( "<font size='10'>Hel</font><font size='20'>loWo</font><font size='30'>rld</font>" ),
-      2,
-      6,
-      std::string( "<font size='10'>He</font><font size='30'>ld</font>" ),
-    },
-    {
-      std::string( "Delete whole group of characters. Merge" ),
-      std::string( "<font size='10'>Hel</font><font size='20'>loWo</font><font size='10'>rld</font>" ),
-      3,
-      4,
-      std::string( "<font size='10'>Helrld</font>" ),
-    },
-    {
-      std::string( "Delete whole group of characters and part of the adjacent ones. Merge" ),
-      std::string( "<font size='10'>Hel</font><font size='20'>loWo</font><font size='10'>rld</font>" ),
-      2,
-      6,
-      std::string( "<font size='10'>Held</font>" ),
-    },
-  };
-  const std::size_t numberOfTests( 11u );
-
-  for( std::size_t index = 0u; index < numberOfTests; ++index )
-  {
-    const RemoveCharactersFromWordTest& test = removeCharactersFromWordTests[index];
-
-    if( !TestRemoveCharactersFromWord( test.description, test.input, test.position, test.numberOfCharacters, test.result, TEST_LOCATION ) )
-    {
-      tet_result( TET_FAIL );
-    }
-  }
-
-  tet_result( TET_PASS );
-  END_TEST;
-}
-
-int UtcDaliTextViewRemoveWordsFromParagraph(void)
-{
-  // Note: Currently RemoveWordsFromParagraph() function is only used to remove a number of words from the beginning, or
-  //       from a given index to the end.
-
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextViewRemoveWordsFromParagraph : ");
-  struct RemoveWordsFromParagraphTest removeWordsFromParagraphTest[] =
-  {
-    {
-      std::string( "Delete 0 words." ),
-      std::string( "Hello hello, שלום עולם hello hello" ),
-      0,
-      0,
-      2.f,
-      std::string( "Hello hello, שלום עולם hello hello" ),
-    },
-    {
-      std::string( "Delete from the middle to the end." ),
-      std::string( "Hello hello, שלום עולם hello hello" ),
-      4,
-      7,
-      0.f,
-      std::string( "Hello hello, " ),
-    },
-    {
-      std::string( "Delete from the beginning to the middle." ),
-      std::string( "Hello hello, שלום עולם hello hello" ),
-      0,
-      8,
-      6.f,
-      std::string( "hello hello" ),
-    },
-  };
-  const std::size_t numberOfTests( 3u );
-
-  for( std::size_t index = 0u; index < numberOfTests; ++index )
-  {
-    const RemoveWordsFromParagraphTest& test = removeWordsFromParagraphTest[index];
-
-    if( !TestRemoveWordsFromParagraph( test.description, test.input, test.wordIndex, test.numberOfWords, test.lineHeightOffset, test.result, TEST_LOCATION ) )
-    {
-      tet_result( TET_FAIL );
-    }
-  }
-
-  tet_result( TET_PASS );
-  END_TEST;
-}
index 03399af..a3f7172 100644 (file)
@@ -63,8 +63,6 @@ SET(TC_SOURCES
    utc-Dali-StyleManager.cpp
    utc-Dali-SuperBlurView.cpp
    utc-Dali-SwirlEffect.cpp
-   utc-Dali-TextInput.cpp
-   utc-Dali-TextView.cpp
 )
 
 # Append list of test harness files (Won't get parsed for test cases)
index 89138eb..df3ae2e 100644 (file)
@@ -72,6 +72,8 @@ void TestApplication::Initialize()
 
   Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage);
   Dali::Integration::Log::InstallLogFunction(logFunction);
+
+  mCore->SceneCreated();
 }
 
 TestApplication::~TestApplication()
index 6d3fa86..0f62a2a 100644 (file)
@@ -934,7 +934,7 @@ int UtcDaliAlignmentOnSizeSet(void)
   application.Render();
   application.SendNotification();
 
-  Vector3 size(100.0f, 200.0f, 0.0f);
+  Vector2 size( 100.0f, 200.0f );
   alignment.SetSize(size);
 
   application.Render();
@@ -942,7 +942,7 @@ int UtcDaliAlignmentOnSizeSet(void)
   application.Render();
   application.SendNotification();
 
-  DALI_TEST_EQUALS(size, alignment.GetImplementation().GetControlSize(), TEST_LOCATION);
+  DALI_TEST_EQUALS(size, alignment.GetImplementation().GetControlSize().GetVectorXY(), TEST_LOCATION);
 
   Stage::GetCurrent().Remove(alignment);
   END_TEST;
@@ -1010,7 +1010,7 @@ int UtcDaliAlignmentOnSizeAnimation(void)
   Stage::GetCurrent().Add(alignment);
 
   Animation animation = Animation::New(100.0f);
-  animation.Resize(alignment, Vector3(100.0f, 150.0f, 200.0f));
+  animation.AnimateTo( Property( alignment, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );
   animation.Play();
 
   application.Render();
index 3a6900e..12e85b6 100644 (file)
@@ -144,6 +144,7 @@ int UtcDaliButtonSize(void)
 
   // First an image is set, then SetSize is called.
   pushButton = PushButton::New();
+  Stage::GetCurrent().Add( pushButton );
 
   pushButton.SetBackgroundImage( image01 );
   pushButton.SetSize( 10.f, 10.f );
index 32bb9de..d6dc8d4 100644 (file)
@@ -111,6 +111,7 @@ int UtcDaliCheckBoxButtonSetImages(void)
   Image image02 = CreateSolidColorImage( Color::RED, 30, 30 );
   ImageActor imageActor02 = CreateSolidColorActor( Color::RED );
   imageActor02.SetSize( 40, 40 );
+  imageActor02.SetName( "imageActor02" );
 
   Image image03 = CreateSolidColorImage( Color::RED, 50, 50 );
   ImageActor imageActor03 = CreateSolidColorActor( Color::RED );
@@ -122,6 +123,8 @@ int UtcDaliCheckBoxButtonSetImages(void)
 
   Vector3 size;
   CheckBoxButton checkBoxButton = CheckBoxButton::New();
+  checkBoxButton.SetName( "UtcDaliCheckBoxButtonSetImages" );
+  Stage::GetCurrent().Add( checkBoxButton );
 
   application.SendNotification();
   application.Render();
@@ -133,79 +136,12 @@ int UtcDaliCheckBoxButtonSetImages(void)
   application.SendNotification();
   application.Render();
 
-  size = checkBoxButton.GetBackgroundImage().GetCurrentSize();
+  size = checkBoxButton.GetCurrentSize();
 
   DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION );
   DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
 
   checkBoxButton.SetBackgroundImage( imageActor01 );
 
-  application.SendNotification();
-  application.Render();
-
-  size = checkBoxButton.GetBackgroundImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
-
-  checkBoxButton.SetSelectedImage( image02 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = checkBoxButton.GetSelectedImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 30.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 30.f, TEST_LOCATION );
-
-  checkBoxButton.SetSelectedImage( imageActor02 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = checkBoxButton.GetSelectedImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 40.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 40.f, TEST_LOCATION );
-
-  checkBoxButton.SetDisabledBackgroundImage( image03 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = checkBoxButton.GetDisabledBackgroundImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 50.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 50.f, TEST_LOCATION );
-
-  checkBoxButton.SetDisabledBackgroundImage( imageActor03 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = checkBoxButton.GetDisabledBackgroundImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 60.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 60.f, TEST_LOCATION );
-
-  checkBoxButton.SetDisabledSelectedImage( image04 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = checkBoxButton.GetDisabledSelectedImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 70.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 70.f, TEST_LOCATION );
-
-  checkBoxButton.SetDisabledSelectedImage( imageActor04 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = checkBoxButton.GetDisabledSelectedImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 80.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 80.f, TEST_LOCATION );
   END_TEST;
 }
index a424aa7..beeb619 100644 (file)
@@ -327,27 +327,17 @@ int UtcDaliControlTestParameters(void)
   ToolkitTestApplication application;
   DummyControl test = DummyControl::New();
 
-  Vector3 maxSize = test.GetNaturalSize();
-  Vector3 minSize = maxSize / 2.0f;
+  test.SetSize( 0.7f, 0.7f, 0.7f );
 
-  Toolkit::Control::SizePolicy widthPolicy( Control::Fixed );
-  Toolkit::Control::SizePolicy heightPolicy( Control::Fixed );
-  test.SetSizePolicy( widthPolicy, heightPolicy );
-  test.GetSizePolicy( widthPolicy, heightPolicy );
+  Stage::GetCurrent().Add( test );
 
-  DALI_TEST_CHECK( widthPolicy == Control::Fixed && heightPolicy == Control::Fixed );
+  application.SendNotification();
+  application.Render();
 
-  test.SetSize( 0.7f, 0.7f, 0.7f );
   float width = 640.0f;
   float height = test.GetHeightForWidth( width );
   DALI_TEST_CHECK( test.GetWidthForHeight( height ) == width );
 
-  test.SetMinimumSize( minSize );
-  DALI_TEST_CHECK( test.GetMinimumSize() == minSize );
-
-  test.SetMaximumSize( maxSize );
-  DALI_TEST_CHECK( test.GetMaximumSize() == maxSize );
-
   test.KeyEventSignal();
 
   // Provide coverage for pointer destructor
@@ -381,7 +371,7 @@ int UtcDaliControlBackgroundImage(void)
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
 
   Image image = ResourceImage::New("TestImage");
-  control.SetBackground( image );
+  control.SetBackgroundImage( image );
   DALI_TEST_CHECK( control.GetBackgroundActor() );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::WHITE, TEST_LOCATION );
 
@@ -393,7 +383,7 @@ int UtcDaliControlBackgroundImage(void)
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
 
   control.SetBackgroundColor( Color::YELLOW );
-  control.SetBackground( image );
+  control.SetBackgroundImage( image );
   DALI_TEST_CHECK( control.GetBackgroundActor() );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::YELLOW, TEST_LOCATION );
 
@@ -408,7 +398,7 @@ int UtcDaliControlBackgroundProperties(void)
   DALI_TEST_CHECK( !control.GetBackgroundActor() );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
   DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
-  DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
+  DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND_IMAGE ).Get< Property::Map >().Empty() );
 
   control.SetProperty( Control::Property::BACKGROUND_COLOR, Color::RED );
   DALI_TEST_CHECK( control.GetBackgroundActor() );
@@ -419,72 +409,22 @@ int UtcDaliControlBackgroundProperties(void)
   imageMap[ "filename" ] = "TestImage";
   Property::Map map;
   map[ "image" ] = imageMap;
-  control.SetProperty( Control::Property::BACKGROUND, map );
+  control.SetProperty( Control::Property::BACKGROUND_IMAGE, map );
   DALI_TEST_CHECK( control.GetBackgroundActor() );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::RED, TEST_LOCATION );
   DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::RED, TEST_LOCATION );
 
-  Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
+  Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND_IMAGE );
   DALI_TEST_CHECK( propValue.HasKey( "image" ) );
   DALI_TEST_CHECK( propValue.GetValue( "image" ).HasKey( "filename" ) );
   DALI_TEST_CHECK( propValue.GetValue( "image" ).GetValue( "filename" ).Get< std::string>() == "TestImage" );
 
   Property::Map emptyMap;
-  control.SetProperty( Control::Property::BACKGROUND, emptyMap );
+  control.SetProperty( Control::Property::BACKGROUND_IMAGE, emptyMap );
   DALI_TEST_CHECK( !control.GetBackgroundActor() );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
   DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
-  DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
-
-  END_TEST;
-}
-
-int UtcDaliControlSizePolicyProperties(void)
-{
-  ToolkitTestApplication application;
-
-  Control control = Control::New();
-
-  Control::SizePolicy widthPolicy( Control::Fixed );
-  Control::SizePolicy heightPolicy( Control::Fixed );
-
-  control.GetSizePolicy( widthPolicy, heightPolicy );
-  DALI_TEST_EQUALS( "FIXED", control.GetProperty( Control::Property::WIDTH_POLICY ).Get< std::string >(), TEST_LOCATION );
-  DALI_TEST_EQUALS( "FIXED", control.GetProperty( Control::Property::HEIGHT_POLICY ).Get< std::string >(), TEST_LOCATION );
-
-  control.SetSizePolicy( Control::Flexible, Control::Range );
-  DALI_TEST_EQUALS( "FLEXIBLE", control.GetProperty( Control::Property::WIDTH_POLICY ).Get< std::string >(), TEST_LOCATION );
-  DALI_TEST_EQUALS( "RANGE", control.GetProperty( Control::Property::HEIGHT_POLICY ).Get< std::string >(), TEST_LOCATION );
-
-  control.SetProperty( Control::Property::WIDTH_POLICY, "MAXIMUM" );
-  control.SetProperty( Control::Property::HEIGHT_POLICY, "MINIMUM" );
-  control.GetSizePolicy( widthPolicy, heightPolicy );
-  DALI_TEST_EQUALS( Control::Maximum, widthPolicy, TEST_LOCATION );
-  DALI_TEST_EQUALS( Control::Minimum, heightPolicy, TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliControlSizeProperties(void)
-{
-  ToolkitTestApplication application;
-
-  Control control = Control::New();
-
-  DALI_TEST_EQUALS( control.GetMinimumSize(), control.GetProperty( Control::Property::MINIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
-  DALI_TEST_EQUALS( control.GetMaximumSize(), control.GetProperty( Control::Property::MAXIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
-
-  control.SetMinimumSize( Vector3( 100.0f, 200.0f, 300.0f ) );
-  DALI_TEST_EQUALS( Vector3( 100.0f, 200.0f, 300.0f ), control.GetProperty( Control::Property::MINIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
-
-
-  control.SetMaximumSize( Vector3( 200.0f, 250.0f, 800.0f ) );
-  DALI_TEST_EQUALS( Vector3( 200.0f, 250.0f, 800.0f ), control.GetProperty( Control::Property::MAXIMUM_SIZE ).Get< Vector3 >(), TEST_LOCATION );
-
-  control.SetProperty( Control::Property::MINIMUM_SIZE, Vector3( 1.0f, 2.0f, 3.0f ) );
-  control.SetProperty( Control::Property::MAXIMUM_SIZE, Vector3( 10.0f, 20.0f, 30.0f ) );
-  DALI_TEST_EQUALS( control.GetMinimumSize(), Vector3( 1.0f, 2.0f, 3.0f ), TEST_LOCATION );
-  DALI_TEST_EQUALS( control.GetMaximumSize(), Vector3( 10.0f, 20.0f, 30.0f ), TEST_LOCATION );
+  DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND_IMAGE ).Get< Property::Map >().Empty() );
 
   END_TEST;
 }
index 6965f35..f7926a5 100644 (file)
@@ -218,7 +218,8 @@ int UtcDaliControlImplOnGestureMethods(void)
   // Check gesture actually happens
   {
     DummyControl dummy = DummyControl::New(true);
-    dummy.SetSize( Vector3(100.0f, 100.0f, 100.0f) );
+    dummy.SetRelayoutEnabled( true );
+    dummy.SetSize( Vector2(100.0f, 100.0f ) );
 
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
     Stage::GetCurrent().Add(dummy);
@@ -278,7 +279,8 @@ int UtcDaliControlImplOnGestureMethods(void)
   // Ensure full code coverage
   {
     DummyControl dummy = DummyControl::New();
-    dummy.SetSize( Vector3(100.0f, 100.0f, 100.0f) );
+    dummy.SetRelayoutEnabled( true );
+    dummy.SetSize( Vector2( 100.0f, 100.0f ) );
 
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
     Stage::GetCurrent().Add(dummy);
@@ -443,14 +445,15 @@ int UtcDaliControlImplSizeSet(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
+    dummy.SetRelayoutEnabled( true );
     DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
 
     Stage::GetCurrent().Add(dummy);
     application.Render();
     application.SendNotification();
 
-    DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION );
-    Vector3 size(100.0f, 200.0f, 0.0f);
+    DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, true, TEST_LOCATION ); // Called from size negotiation
+    Vector2 size(100.0f, 200.0f);
     dummy.SetSize(size);
 
     application.Render();
@@ -458,7 +461,7 @@ int UtcDaliControlImplSizeSet(void)
     application.Render();
     application.SendNotification();
 
-    DALI_TEST_EQUALS(size, dummy.GetCurrentSize(), TEST_LOCATION);
+    DALI_TEST_EQUALS(size, dummy.GetCurrentSize().GetVectorXY(), TEST_LOCATION);
     DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, true, TEST_LOCATION );
 
     Stage::GetCurrent().Remove(dummy);
@@ -467,10 +470,11 @@ int UtcDaliControlImplSizeSet(void)
   // Ensure full code coverage
   {
     DummyControl dummy = DummyControl::New();
+    dummy.SetRelayoutEnabled( true );
     Stage::GetCurrent().Add(dummy);
 
-    Vector3 size(100.0f, 200.0f, 0.0f);
-    DALI_TEST_CHECK( size != dummy.GetCurrentSize() );
+    Vector2 size(100.0f, 200.0f);
+    DALI_TEST_CHECK( size != dummy.GetCurrentSize().GetVectorXY() );
 
     application.Render();
     application.SendNotification();
@@ -482,7 +486,7 @@ int UtcDaliControlImplSizeSet(void)
     application.Render();
     application.SendNotification();
 
-    DALI_TEST_EQUALS(size, dummy.GetCurrentSize(), TEST_LOCATION);
+    DALI_TEST_EQUALS(size, dummy.GetCurrentSize().GetVectorXY(), TEST_LOCATION);
 
     Stage::GetCurrent().Remove(dummy);
   }
@@ -501,7 +505,7 @@ int UtcDaliControlImplSizeAnimation(void)
 
     DALI_TEST_EQUALS( dummyImpl.sizeAnimationCalled, false, TEST_LOCATION );
     Animation animation = Animation::New(1.0f);
-    animation.Resize(dummy, Vector3(100.0f, 150.0f, 200.0f));
+    animation.AnimateTo( Property( dummy, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );
     animation.Play();
 
     application.Render();
@@ -521,7 +525,7 @@ int UtcDaliControlImplSizeAnimation(void)
     Stage::GetCurrent().Add(dummy);
 
     Animation animation = Animation::New(1.0f);
-    animation.Resize(dummy, Vector3(100.0f, 150.0f, 200.0f));
+    animation.AnimateTo( Property( dummy, Actor::Property::SIZE ), Vector3( 100.0f, 150.0f, 200.0f ) );
     animation.Play();
 
     application.Render();
@@ -542,9 +546,10 @@ int UtcDaliControlImplTouchEvent(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
+    dummy.SetRelayoutEnabled( true );
     DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
 
-    dummy.SetSize(100.0f, 100.0f);
+    dummy.SetSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
     Stage::GetCurrent().Add(dummy);
 
@@ -566,8 +571,9 @@ int UtcDaliControlImplTouchEvent(void)
   // Ensure full code coverage
   {
     DummyControl dummy = DummyControl::New();
+    dummy.SetRelayoutEnabled( true );
 
-    dummy.SetSize(100.0f, 100.0f);
+    dummy.SetSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
     Stage::GetCurrent().Add(dummy);
 
@@ -767,9 +773,10 @@ int UtcDaliControlImplMouseWheelEvent(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
+    dummy.SetRelayoutEnabled( true );
     DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
 
-    dummy.SetSize(100.0f, 100.0f);
+    dummy.SetSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
     Stage::GetCurrent().Add(dummy);
 
@@ -794,8 +801,9 @@ int UtcDaliControlImplMouseWheelEvent(void)
   // Ensure full code coverage
   {
     DummyControl dummy = DummyControl::New();
+    dummy.SetRelayoutEnabled( true );
 
-    dummy.SetSize(100.0f, 100.0f);
+    dummy.SetSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
     Stage::GetCurrent().Add(dummy);
 
index 443de6f..955f19d 100644 (file)
@@ -371,6 +371,7 @@ int UtcDaliPageTurnViewEnterLeaveEditMode(void)
   factory.EnableOffscreenRendering( );
 
   PageTurnView pageTurnView = PageTurnLandscapeView::New( factory, PAGE_SIZE );
+  pageTurnView.SetRelayoutEnabled( false );
   pageTurnView.SetPositionInheritanceMode( USE_PARENT_POSITION );
   Stage::GetCurrent().Add( pageTurnView );
 
@@ -422,6 +423,7 @@ int UtcDaliPageTurnViewGetHitActor(void)
   factory.EnableOffscreenRendering( );
 
   PageTurnView pageTurnView = PageTurnPortraitView::New( factory, PAGE_SIZE );
+  pageTurnView.SetRelayoutEnabled( false );
   pageTurnView.SetParentOrigin( ParentOrigin::TOP_LEFT );
   pageTurnView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( pageTurnView );
@@ -458,6 +460,7 @@ int UtcDaliPageTurnViewRefresh(void)
   TestPageFactory factory(application);
   factory.EnableOffscreenRendering( );
   PageTurnView pageTurnView = PageTurnPortraitView::New( factory, PAGE_SIZE );
+  pageTurnView.SetRelayoutEnabled( false );
   pageTurnView.SetParentOrigin( ParentOrigin::TOP_LEFT );
   pageTurnView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( pageTurnView );
@@ -498,6 +501,7 @@ int UtcDaliPageTurnViewSignals(void)
   TestPageFactory factory(application);
   Vector2 size = Stage::GetCurrent().GetSize();
   PageTurnView portraitView = PageTurnPortraitView::New( factory, size );
+  portraitView.SetRelayoutEnabled( false );
   portraitView.SetPositionInheritanceMode( USE_PARENT_POSITION );
   Stage::GetCurrent().Add( portraitView );
 
index 4374bfa..0ba0800 100644 (file)
@@ -279,7 +279,6 @@ int UtcDaliPopupSetState(void)
 
   // Create the Popup actor
   Popup popup = Popup::New();
-  Stage::GetCurrent().Add( popup );
 
   ImageActor backgroundImage = CreateSolidColorActor( Color::RED );
   popup.SetBackgroundImage(backgroundImage);
@@ -303,7 +302,6 @@ int UtcDaliPopupSetStateSlow(void)
 
   // Create the Popup actor
   Popup popup = Popup::New();
-  Stage::GetCurrent().Add( popup );
 
   ImageActor backgroundImage = CreateSolidColorActor( Color::RED );
   popup.SetBackgroundImage(backgroundImage);
@@ -337,7 +335,6 @@ int UtcDaliPopupShowHide(void)
 
   // Create the Popup actor
   Popup popup = Popup::New();
-  Stage::GetCurrent().Add( popup );
   popup.HiddenSignal().Connect( &OnPopupHidden );
 
   ImageActor backgroundImage = CreateSolidColorActor( Color::RED );
@@ -345,9 +342,9 @@ int UtcDaliPopupShowHide(void)
 
   PushButton button1 = PushButton::New();
   PushButton button2 = PushButton::New();
-  button1.SetSize(DEFAULT_BUTTON_SIZE);
+  button1.SetSize(DEFAULT_BUTTON_SIZE.GetVectorXY());
   popup.AddButton(button1);
-  button2.SetSize(DEFAULT_BUTTON_SIZE);
+  button2.SetSize(DEFAULT_BUTTON_SIZE.GetVectorXY());
   popup.AddButton(button2);
 
   // Showing/Hiding popup, results in all child Actors being
index 4a2a33d..84a020e 100644 (file)
@@ -279,27 +279,10 @@ int UtcDaliPushButtonSetImages(void)
   Actor imageActor;
 
   Image image01 = CreateSolidColorImage( Color::RED, 10, 10 );
-  ImageActor imageActor01 = CreateSolidColorActor( Color::RED );
-  imageActor01.SetSize( 20.f, 20.f );
-
-  Image image02 = CreateSolidColorImage( Color::RED, 30, 30 );
-  ImageActor imageActor02 = CreateSolidColorActor( Color::RED );
-  imageActor02.SetSize( 40.f, 40.f );
-
-  Image image03 = CreateSolidColorImage( Color::RED, 50, 50 );
-  ImageActor imageActor03 = CreateSolidColorActor( Color::RED );
-  imageActor03.SetSize( 60.f, 60.f );
-
-  Image image04 = CreateSolidColorImage( Color::RED, 70, 70 );
-  ImageActor imageActor04 = CreateSolidColorActor( Color::RED );
-  imageActor04.SetSize( 80.f, 80.f );
-
-  Image image05 = CreateSolidColorImage( Color::RED, 90, 90 );
-  ImageActor imageActor05 = CreateSolidColorActor( Color::RED );
-  imageActor05.SetSize( 100.f, 100.f );
 
   Vector3 size;
   PushButton pushButton = PushButton::New();
+  Stage::GetCurrent().Add( pushButton );
 
   application.SendNotification();
   application.Render();
@@ -311,100 +294,11 @@ int UtcDaliPushButtonSetImages(void)
   application.SendNotification();
   application.Render();
 
-  size = pushButton.GetButtonImage().GetCurrentSize();
+  size = pushButton.GetCurrentSize();
 
   DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION );
   DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
 
-  pushButton.SetButtonImage( imageActor01 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = pushButton.GetButtonImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
-
-  pushButton.SetBackgroundImage( image02 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = pushButton.GetBackgroundImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 30.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 30.f, TEST_LOCATION );
-
-  pushButton.SetBackgroundImage( imageActor02 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = pushButton.GetBackgroundImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 40.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 40.f, TEST_LOCATION );
-
-  pushButton.SetSelectedImage( image03 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = pushButton.GetSelectedImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 50.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 50.f, TEST_LOCATION );
-
-  pushButton.SetSelectedImage( imageActor03 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = pushButton.GetSelectedImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 60.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 60.f, TEST_LOCATION );
-
-  pushButton.SetDisabledBackgroundImage( image04 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = pushButton.GetDisabledBackgroundImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 70.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 70.f, TEST_LOCATION );
-
-  pushButton.SetDisabledBackgroundImage( imageActor04 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = pushButton.GetDisabledBackgroundImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 80.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 80.f, TEST_LOCATION );
-
-  pushButton.SetDisabledImage( image05 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = pushButton.GetDisabledImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 90.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 90.f, TEST_LOCATION );
-
-  pushButton.SetDisabledImage( imageActor05 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = pushButton.GetDisabledImage().GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 100.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 100.f, TEST_LOCATION );
   END_TEST;
 }
 
index 9b9cad1..662502c 100644 (file)
@@ -239,14 +239,11 @@ struct TestSumConstraint
  */
 static float TestOvershootSnapDuration(ToolkitTestApplication &application, ScrollView scrollView)
 {
-  Property::Index overshootPropertyX = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME);
-  Property::Index overshootPropertyY = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME);
-
   int timeToReachOrigin = -1;
   for(int i = 0;i<MAX_FRAMES_TO_TEST_OVERSHOOT;i++)
   {
-    float overshootXValue = scrollView.GetProperty<float>(overshootPropertyX);
-    float overshootYValue = scrollView.GetProperty<float>(overshootPropertyY);
+    float overshootXValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_X);
+    float overshootYValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_Y);
     if(overshootXValue == 0.0f && overshootYValue == 0.0f)
     {
       break;
@@ -817,9 +814,8 @@ int UtcDaliScrollViewConstraints(void)
   a.SetPosition( TEST_ACTOR_POSITION );
   Wait(application);
 
-  Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME);
   Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
-                                                       Source(scrollView, scrollPositionProperty),
+                                                       Source(scrollView, ScrollView::Property::SCROLL_POSITION),
                                                        TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
   constraint.SetRemoveAction(Constraint::Discard);
   scrollView.ApplyConstraintToChildren(constraint);
@@ -865,10 +861,9 @@ int UtcDaliScrollViewBind(void)
   a.SetPosition( TEST_ACTOR_POSITION );
   Wait(application);
 
-  Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME);
   // apply this constraint to scrollview
   Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
-                                                       Source(scrollView, scrollPositionProperty),
+                                                       Source(scrollView, ScrollView::Property::SCROLL_POSITION),
                                                        TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
 
   constraint.SetRemoveAction(Constraint::Discard);
@@ -1034,12 +1029,9 @@ int UtcDaliScrollViewOvershoot(void)
   // 1. Scroll page in NW (-500,-500 pixels), then inspect overshoot. (don't release touch)
   Vector2 currentPos = Vector2(100.0f, 100.0f);
   currentPos = PerformGestureDiagonalSwipe(application, currentPos, Vector2(5.0f, 5.0f), 100, false);
-  Property::Index overshootXProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME);
-  Property::Index overshootYProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME);
-  Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME);
-  float overshootXValue = scrollView.GetProperty<float>(overshootXProperty);
-  float overshootYValue = scrollView.GetProperty<float>(overshootYProperty);
-  Vector3 positionValue = scrollView.GetProperty<Vector3>(scrollPositionProperty);
+  float overshootXValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_X);
+  float overshootYValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_Y);
+  Vector3 positionValue = scrollView.GetProperty<Vector3>(ScrollView::Property::SCROLL_POSITION);
   DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION);
   DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION);
   DALI_TEST_EQUALS(positionValue, Vector3::ZERO, TEST_LOCATION);
index 8fd2fb6..89090da 100644 (file)
@@ -125,7 +125,7 @@ int UtcDaliSliderSignals(void)
   Stage::GetCurrent().Add( slider );
   slider.SetParentOrigin(ParentOrigin::TOP_LEFT);
   slider.SetAnchorPoint(ParentOrigin::TOP_LEFT);
-  slider.SetSize( Stage::GetCurrent().GetSize().x, 20.0f );
+  slider.SetSize( Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
   slider.SetPosition( 0.0f, 0.0f );
 
   const float MIN_BOUND = 0.0f;
index 5fd205c..b7e662e 100644 (file)
@@ -197,6 +197,7 @@ int UtcDaliSuperBlurViewGetBlurredImage(void)
   tet_infoline( "UtcDaliSuperBlurViewGetBlurredImage" );
 
   SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
+  blurView.SetRelayoutEnabled( false );
   blurView.SetSize( 100.f,100.f );
   Image inputImage = CreateSolidColorImage( application, Color::GREEN, 100, 100 );
   blurView.SetImage( inputImage );
@@ -207,8 +208,8 @@ int UtcDaliSuperBlurViewGetBlurredImage(void)
   DALI_TEST_CHECK( image1 );
 
   Image image2 = blurView.GetBlurredImage( 2 );
-  DALI_TEST_CHECK( image2.GetWidth() == 25 );
-  DALI_TEST_CHECK( image2.GetHeight() == 25 );
+  DALI_TEST_EQUALS( image2.GetWidth(), 25, TEST_LOCATION );
+  DALI_TEST_EQUALS( image2.GetHeight(), 25, TEST_LOCATION );
 
   Image image3 = blurView.GetBlurredImage( 3 );
   DALI_TEST_CHECK( FrameBufferImage::DownCast( image2 ) );
index 8773187..0e99819 100644 (file)
@@ -67,23 +67,28 @@ struct Constraint100
 // Convenience function to quickly set up a 10x10 table with each cell being 10x10 pixels in size by default.
 static void SetupTableViewAndActors(TableView& tableView, Actor& actor1, Actor& actor2, Actor& actor3)
 {
-  tableView = TableView::New(10,10); // 10 by 10 grid.
-  DALI_TEST_CHECK(tableView);
+  tableView = TableView::New( 10, 10 ); // 10 by 10 grid.
+  DALI_TEST_CHECK( tableView );
+
+  tableView.SetRelayoutEnabled( true );
 
   Stage::GetCurrent().Add( tableView );
-  tableView.SetSize( Dali::Vector3( 100.0f, 100.0f, 100.0f ) );
+  tableView.SetSize( Dali::Vector2( 100.0f, 100.0f ) );
 
   actor1 = Actor::New();
   actor2 = Actor::New();
   actor3 = Actor::New();
 
-  actor1.SetSize(10,10);
-  actor2.SetSize(10,10);
-  actor3.SetSize(10,10);
+  actor1.SetRelayoutEnabled( true );
+  actor1.SetSize( Dali::Vector2( 10, 10 ) );
+  actor2.SetRelayoutEnabled( true );
+  actor2.SetSize( Dali::Vector2( 10, 10 ) );
+  actor3.SetRelayoutEnabled( true );
+  actor3.SetSize( Dali::Vector2( 10, 10 ) );
 
-  tableView.AddChild(actor1, TableView::CellPosition(0,0));
-  tableView.AddChild(actor2, TableView::CellPosition(0,1));
-  tableView.AddChild(actor3, TableView::CellPosition(1,0));
+  tableView.AddChild( actor1, TableView::CellPosition( 0, 0 ) );
+  tableView.AddChild( actor2, TableView::CellPosition( 0, 1 ) );
+  tableView.AddChild( actor3, TableView::CellPosition( 1, 0 ) );
 }
 
 } // namespace
@@ -438,7 +443,7 @@ int UtcDaliTableViewMetricsAssert(void)
   catch( Dali::DaliException& e )
   {
     DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS(e.condition, "rowIndex < mFixedHeights.size()", TEST_LOCATION);
+    DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
   }
 
   try
@@ -450,7 +455,7 @@ int UtcDaliTableViewMetricsAssert(void)
   catch( Dali::DaliException& e )
   {
     DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS(e.condition, "rowIndex < mFixedHeights.size()", TEST_LOCATION);
+    DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
   }
 
   try
@@ -462,7 +467,7 @@ int UtcDaliTableViewMetricsAssert(void)
   catch( Dali::DaliException& e )
   {
     DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS(e.condition, "columnIndex < mFixedWidths.size()", TEST_LOCATION);
+    DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
   }
 
   try
@@ -474,7 +479,7 @@ int UtcDaliTableViewMetricsAssert(void)
   catch( Dali::DaliException& e )
   {
     DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS(e.condition, "columnIndex < mFixedWidths.size()", TEST_LOCATION);
+    DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
   }
 
   // relatives...
@@ -488,7 +493,7 @@ int UtcDaliTableViewMetricsAssert(void)
   catch( Dali::DaliException& e )
   {
     DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS(e.condition, "rowIndex < mRelativeHeights.size()", TEST_LOCATION);
+    DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
   }
 
   try
@@ -500,7 +505,7 @@ int UtcDaliTableViewMetricsAssert(void)
   catch( Dali::DaliException& e )
   {
     DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS(e.condition, "rowIndex < mRelativeHeights.size()", TEST_LOCATION);
+    DALI_TEST_EQUALS(e.condition, "rowIndex < mRowData.Size()", TEST_LOCATION);
   }
 
   try
@@ -512,7 +517,7 @@ int UtcDaliTableViewMetricsAssert(void)
   catch( Dali::DaliException& e )
   {
     DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS(e.condition, "columnIndex < mRelativeWidths.size()", TEST_LOCATION);
+    DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
   }
 
   try
@@ -524,7 +529,7 @@ int UtcDaliTableViewMetricsAssert(void)
   catch( Dali::DaliException& e )
   {
     DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS(e.condition, "columnIndex < mRelativeWidths.size()", TEST_LOCATION);
+    DALI_TEST_EQUALS(e.condition, "columnIndex < mColumnData.Size()", TEST_LOCATION);
   }
   END_TEST;
 }
@@ -536,7 +541,7 @@ int UtcDaliTableViewSetGetProperty(void)
 
   // Create a 1x1 table-view
   TableView tableView = TableView::New(1,1);
-  tableView.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, Constraint100() ) );
+  tableView.SetSize( Vector2( 100.0f, 100.0f ) );
   DALI_TEST_CHECK( tableView );
 
   // Test "rows" property
@@ -591,12 +596,14 @@ int UtcDaliTableViewSetGetProperty(void)
   DALI_TEST_EQUALS( tableView.GetRelativeHeight( 3u ), 0.2f, TEST_LOCATION );
 
   Property::Map layoutRowsGet = tableView.GetProperty(TableView::Property::LAYOUT_ROWS).Get<Property::Map>();
-  DALI_TEST_CHECK( layoutRowsGet.GetKey(0).compare(layoutRows.GetKey(0)) == 0 );
-  DALI_TEST_CHECK( layoutRowsGet.GetValue(0).GetValue( "policy" ).Get<std::string>().compare(layoutRows.GetValue(0).GetValue( "policy" ).Get<std::string>()) == 0 );
-  DALI_TEST_EQUALS( layoutRowsGet.GetValue(0).GetValue( "value" ).Get<float>(),layoutRows.GetValue(0).GetValue( "value" ).Get<float>(), TEST_LOCATION );
-  DALI_TEST_CHECK( layoutRowsGet.GetKey(1).compare(layoutRows.GetKey(1)) == 0 );
-  DALI_TEST_CHECK( layoutRowsGet.GetValue(1).GetValue( "policy" ).Get<std::string>().compare(layoutRows.GetValue(1).GetValue( "policy" ).Get<std::string>()) == 0 );
-  DALI_TEST_EQUALS( layoutRowsGet.GetValue(1).GetValue( "value" ).Get<float>(),layoutRows.GetValue(1).GetValue( "value" ).Get<float>(), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( layoutRowsGet.GetKey(1).compare(layoutRows.GetKey(0)), 0, TEST_LOCATION );
+  DALI_TEST_CHECK( layoutRowsGet.GetValue(1).GetValue( "policy" ).Get<std::string>().compare(layoutRows.GetValue(0).GetValue( "policy" ).Get<std::string>()) == 0 );
+  DALI_TEST_EQUALS( layoutRowsGet.GetValue(1).GetValue( "value" ).Get<float>(), layoutRows.GetValue(0).GetValue( "value" ).Get<float>(), TEST_LOCATION );
+
+  DALI_TEST_CHECK( layoutRowsGet.GetKey(3).compare(layoutRows.GetKey(1)) == 0 );
+  DALI_TEST_CHECK( layoutRowsGet.GetValue(3).GetValue( "policy" ).Get<std::string>().compare(layoutRows.GetValue(1).GetValue( "policy" ).Get<std::string>()) == 0 );
+  DALI_TEST_EQUALS( layoutRowsGet.GetValue(3).GetValue( "value" ).Get<float>(), layoutRows.GetValue(1).GetValue( "value" ).Get<float>(), TEST_LOCATION );
 
   // Test "layout-columns" property
   DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_LAYOUT_COLUMNS ) == TableView::Property::LAYOUT_COLUMNS );
@@ -617,12 +624,13 @@ int UtcDaliTableViewSetGetProperty(void)
   DALI_TEST_EQUALS( tableView.GetFixedWidth( 3u ), 30.f, TEST_LOCATION );
 
   Property::Map layoutColumnsGet = tableView.GetProperty(TableView::Property::LAYOUT_COLUMNS).Get<Property::Map>();
-  DALI_TEST_CHECK( layoutColumnsGet.GetKey(0).compare(layoutColumns.GetKey(0)) == 0 );
-  DALI_TEST_CHECK( layoutColumnsGet.GetValue(0).GetValue( "policy" ).Get<std::string>().compare(layoutColumns.GetValue(0).GetValue( "policy" ).Get<std::string>()) == 0 );
-  DALI_TEST_EQUALS( layoutColumnsGet.GetValue(0).GetValue( "value" ).Get<float>(),layoutColumns.GetValue(0).GetValue( "value" ).Get<float>(), TEST_LOCATION );
-  DALI_TEST_CHECK( layoutColumnsGet.GetKey(1).compare(layoutColumns.GetKey(1)) == 0 );
-  DALI_TEST_CHECK( layoutColumnsGet.GetValue(1).GetValue( "policy" ).Get<std::string>().compare(layoutColumns.GetValue(1).GetValue( "policy" ).Get<std::string>()) == 0 );
-  DALI_TEST_EQUALS( layoutColumnsGet.GetValue(1).GetValue( "value" ).Get<float>(),layoutColumns.GetValue(1).GetValue( "value" ).Get<float>(), TEST_LOCATION );
+  DALI_TEST_CHECK( layoutColumnsGet.GetKey(2).compare(layoutColumns.GetKey(0)) == 0 );
+  DALI_TEST_CHECK( layoutColumnsGet.GetValue(2).GetValue( "policy" ).Get<std::string>().compare(layoutColumns.GetValue(0).GetValue( "policy" ).Get<std::string>()) == 0 );
+  DALI_TEST_EQUALS( layoutColumnsGet.GetValue(2).GetValue( "value" ).Get<float>(),layoutColumns.GetValue(0).GetValue( "value" ).Get<float>(), TEST_LOCATION );
+
+  DALI_TEST_CHECK( layoutColumnsGet.GetKey(3).compare(layoutColumns.GetKey(1)) == 0 );
+  DALI_TEST_CHECK( layoutColumnsGet.GetValue(3).GetValue( "policy" ).Get<std::string>().compare(layoutColumns.GetValue(1).GetValue( "policy" ).Get<std::string>()) == 0 );
+  DALI_TEST_EQUALS( layoutColumnsGet.GetValue(3).GetValue( "value" ).Get<float>(),layoutColumns.GetValue(1).GetValue( "value" ).Get<float>(), TEST_LOCATION );
 
   END_TEST;
 }
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextInput.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextInput.cpp
deleted file mode 100644 (file)
index 9f8905e..0000000
+++ /dev/null
@@ -1,968 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-#include <iostream>
-
-#include <stdlib.h>
-#include <dali-toolkit-test-suite-utils.h>
-#include <dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-#include <dali/integration-api/events/key-event-integ.h>
-
-using namespace Dali;
-using namespace Toolkit;
-
-void utc_dali_toolkit_text_input_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_toolkit_text_input_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-namespace
-{
-static bool gObjectCreatedCallBackCalled;
-
-static void TestCallback(BaseHandle handle)
-{
-  Actor actor = Actor::DownCast(handle);
-
-  if(actor)
-  {
-    TextInput handle = TextInput::DownCast(actor);
-     if (handle)
-     {
-       gObjectCreatedCallBackCalled = true;
-     }
-  }
-}
-
-static bool gHasEndSignalBeenReceived;
-static bool gHasStartSignalBeenReceived;
-
-// Callback test function
-void OnStartInput(TextInput textInput)
-{
-  gHasStartSignalBeenReceived = true;
-}
-
-// Callback test function
-void OnEndInput(TextInput textInput)
-{
-  gHasEndSignalBeenReceived = true;
-}
-
-}
-
-// Positive test case for a method
-int UtcDaliTextInputConstruction(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing New constructor");
-
-  TextInput textInput = TextInput::New();
-  DALI_TEST_CHECK(textInput);
-
-  //Additional check to ensure object is created by checking if it's registered
-  ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
-  DALI_TEST_CHECK( registry );
-
-  gObjectCreatedCallBackCalled = false;
-  registry.ObjectCreatedSignal().Connect(&TestCallback);
-  {
-    TextInput textInput = TextInput::New();
-  }
-  DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
-  END_TEST;
-}
-
-
-static bool downCastToTextInput(Dali::Actor actor)
-{
-  TextInput handle = TextInput::DownCast(actor);
-  if (handle)
-  {
-    tet_infoline("Downcasted to TextInput");
-    return true;
-  }
-  else
-  {
-    tet_infoline("Did not downcast to TextInput");
-    return false;
-  }
-}
-
-// Positive test case for a method
-int UtcDaliTextInputDownCast(void)
-{
-  ToolkitTestApplication application;
-
-  TextInput textInput = TextInput::New();
-
-  tet_infoline("Testing Downcasting with a TextInput");
-  DALI_TEST_EQUALS(true,downCastToTextInput(textInput), TEST_LOCATION); // downcast a TextInput
-
-  Dali::TextActor badHandle = Dali::TextActor::New("test");
-
-  tet_infoline("Testing Downcasting with the wrong actor");
-  DALI_TEST_EQUALS(false, downCastToTextInput(badHandle), TEST_LOCATION); // downcast a TextActor to TextInput
-  END_TEST;
-}
-
-// Positive test case for a method
-int UtcDaliTextInputGetText(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing GetText");
-
-  const std::string teststring = "test";
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  DALI_TEST_EQUALS("",textInput.GetText(), TEST_LOCATION); // Get text which should be empty
-
-  textInput.SetInitialText(teststring);
-
-  DALI_TEST_EQUALS(teststring,textInput.GetText(), TEST_LOCATION); // Get text which should be test string
-
-  END_TEST;
-}
-
-int UtcDaliTextInputGetMarkupText(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing retrieval of Markup text after style set");
-
-  const std::string markup = "<i>Text with italic style</i>" ;
-  const std::string teststring = "Text with italic style";
-
-  TextInput textInput = TextInput::New();
-
-  tet_infoline("Set initial text");
-
-  textInput.SetInitialText( teststring );
-
-  tet_infoline("Check initial text");
-  DALI_TEST_EQUALS( teststring,textInput.GetText(), TEST_LOCATION); // Get text which should be empty
-
-  TextStyle style;
-  style.SetItalics( true );
-
-  tet_infoline("Apply style to TextInput");
-  textInput.ApplyStyleToAll( style );
-
-  tet_infoline("Retreive Markup Text");
-  const std::string retreivedMarkupString = textInput.GetMarkupText();
-
-  tet_infoline("Test Retreived text and Markup text match");
-  DALI_TEST_EQUALS( retreivedMarkupString , retreivedMarkupString, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputSetMaxCharacterLength(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing Setting of max characters");
-
-  const int maxChars = 4;
-  const char* testChar  = "v";
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-  Stage::GetCurrent().Add(textInput);
-  application.SendNotification();
-  application.Render();
-
-  textInput.SetMaxCharacterLength(maxChars);
-
-  Integration::KeyEvent event(testChar, testChar, 0, 0, 0, Integration::KeyEvent::Down );
-
-  std::string testString = "";
-
-  tet_infoline("Starting editmode");
-  textInput.SetEditable( true );
-
-  tet_infoline("Sending Key Events");
-  // Send max number of characters
-  for (int i=0; i < maxChars; i++)
-    {
-      application.ProcessEvent(event);
-      testString.append(testChar);
-    }
-
-  tet_printf( "Get text result : %s\n", textInput.GetText().c_str());
-
-  DALI_TEST_EQUALS(testString, textInput.GetText(), TEST_LOCATION);
-
-  tet_infoline("Sending Key Event which exceeds max characters");
-
-  application.ProcessEvent(event); // try to append additional character
-
-  DALI_TEST_EQUALS(testString,textInput.GetText(), TEST_LOCATION);
-
-  tet_infoline("Increase max characters limit");
-
-  textInput.SetMaxCharacterLength(maxChars+1); // increment max characters by 1
-
-  tet_infoline("Send character again which should now fit");
-  application.ProcessEvent(event); // append additional character
-  testString.append(testChar);
-
-  DALI_TEST_EQUALS(testString,textInput.GetText(), TEST_LOCATION);
-  END_TEST;
-}
-
-
-int UtcDaliTextInputSetAndGetNumberOfLines(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Ensuring API for setting and getting max number of lines is correct");
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  unsigned int numberOfLines = 1;
-
-  textInput.SetNumberOfLinesLimit( numberOfLines );
-
-  DALI_TEST_EQUALS(numberOfLines ,textInput.GetNumberOfLinesLimit(),  TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputGetNumberOfCharacters(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing Getting number of characters");
-
-  const std::string initialString = "initial text";
-  const std::string newInitialString = "initial text new";
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  textInput.SetInitialText( initialString );
-
-  tet_infoline("Testing TextInput contains correct number of characters ");
-
-  DALI_TEST_EQUALS( initialString.size() , textInput.GetNumberOfCharacters(), TEST_LOCATION);
-
-  tet_infoline("Testing TextInput contains correct number of characters second phase ");
-
-  textInput.SetInitialText( newInitialString );
-
-  DALI_TEST_EQUALS( newInitialString.size() , textInput.GetNumberOfCharacters(), TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputSetAndGetPlaceholderText(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing Setting of PlaceholderText");
-
-  const std::string initialString = "initial text";
-  const std::string placeholderString = "placeholder";
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  tet_infoline("Testing TextInput is empty at creation ");
-
-  DALI_TEST_EQUALS("",textInput.GetText(), TEST_LOCATION);
-
-  tet_infoline("Set placeholder text");
-
-  textInput.SetPlaceholderText( placeholderString );
-
-  tet_infoline("Testing TextInput contains placeholder text");
-
-  DALI_TEST_EQUALS( placeholderString , textInput.GetPlaceholderText(), TEST_LOCATION);
-
-  tet_infoline("Set initial text which should replace placeholder text");
-
-  textInput.SetInitialText( initialString );
-
-  tet_infoline("Testing TextInput contains initial text when placeholder text set");
-
-  DALI_TEST_EQUALS( initialString,textInput.GetText(), TEST_LOCATION);
-  END_TEST;
-}
-
-// Positive test case for a method
-int UtcDaliTextInputSetInitialText(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing Setting of Initial Text");
-
-  const std::string teststring = "test";
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  tet_infoline("Testing TextInput is empty at creation ");
-
-  DALI_TEST_EQUALS("",textInput.GetText(), TEST_LOCATION);
-
-  tet_infoline("Set text to TextInput");
-
-  textInput.SetInitialText(teststring);
-
-  tet_infoline("Test TextInput contains set text");
-
-  DALI_TEST_EQUALS(teststring,textInput.GetText(), TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputSetEditableAndIsEditable(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing SetEditable And IsEditable");
-
-  const std::string initialString = "initial text";
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-  textInput.SetInitialText( initialString );
-
-  Stage::GetCurrent().Add(textInput);
-  application.SendNotification();
-  application.Render();
-
-  bool editableStateFalse ( false );
-  bool editableStateTrue ( true );
-
-  textInput.SetEditable ( editableStateFalse );
-  application.SendNotification();
-  application.Render();
-  DALI_TEST_EQUALS( editableStateFalse, textInput.IsEditable() , TEST_LOCATION);
-
-  textInput.SetEditable ( editableStateTrue );
-  application.SendNotification();
-  application.Render();
-  DALI_TEST_EQUALS( editableStateTrue, textInput.IsEditable() , TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputSetEditOnTouch(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing SetEditOnTouch And IsEditOnTouch");
-
-  TextInput textInput = TextInput::New();
-
-  bool editableOnTouchOn ( true );
-  bool editableOnTouchOff( false );
-
-  tet_infoline("Testing SetEditOnTouch disabled");
-  textInput.SetEditOnTouch ( editableOnTouchOff );
-  DALI_TEST_EQUALS( editableOnTouchOff, textInput.IsEditOnTouch() , TEST_LOCATION);
-
-  tet_infoline("Testing SetEditOnTouch enabled");
-  textInput.SetEditOnTouch ( editableOnTouchOn );
-  DALI_TEST_EQUALS( editableOnTouchOn, textInput.IsEditOnTouch() , TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputSetTextSelectable(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing SetTextSelectable and IsTextSelectable");
-
-  const std::string initialString = "initial text";
-
-  TextInput textInput = TextInput::New();
-  textInput.SetInitialText( initialString );
-
-  tet_infoline("Testing SetTextSelectable");
-  textInput.SetTextSelectable();
-  DALI_TEST_EQUALS( true, textInput.IsTextSelectable() , TEST_LOCATION);
-  textInput.SetTextSelectable( false );
-  DALI_TEST_EQUALS( false, textInput.IsTextSelectable() , TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputTextSelection(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing Text Selection");
-
-  const std::string initialString = "initial text";
-
-  TextInput textInput = TextInput::New();
-  textInput.SetInitialText( initialString );
-
-  Stage::GetCurrent().Add(textInput);
-  application.SendNotification();
-  application.Render();
-
-  textInput.SetEditable( true );
-
-  tet_infoline("Testing IsTextSelected negative");
-  DALI_TEST_EQUALS( false, textInput.IsTextSelected(), TEST_LOCATION);
-
-  textInput.SelectText(1,7);
-  DALI_TEST_EQUALS( true, textInput.IsTextSelected(), TEST_LOCATION);
-
-  textInput.DeSelectText();
-  DALI_TEST_EQUALS( false, textInput.IsTextSelected(), TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputEnableGrabHandleAndIsGrabHandleEnabled(void)
-{
-  ToolkitTestApplication application;
-
-  TextInput textInput = TextInput::New();
-
-  bool grabHandleState = false;
-
-  textInput.EnableGrabHandle( grabHandleState );
-
-  DALI_TEST_EQUALS( grabHandleState, textInput.IsGrabHandleEnabled(), TEST_LOCATION);
-
-  grabHandleState = true;
-  textInput.EnableGrabHandle( grabHandleState );
-
-  DALI_TEST_EQUALS( grabHandleState, textInput.IsGrabHandleEnabled(), TEST_LOCATION);
-
-  END_TEST;
-}
-
-int UtcDaliTextInputSetAndGetBoundingRectangle(void)
-{
-  ToolkitTestApplication application;
-
-  TextInput textInput = TextInput::New();
-
-  Stage::GetCurrent().Add(textInput);
-  Vector2 stageSize = Stage::GetCurrent().GetSize();
-
-  const Rect<float> boundingRectangle( 100.0f, 100.0f, stageSize.width, stageSize.height );
-
-  textInput.SetBoundingRectangle( boundingRectangle );
-
-  const Rect<float> retreievedBoundingRectangle = textInput.GetBoundingRectangle();
-
-  DALI_TEST_EQUALS( boundingRectangle.x, retreievedBoundingRectangle.x, TEST_LOCATION);
-  DALI_TEST_EQUALS( boundingRectangle.y, retreievedBoundingRectangle.y, TEST_LOCATION);
-  DALI_TEST_EQUALS( boundingRectangle.width, retreievedBoundingRectangle.width, TEST_LOCATION);
-  DALI_TEST_EQUALS( boundingRectangle.height, retreievedBoundingRectangle.height, TEST_LOCATION);
-  END_TEST;
-}
-
-
-int UtcDaliTextInputSetAndGetTextAlignment01(void)
-{
-  ToolkitTestApplication application;
-
-  TextInput textInput = TextInput::New();
-  Stage::GetCurrent().Add(textInput);
-  application.SendNotification();
-  application.Render();
-
-  textInput.SetTextAlignment(static_cast<Alignment::Type>( Alignment::HorizontalCenter) );
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( static_cast<Alignment::Type>( Alignment::HorizontalCenter) & textInput.GetTextAlignment()) ;
-  END_TEST;
-}
-
-int UtcDaliTextInputSetAndGetTextAlignment02(void)
-{
-  ToolkitTestApplication application;
-
-  TextInput textInput = TextInput::New();
-  textInput.SetTextAlignment(static_cast<Alignment::Type>( Alignment::HorizontalCenter) );
-
-  bool result = ( textInput.GetTextAlignment() & Alignment::HorizontalCenter ) ;
-
-  DALI_TEST_CHECK( result );
-
-  result = ( textInput.GetTextAlignment() & Alignment::HorizontalRight );
-
-  DALI_TEST_CHECK( !result );
-  END_TEST;
-}
-
-int UtcDaliTextInputSetSortModifier(void)
-{
-  tet_infoline("Testing SetSortModifier does not cause TextInput failure");
-
-  ToolkitTestApplication application;
-
-  TextInput textInput = TextInput::New();
-
-  const float offsetToUse = 1.5f;
-
-  textInput.SetSortModifier( offsetToUse );
-
-  DALI_TEST_CHECK( textInput );
-  END_TEST;
-}
-
-int UtcDaliTextInputSetAndGetSnapshotModeEnabled(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing SetSnapshotModeEnabled and IsSnapshotModeEnabled");
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-  bool snapshotMode( true );
-  textInput.SetSnapshotModeEnabled( snapshotMode );
-
-  DALI_TEST_EQUALS( snapshotMode, textInput.IsSnapshotModeEnabled(), TEST_LOCATION);
-
-  snapshotMode = false;
-  textInput.SetSnapshotModeEnabled( snapshotMode );
-
-  DALI_TEST_EQUALS( snapshotMode, textInput.IsSnapshotModeEnabled(), TEST_LOCATION);
-  END_TEST;
-}
-
-
-int UtcDaliTextInputEndSignalEmit(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing Set editable false emits end signal");
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  Stage::GetCurrent().Add(textInput);
-
-  textInput.InputFinishedSignal().Connect( &OnEndInput );
-
-  textInput.SetEditable(true) ;
-
-  gHasEndSignalBeenReceived = false;
-
-  textInput.SetEditable(false) ;
-
-  DALI_TEST_EQUALS(true, gHasEndSignalBeenReceived, TEST_LOCATION);
-  END_TEST;
-}
-
-
-
-int UtcDaliTextInputStartSignalEmit(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing SetEditable emits start signal");
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  Stage::GetCurrent().Add(textInput);
-
-  textInput.InputStartedSignal().Connect( &OnStartInput );
-
-  gHasStartSignalBeenReceived = false;
-
-  textInput.SetEditable(true);  // Set editable first time
-
-  DALI_TEST_EQUALS(true, gHasStartSignalBeenReceived, TEST_LOCATION);
-
-  gHasStartSignalBeenReceived = false;
-
-  textInput.SetEditable(true); // Set editable second time, signal should not be sent again.
-
-  DALI_TEST_EQUALS(false, gHasStartSignalBeenReceived, TEST_LOCATION);
-
-  textInput.SetEditable(false);
-
-  gHasStartSignalBeenReceived = false;
-
-  textInput.SetEditable(true);  // Set editable again
-
-  DALI_TEST_EQUALS(true, gHasStartSignalBeenReceived, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputExceedMaxCharacters(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing Max characters is obeyed when inputting key events ");
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  Stage::GetCurrent().Add(textInput);
-  textInput.SetMaxCharacterLength(4);
-  textInput.SetInitialText("");
-  textInput.SetEditable(true);
-
-  application.SendNotification();
-  application.Render();
-
-  Integration::KeyEvent eventA("a", "a", 0, 0, 0, Integration::KeyEvent::Down );
-  Integration::KeyEvent eventB("b", "b", 0, 0, 0, Integration::KeyEvent::Down );
-
-  application.ProcessEvent(eventA);
-  application.ProcessEvent(eventB);
-  application.ProcessEvent(eventA);
-  application.ProcessEvent(eventB);
-
-  application.ProcessEvent(eventA);
-  application.ProcessEvent(eventB);
-
-  tet_printf( "Get text result : %s\n", textInput.GetText().c_str());
-
-  DALI_TEST_EQUALS("abab",textInput.GetText(), TEST_LOCATION); // Get text which should be only 4 characters
-  END_TEST;
-}
-
-
-
-int UtcDaliTextInputSetAndGetFadeBoundary(void)
-{
-  tet_infoline("UtcDaliTextViewSetAndGetFadeBoundary: ");
-
-  ToolkitTestApplication application;
-
-  TextView::FadeBoundary fadeBoundary( PixelSize( 0 ), PixelSize( 20 ), PixelSize( 0 ), PixelSize( 10 ) );
-
-  TextInput textInput = TextInput::New();
-  textInput.SetInitialText( "Hello world!" );
-
-  Stage::GetCurrent().Add(textInput);
-  application.SendNotification();
-  application.Render();
-
-  textInput.SetFadeBoundary( fadeBoundary );
-
-  TextView::FadeBoundary fadeBoundary2 = textInput.GetFadeBoundary();
-
-  DALI_TEST_EQUALS( fadeBoundary.mLeft, fadeBoundary2.mLeft, TEST_LOCATION );
-  DALI_TEST_EQUALS( fadeBoundary.mRight, fadeBoundary2.mRight, TEST_LOCATION );
-  DALI_TEST_EQUALS( fadeBoundary.mTop, fadeBoundary2.mTop, TEST_LOCATION );
-  DALI_TEST_EQUALS( fadeBoundary.mBottom, fadeBoundary2.mBottom, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliTextInputSetAndGetWidthExceedPolicy(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextInputSetAndGetWidthExceedPolicy: ");
-
-  const TextView::ExceedPolicy EXCEED_POLICIES[] = { TextView::Original, TextView::Fade, TextView::Split, TextView::ShrinkToFit };
-  const unsigned int NUM_EXCEED_POLICIES = sizeof( EXCEED_POLICIES ) / sizeof( unsigned int );
-
-  TextInput textInput = TextInput::New();
-  textInput.SetInitialText( "Hello world!" );
-
-  for( unsigned int epIndex = 0; epIndex < NUM_EXCEED_POLICIES; ++epIndex )
-  {
-    textInput.SetWidthExceedPolicy( EXCEED_POLICIES[epIndex] );
-
-    DALI_TEST_EQUALS( textInput.GetWidthExceedPolicy(), EXCEED_POLICIES[epIndex], TEST_LOCATION );
-  }
-  END_TEST;
-}
-
-int UtcDaliTextInputSetAndGetHeightExceedPolicy(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("UtcDaliTextInputSetAndGetHeightExceedPolicy: ");
-
-  const TextView::ExceedPolicy EXCEED_POLICIES[] = { TextView::Original, TextView::Fade, TextView::ShrinkToFit };
-  const unsigned int NUM_EXCEED_POLICIES = sizeof( EXCEED_POLICIES ) / sizeof( unsigned int );
-
-  TextInput textInput = TextInput::New();
-  textInput.SetInitialText( "Hello world!" );
-
-  for( unsigned int epIndex = 0; epIndex < NUM_EXCEED_POLICIES; ++epIndex )
-  {
-    textInput.SetHeightExceedPolicy( EXCEED_POLICIES[epIndex] );
-
-    DALI_TEST_EQUALS( textInput.GetHeightExceedPolicy(), EXCEED_POLICIES[epIndex], TEST_LOCATION );
-  }
-  END_TEST;
-}
-
-int UtcDaliTextInputScroll(void)
-{
-  tet_infoline("UtcDaliTextInputScroll: ");
-  ToolkitTestApplication application;
-
-  // Avoids the frame buffer texture to throw an exception.
-  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
-
-  TextInput view = TextInput::New();
-  view.SetMultilinePolicy( TextView::SplitByNewLineChar );
-  view.SetWidthExceedPolicy( TextView::Original );
-  view.SetHeightExceedPolicy( TextView::Original );
-  view.SetTextAlignment( static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalCenter | Toolkit::Alignment::VerticalCenter ) );
-  view.SetInitialText( "Hello world! This is a scroll test." );
-  view.SetSize( 100.f, 100.f );
-  view.SetSnapshotModeEnabled( false );
-
-  Stage::GetCurrent().Add( view );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( !view.IsScrollEnabled() ); // Scroll should be disabled by default.
-
-  view.SetScrollEnabled( true );
-
-  DALI_TEST_CHECK( view.IsScrollEnabled() );
-  DALI_TEST_CHECK( view.IsSnapshotModeEnabled() ); // Scroll should enable snapshot mode.
-
-  view.SetScrollPosition( Vector2( 400.f, 400.f ) );
-
-  application.SendNotification();
-  application.Render();
-
-  const Vector2& scrollPosition = view.GetScrollPosition();
-  DALI_TEST_EQUALS( scrollPosition, Vector2( 149.153656f, 0.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliTextInputSetActiveStyle(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing Setting of Style to newly added text");
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  Stage::GetCurrent().Add(textInput);
-
-  const std::string styledString = "Test String<i>ab</i>" ;
-  const std::string plainString = "Test String";
-  textInput.SetInitialText( plainString );
-
-  application.SendNotification();
-  application.Render();
-
-  textInput.SetEditable(true);
-
-  std::string retreivedMarkupString = textInput.GetMarkupText();
-
-  tet_infoline("Confirm markup text is a plain string ");
-  DALI_TEST_EQUALS( plainString,textInput.GetText(), TEST_LOCATION);
-
-  TextStyle style;
-  style.SetItalics( true );
-
-  tet_infoline("Apply style to TextInput");
-  textInput.SetActiveStyle( style );
-
-  Integration::KeyEvent eventA("a", "a", 0, 0, 0, Integration::KeyEvent::Down );
-  Integration::KeyEvent eventB("b", "b", 0, 0, 0, Integration::KeyEvent::Down );
-
-  application.SendNotification();
-  application.Render();
-
-  application.ProcessEvent(eventA);
-  application.SendNotification();
-  application.Render();
-
-  application.ProcessEvent(eventB);
-  application.SendNotification();
-  application.Render();
-
-  retreivedMarkupString = textInput.GetMarkupText();
-
-  DALI_TEST_EQUALS( styledString, retreivedMarkupString, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputApplyStyleToSelectedText(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing application of style to selected text ");
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  Stage::GetCurrent().Add(textInput);
-
-  const std::string styledString = "Test <i>String</i> to style";
-  const std::string plainString = "Test String to style";
-  textInput.SetInitialText( plainString );
-
-  application.SendNotification();
-  application.Render();
-
-  textInput.SetEditable(true);
-
-  std::string retreivedMarkupString = textInput.GetMarkupText();
-
-  tet_infoline("Confirm markup text is a plain string ");
-  DALI_TEST_EQUALS( plainString,textInput.GetText(), TEST_LOCATION);
-
-  TextStyle style;
-  style.SetItalics( true );
-
-  textInput.SelectText( 5, 11 );
-
-  tet_infoline("Apply style to selected text");
-  textInput.ApplyStyle( style );
-
-  application.Render();
-
-  retreivedMarkupString = textInput.GetMarkupText();
-
-  DALI_TEST_EQUALS( styledString, retreivedMarkupString, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputApplyStyleToAll(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Testing application of style to all text ");
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  Stage::GetCurrent().Add(textInput);
-
-  const std::string styledString = "<i>Test String to style</i>";
-  const std::string plainString = "Test String to style";
-  textInput.SetInitialText( plainString );
-
-  application.SendNotification();
-  application.Render();
-
-  textInput.SetEditable(true);
-
-  std::string retreivedMarkupString = textInput.GetMarkupText();
-
-  tet_infoline("Confirm markup text is a plain string ");
-  DALI_TEST_EQUALS( plainString,textInput.GetText(), TEST_LOCATION);
-
-  TextStyle style;
-  style.SetItalics( true );
-
-  tet_infoline("Apply style to all text");
-  textInput.ApplyStyleToAll( style );
-
-  application.Render();
-
-  retreivedMarkupString = textInput.GetMarkupText();
-
-  DALI_TEST_EQUALS( styledString, retreivedMarkupString, TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliTextInputGetStyleAtCursor(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline("Test getting style at cursor");
-
-  TextInput textInput = TextInput::New();  // create empty TextInput
-
-  Stage::GetCurrent().Add(textInput);
-
-  const std::string styledString = "Test Stringa<i>b</i>" ;
-  const std::string plainString = "Test String";
-  textInput.SetInitialText( plainString );
-
-  application.SendNotification();
-  application.Render();
-
-  textInput.SetEditable(true);
-
-  tet_infoline("Confirm style at cursor is default(plain)");
-  TextStyle style;
-  Integration::KeyEvent eventA("a", "a", 0, 0, 0, Integration::KeyEvent::Down );
-  application.ProcessEvent(eventA);
-  application.SendNotification();
-  application.Render();
-
-  TextStyle retreivedStyleAtCursor = textInput.GetStyleAtCursor();
-
-  DALI_TEST_CHECK( style == retreivedStyleAtCursor );
-  DALI_TEST_CHECK( !retreivedStyleAtCursor.IsItalicsEnabled() );
-
-  tet_infoline("Set style before adding new character");
-  style.SetItalics( true );
-  textInput.SetActiveStyle( style );
-
-  Integration::KeyEvent eventB("b", "b", 0, 0, 0, Integration::KeyEvent::Down );
-  application.ProcessEvent(eventB);
-  application.SendNotification();
-  application.Render();
-
-  tet_infoline("Confirm style at cursor is correct style");
-  retreivedStyleAtCursor = textInput.GetStyleAtCursor();
-
-  DALI_TEST_CHECK( retreivedStyleAtCursor.IsItalicsEnabled() );
-
-  tet_infoline("Confirm style at cursor is not a style that was not set");
-  DALI_TEST_CHECK( !retreivedStyleAtCursor.IsUnderlineEnabled() );
-
-  tet_infoline("Confirm markup text is correct");
-  DALI_TEST_EQUALS( styledString, textInput.GetMarkupText(), TEST_LOCATION);
-
-
-
-  END_TEST;
-}
-
-int UtcDaliTextInputSetAndGetMultilinePolicy(void)
-{
-  ToolkitTestApplication application;
-
-  const TextView::MultilinePolicy MULTILINE_POLICIES[] = { TextView::SplitByNewLineChar, TextView::SplitByWord, TextView::SplitByChar };
-  const unsigned int NUM_MULTILINE_POLICIES = sizeof( MULTILINE_POLICIES ) / sizeof( unsigned int );
-
-  TextInput textInput = TextInput::New();
-  Stage::GetCurrent().Add(textInput);
-  textInput.SetInitialText( "Hello world!" );
-
-  for( unsigned int epIndex = 0; epIndex < NUM_MULTILINE_POLICIES; ++epIndex )
-  {
-    textInput.SetMultilinePolicy( MULTILINE_POLICIES[epIndex] );
-
-    DALI_TEST_EQUALS( textInput.GetMultilinePolicy(), MULTILINE_POLICIES[epIndex], TEST_LOCATION );
-  }
-  END_TEST;
-}
-
-int UtcDaliTextInputSetAndGetExceedEnabled(void)
-{
-  ToolkitTestApplication application;
-
-  const TextView::ExceedPolicy EXCEED_POLICIES[] = { TextView::Original, TextView::Fade, TextView::Split, TextView::ShrinkToFit };
-  const unsigned int NUM_EXCEED_POLICIES = sizeof( EXCEED_POLICIES ) / sizeof( unsigned int );
-
-  TextInput textInput = TextInput::New();
-  Stage::GetCurrent().Add(textInput);
-  textInput.SetInitialText( "Hello world!" );
-
-  for( unsigned int epIndex = 0; epIndex < NUM_EXCEED_POLICIES; ++epIndex )
-  {
-    textInput.SetWidthExceedPolicy( EXCEED_POLICIES[epIndex] );
-
-    DALI_TEST_EQUALS( textInput.GetWidthExceedPolicy(), EXCEED_POLICIES[epIndex], TEST_LOCATION );
-  }
-  END_TEST;
-}
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextView.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextView.cpp
deleted file mode 100644 (file)
index cb3f34a..0000000
+++ /dev/null
@@ -1,823 +0,0 @@
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-#include <iostream>
-#include <stdlib.h>
-
-// Need to override adaptor classes for toolkit test harness, so include
-// test harness headers before dali headers.
-#include <dali-toolkit-test-suite-utils.h>
-
-#include <dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-using namespace Dali;
-using namespace Toolkit;
-
-void utc_dali_toolkit_text_view_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_toolkit_text_view_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-
-namespace
-{
-
-const char* const PROPERTY_TEXT = "text";
-const char* const PROPERTY_MULTILINE_POLICY = "multiline-policy";
-const char* const PROPERTY_WIDTH_EXCEED_POLICY = "width-exceed-policy";
-const char* const PROPERTY_HEIGHT_EXCEED_POLICY = "height-exceed-policy";
-const char* const PROPERTY_LINE_JUSTIFICATION = "line-justification";
-const char* const PROPERTY_FADE_BOUNDARY = "fade-boundary";
-const char* const PROPERTY_LINE_HEIGHT_OFFSET = "line-height-offset";
-const char* const PROPERTY_HORIZONTAL_ALIGNMENT = "horizontal-alignment";
-const char* const PROPERTY_VERTICAL_ALIGNMENT = "vertical-alignment";
-
-bool TestEqual( float x, float y )
-{
-  return !( fabsf( x - y ) > Math::MACHINE_EPSILON_1000 );
-}
-
-static bool gObjectCreatedCallBackCalled;
-static unsigned int gNumberObjectCreated;
-
-static void TestCallback(BaseHandle handle)
-{
-  gObjectCreatedCallBackCalled = true;
-  ++gNumberObjectCreated;
-}
-
-static bool gTextScrolled;
-static Vector2 gScrollDelta;
-static void TestTextScrolled( TextView textView, Vector2 scrollDelta )
-{
-  gTextScrolled = true;
-  gScrollDelta = scrollDelta;
-}
-
-} // namespace
-
-
-int UtcDaliTextViewNew(void)
-{
-  tet_infoline("UtcDaliTextViewNew: ");
-  ToolkitTestApplication application;
-
-  // Test default constructor.
-  TextView view;
-
-  DALI_TEST_CHECK( !view );
-
-  // Test default initialization.
-  view = TextView::New();
-
-  DALI_TEST_CHECK( view );
-
-  // Test copy constructor and asignment operator.
-  TextView viewCopy1;
-
-  viewCopy1 = view;
-
-  DALI_TEST_CHECK( viewCopy1 );
-
-  TextView viewCopy2( view );
-
-  DALI_TEST_CHECK( viewCopy2 );
-
-  // Test down cast.
-  Actor actorView;
-
-  actorView = view;
-
-  TextView downCastView = TextView::DownCast( actorView );
-
-  DALI_TEST_CHECK( downCastView );
-
-  // Test constructor with a given text.
-
-  const std::string text( "Hello world!" );
-
-  const float DESCENDER = 8.0f;
-
-  TextView view1 = TextView::New( text );
-
-  DALI_TEST_EQUALS( view1.GetText(), text, TEST_LOCATION );
-
-  MarkupProcessor::StyledTextArray styledText;
-  MarkupProcessor::GetStyledTextArray( text, styledText, true );
-
-  TextView view2 = TextView::New( styledText );
-
-  DALI_TEST_EQUALS( view2.GetText(), text, TEST_LOCATION );
-
-  // Check the default Toolkit::TextView::CharacterLayoutInfo::CharacterLayoutInfo() to increase coverage.
-  TextView::CharacterLayoutInfo characterLayoutInfo;
-
-  DALI_TEST_EQUALS( characterLayoutInfo.mSize, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mPosition, Vector3::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mIsNewLineChar, false, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mIsRightToLeftCharacter, false, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mIsVisible, true, TEST_LOCATION );
-
-  TextView::CharacterLayoutInfo characterLayoutInfo2( Size( 2.f, 2.f ),
-                                                      Vector3( 3.f, 4.f, 5.f ),
-                                                      true,
-                                                      true,
-                                                      false,
-                                                      DESCENDER );
-
-  characterLayoutInfo = characterLayoutInfo2;
-
-  DALI_TEST_EQUALS( characterLayoutInfo.mSize, Size( 2.f, 2.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mPosition, Vector3( 3.f, 4.f, 5.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mIsNewLineChar, true, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mIsRightToLeftCharacter, true, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mIsVisible, false, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo.mDescender, DESCENDER , TEST_LOCATION );
-
-
-  TextView::CharacterLayoutInfo characterLayoutInfo3( characterLayoutInfo );
-
-  DALI_TEST_EQUALS( characterLayoutInfo3.mSize, Size( 2.f, 2.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo3.mPosition, Vector3( 3.f, 4.f, 5.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo3.mIsNewLineChar, true, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo3.mIsRightToLeftCharacter, true, TEST_LOCATION );
-  DALI_TEST_EQUALS( characterLayoutInfo3.mIsVisible, false, TEST_LOCATION );
-
-  // Check the default Toolkit::TextView::TextLayoutInfo::TextLayoutInfo() to increase coverage.
-
-  TextView::TextLayoutInfo textLayoutInfo;
-  DALI_TEST_EQUALS( textLayoutInfo.mCharacterLayoutInfoTable.size(), 0u, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo.mCharacterLogicalToVisualMap.size(), 0u, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo.mCharacterVisualToLogicalMap.size(), 0u, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo.mTextSize, Size::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo.mScrollOffset, Vector2::ZERO, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-
-  textLayoutInfo.mCharacterLayoutInfoTable.push_back( characterLayoutInfo );
-  textLayoutInfo.mCharacterLogicalToVisualMap.push_back( 1 );
-  textLayoutInfo.mCharacterVisualToLogicalMap.push_back( 1 );
-  textLayoutInfo.mTextSize = Size( 10.f, 10.f );
-  textLayoutInfo.mScrollOffset = Vector2( 5.f, 5.f );
-
-  TextView::TextLayoutInfo textLayoutInfo2( textLayoutInfo );
-
-  DALI_TEST_EQUALS( textLayoutInfo2.mCharacterLayoutInfoTable.size(), 1u, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo2.mCharacterLogicalToVisualMap.size(), 1u, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo2.mCharacterVisualToLogicalMap.size(), 1u, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo2.mTextSize, Size( 10.f, 10.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo2.mScrollOffset, Vector2( 5.f, 5.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-
-  TextView::TextLayoutInfo textLayoutInfo3;
-
-  textLayoutInfo3 = textLayoutInfo2;
-
-  DALI_TEST_EQUALS( textLayoutInfo3.mCharacterLayoutInfoTable.size(), 1u, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo3.mCharacterLogicalToVisualMap.size(), 1u, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo3.mCharacterVisualToLogicalMap.size(), 1u, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo3.mTextSize, Size( 10.f, 10.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  DALI_TEST_EQUALS( textLayoutInfo3.mScrollOffset, Vector2( 5.f, 5.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-
-  //Additional check to ensure object is created by checking if it's registered
-  ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
-  DALI_TEST_CHECK( registry );
-
-  gObjectCreatedCallBackCalled = false;
-  registry.ObjectCreatedSignal().Connect(&TestCallback);
-  {
-    TextView view = TextView::New();
-  }
-  DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
-  END_TEST;
-}
-
-int UtcDaliTextViewSetAndGetText(void)
-{
-  tet_infoline("UtcDaliTextViewSetAndGetText: ");
-  ToolkitTestApplication application;
-
-  TextView view = TextView::New();
-  view.SetSnapshotModeEnabled( false ); // Disables offscreen rendering.
-
-  std::string str( "Text with differing aCeNdEr and dEcEnDeR" );
-
-  view.SetText( str );
-  DALI_TEST_EQUALS( view.GetText(), str, TEST_LOCATION );
-
-  MarkupProcessor::StyledTextArray styledText;
-  MarkupProcessor::GetStyledTextArray( str, styledText, true );
-
-  view.SetText( styledText );
-  DALI_TEST_EQUALS( view.GetText(), str, TEST_LOCATION );
-
-  // Test the number of text actor created.
-
-  ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
-  DALI_TEST_CHECK( registry );
-
-  gNumberObjectCreated = 0u;
-  registry.ObjectCreatedSignal().Connect(&TestCallback);
-
-  // Following string should create three text-actors ([Hel], [lo wo] and [rld]).
-  std::string text( "Hel<font size='10'>lo wo</font>rld!\n"
-                    "\n" );
-
-  view.SetMarkupProcessingEnabled( true ); // Enables markup processing.
-
-  Stage::GetCurrent().Add( view );
-  view.SetText( text );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_EQUALS( 3u, gNumberObjectCreated, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliTextViewSetStyleToCurrentText(void)
-{
-  tet_infoline("UtcDaliTextViewSetStyleToCurrentText: ");
-  ToolkitTestApplication application;
-
-  TextStyle style;
-  style.SetItalics( true );
-
-  const std::string text( "앞서 농식품부 주이석 검역검사본부\n"
-                          "동물방역부장을 단장으로 하는\n"
-                          "민관합동조사단은 지난달 30일부터\n"
-                          "12일간의 현지 조사활동을 마치고\n"
-                          "11일 새벽 귀국했습니다." );
-  TextView view = TextView::New( text );
-
-  bool fail = false;
-  try
-  {
-    view.SetStyleToCurrentText( style );
-  }
-  catch( ... )
-  {
-    tet_printf( "Tet case fails\n" );
-    fail = true;
-    tet_result(TET_FAIL);
-  }
-
-  DALI_TEST_CHECK( !fail );
-  END_TEST;
-}
-
-int UtcDaliTextViewSetAndGetLineHeight(void)
-{
-  tet_infoline("UtcDaliTextViewSetAndGetLineHeight: ");
-
-  ToolkitTestApplication application;
-
-  const float lineHeightOffset( 9.f );
-
-  TextView textView = TextView::New();
-
-  textView.SetLineHeightOffset( PointSize( lineHeightOffset ) );
-
-  DALI_TEST_EQUALS( float(textView.GetLineHeightOffset()), lineHeightOffset, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliTextViewSetAndGetFadeBoundary(void)
-{
-  tet_infoline("UtcDaliTextViewSetAndGetFadeBoundary: ");
-
-  ToolkitTestApplication application;
-
-  TextView::FadeBoundary fadeBoundary( PixelSize( 0 ), PixelSize( 20 ), PixelSize( 0 ), PixelSize( 10 ) );
-
-  TextView textView = TextView::New( "Hello world!" );
-
-  textView.SetFadeBoundary( fadeBoundary );
-
-  TextView::FadeBoundary fadeBoundary2 = textView.GetFadeBoundary();
-
-  DALI_TEST_EQUALS( fadeBoundary.mLeft, fadeBoundary2.mLeft, TEST_LOCATION );
-  DALI_TEST_EQUALS( fadeBoundary.mRight, fadeBoundary2.mRight, TEST_LOCATION );
-  DALI_TEST_EQUALS( fadeBoundary.mTop, fadeBoundary2.mTop, TEST_LOCATION );
-  DALI_TEST_EQUALS( fadeBoundary.mBottom, fadeBoundary2.mBottom, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliTextViewSetAndGetEllipsizeText(void)
-{
-  tet_infoline("UtcDaliTextViewSetAndGetEllipsizeText: ");
-
-  ToolkitTestApplication application;
-
-  TextView textView = TextView::New( "Hello world!" );
-
-  textView.SetEllipsizeText( std::string( "..." ) );
-
-  DALI_TEST_EQUALS( std::string( "..." ), textView.GetEllipsizeText(), TEST_LOCATION );
-
-  Toolkit::MarkupProcessor::StyledTextArray styledTextArray;
-
-  GetStyledTextArray( std::string( "..." ), styledTextArray, true );
-
-  textView.SetEllipsizeText( styledTextArray );
-
-  DALI_TEST_EQUALS( std::string( "..." ), textView.GetEllipsizeText(), TEST_LOCATION );
-
-  END_TEST;
-}
-
-int UtcDaliTextViewSetAndGetWidthExceedPolicy(void)
-{
-  tet_infoline("UtcDaliTextViewSetAndGetWidthExceedPolicy: ");
-
-  ToolkitTestApplication application;
-
-  const TextView::ExceedPolicy EXCEED_POLICIES[] = { TextView::Original, TextView::Fade, TextView::Split, TextView::ShrinkToFit };
-  const unsigned int NUM_EXCEED_POLICIES = sizeof( EXCEED_POLICIES ) / sizeof( unsigned int );
-
-  TextView textView = TextView::New( "Hello world!" );
-
-  for( unsigned int epIndex = 0; epIndex < NUM_EXCEED_POLICIES; ++epIndex )
-  {
-    textView.SetWidthExceedPolicy( EXCEED_POLICIES[epIndex] );
-
-    DALI_TEST_EQUALS( textView.GetWidthExceedPolicy(), EXCEED_POLICIES[epIndex], TEST_LOCATION );
-  }
-  END_TEST;
-}
-
-int UtcDaliTextViewSetAndGetHeightExceedPolicy(void)
-{
-  tet_infoline("UtcDaliTextViewSetAndGetHeightExceedPolicy: ");
-
-  ToolkitTestApplication application;
-
-  const TextView::ExceedPolicy EXCEED_POLICIES[] = { TextView::Original, TextView::Fade, TextView::ShrinkToFit };
-  const unsigned int NUM_EXCEED_POLICIES = sizeof( EXCEED_POLICIES ) / sizeof( unsigned int );
-
-  TextView textView = TextView::New( "Hello world!" );
-
-  for( unsigned int epIndex = 0; epIndex < NUM_EXCEED_POLICIES; ++epIndex )
-  {
-    textView.SetHeightExceedPolicy( EXCEED_POLICIES[epIndex] );
-
-    DALI_TEST_EQUALS( textView.GetHeightExceedPolicy(), EXCEED_POLICIES[epIndex], TEST_LOCATION );
-  }
-  END_TEST;
-}
-
-/*
-// Re-enable this test case when ALL layout options work in TextView, currently this breaks TCT
-// output because too many warnings/errors are printed out
-//int UtcDaliTextViewTestLayoutOptions01(void)
-{
-  tet_infoline("UtcDaliTextViewTestLayoutOptions01: ");
-
-  ToolkitTestApplication application;
-
-  const std::string text( "앞서 농식품부 주이석 검역검사본부\n"
-                          "동물방역부장을 단장으로 하는\n"
-                          "민관합동조사단은 지난달 30일부터\n"
-                          "12일간의 현지 조사활동을 마치고\n"
-                          "11일 새벽 귀국했습니다." );
-
-  const TextView::MultilinePolicy MULTILINE_POLICIES[] = { TextView::SplitByNewLineChar, TextView::SplitByWord, TextView::SplitByChar };
-  const TextView::ExceedPolicy EXCEED_WIDTH_POLICIES[] = { TextView::Original, TextView::Fade, TextView::Split, TextView::ShrinkToFit, TextView::EllipsizeEnd };
-  const TextView::ExceedPolicy EXCEED_HEIGHT_POLICIES[] = { TextView::Original, TextView::Fade, TextView::ShrinkToFit };
-  const Alignment::Type TEXT_ALIGNMENT[] = { static_cast<Alignment::Type>( Alignment::HorizontalLeft | Alignment::VerticalTop ),
-                                             static_cast<Alignment::Type>( Alignment::HorizontalLeft | Alignment::VerticalCenter ),
-                                             static_cast<Alignment::Type>( Alignment::HorizontalLeft | Alignment::VerticalBottom ),
-                                             static_cast<Alignment::Type>( Alignment::HorizontalCenter | Alignment::VerticalTop ),
-                                             static_cast<Alignment::Type>( Alignment::HorizontalCenter | Alignment::VerticalCenter ),
-                                             static_cast<Alignment::Type>( Alignment::HorizontalCenter | Alignment::VerticalBottom ),
-                                             static_cast<Alignment::Type>( Alignment::HorizontalRight | Alignment::VerticalTop ),
-                                             static_cast<Alignment::Type>( Alignment::HorizontalRight | Alignment::VerticalCenter ),
-                                             static_cast<Alignment::Type>( Alignment::HorizontalRight | Alignment::VerticalBottom ) };
-  const TextView::LineJustification LINE_JUSTIFICATION[] = { TextView::Left, TextView::Center, TextView::Right, TextView::Justified };
-
-  const unsigned int NUM_MULTILINE_POLICIES = sizeof( MULTILINE_POLICIES ) / sizeof( unsigned int );
-  const unsigned int NUM_WIDTH_EXCEED_POLICIES = sizeof( EXCEED_WIDTH_POLICIES ) / sizeof( unsigned int );
-  const unsigned int NUM_HEIGHT_EXCEED_POLICIES = sizeof( EXCEED_HEIGHT_POLICIES ) / sizeof( unsigned int );
-  const unsigned int NUM_TEXT_ALIGNMENT = sizeof( TEXT_ALIGNMENT ) / sizeof( unsigned int );
-  const unsigned int NUM_LINE_JUSTIFICATION = sizeof( LINE_JUSTIFICATION ) / sizeof( unsigned int );
-
-  TextView textView = TextView::New( text );
-  textView.SetSnapshotModeEnabled( false ); // Disables offscreen rendering.
-
-  Stage::GetCurrent().Add( textView );
-
-  TextView::TextLayoutInfo textLayoutInfo;
-
-  for( unsigned int mlpIndex = 0; mlpIndex < NUM_MULTILINE_POLICIES; ++mlpIndex )
-  {
-    textView.SetMultilinePolicy( MULTILINE_POLICIES[mlpIndex] );
-    for( unsigned int ewpIndex = 0; ewpIndex < NUM_WIDTH_EXCEED_POLICIES; ++ewpIndex )
-    {
-      textView.SetWidthExceedPolicy( EXCEED_WIDTH_POLICIES[ewpIndex] );
-      for( unsigned int ehpIndex = 0; ehpIndex < NUM_HEIGHT_EXCEED_POLICIES; ++ehpIndex )
-      {
-        textView.SetHeightExceedPolicy( EXCEED_HEIGHT_POLICIES[ehpIndex] );
-        for( unsigned int taIndex = 0; taIndex < NUM_TEXT_ALIGNMENT; ++taIndex )
-        {
-          textView.SetTextAlignment( TEXT_ALIGNMENT[taIndex] );
-          for( unsigned int ljIndex = 0; ljIndex < NUM_LINE_JUSTIFICATION; ++ljIndex )
-          {
-            textView.SetLineJustification( LINE_JUSTIFICATION[ljIndex] );
-
-            try
-            {
-              textView.GetTextLayoutInfo( textLayoutInfo );
-
-              application.SendNotification();
-              application.Render();
-            }
-            catch( Dali::DaliException& e )
-            {
-              DALI_TEST_EQUALS( e.condition, "!\"TextView::CombineExceedPolicies() Invalid width and height exceed policies combination\"", TEST_LOCATION );
-            }
-            catch( ... )
-            {
-              tet_printf( "Tet case fails\n" );
-              tet_printf( "      MultilinePolicy : %d\n", MULTILINE_POLICIES[mlpIndex] );
-              tet_printf( "   Width ExceedPolicy : %d\n", EXCEED_WIDTH_POLICIES[ewpIndex] );
-              tet_printf( "  Height ExceedPolicy : %d\n", EXCEED_HEIGHT_POLICIES[ehpIndex] );
-              tet_printf( "        TextAlignment : %d\n", TEXT_ALIGNMENT[taIndex] );
-              tet_printf( "    LineJustification : %d\n", LINE_JUSTIFICATION[ljIndex] );
-              tet_result(TET_FAIL);
-            }
-
-            DALI_TEST_CHECK( LINE_JUSTIFICATION[ljIndex] == textView.GetLineJustification() );
-          }
-          DALI_TEST_CHECK( TEXT_ALIGNMENT[taIndex] == textView.GetTextAlignment() );
-        }
-        DALI_TEST_CHECK( EXCEED_HEIGHT_POLICIES[ehpIndex] == textView.GetHeightExceedPolicy() );
-      }
-      DALI_TEST_CHECK( EXCEED_WIDTH_POLICIES[ewpIndex] == textView.GetWidthExceedPolicy() );
-    }
-    DALI_TEST_CHECK( MULTILINE_POLICIES[mlpIndex] == textView.GetMultilinePolicy() );
-  }
-  END_TEST;
-}
-*/
-
-int UtcDaliTextViewTestLayoutOptions02(void)
-{
-  tet_infoline("UtcDaliTextViewTestLayoutOptions02: ");
-  ToolkitTestApplication application;
-
-  // Check some configurations.
-
-  TextView textView = TextView::New();
-  textView.SetSnapshotModeEnabled( false ); // Disables offscreen rendering.
-  textView.SetMarkupProcessingEnabled( true ); // Enables markup processing.
-
-  Stage::GetCurrent().Add( textView );
-
-  // SplitByWord and ShrinkToFit.
-  // Centered alignment.
-  // Centered justification.
-  // Don't create a text actor per character.
-
-  textView.SetMultilinePolicy( TextView::SplitByWord );
-  textView.SetWidthExceedPolicy( TextView::ShrinkToFit );
-  textView.SetHeightExceedPolicy( TextView::ShrinkToFit );
-  textView.SetTextAlignment( static_cast<Alignment::Type>( Alignment::HorizontalCenter | Alignment::VerticalTop ) );
-  textView.SetLineJustification( TextView::Center );
-  textView.SetSize( 136.56252f, 100.f );
-
-  textView.SetText( "Hel<font color='green'>lo wo</font>rld!" );
-
-  application.SendNotification();
-  application.Render();
-
-  std::vector<Size> sizes;
-  sizes.push_back( Size( 34.14063f, 11.380210f ) );              //
-  sizes.push_back( Size( 56.90105f, 11.380210f ) );              //
-  sizes.push_back( Size( 45.52084f, 11.380210f ) );              // By default characters have width and height values of 11.380210.
-                                                                 // The result should be a line with the text 'Hello world' as shown below.
-  std::vector<Vector3> positions;                                //  ____________
-  positions.push_back( Vector3( 0.000008f, 11.380209f, 0.f ) );  // |Hello world!|
-  positions.push_back( Vector3( 34.14063f, 11.380209f, 0.f ) );  //  ------------
-  positions.push_back( Vector3( 91.04168f, 11.380209f, 0.f ) );  //
-
-  DALI_TEST_CHECK( positions.size() == textView.GetChildCount() ); // Check text has two text-actors.
-
-  for( std::size_t index = 0, num = textView.GetChildCount(); index < num; ++index )
-  {
-    const Vector3& size = textView.GetChildAt(index).GetCurrentSize();
-    const Vector3& position = textView.GetChildAt(index).GetCurrentPosition();
-
-    DALI_TEST_EQUALS( size.width, sizes[index].width, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-    DALI_TEST_EQUALS( size.height, sizes[index].height, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-    DALI_TEST_EQUALS( position.width, positions[index].width, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-    DALI_TEST_EQUALS( position.height, positions[index].height, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  }
-
-  textView.SetSize( 50.f, 50.f );
-  textView.SetTextAlignment( static_cast<Alignment::Type>( Alignment::HorizontalCenter | Alignment::VerticalCenter ) );
-  textView.SetSizePolicy( Toolkit::Control::Fixed, Toolkit::Control::Fixed );
-  textView.SetLineJustification( Toolkit::TextView::Left );
-
-  application.SendNotification();
-  application.Render();
-
-  sizes.clear();
-  sizes.push_back( Size( 24.999999f, 8.333333f ) );              //
-  sizes.push_back( Size( 24.999999f, 8.333333f ) );              //
-  sizes.push_back( Size( 16.666666f, 8.333333f ) );              // Longest word is 'world!' (6 characters x 11.380210) which doesn't fit in the 50x50 box.
-  sizes.push_back( Size( 33.333332f, 8.333333f ) );              // The scale factor is 0.732265339, so the character size is 8.333333.
-                                                                 // Text should be split in two lines, centered in the vertical dimension and fitted in the horizontal one.
-  positions.clear();                                             // As shown below, the text is two lines and centered in the vertical dimension and
-  positions.push_back( Vector3(  0.000008f, 25.223114f, 0.f ) ); // it should start in middle height (~25).
-  positions.push_back( Vector3( 24.999999f, 25.223114f, 0.f ) ); //   ______
-  positions.push_back( Vector3(  0.000006f, 33.556446f, 0.f ) ); //  |      |
-  positions.push_back( Vector3( 16.666666f, 33.556446f, 0.f ) ); //  |Hello |
-                                                                 //  |world!|
-                                                                 //  |______|
-                                                                 //
-
-  DALI_TEST_CHECK( positions.size() == textView.GetChildCount() ); // Check text has two text-actors.
-
-  for( std::size_t index = 0, num = textView.GetChildCount(); index < num; ++index )
-  {
-    const Vector3& size = textView.GetChildAt(index).GetCurrentSize();
-    const Vector3& position = textView.GetChildAt(index).GetCurrentPosition();
-
-    DALI_TEST_EQUALS( size.width, sizes[index].width, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-    DALI_TEST_EQUALS( size.height, sizes[index].height, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-    DALI_TEST_EQUALS( position.width, positions[index].width, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-    DALI_TEST_EQUALS( position.height, positions[index].height, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  }
-
-  // TODO: Add more tests when TextView implementation is finished.
-  END_TEST;
-}
-
-int UtcDaliTextViewInsertRemoveText(void)
-{
-  tet_infoline("UtcDaliTextViewInsertRemoveText: ");
-  ToolkitTestApplication application;
-
-  std::string text("Hello ");
-
-  MarkupProcessor::StyledTextArray styledText;
-  MarkupProcessor::GetStyledTextArray( text, styledText, true );
-
-  TextView view = TextView::New( "world!" );
-
-  view.InsertTextAt( 0, styledText );
-
-  DALI_TEST_EQUALS( view.GetText(), std::string("Hello world!"), TEST_LOCATION );
-
-  view.RemoveTextFrom( 4, 5 );
-
-  DALI_TEST_EQUALS( view.GetText(), std::string("Hellld!"), TEST_LOCATION );
-
-  view.InsertTextAt( 0, "Hello " );
-
-  DALI_TEST_EQUALS( view.GetText(), std::string("Hello Hellld!"), TEST_LOCATION );
-
-
-  view.InsertTextAt( 0, "Hello " );
-  view.InsertTextAt( 0, "Hello " );
-  view.InsertTextAt( 0, "Hello " );
-  view.InsertTextAt( 0, "Hello " );
-  view.RemoveTextFrom( 4, 2 );
-  view.RemoveTextFrom( 4, 2 );
-  view.RemoveTextFrom( 4, 2 );
-  view.RemoveTextFrom( 4, 2 );
-  view.RemoveTextFrom( 4, 2 );
-  view.SetText( "Hello world!" );
-
-  DALI_TEST_EQUALS( view.GetText(), std::string("Hello world!"), TEST_LOCATION );
-
-  view.ReplaceTextFromTo( 5, 1, "" );
-
-  DALI_TEST_EQUALS( view.GetText(), std::string("Helloworld!"), TEST_LOCATION );
-
-  view.ReplaceTextFromTo( 0, 11, styledText );
-
-  DALI_TEST_EQUALS( view.GetText(), std::string("Hello "), TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliTextViewSnapshotEnable(void)
-{
-  tet_infoline("UtcDaliTextViewSnapshotEnable: ");
-  ToolkitTestApplication application;
-
-  // Avoids the frame buffer texture to throw an exception.
-  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
-
-  TextView view = TextView::New();
-  view.SetMarkupProcessingEnabled( true ); // Enables markup processing.
-  view.SetText( "Hel<font color='green'>lo world!</font> This <font color='green'>is</font> a sna<font color='green'>psho</font>t test." );
-
-  Stage::GetCurrent().Add( view );
-
-  view.SetSnapshotModeEnabled( true );  // VCC. By default the snapshot mode should be enabled but it has been temporary disabled.
-                                        // This line should be removed when text-view is set to use the snapshot mode by default.
-
-  // Snapshot is enabled by default.
-  DALI_TEST_CHECK( view.IsSnapshotModeEnabled() );
-
-  application.SendNotification();
-  application.Render();
-
-  // TextView should have only two actors:
-  // the root (Actor) and the image (ImageActor).
-
-  DALI_TEST_EQUALS( view.GetChildCount(), 2u, TEST_LOCATION );
-
-  view.SetSnapshotModeEnabled( false );
-  DALI_TEST_CHECK( !view.IsSnapshotModeEnabled() );
-
-  application.SendNotification();
-  application.Render();
-
-  // TextView should have one text-actor per word.
-
-  DALI_TEST_EQUALS( view.GetChildCount(), 7u, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliTextViewScroll(void)
-{
-  tet_infoline("UtcDaliTextViewScroll: ");
-  ToolkitTestApplication application;
-
-  // Avoids the frame buffer texture to throw an exception.
-  application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
-
-  TextView view = TextView::New( "Hello world! This is a scroll test." );
-  view.SetSize( 100.f, 100.f );
-  view.SetSnapshotModeEnabled( false );
-
-  Stage::GetCurrent().Add( view );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_CHECK( !view.IsScrollEnabled() ); // Scroll should be disabled by default.
-
-  view.SetScrollEnabled( true );
-  view.ScrolledSignal().Connect( &TestTextScrolled );
-
-  DALI_TEST_CHECK( view.IsScrollEnabled() );
-  DALI_TEST_CHECK( view.IsSnapshotModeEnabled() ); // Scroll should enable snapshot mode.
-
-  gTextScrolled = false;
-  gScrollDelta = Vector2::ZERO;
-  view.SetScrollPosition( Vector2( 400.f, 400.f ) );
-
-  application.SendNotification();
-  application.Render();
-
-  const Vector2& scrollPosition = view.GetScrollPosition();
-  DALI_TEST_EQUALS( scrollPosition, Vector2( 149.153656f, 0.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-
-  DALI_TEST_CHECK( gTextScrolled );
-  DALI_TEST_EQUALS( gScrollDelta, Vector2( 149.153656f, 0.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-
-  DALI_TEST_CHECK( view.IsScrollPositionTrimmed() );
-  END_TEST;
-}
-
-int UtcDaliTextViewSetProperty(void)
-{
-  tet_infoline("UtcDaliTextViewSetAndGetText: ");
-  ToolkitTestApplication application;
-
-  TextView view = TextView::New( "Hello world!" );
-  Stage::GetCurrent().Add( view );
-
-  //Test multiline policy property
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_MULTILINE_POLICY), "SplitByNewLineChar");
-  DALI_TEST_CHECK( Toolkit::TextView::SplitByNewLineChar == view.GetMultilinePolicy() );
-
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_MULTILINE_POLICY), "SplitByWord");
-  DALI_TEST_CHECK( Toolkit::TextView::SplitByWord == view.GetMultilinePolicy() );
-
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_MULTILINE_POLICY), "SplitByChar");
-  DALI_TEST_CHECK( Toolkit::TextView::SplitByChar == view.GetMultilinePolicy() );
-
-  //Test width exceed policy property
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_WIDTH_EXCEED_POLICY), "Original");
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_HEIGHT_EXCEED_POLICY), "Original");
-  DALI_TEST_CHECK( Toolkit::TextView::Original == view.GetWidthExceedPolicy() );
-  DALI_TEST_CHECK( Toolkit::TextView::Original == view.GetHeightExceedPolicy() );
-
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_WIDTH_EXCEED_POLICY), "Fade");
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_HEIGHT_EXCEED_POLICY), "Fade");
-  DALI_TEST_CHECK( Toolkit::TextView::Fade == view.GetWidthExceedPolicy() );
-  DALI_TEST_CHECK( Toolkit::TextView::Fade == view.GetHeightExceedPolicy() );
-
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_WIDTH_EXCEED_POLICY), "ShrinkToFit");
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_HEIGHT_EXCEED_POLICY), "ShrinkToFit");
-  DALI_TEST_CHECK( Toolkit::TextView::ShrinkToFit == view.GetWidthExceedPolicy() );
-  DALI_TEST_CHECK( Toolkit::TextView::ShrinkToFit == view.GetHeightExceedPolicy() );
-
-  //Test line justification property
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_LINE_JUSTIFICATION), "Left");
-  DALI_TEST_CHECK( Toolkit::TextView::Left == view.GetLineJustification() );
-
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_LINE_JUSTIFICATION), "Center");
-  DALI_TEST_CHECK( Toolkit::TextView::Center == view.GetLineJustification() );
-
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_LINE_JUSTIFICATION), "Right");
-  DALI_TEST_CHECK( Toolkit::TextView::Right == view.GetLineJustification() );
-
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_LINE_JUSTIFICATION), "Justified");
-  DALI_TEST_CHECK( Toolkit::TextView::Justified == view.GetLineJustification() );
-
-  //Test fade boundary property
-  const Vector4 testValue( 23.f, 26.f, 2.f, 11.f );
-
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_FADE_BOUNDARY), testValue);
-  DALI_TEST_CHECK( testValue.x == view.GetFadeBoundary().mLeft );
-  DALI_TEST_CHECK( testValue.y == view.GetFadeBoundary().mRight );
-  DALI_TEST_CHECK( testValue.z == view.GetFadeBoundary().mTop );
-  DALI_TEST_CHECK( testValue.w == view.GetFadeBoundary().mBottom );
-
-  //Test Line height offset property
-  float testOffsetValue = 14.04f;
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_LINE_HEIGHT_OFFSET), testOffsetValue);
-  DALI_TEST_CHECK( PointSize(testOffsetValue) == view.GetLineHeightOffset() );
-
-  //Test alignment property
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_HORIZONTAL_ALIGNMENT), "HorizontalLeft");
-  view.SetProperty(view.GetPropertyIndex(PROPERTY_VERTICAL_ALIGNMENT), "VerticalTop");
-  DALI_TEST_CHECK( (Toolkit::Alignment::HorizontalLeft | Toolkit::Alignment::VerticalTop) == view.GetTextAlignment() );
-  END_TEST;
-}
-
-int UtcDaliTextViewSetSortModifier(void)
-{
-  tet_infoline("UtcDaliTextViewSetAndGetText: ");
-  ToolkitTestApplication application;
-
-  TextView view = TextView::New( "Hello world!" );
-  Stage::GetCurrent().Add( view );
-
-  view.SetSortModifier( 10.f );
-  view.SetSnapshotModeEnabled( false );
-
-  application.SendNotification();
-  application.Render();
-
-  DALI_TEST_EQUALS( RenderableActor::DownCast(view.GetChildAt(0)).GetSortModifier(), 10.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliTextViewUnderlineText(void)
-{
-  tet_infoline("UtcDaliTextViewUnderlineText: ");
-  ToolkitTestApplication application;
-
-  TextView textView = TextView::New();
-  textView.SetSnapshotModeEnabled( false );
-  textView.SetMarkupProcessingEnabled( true );
-  textView.SetText( "<u><font size='10'>gg<font size='14'>gg<font size='18'>gg<font size='22'>gg</font>gg</font>gg</font>gg</font></u>" );
-
-  textView.SetSize( 150.f, 100.f );
-
-  Stage::GetCurrent().Add( textView );
-
-  application.SendNotification();
-  application.Render();
-
-  std::vector<float> positions;
-  positions.push_back( 6.448784f );
-  positions.push_back( 9.862847f );
-  positions.push_back( 13.276909f );
-  positions.push_back( 16.690973f );
-  positions.push_back( 13.276909f );
-  positions.push_back( 9.862847f );
-  positions.push_back( 6.448784f );
-
-  for( std::size_t index = 0, num = textView.GetChildCount(); index < num; ++index )
-  {
-    TextStyle style = TextActor::DownCast( textView.GetChildAt(index) ).GetTextStyle();
-
-    DALI_TEST_EQUALS( 4.17274f, style.GetUnderlineThickness(), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-    DALI_TEST_EQUALS( positions[index], style.GetUnderlinePosition(), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
-  }
-  END_TEST;
-}
index 4b03c11..d359334 100644 (file)
@@ -114,18 +114,18 @@ int UtcDaliToolBarAddControl01(void)
   try
   {
     ImageActor control1 = CreateSolidColorActor( Color::RED );
-    control1.SetSize( 100.f, 100.f );
+    control1.SetSize( Vector2( 100.f, 100.f ) );
     ImageActor control2 = CreateSolidColorActor( Color::RED );
-    control2.SetSize( 100.f, 100.f );
+    control2.SetSize( Vector2( 100.f, 100.f ) );
     ImageActor control3 = CreateSolidColorActor( Color::RED );
-    control3.SetSize( 100.f, 100.f );
+    control3.SetSize( Vector2( 100.f, 100.f ) );
     ImageActor control4 = CreateSolidColorActor( Color::RED );
-    control4.SetSize( 100.f, 100.f );
+    control4.SetSize( Vector2( 100.f, 100.f ) );
     ImageActor control5 = CreateSolidColorActor( Color::RED );
-    control5.SetSize( 100.f, 100.f );
+    control5.SetSize( Vector2( 100.f, 100.f ) );
 
     ToolBar toolbar = ToolBar::New();
-    toolbar.SetSize( 600.f, 100.f );
+    toolbar.SetSize( Vector2( 600.f, 100.f ) );
 
     application.Render();
     application.SendNotification();
@@ -139,11 +139,11 @@ int UtcDaliToolBarAddControl01(void)
     toolbar.AddControl( control5, 0.1f, Alignment::HorizontalRight, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
 
     ImageActor control6 = CreateSolidColorActor( Color::RED );
-    control6.SetSize( 100.f, 100.f );
+    control6.SetSize( Vector2( 100.f, 100.f ) );
     ImageActor control7 = CreateSolidColorActor( Color::RED );
-    control7.SetSize( 100.f, 100.f );
+    control7.SetSize( Vector2( 100.f, 100.f ) );
     ImageActor control8 = CreateSolidColorActor( Color::RED );
-    control8.SetSize( 100.f, 100.f );
+    control8.SetSize( Vector2( 100.f, 100.f ) );
 
     application.Render();
     application.SendNotification();
index 21a57df..ad124e1 100644 (file)
@@ -305,9 +305,10 @@ int UtcDaliViewOrientationChanged(void)
   try
   {
     View view = View::New();
+    view.SetRelayoutEnabled( true );
     Stage::GetCurrent().Add( view );
 
-    view.SetSize( 480, 800 );
+    view.SetSize( Vector2( 480, 800 ) );
 
     view.OrientationAnimationStartedSignal().Connect( &StartAnimation );
 
index 1ca51e4..bb89f6c 100644 (file)
@@ -30,8 +30,7 @@ lib_LTLIBRARIES = libdali-script-plugin-v8.la
 # It won't be installed until the rpm is installed, and unfortunately the
 # plugin is part of the same rpm
 script_plugin_v8_includes = -I../../../plugins/dali-script-v8/src \
-                         -I../../../plugins/dali-script-v8/src/utils \
-                         -I../../../
+                            -I../../../plugins/dali-script-v8/src/utils
 
 
 libdali_script_plugin_v8_la_SOURCES = \
@@ -40,14 +39,13 @@ libdali_script_plugin_v8_la_SOURCES = \
 libdali_script_plugin_v8_la_DEPENDENCIES =
 
 libdali_script_plugin_v8_la_CXXFLAGS = -DDALI_COMPILATION \
+                            $(V8_CFLAGS) \
                             $(DALI_TOOLKIT_CFLAGS) \
                             $(DALICORE_CFLAGS) \
                             -DDALI_DATA_READ_ONLY_DIR="\"${dataReadOnlyDir}\"" \
                             $(DALI_CFLAGS) \
                             $(DLOG_CFLAGS) \
-                            -I../../.. \
                             $(script_plugin_v8_includes) \
-                            $(V8_CFLAGS) \
                             -Werror -Wall
 
 libdali_script_plugin_v8_la_LIBADD = \
diff --git a/dali-toolkit/images/00_popup_bg.9.png b/dali-toolkit/images/00_popup_bg.9.png
new file mode 100644 (file)
index 0000000..b8f5b3f
Binary files /dev/null and b/dali-toolkit/images/00_popup_bg.9.png differ
index 18f9533..cc300fa 100644 (file)
Binary files a/dali-toolkit/images/00_popup_bg.png and b/dali-toolkit/images/00_popup_bg.png differ
index c1c8921..bea8368 100644 (file)
@@ -16,6 +16,8 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/actors/renderable-actor.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
index 766e1bf..21c49a1 100644 (file)
  */
 
 // EXTERNAL INCLUDES
-#include <dali.h>
+#include <dali/public-api/math/rect.h>
+#include <dali/public-api/math/vector2.h>
+#include <dali/public-api/math/vector3.h>
+#include <dali/public-api/math/vector4.h>
+#include <dali/public-api/math/matrix.h>
+#include <dali/public-api/math/matrix3.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/builder/tree-node.h>
index b550ac1..202e944 100644 (file)
 #include <sys/stat.h>
 #include <boost/function.hpp>
 #include <sstream>
-
+#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/public-api/object/type-info.h>
+#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/actors/image-actor.h>
+#include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/builder/json-parser.h>
 
@@ -529,6 +534,9 @@ BaseHandle Builder::DoCreate( const TreeNode& root, const TreeNode& node,
 
       if( actor )
       {
+        // TEMP: Assume all script created actors are not using size negotiation for now
+        actor.SetRelayoutEnabled( false );
+
         // add children of all the styles
         if( OptionalChild actors = IsChild( node, KEYNAME_ACTORS ) )
         {
index aeb3ff1..4fb7aba 100644 (file)
 #include <string>
 #include <list>
 #include <map>
+#include <dali/public-api/common/stage.h>
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/object/base-object.h>
+#include <dali/public-api/object/property-map.h>
+#include <dali/public-api/render-tasks/render-task.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
index 00d6ec6..184d253 100644 (file)
@@ -17,6 +17,7 @@
 
 // EXTERNAL INCLUDES
 #include <sstream>
+#include <dali/public-api/adaptor-framework/color-controller.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/builder/builder-impl.h>
index 0efd85b..f832721 100644 (file)
  */
 
 // EXTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
 #include <boost/function.hpp>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/object/type-info.h>
+#include <dali/public-api/object/property-notification.h>
+#include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/builder/builder-impl.h>
index 62f5e08..9713587 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/object/property-input.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/size-negotiation/relayout-container.h>
 
 namespace Dali
 {
@@ -450,7 +451,7 @@ const Toolkit::Alignment::Padding& Alignment::GetPadding() const
   return mPadding;
 }
 
-void Alignment::OnRelayout( const Vector2& size, ActorSizeContainer& container )
+void Alignment::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   // lay out the actors
   Vector3 anchorPointAndParentOrigin  = Vector3::ZERO;
@@ -474,59 +475,59 @@ void Alignment::OnRelayout( const Vector2& size, ActorSizeContainer& container )
     anchorPointAndParentOrigin.y = 1.0f;
   }
 
-  unsigned int childCount = Self().GetChildCount();
-  for( unsigned int i=0; i<childCount; ++i )
+  for( unsigned int i = 0, childCount = Self().GetChildCount(); i < childCount; ++i )
   {
-    Actor actor = Self().GetChildAt(i);
+    Actor child = Self().GetChildAt(i);
 
-    actor.SetAnchorPoint( anchorPointAndParentOrigin );
-    actor.SetParentOrigin( anchorPointAndParentOrigin );
+    child.SetAnchorPoint( anchorPointAndParentOrigin );
+    child.SetParentOrigin( anchorPointAndParentOrigin );
 
-    Vector3 actorSize ( actor.GetSize() );
-    Toolkit::Control control( Toolkit::Control::DownCast( actor ) );
-    if ( actorSize == Vector3::ZERO && control )
+    Vector3 currentChildSize( child.GetTargetSize() );
+    if( currentChildSize == Vector3::ZERO )
     {
-      actorSize = control.GetNaturalSize();
+      currentChildSize = child.GetNaturalSize();
     }
 
-    Vector3 childSize;
+    bool renegotiate = true;
+    Vector3 newChildSize;
 
     switch( mScaling )
     {
       case Toolkit::Alignment::ScaleNone:
       {
         // Nothing to do but needed just to not to jump to the default.
-        childSize = actorSize;
+        newChildSize = currentChildSize;
+        renegotiate = false;
         break;
       }
       case Toolkit::Alignment::ScaleToFill:
       {
         ScaleToFillConstraint constraint( mPadding );
-        childSize = constraint.GetSize( actorSize, Vector3(size) ) ;
+        newChildSize = constraint.GetSize( currentChildSize, Vector3(size) ) ;
         break;
       }
       case Toolkit::Alignment::ScaleToFitKeepAspect:
       {
         ScaleToFitKeepAspectConstraint constraint( mPadding );
-        childSize = constraint.GetSize( actorSize, Vector3(size) ) ;
+        newChildSize = constraint.GetSize( currentChildSize, Vector3(size) ) ;
         break;
       }
       case Toolkit::Alignment::ScaleToFillKeepAspect:
       {
         ScaleToFillKeepAspectConstraint constraint( mPadding );
-        childSize = constraint.GetSize( actorSize, Vector3(size) );
+        newChildSize = constraint.GetSize( currentChildSize, Vector3(size) );
         break;
       }
       case Toolkit::Alignment::ShrinkToFit:
       {
         ShrinkToFitConstraint constraint( mPadding );
-        childSize = constraint.GetSize( actorSize, Vector3(size) );
+        newChildSize = constraint.GetSize( currentChildSize, Vector3(size) );
         break;
       }
       case Toolkit::Alignment::ShrinkToFitKeepAspect:
       {
         ShrinkToFitKeepAspectConstraint constraint( mPadding );
-        childSize = constraint.GetSize( actorSize, Vector3(size) );
+        newChildSize = constraint.GetSize( currentChildSize, Vector3(size) );
         break;
       }
       default:
@@ -537,14 +538,12 @@ void Alignment::OnRelayout( const Vector2& size, ActorSizeContainer& container )
     }
 
     PositionConstraint positionConstraint(mPadding, mHorizontal, mVertical);
-    actor.SetPosition( positionConstraint.GetPosition(childSize, actorSize) );
+    child.SetPosition( positionConstraint.GetPosition(newChildSize, currentChildSize) );
 
-    if( !control )
+    if( renegotiate )
     {
-      actor.SetScale(childSize / actorSize);
+      container.Add( child, Vector2(newChildSize) );
     }
-
-    Relayout( actor, Vector2(childSize), container );
   }
 }
 
index 3788d84..44d058f 100644 (file)
@@ -84,7 +84,7 @@ private: // From Control
   /**
    * @copydoc Control::OnRelayout()
    */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
 
 private:
 
index acf3a5a..0d3fcd5 100644 (file)
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/text-view/text-view.h>
 
+/**
+ * Button states and contents
+ *                                         (3) mSelectedContent
+ *  (2) mButtonContent                     (2) mSelectedBackgroundContent
+ *  (1) mBackgroundContent                 (1) mBackgroundContent
+ * < unselected > ----------------------- < selected >
+ *       |                OnSelect()            |
+ *       | OnDisabled()                         | OnDisabled()
+ *       |                                      |
+ * < disabled >                           < disabled-selected >
+ *  (2) mDisabledContent                   (2) mDisabledSelectedContent
+ *  (1) mDisabledBackgroundContent         (1) mDisabledBackgroundContent
+ *
+ * The drawing order of child actors is as follows.
+ *
+ *  Top      mLabel
+ *   |       mButtonContent / mSelectedContent / mDisabledContent / mDisabledSelectedContent
+ *   |       mSelectedBackgroundContent
+ * Bottom    mBackgroundContent / mDisabledBackgroundContent
+ *
+ * Some of contents may be missed.
+ * And 2 images - fade-in image and fade-out image - in the same layer can be shown during the transition animation. Fade-in image should be above fade-out image.
+ */
+
 namespace Dali
 {
 
@@ -85,7 +109,8 @@ Button::Button()
   mNextAutoRepeatingDelay( NEXT_AUTOREPEATING_DELAY ),
   mAnimationTime( 0.0f ),
   mClickActionPerforming( false ),
-  mState( ButtonUp )
+  mState( ButtonUp ),
+  mPaintState( UnselectedState )
 {
 }
 
@@ -101,9 +126,241 @@ void Button::SetDisabled( bool disabled )
 {
   if( disabled != mDisabled )
   {
+    unsigned int backgroundIndex;
+    unsigned int buttonIndex;
+
+    bool animationStarted = false;
+
     mDisabled = disabled;
 
-    OnDisabled( mDisabled );
+    switch( mPaintState )
+    {
+      case UnselectedState:
+      {
+        buttonIndex = FindChildIndex( mLabel );
+        InsertChild( buttonIndex, mDisabledContent );
+
+        if( mBackgroundContent )
+        {
+          backgroundIndex = 1;
+        }
+        else
+        {
+          backgroundIndex = 0;
+        }
+
+        InsertChild( backgroundIndex, mDisabledBackgroundContent );
+
+        animationStarted = OnDisabled();
+
+        if( animationStarted )
+        {
+          mPaintState = UnselectedDisabledTransition;
+        }
+        else
+        {
+          mPaintState = DisabledUnselectedState;
+        }
+        break;
+      }
+      case SelectedState:
+      {
+        buttonIndex = FindChildIndex( mLabel );
+        InsertChild( buttonIndex, mDisabledSelectedContent );
+
+        if( mBackgroundContent )
+        {
+          backgroundIndex = 1;
+        }
+        else
+        {
+          backgroundIndex = 0;
+        }
+
+        InsertChild( backgroundIndex, mDisabledBackgroundContent );
+
+        animationStarted = OnDisabled();
+
+        if( animationStarted )
+        {
+          mPaintState = SelectedDisabledTransition;
+        }
+        else
+        {
+          mPaintState = DisabledSelectedState;
+        }
+        break;
+      }
+      case DisabledUnselectedState:
+      {
+        buttonIndex = FindChildIndex( mLabel );
+        InsertChild( buttonIndex, mButtonContent );
+
+        if( mDisabledBackgroundContent )
+        {
+          backgroundIndex = 1;
+        }
+        else
+        {
+          backgroundIndex = 0;
+        }
+
+        InsertChild( backgroundIndex, mBackgroundContent );
+
+        animationStarted = OnDisabled();
+
+        if( animationStarted )
+        {
+          mPaintState = DisabledUnselectedTransition;
+        }
+        else
+        {
+          mPaintState = UnselectedState;
+        }
+        break;
+      }
+      case DisabledSelectedState:
+      {
+        buttonIndex = FindChildIndex( mLabel );
+        InsertChild( buttonIndex, mSelectedContent );
+
+        if( mDisabledBackgroundContent )
+        {
+          backgroundIndex = 1;
+        }
+        else
+        {
+          backgroundIndex = 0;
+        }
+
+        InsertChild( backgroundIndex, mSelectedBackgroundContent );
+        InsertChild( backgroundIndex, mBackgroundContent );
+
+        animationStarted = OnDisabled();
+
+        if( animationStarted )
+        {
+          mPaintState = DisabledSelectedTransition;
+        }
+        else
+        {
+          mPaintState = SelectedState;
+        }
+        break;
+      }
+      case UnselectedSelectedTransition:
+      {
+        buttonIndex = FindChildIndex( mLabel );
+        InsertChild( buttonIndex, mDisabledSelectedContent );
+
+        if( mBackgroundContent )
+        {
+          backgroundIndex = 1;
+        }
+        else
+        {
+          backgroundIndex = 0;
+        }
+
+        InsertChild( backgroundIndex, mDisabledBackgroundContent );
+
+        animationStarted = OnDisabled();
+
+        if( animationStarted )
+        {
+          mPaintState = SelectedDisabledTransition;
+        }
+        else
+        {
+          mPaintState = DisabledSelectedState;
+        }
+        break;
+      }
+      case SelectedUnselectedTransition:
+      {
+        buttonIndex = FindChildIndex( mLabel );
+        InsertChild( buttonIndex, mDisabledContent );
+
+        if( mBackgroundContent )
+        {
+          backgroundIndex = 1;
+        }
+        else
+        {
+          backgroundIndex = 0;
+        }
+
+        InsertChild( backgroundIndex, mDisabledBackgroundContent );
+
+        animationStarted = OnDisabled();
+
+        if( animationStarted )
+        {
+          mPaintState = UnselectedDisabledTransition;
+        }
+        else
+        {
+          mPaintState = DisabledUnselectedState;
+        }
+        break;
+      }
+      case UnselectedDisabledTransition:
+      {
+        animationStarted = OnDisabled();
+
+        if( animationStarted )
+        {
+          mPaintState = DisabledUnselectedTransition;
+        }
+        else
+        {
+          mPaintState = UnselectedState;
+        }
+        break;
+      }
+      case DisabledUnselectedTransition:
+      {
+        animationStarted = OnDisabled();
+
+        if( animationStarted )
+        {
+          mPaintState = UnselectedDisabledTransition;
+        }
+        else
+        {
+          mPaintState = DisabledUnselectedState;
+        }
+        break;
+      }
+      case SelectedDisabledTransition:
+      {
+        animationStarted = OnDisabled();
+
+        if( animationStarted )
+        {
+          mPaintState = DisabledSelectedTransition;
+        }
+        else
+        {
+          mPaintState = SelectedState;
+        }
+        break;
+      }
+      case DisabledSelectedTransition:
+      {
+        animationStarted = OnDisabled();
+
+        if( animationStarted )
+        {
+          mPaintState = SelectedDisabledTransition;
+        }
+        else
+        {
+          mPaintState = DisabledSelectedState;
+        }
+        break;
+      }
+    }
   }
 }
 
@@ -124,11 +381,7 @@ void Button::SetAutoRepeating( bool autoRepeating )
     if( mSelected )
     {
       // Emit a signal is not wanted, only change the appearance.
-      OnSelected( false );
-
-      mSelected = false;
-
-      RelayoutRequest();
+      SetSelected( false, false );
     }
   }
 }
@@ -180,18 +433,169 @@ void Button::SetSelected( bool selected )
 {
   if( !mDisabled && mTogglableButton && ( selected != mSelected ) )
   {
-    // Notifies the derived class the button has been selected.
-    OnSelected( selected );
+    SetSelected( selected, true );
+  }
+}
 
-    mSelected = selected;
+void Button::SetSelected( bool selected, bool emitSignal )
+{
+  unsigned int buttonIndex, backgroundIndex;
+  bool animationStarted = false;
 
+  mSelected = selected;
+
+  switch( mPaintState )
+  {
+    case UnselectedState:
+    {
+      buttonIndex = FindChildIndex( mLabel );
+      InsertChild( buttonIndex, mSelectedContent );
+
+      if( mBackgroundContent )
+      {
+        backgroundIndex = 1;
+      }
+      else
+      {
+        backgroundIndex = 0;
+      }
+
+      InsertChild( backgroundIndex, mSelectedBackgroundContent );
+
+      // Notifies the derived class the button has been selected.
+      animationStarted = OnSelected();
+
+      if( animationStarted )
+      {
+        mPaintState = UnselectedSelectedTransition;
+      }
+      else
+      {
+        mPaintState = SelectedState;
+      }
+      break;
+    }
+    case SelectedState:
+    {
+      buttonIndex = FindChildIndex( mLabel );
+      InsertChild( buttonIndex, mButtonContent );
+
+      // Notifies the derived class the button has been selected.
+      animationStarted = OnSelected();
+
+      if( animationStarted )
+      {
+        mPaintState = SelectedUnselectedTransition;
+      }
+      else
+      {
+        mPaintState = UnselectedState;
+      }
+      break;
+    }
+    case UnselectedSelectedTransition:
+    {
+      // Notifies the derived class the button has been selected.
+      animationStarted = OnSelected();
+
+      if( animationStarted )
+      {
+        mPaintState = SelectedUnselectedTransition;
+      }
+      else
+      {
+        mPaintState = UnselectedState;
+      }
+      break;
+    }
+    case SelectedUnselectedTransition:
+    {
+      // Notifies the derived class the button has been selected.
+      animationStarted = OnSelected();
+
+      if( animationStarted )
+      {
+        mPaintState = UnselectedSelectedTransition;
+      }
+      else
+      {
+        mPaintState = SelectedState;
+      }
+      break;
+    }
+    case DisabledUnselectedTransition:
+    {
+      buttonIndex = FindChildIndex( mLabel );
+      InsertChild( buttonIndex, mSelectedContent );
+
+      if( mDisabledBackgroundContent )
+      {
+        if(  mBackgroundContent )
+        {
+          backgroundIndex = 2;
+        }
+        else
+        {
+          backgroundIndex = 1;
+        }
+      }
+      else if( mBackgroundContent )
+      {
+        backgroundIndex = 1;
+      }
+      else
+      {
+        backgroundIndex = 0;
+      }
+
+      InsertChild( backgroundIndex, mSelectedBackgroundContent );
+
+      // Notifies the derived class the button has been selected.
+      animationStarted = OnSelected();
+
+      if( animationStarted )
+      {
+        mPaintState = UnselectedSelectedTransition;
+      }
+      else
+      {
+        mPaintState = SelectedState;
+      }
+      break;
+    }
+    case DisabledSelectedTransition:
+    {
+      buttonIndex = FindChildIndex( mLabel );
+      InsertChild( buttonIndex, mButtonContent );
+
+      // Notifies the derived class the button has been selected.
+      animationStarted = OnSelected();
+
+      if( animationStarted )
+      {
+        mPaintState = SelectedUnselectedTransition;
+      }
+      else
+      {
+        mPaintState = UnselectedState;
+      }
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  if( emitSignal )
+  {
     Toolkit::Button handle( GetOwner() );
 
     // Emit signal.
     mStateChangedSignal.Emit( handle );
-
-    RelayoutRequest();
   }
+
+  RelayoutRequest();
 }
 
 bool Button::IsSelected() const
@@ -226,6 +630,10 @@ void Button::SetLabel( Actor label )
     }
 
     mLabel = label;
+    mLabel.SetPosition( 0.f, 0.f );
+
+    // label should be the top of the button
+    Self().Add( mLabel );
 
     OnLabelSet();
 
@@ -243,6 +651,31 @@ Actor& Button::GetLabel()
   return mLabel;
 }
 
+void Button::SetButtonImage( Actor image )
+{
+  StopAllAnimations();
+
+  if( mButtonContent && mButtonContent.GetParent() )
+  {
+    Self().Remove( mButtonContent );
+  }
+
+  mButtonContent = image;
+
+  mButtonContent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  mButtonContent.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  mButtonContent.SetPosition( 0.f, 0.f );
+
+  if( mPaintState == UnselectedState )
+  {
+    unsigned int index = FindChildIndex( mLabel );
+
+    Self().Insert( index, mButtonContent );
+  }
+
+  OnButtonImageSet();
+}
+
 Actor Button::GetButtonImage() const
 {
   return mButtonContent;
@@ -253,6 +686,31 @@ Actor& Button::GetButtonImage()
   return mButtonContent;
 }
 
+void Button::SetSelectedImage( Actor image )
+{
+  StopAllAnimations();
+
+  if( mSelectedContent && mSelectedContent.GetParent() )
+  {
+    Self().Remove( mSelectedContent );
+  }
+
+  mSelectedContent = image;
+
+  mSelectedContent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  mSelectedContent.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  mSelectedContent.SetPosition( 0.f, 0.f );
+
+  if( mPaintState == SelectedState )
+  {
+    unsigned int index = FindChildIndex( mLabel );
+
+    Self().Insert( index, mSelectedContent );
+  }
+
+  OnSelectedImageSet();
+}
+
 Actor Button::GetSelectedImage() const
 {
   return mSelectedContent;
@@ -263,6 +721,29 @@ Actor& Button::GetSelectedImage()
   return mSelectedContent;
 }
 
+void Button::SetBackgroundImage( Actor image )
+{
+  StopAllAnimations();
+
+  if( mBackgroundContent && mBackgroundContent.GetParent() )
+  {
+    Self().Remove( mBackgroundContent );
+  }
+
+  mBackgroundContent = image;
+
+  mBackgroundContent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  mBackgroundContent.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  mBackgroundContent.SetPosition( 0.f, 0.f );
+
+  if( mPaintState == UnselectedState || mPaintState == SelectedState )
+  {
+    Self().Insert( 0, mBackgroundContent );
+  }
+
+  OnBackgroundImageSet();
+}
+
 Actor Button::GetBackgroundImage() const
 {
   return mBackgroundContent;
@@ -273,6 +754,71 @@ Actor& Button::GetBackgroundImage()
   return mBackgroundContent;
 }
 
+void Button::SetSelectedBackgroundImage( Actor image )
+{
+  StopAllAnimations();
+
+  if( mSelectedBackgroundContent && mSelectedBackgroundContent.GetParent() )
+  {
+    Self().Remove( mSelectedBackgroundContent );
+  }
+
+  mSelectedBackgroundContent = image;
+
+  mSelectedBackgroundContent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  mSelectedBackgroundContent.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  mSelectedBackgroundContent.SetPosition( 0.f, 0.f );
+
+  if( mPaintState == SelectedState )
+  {
+    if( mBackgroundContent )
+    {
+      Self().Insert( 1, mSelectedBackgroundContent );
+    }
+    else
+    {
+      Self().Insert( 0, mSelectedBackgroundContent );
+    }
+  }
+
+  OnSelectedBackgroundImageSet();
+}
+
+Actor Button::GetSelectedBackgroundImage() const
+{
+  return mSelectedBackgroundContent;
+}
+
+Actor& Button::GetSelectedBackgroundImage()
+{
+  return mSelectedBackgroundContent;
+}
+
+void Button::SetDisabledImage( Actor image )
+{
+  StopAllAnimations();
+
+  if( mDisabledContent && mDisabledContent.GetParent() )
+  {
+    Self().Remove( mDisabledContent );
+  }
+
+  mDisabledContent = image;
+
+  mDisabledContent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  mDisabledContent.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  mDisabledContent.SetPosition( 0.f, 0.f );
+
+  if( mPaintState == DisabledUnselectedState || mPaintState == DisabledSelectedState )
+  {
+    unsigned int index = FindChildIndex( mLabel );
+
+    Self().Insert( index, mDisabledContent );
+  }
+
+  OnDisabledImageSet();
+}
+
 Actor Button::GetDisabledImage() const
 {
   return mDisabledContent;
@@ -283,6 +829,31 @@ Actor& Button::GetDisabledImage()
   return mDisabledContent;
 }
 
+void Button::SetDisabledSelectedImage( Actor image )
+{
+  StopAllAnimations();
+
+  if( mDisabledSelectedContent && mDisabledSelectedContent.GetParent() )
+  {
+    Self().Remove( mDisabledSelectedContent );
+  }
+
+  mDisabledSelectedContent = image;
+
+  mDisabledSelectedContent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  mDisabledSelectedContent.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  mDisabledSelectedContent.SetPosition( 0.f, 0.f );
+
+  if( mPaintState == DisabledSelectedState )
+  {
+    unsigned int index = FindChildIndex( mLabel );
+
+    Self().Insert( index, mDisabledSelectedContent );
+  }
+
+  OnDisabledSelectedImageSet();
+}
+
 Actor Button::GetDisabledSelectedImage() const
 {
   return mDisabledSelectedContent;
@@ -293,6 +864,29 @@ Actor& Button::GetDisabledSelectedImage()
   return mDisabledSelectedContent;
 }
 
+void Button::SetDisabledBackgroundImage( Actor image )
+{
+  StopAllAnimations();
+
+  if( mDisabledBackgroundContent && mDisabledBackgroundContent.GetParent() )
+  {
+    Self().Remove( mDisabledBackgroundContent );
+  }
+
+  mDisabledBackgroundContent = image;
+
+  mDisabledBackgroundContent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  mDisabledBackgroundContent.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  mDisabledBackgroundContent.SetPosition( 0.f, 0.f );
+
+  if( mPaintState == DisabledUnselectedState || mPaintState == DisabledSelectedState )
+  {
+    Self().Insert( 0, mDisabledBackgroundContent );
+  }
+
+  OnDisabledBackgroundImageSet();
+}
+
 Actor Button::GetDisabledBackgroundImage() const
 {
   return mDisabledBackgroundContent;
@@ -336,16 +930,66 @@ void Button::DoClickAction( const PropertyValueContainer& attributes )
   }
 }
 
+void Button::UpdatePaintTransitionState()
+{
+  switch( mPaintState )
+  {
+    case UnselectedSelectedTransition:
+    {
+      RemoveChild( mButtonContent );
+      mPaintState = SelectedState;
+      break;
+    }
+    case SelectedUnselectedTransition:
+    {
+      RemoveChild( mSelectedBackgroundContent );
+      RemoveChild( mSelectedContent );
+      mPaintState = UnselectedState;
+      break;
+    }
+    case UnselectedDisabledTransition:
+    {
+      RemoveChild( mBackgroundContent );
+      RemoveChild( mButtonContent );
+      mPaintState = DisabledUnselectedState;
+      break;
+    }
+    case DisabledUnselectedTransition:
+    {
+      RemoveChild( mDisabledBackgroundContent );
+      RemoveChild( mDisabledContent );
+      mPaintState = UnselectedState;
+      break;
+    }
+    case SelectedDisabledTransition:
+    {
+      RemoveChild( mBackgroundContent );
+      RemoveChild( mSelectedBackgroundContent );
+      RemoveChild( mSelectedContent );
+      mPaintState = DisabledSelectedState;
+      break;
+    }
+    case DisabledSelectedTransition:
+    {
+      RemoveChild( mDisabledBackgroundContent );
+      RemoveChild( mDisabledSelectedContent );
+      mPaintState = SelectedState;
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+}
+
 void Button::OnButtonStageDisconnection()
 {
   if( ButtonDown == mState )
   {
     if( !mTogglableButton )
     {
-      Toolkit::Button handle( GetOwner() );
-
-      // Notifies the derived class the button has been released.
-      OnReleased();
+      Released();
 
       if( mAutoRepeating )
       {
@@ -361,8 +1005,7 @@ void Button::OnButtonDown()
   {
     Toolkit::Button handle( GetOwner() );
 
-    // Notifies the derived class the button has been pressed.
-    OnPressed();
+    Pressed();
 
     if( mAutoRepeating )
     {
@@ -384,9 +1027,7 @@ void Button::OnButtonUp()
     }
     else
     {
-      // Notifies the derived class the button has been clicked.
-      OnReleased();
-      OnClicked();
+      Released();
 
       if( mAutoRepeating )
       {
@@ -410,8 +1051,7 @@ void Button::OnTouchPointLeave()
     {
       Toolkit::Button handle( GetOwner() );
 
-      // Notifies the derived class the button has been released.
-      OnReleased();
+      Released();
 
       if( mAutoRepeating )
       {
@@ -555,6 +1195,7 @@ void Button::OnInitialize()
 
   OnButtonInitialize();
 
+  self.SetDrawMode( DrawMode::OVERLAY );
   self.SetKeyboardFocusable( true );
 }
 
@@ -565,6 +1206,12 @@ void Button::OnActivated()
   DoClickAction( attributes );
 }
 
+void Button::OnControlStageDisconnection()
+{
+  OnButtonStageDisconnection(); // Notification for derived classes.
+  mState = ButtonUp;
+}
+
 void Button::OnTap(Actor actor, const TapGesture& tap)
 {
   // Do nothing.
@@ -585,10 +1232,9 @@ bool Button::AutoRepeatingSlot()
     // Restart the autorepeat timer.
     SetUpTimer( mNextAutoRepeatingDelay );
 
-    Toolkit::Button handle( GetOwner() );
+    Pressed();
 
-    // Notifies the derived class the button has been pressed.
-    OnPressed();
+    Toolkit::Button handle( GetOwner() );
 
     //Emit signal.
     consumed = mReleasedSignal.Emit( handle );
@@ -599,10 +1245,165 @@ bool Button::AutoRepeatingSlot()
   return consumed;
 }
 
-void Button::OnControlStageDisconnection()
+void Button::Pressed()
 {
-  OnButtonStageDisconnection(); // Notification for derived classes.
-  mState = ButtonUp;
+  unsigned int buttonIndex, backgroundIndex;
+  bool animationStarted = false;
+
+  switch( mPaintState )
+  {
+    case UnselectedState:
+    {
+      buttonIndex = FindChildIndex( mLabel );
+      InsertChild( buttonIndex, mSelectedContent );
+
+      if( mBackgroundContent )
+      {
+        backgroundIndex = 1;
+      }
+      else
+      {
+        backgroundIndex = 0;
+      }
+
+      InsertChild( backgroundIndex, mSelectedBackgroundContent );
+
+      // Notifies the derived class the button has been pressed.
+      animationStarted = OnPressed();
+
+      if( animationStarted )
+      {
+        mPaintState = UnselectedSelectedTransition;
+      }
+      else
+      {
+        mPaintState = SelectedState;
+      }
+      break;
+    }
+    case SelectedUnselectedTransition:
+    {
+      // Notifies the derived class the button has been pressed.
+      animationStarted = OnPressed();
+
+      if( animationStarted )
+      {
+        mPaintState = UnselectedSelectedTransition;
+      }
+      else
+      {
+        mPaintState = SelectedState;
+      }
+      break;
+    }
+    case DisabledUnselectedTransition:
+    {
+      buttonIndex = FindChildIndex( mLabel );
+      InsertChild( buttonIndex, mSelectedContent );
+
+      if( mDisabledBackgroundContent )
+      {
+        if(  mBackgroundContent )
+        {
+          backgroundIndex = 2;
+        }
+        else
+        {
+          backgroundIndex = 1;
+        }
+      }
+      else if( mBackgroundContent )
+      {
+        backgroundIndex = 1;
+      }
+      else
+      {
+        backgroundIndex = 0;
+      }
+
+      InsertChild( backgroundIndex, mSelectedBackgroundContent );
+
+      // Notifies the derived class the button has been pressed.
+      animationStarted = OnPressed();
+
+      if( animationStarted )
+      {
+        mPaintState = UnselectedSelectedTransition;
+      }
+      else
+      {
+        mPaintState = SelectedState;
+      }
+      break;
+    }
+    default:
+      break;
+  }
+}
+
+void Button::Released()
+{
+  unsigned int buttonIndex;
+  bool animationStarted = false;
+
+  switch( mPaintState )
+  {
+    case SelectedState:
+    {
+      buttonIndex = FindChildIndex( mLabel );
+      InsertChild( buttonIndex, mButtonContent );
+
+      // Notifies the derived class the button has been released.
+      animationStarted = OnReleased();
+
+      if( animationStarted )
+      {
+        mPaintState = SelectedUnselectedTransition;
+      }
+      else
+      {
+        mPaintState = UnselectedState;
+      }
+      break;
+    }
+    case UnselectedSelectedTransition:
+    {
+      // Notifies the derived class the button has been released.
+      animationStarted = OnReleased();
+
+      if( animationStarted )
+      {
+        mPaintState = SelectedUnselectedTransition;
+      }
+      else
+      {
+        mPaintState = UnselectedState;
+      }
+      break;
+    }
+    case DisabledSelectedTransition:
+    {
+      buttonIndex = FindChildIndex( mLabel );
+      InsertChild( buttonIndex, mButtonContent );
+
+      // Notifies the derived class the button has been released.
+      animationStarted = OnReleased();
+
+      if( animationStarted )
+      {
+        mPaintState = SelectedUnselectedTransition;
+      }
+      else
+      {
+        mPaintState = UnselectedState;
+      }
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
 }
 
 Button::ButtonState Button::GetState()
@@ -610,6 +1411,44 @@ Button::ButtonState Button::GetState()
   return mState;
 }
 
+Button::PaintState Button::GetPaintState()
+{
+  return mPaintState;
+}
+
+void Button::InsertChild( unsigned int index, Actor& actor )
+{
+  if( actor )
+  {
+    Self().Insert( index, actor);
+  }
+}
+
+void Button::RemoveChild( Actor& actor )
+{
+  if( actor && actor.GetParent() )
+  {
+    Self().Remove( actor );
+  }
+}
+
+unsigned int Button::FindChildIndex( Actor& actor )
+{
+  Actor self = Self();
+  unsigned int childrenNum = self.GetChildCount();
+
+  for( unsigned int i = 0; i < childrenNum; i++ )
+  {
+    Actor child = self.GetChildAt( i );
+    if( child == actor )
+    {
+      return i;
+    }
+  }
+
+  return childrenNum;
+}
+
 void Button::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
 {
   Toolkit::Button button = Toolkit::Button::DownCast( Dali::BaseHandle( object ) );
index f9dee5a..5197aca 100644 (file)
@@ -142,6 +142,11 @@ public:
   Actor GetLabel() const;
 
   /**
+   * @copydoc Dali::Toolkit::PushButton::SetButtonImage( Actor image )
+   */
+  void SetButtonImage( Actor image );
+
+  /**
    * @copydoc Dali::Toolkit::PushButton::GetButtonImage()
    */
   Actor GetButtonImage() const;
@@ -153,6 +158,11 @@ public:
   Actor& GetButtonImage();
 
   /**
+   * @copydoc Dali::Toolkit::PushButton::SetSelectedImage( Actor image )
+   */
+  void SetSelectedImage( Actor image );
+
+  /**
    * @copydoc Dali::Toolkit::PushButton::GetSelectedImage()
    */
   Actor GetSelectedImage() const;
@@ -164,6 +174,11 @@ public:
   Actor& GetSelectedImage();
 
   /**
+   * @copydoc Dali::Toolkit::PushButton::SetBackgroundImage( Actor image )
+   */
+  void SetBackgroundImage( Actor image );
+
+  /**
    * @copydoc Dali::Toolkit::PushButton::GetBackgroundImage()
    */
   Actor GetBackgroundImage() const;
@@ -175,6 +190,27 @@ public:
   Actor& GetBackgroundImage();
 
   /**
+   * @copydoc Dali::Toolkit::PushButton::SetSelectedBackgroundImage( Actor image )
+   */
+  void SetSelectedBackgroundImage( Actor image );
+
+  /**
+   * @copydoc Dali::Toolkit::PushButton::GetSelectedBackgroundImage()
+   */
+  Actor GetSelectedBackgroundImage() const;
+
+  /**
+   * Internal use only.
+   * @return A reference to the selected background image.
+   */
+  Actor& GetSelectedBackgroundImage();
+
+  /**
+   * @copydoc Dali::Toolkit::PushButton::SetDisabledImage( Actor image )
+   */
+  void SetDisabledImage( Actor image );
+
+  /**
    * @copydoc Dali::Toolkit::PushButton::GetDisabledImage()
    */
   Actor GetDisabledImage() const;
@@ -186,6 +222,11 @@ public:
   Actor& GetDisabledImage();
 
   /**
+   * @copydoc Dali::Toolkit::CheckBoxButton::SetDisabledSelectedImage( Actor image )
+   */
+  void SetDisabledSelectedImage( Actor image );
+
+  /**
    * @copydoc Dali::Toolkit::CheckBoxButton::GetDisabledSelectedImage()
    */
   Actor GetDisabledSelectedImage() const;
@@ -197,6 +238,11 @@ public:
   Actor& GetDisabledSelectedImage();
 
   /**
+   * @copydoc Dali::Toolkit::PushButton::SetDisabledBackgroundImage( Actor image )
+   */
+  void SetDisabledBackgroundImage( Actor image );
+
+  /**
    * @copydoc Dali::Toolkit::PushButton::GetDisabledBackgroundImage()
    */
   Actor GetDisabledBackgroundImage() const;
@@ -216,57 +262,71 @@ public:
    */
   static bool DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes );
 
+protected:
+
   /**
-   * @copydoc Dali::Toolkit::PushButton::SetButtonImage( Actor image )
+   * @return A reference to the label actor.
    */
-  virtual void SetButtonImage( Actor image ) {}
+  Actor& GetLabel();
 
   /**
-   * @copydoc Dali::Toolkit::PushButton::SetSelectedImage( Actor image )
+   * It changes the transition state of the push button.
    */
-  virtual void SetSelectedImage( Actor image ) {}
+  void UpdatePaintTransitionState();
+
+private:
 
   /**
-   * @copydoc Dali::Toolkit::PushButton::SetBackgroundImage( Actor image )
+   * Perform the click action to click the button.
+   * @param[in] attributes The attributes to perfrom this action.
    */
-  virtual void SetBackgroundImage( Actor image ) {}
+  void DoClickAction( const PropertyValueContainer& attributes );
 
   /**
-   * @copydoc Dali::Toolkit::PushButton::SetDisabledImage( Actor image )
+   * This method is called after the button initialization.
+   * Could be reimplemented in subclasses to provide specific behaviour.
    */
-  virtual void SetDisabledImage( Actor image ) {}
+  virtual void OnButtonInitialize() { }
 
   /**
-   * @copydoc Dali::Toolkit::CheckBoxButton::SetDisabledSelectedImage( Actor image )
+   * This method is called when the label is set.
    */
-  virtual void SetDisabledSelectedImage( Actor image ) {}
+  virtual void OnLabelSet() {}
 
   /**
-   * @copydoc Dali::Toolkit::PushButton::SetDisabledBackgroundImage( Actor image )
+   * This method is called when the button image is set
    */
-  virtual void SetDisabledBackgroundImage( Actor image ) {}
+  virtual void OnButtonImageSet() {}
 
-protected:
+  /**
+   * This method is called when the selected image is set
+   */
+  virtual void OnSelectedImageSet() {}
 
   /**
-   * Internal use only.
-   * @return A reference to the label actor.
+   * This method is called when the background image is set
    */
-  Actor& GetLabel();
+  virtual void OnBackgroundImageSet() {}
 
-private:
+  /**
+   * This method is called when the selected background image is set
+   */
+  virtual void OnSelectedBackgroundImageSet() {}
 
   /**
-   * Perform the click action to click the button.
-   * @param[in] attributes The attributes to perfrom this action.
+   * This method is called when the disabled button image is set
    */
-  void DoClickAction( const PropertyValueContainer& attributes );
+  virtual void OnDisabledImageSet() {}
 
   /**
-   * This method is called after the button initialization.
-   * Could be reimplemented in subclasses to provide specific behaviour.
+   * This method is called when the disabled selected image is set
    */
-  virtual void OnButtonInitialize() { }
+  virtual void OnDisabledSelectedImageSet() {}
+
+  /**
+   * This method is called when the disabled background image is set
+   */
+  virtual void OnDisabledBackgroundImageSet() {}
 
   /**
    * This method is called from the OnTouchEvent method when the button is down.
@@ -300,34 +360,33 @@ private:
   virtual void OnButtonStageDisconnection();
 
   /**
-   * This method is called when the label is set.
-   */
-  virtual void OnLabelSet() {}
-
-  /**
    * This method is called when the \e selected property is changed.
+   * @return true if the transition animation is started.
    */
-  virtual void OnSelected( bool selected ) {}
+  virtual bool OnSelected() { return false; }
 
   /**
    * This method is called when the \e disabled property is changed.
+   * @return true if the transition animation is started.
    */
-  virtual void OnDisabled( bool disabled ) {}
+  virtual bool OnDisabled() { return false; }
 
   /**
    * This method is called when the button is pressed.
+   * @return true if the transition animation is started.
    */
-  virtual void OnPressed() {}
+  virtual bool OnPressed() { return false; }
 
   /**
    * This method is called when the button is released.
+   * @return true if the transition animation is started.
    */
-  virtual void OnReleased() {}
+  virtual bool OnReleased() { return false; }
 
   /**
-   * This method is called when the button is clicked
+   * This method stops all animations
    */
-  virtual void OnClicked() {}
+  virtual void StopAllAnimations() {}
 
 public:
 
@@ -428,6 +487,23 @@ private:
    */
   bool AutoRepeatingSlot();
 
+  /**
+   * Sets the button as selected or unselected.
+   * @param[in] selected \e selected property value.
+   * @param[in] emitSignal Emit a signal if this value is \e true.
+   */
+  void SetSelected( bool selected, bool emitSignal );
+
+  /**
+   * This method is called when the button is pressed.
+   */
+  void Pressed();
+
+  /**
+   * This method is called when the button is released.
+   */
+  void Released();
+
 protected:
 
   enum ButtonState
@@ -446,7 +522,7 @@ protected:
     DisabledUnselectedState,      ///< The button is disabled and unselected.
     DisabledSelectedState,        ///< The button is disabled and selected.
     UnselectedSelectedTransition, ///< The button is in transition from unselected to selected.
-    SelectedUnselectedTransition, ///< The push button is in transition from selected to unselected.
+    SelectedUnselectedTransition, ///< The button is in transition from selected to unselected.
     UnselectedDisabledTransition, ///< The button is in transition from unselected to disabled.
     DisabledUnselectedTransition, ///< The button is in transition from disabled to unselected.
     SelectedDisabledTransition,   ///< The button is in transition from selected to disabled.
@@ -454,6 +530,23 @@ protected:
   };
 
   ButtonState GetState();
+  PaintState GetPaintState();
+
+  /**
+   * Inserts the actor to the button.
+   */
+  void InsertChild( unsigned int index, Actor& actor );
+
+  /**
+   * Removes the actor from the button.
+   */
+  void RemoveChild( Actor& actor );
+
+  /**
+   * Finds the index of the actor.
+   * If the actor doesn't exist, return the last index + 1.
+   */
+  unsigned int FindChildIndex( Actor& actor );
 
 private:
 
@@ -478,6 +571,7 @@ private:
   Actor mButtonContent;                        ///< Stores the unselected content.
   Actor mSelectedContent;                      ///< Stores the selected content.
   Actor mBackgroundContent;                    ///< Stores the background content.
+  Actor mSelectedBackgroundContent;            ///< Stores the selected background content.
   Actor mDisabledContent;                      ///< Stores the disabled content.
   Actor mDisabledSelectedContent;              ///< Stores the disabled selected content.
   Actor mDisabledBackgroundContent;            ///< Stores the disabled background content.
@@ -496,6 +590,7 @@ private:
   bool             mClickActionPerforming;
 
   ButtonState      mState;                     ///< Stores the button state.
+  PaintState       mPaintState;                ///< Stores the paint state.
 };
 
 } // namespace Internal
index 656781f..cc90db8 100644 (file)
@@ -34,13 +34,9 @@ namespace Internal
 namespace
 {
 
-const float FOREGROUND_DEPTH( 0.5f );
-const float BACKGROUND_DEPTH( 0.25f );
-
+const float DISTANCE_BETWEEN_IMAGE_AND_LABEL( 5.0f );
 const float ANIMATION_TIME( 0.26f );  // EFL checkbox tick time
 
-const Vector3 DISTANCE_BETWEEN_IMAGE_AND_LABEL(5.0f, 0.0f, 0.0f);
-
 BaseHandle Create()
 {
   return Toolkit::CheckBoxButton::New();
@@ -66,8 +62,7 @@ Dali::Toolkit::CheckBoxButton CheckBoxButton::New()
 }
 
 CheckBoxButton::CheckBoxButton()
-: Button(),
-  mPaintState( UnselectedState )
+: Button()
 {
   SetTogglableButton( true );
 
@@ -76,156 +71,16 @@ CheckBoxButton::CheckBoxButton()
 
 CheckBoxButton::~CheckBoxButton()
 {
-  if( mCheckInAnimation )
-  {
-    mCheckInAnimation.Clear();
-  }
-}
-
-void CheckBoxButton::SetSelectedImage( Actor image )
-{
-  Actor& selectedImage = GetSelectedImage();
-
-  switch( mPaintState )
+  if( mTransitionAnimation )
   {
-    case SelectedState:
-    {
-      if( selectedImage && selectedImage.GetParent() )
-      {
-        Self().Remove( selectedImage );
-      }
-
-      selectedImage = image;
-      Self().Add( selectedImage );
-      break;
-    }
-    case UnselectedSelectedTransition:
-    {
-      StopCheckInAnimation();
-      Self().Remove( selectedImage );
-
-      selectedImage = image;
-      Self().Add( selectedImage );
-
-      mPaintState = SelectedState;
-      break;
-    }
-    default:
-    {
-      selectedImage = image;
-      break;
-    }
+    mTransitionAnimation.Clear();
   }
-
-  selectedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  selectedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  selectedImage.SetZ( FOREGROUND_DEPTH );
 }
 
-void CheckBoxButton::SetBackgroundImage( Actor image )
+void CheckBoxButton::OnButtonInitialize()
 {
-  Actor& backgroundImage = GetBackgroundImage();
-
-  switch( mPaintState )
-  {
-    case UnselectedState:             // FALLTHROUGH
-    case SelectedState:
-    case UnselectedSelectedTransition:
-    {
-      if( backgroundImage && backgroundImage.GetParent() )
-      {
-        Self().Remove( backgroundImage );
-
-        Actor& label = GetLabel();
-
-        if( label )
-        {
-          backgroundImage.Remove( label );
-          image.Add( label );
-        }
-      }
-
-      backgroundImage = image;
-      Self().Add( backgroundImage );
-      break;
-    }
-    default:
-    {
-      backgroundImage = image;
-      break;
-    }
-  }
-
-  backgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  backgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  backgroundImage.SetZ( BACKGROUND_DEPTH );
-}
-
-void CheckBoxButton::SetDisabledSelectedImage( Actor image )
-{
-  Actor& disabledSelectedImage = GetDisabledSelectedImage();
-
-  switch( mPaintState )
-  {
-    case DisabledSelectedState:
-    {
-      if( disabledSelectedImage && disabledSelectedImage.GetParent() )
-      {
-        Self().Remove( disabledSelectedImage );
-      }
-
-      disabledSelectedImage = image;
-      Self().Add( disabledSelectedImage );
-      break;
-    }
-    default:
-    {
-      disabledSelectedImage = image;
-      break;
-    }
-  }
-
-  disabledSelectedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  disabledSelectedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  disabledSelectedImage.SetZ( FOREGROUND_DEPTH );
-}
-
-void CheckBoxButton::SetDisabledBackgroundImage( Actor image )
-{
-  Actor& disabledBackgroundImage = GetDisabledBackgroundImage();
-
-  switch( mPaintState )
-  {
-    case DisabledSelectedState:
-    case DisabledUnselectedState:
-    {
-      if( disabledBackgroundImage && disabledBackgroundImage.GetParent() )
-      {
-        Self().Remove( disabledBackgroundImage );
-
-        Actor& label = GetLabel();
-
-        if( label )
-        {
-          disabledBackgroundImage.Remove( label );
-          image.Add( label );
-        }
-      }
-
-      disabledBackgroundImage = image;
-      Self().Add( disabledBackgroundImage );
-      break;
-    }
-    default:
-    {
-      disabledBackgroundImage = image;
-      break;
-    }
-  }
-
-  disabledBackgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  disabledBackgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  disabledBackgroundImage.SetZ( BACKGROUND_DEPTH );
+  // Wrap around all children
+  Self().SetResizePolicy( FIT_TO_CHILDREN, ALL_DIMENSIONS );
 }
 
 void CheckBoxButton::OnLabelSet()
@@ -234,203 +89,141 @@ void CheckBoxButton::OnLabelSet()
 
   if( label )
   {
-    label.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
+    label.SetParentOrigin( ParentOrigin::CENTER_LEFT );
     label.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
-    label.TranslateBy( DISTANCE_BETWEEN_IMAGE_AND_LABEL );
 
     if( IsDisabled() && GetDisabledBackgroundImage() )
     {
-      GetDisabledBackgroundImage().Add( label );
+      label.SetX( GetDisabledBackgroundImage().GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
     }
     else if ( GetBackgroundImage() )
     {
-      GetBackgroundImage().Add( label );
+      label.SetX( GetBackgroundImage().GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
     }
     else
     {
-      Self().Add( label );
+      label.SetX( DISTANCE_BETWEEN_IMAGE_AND_LABEL );
     }
   }
 }
 
-void CheckBoxButton::OnSelected( bool selected )
+bool CheckBoxButton::OnSelected()
 {
   Actor& selectedImage = GetSelectedImage();
 
-  switch( mPaintState )
+  PaintState paintState = GetPaintState();
+
+  switch( paintState )
   {
     case UnselectedState:
     {
-      AddChild( selectedImage );
-      StartCheckInAnimation( selectedImage );    // Animate in the check actor
-
-      mPaintState = UnselectedSelectedTransition;
+      StartTransitionAnimation( selectedImage );
       break;
     }
     case SelectedState:
     {
       RemoveChild( selectedImage );
-
-      mPaintState = UnselectedState;
       break;
     }
     case UnselectedSelectedTransition:
     {
-      StopCheckInAnimation();
+      StopTransitionAnimation( false );
       RemoveChild( selectedImage );
-
-      mPaintState = UnselectedState;
       break;
     }
     default:
+    {
       break;
+    }
   }
+
+  if( mTransitionAnimation )
+  {
+    return true;
+  }
+
+  return false;
 }
 
-void CheckBoxButton::OnDisabled( bool disabled )
+bool CheckBoxButton::OnDisabled()
 {
   Actor& backgroundImage = GetBackgroundImage();
   Actor& selectedImage = GetSelectedImage();
   Actor& disabledBackgroundImage = GetDisabledBackgroundImage();
   Actor& disabledSelectedImage = GetDisabledSelectedImage();
 
-  switch( mPaintState )
+  PaintState paintState = GetPaintState();
+
+  switch( paintState )
   {
     case UnselectedState:
     {
-      if( disabled )
-      {
-        RemoveChild( backgroundImage );
-        AddChild( disabledBackgroundImage );
-        mPaintState = DisabledUnselectedState;
-      }
+      RemoveChild( backgroundImage );
       break;
     }
     case SelectedState:
     {
-      if( disabled )
-      {
-        RemoveChild( backgroundImage );
-        RemoveChild( selectedImage );
-        AddChild( disabledBackgroundImage );
-        AddChild( disabledSelectedImage );
-
-        mPaintState = DisabledSelectedState;
-      }
+      RemoveChild( backgroundImage );
+      RemoveChild( selectedImage );
       break;
     }
     case DisabledUnselectedState:
     {
-      if( !disabled )
-      {
-        RemoveChild( disabledBackgroundImage );
-        AddChild( backgroundImage );
-
-        mPaintState = UnselectedState;
-      }
+      RemoveChild( disabledBackgroundImage );
       break;
     }
     case DisabledSelectedState:
     {
-      if( !disabled )
-      {
-        RemoveChild( disabledBackgroundImage );
-        RemoveChild( disabledSelectedImage );
-        AddChild( backgroundImage );
-        AddChild( selectedImage );
-
-        mPaintState = SelectedState;
-      }
+      RemoveChild( disabledBackgroundImage );
+      RemoveChild( disabledSelectedImage );
       break;
     }
     case UnselectedSelectedTransition:
     {
-      if( disabled )
-      {
-        StopCheckInAnimation();
-
-        RemoveChild( backgroundImage );
-        RemoveChild( selectedImage );
-        AddChild( disabledBackgroundImage );
-        AddChild( disabledSelectedImage );
+      StopTransitionAnimation();
 
-        mPaintState = DisabledSelectedState;
-      }
+      RemoveChild( backgroundImage );
+      RemoveChild( selectedImage );
       break;
     }
     default:
+    {
       break;
+    }
   }
 
   Actor& label = GetLabel();
 
   if( label )
   {
-    if( label.GetParent() )
+    if( IsDisabled() && disabledBackgroundImage)
     {
-      label.GetParent().Remove( label );
+      label.SetX( disabledBackgroundImage.GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
     }
-
-    if( disabled && disabledBackgroundImage)
+    else if( backgroundImage )
     {
-      disabledBackgroundImage.Add( label );
+      label.SetX( backgroundImage.GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
     }
-    else if( backgroundImage )
+    else
     {
-      backgroundImage.Add( label );
+      label.SetX( DISTANCE_BETWEEN_IMAGE_AND_LABEL );
     }
   }
-}
 
-void CheckBoxButton::OnRelayout( const Vector2& size, ActorSizeContainer& container )
-{
-  Vector3 newSize;
-
-  if( IsDisabled() && GetDisabledBackgroundImage() )
+  if( mTransitionAnimation )
   {
-    newSize = GetDisabledBackgroundImage().GetNaturalSize();
+    return true;
   }
-  else if( GetBackgroundImage() )
-  {
-    newSize = GetBackgroundImage().GetNaturalSize();
-  }
-
-  Actor& label = GetLabel();
-
-  if( label )
-  {
-    // Offset the label from the radio button image
-    newSize.width += DISTANCE_BETWEEN_IMAGE_AND_LABEL.width;
 
-    // Find the size of the control using size negotiation
-    Vector3 actorNaturalSize( label.GetNaturalSize() );
-    Control::Relayout( label, Vector2( actorNaturalSize.width, actorNaturalSize.height ), container );
-
-    Vector3 actorSize( label.GetSize() );
-    newSize.width += actorSize.width;
-    newSize.height = std::max( newSize.height, actorSize.height );
-  }
-
-  Self().SetSize( newSize );
+  return false;
 }
 
-void CheckBoxButton::AddChild( Actor& actor )
+void CheckBoxButton::StopAllAnimations()
 {
-  if( actor )
-  {
-    Self().Add( actor);
-  }
+  StopTransitionAnimation();
 }
 
-void CheckBoxButton::RemoveChild( Actor& actor )
-{
-  if( actor )
-  {
-    Self().Remove( actor );
-  }
-}
-
-void CheckBoxButton::StartCheckInAnimation( Actor& actor )
+void CheckBoxButton::StartTransitionAnimation( Actor& actor )
 {
   if( actor )
   {
@@ -445,47 +238,39 @@ void CheckBoxButton::StartCheckInAnimation( Actor& actor )
 
     mTickUVEffect.SetBottomRight( Vector2( 0.0f, 1.0f ) );
 
-    if( !mCheckInAnimation )
+    if( !mTransitionAnimation )
     {
-      mCheckInAnimation = Dali::Animation::New( GetAnimationTime()  );
+      mTransitionAnimation = Dali::Animation::New( GetAnimationTime()  );
     }
 
     // UV anim
-    mCheckInAnimation.AnimateTo( Property( mTickUVEffect, mTickUVEffect.GetBottomRightPropertyName() ), Vector2( 1.0f, 1.0f ) );
+    mTransitionAnimation.AnimateTo( Property( mTickUVEffect, mTickUVEffect.GetBottomRightPropertyName() ), Vector2( 1.0f, 1.0f ) );
 
     // Actor size anim
-    mCheckInAnimation.AnimateTo( Property( actor, Actor::Property::SCALE_X ), 1.0f );
+    mTransitionAnimation.AnimateTo( Property( actor, Actor::Property::SCALE_X ), 1.0f );
 
-    mCheckInAnimation.FinishedSignal().Connect( this, &CheckBoxButton::CheckInAnimationFinished );
-    mCheckInAnimation.Play();
+    mTransitionAnimation.FinishedSignal().Connect( this, &CheckBoxButton::TransitionAnimationFinished );
+    mTransitionAnimation.Play();
   }
 }
 
-void CheckBoxButton::StopCheckInAnimation()
+void CheckBoxButton::StopTransitionAnimation( bool remove )
 {
-  if( mCheckInAnimation )
+  if( mTransitionAnimation )
   {
-    mCheckInAnimation.Clear();
-    mCheckInAnimation.Reset();
+    mTransitionAnimation.Clear();
+    mTransitionAnimation.Reset();
   }
-}
 
-void CheckBoxButton::CheckInAnimationFinished( Dali::Animation& source )
-{
-  switch( mPaintState )
+  if( remove )
   {
-    case UnselectedSelectedTransition:
-    {
-      mPaintState = SelectedState;
-      break;
-    }
-    default:
-    {
-      break;
-    }
+    UpdatePaintTransitionState();
   }
+}
 
-  StopCheckInAnimation();
+void CheckBoxButton::TransitionAnimationFinished( Dali::Animation& source )
+{
+  StopTransitionAnimation();
 }
 
 } // namespace Internal
index 9d4335a..7f55610 100644 (file)
@@ -52,29 +52,25 @@ public:
    */
   static Dali::Toolkit::CheckBoxButton New();
 
-public: // From Button
+private:
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetSelectedImage( Actor image )
+   * Construct a new CheckBoxButton.
    */
-  virtual void SetSelectedImage( Actor image );
+  CheckBoxButton();
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetBackgroundImage( Actor image )
+   * A reference counted object may only be deleted by calling Unreference()
    */
-  virtual void SetBackgroundImage( Actor image );
+  virtual ~CheckBoxButton();
+
+private: // From Button
 
-  /**
-   * @copydoc Toolkit::Internal::Button::SetDisabledSelectedImage( Actor image )
-   */
-  virtual void SetDisabledSelectedImage( Actor image );
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetDisabledBackgroundImage( Actor image )
+   * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
    */
-  virtual void SetDisabledBackgroundImage( Actor image );
-
-private: // From Button
+  virtual void OnButtonInitialize();
 
   /**
    * @copydoc Toolkit::Internal::Button::OnLabelSet()
@@ -84,63 +80,39 @@ private: // From Button
   /**
    * @copydoc Toolkit::Internal::Button::OnSelected()
    */
-  virtual void OnSelected( bool selected );
+  virtual bool OnSelected();
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnDisabled( bool disabled )
+   * @copydoc Toolkit::Internal::Button::OnDisabled()
    */
-  virtual void OnDisabled( bool disabled );
-
-private: // From Control
+  virtual bool OnDisabled();
 
   /**
-   * @copydoc Dali::Toolkit::Control::OnRelayout()
+   * @copydoc Toolkit::Internal::Button::StopAllAnimations()
    */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
+  virtual void StopAllAnimations();
 
 private:
 
   /**
-   * Construct a new CheckBoxButton.
-   */
-  CheckBoxButton();
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~CheckBoxButton();
-
-private:
-
-  /**
-   * Adds the actor to the button.
-   */
-  void AddChild( Actor& actor );
-
-  /**
-   * Removes the actor from the button.
-   */
-  void RemoveChild( Actor& actor );
-
-  /**
-   * Adds the actor to the check in animation.
-   * It creates a check in animation if needed and starts the check in animation.
+   * Adds the actor to the transition animation.
+   * It creates a transition animation if needed and starts the animation.
    * @param[in] actor The actor.
    */
-  void StartCheckInAnimation( Actor& actor );
+  void StartTransitionAnimation( Actor& actor );
 
   /**
-   * Stops the check in animation.
+   * Stops the transition animation.
+   * @param[in] remove If true, removes the fadeout actor from root.
    */
-  void StopCheckInAnimation();
+  void StopTransitionAnimation( bool remove = true );
 
   // slots
 
   /**
-   * Called when the check in animation finishes.
-   * It changes the check button paint state.
+   * Called when the transition animation finishes.
    */
-  void CheckInAnimationFinished( Dali::Animation& source );
+  void TransitionAnimationFinished( Dali::Animation& source );
 
 private:
 
@@ -151,10 +123,8 @@ private:
   CheckBoxButton& operator=( const CheckBoxButton& );
 
 private:
-  Animation                 mCheckInAnimation;  ///< Animation used in the state transitions.
-  ImageRegionEffect         mTickUVEffect;      ///< ImageRegionEffect to expand the tick across
-
-  PaintState                mPaintState;        ///< The paint state.
+  Animation                 mTransitionAnimation;  ///< Animation used in the state transitions.
+  ImageRegionEffect         mTickUVEffect;         ///< ImageRegionEffect to expand the tick across
 };
 
 } // namespace Internal
index 4aae15b..a2cb95d 100644 (file)
@@ -24,7 +24,6 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/text-view/text-view.h>
-#include <dali-toolkit/internal/controls/relayout-helper.h>
 
 namespace Dali
 {
@@ -39,11 +38,6 @@ namespace
 {
 
 const float TEXT_PADDING = 12.0f;
-
-const float LABEL_DEPTH( 0.75f );
-const float FOREGROUND_DEPTH( 0.5f );
-const float BACKGROUND_DEPTH( 0.25f );
-
 const float ANIMATION_TIME( 0.2f );
 
 BaseHandle Create()
@@ -98,8 +92,7 @@ Dali::Toolkit::PushButton PushButton::New()
 
 PushButton::PushButton()
 : Button(),
-  mSize(),
-  mPaintState( UnselectedState )
+  mSize()
 {
   SetAnimationTime( ANIMATION_TIME );
 }
@@ -108,477 +101,162 @@ PushButton::~PushButton()
 {
 }
 
-void PushButton::SetButtonImage( Actor image )
+void PushButton::OnButtonInitialize()
 {
-  Actor& buttonImage = GetButtonImage();
-  Actor& fadeOutButtonImage = GetFadeOutButtonImage();
-
-  switch( mPaintState )
-  {
-    case UnselectedState:
-    {
-      if( buttonImage && buttonImage.GetParent() )
-      {
-        StopFadeOutAnimation();
-        FadeOutImage( Foreground, buttonImage );
-
-        buttonImage = image;
-
-        FadeInImage( buttonImage );
-
-        StartFadeOutAnimation();
-        StartFadeInAnimation();
-      }
-      else
-      {
-        buttonImage = image;
-        Self().Add( buttonImage );
-      }
-      break;
-    }
-    case UnselectedSelectedTransition: // FALLTHROUGH
-    case UnselectedDisabledTransition:
-    {
-      float opacity = 1.f;
-      if( fadeOutButtonImage )
-      {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
-      }
-      StopFadeOutAnimation();
-
-      // Replaces the button image.
-      buttonImage = image;
-
-      Self().Add( buttonImage );
-      FadeOutImage( Foreground, buttonImage, opacity );
-
-      StartFadeOutAnimation();
-      break;
-    }
-    case SelectedUnselectedTransition: // FALLTHROUGH
-    case DisabledUnselectedTransition:
-    {
-      StopFadeInAnimation();
-      Self().Remove( buttonImage );
-
-      buttonImage = image;
-
-      FadeInImage( buttonImage );
-      StartFadeInAnimation();
-      break;
-    }
-    default:
-      buttonImage = image;
-      break;
-  }
+  // Push button requires the Leave event.
+  Actor self = Self();
+  self.SetLeaveRequired( true );
 
-  buttonImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  buttonImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  buttonImage.SetPosition( 0.f, 0.f, FOREGROUND_DEPTH );
-  buttonImage.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  // Set resize policy to natural size so that buttons will resize to background images
+  self.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
 }
 
-void PushButton::SetSelectedImage( Actor image )
+void PushButton::OnLabelSet()
 {
-  Actor& selectedImage = GetSelectedImage();
-  Actor& fadeOutButtonImage = GetFadeOutButtonImage();
+  Actor& label = GetLabel();
 
-  switch( mPaintState )
+  if( label )
   {
-    case SelectedState:
-    {
-      if( selectedImage && selectedImage.GetParent() )
-      {
-        StopFadeOutAnimation();
-        FadeOutImage( Foreground, selectedImage  );
-
-        selectedImage = image;
-
-        FadeInImage( selectedImage );
-
-        StartFadeOutAnimation();
-        StartFadeInAnimation();
-      }
-      else
-      {
-        selectedImage = image;
-        Self().Add( selectedImage );
-      }
-      break;
-    }
-    case SelectedUnselectedTransition: // FALLTHROUGH
-    case SelectedDisabledTransition:
-    {
-      float opacity = 1.f;
-      if( fadeOutButtonImage )
-      {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
-      }
-      StopFadeOutAnimation();
-
-      // Replaces the button image.
-      selectedImage = image;
-
-      Self().Add( selectedImage );
-      FadeOutImage( Foreground, selectedImage, opacity );
-
-      StartFadeOutAnimation();
-      break;
-    }
-    case UnselectedSelectedTransition: // FALLTHROUGH
-    case DisabledSelectedTransition:
-    {
-      StopFadeInAnimation();
-      Self().Remove( selectedImage );
-
-      selectedImage = image;
-
-      FadeInImage( selectedImage );
-      StartFadeInAnimation();
-      break;
-    }
-    default:
-      selectedImage = image;
-      break;
+    label.SetAnchorPoint( AnchorPoint::CENTER );
+    label.SetParentOrigin( ParentOrigin::CENTER );
+    label.SetSize( mSize );
   }
-
-  selectedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  selectedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  selectedImage.SetPosition( 0.f, 0.f, FOREGROUND_DEPTH );
-  selectedImage.SetSizeMode( SIZE_EQUAL_TO_PARENT );
 }
 
-void PushButton::SetBackgroundImage( Actor image )
+void PushButton::OnButtonImageSet()
 {
-  Actor& backgroundImage = GetBackgroundImage();
-  Actor& fadeOutBackgroundImage = GetFadeOutBackgroundImage();
-
-  switch( mPaintState )
-  {
-    case UnselectedState:             // FALLTHROUGH
-    case SelectedState:
-    case UnselectedSelectedTransition:
-    case SelectedUnselectedTransition:
-    {
-      if( backgroundImage && backgroundImage.GetParent() )
-      {
-        StopFadeOutAnimation();
-        FadeOutImage( Background, backgroundImage  );
-
-        backgroundImage = image;
-
-        FadeInImage( backgroundImage );
-
-        StartFadeOutAnimation();
-        StartFadeInAnimation();
-      }
-      else
-      {
-        backgroundImage = image;
-        Self().Add( backgroundImage );
-      }
-      break;
-    }
-    case UnselectedDisabledTransition: // FALLTHROUGH
-    case SelectedDisabledTransition:
-    {
-      float opacity = 1.f;
-      if( fadeOutBackgroundImage )
-      {
-        opacity = fadeOutBackgroundImage.GetCurrentOpacity();
-      }
-      StopFadeOutAnimation();
-
-      // Replaces the button image.
-      backgroundImage = image;
-
-      Self().Add( backgroundImage );
-      FadeOutImage( Background, backgroundImage, opacity );
-
-      StartFadeOutAnimation();
-      break;
-    }
-    case DisabledUnselectedTransition: // FALLTHROUGH
-    case DisabledSelectedTransition:
-    {
-      StopFadeInAnimation();
-      Self().Remove( backgroundImage );
+  Actor& buttonImage = GetButtonImage();
 
-      backgroundImage = image;
+  buttonImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
-      FadeInImage( backgroundImage );
-      StartFadeInAnimation();
-      break;
-    }
-    default:
-      backgroundImage = image;
-      break;
-    }
+  buttonImage.RelayoutRequestTree();
 
-  backgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  backgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  backgroundImage.SetPosition( 0.f, 0.f, BACKGROUND_DEPTH );
-  backgroundImage.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  RelayoutRequest();
 }
 
-void PushButton::SetDisabledImage( Actor image )
+void PushButton::OnSelectedImageSet()
 {
-  Actor& disabledImage = GetDisabledImage();
-  Actor& fadeOutButtonImage = GetFadeOutButtonImage();
-
-  switch( mPaintState )
-  {
-    case DisabledUnselectedState: // FALLTHROUGH
-    case DisabledSelectedState:
-    {
-      if( disabledImage && disabledImage.GetParent() )
-      {
-        StopFadeOutAnimation();
-        FadeOutImage( Foreground, disabledImage  );
-
-        disabledImage = image;
-
-        FadeInImage( disabledImage );
-
-        StartFadeOutAnimation();
-        StartFadeInAnimation();
-      }
-      else
-      {
-        disabledImage = image;
-        Self().Add( disabledImage );
-      }
-      break;
-    }
-    case UnselectedDisabledTransition: // FALLTHROUGH
-    case SelectedDisabledTransition:
-    {
-      StopFadeInAnimation();
-      Self().Remove( disabledImage );
-
-      disabledImage = image;
-
-      FadeInImage( disabledImage );
-      StartFadeInAnimation();
-      break;
-    }
-    case DisabledUnselectedTransition: // FALLTHROUGH
-    case DisabledSelectedTransition:
-    {
-      float opacity = 1.f;
-      if( fadeOutButtonImage )
-      {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
-      }
-      StopFadeOutAnimation();
-
-      // Replaces the button image.
-      disabledImage = image;
+  Actor& selectedImage = GetSelectedImage();
 
-      Self().Add( disabledImage );
-      FadeOutImage( Foreground, disabledImage, opacity );
+  selectedImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
-      StartFadeOutAnimation();
-      break;
-    }
-    default:
-      disabledImage = image;
-      break;
-  }
+  selectedImage.RelayoutRequestTree();
 
-  disabledImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  disabledImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  disabledImage.SetPosition( 0.f, 0.f, FOREGROUND_DEPTH );
-  disabledImage.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  RelayoutRequest();
 }
 
-void PushButton::SetDisabledBackgroundImage( Actor image )
+void PushButton::OnBackgroundImageSet()
 {
-  Actor& disabledBackgroundImage = GetDisabledBackgroundImage();
-  Actor& fadeOutBackgroundImage = GetFadeOutBackgroundImage();
-
-  switch( mPaintState )
-  {
-    case DisabledUnselectedState: // FALLTHROUGH
-    case DisabledSelectedState:
-    {
-      if( disabledBackgroundImage && disabledBackgroundImage.GetParent() )
-      {
-        StopFadeOutAnimation();
-        FadeOutImage( Background, disabledBackgroundImage  );
+  Actor& backgroundImage = GetBackgroundImage();
 
-        disabledBackgroundImage = image;
+  backgroundImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
-        FadeInImage( disabledBackgroundImage );
+  backgroundImage.RelayoutRequestTree();
 
-        StartFadeOutAnimation();
-        StartFadeInAnimation();
-      }
-      else
-      {
-        disabledBackgroundImage = image;
-        Self().Add( disabledBackgroundImage );
-      }
-      break;
-    }
-    case UnselectedDisabledTransition: // FALLTHROUGH
-    case SelectedDisabledTransition:
-    {
-      StopFadeInAnimation();
-      Self().Remove( disabledBackgroundImage );
+  RelayoutRequest();
+}
 
-      disabledBackgroundImage = image;
+void PushButton::OnSelectedBackgroundImageSet()
+{
+  Actor& selectedBackgroundImage = GetSelectedBackgroundImage();
 
-      FadeInImage( disabledBackgroundImage );
-      StartFadeInAnimation();
-      break;
-    }
-    case DisabledUnselectedTransition: // FALLTHROUGH
-    case DisabledSelectedTransition:
-    {
-      float opacity = 1.f;
-      if( fadeOutBackgroundImage )
-      {
-        opacity = fadeOutBackgroundImage.GetCurrentOpacity();
-      }
-      StopFadeOutAnimation();
+  selectedBackgroundImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+}
 
-      // Replaces the button image.
-      disabledBackgroundImage = image;
+void PushButton::OnDisabledImageSet()
+{
+  Actor& disabledImage = GetDisabledImage();
 
-      Self().Add( disabledBackgroundImage );
-      FadeOutImage( Background, disabledBackgroundImage, opacity );
+  disabledImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
-      StartFadeOutAnimation();
-      break;
-    }
-    default:
-      disabledBackgroundImage = image;
-      break;
-  }
+  disabledImage.RelayoutRequestTree();
 
-  disabledBackgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  disabledBackgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  disabledBackgroundImage.SetPosition( 0.f, 0.f, BACKGROUND_DEPTH );
-  disabledBackgroundImage.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  RelayoutRequest();
 }
 
-void PushButton::OnButtonInitialize()
+void PushButton::OnDisabledBackgroundImageSet()
 {
-  // Push button requires the Leave event.
-  Actor root = Self();
-  root.SetLeaveRequired( true );
-}
+  Actor& disabledBackgroundImage = GetDisabledBackgroundImage();
 
-void PushButton::OnLabelSet()
-{
-  Actor& label = GetLabel();
+  disabledBackgroundImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
-  if( label )
-  {
-    label.SetAnchorPoint( AnchorPoint::CENTER );
-    label.SetParentOrigin( ParentOrigin::CENTER );
-    label.SetPosition( 0.f, 0.f, LABEL_DEPTH );
-    label.SetSize( mSize );
+  disabledBackgroundImage.RelayoutRequestTree();
 
-    Self().Add( label );
-  }
+  RelayoutRequest();
 }
 
-void PushButton::OnSelected( bool selected )
+bool PushButton::OnSelected()
 {
-  Actor& selectedImage = GetSelectedImage();
   Actor& buttonImage = GetButtonImage();
-  Actor& fadeOutButtonImage = GetFadeOutButtonImage();
+  Actor& selectedImage = GetSelectedImage();
+  Actor& selectedBackgroundImage = GetSelectedBackgroundImage();
 
-  switch( mPaintState )
+  PaintState paintState = GetPaintState();
+
+  switch( paintState )
   {
     case UnselectedState:
     {
-      StopFadeOutAnimation();
-      FadeOutImage( Foreground, buttonImage );
+      FadeOutImage( buttonImage );
+      FadeInImage( selectedBackgroundImage );
       FadeInImage( selectedImage );
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( buttonImage || selectedImage )
-      {
-        mPaintState = UnselectedSelectedTransition;
-      }
-      else
-      {
-        mPaintState = SelectedState;
-      }
+      StartTransitionAnimation();
       break;
     }
     case SelectedState:
     {
-      StopFadeOutAnimation();
-      FadeOutImage( Foreground, selectedImage );
+      FadeOutImage( selectedBackgroundImage );
+      FadeOutImage( selectedImage );
       FadeInImage( buttonImage );
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( buttonImage || selectedImage )
-      {
-        mPaintState = SelectedUnselectedTransition;
-      }
-      else
-      {
-        mPaintState = UnselectedState;
-      }
+      StartTransitionAnimation();
       break;
     }
     case UnselectedSelectedTransition:
     {
       float opacity = 1.f;
-      if( fadeOutButtonImage )
+      if( selectedImage )
       {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
+        opacity = selectedImage.GetCurrentOpacity();
       }
-      StopFadeOutAnimation( false );
-      StopFadeInAnimation();
-
-      FadeOutImage( Foreground, selectedImage, 1.f - opacity );
-      FadeInImage( buttonImage, opacity );
 
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( buttonImage || selectedImage )
-      {
-        mPaintState = SelectedUnselectedTransition;
-      }
-      else
-      {
-        mPaintState = UnselectedState;
-      }
+      StopTransitionAnimation( false );
+      FadeOutImage( selectedBackgroundImage, opacity );
+      FadeOutImage( selectedImage, opacity );
+      FadeInImage( buttonImage, 1.f - opacity );
+      StartTransitionAnimation();
       break;
     }
     case SelectedUnselectedTransition:
     {
       float opacity = 0.f;
-      if( fadeOutButtonImage )
+      if( selectedImage )
       {
-        opacity = 1.f - fadeOutButtonImage.GetCurrentOpacity();
+        opacity = selectedImage.GetCurrentOpacity();
       }
-      StopFadeOutAnimation( false );
-      StopFadeInAnimation();
 
-      FadeOutImage( Foreground, buttonImage, 1.f - opacity );
+      StopTransitionAnimation( false );
+      FadeOutImage( buttonImage, 1.f - opacity );
+      FadeInImage( selectedBackgroundImage, opacity );
       FadeInImage( selectedImage, opacity );
-
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( buttonImage || selectedImage )
-      {
-        mPaintState = UnselectedSelectedTransition;
-      }
-      else
-      {
-        mPaintState = SelectedState;
-      }
+      StartTransitionAnimation();
+      break;
+    }
+    case DisabledUnselectedTransition:
+    {
+      StopTransitionAnimation();
+      FadeOutImage( buttonImage );
+      FadeInImage( selectedBackgroundImage );
+      FadeInImage( selectedImage );
+      StartTransitionAnimation();
+      break;
+    }
+    case DisabledSelectedTransition:
+    {
+      StopTransitionAnimation();
+      FadeOutImage( selectedBackgroundImage );
+      FadeOutImage( selectedImage );
+      FadeInImage( buttonImage );
+      StartTransitionAnimation();
       break;
     }
     default:
@@ -586,419 +264,282 @@ void PushButton::OnSelected( bool selected )
       break;
     }
   }
+
+  if( mTransitionAnimation )
+  {
+    return true;
+  }
+
+  return false;
 }
 
-void PushButton::OnDisabled( bool disabled )
+bool PushButton::OnDisabled()
 {
   Actor& buttonImage = GetButtonImage();
   Actor& selectedImage = GetSelectedImage();
+  Actor& selectedBackgroundImage = GetSelectedBackgroundImage();
   Actor& backgroundImage = GetBackgroundImage();
   Actor& disabledImage = GetDisabledImage();
+  Actor& disabledSelectedImage = GetDisabledSelectedImage();
   Actor& disabledBackgroundImage = GetDisabledBackgroundImage();
-  Actor& fadeOutButtonImage = GetFadeOutButtonImage();
 
-  switch( mPaintState )
-  {
-  case UnselectedState:
+  PaintState paintState = GetPaintState();
+
+  switch( paintState )
   {
-    if( disabled )
+    case UnselectedState:
     {
-      StopFadeOutAnimation();
-      FadeOutImage( Background, backgroundImage );
-      FadeOutImage( Foreground, buttonImage );
+      FadeOutImage( backgroundImage );
+      FadeOutImage( buttonImage );
       FadeInImage( disabledBackgroundImage );
       FadeInImage( disabledImage );
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( buttonImage || disabledImage || backgroundImage || disabledBackgroundImage )
-      {
-        mPaintState = UnselectedDisabledTransition;
-      }
-      else
-      {
-        mPaintState = DisabledUnselectedState;
-      }
+      StartTransitionAnimation();
+      break;
     }
-    break;
-  }
-  case SelectedState:
-  {
-    if( disabled )
+    case SelectedState:
     {
-      StopFadeOutAnimation();
-      FadeOutImage( Background, backgroundImage );
-      FadeOutImage( Foreground, selectedImage );
+      FadeOutImage( backgroundImage );
+      FadeOutImage( selectedBackgroundImage );
+      FadeOutImage( selectedImage );
       FadeInImage( disabledBackgroundImage );
-      FadeInImage( disabledImage );
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( selectedImage || disabledImage || backgroundImage || disabledBackgroundImage )
-      {
-        mPaintState = SelectedDisabledTransition;
-      }
-      else
-      {
-        mPaintState = DisabledSelectedState;
-      }
+      FadeInImage( disabledSelectedImage );
+      StartTransitionAnimation();
+      break;
     }
-    break;
-  }
-  case DisabledUnselectedState:
-  {
-    if( !disabled )
+    case DisabledUnselectedState:
     {
-      StopFadeOutAnimation();
-      FadeOutImage( Background, disabledBackgroundImage );
-      FadeOutImage( Foreground, disabledImage );
+      FadeOutImage( disabledBackgroundImage );
+      FadeOutImage( disabledImage );
       FadeInImage( backgroundImage );
       FadeInImage( buttonImage );
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( buttonImage || disabledImage || backgroundImage || disabledBackgroundImage )
-      {
-        mPaintState = DisabledUnselectedTransition;
-      }
-      else
-      {
-        mPaintState = UnselectedState;
-      }
+      StartTransitionAnimation();
+      break;
     }
-    break;
-  }
-  case DisabledSelectedState:
-  {
-    if( !disabled )
+    case DisabledSelectedState:
     {
-      StopFadeOutAnimation();
-      FadeOutImage( Background, disabledBackgroundImage );
-      FadeOutImage( Foreground, disabledImage );
+      FadeOutImage( disabledBackgroundImage );
+      FadeOutImage( disabledSelectedImage );
       FadeInImage( backgroundImage );
+      FadeInImage( selectedBackgroundImage );
       FadeInImage( selectedImage );
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( selectedImage || disabledImage || backgroundImage || disabledBackgroundImage )
-      {
-        mPaintState = DisabledSelectedTransition;
-      }
-      else
-      {
-        mPaintState = SelectedState;
-      }
+      StartTransitionAnimation();
+      break;
     }
-    break;
-  }
-  case UnselectedSelectedTransition:
-  {
-    if( disabled )
+    case UnselectedSelectedTransition:
     {
       float opacity = 1.f;
-      if( fadeOutButtonImage )
+      if( selectedImage )
       {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
+        opacity = selectedImage.GetCurrentOpacity();
       }
-      StopFadeOutAnimation();
-      StopFadeInAnimation();
-
-      FadeOutImage( Foreground, selectedImage, 1.f - opacity );
-      FadeOutImage( Background, backgroundImage );
 
-      FadeInImage( disabledImage );
+      StopTransitionAnimation();
+      FadeOutImage( backgroundImage );
+      FadeOutImage( selectedBackgroundImage, opacity );
+      FadeOutImage( selectedImage, opacity );
       FadeInImage( disabledBackgroundImage );
-
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( selectedImage || disabledImage || backgroundImage || disabledBackgroundImage )
-      {
-        mPaintState = SelectedDisabledTransition;
-      }
-      else
-      {
-        mPaintState = DisabledSelectedState;
-      }
+      FadeInImage( disabledSelectedImage );
+      StartTransitionAnimation();
+      break;
     }
-    break;
-  }
-  case SelectedUnselectedTransition:
-  {
-    if( disabled )
+    case SelectedUnselectedTransition:
     {
       float opacity = 1.f;
-      if( fadeOutButtonImage )
+      if( buttonImage )
       {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
+        opacity = buttonImage.GetCurrentOpacity();
       }
-      StopFadeOutAnimation();
-      StopFadeInAnimation();
-
-      FadeOutImage( Foreground, buttonImage, 1.f - opacity );
-      FadeOutImage( Background, backgroundImage );
 
-      FadeInImage( disabledImage );
+      StopTransitionAnimation();
+      FadeOutImage( backgroundImage );
+      FadeOutImage( buttonImage, opacity );
       FadeInImage( disabledBackgroundImage );
-
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( buttonImage || disabledImage || backgroundImage || disabledBackgroundImage )
-      {
-        mPaintState = UnselectedDisabledTransition;
-      }
-      else
-      {
-        mPaintState = DisabledUnselectedState;
-      }
+      FadeInImage( disabledImage );
+      StartTransitionAnimation();
+      break;
     }
-    break;
-  }
-  case UnselectedDisabledTransition:
-  {
-    if( !disabled )
+    case UnselectedDisabledTransition:
     {
       float opacity = 1.f;
-      if( fadeOutButtonImage )
+      if( disabledImage )
       {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
+        opacity = disabledImage.GetCurrentOpacity();
       }
-      StopFadeOutAnimation( false );
-      StopFadeInAnimation();
-
-      FadeOutImage( Foreground, disabledImage, 1.f - opacity );
-      FadeOutImage( Background, disabledBackgroundImage, 1.f - opacity );
-      FadeInImage( buttonImage, opacity );
-      FadeInImage( backgroundImage, opacity );
-
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
 
-      if( buttonImage || disabledImage || backgroundImage || disabledBackgroundImage )
-      {
-        mPaintState = DisabledUnselectedTransition;
-      }
-      else
-      {
-        mPaintState = UnselectedState;
-      }
+      StopTransitionAnimation( false );
+      FadeOutImage( disabledBackgroundImage, opacity );
+      FadeOutImage( disabledImage, opacity );
+      FadeInImage( backgroundImage, 1.f - opacity );
+      FadeInImage( buttonImage, 1.f - opacity );
+      StartTransitionAnimation();
+      break;
     }
-    break;
-  }
-  case DisabledUnselectedTransition:
-  {
-    if( disabled )
+    case DisabledUnselectedTransition:
     {
       float opacity = 1.f;
-      if( fadeOutButtonImage )
+      if( buttonImage )
       {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
+        opacity = buttonImage.GetCurrentOpacity();
       }
-      StopFadeOutAnimation( false );
-      StopFadeInAnimation();
 
-      FadeOutImage( Foreground, buttonImage, 1.f - opacity );
-      FadeOutImage( Background, backgroundImage, 1.f - opacity );
-      FadeInImage( disabledImage, opacity );
-      FadeInImage( disabledBackgroundImage, opacity );
-
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( buttonImage || disabledImage || backgroundImage || disabledBackgroundImage )
-      {
-        mPaintState = UnselectedDisabledTransition;
-      }
-      else
-      {
-        mPaintState = DisabledUnselectedState;
-      }
+      StopTransitionAnimation( false );
+      FadeOutImage( backgroundImage, opacity );
+      FadeOutImage( buttonImage, opacity );
+      FadeInImage( disabledBackgroundImage, 1.f - opacity );
+      FadeInImage( disabledImage, 1.f - opacity );
+      StartTransitionAnimation();
+      break;
     }
-    break;
-  }
-  case SelectedDisabledTransition:
-  {
-    if( !disabled )
+    case SelectedDisabledTransition:
     {
       float opacity = 1.f;
-      if( fadeOutButtonImage )
+      if( disabledSelectedImage )
       {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
+        opacity = disabledSelectedImage.GetCurrentOpacity();
       }
-      StopFadeOutAnimation( false );
-      StopFadeInAnimation();
-
-      FadeOutImage( Foreground, disabledImage, 1.f - opacity );
-      FadeOutImage( Background, disabledBackgroundImage, 1.f - opacity );
-      FadeInImage( selectedImage, opacity );
-      FadeInImage( backgroundImage, opacity );
 
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( selectedImage || disabledImage || backgroundImage || disabledBackgroundImage )
-      {
-        mPaintState = DisabledSelectedTransition;
-      }
-      else
-      {
-        mPaintState = SelectedState;
-      }
+      StopTransitionAnimation( false );
+      FadeOutImage( disabledBackgroundImage, opacity );
+      FadeOutImage( disabledSelectedImage, opacity );
+      FadeInImage( backgroundImage, 1.f - opacity );
+      FadeInImage( selectedBackgroundImage, 1.f - opacity );
+      FadeInImage( selectedImage, 1.f - opacity );
+      StartTransitionAnimation();
+      break;
     }
-    break;
-  }
-  case DisabledSelectedTransition:
-  {
-    if( disabled )
+    case DisabledSelectedTransition:
     {
       float opacity = 1.f;
-      if( fadeOutButtonImage )
+      if( selectedImage )
       {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
+        opacity = selectedImage.GetCurrentOpacity();
       }
-      StopFadeOutAnimation( false );
-      StopFadeInAnimation();
-
-      FadeOutImage( Foreground, selectedImage, 1.f - opacity );
-      FadeOutImage( Background, backgroundImage, 1.f - opacity );
-      FadeInImage( disabledImage, opacity );
-      FadeInImage( disabledBackgroundImage, opacity );
 
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( selectedImage || disabledImage || backgroundImage || disabledBackgroundImage )
-      {
-        mPaintState = SelectedDisabledTransition;
-      }
-      else
-      {
-        mPaintState = DisabledSelectedState;
-      }
+      StopTransitionAnimation( false );
+      FadeOutImage( backgroundImage, opacity );
+      FadeOutImage( selectedBackgroundImage, opacity );
+      FadeOutImage( selectedImage, opacity );
+      FadeInImage( disabledBackgroundImage, 1.f - opacity );
+      FadeInImage( disabledSelectedImage, 1.f - opacity );
+      StartTransitionAnimation();
+      break;
     }
-    break;
   }
-  default:
-    break;
+
+  if( mTransitionAnimation )
+  {
+    return true;
   }
+
+  return false;
 }
 
-void PushButton::OnPressed()
+bool PushButton::OnPressed()
 {
-  Actor& selectedImage = GetSelectedImage();
   Actor& buttonImage = GetButtonImage();
-  Actor& fadeOutButtonImage = GetFadeOutButtonImage();
+  Actor& selectedImage = GetSelectedImage();
+  Actor& selectedBackgroundImage = GetSelectedBackgroundImage();
+
+  PaintState paintState = GetPaintState();
 
-  switch( mPaintState )
+  switch( paintState )
   {
     case UnselectedState:
     {
-      StopFadeOutAnimation();
-      FadeOutImage( Foreground, buttonImage );
+      FadeOutImage( buttonImage );
+      FadeInImage( selectedBackgroundImage );
       FadeInImage( selectedImage );
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( buttonImage || selectedImage )
-      {
-        mPaintState = UnselectedSelectedTransition;
-      }
-      else
-      {
-        mPaintState = SelectedState;
-      }
+      StartTransitionAnimation();
       break;
     }
-    case UnselectedSelectedTransition:
+    case SelectedUnselectedTransition:
     {
-      if( !IsAutoRepeating() )
+      float opacity = 1.f;
+      if( buttonImage )
       {
-        mPaintState = SelectedUnselectedTransition;
+        opacity = buttonImage.GetCurrentOpacity();
       }
+
+      StopTransitionAnimation( false );
+      FadeOutImage( buttonImage, opacity );
+      FadeInImage( selectedBackgroundImage, 1.f - opacity );
+      FadeInImage( selectedImage, 1.f - opacity );
+      StartTransitionAnimation();
       break;
     }
-    case SelectedUnselectedTransition:
+    case DisabledUnselectedTransition:
     {
       float opacity = 1.f;
-      if( fadeOutButtonImage )
+      if( buttonImage )
       {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
+        opacity = buttonImage.GetCurrentOpacity();
       }
-      StopFadeOutAnimation( false );
-      StopFadeInAnimation();
-
-      FadeOutImage( Foreground, buttonImage, 1.f - opacity );
-      FadeInImage( selectedImage, opacity );
-
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
 
-      if( buttonImage || selectedImage )
-      {
-        mPaintState = UnselectedSelectedTransition;
-      }
-      else
-      {
-        mPaintState = SelectedState;
-      }
+      StopTransitionAnimation();
+      FadeOutImage( buttonImage, opacity );
+      FadeInImage( selectedBackgroundImage );
+      FadeInImage( selectedImage );
+      StartTransitionAnimation();
       break;
     }
     default:
       break;
   }
+
+  if( mTransitionAnimation )
+  {
+    return true;
+  }
+
+  return false;
 }
 
-void PushButton::OnReleased()
+bool PushButton::OnReleased()
 {
-  Actor& selectedImage = GetSelectedImage();
   Actor& buttonImage = GetButtonImage();
-  Actor& fadeOutButtonImage = GetFadeOutButtonImage();
+  Actor& selectedImage = GetSelectedImage();
+  Actor& selectedBackgroundImage = GetSelectedBackgroundImage();
+
+  PaintState paintState = GetPaintState();
 
-  switch( mPaintState )
+  switch( paintState )
   {
     case SelectedState:
     {
-      StopFadeOutAnimation();
-      FadeOutImage( Foreground, selectedImage );
+      FadeOutImage( selectedBackgroundImage );
+      FadeOutImage( selectedImage );
       FadeInImage( buttonImage );
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( buttonImage || selectedImage )
-      {
-        mPaintState = SelectedUnselectedTransition;
-      }
-      else
-      {
-        mPaintState = UnselectedState;
-      }
+      StartTransitionAnimation();
       break;
     }
     case UnselectedSelectedTransition:
     {
       float opacity = 1.f;
-      if( fadeOutButtonImage )
+      if( selectedImage )
       {
-        opacity = fadeOutButtonImage.GetCurrentOpacity();
+        opacity = selectedImage.GetCurrentOpacity();
       }
-      StopFadeOutAnimation( false );
-      StopFadeInAnimation();
-
-      FadeOutImage( Foreground, selectedImage, 1.f - opacity );
-      FadeInImage( buttonImage, opacity );
 
-      StartFadeOutAnimation();
-      StartFadeInAnimation();
-
-      if( buttonImage || selectedImage )
-      {
-        mPaintState = SelectedUnselectedTransition;
-      }
-      else
+      StopTransitionAnimation( false );
+      FadeOutImage( selectedBackgroundImage, opacity );
+      FadeOutImage( selectedImage, opacity );
+      FadeInImage( buttonImage, 1.f - opacity );
+      StartTransitionAnimation();
+      break;
+    }
+    case DisabledSelectedTransition:
+    {
+      float opacity = 1.f;
+      if( selectedImage )
       {
-        mPaintState = UnselectedState;
+        opacity = selectedImage.GetCurrentOpacity();
       }
+
+      StopTransitionAnimation();
+      FadeOutImage( selectedBackgroundImage, opacity );
+      FadeOutImage( selectedImage, opacity );
+      FadeInImage( buttonImage );
+      StartTransitionAnimation();
       break;
     }
     default:
@@ -1006,11 +547,18 @@ void PushButton::OnReleased()
       break;
     }
   }
+
+  if( mTransitionAnimation )
+  {
+    return true;
+  }
+
+  return false;
 }
 
-void PushButton::OnClicked()
+void PushButton::StopAllAnimations()
 {
-  OnReleased();
+  StopTransitionAnimation();
 }
 
 void PushButton::OnControlSizeSet( const Vector3& targetSize )
@@ -1030,266 +578,94 @@ void PushButton::OnControlSizeSet( const Vector3& targetSize )
 
 Vector3 PushButton::GetNaturalSize()
 {
-  Vector3 size = Control::GetNaturalSize();
-
-  const bool widthIsZero = EqualsZero( size.width );
-  const bool heightIsZero = EqualsZero( size.height );
+  Vector3 size;
 
-  if( widthIsZero || heightIsZero )
+  // If background and background not scale9 try get size from that
+  ImageActor imageActor = FindImageActor( GetButtonImage() );
+  if( imageActor && imageActor.GetStyle() != ImageActor::STYLE_NINE_PATCH )
   {
-    // If background and background not scale9 try get size from that
-    ImageActor imageActor = FindImageActor( GetButtonImage() );
-    if( imageActor && imageActor.GetStyle() != ImageActor::STYLE_NINE_PATCH )
-    {
-      Vector3 imageSize = RelayoutHelper::GetNaturalSize( imageActor );
-
-      if( widthIsZero )
-      {
-        size.width = imageSize.width;
-      }
-
-      if( heightIsZero )
-      {
-        size.height = imageSize.height;
-      }
-    }
-
-    ImageActor backgroundImageActor = FindImageActor( GetBackgroundImage() );
-    if( backgroundImageActor && backgroundImageActor.GetStyle() != ImageActor::STYLE_NINE_PATCH )
-    {
-      Vector3 imageSize = RelayoutHelper::GetNaturalSize( backgroundImageActor );
-
-      if( widthIsZero )
-      {
-        size.width = std::max( size.width, imageSize.width );
-      }
-
-      if( heightIsZero )
-      {
-        size.height = std::max( size.height, imageSize.height );
-      }
-    }
-
-    // If label, test against it's size
-    Toolkit::TextView textView = Toolkit::TextView::DownCast( GetLabel() );
-    if( textView )
-    {
-      Vector3 textViewSize = textView.GetNaturalSize();
-
-      if( widthIsZero )
-      {
-        size.width = std::max( size.width, textViewSize.width + TEXT_PADDING * 2.0f );
-      }
-
-      if( heightIsZero )
-      {
-        size.height = std::max( size.height, textViewSize.height + TEXT_PADDING * 2.0f );
-      }
-    }
+    size.width = imageActor.GetRelayoutSize( WIDTH );
+    size.height = imageActor.GetRelayoutSize( HEIGHT );
   }
 
-  return size;
-}
-
-Actor& PushButton::GetFadeOutButtonImage()
-{
-  return mFadeOutButtonContent;
-}
-
-Actor& PushButton::GetFadeOutBackgroundImage()
-{
-  return mFadeOutBackgroundContent;
-}
-
-void PushButton::AddToFadeInAnimation( const Actor& actor )
-{
-  if( !mFadeInAnimation )
+  ImageActor backgroundImageActor = FindImageActor( GetBackgroundImage() );
+  if( backgroundImageActor && backgroundImageActor.GetStyle() != ImageActor::STYLE_NINE_PATCH )
   {
-    mFadeInAnimation = Dali::Animation::New( GetAnimationTime() );
+    size.width = std::max( size.width, backgroundImageActor.GetRelayoutSize( WIDTH ) );
+    size.height = std::max( size.height, backgroundImageActor.GetRelayoutSize( HEIGHT ) );
   }
 
-  mFadeInAnimation.OpacityTo( actor, 1.f );
-}
-
-void PushButton::StartFadeInAnimation()
-{
-  if( mFadeInAnimation )
+  // If label, test against it's size
+  Toolkit::TextView textView = Toolkit::TextView::DownCast( GetLabel() );
+  if( textView )
   {
-    mFadeInAnimation.FinishedSignal().Connect( this, &PushButton::FadeInAnimationFinished );
-    mFadeInAnimation.Play();
-  }
-}
+    Vector3 textViewSize = textView.GetNaturalSize();
 
-void PushButton::StopFadeInAnimation()
-{
-  if( mFadeInAnimation )
-  {
-    mFadeInAnimation.Clear();
-    mFadeInAnimation.Reset();
+    size.width = std::max( size.width, textViewSize.width + TEXT_PADDING * 2.0f );
+    size.height = std::max( size.height, textViewSize.height + TEXT_PADDING * 2.0f );
   }
-}
 
-void PushButton::AddToFadeOutAnimation( const Actor& actor )
-{
-  if( !mFadeOutAnimation )
-  {
-    mFadeOutAnimation = Dali::Animation::New( GetAnimationTime() );
-  }
-
-  mFadeOutAnimation.OpacityTo( actor, 0.f );
+  return size;
 }
 
-void PushButton::StartFadeOutAnimation()
+void PushButton::StartTransitionAnimation()
 {
-  if( mFadeOutAnimation )
+  if( mTransitionAnimation )
   {
-    mFadeOutAnimation.FinishedSignal().Connect( this, &PushButton::FadeOutAnimationFinished );
-    mFadeOutAnimation.Play();
+    mTransitionAnimation.FinishedSignal().Connect( this, &PushButton::TransitionAnimationFinished );
+    mTransitionAnimation.Play();
   }
 }
 
-void PushButton::StopFadeOutAnimation( bool remove )
+void PushButton::StopTransitionAnimation( bool remove )
 {
-  if( mFadeOutAnimation )
+  if( mTransitionAnimation )
   {
-    mFadeOutAnimation.Clear();
-    mFadeOutAnimation.Reset();
+    mTransitionAnimation.Clear();
+    mTransitionAnimation.Reset();
   }
 
   if( remove )
   {
-    Actor& fadeOutButtonImage = GetFadeOutButtonImage();
-    Actor& fadeOutBackgroundImage = GetFadeOutBackgroundImage();
-
-    if( fadeOutButtonImage && fadeOutButtonImage.GetParent() )
-    {
-      fadeOutButtonImage.GetParent().Remove( fadeOutButtonImage );
-    }
-
-    if( fadeOutBackgroundImage && fadeOutBackgroundImage.GetParent() )
-    {
-      fadeOutBackgroundImage.GetParent().Remove( fadeOutBackgroundImage );
-    }
-
-    fadeOutButtonImage.Reset();
-    fadeOutBackgroundImage.Reset();
+    UpdatePaintTransitionState();
   }
 }
 
-void PushButton::FadeInImage( Actor& image, float opacity )
+void PushButton::FadeInImage( Actor& image, float opacity, Vector3 scale )
 {
   if( image )
   {
     image.SetOpacity( opacity );
-    if( !image.GetParent() )
+    image.SetScale( scale );
+
+    if( !mTransitionAnimation )
     {
-      Self().Add( image );
+      mTransitionAnimation = Dali::Animation::New( GetAnimationTime() );
     }
 
-    AddToFadeInAnimation( image );
+    mTransitionAnimation.AnimateTo( Property( image, Actor::Property::COLOR_ALPHA ), 1.f );
   }
 }
 
-void PushButton::FadeOutImage( ImageLayer layer, Actor& image, float opacity )
+void PushButton::FadeOutImage( Actor& image, float opacity, Vector3 scale )
 {
   if( image )
   {
-    Actor& fadeOutButtonImage = GetFadeOutButtonImage();
-    Actor& fadeOutBackgroundImage = GetFadeOutBackgroundImage();
-
-    Actor& actorLayer = ( ( Background == layer ) ? fadeOutBackgroundImage : fadeOutButtonImage );
-
-    actorLayer = image;
-    actorLayer.SetOpacity( opacity );
-
-    AddToFadeOutAnimation( actorLayer );
-  }
-}
+    image.SetOpacity( opacity );
+    image.SetScale( scale );
 
-void PushButton::FadeOutAnimationFinished( Dali::Animation& source )
-{
-  switch( mPaintState )
-  {
-    case UnselectedSelectedTransition:
-    {
-      mPaintState = SelectedState;
-      break;
-    }
-    case SelectedUnselectedTransition:
-    {
-      mPaintState = UnselectedState;
-      break;
-    }
-    case UnselectedDisabledTransition:
-    {
-      mPaintState = DisabledUnselectedState;
-      break;
-    }
-    case DisabledUnselectedTransition:
-    {
-      mPaintState = UnselectedState;
-      break;
-    }
-    case SelectedDisabledTransition:
-    {
-      mPaintState = DisabledSelectedState;
-      break;
-    }
-    case DisabledSelectedTransition:
-    {
-      mPaintState = SelectedState;
-      break;
-    }
-    default:
+    if( !mTransitionAnimation )
     {
-      break;
+      mTransitionAnimation = Dali::Animation::New( GetAnimationTime() );
     }
-  }
 
-  StopFadeOutAnimation();
+    mTransitionAnimation.AnimateTo( Property( image, Actor::Property::COLOR_ALPHA ), 0.f );
+  }
 }
 
-void PushButton::FadeInAnimationFinished( Dali::Animation& source )
+void PushButton::TransitionAnimationFinished( Dali::Animation& source )
 {
-  switch( mPaintState )
-  {
-    case UnselectedSelectedTransition:
-    {
-      mPaintState = SelectedState;
-      break;
-    }
-    case SelectedUnselectedTransition:
-    {
-      mPaintState = UnselectedState;
-      break;
-    }
-    case UnselectedDisabledTransition:
-    {
-      mPaintState = DisabledUnselectedState;
-      break;
-    }
-    case DisabledUnselectedTransition:
-    {
-      mPaintState = UnselectedState;
-      break;
-    }
-    case SelectedDisabledTransition:
-    {
-      mPaintState = DisabledSelectedState;
-      break;
-    }
-    case DisabledSelectedTransition:
-    {
-      mPaintState = SelectedState;
-      break;
-    }
-    default:
-    {
-      break;
-    }
-  }
-
-  StopFadeInAnimation();
+  StopTransitionAnimation();
 }
 
 } // namespace Internal
index 2784bab..3eddddc 100644 (file)
@@ -62,69 +62,72 @@ protected:
    */
   virtual ~PushButton();
 
-public: // From Button
+private: // From Button
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetButtonImage( Actor image )
+   * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
    */
-  virtual void SetButtonImage( Actor image );
+  virtual void OnButtonInitialize();
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetSelectedImage( Actor image )
+   * @copydoc Toolkit::Internal::Button::OnLabelSet()
    */
-  virtual void SetSelectedImage( Actor image );
+  virtual void OnLabelSet();
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetBackgroundImage( Actor image )
+   * @copydoc Toolkit::Internal::Button::OnButtonImageSet()
    */
-  virtual void SetBackgroundImage( Actor image );
+  virtual void OnButtonImageSet();
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetDisabledImage( Actor image )
+   * @copydoc Toolkit::Internal::Button::OnSelectedImageSet()
    */
-  virtual void SetDisabledImage( Actor image );
+  virtual void OnSelectedImageSet();
 
   /**
-   * @copydoc Toolkit::Internal::Button::SetDisabledBackgroundImage( Actor image )
+   * @copydoc Toolkit::Internal::Button::OnBackgroundImage()
    */
-  virtual void SetDisabledBackgroundImage( Actor image );
+  virtual void OnBackgroundImageSet();
 
-private: // From Button
+  /**
+   * @copydoc Toolkit::Internal::Button::OnSelectedBackgroundImageSet()
+   */
+  virtual void OnSelectedBackgroundImageSet();
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
+   * @copydoc Toolkit::Internal::Button::OnDisabledImageSet()
    */
-  virtual void OnButtonInitialize();
+  virtual void OnDisabledImageSet();
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnLabelSet()
+   * @copydoc Toolkit::Internal::Button::OnDisabledBackgroundImageSet()
    */
-  virtual void OnLabelSet();
+  virtual void OnDisabledBackgroundImageSet();
 
   /**
    * @copydoc Toolkit::Internal::Button::OnSelected()
    */
-  virtual void OnSelected( bool selected );
+  virtual bool OnSelected();
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnDisabled( bool disabled )
+   * @copydoc Toolkit::Internal::Button::OnDisabled()
    */
-  virtual void OnDisabled( bool disabled );
+  virtual bool OnDisabled();
 
   /**
    * @copydoc Toolkit::Internal::Button::OnPressed()
    */
-  virtual void OnPressed();
+  virtual bool OnPressed();
 
   /**
    * @copydoc Toolkit::Internal::Button::OnReleased()
    */
-  virtual void OnReleased();
+  virtual bool OnReleased();
 
   /**
-   * @copydoc Toolkit::Internal::Button::OnClicked()
+   * @copydoc Toolkit::Internal::Button::StopAllAnimations()
    */
-  virtual void OnClicked();
+  virtual void StopAllAnimations();
 
 private: // From Control
 
@@ -141,89 +144,40 @@ private: // From Control
 private:
 
   /**
-   * Used in the FadeOut functions.
-   */
-  enum ImageLayer
-  {
-    Background, ///< Fade out the background.
-    Foreground  ///< Fade out the foreground.
-  };
-
-  /**
-   * Gets the button image that is fading out.
-   * @return A reference to the button image that is fading out.
+   * Starts the transition animation.
+   * PushButton::TransitionAnimationFinished slot is called when the animation finishes.
    */
-  Actor& GetFadeOutButtonImage();
+  void StartTransitionAnimation();
 
   /**
-   * Gets the background image that is fading out.
-   * @return A reference to the background image that is fading out.
-   */
-  Actor& GetFadeOutBackgroundImage();
-
-  /**
-   * Adds the actor to the fade in animation. It creates a fade in animation if needed.
-   * @param[in] actor The actor.
-   */
-  void AddToFadeInAnimation( const Actor& actor );
-
-  /**
-   * Starts the fade in animation.
-   * PushButton::FadeInAnimationFinished slot is called when the animation finishes.
-   */
-  void StartFadeInAnimation();
-
-  /**
-   * Stops the fade in animation.
-   */
-  void StopFadeInAnimation();
-
-  /**
-   * Adds the actor to the fade out animation. It creates a fade out animation if needed.
-   */
-  void AddToFadeOutAnimation( const Actor& actor );
-
-  /**
-   * Starts the fade out animation.
-   * PushButton::FadeOutAnimationFinished slot is called when the animation finishes.
-   */
-  void StartFadeOutAnimation();
-
-  /**
-   * Stops the fade out animation.
-   * It removes the actor stored in PushButton::mFadeOutBackgroundImage and PushButton::mFadeOutCheckedImage.
+   * Stops the transition animation.
    * @param[in] remove If true, removes the fadeout actor from root.
    */
-  void StopFadeOutAnimation( bool remove = true );
+  void StopTransitionAnimation( bool remove = true );
 
   /**
    * It adds the actor to the root actor and to the fade in animation.
    * @param[inout] image The actor.
    * @param[in] opacity The initial opacity.
+   * @param[in] scale The initial scale.
    */
-  void FadeInImage( Actor& image, float opacity = 0.f );
+  void FadeInImage( Actor& image, float opacity = 0.f, Vector3 scale = Vector3( 1.f, 1.f, 1.f ) );
 
   /**
    * It adds the actor fade out animation and stores it to be removed when the animation finishes.
    * @param[in] layer Defines if the actor is going to be stored in the mFadeOutBackgroundImage or mFadeOutCheckedImage member.
    * @param[inout] image The actor.
    * @param[in] opacity The initial opacity.
+   * @param[in] scale The initial scale.
    */
-  void FadeOutImage( ImageLayer layer, Actor& image, float opacity = 1.f );
+  void FadeOutImage( Actor& image, float opacity = 1.f, Vector3 scale = Vector3( 1.f, 1.f, 1.f ) );
 
   // slots
 
   /**
-   * Called when the fade out animation finishes.
-   * It changes the check button paint state and removes actors from the root.
+   * Called when the transition animation finishes.
    */
-  void FadeOutAnimationFinished( Dali::Animation& source );
-
-  /**
-   * Called when the fade in animation finishes.
-   * It changes the check button paint state.
-   */
-  void FadeInAnimationFinished( Dali::Animation& source );
+  void TransitionAnimationFinished( Dali::Animation& source );
 
 private:
 
@@ -235,15 +189,8 @@ private:
 
 private:
 
-  Animation             mFadeInAnimation;           ///< Animation used in the state transitions.
-  Animation             mFadeOutAnimation;          ///< Animation used in the state transitions.
-
-  Actor                 mFadeOutButtonContent;      ///< Stores a foreground content, which is in a fade out animation, to be removed when the animation finishes.
-  Actor                 mFadeOutBackgroundContent;  ///< Stores a background content, which is in a fade out animation, to be removed when the animation finishes.
-
+  Animation             mTransitionAnimation;       ///< Animation used in the state transitions.
   Vector3               mSize;                      ///< The button's size.
-
-  PaintState            mPaintState;                ///< The paint state.
 };
 
 } // namespace Internal
index d1ccebd..96b588c 100644 (file)
@@ -45,7 +45,7 @@ TypeRegistration typeRegistration( typeid( Toolkit::RadioButton ), typeid( Toolk
 const char* const UNSELECTED_BUTTON_IMAGE_DIR = DALI_IMAGE_DIR "radio-button-unselected.png";
 const char* const SELECTED_BUTTON_IMAGE_DIR = DALI_IMAGE_DIR "radio-button-selected.png";
 
-const Vector3 DISTANCE_BETWEEN_IMAGE_AND_LABEL(5.0f, 0.0f, 0.0f);
+const float DISTANCE_BETWEEN_IMAGE_AND_LABEL( 5.0f );
 }
 
 Dali::Toolkit::RadioButton RadioButton::New()
@@ -72,66 +72,13 @@ RadioButton::~RadioButton()
 {
 }
 
-void RadioButton::SetButtonImage( Actor image )
-{
-  Actor& buttonImage = GetButtonImage();
-
-  if( !IsSelected() )
-  {
-    if( buttonImage && buttonImage.GetParent() )
-    {
-      buttonImage.GetParent().Remove( buttonImage );
-      buttonImage.Reset();
-    }
-
-    Self().Add( image );
-
-    Actor& label = GetLabel();
-
-    if( label )
-    {
-      buttonImage.Remove( label );
-      image.Add( label );
-    }
-  }
-
-  buttonImage = image;
-
-  buttonImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  buttonImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-}
-
-void RadioButton::SetSelectedImage( Actor image )
+void RadioButton::OnButtonInitialize()
 {
-  Actor& selectedImage = GetSelectedImage();
-
-  if( IsSelected() )
-  {
-    if( selectedImage && selectedImage.GetParent() )
-    {
-      selectedImage.GetParent().Remove( selectedImage );
-      selectedImage.Reset();
-    }
-
-    Self().Add( image );
+  Actor self = Self();
 
-    Actor& label = GetLabel();
-
-    if( label )
-    {
-      selectedImage.Remove( label );
-      image.Add( label );
-    }
-  }
-
-  selectedImage = image;
-
-  selectedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  selectedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-}
+  // Wrap size of radio button around all its children
+  self.SetResizePolicy( FIT_TO_CHILDREN, ALL_DIMENSIONS );
 
-void RadioButton::OnButtonInitialize()
-{
   Image buttonImage = Dali::ResourceImage::New( UNSELECTED_BUTTON_IMAGE_DIR );
   Image selectedImage = Dali::ResourceImage::New( SELECTED_BUTTON_IMAGE_DIR );
 
@@ -148,7 +95,7 @@ void RadioButton::OnButtonUp()
     // Don't allow selection on an already selected radio button
     if( !IsSelected() )
     {
-      SetSelected(!IsSelected());
+      SetSelected( !IsSelected() );
     }
   }
 }
@@ -159,95 +106,71 @@ void RadioButton::OnLabelSet()
 
   if( label )
   {
-    label.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
+    label.SetParentOrigin( ParentOrigin::CENTER_LEFT );
     label.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
-    label.TranslateBy( DISTANCE_BETWEEN_IMAGE_AND_LABEL );
 
     if( IsSelected() )
     {
-      GetSelectedImage().Add( label );
+      label.SetX( GetSelectedImage().GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
     }
     else
     {
-      GetButtonImage().Add( label );
+      label.SetX( GetButtonImage().GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
     }
   }
 }
 
-void RadioButton::OnSelected( bool selected )
+bool RadioButton::OnSelected()
 {
   Actor& buttonImage = GetButtonImage();
   Actor& selectedImage = GetSelectedImage();
   Actor& label = GetLabel();
 
-  if( selected )
+  PaintState paintState = GetPaintState();
+
+  switch( paintState )
   {
-    Actor parent = Self().GetParent();
-    if( parent )
+    case UnselectedState:
     {
-      for( unsigned int i = 0; i < parent.GetChildCount(); ++i )
+      Actor parent = Self().GetParent();
+      if( parent )
       {
-        Dali::Toolkit::RadioButton rbChild = Dali::Toolkit::RadioButton::DownCast(parent.GetChildAt(i));
-
-        if( rbChild )
+        for( unsigned int i = 0; i < parent.GetChildCount(); ++i )
         {
-          rbChild.SetSelected(false);
+          Dali::Toolkit::RadioButton radioButtonChild = Dali::Toolkit::RadioButton::DownCast( parent.GetChildAt( i ) );
+          if( radioButtonChild && radioButtonChild != Self() )
+          {
+            radioButtonChild.SetSelected( false );
+          }
         }
       }
-    }
 
-    buttonImage.GetParent().Remove( buttonImage );
-    Self().Add( selectedImage );
+      RemoveChild( buttonImage );
 
-    if( label )
-    {
-      label.GetParent().Remove( label );
-      selectedImage.Add( label );
+      if( label )
+      {
+        label.SetX( selectedImage.GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
+      }
+      break;
     }
-  }
-  else
-  {
-    selectedImage.GetParent().Remove( selectedImage );
-    Self().Add( buttonImage );
+    case SelectedState:
+    {
+      RemoveChild( selectedImage );
 
-    if( label )
+      if( label )
+      {
+        label.SetX( buttonImage.GetNaturalSize().width + DISTANCE_BETWEEN_IMAGE_AND_LABEL );
+      }
+      break;
+    }
+    default:
     {
-      label.GetParent().Remove( label );
-      buttonImage.Add( label );
+      break;
     }
   }
-}
-
-void RadioButton::OnRelayout( const Vector2& /*size*/, ActorSizeContainer& container )
-{
-  Vector3 newSize;
-
-  if( IsSelected() )
-  {
-    newSize = GetSelectedImage().GetNaturalSize();
-  }
-  else
-  {
-    newSize = GetButtonImage().GetNaturalSize();
-  }
-
-  Actor& label = GetLabel();
-
-  if( label )
-  {
-    // Offset the label from the radio button image
-    newSize.width += DISTANCE_BETWEEN_IMAGE_AND_LABEL.width;
-
-    // Find the size of the control using size negotiation
-    Vector3 actorNaturalSize( label.GetNaturalSize() );
-    Control::Relayout( label, Vector2( actorNaturalSize.width, actorNaturalSize.height ), container );
-
-    Vector3 actorSize( label.GetSize() );
-    newSize.width += actorSize.width;
-    newSize.height = std::max( newSize.height, actorSize.height );
-  }
 
-  Self().SetSize( newSize );
+  // there is no animation
+  return false;
 }
 
 } // namespace Internal
index db28905..eec11ab 100644 (file)
@@ -25,6 +25,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/text-view/text-view.h>
 #include <dali-toolkit/public-api/controls/buttons/radio-button.h>
+#include <dali-toolkit/public-api/controls/table-view/table-view.h>
 #include "button-impl.h"
 
 namespace Dali
@@ -46,42 +47,22 @@ public:
   /**
    * Create a new RadioButton.
    *
-   * @return A smart-pointer to the newly allocated PushButton.
+   * @return A smart-pointer to the newly allocated RadioButton.
    */
   static Dali::Toolkit::RadioButton New();
 
-  /**
-   * Construct a new PushButton.
-   */
-  RadioButton();
-
-  /**
-   * Construct a new PushButton with label.
-   */
-  RadioButton( const std::string& label );
+private:
 
   /**
-   * Construct a new PushButton with label.
+   * Construct a new RadioButton.
    */
-  RadioButton( Actor label );
+  RadioButton();
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
    */
   virtual ~RadioButton();
 
-public: // From Button
-
-  /**
-   * @copydoc Toolkit::Internal::Button::SetButtonImage( Actor image )
-   */
-  virtual void SetButtonImage( Actor image );
-
-  /**
-   * @copydoc Toolkit::Internal::Button::SetSelectedImage( Actor image )
-   */
-  virtual void SetSelectedImage( Actor image );
-
 private: // From Button
 
   /**
@@ -97,20 +78,13 @@ private: // From Button
   /**
    * @copydoc Toolkit::Internal::Button::OnSelected()
    */
-  virtual void OnSelected( bool selected );
+  virtual bool OnSelected();
 
   /**
    * @copydoc Toolkit::Internal::Button::OnLabelSet()
    */
   virtual void OnLabelSet();
 
-private: // From Control
-
-  /**
-   * @copydoc Dali::Toolkit::Control::OnRelayout()
-   */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
-
 private:
 
   // Undefined
index 1084302..4974ce1 100644 (file)
@@ -295,8 +295,8 @@ void ClusterStyle::Apply( Actor actor,
   if( animationDuration > 0.f )
   {
     Animation animation = Animation::New(animationDuration);
-    animation.MoveTo( actor, position, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds );
-    animation.Resize( actor, size, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds );
+    animation.AnimateTo( Property( actor, Actor::Property::POSITION ), position, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
     animation.Play();
   }
   else
@@ -318,10 +318,10 @@ void ClusterStyle::Apply( Actor actor,
   if( animationDuration > 0.f )
   {
     Animation animation = Animation::New(animationDuration);
-    animation.MoveTo( actor, position, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds );
-    animation.Resize( actor, size, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds );
-    animation.RotateTo( actor, rotation, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds );
-    animation.ScaleTo( actor, scale, alpha, durationSeconds.delaySeconds, durationSeconds.durationSeconds );
+    animation.AnimateTo( Property( actor, Actor::Property::POSITION ), position, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
+    animation.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), rotation, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
+    animation.AnimateTo( Property( actor, Actor::Property::SCALE ), scale, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
     animation.Play();
   }
   else
index 7521051..37e5776 100644 (file)
@@ -283,6 +283,7 @@ void Magnifier::SetFrameVisibility(bool visible)
 
     Image image = ResourceImage::New( DEFAULT_FRAME_IMAGE_PATH );
     mFrame = ImageActor::New( image );
+    mFrame.SetRelayoutEnabled( false );
     mFrame.SetDrawMode(DrawMode::OVERLAY);
     mFrame.SetStyle( ImageActor::STYLE_NINE_PATCH );
     mFrame.SetPositionInheritanceMode(DONT_INHERIT_POSITION);
index ac5244a..84eb4e4 100644 (file)
 #include <dali/public-api/events/key-event.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/size-negotiation/relayout-container.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/focus-manager/focus-manager.h>
 #include <dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.h>
 #include <dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.h>
-#include <dali-toolkit/internal/controls/relayout-controller.h>
+#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
 
 namespace Dali
 {
@@ -263,11 +264,12 @@ void NavigationControl::OrientationChanged( int angle )
       }
     }
 
+    Actor self = Self();
     Animation animation = Animation::New( mOrientationAnimationDuration );
-    animation.RotateTo( Self(), Degree( -angle ), Vector3::ZAXIS, mOrientationAnimationAlphaFunc );
+    animation.AnimateTo( Property( self, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -angle ) ), Vector3::ZAXIS ), mOrientationAnimationAlphaFunc );
     animation.Play();
 
-    Self().SetSize( targetSize );
+    self.SetSize( targetSize );
 
     RelayoutRequest();
   }
@@ -284,7 +286,7 @@ Layer NavigationControl::GetBarLayer() const
   return mBarLayer;
 }
 
-void NavigationControl::OnRelayout( const Vector2& size, ActorSizeContainer& container )
+void NavigationControl::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   const Vector2 setSize( size );
 
@@ -307,11 +309,11 @@ void NavigationControl::OnRelayout( const Vector2& size, ActorSizeContainer& con
     mCurrentItem.SetPosition( mItemPositionCoefficient * positionOffset);
     Vector2 itemSize( setSize.x, setSize.y-sizeShrink );
 
-    Relayout(mCurrentItem, itemSize, container);
+    container.Add( mCurrentItem, itemSize );
   }
 
-  container.push_back(ActorSizePair( mBarLayer, setSize ));
-  container.push_back(ActorSizePair( mPopupLayer, setSize ));
+  container.Add( mBarLayer, setSize );
+  container.Add( mPopupLayer, setSize );
 }
 
 void NavigationControl::OnControlSizeSet( const Vector3& size )
index 41990a2..1e7f0a2 100644 (file)
@@ -157,7 +157,7 @@ private: // override functions from Control
   /**
    * @copydoc Control::OnRelayout()
    */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
 
   /**
    * @copydoc Control::OnControlSizeSet
index ffd79e4..69df006 100755 (executable)
@@ -28,6 +28,7 @@
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -35,7 +36,6 @@
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 #include <dali-toolkit/public-api/focus-manager/focus-manager.h>
-#include <dali-toolkit/internal/controls/relayout-helper.h>
 #include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
 
 using namespace Dali;
@@ -69,9 +69,7 @@ DALI_TYPE_REGISTRATION_END()
 const char* const PROPERTY_TITLE = "title";
 const char* const PROPERTY_STATE = "state";
 
-const float CONTENT_DEPTH = 1.0f;                                 ///< 3D Effect of buttons/title etc. appearing off the popup.
-const float POPUP_ANIMATION_DURATION = 0.5f;                      ///< Duration of hide/show animations
-const float BACKING_DEPTH = -1.0f;                                ///< Depth of backing (positioned just behind dialog, so dialog catches hit events first)
+const float POPUP_ANIMATION_DURATION = 0.45f;                      ///< Duration of hide/show animations
 
 const float POPUP_WIDTH = 720.0f;                             ///< Width of Popup
 const float POPUP_OUT_MARGIN_WIDTH = 16.f;                    ///< Space between the screen edge and the popup edge in the horizontal dimension.
@@ -81,40 +79,6 @@ const float POPUP_BUTTON_BG_HEIGHT = 96.f;                    ///< Height of But
 const Vector3 DEFAULT_DIALOG_SIZE = Vector3(POPUP_TITLE_WIDTH/POPUP_WIDTH, 0.5f, 0.0f);
 const Vector3 DEFAULT_BOTTOM_SIZE = Vector3(1.0f, 0.2f, 0.0f);
 
-/**
- * The background size should be at least as big as the Dialog.
- * In some cases a background may have graphics which are visible
- * outside of the Dialog, e.g. A Shadow. For this we need to alter
- * the size of Background.
- *
- * @param[in] outerBorder The border to extend beyond parent's Size.
- * @param[in] parentSize  The parent's size
- */
-Vector3 BackgroundSize(const Vector4& outerBoarder, const Vector3& parentSize)
-{
-  Vector3 size( parentSize );
-  size.width += outerBoarder.x + outerBoarder.y;
-  size.height += outerBoarder.z + outerBoarder.w;
-
-  return size;
-}
-
-  /**
-   * sets button area size to parent's size plus a border.
-   *
-   * @param[in] outerBorder The border to extend beyond parent's Size.
-   * @param[in] parentSize  The parent's size
-   */
-Vector3 ButtonAreaSize( const Vector4& outBoarder, const Vector3& parentSize )
-{
-  Vector3 size( parentSize );
-  size.width += outBoarder.x + outBoarder.y;
-  size.width -= (POPUP_OUT_MARGIN_WIDTH + POPUP_OUT_MARGIN_WIDTH);
-  size.height = POPUP_BUTTON_BG_HEIGHT;
-
-  return size;
-}
-
 } // unnamed namespace
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -152,33 +116,49 @@ Popup::Popup(PopupStyle& style)
 
 void Popup::OnInitialize()
 {
+  Dali::Stage stage = Dali::Stage::GetCurrent();
+
   Actor self = Self();
   self.SetSensitive(false);
+  // Reisize to fit the height of children
+  self.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
 
   // Create Layer
   mLayer = Layer::New();
+  mLayer.SetName( "POPUP_LAYER" );
   mLayer.SetParentOrigin(ParentOrigin::CENTER);
   mLayer.SetAnchorPoint(AnchorPoint::CENTER);
-  mLayer.RaiseToTop();
-  self.Add(mLayer);
-
-  mPopupBg = Actor::New();
-  mPopupBg.SetParentOrigin(ParentOrigin::CENTER);
-  mPopupBg.SetAnchorPoint(AnchorPoint::CENTER);
-  mLayer.Add(mPopupBg);
+  mLayer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+  mLayer.SetDrawMode( DrawMode::OVERLAY );
 
   // Any content after this point which is added to Self() will be reparented to
   // mContent.
   mAlterAddedChild = true;
-
   // Add Backing (Dim effect)
   CreateBacking();
+  mAlterAddedChild = false;
 
   // Add Dialog ( background image, title, content container, button container and tail )
   CreateDialog();
 
+  mLayer.Add( self );
+
+  mPopupLayout = Toolkit::TableView::New( 3, 1 );
+  mPopupLayout.SetName( "POPUP_LAYOUT_TABLE" );
+  mPopupLayout.SetParentOrigin(ParentOrigin::CENTER);
+  mPopupLayout.SetAnchorPoint(AnchorPoint::CENTER);
+  mPopupLayout.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+  mPopupLayout.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+  mPopupLayout.SetFitHeight( 0 );   // Set row to fit
+  mPopupLayout.SetFitHeight( 1 );   // Set row to fit
+  self.Add( mPopupLayout );
+
+  // Any content after this point which is added to Self() will be reparented to
+  // mContent.
+  mAlterAddedChild = true;
+
   // Default content.
-  ShowTail(ParentOrigin::BOTTOM_CENTER);
+//  ShowTail(ParentOrigin::BOTTOM_CENTER);
 
   // Hide content by default.
   SetState( Toolkit::Popup::POPUP_HIDE, 0.0f );
@@ -191,6 +171,12 @@ void Popup::OnInitialize()
   SetAsKeyboardFocusGroup(true);
 }
 
+void Popup::MarkDirtyForRelayout()
+{
+  // Flag all the popup controls for relayout as it is about to be hidden and miss the main flagging pass
+  mLayer.RelayoutRequestTree();
+}
+
 void Popup::OnPropertySet( Property::Index index, Property::Value propertyValue )
 {
   if( index == mPropertyTitle )
@@ -213,6 +199,7 @@ void Popup::OnPropertySet( Property::Index index, Property::Value propertyValue
 
 Popup::~Popup()
 {
+  mLayer.Unparent();
 }
 
 size_t Popup::GetButtonCount() const
@@ -223,26 +210,38 @@ size_t Popup::GetButtonCount() const
 void Popup::SetBackgroundImage( Actor image )
 {
   // Removes any previous background.
-  if( mBackgroundImage && mPopupBg )
+  if( mBackgroundImage && mPopupLayout )
   {
-    mPopupBg.Remove( mBackgroundImage );
+    mPopupLayout.Remove( mBackgroundImage );
   }
 
   // Adds new background to the dialog.
   mBackgroundImage = image;
 
+  mBackgroundImage.SetName( "POPUP_BACKGROUND_IMAGE" );
+
   // OnDialogTouched only consume the event. It prevents the touch event to be caught by the backing.
   mBackgroundImage.TouchedSignal().Connect( this, &Popup::OnDialogTouched );
 
-  mPopupBg.Add( mBackgroundImage );
+  mBackgroundImage.SetResizePolicy( SIZE_FIXED_OFFSET_FROM_PARENT, ALL_DIMENSIONS );
+  mBackgroundImage.SetAnchorPoint( AnchorPoint::CENTER );
+  mBackgroundImage.SetParentOrigin( ParentOrigin::CENTER );
+
+  Vector3 border( mPopupStyle->backgroundOuterBorder.x, mPopupStyle->backgroundOuterBorder.z, 0.0f );
+  mBackgroundImage.SetSizeModeFactor( border );
+
+  const bool prevAlter = mAlterAddedChild;
+  mAlterAddedChild = false;
+  Self().Add( mBackgroundImage );
+  mAlterAddedChild = prevAlter;
 }
 
 void Popup::SetButtonAreaImage( Actor image )
 {
   // Removes any previous area image.
-  if( mButtonAreaImage && mPopupBg )
+  if( mButtonAreaImage && mPopupLayout )
   {
-    mPopupBg.Remove( mButtonAreaImage );
+    mPopupLayout.Remove( mButtonAreaImage );
   }
 
   // Adds new area image to the dialog.
@@ -251,12 +250,20 @@ void Popup::SetButtonAreaImage( Actor image )
   // OnDialogTouched only consume the event. It prevents the touch event to be caught by the backing.
   mButtonAreaImage.TouchedSignal().Connect( this, &Popup::OnDialogTouched );
 
-  mPopupBg.Add( mButtonAreaImage );
+  mButtonAreaImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+  mButtonAreaImage.SetAnchorPoint( AnchorPoint::CENTER );
+  mButtonAreaImage.SetParentOrigin( ParentOrigin::CENTER );
+
+  if( GetButtonCount() > 0 )
+  {
+    mBottomBg.Add( mButtonAreaImage );
+  }
 }
 
 void Popup::SetTitle( const std::string& text )
 {
   Toolkit::TextView titleActor = Toolkit::TextView::New();
+  titleActor.SetName( "POPUP_TITLE" );
   titleActor.SetText( text );
   titleActor.SetColor( Color::BLACK );
   titleActor.SetMultilinePolicy( Toolkit::TextView::SplitByWord );
@@ -269,13 +276,20 @@ void Popup::SetTitle( const std::string& text )
 void Popup::SetTitle( Toolkit::TextView titleActor )
 {
   // Replaces the current title actor.
-  if( mTitle && mPopupBg )
+  if( mPopupLayout )
   {
-    mPopupBg.Remove( mTitle );
+    mPopupLayout.RemoveChildAt( Toolkit::TableView::CellPosition( 0, 0 ) );
   }
+
   mTitle = titleActor;
 
-  mPopupBg.Add( mTitle );
+  if( mPopupLayout )
+  {
+    mTitle.SetPadding( Padding( 0.0f, 0.0f, mPopupStyle->margin, mPopupStyle->margin ) );
+    mTitle.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+    mTitle.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
+    mPopupLayout.AddChild( mTitle, Toolkit::TableView::CellPosition( 0, 0 ) );
+  }
 
   RelayoutRequest();
 }
@@ -285,9 +299,37 @@ Toolkit::TextView Popup::GetTitle() const
   return mTitle;
 }
 
+void Popup::CreateFooter()
+{
+  if( !mBottomBg )
+  {
+    // Adds bottom background
+    mBottomBg = Actor::New();
+    mBottomBg.SetName( "POPUP_BOTTOM_BG" );
+    mBottomBg.SetRelayoutEnabled( true );
+    mBottomBg.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+
+    mPopupLayout.SetFixedHeight( 2, mPopupStyle->bottomSize.height );   // Buttons
+    mPopupLayout.AddChild( mBottomBg, Toolkit::TableView::CellPosition( 2, 0 ) );
+  }
+}
+
 void Popup::AddButton( Toolkit::Button button )
 {
   mButtons.push_back( button );
+  button.SetResizePolicy( USE_ASSIGNED_SIZE, ALL_DIMENSIONS );    // Size will be assigned to it
+
+  // If this is the first button added
+  if( mButtons.size() == 1 )
+  {
+    CreateFooter();
+
+    if( mButtonAreaImage )
+    {
+      mBottomBg.Add( mButtonAreaImage );
+    }
+  }
+
   mBottomBg.Add( button );
 
   RelayoutRequest();
@@ -347,6 +389,8 @@ void Popup::ShowTail(const Vector3& position)
     mTailImage.SetParentOrigin(position);
     mTailImage.SetAnchorPoint(anchorPoint);
 
+    CreateFooter();
+
     mBottomBg.Add(mTailImage);
   }
 }
@@ -369,30 +413,25 @@ PopupStylePtr Popup::GetStyle() const
 
 void Popup::SetDefaultBackgroundImage()
 {
-  Image bg = ResourceImage::New( mPopupStyle->backgroundImage );
-  ImageActor bgImage = ImageActor::New( bg );
-  bgImage.SetStyle( ImageActor::STYLE_NINE_PATCH );
-  bgImage.SetNinePatchBorder( mPopupStyle->backgroundScale9Border );
-
   Image buttonBg = ResourceImage::New( mPopupStyle->buttonAreaImage );
   ImageActor buttonBgImage = ImageActor::New( buttonBg );
   buttonBgImage.SetStyle( ImageActor::STYLE_NINE_PATCH );
   buttonBgImage.SetNinePatchBorder( mPopupStyle->buttonArea9PatchBorder );
 
-  SetBackgroundImage( bgImage );
+  SetBackgroundImage( ImageActor::New( ResourceImage::New( mPopupStyle->backgroundImage ) ) );
   SetButtonAreaImage( buttonBgImage );
 }
 
 void Popup::CreateBacking()
 {
   mBacking = Dali::Toolkit::CreateSolidColorActor( mPopupStyle->backingColor );
+  mBacking.SetName( "POPUP_BACKING" );
 
-  mBacking.SetPositionInheritanceMode(DONT_INHERIT_POSITION);
+  mBacking.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
   mBacking.SetSensitive(true);
 
-  mLayer.Add(mBacking);
+  mLayer.Add( mBacking );
   mBacking.SetOpacity(0.0f);
-  mBacking.SetPosition(0.0f, 0.0f, BACKING_DEPTH);
   mBacking.TouchedSignal().Connect( this, &Popup::OnBackingTouched );
   mBacking.MouseWheelEventSignal().Connect(this, &Popup::OnBackingMouseWheelEvent);
 }
@@ -401,19 +440,12 @@ void Popup::CreateDialog()
 {
   // Adds default background image.
   SetDefaultBackgroundImage();
-
-  // Adds bottom background
-  mBottomBg = Actor::New();
-  mPopupBg.Add( mBottomBg );
 }
 
 void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration )
 {
-  const Vector2& stageSize( Stage::GetCurrent().GetSize() );
-
   Vector3 targetSize;
   float targetBackingAlpha;
-  Vector3 targetBackingSize;
 
   if(mState == state)
   {
@@ -426,7 +458,6 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration
     {
       targetSize = Vector3(0.0f, 0.0f, 1.0f);
       targetBackingAlpha = 0.0f;
-      targetBackingSize = Vector3(0.0f, 0.0f, 1.0f);
       mShowing = false;
       ClearKeyInputFocus();
 
@@ -448,17 +479,16 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration
     {
       targetSize = Vector3(1.0f, 1.0f, 1.0f);
       targetBackingAlpha = 1.0f;
-      float length = (stageSize.width > stageSize.height) ? stageSize.width : stageSize.height;
-      targetBackingSize = Vector3( length, length, 1.0f );
       mShowing = true;
 
       // Add contents to stage for showing.
       if( !mLayer.GetParent() )
       {
-        mAlterAddedChild = false;
-        Self().Add(mLayer);
-        mAlterAddedChild = true;
+        Dali::Stage stage = Dali::Stage::GetCurrent();
+        stage.Add( mLayer );
+        mLayer.RaiseToTop();
       }
+
       Self().SetSensitive(true);
       SetKeyInputFocus();
 
@@ -487,8 +517,7 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration
     }
   }
 
-  mBacking.SetSize( targetBackingSize );
-
+  Actor self = Self();
   if(duration > Math::MACHINE_EPSILON_1)
   {
     if ( mAnimation )
@@ -502,12 +531,12 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration
     if(mShowing)
     {
       mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
-      mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(duration * 0.5f, duration * 0.5f) );
+      mAnimation.AnimateTo( Property(self, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(duration * 0.5f, duration * 0.5f) );
     }
     else
     {
       mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
-      mAnimation.AnimateTo( Property(mPopupBg, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
+      mAnimation.AnimateTo( Property(self, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
     }
     mAnimation.Play();
     mAnimation.FinishedSignal().Connect(this, &Popup::OnStateAnimationFinished);
@@ -515,7 +544,7 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration
   else
   {
     mBacking.SetOpacity( targetBackingAlpha );
-    mPopupBg.SetScale( targetSize );
+    self.SetScale( targetSize );
 
     HandleStateChangeComplete();
   }
@@ -524,9 +553,9 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration
 void Popup::HandleStateChangeComplete()
 {
   // Remove contents from stage if completely hidden.
-  if( (mState == Toolkit::Popup::POPUP_HIDE) && (mLayer.GetParent()) )
+  if( ( mState == Toolkit::Popup::POPUP_HIDE ) && mLayer.GetParent() )
   {
-    Self().Remove(mLayer);
+    mLayer.Unparent();
     Self().SetSensitive( false );
 
     // Guard against destruction during signal emission
@@ -612,169 +641,78 @@ void Popup::OnControlChildAdd( Actor& child )
     // Removes previously added content.
     if( mContent )
     {
-      mPopupBg.Remove( mContent );
+      mPopupLayout.RemoveChildAt( Toolkit::TableView::CellPosition( 1, 0 ) );
     }
 
-    // Reparent new content.
-    Self().Remove( child );
-
     // keep a handle to the new content.
     mContent = child;
 
-    mPopupBg.Add( mContent );
+    mPopupLayout.AddChild( mContent, Toolkit::TableView::CellPosition( 1, 0 ) );
   }
 }
 
-void Popup::OnControlSizeSet( const Vector3& targetSize )
+void Popup::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
-  mLayer.SetSize( targetSize );
-  mPopupBg.SetSize( targetSize );
-
-  const Vector4 outerBorder = mPopupStyle->backgroundOuterBorder;
-  if( mBackgroundImage )
-  {
-    mBackgroundImage.SetSize( BackgroundSize( outerBorder,targetSize ) );
-  }
-  if( mButtonAreaImage )
-  {
-    mButtonAreaImage.SetSize( ButtonAreaSize( outerBorder, targetSize ) );
-  }
-
-}
-
-void Popup::OnRelayout( const Vector2& size, ActorSizeContainer& container )
-{
-  // Set the popup size
-  Vector2 popupSize;
-  popupSize.width  = size.width - 2.f * ( POPUP_OUT_MARGIN_WIDTH + mPopupStyle->margin );
-  popupSize.height = size.height - 2.f * ( POPUP_OUT_MARGIN_WIDTH + mPopupStyle->margin );
-
-  // Update sizes of all popup's components.
-
-  // Relayout background image.
-  // Adjust background position and size relative to parent to cater to outer Border.
-  // Some backgrounds are intended to over-spill. That is some content
-  // should appear outside the Dialog on all sides i.e. Shadows, glow effects.
-  const Vector4 outerBorder = mPopupStyle->backgroundOuterBorder;
-
-  if( mBackgroundImage )
-  {
-    mBackgroundImage.SetSize(BackgroundSize(outerBorder, Vector3(size)));
-    mBackgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-    mBackgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-    mBackgroundImage.SetPosition( -outerBorder.x, -outerBorder.y, 0.0f );
-  }
-
-  if( mPopupBg && mButtonAreaImage )
-  {
-    // If there are no buttons, button background is also removed.
-    if ( mButtons.size() == 0 )
-    {
-      mPopupBg.Remove( mButtonAreaImage );
-    }
-    else
-    {
-      mButtonAreaImage.SetSize( ButtonAreaSize(outerBorder, Vector3(size)) );
-      mButtonAreaImage.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-      mButtonAreaImage.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
-      mButtonAreaImage.SetY( -outerBorder.z - POPUP_OUT_MARGIN_HEIGHT );
-
-      mPopupBg.Add( mButtonAreaImage );
-    }
-  }
-
-  // Relayout title
-  Vector3 positionOffset( 0.0f, mPopupStyle->margin + POPUP_OUT_MARGIN_WIDTH, CONTENT_DEPTH );
-  if( mTitle )
-  {
-    Vector2 titleSize;
-    titleSize.width  = popupSize.width;
-    titleSize.height = mTitle.GetHeightForWidth( titleSize.width );
-
-    // As the default size policy for text-view is Fixed & Fixed, a size needs to be set.
-    // Otherwise size-negotiation algorithm uses the GetNaturalSize() with doesn't take
-    // into account the multiline and exceed policies, giving as result a wrong size.
-    mTitle.SetSize( titleSize );
-    Relayout( mTitle, titleSize, container );
-
-    mTitle.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-    mTitle.SetParentOrigin( ParentOrigin::TOP_CENTER );
-    mTitle.SetPosition( positionOffset );
-
-    positionOffset.y += titleSize.height + mPopupStyle->margin;
-  }
-
-  // Relayout content
-  if( mContent )
-  {
-    // If the content width is greater than popup width then scale it down/wrap text as needed
-    Vector2 contentSize( RelayoutHelper::GetNaturalSize( mContent ) );
-    if( contentSize.width > popupSize.width )
-    {
-      contentSize.width = popupSize.width;
-      contentSize.height = RelayoutHelper::GetHeightForWidth( mContent, contentSize.width );
-    }
-
-    mContent.SetSize( contentSize );
-    Relayout( mContent, contentSize, container );
-
-    mContent.SetParentOrigin(ParentOrigin::TOP_CENTER);
-    mContent.SetAnchorPoint(AnchorPoint::TOP_CENTER);
-
-    mContent.SetPosition( positionOffset );
-
-    positionOffset.y += contentSize.height + mPopupStyle->margin;
-  }
-
-  // Relayout Button Area
-  if( mBottomBg )
-  {
-    mBottomBg.SetSize( popupSize.width, mPopupStyle->bottomSize.height );
-
-    mBottomBg.SetParentOrigin(ParentOrigin::TOP_CENTER);
-    mBottomBg.SetAnchorPoint(AnchorPoint::TOP_CENTER);
-
-    mBottomBg.SetPosition( positionOffset );
-  }
+  // Hide the background image
+  mBackgroundImage.SetVisible( !( mButtons.empty() && mPopupLayout.GetChildCount() == 0 ) );
 
   // Relayout All buttons
   if ( !mButtons.empty() )
   {
     // All buttons should be the same size and fill the button area. The button spacing needs to be accounted for as well.
-    Vector2 buttonSize( ( ( popupSize.width - mPopupStyle->buttonSpacing * ( mButtons.size() - 1 ) ) / mButtons.size() ),
+    Vector2 buttonSize( ( ( size.width - mPopupStyle->buttonSpacing * ( mButtons.size() + 1 ) ) / mButtons.size() ),
                         mPopupStyle->bottomSize.height - mPopupStyle->margin );
 
-    Vector3 buttonPosition;
+    Vector3 buttonPosition( mPopupStyle->buttonSpacing, 0.0f, 0.0f );
 
     for ( ActorIter iter = mButtons.begin(), endIter = mButtons.end();
           iter != endIter;
           ++iter, buttonPosition.x += mPopupStyle->buttonSpacing + buttonSize.width )
     {
-      iter->SetPosition( buttonPosition );
+      Actor button = *iter;
 
       // If there is only one button, it needs to be laid out on center.
       if ( mButtons.size() == 1 )
       {
-        iter->SetAnchorPoint( AnchorPoint::CENTER );
-        iter->SetParentOrigin( ParentOrigin::CENTER );
+        buttonPosition.x = 0.0f;
+        button.SetAnchorPoint( AnchorPoint::CENTER );
+        button.SetParentOrigin( ParentOrigin::CENTER );
       }
       else
       {
-        iter->SetAnchorPoint( AnchorPoint::CENTER_LEFT );
-        iter->SetParentOrigin( ParentOrigin::CENTER_LEFT );
+        button.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
+        button.SetParentOrigin( ParentOrigin::CENTER_LEFT );
       }
 
-      Relayout( *iter, buttonSize, container );
+      button.SetPosition( buttonPosition );
+
+      button.PropagateRelayoutFlags();    // Reset relayout flags for relayout
+      container.Add( button, buttonSize );
     }
   }
+}
 
-  if( mShowing && mBacking )
+void Popup::OnSetResizePolicy( ResizePolicy policy, Dimension dimension )
+{
+  if( mPopupLayout )
   {
-    Vector2 stageSize = Stage::GetCurrent().GetSize();
-    float length = (stageSize.width > stageSize.height) ? stageSize.width : stageSize.height;
-    Vector3 targetBackingSize = Vector3( length, length, 1.0f );
-
-    mBacking.SetSize( targetBackingSize );
+    if( policy == FIT_TO_CHILDREN )
+    {
+      mPopupLayout.SetResizePolicy( USE_NATURAL_SIZE, dimension );
+      if( dimension & HEIGHT )
+      {
+        mPopupLayout.SetFitHeight( 1 );
+      }
+    }
+    else
+    {
+      mPopupLayout.SetResizePolicy( FILL_TO_PARENT, dimension );
+      // Make the content cell fill the whole of the available space
+      if( dimension & HEIGHT )
+      {
+        mPopupLayout.SetRelativeHeight( 1, 1.0f );
+      }
+    }
   }
 }
 
@@ -826,13 +764,13 @@ Vector3 Popup::GetNaturalSize()
 
   if( mContent )
   {
-    Vector3 contentSize = RelayoutHelper::GetNaturalSize( mContent );
+    Vector3 contentSize = mContent.GetNaturalSize();
     // Choose the biggest width
     naturalSize.width = std::max( naturalSize.width, contentSize.width );
     if( naturalSize.width > maxWidth )
     {
       naturalSize.width = maxWidth;
-      contentSize.height = RelayoutHelper::GetHeightForWidth( mContent, maxWidth );
+      contentSize.height = mContent.GetHeightForWidth( maxWidth );
     }
     naturalSize.height += contentSize.height + mPopupStyle->margin;
   }
@@ -862,7 +800,7 @@ float Popup::GetHeightForWidth( float width )
 
   if( mContent )
   {
-    height += RelayoutHelper::GetHeightForWidth( mContent, popupWidth ) + mPopupStyle->margin;
+    height += mContent.GetHeightForWidth( popupWidth ) + mPopupStyle->margin;
   }
 
   if( !mButtons.empty() )
index b6ee02b..ec85966 100755 (executable)
@@ -27,6 +27,7 @@
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/popup/popup.h>
 #include <dali-toolkit/internal/controls/popup/popup-style-impl.h>
+#include <dali-toolkit/public-api/controls/table-view/table-view.h>
 
 namespace Dali
 {
@@ -122,7 +123,6 @@ public:
    */
   void HideTail();
 
-
   /**
    * Sets the style of the popup
    * @param[in] style The style of the popup
@@ -135,6 +135,11 @@ public:
    */
   PopupStylePtr GetStyle() const;
 
+  /**
+   * @copydoc Toolkit::Popup::MarkDirtyForRelayout
+   */
+  void MarkDirtyForRelayout();
+
 protected:
 
   /**
@@ -251,14 +256,14 @@ private:
   virtual void OnControlChildAdd( Actor& child );
 
   /**
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& size )
+   * @copydoc Control::OnRelayOut()
    */
-  virtual void OnControlSizeSet( const Vector3& size );
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
 
   /**
-   * @copydoc Control::OnRelayOut()
+   * @copydoc Control::OnSetResizePolicy()
    */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
+  virtual void OnSetResizePolicy( ResizePolicy policy, Dimension dimension );
 
   /**
    * @copydoc Control::OnKeyEvent()
@@ -285,6 +290,11 @@ private:
    */
   Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled);
 
+  /**
+   * Create the root actor for the footer
+   */
+  void CreateFooter();
+
 private:
 
   // Undefined
@@ -308,7 +318,7 @@ private:
   bool mShowing;                          ///< Popup is showing or not
 
   Layer mLayer;                           ///< Popup Layer (i.e. Dim backing and PopupBg reside in this)
-  Actor mPopupBg;                         ///< Popup Background (i.e. dialog reside in this)
+  Toolkit::TableView mPopupLayout;        ///< Popup layout (i.e. dialog reside in this)
   ImageActor mBacking;                    ///< Backing actor (dim effect)
 
   Actor mPreviousFocusedActor;            ///< Store the previous focused actor to restore the focus when popup hide
index 2a94eff..4dba00b 100644 (file)
@@ -26,9 +26,9 @@ namespace // unnamed namespace
 // Popup style default
 const Vector4 DEFAULT_BACKING_COLOR = Vector4(0.0f, 0.0f, 0.0f, 0.5f);
 const float DEFAULT_MARGIN = 20.0f;          //From Tizen GUI UX
-const float DEFAULT_BUTTON_SPACING = 20.0f;  //From Tizen GUI UX
+const float DEFAULT_BUTTON_SPACING = 10.0f;  //From Tizen GUI UX
 const Vector3 DEFAULT_BUTTON_SIZE(275.0f, 74.0f, 0.0f);
-const char* DEFAULT_BACKGROUND_IMAGE_PATH = DALI_IMAGE_DIR "00_popup_bg.png";
+const char* DEFAULT_BACKGROUND_IMAGE_PATH = DALI_IMAGE_DIR "00_popup_bg.9.png";
 const char* DEFAULT_BUTTON_AREA_IMAGE_PATH = DALI_IMAGE_DIR "00_popup_button_bg.png";
 const char* DEFAULT_TAIL_UP_IMAGE_PATH = DALI_IMAGE_DIR "popup_tail_up.png";
 const char* DEFAULT_TAIL_DOWN_IMAGE_PATH = DALI_IMAGE_DIR "popup_tail_down.png";
@@ -37,7 +37,7 @@ const char* DEFAULT_TAIL_RIGHT_IMAGE_PATH = DALI_IMAGE_DIR "popup_tail_right.png
 const Vector3 DEFAULT_BOTTOM_SIZE(620.0f,96.0f,0.0f);
 const Vector2 DEFAULT_BACKGROUND_SIZE(620.0f, 236.0f);
 const Vector4 DEFAULT_BACKGROUND_STYLE_9_BORDER( 25.0f, 25.0f, 26.0f, 50.0f );
-const Vector4 DEFAULT_BACKGROUND_OUTER_BORDER( 0.0f, 0.0f, 0.0f, 0.0f );
+const Vector4 DEFAULT_BACKGROUND_OUTER_BORDER( 40.0f, 0.0f, 30.0f, 0.0f );
 const Vector4 DEFAULT_BUTTON_AREA_9_PATCH_BORDER( 13.0f, 8.0f, 13.0f, 8.0f );
 }
 
diff --git a/dali-toolkit/internal/controls/relayout-controller-impl.cpp b/dali-toolkit/internal/controls/relayout-controller-impl.cpp
deleted file mode 100644 (file)
index 09b7fcf..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright (c) 2014 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 "relayout-controller-impl.h"
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/layer.h>
-#include <dali/public-api/common/stage.h>
-#include <dali/integration-api/debug.h>
-
-#if defined(DEBUG_ENABLED)
-#include <sstream>
-#endif // defined(DEBUG_ENABLED)
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/text-view/text-view.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace
-{
-#if defined(DEBUG_ENABLED)
-
-Integration::Log::Filter* gLogFilter( Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_RELAYOUT_CONTROLLER") );
-
-/**
- * Prints out all the children of the given actor when debug is enabled.
- *
- * @param[in]  actor  The actor whose children to print.
- * @param[in]  level  The number of " | " to put in front of the children.
- */
-void PrintChildren( Actor actor, int level )
-{
-  std::ostringstream output;
-
-  for ( int t = 0; t < level; ++t )
-  {
-    output << " | ";
-  }
-
-  output << actor.GetTypeName();
-
-  output << " - Pos: " << actor.GetCurrentPosition() << " Size: " << actor.GetCurrentSize() << ",";
-
-  output << " (" << actor.GetObjectPtr() << ")" << std::endl;
-
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, output.str().c_str() );
-
-  ++level;
-  unsigned int numChildren = actor.GetChildCount();
-  for( unsigned int i=0; i<numChildren; ++i )
-  {
-    PrintChildren( actor.GetChildAt(i), level );
-  }
-  --level;
-}
-
-/**
- * Prints the entire hierarchy of the scene.
- */
-void PrintHierarchy()
-{
-  if ( gLogFilter->IsEnabledFor( Debug::Verbose ) )
-  {
-    PrintChildren( Stage().GetCurrent().GetRootLayer(), 0 );
-  }
-}
-
-#define PRINT_HIERARCHY PrintHierarchy()
-
-#else // defined(DEBUG_ENABLED)
-
-#define PRINT_HIERARCHY
-
-#endif // defined(DEBUG_ENABLED)
-
-/**
- * Sets the target to source if the individual elements of source are NOT zero.
- *
- * @param[out]  target  The Vector2 elements to set if the source Vector2 elements are not 0.
- * @param[in]   source  The Vector2 elements that are to be set to the target Vector2.
- */
-void SetIfNotZero( Vector2& target, const Vector2& source )
-{
-  // Only set the width if it is non zero.
-  if ( !EqualsZero( source.width ) )
-  {
-    target.width  = source.width;
-  }
-
-  // Only set the height if it is non zero.
-  if ( !EqualsZero( source.height ) )
-  {
-    target.height = source.height;
-  }
-}
-
-/**
- * Finds controls in the hierarchy of actor. It descends the tree if the actor has more Actors.
- * If it is a control, it no longer descends the tree.
- *
- * @param[in]  actor  The actor in which controls should be found.
- * @param[in]  size   The size that this actor and its children should be.
- */
-void FindControls( Actor actor, ControlStack& controls, Vector2 size )
-{
-  Toolkit::Control control( Toolkit::Control::DownCast( actor ) );
-  if( control )
-  {
-    // If the control size has been set by the application / control, then we should try and honour that.
-    Vector2 controlSetSize( control.GetImplementation().GetSizeSet() );
-
-    // Only set the width and height if they are non zero.
-    SetIfNotZero( size, controlSetSize );
-
-    controls.push_back( ControlSizePair( control, size ) );
-  }
-  else
-  {
-    unsigned int numChildren = actor.GetChildCount();
-    for( unsigned int i=numChildren; i>0; --i )
-    {
-      FindControls( actor.GetChildAt(i-1), controls, size );
-    }
-  }
-}
-
-/**
- * Pushes the controls in the container, to the stack.
- *
- * @param[in,out]  controlStack  The stack to push controls to.
- * @param[in]      container     The container to push controls from.
- */
-void PushToStack( ControlStack& controlStack, const ActorSizeContainer& container )
-{
-  for ( ActorSizeContainer::const_reverse_iterator iter = container.rbegin(), endIter = container.rend(); iter != endIter; ++iter )
-  {
-    FindControls( iter->first, controlStack, iter->second );
-  }
-}
-
-} // unnamed namespace
-
-RelayoutControllerImpl::RelayoutControllerImpl( bool& relayoutFlag )
-: mRelayoutFlag( relayoutFlag ),
-  mRelayoutConnection( false )
-{
-  // make space for 32 controls to avoid having to copy construct a lot in the beginning
-  mControlStack.reserve( 32 );
-  mSizecontainer.reserve( 32 );
-}
-
-RelayoutControllerImpl::~RelayoutControllerImpl()
-{
-}
-
-void RelayoutControllerImpl::Request()
-{
-  //TODO use Relayout Request to set up logic to optimize relayout of the actors/controls in the scene
-
-  if( !mRelayoutConnection )
-  {
-    Stage stage = Stage::GetCurrent();
-    stage.EventProcessingFinishedSignal().Connect( this, &RelayoutControllerImpl::Relayout );
-    mRelayoutConnection = true;
-  }
-}
-
-void RelayoutControllerImpl::Relayout()
-{
-  // only do something when requested
-  if( mRelayoutFlag )
-  {
-    // clear the flag as we're now doing the relayout
-    mRelayoutFlag = false;
-    PRINT_HIERARCHY;
-
-    mControlStack.clear(); // we do not release memory, just empty the container
-
-    // 1. Finds all top-level controls from the root actor and allocate them the size of the stage
-    //    These controls are paired with the stage size and added to the stack.
-    FindControls( Stage().GetCurrent().GetRootLayer(), mControlStack, Stage::GetCurrent().GetSize() );
-
-    // 2. Iterate through the stack until it's empty.
-    while ( !mControlStack.empty() )
-    {
-      ControlSizePair pair ( mControlStack.back() );
-      Toolkit::Control control ( pair.first );
-      Vector2 size ( pair.second );
-      mControlStack.pop_back();
-
-      DALI_LOG_INFO( gLogFilter, Debug::General, "Allocating %p (%.2f, %.2f)\n", control.GetObjectPtr(), size.width, size.height );
-
-      mSizecontainer.clear();
-      // 3. Negotiate the size with the current control. Pass it an empty container which the control
-      //    has to fill with all the actors it has not done any size negotiation for.
-      control.GetImplementation().NegotiateSize( size, mSizecontainer );
-
-      // 4. Push the controls from the actors in the container to the stack.
-      PushToStack( mControlStack, mSizecontainer );
-    }
-  }
-  // should not disconnect the signal as that causes some control size negotiations to not work correctly
-  // this algorithm needs more optimization as well
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/relayout-controller-impl.h b/dali-toolkit/internal/controls/relayout-controller-impl.h
deleted file mode 100644 (file)
index f60d5e5..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__
-#define __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__
-
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
-#include <dali/public-api/object/base-object.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control.h>
-#include <dali-toolkit/public-api/controls/control-impl.h>
-#include "relayout-controller.h"
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-class RelayoutController;
-
-typedef std::pair< Dali::Toolkit::Control, Vector2 > ControlSizePair;
-typedef std::vector< ControlSizePair > ControlStack;
-
-/**
- * @copydoc Toolkit::Internal::RelayoutController
- */
-class RelayoutControllerImpl : public Dali::BaseObject, public ConnectionTracker
-{
-public:
-
-  /**
-   * Constructor.
-   * We should only create a unique instance.
-   * @param relayoutFlag to avoid unnecessary calls inside a single frame
-   */
-  RelayoutControllerImpl( bool& relayoutFlag );
-
-
-  /**
-   * Destructor
-   */
-  virtual ~RelayoutControllerImpl();
-
-  /**
-   * Request for relayout.
-   */
-  void Request();
-
-private:
-
-  /**
-   * Relayouts controls inside actor tree from bottom to top.
-   */
-  void Relayout();
-
-  /**
-   * Resets the relayout controller.
-   */
-  void Reset();
-
-  /**
-   * Disconnect the Relayout() method from the Stage::EventProcessingFinishedSignal().
-   */
-  void Disconnect();
-
-  // Undefined
-  RelayoutControllerImpl(const RelayoutControllerImpl&);
-  RelayoutControllerImpl& operator=(const RelayoutControllerImpl&);
-
-private:
-
-  bool& mRelayoutFlag;               ///< reference to relayout flag to avoid unnecessary calls
-  ControlStack mControlStack;        ///< stack for relayouting
-  ActorSizeContainer mSizecontainer; ///< size container
-  bool mRelayoutConnection:1;        ///< Whether EventProcessingFinishedSignal signal is connected.
-
-};
-
-} // namespace Internal
-
-
-inline Internal::RelayoutControllerImpl& GetImpl(Dali::Toolkit::Internal::RelayoutController& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  Dali::BaseObject& handle = obj.GetBaseObject();
-
-  return static_cast<Internal::RelayoutControllerImpl&>(handle);
-}
-
-inline const Internal::RelayoutControllerImpl& GetImpl(const Dali::Toolkit::Internal::RelayoutController& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  const Dali::BaseObject& handle = obj.GetBaseObject();
-
-  return static_cast<const Internal::RelayoutControllerImpl&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_IMPL_H__
diff --git a/dali-toolkit/internal/controls/relayout-controller.cpp b/dali-toolkit/internal/controls/relayout-controller.cpp
deleted file mode 100644 (file)
index 19b2ab0..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2014 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 "relayout-controller.h"
-
-// EXTERNAL INCLUDES
-#include <stack>
-#include <sstream>
-#include <dali/public-api/adaptor-framework/singleton-service.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-
-#include "relayout-controller-impl.h"
-#include "dali-toolkit/public-api/controls/control.h"
-#include "dali-toolkit/public-api/controls/control-impl.h"
-#include "dali-toolkit/public-api/controls/text-view/text-view.h"
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace
-{
-// Flag to avoid doing more than one request per frame
-// getting the singleton handle can be expensive as it requires calling to adaptor, dynamic cast etc
-// and it can get called 100 times per frame easily in startup and new view initialization
-  bool gRelayoutRequestPending = false;
-}
-
-RelayoutController::RelayoutController()
-{
-
-}
-
-RelayoutController::~RelayoutController()
-{
-
-}
-
-void RelayoutController::Request()
-{
-  // are we already going to do it this frame
-  if( !gRelayoutRequestPending )
-  {
-    RelayoutController controller;
-
-    // Check whether the RelayoutController is already created
-    SingletonService singletonService( SingletonService::Get() );
-    if ( singletonService )
-    {
-      Dali::BaseHandle handle = singletonService.GetSingleton(typeid(RelayoutController));
-
-      if(handle)
-      {
-        // If so, downcast the handle of singleton to RelayoutController
-        controller = RelayoutController(dynamic_cast<Internal::RelayoutControllerImpl*>(handle.GetObjectPtr()));
-      }
-
-      if(!controller)
-      {
-        // If not, create the RelayoutController and register it as a singleton
-        controller = RelayoutController( new Internal::RelayoutControllerImpl(gRelayoutRequestPending) );
-        singletonService.Register( typeid(controller), controller );
-      }
-
-      GetImpl(controller).Request();
-      gRelayoutRequestPending = true;
-    }
-  }
-}
-
-RelayoutController::RelayoutController(Internal::RelayoutControllerImpl *impl)
-  : BaseHandle(impl)
-{
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
diff --git a/dali-toolkit/internal/controls/relayout-controller.h b/dali-toolkit/internal/controls/relayout-controller.h
deleted file mode 100644 (file)
index 40438b9..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_H__
-#define __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_H__
-
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/base-handle.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-class RelayoutControllerImpl;
-
-/**
- * RelayoutController
- * This singleton class provides functionality to trigger relayouting of toolkit controls in the dali scene graph.
- */
-class RelayoutController : public Dali::BaseHandle
-{
-public:
-
-  /**
-   * Constructor.
-   * We should only create a unique instance.
-   */
-  RelayoutController();
-
-  /**
-   * @brief Destructor
-   *
-   * This is non-virtual since derived Handle types must not contain data or virtual methods.
-   */
-  ~RelayoutController();
-
-  /**
-   * Request to relayout.
-   */
-  static void Request();
-
-private:
-
-  RelayoutController(Internal::RelayoutControllerImpl* impl);
-
-};
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_RELAYOUT_CONTROLLER_H__
diff --git a/dali-toolkit/internal/controls/relayout-helper.cpp b/dali-toolkit/internal/controls/relayout-helper.cpp
deleted file mode 100644 (file)
index 6b0aeb3..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2014 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 "relayout-helper.h"
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/actors/text-actor.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control.h>
-
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace RelayoutHelper
-{
-
-Vector3 GetNaturalSize( Actor actor )
-{
-  Vector3 size( 0.0f, 0.0f, 0.0f );
-
-  Toolkit::Control control = Toolkit::Control::DownCast( actor );
-  if( control )
-  {
-    size = control.GetNaturalSize();
-  }
-  else
-  {
-    size = actor.GetCurrentSize();
-    const float depth = size.depth;
-
-    // Get natural size for ImageActor.
-    // TODO: currently it doesn't work as expected.
-    ImageActor imageActor = ImageActor::DownCast( actor );
-    if( ( imageActor ) && ( imageActor.GetImage() ) )
-    {
-      Image image = imageActor.GetImage();
-      size = Vector3( static_cast<float>( image.GetWidth() ), static_cast<float>( image.GetHeight() ), depth );
-    }
-    else
-    {
-      // Get natural size for TextActor.
-      TextActor textActor = TextActor::DownCast( actor );
-      if( textActor )
-      {
-        Font font = textActor.GetFont();
-        if( !font )
-        {
-          font = Font::New();
-        }
-        size = font.MeasureText( textActor.GetText() );
-        size.depth = depth;
-      }
-    }
-  }
-
-  return size;
-}
-
-float GetHeightForWidth( Actor actor, float width )
-{
-  float height = 0.0f;
-
-  Toolkit::Control control = Toolkit::Control::DownCast( actor );
-  if( control )
-  {
-    height = control.GetHeightForWidth( width );
-  }
-  else
-  {
-    bool constrainSize = false;
-    Vector3 size( 0.0f, 0.0f, 0.0f );
-
-    ImageActor imageActor = ImageActor::DownCast( actor );
-    if( ( imageActor ) && ( imageActor.GetImage() ) )
-    {
-      Image image = imageActor.GetImage();
-      size = Vector3( static_cast<float>( image.GetWidth() ), static_cast<float>( image.GetHeight() ), 0.0f );
-
-      constrainSize = true;
-    }
-    else
-    {
-      TextActor textActor = TextActor::DownCast( actor );
-      if( textActor )
-      {
-        Font font = textActor.GetFont();
-        if( !font )
-        {
-          font = Font::New();
-        }
-        size = font.MeasureText( textActor.GetText() );
-
-        constrainSize = true;
-      }
-      else
-      {
-        size = actor.GetCurrentSize();
-      }
-    }
-
-    // Scale the actor
-    float scaleRatio = width / size.width;
-    if( constrainSize )
-    {
-      // Allow the scale to decrease if greater than input width but not increase if less than input width
-      if( scaleRatio > 1.0f )
-      {
-        scaleRatio = 1.0f;
-      }
-    }
-
-    height = size.height * scaleRatio;
-  }
-
-  return height;
-}
-
-} // namespace RelayoutHelper
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/relayout-helper.h b/dali-toolkit/internal/controls/relayout-helper.h
deleted file mode 100644 (file)
index c7f2372..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_RELAYOUT_HELPER_H__
-#define __DALI_TOOLKIT_INTERNAL_RELAYOUT_HELPER_H__
-
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/actor.h>
-#include <dali/public-api/math/vector3.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace RelayoutHelper
-{
-
-/**
- * Gets the natural size of the given actor.
- *
- * If the actor is a Control, it returns the natural size of the Control. @see Control::GetNaturalSize()
- * If the actor is an ImageActor, it returns the size of the image.
- * If the actor is a TextActor, it returns the size of the text. @see Font::MeasureText()
- * Otherwise it returns the actor's current size. @see Actor::GetCurrentSize()
- *
- * @param[in] actor The actor.
- *
- * @return The natural size.
- */
-Vector3 GetNaturalSize( Actor actor );
-
-/**
- * Gets the actor's height for the given width.
- *
- * If the actor is a Control it returns the height for width. @see Control::GetHeightForWidth()
- * If the actor is an ImageActor or a TextActor it scales the natural size to fit the given width. @see GetNaturalSize()
- * Otherwise it returns the actor's current size. @see Actor::GetCurrentSize()
- *
- * @param[in] actor The actor.
- * @param[in] width The width.
- *
- * @return The actor's height for given width.
- */
-float GetHeightForWidth( Actor actor, float width );
-
-} // namespace RelayoutHelper
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_RELAYOUT_HELPER_H__
index bae2b78..cd3a764 100755 (executable)
@@ -250,6 +250,8 @@ void ScrollBar::OnScrollPositionNotified(PropertyNotification& source)
 
 void ScrollBar::Show()
 {
+  Actor self = Self();
+
   // Cancel any animation
   if(mAnimation)
   {
@@ -260,17 +262,19 @@ void ScrollBar::Show()
   if(mIndicatorShowDuration > 0.0f)
   {
     mAnimation = Animation::New( mIndicatorShowDuration );
-    mAnimation.OpacityTo( Self(), 1.0f, AlphaFunctions::EaseIn );
+    mAnimation.AnimateTo( Property( self, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::EaseIn );
     mAnimation.Play();
   }
   else
   {
-    Self().SetOpacity(1.0f);
+    self.SetOpacity(1.0f);
   }
 }
 
 void ScrollBar::Hide()
 {
+  Actor self = Self();
+
   // Cancel any animation
   if(mAnimation)
   {
@@ -281,12 +285,12 @@ void ScrollBar::Hide()
   if(mIndicatorHideDuration > 0.0f)
   {
     mAnimation = Animation::New( mIndicatorHideDuration );
-    mAnimation.OpacityTo( Self(), 0.0f, AlphaFunctions::EaseIn );
+    mAnimation.AnimateTo( Property( self, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunctions::EaseIn );
     mAnimation.Play();
   }
   else
   {
-    Self().SetOpacity(0.0f);
+    self.SetOpacity(0.0f);
   }
 }
 
index 1dfced0..b01505b 100755 (executable)
@@ -393,32 +393,32 @@ ScrollBarInternal::ScrollBarInternal(Toolkit::Scrollable& container, bool vertic
   // target the container to observe for scrolling
   Actor target = mContainer.Self();
   Constraint constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
-                                      Source( target, vertical ? target.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL) : target.GetPropertyIndex(Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL)),
+                                      Source( target, vertical ? Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL : Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL),
                                       ScrollBarInternalVisibilityConstraint );
   mSlider.ApplyConstraint( constraint );
   mSliderWrap.ApplyConstraint( constraint );
 
   constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
-                                                   Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                                   Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
-                                                   Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
+                                                   Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                                   Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
+                                                   Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
                                                    Source( target, Actor::Property::SIZE ),
                                                    ScrollBarInternalSizeConstraint( vertical ) );
   mSlider.ApplyConstraint( constraint );
   mSliderWrap.ApplyConstraint( constraint );
 
   constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
-                                            Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
+                                            Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
                                             ScrollBarInternalRotationConstraint( vertical ) );
   mSlider.ApplyConstraint( constraint );
   mSliderWrap.ApplyConstraint( constraint );
 
   constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                          Source( mSlider, Actor::Property::SIZE),
-                                         Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME ) ),
-                                         Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
-                                         Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
+                                         Source( target, Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION ),
+                                         Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
+                                         Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
                                          Source( target, Actor::Property::SIZE ),
                                          ScrollBarInternalPositionConstraint(vertical) );
 
@@ -426,10 +426,10 @@ ScrollBarInternal::ScrollBarInternal(Toolkit::Scrollable& container, bool vertic
 
   constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                          Source( mSlider, Actor::Property::SIZE),
-                                         Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME ) ),
-                                         Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
-                                         Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
+                                         Source( target, Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION ),
+                                         Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
+                                         Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
                                          Source( target, Actor::Property::SIZE ),
                                          ScrollBarInternalPositionConstraint(vertical, true) );
   mSliderWrap.ApplyConstraint( constraint );
@@ -447,7 +447,7 @@ ScrollBarInternal::ScrollBarInternal(Toolkit::Scrollable& container, bool vertic
 
   mContainer.AddOverlay( mHitArea );
   constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
-                                         Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
+                                         Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
                                          Source( target, Actor::Property::SIZE ),
                                          ScrollBarInternalHitSizeConstraint(vertical, BAR_TAB_SIZE.width) );
   mHitArea.ApplyConstraint( constraint );
@@ -558,8 +558,8 @@ void ScrollBarInternal::Show()
   }
 
   mAnimation = Animation::New( BAR_SHOW_TIME );
-  mAnimation.OpacityTo( mSlider, 1.0f, AlphaFunctions::EaseIn );
-  mAnimation.OpacityTo( mSliderWrap, 1.0f, AlphaFunctions::EaseIn );
+  mAnimation.AnimateTo( Property( mSlider, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::EaseIn );
+  mAnimation.AnimateTo( Property( mSliderWrap, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::EaseIn );
   mAnimation.Play();
 
   DestructTimer();
@@ -575,8 +575,8 @@ void ScrollBarInternal::Hide()
   }
 
   mAnimation = Animation::New( BAR_HIDE_TIME );
-  mAnimation.OpacityTo( mSlider, 0.0f, AlphaFunctions::EaseIn );
-  mAnimation.OpacityTo( mSliderWrap, 0.0f, AlphaFunctions::EaseIn );
+  mAnimation.AnimateTo( Property( mSlider, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunctions::EaseIn );
+  mAnimation.AnimateTo( Property( mSliderWrap, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunctions::EaseIn );
   mAnimation.Play();
 }
 
index 405e819..9ac90b9 100644 (file)
@@ -362,12 +362,11 @@ ItemView::ItemView(ItemFactory& factory)
 
 void ItemView::OnInitialize()
 {
-  SetSizePolicy( Toolkit::Control::Fixed, Toolkit::Control::Fixed );
-
-  RegisterCommonProperties();
-
   Actor self = Self();
 
+  // Disable size negotiation for item views
+  self.SetRelayoutEnabled( false );
+
   mScrollConnector = Dali::Toolkit::ScrollConnector::New();
   mScrollPositionObject = mScrollConnector.GetScrollPositionObject();
   mScrollConnector.ScrollPositionChangedSignal().Connect( this, &ItemView::OnScrollPositionChanged );
@@ -378,10 +377,10 @@ void ItemView::OnInitialize()
 
   EnableScrollComponent(Toolkit::Scrollable::OvershootIndicator);
 
-  Constraint constraint = Constraint::New<Vector3>(mPropertyRelativePosition,
+  Constraint constraint = Constraint::New<Vector3>(Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION,
                                                    LocalSource(mPropertyPosition),
-                                                   LocalSource(mPropertyPositionMin),
-                                                   LocalSource(mPropertyPositionMax),
+                                                   LocalSource(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN),
+                                                   LocalSource(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX),
                                                    LocalSource(Actor::Property::SIZE),
                                                    RelativePositionConstraint);
   self.ApplyConstraint(constraint);
@@ -460,7 +459,6 @@ void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSiz
 
   // Move the items to the new layout positions...
 
-  bool resizeAnimationNeeded(false);
   for (ConstItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
   {
     unsigned int itemId = iter->first;
@@ -472,34 +470,13 @@ void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSiz
     Vector3 size;
     if(mActiveLayout->GetItemSize(itemId, targetSize, size))
     {
-      if( durationSeconds > 0.0f )
-      {
-        // Use a size animation
-        if (!resizeAnimationNeeded)
-        {
-          resizeAnimationNeeded = true;
-          RemoveAnimation(mResizeAnimation);
-          mResizeAnimation = Animation::New(durationSeconds);
-        }
-
-        // The layout provides its own resize animation
-        mActiveLayout->GetResizeAnimation(mResizeAnimation, actor, size, durationSeconds);
-      }
-      else
-      {
-        // resize immediately
-        actor.SetSize(size);
-      }
+      // resize immediately
+      actor.SetSize( size.GetVectorXY() );
     }
 
     mActiveLayout->ApplyConstraints(actor, itemId, durationSeconds, mScrollPositionObject, Self() );
   }
 
-  if (resizeAnimationNeeded)
-  {
-    mResizeAnimation.Play();
-  }
-
   // Refresh the new layout
   ItemRange range = GetItemRange(*mActiveLayout, targetSize, GetCurrentLayoutPosition(0), false/* don't reserve extra*/);
   AddActorsWithinRange( range, durationSeconds );
@@ -540,7 +517,7 @@ void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSiz
 
   Radian scrollDirection(mActiveLayout->GetScrollDirection());
   float orientation = static_cast<float>(mActiveLayout->GetOrientation());
-  self.SetProperty(mPropertyScrollDirection, Vector3(sinf(scrollDirection), cosf(scrollDirection), orientation));
+  self.SetProperty(Toolkit::Scrollable::Property::SCROLL_DIRECTION, Vector3(sinf(scrollDirection), cosf(scrollDirection), orientation));
 
   self.SetProperty(mPropertyScrollSpeed, mScrollSpeed);
 
@@ -570,6 +547,17 @@ void ItemView::OnRefreshNotification(PropertyNotification& source)
   }
 }
 
+void ItemView::Refresh()
+{
+  for (ItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter )
+  {
+    ReleaseActor( iter->first, iter->second );
+  }
+  mItemPool.clear();
+
+  DoRefresh(GetCurrentLayoutPosition(0), true);
+}
+
 void ItemView::DoRefresh(float currentLayoutPosition, bool cacheExtra)
 {
   if (mActiveLayout)
@@ -1005,7 +993,7 @@ void ItemView::SetupActor( Item item, float durationSeconds )
     Vector3 size;
     if( mActiveLayout->GetItemSize( item.first, mActiveLayoutTargetSize, size ) )
     {
-      item.second.SetSize( size );
+      item.second.SetSize( size.GetVectorXY() );
     }
 
     mActiveLayout->ApplyConstraints( item.second, item.first, durationSeconds, mScrollPositionObject, Self() );
@@ -1463,22 +1451,22 @@ void ItemView::CalculateDomainSize(const Vector3& layoutSize)
 
     if(IsHorizontal(mActiveLayout->GetOrientation()))
     {
-      self.SetProperty(mPropertyPositionMin, Vector3(0.0f, firstItemPosition.x, 0.0f));
-      self.SetProperty(mPropertyPositionMax, Vector3(0.0f, lastItemPosition.x, 0.0f));
+      self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN, Vector3(0.0f, firstItemPosition.x, 0.0f));
+      self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX, Vector3(0.0f, lastItemPosition.x, 0.0f));
       domainSize = fabs(firstItemPosition.x - lastItemPosition.x);
     }
     else
     {
-      self.SetProperty(mPropertyPositionMin, Vector3(0.0f, firstItemPosition.y, 0.0f));
-      self.SetProperty(mPropertyPositionMax, Vector3(0.0f, lastItemPosition.y, 0.0f));
+      self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN, Vector3(0.0f, firstItemPosition.y, 0.0f));
+      self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX, Vector3(0.0f, lastItemPosition.y, 0.0f));
       domainSize = fabs(firstItemPosition.y - lastItemPosition.y);
     }
 
     mScrollConnector.SetScrollDomain(minLayoutPosition, 0.0f, domainSize);
 
     bool isLayoutScrollable = IsLayoutScrollable(layoutSize);
-    self.SetProperty(mPropertyCanScrollVertical, isLayoutScrollable);
-    self.SetProperty(mPropertyCanScrollHorizontal, false);
+    self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL, isLayoutScrollable);
+    self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL, false);
   }
 }
 
@@ -1486,8 +1474,8 @@ Vector3 ItemView::GetDomainSize() const
 {
   Actor self = Self();
 
-  float minScrollPosition = self.GetProperty<float>(mPropertyPositionMin);
-  float maxScrollPosition = self.GetProperty<float>(mPropertyPositionMax);
+  float minScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN);
+  float maxScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX);
 
   return Vector3(0.0f, fabs(maxScrollPosition - minScrollPosition), 0.0f);
 }
@@ -1574,7 +1562,7 @@ void ItemView::SetOvershootEnabled( bool enable )
     self.Add(mOvershootOverlay);
 
     Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
-                                                      ParentSource( mPropertyScrollDirection ),
+                                                      ParentSource( Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
                                                       Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
                                                       ParentSource( Actor::Property::SIZE ),
                                                       OvershootOverlaySizeConstraint() );
@@ -1582,20 +1570,20 @@ void ItemView::SetOvershootEnabled( bool enable )
     mOvershootOverlay.SetSize(OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.width, OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height);
 
     constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
-                                              ParentSource( mPropertyScrollDirection ),
+                                              ParentSource( Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
                                               Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
                                               OvershootOverlayRotationConstraint() );
     mOvershootOverlay.ApplyConstraint(constraint);
 
     constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                            ParentSource( Actor::Property::SIZE ),
-                                           ParentSource( mPropertyScrollDirection ),
+                                           ParentSource( Toolkit::Scrollable::Property::SCROLL_DIRECTION ),
                                            Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
                                            OvershootOverlayPositionConstraint() );
     mOvershootOverlay.ApplyConstraint(constraint);
 
     constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
-                                        ParentSource( mPropertyCanScrollVertical ),
+                                        ParentSource( Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL ),
                                         OvershootOverlayVisibilityConstraint() );
     mOvershootOverlay.ApplyConstraint(constraint);
 
index 991f538..7c41d1f 100644 (file)
@@ -171,6 +171,11 @@ public:
   float GetRefreshInterval() const;
 
   /**
+   * @copydoc Toolkit::ItemView::Refresh
+   */
+  void Refresh();
+
+  /**
    * @copydoc Toolkit::ItemView::GetItem
    */
   Actor GetItem(unsigned int itemId) const;
index 60cb127..44ceade 100644 (file)
@@ -33,23 +33,9 @@ namespace Internal
 // ScrollBase
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-const char* const ScrollBase::SCROLL_DOMAIN_OFFSET_PROPERTY_NAME = "domain-offset";
-
 ScrollBase::ScrollBase()
 : Scrollable(),
   mParent(NULL),
-  mPropertyTime(Property::INVALID_INDEX),
-  mPropertyPrePosition(Property::INVALID_INDEX),
-  mPropertyPosition(Property::INVALID_INDEX),
-  mPropertyOvershootX(Property::INVALID_INDEX),
-  mPropertyOvershootY(Property::INVALID_INDEX),
-  mPropertyWrap(Property::INVALID_INDEX),
-  mPropertyPanning(Property::INVALID_INDEX),
-  mPropertyScrolling(Property::INVALID_INDEX),
-  mPropertyFinal(Property::INVALID_INDEX),
-  mPropertyDomainOffset(Property::INVALID_INDEX),
-  mPropertyPositionDelta(Property::INVALID_INDEX),
-  mPropertyScrollStartPagePosition(Property::INVALID_INDEX),
   mDelay(0.0f)
 {
 }
@@ -59,28 +45,6 @@ void ScrollBase::SetParent(ScrollBase *parent)
   mParent = parent;
 }
 
-void ScrollBase::RegisterProperties()
-{
-  Actor self = Self();
-
-  // Register common properties
-  RegisterCommonProperties();
-
-  // Register Scroll Properties.
-  mPropertyTime = self.RegisterProperty(Toolkit::ScrollView::SCROLL_TIME_PROPERTY_NAME, 0.0f);
-  mPropertyPrePosition = self.RegisterProperty(Toolkit::ScrollView::SCROLL_PRE_POSITION_PROPERTY_NAME, Vector3::ZERO);
-  mPropertyPosition = self.RegisterProperty(Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME, Vector3::ZERO);
-  mPropertyOvershootX = self.RegisterProperty(Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME, 0.0f);
-  mPropertyOvershootY = self.RegisterProperty(Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME, 0.0f);
-  mPropertyFinal = self.RegisterProperty(Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME, Vector3::ZERO);
-  mPropertyWrap = self.RegisterProperty(Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME, false);
-  mPropertyPanning = self.RegisterProperty(Toolkit::ScrollView::SCROLL_PANNING_PROPERTY_NAME, false);
-  mPropertyScrolling = self.RegisterProperty(Toolkit::ScrollView::SCROLL_SCROLLING_PROPERTY_NAME, false);
-  mPropertyDomainOffset = self.RegisterProperty(SCROLL_DOMAIN_OFFSET_PROPERTY_NAME, Vector3::ZERO);
-  mPropertyPositionDelta = self.RegisterProperty(Toolkit::ScrollView::SCROLL_POSITION_DELTA_PROPERTY_NAME, Vector3::ZERO);
-  mPropertyScrollStartPagePosition = self.RegisterProperty(Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME, Vector3::ZERO);
-}
-
 void ScrollBase::BindActor(Actor child)
 {
   FindAndUnbindActor(child);
index 968e3ab..a4b955c 100644 (file)
@@ -191,26 +191,9 @@ protected:
    */
   ScrollBase();
 
-  /**
-   * 2nd-phase initialization.
-   */
-  void RegisterProperties();
-
 protected:
 
   ScrollBase *mParent;                              ///< Pointer to ScrollBase parent, if exists.
-  Property::Index mPropertyTime;                    ///< Scroll Time (0 to animationDuration while animating, otherwise 0)
-  Property::Index mPropertyPrePosition;             ///< Scroll Position ("scroll-position") [function of scroll-x, scroll-y]
-  Property::Index mPropertyPosition;                ///< Scroll Position ("scroll-position") [function of scroll-pre-position]
-  Property::Index mPropertyOvershootX;              ///< Scroll Overshoot ("scroll-overshoot-x") [function of scroll-pre-position, scroll-position]
-  Property::Index mPropertyOvershootY;              ///< Scroll Overshoot ("scroll-overshoot-y") [function of scroll-pre-position, scroll-position]
-  Property::Index mPropertyWrap;                    ///< Scroll Wrap ("scroll-wrap")
-  Property::Index mPropertyPanning;                 ///< Whether we are panning
-  Property::Index mPropertyScrolling;               ///< Whether we are scrolling
-  Property::Index mPropertyFinal;                   ///< Scroll Final Position ("scroll-final") [scroll-position + f(scroll-overshoot)]
-  Property::Index mPropertyDomainOffset;            ///< Scroll Domain Offset ("scroll-domain-offset") keeps track of scroll position as it wraps domains
-  Property::Index mPropertyPositionDelta;           ///< Scroll Position Delta ("scroll-position-delta")
-  Property::Index mPropertyScrollStartPagePosition; ///< Scroll Start Page Position ("scroll-start-page-position")
 
 private:
 
index b02d3fc..c3a900e 100644 (file)
@@ -158,7 +158,7 @@ ScrollOvershootEffectRipple::ScrollOvershootEffectRipple( bool vertical, Scrolla
 void ScrollOvershootEffectRipple::Apply()
 {
   Actor self = mAttachedScrollView.Self();
-  mOvershootProperty = self.GetPropertyIndex(IsVertical() ? Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME : Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME);
+  mOvershootProperty = IsVertical() ? Toolkit::ScrollView::Property::OVERSHOOT_Y : Toolkit::ScrollView::Property::OVERSHOOT_X;
 
   // make sure height is set, since we only create a constraint for image width
   mOvershootOverlay.SetSize(OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.width, OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height);
index ea529ff..6eb200b 100644 (file)
@@ -83,7 +83,7 @@ public:
    * @param[in] positionProperty The Actor's Position.
    * @param[in] scaleProperty The Actor's Scale.
    * @param[in] sizeProperty The Actor's Size
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
    * @param[in] scrollSizeProperty The size of the scroll-view (scrollView SIZE)
    * @return The new visibility of this Actor.
    */
@@ -114,7 +114,7 @@ public:
    * @param[in] positionProperty The Actor's Position.
    * @param[in] scaleProperty The Actor's Scale.
    * @param[in] sizeProperty The Actor's Size
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
    * @param[in] scrollSizeProperty The size of the scroll-view (scrollView SIZE)
    * @param[in] activateProperty Activation value (0 - normal, 1.0 - full effect)
    * @return The new orientation of this Actor.
@@ -164,7 +164,7 @@ public:
    * @param[in] current The current position of this Actor
    * @param[in] scaleProperty The Actor's Scale.
    * @param[in] sizeProperty The Actor's Size
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
    * @param[in] scrollSizeProperty The size of the scroll-view (scrollView SIZE)
    * @param[in] activateProperty Activation value (0 - normal, 1.0 - full effect)
    * @return The new position of this Actor.
@@ -234,7 +234,7 @@ void ApplyScrollCarouselConstraints(Toolkit::ScrollView scrollView,
                                       LocalSource( Actor::Property::POSITION ),
                                       LocalSource( Actor::Property::SCALE ),
                                       LocalSource( Actor::Property::SIZE ),
-                                      Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
+                                      Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
                                       Source(scrollView, Actor::Property::SIZE ),
                                       Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
                                       boost::bind( &ScrollCarouselEffectInfo::VisibilityConstraint, info, _1, _2, _3, _4, _5, _6) );
@@ -245,7 +245,7 @@ void ApplyScrollCarouselConstraints(Toolkit::ScrollView scrollView,
                                             LocalSource( Actor::Property::POSITION ),
                                             LocalSource( Actor::Property::SCALE ),
                                             LocalSource( Actor::Property::SIZE ),
-                                            Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
+                                            Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
                                             Source(scrollView, Actor::Property::SIZE ),
                                             Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
                                             boost::bind( &ScrollCarouselEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
@@ -255,7 +255,7 @@ void ApplyScrollCarouselConstraints(Toolkit::ScrollView scrollView,
   constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                          LocalSource( Actor::Property::SCALE ),
                                          LocalSource( Actor::Property::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
                                          Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
                                          boost::bind( &ScrollCarouselEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6) );
index 938ba1c..dfc980d 100644 (file)
@@ -64,11 +64,11 @@ public:
   /**
    * @param[in] current The current orientation of this Actor
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
    * @return The new orientation of this Actor.
    */
   Quaternion RotationConstraint(const Quaternion& current,
@@ -134,11 +134,11 @@ public:
   /**
    * @param[in] current The current color of this Actor
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
    * @return The new color of this Actor.
    */
   Vector4 ColorConstraint(const Vector4& current,
@@ -208,11 +208,11 @@ public:
   /**
    * @param[in] current The current position
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
    * @return The new position of this Actor.
    */
   Vector3 PositionConstraint(const Vector3& current,
@@ -305,11 +305,11 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
   Constraint constraint;
   constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
                                          Source(parentPage, Actor::Property::POSITION),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source(scrollView, Actor::Property::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
                                          boost::bind( &ScrollCubeEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
@@ -317,11 +317,11 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
 
   constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
                                          Source(parentPage, Actor::Property::POSITION),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source(scrollView, Actor::Property::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
                                          boost::bind( &ScrollCubeEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
@@ -329,11 +329,11 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
 
   constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                          Source(parentPage, Actor::Property::POSITION),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source(scrollView, Actor::Property::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
                                          boost::bind( &ScrollCubeEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
index 8b6003f..0f21d0c 100644 (file)
@@ -93,11 +93,11 @@ struct ScrollDepthScaleConstraint
   /**
    * @param[in] current The current scale
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
    * @return The new scale of this Actor.
    */
   Vector3 operator()(const Vector3& currentScale,
@@ -218,11 +218,11 @@ struct ScrollDepthPositionConstraint
   /**
    * @param[in] current The current position
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
    * @return The new position of this Actor.
    */
   Vector3 operator()(const Vector3& currentPosition,
@@ -339,9 +339,9 @@ void ApplyScrollDepthConstraints(Toolkit::ScrollView scrollView,
   Constraint constraint = Constraint::New<Vector3>( Actor::Property::SCALE,
                                          LocalSource(Actor::Property::POSITION),
                                          ParentSource(Actor::Property::POSITION),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source(scrollView, Actor::Property::SIZE ),
                                          ScrollDepthScaleConstraint( positionExtent, offsetExtent, positionScale, scaleExtent ) );
   constraint.SetRemoveAction( Constraint::Discard );
@@ -350,11 +350,11 @@ void ApplyScrollDepthConstraints(Toolkit::ScrollView scrollView,
   // Position Constraint (apply last as other constraints use Actor::POSITION as a function input)
   constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                          ParentSource(Actor::Property::POSITION),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source(scrollView, Actor::Property::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
                                          ScrollDepthPositionConstraint( positionExtent, offsetExtent, positionScale ) );
 
   constraint.SetRemoveAction( Constraint::Discard );
index 5111cec..ee5163c 100644 (file)
@@ -29,6 +29,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
+#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h>
 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
@@ -213,6 +214,18 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollView, Toolkit::Scrollable, Create )
 
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-position", VECTOR3, SCROLL_POSITION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-pre-position", VECTOR3, SCROLL_PRE_POSITION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "overshoot-x", FLOAT, OVERSHOOT_X)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "overshoot-y", FLOAT, OVERSHOOT_Y)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-final", VECTOR3, SCROLL_FINAL)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "wrap", BOOLEAN, WRAP)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "panning", BOOLEAN, PANNING)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scrolling", BOOLEAN, SCROLLING)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-domain-offset", VECTOR3, SCROLL_DOMAIN_OFFSET)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-position-delta", VECTOR3, SCROLL_POSITION_DELTA)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "start-page-position", VECTOR3, START_PAGE_POSITION)
+
 DALI_SIGNAL_REGISTRATION( ScrollView, "value-changed", SIGNAL_SNAP_STARTED )
 
 DALI_TYPE_REGISTRATION_END()
@@ -420,7 +433,7 @@ struct InternalPositionConstraint
 
 /**
  * This constraint updates the X overshoot property using the difference
- * mPropertyPrePosition.x and mPropertyPosition.x, returning a relative value between 0.0f and 1.0f
+ * SCROLL_PRE_POSITION.x and SCROLL_POSITION.x, returning a relative value between 0.0f and 1.0f
  */
 struct OvershootXConstraint
 {
@@ -446,7 +459,7 @@ struct OvershootXConstraint
 
 /**
  * This constraint updates the Y overshoot property using the difference
- * mPropertyPrePosition.y and mPropertyPosition.y, returning a relative value between 0.0f and 1.0f
+ * SCROLL_PRE_POSITION.y and SCROLL_POSITION.y, returning a relative value between 0.0f and 1.0f
  */
 struct OvershootYConstraint
 {
@@ -596,9 +609,6 @@ void ScrollView::OnInitialize()
 
   mAlterChild = true;
 
-  // Register Scroll Properties.
-  RegisterProperties();
-
   mScrollPostPosition = mScrollPrePosition = Vector3::ZERO;
 
   mMouseWheelScrollDistanceStep = Stage::GetCurrent().GetSize() * DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
@@ -617,6 +627,9 @@ void ScrollView::OnInitialize()
 
   EnableScrollComponent(Toolkit::Scrollable::OvershootIndicator);
 
+  self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL, mCanScrollVertical);
+  self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL, mCanScrollHorizontal);
+
   Vector3 size = GetControlSize();
   UpdatePropertyDomain(size);
   SetInternalConstraints();
@@ -871,24 +884,24 @@ void ScrollView::UpdatePropertyDomain(const Vector3& size)
   if( mCanScrollVertical != canScrollVertical )
   {
     mCanScrollVertical = canScrollVertical;
-    self.SetProperty(mPropertyCanScrollVertical, canScrollVertical);
+    self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL, canScrollVertical);
   }
   if( mCanScrollHorizontal != canScrollHorizontal )
   {
     mCanScrollHorizontal = canScrollHorizontal;
-    self.SetProperty(mPropertyCanScrollHorizontal, canScrollHorizontal);
+    self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL, canScrollHorizontal);
   }
   if( scrollPositionChanged )
   {
-    DALI_LOG_SCROLL_STATE("[0x%X] Domain Changed, setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
-    self.SetProperty(mPropertyPrePosition, mScrollPrePosition);
+    DALI_LOG_SCROLL_STATE("[0x%X] Domain Changed, setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
+    self.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollPrePosition);
   }
   if( domainChanged )
   {
     mMinScroll = min;
     mMaxScroll = max;
-    self.SetProperty(mPropertyPositionMin, mMinScroll );
-    self.SetProperty(mPropertyPositionMax, mMaxScroll );
+    self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN, mMinScroll );
+    self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX, mMaxScroll );
   }
 }
 
@@ -961,7 +974,7 @@ bool ScrollView::GetWrapMode() const
 void ScrollView::SetWrapMode(bool enable)
 {
   mWrapMode = enable;
-  Self().SetProperty(mPropertyWrap, enable);
+  Self().SetProperty(Toolkit::ScrollView::Property::WRAP, enable);
 }
 
 int ScrollView::GetScrollUpdateDistance() const
@@ -1119,7 +1132,7 @@ void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunct
     this, position.x, position.y, duration, int(horizontalBias), int(verticalBias));
 
   Vector3 currentScrollPosition = GetCurrentScrollPosition();
-  self.SetProperty( mPropertyScrollStartPagePosition, currentScrollPosition );
+  self.SetProperty( Toolkit::ScrollView::Property::START_PAGE_POSITION, currentScrollPosition );
 
   if( mScrolling ) // are we interrupting a current scroll?
   {
@@ -1134,7 +1147,7 @@ void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunct
     DALI_LOG_SCROLL_STATE("[0x%X] Interrupting Pan, set to false", this );
     mPanning = false;
     mGestureStackDepth = 0;
-    self.SetProperty( mPropertyPanning, false );
+    self.SetProperty( Toolkit::ScrollView::Property::PANNING, false );
 
     if( mScrollMainInternalPrePositionConstraint )
     {
@@ -1142,7 +1155,7 @@ void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunct
     }
   }
 
-  self.SetProperty(mPropertyScrolling, true);
+  self.SetProperty(Toolkit::ScrollView::Property::SCROLLING, true);
   mScrolling = true;
 
   DALI_LOG_SCROLL_STATE("[0x%X] mScrollStartedSignal 1 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
@@ -1158,7 +1171,7 @@ void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunct
   if(!animating)
   {
     // if not animating, then this pan has completed right now.
-    self.SetProperty(mPropertyScrolling, false);
+    self.SetProperty(Toolkit::ScrollView::Property::SCROLLING, false);
     mScrolling = false;
 
     // If we have no duration, then in the next update frame, we will be at the position specified as we just set.
@@ -1450,7 +1463,7 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
 
     if(child)
     {
-      Vector3 position = Self().GetProperty<Vector3>(mPropertyPosition);
+      Vector3 position = Self().GetProperty<Vector3>(Toolkit::ScrollView::Property::SCROLL_POSITION);
 
       // Get center-point of the Actor.
       Vector3 childPosition = GetPositionOfAnchor(child, AnchorPoint::CENTER);
@@ -1639,15 +1652,15 @@ bool ScrollView::AnimateTo(const Vector3& position, const Vector3& positionDurat
 
     if( !(mScrollStateFlags & SCROLL_ANIMATION_FLAGS) )
     {
-      DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollTargetPosition.x, mScrollTargetPosition.y );
-      self.SetProperty(mPropertyPrePosition, mScrollTargetPosition);
+      DALI_LOG_SCROLL_STATE("[0x%X] Setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollTargetPosition.x, mScrollTargetPosition.y );
+      self.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollTargetPosition);
       mScrollPrePosition = mScrollTargetPosition;
       mScrollPostPosition = mScrollTargetPosition;
       WrapPosition(mScrollPostPosition);
     }
 
     DALI_LOG_SCROLL_STATE("[0x%X] position-changed, mScrollTargetPosition[%.2f, %.2f], mScrollPrePosition[%.2f, %.2f], mScrollPostPosition[%.2f, %.2f]", this, mScrollTargetPosition.x, mScrollTargetPosition.y, mScrollPrePosition.x, mScrollPrePosition.y, mScrollPostPosition.x, mScrollPostPosition.y );
-    DALI_LOG_SCROLL_STATE("[0x%X] mPropertyPrePosition[%.2f, %.2f], mPropertyPosition[%.2f, %.2f]", this, self.GetProperty( mPropertyPrePosition ).Get<Vector3>().x, self.GetProperty( mPropertyPrePosition ).Get<Vector3>().y, self.GetProperty( mPropertyPosition ).Get<Vector3>().x, self.GetProperty( mPropertyPosition ).Get<Vector3>().y );
+    DALI_LOG_SCROLL_STATE("[0x%X] SCROLL_PRE_POSITION[%.2f, %.2f], SCROLL_POSITION[%.2f, %.2f]", this, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ).Get<Vector3>().x, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ).Get<Vector3>().y, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_POSITION ).Get<Vector3>().x, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_POSITION ).Get<Vector3>().y );
   }
 
   SetScrollUpdateNotification(true);
@@ -1728,14 +1741,14 @@ void ScrollView::FindAndUnbindActor(Actor child)
 
 Vector3 ScrollView::GetPropertyPrePosition() const
 {
-  Vector3 position = Self().GetProperty<Vector3>(mPropertyPrePosition);
+  Vector3 position = Self().GetProperty<Vector3>(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION);
   WrapPosition(position);
   return position;
 }
 
 Vector3 ScrollView::GetPropertyPosition() const
 {
-  Vector3 position = Self().GetProperty<Vector3>(mPropertyPosition);
+  Vector3 position = Self().GetProperty<Vector3>(Toolkit::ScrollView::Property::SCROLL_POSITION);
   WrapPosition(position);
 
   return position;
@@ -1751,21 +1764,21 @@ void ScrollView::HandleSnapAnimationFinished()
   // Emit Signal that scrolling has completed.
   mScrolling = false;
   Actor self = Self();
-  self.SetProperty(mPropertyScrolling, false);
+  self.SetProperty(Toolkit::ScrollView::Property::SCROLLING, false);
 
   Vector3 deltaPosition(mScrollPrePosition);
 
   UpdateLocalScrollProperties();
   WrapPosition(mScrollPrePosition);
-  DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
-  self.SetProperty(mPropertyPrePosition, mScrollPrePosition);
+  DALI_LOG_SCROLL_STATE("[0x%X] Setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
+  self.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollPrePosition);
 
   Vector3 currentScrollPosition = GetCurrentScrollPosition();
   DALI_LOG_SCROLL_STATE("[0x%X] mScrollCompletedSignal 3 current[%.2f, %.2f], mScrollTargetPosition[%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y, -mScrollTargetPosition.x, -mScrollTargetPosition.y );
   mScrollCompletedSignal.Emit( currentScrollPosition );
 
   mDomainOffset += deltaPosition - mScrollPostPosition;
-  self.SetProperty(mPropertyDomainOffset, mDomainOffset);
+  self.SetProperty(Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET, mDomainOffset);
   HandleStoppedAnimation();
 }
 
@@ -1782,7 +1795,7 @@ void ScrollView::SetScrollUpdateNotification( bool enabled )
   if( enabled && !mScrollUpdatedSignal.Empty())
   {
     // Only set up the notification when the application has connected to the updated signal
-    mScrollXUpdateNotification = self.AddPropertyNotification(mPropertyPosition, 0, StepCondition(mScrollUpdateDistance, 0.0f));
+    mScrollXUpdateNotification = self.AddPropertyNotification(Toolkit::ScrollView::Property::SCROLL_POSITION, 0, StepCondition(mScrollUpdateDistance, 0.0f));
     mScrollXUpdateNotification.NotifySignal().Connect( this, &ScrollView::OnScrollUpdateNotification );
   }
   if( mScrollYUpdateNotification )
@@ -1795,7 +1808,7 @@ void ScrollView::SetScrollUpdateNotification( bool enabled )
   if( enabled && !mScrollUpdatedSignal.Empty())
   {
     // Only set up the notification when the application has connected to the updated signal
-    mScrollYUpdateNotification = self.AddPropertyNotification(mPropertyPosition, 1, StepCondition(mScrollUpdateDistance, 0.0f));
+    mScrollYUpdateNotification = self.AddPropertyNotification(Toolkit::ScrollView::Property::SCROLL_POSITION, 1, StepCondition(mScrollUpdateDistance, 0.0f));
     mScrollYUpdateNotification.NotifySignal().Connect( this, &ScrollView::OnScrollUpdateNotification );
   }
 }
@@ -1869,16 +1882,6 @@ void ScrollView::OnChildRemove(Actor& child)
   UnbindActor(child);
 }
 
-void ScrollView::OnPropertySet( Property::Index index, Property::Value propertyValue )
-{
-  Actor self = Self();
-  if( index == mPropertyPrePosition )
-  {
-    DALI_LOG_SCROLL_STATE("[0x%X]: mPropertyPrePosition[%.2f, %.2f]", this, propertyValue.Get<Vector3>().x, propertyValue.Get<Vector3>().y);
-    propertyValue.Get(mScrollPrePosition);
-  }
-}
-
 void ScrollView::StartTouchDownTimer()
 {
   if ( !mTouchDownTimer )
@@ -1917,7 +1920,7 @@ bool ScrollView::OnTouchDownTimeout()
       mScrollInterrupted = true;
       // reset domain offset as scrolling from original plane.
       mDomainOffset = Vector3::ZERO;
-      Self().SetProperty(mPropertyDomainOffset, Vector3::ZERO);
+      Self().SetProperty(Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET, Vector3::ZERO);
 
       UpdateLocalScrollProperties();
       Vector3 currentScrollPosition = GetCurrentScrollPosition();
@@ -2047,32 +2050,32 @@ bool ScrollView::OnMouseWheelEvent(const MouseWheelEvent& event)
 void ScrollView::ResetScrolling()
 {
   Actor self = Self();
-  self.GetProperty(mPropertyPosition).Get(mScrollPostPosition);
+  self.GetProperty(Toolkit::ScrollView::Property::SCROLL_POSITION).Get(mScrollPostPosition);
   mScrollPrePosition = mScrollPostPosition;
-  DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPostPosition.x, mScrollPostPosition.y );
-  self.SetProperty(mPropertyPrePosition, mScrollPostPosition);
+  DALI_LOG_SCROLL_STATE("[0x%X] Setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollPostPosition.x, mScrollPostPosition.y );
+  self.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollPostPosition);
 }
 
 void ScrollView::UpdateLocalScrollProperties()
 {
   Actor self = Self();
-  self.GetProperty(mPropertyPrePosition).Get(mScrollPrePosition);
-  self.GetProperty(mPropertyPosition).Get(mScrollPostPosition);
+  self.GetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION).Get(mScrollPrePosition);
+  self.GetProperty(Toolkit::ScrollView::Property::SCROLL_POSITION).Get(mScrollPostPosition);
 }
 
 // private functions
 
 void ScrollView::PreAnimatedScrollSetup()
 {
-  // mPropertyPrePosition is our unclamped property with wrapping
-  // mPropertyPosition is our final scroll position after clamping
+  // SCROLL_PRE_POSITION is our unclamped property with wrapping
+  // SCROLL_POSITION is our final scroll position after clamping
 
   Actor self = Self();
 
   Vector3 deltaPosition(mScrollPostPosition);
   WrapPosition(mScrollPostPosition);
   mDomainOffset += deltaPosition - mScrollPostPosition;
-  Self().SetProperty(mPropertyDomainOffset, mDomainOffset);
+  Self().SetProperty(Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET, mDomainOffset);
 
   if( mScrollStateFlags & SCROLL_X_STATE_MASK )
   {
@@ -2103,11 +2106,11 @@ void ScrollView::AnimateInternalXTo( float position, float duration, AlphaFuncti
   if( duration > Math::MACHINE_EPSILON_10 )
   {
     Actor self = Self();
-    DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(mPropertyPrePosition).Get<Vector3>().x, position );
+    DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector3>().x, position );
     mInternalXAnimation = Animation::New(duration);
     DALI_LOG_SCROLL_STATE("[0x%X], mInternalXAnimation[0x%X]", this, mInternalXAnimation.GetObjectPtr() );
     mInternalXAnimation.FinishedSignal().Connect(this, &ScrollView::OnScrollAnimationFinished);
-    mInternalXAnimation.AnimateTo( Property(self, mPropertyPrePosition, 0), position, alpha, duration);
+    mInternalXAnimation.AnimateTo( Property(self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, 0), position, alpha, duration);
     mInternalXAnimation.Play();
 
     // erase current state flags
@@ -2124,11 +2127,11 @@ void ScrollView::AnimateInternalYTo( float position, float duration, AlphaFuncti
   if( duration > Math::MACHINE_EPSILON_10 )
   {
     Actor self = Self();
-    DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(mPropertyPrePosition).Get<Vector3>().y, position );
+    DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector3>().y, position );
     mInternalYAnimation = Animation::New(duration);
     DALI_LOG_SCROLL_STATE("[0x%X], mInternalYAnimation[0x%X]", this, mInternalYAnimation.GetObjectPtr() );
     mInternalYAnimation.FinishedSignal().Connect(this, &ScrollView::OnScrollAnimationFinished);
-    mInternalYAnimation.AnimateTo( Property(self, mPropertyPrePosition, 1), position, alpha, TimePeriod(duration));
+    mInternalYAnimation.AnimateTo( Property(self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, 1), position, alpha, TimePeriod(duration));
     mInternalYAnimation.Play();
 
     // erase current state flags
@@ -2151,7 +2154,7 @@ void ScrollView::OnScrollAnimationFinished( Animation& source )
 
   if( source == mInternalXAnimation )
   {
-    DALI_LOG_SCROLL_STATE("[0x%X] mInternalXAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalXAnimation.GetObjectPtr(), mScrollTargetPosition.x, Self().GetProperty(mPropertyPrePosition).Get<Vector3>().x, mScrollPostPosition.x );
+    DALI_LOG_SCROLL_STATE("[0x%X] mInternalXAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalXAnimation.GetObjectPtr(), mScrollTargetPosition.x, Self().GetProperty(SCROLL_PRE_POSITION).Get<Vector3>().x, mScrollPostPosition.x );
 
     if( !(mScrollStateFlags & AnimatingInternalY) )
     {
@@ -2163,15 +2166,15 @@ void ScrollView::OnScrollAnimationFinished( Animation& source )
     {
       const RulerDomain rulerDomain = mRulerX->GetDomain();
       mScrollPrePosition.x = -WrapInDomain(-mScrollPrePosition.x, rulerDomain.min, rulerDomain.max);
-      DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
-      handle.SetProperty(mPropertyPrePosition, mScrollPrePosition);
+      DALI_LOG_SCROLL_STATE("[0x%X] Setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
+      handle.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollPrePosition);
     }
     SnapInternalXTo(mScrollPostPosition.x);
   }
 
   if( source == mInternalYAnimation )
   {
-    DALI_LOG_SCROLL_STATE("[0x%X] mInternalYAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalYAnimation.GetObjectPtr(), mScrollTargetPosition.y, Self().GetProperty(mPropertyPrePosition).Get<Vector3>().y, mScrollPostPosition.y );
+    DALI_LOG_SCROLL_STATE("[0x%X] mInternalYAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalYAnimation.GetObjectPtr(), mScrollTargetPosition.y, Self().GetProperty(SCROLL_PRE_POSITION).Get<Vector3>().y, mScrollPostPosition.y );
 
     if( !(mScrollStateFlags & AnimatingInternalX) )
     {
@@ -2183,8 +2186,8 @@ void ScrollView::OnScrollAnimationFinished( Animation& source )
       // wrap pre scroll y position and set it
       const RulerDomain rulerDomain = mRulerY->GetDomain();
       mScrollPrePosition.y = -WrapInDomain(-mScrollPrePosition.y, rulerDomain.min, rulerDomain.max);
-      DALI_LOG_SCROLL_STATE("[0x%X] Setting mPropertyPrePosition To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
-      handle.SetProperty(mPropertyPrePosition, mScrollPrePosition);
+      DALI_LOG_SCROLL_STATE("[0x%X] Setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
+      handle.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollPrePosition);
     }
     SnapInternalYTo(mScrollPostPosition.y);
   }
@@ -2238,7 +2241,7 @@ void ScrollView::SnapInternalXTo(float position)
 
     mInternalXAnimation = Animation::New(duration);
     mInternalXAnimation.FinishedSignal().Connect(this, &ScrollView::OnSnapInternalPositionFinished);
-    mInternalXAnimation.AnimateTo(Property(self, mPropertyPrePosition, 0), position);
+    mInternalXAnimation.AnimateTo(Property(self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, 0), position);
     mInternalXAnimation.Play();
 
     // add internal animation state flag
@@ -2264,7 +2267,7 @@ void ScrollView::SnapInternalYTo(float position)
 
     mInternalYAnimation = Animation::New(duration);
     mInternalYAnimation.FinishedSignal().Connect(this, &ScrollView::OnSnapInternalPositionFinished);
-    mInternalYAnimation.AnimateTo(Property(self, mPropertyPrePosition, 1), position);
+    mInternalYAnimation.AnimateTo(Property(self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, 1), position);
     mInternalYAnimation.Play();
 
     // add internal animation state flag
@@ -2357,8 +2360,8 @@ void ScrollView::OnPan( const PanGesture& gesture )
       UpdateLocalScrollProperties();
       GestureStarted();
       mPanning = true;
-      self.SetProperty( mPropertyPanning, true );
-      self.SetProperty( mPropertyScrollStartPagePosition, Vector3(gesture.position.x, gesture.position.y, 0.0f) );
+      self.SetProperty( Toolkit::ScrollView::Property::PANNING, true );
+      self.SetProperty( Toolkit::ScrollView::Property::START_PAGE_POSITION, Vector3(gesture.position.x, gesture.position.y, 0.0f) );
 
       UpdateMainInternalConstraint();
       break;
@@ -2389,7 +2392,7 @@ void ScrollView::OnPan( const PanGesture& gesture )
         UpdateLocalScrollProperties();
         mLastVelocity = gesture.velocity;
         mPanning = false;
-        self.SetProperty( mPropertyPanning, false );
+        self.SetProperty( Toolkit::ScrollView::Property::PANNING, false );
 
         if( mScrollMainInternalPrePositionConstraint )
         {
@@ -2428,7 +2431,7 @@ void ScrollView::OnGestureEx(Gesture::State state)
   if(state == Gesture::Started)
   {
     Vector3 currentScrollPosition = GetCurrentScrollPosition();
-    Self().SetProperty(mPropertyScrolling, true);
+    Self().SetProperty(Toolkit::ScrollView::Property::SCROLLING, true);
     mScrolling = true;
     DALI_LOG_SCROLL_STATE("[0x%X] mScrollStartedSignal 2 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
     mScrollStartedSignal.Emit( currentScrollPosition );
@@ -2474,7 +2477,7 @@ void ScrollView::FinishTransform()
     // if not animating, then this pan has completed right now.
     SetScrollUpdateNotification(false);
     mScrolling = false;
-    Self().SetProperty(mPropertyScrolling, false);
+    Self().SetProperty(Toolkit::ScrollView::Property::SCROLLING, false);
 
     if( fabs(mScrollPrePosition.x - mScrollTargetPosition.x) > Math::MACHINE_EPSILON_10 )
     {
@@ -2611,7 +2614,7 @@ void ScrollView::UpdateMainInternalConstraint()
 
   if( mPanning )
   {
-    constraint = Constraint::New<Vector3>( mPropertyPrePosition,
+    constraint = Constraint::New<Vector3>( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION,
                                                       Source( detector, PanGestureDetector::Property::LOCAL_POSITION ),
                                                       Source( self, Actor::Property::SIZE ),
                                                       InternalPrePositionConstraint( mPanStartPosition, initialPanMask, mAxisAutoLock, mAxisAutoLockGradient, mLockAxis, mMaxOvershoot, mRulerX->GetDomain(), mRulerY->GetDomain() ) );
@@ -2619,33 +2622,33 @@ void ScrollView::UpdateMainInternalConstraint()
   }
 
   // 2. Second calculate the clamped position (actual position)
-  constraint = Constraint::New<Vector3>( mPropertyPosition,
-                                         LocalSource( mPropertyPrePosition ),
-                                         LocalSource( mPropertyPositionMin ),
-                                         LocalSource( mPropertyPositionMax ),
+  constraint = Constraint::New<Vector3>( Toolkit::ScrollView::Property::SCROLL_POSITION,
+                                         LocalSource( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ),
+                                         LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source( self, Actor::Property::SIZE ),
                                          InternalPositionConstraint( mRulerX->GetDomain(),
                                                                      mRulerY->GetDomain(), mWrapMode ) );
   mScrollMainInternalPositionConstraint = self.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( mPropertyPositionDelta,
-                                         LocalSource( mPropertyPosition ),
-                                         LocalSource( mPropertyDomainOffset ),
+  constraint = Constraint::New<Vector3>( Toolkit::ScrollView::Property::SCROLL_POSITION_DELTA,
+                                         LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ),
+                                         LocalSource( Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET ),
                                          InternalPositionDeltaConstraint );
   mScrollMainInternalDeltaConstraint = self.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( mPropertyFinal,
-                                         LocalSource( mPropertyPosition ),
-                                         LocalSource( mPropertyOvershootX ),
-                                         LocalSource( mPropertyOvershootY ),
+  constraint = Constraint::New<Vector3>( Toolkit::ScrollView::Property::SCROLL_FINAL,
+                                         LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ),
+                                         LocalSource( Toolkit::ScrollView::Property::OVERSHOOT_X ),
+                                         LocalSource( Toolkit::ScrollView::Property::OVERSHOOT_Y ),
                                          InternalFinalConstraint( FinalDefaultAlphaFunction,
                                                                   FinalDefaultAlphaFunction ) );
   mScrollMainInternalFinalConstraint = self.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( mPropertyRelativePosition,
-                                         LocalSource( mPropertyPosition ),
-                                         LocalSource( mPropertyPositionMin ),
-                                         LocalSource( mPropertyPositionMax ),
+  constraint = Constraint::New<Vector3>( Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION,
+                                         LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ),
+                                         LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          LocalSource( Actor::Property::SIZE ),
                                          InternalRelativePositionConstraint );
   mScrollMainInternalRelativeConstraint = self.ApplyConstraint( constraint );
@@ -2667,24 +2670,24 @@ void ScrollView::SetOvershootConstraintsEnabled(bool enabled)
   }
   if( enabled )
   {
-    Constraint constraint = Constraint::New<float>( mPropertyOvershootX,
-                                           LocalSource( mPropertyPrePosition ),
-                                           LocalSource( mPropertyPosition ),
-                                           LocalSource( mPropertyCanScrollHorizontal ),
+    Constraint constraint = Constraint::New<float>( Toolkit::ScrollView::Property::OVERSHOOT_X,
+                                           LocalSource( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ),
+                                           LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ),
+                                           LocalSource( Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL ),
                                            OvershootXConstraint(mMaxOvershoot.x) );
     mScrollMainInternalOvershootXConstraint = self.ApplyConstraint( constraint );
 
-    constraint = Constraint::New<float>( mPropertyOvershootY,
-                                           LocalSource( mPropertyPrePosition ),
-                                           LocalSource( mPropertyPosition ),
-                                           LocalSource( mPropertyCanScrollVertical ),
+    constraint = Constraint::New<float>( Toolkit::ScrollView::Property::OVERSHOOT_Y,
+                                           LocalSource( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ),
+                                           LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ),
+                                           LocalSource( Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL ),
                                            OvershootYConstraint(mMaxOvershoot.y) );
     mScrollMainInternalOvershootYConstraint = self.ApplyConstraint( constraint );
   }
   else
   {
-    self.SetProperty(mPropertyOvershootX, 0.0f);
-    self.SetProperty(mPropertyOvershootY, 0.0f);
+    self.SetProperty(Toolkit::ScrollView::Property::OVERSHOOT_X, 0.0f);
+    self.SetProperty(Toolkit::ScrollView::Property::OVERSHOOT_Y, 0.0f);
   }
 }
 
@@ -2703,7 +2706,7 @@ void ScrollView::SetInternalConstraints()
 
   // MoveActor (scrolling)
   constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
-                                         Source( self, mPropertyPosition ),
+                                         Source( self, Toolkit::ScrollView::Property::SCROLL_POSITION ),
                                          MoveActorConstraint );
   constraint.SetRemoveAction(Constraint::Discard);
   ApplyConstraintToBoundActors(constraint);
@@ -2713,9 +2716,9 @@ void ScrollView::SetInternalConstraints()
                                                  LocalSource( Actor::Property::SCALE ),
                                                  LocalSource( Actor::Property::ANCHOR_POINT ),
                                                  LocalSource( Actor::Property::SIZE ),
-                                                 Source( self, mPropertyPositionMin ),
-                                                 Source( self, mPropertyPositionMax ),
-                                                 Source( self, mPropertyWrap ),
+                                                 Source( self, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                                 Source( self, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
+                                                 Source( self, Toolkit::ScrollView::Property::WRAP ),
                                                  WrapActorConstraint );
   constraint.SetRemoveAction(Constraint::Discard);
   ApplyConstraintToBoundActors(constraint);
index 8f9abc7..da194f9 100644 (file)
@@ -525,11 +525,6 @@ private: // private overriden functions from CustomActorImpl and Controls
   virtual void OnChildRemove(Actor& child);
 
   /**
-   * @copydoc Dali::CustomActorImpl::OnPropertySet( Property::Index index, Property::Value propertyValue )
-   */
-  virtual void OnPropertySet( Property::Index index, Property::Value propertyValue );
-
-  /**
    * From CustomActorImpl; called after a touch-signal is received by the owning actor.
    *
    * We don't listen to these events as content within the contain may consume events.
@@ -591,7 +586,7 @@ private:
   /**
    * Called whenever a snap animation has completed
    * @param[in] source the Animation instance that has completed.
-   * Resets all scrolling animations and states, leaving current scroll position at mPropertyPosition
+   * Resets all scrolling animations and states, leaving current scroll position at SCROLL_POSITION
    */
   void ResetScrolling();
 
@@ -636,7 +631,7 @@ private:
   void OnScrollAnimationFinished( Animation& source );
 
   /**
-   * Called when either the X or Y internal scroll positions have finished snapping back to mPropertyPrePosition
+   * Called when either the X or Y internal scroll positions have finished snapping back to SCROLL_PRE_POSITION
    *
    * @param[in] source the Animation instance that has completed.
    */
index fb4578e..704cdaf 100644 (file)
@@ -68,11 +68,11 @@ public:
   /**
    * @param[in] current The current color of this Actor
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
    * @return The new color of this Actor.
    */
   Vector4 ColorConstraint(const Vector4& current,
@@ -120,11 +120,11 @@ public:
   /**
    * @param[in] current The current position
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
    * @return The new position of this Actor.
    */
   Vector3 PositionConstraint(const Vector3& current,
@@ -192,11 +192,11 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
   Constraint constraint;
   constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
                                          LocalSource(Actor::Property::POSITION),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source(scrollView, Actor::Property::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
                                          boost::bind( &ScrollPageCarouselEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
@@ -204,11 +204,11 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
 
   constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                          LocalSource(Actor::Property::POSITION),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source(scrollView, Actor::Property::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
                                          boost::bind( &ScrollPageCarouselEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
index 27e43e1..c65d4f3 100644 (file)
@@ -71,11 +71,11 @@ public:
   /**
    * @param[in] current The current orientation of this Actor
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
    * @return The new orientation of this Actor.
    */
   Quaternion RotationConstraint(const Quaternion& current,
@@ -125,11 +125,11 @@ public:
   /**
    * @param[in] current The current color of this Actor
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
    * @return The new color of this Actor.
    */
   Vector4 ColorConstraint(const Vector4& current,
@@ -185,11 +185,11 @@ public:
   /**
    * @param[in] current The current position
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (SCROLL_WRAP_PROPERTY_NAME)
+   * @param[in] scrollWrap Whether scroll wrap has been enabled or not (WRAP)
    * @return The new position of this Actor.
    */
   Vector3 PositionConstraint(const Vector3& current,
@@ -261,11 +261,11 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
   Constraint constraint;
   constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
                                             LocalSource(Actor::Property::POSITION),
-                                            Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
-                                            Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                            Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                            Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+                                            Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                            Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                             Source(scrollView, Actor::Property::SIZE ),
-                                            Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+                                            Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
                                             boost::bind( &ScrollPageCubeEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
@@ -273,11 +273,11 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
 
   constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
                                          LocalSource(Actor::Property::POSITION),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source(scrollView, Actor::Property::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
                                          boost::bind( &ScrollPageCubeEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
@@ -285,11 +285,11 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
 
   constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                          LocalSource(Actor::Property::POSITION),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source(scrollView, Actor::Property::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::WRAP ),
                                          boost::bind( &ScrollPageCubeEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
index b414458..27db48f 100644 (file)
@@ -82,11 +82,11 @@ public:
   /**
    * @param[in] current The current orientation of this Actor
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION_PROPERTY_NAME)
+   * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (START_PAGE_POSITION)
    * @return The new orientation of this Actor.
    */
   Quaternion RotationConstraint(const Quaternion& current,
@@ -163,11 +163,11 @@ public:
   /**
    * @param[in] current The current color of this Actor
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION_PROPERTY_NAME)
+   * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (START_PAGE_POSITION)
    * @return The new color of this Actor.
    */
   Vector4 ColorConstraint(const Vector4& current,
@@ -251,11 +251,11 @@ public:
   /**
    * @param[in] current The current position
    * @param[in] pagePositionProperty The page's position.
-   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION_PROPERTY_NAME)
-   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
-   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MIN_PROPERTY_NAME)
+   * @param[in] scrollPositionProperty The scroll-view's position property (SCROLL_POSITION)
+   * @param[in] scrollPositionMin The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
+   * @param[in] scrollPositionMax The maximum extent of this scroll domain. (SCROLL_POSITION_MAX)
    * @param[in] pageSizeProperty The size of the page. (scrollView SIZE)
-   * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION_PROPERTY_NAME)
+   * @param[in] scrollPageStartPositionProperty The position of the page where scrolling started. (START_PAGE_POSITION)
    * @return The new position of this Actor.
    */
   Vector3 PositionConstraint(const Vector3& current,
@@ -351,11 +351,11 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
   Constraint constraint;
   constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
                                             LocalSource(Actor::Property::POSITION),
-                                            Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
-                                            Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                            Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                            Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+                                            Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                            Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                             Source(scrollView, Actor::Property::SIZE ),
-                                            Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
+                                            Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ),
                                             boost::bind( &ScrollPageSpiralEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
@@ -363,11 +363,11 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
 
   constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
                                          LocalSource(Actor::Property::POSITION),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source(scrollView, Actor::Property::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ),
                                          boost::bind( &ScrollPageSpiralEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
@@ -375,11 +375,11 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
 
   constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                          LocalSource(Actor::Property::POSITION),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_FINAL_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MIN_PROPERTY_NAME ) ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_MAX_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ),
+                                         Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ),
                                          Source(scrollView, Actor::Property::SIZE ),
-                                         Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
+                                         Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ),
                                          boost::bind( &ScrollPageSpiralEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
index e21ef87..c8c669b 100644 (file)
@@ -231,10 +231,6 @@ void ScrollViewWobbleEffect::OnDetach(Toolkit::ScrollView& scrollView)
 
 void ScrollViewWobbleEffect::AttachActor(Actor actor)
 {
-  Property::Index propertyPosition = actor.GetPropertyIndex(Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME);
-  Property::Index propertyOvershootX = actor.GetPropertyIndex(Toolkit::ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME);
-  Property::Index propertyOvershootY = actor.GetPropertyIndex(Toolkit::ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME);
-
   // Create effect-overshoot property if not already created.
   Property::Index propertyEffectOvershoot = actor.GetPropertyIndex(Toolkit::ScrollViewWobbleEffect::EFFECT_OVERSHOOT);
   if(propertyEffectOvershoot == Property::INVALID_INDEX)
@@ -246,9 +242,9 @@ void ScrollViewWobbleEffect::AttachActor(Actor actor)
 
   Constraint constraint = Constraint::New<Vector3>( propertyEffectOvershoot,
                                                     Source(scrollView, mPropertyTime),
-                                                    Source(actor, propertyPosition),
-                                                    Source(actor, propertyOvershootX),
-                                                    Source(actor, propertyOvershootY),
+                                                    Source(actor, Toolkit::ScrollView::Property::SCROLL_POSITION),
+                                                    Source(actor, Toolkit::ScrollView::Property::OVERSHOOT_X),
+                                                    Source(actor, Toolkit::ScrollView::Property::OVERSHOOT_Y),
                                                     ScrollViewWobbleEffectConstraint(*this) );
   actor.ApplyConstraint(constraint);
 }
index 0c73cd4..3db2f3e 100644 (file)
@@ -49,6 +49,13 @@ DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Scrollable, Toolkit::Control, Create );
 DALI_PROPERTY_REGISTRATION( Scrollable, "overshoot-effect-color",    VECTOR4, OVERSHOOT_EFFECT_COLOR    )
 DALI_PROPERTY_REGISTRATION( Scrollable, "overshoot-animation-speed", FLOAT,   OVERSHOOT_ANIMATION_SPEED )
 
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-relative-position", VECTOR3, SCROLL_RELATIVE_POSITION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-position-min",      VECTOR3, SCROLL_POSITION_MIN)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-position-max",      VECTOR3, SCROLL_POSITION_MAX)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-direction",         VECTOR3, SCROLL_DIRECTION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "can-scroll-vertical",      BOOLEAN, CAN_SCROLL_VERTICAL)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "can-scroll-horizontal",    BOOLEAN, CAN_SCROLL_HORIZONTAL)
+
 DALI_SIGNAL_REGISTRATION(   Scrollable, "scroll-started",                     SIGNAL_SCROLL_STARTED     )
 DALI_SIGNAL_REGISTRATION(   Scrollable, "scroll-completed",                   SIGNAL_SCROLL_COMPLETED   )
 DALI_SIGNAL_REGISTRATION(   Scrollable, "scroll-updated",                     SIGNAL_SCROLL_UPDATED     )
@@ -60,9 +67,6 @@ const float DEFAULT_OVERSHOOT_ANIMATION_SPEED(120.0f); // 120 pixels per second
 
 }
 
-const char* const Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL = "scrollable-can-scroll-vertical";
-const char* const Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL = "scrollable-can-scroll-horizontal";
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Scrollable
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -73,12 +77,6 @@ Scrollable::Scrollable()
 : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | NO_SIZE_NEGOTIATION ) ),
   mOvershootEffectColor(  DEFAULT_OVERSHOOT_COLOUR ),
   mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),
-  mPropertyRelativePosition(Property::INVALID_INDEX),
-  mPropertyPositionMin(Property::INVALID_INDEX),
-  mPropertyPositionMax(Property::INVALID_INDEX),
-  mPropertyScrollDirection(Property::INVALID_INDEX),
-  mPropertyCanScrollVertical(Property::INVALID_INDEX),
-  mPropertyCanScrollHorizontal(Property::INVALID_INDEX),
   mOvershootEnabled(false)
 {
 }
@@ -89,19 +87,6 @@ Scrollable::~Scrollable()
   mComponents.clear();
 }
 
-void Scrollable::RegisterCommonProperties()
-{
-  Actor self = Self();
-
-  // Register properties.
-  mPropertyRelativePosition = self.RegisterProperty(Toolkit::Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME, Vector3::ZERO);
-  mPropertyPositionMin = self.RegisterProperty(Toolkit::Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME, Vector3::ZERO);
-  mPropertyPositionMax = self.RegisterProperty(Toolkit::Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME, Vector3::ZERO);
-  mPropertyScrollDirection = self.RegisterProperty(Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME, Vector3::ZERO);
-  mPropertyCanScrollVertical = self.RegisterProperty(SCROLLABLE_CAN_SCROLL_VERTICAL, true);
-  mPropertyCanScrollHorizontal = self.RegisterProperty(SCROLLABLE_CAN_SCROLL_HORIZONTAL, true);
-}
-
 bool Scrollable::IsScrollComponentEnabled(Toolkit::Scrollable::ScrollComponentType type) const
 {
   if(type == Toolkit::Scrollable::OvershootIndicator)
index 799ed62..eb9f377 100644 (file)
@@ -44,16 +44,6 @@ typedef IntrusivePtr<Scrollable> ScrollablePtr;
 class Scrollable : public Control
 {
 public:
-  static const char* const SCROLLABLE_CAN_SCROLL_VERTICAL;
-  static const char* const SCROLLABLE_CAN_SCROLL_HORIZONTAL;
-
-  /**
-   * Create a new Scrollable.
-   * @return A public handle to the newly allocated Scrollable.
-   */
-//  static Dali::Toolkit::Scrollable New();
-
-public:
 
   /**
    * @copydoc Dali::Toolkit::Scrollable::IsScrollComponentEnabled(Scrollable::ScrollComponentType type)
@@ -196,11 +186,6 @@ protected:
    */
   virtual ~Scrollable();
 
-  /**
-   * Register common properties
-   */
-  void RegisterCommonProperties();
-
 private:
 
   /**
@@ -231,13 +216,6 @@ protected:
   Vector4         mOvershootEffectColor;    ///<The color of the overshoot bouncing effect
   float           mOvershootAnimationSpeed; ///<The speed of the overshoot animation (pixels per second)
 
-  Property::Index mPropertyRelativePosition;///< Scroll Relative Position ("scroll-relative-position") [range from 0.0f - 1.0f in each axes]
-  Property::Index mPropertyPositionMin;     ///< Scroll Domain Minimum ("position-min")
-  Property::Index mPropertyPositionMax;     ///< Scroll Domain Maximum ("position-max")
-  Property::Index mPropertyScrollDirection; ///< Scroll direction ("scroll-direction")
-  Property::Index mPropertyCanScrollVertical;    ///< Whether the current scroll domain is large enough to scroll vertically
-  Property::Index mPropertyCanScrollHorizontal;    ///< Whether the current scroll domain is large enough to scroll horizontally
-
   std::map<Toolkit::Scrollable::ScrollComponentType, ScrollComponentPtr> mComponent;  ///< ScrollComponent (such as a scrollbar/page indicator/status)
 
   Toolkit::Scrollable::ScrollStartedSignalType mScrollStartedSignal;
index 23f1f0f..a1ad3b6 100644 (file)
@@ -168,6 +168,7 @@ void ShadowView::SetShadowPlane(Actor shadowPlane)
   mShadowPlaneBg = shadowPlane;
 
   mShadowPlane = ImageActor::New();
+  mShadowPlane.SetName( "SHADOW_PLANE" );
   mShadowPlane.SetParentOrigin(ParentOrigin::CENTER);
   mShadowPlane.SetAnchorPoint(AnchorPoint::CENTER);
 
@@ -182,9 +183,9 @@ void ShadowView::SetShadowPlane(Actor shadowPlane)
 
   ConstrainCamera();
 
-  mShadowPlane.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  mShadowPlane.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
-  mBlurRootActor.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  mBlurRootActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 }
 
 void ShadowView::SetPointLight(Actor pointLight)
@@ -239,7 +240,8 @@ void ShadowView::OnInitialize()
 {
   // root actor to parent all user added actors. Used as source actor for shadow render task.
   mChildrenRoot.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
-  mChildrenRoot.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  mChildrenRoot.SetRelayoutEnabled( true );
+  mChildrenRoot.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
   Vector2 stageSize = Stage::GetCurrent().GetSize();
   mCameraActor = CameraActor::New(stageSize);
@@ -274,6 +276,8 @@ void ShadowView::OnInitialize()
   mBlurFilter.SetPixelFormat(Pixel::RGBA8888);
 
   mBlurRootActor = Actor::New();
+  mBlurRootActor.SetName( "BLUR_ROOT_ACTOR" );
+  mBlurRootActor.SetRelayoutEnabled( true );
 
   // Turn off inheritance to ensure filter renders properly
   mBlurRootActor.SetPositionInheritanceMode(USE_PARENT_POSITION);
index 56bbd33..0cd8783 100755 (executable)
@@ -353,6 +353,7 @@ void Slider::DisplayValue( float value, bool raiseSignals )
     std::stringstream ss;
     ss.precision( GetValuePrecision() );
     ss << std::fixed << clampledValue;
+
     mHandleValueTextView.SetText( ss.str() );
   }
 }
@@ -397,6 +398,7 @@ Actor Slider::CreateHitRegion()
 ImageActor Slider::CreateBacking()
 {
   ImageActor backing = ImageActor::New();
+  backing.SetRelayoutEnabled( false );
   backing.SetParentOrigin( ParentOrigin::CENTER );
   backing.SetAnchorPoint( AnchorPoint::CENTER );
   backing.SetZ( BACKING_Z );
@@ -426,6 +428,7 @@ std::string Slider::GetBackingImageName()
 ImageActor Slider::CreateProgress()
 {
   ImageActor progress = ImageActor::New();
+  progress.SetRelayoutEnabled( false );
   progress.SetParentOrigin( ParentOrigin::CENTER_LEFT );
   progress.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
   progress.SetZ( PROGRESS_Z );
@@ -501,6 +504,7 @@ void Slider::ResizeProgressRegion( const Vector2& region )
 ImageActor Slider::CreateHandle()
 {
   ImageActor handle = ImageActor::New();
+  handle.SetRelayoutEnabled( false );
   handle.SetParentOrigin( ParentOrigin::CENTER_LEFT );
   handle.SetAnchorPoint( AnchorPoint::CENTER );
   handle.SetZ( HANDLE_Z );
@@ -511,6 +515,7 @@ ImageActor Slider::CreateHandle()
 ImageActor Slider::CreatePopupArrow()
 {
   ImageActor arrow = ImageActor::New();
+  arrow.SetRelayoutEnabled( false );
   arrow.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
   arrow.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
   arrow.SetZ( HANDLE_Z );
@@ -523,7 +528,6 @@ Toolkit::TextView Slider::CreatePopupText()
   Toolkit::TextView textView = Toolkit::TextView::New();
   textView.SetParentOrigin( ParentOrigin::CENTER );
   textView.SetAnchorPoint( AnchorPoint::CENTER );
-  textView.SetSizePolicy( Toolkit::Control::Flexible, Toolkit::Control::Flexible );
   textView.SetZ( VALUE_DISPLAY_TEXT_Z );
   return textView;
 }
@@ -531,6 +535,7 @@ Toolkit::TextView Slider::CreatePopupText()
 ImageActor Slider::CreatePopup()
 {
   ImageActor popup = ImageActor::New();
+  popup.SetRelayoutEnabled( false );
   popup.SetParentOrigin( ParentOrigin::TOP_CENTER );
   popup.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
 
index 1b15f2b..5544761 100644 (file)
@@ -250,7 +250,7 @@ void SuperBlurView::ClearBlurResource()
   }
 }
 
-void SuperBlurView::OnRelayout( const Vector2& size, ActorSizeContainer& container )
+void SuperBlurView::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   unsigned int numChildren = Self().GetChildCount();
 
index ebbe453..041e717 100644 (file)
@@ -122,7 +122,7 @@ private: // from Control
   /**
    * @copydoc Control::OnRelayout()
    */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
 
 private:
 
index e18fd6d..4f17023 100644 (file)
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/scripting/scripting.h>
+#include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/integration-api/debug.h>
 
 using namespace Dali;
 
 namespace
 {
-const float DEFAULT_CONSTRAINT_DURATION = 0.0f;
 
 /**
- * sets a child property relative to parents size and applies a unit based padding before the relative calculation.
- * @param[in] scale of parent minus padding between 0 and 1
- * @param[in] padding in world coordinate units
- * @param[in] fixed part in world coordinate units
- * @param[in] size of the parent
- * @return The relative size with padding.
+ * @brief Should the tableview fit around the given actor
+ *
+ * @param[in] actor The child actor to test against
+ * @param[dimension] The dimnesion to test against
  */
-Vector2 RelativeToSize( const Vector2& scale, const Vector2& padding, const Vector2& fixed, const Vector2& parentSize)
+bool FitToChild( Actor actor, Dimension dimension )
 {
-  return fixed + ( parentSize - padding ) * scale;
+  return actor.GetResizePolicy( dimension ) != FILL_TO_PARENT && actor.GetRelayoutSize( dimension ) > 0.0f;
 }
 
 #if defined(DEBUG_ENABLED)
@@ -136,9 +134,9 @@ DALI_TYPE_REGISTRATION_END()
 
 const Scripting::StringEnum< Toolkit::TableView::LayoutPolicy > LAYOUT_POLICY_STRING_TABLE[] =
 {
- { "fixed",    Toolkit::TableView::Fixed    },
- { "relative", Toolkit::TableView::Relative },
- { "fill",     Toolkit::TableView::Fill     }
+ { "fixed",    Toolkit::TableView::FIXED    },
+ { "relative", Toolkit::TableView::RELATIVE },
+ { "fill",     Toolkit::TableView::FILL     }
 };
 
 const unsigned int LAYOUT_POLICY_STRING_TABLE_COUNT = sizeof(LAYOUT_POLICY_STRING_TABLE) / sizeof( LAYOUT_POLICY_STRING_TABLE[0] );
@@ -160,7 +158,7 @@ Toolkit::TableView TableView::New( unsigned int initialRows, unsigned int initia
   return handle;
 }
 
-bool TableView::AddChild( Actor child, Toolkit::TableView::CellPosition position )
+bool TableView::AddChild( Actor& child, const Toolkit::TableView::CellPosition& position )
 {
   // check that the child is valid
   DALI_ASSERT_ALWAYS( child );
@@ -170,31 +168,35 @@ bool TableView::AddChild( Actor child, Toolkit::TableView::CellPosition position
   {
     child.GetParent().Remove( child );
   }
+
   // check if we need to expand our data array
   if( position.rowIndex >= mCellData.GetRows() )
   {
     // only adding new rows
     ResizeContainers( position.rowIndex + 1, mCellData.GetColumns() );
   }
+
   if( position.columnIndex >= mCellData.GetColumns() )
   {
     // only adding new columns
     ResizeContainers( mCellData.GetRows(), position.columnIndex + 1 );
   }
+
   // check if there already is something in this cell
   if( mCellData[ position.rowIndex ][ position.columnIndex ].actor )
   {
     return false; // cannot share a cell, it would complicate all logic and not bring much benefit
   }
+
   RelayoutingLock lock( *this );
   // adopt the child
   Self().Add( child );
 
   // put the actor to the main cell
-  CellData data;
+  CellData& data = mCellData[ position.rowIndex ][ position.columnIndex ];
   data.actor = child;
   data.position = position;
-  mCellData[ position.rowIndex ][ position.columnIndex ] = data;
+
   // if child spans multiple rows of columns
   bool spanned = false;
   if( position.rowSpan > 1 )
@@ -205,8 +207,10 @@ bool TableView::AddChild( Actor child, Toolkit::TableView::CellPosition position
       // increase table size for the full span, only increasing rows
       ResizeContainers( position.rowIndex + position.rowSpan, mCellData.GetColumns() );
     }
+
     spanned = true;
   }
+
   if( position.columnSpan > 1 )
   {
     // span might go outside table
@@ -215,8 +219,10 @@ bool TableView::AddChild( Actor child, Toolkit::TableView::CellPosition position
       // increase table size for the full span, only increasing columns
       ResizeContainers( mCellData.GetRows(), position.columnIndex + position.columnSpan );
     }
+
     spanned = true;
   }
+
   // if it spanned multiple rows, put the cellinfo in all of those
   if( spanned )
   {
@@ -232,25 +238,25 @@ bool TableView::AddChild( Actor child, Toolkit::TableView::CellPosition position
       }
     }
   }
-  // relayout the whole table
+
+  // Relayout the whole table
   RelayoutRequest();
-  return true; // addition successful
+
+  return true;    // Addition successful
 }
 
-Actor TableView::GetChildAt( Toolkit::TableView::CellPosition position )
+Actor TableView::GetChildAt( const Toolkit::TableView::CellPosition& position )
 {
-  // check if we have this row and column in the table
-  if( ( position.columnIndex >= mCellData.GetColumns() )||
-      ( position.rowIndex >= mCellData.GetRows() ) )
+  if( ( position.rowIndex < mCellData.GetRows() ) && ( position.columnIndex < mCellData.GetColumns() ) )
   {
-    // return an empty handle
-    return Actor();
+    return mCellData[ position.rowIndex ][ position.columnIndex ].actor;
   }
-  // return the child handle
-  return mCellData[ position.rowIndex ][ position.columnIndex ].actor;
+
+  // Return an empty handle
+  return Actor();
 }
 
-Actor TableView::RemoveChildAt( Toolkit::TableView::CellPosition position )
+Actor TableView::RemoveChildAt( const Toolkit::TableView::CellPosition& position )
 {
   // get the child handle
   Actor child = GetChildAt( position );
@@ -271,62 +277,70 @@ Actor TableView::RemoveChildAt( Toolkit::TableView::CellPosition position )
   return child;
 }
 
-bool TableView::FindChildPosition( Actor child, Toolkit::TableView::CellPosition& position )
+bool TableView::FindChildPosition( const Actor& child, Toolkit::TableView::CellPosition& positionOut )
 {
-  // only find valid child actors
+  // Only find valid child actors
   if( child )
   {
-    // walk through the layout data
+    // Walk through the layout data
     const unsigned int rowCount = mCellData.GetRows();
     const unsigned int columnCount = mCellData.GetColumns();
+
     for( unsigned int row = 0; row < rowCount; ++row )
     {
       for( unsigned int column = 0; column < columnCount; ++column )
       {
         if( mCellData[ row ][ column ].actor == child )
         {
-          position = mCellData[ row ][ column ].position;
+          positionOut = mCellData[ row ][ column ].position;
           return true;
         }
       }
     }
   }
+
   return false;
 }
 
 void TableView::InsertRow( unsigned int rowIndex )
 {
   RelayoutingLock lock( *this );
+
   mCellData.InsertRow( rowIndex );
-  // need to update the cellinfos for the items that moved
+
+  // Need to update the cell infos for the items that moved
   const unsigned int rowCount = mCellData.GetRows();
   const unsigned int columnCount = mCellData.GetColumns();
+
   for( unsigned int row = 0; row < rowCount; ++row )
   {
     for( unsigned int column = 0; column < columnCount; ++column )
     {
       Toolkit::TableView::CellPosition& position = mCellData[ row ][ column ].position;
-      // if cell is spanning and above and spans to inserted row
-      if( ( position.rowSpan > 1 )&&( position.rowIndex <= rowIndex )&&
+
+      // If cell is spanning and above and spans to inserted row
+      if( ( position.rowSpan > 1 ) && ( position.rowIndex <= rowIndex ) &&
           ( position.rowIndex + position.rowSpan > rowIndex ) )
       {
-        // increase span by one
+        // Increment span
         position.rowSpan++;
-        // copy cell to occupy the new column
+
+        // Copy cell to occupy the new column
         mCellData[ rowIndex ][ column ] = mCellData[ row ][ column ];
       }
-      // if below of inserted row, increase row index
-      else if( row > rowIndex )
+      else if( row > rowIndex )   // If below of inserted row, increase row index
       {
-        // increase index by one
+        // Increment index
         position.rowIndex++;
       }
     }
   }
-  mRelativeSizes.InsertRow( rowIndex );
-  // inserting a row requires adjusting the height vectors
-  mFixedHeights.insert( mFixedHeights.begin() + rowIndex, 0 );
-  mRelativeHeights.insert( mRelativeHeights.begin() + rowIndex, 0 );
+
+  // Expand row data array
+  mRowData.Insert( mRowData.Begin() + rowIndex, RowColumnData() );
+
+  // Sizes may have changed, so relayout
+  mRowColumnDirty = true;
   RelayoutRequest();
 }
 
@@ -339,30 +353,34 @@ void TableView::DeleteRow( unsigned int rowIndex )
 void TableView::DeleteRow( unsigned int rowIndex, std::vector<Actor>& removed )
 {
   RelayoutingLock lock( *this );
+
+  // Delete the row
   std::vector< CellData > lost;
   mCellData.DeleteRow( rowIndex, lost );
-  // need to update the cellinfos for the items that moved
+
+  // Need to update the cell infos for the items that moved
   const unsigned int rowCount = mCellData.GetRows();
   const unsigned int columnCount = mCellData.GetColumns();
+
   for( unsigned int row = 0; row < rowCount; ++row )
   {
     for( unsigned int column = 0; column < columnCount; ++column )
     {
       Toolkit::TableView::CellPosition& position = mCellData[ row ][ column ].position;
-      // if cell is spanning and above and spans to deleted row
-      if( ( position.rowSpan > 1 )&&( position.rowIndex <= rowIndex )&&
+
+      // If cell is spanning and above and spans to deleted row
+      if( ( position.rowSpan > 1 ) && ( position.rowIndex <= rowIndex ) &&
           ( position.rowIndex + position.rowSpan > rowIndex ) )
       {
-        // decrease span by one
+        // Decrement span
         if( position.rowSpan > 1 )
         {
           position.rowSpan--;
         }
       }
-      // if below of or at the inserted row, decrease row index
-      else if( row >= rowIndex )
+      else if( row >= rowIndex )    // If below of or at the inserted row, decrease row index
       {
-        // decrease index by one
+        // Decrement index
         if( position.rowIndex > 1 )
         {
           position.rowIndex--;
@@ -370,50 +388,58 @@ void TableView::DeleteRow( unsigned int rowIndex, std::vector<Actor>& removed )
       }
     }
   }
+
   // 1 row removed, 0 columns
   RemoveAndGetLostActors( lost, removed, 1u, 0u );
-  // resize the data structures
-  mRelativeSizes.DeleteRow( rowIndex );
-  // deleting a row requires adjusting the height vectors
-  mFixedHeights.erase( mFixedHeights.begin() + rowIndex );
-  mRelativeHeights.erase( mRelativeHeights.begin() + rowIndex );
+
+  // Contract row data array
+  mRowData.Erase( mRowData.Begin() + rowIndex );
+
+  // Sizes may have changed, so relayout
+  mRowColumnDirty = true;
   RelayoutRequest();
 }
 
 void TableView::InsertColumn( unsigned int columnIndex )
 {
   RelayoutingLock lock( *this );
+
+  // Insert the new column
   mCellData.InsertColumn( columnIndex );
-  // need to update the cellinfos for the items that moved
+
+  // Need to update the cell infos for the items that moved
   const unsigned int rowCount = mCellData.GetRows();
   const unsigned int columnCount = mCellData.GetColumns();
+
   for( unsigned int row = 0; row < rowCount; ++row )
   {
     for( unsigned int column = 0; column < columnCount; ++column )
     {
       Toolkit::TableView::CellPosition& position = mCellData[ row ][ column ].position;
-      // if cell is spanning and left side and spans to inserted column
-      if( ( position.columnSpan > 1 )&&( position.columnIndex <= columnIndex )&&
+
+      // If cell is spanning and left side and spans to inserted column
+      if( ( position.columnSpan > 1 ) && ( position.columnIndex <= columnIndex ) &&
           ( position.columnIndex + position.columnSpan > columnIndex ) )
       {
-        // increase span by one
+        // Increment span
         position.columnSpan++;
-        // copy cell to occupy the new column
+
+        // Copy cell to occupy the new column
         mCellData[ row ][ columnIndex ] = mCellData[ row ][ column ];
       }
-      // if on the right side of inserted column, increase column index
-      else if( column > columnIndex )
+      else if( column > columnIndex )   // If on the right side of inserted column, increase column index
       {
-        // increase index by one
+        // Increment index
         position.columnIndex++;
       }
     }
   }
-  // relative sizes gets recalculated on Relayout
-  mRelativeSizes.InsertColumn( columnIndex );
-  // inserting a column requires adjusting the width vectors
-  mFixedWidths.insert( mFixedWidths.begin() + columnIndex, 0 );
-  mRelativeWidths.insert( mRelativeWidths.begin() + columnIndex, 0 );
+
+  // Expand column data array
+  mColumnData.Insert( mColumnData.Begin() + columnIndex, RowColumnData() );
+
+  // Sizes may have changed so relayout
+  mRowColumnDirty = true;
   RelayoutRequest();
 }
 
@@ -426,30 +452,34 @@ void TableView::DeleteColumn( unsigned int columnIndex )
 void TableView::DeleteColumn( unsigned int columnIndex, std::vector<Actor>& removed )
 {
   RelayoutingLock lock( *this );
+
+  // Remove the column
   std::vector< CellData > lost;
   mCellData.DeleteColumn( columnIndex, lost );
-  // need to update the cellinfos for the items that moved
+
+  // Need to update the cell infos for the items that moved
   const unsigned int rowCount = mCellData.GetRows();
   const unsigned int columnCount = mCellData.GetColumns();
+
   for( unsigned int row = 0; row < rowCount; ++row )
   {
     for( unsigned int column = 0; column < columnCount; ++column )
     {
       Toolkit::TableView::CellPosition& position = mCellData[ row ][ column ].position;
-      // if cell is spanning and left side and spans to inserted column
-      if( ( position.columnSpan > 1 )&&( position.columnIndex <= columnIndex )&&
+
+      // If cell is spanning and left side and spans to inserted column
+      if( ( position.columnSpan > 1 ) && ( position.columnIndex <= columnIndex ) &&
           ( position.columnIndex + position.columnSpan > columnIndex ) )
       {
-        // decrease span by one
+        // Decrement span
         if( position.columnSpan > 1 )
         {
           position.columnSpan--;
         }
       }
-      // if on the right side of or at the inserted column, decrease column index
-      else if( column >= columnIndex )
+      else if( column >= columnIndex )    // If on the right side of or at the inserted column, decrease column index
       {
-        // decrease index by one
+        // Decrement index
         if( position.columnIndex > 0 )
         {
           position.columnIndex--;
@@ -457,14 +487,15 @@ void TableView::DeleteColumn( unsigned int columnIndex, std::vector<Actor>& remo
       }
     }
   }
+
   // 0 rows, 1 column removed
   RemoveAndGetLostActors( lost, removed, 0u, 1u );
-  // resize the data structures
-  mRelativeSizes.DeleteColumn( columnIndex );
-  // deleting a column requires adjusting the width vectors
-  mFixedWidths.erase( mFixedWidths.begin() + columnIndex );
-  mRelativeWidths.erase( mRelativeWidths.begin() + columnIndex );
-  // relayout
+
+  // Contract column data array
+  mColumnData.Erase( mColumnData.Begin() + columnIndex );
+
+  // Size may have changed so relayout
+  mRowColumnDirty = true;
   RelayoutRequest();
 }
 
@@ -477,36 +508,45 @@ void TableView::Resize( unsigned int rows, unsigned int columns )
 void TableView::Resize( unsigned int rows, unsigned int columns, std::vector<Actor>& removed )
 {
   RelayoutingLock lock( *this );
+
   unsigned int oldRows = GetRows();
   unsigned int oldColumns = GetColumns();
-  // resize data array
+
+  // Resize data array
   std::vector< CellData > lost;
   ResizeContainers( rows, columns, lost );
-  // calculate if we lost rows or columns
+
+  // Calculate if we lost rows
   unsigned int rowsRemoved = 0;
   unsigned int newRows = GetRows();
+
   if( oldRows < newRows )
   {
     rowsRemoved = newRows - oldRows;
   }
+
+  // Calculate if we lost columns
   unsigned int columnsRemoved = 0;
   unsigned int newColumns = GetColumns();
   if( oldColumns < newColumns )
   {
     rowsRemoved = newColumns - oldColumns;
   }
+
   RemoveAndGetLostActors( lost, removed, rowsRemoved, columnsRemoved );
-  // finally relayout once all actors are removed
+
+  // Sizes may have changed so request a relayout
+  mRowColumnDirty = true;
   RelayoutRequest();
 }
 
 void TableView::SetCellPadding( Size padding )
 {
-  // if padding really changed
+  // If padding really changed
   if( padding != mPadding )
   {
     mPadding = padding;
-    // do a relayout
+
     RelayoutRequest();
   }
 }
@@ -516,184 +556,224 @@ Size TableView::GetCellPadding()
   return mPadding;
 }
 
+void TableView::SetRowPolicy( unsigned int rowIndex, CellSizePolicy policy )
+{
+  DALI_ASSERT_ALWAYS( rowIndex < mRowData.Size() );
+
+  if( mRowData[ rowIndex ].sizePolicy != policy )
+  {
+    mRowData[ rowIndex ].sizePolicy = policy;
+
+    mRowColumnDirty = true;
+    RelayoutRequest();
+  }
+}
+
+TableView::CellSizePolicy TableView::GetRowPolicy( unsigned int rowIndex ) const
+{
+  DALI_ASSERT_ALWAYS( rowIndex < mRowData.Size() );
+
+  return mRowData[ rowIndex ].sizePolicy;
+}
+
+void TableView::SetColumnPolicy( unsigned int columnIndex, CellSizePolicy policy )
+{
+  DALI_ASSERT_ALWAYS( columnIndex < mColumnData.Size() );
+
+  if( mColumnData[ columnIndex ].sizePolicy != policy )
+  {
+    mColumnData[ columnIndex ].sizePolicy = policy;
+
+    mRowColumnDirty = true;
+    RelayoutRequest();
+  }
+}
+
+TableView::CellSizePolicy TableView::GetColumnPolicy( unsigned int columnIndex ) const
+{
+  DALI_ASSERT_ALWAYS( columnIndex < mColumnData.Size() );
+
+  return mColumnData[ columnIndex ].sizePolicy;
+}
+
 void TableView::SetFixedHeight( unsigned int rowIndex, float height )
 {
-  DALI_ASSERT_ALWAYS( rowIndex < mFixedHeights.size() );
-  // add the fixed height to the array of fixed heights
-  mFixedHeights[ rowIndex ] = height;
-  // remove the relative height of the same row
-  mRelativeHeights[ rowIndex ] = 0.f;
-  // relayout all cells, no lock needed as nothing added or removed
+  DALI_ASSERT_ALWAYS( rowIndex < mRowData.Size() );
+
+  RowColumnData& data = mRowData[ rowIndex ];
+  data.size = height;
+  data.sizePolicy = FIXED;
+
+  mRowColumnDirty = true;
   RelayoutRequest();
 }
 
 float TableView::GetFixedHeight( unsigned int rowIndex ) const
 {
-  DALI_ASSERT_ALWAYS( rowIndex < mFixedHeights.size() );
+  DALI_ASSERT_ALWAYS( rowIndex < mRowData.Size() );
 
-  return mFixedHeights[ rowIndex ];
+  return mRowData[ rowIndex ].size;
 }
 
-void TableView::SetRelativeHeight( unsigned int rowIndex, float heightPercentage )
+void TableView::SetFixedWidth( unsigned int columnIndex, float width )
 {
-  DALI_ASSERT_ALWAYS( rowIndex < mRelativeHeights.size() );
-  // add the relative height to the array of relative heights
-  mRelativeHeights[ rowIndex ] = heightPercentage;
-  // remove the fixed height of the same row
-  mFixedHeights[ rowIndex ] = 0.f;
-  // relayout all cells, no lock needed as nothing added or removed
+  DALI_ASSERT_ALWAYS( columnIndex < mColumnData.Size() );
+
+  RowColumnData& data = mColumnData[ columnIndex ];
+  data.size = width;
+  data.sizePolicy = FIXED;
+
+  mRowColumnDirty = true;
   RelayoutRequest();
 }
 
-float TableView::GetRelativeHeight( unsigned int rowIndex ) const
+float TableView::GetFixedWidth( unsigned int columnIndex ) const
 {
-  DALI_ASSERT_ALWAYS( rowIndex < mRelativeHeights.size() );
+  DALI_ASSERT_ALWAYS( columnIndex < mColumnData.Size() );
 
-  return mRelativeHeights[ rowIndex ];
+  return mColumnData[ columnIndex ].size;
 }
 
-void TableView::SetFixedWidth( unsigned int columnIndex, float width )
+void TableView::SetRelativeHeight( unsigned int rowIndex, float heightPercentage )
 {
-  DALI_ASSERT_ALWAYS( columnIndex < mFixedWidths.size() );
-  // add the fixed width to the array of fixed column widths
-  mFixedWidths[ columnIndex ] = width;
-  // remove the relative width of the same column
-  mRelativeWidths[ columnIndex ] = 0.f;
-  // relayout all cells, no lock needed as nothing added or removed
+  DALI_ASSERT_ALWAYS( rowIndex < mRowData.Size() );
+
+  RowColumnData& data = mRowData[ rowIndex ];
+  data.fillRatio = heightPercentage;
+  data.userFillRatio = true;
+  data.sizePolicy = FILL;
+
+  mRowColumnDirty = true;
   RelayoutRequest();
 }
 
-float TableView::GetFixedWidth( unsigned int columnIndex ) const
+float TableView::GetRelativeHeight( unsigned int rowIndex ) const
 {
-  DALI_ASSERT_ALWAYS( columnIndex < mFixedWidths.size() );
+  DALI_ASSERT_ALWAYS( rowIndex < mRowData.Size() );
 
-  return mFixedWidths[ columnIndex ];
+  return mRowData[ rowIndex ].fillRatio;
 }
 
 void TableView::SetRelativeWidth( unsigned int columnIndex, float widthPercentage )
 {
-  DALI_ASSERT_ALWAYS( columnIndex < mRelativeWidths.size() );
-  // add the relative widths to the array of relative widths
-  mRelativeWidths[ columnIndex ] = widthPercentage;
-  // remove the fixed width of the same column
-  mFixedWidths[ columnIndex ] = 0.f;
-  // relayout all cells, no lock needed as nothing added or removed
+  DALI_ASSERT_ALWAYS( columnIndex < mColumnData.Size() );
+
+  RowColumnData& data = mColumnData[ columnIndex ];
+  data.fillRatio = widthPercentage;
+  data.userFillRatio = true;
+  data.sizePolicy = FILL;
+
+  mRowColumnDirty = true;
   RelayoutRequest();
 }
 
 float TableView::GetRelativeWidth( unsigned int columnIndex ) const
 {
-  DALI_ASSERT_ALWAYS( columnIndex < mRelativeWidths.size() );
+  DALI_ASSERT_ALWAYS( columnIndex < mColumnData.Size() );
+
+  return mColumnData[ columnIndex ].fillRatio;
+}
+
+void TableView::CalculateRowColumnData()
+{
+  // Calculate the relative sizes
+  if( mRowColumnDirty )
+  {
+    ComputeRelativeSizes( mRowData );
+    ComputeRelativeSizes( mColumnData );
 
-  return mRelativeWidths[ columnIndex ];
+    mRowColumnDirty = false;
+  }
 }
 
-void TableView::OnRelayout( const Vector2& size, ActorSizeContainer& container )
+void TableView::OnCalculateRelayoutSize( Dimension dimension )
 {
-  float fixedHeightsTotal = 0.0f;
-  float fixedWidthsTotal = 0.0f;
+  CalculateRowColumnData();
 
-  // 1. update the relative sizes and calculate total fixed height and width
-  UpdateRelativeSizes( fixedHeightsTotal, fixedWidthsTotal );
+  if( dimension & WIDTH )
+  {
+    CalculateFixedSizes( mColumnData, WIDTH );
+    mFixedTotals.width = CalculateTotalFixedSize( mColumnData );
+  }
 
-  // 2. go through the layout data and create constraints
-  float cumulatedFixedHeight = 0.0f;
-  float cumulatedRelativeHeight = 0.0f;
+  if( dimension & HEIGHT )
+  {
+    CalculateFixedSizes( mRowData, HEIGHT );
+    mFixedTotals.height = CalculateTotalFixedSize( mRowData );
+  }
+}
+
+void TableView::OnLayoutNegotiated( float size, Dimension dimension )
+{
+  CalculateRowColumnData();
+
+  // Calculate the value of all relative sized rows and columns
+  if( dimension & WIDTH )
+  {
+    float remainingSize = size - mFixedTotals.width;
+    if( remainingSize < 0.0f )
+    {
+      remainingSize = 0.0f;
+    }
+
+    CalculateRelativeSizes( mColumnData, remainingSize );
+  }
+
+  if( dimension & HEIGHT )
+  {
+    float remainingSize = size - mFixedTotals.height;
+    if( remainingSize < 0.0f )
+    {
+      remainingSize = 0.0f;
+    }
+
+    CalculateRelativeSizes( mRowData, remainingSize );
+  }
+}
+
+void TableView::OnRelayout( const Vector2& size, RelayoutContainer& container )
+{
+  CalculateRowColumnData();
+
+  // Go through the layout data
+  float cumulatedHeight = 0.0f;
 
-  // iterate the table
   const unsigned int rowCount = mCellData.GetRows();
   const unsigned int columnCount = mCellData.GetColumns();
-  // float versions of the count + 1 to keep precision
-  const float maxRowPlusOne( rowCount + 1 );
-  const float maxColumnPlusOne( columnCount + 1 );
+
   for( unsigned int row = 0; row < rowCount; ++row )
   {
-    // reset widths at the start of each row
-    float cumulatedFixedWidth = 0.0f;
-    float cumulatedRelativeWidth = 0.0f;
+    float cumulatedWidth = 0.0f;
+
     for( unsigned int column = 0; column < columnCount; ++column )
     {
-      // check if this cell has an actor
-      Actor actor = mCellData[ row ][ column ].actor;
+      Actor& actor = mCellData[ row ][ column ].actor;
       const Toolkit::TableView::CellPosition position = mCellData[ row ][ column ].position;
-      // if there is an actor and this is the main cell of the actor
-      // an actor can be in multiple cells if its row or columnspan is more than 1
-      // we however must only lay out each actor only once
-      if( ( actor )&&( position.rowIndex == row )&&( position.columnIndex == column ) )
+
+      // If there is an actor and this is the main cell of the actor.
+      // An actor can be in multiple cells if its row or columnspan is more than 1.
+      // We however must lay out each actor only once.
+      if( actor && ( position.rowIndex == row ) && ( position.columnIndex == column ) )
       {
-        // anchor actor correctly
+        // Anchor actor to top left of table view
         actor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
         actor.SetParentOrigin( ParentOrigin::TOP_LEFT );
-        // remove old constraints
-        actor.RemoveConstraints();
-
-        // 1. set position
-        // get the row and column indices
-        float rowPos( position.rowIndex );
-        float colPos( position.columnIndex );
-        // constrain the actor position to be relative to the width and height of table
-        // minus the padding of course (padding is all around cells)
-        Vector2 relativePosition( cumulatedRelativeWidth, cumulatedRelativeHeight );
-        // fixed height rows and fixed width cells are considered as padding so
-        // they are removed from the total size for relative
-        // for position only consider cumulated fixed rows and columns from top and left
-        Vector2 positionPadding( maxColumnPlusOne * mPadding.width + fixedWidthsTotal,
-                                 maxRowPlusOne * mPadding.height + fixedHeightsTotal );
-        Vector2 fixedPosition( ( colPos + 1.0f ) * mPadding.width + cumulatedFixedWidth,
-                                 ( rowPos + 1.0f ) * mPadding.height + cumulatedFixedHeight );
-
-        Vector3 actorPosition( RelativeToSize( relativePosition, positionPadding, fixedPosition, size ) );
-        actor.SetPosition( actorPosition );
 
-        // 2. set size
-        // constrain the actor size to be relative to the size of table
-        // get the relative size for this cell
-        Vector2 relativeSize( mRelativeSizes[ row ][ column ] );
-        Vector2 fixedSize( mFixedWidths[ column ], mFixedHeights[ row ] );
-        // if we span multiple cells, need to sum them all up, both fixed and relative parts
-        if( position.rowSpan > 1 )
-        {
-          for( unsigned int i = 1; i < position.rowSpan; ++i )
-          {
-            // accumulate the height only
-            relativeSize.height += mRelativeSizes[ row + i ][ column ].height;
-            fixedSize.height += mFixedHeights[ row + i ];
-          }
-        }
-        if( position.columnSpan > 1 )
-        {
-          for( unsigned int i = 1; i < position.columnSpan; ++i )
-          {
-            // accumulate the width only
-            relativeSize.width += mRelativeSizes[ row ][ column + i ].width;
-            fixedSize.width += mFixedWidths[ column + i ];
-          }
-        }
-        // minus the padding from size (padding is all around cells)
-        // if item spans multiple columns or rows then less padding is added (default span is 1)
-        // fixed height rows and fixed width cells are considered as padding so they are removed
-        // from the total available size for relative cells
-        Vector2 sizePadding( maxColumnPlusOne * mPadding.width + fixedWidthsTotal,
-                             maxRowPlusOne * mPadding.height + fixedHeightsTotal );
-        // and added to the fixed size multiplied by the span of rows and columns
-        fixedSize.width += ( position.columnSpan - 1.0f ) * mPadding.width;
-        fixedSize.height += ( position.rowSpan - 1.0f ) * mPadding.height;
-
-        Vector2 actorSize( RelativeToSize( relativeSize, sizePadding, fixedSize, size ) );
-        actor.SetSize(actorSize.x, actorSize.y);
-
-        // Relayout Children
-        Relayout ( actor, actorSize, container );
+        Padding padding;
+        actor.GetPadding( padding );
+
+        Vector3 actorPosition( cumulatedWidth + mPadding.width + padding.left,       // Left padding
+                               cumulatedHeight + mPadding.height + padding.top,      // Top padding
+                               0.0f );
+        actor.SetPosition( actorPosition );
       }
-      // for position we need to keep track of current fixed width and relative width
-      // increase for next column
-      cumulatedFixedWidth += mFixedWidths[ column ];
-      cumulatedRelativeWidth += mRelativeSizes[ row ][ column ].width;
+
+      DALI_ASSERT_DEBUG( column < mColumnData.Size() );
+      cumulatedWidth += mColumnData[ column ].size;
     }
-    // for position we need to keep track of current fixed height and relative height
-    // increase for next row
-    cumulatedFixedHeight += mFixedHeights[ row ];
-    cumulatedRelativeHeight += mRelativeSizes[ row ][ 0 ].height; // all columns share same height
+
+    DALI_ASSERT_DEBUG( row < mRowData.Size() );
+    cumulatedHeight += mRowData[ row ].size;
   }
 }
 
@@ -801,15 +881,20 @@ void TableView::OnControlChildAdd( Actor& child )
     return;
   }
 
+  RelayoutRequest();
+
+  // Test properties on actor
   Toolkit::TableView::CellPosition cellPosition;
   if( child.GetPropertyIndex(Toolkit::TableView::ROW_SPAN_PROPERTY_NAME) != Property::INVALID_INDEX )
   {
     cellPosition.rowSpan = static_cast<unsigned int>( child.GetProperty( child.GetPropertyIndex(Toolkit::TableView::ROW_SPAN_PROPERTY_NAME) ).Get<float>() );
   }
+
   if( child.GetPropertyIndex(Toolkit::TableView::COLUMN_SPAN_PROPERTY_NAME) != Property::INVALID_INDEX )
   {
     cellPosition.columnSpan = static_cast<unsigned int>( child.GetProperty( child.GetPropertyIndex(Toolkit::TableView::COLUMN_SPAN_PROPERTY_NAME) ).Get<float>() );
   }
+
   if( child.GetPropertyIndex(Toolkit::TableView::CELL_INDICES_PROPERTY_NAME) != Property::INVALID_INDEX )
   {
     Vector2 indices = child.GetProperty( child.GetPropertyIndex(Toolkit::TableView::CELL_INDICES_PROPERTY_NAME) ).Get<Vector2 >();
@@ -817,44 +902,43 @@ void TableView::OnControlChildAdd( Actor& child )
     cellPosition.columnIndex = static_cast<unsigned int>( indices.y );
 
     AddChild( child, cellPosition );
-    // donot continue
+
+    // Do not continue
     return;
   }
 
-  // check if we're already laying out this child somewhere on the table
-  // walk through the layout data
+  // Find the first available cell to store the actor in
   const unsigned int rowCount = mCellData.GetRows();
   const unsigned int columnCount = mCellData.GetColumns();
-  // child not yet laid out, find the first free slot
   for( unsigned int row = 0; row < rowCount; ++row )
   {
     for( unsigned int column = 0; column < columnCount; ++column )
     {
-      // no actor means free cell
       if( !(mCellData[ row ][ column ].actor) )
       {
-        // put the actor in the cell
+        // Put the actor in the cell
         CellData data;
         data.actor = child;
         data.position.columnIndex = column;
         data.position.rowIndex = row;
         mCellData[ row ][ column ] = data;
-        RelayoutRequest();
-        // don' continue
+
+        // Don't continue
         return;
       }
     }
   }
-  // still here, no room for the poor child so increase the array. Need a new row
-  ResizeContainers( rowCount + 1, columnCount );
-  // put the actor to the first cell of the new row
+
+  // No empty cells, so increase size of the table
+  unsigned int newColumnCount = ( columnCount > 0 ) ? columnCount : 1;
+  ResizeContainers( rowCount + 1, newColumnCount );
+
+  // Put the actor in the first cell of the new row
   CellData data;
   data.actor = child;
   data.position.rowIndex = rowCount;
   data.position.columnIndex = 0;
   mCellData[ rowCount ][ 0 ] = data;
-  // finally relayout the table
-  RelayoutRequest();
 }
 
 void TableView::OnControlChildRemove( Actor& child )
@@ -873,7 +957,8 @@ void TableView::OnControlChildRemove( Actor& child )
 TableView::TableView( unsigned int initialRows, unsigned int initialColumns )
 : Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
   mCellData( initialRows, initialColumns ),
-  mLayoutingChild( false )
+  mLayoutingChild( false ),
+  mRowColumnDirty( true )     // Force recalculation first time
 {
   SetKeyboardNavigationSupport( true );
   ResizeContainers( initialRows, initialColumns );
@@ -895,13 +980,12 @@ void TableView::ResizeContainers( unsigned int rows, unsigned int columns )
 
 void TableView::ResizeContainers( unsigned int rows, unsigned int columns, std::vector<CellData>& removed )
 {
+  // Resize cell data
   mCellData.Resize( rows, columns, removed );
-  // we dont care if these go smaller, data will be regenerated or is not needed anymore
-  mRelativeSizes.Resize( rows, columns );
-  mFixedHeights.resize( rows );
-  mRelativeHeights.resize( rows );
-  mFixedWidths.resize( columns );
-  mRelativeWidths.resize( columns );
+
+  // We don't care if these go smaller, data will be regenerated or is not needed anymore
+  mRowData.Resize( rows );
+  mColumnData.Resize( columns );
 }
 
 void TableView::RemoveAndGetLostActors( const std::vector<CellData>& lost, std::vector<Actor>& removed,
@@ -952,7 +1036,7 @@ void TableView::RemoveAndGetLostActors( const std::vector<CellData>& lost, std::
   }
 }
 
-bool TableView::RemoveAllInstances( Actor child )
+bool TableView::RemoveAllInstances( const Actor& child )
 {
   bool found = false;
   // walk through the layout data
@@ -973,104 +1057,6 @@ bool TableView::RemoveAllInstances( Actor child )
   return found;
 }
 
-void TableView::UpdateRelativeSizes( float& fixedHeightsTotal, float& fixedWidthsTotal )
-{
-  // 1. check all the fixed heights and widths to know how much size they take in total
-  // as well as the relative heights and widths to know how much is left for the 'fill' cells
-  unsigned int fixedRowCount = 0;
-  unsigned int relativeRowCount = 0;
-  float relativeHeightsTotal = 0.0f;
-  const unsigned int rowCount = mCellData.GetRows();
-  for( unsigned int row = 0; row < rowCount; ++row )
-  {
-    if( mFixedHeights[ row ] > 0.0f )
-    {
-      ++fixedRowCount;
-      fixedHeightsTotal += mFixedHeights[ row ];
-    }
-    if( mRelativeHeights[ row ] > 0.0f )
-    {
-      ++relativeRowCount;
-      relativeHeightsTotal += mRelativeHeights[ row ];
-    }
-  }
-  unsigned int fixedColumnCount = 0;
-  unsigned int relativeColumnCount = 0;
-  const unsigned int columnCount = mCellData.GetColumns();
-  float relativeWidthsTotal = 0.0f;
-  for( unsigned int column = 0; column < columnCount; ++column )
-  {
-    if( mFixedWidths[ column ] > 0.0f )
-    {
-      ++fixedColumnCount;
-      fixedWidthsTotal += mFixedWidths[ column ];
-    }
-    if( mRelativeWidths[ column ] > 0.0f )
-    {
-      ++relativeColumnCount;
-      relativeWidthsTotal += mRelativeWidths[ column ];
-    }
-  }
-
-  // 2. cap the relative width and height totals to 100%
-  if( relativeHeightsTotal > 1.0f )
-  {
-    relativeHeightsTotal = 1.0f;
-  }
-  if( relativeWidthsTotal > 1.0f )
-  {
-    relativeWidthsTotal = 1.0f;
-  }
-
-  // 3. create a table of relative sizes so we can lookup for cells that span multiple rows & colums
-  const float fillRowCount( rowCount - relativeRowCount - fixedRowCount );
-  const float fillColumnCount( columnCount - relativeColumnCount - fixedColumnCount );
-
-  // walk through the data containers
-  for( unsigned int row = 0; row < rowCount; ++row )
-  {
-    float relativeHeight = 0.0f;
-    // if we have a fixed height, relative height is 0
-    if( mFixedHeights[ row ] > 0.0f )
-    {
-      relativeHeight = 0.0f;
-    }
-    // else if we're given a specific row height %, use that
-    else if( mRelativeHeights[ row ] > 0.0f )
-    {
-      relativeHeight = mRelativeHeights[ row ];
-    }
-    // else if there are fill rows
-    else if( fillRowCount > 0 )
-    {
-      // this is a 'fill' row. it gets the remainder of the 100% divided evenly between 'fill' rows
-      relativeHeight = (1.0f - relativeHeightsTotal ) / fillRowCount;
-    }
-    for( unsigned int column = 0; column < columnCount; ++column )
-    {
-      float relativeWidth = 0.0f;
-      // if we have a fixed width, relative width is 0
-      if( mFixedWidths[ column ] > 0.0f )
-      {
-        relativeWidth = 0.0f;
-      }
-      // else if we're given a specific column width %, use that
-      else if( mRelativeWidths[ column ] > 0.0f )
-      {
-        relativeWidth = mRelativeWidths[ column ];
-      }
-      // else if there are fill columns
-      else if( fillColumnCount > 0 )
-      {
-        // this is a 'fill' column. it gets the remainder of the 100% divided evenly between 'fill' columns
-        relativeWidth = (1.0f - relativeWidthsTotal ) / fillColumnCount;
-      }
-      // store the value
-      mRelativeSizes[ row ][ column ] = Size( relativeWidth, relativeHeight );
-    }
-  }
-}
-
 void TableView::SetHeightOrWidthProperty(TableView& tableViewImpl,
                                          void(TableView::*funcFixed)(unsigned int, float),
                                          void(TableView::*funcRelative)(unsigned int, float),
@@ -1090,11 +1076,11 @@ void TableView::SetHeightOrWidthProperty(TableView& tableViewImpl,
         if( item.HasKey( "policy" ) && item.HasKey( "value" ) )
         {
           Toolkit::TableView::LayoutPolicy policy = Scripting::GetEnumeration< Toolkit::TableView::LayoutPolicy >( item.GetValue("policy").Get<std::string>().c_str(), LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT );
-          if( policy == Toolkit::TableView::Fixed )
+          if( policy == Toolkit::TableView::FIXED )
           {
             (tableViewImpl.*funcFixed)( rowIndex, item.GetValue("value").Get<float>() );
           }
-          else if( policy == Toolkit::TableView::Relative )
+          else if( policy == Toolkit::TableView::RELATIVE )
           {
             (tableViewImpl.*funcRelative)( rowIndex, item.GetValue("value").Get<float>() );
           }
@@ -1107,40 +1093,61 @@ void TableView::SetHeightOrWidthProperty(TableView& tableViewImpl,
 Property::Value TableView::GetRowHeightsPropertyValue()
 {
   Property::Map map;
-  GetMapPropertyValue( mFixedHeights, mRelativeHeights, map);
+  GetMapPropertyValue( mRowData, map);
   return Property::Value(map);
 }
 
 Property::Value TableView::GetColumnWidthsPropertyValue()
 {
   Property::Map map;
-  GetMapPropertyValue( mFixedWidths, mRelativeWidths, map);
+  GetMapPropertyValue( mColumnData, map);
   return Property::Value(map);
 }
 
-void TableView::GetMapPropertyValue( const std::vector<float>& fixedSize, const std::vector<float>& relativeSize, Property::Map& map )
+void TableView::GetMapPropertyValue( const RowColumnArray& data, Property::Map& map )
 {
-  std::string fixedPolicy( Scripting::GetEnumerationName< Toolkit::TableView::LayoutPolicy >( Toolkit::TableView::Fixed, LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT ) );
-  std::string relativePolicy( Scripting::GetEnumerationName< Toolkit::TableView::LayoutPolicy >( Toolkit::TableView::Relative, LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT ) );
+  std::string fixedPolicy( Scripting::GetEnumerationName< Toolkit::TableView::LayoutPolicy >( Toolkit::TableView::FIXED, LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT ) );
+  std::string relativePolicy( Scripting::GetEnumerationName< Toolkit::TableView::LayoutPolicy >( Toolkit::TableView::RELATIVE, LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT ) );
 
-  size_t count = fixedSize.size();
-  for( size_t index = 0; index < count; index++ )
+  const RowColumnArray::SizeType count = data.Size();
+  for( RowColumnArray::SizeType i = 0; i < count; i++ )
   {
-    if( ! EqualsZero( fixedSize[index] ) )
-    {
-      Property::Map item;
-      item[ "policy" ] = fixedPolicy;
-      item[ "value" ] = fixedSize[index];
+    const RowColumnData& dataInstance = data[ i ];
 
-      map[ static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str() ] = item;
-    }
-    else if( ! EqualsZero( relativeSize[index] ) )
+    switch( dataInstance.sizePolicy )
     {
-      Property::Map item;
-      item[ "policy" ] = relativePolicy;
-      item[ "value" ] = relativeSize[index];
+      case FIXED:
+      {
+        Property::Map item;
+        item[ "policy" ] = fixedPolicy;
+        item[ "value" ] = dataInstance.size;
+
+        std::ostringstream ss;
+        ss << i;
+
+        map[ ss.str() ] = item;
+
+        break;
+      }
+
+      case FILL:
+      {
+        Property::Map item;
+        item[ "policy" ] = relativePolicy;
+        item[ "value" ] = dataInstance.fillRatio;
+
+        std::ostringstream ss;
+        ss << i;
 
-      map[ static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str() ] = item;
+        map[ ss.str() ] = item;
+
+        break;
+      }
+
+      default:
+      {
+        break;
+      }
     }
   }
 }
@@ -1236,6 +1243,257 @@ Actor TableView::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolki
   return nextFocusableActor;
 }
 
+Vector3 TableView::GetNaturalSize()
+{
+  // Natural size is the size of all fixed cell widths or heights. This ignores cells with relative heights.
+  return Vector3( mFixedTotals.width, mFixedTotals.height, 1.0f );
+}
+
+float TableView::CalculateChildSize( const Actor& child, Dimension dimension )
+{
+  CalculateRowColumnData();
+
+  const unsigned int rowCount = mCellData.GetRows();
+  const unsigned int columnCount = mCellData.GetColumns();
+
+  for( unsigned int row = 0; row < rowCount; ++row )
+  {
+    for( unsigned int column = 0; column < columnCount; ++column )
+    {
+      // check if this cell has an actor
+      Actor& actor = mCellData[ row ][ column ].actor;
+
+      if( actor && ( actor == child ) )
+      {
+        const Toolkit::TableView::CellPosition position = mCellData[ row ][ column ].position;
+
+        // If there is an actor and this is the main cell of the actor.
+        // An actor can be in multiple cells if its row or columnspan is more than 1.
+        if ( ( position.rowIndex == row ) && ( position.columnIndex == column ) )
+        {
+          switch( dimension )
+          {
+            case WIDTH:
+            {
+              float cellSize = 0.0f;
+
+              // Accumulate the width
+              for( unsigned int i = 0; i < position.columnSpan; ++i )
+              {
+                cellSize += mColumnData[ column + i ].size;
+              }
+
+              // Apply padding
+              cellSize -= mPadding.width * 2.0f;
+              if( cellSize < 0.0f )
+              {
+                cellSize = 0.0f;
+              }
+
+              return cellSize;
+            }
+
+            case HEIGHT:
+            {
+              float cellSize = 0.0f;
+
+              // Accumulate the height
+              for( unsigned int i = 0; i < position.rowSpan; ++i )
+              {
+                cellSize += mRowData[ row + i ].size;
+              }
+
+              // Apply padding
+              cellSize -= mPadding.width * 2.0f;
+              if( cellSize < 0.0f )
+              {
+                cellSize = 0.0f;
+              }
+
+              return cellSize;
+            }
+
+            default:
+            {
+              return 0.0f;
+            }
+          }
+        }
+      }
+    }
+  }
+
+  return 0.0f;    // Child not found
+}
+
+bool TableView::RelayoutDependentOnChildren( Dimension dimension )
+{
+  if ( Control::RelayoutDependentOnChildren( dimension ) )
+  {
+    return true;
+  }
+
+  return FindFit( mRowData ) || FindFit( mColumnData );
+}
+
+void TableView::SetCellAlignment( Toolkit::TableView::CellPosition position, HorizontalAlignment::Type horizontal, VerticalAlignment::Type vertical )
+{
+  // Check if we need to expand our data array
+  if( position.rowIndex >= mCellData.GetRows() )
+  {
+    // Only adding new rows
+    ResizeContainers( position.rowIndex + 1, mCellData.GetColumns() );
+  }
+
+  if( position.columnIndex >= mCellData.GetColumns() )
+  {
+    // Only adding new columns
+    ResizeContainers( mCellData.GetRows(), position.columnIndex + 1 );
+  }
+
+  // Set the alignment of the cell
+  CellData& data = mCellData[ position.rowIndex ][ position.columnIndex ];
+  data.horizontalAlignment = horizontal;
+  data.verticalAlignment = vertical;
+}
+
+void TableView::ComputeRelativeSizes( RowColumnArray& data )
+{
+  // First pass: Count number of fill entries and calculate used relative space
+  Dali::Vector< RowColumnData* > fillData;
+  float relativeTotal = 0.0f;
+
+  const unsigned int dataCount = data.Size();
+
+  for( unsigned int i = 0; i < dataCount; ++i )
+  {
+    RowColumnData& dataInstance = data[ i ];
+
+    if( dataInstance.sizePolicy == FILL )
+    {
+      if( dataInstance.userFillRatio )
+      {
+        relativeTotal += dataInstance.fillRatio;
+      }
+      else
+      {
+        fillData.PushBack( &dataInstance );
+      }
+    }
+  }
+
+  // Second pass: Distribute remaining relative space
+  const unsigned int fillCount = fillData.Size();
+  if( fillCount > 0 )
+  {
+    if( relativeTotal > 1.0f )
+    {
+      relativeTotal = 1.0f;
+    }
+
+    const float evenFillRatio = (1.0f - relativeTotal ) / fillCount;
+
+    for( unsigned int i = 0; i < fillCount; ++i )
+    {
+      fillData[ i ]->fillRatio = evenFillRatio;
+    }
+  }
+}
+
+float TableView::CalculateTotalFixedSize( const RowColumnArray& data )
+{
+  float totalSize = 0.0f;
+
+  const unsigned int dataCount = data.Size();
+
+  for( unsigned int i = 0; i < dataCount; ++i )
+  {
+    const RowColumnData& dataInstance = data[ i ];
+
+    switch( dataInstance.sizePolicy )
+    {
+      case FIXED:
+      case FIT:
+      {
+        totalSize += dataInstance.size;
+        break;
+      }
+
+      default:
+      {
+        break;
+      }
+    }
+  }
+
+  return totalSize;
+}
+
+void TableView::CalculateFixedSizes( RowColumnArray& data, Dimension dimension )
+{
+  const unsigned int dataCount = data.Size();
+
+  for( unsigned int i = 0; i < dataCount; ++i )
+  {
+    RowColumnData& dataInstance = data[ i ];
+
+    if( dataInstance.sizePolicy == FIT )
+    {
+      // Find the size of the biggest actor in the row or column
+      float maxActorHeight = 0.0f;
+
+      unsigned int fitCount = ( dimension == WIDTH ) ? mCellData.GetRows() : mCellData.GetColumns();
+
+      for( unsigned int j = 0; j < fitCount; ++j )
+      {
+        unsigned int row = ( dimension == WIDTH ) ? j : i;
+        unsigned int column = ( dimension == WIDTH ) ? i : j;
+        DALI_ASSERT_DEBUG( row < mCellData.GetRows() );
+        DALI_ASSERT_DEBUG( column < mCellData.GetColumns() );
+
+        Actor& actor = mCellData[ row ][ column ].actor;
+        if( actor )
+        {
+          if( FitToChild( actor, dimension ) )
+          {
+            maxActorHeight = std::max( maxActorHeight, actor.GetRelayoutSize( dimension ) );
+          }
+        }
+      }
+
+      dataInstance.size = maxActorHeight;
+    }
+  }
+}
+
+void TableView::CalculateRelativeSizes( RowColumnArray& data, float size )
+{
+  const unsigned int dataCount = data.Size();
+
+  for( unsigned int i = 0; i < dataCount; ++i )
+  {
+    RowColumnData& dataInstance = data[ i ];
+
+    if( dataInstance.sizePolicy == FILL )
+    {
+      dataInstance.size = dataInstance.fillRatio * size;
+    }
+  }
+}
+
+bool TableView::FindFit( const RowColumnArray& data )
+{
+  for( unsigned int i = 0, count = data.Size(); i < count; ++i )
+  {
+    if( data[ i ].sizePolicy == FIT )
+    {
+      return true;
+    }
+  }
+
+  return false;
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index 154c341..55a7d7b 100644 (file)
@@ -41,13 +41,13 @@ class TableView : public Control
 public:
 
   /**
-   * Structure for the layout data
+   * Enum for the size policies of rows and columns
    */
-  struct CellData
+  enum CellSizePolicy
   {
-    // data members
-    Actor actor;
-    Toolkit::TableView::CellPosition position;
+    FILL,       ///< Fill up available space, may have a ratio associated with it
+    FIXED,      ///< A specific fixed width or height
+    FIT         ///< Fit around actors in the row or column
   };
 
   /**
@@ -59,22 +59,22 @@ public:
   /**
    * @copydoc Toolkit::TableView::AddChild
    */
-  bool AddChild( Actor child, Toolkit::TableView::CellPosition position );
+  bool AddChild( Actor& child, const Toolkit::TableView::CellPosition& position );
 
   /**
    * @copydoc Toolkit::TableView::GetChildAt
    */
-  Actor GetChildAt( Toolkit::TableView::CellPosition position );
+  Actor GetChildAt( const Toolkit::TableView::CellPosition& position );
 
   /**
    * @copydoc Toolkit::TableView::RemoveChildAt
    */
-  Actor RemoveChildAt( Toolkit::TableView::CellPosition position );
+  Actor RemoveChildAt( const Toolkit::TableView::CellPosition& position );
 
   /**
    * @copydoc Toolkit::TableView::FindChildPosition
    */
-  bool FindChildPosition( Actor child, Toolkit::TableView::CellPosition& position );
+  bool FindChildPosition( const Actor& child, Toolkit::TableView::CellPosition& positionOut );
 
   /**
    * @copydoc Toolkit::TableView::InsertRow
@@ -127,24 +127,36 @@ public:
   Size GetCellPadding();
 
   /**
-   * @copydoc Toolkit::TableView::SetFixedHeight
+   * @brief Set a row policy
+   *
+   * @param[in] rowIndex The row to set the policy for
+   * @param[in] policy The policy to set
    */
-  void SetFixedHeight( unsigned int rowIndex, float height );
+  void SetRowPolicy( unsigned int rowIndex, CellSizePolicy policy );
 
   /**
-   * @copydoc Toolkit::TableView::GetFixedHeight
+   * @brief Querry a row policy
+   *
+   * @param[in] rowIndex The row to querry
+   * @return Return the policy
    */
-  float GetFixedHeight( unsigned int rowIndex ) const;
+  CellSizePolicy GetRowPolicy( unsigned int rowIndex ) const;
 
   /**
-   * @copydoc Toolkit::TableView::SetRelativeHeight
+   * @brief Set a column policy
+   *
+   * @param[in] columnIndex The column to set the policy for
+   * @param[in] policy The policy to set
    */
-  void SetRelativeHeight( unsigned int rowIndex, float heightPercentage );
+  void SetColumnPolicy( unsigned int columnIndex, CellSizePolicy policy );
 
   /**
-   * @copydoc Toolkit::TableView::GetRelativeHeight
+   * @brief Querry a column policy
+   *
+   * @param[in] columnIndex The column to querry
+   * @return Return the policy
    */
-  float GetRelativeHeight( unsigned int rowIndex ) const;
+  CellSizePolicy GetColumnPolicy( unsigned int columnIndex ) const;
 
   /**
    * @copydoc Toolkit::TableView::SetFixedWidth
@@ -157,6 +169,26 @@ public:
   float GetFixedWidth( unsigned int columnIndex ) const;
 
   /**
+   * @copydoc Toolkit::TableView::SetFixedHeight
+   */
+  void SetFixedHeight( unsigned int rowIndex, float height );
+
+  /**
+   * @copydoc Toolkit::TableView::GetFixedHeight
+   */
+  float GetFixedHeight( unsigned int rowIndex ) const;
+
+  /**
+   * @copydoc Toolkit::TableView::SetRelativeHeight
+   */
+  void SetRelativeHeight( unsigned int rowIndex, float heightPercentage );
+
+  /**
+   * @copydoc Toolkit::TableView::GetRelativeHeight
+   */
+  float GetRelativeHeight( unsigned int rowIndex ) const;
+
+  /**
    * @copydoc Toolkit::TableView::SetRelativeWidth
    */
   void SetRelativeWidth( unsigned int columnIndex, float widthPercentage );
@@ -176,6 +208,11 @@ public:
    */
   unsigned int GetColumns();
 
+  /**
+   * @copydoc Toolkit::TableView::SetCellAlignment
+   */
+  void SetCellAlignment( Toolkit::TableView::CellPosition position, HorizontalAlignment::Type horizontal, VerticalAlignment::Type vertical );
+
   // Properties
 
   /**
@@ -199,17 +236,22 @@ private: // From Control
   /**
    * @copydoc Control::OnControlChildAdd(Actor& child)
    */
-  virtual void OnControlChildAdd(Actor& child);
+  virtual void OnControlChildAdd( Actor& child );
 
   /**
    * @copydoc Control::OnControlChildRemove(Actor& child)
    */
-  virtual void OnControlChildRemove(Actor& child);
+  virtual void OnControlChildRemove( Actor& child );
 
   /**
    * @copydoc Control::OnRelayout
    */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+
+  /**
+   * @copydoc Control::CalculateChildSize
+   */
+  virtual float CalculateChildSize( const Actor& child, Dimension dimension );
 
   /**
    * @copydoc Control::OnInitialize()
@@ -219,11 +261,94 @@ private: // From Control
   /**
    * @copydoc Control::GetNextKeyboardFocusableActor
    */
-  virtual Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled);
+  virtual Actor GetNextKeyboardFocusableActor( Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled );
+
+  /**
+   * @copydoc Control::GetNaturalSize()
+   */
+  virtual Vector3 GetNaturalSize();
+
+  /**
+   * @copydoc Control::RelayoutDependentOnChildren()
+   */
+  virtual bool RelayoutDependentOnChildren( Dimension dimension = ALL_DIMENSIONS );
+
+  /**
+   * @copydoc Control::OnCalculateRelayoutSize
+   */
+  virtual void OnCalculateRelayoutSize( Dimension dimension );
+
+  /**
+   * @copydoc Control::OnLayoutNegotiated
+   */
+  virtual void OnLayoutNegotiated( float size, Dimension dimension );
 
 private: // Implementation
 
   /**
+   * Struct to hold data for rows and columns
+   *
+   * If sizePolicy is FIXED then size is the absolute size to use.
+   * If sizePolicy is FIT or FILL then size is the calculated value of size.
+   */
+  struct RowColumnData
+  {
+    /**
+     * Default constructor
+     */
+    RowColumnData()
+    : size( 0.0f ),
+      fillRatio( 0.0f ),
+      sizePolicy( FILL ),
+      userFillRatio( false )
+    {
+    }
+
+    /**
+     * Constructor
+     *
+     * @param[in] newSize The size to set for this data
+     * @param[in] newSizePolicy The policy used to interpret the size value
+     */
+    RowColumnData( float newSize, float newFillRatio, CellSizePolicy newSizePolicy, bool newUserFillRatio )
+    : size( newSize ),
+      fillRatio( newFillRatio ),
+      sizePolicy( newSizePolicy ),
+      userFillRatio( newUserFillRatio )
+    {
+    }
+
+    float size;                       ///< Set or calculated size
+    float fillRatio;                  ///< Ratio to fill remaining space
+    CellSizePolicy sizePolicy;        ///< The size policy used to interpret the size value
+    bool userFillRatio : 1;           ///< FillRatio was set by user
+  };
+
+  typedef Dali::Vector<RowColumnData> RowColumnArray;
+
+public:
+
+  /**
+   * Structure for the layout data
+   */
+  struct CellData
+  {
+    CellData()
+    : horizontalAlignment( HorizontalAlignment::LEFT ),
+      verticalAlignment( VerticalAlignment::TOP )
+    {
+    }
+
+    // data members
+    Dali::Actor actor;
+    Toolkit::TableView::CellPosition position;
+    HorizontalAlignment::Type horizontalAlignment;
+    VerticalAlignment::Type verticalAlignment;
+  };
+
+private:
+
+  /**
    * Construct a new TableView.
    */
   TableView( unsigned int initialRows, unsigned int initialColumns );
@@ -259,14 +384,50 @@ private: // Implementation
    * @param child actor to remove
    * @return true if the actor was found
    */
-  bool RemoveAllInstances( Actor child );
+  bool RemoveAllInstances( const Actor& child );
+
+  /**
+   * @brief Compute relative sizes for an array
+   *
+   * @param[in] data The RowColumn data to compute the relative sizes for
+   */
+  void ComputeRelativeSizes( RowColumnArray& data );
+
+  /**
+   * @brief Calculate the total fixed sizes for a row or column
+   *
+   * @param[in] data The row or column data to process
+   */
+  float CalculateTotalFixedSize( const RowColumnArray& data );
+
+  /**
+   * @brief Calculate the fixed sizes for a row or column
+   *
+   * @param[in] data The row or column data to process
+   * @param[in] dimension The dimension being calculated: row == HEIGHT, column == WIDTH
+   */
+  void CalculateFixedSizes( RowColumnArray& data, Dimension dimension );
+
+  /**
+   * @brief Calculate the value of the relative sizes
+   *
+   * @param[in] data The row or column data to process
+   * @param[in] size The size of the table view in that dimension
+   */
+  void CalculateRelativeSizes( RowColumnArray& data, float size );
+
+  /**
+   * @brief Search for a FIT cell in the array
+   *
+   * @param[in] data The row or column data to process
+   * @return Return if a FIT cell was found or not
+   */
+  bool FindFit( const RowColumnArray& data );
 
   /**
-   * Helper to update relative sizes
-   * @param fixedHeightsTotal sum of the fixed height rows
-   * @param fixedWidthsTotal sum of the fixed width columns
+   * @brief Calculate row and column data when it is dirty
    */
-  void UpdateRelativeSizes( float& fixedHeightsTotal, float& fixedWidthsTotal );
+  void CalculateRowColumnData();
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
@@ -301,11 +462,10 @@ private: // scripting support
 
   /**
    * Generate the map type property value from the size vectors.
-   * @param[in] fixedSize The vector of fixed heights or widths.
-   * @param[in] relativeSize The vector of relative heights or widths.
+   * @param[in] data The array of row or column data
    * @param[out] map The property value.
    */
-  void GetMapPropertyValue( const std::vector<float>& fixedSize, const std::vector<float>& relativeSize, Property::Map& map );
+  void GetMapPropertyValue( const RowColumnArray& data, Property::Map& map );
 
 
   /**
@@ -350,15 +510,15 @@ private:
 
 private: // Data
 
-  Array2d<CellData> mCellData;
-  Array2d<Size> mRelativeSizes;
-  std::vector<float> mFixedHeights;
-  std::vector<float> mRelativeHeights;
-  std::vector<float> mFixedWidths;
-  std::vector<float> mRelativeWidths;
-  Size mPadding;
-  bool mLayoutingChild;
+  Array2d<CellData> mCellData;                ///< Data for each cell: Actor, alignment settings etc
+
+  RowColumnArray mRowData;       ///< Data for each row
+  RowColumnArray mColumnData;    ///< Data for each column
+  Size mFixedTotals;             ///< Accumulated totals for fixed width and height
 
+  Size mPadding;                 ///< Padding to apply to each cell
+  bool mLayoutingChild;          ///< Can't be a bitfield due to Relayouting lock
+  bool mRowColumnDirty : 1;       ///< Flag to indicate the row column data is dirty
 };
 
 } // namespace Internal
index aa5ca7d..8249889 100644 (file)
@@ -62,7 +62,7 @@ Actor CreateGrabArea( const std::string& name, const Vector3& relativeScale )
 
   Actor handleGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
   handleGrabArea.SetName( name );
-  handleGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+  handleGrabArea.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
   handleGrabArea.SetSizeModeFactor( relativeScale );
   handleGrabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
 
index 1cb15f4..fc289f8 100644 (file)
@@ -30,6 +30,7 @@
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/object/property-notification.h>
+#include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/images/resource-image.h>
 
@@ -1156,10 +1157,10 @@ void TextInput::OnControlSizeSet(const Vector3& targetSize)
   mActiveLayer.SetSize(targetSize);
 }
 
-void TextInput::OnRelayout( const Vector2& size, ActorSizeContainer& container )
+void TextInput::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
-  Relayout( mDisplayedTextView, size, container );
-  Relayout( mPopupPanel.GetRootActor(), size, container );
+  container.Add( mDisplayedTextView, size );
+  container.Add( mPopupPanel.GetRootActor(), size );
 
   GetTextLayoutInfo();
 
@@ -2142,7 +2143,6 @@ void TextInput::CreateTextViewActor()
   mDisplayedTextView.SetLineJustification( Toolkit::TextView::Left );
   mDisplayedTextView.SetTextAlignment( static_cast<Toolkit::Alignment::Type>( Toolkit::Alignment::HorizontalLeft | Toolkit::Alignment::VerticalTop ) );
   mDisplayedTextView.SetPosition( Vector3( 0.0f, 0.0f, DISPLAYED_TEXT_VIEW_Z_OFFSET ) );
-  mDisplayedTextView.SetSizePolicy( Toolkit::Control::Fixed, Toolkit::Control::Fixed );
 
   mDisplayedTextView.ScrolledSignal().Connect( this, &TextInput::OnTextViewScrolled );
 
@@ -3036,7 +3036,7 @@ void TextInput::CreateGrabArea( Actor& parent )
   mGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
   mGrabArea.SetName( "GrabArea" );
   mGrabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
-  mGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+  mGrabArea.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
   mGrabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
   mGrabArea.TouchedSignal().Connect(this,&TextInput::OnPressDown);
   mTapDetector.Attach( mGrabArea );
@@ -3273,7 +3273,7 @@ void TextInput::CreateSelectionHandles( std::size_t start, std::size_t end, Dali
     mHandleOneGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
     mHandleOneGrabArea.SetName("SelectionHandleOneGrabArea");
 
-    mHandleOneGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+    mHandleOneGrabArea.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
     mHandleOneGrabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
     mHandleOneGrabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
 
@@ -3301,7 +3301,7 @@ void TextInput::CreateSelectionHandles( std::size_t start, std::size_t end, Dali
 
     mHandleTwoGrabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
     mHandleTwoGrabArea.SetName("SelectionHandleTwoGrabArea");
-    mHandleTwoGrabArea.SetSizeMode( SIZE_RELATIVE_TO_PARENT );
+    mHandleTwoGrabArea.SetResizePolicy( SIZE_RELATIVE_TO_PARENT, ALL_DIMENSIONS );
     mHandleTwoGrabArea.SetSizeModeFactor( DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE );
     mHandleTwoGrabArea.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
 
index 8df0ac9..66bf9ad 100644 (file)
@@ -571,7 +571,7 @@ private: // From Control
   /**
    * @copydoc Control::OnRelayout()
    */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
 
   /**
    * Retrieves the text-input's natural size by calling TextView::GetNaturalSize().
index 21b39b8..e92e4d0 100644 (file)
@@ -260,7 +260,6 @@ Toolkit::TextView TextInputPopup::CreateOptionCaption( const std::string& captio
   styledCaption.push_back( MarkupProcessor::StyledText( Text( caption ), style ) );
 
   Toolkit::TextView textView = Toolkit::TextView::New( styledCaption );
-  textView.SetSizePolicy( Toolkit::Control::Fixed, Toolkit::Control::Fixed );
   textView.SetWidthExceedPolicy( Toolkit::TextView::EllipsizeEnd );
   textView.SetHeightExceedPolicy( Toolkit::TextView::EllipsizeEnd );
   textView.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
@@ -294,7 +293,7 @@ void TextInputPopup::CreateBackground()
     mBackgroundEffect.SetAnchorPoint( AnchorPoint::CENTER );
     mBackgroundEffect.SetParentOrigin( ParentOrigin::CENTER );
     mBackgroundEffect.SetName( "text-input-popup-background-effect" );
-    mBackgroundEffect.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+    mBackgroundEffect.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
     mBackgroundEffect.SetZ( 1.0f );
     mBackground.Add( mBackgroundEffect );
 
@@ -303,7 +302,7 @@ void TextInputPopup::CreateBackground()
     mBackgroundLine.SetAnchorPoint( AnchorPoint::CENTER);
     mBackgroundLine.SetParentOrigin( ParentOrigin::CENTER );
     mBackgroundLine.SetName( "text-input-popup-background-effect" );
-    mBackgroundLine.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+    mBackgroundLine.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
     mBackgroundLine.SetColor( mLineColor );
     mBackgroundLine.SetZ( 0.1f );
     mBackgroundEffect.Add( mBackgroundLine );
@@ -329,7 +328,7 @@ void TextInputPopup::CreateTail()
     mTailEffect.SetParentOrigin( ParentOrigin::CENTER );
     mTailEffect.SetAnchorPoint( AnchorPoint::CENTER );
     mTailEffect.SetName( "text-input-popup-tail-effect" );
-    mTailEffect.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+    mTailEffect.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
     mTailEffect.SetZ( 0.1f );
     mTail.Add( mTailEffect );
 
@@ -337,7 +336,7 @@ void TextInputPopup::CreateTail()
     mTailLine = ImageActor::New( tailLine );
     mTailLine.SetParentOrigin( ParentOrigin::CENTER );
     mTailLine.SetAnchorPoint( AnchorPoint::CENTER );
-    mTailLine.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+    mTailLine.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
     mTailLine.SetName( "text-input-popup-tail-line" );
     mTailLine.SetColor( mLineColor );
     mTailLine.SetZ( 0.1f );
@@ -491,7 +490,6 @@ void TextInputPopup::AddOption(const std::string& name, const std::string& capti
 
   // 5. Create a option.
   Toolkit::PushButton option = Toolkit::PushButton::New();
-  option.SetSizePolicy( Toolkit::Control::Fixed, Toolkit::Control::Fixed );
   option.SetParentOrigin( ParentOrigin::TOP_LEFT );
   option.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   option.SetSize( constrainedOptionSize );
index 5cd83a0..33983d8 100644 (file)
@@ -1995,6 +1995,7 @@ void CreateTextActor( const TextView::VisualParameters& visualParameters,
       {
         TextActorParameters parameters( style, TextActorParameters::FONT_DETECTION_OFF );
         textActor = TextActor::New( Text(), parameters );
+        textActor.SetRelayoutEnabled( false );
       }
       else
       {
@@ -2549,6 +2550,9 @@ RenderableActor CreateGlyphActor( const Text& text, const TextStyle& style, Text
     textActor = TextActor::New( text, parameters );
   }
 
+  // Exclude from size negotiation
+  textActor.SetRelayoutEnabled( false );
+
   return textActor;
 }
 
index 3619590..4278d4b 100644 (file)
@@ -1199,6 +1199,8 @@ float TextView::GetWidthForHeight( float height )
 
 void TextView::OnInitialize()
 {
+  // The actor handle needs to be inialised for this to work
+  Self().SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
 }
 
 
@@ -1222,7 +1224,7 @@ void TextView::OnControlSizeSet( const Vector3& size )
   }
 }
 
-void TextView::OnRelayout( const Vector2& size, ActorSizeContainer& container )
+void TextView::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
   if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) )
   {
index dfa7760..270d32b 100644 (file)
@@ -377,7 +377,7 @@ private: // From Control
   /**
    * @copydoc Toolkit::Control::OnRelayout()
    */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
 
   /**
    * Retrieves the text-view's natural size.
index e0dbd86..274ca56 100644 (file)
@@ -74,7 +74,7 @@ void ToolBar::SetBackground( Actor background )
   // ToolBar image
   background.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
   background.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
-  background.SetSize( mToolBarSize );
+  background.SetSize( Vector2( mToolBarSize.width, mToolBarSize.height ) );
 
   RenderableActor renderableActor = RenderableActor::DownCast( background );
   if ( renderableActor )
@@ -125,8 +125,9 @@ void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment:
 
   // Create an alignment container where to place the control.
   Toolkit::Alignment alignmentContainer = Toolkit::Alignment::New( alignment );
-  alignmentContainer.SetScaling( Toolkit::Alignment::ScaleToFill );
+  alignmentContainer.SetSizeScalePolicy( FIT_WITH_ASPECT_RATIO );
   alignmentContainer.SetPadding( padding );
+  alignmentContainer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
   alignmentContainer.Add( control );
 
   // Insert the control in the table view.
@@ -320,6 +321,8 @@ void ToolBar::OnInitialize()
 
   // Layout
   mLayout = Toolkit::TableView::New( 1, 1 );
+  mLayout.SetName( "TOOLBAR_LAYOUT" );
+  mLayout.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
   mLayout.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
 
   Self().Add( mLayout );
@@ -356,7 +359,7 @@ void ToolBar::OnControlChildAdd(Actor& child)
 void ToolBar::OnControlSizeSet( const Vector3& targetSize )
 {
   mToolBarSize = targetSize;
-  mBackground.SetSize( mToolBarSize );
+  mBackground.SetSize( Vector2( mToolBarSize.width, mToolBarSize.height ) );
 }
 
 } // namespace Internal
index 9a486ed..3cb58ac 100644 (file)
@@ -132,7 +132,7 @@ void View::SetBackground( ImageActor backgroundImage )
     mBackgroundLayer = Layer::New();
 
     mBackgroundLayer.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
-    mBackgroundLayer.SetSize( mViewSize );
+    mBackgroundLayer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
     // Add background layer to custom actor.
     Self().Add( mBackgroundLayer );
@@ -152,8 +152,10 @@ void View::SetBackground( ImageActor backgroundImage )
   }
 
   backgroundImage.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
-  backgroundImage.SetScale( FillXYKeepAspectRatio( mViewSize, backgroundImage.GetSize() ) );
+  backgroundImage.SetRelayoutEnabled( false );    // We will scale its size manually
   mBackgroundLayer.Add( backgroundImage );
+
+  RelayoutRequest();
 }
 
 void View::SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree landscapeInverse )
@@ -166,6 +168,8 @@ void View::SetOrientationFunction( Degree portrait, Degree landscale, Degree por
 
 void View::OrientationChanged( Dali::Orientation orientation )
 {
+  Actor self = Self();
+
   // Nothing to do if orientation doesn't really change.
   if ( orientation.GetDegrees() == mOrientation || !mAutoRotateEnabled )
   {
@@ -176,13 +180,13 @@ void View::OrientationChanged( Dali::Orientation orientation )
 
   // has parent so we expect it to be on stage
   mRotateAnimation = Animation::New( ROTATION_ANIMATION_DURATION );
-  mRotateAnimation.RotateTo( Self(), Degree( -orientation.GetDegrees() ), Vector3::ZAXIS, AlphaFunctions::EaseOut );
+  mRotateAnimation.AnimateTo( Property( self, Actor::Property::ORIENTATION ), Quaternion( -orientation.GetRadians(), Vector3::ZAXIS ), AlphaFunctions::EaseOut );
 
   // Resize the view
   if( mFullScreen )
   {
     const Vector2& stageSize( Stage::GetCurrent().GetSize() );
-    const Vector3& currentSize( Self().GetCurrentSize() );
+    const Vector3& currentSize( self.GetCurrentSize() );
 
     float minSize = std::min( stageSize.width, stageSize.height );
     float maxSize = std::max( stageSize.width, stageSize.height );
@@ -212,15 +216,15 @@ void View::OrientationChanged( Dali::Orientation orientation )
     {
       // width grows, shrink height faster
       Vector3 shrink( currentSize );shrink.height = targetSize.height;
-      mRotateAnimation.Resize( Self(), shrink, AlphaFunctions::EaseOut, 0.0f, ROTATION_ANIMATION_DURATION * 0.5f );
-      mRotateAnimation.Resize( Self(), targetSize, AlphaFunctions::EaseIn, 0.0f, ROTATION_ANIMATION_DURATION );
+      mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), shrink, AlphaFunctions::EaseOut, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION * 0.5f ) );
+      mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), targetSize, AlphaFunctions::EaseIn, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION ) );
     }
     else
     {
       // height grows, shrink width faster
       Vector3 shrink( currentSize );shrink.width = targetSize.width;
-      mRotateAnimation.Resize( Self(), shrink, AlphaFunctions::EaseOut, 0.0f, ROTATION_ANIMATION_DURATION * 0.5f );
-      mRotateAnimation.Resize( Self(), targetSize, AlphaFunctions::EaseIn, 0.0f, ROTATION_ANIMATION_DURATION );
+      mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), shrink, AlphaFunctions::EaseOut, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION * 0.5f ) );
+      mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), targetSize, AlphaFunctions::EaseIn, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION ) );
     }
   }
 
@@ -290,16 +294,14 @@ void View::OnInitialize()
   }
 }
 
-void View::OnControlSizeSet( const Vector3& targetSize )
+void View::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
-  mViewSize = targetSize;
   if( mBackgroundLayer )
   {
-    mBackgroundLayer.SetSize( mViewSize );
-    if( mBackgroundLayer.GetChildCount() > 0 )
+    if( mBackgroundLayer && mBackgroundLayer.GetChildCount() > 0 )
     {
       Actor background = mBackgroundLayer.GetChildAt(0);
-      background.SetScale( FillXYKeepAspectRatio( mViewSize, background.GetSize() ) );
+      background.SetScale( FillXYKeepAspectRatio( Vector3( size.width, size.height, 1.0f ), background.GetTargetSize() ) );
     }
   }
 }
index 5352afe..9aacc9e 100644 (file)
@@ -138,10 +138,9 @@ private: // From Control
   virtual void OnInitialize();
 
   /**
-   *
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
+   * @copydoc Toolkit::Control::OnRelayout()
    */
-  virtual void OnControlSizeSet( const Vector3& targetSize );
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
 
 private:
 
@@ -180,7 +179,6 @@ private:
   Animation      mRotateAnimation;        ///< The animation which rotates the view (and all layers added to it)
   float          mOrientationFunction[4]; ///< The orientation function used to transform from degrees to the internal orientation.
   bool           mAutoRotateEnabled;      ///< Whether the view rotates if the OrientationChanged method is called.
-  Vector3        mViewSize;               ///< The Control Size
 
   Toolkit::View::OrientationAnimationStartedSignalType mOrientationAnimationStartedSignal;
 };
index 0a8d428..31800b7 100644 (file)
@@ -33,9 +33,6 @@ toolkit_src_files = \
    $(toolkit_src_dir)/controls/page-turn-view/page-turn-portrait-view-impl.cpp \
    $(toolkit_src_dir)/controls/page-turn-view/page-turn-landscape-view-impl.cpp \
    $(toolkit_src_dir)/controls/page-turn-view/page-turn-view-impl.cpp \
-   $(toolkit_src_dir)/controls/relayout-controller-impl.cpp \
-   $(toolkit_src_dir)/controls/relayout-controller.cpp \
-   $(toolkit_src_dir)/controls/relayout-helper.cpp \
    $(toolkit_src_dir)/controls/scroll-bar/scroll-bar-impl.cpp \
    $(toolkit_src_dir)/controls/scroll-component/scroll-bar-internal-impl.cpp \
    $(toolkit_src_dir)/controls/scroll-component/scroll-bar-internal.cpp \
index ee152de..af62fb3 100644 (file)
@@ -142,7 +142,7 @@ void BlurTwoPassFilter::Enable()
   // create actor to render input with applied emboss effect
   mActorForInput = ImageActor::New( mInputImage );
   mActorForInput.SetParentOrigin( ParentOrigin::CENTER );
-  mActorForInput.SetSize(mTargetSize);
+  mActorForInput.SetSize( mTargetSize );
   mActorForInput.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) );
 
   // create internal offscreen for result of horizontal pass
@@ -151,7 +151,7 @@ void BlurTwoPassFilter::Enable()
   // create an actor to render mImageForHorz for vertical blur pass
   mActorForHorz = ImageActor::New( mImageForHorz );
   mActorForHorz.SetParentOrigin( ParentOrigin::CENTER );
-  mActorForHorz.SetSize(mTargetSize);
+  mActorForHorz.SetSize( mTargetSize );
   mActorForHorz.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) );
 
   // create internal offscreen for result of the two pass blurred image
@@ -160,7 +160,7 @@ void BlurTwoPassFilter::Enable()
   // create an actor to blend the blurred image and the input image with the given blur strength
   mActorForBlending = ImageActor::New( mBlurredImage );
   mActorForBlending.SetParentOrigin( ParentOrigin::CENTER );
-  mActorForBlending.SetSize(mTargetSize);
+  mActorForBlending.SetSize( mTargetSize );
   mActorForBlending.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) );
 
   mRootActor.Add( mActorForInput );
index 0b48ecb..5a3a611 100644 (file)
@@ -674,7 +674,7 @@ void FocusManager::CreateDefaultFocusIndicatorActor()
   focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f));
 
   // Apply size constraint to the focus indicator
-  focusIndicator.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  focusIndicator.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
   SetFocusIndicatorActor(focusIndicator);
 }
index 014e215..038f99c 100644 (file)
@@ -477,7 +477,7 @@ void KeyboardFocusManager::CreateDefaultFocusIndicatorActor()
   focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f));
 
   // Apply size constraint to the focus indicator
-  focusIndicator.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  focusIndicator.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 
   SetFocusIndicatorActor(focusIndicator);
 }
index ba4094e..bda3721 100644 (file)
@@ -17,6 +17,8 @@
  * limitations under the License.
  *
  */
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/base-object.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/scripting/script.h>
index 975889d..5a0188a 100644 (file)
@@ -127,11 +127,11 @@ void CubeTransitionCrossEffect::SetupAnimation(unsigned int actorIndex, float an
     mTiles[mContainerIndex][actorIndex].TranslateBy( resetTranslation );
     mTiles[mContainerIndex][actorIndex].SetOrientation( Radian( angle),  axis );
   }
-  mAnimation.RotateTo( mBoxes[actorIndex], Radian( -angle ), axis, AlphaFunctions::EaseInOutSine );
+  mAnimation.AnimateTo( Property( mBoxes[actorIndex], Actor::Property::ORIENTATION ), Quaternion( Radian( -angle ), axis ), AlphaFunctions::EaseInOutSine );
   Vector3 position(mBoxes[actorIndex].GetCurrentPosition());
-  mAnimation.MoveTo(mBoxes[actorIndex], position*mDisplacementRatio+Vector3(0.f,0.f,mCubeDisplacement), AlphaFunctions::Bounce);
-  mAnimation.ColorTo( mTiles[mContainerIndex^1][actorIndex], HALF_BRIGHTNESS, AlphaFunctions::EaseOut );
-  mAnimation.ColorTo( mTiles[mContainerIndex][actorIndex], FULL_BRIGHTNESS, AlphaFunctions::EaseIn );
+  mAnimation.AnimateTo( Property( mBoxes[actorIndex], Actor::Property::POSITION ), position * mDisplacementRatio + Vector3( 0.f, 0.f, mCubeDisplacement ), AlphaFunctions::Bounce );
+  mAnimation.AnimateTo( Property( mTiles[mContainerIndex^1][actorIndex], Actor::Property::COLOR ), HALF_BRIGHTNESS, AlphaFunctions::EaseOut );
+  mAnimation.AnimateTo( Property( mTiles[mContainerIndex][actorIndex], Actor::Property::COLOR ), FULL_BRIGHTNESS, AlphaFunctions::EaseIn );
 }
 
 } // namespace Internal
index 14645f6..1a58f8d 100644 (file)
@@ -116,6 +116,7 @@ void CubeTransitionEffect::Initialize()
 
   // helper actor to create a off-screen image using shader effect
   mEmptyImage = ImageActor::New( placeHolder );
+  mEmptyImage.SetRelayoutEnabled( false );
   mEmptyImage.SetSize(Stage::GetCurrent().GetSize());
   mEmptyImage.SetParentOrigin( ParentOrigin::CENTER );
   mEmptyImage.SetAnchorPoint( AnchorPoint::CENTER );
@@ -139,6 +140,7 @@ void CubeTransitionEffect::Initialize()
 ImageActor CubeTransitionEffect::CreateTile( Image image, const Vector4& color )
 {
   ImageActor tile = ImageActor::New( image );
+  tile.SetRelayoutEnabled( false );
   tile.SetParentOrigin( ParentOrigin::CENTER );
   tile.SetAnchorPoint( AnchorPoint::CENTER );
   tile.SetSize( mTileSize );
index abffa6a..37a3a06 100644 (file)
@@ -125,11 +125,11 @@ void CubeTransitionFoldEffect::SetupAnimation(unsigned int actorIndex, float ang
     sideTile.TranslateBy( resetTranslation );
     sideTile.SetOrientation( Radian( angle),   Vector3::YAXIS );
   }
-  mAnimation.RotateTo( currentCube, Radian( -angle ), Vector3::YAXIS, AlphaFunctions::Linear );
+  mAnimation.AnimateTo( Property( currentCube, Actor::Property::ORIENTATION ), Quaternion( Radian( -angle ), Vector3::YAXIS ), AlphaFunctions::Linear );
   Vector3 position(currentCube.GetCurrentPosition());
-  mAnimation.MoveTo(currentCube, Vector3( position.x*mDisplacementRatio, position.y, position.z ), AlphaFunctions::Bounce);
-  mAnimation.ColorTo( frontTile, HALF_BRIGHTNESS, AlphaFunctions::EaseOut );
-  mAnimation.ColorTo( sideTile, FULL_BRIGHTNESS, AlphaFunctions::EaseIn );
+  mAnimation.AnimateTo( Property( currentCube, Actor::Property::POSITION ), Vector3( position.x*mDisplacementRatio, position.y, position.z ), AlphaFunctions::Bounce );
+  mAnimation.AnimateTo( Property( frontTile, Actor::Property::COLOR ), HALF_BRIGHTNESS, AlphaFunctions::EaseOut );
+  mAnimation.AnimateTo( Property( sideTile, Actor::Property::COLOR ), FULL_BRIGHTNESS, AlphaFunctions::EaseIn );
 }
 
 } // namespace Internal
index 1f8ca0f..1b0063d 100644 (file)
@@ -97,14 +97,14 @@ void CubeTransitionWaveEffect::OnStartTransition( Vector2 panPosition, Vector2 p
       // the delay value is within 0.f ~ 2.f*thirdAnimationDuration
       float delay = thirdAnimationDuration * CalculateDelay(x*mTileSize.width,y*mTileSize.height);
 
-      mAnimation.RotateTo( mBoxes[idx], Degree( -angle ), Vector3::YAXIS,
-                           AlphaFunctions::EaseOutSine, delay, thirdAnimationDuration );
-      mAnimation.MoveBy( mBoxes[idx], Vector3(0.f,0.f,-mCubeDisplacement),
-                         AlphaFunctions::Bounce, delay, thirdAnimationDuration );
-      mAnimation.ColorTo( mTiles[anotherIndex][idx], HALF_BRIGHTNESS,
-                          AlphaFunctions::EaseOut, delay, thirdAnimationDuration );
-      mAnimation.ColorTo( mTiles[mContainerIndex][idx], FULL_BRIGHTNESS,
-                          AlphaFunctions::EaseIn, delay, thirdAnimationDuration );
+      mAnimation.AnimateTo( Property( mBoxes[idx], Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -angle ) ), Vector3::YAXIS ),
+                            AlphaFunctions::EaseOutSine, TimePeriod( delay, thirdAnimationDuration ) );
+      mAnimation.AnimateBy( Property( mBoxes[idx], Actor::Property::POSITION ), Vector3( 0.f, 0.f, -mCubeDisplacement ),
+                         AlphaFunctions::Bounce, TimePeriod( delay, thirdAnimationDuration ) );
+      mAnimation.AnimateTo( Property( mTiles[anotherIndex][idx], Actor::Property::COLOR ), HALF_BRIGHTNESS,
+                          AlphaFunctions::EaseOut, TimePeriod( delay, thirdAnimationDuration ) );
+      mAnimation.AnimateTo( Property( mTiles[mContainerIndex][idx], Actor::Property::COLOR ), FULL_BRIGHTNESS,
+                          AlphaFunctions::EaseIn, TimePeriod( delay, thirdAnimationDuration ) );
     }
   }
 
index d2ae939..f128778 100644 (file)
@@ -76,7 +76,9 @@ PushButton PushButton::DownCast( BaseHandle handle )
 
 void PushButton::SetButtonImage( Image image )
 {
-  Dali::Toolkit::GetImplementation( *this ).SetButtonImage( ImageActor::New( image ) );
+  Actor imageActor = ImageActor::New( image );
+  imageActor.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+  Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor );
 }
 
 void PushButton::SetButtonImage( Actor image )
@@ -91,7 +93,9 @@ Actor PushButton::GetButtonImage() const
 
 void PushButton::SetBackgroundImage( Image image )
 {
-  Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( ImageActor::New( image ) );
+  Actor imageActor = ImageActor::New( image );
+  imageActor.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+  Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( imageActor );
 }
 
 void PushButton::SetBackgroundImage( Actor image )
@@ -106,7 +110,9 @@ Actor PushButton::GetBackgroundImage() const
 
 void PushButton::SetSelectedImage( Image image )
 {
-  Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( ImageActor::New( image ) );
+  Actor imageActor = ImageActor::New( image );
+  imageActor.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+  Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageActor );
 }
 
 void PushButton::SetSelectedImage( Actor image )
@@ -119,9 +125,26 @@ Actor PushButton::GetSelectedImage() const
   return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage();
 }
 
+void PushButton::SetSelectedBackgroundImage( Image image )
+{
+  Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( ImageActor::New( image ) );
+}
+
+void PushButton::SetSelectedBackgroundImage( Actor image )
+{
+  Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( image );
+}
+
+Actor PushButton::GetSelectedBackgroundImage() const
+{
+  return Dali::Toolkit::GetImplementation( *this ).GetSelectedBackgroundImage();
+}
+
 void PushButton::SetDisabledBackgroundImage( Image image )
 {
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( ImageActor::New( image ) );
+  Actor imageActor = ImageActor::New( image );
+  imageActor.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+  Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( imageActor );
 }
 
 void PushButton::SetDisabledBackgroundImage( Actor image )
@@ -136,7 +159,9 @@ Actor PushButton::GetDisabledBackgroundImage() const
 
 void PushButton::SetDisabledImage( Image image )
 {
-  Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( ImageActor::New( image ) );
+  Actor imageActor = ImageActor::New( image );
+  imageActor.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+  Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( imageActor );
 }
 
 void PushButton::SetDisabledImage( Actor image )
index dfc3409..4a1974f 100644 (file)
@@ -179,6 +179,25 @@ public:
   Actor GetSelectedImage() const;
 
   /**
+   * @brief Sets the selected background image.
+   *
+   * @param[in] image The selected background image.
+   */
+  void SetSelectedBackgroundImage( Image image );
+
+  /**
+   * @copydoc SetSelectedBackgroundImage( Image image )
+   */
+  void SetSelectedBackgroundImage( Actor image );
+
+  /**
+   * @brief Gets the selected background image.
+   *
+   * @return An actor with the selected background image.
+   */
+  Actor GetSelectedBackgroundImage() const;
+
+  /**
    * @brief Sets the disabled background image.
    *
    * @param[in] image The disabled background image.
index b79badd..39fa68a 100644 (file)
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/scripting/scripting.h>
+#include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/relayout-controller.h>
-#include <dali-toolkit/internal/controls/relayout-helper.h>
 #include <dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h>
 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
 #include <dali-toolkit/public-api/controls/control.h>
@@ -49,16 +48,6 @@ namespace Toolkit
 namespace
 {
 
-const Scripting::StringEnum< Control::SizePolicy > SIZE_POLICY_STRING_TABLE[] =
-{
-  { "FIXED",      Control::Fixed      },
-  { "MINIMUM",    Control::Minimum    },
-  { "MAXIMUM",    Control::Maximum    },
-  { "RANGE",      Control::Range      },
-  { "FLEXIBLE",   Control::Flexible   },
-};
-const unsigned int SIZE_POLICY_STRING_TABLE_COUNT = sizeof( SIZE_POLICY_STRING_TABLE ) / sizeof( SIZE_POLICY_STRING_TABLE[0] );
-
 #if defined(DEBUG_ENABLED)
 Integration::Log::Filter* gLogFilter  = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_CONTROL");
 #endif
@@ -106,70 +95,6 @@ struct Background
 };
 
 /**
- * Helper function to calculate a dimension given the policy of that dimension; the minimum &
- * maximum values that dimension can be; and the allocated value for that dimension.
- *
- * @param[in]  policy     The size policy for that dimension.
- * @param[in]  minimum    The minimum value that dimension can be.
- * @param[in]  maximum    The maximum value that dimension can be.
- * @param[in]  allocated  The value allocated for that dimension.
- *
- * @return The value that the dimension should be.
- *
- * @note This does not handle Control::Fixed policy.
- */
-float Calculate( Control::SizePolicy policy, float minimum, float maximum, float allocated )
-{
-  float size( allocated );
-
-  switch( policy )
-  {
-    case Control::Fixed:
-    {
-      // Use allocated value
-      break;
-    }
-
-    case Control::Minimum:
-    {
-      // Size is always at least the minimum.
-      size = std::max( allocated, minimum );
-      break;
-    }
-
-    case Control::Maximum:
-    {
-      // Size can grow but up to a maximum value.
-      size = std::min( allocated, maximum );
-      break;
-    }
-
-    case Control::Range:
-    {
-      // Size is at least the minimum and can grow up to the maximum
-      size = std::max( size, minimum );
-      size = std::min( size, maximum );
-     break;
-    }
-
-    case Control::Flexible:
-    {
-      // Size grows or shrinks with no limits.
-      size = allocated;
-      break;
-    }
-
-    default:
-    {
-      DALI_ASSERT_DEBUG( false && "This function was not intended to be used by any other policy." );
-      break;
-    }
-  }
-
-  return size;
-}
-
-/**
  * Creates a white coloured Mesh.
  */
 Mesh CreateMesh()
@@ -213,6 +138,7 @@ void SetupBackgroundActor( Actor actor, Property::Index constrainingIndex, const
   actor.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
   actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
   actor.SetZ( BACKGROUND_ACTOR_Z_POSITION );
+  actor.SetRelayoutEnabled( false );
 
   Constraint constraint = Constraint::New<Vector3>( constrainingIndex,
                                                     ParentSource( Actor::Property::SIZE ),
@@ -251,10 +177,7 @@ public:
     mLongPressGestureDetector(),
     mCurrentSize(),
     mNaturalSize(),
-    mWidthPolicy( Toolkit::Control::Fixed ),
-    mHeightPolicy( Toolkit::Control::Fixed ),
     mFlags( Control::CONTROL_BEHAVIOUR_NONE ),
-    mInsideRelayout( false ),
     mIsKeyboardNavigationSupported( false ),
     mIsKeyboardFocusGroup( false ),
     mInitialized( false )
@@ -329,7 +252,7 @@ public:
           break;
         }
 
-        case Toolkit::Control::Property::BACKGROUND:
+        case Toolkit::Control::Property::BACKGROUND_IMAGE:
         {
           if ( value.HasKey( "image" ) )
           {
@@ -338,7 +261,7 @@ public:
 
             if ( image )
             {
-              controlImpl.SetBackground( image );
+              controlImpl.SetBackgroundImage( image );
             }
           }
           else if ( value.Get< Property::Map >().Empty() )
@@ -349,30 +272,6 @@ public:
           break;
         }
 
-        case Toolkit::Control::Property::WIDTH_POLICY:
-        {
-          controlImpl.mImpl->mWidthPolicy = Scripting::GetEnumeration< Toolkit::Control::SizePolicy >( value.Get< std::string >().c_str(), SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT );
-          break;
-        }
-
-        case Toolkit::Control::Property::HEIGHT_POLICY:
-        {
-          controlImpl.mImpl->mHeightPolicy = Scripting::GetEnumeration< Toolkit::Control::SizePolicy >( value.Get< std::string >().c_str(), SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT );
-          break;
-        }
-
-        case Toolkit::Control::Property::MINIMUM_SIZE:
-        {
-          controlImpl.SetMinimumSize( value.Get< Vector3 >() );
-          break;
-        }
-
-        case Toolkit::Control::Property::MAXIMUM_SIZE:
-        {
-          controlImpl.SetMaximumSize( value.Get< Vector3 >() );
-          break;
-        }
-
         case Toolkit::Control::Property::KEY_INPUT_FOCUS:
         {
           if ( value.Get< bool >() )
@@ -413,7 +312,7 @@ public:
           break;
         }
 
-        case Toolkit::Control::Property::BACKGROUND:
+        case Toolkit::Control::Property::BACKGROUND_IMAGE:
         {
           Property::Map map;
 
@@ -434,30 +333,6 @@ public:
           break;
         }
 
-        case Toolkit::Control::Property::WIDTH_POLICY:
-        {
-          value = std::string( Scripting::GetEnumerationName< Toolkit::Control::SizePolicy >( controlImpl.mImpl->mWidthPolicy, SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT ) );
-          break;
-        }
-
-        case Toolkit::Control::Property::HEIGHT_POLICY:
-        {
-          value = std::string( Scripting::GetEnumerationName< Toolkit::Control::SizePolicy >( controlImpl.mImpl->mHeightPolicy, SIZE_POLICY_STRING_TABLE, SIZE_POLICY_STRING_TABLE_COUNT ) );
-          break;
-        }
-
-        case Toolkit::Control::Property::MINIMUM_SIZE:
-        {
-          value = controlImpl.mImpl->GetMinimumSize();
-          break;
-        }
-
-        case Toolkit::Control::Property::MAXIMUM_SIZE:
-        {
-          value = controlImpl.mImpl->GetMaximumSize();
-          break;
-        }
-
         case Toolkit::Control::Property::KEY_INPUT_FOCUS:
         {
           value = controlImpl.HasKeyInputFocus();
@@ -469,79 +344,6 @@ public:
     return value;
   }
 
-  /**
-   * Helper to get minimum size
-   * @return minimum size
-   */
-  inline const Vector3& GetMinimumSize()
-  {
-    if( mMinMaxSize.Count() > MIN_SIZE_INDEX )
-    {
-      return mMinMaxSize[ MIN_SIZE_INDEX ];
-    }
-    else
-    {
-      // its not been allocated so its ZERO
-      return Vector3::ZERO;
-    }
-  }
-  /**
-   * Helper to Set minimum size
-   * @param size to set
-   */
-  inline void SetMinimumSize( const Vector3& size )
-  {
-    if( mMinMaxSize.Count() > MIN_SIZE_INDEX )
-    {
-      mMinMaxSize[ MIN_SIZE_INDEX ] = size;
-    }
-    else
-    {
-      // its not been allocated so push the new value there
-      mMinMaxSize.PushBack( size );
-    }
-  }
-
-  /**
-   * Helper to get maximum size
-   * @return maximum size
-   */
-  inline const Vector3& GetMaximumSize()
-  {
-    if( mMinMaxSize.Count() > MAX_SIZE_INDEX )
-    {
-      return mMinMaxSize[ MAX_SIZE_INDEX ];
-    }
-    else
-    {
-      // its not been allocated so its MAX_SIZE
-      return MAX_SIZE;
-    }
-  }
-
-  /**
-   * Helper to Set minimum size
-   * @param size to set
-   */
-  inline void SetMaximumSize( const Vector3& size )
-  {
-    if( mMinMaxSize.Count() > MAX_SIZE_INDEX )
-    {
-      mMinMaxSize[ MAX_SIZE_INDEX ] = size;
-    }
-    else if( mMinMaxSize.Count() > MIN_SIZE_INDEX )
-    {
-      // max has not been allocated, but min has
-      mMinMaxSize.PushBack( size );
-    }
-    else
-    {
-      // min and max both unallocated so allocate both
-      mMinMaxSize.Resize( 2u ); // this will reserve and default construct two Vector3s
-      mMinMaxSize[ MAX_SIZE_INDEX ] = size;
-    }
-  }
-
   // Data
 
   Control& mControlImpl;
@@ -557,34 +359,22 @@ public:
   // @todo change all these to Vector2 when we have a chance to sanitize the public API as well
   Vector3 mCurrentSize; ///< Stores the current control's size, this is the negotiated size
   Vector3 mNaturalSize; ///< Stores the size set through the Actor's API. This is size the actor wants to be. Useful when reset to the initial size is needed.
-  Dali::Vector< Vector3 > mMinMaxSize; ///< Stores the minimum and maximum size if they are set
 
-  Toolkit::Control::SizePolicy mWidthPolicy :3;  ///< Stores the width policy. 3 bits covers 8 values
-  Toolkit::Control::SizePolicy mHeightPolicy :3; ///< Stores the height policy. 3 bits covers 8 values
-  ControlBehaviour mFlags :6;             ///< Flags passed in from constructor. Need to increase this size when new enums are added
-  bool mInsideRelayout:1;                 ///< Detect when were in Relayout
-  bool mIsKeyboardNavigationSupported:1;  ///< Stores whether keyboard navigation is supported by the control.
-  bool mIsKeyboardFocusGroup:1;           ///< Stores whether the control is a focus group.
-  bool mInitialized:1;
+  ControlBehaviour mFlags :6;              ///< Flags passed in from constructor. Need to increase this size when new enums are added
+  bool mIsKeyboardNavigationSupported :1;  ///< Stores whether keyboard navigation is supported by the control.
+  bool mIsKeyboardFocusGroup :1;           ///< Stores whether the control is a focus group.
+  bool mInitialized :1;
 
   // Properties - these need to be members of Internal::Control::Impl as they need to function within this class.
   static PropertyRegistration PROPERTY_1;
   static PropertyRegistration PROPERTY_2;
   static PropertyRegistration PROPERTY_3;
-  static PropertyRegistration PROPERTY_4;
-  static PropertyRegistration PROPERTY_5;
-  static PropertyRegistration PROPERTY_6;
-  static PropertyRegistration PROPERTY_7;
 };
 
 // Properties registered without macro to use specific member variables.
 PropertyRegistration Control::Impl::PROPERTY_1( typeRegistration, "background-color", Toolkit::Control::Property::BACKGROUND_COLOR, Property::VECTOR4, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_2( typeRegistration, "background",       Toolkit::Control::Property::BACKGROUND,      Property::MAP,     &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "width-policy",     Toolkit::Control::Property::WIDTH_POLICY,     Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_4( typeRegistration, "height-policy",    Toolkit::Control::Property::HEIGHT_POLICY,    Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_5( typeRegistration, "minimum-size",     Toolkit::Control::Property::MINIMUM_SIZE,     Property::VECTOR3, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_6( typeRegistration, "maximum-size",     Toolkit::Control::Property::MAXIMUM_SIZE,     Property::VECTOR3, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_7( typeRegistration, "key-input-focus",  Toolkit::Control::Property::KEY_INPUT_FOCUS,   Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+PropertyRegistration Control::Impl::PROPERTY_2( typeRegistration, "background-image", Toolkit::Control::Property::BACKGROUND_IMAGE, Property::MAP,     &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "key-input-focus",  Toolkit::Control::Property::KEY_INPUT_FOCUS,  Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
 
 Toolkit::Control Control::New()
 {
@@ -606,79 +396,21 @@ Control::~Control()
   delete mImpl;
 }
 
-void Control::SetSizePolicy( Toolkit::Control::SizePolicy widthPolicy, Toolkit::Control::SizePolicy heightPolicy )
-{
-  bool relayoutRequest( false );
-
-  if ( ( mImpl->mWidthPolicy != widthPolicy ) || ( mImpl->mHeightPolicy != heightPolicy ) )
-  {
-    relayoutRequest = true;
-  }
-
-  mImpl->mWidthPolicy = widthPolicy;
-  mImpl->mHeightPolicy = heightPolicy;
-
-  // Ensure RelayoutRequest is called AFTER new policies have been set.
-  if ( relayoutRequest )
-  {
-    RelayoutRequest();
-  }
-}
-
-void Control::GetSizePolicy( Toolkit::Control::SizePolicy& widthPolicy, Toolkit::Control::SizePolicy& heightPolicy ) const
-{
-  widthPolicy = mImpl->mWidthPolicy;
-  heightPolicy = mImpl->mHeightPolicy;
-}
-
-void Control::SetMinimumSize( const Vector3& size )
-{
-  const Vector3& minSize = mImpl->GetMinimumSize();
-  if ( fabsf( minSize.width - size.width ) > Math::MACHINE_EPSILON_1000 ||
-       fabsf( minSize.height - size.height ) > Math::MACHINE_EPSILON_1000 )
-  {
-    mImpl->SetMinimumSize( size );
-
-    // Only relayout if our control is using the minimum or range policy.
-    if ( ( mImpl->mHeightPolicy == Toolkit::Control::Minimum ) || ( mImpl->mWidthPolicy  == Toolkit::Control::Minimum ) ||
-         ( mImpl->mHeightPolicy == Toolkit::Control::Range   ) || ( mImpl->mWidthPolicy  == Toolkit::Control::Range   ) )
-    {
-      RelayoutRequest();
-    }
-  }
-}
-
-const Vector3& Control::GetMinimumSize() const
+Vector3 Control::GetNaturalSize()
 {
-  return mImpl->GetMinimumSize();
+  // could be overridden in derived classes.
+  return mImpl->mNaturalSize;
 }
 
-void Control::SetMaximumSize( const Vector3& size )
+float Control::CalculateChildSize( const Dali::Actor& child, Dimension dimension )
 {
-  const Vector3& maxSize = mImpl->GetMaximumSize();
-  if ( fabsf( maxSize.width - size.width ) > Math::MACHINE_EPSILON_1000 ||
-       fabsf( maxSize.height - size.height ) > Math::MACHINE_EPSILON_1000 )
-  {
-    mImpl->SetMaximumSize( size );
-
-    // Only relayout if our control is using the maximum or range policy.
-    if ( ( mImpl->mHeightPolicy == Toolkit::Control::Maximum ) || ( mImpl->mWidthPolicy  == Toolkit::Control::Maximum ) ||
-         ( mImpl->mHeightPolicy == Toolkit::Control::Range   ) || ( mImpl->mWidthPolicy  == Toolkit::Control::Range   ) )
-    {
-      RelayoutRequest();
-    }
-  }
+  // Could be overridden in derived classes.
+  return CalculateChildSizeBase( child, dimension );
 }
 
-const Vector3& Control::GetMaximumSize() const
+bool Control::RelayoutDependentOnChildren( Dimension dimension )
 {
-  return mImpl->GetMaximumSize();
-}
-
-Vector3 Control::GetNaturalSize()
-{
-  // could be overridden in derived classes.
-  return mImpl->mNaturalSize;
+  return RelayoutDependentOnChildrenBase( dimension );
 }
 
 float Control::GetHeightForWidth( float width )
@@ -792,7 +524,7 @@ Vector4 Control::GetBackgroundColor() const
   return Color::TRANSPARENT;
 }
 
-void Control::SetBackground( Image image )
+void Control::SetBackgroundImage( Image image )
 {
   Background& background( mImpl->GetBackground() );
 
@@ -864,116 +596,6 @@ bool Control::OnAccessibilityValueChange(bool isIncrease)
   return false; // Accessibility value change action is not handled by default
 }
 
-void Control::NegotiateSize( const Vector2& allocatedSize, ActorSizeContainer& container )
-{
-  Vector2 size;
-
-  if ( mImpl->mWidthPolicy == Toolkit::Control::Fixed )
-  {
-    if ( mImpl->mHeightPolicy == Toolkit::Control::Fixed )
-    {
-      // If a control says it has a fixed size, then use the size set by the application / control.
-      Vector2 setSize( mImpl->mNaturalSize );
-      if ( setSize != Vector2::ZERO )
-      {
-        size = setSize;
-
-        // Policy is set to Fixed, so if the application / control has not set one of the dimensions,
-        // then we should use the natural size of the control rather than the full allocation.
-        if ( EqualsZero( size.width ) )
-        {
-          size.width = GetWidthForHeight( size.height );
-        }
-        else if ( EqualsZero( size.height ) )
-        {
-          size.height = GetHeightForWidth( size.width );
-        }
-      }
-      else
-      {
-        // If that is not set then set the size to the control's natural size
-        size = Vector2( GetNaturalSize() );
-      }
-    }
-    else
-    {
-      // Width is fixed so if the application / control has set it, then use that.
-      if ( !EqualsZero( mImpl->mNaturalSize.width ) )
-      {
-        size.width = mImpl->mNaturalSize.width;
-      }
-      else
-      {
-        // Otherwise, set the width to what has been allocated.
-        size.width = allocatedSize.width;
-      }
-
-      // Height is flexible so ask control what the height should be for our width.
-      size.height = GetHeightForWidth( size.width );
-
-      // Ensure height is within our policy rules
-      size.height = Calculate( mImpl->mHeightPolicy, GetMinimumSize().height, GetMaximumSize().height, size.height );
-    }
-  }
-  else
-  {
-    if ( mImpl->mHeightPolicy == Toolkit::Control::Fixed )
-    {
-      // Height is fixed so if the application / control has set it, then use that.
-      if ( !EqualsZero( mImpl->mNaturalSize.height ) )
-      {
-        size.height = mImpl->mNaturalSize.height;
-      }
-      else
-      {
-        // Otherwise, set the height to what has been allocated.
-        size.height = allocatedSize.height;
-      }
-
-      // Width is flexible so ask control what the width should be for our height.
-      size.width = GetWidthForHeight( size.height );
-
-      // Ensure width is within our policy rules
-      size.width = Calculate( mImpl->mWidthPolicy, mImpl->GetMinimumSize().width, mImpl->GetMaximumSize().width, size.width );
-    }
-    else
-    {
-      // Width and height are BOTH flexible.
-      // Calculate the width and height using the policy rules.
-      size.width = Calculate( mImpl->mWidthPolicy, mImpl->GetMinimumSize().width, mImpl->GetMaximumSize().width, allocatedSize.width );
-      size.height = Calculate( mImpl->mHeightPolicy, mImpl->GetMinimumSize().height, mImpl->GetMaximumSize().height, allocatedSize.height );
-    }
-  }
-
-  // If the width has not been set, then set to the allocated width.
-  // Also if the width set is greater than the allocated, then set to allocated (no exceed support).
-  if ( EqualsZero( size.width ) || ( size.width > allocatedSize.width ) )
-  {
-    size.width = allocatedSize.width;
-  }
-
-  // If the height has not been set, then set to the allocated height.
-  // Also if the height set is greater than the allocated, then set to allocated (no exceed support).
-  if ( EqualsZero( size.height ) || ( size.height > allocatedSize.height ) )
-  {
-    size.height = allocatedSize.height;
-  }
-
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose,
-                 "%p: Natural: [%.2f, %.2f] Allocated: [%.2f, %.2f] Set: [%.2f, %.2f]\n",
-                 Self().GetObjectPtr(),
-                 GetNaturalSize().x, GetNaturalSize().y,
-                 allocatedSize.x, allocatedSize.y,
-                 size.x, size.y );
-
-  // Avoids relayout again when OnSizeSet callback arrives as a function of us or deriving class calling SetSize()
-  mImpl->mInsideRelayout = true;
-  Self().SetSize( size );
-  // Only relayout controls which requested to be relaid out.
-  OnRelayout( size, container );
-  mImpl->mInsideRelayout = false;
-}
-
 void Control::SetAsKeyboardFocusGroup(bool isFocusGroup)
 {
   mImpl->mIsKeyboardFocusGroup = isFocusGroup;
@@ -1093,10 +715,16 @@ Control::Control( ControlBehaviour behaviourFlags )
 
 void Control::Initialize()
 {
-
   // Calling deriving classes
   OnInitialize();
 
+  // Test if the no size negotiation flag is not set
+  if( ( mImpl->mFlags & NO_SIZE_NEGOTIATION ) == 0 )
+  {
+    // Size negotiate disabled by default, so turn it on for this actor
+    Self().SetRelayoutEnabled( true );
+  }
+
   if( mImpl->mFlags & REQUIRES_STYLE_CHANGE_SIGNALS )
   {
     Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
@@ -1172,32 +800,6 @@ void Control::DisableGestureDetection(Gesture::Type type)
   }
 }
 
-void Control::RelayoutRequest()
-{
-  // unfortunate double negative but thats to guarantee new controls get size negotiation
-  // by default and have to "opt-out" if they dont want it
-  if( !(mImpl->mFlags & NO_SIZE_NEGOTIATION) )
-  {
-    Internal::RelayoutController::Request();
-  }
-}
-
-void Control::Relayout( Actor actor, const Vector2& size, ActorSizeContainer& container )
-{
-  if ( actor )
-  {
-    Toolkit::Control control( Toolkit::Control::DownCast( actor ) );
-    if( control )
-    {
-      control.GetImplementation().NegotiateSize( size, container );
-    }
-    else
-    {
-      container.push_back( ActorSizePair( actor, size ) );
-    }
-  }
-}
-
 void Control::OnInitialize()
 {
 }
@@ -1263,16 +865,26 @@ void Control::OnControlSizeSet( const Vector3& size )
 {
 }
 
-void Control::OnRelayout( const Vector2& size, ActorSizeContainer& container )
+void Control::OnCalculateRelayoutSize( Dimension dimension )
 {
-  unsigned int numChildren = Self().GetChildCount();
+}
 
-  for( unsigned int i=0; i<numChildren; ++i )
+void Control::OnLayoutNegotiated( float size, Dimension dimension )
+{
+}
+
+void Control::OnRelayout( const Vector2& size, RelayoutContainer& container )
+{
+  for( unsigned int i = 0, numChildren = Self().GetChildCount(); i < numChildren; ++i )
   {
-    container.push_back( ActorSizePair( Self().GetChildAt(i), size ) );
+    container.Add( Self().GetChildAt( i ), size );
   }
 }
 
+void Control::OnSetResizePolicy( ResizePolicy policy, Dimension dimension )
+{
+}
+
 void Control::OnKeyInputFocusGained()
 {
   // Do Nothing
@@ -1310,8 +922,6 @@ bool Control::OnMouseWheelEvent(const MouseWheelEvent& event)
 
 void Control::OnStageConnection()
 {
-  RelayoutRequest();
-
   // Notify derived classes.
   OnControlStageConnection();
 }
@@ -1330,9 +940,6 @@ void Control::OnChildAdd(Actor& child)
     return;
   }
 
-  // Request for relayout as we may need to position the new child and old ones
-  RelayoutRequest();
-
   // Notify derived classes.
   OnControlChildAdd( child );
 }
@@ -1345,16 +952,13 @@ void Control::OnChildRemove(Actor& child)
     return;
   }
 
-  // Request for relayout as we may need to re-position the old child
-  RelayoutRequest();
-
   // Notify derived classes.
   OnControlChildRemove( child );
 }
 
 void Control::OnSizeSet(const Vector3& targetSize)
 {
-  if( ( !mImpl->mInsideRelayout ) && ( targetSize != mImpl->mNaturalSize ) )
+  if( targetSize != mImpl->mNaturalSize )
   {
     // Only updates size if set through Actor's API
     mImpl->mNaturalSize = targetSize;
index a441b07..2583450 100644 (file)
@@ -41,13 +41,9 @@ class StyleManager;
 
 namespace Internal DALI_INTERNAL
 {
-class RelayoutControllerImpl;
 class KeyInputFocusManager;
 }
 
-typedef std::pair< Actor, Vector2 > ActorSizePair;       ///< Pair of actor and size
-typedef std::vector< ActorSizePair > ActorSizeContainer; ///< Container of actors and their sizes
-
 namespace Internal
 {
 
@@ -80,34 +76,14 @@ public:
   // Size negotiation
 
   /**
-   * @copydoc Toolkit::Control::SetSizePolicy()
-   */
-  void SetSizePolicy( Toolkit::Control::SizePolicy widthPolicy, Toolkit::Control::SizePolicy heightPolicy );
-
-  /**
-   * @copydoc Toolkit::Control::GetSizePolicy()
-   */
-  void GetSizePolicy( Toolkit::Control::SizePolicy& widthPolicy, Toolkit::Control::SizePolicy& heightPolicy ) const;
-
-  /**
-   * @copydoc Toolkit::Control::SetMinimumSize()
-   */
-  void SetMinimumSize( const Vector3& size );
-
-  /**
-   * @copydoc Toolkit::Control::GetMinimumSize()
-   */
-  const Vector3& GetMinimumSize() const;
-
-  /**
-   * @copydoc Toolkit::Control::SetMaximumSize()
+   * @copydoc Dali::CustomActorImpl::GetHeightForWidth()
    */
-  void SetMaximumSize( const Vector3& size );
+  virtual float GetHeightForWidth( float width );
 
   /**
-   * @copydoc Toolkit::Control::GetMaximumSize()
+   * @copydoc Dali::CustomActorImpl::GetWidthForHeight()
    */
-  const Vector3& GetMaximumSize() const;
+  virtual float GetWidthForHeight( float height );
 
   /**
    * @copydoc Toolkit::Control::GetNaturalSize()
@@ -115,26 +91,6 @@ public:
   virtual Vector3 GetNaturalSize();
 
   /**
-   * @brief This method is called during size negotiation when a height is required for a given width.
-   *
-   * Derived classes should override this if they wish to customize the height returned.
-   *
-   * @param width to use.
-   * @return the height based on the width.
-   */
-  virtual float GetHeightForWidth( float width );
-
-  /**
-   * @brief This method is called during size negotiation when a width is required for a given height.
-   *
-   * Derived classes should override this if they wish to customize the width returned.
-   *
-   * @param height to use.
-   * @return the width based on the width.
-   */
-  virtual float GetWidthForHeight( float height );
-
-  /**
    * @brief Retrieves the current Control's size.
    *
    * @return The control's size.
@@ -224,9 +180,9 @@ public:
   Vector4 GetBackgroundColor() const;
 
   /**
-   * @copydoc Dali::Toolkit::Control::SetBackground
+   * @copydoc Dali::Toolkit::Control::SetBackgroundImage
    */
-  void SetBackground( Image image );
+  void SetBackgroundImage( Image image );
 
   /**
    * @copydoc Dali::Toolkit::Control::ClearBackground
@@ -291,22 +247,6 @@ public:
    */
   virtual bool OnAccessibilityValueChange(bool isIncrease);
 
-  // Called by the RelayoutController
-
-  /**
-   * @brief Called by the RelayoutController to negotiate the size of a control.
-   *
-   * The size allocated by the the algorithm is passed in which the
-   * control must adhere to.  A container is passed in as well which
-   * the control should populate with actors it has not / or does not
-   * need to handle in its size negotiation.
-   *
-   * @param[in]      size       The allocated size.
-   * @param[in,out]  container  The container that holds actors that are fed back into the
-   *                            RelayoutController algorithm.
-   */
-  DALI_INTERNAL void NegotiateSize( const Vector2& size, ActorSizeContainer& container );
-
   // Keyboard Focus
 
   /**
@@ -431,32 +371,10 @@ protected:
    */
   void DisableGestureDetection(Gesture::Type type);
 
-  // Size Negotiation
-
-  /**
-   * @brief Request a relayout, which means performing a size negotiation on this control, its parent and children (and potentially whole scene)
-   *
-   * This method is automatically called from OnStageConnection(), OnChildAdd(),
-   * OnChildRemove(), SetSizePolicy(), SetMinimumSize() and SetMaximumSize().
-   *
-   * This method can also be called from a derived class every time it needs a different size.
-   * At the end of event processing, the relayout process starts and
-   * all controls which requested Relayout will have their sizes (re)negotiated.
-   *
-   * @note RelayoutRequest() can be called multiple times; the size negotiation is still
-   * only performed once, i.e. there is no need to keep track of this in the calling side.
-   */
-  void RelayoutRequest();
-
   /**
-   * @brief Helper method for controls to Relayout their children if
-   * they do not know whether that child is a control or not.
-   *
-   * @param[in]      actor      The actor to relayout.
-   * @param[in]      size       The size to allocate to the actor.
-   * @param[in,out]  container  The container that holds actors that have not been allocated a size yet.
+   * @copydoc Dali::CustomActorImpl::RelayoutDependentOnChildren()
    */
-  static void Relayout( Actor actor, const Vector2& size, ActorSizeContainer& container );
+  virtual bool RelayoutDependentOnChildren( Dimension dimension = ALL_DIMENSIONS );
 
 private:
 
@@ -588,24 +506,6 @@ private:
   virtual void OnControlSizeSet( const Vector3& size );
 
   /**
-   * @brief Called after the size negotiation has been finished for this control.
-   *
-   * The control is expected to assign this given size to itself/its children.
-   *
-   * Should be overridden by derived classes if they need to layout
-   * actors differently after certain operations like add or remove
-   * actors, resize or after changing specific properties.
-   *
-   * Note! As this function is called from inside the size negotiation algorithm, you cannot
-   * call RequestRelayout (the call would just be ignored)
-   *
-   * @param[in]      size       The allocated size.
-   * @param[in,out]  container  The control should add actors to this container that it is not able
-   *                            to allocate a size for.
-   */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
-
-  /**
    * @brief Called when the control gains key input focus.
    *
    * Should be overridden by derived classes if they need to customize what happens when focus is gained.
@@ -646,6 +546,31 @@ private:
    */
   virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
 
+  /**
+   * @copydoc Dali::CustomActorImpl::OnCalculateRelayoutSize()
+   */
+  virtual void OnCalculateRelayoutSize( Dimension dimension );
+
+  /**
+   * @copydoc Dali::CustomActorImpl::OnLayoutNegotiated()
+   */
+  virtual void OnLayoutNegotiated( float size, Dimension dimension );
+
+  /**
+   * @copydoc Dali::CustomActorImpl::OnRelayout()
+   */
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+
+  /**
+   * @copydoc Dali::CustomActorImpl::OnSetResizePolicy()
+   */
+  virtual void OnSetResizePolicy( ResizePolicy policy, Dimension dimension );
+
+  /**
+   * @copydoc Dali::CustomActorImpl::CalculateChildSize()
+   */
+  virtual float CalculateChildSize( const Dali::Actor& child, Dimension dimension );
+
   // From CustomActorImpl, derived classes should NOT override these.
 
   /**
index b987ade..a66f2ae 100644 (file)
@@ -69,51 +69,6 @@ const Internal::Control& Control::GetImplementation() const
   return static_cast<const Internal::Control&>(CustomActor::GetImplementation());
 }
 
-void Control::SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy )
-{
-  GetImplementation().SetSizePolicy( widthPolicy, heightPolicy );
-}
-
-void Control::GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const
-{
-  GetImplementation().GetSizePolicy( widthPolicy, heightPolicy );
-}
-
-void Control::SetMinimumSize( const Vector3& size )
-{
-  GetImplementation().SetMinimumSize( size );
-}
-
-const Vector3& Control::GetMinimumSize() const
-{
-  return GetImplementation().GetMinimumSize();
-}
-
-void Control::SetMaximumSize( const Vector3& size )
-{
-  GetImplementation().SetMaximumSize( size );
-}
-
-const Vector3& Control::GetMaximumSize() const
-{
-  return GetImplementation().GetMaximumSize();
-}
-
-Vector3 Control::GetNaturalSize()
-{
-  return GetImplementation().GetNaturalSize();
-}
-
-float Control::GetHeightForWidth( float width )
-{
-  return GetImplementation().GetHeightForWidth( width );
-}
-
-float Control::GetWidthForHeight( float height )
-{
-  return GetImplementation().GetWidthForHeight( height );
-}
-
 void Control::SetKeyInputFocus()
 {
   GetImplementation().SetKeyInputFocus();
@@ -159,9 +114,9 @@ Vector4 Control::GetBackgroundColor() const
   return GetImplementation().GetBackgroundColor();
 }
 
-void Control::SetBackground( Image image )
+void Control::SetBackgroundImage( Image image )
 {
-  GetImplementation().SetBackground( image );
+  GetImplementation().SetBackgroundImage( image );
 }
 
 void Control::ClearBackground()
index af840cd..1e6f8d9 100644 (file)
@@ -83,38 +83,12 @@ public:
     enum
     {
       BACKGROUND_COLOR = PROPERTY_START_INDEX, ///< name "background-color", @see SetBackgroundColor, type Vector4
-      BACKGROUND,                              ///< name "background",       @see SetBackground,      type Map
-      WIDTH_POLICY,                            ///< name "width-policy",     @see SetSizePolicy,      type std::string
-      HEIGHT_POLICY,                           ///< name "height-policy",    @see SetSizePolicy,      type std::string
-      MINIMUM_SIZE,                            ///< name "minimum-size",     @see SetMinimumSize,     type Vector3
-      MAXIMUM_SIZE,                            ///< name "maximum-size",     @see SetMaximumSize,     type Vector3
+      BACKGROUND_IMAGE,                        ///< name "background-image", @see SetBackgroundImage, type Map
       KEY_INPUT_FOCUS,                         ///< name "key-input-focus",  @see SetKeyInputFocus,   type bool
     };
   };
 
   /**
-   * @brief Describes how a control could be resized.
-   */
-  enum SizePolicy
-  {
-    Fixed,    ///< Size can't grow or shrink.
-    Minimum,  ///< Size can grow but shrink up to a minimum level.
-    Maximum,  ///< Size can shrink but grow up to a maximum value.
-    Range,    ///< Size can grow or shrink between a minimum and a maximum values.
-    Flexible, ///< Size can grow or shrink with no limits.
-  };
-
-  /**
-   * @brief Describes what a control should do when a contained actor/control exceeds the boundary of the control.
-   */
-  enum ExceedPolicy
-  {
-    Crop,   ///< Control's contents will be cropped.
-    Shrink, ///< Control's contents will be shrunk.
-    Scroll  ///< Control's contents will be added to a scroll.
-  };
-
-  /**
    * @brief Describes the direction to move the keyboard focus towards.
    */
   enum KeyboardFocusNavigationDirection
@@ -200,79 +174,6 @@ public:
    */
   const Internal::Control& GetImplementation() const;
 
-  // Size Negotiation
-
-  /**
-   * @brief Sets the size policies for the width and height dimensions.
-   *
-   * @param[in] widthPolicy Size policy for the width dimension.
-   * @param[in] heightPolicy Size policy for the height dimension.
-   */
-  void SetSizePolicy( SizePolicy widthPolicy, SizePolicy heightPolicy );
-
-  /**
-   * @brief Retrieves the size policies for the width and height dimensions.
-   *
-   * @param[out] widthPolicy Width's size policy.
-   * @param[out] heightPolicy Height's size policy.
-   */
-  void GetSizePolicy( SizePolicy& widthPolicy, SizePolicy& heightPolicy ) const;
-
-  /**
-   * @brief Sets the minimum size for the control.
-   *
-   * @param[in] size The minimum size.
-   */
-  void SetMinimumSize( const Vector3& size );
-
-  /**
-   * @brief Retrieves the minimum size.
-   *
-   * @return The minimum size.
-   */
-  const Vector3& GetMinimumSize() const;
-
-  /**
-   * @brief Sets the maximum size.
-   *
-   * @param[in] size The maximum size.
-   */
-  void SetMaximumSize( const Vector3& size );
-
-  /**
-   * @brief Retrieves the maximum size.
-   *
-   * @return The maximum size.
-   */
-  const Vector3& GetMaximumSize() const;
-
-  /**
-   * @brief Works out the natural size.
-   *
-   * Natural size is the control's size with any restriction.
-   *
-   * @return The natural size.
-   */
-  Vector3 GetNaturalSize();
-
-  /**
-   * @brief Works out the control's height for a given width.
-   *
-   * @param[in] width The control's width.
-   *
-   * @return The control's height for the given width.
-   */
-  float GetHeightForWidth( float width );
-
-  /**
-   * @brief Works out the control's width for a given height.
-   *
-   * @param[in] height The control's height.
-   *
-   * @return The control's width for the given height.
-   */
-  float GetWidthForHeight( float height );
-
   // Key Input
 
   /**
@@ -366,7 +267,7 @@ public:
    *
    * @param[in] image The image to set as the background.
    */
-  void SetBackground( Image image );
+  void SetBackgroundImage( Image image );
 
   /**
    * @brief Clears the background.
index 8e393c7..df8e42d 100644 (file)
@@ -137,6 +137,11 @@ void Popup::HideTail()
   GetImpl(*this).HideTail();
 }
 
+void Popup::MarkDirtyForRelayout()
+{
+  GetImpl(*this).MarkDirtyForRelayout();
+}
+
 Popup::TouchedOutsideSignalType& Popup::OutsideTouchedSignal()
 {
   return GetImpl(*this).OutsideTouchedSignal();
index 040cb08..fc14389 100644 (file)
@@ -252,6 +252,11 @@ public:
    */
   void HideTail();
 
+  /**
+   * @brief Flag the popup as dirty for relayout
+   */
+  void MarkDirtyForRelayout();
+
 public: // Not intended for application developers
 
   /**
index cce79c0..564235c 100644 (file)
@@ -575,7 +575,7 @@ void DepthLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3
 {
   if(animation)
   {
-    animation.Resize(actor, size);
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size );
   }
 }
 
index efb16e2..93e9956 100644 (file)
@@ -624,8 +624,8 @@ void GridLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 s
 
     // Do a nonlinear size animation to shrink the actor first when the actor size changes,
     // so that we can avoid the actors overlapping during orientation change.
-    animation.Resize( actor, shrink, AlphaFunctions::EaseOut, 0.0f, durationSeconds * 0.5f );
-    animation.Resize( actor, size, AlphaFunctions::EaseIn, 0.0f, durationSeconds );
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), shrink, AlphaFunctions::EaseOut, TimePeriod( 0.0f, durationSeconds * 0.5f ) );
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, AlphaFunctions::EaseIn, TimePeriod( 0.0f, durationSeconds ) );
   }
 }
 
index 0bb8842..26a232f 100644 (file)
@@ -178,6 +178,11 @@ float ItemView::GetRefreshInterval() const
   return GetImpl(*this).GetRefreshInterval();
 }
 
+void ItemView::Refresh()
+{
+  return GetImpl(*this).Refresh();
+}
+
 Actor ItemView::GetItem(unsigned int itemId) const
 {
   return GetImpl(*this).GetItem(itemId);
index 1dd4fe3..aefa4f1 100644 (file)
@@ -277,6 +277,11 @@ public:
   float GetRefreshInterval() const;
 
   /**
+   * @brief Do a refresh of the item view.
+   */
+  void Refresh();
+
+  /**
    * @brief Given the Item ID, this returns the accompanying actor.
    *
    * @param[in] itemId The Item ID of the actor required.
index 471574c..07b5a78 100644 (file)
@@ -489,7 +489,7 @@ void SpiralLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3
 {
   if(animation)
   {
-    animation.Resize(actor, size);
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size );
   }
 }
 
index 9e8a9c7..be7a991 100644 (file)
@@ -283,18 +283,6 @@ unsigned int FixedRuler::GetTotalPages() const
 // ScrollView
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-const std::string ScrollView::SCROLL_TIME_PROPERTY_NAME( "scroll-time" );
-const std::string ScrollView::SCROLL_POSITION_PROPERTY_NAME( "scroll-position" );
-const std::string ScrollView::SCROLL_PRE_POSITION_PROPERTY_NAME( "scroll-pre-position" );
-const std::string ScrollView::SCROLL_OVERSHOOT_X_PROPERTY_NAME( "scroll-overshoot-x" );
-const std::string ScrollView::SCROLL_OVERSHOOT_Y_PROPERTY_NAME( "scroll-overshoot-y" );
-const std::string ScrollView::SCROLL_FINAL_PROPERTY_NAME( "scroll-final" );
-const std::string ScrollView::SCROLL_WRAP_PROPERTY_NAME( "scroll-wrap" );
-const std::string ScrollView::SCROLL_PANNING_PROPERTY_NAME( "scroll-panning" );
-const std::string ScrollView::SCROLL_SCROLLING_PROPERTY_NAME( "scroll-scrolling" );
-const std::string ScrollView::SCROLL_POSITION_DELTA_PROPERTY_NAME( "scroll-position-delta" );
-const std::string ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME( "scroll-start-page-position" );
-
 const float ScrollView::DEFAULT_SLOW_SNAP_ANIMATION_DURATION(0.5f);
 const float ScrollView::DEFAULT_FAST_SNAP_ANIMATION_DURATION(0.25f);
 const float ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION(0.5f);
index 6cf6331..3ba77ed 100644 (file)
@@ -409,20 +409,6 @@ class DALI_IMPORT_API ScrollView : public Scrollable
 {
 public:
 
-  // Custom properties
-
-  static const std::string SCROLL_TIME_PROPERTY_NAME;                   ///< Property, name "scroll-time",               type float
-  static const std::string SCROLL_POSITION_PROPERTY_NAME;               ///< Property, name "scroll-position",           type Vector3
-  static const std::string SCROLL_PRE_POSITION_PROPERTY_NAME;           ///< Property, name "scroll-pre-position",       type Vector3
-  static const std::string SCROLL_OVERSHOOT_X_PROPERTY_NAME;            ///< Property, name "scroll-overshoot-x",        type float
-  static const std::string SCROLL_OVERSHOOT_Y_PROPERTY_NAME;            ///< Property, name "scroll-overshoot-y",        type float
-  static const std::string SCROLL_FINAL_PROPERTY_NAME;                  ///< Property, name "scroll-final",              type Vector3
-  static const std::string SCROLL_WRAP_PROPERTY_NAME;                   ///< Property, name "scroll-wrap",               type bool
-  static const std::string SCROLL_PANNING_PROPERTY_NAME;                ///< Property, name "scroll-panning",            type bool
-  static const std::string SCROLL_SCROLLING_PROPERTY_NAME;              ///< Property, name "scroll-scrolling",          type bool
-  static const std::string SCROLL_POSITION_DELTA_PROPERTY_NAME;         ///< Property, name "scroll-position-delta"      type Vector3
-  static const std::string SCROLL_START_PAGE_POSITION_PROPERTY_NAME;    ///< Property, name "scroll-start-page-position" type Vector3
-
   // Default settings
 
   static const float DEFAULT_SLOW_SNAP_ANIMATION_DURATION;              ///< Default Drag-Release animation time.
@@ -457,6 +443,36 @@ public:
     float duration;   ///< Duration of snap animation.
   };
 
+  /**
+   * @brief The start and end property ranges for this control.
+   */
+  enum PropertyRange
+  {
+    ANIMATABLE_PROPERTY_START_INDEX = Toolkit::Scrollable::ANIMATABLE_PROPERTY_END_INDEX + 1,
+    ANIMATABLE_PROPERTY_END_INDEX   = ANIMATABLE_PROPERTY_START_INDEX + 1000                   ///< Reserve animatable property indices
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the ScrollView class.
+   */
+  struct Property
+  {
+    enum
+    {
+      SCROLL_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scroll-position",       type Vector3
+      SCROLL_PRE_POSITION,                               ///< Property, name "scroll-pre-position",   type Vector3
+      OVERSHOOT_X,                                       ///< Property, name "overshoot-x",           type float
+      OVERSHOOT_Y,                                       ///< Property, name "overshoot-y",           type float
+      SCROLL_FINAL,                                      ///< Property, name "scroll-final",          type Vector3
+      WRAP,                                              ///< Property, name "wrap",                  type bool
+      PANNING,                                           ///< Property, name "panning",               type bool
+      SCROLLING,                                         ///< Property, name "scrolling",             type bool
+      SCROLL_DOMAIN_OFFSET,                              ///< Property, name "scroll-domain-offset"   type Vector3
+      SCROLL_POSITION_DELTA,                             ///< Property, name "scroll-position-delta"  type Vector3
+      START_PAGE_POSITION                                ///< Property, name "start-page-position"    type Vector3
+    };
+  };
+
   typedef Signal< void ( const SnapEvent& ) > SnapStartedSignalType; ///< SnapStarted signal type
 
   /**
index 1ce8314..ff955ff 100644 (file)
@@ -26,11 +26,6 @@ namespace Dali
 namespace Toolkit
 {
 
-const std::string Scrollable::SCROLL_RELATIVE_POSITION_PROPERTY_NAME( "scroll-relative-position" );
-const std::string Scrollable::SCROLL_POSITION_MIN_PROPERTY_NAME( "scroll-position-min" );
-const std::string Scrollable::SCROLL_POSITION_MAX_PROPERTY_NAME( "scroll-position-max" );
-const std::string Scrollable::SCROLL_DIRECTION_PROPERTY_NAME( "scroll-direction" );
-
 Scrollable::Scrollable()
 {
 }
index 0b315f3..62f6100 100644 (file)
@@ -59,20 +59,16 @@ public:
     OvershootIndicator,
   };
 
-  // Custom properties
-
-  static const std::string SCROLL_RELATIVE_POSITION_PROPERTY_NAME;      ///< Property, name "scroll-relative-position", type Vector3
-  static const std::string SCROLL_POSITION_MIN_PROPERTY_NAME;           ///< Property, name "scroll-position-min",      type Vector3
-  static const std::string SCROLL_POSITION_MAX_PROPERTY_NAME;           ///< Property, name "scroll-position-max",      type Vector3
-  static const std::string SCROLL_DIRECTION_PROPERTY_NAME;              ///< Property, name "scroll-direction",         type Vector2
-
   /**
    * @brief The start and end property ranges for this control.
    */
   enum PropertyRange
   {
     PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
-    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserve property indices
+    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000,             ///< Reserve property indices
+
+    ANIMATABLE_PROPERTY_START_INDEX = ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX,
+    ANIMATABLE_PROPERTY_END_INDEX =   ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX + 1000              ///< Reserve animatable property indices
   };
 
   /**
@@ -82,8 +78,17 @@ public:
   {
     enum
     {
+      // Event side properties
       OVERSHOOT_EFFECT_COLOR = PROPERTY_START_INDEX, ///< Property, name "overshoot-effect-color",    @see SetOvershootEffectColor(),    type Vector4
       OVERSHOOT_ANIMATION_SPEED,                     ///< Property, name "overshoot-animation-speed", @see SetOvershootAnimationSpeed(), type float
+
+      // Animatable properties
+      SCROLL_RELATIVE_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scroll-relative-position", type Vector3
+      SCROLL_POSITION_MIN,                                        ///< Property, name "scroll-position-min",      type Vector3
+      SCROLL_POSITION_MAX,                                        ///< Property, name "scroll-position-max",      type Vector3
+      SCROLL_DIRECTION,                                           ///< Property, name "scroll-direction",         type Vector2
+      CAN_SCROLL_VERTICAL,                                        ///< Property, name "can-scroll-vertical",      type bool
+      CAN_SCROLL_HORIZONTAL                                       ///< Property, name "can-scroll-horizontal",    type bool
     };
   };
 
index 7c77387..82e6e10 100644 (file)
@@ -135,6 +135,26 @@ Size TableView::GetCellPadding()
   return GetImpl(*this).GetCellPadding();
 }
 
+void TableView::SetFitHeight( unsigned int rowIndex )
+{
+  GetImpl(*this).SetRowPolicy( rowIndex, Internal::TableView::FIT );
+}
+
+bool TableView::IsFitHeight( unsigned int rowIndex ) const
+{
+  return ( GetImpl(*this).GetRowPolicy( rowIndex ) == Internal::TableView::FIT );
+}
+
+void TableView::SetFitWidth( unsigned int columnIndex )
+{
+  GetImpl(*this).SetColumnPolicy( columnIndex, Internal::TableView::FIT );
+}
+
+bool TableView::IsFitWidth( unsigned int columnIndex ) const
+{
+  return ( GetImpl(*this).GetColumnPolicy( columnIndex ) == Internal::TableView::FIT );
+}
+
 void TableView::SetFixedHeight( unsigned int rowIndex, float height )
 {
   GetImpl(*this).SetFixedHeight( rowIndex, height );
@@ -185,6 +205,11 @@ unsigned int TableView::GetColumns()
   return GetImpl(*this).GetColumns();
 }
 
+void TableView::SetCellAlignment( CellPosition position, HorizontalAlignment::Type horizontal, VerticalAlignment::Type vertical )
+{
+  GetImpl(*this).SetCellAlignment( position, horizontal, vertical );
+}
+
 TableView::TableView(Internal::TableView& implementation)
 : Control(implementation)
 {
index 104a050..4340d45 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/actors/actor-enumerations.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
@@ -99,9 +100,9 @@ public:
    */
   enum LayoutPolicy
   {
-    Fixed,      ///< Fixed with the given value.
-    Relative,   ///< Calculated as percentage of the remainder after subtracting Padding and Fixed height/width
-    Fill        ///< Get the remainder of the 100% (after subtracting Padding, Fixed and Relative height/ width) divided evenly between 'fill' rows/columns
+    FIXED,      ///< Fixed with the given value.
+    RELATIVE,   ///< Calculated as percentage of the remainder after subtracting Padding and Fixed height/width
+    FILL        ///< Get the remainder of the 100% (after subtracting Padding, Fixed and Relative height/ width) divided evenly between 'fill' rows/columns
   };
 
   /**
@@ -271,6 +272,36 @@ public:
   Size GetCellPadding();
 
   /**
+   * @brief Specify this row as fitting its height to its children
+   *
+   * @param[in] rowIndex The row to set
+   */
+  void SetFitHeight( unsigned int rowIndex );
+
+  /**
+   * @brief Is the row a fit row
+   *
+   * @param[in] rowIndex The row to check
+   * @return Return true if the row is fit
+   */
+  bool IsFitHeight( unsigned int rowIndex ) const;
+
+  /**
+   * @brief Specify this column as fitting its width to its children
+   *
+   * @param[in] columnIndex The column to set
+   */
+  void SetFitWidth( unsigned int columnIndex );
+
+  /**
+   * @brief Is the column a fit column
+   *
+   * @param[in] columnIndex The column to check
+   * @return Return true if the column is fit
+   */
+  bool IsFitWidth( unsigned int columnIndex ) const;
+
+  /**
    * Sets a row to have fixed height
    * Setting a fixed height of 0 has no effect
    * @pre The row rowIndex must exist.
@@ -350,6 +381,15 @@ public:
    */
   unsigned int GetColumns();
 
+  /**
+   * @brief Set the alignment on a cell
+   *
+   * @param[in] position The cell to set alignment on
+   * @param[in] horizontal The horizontal alignment
+   * @param[in] vertical The vertical alignment
+   */
+  void SetCellAlignment( CellPosition position, HorizontalAlignment::Type horizontal, VerticalAlignment::Type vertical );
+
 public: // Not intended for application developers
 
   /**
index 5487676..898eac4 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 35;
+const unsigned int TOOLKIT_MICRO_VERSION = 36;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 53c82aa..a3dd4bc 100644 (file)
@@ -18,9 +18,9 @@
  *
  */
 
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
-#include <dali.h>
+#include <dali/public-api/object/base-handle.h>
 
 namespace Dali
 {
diff --git a/docs/content/images/size-negotiation/Algorithm1.png b/docs/content/images/size-negotiation/Algorithm1.png
deleted file mode 100644 (file)
index dc0b603..0000000
Binary files a/docs/content/images/size-negotiation/Algorithm1.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/Algorithm10.png b/docs/content/images/size-negotiation/Algorithm10.png
deleted file mode 100644 (file)
index 154777e..0000000
Binary files a/docs/content/images/size-negotiation/Algorithm10.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/Algorithm2.png b/docs/content/images/size-negotiation/Algorithm2.png
deleted file mode 100644 (file)
index 3de7aeb..0000000
Binary files a/docs/content/images/size-negotiation/Algorithm2.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/Algorithm3.png b/docs/content/images/size-negotiation/Algorithm3.png
deleted file mode 100644 (file)
index 76d088e..0000000
Binary files a/docs/content/images/size-negotiation/Algorithm3.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/Algorithm4.png b/docs/content/images/size-negotiation/Algorithm4.png
deleted file mode 100644 (file)
index eafd019..0000000
Binary files a/docs/content/images/size-negotiation/Algorithm4.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/Algorithm8.png b/docs/content/images/size-negotiation/Algorithm8.png
deleted file mode 100644 (file)
index df20bf3..0000000
Binary files a/docs/content/images/size-negotiation/Algorithm8.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/Algorithm9.png b/docs/content/images/size-negotiation/Algorithm9.png
deleted file mode 100644 (file)
index 7a22cdb..0000000
Binary files a/docs/content/images/size-negotiation/Algorithm9.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/FixedWidthFlexibleHeight.png b/docs/content/images/size-negotiation/FixedWidthFlexibleHeight.png
deleted file mode 100644 (file)
index 0dd09b8..0000000
Binary files a/docs/content/images/size-negotiation/FixedWidthFlexibleHeight.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/FixedWidthFlexibleHeight2.png b/docs/content/images/size-negotiation/FixedWidthFlexibleHeight2.png
deleted file mode 100644 (file)
index 54cb64e..0000000
Binary files a/docs/content/images/size-negotiation/FixedWidthFlexibleHeight2.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/FixedWidthHeight.png b/docs/content/images/size-negotiation/FixedWidthHeight.png
deleted file mode 100644 (file)
index af6dee0..0000000
Binary files a/docs/content/images/size-negotiation/FixedWidthHeight.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/FixedWidthHeight2.png b/docs/content/images/size-negotiation/FixedWidthHeight2.png
deleted file mode 100644 (file)
index c792b73..0000000
Binary files a/docs/content/images/size-negotiation/FixedWidthHeight2.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/FlexibleWidthFixedHeight.png b/docs/content/images/size-negotiation/FlexibleWidthFixedHeight.png
deleted file mode 100644 (file)
index 0edf63f..0000000
Binary files a/docs/content/images/size-negotiation/FlexibleWidthFixedHeight.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/FlexibleWidthFixedHeight2.png b/docs/content/images/size-negotiation/FlexibleWidthFixedHeight2.png
deleted file mode 100644 (file)
index 9ee0bb4..0000000
Binary files a/docs/content/images/size-negotiation/FlexibleWidthFixedHeight2.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/FlexibleWidthHeight.png b/docs/content/images/size-negotiation/FlexibleWidthHeight.png
deleted file mode 100644 (file)
index 1025009..0000000
Binary files a/docs/content/images/size-negotiation/FlexibleWidthHeight.png and /dev/null differ
diff --git a/docs/content/images/size-negotiation/Popup.png b/docs/content/images/size-negotiation/Popup.png
new file mode 100644 (file)
index 0000000..f5d9b7f
Binary files /dev/null and b/docs/content/images/size-negotiation/Popup.png differ
diff --git a/docs/content/images/size-negotiation/PopupExample.png b/docs/content/images/size-negotiation/PopupExample.png
new file mode 100644 (file)
index 0000000..531622d
Binary files /dev/null and b/docs/content/images/size-negotiation/PopupExample.png differ
diff --git a/docs/content/images/size-negotiation/ResizePolicies.png b/docs/content/images/size-negotiation/ResizePolicies.png
new file mode 100644 (file)
index 0000000..7b8350e
Binary files /dev/null and b/docs/content/images/size-negotiation/ResizePolicies.png differ
diff --git a/docs/content/images/size-negotiation/ResizePoliciesExample.png b/docs/content/images/size-negotiation/ResizePoliciesExample.png
new file mode 100644 (file)
index 0000000..19b806f
Binary files /dev/null and b/docs/content/images/size-negotiation/ResizePoliciesExample.png differ
diff --git a/docs/content/images/size-negotiation/SizeNegotiationExample_After.png b/docs/content/images/size-negotiation/SizeNegotiationExample_After.png
new file mode 100644 (file)
index 0000000..3a64d36
Binary files /dev/null and b/docs/content/images/size-negotiation/SizeNegotiationExample_After.png differ
diff --git a/docs/content/images/size-negotiation/SizeNegotiationExample_Before.png b/docs/content/images/size-negotiation/SizeNegotiationExample_Before.png
new file mode 100644 (file)
index 0000000..30251d2
Binary files /dev/null and b/docs/content/images/size-negotiation/SizeNegotiationExample_Before.png differ
index f742f01..ab76aa7 100644 (file)
  * \section Constraints
  * - \link constraints-intro Introduction to Constraints \endlink
  *
+ * \section SizeNegotiation Size Negotiation
+ * - \link size-negotiation Size Negotiation \endlink
+ *
  * \section UIControls UI Controls
  * - \link item-view Item View \endlink
  * - \link text-view Text View \endlink
  * - \link text-input Text Input \endlink
  * - \link scroll-view Scroll View \endlink
+ * - \link size-negotiation-controls Size Negotiation for Controls \endlink
  * - \link markup-processor Markup Processor \endlink
- * - \link size-negotiation Size Negotiation \endlink
  * - \link type-registration Type Registration \endlink
  * - \link properties Properties \endlink
  * - \link background Background \endlink
index 577dcfe..d133614 100644 (file)
@@ -20,8 +20,8 @@
 
    Here we add the animators, these are the building blocks (functions) of the animation and define what we want to see
    @code
-   myAnimation.OpacityTo(actor, 1.0f);
-   myAnimation.MoveTo(actor, x, y, z);
+   myAnimation.AnimateTo(Property(actor, Actor::Property::OPACITY), 1.0f);
+   myAnimation.AnimateTo(Property(actor, Actor::Property::POSITION), Vector3(x, y, z));
    @endcode
 
    start animation, when this is called we want the animation to start playing so here the actor will move whilst the opacity changes.
    @endcode
    \section advanced-anims Adding more advanced animators, if simply moving the actor is not enough we have further animations methods.
 
-   For actor there exists a range of methods ranging from Move, Rotate, Scale, Opacity, Color to Resize.  The API explains in detail what each does and the parameters to these methods but there are some points worth noting;
-
-   xxxxBy and xxxxTo, method names are appended by 'By' or 'To' either animate to a supplied value or animate by a supplied value.  For example an actor at (10,10,10) calling MoveBy(actor, 50,0,0) would mean its location is (60,0,0) whilst MoveTo(actor, 50,0,0) would result in a location (50,0,0).
+   AnimateBy and AnimateTo, method names are appended by 'By' or 'To' either animate to a supplied value or animate by a supplied value.  For example an actor at (10,10,10) calling AnimateBy(Property(actor, Actor::Property::POSITION), 50,0,0) would mean its location is (60,0,0) whilst AnimateTo(Property(actor, Actor::Property::POSITION), 50,0,0) would result in a location (50,0,0).
 
    Dali::AlphaFunctions can be used to give interesting effects to the animation, for example the MOVEment of an actor on screen can speed up and slow down following a sine curve by using the Dali::AlphaFunctions::EaseInOutSine instead of AlphaFunctions::Linear.
 
    @code
-   myAnimation.MoveTo(actor, Vector3(x, y, z), AlphaFunctions::Linear, delay, ANIMATOR_DURATION);
-   myAnimation.Resize(actor, actorSize, AlphaFunctions::EaseIn, delay, ANIMATOR_DURATION);
+   myAnimation.AnimateTo(Property(actor, Actor::Property::POSITION), Vector3(x, y, z), AlphaFunctions::Linear, delay, ANIMATOR_DURATION);
+   myAnimation.AnimateTo(Property(actor, Actor::Property::SIZE), actorSize, AlphaFunctions::EaseIn, delay, ANIMATOR_DURATION);
    @endcode
    \section playback-control Controlling a playing animation
 
index 2e01044..0351ec9 100644 (file)
  * actor.RotateBy(q);
  * @endcode
  *
- * The Dali::Animation class provides several RotateTo methods that
- * use \ref Dali::Quaternion "Quaternions" directly.  The other
- * RotateTo methods are specified using Axis+Angle, and these convert
- * to Quaternion internally. You will only need to use the quaternion
- * based methods when you are doing something more complex than
- * initialising with Axis+Angle, such as applying several rotations
- * together.
+ * The Dali::Animation class provides several AnimateTo methods that
+ * use \ref Dali::Quaternion "Quaternions" directly to change the orientation.
+ *
  * @code
  * mAnimation = Animation::New(5.0f); // 5 seconds
  * Quaternion q(Radian(Degree(45.0f)).value, Vector3::YAXIS);
  * Quaternion r(Radian(Degree(30.0f)).value, Vector3::ZAXIS);
  * q *= r;
- * mAnimation.RotateTo(mActor, q, AlphaFunctions::EaseInOut);
+ * mAnimation.AnimateTo(Property(mActor, Actor::Property::ORIENTATION), q, AlphaFunctions::EaseInOut);
  * mAnimation.Play();
  * @endcode
  */
index a8a9200..a6761d5 100644 (file)
  * body.SetKinematic( true );
  * // create a second animation to move the actor 100 units to the right
  * Animation animation( Animation::New( 1 ) );
- * animation.MoveBy( actor, Vector3( 100, 0, 0 ), AlphaFunctions::Linear );
+ * animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Vector3( 100, 0, 0 ), AlphaFunctions::Linear );
  * animation.Play();
  * \endcode
  * <hr>
diff --git a/docs/content/programming-guide/size-negotiation-controls.h b/docs/content/programming-guide/size-negotiation-controls.h
new file mode 100644 (file)
index 0000000..1663e79
--- /dev/null
@@ -0,0 +1,255 @@
+/*! \page size-negotiation-controls Size Negotiation for Controls
+ *
+<h2 class="pg">Overview</h2>
+
+This document details how to create controls using the size negotiation API and is intended for UI control writters. For an introduction to
+size negotiation please see the <i>Size Negotiation Programming Guide</i>.
+
+The topics covered are:
+- The Relayout Controller
+- Resize Policies
+- Creating a Control: Popups
+- Size Negotiation API
+- Creating a Control: TableView
+
+<h2 class="pg">The Relayout Controller</h2>
+
+<h3>Overview</h3>
+The RelayoutController is an object that is private in DALi Core. It's main job is to take relayout requests from actors.
+It can be enabled or disabled internally. If disabled, then all relayout requests are ignored. By default the relayout controller is disabled until just after the
+initial application initialize. This allows the scene for an application to be created without generating many relayout requests. After the application
+has initialized the scene, then the relayout controller is automatically enabled and a relayout request is called on the root of the scene. This request spreads down the scene
+hierarchy and requests relayout on all actors that have size negotiation enabled.
+
+Relayout requests are put in automatically when a property is changed on an actor or a change to the stage hierarchy is made and manual requests are usually not necessary.
+
+<h2 class="pg">Resize Policies</h2>
+
+In addition to the resize policies detailed in the Size Negotiation Programming Guide there is one additional policy available to control writers:
+
+- USE_ASSIGNED_SIZE: Tells the actor to use the size that was passed into the size negotiation algorithm for it. This is used in the OnRelayout
+method derived from Actor when passing back controls to be negotiated using the container argument to the method.
+
+<h2 class="pg">Creating a Control: Popups</h2>
+
+<h3>Initialization</h3>
+Size negotiation is enabled on controls by default. If a control is desired to not have size negotiation enabled then simply pass in the
+NO_SIZE_NEGOTIATION flag into the Control constructor. This will then call SetRelayoutEnabled( false ) on the base class.
+
+The other step to perform is to set default resize policies for width and height.
+
+<h3>A Simple Example: Popup</h3>
+
+This example shows how to set up a popup for use with size negotiation. The popup contains a layer to raise it above all other controls,
+a semi-transparent full-screen backing image to dim the screen, a background image with a shadow border, and buttons that are positioned
+and resized by the popup. The following screen shot shows an example popup.
+
+\image html size-negotiation/PopupExample.png
+
+The first step is to set the default resize policies. This is done in the OnInitialize method. In the following snippet the popup
+is set to have a height resize policy of FIT_TO_CHILDREN. This assumes that the width of the popup will be specified by the user of
+the popup and that the desired behaviour is to fit the height of the popup to the size of its content.
+@code
+void Popup::OnInitialize()
+...
+Actor self = Self();
+self.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+@endcode
+The popup will use a layer to place its content in. The layer is created and specified to fill the whole screen by using the following command.
+@code
+mLayer.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+@endcode
+A half transparent backing image is added to the layer and told to fill the layer with the following.
+@code
+mBacking.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+@endcode
+The popup control is added to the layer and a background image is specified to fill the size of the popup and add a border by the following.
+@code
+mBackgroundImage.SetResizePolicy( SIZE_FIXED_OFFSET_FROM_PARENT, ALL_DIMENSIONS );
+Vector3 border( mPopupStyle->backgroundOuterBorder.x, mPopupStyle->backgroundOuterBorder.z, 0.0f );
+mBackgroundImage.SetSizeModeFactor( border );
+@endcode
+A table view is added to the popup to specify layout. It will fill to the width of the popup and expand/contract around its children cell heights.
+@code
+mPopupLayout.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+mPopupLayout.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+@endcode
+Override the OnRelayout method to position and resize the buttons. The trick to this is that the buttons do not know they are part of a popup and are
+about to be resized so could already have had their sizes negotiated. The call to PropagateRelayoutFlags on the button will ensure that it and all
+its child dependents are ready for a new size negotiation pass. The container.Add call will add the button to the relayout queue to be processed this frame.
+The buttonSize parameter is the desired size for the button. The desired size will only be set if the size policy of the button has already been changed to
+USE_ASSIGNED_SIZE, which is what happens when a button is added to the popup.
+@code
+void Popup::AddButton( Toolkit::Button button )
+...
+button.SetResizePolicy( USE_ASSIGNED_SIZE, ALL_DIMENSIONS );
+...
+
+void Popup::OnRelayout( const Vector2& size, RelayoutContainer& container )
+...
+button.SetPosition( buttonPosition );
+
+button.PropagateRelayoutFlags();    // Reset relayout flags for relayout
+container.Add( button, buttonSize );
+...
+@endcode
+Another aspect to the popup is that depending which resize policies are active on it then the inner table view requires different resize policies itself.
+OnSetResizePolicy can be overridden to receive notice that the resize policy has changed on the control and action can be taken.
+@code
+void Popup::OnSetResizePolicy( ResizePolicy policy, Dimension dimension )
+...
+if( policy == FIT_TO_CHILDREN )
+{
+  // Make content fit to children
+  mPopupLayout.SetResizePolicy( USE_NATURAL_SIZE, dimension );
+  if( dimension & HEIGHT )
+  {
+    mPopupLayout.SetFitHeight( 1 );
+  }
+}
+else
+{
+  mPopupLayout.SetResizePolicy( FILL_TO_PARENT, dimension );
+  // Make the content cell fill the whole of the available space
+  if( dimension & HEIGHT )
+  {
+    mPopupLayout.SetRelativeHeight( 1, 1.0f );
+  }
+}
+@endcode
+Popup also implements the following methods for use with the relevant resize policies:
+- GetNaturalSize
+- GetHeightForWidth
+- GetWidthForHeight
+
+<h2 class="pg">Size Negotiation API</h2>
+
+<h3>Base Class Methods</h3>
+
+The base class methods are used to call functionality held in Actor and are defined in CustomActorImpl.
+
+There is a RelayoutRequest method defined. This method is available for deriving controls to call when they would like themselves to be relaid out.
+@code void RelayoutRequest() @endcode
+
+<h3>Overridable Methods</h3>
+These overridable methods in control provide customization points for the size negotiation algorithm.
+
+<h4>Responding to the Change of Size on a Control</h4>
+
+OnRelayout is called during the relayout process at the end of the frame immediately after the new size has been set on the actor. If the actor has calculated
+the size of child actors then add them to container with their desired size and set the USE_ASSIGNED_SIZE resize policy on them.
+At this point the size of the actor has been calculated so it is a good place to calculate positions of child actors etc.
+@code virtual void OnRelayout( const Vector2& size, RelayoutContainer& container ) @endcode
+
+The OnRelayoutSignal signal is raised after SetSize and OnRelayout have been called during the relayout processing at the end of the frame. If the control is deriving
+from Control then the OnRelayout virtual is preferred over this signal. The signal is provided for instance when custom code needs to be run on the
+children of an actor that is not a control.
+@code OnRelayoutSignalType& OnRelayoutSignal() @endcode
+
+The OnCalculateRelayoutSize is called right before the size is calculated for an actor's dimension during the size negotiation phase. At this point all other actors this actor is
+dependent on have been negotiated so calculations depending on these actors can be performed before the size for this actor is calculated. Useful for container size calculations.
+@code virtual void OnCalculateRelayoutSize( Dimension dimension ) @endcode
+
+OnLayoutNegotiated is called right after the size in a given dimension has been negotiated for an actor. This allows calculations to be performed in response to the change
+in a given dimension but before OnRelayout is called.
+@code virtual void OnLayoutNegotiated( float size, Dimension dimension ) @endcode
+
+<h4>Calculating Sizes</h4>
+
+Calculate the natural size for this control. This will be called when a control's resize policy is set to USE_NATURAL_SIZE.
+For example, TableView will calculated the size of the table given its various cell properties.
+@code virtual Vector3 GetNaturalSize() @endcode
+
+Given an input width return the correct height for this control. This will be called when the resize policy is set to DIMENSION_DEPENDENCY and
+height has a dependency on width.
+@code virtual float GetHeightForWidth( float width ) @endcode
+
+Given the input height return the correct width for this control. This will be called when the resize policy is set to DIMENSION_DEPENDENCY and
+width has a dependency on height.
+@code virtual float GetWidthForHeight( float height ) @endcode
+
+<h4>Relayout Dependencies</h4>
+
+Return true from this method if this control is dependent on any of its children to calculate its own size. All relayout containers that can be dependent on their
+children for their own size need to return true from this.
+@code virtual bool RelayoutDependentOnChildren( Dimension dimension = ALL_DIMENSIONS ) @endcode
+
+This will be called by children when they are using the FILL_TO_PARENT resize policy. It is the parent's responsibility to calculate the child's correct size.
+@code virtual float CalculateChildSize( const Dali::Actor& child, Dimension dimension ) @endcode
+
+<h4>Events</h4>
+
+OnSetResizePolicy is called when the resize policy is set on an actor. Allows deriving actors to respond to changes in resize policy.
+@code virtual void OnSetResizePolicy( ResizePolicy policy, Dimension dimension ) @endcode
+
+<h2 class="pg">Creating a Control: TableView</h2>
+
+This section demonstrates how size negotiation may be used when creating a table view.
+
+First we define some policies for how table row and columns may resize. These are:
+- Fixed: Use a fixed size
+- Relative: Use a ratio size of empty remaining space
+- Fill: Fill up to all remaining space, distributing evenly between all "fill" row or columns
+
+A data structure is defined to hold information for each row and column regarding their cell size policy and their assigned and calculated sizes.
+
+We need to be able to calculate the fixed sizes of all actors placed into table cells. The place to do this is in OnCalculateRelayoutSize. When
+this is called every actor the table view is dependent on has already had their sizes calculated. Calculations can be made that the main calculation
+for the actor can then use.
+@code
+void TableView::OnCalculateRelayoutSize( Dimension dimension )
+...
+CalculateRowColumnData();
+
+if( dimension & WIDTH )
+{
+  CalculateFixedSizes( mColumnData, WIDTH );
+  mFixedTotals.width = CalculateTotalFixedSize( mColumnData );
+}
+
+if( dimension & HEIGHT )
+{
+  CalculateFixedSizes( mRowData, HEIGHT );
+  mFixedTotals.height = CalculateTotalFixedSize( mRowData );
+}
+...
+@endcode
+
+An important override is GetNaturalSize. This will simply return the total sum of the fixed cells for each row and column.
+@code
+Vector3 TableView::GetNaturalSize()
+...
+return Vector3( mFixedTotals.width, mFixedTotals.height, 1.0f );
+...
+@endcode
+
+When the time comes to calculate the size of each child in the table cells the following method will be called.
+@code
+float TableView::CalculateChildSize( const Actor& child, Dimension dimension )
+...
+// Use cell data to calculate child size
+@endcode
+
+The table view is dependent on its children if its size policy is set to USE_NATURAL_SIZE or a row or column is set to "fit" an actor.
+The following code shows calling the base class RelayoutDependentOnChildren to check the resize policy and then searches for fit row or columns.
+@code
+bool TableView::RelayoutDependentOnChildren( Dimension dimension )
+{
+  if ( Control::RelayoutDependentOnChildren( dimension ) )
+  {
+    return true;
+  }
+
+  return FindFit( mRowData ) || FindFit( mColumnData );
+}
+@endcode
+
+With the cell sizes already calculated, the job of OnRelayout is to position all the actors in the table view in their respective positions.
+@code
+void TableView::OnRelayout( const Vector2& size, RelayoutContainer& container )
+...
+// Find each actor and position it, taking padding into account
+@endcode
+
+*
+*/
index d53bc39..c8bcb89 100644 (file)
  *
 <h2 class="pg">Overview</h2>
 
-Size negotiation provides the ability for controls to be resized without the application having to set a size.
-A parent control can resize itself according to its children. Each control can provide hints to using policies for the width and height.
-Controls will be relaid just once and only when requested to, rather than relaid out several times when different properties are set.
-Using size negotiation avoids the need for using size constraints to resize children, which would need to be calculated in the update
-thread every time even minor changes occur.
-
-This topic covers size policies, deriving from ControlImpl, size policy examples and the size negotiation algorithm.
-
-<h2 class="pg">Size Policies</h2>
-
-Each control has a policy for both width and height:
-- <b>Fixed:</b> The size is fixed to the size set by the application. If no size is set, then the size is fixed to the <i>natural</i> size of the control.
-- <b>Mininum:</b> The size can grow and shrink but cannot be smaller than the <i>minimum</i> size specified.
-- <b>Maximum:</b> The size can grow and shrink but cannot be larger than the <i>maximum</i> size specified.
-- <b>Range:</b> The size can grow or shrink but within the <i>minimum</i> and <i>maximum</i> sizes specified.
-- <b>Flexible:</b> The size of the control can grow or shrink as required without any limits.
-
-Currently, by default, controls use a fixed size policy for width and height. If one dimension is set, and the other dimension is set to zero, then the latter
-dimension is assumed to have a non fixed policy.
-
-<h2 class="pg">Deriving from ControlImpl</h2>
-
-The size negotiation utilises several methods to work out the best size of a control. The default behaviour is in the ControlImpl class.
-The following methods can be overridden.
-@code Vector3 GetNaturalSize() @endcode
-This method should return the natural size of the control. This can be dependent on the control's children or the control may decide to have a fixed size.
-
-@code float GetHeightForWidth( float width ) @endcode
-This method should return the height it needs to be when given a certain width.
-
-@code float GetWidthForHeight( float height ) @endcode
-This method should return the width it needs to be when given a certain height.
-
-All these methods can be overridden by deriving classes. This allows each control to dictate what size it would like to be. If you want the default behaviour,
-then you do not have to override these methods. A parent control can call the child's methods to determine its size if it needs to.
-
-<h2 class="pg">Size Policies and Virtual Methods</h2>
-
-The table below shows the methods that are called when certain width and height policies are in place.
-
-<table>
-  <tr>
-    <td></td>
-    <td><b>Fixed Height</b></td>
-    <td><b>Height Not Fixed (All other policies)</b></td>
-  </tr>
-  <tr>
-    <td><b>Fixed Width</b></td>
-    <td>
-    - Use size set by application
-    - If only height set by application
-      - Use height set by application
-      - Use <b>GetWidthForHeight()</b> for width
-    - If only width set by application
-      - Use width set by application
-      - Use <b>GetHeightForWidth()</b> for height
-    - If not set, then get size by calling <b>GetNaturalSize()</b>
-    </td>
-    <td>
-    - Use width set by application
-    - Use allocated width if not set
-      - Ensure it satisfies our width policy
-      - Adjust if required
-    - Use <b>GetHeightForWidth()</b> for height
-    - Ensure height satisfies our height policy
-      - Adjust if required
-    </td>
-  </tr>
-  <tr>
-    <td><b>Width Not Fixed (All other policies)</b></td>
-    <td>
-    - Use height set by application
-    - Use allocated height if not set
-      - Ensure it satisfies our height policy
-      - Adjust if required
-    - Use <b>GetWidthForHeight()</b> for width
-    - Ensure width satisfies our width policy
-      - Adjust if required
-    </td>
-    <td>
-    - Constrain the allocated width and height according to the two policies
-    </td>
-  </tr>
-</table>
-
-<h2 class="pg">Size Policy Examples</h2>
-
-<h3 class="pg">Policy: Fixed Width and Height (1)</h3>
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html FixedWidthHeight.png
-</td>
-<td>
-The application/control has set the following settings:
-- <b>SetSize:</b> 200 x 300
-- <b>Natural Size:</b> 400 x 400
-- <b>Width To Height Ratio:</b> 1 to 1
-- <b>Width Policy:</b> Fixed
-- <b>Height Policy:</b> Fixed
-- <b>ParentOrigin:</b> TopLeft
-- <b>AnchorPoint:</b> TopLeft
-
-Control methods called:
-- None
-
-Result
-- <b>Allocated size:</b> 200 x 300
-</td>
-</tr></table>
-
-<h3 class="pg">Policy: Fixed Width and Height (2)</h3>
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html FixedWidthHeight2.png
-</td>
-<td>
-The application/control has set the following settings:
-- <b>SetSize:</b> 0 x 0 (No size set)
-- <b>Natural Size:</b> 400 x 400
-- <b>Width To Height Ratio:</b> 1 to 1
-- <b>Width Policy:</b> Fixed
-- <b>Height Policy:</b> Fixed
-- <b>ParentOrigin:</b> TopLeft
-- <b>AnchorPoint:</b> TopLeft
-
-Control methods called:
-- GetNaturalSize() = 400 x 400
-
-Result
-- <b>Allocated size:</b> 400 x 400
-</td>
-</tr></table>
-
-<h3 class="pg">Policy: Flexible Width and Height</h3>
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html FlexibleWidthHeight.png
-</td>
-<td>
-The application/control has set the following settings:
-- <b>SetSize:</b> 200 x 300
-- <b>Natural Size:</b> 400 x 400
-- <b>Width To Height Ratio:</b> 1 to 1
-- <b>Width Policy:</b> Flexible
-- <b>Height Policy:</b> Flexible
-- <b>ParentOrigin:</b> TopLeft
-- <b>AnchorPoint:</b> TopLeft
-
-Control methods called:
-- None
-
-Result
-- <b>Allocated size:</b> 480 x 800  (Assume stage size 480 x 800)
-</td>
-</tr></table>
-
-<h3 class="pg">Policy: Fixed Width and Flexible Height (1)</h3>
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html FixedWidthFlexibleHeight.png
-</td>
-<td>
-The application/control has set the following settings:
-- <b>SetSize:</b> 200 x 300
-- <b>Natural Size:</b> 400 x 400
-- <b>Width To Height Ratio:</b> 1 to 1
-- <b>Width Policy:</b> Fixed
-- <b>Height Policy:</b> Flexible
-- <b>ParentOrigin:</b> TopLeft
-- <b>AnchorPoint:</b> TopLeft
-
-Control methods called:
-- GetHeightForWidth( 200 ) = 200
-
-Result
-- <b>Allocated size:</b> 200 x 200
-</td>
-</tr></table>
-
-<h3 class="pg">Policy: Fixed Width and Flexible Height (2)</h3>
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html FixedWidthFlexibleHeight.png
-</td>
-<td>
-The application/control has set the following settings:
-- <b>SetSize:</b> 200 x 0 (No height set)
-- <b>Natural Size:</b> 400 x 400
-- <b>Width To Height Ratio:</b> 1 to 1
-- <b>Width Policy:</b> Fixed
-- <b>Height Policy:</b> Flexible
-- <b>ParentOrigin:</b> TopLeft
-- <b>AnchorPoint:</b> TopLeft
-
-Control methods called:
-- GetHeightForWidth( 200 ) = 200
-
-Result
-- <b>Allocated size:</b> 200 x 200
-</td>
-</tr></table>
-
-<h3 class="pg">Policy: Fixed Width and Flexible Height (3)</h3>
-
-If the control did not have the GetHeightForWidth() method, then the <i>size set</i> is used to calculate the ratio.
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html FixedWidthFlexibleHeight2.png
-</td>
-<td>
-The application/control has set the following settings:
-- <b>SetSize:</b> 200 x 0 (No height set)
-- <b>Natural Size:</b> 400 x 400
-- <b>Width To Height Ratio:</b> Not set
-- <b>Width Policy:</b> Fixed
-- <b>Height Policy:</b> Flexible
-- <b>ParentOrigin:</b> TopLeft
-- <b>AnchorPoint:</b> TopLeft
-
-Control methods called:
-- GetHeightForWidth( 200 ) = 200  <i>(Unable to calculate ratio using size set)</i>
-
-Result
-- <b>Allocated size:</b> 200 x 800  <i>(Allocate entire height)</i>
-</td>
-</tr></table>
-
-<h3 class="pg">Policy: Fixed Width and Flexible Height (4)</h3>
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html FlexibleWidthHeight.png
-</td>
-<td>
-The application/control has set the following settings:
-- <b>SetSize:</b> 0 x 0 (No size set)
-- <b>Natural Size:</b> 400 x 400
-- <b>Width To Height Ratio:</b> 1 to 1
-- <b>Width Policy:</b> Fixed
-- <b>Height Policy:</b> Flexible
-- <b>ParentOrigin:</b> TopLeft
-- <b>AnchorPoint:</b> TopLeft
-
-Control methods called:
-- GetHeightForWidth( 0 ) = 0
-
-Result
-- <b>Allocated size:</b> 480 x 800  <i>(Allocate entire size)</i>
-</td>
-</tr></table>
-
-<h3 class="pg">Policy: Flexible Width and Fixed Height (1)</h3>
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html FlexibleWidthFixedHeight.png
-</td>
-<td>
-The application/control has set the following settings:
-- <b>SetSize:</b> 0 x 300 (No width set)
-- <b>Natural Size:</b> 400 x 400
-- <b>Width To Height Ratio:</b> 1 to 1
-- <b>Width Policy:</b> Flexible
-- <b>Height Policy:</b> Fixed
-- <b>ParentOrigin:</b> TopLeft
-- <b>AnchorPoint:</b> TopLeft
-
-Control methods called:
-- GetWidthForHeight( 300 ) = 300
-
-Result
-- <b>Allocated size:</b> 300 x 300
-</td>
-</tr></table>
-
-<h3 class="pg">Policy: Flexible Width and Fixed Height (2)</h3>
-
-If the control did not have the GetWidthForHeight() method, then the <i>size set</i> is used to calculate the ratio.
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html FlexibleWidthFixedHeight2.png
-</td>
-<td>
-The application/control has set the following settings:
-- <b>SetSize:</b> 0 x 300 (No width set)
-- <b>Natural Size:</b> 400 x 400
-- <b>Width To Height Ratio:</b> Not set
-- <b>Width Policy:</b> Flexible
-- <b>Height Policy:</b> Fixed
-- <b>ParentOrigin:</b> TopLeft
-- <b>AnchorPoint:</b> TopLeft
-
-Control methods called:
-- GetWidthForHeight( 300 ) = 0  <i>(Unable to calculate ratio using size set)</i>
-
-Result
-- <b>Allocated size:</b> 480 x 300  <i>(Allocate entire width)</i>
-</td>
-</tr></table>
-
-<h2 class="pg">The Size Negotiation Algorithm</h2>
-
-<h3 class="pg">The Algorithm</h3>
-
--# The algorithm starts at the stage
-  - All top level controls are found and offered the size of the stage
-  - The control negotiates the size offered by using the policy rules to determine the size that it should be allocated
-  - The control is then set to that allocated size
--# The control is responsible for setting the sizes of all its children
-  - Can set a size on an Actor
-  - Or can call relayout on a Control directly
--# Children that a control does not handle, the control can add to a container so that the top-level algorithm delas with it instead
-  - The control should call Relayout with the child and size of itself as parameters
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html Algorithm1.png
-</td>
-<td>
-\image html Algorithm2.png
-</td>
-</tr></table>
-
-<h3 class="pg">A closer look at Control A</h3>
-
-Taking a closer look at Control A we see in this example that children should share the width equally and that the height of Control A
-is the maximum height of the children.
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html Algorithm3.png
-</td>
-<td>
-<table border=0 cellpadding=10><tr>
-<td>
-\image html Algorithm4.png
-</td>
-</tr></table>
-</td>
-</tr></table>
+Size negotiation, also known as layout management, is responsible for allocating sizes to all actors on the stage based on rules of dependency between
+the actors. Requests for relayout on actors are collected during the frame with the actual relayout performed at the end of the frame.
 
+This document details how to use the size negotiation API and is intended for application writters.
+
+The topics covered are:
+- Dimensions
+- Resize policies
+- Actor
+- Debugging
+
+<h2 class="pg">Dimensions</h2>
+
+The notion of width and height is generalised into the concept of a Dimension. Several methods take a Dimension parameter.
+
+The Dimension enum specifies the available dimensions as bitfields:
+- WIDTH
+- HEIGHT
+
+If a method can process width and height at the same time then the ALL_DIMENSIONS mask can be specified.
+
+<h2 class="pg">Resize Policies</h2>
+
+<h3>Policies</h3>
+The ResizePolicy enum specifies a range of options for controlling the way actors resize. These are powerful rules that enable much automatic
+resizing behaviour. They are as following:
+
+- FIXED: This is the option to use when you want the specific definite size as set by SetSize (This is the default for all actors)
+- USE_NATURAL_SIZE: Use this option for objects such as images or text to get their natural size e.g. The dimensions of the image, or the size of the text without wrapping. Also use this on TableViews when the size of the table is dependent on its children.
+- FILL_TO_PARENT: Size will fill up to the size of its parent's size, taking a size factor into account to allow proportionate filling
+- SIZE_RELATIVE_TO_PARENT: Fill up the parent with a relative scale. Use SetSizeModeFactor to specify the ratio to fill up to the parent.
+- SIZE_FIXED_OFFSET_FROM_PARENT: Fill up the parent and add a fixed offset using SetSizeModeFactor.
+- FIT_TO_CHILDREN: Size will scale around the size of the actor's children. E.g. A popup's height may resize itself around it's contents.
+- DIMENSION_DEPENDENCY: This covers rules such as width-for-height and height-for-width. You specify that one dimension depends on another.
+
+\image html size-negotiation/ResizePolicies.png
+
+<h2 class="pg">Actor</h2>
+
+This section details how an actor may be used with size negotiation.
+
+<h3>Enabling Size Negotiation</h3>
+
+The first thing to do is to specify whether you want an actor to be included or excluded from the relayout process. The following method is used to enable or disable the relayout
+for an individual actor. Make sure this is the first thing that is called after the actor is created otherwise the actor may still be negotiated.
+@code void SetRelayoutEnabled( bool enabled ) @endcode
+Text and image actors have relayout enabled by default, while a plain Actor is disabled. Be aware that if desiring to use an Actor in relayout
+then relayout needs to be explicitly enabled first.
+
+<h3>Specifying Size Policies</h3>
+
+Actors have different size policies by default. For example ImageActor is set to USE_NATURAL_SIZE. This ensures that when an image actor is
+placed on the stage it will use its natural size by default. However if the user calls SetSize with non-zero sizes on the image actor then the current
+size policy is overridden by the FIXED size policy and the actor will take on the size specified.
+
+The next step is to specify how an actor will be size negotiated. The resize policies for an actor may be specified by the following method:
+@code void SetResizePolicy( ResizePolicy policy, Dimension dimension ) @endcode
+It is common to specifiy different policies for the different dimensions of width and height to achive different layouts. Different actors have
+different resize policies specified by default. For example ImageActors are set to use USE_NATURAL_SIZE.
+
+The following example code snippet shows rootActor having its width policy set to FILL_TO_PARENT and its height policy set to FIT_TO_CHILDREN.
+It has an ImageActor added to it with an explicit call to USE_NATURAL_SIZE in both dimensions called on it. This will make an actor that will
+fill up the space of its parent in the width dimension and fit to its child in the height dimension. As the image actor child is using natural size
+the height of the root actor will fit to the height of the child image.
+
+@code
+Actor rootActor = Actor::New();
+rootActor.SetRelayoutEnabled( true );
+rootActor.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+rootActor.SetResizePolicy( FIT_TO_CHILDREN, HEIGHT );
+ImageActor image = ImageActor::New( Image::New( MY_IMAGE_PATH ) );
+image.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
+rootActor.Add( image );
+@endcode
+
+The following images show the before and after layouts for this code example.
+
+Before:
+\image html size-negotiation/SizeNegotiationExample_Before.png
+After:
+\image html size-negotiation/SizeNegotiationExample_After.png
+
+This example shows an actor rootActor set to expand to its parent's width and contract/expand around its child's height. The child image actor
+is set to natural size which means it will display at the acutal size of the image.
+
+To specify that a dimension has a dependency on another dimension use DIMENSION_DEPENDENCY. For example if dimension is HEIGHT and dependency is
+WIDTH then there is a height-for-width dependency in effect. The classic use case for this
+is a text view that wraps its text. The following example snippet shows a text view that expands its width to the size of its parent, wraps its
+contents and then determines its height based on the width.
 @code
-class ControlA : public Control
-{
-  ...
-private:
-  // Data
-  Actor mActorC; // Container to store children
-  TextView mControlD; // Some text we want to display
-  ImageActor mActorD; // An image
-};
+TextView text = TextView::New( "Example" );
+text.SetMultilinePolicy( SplitByWord );
+text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
 @endcode
 
+<h3>Specifying Sizes and Size Limits</h3>
+
+When wanting a specific fixed size for an actor then specify the resize policy to be FIXED and set the desired, or preferred size using SetSize.
+If only one dimension is FIXED then the other value in the size parameter will be ignored, so it is safe to set it to zero.
+
+To constrain the final negotiated size of an actor, set the following for minimum and maximum sizes respectively.
 @code
-Vector3 ControlA::GetNaturalSize()
-{
-  // Width is total of ControlD and ActorD
-  // Height is max of ControlD and ActorD
-  // Don't care about the Depth
-  Vector3 naturalSize;  // Initialised to (0.0f, 0.0f, 0.0f)
-
-  if ( mControlD )
-  {
-    // We know ControlD is a control, so just ask its natural size
-    naturalSize = mControlD.GetNaturalSize();
-  }
-
-  if ( mActorD )
-  {
-    // We know ActorD is an ImageActor, we can get the image's natural size
-    Image image = mActorD.GetImage();
-    naturalSize.width += image.GetWidth;
-    naturalSize.height = std::max( naturalSize.height, image.GetHeight() );
-  }
-
-  return naturalSize;
-}
+void SetMinimumSize( const Vector2& size )
+void SetMaximumSize( const Vector2& size )
 @endcode
 
-GetHeightForWidth() and GetWidthForHeight() can be created in a similar manner.
+<h3>Altering Negotiated Size</h3>
+
+When an actor is required to maintain the aspect ratio of its natural size the following method can be used. This is useful for size negotiating images
+to ensure they maintain their aspect ratio while still fitting within the bounds they have been allocated. This can be one of USE_SIZE_SET, FIT_WITH_ASPECT_RATIO
+or FILL_WITH_ASPECT_RATIO. The first is the default. The second will fit the actor within the bounds it has been allocated while maintaining aspect ratio. The
+third will fill all available space, potentially overflowing its bounds, while maintaining apsect ratio.
+@code void SetSizeScalePolicy( SizeScalePolicy policy ) @endcode
+
+<h3>Using Actors in Containers</h3>
+
+When laying out actors in containers such as TableView it is useful to be able to specify padding that surrounds the actor. E.g. You may
+want some white space around an image actor placed in a table cell. The padding specifies the left, right, bottom and top padding values.
+@code void SetPadding( const Padding& padding ) @endcode
+
+<h2 class="pg">An Example</h2>
 
+This section shows a more complex example of how to configure size negotiation. It creates a popup and adds a table view to it with a text view,
+an image and a sub-table. The sub-table contains a checkbox and another text view.
 @code
-void ControlA::OnRelayout( const Vector2& size, ActorSizeContainer& container )
-{
-  // Width to be shared between ControlD and ActorD
-  Vector2 childSize( size.width * 0.5f, size.height );
-
-  if ( mActorC )
-  {
-    // ActorC is the same size as ControlA
-    mActorC.SetSize( size );
-  }
-
-  if ( mControlD )
-  {
-    Relayout( mControlD, childSize );
-    // Can add more complex calculations to preserve aspect ratio etc.
-  }
-
-  if ( mActorD )
-  {
-    mActorD.SetSize( childSize );
-    // Can add more complex calculations to preserve aspect ratio etc.
-  }
-}
+mPopup = CreatePopup();
+mPopup.SetTitle( "Warning" );
+
+// Content
+Toolkit::TableView content = Toolkit::TableView::New( 2, 2 );
+content.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+content.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+content.SetFitHeight( 0 );
+content.SetFitHeight( 1 );
+content.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
+
+// Text
+Toolkit::TextView text = Toolkit::TextView::New();
+text.SetText( "Do you really want to quit?" );
+text.SetMultilinePolicy( Toolkit::TextView::SplitByWord );
+text.SetWidthExceedPolicy( Toolkit::TextView::Split );
+text.SetLineJustification( Toolkit::TextView::Left );
+text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
+
+content.AddChild( text, Toolkit::TableView::CellPosition( 0, 0 ) );
+
+// Image
+ImageActor image = ImageActor::New( ResourceImage::New( IMAGE1 ) );
+image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+image.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
+image.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
+content.AddChild( image, Toolkit::TableView::CellPosition( 0, 1 ) );
+
+// Checkbox and text
+Toolkit::TableView root = Toolkit::TableView::New( 1, 2 );
+root.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+root.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+root.SetFitHeight( 0 );
+root.SetFitWidth( 0 );
+root.SetPadding( Padding( 0.0f, 0.0f, 0.0f, 20.0f ) );
+
+Dali::Image unchecked = Dali::ResourceImage::New( CHECKBOX_UNCHECKED_IMAGE );
+Dali::Image checked = Dali::ResourceImage::New( CHECKBOX_CHECKED_IMAGE );
+Toolkit::CheckBoxButton checkBox = Toolkit::CheckBoxButton::New();
+checkBox.SetBackgroundImage( unchecked );
+checkBox.SetSelectedImage( checked );
+checkBox.SetSize( Vector2( 48, 48 ) );
+
+root.AddChild( checkBox, Toolkit::TableView::CellPosition( 0, 0 ) );
+
+Toolkit::TextView text2 = Toolkit::TextView::New();
+text2.SetText( "Don't show again" );
+text2.SetLineJustification( Toolkit::TextView::Left );
+text2.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 10.0f ) );
+
+root.AddChild( text2, Toolkit::TableView::CellPosition( 0, 1 ) );
+
+content.AddChild( root, Toolkit::TableView::CellPosition( 1, 0, 0, 2 ) );  // Column span 2
+
+mPopup.Add( content );
 @endcode
 
-The allocated layout is as follows.
-<table border=0 cellpadding=10><tr>
-<td>
-\image html Algorithm8.png
-</td>
-</tr></table>
-
-<h3 class="pg">A closer look at Control B</h3>
-
-In this example we have the following requirements:
-- Control B creates a small border around its children
-- Control B just allocates whatever its given to its children (minus the border)
-- Actor E is a simple container actor and contains one control (Control E)
-- Control B is not aware of the actors it contains
-
-<table border=0 cellpadding=10><tr>
-<td>
-\image html Algorithm9.png
-</td>
-<td>
-\image html Algorithm10.png
-</td>
-</tr></table>
+The resulting popup with additional buttons added is shown below.
+\image html size-negotiation/Popup.png
 
+The key things to pick out from this example are the use of the size negotiation API.
+The content table view is set to FILL_TO_PARENT for its width and USE_NATURAL_SIZE for its height. This will result
+in the table view expanding its width to fit the available space in the popup while also expanding/contracting its
+height based on the size of the contents in its cells.
+@code
+content.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+content.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+@endcode
+To add a little space around the left, right and bottom of the table view, some padding is added.
+@code
+content.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
+@endcode
+The first text view has its width set to FILL_TO_PARENT and its height has a dimension dependency on its width. This
+will result in a text view that fills up its width to available space in the table cell and then then calculates its
+height based on its new width. The table view will then fit its height taking the height of the text view into account.
+@code
+text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+text.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
+@endcode
+The image view performs a similar relayout. It fits its width to the size of the cell and calculates its height based on the new
+width. Some padding is added to the left of it as well to center it more.
 @code
-void ControlA::OnRelayout( const Vector2& size, ActorSizeContainer& container )
-{
-  // Width of children is our size minus border
-  Vector3 childSize( size.width - mBorder.width * 2.0f,
-                     size.height - mBorder.height * 2.0f );
-
-  // Our children should be set to the childSize
-  ActorContainer children( Self().GetChildren() );
-  for ( ActorIter iter = children.begin(), endIter = children.end();
-        iter != endIter;
-        ++iter )
-  {
-    Relayout( *iter, childSize, container );
-  }
-}
+image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+image.SetResizePolicy( DIMENSION_DEPENDENCY, HEIGHT );
+image.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 0.0f ) );
 @endcode
+The sub table view is similar as well in that it expands its width to the size of its cell. When it is added to the table view it
+will span two columns. Its height is set to natural size so that it will grow or shrink based on its children cells. Note that for
+a container like table view, USE_NATURAL_SIZE acts in a similar manner to FIT_TO_CHILDREN in that the size of the container could
+grow or shrink based on the sizes of the child actors.
+@code
+root.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+root.SetResizePolicy( USE_NATURAL_SIZE, HEIGHT );
+@endcode
+The checkbox is set to have a fixed size.
+@code
+checkBox.SetResizePolicy( FIXED, ALL_DIMENSIONS );
+@endcode
+The second text view has not specified a resize policy so will use its default of USE_NATURAL_SIZE.
+
+<h2 class="pg">Debugging</h2>
+
+When constructing large scenes using interacting resize policies it is useful to be able to debug the relayout process. The following sections
+describe a pitfall to avoid when creating scenes and a way to print debug output about the actors.
+
+<h3>Infinite Dependency Loops</h3>
+Despite the power of the resize rules there is one pitfall to be aware of: infinite dependency loops. The most simplest form of this is
+shown by a parent actor with resize policy set to FIT_TO_CHILDREN with a child that has a resize policy of FILL_TO_PARENT. Who should
+determine the size in this case? A more complex loop occurs when DIMENSION_DEPENDENCY comes into play. Say a parent has a width policy
+of DIMENSION_DEPENDENCY with height and a height policy of FIT_TO_CHILDREN. The parent has a single child with a height policy DIMENSION_DEPENDENCY
+with width. If the child's width policy is FILL_TO_PARENT then a loop will occur. These are two simple examples but the loops could occur
+over larger spreads of parent child relationships. These loops are detected by the relayout algorithm with the result being that actors will
+receive zero sizes. These loops are not common but are still something to watch out for.
+
+<h3 class="pg">Inspecting Actor Relayout Properties</h3>
+To get a print out of the stage hierarchy before and after negotiation, with a list of actors that were negotiated set the LOG_RELAYOUT_CONTROLLER environment variable to 3,true.
+
+E.g. On desktop run:
+
+$  LOG_RELAYOUT_CONTROLLER=3,true dali-demo
+
+Example output from the logging is as follows:
+
+PushButton, OKAY_BUTTON - Pos: [185, 0, 0.1] Size: [165, 76, 76], Dirty: (FALSE,FALSE), Negotiated: (TRUE,TRUE), Enabled: TRUE, (0x1649850)
 
-The Relayout method will add ControlB's children to the size negotiation algorithm container where the child's size will be negotiated. Control E's
-size will be negotiated with the childSize as the allocation.
+The format is as follows:
 
+[Actor type], [Actor name] – Pos:[X, Y, Z] Size[WIDTH, HEIGHT, DEPTH], Dirty:(WIDTH, HEIGHT), Negotiated: (WIDTH, HEIGHT), Enabled: BOOLEAN, (Object address)
+- <i>Actor type</i>: The type name of the actor E.g. PushButton
+- <i>Actor name</i>: The name set on the actor with SetName(). Useful for debugging.
+- <i>Pos</i>: The position of the actor
+- <i>Size</i>: The current size of the actor. Check this to see if the actor has been negotiated correctly.
+- <i>Dirty</i>: Booleans to say if the width or height has been marked as dirty by the relayout dirty flag propagation algorithm
+- <i>Negotiated</i>: Booleans to say if the width or height has been negotiated by the size negotiation algorithm
+- <i>Enabled</i>: Boolean to say if the actor is enabled for size negotitation
+- <i>Object address</i>: The address of the actor object in memory
 *
 */
index 6661aeb..e38d022 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.0.35
+Version:    1.0.36
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 13300ef..d87322f 100644 (file)
@@ -23,6 +23,7 @@ script_v8_plugin_src_files = \
    $(v8_plugin_dir)/animation/animation-api.cpp \
    $(v8_plugin_dir)/animation/animation-wrapper.cpp \
    $(v8_plugin_dir)/animation/path-api.cpp \
+   $(v8_plugin_dir)/animation/path-constraint-wrapper.cpp \
    $(v8_plugin_dir)/animation/path-wrapper.cpp \
    $(v8_plugin_dir)/stage/stage-wrapper.cpp \
    $(v8_plugin_dir)/events/event-object-generator.cpp \
index d068554..7237547 100644 (file)
@@ -24,6 +24,7 @@
 // INTERNAL INCLUDES
 #include <v8-utils.h>
 #include <actors/actor-wrapper.h>
+#include <animation/path-constraint-wrapper.h>
 
 namespace Dali
 {
@@ -609,6 +610,111 @@ void ActorApi::ScaleBy( const v8::FunctionCallbackInfo<v8::Value>& args )
   actor.ScaleBy( vector );
 }
 
+void ActorApi::ApplyPathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args )
+{
+  v8::Isolate* isolate = args.GetIsolate();
+  v8::HandleScope handleScope( isolate );
+
+  //Get target actor
+  Actor targetActor = GetActor( isolate, args );
+
+  //Get PathConstraint
+  bool found(false);
+  Handle pathConstraintHandle =  V8Utils::GetHandleParameter(PARAMETER_0, found, isolate, args );
+  if( !found )
+  {
+    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 0 (PathConstraint)" );
+    return;
+  }
+  PathConstraint pathConstraint = PathConstraint::DownCast(pathConstraintHandle);
+
+  //Get target property
+  std::string propertyName = V8Utils::GetStringParameter( PARAMETER_1, found, isolate, args );
+  if(!found)
+  {
+    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 1 (Property name)" );
+    return;
+  }
+
+  // try both properties with dashes and without
+  Property::Index targetPropertyIndex = targetActor.GetPropertyIndex( propertyName );
+  if( targetPropertyIndex == Property::INVALID_INDEX )
+  {
+    std::string convertedName = V8Utils::JavaScriptNameToPropertyName( propertyName );
+    targetPropertyIndex = targetActor.GetPropertyIndex( convertedName );
+
+    if( targetPropertyIndex == Property::INVALID_INDEX )
+    {
+      DALI_SCRIPT_EXCEPTION( isolate, "Property not found" );
+    }
+  }
+
+  //Get source actor
+  Actor sourceActor = V8Utils::GetActorParameter( PARAMETER_2, found, isolate, args );
+  if( !found )
+  {
+    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 2 (Actor)" );
+  }
+
+  // try both properties with dashes and without
+  propertyName = V8Utils::GetStringParameter( PARAMETER_3, found, isolate, args );
+  if(!found)
+  {
+    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 3 (Property name)" );
+    return;
+  }
+
+  Property::Index sourcePropertyIndex = sourceActor.GetPropertyIndex( propertyName );
+  if( sourcePropertyIndex == Property::INVALID_INDEX )
+  {
+    std::string convertedName = V8Utils::JavaScriptNameToPropertyName( propertyName );
+    sourcePropertyIndex = sourceActor.GetPropertyIndex( convertedName );
+
+    if( sourcePropertyIndex == Property::INVALID_INDEX )
+    {
+      DALI_SCRIPT_EXCEPTION( isolate, "Property not found" );
+      return;
+    }
+  }
+
+  //Check if forward vector is specified
+  Vector3 forward( 0.0f,0.0f,0.0f);
+  if( args.Length() > 4 )
+  {
+    forward =  V8Utils::GetVector3Parameter( PARAMETER_4, found, isolate, args );
+    if( !found )
+    {
+      DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 4 (Vector3)" );
+      return;
+    }
+  }
+
+  pathConstraint.Apply( Dali::Property(sourceActor,sourcePropertyIndex),
+                        Dali::Property(targetActor,targetPropertyIndex),
+                        forward );
+
+}
+
+void ActorApi::RemovePathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args )
+{
+  v8::Isolate* isolate = args.GetIsolate();
+  v8::HandleScope handleScope( isolate );
+
+  //Get target actor
+  Actor actor = GetActor( isolate, args );
+
+  //Get PathConstraint
+  bool found(false);
+  Handle pathConstraintHandle =  V8Utils::GetHandleParameter(PARAMETER_0, found, isolate, args );
+  if( !found )
+  {
+    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 0 (PathConstraint)" );
+    return;
+  }
+  PathConstraint pathConstraint = PathConstraint::DownCast(pathConstraintHandle);
+  pathConstraint.Remove(actor);
+}
+
 } // namespace V8Plugin
 
 } // namespace Dali
index 9d1bb16..b1dfd4b 100644 (file)
@@ -68,6 +68,12 @@ namespace ActorApi
   void RotateBy( const v8::FunctionCallbackInfo< v8::Value >& args );
   void ScaleBy( const v8::FunctionCallbackInfo< v8::Value >& args );
 
+  // new function just for JavaScript API, to apply a PathConstraint to an actor
+  void ApplyPathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args );
+
+  // new function just for JavaScript API, to remove a PathConstraint from an actor
+  void RemovePathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args );
+
   // new function just for JavaScript API, to help developers know what type of actor
   // they're dealing with, returns actor name as a string
   void GetActorType( const v8::FunctionCallbackInfo< v8::Value >& args );
index 6f2d6f0..7613178 100644 (file)
@@ -202,6 +202,8 @@ const ActorFunctions ActorFunctionTable[]=
     { "FindChildById",     ActorApi::FindChildById,    ACTOR_API },
     { "GetParent" ,        ActorApi::GetParent,        ACTOR_API },
     { "GetActorType" ,     ActorApi::GetActorType,     ACTOR_API }, // custom for javascript
+    { "ApplyPathConstraint",  ActorApi::ApplyPathConstraint,  ACTOR_API }, // custom for javascript
+    { "RemovePathConstraint", ActorApi::RemovePathConstraint, ACTOR_API }, // custom for javascript
 
     // ignore. SetParentOrigin() use Actor.parentOrigin
     // ignore. GetCurrentParentOrigin()  use Actor.parentOrigin
diff --git a/plugins/dali-script-v8/src/animation/path-constraint-wrapper.cpp b/plugins/dali-script-v8/src/animation/path-constraint-wrapper.cpp
new file mode 100644 (file)
index 0000000..72434d9
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2015 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 "path-constraint-wrapper.h"
+
+// INTERNAL INCLUDES
+#include <v8-utils.h>
+#include <dali-wrapper.h>
+#include <shared/object-template-helper.h>
+
+namespace Dali
+{
+
+namespace V8Plugin
+{
+
+PathConstraintWrapper::PathConstraintWrapper( PathConstraint pathConstraint, GarbageCollectorInterface& gc )
+:HandleWrapper( BaseWrappedObject::PATH_CONSTRAINT, pathConstraint, gc ),
+ mPathConstraint( pathConstraint )
+{
+}
+
+v8::Handle<v8::ObjectTemplate> PathConstraintWrapper::MakePathConstraintTemplate( v8::Isolate* isolate )
+{
+  v8::EscapableHandleScope handleScope( isolate );
+
+  v8::Local<v8::ObjectTemplate> objTemplate = v8::ObjectTemplate::New();
+  objTemplate->SetInternalFieldCount( BaseWrappedObject::FIELD_COUNT );
+
+  // property handle intercepts property getters and setters and signals
+  HandleWrapper::AddInterceptsToTemplate( isolate, objTemplate );
+
+  return handleScope.Escape( objTemplate );
+}
+
+v8::Handle<v8::Object> PathConstraintWrapper::WrapPathConstraint( v8::Isolate* isolate, PathConstraint pathConstraint )
+{
+  v8::EscapableHandleScope handleScope( isolate );
+  v8::Local<v8::ObjectTemplate> objectTemplate;
+
+  objectTemplate = MakePathConstraintTemplate( isolate );
+
+  // create an instance of the template
+  v8::Local<v8::Object> localObject = objectTemplate->NewInstance();
+
+  // create the pathconstraint object
+  PathConstraintWrapper* pointer = new PathConstraintWrapper( pathConstraint, Dali::V8Plugin::DaliWrapper::Get().GetDaliGarbageCollector() );
+
+  // assign the JavaScript object to the wrapper.
+  // This also stores Dali object, in an internal field inside the JavaScript object.
+  pointer->SetJavascriptObject( isolate, localObject );
+
+  return handleScope.Escape( localObject );
+}
+
+PathConstraint PathConstraintWrapper::GetPathConstraint()
+{
+  return mPathConstraint;
+}
+
+/**
+ * Create an initialized PathConstraint handle.
+ * @constructor
+ * @for Path
+ * @method Path
+ */
+void PathConstraintWrapper::NewPathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args)
+{
+  v8::Isolate* isolate = args.GetIsolate();
+  v8::HandleScope handleScope( isolate );
+
+  if( !args.IsConstructCall() )
+  {
+    DALI_SCRIPT_EXCEPTION( isolate, "constructor called without 'new" );
+    return;
+  }
+
+  //Extract Path Handle
+  bool parameterFound;
+  Handle pathHandle = V8Utils::GetHandleParameter( PARAMETER_0, parameterFound, isolate, args );
+  if( !parameterFound )
+  {
+    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 0 (Path)" );
+    return;
+  }
+  Dali::Path path = Path::DownCast(pathHandle);
+
+  //Extract range
+  Vector2 range = V8Utils::GetVector2Parameter( PARAMETER_1, parameterFound, isolate, args );
+  if( !parameterFound )
+  {
+    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 1 (Range)" );
+    return;
+  }
+
+  PathConstraint pathConstraint = PathConstraint::New(path, range );
+  v8::Local<v8::Object> localObject = WrapPathConstraint( isolate, pathConstraint );
+  args.GetReturnValue().Set( localObject );
+}
+
+
+} // namespace V8Plugin
+
+} // namespace Dali
diff --git a/plugins/dali-script-v8/src/animation/path-constraint-wrapper.h b/plugins/dali-script-v8/src/animation/path-constraint-wrapper.h
new file mode 100644 (file)
index 0000000..bbc4c92
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef __DALI_V8PLUGIN_PATH_CONSTRAINT_WRAPPER_H__
+#define __DALI_V8PLUGIN_PATH_CONSTRAINT_WRAPPER_H__
+
+/*
+ * Copyright (c) 2015 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.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <v8.h>
+#include <dali/public-api/animation/path-constraint.h>
+
+// INTERNAL INCLUDES
+#include <object/handle-wrapper.h>
+
+
+namespace Dali
+{
+
+namespace V8Plugin
+{
+
+/**
+ * Wraps a Path.
+ */
+class PathConstraintWrapper : public HandleWrapper
+{
+
+public:
+
+  /**
+   * Constructor
+   */
+  PathConstraintWrapper( PathConstraint pathConstraint, GarbageCollectorInterface& gc );
+
+  /**
+   * Virtual destructor
+   */
+  virtual ~PathConstraintWrapper(){};
+
+  /**
+   * Creates a new PathConstraint wrapped inside a Javascript Object.
+   * @param[in] args v8 function call arguments interpreted
+   */
+  static void NewPathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args);
+
+  /**
+   * Wraps a PathConstraint inside a Javascript object
+   */
+  static v8::Handle<v8::Object> WrapPathConstraint(v8::Isolate* isolate, PathConstraint pathConstraint );
+
+  /*
+   * Get the wrapped PathConstraint
+   */
+  PathConstraint GetPathConstraint();
+
+private:
+
+  /**
+   * Create a v8 object template for the PathConstraint
+   */
+  static v8::Handle<v8::ObjectTemplate> MakePathConstraintTemplate( v8::Isolate* isolate );
+
+  PathConstraint mPathConstraint;
+};
+
+} // namespace V8Plugin
+
+} // namespace Dali
+
+#endif // header
index e7c4c16..9815aa7 100644 (file)
@@ -201,11 +201,6 @@ const IntegerPair EnumTable[] =
     { "CULL_BACK_FACE",                                     CullBack  },
     { "CULL_FRONT_AND_BACK_FACE",                           CullFrontAndBack },
 
-    { "USE_OWN_SIZE",                                       USE_OWN_SIZE },
-    { "SIZE_EQUAL_TO_PARENT",                               SIZE_EQUAL_TO_PARENT },
-    { "SIZE_RELATIVE_TO_PARENT",                            SIZE_RELATIVE_TO_PARENT },
-    { "SIZE_FIXED_OFFSET_FROM_PARENT",                      SIZE_FIXED_OFFSET_FROM_PARENT },
-
     { "CAMERA_FREE_LOOK"             ,      Camera::FREE_LOOK                   },
     { "CAMERA_LOOK_AT_TARGET"        ,      Camera::LOOK_AT_TARGET              },
     { "CAMERA_PERSPECTIVE_PROJECTION" ,     Camera::PERSPECTIVE_PROJECTION      },
index 1bb2dfc..5bce721 100644 (file)
@@ -28,6 +28,7 @@
 #include <image/image-wrapper.h>
 #include <text/font-wrapper.h>
 #include <animation/path-wrapper.h>
+#include <animation/path-constraint-wrapper.h>
 #include <animation/animation-wrapper.h>
 #include <events/pan-gesture-detector-wrapper.h>
 #include <shader-effects/shader-effect-wrapper.h>
@@ -61,6 +62,7 @@ const ApiFunction ConstructorFunctionTable[]=
     { "Matrix",             PropertyValueWrapper::NewMatrix},
     { "Font",               FontWrapper::NewFont },
     { "Path",               PathWrapper::NewPath },
+    { "PathConstraint",     PathConstraintWrapper::NewPathConstraint },
     { "Actor",              ActorWrapper::NewActor },
     { "TextActor",          ActorWrapper::NewActor },
     { "ImageActor",         ActorWrapper::NewActor },
index 7e473cd..fee9d8c 100644 (file)
@@ -71,6 +71,7 @@ public:
       CONNECTION,
       ANIMATION,
       PATH,
+      PATH_CONSTRAINT,
       BUILDER,
       STAGE,
       FONT,
index e8933be..534c547 100644 (file)
@@ -46,6 +46,7 @@ enum
   PARAMETER_1 = 1,   ///< second parameter of a function call
   PARAMETER_2 = 2,   ///< third parameter of a function call
   PARAMETER_3 = 3,   ///< forth parameter of a function call
+  PARAMETER_4 = 4,   ///< fifth parameter of a function call
 };
 
 #define DALI_SCRIPT_EXCEPTION( isolate, message ) V8Utils::ScriptError( __FUNCTION__ , isolate, message );