Merge branch 'tizen' into devel/new_mesh 91/37591/3
authorDavid Steele <david.steele@partner.samsung.com>
Tue, 31 Mar 2015 14:44:46 +0000 (15:44 +0100)
committerDavid Steele <david.steele@partner.samsung.com>
Tue, 31 Mar 2015 16:03:32 +0000 (17:03 +0100)
Change-Id: I1df97f4ad515536413b587eb178a5645c31dbf3a

200 files changed:
automated-tests/README.md
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp
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/dali-toolkit-test-utils/test-platform-abstraction.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h
automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp
automated-tests/src/dali-toolkit/utc-Dali-Builder.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-CubeTransitionEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-NavigationLayout.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp
automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-RollLayout.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-Slider.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/configure.ac
build/tizen/docs-internal/dali_internal.doxy
build/tizen/docs/dali.doxy.in
build/tizen/plugins/Makefile.am
dali-toolkit/dali-toolkit.h
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-impl.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/bloom-view/bloom-view-impl.cpp
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-impl.cpp
dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/image-view/masked-image-view-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/navigation-frame/page-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
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-bar/scroll-bar-impl.h
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-connector-impl.cpp
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-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-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/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/slider/slider-impl.h
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-decorator-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/text-view/text-view-word-processor.cpp
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/filters/emboss-filter.cpp
dali-toolkit/internal/filters/spread-filter.cpp
dali-toolkit/internal/focus-manager/focus-manager-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.cpp
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/button.h
dali-toolkit/public-api/controls/cluster/cluster.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/image-view/masked-image-view.h
dali-toolkit/public-api/controls/magnifier/magnifier.h
dali-toolkit/public-api/controls/popup/popup.cpp
dali-toolkit/public-api/controls/popup/popup.h
dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h
dali-toolkit/public-api/controls/scrollable/item-view/item-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/navigation-layout.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/item-view/navigation-layout.h [deleted file]
dali-toolkit/public-api/controls/scrollable/item-view/roll-layout.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/item-view/roll-layout.h [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h
dali-toolkit/public-api/controls/scrollable/scrollable.h
dali-toolkit/public-api/controls/slider/slider.h
dali-toolkit/public-api/controls/super-blur-view/super-blur-view.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/controls/text-input/text-input.h
dali-toolkit/public-api/controls/text-view/text-view.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/file.list
dali-toolkit/public-api/shader-effects/displacement-effect.h
dali-toolkit/public-api/shader-effects/dissolve-effect.cpp
dali-toolkit/public-api/shader-effects/dissolve-local-effect.cpp
dali-toolkit/public-api/shader-effects/mirror-effect.h
dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp
dali-toolkit/public-api/shader-effects/motion-blur-effect.h
dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp
dali-toolkit/public-api/shader-effects/motion-stretch-effect.h
dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp
dali-toolkit/public-api/shader-effects/soft-button-effect.cpp
dali-toolkit/public-api/shader-effects/soft-button-effect.h
docs/content/example-code/property-example.cpp [new file with mode: 0644]
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-rotation.h
docs/content/programming-guide/performance-profiling.h
docs/content/programming-guide/properties.h
docs/content/programming-guide/size-negotiation-controls.h [new file with mode: 0644]
docs/content/programming-guide/size-negotiation.h
docs/content/programming-guide/type-registration.h
docs/content/shared-javascript-and-cpp-documentation/documentation-guide.md [new file with mode: 0644]
packaging/dali-toolkit.spec
plugins/dali-script-v8/docs/content/actor.js
plugins/dali-script-v8/docs/content/animation.js
plugins/dali-script-v8/docs/content/camera-actor.js
plugins/dali-script-v8/docs/content/shader-effect.js
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/actors/actor-wrapper.h
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/module-loader/module-loader.cpp
plugins/dali-script-v8/src/shader-effects/shader-effect-api.cpp
plugins/dali-script-v8/src/shader-effects/shader-effect-wrapper.cpp
plugins/dali-script-v8/src/shared/base-wrapped-object.h
plugins/dali-script-v8/src/utils/v8-utils.cpp
plugins/dali-script-v8/src/utils/v8-utils.h

index 8db6f2c..db21746 100644 (file)
@@ -62,19 +62,19 @@ Run the following commands:
     cd automated-tests
     ./build.sh
 
-This will build dali and dali-internal test sets.
+This will build dali-toolkit and dali-toolkit-internal test sets.
 
 Test sets can be built individually:
 
-    ./build.sh dali
+    ./build.sh dali-toolkit
 
 They can also be built without regenerating test case scripts (Useful for quicker rebuilds)
 
-    ./build.sh -n dali-internal
+    ./build.sh -n dali-toolkit-internal
 
 Or without cleaning down the build area (Useful for fast build/run/debug cycles)
 
-    ./build.sh -n -r dali-internal
+    ./build.sh -n -r dali-toolkit-internal
 
 
 Executing the tests
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)
index 8636839..05ced5a 100644 (file)
@@ -640,86 +640,86 @@ int UtcDaliPushButtonProperties(void)
 
   // Button::PROPERTY_AUTO_REPEATING
   button.SetAutoRepeating( false );
-  DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::PROPERTY_AUTO_REPEATING ) );
-  button.SetProperty( Button::PROPERTY_AUTO_REPEATING, true );
+  DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::Property::AUTO_REPEATING ) );
+  button.SetProperty( Button::Property::AUTO_REPEATING, true );
   DALI_TEST_CHECK( button.IsAutoRepeating() ) ;
-  DALI_TEST_CHECK( button.GetProperty< bool >( Button::PROPERTY_AUTO_REPEATING ) );
+  DALI_TEST_CHECK( button.GetProperty< bool >( Button::Property::AUTO_REPEATING ) );
 
   // Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY
   button.SetInitialAutoRepeatingDelay( 10.0f );
-  DALI_TEST_EQUALS( 10.0f, button.GetProperty< float >( Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
-  button.SetProperty( Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY, 25.0f );
+  DALI_TEST_EQUALS( 10.0f, button.GetProperty< float >( Button::Property::INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+  button.SetProperty( Button::Property::INITIAL_AUTO_REPEATING_DELAY, 25.0f );
   DALI_TEST_EQUALS( 25.0f, button.GetInitialAutoRepeatingDelay(), TEST_LOCATION );
-  DALI_TEST_EQUALS( 25.0f, button.GetProperty< float >( Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+  DALI_TEST_EQUALS( 25.0f, button.GetProperty< float >( Button::Property::INITIAL_AUTO_REPEATING_DELAY ), TEST_LOCATION );
 
   //  Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY
   button.SetNextAutoRepeatingDelay( 3.0f );
-  DALI_TEST_EQUALS( 3.0f, button.GetProperty< float >( Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
-  button.SetProperty( Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY, 4.0f );
+  DALI_TEST_EQUALS( 3.0f, button.GetProperty< float >( Button::Property::NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+  button.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, 4.0f );
   DALI_TEST_EQUALS( 4.0f, button.GetNextAutoRepeatingDelay(), TEST_LOCATION );
-  DALI_TEST_EQUALS( 4.0f, button.GetProperty< float >( Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
+  DALI_TEST_EQUALS( 4.0f, button.GetProperty< float >( Button::Property::NEXT_AUTO_REPEATING_DELAY ), TEST_LOCATION );
 
   //  Button::PROPERTY_TOGGLABLE
   button.SetTogglableButton( false );
-  DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::PROPERTY_TOGGLABLE ) );
-  button.SetProperty( Button::PROPERTY_TOGGLABLE, true );
+  DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::Property::TOGGLABLE ) );
+  button.SetProperty( Button::Property::TOGGLABLE, true );
   DALI_TEST_CHECK( button.IsTogglableButton() ) ;
-  DALI_TEST_CHECK( button.GetProperty< bool >( Button::PROPERTY_TOGGLABLE ) );
+  DALI_TEST_CHECK( button.GetProperty< bool >( Button::Property::TOGGLABLE ) );
 
   //  Button::PROPERTY_SELECTED
   button.SetSelected( false );
-  DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::PROPERTY_SELECTED ) );
-  button.SetProperty( Button::PROPERTY_SELECTED, true );
+  DALI_TEST_CHECK( ! button.GetProperty< bool >( Button::Property::SELECTED ) );
+  button.SetProperty( Button::Property::SELECTED, true );
   DALI_TEST_CHECK( button.IsSelected() ) ;
-  DALI_TEST_CHECK( button.GetProperty< bool >( Button::PROPERTY_SELECTED ) );
+  DALI_TEST_CHECK( button.GetProperty< bool >( Button::Property::SELECTED ) );
 
   //  Button::PROPERTY_NORMAL_STATE_ACTOR
   {
     button.SetButtonImage( ResourceImage::New( "IMAGE_PATH_1") );
-    DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( Button::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
+    DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( Button::Property::NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
 
     Property::Map map;
     map[ "type" ] = "ImageActor";
 
-    button.SetProperty( Button::PROPERTY_NORMAL_STATE_ACTOR, map );
-    DALI_TEST_EQUALS( "ImageActor", button.GetProperty( Button::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+    button.SetProperty( Button::Property::NORMAL_STATE_ACTOR, map );
+    DALI_TEST_EQUALS( "ImageActor", button.GetProperty( Button::Property::NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
   }
 
   //  Button::PROPERTY_SELECTED_STATE_ACTOR
   {
     button.SetSelectedImage( ResourceImage::New( "IMAGE_PATH_2") );
-    DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
+    DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
 
     Property::Map map;
     map[ "type" ] = "Actor";
 
-    button.SetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR, map );
-    DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
-    DALI_TEST_CHECK( "ImageActor" != button.GetProperty( Button::PROPERTY_SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >() );
+    button.SetProperty( Button::Property::SELECTED_STATE_ACTOR, map );
+    DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+    DALI_TEST_CHECK( "ImageActor" != button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >() );
   }
 
   //  Button::PROPERTY_DISABLED_STATE_ACTOR
   {
     button.SetDisabledImage( ResourceImage::New( "IMAGE_PATH_3") );
-    DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( Button::PROPERTY_DISABLED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
+    DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( Button::Property::DISABLED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
 
     Property::Map map;
     map[ "type" ] = "Actor";
 
-    button.SetProperty( Button::PROPERTY_DISABLED_STATE_ACTOR, map );
-    DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::PROPERTY_DISABLED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+    button.SetProperty( Button::Property::DISABLED_STATE_ACTOR, map );
+    DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::DISABLED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
   }
 
   //  Button::PROPERTY_LABEL_ACTOR
   {
     button.SetLabel( "LABEL_TEXT_CUSTOM" );
-    DALI_TEST_EQUALS( "TextView", button.GetProperty( Button::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+    DALI_TEST_EQUALS( "TextView", button.GetProperty( Button::Property::LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
 
     Property::Map map;
     map[ "type" ] = "Actor";
 
-    button.SetProperty( Button::PROPERTY_LABEL_ACTOR, map );
-    DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
+    button.SetProperty( Button::Property::LABEL_ACTOR, map );
+    DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
   }
   END_TEST;
 }
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 7709cda..a3f7172 100644 (file)
@@ -24,12 +24,10 @@ SET(TC_SOURCES
    utc-Dali-JsonParser.cpp
    utc-Dali-KeyInputFocusManager.cpp
    utc-Dali-NavigationControl.cpp
-   utc-Dali-NavigationLayout.cpp
    utc-Dali-OverlayEffect.cpp
    utc-Dali-Page.cpp
    utc-Dali-PageTurnEffect.cpp
    utc-Dali-PageTurnView.cpp
-   utc-Dali-RollLayout.cpp
    utc-Dali-ScrollView.cpp
    utc-Dali-ShadowView.cpp
    utc-Dali-ShearEffect.cpp
@@ -65,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 aa1b5b2..5ab4b7d 100644 (file)
@@ -370,6 +370,20 @@ bool TestPlatformAbstraction::LoadFile( const std::string& filename, std::vector
 }
 
 /**
+ * @copydoc PlatformAbstraction::LoadShaderBinFile()
+ */
+bool TestPlatformAbstraction::LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const
+{
+  mTrace.PushCall("LoadShaderBinFile", "");
+  if( mLoadFileResult.loadResult )
+  {
+    buffer = mLoadFileResult.buffer;
+  }
+
+  return mLoadFileResult.loadResult;
+}
+
+/**
  * @copydoc PlatformAbstraction::SaveFile()
  */
 bool TestPlatformAbstraction::SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const
@@ -498,6 +512,7 @@ bool TestPlatformAbstraction::WasCalled(TestFuncEnum func)
     case LoadResourceFunc:                    return mTrace.FindMethod("LoadResource");
     case SaveResourceFunc:                    return mTrace.FindMethod("SaveResource");
     case LoadFileFunc:                        return mTrace.FindMethod("LoadFile");
+    case LoadShaderBinFileFunc:               return mTrace.FindMethod("LoadShaderBinFile");
     case SaveFileFunc:                        return mTrace.FindMethod("SaveFile");
     case CancelLoadFunc:                      return mTrace.FindMethod("CancelLoad");
     case GetResourcesFunc:                    return mTrace.FindMethod("GetResources");
index 2d4c38c..41b06cd 100644 (file)
@@ -208,6 +208,11 @@ public:
   virtual bool LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
 
   /**
+   * @copydoc PlatformAbstraction::LoadShaderBinFile()
+   */
+  virtual bool LoadShaderBinFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
+
+  /**
    * @copydoc PlatformAbstraction::SaveFile()
    */
   virtual bool SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const;
@@ -251,6 +256,7 @@ public: // TEST FUNCTIONS
     SaveResourceFunc,
     SaveFileFunc,
     LoadFileFunc,
+    LoadShaderBinFileFunc,
     CancelLoadFunc,
     GetResourcesFunc,
     IsLoadingFunc,
index 6d3fa86..4dcef68 100644 (file)
@@ -934,15 +934,15 @@ int UtcDaliAlignmentOnSizeSet(void)
   application.Render();
   application.SendNotification();
 
-  Vector3 size(100.0f, 200.0f, 0.0f);
-  alignment.SetSize(size);
+  Vector2 size( 100.0f, 200.0f );
+  alignment.SetPreferredSize(size);
 
   application.Render();
   application.SendNotification();
   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;
index f95bbe7..d403477 100644 (file)
@@ -64,7 +64,7 @@ namespace
       [                                                        \
         {                                                      \
           'actor':'text',                                      \
-          'property':'rotation',                               \
+          'property':'orientation',                            \
           'value':[0, 3, 0, 0],                                \
           'alpha-function': 'EASE_IN_OUT',                     \
           'time-period': {'delay': 0, 'duration': 3 }          \
index f1edb7a..aa9e46c 100644 (file)
@@ -327,27 +327,11 @@ int UtcDaliControlTestParameters(void)
   ToolkitTestApplication application;
   DummyControl test = DummyControl::New();
 
-  Vector3 maxSize = test.GetNaturalSize();
-  Vector3 minSize = maxSize / 2.0f;
-
-  Toolkit::Control::SizePolicy widthPolicy( Control::Fixed );
-  Toolkit::Control::SizePolicy heightPolicy( Control::Fixed );
-  test.SetSizePolicy( widthPolicy, heightPolicy );
-  test.GetSizePolicy( widthPolicy, heightPolicy );
-
-  DALI_TEST_CHECK( widthPolicy == Control::Fixed && heightPolicy == Control::Fixed );
-
   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 +365,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 +377,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 );
 
@@ -407,84 +391,34 @@ 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_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
+  DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND_IMAGE ).Get< Property::Map >().Empty() );
 
-  control.SetProperty( Control::PROPERTY_BACKGROUND_COLOR, Color::RED );
+  control.SetProperty( Control::Property::BACKGROUND_COLOR, Color::RED );
   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 );
+  DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::RED, TEST_LOCATION );
 
   Property::Map imageMap;
   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 );
+  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_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
+  DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND_IMAGE ).Get< Property::Map >().Empty() );
 
   END_TEST;
 }
@@ -496,15 +430,15 @@ int UtcDaliControlKeyProperties(void)
   Control control = Control::New();
   Stage::GetCurrent().Add( control );
 
-  DALI_TEST_EQUALS( control.HasKeyInputFocus(), control.GetProperty( Control::PROPERTY_KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
+  DALI_TEST_EQUALS( control.HasKeyInputFocus(), control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
 
   control.SetKeyInputFocus();
-  DALI_TEST_EQUALS( true, control.GetProperty( Control::PROPERTY_KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
+  DALI_TEST_EQUALS( true, control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
 
   control.ClearKeyInputFocus();
-  DALI_TEST_EQUALS( false, control.GetProperty( Control::PROPERTY_KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
+  DALI_TEST_EQUALS( false, control.GetProperty( Control::Property::KEY_INPUT_FOCUS ).Get< bool >(), TEST_LOCATION );
 
-  control.SetProperty( Control::PROPERTY_KEY_INPUT_FOCUS, true );
+  control.SetProperty( Control::Property::KEY_INPUT_FOCUS, true );
   DALI_TEST_EQUALS( true, control.HasKeyInputFocus(), TEST_LOCATION );
 
   END_TEST;
index 6965f35..c0cf98c 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.SetPreferredSize( 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.SetPreferredSize( Vector2( 100.0f, 100.0f ) );
 
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
     Stage::GetCurrent().Add(dummy);
@@ -443,22 +445,23 @@ 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);
-    dummy.SetSize(size);
+    DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, true, TEST_LOCATION ); // Called from size negotiation
+    Vector2 size(100.0f, 200.0f);
+    dummy.SetPreferredSize(size);
 
     application.Render();
     application.SendNotification();
     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,22 +470,23 @@ 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();
 
-    dummy.SetSize(size);
+    dummy.SetPreferredSize(size);
 
     application.Render();
     application.SendNotification();
     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);
   }
@@ -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.SetPreferredSize( 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.SetPreferredSize( 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.SetPreferredSize( 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.SetPreferredSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
     Stage::GetCurrent().Add(dummy);
 
index 185940d..28690e8 100644 (file)
@@ -386,28 +386,28 @@ int UtcDaliCubeTransitionWaveEffectStartTransition(void)
   waveEffect.SetTargetImage( imageActor );
   waveEffect.StartTransition(true);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
 
   waveEffect.SetTargetImage( imageActor );
   waveEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube.GetCurrentRotation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
 
   waveEffect.SetTargetImage( imageActor );
   waveEffect.StartTransition(false);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
 
   waveEffect.SetTargetImage( imageActor );
   waveEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube.GetCurrentRotation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   END_TEST;
@@ -437,8 +437,8 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void)
   crossEffect.SetTargetImage( imageActor );
   crossEffect.StartTransition(true);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
 
@@ -446,8 +446,8 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void)
   crossEffect.SetTargetImage( imageActor );
   crossEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( 2.f*Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 2.f*Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
 
@@ -455,16 +455,16 @@ int UtcDaliCubeTransitionCrossEffectStartTransition(void)
   crossEffect.SetTargetImage( imageActor );
   crossEffect.StartTransition(false);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
 
   crossEffect.SetTargetImage( imageActor );
   crossEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( 0.f,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   END_TEST;
@@ -493,16 +493,16 @@ int UtcDaliCubeTransitionFoldEffectStartTransition(void)
   foldEffect.SetTargetImage( imageActor );
   foldEffect.StartTransition(true);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
 
   foldEffect.SetTargetImage( imageActor );
   foldEffect.StartTransition(PAN_POSITION1, PAN_DISPLACEMENT1);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( 2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
 
@@ -510,16 +510,16 @@ int UtcDaliCubeTransitionFoldEffectStartTransition(void)
   foldEffect.SetTargetImage( imageActor );
   foldEffect.StartTransition(false);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(),fullBrightness, FLT_EPISILON, TEST_LOCATION );
 
   foldEffect.SetTargetImage( imageActor );
   foldEffect.StartTransition(PAN_POSITION2, PAN_DISPLACEMENT2);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   END_TEST;
@@ -749,7 +749,7 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void)
   waveEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
 
@@ -759,7 +759,7 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void)
   waveEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube.GetCurrentRotation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
 
@@ -769,7 +769,7 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void)
   waveEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
 
@@ -779,7 +779,7 @@ int UtcDaliCubeTransitionWaveEffectStopTransition(void)
   waveEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube.GetCurrentRotation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   END_TEST;
@@ -813,8 +813,8 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void)
   crossEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
 
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
@@ -825,8 +825,8 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void)
   crossEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( 2.f*Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 2.f*Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
 
@@ -836,8 +836,8 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void)
   crossEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
 
@@ -847,8 +847,8 @@ int UtcDaliCubeTransitionCrossEffectStopTransition(void)
   crossEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( 0.f,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::XAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   END_TEST;
@@ -881,8 +881,8 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void)
   foldEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
 
@@ -892,8 +892,8 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void)
   foldEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( 2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
 
@@ -903,8 +903,8 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void)
   foldEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
 
@@ -914,8 +914,8 @@ int UtcDaliCubeTransitionFoldEffectStopTransition(void)
   foldEffect.StopTransition();
   application.SendNotification();
   application.Render(RENDER_FRAME_INTERVAL);
-  DALI_TEST_EQUALS( cube1.GetCurrentRotation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
-  DALI_TEST_EQUALS( cube0.GetCurrentRotation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube1.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
   DALI_TEST_EQUALS( cube0.GetChildAt(0).GetCurrentColor(), fullBrightness, FLT_EPISILON, TEST_LOCATION );
   DALI_TEST_EQUALS( cube0.GetChildAt(1).GetCurrentColor(), halfBrightness, FLT_EPISILON, TEST_LOCATION );
   END_TEST;
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-NavigationLayout.cpp b/automated-tests/src/dali-toolkit/utc-Dali-NavigationLayout.cpp
deleted file mode 100644 (file)
index 6166183..0000000
+++ /dev/null
@@ -1,566 +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 <float.h>       // for FLT_MAX
-#include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-using namespace Dali;
-using namespace Toolkit;
-
-namespace
-{
-const unsigned int TOTAL_ITEM_NUMBER = 200;
-
-
-// Implementation of ItemFactory for providing actors to ItemView
-class TestItemFactory : public ItemFactory
-{
-public:
-
-  /**
-   * Constructor
-   * @param application class, stored as reference
-   */
-  TestItemFactory()
-  {
-  }
-
-public: // From ItemFactory
-
-  /**
-   * Query the number of items available from the factory.
-   * The maximum available item has an ID of GetNumberOfItems() - 1.
-   */
-  virtual unsigned int GetNumberOfItems()
-  {
-    return TOTAL_ITEM_NUMBER;
-  }
-
-  /**
-   * Create an Actor to represent a visible item.
-   * @param itemId
-   * @return the created actor.
-   */
-  virtual Actor NewItem(unsigned int itemId)
-  {
-    // Create an test actor for this item
-    ImageActor actor = CreateSolidColorActor(Color::RED);
-    actor.SetSize(64.0f, 64.0f);
-
-    return actor;
-  }
-};
-} // namespace
-
-
-// Positive test case for a method
-int UtcDaliNavigationLayoutNew(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a navigation layout
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-  navigationLayout->SetNumberOfColumns(6);
-  DALI_TEST_CHECK(navigationLayout);
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutColumns(void)
-{
-  ToolkitTestApplication application;
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-
-  navigationLayout->SetNumberOfColumns(6);
-  // Check whether we get the correct number of columns
-  DALI_TEST_CHECK(navigationLayout->GetNumberOfColumns() == 6);
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutSetGetOrientation(void)
-{
-  ToolkitTestApplication application;
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-
-  navigationLayout->SetNumberOfColumns(6);
-  navigationLayout->SetOrientation(ControlOrientation::Right);
-  DALI_TEST_CHECK(navigationLayout->GetOrientation() == ControlOrientation::Right);
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutTestConstraintLeft(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-  navigationLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*navigationLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  navigationLayout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and all of them is positioned at X = 0
-  // and the series is monotonely decreasing.
-  int nonZeroXCount = 0;
-  int elementsFound = 0;
-  int wrongDirectionCount = 0;
-  float prevY = FLT_MAX;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.x != 0.0f)
-      {
-        nonZeroXCount++;
-      }
-
-      if (pos.y >= prevY)
-      {
-        wrongDirectionCount++;
-      }
-
-      prevY = pos.y;
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroXCount == 0) && (wrongDirectionCount == 0));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutTestConstraintRight(void)
-{
-  ToolkitTestApplication application;
-
-   // Create the ItemView actor
-   TestItemFactory factory;
-   ItemView view = ItemView::New(factory);
-   Vector3 vec(480.0f, 800.0f, 0.0f);
-   NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-   navigationLayout->SetNumberOfColumns(6);
-
-   view.SetName("view actor");
-   view.AddLayout(*navigationLayout);
-   view.SetSize(vec);
-
-   Stage::GetCurrent().Add(view);
-   navigationLayout->SetOrientation(ControlOrientation::Right);
-   view.ActivateLayout(0, vec, 0.0f);
-
-   application.SendNotification();
-   application.Render(0);
-
-   // render 10 frames
-   for(int i = 0; i < 10; ++i)
-   {
-     application.Render(16); // 60hz frames
-   }
-
-   // Confirm: we have actors in the view and all of them is positioned at X = 0
-   // and the series is monotonely increasing.
-   int nonZeroXCount = 0;
-   int elementsFound = 0;
-   int wrongDirectionCount = 0;
-   float prevY = -FLT_MAX;
-   for(unsigned int i = 0; i < 10; i++)
-   {
-     Actor testActor = view.GetItem(i);
-     if (testActor)
-     {
-       elementsFound++;
-       Vector3 pos = testActor.GetCurrentPosition();
-
-       if (pos.x != 0.0f)
-       {
-         nonZeroXCount++;
-       }
-
-       if (pos.y <= prevY)
-       {
-         wrongDirectionCount++;
-       }
-
-       prevY = pos.y;
-     }
-   }
-
-   DALI_TEST_CHECK((elementsFound > 0) && (nonZeroXCount == 0) && (wrongDirectionCount == 0));
-   Stage::GetCurrent().Remove(view);
-   END_TEST;
-}
-
-int UtcDaliNavigationLayoutTestConstraintUp(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-  navigationLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*navigationLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  navigationLayout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and all of them is positioned at X = 0
-  // and the series is monotonely decreasing.
-  int nonZeroYCount = 0;
-  int elementsFound = 0;
-  int wrongDirectionCount = 0;
-  float prevX = -FLT_MAX;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.y != 0.0f)
-      {
-        nonZeroYCount++;
-      }
-
-      if (pos.x <= prevX)
-      {
-        wrongDirectionCount++;
-      }
-
-      prevX = pos.x;
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroYCount == 0) && (wrongDirectionCount == 0));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutTestConstraintDown(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-  navigationLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*navigationLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  navigationLayout->SetOrientation(ControlOrientation::Down);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and all of them is positioned at X = 0
-  // and the series is monotonely decreasing.
-  int nonZeroYCount = 0;
-  int elementsFound = 0;
-  int wrongDirectionCount = 0;
-  float prevX = FLT_MAX;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.y != 0.0f)
-      {
-        nonZeroYCount++;
-      }
-
-      if (pos.x > prevX)
-      {
-        wrongDirectionCount++;
-      }
-
-      prevX = pos.x;
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroYCount == 0) && (wrongDirectionCount == 0));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-
-int UtcDaliNavigationLayoutScrollDirection(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-  navigationLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*navigationLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  navigationLayout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  ItemLayoutPtr layout = navigationLayout;
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  navigationLayout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  Degree deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == (180.0f - 45.0f));
-
-  navigationLayout->SetOrientation(ControlOrientation::Down);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK((deg == -45.0f));
-
-  layout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == (270.0f - 45.0f));
-
-  navigationLayout->SetOrientation(ControlOrientation::Right);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == (90.0f - 45.0f));
-
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutSetGetColumnSpacing(void)
-{
-  ToolkitTestApplication application;
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-  const float testValue = 11.0f;
-
-  navigationLayout->SetNumberOfColumns(6);
-  navigationLayout->SetColumnSpacing(testValue);
-  DALI_TEST_CHECK(navigationLayout->GetColumnSpacing() == testValue);
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutSetGetTopMargin(void)
-{
-  ToolkitTestApplication application;
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-  const float testValue = 11.0f;
-
-  navigationLayout->SetNumberOfColumns(6);
-  navigationLayout->SetTopMargin(testValue);
-  DALI_TEST_CHECK(navigationLayout->GetTopMargin() == testValue);
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutSetGetBottomMargin(void)
-{
-  ToolkitTestApplication application;
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-  const float testValue = 12.0f;
-
-  navigationLayout->SetNumberOfColumns(6);
-  navigationLayout->SetBottomMargin(testValue);
-  DALI_TEST_CHECK(navigationLayout->GetBottomMargin() == testValue);
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutSetGetScrollSpeedFactor(void)
-{
-  ToolkitTestApplication application;
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-  const float testValue = 15.0f;
-
-  navigationLayout->SetNumberOfColumns(6);
-  navigationLayout->SetScrollSpeedFactor(testValue);
-  DALI_TEST_CHECK(navigationLayout->GetScrollSpeedFactor() == testValue);
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutSetGetMaximumSwipeSpeed(void)
-{
-  ToolkitTestApplication application;
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-  const float testValue = 10.0f;
-
-  navigationLayout->SetNumberOfColumns(6);
-  navigationLayout->SetMaximumSwipeSpeed(testValue);
-  DALI_TEST_CHECK(navigationLayout->GetMaximumSwipeSpeed() == testValue);
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutSetAndGetItemFlickAnimationDuration(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a navigation layout
-  NavigationLayoutPtr navigationLayout = NavigationLayout::New();
-
-  // Set the flick animaiton duration
-  navigationLayout->SetItemFlickAnimationDuration(0.35f);
-
-  // Check whether we get the correct flick animaiton duration
-  DALI_TEST_EQUALS( navigationLayout->GetItemFlickAnimationDuration(), 0.35f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliNavigationLayoutGetScrollToPosition(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  NavigationLayoutPtr layout = NavigationLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*layout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  layout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view.
-  std::vector<unsigned int> indices;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      indices.push_back(i);
-    }
-  }
-
-  try
-  {
-    if (!indices.empty())
-    {
-      const unsigned int firstTargetIndex = indices[indices.size()-1];
-      // scroll to last item
-      view.ScrollToItem(firstTargetIndex, 0.00f);
-      application.Render(16); // 60hz frames
-
-      std::size_t moveCount = 0;
-      for(std::size_t i = 0; i < indices.size(); i++)
-      {
-        float layoutPosBefore = view.GetCurrentLayoutPosition(i);
-        view.ScrollToItem(indices[i], 0.0f);
-
-        application.Render(16); // 60hz frame
-
-        float layoutPosAfter = view.GetCurrentLayoutPosition(i);
-
-        if (fabs(layoutPosBefore-layoutPosAfter) <= FLT_EPSILON)
-        {
-          ++moveCount;
-        }
-      }
-
-      DALI_TEST_CHECK((moveCount == indices.size()));
-    }
-  }
-  catch(...)
-  {
-    tet_result(TET_FAIL);
-  }
-
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
index 4374bfa..1f2ecc7 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.SetPreferredSize(DEFAULT_BUTTON_SIZE.GetVectorXY());
   popup.AddButton(button1);
-  button2.SetSize(DEFAULT_BUTTON_SIZE);
+  button2.SetPreferredSize(DEFAULT_BUTTON_SIZE.GetVectorXY());
   popup.AddButton(button2);
 
   // Showing/Hiding popup, results in all child Actors being
index 9b3c9e5..d53084c 100644 (file)
@@ -154,19 +154,19 @@ int UtcDaliRadioButtonSelectedProperty(void)
   radioButton.SetPosition( 0.0f, 0.0f );
 
   // Default selected
-  DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+  DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == false );
 
   // Setting false selected
-  radioButton.SetProperty( Button::PROPERTY_SELECTED, false );
-  DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+  radioButton.SetProperty( Button::Property::SELECTED, false );
+  DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == false );
 
   // Setting true selected
-  radioButton.SetProperty( Button::PROPERTY_SELECTED, true );
-  DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_SELECTED ) == true );
+  radioButton.SetProperty( Button::Property::SELECTED, true );
+  DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == true );
 
   // Setting false again
-  radioButton.SetProperty( Button::PROPERTY_SELECTED, false );
-  DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+  radioButton.SetProperty( Button::Property::SELECTED, false );
+  DALI_TEST_CHECK( radioButton.GetProperty<bool>( Button::Property::SELECTED ) == false );
 
   // Test selecting radio buttons
   RadioButton radioButton2 = RadioButton::New( "label" );
@@ -193,8 +193,8 @@ int UtcDaliRadioButtonSelectedProperty(void)
   application.Render();
 
   // Simulate touch events
-  DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
-  DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+  DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == false );
+  DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == false );
 
   // Select first radio
   {
@@ -213,8 +213,8 @@ int UtcDaliRadioButtonSelectedProperty(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_SELECTED ) == true );
-    DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+    DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == true );
+    DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == false );
   }
 
   // Select an already selected radio
@@ -234,8 +234,8 @@ int UtcDaliRadioButtonSelectedProperty(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_SELECTED ) == true );
-    DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
+    DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == true );
+    DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == false );
   }
 
   // Select second radio
@@ -255,8 +255,8 @@ int UtcDaliRadioButtonSelectedProperty(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
-    DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_SELECTED ) == true );
+    DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == false );
+    DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == true );
   }
 
   // Select outside radio group
@@ -276,8 +276,8 @@ int UtcDaliRadioButtonSelectedProperty(void)
     application.SendNotification();
     application.Render();
 
-    DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::PROPERTY_SELECTED ) == false );
-    DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::PROPERTY_SELECTED ) == true );
+    DALI_TEST_CHECK( radioButton2.GetProperty<bool>( Button::Property::SELECTED ) == false );
+    DALI_TEST_CHECK( radioButton3.GetProperty<bool>( Button::Property::SELECTED ) == true );
   }
 
   END_TEST;
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-RollLayout.cpp b/automated-tests/src/dali-toolkit/utc-Dali-RollLayout.cpp
deleted file mode 100644 (file)
index 59fd84f..0000000
+++ /dev/null
@@ -1,437 +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>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace
-{
-const unsigned int TOTAL_ITEM_NUMBER = 200;
-
-Vector3 RollLayoutItemSizeFunction(float layoutWidth, float layoutHeight, float rowSpacing)
-{
-  float height = (layoutHeight - rowSpacing) * 0.5f;
-  return Vector3(layoutWidth, height, height);
-}
-
-} // namespace
-
-
-// Implementation of ItemFactory for providing actors to ItemView
-class TestItemFactory : public ItemFactory
-{
-public:
-
-  /**
-   * Constructor
-   */
-  TestItemFactory()
-  {
-  }
-
-public: // From ItemFactory
-
-  /**
-   * Query the number of items available from the factory.
-   * The maximum available item has an ID of GetNumberOfItems() - 1.
-   */
-  virtual unsigned int GetNumberOfItems()
-  {
-    return TOTAL_ITEM_NUMBER;
-  }
-
-  /**
-   * Create an Actor to represent a visible item.
-   * @param itemId
-   * @return the created actor.
-   */
-  virtual Actor NewItem(unsigned int itemId)
-  {
-    // Create an test actor for this item
-    ImageActor actor = CreateSolidColorActor(Color::RED);
-    actor.SetSize(64.0f, 64.0f);
-    return actor;
-  }
-};
-
-void dali_roll_layout_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void dali_roll_layout_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-
-
-int UtcDaliRollLayoutNew(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a roll layout
-  RollLayoutPtr rollLayout = RollLayout::New();
-
-  DALI_TEST_CHECK(rollLayout);
-  END_TEST;
-}
-
-int UtcDaliRollLayoutSetAndGetRowSpacing(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a roll layout
-  RollLayoutPtr rollLayout = RollLayout::New();
-
-  // Set the row spacing
-  rollLayout->SetRowSpacing(10.0f);
-
-  // Check whether we get the correct row spacing
-  DALI_TEST_EQUALS(rollLayout->GetRowSpacing(), 10.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliRollLayoutSetAndGetItemSizeFunction(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a roll layout
-  RollLayoutPtr rollLayout = RollLayout::New();
-
-  // Set the item size function
-  rollLayout->SetItemSizeFunction(RollLayoutItemSizeFunction);
-
-  // Check whether we get the correct item size function
-  DALI_TEST_CHECK(rollLayout->GetItemSizeFunction() == RollLayoutItemSizeFunction);
-  END_TEST;
-}
-
-int UtcDaliRollLayoutSetAndGetScrollSpeedFactor(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a roll layout
-  RollLayoutPtr rollLayout = RollLayout::New();
-
-  // Set the scroll speed factor
-  rollLayout->SetScrollSpeedFactor(0.05f);
-
-  // Check whether we get the correct scroll speed factor
-  DALI_TEST_EQUALS(rollLayout->GetScrollSpeedFactor(), 0.05f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliRollLayoutSetAndGetMaximumSwipeSpeed(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a roll layout
-  RollLayoutPtr rollLayout = RollLayout::New();
-
-  // Set the maximum swipe speed
-  rollLayout->SetMaximumSwipeSpeed(50.0f);
-
-  // Check whether we get the correct maximum swipe speed
-  DALI_TEST_EQUALS(rollLayout->GetMaximumSwipeSpeed(), 50.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliRollLayoutSetAndGetItemFlickAnimationDuration(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a roll layout
-  RollLayoutPtr rollLayout = RollLayout::New();
-
-  // Set the flick animaiton duration
-  rollLayout->SetItemFlickAnimationDuration(0.35f);
-
-  // Check whether we get the correct flick animaiton duration
-  DALI_TEST_EQUALS( rollLayout->GetItemFlickAnimationDuration(), 0.35f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliRollLayoutConstraintLeft(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  RollLayoutPtr rollLayout = RollLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*rollLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  rollLayout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliRollLayoutConstraintRight(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  RollLayoutPtr rollLayout = RollLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*rollLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  rollLayout->SetOrientation(ControlOrientation::Right);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliRollLayoutConstraintUp(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  RollLayoutPtr rollLayout = RollLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*rollLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  rollLayout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliRollLayoutConstraintDown(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  RollLayoutPtr rollLayout = RollLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*rollLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  rollLayout->SetOrientation(ControlOrientation::Down);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliRollLayoutScrollDirection(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  RollLayoutPtr rollLayout = RollLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*rollLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  rollLayout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  ItemLayoutPtr layout = rollLayout;
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  rollLayout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  Degree deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == 0.0f);
-
-  rollLayout->SetOrientation(ControlOrientation::Down);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK((deg == 180.0f));
-
-  layout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == 90.f);
-
-  rollLayout->SetOrientation(ControlOrientation::Right);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == 270.0f);
-
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
index 43d186f..9b9cad1 100644 (file)
@@ -818,7 +818,7 @@ int UtcDaliScrollViewConstraints(void)
   Wait(application);
 
   Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME);
-  Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+  Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                                        Source(scrollView, scrollPositionProperty),
                                                        TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
   constraint.SetRemoveAction(Constraint::Discard);
@@ -867,7 +867,7 @@ int UtcDaliScrollViewBind(void)
 
   Property::Index scrollPositionProperty = scrollView.GetPropertyIndex(ScrollView::SCROLL_POSITION_PROPERTY_NAME);
   // apply this constraint to scrollview
-  Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+  Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                                        Source(scrollView, scrollPositionProperty),
                                                        TestSumConstraint( TEST_CONSTRAINT_OFFSET ) );
 
index e10107b..5cda497 100644 (file)
@@ -141,7 +141,7 @@ ScrollView SetupTestScrollView(int rows, int columns, Vector2 size)
   scrollView.SetSize(size);
   scrollView.SetAnchorPoint(AnchorPoint::CENTER);
   scrollView.SetParentOrigin(ParentOrigin::CENTER);
-  scrollView.ApplyConstraint( Constraint::New<Dali::Vector3>( Dali::Actor::Property::Size, Dali::ParentSource( Dali::Actor::Property::Size ), Dali::EqualToConstraint() ) );
+  scrollView.ApplyConstraint( Constraint::New<Dali::Vector3>( Dali::Actor::Property::SIZE, Dali::ParentSource( Dali::Actor::Property::SIZE ), Dali::EqualToConstraint() ) );
   scrollView.SetWrapMode(false);
   scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
   scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
@@ -175,7 +175,7 @@ ScrollView SetupTestScrollView(int rows, int columns, Vector2 size)
   container.SetAnchorPoint(AnchorPoint::CENTER);
   container.SetSize( size );
   scrollView.Add( container );
-  container.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+  container.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
 
   gPages.clear();
   for(int row = 0;row<rows;row++)
@@ -183,7 +183,7 @@ ScrollView SetupTestScrollView(int rows, int columns, Vector2 size)
     for(int column = 0;column<columns;column++)
     {
       Actor page = Actor::New();
-      page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+      page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
       page.SetParentOrigin( ParentOrigin::CENTER );
       page.SetAnchorPoint( AnchorPoint::CENTER );
       page.SetPosition( column * size.x, row * size.y );
@@ -322,7 +322,7 @@ int UtcDaliScrollViewSpiralEffectTest(void)
   {
     Actor page = *pageIter;
     page.RemoveConstraints();
-    page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+    page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
     effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f));
   }
   Wait(application);
@@ -431,7 +431,7 @@ int UtcDaliScrollViewPageCubeEffectTest(void)
   {
     Actor page = *pageIter;
     page.RemoveConstraints();
-    page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+    page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
     effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f));
   }
   Wait(application);
@@ -466,7 +466,7 @@ int UtcDaliScrollViewPageCarouselEffectTest(void)
   {
     Actor page = *pageIter;
     page.RemoveConstraints();
-    page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+    page.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
     effect.ApplyToPage(page);
   }
   Wait(application);
index 0b0463f..d5d2ef0 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.SetPreferredSize( Vector2( Stage::GetCurrent().GetSize().x, 20.0f ) );
   slider.SetPosition( 0.0f, 0.0f );
 
   const float MIN_BOUND = 0.0f;
@@ -136,8 +136,8 @@ int UtcDaliSliderSignals(void)
   {
     marks.push_back( MIN_BOUND + ( static_cast<float>(i) / ( NUM_MARKS - 1) ) * ( MAX_BOUND - MIN_BOUND ) );
   }
-  slider.SetProperty( Slider::MARKS_PROPERTY, marks );
-  slider.SetProperty( Slider::MARK_TOLERANCE_PROPERTY, 0.1f );
+  slider.SetProperty( Slider::Property::MARKS, marks );
+  slider.SetProperty( Slider::Property::MARK_TOLERANCE, 0.1f );
 
   slider.ValueChangedSignal().Connect( &OnSliderValueChanged );
   slider.MarkSignal().Connect( &OnSliderMark );
index 53bbae6..484453c 100644 (file)
@@ -42,7 +42,6 @@ const char* const PROPERTY_NAME_CELL_PADDING = "cell-padding";
 const char* const PROPERTY_NAME_LAYOUT_ROWS = "layout-rows";
 const char* const PROPERTY_NAME_LAYOUT_COLUMNS = "layout-columns";
 
-
 static bool gObjectCreatedCallBackCalled;
 
 static void TestCallback(BaseHandle handle)
@@ -50,7 +49,6 @@ static void TestCallback(BaseHandle handle)
   gObjectCreatedCallBackCalled = true;
 }
 
-
 struct Constraint100
 {
   Constraint100( )
@@ -69,28 +67,32 @@ 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.SetPreferredSize( 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.SetPreferredSize( Dali::Vector2( 10, 10 ) );
+  actor2.SetRelayoutEnabled( true );
+  actor2.SetPreferredSize( Dali::Vector2( 10, 10 ) );
+  actor3.SetRelayoutEnabled( true );
+  actor3.SetPreferredSize( 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
 
-
 int UtcDaliTableViewNew(void)
 {
   ToolkitTestApplication application;
@@ -441,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
@@ -453,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
@@ -465,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
@@ -477,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...
@@ -491,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
@@ -503,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
@@ -515,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
@@ -527,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;
 }
@@ -539,32 +541,32 @@ int UtcDaliTableViewSetGetProperty(void)
 
   // Create a 1x1 table-view
   TableView tableView = TableView::New(1,1);
-  tableView.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, Constraint100() ) );
+  tableView.SetPreferredSize( Vector2( 100.0f, 100.0f ) );
   DALI_TEST_CHECK( tableView );
 
   // Test "rows" property
-  DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_ROWS ) == TableView::PROPERTY_ROWS );
+  DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_ROWS ) == TableView::Property::ROWS );
 
-  tableView.SetProperty( TableView::PROPERTY_ROWS, 4u );
+  tableView.SetProperty( TableView::Property::ROWS, 4u );
 
   DALI_TEST_CHECK( tableView.GetRows() == 4u );
-  DALI_TEST_CHECK( tableView.GetProperty(TableView::PROPERTY_ROWS).Get<unsigned int>() == 4u );
+  DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::ROWS).Get<unsigned int>() == 4u );
 
   // Test "columns" property
-  DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_COLUMNS ) == TableView::PROPERTY_COLUMNS );
+  DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_COLUMNS ) == TableView::Property::COLUMNS );
 
-  tableView.SetProperty( TableView::PROPERTY_COLUMNS, 5u );
+  tableView.SetProperty( TableView::Property::COLUMNS, 5u );
 
   DALI_TEST_CHECK( tableView.GetColumns() == 5u );
-  DALI_TEST_CHECK( tableView.GetProperty(TableView::PROPERTY_COLUMNS).Get<unsigned int>() == 5u );
+  DALI_TEST_CHECK( tableView.GetProperty(TableView::Property::COLUMNS).Get<unsigned int>() == 5u );
 
   // Test "cell-padding" property
-  DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_CELL_PADDING ) == TableView::PROPERTY_CELL_PADDING );
+  DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_CELL_PADDING ) == TableView::Property::CELL_PADDING );
 
-  tableView.SetProperty( TableView::PROPERTY_CELL_PADDING, Size( 6.f, 8.f ) );
+  tableView.SetProperty( TableView::Property::CELL_PADDING, Size( 6.f, 8.f ) );
 
   DALI_TEST_EQUALS( tableView.GetCellPadding(), Size(6.f, 8.f), TEST_LOCATION );
-  DALI_TEST_EQUALS( tableView.GetProperty(TableView::PROPERTY_CELL_PADDING).Get<Vector2>(), Vector2(6.f,8.f), TEST_LOCATION );
+  DALI_TEST_EQUALS( tableView.GetProperty(TableView::Property::CELL_PADDING).Get<Vector2>(), Vector2(6.f,8.f), TEST_LOCATION );
 
   //{ "policy": "fixed", "value": 30.0 },
   Property::Map item1;
@@ -576,7 +578,7 @@ int UtcDaliTableViewSetGetProperty(void)
   item2[ "value" ] = 0.2f;
 
   // Test "layout-rows" property
-  DALI_TEST_CHECK( tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::PROPERTY_LAYOUT_ROWS );
+  DALI_TEST_CHECK( tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::Property::LAYOUT_ROWS );
 
   /*
    * "layout-rows":
@@ -588,21 +590,23 @@ int UtcDaliTableViewSetGetProperty(void)
   Property::Map layoutRows;
   layoutRows[ "1" ] = item1;
   layoutRows[ "3" ] = item2;
-  tableView.SetProperty( TableView::PROPERTY_LAYOUT_ROWS, layoutRows );
+  tableView.SetProperty( TableView::Property::LAYOUT_ROWS, layoutRows );
 
   DALI_TEST_EQUALS( tableView.GetFixedHeight( 1u ), 30.f, TEST_LOCATION );
   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 );
+  Property::Map layoutRowsGet = tableView.GetProperty(TableView::Property::LAYOUT_ROWS).Get<Property::Map>();
+
+  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 );
+  DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_LAYOUT_COLUMNS ) == TableView::Property::LAYOUT_COLUMNS );
 
   /*
    * "layout-columns":
@@ -614,18 +618,19 @@ int UtcDaliTableViewSetGetProperty(void)
   Property::Map layoutColumns;
   layoutColumns[ "2" ] = item2;
   layoutColumns[ "3" ] = item1;
-  tableView.SetProperty( TableView::PROPERTY_LAYOUT_COLUMNS, layoutColumns );
+  tableView.SetProperty( TableView::Property::LAYOUT_COLUMNS, layoutColumns );
 
   DALI_TEST_EQUALS( tableView.GetRelativeWidth( 2u ), 0.2f, TEST_LOCATION );
   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 );
+  Property::Map layoutColumnsGet = tableView.GetProperty(TableView::Property::LAYOUT_COLUMNS).Get<Property::Map>();
+  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;
 }
@@ -637,7 +642,7 @@ int UtcDaliTableViewCustomProperties(void)
 
   // Create a 10x10 table-view
   TableView tableView = TableView::New(10,10);
-  tableView.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, Constraint100() ) );
+  tableView.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, Constraint100() ) );
   DALI_TEST_CHECK( tableView );
 
   // Create a child actor with the custom properties
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..e1042b2 100644 (file)
@@ -114,18 +114,23 @@ int UtcDaliToolBarAddControl01(void)
   try
   {
     ImageActor control1 = CreateSolidColorActor( Color::RED );
-    control1.SetSize( 100.f, 100.f );
+    control1.SetPreferredSize( Vector2( 100.f, 100.f ) );
+    control1.SetResizePolicy( FIXED, ALL_DIMENSIONS );
     ImageActor control2 = CreateSolidColorActor( Color::RED );
-    control2.SetSize( 100.f, 100.f );
+    control2.SetPreferredSize( Vector2( 100.f, 100.f ) );
+    control2.SetResizePolicy( FIXED, ALL_DIMENSIONS );
     ImageActor control3 = CreateSolidColorActor( Color::RED );
-    control3.SetSize( 100.f, 100.f );
+    control3.SetPreferredSize( Vector2( 100.f, 100.f ) );
+    control3.SetResizePolicy( FIXED, ALL_DIMENSIONS );
     ImageActor control4 = CreateSolidColorActor( Color::RED );
-    control4.SetSize( 100.f, 100.f );
+    control4.SetPreferredSize( Vector2( 100.f, 100.f ) );
+    control4.SetResizePolicy( FIXED, ALL_DIMENSIONS );
     ImageActor control5 = CreateSolidColorActor( Color::RED );
-    control5.SetSize( 100.f, 100.f );
+    control5.SetPreferredSize( Vector2( 100.f, 100.f ) );
+    control5.SetResizePolicy( FIXED, ALL_DIMENSIONS );
 
     ToolBar toolbar = ToolBar::New();
-    toolbar.SetSize( 600.f, 100.f );
+    toolbar.SetPreferredSize( Vector2( 600.f, 100.f ) );
 
     application.Render();
     application.SendNotification();
@@ -139,11 +144,14 @@ 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.SetPreferredSize( Vector2( 100.f, 100.f ) );
+    control6.SetResizePolicy( FIXED, ALL_DIMENSIONS );
     ImageActor control7 = CreateSolidColorActor( Color::RED );
-    control7.SetSize( 100.f, 100.f );
+    control7.SetPreferredSize( Vector2( 100.f, 100.f ) );
+    control7.SetResizePolicy( FIXED, ALL_DIMENSIONS );
     ImageActor control8 = CreateSolidColorActor( Color::RED );
-    control8.SetSize( 100.f, 100.f );
+    control8.SetPreferredSize( Vector2( 100.f, 100.f ) );
+    control8.SetResizePolicy( FIXED, ALL_DIMENSIONS );
 
     application.Render();
     application.SendNotification();
index 21a57df..2d28fd2 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.SetPreferredSize( Vector2( 480, 800 ) );
 
     view.OrientationAnimationStartedSignal().Connect( &StartAnimation );
 
index c1858ef..5f027e6 100644 (file)
@@ -46,30 +46,34 @@ AC_ARG_ENABLE([debug],
               [enable_debug=$enableval],
               [enable_debug=no])
 
-# option for JavaScript plugin
-AC_ARG_ENABLE(javascript,
+# option to build JavaScript plugin
+# configure settings and output
+# --enable-javascript        // enable_javascript = yes
+# --enable-javascript=yes    // enable_javascript = yes
+# --enable-javascript=no     // enable_javascript = no
+# --disable-javascript       // enable_javascript = no
+#  no setting                // enable_javascript = automatic ( enable if v8 present)
+AC_ARG_ENABLE([javascript],
               [AC_HELP_STRING([--enable-javascript],
-                              [Enable JavaScript plugin])] ,
-               [enable_javascript=yes],
+               [Enable JavaScript plugin])] ,
+               [enable_javascript=$enableval],
                [enable_javascript=no])
+#TODO MESH_REWORK  Change default back to automatic
 
 if test "x$enable_debug" = "xyes"; then
   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDEBUG_ENABLED"
-  DALI_SCRIPTV8_CFLAGS="$DALI_TOOLKIT_CFLAGS -DDEBUG_ENABLED"
 fi
 
 if test "x$enable_debug" = "xno" -a "x$enable_exportall" = "xno"; then
   DALI_TOOLKIT_CFLAGS="$DALI_TOOLKIT_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
-  DALI_SCRIPTV8_CFLAGS="$DALI_TOOLKIT_CFLAGS -fvisibility=hidden -DHIDE_DALI_INTERNALS"
 fi
 
-#set a variable for the makefile to conditionally compile the plugin
-AM_CONDITIONAL([ENABLE_JAVASCRIPT_PLUGIN], [test x$enable_javascript = xyes])
+
 
 
 # Tizen Profile options
 AC_ARG_ENABLE([profile],
-              [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,LITE,WEARABLE,TV],
+              [AC_HELP_STRING([--enable-profile=COMMON,MOBILE,WEARABLE,TV],
                             [Select the variant of tizen])],
               [dali_profile=$enableval],
               [dali_profile=COMMON])
@@ -86,11 +90,37 @@ else
   dataReadOnlyDir=${prefix}/share/dali/
 fi
 
+# v8 version 4+ requires c++11
+PKG_CHECK_MODULES(V8, v8 = 3.32.7, [ pkg_check_v8=yes ],  [ pkg_check_v8=no  ] )
+
+# Rules for building JavaScript plugin
+# If enable_javascript=yes and v8 installed = build javascript
+# If enable_javascript=automatic and v8 installed = build javascript
+# If enable_javascript=yes and v8 not installed = throw an error
+build_javascript_plugin=no
+if test x$enable_javascript = xyes; then
+  if test x$pkg_check_v8 = xno; then
+    [build_javascript_plugin=no]
+    AC_MSG_ERROR("V8 not found or incorrect version installed")
+    AC_MSG_NOTICE("To disable building of JavaScript plugin use --disable-javascript")
+  else
+    [build_javascript_plugin=yes]
+    AC_MSG_NOTICE(V8 library found. Building DALi JavaScript plugin)
+  fi
+fi
+if test x$enable_javascript = xautomatic && test x$pkg_check_v8 = xyes; then
+  [build_javascript_plugin=yes]
+  AC_MSG_NOTICE( V8 library found. Automatic building of JavaScript plugin. Use  use --disable-javascript to disable)
+fi
+
+
+#set a variable for the makefile to force compile the JAvaSplugin
+AM_CONDITIONAL([ENABLE_JAVASCRIPT_PLUGIN], [test x$build_javascript_plugin = xyes])
+
 AC_SUBST(dataReadWriteDir)
 AC_SUBST(dataReadOnlyDir)
 AC_SUBST(DALI_TOOLKIT_CFLAGS)
-AC_SUBST(DALI_SCRIPTV8_CFLAGS)
-AC_SUBST(DALI_SCRIPTV8_LIBS)
+
 
 # Specify the include directory for development headers
 #devincludepath=${includedir}/dali/internal
@@ -119,7 +149,7 @@ Configuration
 -------------
   Prefix:                           $prefix
   Debug Build:                      $enable_debug
-  JavaScript support (V8 required)  $enable_javascript
+  JavaScript support (V8 required)  $build_javascript_plugin
   Profile:                          $dali_profile
   Data Dir (Read/Write):            $dataReadWriteDir
   Data Dir (Read Only):             $dataReadOnlyDir
index 65c3807..b6cf664 100644 (file)
@@ -560,7 +560,7 @@ INPUT                  = ../../../docs/content \
                          ../../../../dali-adaptor/plugins \
                          ../../../../dali-adaptor/platform-abstractions/interfaces \
                          ../../../../dali-adaptor/platform-abstractions/portable \
-                         ../../../../dali-adaptor/platform-abstractions/slp \
+                         ../../../../dali-adaptor/platform-abstractions/tizen \
                          ../../../dali-toolkit \
                          ../../../texture-atlas-exporter \
                          ../../../../dali/automated-tests \
index 92ff833..e072023 100644 (file)
@@ -231,6 +231,10 @@ TAB_SIZE               = 2
 # newlines.
 
 ALIASES                =
+# Clip alias inserts the specified file between two text markers.
+# EG: @clip{"button.h",public,private}
+# Shows all lines between public and private *inclusive*.
+ALIASES += clip{3}="\dontinclude \1 \n \skip \2 \n \until \3"
 
 # This tag can be used to specify a number of word-keyword mappings (TCL only).
 # A mapping has the form "name=value". For example adding "class=itcl::class"
@@ -859,7 +863,7 @@ EXCLUDE_SYMBOLS        = DaliInternal \
 # that contain example code fragments that are included (see the \include
 # command).
 
-EXAMPLE_PATH           =
+EXAMPLE_PATH           = @DOXYGEN_DOCS_DIR@/../
 
 # If the value of the EXAMPLE_PATH tag contains directories, you can use the
 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
@@ -953,7 +957,7 @@ INLINE_SOURCES         = NO
 # Fortran comments will always remain visible.
 # The default value is: YES.
 
-STRIP_CODE_COMMENTS    = YES
+STRIP_CODE_COMMENTS    = NO
 
 # If the REFERENCED_BY_RELATION tag is set to YES then for each documented
 # function all documented functions referencing it will be listed.
index d80dd67..bb89f6c 100644 (file)
@@ -20,7 +20,6 @@ plugin_src_dir = ../../../plugins
 
 include ../../../plugins/dali-script-v8/file.list
 
-DALI_SCRIPTV8_LIBS="-lv8 -lpthread"
 
 lib_LTLIBRARIES = libdali-script-plugin-v8.la
 
@@ -31,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 = \
@@ -41,13 +39,12 @@ 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) \
-                            $(DALI_SCRIPTV8_CFLAGS) \
-                            -I../../.. \
                             $(script_plugin_v8_includes) \
                             -Werror -Wall
 
@@ -55,7 +52,7 @@ libdali_script_plugin_v8_la_LIBADD = \
                             $(DALICORE_LIBS) \
                             $(DALI_LIBS) \
                             $(DLOG_LIBS) \
-                            $(DALI_SCRIPTV8_LIBS)
+                            $(V8_LIBS)
 
 libdali_script_plugin_v8_la_LDFLAGS = \
                            -rdynamic
index db7861e..8e4120f 100644 (file)
@@ -56,8 +56,6 @@
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/item-view/navigation-layout.h>
-#include <dali-toolkit/public-api/controls/scrollable/item-view/roll-layout.h>
 #include <dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
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 8a0e1dd..5386db9 100644 (file)
@@ -529,6 +529,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 ) )
         {
@@ -770,7 +773,7 @@ Path Builder::GetPath( const std::string& name )
           if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
           {
             ret = Path::New();
-            ret.SetProperty( Path::Property::Points, points);
+            ret.SetProperty( Path::Property::POINTS, points);
 
             //control-points property
             if( OptionalChild pointsProperty = IsChild( *path, "control-points") )
@@ -778,7 +781,7 @@ Path Builder::GetPath( const std::string& name )
               Dali::Property::Value points(Property::ARRAY);
               if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
               {
-                ret.SetProperty( Path::Property::ControlPoints, points);
+                ret.SetProperty( Path::Property::CONTROL_POINTS, points);
               }
             }
             else
index 40428e3..0efd85b 100644 (file)
@@ -43,12 +43,12 @@ using namespace Dali;
 // Signal Actions
 //
 
-// Action on child actor. The child is found by alias so can be 'previous' etc.
+// Action on child actor. The child is found by name
 struct ChildActorAction
 {
   std::string actorName;
   std::string actionName;
-  std::string childAlias;
+  std::string childName;
   PropertyValueContainer parameters;
 
   void operator()(void)
@@ -57,7 +57,7 @@ struct ChildActorAction
 
     if(actor)
     {
-      Actor child_actor = actor.FindChildByAlias(childAlias);
+      Actor child_actor = actor.FindChildByName(childName);
 
       if(child_actor)
       {
@@ -65,7 +65,7 @@ struct ChildActorAction
       }
       else
       {
-        DALI_SCRIPT_WARNING("Could not find child by alias '%s'\n", childAlias.c_str());
+        DALI_SCRIPT_WARNING("Could not find child by name '%s'\n", childName.c_str());
       }
     }
   };
@@ -239,7 +239,7 @@ boost::function<void (void)> GetAction(const TreeNode &root, const TreeNode &chi
   {
     ChildActorAction action;
     action.actorName       = *actorName;
-    action.childAlias      = *childActorName;
+    action.childName       = *childActorName;
     action.actionName      = *actionName;
     GetParameters(child, action.parameters);
     callback = action;
index 17dfff6..9713587 100644 (file)
@@ -21,8 +21,8 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/property-input.h>
 #include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
+#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/public-api/size-negotiation/relayout-container.h>
 
 namespace Dali
 {
@@ -42,7 +42,8 @@ BaseHandle Create()
   return Toolkit::Alignment::New();
 }
 
-TypeRegistration mType( typeid(Toolkit::Alignment), typeid(Toolkit::Control), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Alignment, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
 
 struct ScaleToFillConstraint
 {
@@ -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 dfbebc4..0221785 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 // INTERNAL INCLUDES
@@ -52,7 +53,8 @@ BaseHandle Create()
   return Toolkit::BloomView::New();
 }
 
-TypeRegistration mType( typeid(Toolkit::BloomView), typeid(Toolkit::Control), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::BloomView, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
 
 // default parameters
 const float BLOOM_THRESHOLD_DEFAULT = 0.25f;
@@ -72,14 +74,13 @@ const float BLOOM_GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_HEIGHT_SCALE = 0.5f;
 
 const float ARBITRARY_FIELD_OF_VIEW = Math::PI / 4.0f;
 
-const std::string BLOOM_BLUR_STRENGTH_PROPERTY_NAME( "BlurStrengthProperty" );
-
-const std::string BLOOM_THRESHOLD_PROPERTY_NAME( "uBloomThreshold" );
-const std::string RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME( "uRecipOneMinusBloomThreshold" );
-const std::string BLOOM_INTENSITY_PROPERTY_NAME( "uBloomIntensity" );
-const std::string BLOOM_SATURATION_PROPERTY_NAME( "uBloomSaturation" );
-const std::string IMAGE_INTENSITY_PROPERTY_NAME( "uImageIntensity" );
-const std::string IMAGE_SATURATION_PROPERTY_NAME( "uImageSaturation" );
+const char* const BLOOM_BLUR_STRENGTH_PROPERTY_NAME = "BlurStrengthProperty";
+const char* const BLOOM_THRESHOLD_PROPERTY_NAME = "uBloomThreshold";
+const char* const RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME = "uRecipOneMinusBloomThreshold";
+const char* const BLOOM_INTENSITY_PROPERTY_NAME = "uBloomIntensity";
+const char* const BLOOM_SATURATION_PROPERTY_NAME = "uBloomSaturation";
+const char* const IMAGE_INTENSITY_PROPERTY_NAME = "uImageIntensity";
+const char* const IMAGE_SATURATION_PROPERTY_NAME = "uImageSaturation";
 
 ///////////////////////////////////////////////////////
 //
@@ -334,7 +335,6 @@ void BloomView::AllocateResources()
     mRenderDownsampledCamera.SetNearClippingPlane(1.0f);
     mRenderDownsampledCamera.SetAspectRatio(mDownsampledWidth / mDownsampledHeight);
     mRenderDownsampledCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
-    mRenderDownsampledCamera.SetRotation(Quaternion(M_PI, Vector3::YAXIS)); // Rotate to look at origin
 
     mRenderDownsampledCamera.SetPosition(0.0f, 0.0f, ((mDownsampledHeight * 0.5f) / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f)));
 
@@ -344,7 +344,6 @@ void BloomView::AllocateResources()
     mRenderFullSizeCamera.SetNearClippingPlane(1.0f);
     mRenderFullSizeCamera.SetAspectRatio(mTargetSize.width / mTargetSize.height);
     mRenderFullSizeCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
-    mRenderFullSizeCamera.SetRotation(Quaternion(M_PI, Vector3::YAXIS)); // Rotate to look at origin
 
     float cameraPosConstraintScale = 0.5f / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f);
     mRenderFullSizeCamera.SetPosition(0.0f, 0.0f, mTargetSize.height * cameraPosConstraintScale);
index 4f7dd86..acf3a5a 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/scripting/scripting.h>
 
@@ -33,62 +34,43 @@ namespace Dali
 namespace Toolkit
 {
 
-const Property::Index Button::PROPERTY_DISABLED                     = Internal::Button::BUTTON_PROPERTY_START_INDEX;
-const Property::Index Button::PROPERTY_AUTO_REPEATING               = Internal::Button::BUTTON_PROPERTY_START_INDEX + 1;
-const Property::Index Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY = Internal::Button::BUTTON_PROPERTY_START_INDEX + 2;
-const Property::Index Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY    = Internal::Button::BUTTON_PROPERTY_START_INDEX + 3;
-const Property::Index Button::PROPERTY_TOGGLABLE                    = Internal::Button::BUTTON_PROPERTY_START_INDEX + 4;
-const Property::Index Button::PROPERTY_SELECTED                     = Internal::Button::BUTTON_PROPERTY_START_INDEX + 5;
-const Property::Index Button::PROPERTY_NORMAL_STATE_ACTOR           = Internal::Button::BUTTON_PROPERTY_START_INDEX + 6;
-const Property::Index Button::PROPERTY_SELECTED_STATE_ACTOR         = Internal::Button::BUTTON_PROPERTY_START_INDEX + 7;
-const Property::Index Button::PROPERTY_DISABLED_STATE_ACTOR         = Internal::Button::BUTTON_PROPERTY_START_INDEX + 8;
-const Property::Index Button::PROPERTY_LABEL_ACTOR                  = Internal::Button::BUTTON_PROPERTY_START_INDEX + 9;
-
 namespace Internal
 {
 
 namespace
 {
 
-const unsigned int INITIAL_AUTOREPEATING_DELAY( 0.15f );
-const unsigned int NEXT_AUTOREPEATING_DELAY( 0.05f );
-
-// Signals
-
-const char* const SIGNAL_PRESSED =       "pressed";
-const char* const SIGNAL_RELEASED =      "released";
-const char* const SIGNAL_CLICKED =       "clicked";
-const char* const SIGNAL_STATE_CHANGED = "state-changed";
-
-// Actions
-
-const char* const ACTION_BUTTON_CLICK =  "button-click";
-
 BaseHandle Create()
 {
   // empty handle as we cannot create button (but type registered for clicked signal)
   return BaseHandle();
 }
 
-TypeRegistration typeRegistration( typeid( Toolkit::Button ), typeid( Toolkit::Control ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Button, Toolkit::Control, Create );
+
+DALI_PROPERTY_REGISTRATION( Button, "disabled",                     BOOLEAN, DISABLED                     )
+DALI_PROPERTY_REGISTRATION( Button, "auto-repeating",               BOOLEAN, AUTO_REPEATING               )
+DALI_PROPERTY_REGISTRATION( Button, "initial-auto-repeating-delay", FLOAT,   INITIAL_AUTO_REPEATING_DELAY )
+DALI_PROPERTY_REGISTRATION( Button, "next-auto-repeating-delay",    FLOAT,   NEXT_AUTO_REPEATING_DELAY    )
+DALI_PROPERTY_REGISTRATION( Button, "togglable",                    BOOLEAN, TOGGLABLE                    )
+DALI_PROPERTY_REGISTRATION( Button, "selected",                     BOOLEAN, SELECTED                     )
+DALI_PROPERTY_REGISTRATION( Button, "normal-state-actor",           MAP,     NORMAL_STATE_ACTOR           )
+DALI_PROPERTY_REGISTRATION( Button, "selected-state-actor",         MAP,     SELECTED_STATE_ACTOR         )
+DALI_PROPERTY_REGISTRATION( Button, "disabled-state-actor",         MAP,     DISABLED_STATE_ACTOR         )
+DALI_PROPERTY_REGISTRATION( Button, "label-actor",                  MAP,     LABEL_ACTOR                  )
 
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_PRESSED , &Button::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, SIGNAL_RELEASED, &Button::DoConnectSignal );
-SignalConnectorType signalConnector3( typeRegistration, SIGNAL_CLICKED, &Button::DoConnectSignal );
-SignalConnectorType signalConnector4( typeRegistration, SIGNAL_STATE_CHANGED, &Button::DoConnectSignal );
+DALI_SIGNAL_REGISTRATION(   Button, "pressed",                               SIGNAL_PRESSED               )
+DALI_SIGNAL_REGISTRATION(   Button, "released",                              SIGNAL_RELEASED              )
+DALI_SIGNAL_REGISTRATION(   Button, "clicked",                               SIGNAL_CLICKED               )
+DALI_SIGNAL_REGISTRATION(   Button, "state-changed",                         SIGNAL_STATE_CHANGED         )
 
-TypeAction action1( typeRegistration, ACTION_BUTTON_CLICK, &Button::DoAction );
+DALI_ACTION_REGISTRATION(   Button, "button-click",                          ACTION_BUTTON_CLICK          )
 
-PropertyRegistration property1( typeRegistration, "disabled",                     Toolkit::Button::PROPERTY_DISABLED,                     Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property2( typeRegistration, "auto-repeating",               Toolkit::Button::PROPERTY_AUTO_REPEATING,               Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property3( typeRegistration, "initial-auto-repeating-delay", Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY, Property::FLOAT,   &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property4( typeRegistration, "next-auto-repeating-delay",    Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY,    Property::FLOAT,   &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property5( typeRegistration, "togglable",                    Toolkit::Button::PROPERTY_TOGGLABLE,                    Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property6( typeRegistration, "selected",                     Toolkit::Button::PROPERTY_SELECTED,                     Property::BOOLEAN, &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property7( typeRegistration, "normal-state-actor",           Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR,           Property::MAP,     &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property8( typeRegistration, "selected-state-actor",         Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR,         Property::MAP,     &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property9( typeRegistration, "disabled-state-actor",         Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR,         Property::MAP,     &Button::SetProperty, &Button::GetProperty );
-PropertyRegistration property10( typeRegistration, "label-actor",                 Toolkit::Button::PROPERTY_LABEL_ACTOR,                  Property::MAP,     &Button::SetProperty, &Button::GetProperty );
+DALI_TYPE_REGISTRATION_END()
+
+const unsigned int INITIAL_AUTOREPEATING_DELAY( 0.15f );
+const unsigned int NEXT_AUTOREPEATING_DELAY( 0.05f );
 
 } // unnamed namespace
 
@@ -636,61 +618,61 @@ void Button::SetProperty( BaseObject* object, Property::Index index, const Prope
   {
     switch ( index )
     {
-      case Toolkit::Button::PROPERTY_DISABLED:
+      case Toolkit::Button::Property::DISABLED:
       {
         GetImplementation( button ).SetDisabled( value.Get<bool>() );
         break;
       }
 
-      case Toolkit::Button::PROPERTY_AUTO_REPEATING:
+      case Toolkit::Button::Property::AUTO_REPEATING:
       {
         GetImplementation( button ).SetAutoRepeating( value.Get< bool >() );
         break;
       }
 
-      case Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY:
+      case Toolkit::Button::Property::INITIAL_AUTO_REPEATING_DELAY:
       {
         GetImplementation( button ).SetInitialAutoRepeatingDelay( value.Get< float >() );
         break;
       }
 
-      case Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY:
+      case Toolkit::Button::Property::NEXT_AUTO_REPEATING_DELAY:
       {
         GetImplementation( button ).SetNextAutoRepeatingDelay( value.Get< float >() );
         break;
       }
 
-      case Toolkit::Button::PROPERTY_TOGGLABLE:
+      case Toolkit::Button::Property::TOGGLABLE:
       {
         GetImplementation( button ).SetTogglableButton( value.Get< bool >() );
         break;
       }
 
-      case Toolkit::Button::PROPERTY_SELECTED:
+      case Toolkit::Button::Property::SELECTED:
       {
         GetImplementation( button ).SetSelected( value.Get< bool >() );
         break;
       }
 
-      case Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR:
+      case Toolkit::Button::Property::NORMAL_STATE_ACTOR:
       {
         GetImplementation( button ).SetButtonImage( Scripting::NewActor( value.Get< Property::Map >() ) );
         break;
       }
 
-      case Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR:
+      case Toolkit::Button::Property::SELECTED_STATE_ACTOR:
       {
         GetImplementation( button ).SetSelectedImage( Scripting::NewActor( value.Get< Property::Map >() ) );
         break;
       }
 
-      case Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR:
+      case Toolkit::Button::Property::DISABLED_STATE_ACTOR:
       {
         GetImplementation( button ).SetDisabledImage( Scripting::NewActor( value.Get< Property::Map >() ) );
         break;
       }
 
-      case Toolkit::Button::PROPERTY_LABEL_ACTOR:
+      case Toolkit::Button::Property::LABEL_ACTOR:
       {
         GetImplementation( button ).SetLabel( Scripting::NewActor( value.Get< Property::Map >() ) );
         break;
@@ -709,43 +691,43 @@ Property::Value Button::GetProperty( BaseObject* object, Property::Index propert
   {
     switch ( propertyIndex )
     {
-      case Toolkit::Button::PROPERTY_DISABLED:
+      case Toolkit::Button::Property::DISABLED:
       {
         value = GetImplementation( button ).mDisabled;
         break;
       }
 
-      case Toolkit::Button::PROPERTY_AUTO_REPEATING:
+      case Toolkit::Button::Property::AUTO_REPEATING:
       {
         value = GetImplementation( button ).mAutoRepeating;
         break;
       }
 
-      case Toolkit::Button::PROPERTY_INITIAL_AUTO_REPEATING_DELAY:
+      case Toolkit::Button::Property::INITIAL_AUTO_REPEATING_DELAY:
       {
         value = GetImplementation( button ).mInitialAutoRepeatingDelay;
         break;
       }
 
-      case Toolkit::Button::PROPERTY_NEXT_AUTO_REPEATING_DELAY:
+      case Toolkit::Button::Property::NEXT_AUTO_REPEATING_DELAY:
       {
         value = GetImplementation( button ).mNextAutoRepeatingDelay;
         break;
       }
 
-      case Toolkit::Button::PROPERTY_TOGGLABLE:
+      case Toolkit::Button::Property::TOGGLABLE:
       {
         value = GetImplementation( button ).mTogglableButton;
         break;
       }
 
-      case Toolkit::Button::PROPERTY_SELECTED:
+      case Toolkit::Button::Property::SELECTED:
       {
         value = GetImplementation( button ).mSelected;
         break;
       }
 
-      case Toolkit::Button::PROPERTY_NORMAL_STATE_ACTOR:
+      case Toolkit::Button::Property::NORMAL_STATE_ACTOR:
       {
         Property::Map map;
         Scripting::CreatePropertyMap( GetImplementation( button ).mButtonContent, map );
@@ -753,7 +735,7 @@ Property::Value Button::GetProperty( BaseObject* object, Property::Index propert
         break;
       }
 
-      case Toolkit::Button::PROPERTY_SELECTED_STATE_ACTOR:
+      case Toolkit::Button::Property::SELECTED_STATE_ACTOR:
       {
         Property::Map map;
         Scripting::CreatePropertyMap( GetImplementation( button ).mSelectedContent, map );
@@ -761,7 +743,7 @@ Property::Value Button::GetProperty( BaseObject* object, Property::Index propert
         break;
       }
 
-      case Toolkit::Button::PROPERTY_DISABLED_STATE_ACTOR:
+      case Toolkit::Button::Property::DISABLED_STATE_ACTOR:
       {
         Property::Map map;
         Scripting::CreatePropertyMap( GetImplementation( button ).mDisabledContent, map );
@@ -769,7 +751,7 @@ Property::Value Button::GetProperty( BaseObject* object, Property::Index propert
         break;
       }
 
-      case Toolkit::Button::PROPERTY_LABEL_ACTOR:
+      case Toolkit::Button::Property::LABEL_ACTOR:
       {
         Property::Map map;
         Scripting::CreatePropertyMap( GetImplementation( button ).mLabel, map );
index 2c4c115..f9dee5a 100644 (file)
@@ -41,14 +41,6 @@ namespace Internal
  */
 class Button : public Control
 {
-public:
-
-  // Properties
-  enum
-  {
-    BUTTON_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
-    BUTTON_PROPERTY_END_INDEX = BUTTON_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
-  };
 
 protected:
 
@@ -533,4 +525,3 @@ inline const Toolkit::Internal::Button& GetImplementation( const Toolkit::Button
 } // namespace Dali
 
 #endif // __DALI_TOOLKIT_INTERNAL_BUTTON_H__
-
index b535498..0da7949 100644 (file)
@@ -82,6 +82,12 @@ CheckBoxButton::~CheckBoxButton()
   }
 }
 
+void CheckBoxButton::OnButtonInitialize()
+{
+  // Wrap around all children
+  Self().SetResizePolicy( FIT_TO_CHILDREN, ALL_DIMENSIONS );
+}
+
 void CheckBoxButton::SetSelectedImage( Actor image )
 {
   Actor& selectedImage = GetSelectedImage();
@@ -236,7 +242,7 @@ void CheckBoxButton::OnLabelSet()
   {
     label.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
     label.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
-    label.MoveBy( DISTANCE_BETWEEN_IMAGE_AND_LABEL );
+    label.TranslateBy( DISTANCE_BETWEEN_IMAGE_AND_LABEL );
 
     if( IsDisabled() && GetDisabledBackgroundImage() )
     {
@@ -382,38 +388,6 @@ void CheckBoxButton::OnDisabled( bool disabled )
   }
 }
 
-void CheckBoxButton::OnRelayout( const Vector2& size, ActorSizeContainer& container )
-{
-  Vector3 newSize;
-
-  if( IsDisabled() && GetDisabledBackgroundImage() )
-  {
-    newSize = GetDisabledBackgroundImage().GetNaturalSize();
-  }
-  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 );
-}
-
 void CheckBoxButton::AddChild( Actor& actor )
 {
   if( actor )
@@ -454,7 +428,7 @@ void CheckBoxButton::StartCheckInAnimation( Actor& actor )
     mCheckInAnimation.AnimateTo( Property( mTickUVEffect, mTickUVEffect.GetBottomRightPropertyName() ), Vector2( 1.0f, 1.0f ) );
 
     // Actor size anim
-    mCheckInAnimation.AnimateTo( Property( actor, Actor::Property::ScaleX ), 1.0f );
+    mCheckInAnimation.AnimateTo( Property( actor, Actor::Property::SCALE_X ), 1.0f );
 
     mCheckInAnimation.FinishedSignal().Connect( this, &CheckBoxButton::CheckInAnimationFinished );
     mCheckInAnimation.Play();
index 9d4335a..47b91ae 100644 (file)
@@ -76,6 +76,12 @@ public: // From Button
 
 private: // From Button
 
+
+  /**
+   * @copydoc Toolkit::Internal::Button::OnButtonInitialize()
+   */
+  virtual void OnButtonInitialize();
+
   /**
    * @copydoc Toolkit::Internal::Button::OnLabelSet()
    */
@@ -91,13 +97,6 @@ private: // From Button
    */
   virtual void OnDisabled( bool disabled );
 
-private: // From Control
-
-  /**
-   * @copydoc Dali::Toolkit::Control::OnRelayout()
-   */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
-
 private:
 
   /**
index 4aae15b..c96d56d 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
 {
@@ -124,7 +123,7 @@ void PushButton::SetButtonImage( Actor image )
 
         buttonImage = image;
 
-        FadeInImage( buttonImage );
+        FadeInImage( buttonImage, 0.0f, 0 );
 
         StartFadeOutAnimation();
         StartFadeInAnimation();
@@ -132,7 +131,7 @@ void PushButton::SetButtonImage( Actor image )
       else
       {
         buttonImage = image;
-        Self().Add( buttonImage );
+        Self().Insert( 0, buttonImage );
       }
       break;
     }
@@ -149,7 +148,7 @@ void PushButton::SetButtonImage( Actor image )
       // Replaces the button image.
       buttonImage = image;
 
-      Self().Add( buttonImage );
+      Self().Insert( 0, buttonImage );
       FadeOutImage( Foreground, buttonImage, opacity );
 
       StartFadeOutAnimation();
@@ -163,7 +162,7 @@ void PushButton::SetButtonImage( Actor image )
 
       buttonImage = image;
 
-      FadeInImage( buttonImage );
+      FadeInImage( buttonImage, 0.0f, 0 );
       StartFadeInAnimation();
       break;
     }
@@ -175,7 +174,8 @@ void PushButton::SetButtonImage( Actor image )
   buttonImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   buttonImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
   buttonImage.SetPosition( 0.f, 0.f, FOREGROUND_DEPTH );
-  buttonImage.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  buttonImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
+  buttonImage.SetName( "BUTTON_IMAGE" );
 }
 
 void PushButton::SetSelectedImage( Actor image )
@@ -194,7 +194,7 @@ void PushButton::SetSelectedImage( Actor image )
 
         selectedImage = image;
 
-        FadeInImage( selectedImage );
+        FadeInImage( selectedImage, 0.0f, 0 );
 
         StartFadeOutAnimation();
         StartFadeInAnimation();
@@ -202,7 +202,7 @@ void PushButton::SetSelectedImage( Actor image )
       else
       {
         selectedImage = image;
-        Self().Add( selectedImage );
+        Self().Insert( 0, selectedImage );
       }
       break;
     }
@@ -219,7 +219,7 @@ void PushButton::SetSelectedImage( Actor image )
       // Replaces the button image.
       selectedImage = image;
 
-      Self().Add( selectedImage );
+      Self().Insert( 0, selectedImage );
       FadeOutImage( Foreground, selectedImage, opacity );
 
       StartFadeOutAnimation();
@@ -233,7 +233,7 @@ void PushButton::SetSelectedImage( Actor image )
 
       selectedImage = image;
 
-      FadeInImage( selectedImage );
+      FadeInImage( selectedImage, 0.0f, 0 );
       StartFadeInAnimation();
       break;
     }
@@ -245,7 +245,7 @@ void PushButton::SetSelectedImage( Actor image )
   selectedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   selectedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
   selectedImage.SetPosition( 0.f, 0.f, FOREGROUND_DEPTH );
-  selectedImage.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  selectedImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 }
 
 void PushButton::SetBackgroundImage( Actor image )
@@ -267,7 +267,7 @@ void PushButton::SetBackgroundImage( Actor image )
 
         backgroundImage = image;
 
-        FadeInImage( backgroundImage );
+        FadeInImage( backgroundImage, 0.0f, 0 );
 
         StartFadeOutAnimation();
         StartFadeInAnimation();
@@ -275,7 +275,7 @@ void PushButton::SetBackgroundImage( Actor image )
       else
       {
         backgroundImage = image;
-        Self().Add( backgroundImage );
+        Self().Insert( 0, backgroundImage );
       }
       break;
     }
@@ -292,7 +292,7 @@ void PushButton::SetBackgroundImage( Actor image )
       // Replaces the button image.
       backgroundImage = image;
 
-      Self().Add( backgroundImage );
+      Self().Insert( 0, backgroundImage );
       FadeOutImage( Background, backgroundImage, opacity );
 
       StartFadeOutAnimation();
@@ -306,7 +306,7 @@ void PushButton::SetBackgroundImage( Actor image )
 
       backgroundImage = image;
 
-      FadeInImage( backgroundImage );
+      FadeInImage( backgroundImage, 0.0f, 0 );
       StartFadeInAnimation();
       break;
     }
@@ -318,7 +318,7 @@ void PushButton::SetBackgroundImage( Actor image )
   backgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   backgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
   backgroundImage.SetPosition( 0.f, 0.f, BACKGROUND_DEPTH );
-  backgroundImage.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  backgroundImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 }
 
 void PushButton::SetDisabledImage( Actor image )
@@ -338,7 +338,7 @@ void PushButton::SetDisabledImage( Actor image )
 
         disabledImage = image;
 
-        FadeInImage( disabledImage );
+        FadeInImage( disabledImage, 0.0f, 0 );
 
         StartFadeOutAnimation();
         StartFadeInAnimation();
@@ -358,7 +358,7 @@ void PushButton::SetDisabledImage( Actor image )
 
       disabledImage = image;
 
-      FadeInImage( disabledImage );
+      FadeInImage( disabledImage, 0.0f, 0 );
       StartFadeInAnimation();
       break;
     }
@@ -389,7 +389,7 @@ void PushButton::SetDisabledImage( Actor image )
   disabledImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   disabledImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
   disabledImage.SetPosition( 0.f, 0.f, FOREGROUND_DEPTH );
-  disabledImage.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  disabledImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 }
 
 void PushButton::SetDisabledBackgroundImage( Actor image )
@@ -409,7 +409,7 @@ void PushButton::SetDisabledBackgroundImage( Actor image )
 
         disabledBackgroundImage = image;
 
-        FadeInImage( disabledBackgroundImage );
+        FadeInImage( disabledBackgroundImage, 0.0f, 0 );
 
         StartFadeOutAnimation();
         StartFadeInAnimation();
@@ -429,7 +429,7 @@ void PushButton::SetDisabledBackgroundImage( Actor image )
 
       disabledBackgroundImage = image;
 
-      FadeInImage( disabledBackgroundImage );
+      FadeInImage( disabledBackgroundImage, 0.0f, 0 );
       StartFadeInAnimation();
       break;
     }
@@ -460,7 +460,7 @@ void PushButton::SetDisabledBackgroundImage( Actor image )
   disabledBackgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   disabledBackgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
   disabledBackgroundImage.SetPosition( 0.f, 0.f, BACKGROUND_DEPTH );
-  disabledBackgroundImage.SetSizeMode( SIZE_EQUAL_TO_PARENT );
+  disabledBackgroundImage.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 }
 
 void PushButton::OnButtonInitialize()
@@ -468,6 +468,9 @@ void PushButton::OnButtonInitialize()
   // Push button requires the Leave event.
   Actor root = Self();
   root.SetLeaveRequired( true );
+
+  // Set resize policy to natural size so that buttons will resize to background images
+  root.SetResizePolicy( USE_NATURAL_SIZE, ALL_DIMENSIONS );
 }
 
 void PushButton::OnLabelSet()
@@ -497,7 +500,7 @@ void PushButton::OnSelected( bool selected )
     {
       StopFadeOutAnimation();
       FadeOutImage( Foreground, buttonImage );
-      FadeInImage( selectedImage );
+      FadeInImage( selectedImage, 0.0f, 0 );
       StartFadeOutAnimation();
       StartFadeInAnimation();
 
@@ -515,7 +518,7 @@ void PushButton::OnSelected( bool selected )
     {
       StopFadeOutAnimation();
       FadeOutImage( Foreground, selectedImage );
-      FadeInImage( buttonImage );
+      FadeInImage( buttonImage, 0.0f, 0 );
       StartFadeOutAnimation();
       StartFadeInAnimation();
 
@@ -540,7 +543,7 @@ void PushButton::OnSelected( bool selected )
       StopFadeInAnimation();
 
       FadeOutImage( Foreground, selectedImage, 1.f - opacity );
-      FadeInImage( buttonImage, opacity );
+      FadeInImage( buttonImage, opacity, 0 );
 
       StartFadeOutAnimation();
       StartFadeInAnimation();
@@ -566,7 +569,7 @@ void PushButton::OnSelected( bool selected )
       StopFadeInAnimation();
 
       FadeOutImage( Foreground, buttonImage, 1.f - opacity );
-      FadeInImage( selectedImage, opacity );
+      FadeInImage( selectedImage, opacity, 0 );
 
       StartFadeOutAnimation();
       StartFadeInAnimation();
@@ -606,8 +609,8 @@ void PushButton::OnDisabled( bool disabled )
       StopFadeOutAnimation();
       FadeOutImage( Background, backgroundImage );
       FadeOutImage( Foreground, buttonImage );
-      FadeInImage( disabledBackgroundImage );
-      FadeInImage( disabledImage );
+      FadeInImage( disabledBackgroundImage, 0.0f, 0 );
+      FadeInImage( disabledImage, 0.0f, 0 );
       StartFadeOutAnimation();
       StartFadeInAnimation();
 
@@ -629,8 +632,8 @@ void PushButton::OnDisabled( bool disabled )
       StopFadeOutAnimation();
       FadeOutImage( Background, backgroundImage );
       FadeOutImage( Foreground, selectedImage );
-      FadeInImage( disabledBackgroundImage );
-      FadeInImage( disabledImage );
+      FadeInImage( disabledBackgroundImage, 0.0f, 0 );
+      FadeInImage( disabledImage, 0.0f, 0 );
       StartFadeOutAnimation();
       StartFadeInAnimation();
 
@@ -652,8 +655,8 @@ void PushButton::OnDisabled( bool disabled )
       StopFadeOutAnimation();
       FadeOutImage( Background, disabledBackgroundImage );
       FadeOutImage( Foreground, disabledImage );
-      FadeInImage( backgroundImage );
-      FadeInImage( buttonImage );
+      FadeInImage( backgroundImage, 0.0f, 0 );
+      FadeInImage( buttonImage, 0.0f, 0 );
       StartFadeOutAnimation();
       StartFadeInAnimation();
 
@@ -675,8 +678,8 @@ void PushButton::OnDisabled( bool disabled )
       StopFadeOutAnimation();
       FadeOutImage( Background, disabledBackgroundImage );
       FadeOutImage( Foreground, disabledImage );
-      FadeInImage( backgroundImage );
-      FadeInImage( selectedImage );
+      FadeInImage( backgroundImage, 0.0f, 0 );
+      FadeInImage( selectedImage, 0.0f, 0 );
       StartFadeOutAnimation();
       StartFadeInAnimation();
 
@@ -706,8 +709,8 @@ void PushButton::OnDisabled( bool disabled )
       FadeOutImage( Foreground, selectedImage, 1.f - opacity );
       FadeOutImage( Background, backgroundImage );
 
-      FadeInImage( disabledImage );
-      FadeInImage( disabledBackgroundImage );
+      FadeInImage( disabledImage, 0.0f, 0 );
+      FadeInImage( disabledBackgroundImage, 0.0f, 0 );
 
       StartFadeOutAnimation();
       StartFadeInAnimation();
@@ -738,8 +741,8 @@ void PushButton::OnDisabled( bool disabled )
       FadeOutImage( Foreground, buttonImage, 1.f - opacity );
       FadeOutImage( Background, backgroundImage );
 
-      FadeInImage( disabledImage );
-      FadeInImage( disabledBackgroundImage );
+      FadeInImage( disabledImage, 0.0f, 0);
+      FadeInImage( disabledBackgroundImage, 0.0f, 0 );
 
       StartFadeOutAnimation();
       StartFadeInAnimation();
@@ -769,8 +772,8 @@ void PushButton::OnDisabled( bool disabled )
 
       FadeOutImage( Foreground, disabledImage, 1.f - opacity );
       FadeOutImage( Background, disabledBackgroundImage, 1.f - opacity );
-      FadeInImage( buttonImage, opacity );
-      FadeInImage( backgroundImage, opacity );
+      FadeInImage( buttonImage, opacity, 0 );
+      FadeInImage( backgroundImage, opacity, 0 );
 
       StartFadeOutAnimation();
       StartFadeInAnimation();
@@ -800,8 +803,8 @@ void PushButton::OnDisabled( bool disabled )
 
       FadeOutImage( Foreground, buttonImage, 1.f - opacity );
       FadeOutImage( Background, backgroundImage, 1.f - opacity );
-      FadeInImage( disabledImage, opacity );
-      FadeInImage( disabledBackgroundImage, opacity );
+      FadeInImage( disabledImage, opacity, 0 );
+      FadeInImage( disabledBackgroundImage, opacity, 0 );
 
       StartFadeOutAnimation();
       StartFadeInAnimation();
@@ -831,8 +834,8 @@ void PushButton::OnDisabled( bool disabled )
 
       FadeOutImage( Foreground, disabledImage, 1.f - opacity );
       FadeOutImage( Background, disabledBackgroundImage, 1.f - opacity );
-      FadeInImage( selectedImage, opacity );
-      FadeInImage( backgroundImage, opacity );
+      FadeInImage( selectedImage, opacity, 0 );
+      FadeInImage( backgroundImage, opacity, 0 );
 
       StartFadeOutAnimation();
       StartFadeInAnimation();
@@ -862,8 +865,8 @@ void PushButton::OnDisabled( bool disabled )
 
       FadeOutImage( Foreground, selectedImage, 1.f - opacity );
       FadeOutImage( Background, backgroundImage, 1.f - opacity );
-      FadeInImage( disabledImage, opacity );
-      FadeInImage( disabledBackgroundImage, opacity );
+      FadeInImage( disabledImage, opacity, 0 );
+      FadeInImage( disabledBackgroundImage, opacity, 0 );
 
       StartFadeOutAnimation();
       StartFadeInAnimation();
@@ -896,7 +899,7 @@ void PushButton::OnPressed()
     {
       StopFadeOutAnimation();
       FadeOutImage( Foreground, buttonImage );
-      FadeInImage( selectedImage );
+      FadeInImage( selectedImage, 0.0f, 0 );
       StartFadeOutAnimation();
       StartFadeInAnimation();
 
@@ -929,7 +932,7 @@ void PushButton::OnPressed()
       StopFadeInAnimation();
 
       FadeOutImage( Foreground, buttonImage, 1.f - opacity );
-      FadeInImage( selectedImage, opacity );
+      FadeInImage( selectedImage, opacity, 0 );
 
       StartFadeOutAnimation();
       StartFadeInAnimation();
@@ -961,7 +964,7 @@ void PushButton::OnReleased()
     {
       StopFadeOutAnimation();
       FadeOutImage( Foreground, selectedImage );
-      FadeInImage( buttonImage );
+      FadeInImage( buttonImage, 0.0f, 0 );
       StartFadeOutAnimation();
       StartFadeInAnimation();
 
@@ -986,7 +989,7 @@ void PushButton::OnReleased()
       StopFadeInAnimation();
 
       FadeOutImage( Foreground, selectedImage, 1.f - opacity );
-      FadeInImage( buttonImage, opacity );
+      FadeInImage( buttonImage, opacity, 0 );
 
       StartFadeOutAnimation();
       StartFadeInAnimation();
@@ -1041,7 +1044,7 @@ Vector3 PushButton::GetNaturalSize()
     ImageActor imageActor = FindImageActor( GetButtonImage() );
     if( imageActor && imageActor.GetStyle() != ImageActor::STYLE_NINE_PATCH )
     {
-      Vector3 imageSize = RelayoutHelper::GetNaturalSize( imageActor );
+      Vector3 imageSize = imageActor.GetNaturalSize();
 
       if( widthIsZero )
       {
@@ -1057,7 +1060,7 @@ Vector3 PushButton::GetNaturalSize()
     ImageActor backgroundImageActor = FindImageActor( GetBackgroundImage() );
     if( backgroundImageActor && backgroundImageActor.GetStyle() != ImageActor::STYLE_NINE_PATCH )
     {
-      Vector3 imageSize = RelayoutHelper::GetNaturalSize( backgroundImageActor );
+      Vector3 imageSize = backgroundImageActor.GetNaturalSize();
 
       if( widthIsZero )
       {
@@ -1176,14 +1179,21 @@ void PushButton::StopFadeOutAnimation( bool remove )
   }
 }
 
-void PushButton::FadeInImage( Actor& image, float opacity )
+void PushButton::FadeInImage( Actor& image, float opacity, int priority )
 {
   if( image )
   {
     image.SetOpacity( opacity );
     if( !image.GetParent() )
     {
-      Self().Add( image );
+      if( priority > -1 )
+      {
+        Self().Insert( priority, image );
+      }
+      else
+      {
+        Self().Add( image );
+      }
     }
 
     AddToFadeInAnimation( image );
index 2784bab..89bce4b 100644 (file)
@@ -201,7 +201,7 @@ private:
    * @param[inout] image The actor.
    * @param[in] opacity The initial opacity.
    */
-  void FadeInImage( Actor& image, float opacity = 0.f );
+  void FadeInImage( Actor& image, float opacity = 0.f, int priority = -1 );
 
   /**
    * It adds the actor fade out animation and stores it to be removed when the animation finishes.
index d279697..05dba27 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,72 +72,48 @@ RadioButton::~RadioButton()
 {
 }
 
-void RadioButton::SetButtonImage( Actor image )
+void RadioButton::SetImage( Actor image )
 {
-  Actor& buttonImage = GetButtonImage();
+  mLayoutContainer.RemoveChildAt( Toolkit::TableView::CellPosition( 0, 0 ) );
+  mLayoutContainer.AddChild( image, Toolkit::TableView::CellPosition( 0, 0 ) );
 
-  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 );
-    }
-  }
+  RelayoutRequest();
+}
 
+void RadioButton::SetButtonImage( Actor image )
+{
+  Actor& buttonImage = GetButtonImage();
   buttonImage = image;
-
-  buttonImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  buttonImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
 }
 
 void RadioButton::SetSelectedImage( Actor image )
 {
   Actor& selectedImage = GetSelectedImage();
-
-  if( IsSelected() )
-  {
-    if( selectedImage && selectedImage.GetParent() )
-    {
-      selectedImage.GetParent().Remove( selectedImage );
-      selectedImage.Reset();
-    }
-
-    Self().Add( image );
-
-    Actor& label = GetLabel();
-
-    if( label )
-    {
-      selectedImage.Remove( label );
-      image.Add( label );
-    }
-  }
-
   selectedImage = image;
-
-  selectedImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  selectedImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
 }
 
 void RadioButton::OnButtonInitialize()
 {
+  Actor self = Self();
+
+  // Wrap size of radio button around all its children
+  self.SetResizePolicy( FIT_TO_CHILDREN, ALL_DIMENSIONS );
+
+  // Create the layout container empty at first
+  mLayoutContainer = Toolkit::TableView::New( 0, 0 );
+  mLayoutContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  mLayoutContainer.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  mLayoutContainer.SetResizePolicy( FIT_TO_CHILDREN, ALL_DIMENSIONS );
+  self.Add( mLayoutContainer );
+
   Image buttonImage = Dali::ResourceImage::New( UNSELECTED_BUTTON_IMAGE_DIR );
   Image selectedImage = Dali::ResourceImage::New( SELECTED_BUTTON_IMAGE_DIR );
 
   SetButtonImage( ImageActor::New( buttonImage ) );
   SetSelectedImage( ImageActor::New( selectedImage ) );
 
+  SetImage( GetButtonImage() );
+
   RelayoutRequest();
 }
 
@@ -148,7 +124,7 @@ void RadioButton::OnButtonUp()
     // Don't allow selection on an already selected radio button
     if( !IsSelected() )
     {
-      SetSelected(!IsSelected());
+      SetSelected( !IsSelected() );
     }
   }
 }
@@ -159,27 +135,16 @@ void RadioButton::OnLabelSet()
 
   if( label )
   {
-    label.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
-    label.SetAnchorPoint( AnchorPoint::CENTER_LEFT );
-    label.MoveBy( DISTANCE_BETWEEN_IMAGE_AND_LABEL );
+    // Add padding to the left of the label to create distance from the image
+    label.SetPadding( Padding( DISTANCE_BETWEEN_IMAGE_AND_LABEL, 0.0f, 0.0f, 0.0f ) );
 
-    if( IsSelected() )
-    {
-      GetSelectedImage().Add( label );
-    }
-    else
-    {
-      GetButtonImage().Add( label );
-    }
+    mLayoutContainer.RemoveChildAt( Toolkit::TableView::CellPosition( 0, 1 ) );
+    mLayoutContainer.AddChild( label, Toolkit::TableView::CellPosition( 0, 1 ) );
   }
 }
 
 void RadioButton::OnSelected( bool selected )
 {
-  Actor& buttonImage = GetButtonImage();
-  Actor& selectedImage = GetSelectedImage();
-  Actor& label = GetLabel();
-
   if( selected )
   {
     Actor parent = Self().GetParent();
@@ -187,69 +152,22 @@ void RadioButton::OnSelected( bool selected )
     {
       for( unsigned int i = 0; i < parent.GetChildCount(); ++i )
       {
-        Dali::Toolkit::RadioButton rbChild = Dali::Toolkit::RadioButton::DownCast(parent.GetChildAt(i));
-
-        if( rbChild )
+        Dali::Toolkit::RadioButton radioButtonChild = Dali::Toolkit::RadioButton::DownCast( parent.GetChildAt( i ) );
+        if( radioButtonChild )
         {
-          rbChild.SetSelected(false);
+          radioButtonChild.SetSelected( false );
         }
       }
     }
 
-    buttonImage.GetParent().Remove( buttonImage );
-    Self().Add( selectedImage );
-
-    if( label )
-    {
-      label.GetParent().Remove( label );
-      selectedImage.Add( label );
-    }
+    SetImage( GetSelectedImage() );
   }
   else
   {
-    selectedImage.GetParent().Remove( selectedImage );
-    Self().Add( buttonImage );
-
-    if( label )
-    {
-      label.GetParent().Remove( label );
-      buttonImage.Add( label );
-    }
+    SetImage( GetButtonImage() );
   }
 }
 
-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 );
-}
-
 } // namespace Internal
 
 } // namespace Toolkit
index db28905..917f9fe 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
@@ -104,12 +105,14 @@ private: // From Button
    */
   virtual void OnLabelSet();
 
-private: // From Control
+private:
 
   /**
-   * @copydoc Dali::Toolkit::Control::OnRelayout()
+   * @brief Set the image to display
+   *
+   * @param[in] image The image to set
    */
-  virtual void OnRelayout( const Vector2& size, ActorSizeContainer& container );
+  void SetImage( Actor image );
 
 private:
 
@@ -118,6 +121,11 @@ private:
 
   // Undefined
   RadioButton& operator=( const RadioButton& origin );
+
+private:
+
+  Toolkit::TableView mLayoutContainer;      ///< Container to position button images and labels
+
 };
 
 } // namespace Internal
index 2aa8302..d4daf3c 100644 (file)
@@ -22,6 +22,7 @@
 #include <algorithm>
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
 
 using namespace Dali;
 
-namespace // unnamed namespace
-{
-
-const float CLUSTER_STYLE_CONSTRAINT_DURATION = 1.0f;
-
-}
-
 namespace Dali
 {
 
@@ -49,23 +43,21 @@ namespace Internal
 namespace
 {
 
-// Actions
-
-const char* const ACTION_EXPAND =    "expand";
-const char* const ACTION_COLLAPSE =  "collapse";
-const char* const ACTION_TRANSFORM = "transform";
-
 BaseHandle Create()
 {
   Toolkit::ClusterStyleStandard s = Toolkit::ClusterStyleStandard::New( Toolkit::ClusterStyleStandard::ClusterStyle1 );
   return Toolkit::Cluster::New( s );
 }
 
-TypeRegistration mType( typeid( Toolkit::Cluster ), typeid( Toolkit::Control ), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Cluster, Toolkit::Control, Create )
+
+DALI_ACTION_REGISTRATION( Cluster, "expand",    ACTION_EXPAND    )
+DALI_ACTION_REGISTRATION( Cluster, "collapse",  ACTION_COLLAPSE  )
+DALI_ACTION_REGISTRATION( Cluster, "transform", ACTION_TRANSFORM )
 
-TypeAction a1( mType, ACTION_EXPAND,    &Cluster::DoAction );
-TypeAction a2( mType, ACTION_COLLAPSE,  &Cluster::DoAction );
-TypeAction a3( mType, ACTION_TRANSFORM, &Cluster::DoAction );
+DALI_TYPE_REGISTRATION_END()
+
+const float CLUSTER_STYLE_CONSTRAINT_DURATION = 1.0f;
 
 }
 
@@ -351,9 +343,9 @@ void Cluster::TransformChild( unsigned int index, const Vector3& position, const
 
       child.RemoveConstraints();
       Animation animation = Animation::New(period.delaySeconds + period.durationSeconds);
-      animation.AnimateTo( Property(child, Actor::Property::Position), position, AlphaFunctions::EaseOut, period);
-      animation.AnimateTo( Property(child, Actor::Property::Scale), scale, AlphaFunctions::EaseOut, period);
-      animation.AnimateTo( Property(child, Actor::Property::Rotation), rotation, AlphaFunctions::EaseOut, period);
+      animation.AnimateTo( Property(child, Actor::Property::POSITION), position, AlphaFunctions::EaseOut, period);
+      animation.AnimateTo( Property(child, Actor::Property::SCALE), scale, AlphaFunctions::EaseOut, period);
+      animation.AnimateTo( Property(child, Actor::Property::ORIENTATION), rotation, AlphaFunctions::EaseOut, period);
       animation.Play();
     }
   }
index 18a5e9d..1084302 100644 (file)
@@ -328,7 +328,7 @@ void ClusterStyle::Apply( Actor actor,
   {
     actor.SetPosition( position );
     actor.SetSize( size );
-    actor.SetRotation( rotation );
+    actor.SetOrientation( rotation );
     actor.SetScale( scale );
   }
 }
@@ -470,7 +470,6 @@ void ClusterStyleRandom::ApplyStyle(Actor child, unsigned int index, AlphaFuncti
   Property::Index depthProperty = child.GetPropertyIndex(Toolkit::Cluster::CLUSTER_ACTOR_DEPTH);
   float depthPropertyValue = child.GetProperty<float>( depthProperty );
 
-
   Apply( child,
          FirstOrderEquation( GetClusterSize(), Vector3(position.x, position.y, 0.0f), Vector3(0.0f, 0.0f, depthPropertyValue) ),
          FirstOrderEquation( GetClusterSize(), Vector3::ONE * size),
index 9f26fd7..d229ceb 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 // INTERNAL INCLUDES
@@ -48,21 +49,24 @@ Dali::BaseHandle Create()
   return Toolkit::EffectsView::New();
 }
 
-Dali::TypeRegistration mType( typeid(Dali::Toolkit::EffectsView), typeid(Dali::Toolkit::Control), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::EffectsView, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
 
 const Pixel::Format EFFECTS_VIEW_DEFAULT_PIXEL_FORMAT = Pixel::RGBA8888;
 const float         ARBITRARY_FIELD_OF_VIEW = Math::PI / 4.0f;
 const Vector4       EFFECTS_VIEW_DEFAULT_BACKGROUND_COLOR( 1.0f, 1.0f, 1.0f, 0.0 );
 const bool          EFFECTS_VIEW_REFRESH_ON_DEMAND(false);
-// custom properties
+
+// Custom properties
+const char* const   EFFECT_SIZE_PROPERTY_NAME = "EffectSize";
+const char* const   EFFECT_STRENGTH_PROPERTY_NAME = "EffectStrength";
+const char* const   EFFECT_OFFSET_PROPERTY_NAME = "EffectOffset";
+const char* const   EFFECT_COLOR_PROPERTY_NAME = "EffectColor";
+
 const float         EFFECT_SIZE_DEFAULT( 1.0f );
-const std::string   EFFECT_SIZE_PROPERTY_NAME( "EffectSize" );
 const float         EFFECT_STRENGTH_DEFAULT( 0.5f );
-const std::string   EFFECT_STRENGTH_PROPERTY_NAME( "EffectStrength" );
 const Vector3       EFFECT_OFFSET_DEFAULT( 0.0f, 0.0f, 0.0f );
-const std::string   EFFECT_OFFSET_PROPERTY_NAME( "EffectOffset" );
 const Vector4       EFFECT_COLOR_DEFAULT( Color::WHITE );
-const std::string   EFFECT_COLOR_PROPERTY_NAME( "EffectColor" );
 
 const char* const EFFECTS_VIEW_FRAGMENT_SOURCE =
     "void main()\n"
@@ -267,8 +271,8 @@ void EffectsView::SetupProperties()
   mEffectStrengthPropertyIndex = self.RegisterProperty(EFFECT_STRENGTH_PROPERTY_NAME, EFFECT_STRENGTH_DEFAULT, Property::READ_WRITE);
   mEffectOffsetPropertyIndex   = self.RegisterProperty(EFFECT_OFFSET_PROPERTY_NAME, EFFECT_OFFSET_DEFAULT);
   mEffectColorPropertyIndex    = self.RegisterProperty(EFFECT_COLOR_PROPERTY_NAME, EFFECT_COLOR_DEFAULT);
-  mActorPostFilter.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Position, Source( self, mEffectOffsetPropertyIndex ), EqualToConstraint() ) );
-  mActorPostFilter.ApplyConstraint( Constraint::New<Vector4>( Actor::Property::Color, Source( self, mEffectColorPropertyIndex ), EqualToConstraint() ) );
+  mActorPostFilter.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::POSITION, Source( self, mEffectOffsetPropertyIndex ), EqualToConstraint() ) );
+  mActorPostFilter.ApplyConstraint( Constraint::New<Vector4>( Actor::Property::COLOR, Source( self, mEffectColorPropertyIndex ), EqualToConstraint() ) );
 }
 
 void EffectsView::SetBackgroundColor( const Vector4& color )
@@ -461,7 +465,6 @@ void EffectsView::SetupCameras()
   mCameraForChildren.SetAspectRatio(mTargetSize.width / mTargetSize.height);
   mCameraForChildren.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
   mCameraForChildren.SetPosition(0.0f, 0.0f, mTargetSize.height * cameraPosScale);
-  mCameraForChildren.SetRotation(Quaternion(M_PI, Vector3::YAXIS));
   mCameraForChildren.SetZ( mTargetSize.height * cameraPosScale );
 }
 
index f1359c7..5a5e501 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/integration-api/debug.h>
 
@@ -40,7 +41,6 @@
 // Manager object - re-use render targets if there are multiple GaussianBlurViews created
 
 
-
 /////////////////////////////////////////////////////////
 // IMPLEMENTATION NOTES
 
@@ -85,14 +85,14 @@ BaseHandle Create()
   return Toolkit::GaussianBlurView::New();
 }
 
-TypeRegistration mType( typeid(Toolkit::GaussianBlurView), typeid(Toolkit::Control), Create );
-
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::GaussianBlurView, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
 
 const unsigned int GAUSSIAN_BLUR_VIEW_DEFAULT_NUM_SAMPLES = 5;
 const float GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_BELL_CURVE_WIDTH = 1.5f;
 const Pixel::Format GAUSSIAN_BLUR_VIEW_DEFAULT_RENDER_TARGET_PIXEL_FORMAT = Pixel::RGBA8888;
 const float GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH = 1.0f;                                       // default, fully blurred
-const std::string GAUSSIAN_BLUR_VIEW_STRENGTH_PROPERTY_NAME("GaussianBlurStrengthPropertyName");
+const char* const GAUSSIAN_BLUR_VIEW_STRENGTH_PROPERTY_NAME = "GaussianBlurStrengthPropertyName";
 const float GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_WIDTH_SCALE = 0.5f;
 const float GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_HEIGHT_SCALE = 0.5f;
 
@@ -300,7 +300,7 @@ void GaussianBlurView::OnInitialize()
     mImageActorComposite.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
     mImageActorComposite.SetOpacity(GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH); // ensure alpha is enabled for this object and set default value
 
-    Constraint blurStrengthConstraint = Constraint::New<float>( Actor::Property::ColorAlpha, ParentSource(mBlurStrengthPropertyIndex), EqualToConstraintFloat());
+    Constraint blurStrengthConstraint = Constraint::New<float>( Actor::Property::COLOR_ALPHA, ParentSource(mBlurStrengthPropertyIndex), EqualToConstraintFloat());
     mImageActorComposite.ApplyConstraint(blurStrengthConstraint);
 
     // Create an ImageActor for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task
@@ -408,8 +408,6 @@ void GaussianBlurView::AllocateResources()
     mRenderDownsampledCamera.SetNearClippingPlane(1.0f);
     mRenderDownsampledCamera.SetAspectRatio(mDownsampledWidth / mDownsampledHeight);
     mRenderDownsampledCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
-    // Point the camera back into the scene
-    mRenderDownsampledCamera.SetRotation(Quaternion(M_PI, Vector3::YAXIS));
 
     mRenderDownsampledCamera.SetPosition(0.0f, 0.0f, ((mDownsampledHeight * 0.5f) / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f)));
 
@@ -422,8 +420,6 @@ void GaussianBlurView::AllocateResources()
       mRenderFullSizeCamera.SetNearClippingPlane(1.0f);
       mRenderFullSizeCamera.SetAspectRatio(mTargetSize.width / mTargetSize.height);
       mRenderFullSizeCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
-      // Point the camera back into the scene
-      mRenderFullSizeCamera.SetRotation(Quaternion(M_PI, Vector3::YAXIS));
 
       float cameraPosConstraintScale = 0.5f / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f);
       mRenderFullSizeCamera.SetPosition(0.0f, 0.0f, mTargetSize.height * cameraPosConstraintScale);
index 2dbe35c..2dc796c 100644 (file)
@@ -524,7 +524,7 @@ void MaskedImageView::Initialize( unsigned int targetWidth,
   self.Add( mSourceImageActor );
   mSourceImageActor.SetParentOrigin( ParentOrigin::CENTER );
   mSourceImageActor.SetPositionInheritanceMode( DONT_INHERIT_POSITION );
-  mSourceImageActor.SetInheritRotation( false );
+  mSourceImageActor.SetInheritOrientation( false );
   mSourceImageActor.SetInheritScale( false );
   mSourceImageActor.SetColorMode( USE_OWN_COLOR );
   mSourceImageActor.SetSize( Vector3::ONE );
@@ -545,7 +545,7 @@ void MaskedImageView::Initialize( unsigned int targetWidth,
   mRenderTask.SetInputEnabled( false );
   mRenderTask.SetExclusive( true );
   mRenderTask.SetClearEnabled( true );
-  mRenderTask.ApplyConstraint( Constraint::New<Vector4>( RenderTask::Property::ClearColor,
+  mRenderTask.ApplyConstraint( Constraint::New<Vector4>( RenderTask::Property::CLEAR_COLOR,
                                                          Source( self, mCustomProperties[ Dali::Toolkit::MaskedImageView::BACKGROUND_COLOR ] ),
                                                          EqualToConstraint() ) );
   mRenderTask.FinishedSignal().Connect( this, &MaskedImageView::OnRenderTaskFinished );
index b9749da..37e5776 100644 (file)
@@ -192,7 +192,7 @@ void Magnifier::Initialize()
   mSourceActor = Actor::New();
   Stage().GetCurrent().Add(mSourceActor);
   mSourceActor.SetParentOrigin(ParentOrigin::CENTER);
-  Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+  Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                                     Source( self, mPropertySourcePosition ),
                                                     EqualToConstraint() );
   mSourceActor.ApplyConstraint(constraint);
@@ -224,23 +224,23 @@ void Magnifier::Initialize()
   // at the end of the update cycle i.e. after constraints have been applied.)
   //Property::Index propertySourcePositionDelayed = mCameraActor.RegisterProperty("delayed-source-position", Vector3::ZERO);
 
-  constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                         Source( mSourceActor, Actor::Property::WorldPosition ),
+  constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+                                         Source( mSourceActor, Actor::Property::WORLD_POSITION ),
                                          CameraActorPositionConstraint(stageSize, mDefaultCameraDistance) );
   mCameraActor.ApplyConstraint(constraint);
 
   // Apply constraint to render-task viewport position
-  constraint = Constraint::New<Vector2>( RenderTask::Property::ViewportPosition,
-                                         Source( self, Actor::Property::WorldPosition ),//mPropertySourcePosition ),
-                                         Source( self, Actor::Property::Size ),
-                                         Source( self, Actor::Property::WorldScale ),
+  constraint = Constraint::New<Vector2>( RenderTask::Property::VIEWPORT_POSITION,
+                                         Source( self, Actor::Property::WORLD_POSITION ),//mPropertySourcePosition ),
+                                         Source( self, Actor::Property::SIZE ),
+                                         Source( self, Actor::Property::WORLD_SCALE ),
                                          RenderTaskViewportPositionConstraint(stageSize) );
   mTask.ApplyConstraint(constraint);
 
   // Apply constraint to render-task viewport position
-  constraint = Constraint::New<Vector2>( RenderTask::Property::ViewportSize,
-                                         Source( self, Actor::Property::Size ),
-                                         Source( self, Actor::Property::WorldScale ),
+  constraint = Constraint::New<Vector2>( RenderTask::Property::VIEWPORT_SIZE,
+                                         Source( self, Actor::Property::SIZE ),
+                                         Source( self, Actor::Property::WORLD_SCALE ),
                                          RenderTaskViewportSizeConstraint() );
   mTask.ApplyConstraint(constraint);
 }
@@ -263,7 +263,6 @@ void Magnifier::InitializeRenderTask()
 
   mCameraActor = CameraActor::New();
   mCameraActor.SetType(Camera::FREE_LOOK);
-  mCameraActor.SetRotation(Quaternion(M_PI, Vector3::YAXIS)); // Look at stage
 
   stage.Add(mCameraActor);
   mTask.SetCameraActor( mCameraActor );
@@ -284,13 +283,14 @@ 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);
     mFrame.SetInheritScale(true);
 
-    Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                                      ParentSource( Actor::Property::WorldPosition ),
+    Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+                                                      ParentSource( Actor::Property::WORLD_POSITION ),
                                                       EqualToConstraint() );
     mFrame.ApplyConstraint( constraint );
 
index 3c7e78a..91fb19f 100644 (file)
 #include <dali/public-api/animation/animation.h>
 #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
@@ -41,20 +43,18 @@ namespace Internal
 namespace // to register type
 {
 
-// Actions
-
-const char* const ACTION_PUSH = "push";
-const char* const ACTION_POP =  "pop";
-
 BaseHandle Create()
 {
   return Toolkit::NavigationControl::New();
 }
 
-TypeRegistration mType( typeid( Toolkit::NavigationControl ), typeid( Toolkit::Control ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::NavigationControl, Toolkit::Control, Create )
+
+DALI_ACTION_REGISTRATION( NavigationControl, "push", ACTION_PUSH )
+DALI_ACTION_REGISTRATION( NavigationControl, "pop",  ACTION_POP  )
 
-TypeAction a1( mType, ACTION_PUSH, &NavigationControl::DoAction );
-TypeAction a2( mType, ACTION_POP, &NavigationControl::DoAction );
+DALI_TYPE_REGISTRATION_END()
 
 }
 
@@ -285,7 +285,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 );
 
@@ -308,11 +308,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 a484d64..7ca18c9 100644 (file)
@@ -20,8 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
+#include <dali/public-api/object/type-registry-helper.h>
 
 namespace Dali
 {
@@ -40,7 +39,8 @@ BaseHandle Create()
   return Toolkit::Page::New();
 }
 
-TypeRegistration mType( typeid(Toolkit::Page), typeid(CustomActor), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Page, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
 
 } // unnamed namespace
 
index 64bac9a..8397530 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 namespace Dali
 {
@@ -33,7 +34,10 @@ namespace Internal
 namespace
 {
 using namespace Dali;
-TypeRegistration mType( typeid(Toolkit::PageTurnLandscapeView), typeid(Toolkit::PageTurnView), NULL );
+
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::PageTurnLandscapeView, Toolkit::PageTurnView, NULL )
+DALI_TYPE_REGISTRATION_END()
+
 }
 
 PageTurnLandscapeView::PageTurnLandscapeView( PageFactory& pageFactory, const Vector2& pageSize )
index 8b9d22f..ef5c223 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 namespace Dali
 {
@@ -34,13 +35,16 @@ namespace Internal
 namespace
 {
 using namespace Dali;
-TypeRegistration mType( typeid(Toolkit::PageTurnPortraitView), typeid(Toolkit::PageTurnView), NULL );
+
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::PageTurnPortraitView, Toolkit::PageTurnView, NULL )
+DALI_TYPE_REGISTRATION_END()
 
 // the panning speed threshold, no matter how far is the pan displacement, pan fast to left/right quickly (speed > 0.3) will turn over/back the page
 const float GESTURE_SPEED_THRESHOLD(0.3f);
 
 // the animation duration of turning the previous page back when an outwards flick is detected
 const float PAGE_TURN_OVER_ANIMATION_DURATION(0.5f);
+
 }
 
 PageTurnPortraitView::PageTurnPortraitView( PageFactory& pageFactory, const Vector2& pageSize )
@@ -150,7 +154,7 @@ void PageTurnPortraitView::OnPossibleOutwardsFlick( const Vector2& panPosition,
     animation.AnimateTo( Property( mTurnEffect[mIndex], mTurnEffect[mIndex].PageTurnEffect::GetCurrentCenterPropertyName() ),
                          originalCenter,
                          AlphaFunctions::EaseOut, PAGE_TURN_OVER_ANIMATION_DURATION*0.75f );
-    animation.AnimateBy( Property( actor, Actor::Property::Rotation ), AngleAxis( Degree( 180.0f ), Vector3::YAXIS ) ,AlphaFunctions::EaseOut );
+    animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), AngleAxis( Degree( 180.0f ), Vector3::YAXIS ) ,AlphaFunctions::EaseOut );
     animation.Play();
     ImageActor::DownCast(actor).SetCullFace( CullBack );
     animation.FinishedSignal().Connect( this, &PageTurnPortraitView::OnTurnedOver );
index f757f95..2f4ba6c 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/events/hit-test-algorithm.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 // INTERNAL INCLUDES
 
 using namespace Dali;
 
-namespace //unnamed namespace
+namespace //Unnamed namespace
 {
 // To register type
-TypeRegistration mType( typeid(Toolkit::PageTurnView), typeid(Toolkit::Control), NULL );
+
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::PageTurnView, Toolkit::Control, NULL )
+DALI_TYPE_REGISTRATION_END()
 
 // default grid density for page turn effect, 10 pixels by 10 pixels
 const float DEFAULT_GRID_DENSITY(10.0f);
@@ -311,7 +314,7 @@ void PageTurnView::OnInitialize()
   for( int i = 0; i < MAXIMUM_TURNING_NUM; i++ )
   {
     mTurnEffect[i] = Toolkit::PageTurnEffect::New( false );
-    mTurnEffect[i].SetProperty( ShaderEffect::Property::GridDensity, Property::Value( DEFAULT_GRID_DENSITY ) );
+    mTurnEffect[i].SetProperty( ShaderEffect::Property::GRID_DENSITY, Property::Value( DEFAULT_GRID_DENSITY ) );
     mTurnEffect[i].SetPageSize( mPageSize );
     mTurnEffect[i].SetShadowWidth(0.f);
     mTurnEffect[i].SetSpineShadowParameter( mSpineShadowParameter );
@@ -889,7 +892,7 @@ void PageTurnView::PanContinuing( const Vector2& gesturePosition )
         GetImpl( mTurnEffect[mIndex] ).ApplyInternalConstraint();
 
         float distance = offset.Length();
-        Constraint rotationConstraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
+        Constraint rotationConstraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
                                                                      Source( self, mPropertyPanDisplacement[mIndex] ),
                                                                      RotationConstraint(distance, mPageSize.width, mIsTurnBack[mPanActor]));
         mPanActor.ApplyConstraint( rotationConstraint );
index b0aa312..7b8e420 100755 (executable)
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/key-event.h>
 #include <dali/public-api/events/touch-event.h>
+#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>
-#include <dali/public-api/images/resource-image.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/buttons/button.h>
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/internal/controls/relayout-helper.h>
-#include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-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/focus-manager/keyboard-focus-manager-impl.h>
 
 using namespace Dali;
 
-namespace
-{
-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_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.
-const float POPUP_OUT_MARGIN_HEIGHT = 36.f;                   ///< Space between the screen edge and the popup edge in the vertical dimension.
-const float POPUP_TITLE_WIDTH = 648.0f;                       ///<Width of Popup Title
-const float POPUP_BUTTON_BG_HEIGHT = 96.f;                    ///< Height of Button Background.
-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);
-
-// Signals
-
-const char* const SIGNAL_TOUCHED_OUTSIDE = "touched-outside";
-const char* const SIGNAL_HIDDEN =          "hidden";
-
-// Properties
-
-const char* const PROPERTY_TITLE =         "title";
-const char* const PROPERTY_STATE =         "state";
-
-/**
- * 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
-
 namespace Dali
 {
 
@@ -116,14 +57,29 @@ BaseHandle Create()
   return Toolkit::Popup::New();
 }
 
-TypeRegistration typeRegistration( typeid( Toolkit::Popup ), typeid( Toolkit::Control ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Popup, Toolkit::Control, Create )
 
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TOUCHED_OUTSIDE, &Popup::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, SIGNAL_HIDDEN, &Popup::DoConnectSignal );
+DALI_SIGNAL_REGISTRATION( Popup, "touched-outside", SIGNAL_TOUCHED_OUTSIDE )
+DALI_SIGNAL_REGISTRATION( Popup, "hidden",          SIGNAL_HIDDEN          )
 
+DALI_TYPE_REGISTRATION_END()
 
-}
+// Properties
+const char* const PROPERTY_TITLE = "title";
+const char* const PROPERTY_STATE = "state";
 
+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.
+const float POPUP_OUT_MARGIN_HEIGHT = 36.f;                   ///< Space between the screen edge and the popup edge in the vertical dimension.
+const float POPUP_TITLE_WIDTH = 648.0f;                       ///<Width of Popup Title
+const float POPUP_BUTTON_BG_HEIGHT = 96.f;                    ///< Height of Button Background.
+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);
+
+} // unnamed namespace
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Popup
@@ -160,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 );
@@ -199,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 )
@@ -221,6 +199,7 @@ void Popup::OnPropertySet( Property::Index index, Property::Value propertyValue
 
 Popup::~Popup()
 {
+  mLayer.Unparent();
 }
 
 size_t Popup::GetButtonCount() const
@@ -231,26 +210,39 @@ 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( FILL_TO_PARENT, ALL_DIMENSIONS );
+  mBackgroundImage.SetAnchorPoint( AnchorPoint::CENTER );
+  mBackgroundImage.SetParentOrigin( ParentOrigin::CENTER );
+
+  mBackgroundImage.SetSizeMode( SIZE_FIXED_OFFSET_FROM_PARENT );
+  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.
@@ -259,12 +251,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 );
@@ -277,13 +277,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.SetDimensionDependency( HEIGHT, WIDTH ); // HeightForWidth
+    mPopupLayout.AddChild( mTitle, Toolkit::TableView::CellPosition( 0, 0 ) );
+  }
 
   RelayoutRequest();
 }
@@ -293,9 +300,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();
@@ -355,6 +390,8 @@ void Popup::ShowTail(const Vector3& position)
     mTailImage.SetParentOrigin(position);
     mTailImage.SetAnchorPoint(anchorPoint);
 
+    CreateFooter();
+
     mBottomBg.Add(mTailImage);
   }
 }
@@ -377,30 +414,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);
 }
@@ -409,19 +441,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)
   {
@@ -434,7 +459,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();
 
@@ -456,17 +480,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();
 
@@ -495,8 +518,7 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration
     }
   }
 
-  mBacking.SetSize( targetBackingSize );
-
+  Actor self = Self();
   if(duration > Math::MACHINE_EPSILON_1)
   {
     if ( mAnimation )
@@ -509,13 +531,13 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration
 
     if(mShowing)
     {
-      mAnimation.AnimateTo( Property(mBacking, Actor::Property::ColorAlpha), 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(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, 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::ColorAlpha), 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(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, 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);
@@ -523,7 +545,7 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration
   else
   {
     mBacking.SetOpacity( targetBackingAlpha );
-    mPopupBg.SetScale( targetSize );
+    self.SetScale( targetSize );
 
     HandleStateChangeComplete();
   }
@@ -532,9 +554,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
@@ -620,169 +642,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 );
-  }
-}
-
-void Popup::OnControlSizeSet( const Vector3& targetSize )
-{
-  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 ) );
+    mPopupLayout.AddChild( mContent, Toolkit::TableView::CellPosition( 1, 0 ) );
   }
-
 }
 
-void Popup::OnRelayout( const Vector2& size, ActorSizeContainer& container )
+void Popup::OnRelayout( const Vector2& size, RelayoutContainer& 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 );
+      }
+    }
   }
 }
 
@@ -834,13 +765,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;
   }
@@ -870,7 +801,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 a61f6f0..bae2b78 100755 (executable)
@@ -22,6 +22,7 @@
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/images/resource-image.h>
 
 // INTERNAL INCLUDES
@@ -102,11 +103,6 @@ namespace Dali
 namespace Toolkit
 {
 
-const Property::Index ScrollBar::PROPERTY_INDICATOR_HEIGHT_POLICY( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX );
-const Property::Index ScrollBar::PROPERTY_INDICATOR_FIXED_HEIGHT( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX + 1 );
-const Property::Index ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX + 2 );
-const Property::Index ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION( Internal::ScrollBar::SCROLLBAR_PROPERTY_START_INDEX + 3 );
-
 namespace Internal
 {
 
@@ -115,21 +111,25 @@ namespace
 
 using namespace Dali;
 
-const char* INDICATOR_HEIGHT_POLICY_NAME[] = {"Variable", "Fixed"};
-
 BaseHandle Create()
 {
   return Toolkit::ScrollBar::New();
 }
 
-TypeRegistration typeRegistration( typeid( Toolkit::ScrollBar ), typeid( Toolkit::ScrollComponent ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollBar, Toolkit::ScrollComponent, Create );
+
+DALI_PROPERTY_REGISTRATION( ScrollBar, "indicator-height-policy", STRING, INDICATOR_HEIGHT_POLICY         )
+DALI_PROPERTY_REGISTRATION( ScrollBar, "indicator-fixed-height",  FLOAT,  INDICATOR_FIXED_HEIGHT          )
+DALI_PROPERTY_REGISTRATION( ScrollBar, "indicator-show-duration", FLOAT,  INDICATOR_SHOW_DURATION         )
+DALI_PROPERTY_REGISTRATION( ScrollBar, "indicator-hide-duration", FLOAT,  INDICATOR_HIDE_DURATION         )
 
-const char* const SCROLL_POSITION_NOTIFIED_SIGNAL_NAME = "scroll-position-notified";
+DALI_SIGNAL_REGISTRATION(   ScrollBar, "scroll-position-notified",        SCROLL_POSITION_NOTIFIED_SIGNAL )
+
+DALI_TYPE_REGISTRATION_END()
+
+const char* INDICATOR_HEIGHT_POLICY_NAME[] = {"Variable", "Fixed"};
 
-PropertyRegistration property1( typeRegistration, "indicator-height-policy", Toolkit::ScrollBar::PROPERTY_INDICATOR_HEIGHT_POLICY, Property::STRING, &ScrollBar::SetProperty, &ScrollBar::GetProperty );
-PropertyRegistration property2( typeRegistration, "indicator-fixed-height",  Toolkit::ScrollBar::PROPERTY_INDICATOR_FIXED_HEIGHT,  Property::FLOAT,  &ScrollBar::SetProperty, &ScrollBar::GetProperty );
-PropertyRegistration property3( typeRegistration, "indicator-show-duration",  Toolkit::ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION,  Property::FLOAT,  &ScrollBar::SetProperty, &ScrollBar::GetProperty );
-PropertyRegistration property4( typeRegistration, "indicator-hide-duration",  Toolkit::ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION,  Property::FLOAT,  &ScrollBar::SetProperty, &ScrollBar::GetProperty );
 }
 
 ScrollBar::ScrollBar()
@@ -220,9 +220,9 @@ void ScrollBar::ApplyConstraints()
       mIndicator.RemoveConstraint(mIndicatorPositionConstraint);
     }
 
-    constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                           LocalSource( Actor::Property::Size ),
-                                           ParentSource( Actor::Property::Size ),
+    constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+                                           LocalSource( Actor::Property::SIZE ),
+                                           ParentSource( Actor::Property::SIZE ),
                                            Source( mScrollPositionObject, Toolkit::ScrollConnector::SCROLL_POSITION ),
                                            IndicatorPositionConstraint( mScrollConnector.GetMinLimit(), mScrollConnector.GetMaxLimit() ) );
     mIndicatorPositionConstraint = mIndicator.ApplyConstraint( constraint );
@@ -448,7 +448,7 @@ bool ScrollBar::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface*
   bool connected( true );
   Toolkit::ScrollBar scrollBar = Toolkit::ScrollBar::DownCast( handle );
 
-  if( 0 == strcmp( signalName.c_str(), SCROLL_POSITION_NOTIFIED_SIGNAL_NAME ) )
+  if( 0 == strcmp( signalName.c_str(), SCROLL_POSITION_NOTIFIED_SIGNAL ) )
   {
     scrollBar.ScrollPositionNotifiedSignal().Connect( tracker, functor );
   }
@@ -470,22 +470,22 @@ void ScrollBar::SetProperty( BaseObject* object, Property::Index index, const Pr
     ScrollBar& scrollBarImpl( GetImpl( scrollBar ) );
     switch( index )
     {
-      case Toolkit::ScrollBar::PROPERTY_INDICATOR_HEIGHT_POLICY:
+      case Toolkit::ScrollBar::Property::INDICATOR_HEIGHT_POLICY:
       {
         scrollBarImpl.OnIndicatorHeightPolicyPropertySet( value );
         break;
       }
-      case Toolkit::ScrollBar::PROPERTY_INDICATOR_FIXED_HEIGHT:
+      case Toolkit::ScrollBar::Property::INDICATOR_FIXED_HEIGHT:
       {
         scrollBarImpl.SetIndicatorFixedHeight(value.Get<float>());
         break;
       }
-      case Toolkit::ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION:
+      case Toolkit::ScrollBar::Property::INDICATOR_SHOW_DURATION:
       {
         scrollBarImpl.SetIndicatorShowDuration(value.Get<float>());
         break;
       }
-      case Toolkit::ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION:
+      case Toolkit::ScrollBar::Property::INDICATOR_HIDE_DURATION:
       {
         scrollBarImpl.SetIndicatorHideDuration(value.Get<float>());
         break;
@@ -505,22 +505,22 @@ Property::Value ScrollBar::GetProperty( BaseObject* object, Property::Index inde
     ScrollBar& scrollBarImpl( GetImpl( scrollBar ) );
     switch( index )
     {
-      case Toolkit::ScrollBar::PROPERTY_INDICATOR_HEIGHT_POLICY:
+      case Toolkit::ScrollBar::Property::INDICATOR_HEIGHT_POLICY:
       {
         value = INDICATOR_HEIGHT_POLICY_NAME[ scrollBarImpl.GetIndicatorHeightPolicy() ];
         break;
       }
-      case Toolkit::ScrollBar::PROPERTY_INDICATOR_FIXED_HEIGHT:
+      case Toolkit::ScrollBar::Property::INDICATOR_FIXED_HEIGHT:
       {
         value = scrollBarImpl.GetIndicatorFixedHeight();
         break;
       }
-      case Toolkit::ScrollBar::PROPERTY_INDICATOR_SHOW_DURATION:
+      case Toolkit::ScrollBar::Property::INDICATOR_SHOW_DURATION:
       {
         value = scrollBarImpl.GetIndicatorShowDuration();
         break;
       }
-      case Toolkit::ScrollBar::PROPERTY_INDICATOR_HIDE_DURATION:
+      case Toolkit::ScrollBar::Property::INDICATOR_HIDE_DURATION:
       {
         value = scrollBarImpl.GetIndicatorHideDuration();
         break;
index 6979c52..6826c0e 100755 (executable)
@@ -52,13 +52,6 @@ class ScrollBar : public ScrollComponentImpl
 
 public:
 
-  // Properties
-  enum
-  {
-    SCROLLBAR_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
-    SCROLLBAR_PROPERTY_END_INDEX = SCROLLBAR_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
-  };
-
   // Signals
   typedef Toolkit::ScrollBar::ScrollPositionNotifiedSignalType ScrollPositionNotifiedSignalType;
 
index eb8d82a..1dfced0 100755 (executable)
@@ -23,6 +23,7 @@
 #include <dali/public-api/animation/constraint.h>
 #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/images/resource-image.h>
 
 // INTERNAL INCLUDES
@@ -361,7 +362,8 @@ BaseHandle Create()
   return BaseHandle();
 }
 
-TypeRegistration mType( typeid(Toolkit::ScrollBarInternal), typeid(Toolkit::ScrollComponent), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollBarInternal, Toolkit::ScrollComponent, Create )
+DALI_TYPE_REGISTRATION_END()
 
 }
 
@@ -390,45 +392,45 @@ 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,
+  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)),
                                       ScrollBarInternalVisibilityConstraint );
   mSlider.ApplyConstraint( constraint );
   mSliderWrap.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( Actor::Property::Size,
+  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, Actor::Property::Size ),
+                                                   Source( target, Actor::Property::SIZE ),
                                                    ScrollBarInternalSizeConstraint( vertical ) );
   mSlider.ApplyConstraint( constraint );
   mSliderWrap.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
+  constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
                                             Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
                                             ScrollBarInternalRotationConstraint( vertical ) );
   mSlider.ApplyConstraint( constraint );
   mSliderWrap.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                         Source( mSlider, Actor::Property::Size),
+  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, Actor::Property::Size ),
+                                         Source( target, Actor::Property::SIZE ),
                                          ScrollBarInternalPositionConstraint(vertical) );
 
   mSlider.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                         Source( mSlider, Actor::Property::Size),
+  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, Actor::Property::Size ),
+                                         Source( target, Actor::Property::SIZE ),
                                          ScrollBarInternalPositionConstraint(vertical, true) );
   mSliderWrap.ApplyConstraint( constraint );
 
@@ -444,9 +446,9 @@ ScrollBarInternal::ScrollBarInternal(Toolkit::Scrollable& container, bool vertic
   mHitArea.SetPosition(0.0f, 0.0f, 0.2f);
 
   mContainer.AddOverlay( mHitArea );
-  constraint = Constraint::New<Vector3>( Actor::Property::Size,
+  constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
                                          Source( target, target.GetPropertyIndex( Toolkit::Scrollable::SCROLL_DIRECTION_PROPERTY_NAME ) ),
-                                         Source( target, Actor::Property::Size ),
+                                         Source( target, Actor::Property::SIZE ),
                                          ScrollBarInternalHitSizeConstraint(vertical, BAR_TAB_SIZE.width) );
   mHitArea.ApplyConstraint( constraint );
 
index ede38ed..f27dc2f 100644 (file)
@@ -28,6 +28,7 @@
 #include <dali/public-api/events/mouse-wheel-event.h>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
@@ -37,11 +38,13 @@ using std::string;
 using std::set;
 using namespace Dali;
 
-namespace // unnamed namespace
+namespace // Unnamed namespace
 {
 
 //Type registration
-TypeRegistration mType( typeid(Toolkit::ItemView), typeid(Toolkit::Scrollable), NULL );
+
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ItemView, Toolkit::Scrollable, NULL )
+DALI_TYPE_REGISTRATION_END()
 
 const float DEFAULT_MINIMUM_SWIPE_SPEED = 1.0f;
 const float DEFAULT_MINIMUM_SWIPE_DISTANCE = 3.0f;
@@ -122,8 +125,7 @@ struct OvershootOverlayRotationConstraint
     const float parentOvershoot = parentOvershootProperty.GetFloat();
     const Toolkit::ControlOrientation::Type& parentOrientation = static_cast<Toolkit::ControlOrientation::Type>(parentScrollDirection.z);
 
-    Quaternion rotation;
-
+    float multiplier = 0;
     if(Toolkit::IsVertical(parentOrientation))
     {
       if(fabsf(parentScrollDirection.y) <= Math::MACHINE_EPSILON_1)
@@ -131,21 +133,21 @@ struct OvershootOverlayRotationConstraint
         if( (parentOrientation == Toolkit::ControlOrientation::Up && parentOvershoot < Math::MACHINE_EPSILON_0)
             || (parentOrientation == Toolkit::ControlOrientation::Down && parentOvershoot > Math::MACHINE_EPSILON_0) )
         {
-          rotation = Quaternion(0.5f * Math::PI, Vector3::ZAXIS);
+          multiplier = 0.5f;
         }
         else
         {
-          rotation = Quaternion(1.5f * Math::PI, Vector3::ZAXIS);
+          multiplier = 1.5f;
         }
       }
       else if( (parentOvershoot > Math::MACHINE_EPSILON_0 && parentScrollDirection.y > Math::MACHINE_EPSILON_0)
             || (parentOvershoot < Math::MACHINE_EPSILON_0 && parentScrollDirection.y < Math::MACHINE_EPSILON_0) )
       {
-        rotation = Quaternion(0.0f, Vector3::ZAXIS);
+        multiplier = 0.0f;
       }
       else
       {
-        rotation = Quaternion(Math::PI, Vector3::ZAXIS);
+        multiplier = 1.0f;
       }
     }
     else
@@ -155,24 +157,26 @@ struct OvershootOverlayRotationConstraint
         if( (parentOrientation == Toolkit::ControlOrientation::Left && parentOvershoot > Math::MACHINE_EPSILON_0)
             ||(parentOrientation == Toolkit::ControlOrientation::Right && parentOvershoot < Math::MACHINE_EPSILON_0) )
         {
-          rotation = Quaternion(Math::PI, Vector3::ZAXIS);
+          multiplier = 1.0f;
         }
         else
         {
-          rotation = Quaternion(0.0f, Vector3::ZAXIS);
+          multiplier = 0.0f;
         }
       }
       else if( (parentOvershoot > Math::MACHINE_EPSILON_0 && parentScrollDirection.x > Math::MACHINE_EPSILON_0)
             || (parentOvershoot < Math::MACHINE_EPSILON_0 && parentScrollDirection.x < Math::MACHINE_EPSILON_0) )
       {
-        rotation = Quaternion(1.5f * Math::PI, Vector3::ZAXIS);
+        multiplier = 1.5f;
       }
       else
       {
-        rotation = Quaternion(0.5f * Math::PI, Vector3::ZAXIS);
+        multiplier = 0.5f;
       }
     }
 
+    Quaternion rotation( Radian( multiplier * Math::PI ), Vector3::ZAXIS );
+
     return rotation;
   }
 };
@@ -357,12 +361,13 @@ 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 );
@@ -377,7 +382,7 @@ void ItemView::OnInitialize()
                                                    LocalSource(mPropertyPosition),
                                                    LocalSource(mPropertyPositionMin),
                                                    LocalSource(mPropertyPositionMax),
-                                                   LocalSource(Actor::Property::Size),
+                                                   LocalSource(Actor::Property::SIZE),
                                                    RelativePositionConstraint);
   self.ApplyConstraint(constraint);
 
@@ -455,7 +460,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;
@@ -467,34 +471,14 @@ 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.SetResizePolicy( FIXED, ALL_DIMENSIONS );
+      actor.SetPreferredSize( 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 );
@@ -565,6 +549,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)
@@ -1000,7 +995,8 @@ void ItemView::SetupActor( Item item, float durationSeconds )
     Vector3 size;
     if( mActiveLayout->GetItemSize( item.first, mActiveLayoutTargetSize, size ) )
     {
-      item.second.SetSize( size );
+      item.second.SetResizePolicy( FIXED, ALL_DIMENSIONS );
+      item.second.SetPreferredSize( size.GetVectorXY() );
     }
 
     mActiveLayout->ApplyConstraints( item.second, item.first, durationSeconds, mScrollPositionObject, Self() );
@@ -1562,28 +1558,28 @@ void ItemView::SetOvershootEnabled( bool enable )
   {
     Property::Index effectOvershootPropertyIndex = Property::INVALID_INDEX;
 
-    Constraint constraint = Constraint::New<Vector3>( Actor::Property::Size,
+    Constraint constraint = Constraint::New<Vector3>( Actor::Property::SIZE,
                                                       ParentSource( mPropertyScrollDirection ),
                                                       Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
-                                                      ParentSource( Actor::Property::Size ),
+                                                      ParentSource( Actor::Property::SIZE ),
                                                       OvershootOverlaySizeConstraint() );
     mOvershootOverlay.ApplyConstraint(constraint);
     mOvershootOverlay.SetSize(OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.width, OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height);
 
-    constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
+    constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
                                               ParentSource( mPropertyScrollDirection ),
                                               Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
                                               OvershootOverlayRotationConstraint() );
     mOvershootOverlay.ApplyConstraint(constraint);
 
-    constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                           ParentSource( Actor::Property::Size ),
+    constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+                                           ParentSource( Actor::Property::SIZE ),
                                            ParentSource( mPropertyScrollDirection ),
                                            Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ),
                                            OvershootOverlayPositionConstraint() );
     mOvershootOverlay.ApplyConstraint(constraint);
 
-    constraint = Constraint::New<bool>( Actor::Property::Visible,
+    constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
                                         ParentSource( mPropertyCanScrollVertical ),
                                         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 0ce8fda..613b0e8 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/property-index-ranges.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 namespace Dali
@@ -35,15 +36,13 @@ namespace Internal
 namespace
 {
 
-// Signals
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollConnector, Dali::BaseHandle, NULL )
 
-const char* const DOMAIN_CHANGED_SIGNAL_NAME =          "domain-changed";
-const char* const SCROLL_POSITION_CHANGED_SIGNAL_NAME = "scroll-position-changed";
+DALI_SIGNAL_REGISTRATION( ScrollConnector, "domain-changed",          DOMAIN_CHANGED_SIGNAL_NAME          )
+DALI_SIGNAL_REGISTRATION( ScrollConnector, "scroll-position-changed", SCROLL_POSITION_CHANGED_SIGNAL_NAME )
 
-TypeRegistration typeRegistration( typeid( Toolkit::ScrollConnector ), typeid( Dali::BaseHandle ), NULL );
-
-SignalConnectorType signalConnector1( typeRegistration, DOMAIN_CHANGED_SIGNAL_NAME , &ScrollConnector::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, SCROLL_POSITION_CHANGED_SIGNAL_NAME , &ScrollConnector::DoConnectSignal );
+DALI_TYPE_REGISTRATION_END()
 
 }
 
index 4d7049e..60cb127 100644 (file)
@@ -33,7 +33,7 @@ namespace Internal
 // ScrollBase
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-const std::string ScrollBase::SCROLL_DOMAIN_OFFSET_PROPERTY_NAME( "domain-offset" );
+const char* const ScrollBase::SCROLL_DOMAIN_OFFSET_PROPERTY_NAME = "domain-offset";
 
 ScrollBase::ScrollBase()
 : Scrollable(),
index 5ded775..968e3ab 100644 (file)
@@ -182,7 +182,7 @@ public:
 
 protected:
 
-  static const std::string SCROLL_DOMAIN_OFFSET_PROPERTY_NAME;
+  static const char* const SCROLL_DOMAIN_OFFSET_PROPERTY_NAME;
 
 protected:
 
index 8a1cdba..ea529ff 100644 (file)
@@ -230,33 +230,33 @@ void ApplyScrollCarouselConstraints(Toolkit::ScrollView scrollView,
   // Apply constraints to this actor //
   Constraint constraint;
 
-  constraint = Constraint::New<bool>( Actor::Property::Visible,
-                                      LocalSource( Actor::Property::Position ),
-                                      LocalSource( Actor::Property::Scale ),
-                                      LocalSource( Actor::Property::Size ),
+  constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
+                                      LocalSource( Actor::Property::POSITION ),
+                                      LocalSource( Actor::Property::SCALE ),
+                                      LocalSource( Actor::Property::SIZE ),
                                       Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
-                                      Source(scrollView, Actor::Property::Size ),
+                                      Source(scrollView, Actor::Property::SIZE ),
                                       Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ),
                                       boost::bind( &ScrollCarouselEffectInfo::VisibilityConstraint, info, _1, _2, _3, _4, _5, _6) );
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
-                                            LocalSource( Actor::Property::Position ),
-                                            LocalSource( Actor::Property::Scale ),
-                                            LocalSource( Actor::Property::Size ),
+  constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
+                                            LocalSource( Actor::Property::POSITION ),
+                                            LocalSource( Actor::Property::SCALE ),
+                                            LocalSource( Actor::Property::SIZE ),
                                             Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_POSITION_PROPERTY_NAME ) ),
-                                            Source(scrollView, Actor::Property::Size ),
+                                            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) );
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                         LocalSource( Actor::Property::Scale ),
-                                         LocalSource( Actor::Property::Size ),
+  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, Actor::Property::Size ),
+                                         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 d50ffb9..938ba1c 100644 (file)
@@ -303,36 +303,36 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
 {
   // Apply constraints to this actor //
   Constraint constraint;
-  constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
-                                         Source(parentPage, Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
                                          boost::bind( &ScrollCubeEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector4>( Actor::Property::Color,
-                                         Source(parentPage, Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
                                          boost::bind( &ScrollCubeEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                         Source(parentPage, Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
                                          boost::bind( &ScrollCubeEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
index 544b81c..8b6003f 100644 (file)
@@ -336,24 +336,24 @@ void ApplyScrollDepthConstraints(Toolkit::ScrollView scrollView,
                                  float scaleExtent)
 {
   // Scale Constraint
-  Constraint constraint = Constraint::New<Vector3>( Actor::Property::Scale,
-                                         LocalSource(Actor::Property::Position),
-                                         ParentSource(Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          ScrollDepthScaleConstraint( positionExtent, offsetExtent, positionScale, scaleExtent ) );
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
   // 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),
+  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, Actor::Property::Size ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
                                          ScrollDepthPositionConstraint( positionExtent, offsetExtent, positionScale ) );
 
index e110975..5111cec 100644 (file)
 #include <dali/public-api/events/mouse-wheel-event.h>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.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>
 
 //#define ENABLED_SCROLL_STATE_LOGGING
 
@@ -52,10 +53,6 @@ using namespace Dali;
 namespace
 {
 
-// Signals
-
-const char* const SIGNAL_SNAP_STARTED = "snap-started";
-
 const Vector2 DEFAULT_MIN_FLICK_DISTANCE(30.0f, 30.0f);                                   ///< minimum distance for pan before flick allowed
 const float DEFAULT_MIN_FLICK_SPEED_THRESHOLD(500.0f);                          ///< Minimum pan speed required for flick in pixels/s
 const float FREE_FLICK_SPEED_THRESHOLD = 200.0f;                                          ///< Free-Flick threshold in pixels/ms
@@ -208,6 +205,18 @@ namespace Internal
 namespace
 {
 
+BaseHandle Create()
+{
+  return Toolkit::ScrollView::New();
+}
+
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollView, Toolkit::Scrollable, Create )
+
+DALI_SIGNAL_REGISTRATION( ScrollView, "value-changed", SIGNAL_SNAP_STARTED )
+
+DALI_TYPE_REGISTRATION_END()
+
 /**
  * Returns whether to lock scrolling to a particular axis
  *
@@ -510,16 +519,6 @@ struct InternalFinalConstraint
   AlphaFunction mFunctionY;
 };
 
-
-BaseHandle Create()
-{
-  return Toolkit::ScrollView::New();
-}
-
-TypeRegistration typeRegistration( typeid( Toolkit::ScrollView ), typeid( Toolkit::Scrollable ), Create );
-
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_SNAP_STARTED, &ScrollView::DoConnectSignal );
-
 }
 
 
@@ -591,7 +590,7 @@ void ScrollView::OnInitialize()
   mInternalActor = Actor::New();
   mInternalActor.SetDrawMode(DrawMode::OVERLAY);
   self.Add(mInternalActor);
-  mInternalActor.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::Size, ParentSource( Actor::Property::Size ), EqualToConstraint() ) );
+  mInternalActor.ApplyConstraint( Constraint::New<Vector3>( Actor::Property::SIZE, ParentSource( Actor::Property::SIZE ), EqualToConstraint() ) );
   mInternalActor.SetParentOrigin(ParentOrigin::CENTER);
   mInternalActor.SetAnchorPoint(AnchorPoint::CENTER);
 
@@ -2613,8 +2612,8 @@ void ScrollView::UpdateMainInternalConstraint()
   if( mPanning )
   {
     constraint = Constraint::New<Vector3>( mPropertyPrePosition,
-                                                      Source( detector, PanGestureDetector::Property::LocalPosition ),
-                                                      Source( self, Actor::Property::Size ),
+                                                      Source( detector, PanGestureDetector::Property::LOCAL_POSITION ),
+                                                      Source( self, Actor::Property::SIZE ),
                                                       InternalPrePositionConstraint( mPanStartPosition, initialPanMask, mAxisAutoLock, mAxisAutoLockGradient, mLockAxis, mMaxOvershoot, mRulerX->GetDomain(), mRulerY->GetDomain() ) );
     mScrollMainInternalPrePositionConstraint = self.ApplyConstraint( constraint );
   }
@@ -2624,7 +2623,7 @@ void ScrollView::UpdateMainInternalConstraint()
                                          LocalSource( mPropertyPrePosition ),
                                          LocalSource( mPropertyPositionMin ),
                                          LocalSource( mPropertyPositionMax ),
-                                         Source( self, Actor::Property::Size ),
+                                         Source( self, Actor::Property::SIZE ),
                                          InternalPositionConstraint( mRulerX->GetDomain(),
                                                                      mRulerY->GetDomain(), mWrapMode ) );
   mScrollMainInternalPositionConstraint = self.ApplyConstraint( constraint );
@@ -2647,7 +2646,7 @@ void ScrollView::UpdateMainInternalConstraint()
                                          LocalSource( mPropertyPosition ),
                                          LocalSource( mPropertyPositionMin ),
                                          LocalSource( mPropertyPositionMax ),
-                                         LocalSource( Actor::Property::Size ),
+                                         LocalSource( Actor::Property::SIZE ),
                                          InternalRelativePositionConstraint );
   mScrollMainInternalRelativeConstraint = self.ApplyConstraint( constraint );
 
@@ -2703,17 +2702,17 @@ void ScrollView::SetInternalConstraints()
   Constraint constraint;
 
   // MoveActor (scrolling)
-  constraint = Constraint::New<Vector3>( Actor::Property::Position,
+  constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                          Source( self, mPropertyPosition ),
                                          MoveActorConstraint );
   constraint.SetRemoveAction(Constraint::Discard);
   ApplyConstraintToBoundActors(constraint);
 
   // WrapActor (wrap functionality)
-  constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                                 LocalSource( Actor::Property::Scale ),
-                                                 LocalSource( Actor::Property::AnchorPoint ),
-                                                 LocalSource( Actor::Property::Size ),
+  constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
+                                                 LocalSource( Actor::Property::SCALE ),
+                                                 LocalSource( Actor::Property::ANCHOR_POINT ),
+                                                 LocalSource( Actor::Property::SIZE ),
                                                  Source( self, mPropertyPositionMin ),
                                                  Source( self, mPropertyPositionMax ),
                                                  Source( self, mPropertyWrap ),
index 216572e..fb4578e 100644 (file)
@@ -190,24 +190,24 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
 {
   // Apply constraints to this actor //
   Constraint constraint;
-  constraint = Constraint::New<Vector4>( Actor::Property::Color,
-                                         LocalSource(Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
                                          boost::bind( &ScrollPageCarouselEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                         LocalSource(Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
                                          boost::bind( &ScrollPageCarouselEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
index 66e485e..27e43e1 100644 (file)
@@ -259,36 +259,36 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
 {
   // Apply constraints to this actor //
   Constraint constraint;
-  constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
-                                            LocalSource(Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                            Source(scrollView, Actor::Property::SIZE ),
                                             Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
                                             boost::bind( &ScrollPageCubeEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector4>( Actor::Property::Color,
-                                         LocalSource(Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
                                          boost::bind( &ScrollPageCubeEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                         LocalSource(Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_WRAP_PROPERTY_NAME ) ),
                                          boost::bind( &ScrollPageCubeEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
index 35bd6ed..b414458 100644 (file)
@@ -349,36 +349,36 @@ void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
 {
   // Apply constraints to this actor //
   Constraint constraint;
-  constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
-                                            LocalSource(Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                            Source(scrollView, Actor::Property::SIZE ),
                                             Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
                                             boost::bind( &ScrollPageSpiralEffectInfo::RotationConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector4>( Actor::Property::Color,
-                                         LocalSource(Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
                                          boost::bind( &ScrollPageSpiralEffectInfo::ColorConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
   constraint.SetRemoveAction( Constraint::Discard );
   child.ApplyConstraint( constraint );
 
-  constraint = Constraint::New<Vector3>( Actor::Property::Position,
-                                         LocalSource(Actor::Property::Position),
+  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, Actor::Property::Size ),
+                                         Source(scrollView, Actor::Property::SIZE ),
                                          Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollView::SCROLL_START_PAGE_POSITION_PROPERTY_NAME ) ),
                                          boost::bind( &ScrollPageSpiralEffectInfo::PositionConstraint, info, _1, _2, _3, _4, _5, _6, _7) );
 
index 87d31f8..0c73cd4 100644 (file)
@@ -17,6 +17,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
 
 using namespace Dali;
 
-namespace
-{
-
-} // unnamed namespace
-
 namespace Dali
 {
 
 namespace Toolkit
 {
 
-const Property::Index Scrollable::PROPERTY_OVERSHOOT_EFFECT_COLOR( Toolkit::Internal::Control::CONTROL_PROPERTY_END_INDEX + 1 );
-const Property::Index Scrollable::PROPERTY_OVERSHOOT_ANIMATION_SPEED( Toolkit::Internal::Control::CONTROL_PROPERTY_END_INDEX + 2 );
-
 namespace Internal
 {
 
 namespace
 {
-const Vector4 DEFAULT_OVERSHOOT_COLOUR(0.0f, 0.64f, 0.85f, 0.25f);
-const float DEFAULT_OVERSHOOT_ANIMATION_SPEED(120.0f); // 120 pixels per second
-
-// Signals
-
-const char* const SIGNAL_SCROLL_STARTED =   "scroll-started";
-const char* const SIGNAL_SCROLL_COMPLETED = "scroll-completed";
-const char* const SIGNAL_SCROLL_UPDATED =   "scroll-updated";
 
 BaseHandle Create()
 {
@@ -58,30 +43,25 @@ BaseHandle Create()
   return BaseHandle();
 }
 
-TypeRegistration mType( typeid( Toolkit::Scrollable ), typeid( Toolkit::Control ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Scrollable, Toolkit::Control, Create );
 
-SignalConnectorType s1( mType, SIGNAL_SCROLL_STARTED,   &Scrollable::DoConnectSignal );
-SignalConnectorType s2( mType, SIGNAL_SCROLL_COMPLETED, &Scrollable::DoConnectSignal );
-SignalConnectorType s3( mType, SIGNAL_SCROLL_UPDATED,   &Scrollable::DoConnectSignal );
+DALI_PROPERTY_REGISTRATION( Scrollable, "overshoot-effect-color",    VECTOR4, OVERSHOOT_EFFECT_COLOR    )
+DALI_PROPERTY_REGISTRATION( Scrollable, "overshoot-animation-speed", FLOAT,   OVERSHOOT_ANIMATION_SPEED )
 
-PropertyRegistration property1( mType,
-                                "overshoot-effect-color",
-                                Toolkit::Scrollable::PROPERTY_OVERSHOOT_EFFECT_COLOR,
-                                Property::VECTOR4,
-                                &Scrollable::SetProperty,
-                                &Scrollable::GetProperty );
+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     )
 
-PropertyRegistration property2( mType,
-                                "overshoot-animation-speed",
-                                Toolkit::Scrollable::PROPERTY_OVERSHOOT_ANIMATION_SPEED,
-                                Property::FLOAT,
-                                &Scrollable::SetProperty,
-                                &Scrollable::GetProperty );
+DALI_TYPE_REGISTRATION_END()
+
+const Vector4 DEFAULT_OVERSHOOT_COLOUR(0.0f, 0.64f, 0.85f, 0.25f);
+const float DEFAULT_OVERSHOOT_ANIMATION_SPEED(120.0f); // 120 pixels per second
 
 }
 
-const std::string Scrollable::SCROLLABLE_CAN_SCROLL_VERTICAL( "scrollable-can-scroll-vertical" );
-const std::string Scrollable::SCROLLABLE_CAN_SCROLL_HORIZONTAL( "scrollable-can-scroll-horizontal" );
+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
@@ -246,12 +226,12 @@ void Scrollable::SetProperty( BaseObject* object, Property::Index index, const P
     Scrollable& scrollableImpl( GetImpl( scrollable ) );
     switch( index )
     {
-      case Toolkit::Scrollable::PROPERTY_OVERSHOOT_EFFECT_COLOR:
+      case Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR:
       {
         scrollableImpl.SetOvershootEffectColor( value.Get<Vector4>() );
         break;
       }
-      case Toolkit::Scrollable::PROPERTY_OVERSHOOT_ANIMATION_SPEED:
+      case Toolkit::Scrollable::Property::OVERSHOOT_ANIMATION_SPEED:
       {
         scrollableImpl.SetOvershootAnimationSpeed( value.Get<float>() );
         break;
@@ -271,12 +251,12 @@ Property::Value Scrollable::GetProperty( BaseObject* object, Property::Index ind
     Scrollable& scrollableImpl( GetImpl( scrollable ) );
     switch( index )
     {
-      case Toolkit::Scrollable::PROPERTY_OVERSHOOT_EFFECT_COLOR:
+      case Toolkit::Scrollable::Property::OVERSHOOT_EFFECT_COLOR:
       {
         value = scrollableImpl.GetOvershootEffectColor();
         break;
       }
-      case Toolkit::Scrollable::PROPERTY_OVERSHOOT_ANIMATION_SPEED:
+      case Toolkit::Scrollable::Property::OVERSHOOT_ANIMATION_SPEED:
       {
         value = scrollableImpl.GetOvershootAnimationSpeed();
         break;
index 1bceb81..799ed62 100644 (file)
@@ -44,8 +44,8 @@ typedef IntrusivePtr<Scrollable> ScrollablePtr;
 class Scrollable : public Control
 {
 public:
-  static const std::string SCROLLABLE_CAN_SCROLL_VERTICAL;
-  static const std::string SCROLLABLE_CAN_SCROLL_HORIZONTAL;
+  static const char* const SCROLLABLE_CAN_SCROLL_VERTICAL;
+  static const char* const SCROLLABLE_CAN_SCROLL_HORIZONTAL;
 
   /**
    * Create a new Scrollable.
index 88e8599..5ce5e22 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/integration-api/debug.h>
 
@@ -69,8 +70,8 @@ BaseHandle Create()
   return Toolkit::ShadowView::New();
 }
 
-TypeRegistration mType( typeid(Toolkit::ShadowView), typeid(Toolkit::Control), Create );
-
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ShadowView, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
 
 const float BLUR_STRENGTH_DEFAULT = 1.0f;
 
@@ -79,12 +80,11 @@ const float DEFAULT_FIELD_OF_VIEW_RADIANS = Math::PI / 4.0f; // 45 degrees
 
 const Vector4 DEFAULT_SHADOW_COLOR = Vector4(0.2f, 0.2f, 0.2f, 0.8f);
 
-const std::string SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME( "uLightCameraProjectionMatrix" );
-const std::string SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME( "uLightCameraViewMatrix" );
-const std::string SHADER_SHADOW_COLOR_PROPERTY_NAME( "uShadowColor" );
-
-const std::string BLUR_STRENGTH_PROPERTY_NAME( "BlurStrengthProperty" );
-const std::string SHADOW_COLOR_PROPERTY_NAME( "ShadowColorProperty" );
+const char* const SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME = "uLightCameraProjectionMatrix";
+const char* const SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME = "uLightCameraViewMatrix";
+const char* const SHADER_SHADOW_COLOR_PROPERTY_NAME = "uShadowColor";
+const char* const BLUR_STRENGTH_PROPERTY_NAME = "BlurStrengthProperty";
+const char* const SHADOW_COLOR_PROPERTY_NAME = "ShadowColorProperty";
 
 const char* const RENDER_SHADOW_VERTEX_SOURCE =
   " uniform mediump mat4 uLightCameraProjectionMatrix;\n"
@@ -182,9 +182,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 +239,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);
@@ -249,7 +250,7 @@ void ShadowView::OnInitialize()
   // Target is constrained to point at the shadow plane origin
   mCameraActor.SetNearClippingPlane( 1.0f );
   mCameraActor.SetType( Dali::Camera::FREE_LOOK ); // Camera orientation constrained to point at shadow plane world position
-  mCameraActor.SetRotation(Radian(Degree(180)), Vector3::YAXIS);
+  mCameraActor.SetOrientation(Radian(Degree(180)), Vector3::YAXIS);
   mCameraActor.SetPosition(DEFAULT_LIGHT_POSITION);
 
   mShadowRenderShader = ShaderEffect::New( RENDER_SHADOW_VERTEX_SOURCE, RENDER_SHADOW_FRAGMENT_SOURCE,
@@ -275,9 +276,10 @@ void ShadowView::OnInitialize()
 
   mBlurRootActor = Actor::New();
 
+  mBlurRootActor.SetRelayoutEnabled( true );
   // Turn off inheritance to ensure filter renders properly
   mBlurRootActor.SetPositionInheritanceMode(USE_PARENT_POSITION);
-  mBlurRootActor.SetInheritRotation(false);
+  mBlurRootActor.SetInheritOrientation(false);
   mBlurRootActor.SetInheritScale(false);
   mBlurRootActor.SetColorMode(USE_OWN_COLOR);
 
@@ -315,15 +317,15 @@ void ShadowView::ConstrainCamera()
     // is under control of application, can't use transform inheritance)
 
     Constraint cameraOrientationConstraint =
-      Constraint::New<Quaternion> ( Actor::Property::Rotation,
-                                    Source( mShadowPlane, Actor::Property::WorldPosition ),
-                                    Source( mPointLight,  Actor::Property::WorldPosition ),
-                                    Source( mShadowPlane, Actor::Property::WorldRotation ),
+      Constraint::New<Quaternion> ( Actor::Property::ORIENTATION,
+                                    Source( mShadowPlane, Actor::Property::WORLD_POSITION ),
+                                    Source( mPointLight,  Actor::Property::WORLD_POSITION ),
+                                    Source( mShadowPlane, Actor::Property::WORLD_ORIENTATION ),
                                     &LookAt );
 
     mCameraActor.ApplyConstraint( cameraOrientationConstraint );
 
-    Constraint pointLightPositionConstraint = Constraint::New<Vector3>( Actor::Property::Position, Source( mPointLight, Actor::Property::WorldPosition ), EqualToConstraint() );
+    Constraint pointLightPositionConstraint = Constraint::New<Vector3>( Actor::Property::POSITION, Source( mPointLight, Actor::Property::WORLD_POSITION ), EqualToConstraint() );
 
     mCameraActor.ApplyConstraint( pointLightPositionConstraint );
   }
@@ -371,8 +373,8 @@ void ShadowView::SetShaderConstants()
   Property::Index lightCameraProjectionMatrixPropertyIndex = mShadowRenderShader.GetPropertyIndex(SHADER_LIGHT_CAMERA_PROJECTION_MATRIX_PROPERTY_NAME);
   Property::Index lightCameraViewMatrixPropertyIndex = mShadowRenderShader.GetPropertyIndex(SHADER_LIGHT_CAMERA_VIEW_MATRIX_PROPERTY_NAME);
 
-  Constraint projectionMatrixConstraint = Constraint::New<Dali::Matrix>( lightCameraProjectionMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::ProjectionMatrix ), EqualToConstraintMatrix());
-  Constraint viewMatrixConstraint = Constraint::New<Dali::Matrix>( lightCameraViewMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::ViewMatrix ), EqualToConstraintMatrix());
+  Constraint projectionMatrixConstraint = Constraint::New<Dali::Matrix>( lightCameraProjectionMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::PROJECTION_MATRIX ), EqualToConstraintMatrix());
+  Constraint viewMatrixConstraint = Constraint::New<Dali::Matrix>( lightCameraViewMatrixPropertyIndex, Source( mCameraActor, CameraActor::Property::VIEW_MATRIX ), EqualToConstraintMatrix());
 
   mShadowRenderShader.ApplyConstraint(projectionMatrixConstraint);
   mShadowRenderShader.ApplyConstraint(viewMatrixConstraint);
index ad1576d..0cd8783 100755 (executable)
@@ -22,6 +22,7 @@
 #include <sstream>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/images/resource-image.h>
 
 // INTERNAL INCLUDES
@@ -35,40 +36,46 @@ namespace Dali
 namespace Toolkit
 {
 
-// Properties
-const Property::Index Slider::LOWER_BOUND_PROPERTY             = Internal::Slider::SLIDER_PROPERTY_START_INDEX;
-const Property::Index Slider::UPPER_BOUND_PROPERTY             = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 1;
-
-const Property::Index Slider::VALUE_PROPERTY                   = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 2;
-const Property::Index Slider::HIT_REGION_PROPERTY              = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 3;
-const Property::Index Slider::BACKING_REGION_PROPERTY          = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 4;
-const Property::Index Slider::HANDLE_REGION_PROPERTY           = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 5;
-
-const Property::Index Slider::BACKING_IMAGE_NAME_PROPERTY      = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 6;
-const Property::Index Slider::HANDLE_IMAGE_NAME_PROPERTY       = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 7;
-const Property::Index Slider::PROGRESS_IMAGE_NAME_PROPERTY     = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 8;
-const Property::Index Slider::POPUP_IMAGE_NAME_PROPERTY        = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 9;
-const Property::Index Slider::POPUP_ARROW_IMAGE_NAME_PROPERTY  = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 10;
-
-const Property::Index Slider::DISABLE_COLOR_PROPERTY           = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 11;
-const Property::Index Slider::POPUP_TEXT_COLOR_PROPERTY        = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 12;
-
-const Property::Index Slider::VALUE_PRECISION_PROPERTY         = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 13;
-
-const Property::Index Slider::SHOW_POPUP_PROPERTY              = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 14;
-const Property::Index Slider::SHOW_VALUE_PROPERTY              = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 15;
-
-const Property::Index Slider::ENABLED_PROPERTY                 = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 16;
-
-const Property::Index Slider::MARKS_PROPERTY                   = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 17;
-const Property::Index Slider::SNAP_TO_MARKS_PROPERTY           = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 18;
-const Property::Index Slider::MARK_TOLERANCE_PROPERTY          = Internal::Slider::SLIDER_PROPERTY_START_INDEX + 19;
-
 namespace Internal
 {
 
-namespace
+namespace // Unnamed namespace
+{
+
+BaseHandle Create()
 {
+  return Dali::Toolkit::Slider::New();
+}
+
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Slider, Toolkit::Control, Create )
+
+DALI_PROPERTY_REGISTRATION( Slider, "lower-bound",            FLOAT,    LOWER_BOUND            )
+DALI_PROPERTY_REGISTRATION( Slider, "upper-bound",            FLOAT,    UPPER_BOUND            )
+DALI_PROPERTY_REGISTRATION( Slider, "value",                  FLOAT,    VALUE                  )
+DALI_PROPERTY_REGISTRATION( Slider, "hit-region",             VECTOR2,  HIT_REGION             )
+DALI_PROPERTY_REGISTRATION( Slider, "backing-region",         VECTOR2,  BACKING_REGION         )
+DALI_PROPERTY_REGISTRATION( Slider, "handle-region",          VECTOR2,  HANDLE_REGION          )
+DALI_PROPERTY_REGISTRATION( Slider, "backing-image-name",     STRING,   BACKING_IMAGE_NAME     )
+DALI_PROPERTY_REGISTRATION( Slider, "handle-image-name",      STRING,   HANDLE_IMAGE_NAME      )
+DALI_PROPERTY_REGISTRATION( Slider, "progress-image-name",    STRING,   PROGRESS_IMAGE_NAME    )
+DALI_PROPERTY_REGISTRATION( Slider, "popup-image-name",       STRING,   POPUP_IMAGE_NAME       )
+DALI_PROPERTY_REGISTRATION( Slider, "popup-arrow-image-name", STRING,   POPUP_ARROW_IMAGE_NAME )
+DALI_PROPERTY_REGISTRATION( Slider, "disable-color",          VECTOR4,  DISABLE_COLOR          )
+DALI_PROPERTY_REGISTRATION( Slider, "popup-text-color",       VECTOR4,  POPUP_TEXT_COLOR       )
+DALI_PROPERTY_REGISTRATION( Slider, "value-precision",        INTEGER,  VALUE_PRECISION        )
+DALI_PROPERTY_REGISTRATION( Slider, "show-popup",             BOOLEAN,  SHOW_POPUP             )
+DALI_PROPERTY_REGISTRATION( Slider, "show-value",             BOOLEAN,  SHOW_VALUE             )
+DALI_PROPERTY_REGISTRATION( Slider, "enabled",                BOOLEAN,  ENABLED                )
+DALI_PROPERTY_REGISTRATION( Slider, "marks",                  ARRAY,    MARKS                  )
+DALI_PROPERTY_REGISTRATION( Slider, "snap-to-marks",          BOOLEAN,  SNAP_TO_MARKS          )
+DALI_PROPERTY_REGISTRATION( Slider, "mark-tolerance",         FLOAT,    MARK_TOLERANCE         )
+
+DALI_SIGNAL_REGISTRATION(   Slider, "value-changed",                    SIGNAL_VALUE_CHANGED   )
+DALI_SIGNAL_REGISTRATION(   Slider, "mark",                             SIGNAL_MARK            )
+
+DALI_TYPE_REGISTRATION_END()
+
 const float BACKING_Z = -0.1f;
 const float PROGRESS_Z = 0.1f;
 const float HANDLE_Z = 1.0f;
@@ -115,50 +122,7 @@ const bool DEFAULT_SHOW_VALUE = true;
 const bool DEFAULT_ENABLED = true;
 const bool DEFAULT_SNAP_TO_MARKS = false;
 
-// Signals
-
-const char* const SIGNAL_VALUE_CHANGED = "value-changed";
-const char* const SIGNAL_MARK =          "mark";
-
-BaseHandle Create()
-{
-  return Dali::Toolkit::Slider::New();
-}
-
-TypeRegistration typeRegistration( typeid( Dali::Toolkit::Slider ), typeid( Dali::Toolkit::Control ), Create );
-
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_VALUE_CHANGED, &Toolkit::Internal::Slider::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, SIGNAL_MARK, &Toolkit::Internal::Slider::DoConnectSignal );
-
-PropertyRegistration property1( typeRegistration, "lower-bound",  Toolkit::Slider::LOWER_BOUND_PROPERTY, Property::FLOAT, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property2( typeRegistration, "upper-bound",  Toolkit::Slider::UPPER_BOUND_PROPERTY, Property::FLOAT, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property3( typeRegistration, "value",        Toolkit::Slider::VALUE_PROPERTY,       Property::FLOAT, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property4( typeRegistration, "hit-region",     Toolkit::Slider::HIT_REGION_PROPERTY,      Property::VECTOR2, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property5( typeRegistration, "backing-region", Toolkit::Slider::BACKING_REGION_PROPERTY,  Property::VECTOR2, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property6( typeRegistration, "handle-region",  Toolkit::Slider::HANDLE_REGION_PROPERTY,   Property::VECTOR2, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property7( typeRegistration, "backing-image-name",       Toolkit::Slider::BACKING_IMAGE_NAME_PROPERTY,      Property::STRING, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property8( typeRegistration, "handle-image-name",        Toolkit::Slider::HANDLE_IMAGE_NAME_PROPERTY,       Property::STRING, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property9( typeRegistration, "progress-image-name",      Toolkit::Slider::PROGRESS_IMAGE_NAME_PROPERTY,     Property::STRING, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property10( typeRegistration, "popup-image-name",        Toolkit::Slider::POPUP_IMAGE_NAME_PROPERTY,        Property::STRING, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property11( typeRegistration, "popup-arrow-image-name",  Toolkit::Slider::POPUP_ARROW_IMAGE_NAME_PROPERTY,  Property::STRING, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property12( typeRegistration, "disable-color",       Toolkit::Slider::DISABLE_COLOR_PROPERTY,     Property::VECTOR4, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property13( typeRegistration, "popup-text-color",    Toolkit::Slider::POPUP_TEXT_COLOR_PROPERTY,  Property::VECTOR4, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property14( typeRegistration, "value-precision",    Toolkit::Slider::VALUE_PRECISION_PROPERTY,  Property::INTEGER, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property15( typeRegistration, "show-popup",    Toolkit::Slider::SHOW_POPUP_PROPERTY,  Property::BOOLEAN, &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property16( typeRegistration, "show-value",    Toolkit::Slider::SHOW_VALUE_PROPERTY,  Property::BOOLEAN, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property17( typeRegistration, "enabled",       Toolkit::Slider::ENABLED_PROPERTY,  Property::BOOLEAN, &Slider::SetProperty, &Slider::GetProperty );
-
-PropertyRegistration property18( typeRegistration, "marks",          Toolkit::Slider::MARKS_PROPERTY,          Property::ARRAY,    &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property19( typeRegistration, "snap-to-marks",  Toolkit::Slider::SNAP_TO_MARKS_PROPERTY,  Property::BOOLEAN,  &Slider::SetProperty, &Slider::GetProperty );
-PropertyRegistration property20( typeRegistration, "mark-tolerance", Toolkit::Slider::MARK_TOLERANCE_PROPERTY, Property::FLOAT,    &Slider::SetProperty, &Slider::GetProperty );
-
-} // namespace
+} // Unnamed namespace
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // Slider
@@ -389,6 +353,7 @@ void Slider::DisplayValue( float value, bool raiseSignals )
     std::stringstream ss;
     ss.precision( GetValuePrecision() );
     ss << std::fixed << clampledValue;
+
     mHandleValueTextView.SetText( ss.str() );
   }
 }
@@ -433,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 );
@@ -462,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 );
@@ -537,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 );
@@ -547,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 );
@@ -559,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;
 }
@@ -567,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 );
 
@@ -832,16 +801,14 @@ bool Slider::MarkReached( float value, int& outIndex )
       outIndex = current;
       return true;
     }
+
+    if( value < mark )
+    {
+      tail = current - 1;
+    }
     else
     {
-      if( value < mark )
-      {
-        tail = current - 1;
-      }
-      else
-      {
-        head = current + 1;
-      }
+      head = current + 1;
     }
   }
 
@@ -1088,121 +1055,121 @@ void Slider::SetProperty( BaseObject* object, Property::Index propertyIndex, con
 
     switch ( propertyIndex )
     {
-      case Toolkit::Slider::LOWER_BOUND_PROPERTY:
+      case Toolkit::Slider::Property::LOWER_BOUND:
       {
         sliderImpl.SetLowerBound( value.Get< float >() );
         break;
       }
 
-      case Toolkit::Slider::UPPER_BOUND_PROPERTY:
+      case Toolkit::Slider::Property::UPPER_BOUND:
       {
         sliderImpl.SetUpperBound( value.Get< float >() );
         break;
       }
 
-      case Toolkit::Slider::VALUE_PROPERTY:
+      case Toolkit::Slider::Property::VALUE:
       {
         sliderImpl.SetValue( value.Get< float >() );
         break;
       }
 
-      case Toolkit::Slider::HIT_REGION_PROPERTY:
+      case Toolkit::Slider::Property::HIT_REGION:
       {
         sliderImpl.SetHitRegion( value.Get< Vector2 >() );
         break;
       }
 
-      case Toolkit::Slider::BACKING_REGION_PROPERTY:
+      case Toolkit::Slider::Property::BACKING_REGION:
       {
         sliderImpl.SetBackingRegion( value.Get< Vector2 >() );
         break;
       }
 
-      case Toolkit::Slider::HANDLE_REGION_PROPERTY:
+      case Toolkit::Slider::Property::HANDLE_REGION:
       {
         sliderImpl.SetHandleRegion( value.Get< Vector2 >() );
         break;
       }
 
-      case Toolkit::Slider::BACKING_IMAGE_NAME_PROPERTY:
+      case Toolkit::Slider::Property::BACKING_IMAGE_NAME:
       {
         sliderImpl.SetBackingImageName( value.Get< std::string >() );
         break;
       }
 
-      case Toolkit::Slider::HANDLE_IMAGE_NAME_PROPERTY:
+      case Toolkit::Slider::Property::HANDLE_IMAGE_NAME:
       {
         sliderImpl.SetHandleImageName( value.Get< std::string >() );
         break;
       }
 
-      case Toolkit::Slider::PROGRESS_IMAGE_NAME_PROPERTY:
+      case Toolkit::Slider::Property::PROGRESS_IMAGE_NAME:
       {
         sliderImpl.SetProgressImageName( value.Get< std::string >() );
         break;
       }
 
-      case Toolkit::Slider::POPUP_IMAGE_NAME_PROPERTY:
+      case Toolkit::Slider::Property::POPUP_IMAGE_NAME:
       {
         sliderImpl.SetPopupImageName( value.Get< std::string >() );
         break;
       }
 
-      case Toolkit::Slider::POPUP_ARROW_IMAGE_NAME_PROPERTY:
+      case Toolkit::Slider::Property::POPUP_ARROW_IMAGE_NAME:
       {
         sliderImpl.SetPopupArrowImageName( value.Get< std::string >() );
         break;
       }
 
-      case Toolkit::Slider::DISABLE_COLOR_PROPERTY:
+      case Toolkit::Slider::Property::DISABLE_COLOR:
       {
         sliderImpl.SetDisableColor( value.Get< Vector4 >() );
         break;
       }
 
-      case Toolkit::Slider::POPUP_TEXT_COLOR_PROPERTY:
+      case Toolkit::Slider::Property::POPUP_TEXT_COLOR:
       {
         sliderImpl.SetPopupTextColor( value.Get< Vector4 >() );
         break;
       }
 
-      case Toolkit::Slider::VALUE_PRECISION_PROPERTY:
+      case Toolkit::Slider::Property::VALUE_PRECISION:
       {
         sliderImpl.SetValuePrecision( value.Get< int >() );
         break;
       }
 
-      case Toolkit::Slider::SHOW_POPUP_PROPERTY:
+      case Toolkit::Slider::Property::SHOW_POPUP:
       {
         sliderImpl.SetShowPopup( value.Get< bool >() );
         break;
       }
 
-      case Toolkit::Slider::SHOW_VALUE_PROPERTY:
+      case Toolkit::Slider::Property::SHOW_VALUE:
       {
         sliderImpl.SetShowValue( value.Get< bool >() );
         break;
       }
 
-      case Toolkit::Slider::ENABLED_PROPERTY:
+      case Toolkit::Slider::Property::ENABLED:
       {
         sliderImpl.SetEnabled( value.Get< bool >() );
         break;
       }
 
-      case Toolkit::Slider::MARKS_PROPERTY:
+      case Toolkit::Slider::Property::MARKS:
       {
         sliderImpl.SetMarks( value.Get< Property::Array >() );
         break;
       }
 
-      case Toolkit::Slider::SNAP_TO_MARKS_PROPERTY:
+      case Toolkit::Slider::Property::SNAP_TO_MARKS:
       {
         sliderImpl.SetSnapToMarks( value.Get< bool >() );
         break;
       }
 
-      case Toolkit::Slider::MARK_TOLERANCE_PROPERTY:
+      case Toolkit::Slider::Property::MARK_TOLERANCE:
       {
         sliderImpl.SetMarkTolerance( value.Get< float >() );
         break;
@@ -1223,122 +1190,122 @@ Property::Value Slider::GetProperty( BaseObject* object, Property::Index propert
 
     switch ( propertyIndex )
     {
-      case Toolkit::Slider::LOWER_BOUND_PROPERTY:
+      case Toolkit::Slider::Property::LOWER_BOUND:
       {
         value = sliderImpl.GetLowerBound();
         break;
       }
 
-      case Toolkit::Slider::UPPER_BOUND_PROPERTY:
+      case Toolkit::Slider::Property::UPPER_BOUND:
       {
         value = sliderImpl.GetUpperBound();
         break;
       }
 
-      case Toolkit::Slider::VALUE_PROPERTY:
+      case Toolkit::Slider::Property::VALUE:
       {
         value = sliderImpl.GetValue();
         break;
       }
 
-      case Toolkit::Slider::HIT_REGION_PROPERTY:
+      case Toolkit::Slider::Property::HIT_REGION:
       {
         value = sliderImpl.GetHitRegion();
         break;
       }
 
-      case Toolkit::Slider::BACKING_REGION_PROPERTY:
+      case Toolkit::Slider::Property::BACKING_REGION:
       {
         value = sliderImpl.GetBackingRegion();
         break;
       }
 
-      case Toolkit::Slider::HANDLE_REGION_PROPERTY:
+      case Toolkit::Slider::Property::HANDLE_REGION:
       {
         value = sliderImpl.GetHandleRegion();
         break;
       }
 
-      case Toolkit::Slider::BACKING_IMAGE_NAME_PROPERTY:
+      case Toolkit::Slider::Property::BACKING_IMAGE_NAME:
       {
         value = sliderImpl.GetBackingImageName();
         break;
       }
 
-      case Toolkit::Slider::HANDLE_IMAGE_NAME_PROPERTY:
+      case Toolkit::Slider::Property::HANDLE_IMAGE_NAME:
       {
         value = sliderImpl.GetHandleImageName();
         break;
       }
 
-      case Toolkit::Slider::PROGRESS_IMAGE_NAME_PROPERTY:
+      case Toolkit::Slider::Property::PROGRESS_IMAGE_NAME:
       {
         value = sliderImpl.GetProgressImageName();
         break;
       }
 
-      case Toolkit::Slider::POPUP_IMAGE_NAME_PROPERTY:
+      case Toolkit::Slider::Property::POPUP_IMAGE_NAME:
       {
         value = sliderImpl.GetPopupImageName();
         break;
       }
 
-      case Toolkit::Slider::POPUP_ARROW_IMAGE_NAME_PROPERTY:
+      case Toolkit::Slider::Property::POPUP_ARROW_IMAGE_NAME:
       {
         value = sliderImpl.GetPopupArrowImageName();
         break;
       }
 
-      case Toolkit::Slider::DISABLE_COLOR_PROPERTY:
+      case Toolkit::Slider::Property::DISABLE_COLOR:
       {
         value = sliderImpl.GetDisableColor();
         break;
       }
 
-      case Toolkit::Slider::POPUP_TEXT_COLOR_PROPERTY:
+      case Toolkit::Slider::Property::POPUP_TEXT_COLOR:
       {
         value = sliderImpl.GetPopupTextColor();
         break;
       }
 
-      case Toolkit::Slider::VALUE_PRECISION_PROPERTY:
+      case Toolkit::Slider::Property::VALUE_PRECISION:
       {
         value = sliderImpl.GetValuePrecision();
         break;
       }
 
-      case Toolkit::Slider::SHOW_POPUP_PROPERTY:
+      case Toolkit::Slider::Property::SHOW_POPUP:
       {
         value = sliderImpl.GetShowPopup();
         break;
       }
 
-      case Toolkit::Slider::SHOW_VALUE_PROPERTY:
+      case Toolkit::Slider::Property::SHOW_VALUE:
       {
         value = sliderImpl.GetShowValue();
         break;
       }
 
-      case Toolkit::Slider::ENABLED_PROPERTY:
+      case Toolkit::Slider::Property::ENABLED:
       {
         value = sliderImpl.IsEnabled();
         break;
       }
 
-      case Toolkit::Slider::MARKS_PROPERTY:
+      case Toolkit::Slider::Property::MARKS:
       {
         // TODO: Need to be able to return a PropertyArray
         // value = sliderImpl.GetMarks();
         break;
       }
 
-      case Toolkit::Slider::SNAP_TO_MARKS_PROPERTY:
+      case Toolkit::Slider::Property::SNAP_TO_MARKS:
       {
         value = sliderImpl.GetSnapToMarks();
         break;
       }
 
-      case Toolkit::Slider::MARK_TOLERANCE_PROPERTY:
+      case Toolkit::Slider::Property::MARK_TOLERANCE:
       {
         value = sliderImpl.GetMarkTolerance();
         break;
index d4ac718..8fee62e 100755 (executable)
@@ -49,13 +49,6 @@ class Slider : public Control
 {
 public:
 
-  // Properties
-  enum
-  {
-    SLIDER_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
-    SLIDER_PROPERTY_END_INDEX = SLIDER_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
-  };
-
   typedef Property::Array MarkList;
 
   /**
index b469f83..5544761 100644 (file)
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/stage.h>
 #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/integration-api/debug.h>
 
-namespace //unnamed namespace
+namespace //Unnamed namespace
 {
 
 using namespace Dali;
@@ -81,13 +82,12 @@ namespace Dali
 namespace Toolkit
 {
 
-const Property::Index SuperBlurView::PROPERTY_IMAGE( Internal::SuperBlurView::SUPER_BLUR_VIEW_PROPERTY_START_INDEX );
-
 namespace Internal
 {
 
 namespace
 {
+
 const unsigned int DEFAULT_BLUR_LEVEL(5u); ///< The default blur level when creating SuperBlurView from the type registry
 
 BaseHandle Create()
@@ -95,10 +95,12 @@ BaseHandle Create()
   return Toolkit::SuperBlurView::New( DEFAULT_BLUR_LEVEL );
 }
 
-// Type registration
-TypeRegistration typeRegistration( typeid(Toolkit::SuperBlurView), typeid(Toolkit::Control), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::SuperBlurView, Toolkit::Control, Create )
+
+DALI_PROPERTY_REGISTRATION( SuperBlurView, "image", MAP, IMAGE )
 
-PropertyRegistration property1( typeRegistration, "image", Toolkit::SuperBlurView::PROPERTY_IMAGE,   Property::MAP, &SuperBlurView::SetProperty, &SuperBlurView::GetProperty );
+DALI_TYPE_REGISTRATION_END()
 
 } // unnamed namespace
 
@@ -150,7 +152,7 @@ void SuperBlurView::OnInitialize()
 
   for(unsigned int i=0; i < mBlurLevels; i++)
   {
-    mImageActors[i].ApplyConstraint( Constraint::New<float>( Actor::Property::ColorAlpha, ParentSource( mBlurStrengthPropertyIndex ), ActorOpacityConstraint(mBlurLevels, i) ) );
+    mImageActors[i].ApplyConstraint( Constraint::New<float>( Actor::Property::COLOR_ALPHA, ParentSource( mBlurStrengthPropertyIndex ), ActorOpacityConstraint(mBlurLevels, i) ) );
   }
 
   Self().SetSize(Stage::GetCurrent().GetSize());
@@ -248,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();
 
@@ -277,24 +279,20 @@ void SuperBlurView::SetProperty( BaseObject* object, Property::Index propertyInd
 {
   Toolkit::SuperBlurView superBlurView = Toolkit::SuperBlurView::DownCast( Dali::BaseHandle( object ) );
 
-  if ( superBlurView )
+  if( superBlurView )
   {
     SuperBlurView& superBlurViewImpl( GetImpl( superBlurView ) );
 
-    switch ( propertyIndex )
+    if( propertyIndex == Toolkit::SuperBlurView::Property::IMAGE )
     {
-      case Toolkit::SuperBlurView::PROPERTY_IMAGE:
+      Dali::Image image = Scripting::NewImage( value );
+      if ( image )
+      {
+        superBlurViewImpl.SetImage( image );
+      }
+      else
       {
-        Dali::Image image = Scripting::NewImage( value );
-        if ( image )
-        {
-          superBlurViewImpl.SetImage( image );
-        }
-        else
-        {
-          DALI_LOG_ERROR( "Cannot create image from property value\n" );
-        }
-        break;
+        DALI_LOG_ERROR( "Cannot create image from property value\n" );
       }
     }
   }
@@ -306,22 +304,18 @@ Property::Value SuperBlurView::GetProperty( BaseObject* object, Property::Index
 
   Toolkit::SuperBlurView pushButton = Toolkit::SuperBlurView::DownCast( Dali::BaseHandle( object ) );
 
-  if ( pushButton )
+  if( pushButton )
   {
     SuperBlurView& superBlurViewImpl( GetImpl( pushButton ) );
 
-    switch ( propertyIndex )
+    if( propertyIndex == Toolkit::SuperBlurView::Property::IMAGE )
     {
-      case Toolkit::SuperBlurView::PROPERTY_IMAGE:
+      Property::Map map;
+      if( !superBlurViewImpl.mImageActors.empty() && superBlurViewImpl.mImageActors[0] )
       {
-        Property::Map map;
-        if ( !superBlurViewImpl.mImageActors.empty() && superBlurViewImpl.mImageActors[0] )
-        {
-          Scripting::CreatePropertyMap( superBlurViewImpl.mImageActors[0], map );
-        }
-        value = Property::Value( map );
-        break;
+        Scripting::CreatePropertyMap( superBlurViewImpl.mImageActors[0], map );
       }
+      value = Property::Value( map );
     }
   }
 
index db9c613..041e717 100644 (file)
@@ -39,14 +39,6 @@ namespace Internal
  */
 class SuperBlurView : public Control
 {
-public:
-
-  // Properties
-  enum
-  {
-    SUPER_BLUR_VIEW_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
-    SUPER_BLUR_VIEW_PROPERTY_END_INDEX = SUPER_BLUR_VIEW_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
-  };
 
 public:
 
@@ -130,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 30c66f3..4f17023 100644 (file)
 #include <sstream>
 #include <dali/public-api/object/ref-object.h>
 #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)
@@ -110,41 +109,39 @@ namespace Dali
 namespace Toolkit
 {
 
-const Property::Index TableView::PROPERTY_ROWS( Internal::TableView::TABLEVIEW_PROPERTY_START_INDEX );
-const Property::Index TableView::PROPERTY_COLUMNS( Internal::TableView::TABLEVIEW_PROPERTY_START_INDEX + 1 );
-const Property::Index TableView::PROPERTY_CELL_PADDING( Internal::TableView::TABLEVIEW_PROPERTY_START_INDEX + 2 );
-const Property::Index TableView::PROPERTY_LAYOUT_ROWS( Internal::TableView::TABLEVIEW_PROPERTY_START_INDEX + 3 );
-const Property::Index TableView::PROPERTY_LAYOUT_COLUMNS( Internal::TableView::TABLEVIEW_PROPERTY_START_INDEX + 4 );
-
 namespace Internal
 {
 
 namespace
 {
 
-const Scripting::StringEnum< Toolkit::TableView::LayoutPolicy > LAYOUT_POLICY_STRING_TABLE[] =
-{
- { "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] );
-
 // Type registration
 BaseHandle Create()
 {
-  return Toolkit::TableView::New(0, 0);
+  return Toolkit::TableView::New( 0, 0 );
 }
-TypeRegistration mType( typeid(Toolkit::TableView), typeid(Toolkit::Control), Create );
 
-PropertyRegistration property1( mType, "rows", Toolkit::TableView::PROPERTY_ROWS, Property::UNSIGNED_INTEGER, &TableView::SetProperty, &TableView::GetProperty );
-PropertyRegistration property2( mType, "columns", Toolkit::TableView::PROPERTY_COLUMNS, Property::UNSIGNED_INTEGER, &TableView::SetProperty, &TableView::GetProperty );
-PropertyRegistration property3( mType, "cell-padding", Toolkit::TableView::PROPERTY_CELL_PADDING, Property::VECTOR2, &TableView::SetProperty, &TableView::GetProperty );
-PropertyRegistration property4( mType, "layout-rows", Toolkit::TableView::PROPERTY_LAYOUT_ROWS, Property::MAP, &TableView::SetProperty, &TableView::GetProperty );
-PropertyRegistration property5( mType, "layout-columns", Toolkit::TableView::PROPERTY_LAYOUT_COLUMNS, Property::MAP, &TableView::SetProperty, &TableView::GetProperty );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TableView, Toolkit::Control, Create );
 
-} // namespace
+DALI_PROPERTY_REGISTRATION( TableView, "rows",           UNSIGNED_INTEGER, ROWS           )
+DALI_PROPERTY_REGISTRATION( TableView, "columns",        UNSIGNED_INTEGER, COLUMNS        )
+DALI_PROPERTY_REGISTRATION( TableView, "cell-padding",   VECTOR2,          CELL_PADDING   )
+DALI_PROPERTY_REGISTRATION( TableView, "layout-rows",    MAP,              LAYOUT_ROWS    )
+DALI_PROPERTY_REGISTRATION( TableView, "layout-columns", MAP,              LAYOUT_COLUMNS )
+
+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     }
+};
+
+const unsigned int LAYOUT_POLICY_STRING_TABLE_COUNT = sizeof(LAYOUT_POLICY_STRING_TABLE) / sizeof( LAYOUT_POLICY_STRING_TABLE[0] );
+
+} // Unnamed namespace
 
 Toolkit::TableView TableView::New( unsigned int initialRows, unsigned int initialColumns )
 {
@@ -161,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 );
@@ -171,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 )
@@ -206,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
@@ -216,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 )
   {
@@ -233,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 );
@@ -272,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();
 }
 
@@ -340,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--;
@@ -371,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();
 }
 
@@ -427,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--;
@@ -458,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();
 }
 
@@ -478,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();
   }
 }
@@ -517,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 mRelativeWidths[ columnIndex ];
+  return mColumnData[ columnIndex ].fillRatio;
+}
+
+void TableView::CalculateRowColumnData()
+{
+  // Calculate the relative sizes
+  if( mRowColumnDirty )
+  {
+    ComputeRelativeSizes( mRowData );
+    ComputeRelativeSizes( mColumnData );
+
+    mRowColumnDirty = false;
+  }
 }
 
-void TableView::OnRelayout( const Vector2& size, ActorSizeContainer& container )
+void TableView::OnCalculateRelayoutSize( Dimension dimension )
 {
-  float fixedHeightsTotal = 0.0f;
-  float fixedWidthsTotal = 0.0f;
+  CalculateRowColumnData();
+
+  if( dimension & WIDTH )
+  {
+    CalculateFixedSizes( mColumnData, WIDTH );
+    mFixedTotals.width = CalculateTotalFixedSize( mColumnData );
+  }
+
+  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 );
+  }
+}
 
-  // 1. update the relative sizes and calculate total fixed height and width
-  UpdateRelativeSizes( fixedHeightsTotal, fixedWidthsTotal );
+void TableView::OnRelayout( const Vector2& size, RelayoutContainer& container )
+{
+  CalculateRowColumnData();
 
-  // 2. go through the layout data and create constraints
-  float cumulatedFixedHeight = 0.0f;
-  float cumulatedRelativeHeight = 0.0f;
+  // 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;
   }
 }
 
@@ -717,7 +796,7 @@ void TableView::SetProperty( BaseObject* object, Property::Index index, const Pr
     TableView& tableViewImpl( GetImpl( tableView ) );
     switch( index )
     {
-      case Toolkit::TableView::PROPERTY_ROWS:
+      case Toolkit::TableView::Property::ROWS:
       {
         if( value.Get<unsigned int>() != tableViewImpl.GetRows() )
         {
@@ -725,7 +804,7 @@ void TableView::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
-      case Toolkit::TableView::PROPERTY_COLUMNS:
+      case Toolkit::TableView::Property::COLUMNS:
       {
         if( value.Get<unsigned int>() != tableViewImpl.GetColumns() )
         {
@@ -733,17 +812,17 @@ void TableView::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
-      case Toolkit::TableView::PROPERTY_CELL_PADDING:
+      case Toolkit::TableView::Property::CELL_PADDING:
       {
         tableViewImpl.SetCellPadding( value.Get<Vector2>() );
         break;
       }
-      case Toolkit::TableView::PROPERTY_LAYOUT_ROWS:
+      case Toolkit::TableView::Property::LAYOUT_ROWS:
       {
         SetHeightOrWidthProperty( tableViewImpl, &TableView::SetFixedHeight, &TableView::SetRelativeHeight, value );
         break;
       }
-      case Toolkit::TableView::PROPERTY_LAYOUT_COLUMNS:
+      case Toolkit::TableView::Property::LAYOUT_COLUMNS:
       {
         SetHeightOrWidthProperty( tableViewImpl, &TableView::SetFixedWidth, &TableView::SetRelativeWidth, value );
         break;
@@ -763,27 +842,27 @@ Property::Value TableView::GetProperty( BaseObject* object, Property::Index inde
     TableView& tableViewImpl( GetImpl( tableView ) );
     switch( index )
     {
-      case Toolkit::TableView::PROPERTY_ROWS:
+      case Toolkit::TableView::Property::ROWS:
       {
         value = tableViewImpl.GetRows();
         break;
       }
-      case Toolkit::TableView::PROPERTY_COLUMNS:
+      case Toolkit::TableView::Property::COLUMNS:
       {
         value = tableViewImpl.GetColumns();
         break;
       }
-      case Toolkit::TableView::PROPERTY_CELL_PADDING:
+      case Toolkit::TableView::Property::CELL_PADDING:
       {
         value = tableViewImpl.GetCellPadding();
         break;
       }
-      case Toolkit::TableView::PROPERTY_LAYOUT_ROWS:
+      case Toolkit::TableView::Property::LAYOUT_ROWS:
       {
         value = tableViewImpl.GetRowHeightsPropertyValue();
         break;
       }
-      case Toolkit::TableView::PROPERTY_LAYOUT_COLUMNS:
+      case Toolkit::TableView::Property::LAYOUT_COLUMNS:
       {
         value = tableViewImpl.GetColumnWidthsPropertyValue();
         break;
@@ -802,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 >();
@@ -818,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 )
@@ -874,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 );
@@ -896,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,
@@ -953,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
@@ -974,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),
@@ -1091,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>() );
           }
@@ -1108,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;
 
-      map[ static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str() ] = item;
+        break;
+      }
+
+      case FILL:
+      {
+        Property::Map item;
+        item[ "policy" ] = relativePolicy;
+        item[ "value" ] = dataInstance.fillRatio;
+
+        std::ostringstream ss;
+        ss << i;
+
+        map[ ss.str() ] = item;
+
+        break;
+      }
+
+      default:
+      {
+        break;
+      }
     }
   }
 }
@@ -1210,6 +1216,7 @@ Actor TableView::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolki
           break;
         }
         case Toolkit::Control::Down:
+
         {
           if(++currentRow > numberOfRows - 1)
           {
@@ -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 9939a05..55a7d7b 100644 (file)
@@ -40,21 +40,14 @@ class TableView : public Control
 {
 public:
 
-  // Properties
-  enum
-  {
-    TABLEVIEW_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
-    TABLEVIEW_PROPERTY_END_INDEX = TABLEVIEW_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
-  };
-
   /**
-   * 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
   };
 
   /**
@@ -66,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
@@ -134,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
@@ -164,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 );
@@ -183,6 +208,11 @@ public:
    */
   unsigned int GetColumns();
 
+  /**
+   * @copydoc Toolkit::TableView::SetCellAlignment
+   */
+  void SetCellAlignment( Toolkit::TableView::CellPosition position, HorizontalAlignment::Type horizontal, VerticalAlignment::Type vertical );
+
   // Properties
 
   /**
@@ -206,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()
@@ -226,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 );
@@ -266,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 );
 
   /**
-   * Helper to update relative sizes
-   * @param fixedHeightsTotal sum of the fixed height rows
-   * @param fixedWidthsTotal sum of the fixed width columns
+   * @brief Calculate the total fixed sizes for a row or column
+   *
+   * @param[in] data The row or column data to process
    */
-  void UpdateRelativeSizes( float& fixedHeightsTotal, float& fixedWidthsTotal );
+  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 );
+
+  /**
+   * @brief Calculate row and column data when it is dirty
+   */
+  void CalculateRowColumnData();
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
@@ -308,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 );
 
 
   /**
@@ -357,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 7ce238a..b134d6c 100644 (file)
@@ -439,7 +439,7 @@ void Decorator::DrawCursor(const std::size_t nthChar)
   {
     DALI_ASSERT_DEBUG( ( 0 <= cursorPosition-1 ) && ( cursorPosition-1 < mTextViewCharacterPositioning.StyledTextSize() ) );
     const TextStyle styleAtCursor = mTextViewCharacterPositioning.GetStyleAt( cursorPosition-1 );
-    mCursor.SetRotation( styleAtCursor.IsItalicsEnabled() ? Degree( styleAtCursor.GetItalicsAngle() - CURSOR_ANGLE_OFFSET ) : Degree( 0.f ), Vector3::ZAXIS );
+    mCursor.SetOrientation( styleAtCursor.IsItalicsEnabled() ? Degree( styleAtCursor.GetItalicsAngle() - CURSOR_ANGLE_OFFSET ) : Degree( 0.f ), Vector3::ZAXIS );
   }
 
   DALI_ASSERT_DEBUG( cursorPosition <= mTextViewCharacterPositioning.GetNumberOfCharactersInText() );
@@ -654,37 +654,37 @@ void Decorator::SetUpHandlePropertyNotifications()
   Actor selectionHandleTwo = mTextInputHandles.GetSelectionHandleTwo();
 
   // Exceeding horizontal boundary
-  PropertyNotification leftNotification = selectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionX, LessThanCondition( mBoundingRectangleWorldCoordinates.x + handlesize.x) );
+  PropertyNotification leftNotification = selectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, LessThanCondition( mBoundingRectangleWorldCoordinates.x + handlesize.x) );
   leftNotification.NotifySignal().Connect( this, &Decorator::OnLeftBoundaryExceeded );
 
-  PropertyNotification rightNotification = selectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionX, GreaterThanCondition( mBoundingRectangleWorldCoordinates.z - handlesize.x ) );
+  PropertyNotification rightNotification = selectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, GreaterThanCondition( mBoundingRectangleWorldCoordinates.z - handlesize.x ) );
   rightNotification.NotifySignal().Connect( this, &Decorator::OnRightBoundaryExceeded );
 
   // Within horizontal boundary
-  PropertyNotification leftLeaveNotification = selectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionX, GreaterThanCondition( mBoundingRectangleWorldCoordinates.x + 2*handlesize.x ) );
+  PropertyNotification leftLeaveNotification = selectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, GreaterThanCondition( mBoundingRectangleWorldCoordinates.x + 2*handlesize.x ) );
   leftLeaveNotification.NotifySignal().Connect( this, &Decorator::OnReturnToLeftBoundary );
 
-  PropertyNotification rightLeaveNotification = selectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionX, LessThanCondition( mBoundingRectangleWorldCoordinates.z - 2*handlesize.x ) );
+  PropertyNotification rightLeaveNotification = selectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, LessThanCondition( mBoundingRectangleWorldCoordinates.z - 2*handlesize.x ) );
   rightLeaveNotification.NotifySignal().Connect( this, &Decorator::OnReturnToRightBoundary );
 
   // Exceeding vertical boundary
-  PropertyNotification verticalExceedNotificationOne = selectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionY,
+  PropertyNotification verticalExceedNotificationOne = selectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
                                                        OutsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y,
                                                                          mBoundingRectangleWorldCoordinates.w - handlesize.y ) );
   verticalExceedNotificationOne.NotifySignal().Connect( this, &Decorator::OnHandleOneLeavesBoundary );
 
-  PropertyNotification verticalExceedNotificationTwo = selectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionY,
+  PropertyNotification verticalExceedNotificationTwo = selectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
                                                        OutsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y,
                                                                          mBoundingRectangleWorldCoordinates.w - handlesize.y ) );
   verticalExceedNotificationTwo.NotifySignal().Connect( this, &Decorator::OnHandleTwoLeavesBoundary );
 
   // Within vertical boundary
-  PropertyNotification verticalWithinNotificationOne = selectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionY,
+  PropertyNotification verticalWithinNotificationOne = selectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
                                                        InsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y,
                                                                         mBoundingRectangleWorldCoordinates.w - handlesize.y ) );
   verticalWithinNotificationOne.NotifySignal().Connect( this, &Decorator::OnHandleOneWithinBoundary );
 
-  PropertyNotification verticalWithinNotificationTwo = selectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionY,
+  PropertyNotification verticalWithinNotificationTwo = selectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
                                                        InsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y,
                                                                         mBoundingRectangleWorldCoordinates.w - handlesize.y ) );
   verticalWithinNotificationTwo.NotifySignal().Connect( this, &Decorator::OnHandleTwoWithinBoundary );
@@ -837,7 +837,7 @@ void Decorator::SetUpPopUpPositionNotifications( )
   // Note Property notifications ignore any set anchor point so conditions must allow for this.  Default is Top Left.
 
   // Exceeding vertical boundary
-  PropertyNotification verticalExceedNotificationOne = mPopUpPanel.Self().AddPropertyNotification( Actor::Property::WorldPositionY,
+  PropertyNotification verticalExceedNotificationOne = mPopUpPanel.Self().AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
                                                        OutsideCondition( mBoundingRectangleWorldCoordinates.y + mPopUpPanel.GetSize().y/2,
                                                                          mBoundingRectangleWorldCoordinates.w - mPopUpPanel.GetSize().y/2 ) );
   verticalExceedNotificationOne.NotifySignal().Connect( this, &Decorator::PopUpLeavesVerticalBoundary );
index 34eabee..c73804e 100644 (file)
@@ -28,7 +28,9 @@
 #include <dali/public-api/events/key-event.h>
 #include <dali/public-api/events/touch-event.h>
 #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>
 
@@ -70,13 +72,13 @@ const float UI_Z_OFFSET( 0.2f );                                            ///<
 const Vector3 UI_OFFSET(0.0f, 0.0f, UI_Z_OFFSET);                           ///< Text Selection Handles/Cursor offset.
 const Vector3 DEFAULT_HANDLE_ONE_OFFSET(0.0f, -5.0f, 0.0f);                 ///< Handle One's Offset
 const Vector3 DEFAULT_HANDLE_TWO_OFFSET(0.0f, -5.0f, 0.0f);                 ///< Handle Two's Offset
-const float TOP_HANDLE_TOP_OFFSET( 34.0f);                                   ///< Offset between top handle and cutCopyPaste pop-up
-const float BOTTOM_HANDLE_BOTTOM_OFFSET(34.0f);                              ///< Offset between bottom handle and cutCopyPaste pop-up
+const float TOP_HANDLE_TOP_OFFSET( 34.0f);                                  ///< Offset between top handle and cutCopyPaste pop-up
+const float BOTTOM_HANDLE_BOTTOM_OFFSET(34.0f);                             ///< Offset between bottom handle and cutCopyPaste pop-up
 const float CURSOR_THICKNESS(4.0f);
 const Degree CURSOR_ANGLE_OFFSET(2.0f);                                     ///< Offset from the angle of italic angle.
 const Vector4 DEFAULT_CURSOR_COLOR(1.0f, 1.0f, 1.0f, 1.0f);
 
-const std::string NEWLINE( "\n" );
+const char* const NEWLINE = "\n";
 
 const TextStyle DEFAULT_TEXT_STYLE;
 
@@ -173,73 +175,48 @@ namespace Dali
 
 namespace Toolkit
 {
-// Properties
-const Property::Index TextInput::HIGHLIGHT_COLOR_PROPERTY                     = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX;
-const Property::Index TextInput::CUT_AND_PASTE_COLOR_PROPERTY                 = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+1;
-const Property::Index TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY         = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+2;
-const Property::Index TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY          = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+3;
-const Property::Index TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY            = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+4;
-const Property::Index TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY    = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+5;
-const Property::Index TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY            = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+6;
-const Property::Index TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY    = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+7;
-const Property::Index TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY        = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+8;
-const Property::Index TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY       = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+9;
-const Property::Index TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY      = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+10;
-const Property::Index TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY     = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+11;
-const Property::Index TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+12;
-const Property::Index TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY  = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+13;
-const Property::Index TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY             = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+14;
-const Property::Index TextInput::CURSOR_COLOR_PROPERTY                        = Internal::TextInput::TEXTINPUT_PROPERTY_START_INDEX+15;
-
 
 namespace Internal
 {
 
-namespace
+namespace // Unnamed namespace
 {
 
-// Signals
-
-const char* const SIGNAL_START_INPUT =                  "start-input";
-const char* const SIGNAL_END_INPUT =                    "end-input";
-const char* const SIGNAL_STYLE_CHANGED =                "style-changed";
-const char* const SIGNAL_MAX_INPUT_CHARACTERS_REACHED = "max-input-characters-reached";
-const char* const SIGNAL_TOOLBAR_DISPLAYED =            "toolbar-displayed";
-const char* const SIGNAL_TEXT_EXCEED_BOUNDARIES =       "text-exceed-boundaries";
-
 BaseHandle Create()
 {
   return Toolkit::TextInput::New();
 }
 
-TypeRegistration typeRegistration( typeid( Toolkit::TextInput ), typeid( Toolkit::Control ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextInput, Toolkit::Control, Create )
 
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_START_INPUT,                  &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector2( typeRegistration, SIGNAL_END_INPUT,                    &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector3( typeRegistration, SIGNAL_STYLE_CHANGED,                &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector4( typeRegistration, SIGNAL_MAX_INPUT_CHARACTERS_REACHED, &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector5( typeRegistration, SIGNAL_TOOLBAR_DISPLAYED,            &TextInput::DoConnectSignal );
-SignalConnectorType signalConnector6( typeRegistration, SIGNAL_TEXT_EXCEED_BOUNDARIES,       &TextInput::DoConnectSignal );
+DALI_PROPERTY_REGISTRATION( TextInput, "highlight-color",                     VECTOR4,          HIGHLIGHT_COLOR                     )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-bg-color",              VECTOR4,          CUT_AND_PASTE_COLOR                 )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-pressed-color",         VECTOR4,          CUT_AND_PASTE_PRESSED_COLOR         )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-border-color",          VECTOR4,          CUT_AND_PASTE_BORDER_COLOR          )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-icon-color",            VECTOR4,          CUT_AND_PASTE_ICON_COLOR            )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-icon-pressed-color",    VECTOR4,          CUT_AND_PASTE_ICON_PRESSED_COLOR    )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-text-color",            VECTOR4,          CUT_AND_PASTE_TEXT_COLOR            )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-and-paste-text-pressed-color",    VECTOR4,          CUT_AND_PASTE_TEXT_PRESSED_COLOR    )
+DALI_PROPERTY_REGISTRATION( TextInput, "cut-button-position-priority",        UNSIGNED_INTEGER, CUT_BUTTON_POSITION_PRIORITY        )
+DALI_PROPERTY_REGISTRATION( TextInput, "copy-button-position-priority",       UNSIGNED_INTEGER, COPY_BUTTON_POSITION_PRIORITY       )
+DALI_PROPERTY_REGISTRATION( TextInput, "paste-button-position-priority",      UNSIGNED_INTEGER, PASTE_BUTTON_POSITION_PRIORITY      )
+DALI_PROPERTY_REGISTRATION( TextInput, "select-button-position-priority",     UNSIGNED_INTEGER, SELECT_BUTTON_POSITION_PRIORITY     )
+DALI_PROPERTY_REGISTRATION( TextInput, "select-all-button-position-priority", UNSIGNED_INTEGER, SELECT_ALL_BUTTON_POSITION_PRIORITY )
+DALI_PROPERTY_REGISTRATION( TextInput, "clipboard-button-position-priority",  UNSIGNED_INTEGER, CLIPBOARD_BUTTON_POSITION_PRIORITY  )
+DALI_PROPERTY_REGISTRATION( TextInput, "popup-offset-from-text",              VECTOR4,          POP_UP_OFFSET_FROM_TEXT             )
+DALI_PROPERTY_REGISTRATION( TextInput, "cursor-color",                        VECTOR4,          CURSOR_COLOR                        )
 
-}
+DALI_SIGNAL_REGISTRATION(   TextInput, "start-input",                                           SIGNAL_START_INPUT                  )
+DALI_SIGNAL_REGISTRATION(   TextInput, "end-input",                                             SIGNAL_END_INPUT                    )
+DALI_SIGNAL_REGISTRATION(   TextInput, "style-changed",                                         SIGNAL_STYLE_CHANGED                )
+DALI_SIGNAL_REGISTRATION(   TextInput, "max-input-characters-reached",                          SIGNAL_MAX_INPUT_CHARACTERS_REACHED )
+DALI_SIGNAL_REGISTRATION(   TextInput, "toolbar-displayed",                                     SIGNAL_TOOLBAR_DISPLAYED            )
+DALI_SIGNAL_REGISTRATION(   TextInput, "text-exceed-boundaries",                                SIGNAL_TEXT_EXCEED_BOUNDARIES       )
 
-PropertyRegistration property1( typeRegistration, "highlight-color",  Toolkit::TextInput::HIGHLIGHT_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property2( typeRegistration, "cut-and-paste-bg-color",  Toolkit::TextInput::CUT_AND_PASTE_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property3( typeRegistration, "cut-and-paste-pressed-color",  Toolkit::TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property4( typeRegistration, "cut-and-paste-icon-color",  Toolkit::TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property5( typeRegistration, "cut-and-paste-icon-pressed-color",  Toolkit::TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property6( typeRegistration, "cut-and-paste-text-color",  Toolkit::TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property7( typeRegistration, "cut-and-paste-text-pressed-color",  Toolkit::TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property8( typeRegistration, "cut-and-paste-border-color",  Toolkit::TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property9( typeRegistration, "cut-button-position-priority",  Toolkit::TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property10( typeRegistration, "copy-button-position-priority",  Toolkit::TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property11( typeRegistration, "paste-button-position-priority",  Toolkit::TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property12( typeRegistration, "select-button-position-priority",  Toolkit::TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property13( typeRegistration, "select-all-button-position-priority",  Toolkit::TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property14( typeRegistration, "clipboard-button-position-priority",  Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY, Property::UNSIGNED_INTEGER, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property15( typeRegistration, "popup-offset-from-text", Toolkit::TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
-PropertyRegistration property16( typeRegistration, "cursor-color", Toolkit::TextInput::CURSOR_COLOR_PROPERTY, Property::VECTOR4, &TextInput::SetProperty, &TextInput::GetProperty );
+DALI_TYPE_REGISTRATION_END()
 
+}
 
 // [TextInput::HighlightInfo] /////////////////////////////////////////////////
 
@@ -1175,10 +1152,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();
 
@@ -2136,7 +2113,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 );
 
@@ -2836,7 +2812,7 @@ void TextInput::DrawCursor()
   mCursor.SetSize(size);
 
   // If the character is italic then the cursor also tilts.
-  mCursor.SetRotation( mInputStyle.IsItalicsEnabled() ? Degree( mInputStyle.GetItalicsAngle() - CURSOR_ANGLE_OFFSET ) : Degree( 0.f ), Vector3::ZAXIS );
+  mCursor.SetOrientation( mInputStyle.IsItalicsEnabled() ? Degree( mInputStyle.GetItalicsAngle() - CURSOR_ANGLE_OFFSET ) : Degree( 0.f ), Vector3::ZAXIS );
 
   DALI_ASSERT_DEBUG( mCursorPosition <= mTextLayoutInfo.mCharacterLayoutInfoTable.size() );
 
@@ -3098,37 +3074,37 @@ void TextInput::SetUpHandlePropertyNotifications()
   Vector3 handlesize = GetSelectionHandleSize();
 
   // Exceeding horizontal boundary
-  PropertyNotification leftNotification = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionX, LessThanCondition( mBoundingRectangleWorldCoordinates.x + handlesize.x) );
+  PropertyNotification leftNotification = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, LessThanCondition( mBoundingRectangleWorldCoordinates.x + handlesize.x) );
   leftNotification.NotifySignal().Connect( this, &TextInput::OnLeftBoundaryExceeded );
 
-  PropertyNotification rightNotification = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionX, GreaterThanCondition( mBoundingRectangleWorldCoordinates.z - handlesize.x ) );
+  PropertyNotification rightNotification = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, GreaterThanCondition( mBoundingRectangleWorldCoordinates.z - handlesize.x ) );
   rightNotification.NotifySignal().Connect( this, &TextInput::OnRightBoundaryExceeded );
 
   // Within horizontal boundary
-  PropertyNotification leftLeaveNotification = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionX, GreaterThanCondition( mBoundingRectangleWorldCoordinates.x + 2*handlesize.x ) );
+  PropertyNotification leftLeaveNotification = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, GreaterThanCondition( mBoundingRectangleWorldCoordinates.x + 2*handlesize.x ) );
   leftLeaveNotification.NotifySignal().Connect( this, &TextInput::OnReturnToLeftBoundary );
 
-  PropertyNotification rightLeaveNotification = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionX, LessThanCondition( mBoundingRectangleWorldCoordinates.z - 2*handlesize.x ) );
+  PropertyNotification rightLeaveNotification = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_X, LessThanCondition( mBoundingRectangleWorldCoordinates.z - 2*handlesize.x ) );
   rightLeaveNotification.NotifySignal().Connect( this, &TextInput::OnReturnToRightBoundary );
 
   // Exceeding vertical boundary
-  PropertyNotification verticalExceedNotificationOne = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionY,
+  PropertyNotification verticalExceedNotificationOne = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
                                                        OutsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y,
                                                                          mBoundingRectangleWorldCoordinates.w - handlesize.y ) );
   verticalExceedNotificationOne.NotifySignal().Connect( this, &TextInput::OnHandleOneLeavesBoundary );
 
-  PropertyNotification verticalExceedNotificationTwo = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionY,
+  PropertyNotification verticalExceedNotificationTwo = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
                                                        OutsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y,
                                                                          mBoundingRectangleWorldCoordinates.w - handlesize.y ) );
   verticalExceedNotificationTwo.NotifySignal().Connect( this, &TextInput::OnHandleTwoLeavesBoundary );
 
   // Within vertical boundary
-  PropertyNotification verticalWithinNotificationOne = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WorldPositionY,
+  PropertyNotification verticalWithinNotificationOne = mSelectionHandleOne.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
                                                        InsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y,
                                                                         mBoundingRectangleWorldCoordinates.w - handlesize.y ) );
   verticalWithinNotificationOne.NotifySignal().Connect( this, &TextInput::OnHandleOneWithinBoundary );
 
-  PropertyNotification verticalWithinNotificationTwo = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WorldPositionY,
+  PropertyNotification verticalWithinNotificationTwo = mSelectionHandleTwo.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
                                                        InsideCondition( mBoundingRectangleWorldCoordinates.y + handlesize.y,
                                                                         mBoundingRectangleWorldCoordinates.w - handlesize.y ) );
   verticalWithinNotificationTwo.NotifySignal().Connect( this, &TextInput::OnHandleTwoWithinBoundary );
@@ -5103,84 +5079,85 @@ void TextInput::SetProperty( BaseObject* object, Property::Index propertyIndex,
 
     switch ( propertyIndex )
     {
-      case Toolkit::TextInput::HIGHLIGHT_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::HIGHLIGHT_COLOR:
       {
         textInputImpl.SetMaterialDiffuseColor( value.Get< Vector4 >() );
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_COLOR:
       {
         textInputImpl.mPopupPanel.SetCutPastePopupColor( value.Get< Vector4 >() );
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_PRESSED_COLOR:
       {
         textInputImpl.mPopupPanel.SetCutPastePopupPressedColor( value.Get< Vector4 >() );
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_BORDER_COLOR:
       {
         textInputImpl.mPopupPanel.SetCutPastePopupBorderColor( value.Get< Vector4 >() );
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_ICON_COLOR:
       {
         textInputImpl.mPopupPanel.SetCutPastePopupIconColor( value.Get< Vector4 >() );
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_ICON_PRESSED_COLOR:
       {
         textInputImpl.mPopupPanel.SetCutPastePopupIconPressedColor( value.Get< Vector4 >() );
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_TEXT_COLOR:
       {
         textInputImpl.mPopupPanel.SetCutPastePopupTextColor( value.Get< Vector4 >() );
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_TEXT_PRESSED_COLOR:
       {
         textInputImpl.mPopupPanel.SetCutPastePopupTextPressedColor( value.Get< Vector4 >() );
         break;
       }
-      case Toolkit::TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_BUTTON_POSITION_PRIORITY:
       {
         textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCut, value.Get<unsigned int>() );
         break;
       }
-      case Toolkit::TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::COPY_BUTTON_POSITION_PRIORITY:
       {
         textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsCopy, value.Get<unsigned int>() );
         break;
       }
-      case Toolkit::TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::PASTE_BUTTON_POSITION_PRIORITY:
       {
         textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsPaste, value.Get<unsigned int>() );
         break;
       }
-      case Toolkit::TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::SELECT_BUTTON_POSITION_PRIORITY:
       {
         textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelect, value.Get<unsigned int>() );
         break;
       }
-      case Toolkit::TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::SELECT_ALL_BUTTON_POSITION_PRIORITY:
       {
         textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll, value.Get<unsigned int>() );
         break;
       }
-      case Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::CLIPBOARD_BUTTON_POSITION_PRIORITY:
       {
         textInputImpl.mPopupPanel.SetButtonPriorityPosition( TextInputPopup::ButtonsClipboard, value.Get<unsigned int>() );
         break;
       }
-      case Toolkit::TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY:
+      case Toolkit::TextInput::Property::POP_UP_OFFSET_FROM_TEXT:
       {
         textInputImpl.SetOffsetFromText( value.Get< Vector4 >() );
         break;
       }
-      case Toolkit::TextInput::CURSOR_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CURSOR_COLOR:
       {
         textInputImpl.mCursor.SetColor( value.Get< Vector4 >() );
+        break;
       }
     }
   }
@@ -5198,82 +5175,82 @@ Property::Value TextInput::GetProperty( BaseObject* object, Property::Index prop
 
     switch ( propertyIndex )
     {
-      case Toolkit::TextInput::HIGHLIGHT_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::HIGHLIGHT_COLOR:
       {
         value = textInputImpl.GetMaterialDiffuseColor();
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_COLOR:
       {
         value = textInputImpl.mPopupPanel.GetCutPastePopupColor();
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_PRESSED_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_PRESSED_COLOR:
       {
         value = textInputImpl.mPopupPanel.GetCutPastePopupPressedColor();
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_BORDER_COLOR_PROPERTY :
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_BORDER_COLOR :
       {
         value = textInputImpl.mPopupPanel.GetCutPastePopupBorderColor();
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_ICON_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_ICON_COLOR:
       {
         value = textInputImpl.mPopupPanel.GetCutPastePopupIconColor();
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_ICON_PRESSED_COLOR:
       {
         value = textInputImpl.mPopupPanel.GetCutPastePopupIconPressedColor();
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_TEXT_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_TEXT_COLOR:
       {
         value = textInputImpl.mPopupPanel.GetCutPastePopupTextColor();
         break;
       }
-      case Toolkit::TextInput::CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_AND_PASTE_TEXT_PRESSED_COLOR:
       {
         value = textInputImpl.mPopupPanel.GetCutPastePopupTextPressedColor();
         break;
       }
-      case Toolkit::TextInput::CUT_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::CUT_BUTTON_POSITION_PRIORITY:
       {
         value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCut );
         break;
       }
-      case Toolkit::TextInput::COPY_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::COPY_BUTTON_POSITION_PRIORITY:
       {
         value =  textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsCopy );
         break;
       }
-      case Toolkit::TextInput::PASTE_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::PASTE_BUTTON_POSITION_PRIORITY:
       {
         value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsPaste );
         break;
       }
-      case Toolkit::TextInput::SELECT_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::SELECT_BUTTON_POSITION_PRIORITY:
       {
         value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelect );
         break;
       }
-      case Toolkit::TextInput::SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::SELECT_ALL_BUTTON_POSITION_PRIORITY:
       {
         value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsSelectAll );
         break;
       }
-      case Toolkit::TextInput::CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY:
+      case Toolkit::TextInput::Property::CLIPBOARD_BUTTON_POSITION_PRIORITY:
       {
         value = textInputImpl.mPopupPanel.GetButtonPriorityPosition( TextInputPopup::ButtonsClipboard );
         break;
       }
-      case Toolkit::TextInput::POP_UP_OFFSET_FROM_TEXT_PROPERTY:
+      case Toolkit::TextInput::Property::POP_UP_OFFSET_FROM_TEXT:
       {
         value = textInputImpl.GetOffsetFromText();
         break;
       }
-      case Toolkit::TextInput::CURSOR_COLOR_PROPERTY:
+      case Toolkit::TextInput::Property::CURSOR_COLOR:
       {
         value = textInputImpl.mCursor.GetCurrentColor();
       }
index 19d40b9..6dfe840 100644 (file)
@@ -50,13 +50,6 @@ class TextInput : public Control
 {
 public:
 
-  // Properties
-  enum
-  {
-    TEXTINPUT_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
-    TEXTINPUT_PROPERTY_END_INDEX = TEXTINPUT_PROPERTY_START_INDEX + 512 ///< Reserving property indices
-  };
-
   /**
    * Create a new TextInput
    * @return instrusive ptr to a TextInput
@@ -576,7 +569,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 4e369b1..e92e4d0 100644 (file)
@@ -40,23 +40,23 @@ const Vector2 DEFAULT_POPUP_INDICATOR_OFFSET(0.0f, 60.0f);
 /**
  * Image resource paths
  */
-const std::string POPUP_BACKGROUND( DALI_IMAGE_DIR "popup_bubble_bg.#.png" );
-const std::string POPUP_BACKGROUND_EFFECT( DALI_IMAGE_DIR "popup_bubble_bg_ef.#.png" );
-const std::string POPUP_BACKGROUND_LINE( DALI_IMAGE_DIR "popup_bubble_bg_line.#.png" );
-
-const std::string POPUP_TAIL_BOTTOM( DALI_IMAGE_DIR "popup_bubble_tail_bottom.png" );
-const std::string POPUP_TAIL_BOTTOM_EFFECT( DALI_IMAGE_DIR "popup_bubble_tail_bottom_ef.png" );
-const std::string POPUP_TAIL_BOTTOM_LINE( DALI_IMAGE_DIR "popup_bubble_tail_bottom_line.png" );
-const std::string POPUP_TAIL_TOP( DALI_IMAGE_DIR "popup_bubble_tail_top.png" );
-const std::string POPUP_TAIL_TOP_EFFECT( DALI_IMAGE_DIR "popup_bubble_tail_top_ef.png" );
-const std::string POPUP_TAIL_TOP_LINE( DALI_IMAGE_DIR "popup_bubble_tail_top_line.png" );
-
-const std::string OPTION_ICON_CLIPBOARD( DALI_IMAGE_DIR "copy_paste_icon_clipboard.png" );
-const std::string OPTION_ICON_COPY( DALI_IMAGE_DIR "copy_paste_icon_copy.png" );
-const std::string OPTION_ICON_CUT( DALI_IMAGE_DIR "copy_paste_icon_cut.png" );
-const std::string OPTION_ICON_PASTE( DALI_IMAGE_DIR "copy_paste_icon_paste.png" );
-const std::string OPTION_ICON_SELECT( DALI_IMAGE_DIR "copy_paste_icon_select.png" );
-const std::string OPTION_ICON_SELECT_ALL( DALI_IMAGE_DIR "copy_paste_icon_select_all.png" );
+const char* const POPUP_BACKGROUND = DALI_IMAGE_DIR "popup_bubble_bg.#.png";
+const char* const POPUP_BACKGROUND_EFFECT = DALI_IMAGE_DIR "popup_bubble_bg_ef.#.png";
+const char* const POPUP_BACKGROUND_LINE = DALI_IMAGE_DIR "popup_bubble_bg_line.#.png";
+
+const char* const POPUP_TAIL_BOTTOM = DALI_IMAGE_DIR "popup_bubble_tail_bottom.png";
+const char* const POPUP_TAIL_BOTTOM_EFFECT = DALI_IMAGE_DIR "popup_bubble_tail_bottom_ef.png";
+const char* const POPUP_TAIL_BOTTOM_LINE = DALI_IMAGE_DIR "popup_bubble_tail_bottom_line.png";
+const char* const POPUP_TAIL_TOP = DALI_IMAGE_DIR "popup_bubble_tail_top.png";
+const char* const POPUP_TAIL_TOP_EFFECT = DALI_IMAGE_DIR "popup_bubble_tail_top_ef.png";
+const char* const POPUP_TAIL_TOP_LINE = DALI_IMAGE_DIR "popup_bubble_tail_top_line.png";
+
+const char* const OPTION_ICON_CLIPBOARD = DALI_IMAGE_DIR "copy_paste_icon_clipboard.png";
+const char* const OPTION_ICON_COPY = DALI_IMAGE_DIR "copy_paste_icon_copy.png";
+const char* const OPTION_ICON_CUT = DALI_IMAGE_DIR "copy_paste_icon_cut.png";
+const char* const OPTION_ICON_PASTE = DALI_IMAGE_DIR "copy_paste_icon_paste.png";
+const char* const OPTION_ICON_SELECT = DALI_IMAGE_DIR "copy_paste_icon_select.png";
+const char* const OPTION_ICON_SELECT_ALL = DALI_IMAGE_DIR "copy_paste_icon_select_all.png";
 
 /**
  * Constant values for building the GUI
@@ -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 );
@@ -549,8 +547,8 @@ void TextInputPopup::Hide(bool animate)
     if(animate)
     {
       mAnimation = Animation::New( HIDE_POPUP_ANIMATION_DURATION );
-      mAnimation.AnimateTo( Property(mRoot, Actor::Property::Scale), Vector3::ZERO, AlphaFunctions::EaseOut );
-      mAnimation.AnimateTo( Property(mRoot, Actor::Property::ColorAlpha), 0.0f, AlphaFunctions::EaseOut );
+      mAnimation.AnimateTo( Property(mRoot, Actor::Property::SCALE), Vector3::ZERO, AlphaFunctions::EaseOut );
+      mAnimation.AnimateTo( Property(mRoot, Actor::Property::COLOR_ALPHA), 0.0f, AlphaFunctions::EaseOut );
       mAnimation.Play();
 
       mAnimation.FinishedSignal().Connect( this, &TextInputPopup::OnHideFinished );
@@ -558,8 +556,8 @@ void TextInputPopup::Hide(bool animate)
     }
     else
     {
-      mRoot.SetProperty(Actor::Property::Scale, Vector3::ZERO);
-      mRoot.SetProperty(Actor::Property::ColorAlpha, 0.0f);
+      mRoot.SetProperty(Actor::Property::SCALE, Vector3::ZERO);
+      mRoot.SetProperty(Actor::Property::COLOR_ALPHA, 0.0f);
       mState = StateHidden;
     }
   }
@@ -585,8 +583,8 @@ void TextInputPopup::Show( Actor target, bool animate )
     if(animate)
     {
       mAnimation = Animation::New( SHOW_POPUP_ANIMATION_DURATION );
-      mAnimation.AnimateTo( Property(mRoot, Actor::Property::Scale), Vector3::ONE, AlphaFunctions::EaseOut );
-      mAnimation.AnimateTo( Property(mRoot, Actor::Property::ColorAlpha), 1.0f, AlphaFunctions::EaseOut );
+      mAnimation.AnimateTo( Property(mRoot, Actor::Property::SCALE), Vector3::ONE, AlphaFunctions::EaseOut );
+      mAnimation.AnimateTo( Property(mRoot, Actor::Property::COLOR_ALPHA), 1.0f, AlphaFunctions::EaseOut );
       mAnimation.Play();
 
       mAnimation.FinishedSignal().Connect( this, &TextInputPopup::OnShowFinished );
@@ -594,8 +592,8 @@ void TextInputPopup::Show( Actor target, bool animate )
     }
     else
     {
-      mRoot.SetProperty(Actor::Property::Scale, Vector3::ONE);
-      mRoot.SetProperty(Actor::Property::ColorAlpha, 1.0f);
+      mRoot.SetProperty(Actor::Property::SCALE, Vector3::ONE);
+      mRoot.SetProperty(Actor::Property::COLOR_ALPHA, 1.0f);
       mState = StateShown;
     }
   }
@@ -917,4 +915,3 @@ TextInputPopup::VisibilityChangeFinishedSignalType& TextInputPopup::ShowFinished
 } // namespace Toolkit
 
 } // namespace Dali
-
index f8ca367..54761fb 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 5b3e460..a5b28ef 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 // INTERNAL INCLUDES
@@ -38,27 +39,12 @@ namespace Dali
 namespace Toolkit
 {
 
-const Property::Index TextView::PROPERTY_MARKUP_ENABLED( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX );
-const Property::Index TextView::PROPERTY_TEXT( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 1 );
-const Property::Index TextView::PROPERTY_MULTILINE_POLICY( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 2 );
-const Property::Index TextView::PROPERTY_WIDTH_EXCEED_POLICY( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 3 );
-const Property::Index TextView::PROPERTY_HEIGHT_EXCEED_POLICY( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 4 );
-const Property::Index TextView::PROPERTY_LINE_JUSTIFICATION( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 5 );
-const Property::Index TextView::PROPERTY_FADE_BOUNDARY( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 6 );
-const Property::Index TextView::PROPERTY_LINE_HEIGHT_OFFSET( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 7 );
-const Property::Index TextView::PROPERTY_HORIZONTAL_ALIGNMENT( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 8 );
-const Property::Index TextView::PROPERTY_VERTICAL_ALIGNMENT( Internal::TextView::TEXTVIEW_PROPERTY_START_INDEX + 9 );
-
 namespace Internal
 {
 
 namespace
 {
 
-// Signals
-
-const char* const SIGNAL_TEXT_SCROLLED = "scrolled";
-
 const char* MULTILINE_POLICY_NAME[] = {"SplitByNewLineChar", "SplitByWord", "SplitByChar"};
 const char* EXCEED_POLICY_NAME[] = {"Original", "Truncate", "Fade", "Split","ShrinkToFit","EllipsizeEnd"};
 const char* LINE_JUSTIFICATION_NAME[] = {"Left","Center","Right","Justified"};
@@ -66,26 +52,29 @@ const char* LINE_JUSTIFICATION_NAME[] = {"Left","Center","Right","Justified"};
 // Currently on desktop machines 2k x 2k is the maximum frame buffer size, on target is 4k x 4k.
 const float MAX_OFFSCREEN_RENDERING_SIZE = 2048.f;
 
-//Type Registration
+// Type Registration
 BaseHandle Create()
 {
   return Toolkit::TextView::New();
 }
 
-TypeRegistration typeRegistration( typeid( Toolkit::TextView ), typeid( Toolkit::Control ), Create );
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextView, Toolkit::Control, Create );
+
+DALI_PROPERTY_REGISTRATION( TextView, "markup-enabled",       BOOLEAN, MARKUP_ENABLED       )
+DALI_PROPERTY_REGISTRATION( TextView, "text",                 STRING,  TEXT                 )
+DALI_PROPERTY_REGISTRATION( TextView, "multiline-policy",     STRING,  MULTILINE_POLICY     )
+DALI_PROPERTY_REGISTRATION( TextView, "width-exceed-policy",  STRING,  WIDTH_EXCEED_POLICY  )
+DALI_PROPERTY_REGISTRATION( TextView, "height-exceed-policy", STRING,  HEIGHT_EXCEED_POLICY )
+DALI_PROPERTY_REGISTRATION( TextView, "line-justification",   STRING,  LINE_JUSTIFICATION   )
+DALI_PROPERTY_REGISTRATION( TextView, "fade-boundary",        VECTOR4, FADE_BOUNDARY        )
+DALI_PROPERTY_REGISTRATION( TextView, "line-height-offset",   FLOAT,   LINE_HEIGHT_OFFSET   )
+DALI_PROPERTY_REGISTRATION( TextView, "horizontal-alignment", STRING,  HORIZONTAL_ALIGNMENT )
+DALI_PROPERTY_REGISTRATION( TextView, "vertical-alignment",   STRING,  VERTICAL_ALIGNMENT   )
 
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TEXT_SCROLLED , &TextView::DoConnectSignal );
+DALI_SIGNAL_REGISTRATION(   TextView, "scrolled",                      SIGNAL_TEXT_SCROLLED )
 
-PropertyRegistration property1( typeRegistration,  "markup-enabled",       Toolkit::TextView::PROPERTY_MARKUP_ENABLED,       Property::BOOLEAN, &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property2( typeRegistration,  "text",                 Toolkit::TextView::PROPERTY_TEXT,                 Property::STRING,  &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property3( typeRegistration,  "multiline-policy",     Toolkit::TextView::PROPERTY_MULTILINE_POLICY,     Property::STRING,  &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property4( typeRegistration,  "width-exceed-policy",  Toolkit::TextView::PROPERTY_WIDTH_EXCEED_POLICY,  Property::STRING,  &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property5( typeRegistration,  "height-exceed-policy", Toolkit::TextView::PROPERTY_HEIGHT_EXCEED_POLICY, Property::STRING,  &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property6( typeRegistration,  "line-justification",   Toolkit::TextView::PROPERTY_LINE_JUSTIFICATION,   Property::STRING,  &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property7( typeRegistration,  "fade-boundary",        Toolkit::TextView::PROPERTY_FADE_BOUNDARY,        Property::VECTOR4, &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property8( typeRegistration, "line-height-offset",    Toolkit::TextView::PROPERTY_LINE_HEIGHT_OFFSET,   Property::FLOAT,   &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property9( typeRegistration, "horizontal-alignment",  Toolkit::TextView::PROPERTY_HORIZONTAL_ALIGNMENT, Property::STRING,  &TextView::SetProperty, &TextView::GetProperty );
-PropertyRegistration property10( typeRegistration, "vertical-alignment",   Toolkit::TextView::PROPERTY_VERTICAL_ALIGNMENT,   Property::STRING,  &TextView::SetProperty, &TextView::GetProperty );
+DALI_TYPE_REGISTRATION_END()
 
 /**
  * Whether the text-view-processor operation sets, inserts, replaces, removes text.
@@ -774,7 +763,7 @@ void TextView::SetSnapshotModeEnabled( bool enable )
 
       mOffscreenRootActor.SetColorMode( USE_OWN_COLOR );
       mOffscreenRootActor.SetPositionInheritanceMode( DONT_INHERIT_POSITION );
-      mOffscreenRootActor.SetInheritRotation( false );
+      mOffscreenRootActor.SetInheritOrientation( false );
       mOffscreenRootActor.SetInheritScale( false );
       mOffscreenRootActor.SetDepthTestDisabled( true );
 
@@ -1210,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 );
 }
 
 
@@ -1233,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 ) )
   {
@@ -1505,7 +1496,7 @@ void TextView::ProcessSnapshot( const Size& textViewSize )
           mOffscreenCameraActor = CameraActor::New();
           mOffscreenCameraActor.SetParentOrigin( ParentOrigin::CENTER );
           mOffscreenCameraActor.SetAnchorPoint( AnchorPoint::CENTER );
-          mOffscreenCameraActor.SetRotation(Degree(180.f), Vector3::YAXIS);
+          mOffscreenCameraActor.SetOrientation(Degree(180.f), Vector3::YAXIS);
 
           mOffscreenCameraActor.SetType( Dali::Camera::FREE_LOOK ); // Inherits position from the offscreen root actor.
 
@@ -2102,7 +2093,7 @@ void TextView::OnAlignmentPropertySet( Property::Index propertyIndex, Property::
 {
   std::string value( propertyValue.Get<std::string>() );
 
-  if( propertyIndex == Toolkit::TextView::PROPERTY_HORIZONTAL_ALIGNMENT )
+  if( propertyIndex == Toolkit::TextView::Property::HORIZONTAL_ALIGNMENT )
   {
     if(value == "HorizontalLeft")
     {
@@ -2121,7 +2112,7 @@ void TextView::OnAlignmentPropertySet( Property::Index propertyIndex, Property::
       DALI_ASSERT_ALWAYS( !"TextView::OnAlignmentPropertySet(). Invalid Property value." );
     }
   }
-  else if( propertyIndex == Toolkit::TextView::PROPERTY_VERTICAL_ALIGNMENT )
+  else if( propertyIndex == Toolkit::TextView::Property::VERTICAL_ALIGNMENT )
   {
     if( value == "VerticalTop" )
     {
@@ -2202,49 +2193,49 @@ void TextView::SetProperty( BaseObject* object, Property::Index index, const Pro
     TextView& textViewImpl( GetImpl( textView ) );
     switch( index )
     {
-      case Toolkit::TextView::PROPERTY_MARKUP_ENABLED:
+      case Toolkit::TextView::Property::MARKUP_ENABLED:
       {
         textViewImpl.OnMarkupEnabledPeopertySet( value );
         break;
       }
-      case Toolkit::TextView::PROPERTY_TEXT:
+      case Toolkit::TextView::Property::TEXT:
       {
         textViewImpl.SetText( value.Get<std::string>() );
         break;
       }
-      case Toolkit::TextView::PROPERTY_MULTILINE_POLICY:
+      case Toolkit::TextView::Property::MULTILINE_POLICY:
       {
         textViewImpl.OnMultilinePolicyPropertySet( value );
         break;
       }
-      case Toolkit::TextView::PROPERTY_WIDTH_EXCEED_POLICY:
+      case Toolkit::TextView::Property::WIDTH_EXCEED_POLICY:
       {
         textViewImpl.OnWidthExceedPolicyPropertySet( value );
         break;
       }
-      case Toolkit::TextView::PROPERTY_HEIGHT_EXCEED_POLICY:
+      case Toolkit::TextView::Property::HEIGHT_EXCEED_POLICY:
       {
         textViewImpl.OnHeightExceedPolicyPropertySet( value );
         break;
       }
-      case Toolkit::TextView::PROPERTY_LINE_JUSTIFICATION:
+      case Toolkit::TextView::Property::LINE_JUSTIFICATION:
       {
         textViewImpl.OnLineJustificationPropertySet( value );
         break;
       }
-      case Toolkit::TextView::PROPERTY_FADE_BOUNDARY:
+      case Toolkit::TextView::Property::FADE_BOUNDARY:
       {
         textViewImpl.OnFadeBoundaryPropertySet( value );
         break;
       }
-      case Toolkit::TextView::PROPERTY_LINE_HEIGHT_OFFSET:
+      case Toolkit::TextView::Property::LINE_HEIGHT_OFFSET:
       {
         Dali::PointSize pointSize( value.Get<float>() );
         textViewImpl.SetLineHeightOffset(pointSize);
         break;
       }
-      case Toolkit::TextView::PROPERTY_HORIZONTAL_ALIGNMENT:
-      case Toolkit::TextView::PROPERTY_VERTICAL_ALIGNMENT:
+      case Toolkit::TextView::Property::HORIZONTAL_ALIGNMENT:
+      case Toolkit::TextView::Property::VERTICAL_ALIGNMENT:
       {
         textViewImpl.OnAlignmentPropertySet( index, value );
         break;
@@ -2264,37 +2255,37 @@ Property::Value TextView::GetProperty( BaseObject* object, Property::Index index
     TextView& textViewImpl( GetImpl( textView ) );
     switch( index )
     {
-      case Toolkit::TextView::PROPERTY_MARKUP_ENABLED:
+      case Toolkit::TextView::Property::MARKUP_ENABLED:
       {
         value = textViewImpl.IsMarkupProcessingEnabled();
         break;
       }
-      case Toolkit::TextView::PROPERTY_TEXT:
+      case Toolkit::TextView::Property::TEXT:
       {
         value = textViewImpl.GetText();
         break;
       }
-      case Toolkit::TextView::PROPERTY_MULTILINE_POLICY:
+      case Toolkit::TextView::Property::MULTILINE_POLICY:
       {
         value = MULTILINE_POLICY_NAME[ textViewImpl.GetMultilinePolicy() ];
         break;
       }
-      case Toolkit::TextView::PROPERTY_WIDTH_EXCEED_POLICY:
+      case Toolkit::TextView::Property::WIDTH_EXCEED_POLICY:
       {
         value = EXCEED_POLICY_NAME[ textViewImpl.GetWidthExceedPolicy() ];
         break;
       }
-      case Toolkit::TextView::PROPERTY_HEIGHT_EXCEED_POLICY:
+      case Toolkit::TextView::Property::HEIGHT_EXCEED_POLICY:
       {
         value = EXCEED_POLICY_NAME[ textViewImpl.GetHeightExceedPolicy() ];
         break;
       }
-      case Toolkit::TextView::PROPERTY_LINE_JUSTIFICATION:
+      case Toolkit::TextView::Property::LINE_JUSTIFICATION:
       {
         value = LINE_JUSTIFICATION_NAME[ textViewImpl.GetLineJustification() ];
         break;
       }
-      case Toolkit::TextView::PROPERTY_FADE_BOUNDARY:
+      case Toolkit::TextView::Property::FADE_BOUNDARY:
       {
         Toolkit::TextView::FadeBoundary boundary = textViewImpl.GetFadeBoundary();
         value = Vector4( static_cast<float>( boundary.mLeft.value ),
@@ -2303,17 +2294,17 @@ Property::Value TextView::GetProperty( BaseObject* object, Property::Index index
                          static_cast<float>( boundary.mBottom.value ) );
         break;
       }
-      case Toolkit::TextView::PROPERTY_LINE_HEIGHT_OFFSET:
+      case Toolkit::TextView::Property::LINE_HEIGHT_OFFSET:
       {
         value = textViewImpl.GetLineHeightOffset().value;
         break;
       }
-      case Toolkit::TextView::PROPERTY_HORIZONTAL_ALIGNMENT:
+      case Toolkit::TextView::Property::HORIZONTAL_ALIGNMENT:
       {
         value = textViewImpl.OnHorizontalAlignmentPropertyGet();
         break;
       }
-      case Toolkit::TextView::PROPERTY_VERTICAL_ALIGNMENT:
+      case Toolkit::TextView::Property::VERTICAL_ALIGNMENT:
       {
         value = textViewImpl.OnVerticalAlignmentPropertyGet();
         break;
index 235fede..270d32b 100644 (file)
@@ -47,13 +47,6 @@ class TextView : public Control
 {
 public:
 
-  // Properties
-  enum
-  {
-    TEXTVIEW_PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
-    TEXTVIEW_PROPERTY_END_INDEX = TEXTVIEW_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
-  };
-
   /**
    * Internal exceed policy with the valid combinations.
    */
@@ -384,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 800a96b..eab8cf6 100644 (file)
@@ -37,7 +37,7 @@ namespace TextViewProcessor
 namespace
 {
 
-const std::string EMOJI_FONT_NAME( "SamsungEmoji" ); // Emoticons font family name.
+const char* const EMOJI_FONT_NAME = "SamsungEmoji"; ///< Emoticons font family name.
 
 } // namespace
 
index b6554d1..3bdc399 100644 (file)
 #include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/alignment/alignment.h>
 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
 
-// EXTERNAL INCLUDES
-
 namespace Dali
 {
 
@@ -40,12 +39,14 @@ namespace Internal
 
 namespace
 {
+
 BaseHandle Create()
 {
   return Toolkit::ToolBar::New();
 }
 
-TypeRegistration mType( typeid(Toolkit::ToolBar), typeid(Toolkit::Control), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ToolBar, Toolkit::Control, Create )
+DALI_TYPE_REGISTRATION_END()
 
 const float DEFAULT_RELATIVE_SIZE( 0.1f );
 const Toolkit::Alignment::Type DEFAULT_ALIGNMENT( Toolkit::Alignment::HorizontalLeft );
@@ -73,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.SetPreferredSize( Vector2( mToolBarSize.width, mToolBarSize.height ) );
 
   ImageActor imageActor = ImageActor::DownCast( background );
   if ( imageActor )
@@ -124,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.
@@ -319,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 );
@@ -355,7 +359,7 @@ void ToolBar::OnControlChildAdd(Actor& child)
 void ToolBar::OnControlSizeSet( const Vector3& targetSize )
 {
   mToolBarSize = targetSize;
-  mBackground.SetSize( mToolBarSize );
+  mBackground.SetPreferredSize( Vector2( mToolBarSize.width, mToolBarSize.height ) );
 }
 
 } // namespace Internal
index 9e4eb86..a1d0c09 100644 (file)
@@ -22,8 +22,7 @@
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
-
-// INTERNAL INCLUDES
+#include <dali/public-api/object/type-registry-helper.h>
 
 namespace Dali
 {
@@ -34,26 +33,19 @@ namespace Toolkit
 namespace Internal
 {
 
-namespace // to register type
+namespace
 {
 
-// Signals
-
-const char* const SIGNAL_ORIENTATION_ANIMATION_START = "orientation-animation-start";
-
 BaseHandle Create()
 {
   return Toolkit::View::New();
 }
 
-TypeRegistration typeRegistration( typeid( Toolkit::View ), typeid( Toolkit::Control ), Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::View, Toolkit::Control, Create )
 
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_ORIENTATION_ANIMATION_START , &View::DoConnectSignal );
+DALI_SIGNAL_REGISTRATION( View, "orientation-animation-start", SIGNAL_ORIENTATION_ANIMATION_START )
 
-}
-
-namespace
-{
+DALI_TYPE_REGISTRATION_END()
 
 const float ROTATION_ANIMATION_DURATION = 0.5f;
 
@@ -140,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 );
@@ -160,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 )
@@ -298,16 +292,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 5ec14cd..b2e9a08 100644 (file)
@@ -32,9 +32,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 a9b3c9e..ee152de 100644 (file)
@@ -300,7 +300,6 @@ void BlurTwoPassFilter::SetupCamera()
   mCameraForBlur.SetNearClippingPlane(1.0f);
   mCameraForBlur.SetAspectRatio(mTargetSize.width / mTargetSize.height);
   mCameraForBlur.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
-  mCameraForBlur.SetRotation(Quaternion(M_PI, Vector3::YAXIS));
   mCameraForBlur.SetPosition(0.0f, 0.0f, ((mTargetSize.height * 0.5f) / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f)));
 }
 
index 8f444ac..f437c73 100644 (file)
@@ -279,7 +279,6 @@ void EmbossFilter::SetupCamera()
   mCameraActor.SetNearClippingPlane(1.0f);
   mCameraActor.SetAspectRatio(mTargetSize.width / mTargetSize.height);
   mCameraActor.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
-  mCameraActor.SetRotation(Quaternion(M_PI, Vector3::YAXIS));
   mCameraActor.SetPosition(0.0f, 0.0f, ((mTargetSize.height * 0.5f) / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f)));
 }
 
index 3f3eaa6..d0b54f9 100644 (file)
@@ -203,7 +203,6 @@ void SpreadFilter::SetupCamera()
   mCameraActor.SetNearClippingPlane(1.0f);
   mCameraActor.SetAspectRatio(mTargetSize.width / mTargetSize.height);
   mCameraActor.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
-  mCameraActor.SetRotation(Quaternion(M_PI, Vector3::YAXIS));
   mCameraActor.SetPosition(0.0f, 0.0f, ((mTargetSize.height * 0.5f) / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f)));
 }
 
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 4e26bc7..038f99c 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali/public-api/common/stage.h>
 #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/images/resource-image.h>
 #include <dali/integration-api/debug.h>
 
@@ -44,23 +45,16 @@ namespace Toolkit
 namespace Internal
 {
 
-namespace // unnamed namespace
+namespace // Unnamed namespace
 {
 
-// Signals
-
-const char* const SIGNAL_PRE_FOCUS_CHANGE =        "keyboard-pre-focus-change";
-const char* const SIGNAL_FOCUS_CHANGED =           "keyboard-focus-changed";
-const char* const SIGNAL_FOCUS_GROUP_CHANGED =     "keyboard-focus-group-changed";
-const char* const SIGNAL_FOCUSED_ACTOR_ACTIVATED = "keyboard-focused-actor-activated";
-
 #if defined(DEBUG_ENABLED)
 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_KEYBOARD_FOCUS_MANAGER");
 #endif
 
-const std::string IS_FOCUS_GROUP_PROPERTY_NAME("is-keyboard-focus-group"); // This property will be replaced by a flag in Control.
+const char* const IS_FOCUS_GROUP_PROPERTY_NAME = "is-keyboard-focus-group"; // This property will be replaced by a flag in Control.
 
-const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "keyboard_focus.png";
+const char* const FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "keyboard_focus.png";
 const Vector4 FOCUS_BORDER_IMAGE_BORDER = Vector4(7.0f, 7.0f, 7.0f, 7.0f);
 
 BaseHandle Create()
@@ -81,12 +75,14 @@ BaseHandle Create()
   return handle;
 }
 
-TypeRegistration KEYBOARD_FOCUS_MANAGER_TYPE( typeid(Dali::Toolkit::KeyboardFocusManager), typeid(Dali::BaseHandle), Create, true /* Create instance at startup */ );
+DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::KeyboardFocusManager, Dali::BaseHandle, Create, true )
+
+DALI_SIGNAL_REGISTRATION( KeyboardFocusManager, "keyboard-pre-focus-change",        SIGNAL_PRE_FOCUS_CHANGE        )
+DALI_SIGNAL_REGISTRATION( KeyboardFocusManager, "keyboard-focus-changed",           SIGNAL_FOCUS_CHANGED           )
+DALI_SIGNAL_REGISTRATION( KeyboardFocusManager, "keyboard-focus-group-changed",     SIGNAL_FOCUS_GROUP_CHANGED     )
+DALI_SIGNAL_REGISTRATION( KeyboardFocusManager, "keyboard-focused-actor-activated", SIGNAL_FOCUSED_ACTOR_ACTIVATED )
 
-SignalConnectorType signalConnector1( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_PRE_FOCUS_CHANGE , &KeyboardFocusManager::DoConnectSignal );
-SignalConnectorType signalConnector2( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUS_CHANGED , &KeyboardFocusManager::DoConnectSignal );
-SignalConnectorType signalConnector3( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUS_GROUP_CHANGED , &KeyboardFocusManager::DoConnectSignal );
-SignalConnectorType signalConnector4( KEYBOARD_FOCUS_MANAGER_TYPE, SIGNAL_FOCUSED_ACTOR_ACTIVATED , &KeyboardFocusManager::DoConnectSignal );
+DALI_TYPE_REGISTRATION_END()
 
 } // unnamed namespace
 
@@ -481,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 1ee0e9e..fa453dd 100644 (file)
@@ -23,6 +23,7 @@
 #include <sstream>
 #include <dali/public-api/adaptor-framework/singleton-service.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -72,7 +73,9 @@ BaseHandle Create()
 
   return handle;
 }
-TypeRegistration STYLE_MANAGER_TYPE( typeid(Dali::Toolkit::StyleManager), typeid(Dali::BaseHandle), Create, true /* Create instance at startup */ );
+
+DALI_TYPE_REGISTRATION_BEGIN_CREATE( Toolkit::StyleManager, Dali::BaseHandle, Create, true )
+DALI_TYPE_REGISTRATION_END()
 
 } // namespace
 
index 4b7ad4a..975889d 100644 (file)
@@ -105,12 +105,12 @@ void CubeTransitionCrossEffect::OnStopTransition()
     for( unsigned int x = y%2; x < mNumColumns; x=x+2)
     {
       idx = y*mNumColumns + x;
-      mBoxes[idx].SetRotation( Radian(angle), Vector3::XAXIS );
+      mBoxes[idx].SetOrientation( Radian(angle), Vector3::XAXIS );
     }
     for( unsigned int x = (y+1)%2; x < mNumColumns; x=x+2)
     {
       idx = y*mNumColumns + x;
-      mBoxes[idx].SetRotation( Radian(-angle), Vector3::YAXIS );
+      mBoxes[idx].SetOrientation( Radian(-angle), Vector3::YAXIS );
     }
   }
 }
@@ -120,12 +120,12 @@ void CubeTransitionCrossEffect::SetupAnimation(unsigned int actorIndex, float an
 {
   if ( mFirstTransition && (!mIsToNextImage) ) // for the first transition and it is going to previous image
   {
-    mTiles[mContainerIndex][actorIndex].SetRotation( Radian( angle),  axis );
+    mTiles[mContainerIndex][actorIndex].SetOrientation( Radian( angle),  axis );
   }
   else if( !mChangeTurningDirection )   // reset rotation, translation and color
   {
-    mTiles[mContainerIndex][actorIndex].MoveBy( resetTranslation );
-    mTiles[mContainerIndex][actorIndex].SetRotation( Radian( angle),  axis );
+    mTiles[mContainerIndex][actorIndex].TranslateBy( resetTranslation );
+    mTiles[mContainerIndex][actorIndex].SetOrientation( Radian( angle),  axis );
   }
   mAnimation.RotateTo( mBoxes[actorIndex], Radian( -angle ), axis, AlphaFunctions::EaseInOutSine );
   Vector3 position(mBoxes[actorIndex].GetCurrentPosition());
index 1c16683..2872ffa 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/buffer-image.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 namespace Dali
@@ -36,13 +37,12 @@ namespace Internal
 namespace
 {
 
-// Signals
+// Setup properties, signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::CubeTransitionEffect, Dali::BaseHandle, NULL );
 
-const char* const SIGNAL_TRANSITION_COMPLETED = "transition-completed";
+DALI_SIGNAL_REGISTRATION( CubeTransitionEffect, "transition-completed", SIGNAL_TRANSITION_COMPLETED )
 
-TypeRegistration typeRegistration( typeid( Toolkit::CubeTransitionEffect ), typeid( Dali::BaseHandle ), NULL );
-
-SignalConnectorType signalConnector1( typeRegistration, SIGNAL_TRANSITION_COMPLETED , &CubeTransitionEffect::DoConnectSignal );
+DALI_TYPE_REGISTRATION_END()
 
 }
 
@@ -119,6 +119,7 @@ void CubeTransitionEffect::Initialize()
   mEmptyImage.SetSize(Stage::GetCurrent().GetSize());
   mEmptyImage.SetParentOrigin( ParentOrigin::CENTER );
   mEmptyImage.SetAnchorPoint( AnchorPoint::CENTER );
+  mEmptyImage.SetRelayoutEnabled( false );
   mFullImageCreator = FullAreaImageCreator::New();
   mEmptyImage.SetShaderEffect( mFullImageCreator );
   Stage::GetCurrent().Add(mEmptyImage);
@@ -141,6 +142,7 @@ ImageActor CubeTransitionEffect::CreateTile( Image image, const Vector4& color )
   ImageActor tile = ImageActor::New( image );
   tile.SetParentOrigin( ParentOrigin::CENTER );
   tile.SetAnchorPoint( AnchorPoint::CENTER );
+  tile.SetRelayoutEnabled( false );
   tile.SetSize( mTileSize );
   tile.SetColorMode( Dali::USE_OWN_COLOR );
   tile.SetColor( color );
index 803ed2a..abffa6a 100644 (file)
@@ -102,11 +102,11 @@ void CubeTransitionFoldEffect::OnStopTransition()
     idx = y*mNumColumns;
     for( unsigned int x = y%2; x < mNumColumns; x=x+2)
     {
-      mBoxes[idx+x].SetRotation( Radian(angle), Vector3::YAXIS );
+      mBoxes[idx+x].SetOrientation( Radian(angle), Vector3::YAXIS );
     }
     for( unsigned int x = (y+1)%2; x < mNumColumns; x=x+2)
     {
-      mBoxes[idx+x].SetRotation( Radian(-angle), Vector3::YAXIS );
+      mBoxes[idx+x].SetOrientation( Radian(-angle), Vector3::YAXIS );
     }
   }
 }
@@ -118,12 +118,12 @@ void CubeTransitionFoldEffect::SetupAnimation(unsigned int actorIndex, float ang
   ImageActor frontTile = mTiles[mContainerIndex^1][actorIndex];
   if ( mFirstTransition && (!mIsToNextImage) ) // for the first transition, it is going to previous image
   {
-    sideTile.SetRotation( Radian( angle),   Vector3::YAXIS );
+    sideTile.SetOrientation( Radian( angle),   Vector3::YAXIS );
   }
   else if( !mChangeTurningDirection )   // reset rotation, translation and color
   {
-    sideTile.MoveBy( resetTranslation );
-    sideTile.SetRotation( Radian( angle),   Vector3::YAXIS );
+    sideTile.TranslateBy( resetTranslation );
+    sideTile.SetOrientation( Radian( angle),   Vector3::YAXIS );
   }
   mAnimation.RotateTo( currentCube, Radian( -angle ), Vector3::YAXIS, AlphaFunctions::Linear );
   Vector3 position(currentCube.GetCurrentPosition());
index d483ff1..1f8ca0f 100644 (file)
@@ -74,15 +74,15 @@ void CubeTransitionWaveEffect::OnStartTransition( Vector2 panPosition, Vector2 p
   {
     for( unsigned int idx = 0; idx < totalNum; idx++ )
     {
-      mTiles[mContainerIndex][idx].SetRotation( Degree( angle),  Vector3::YAXIS );
+      mTiles[mContainerIndex][idx].SetOrientation( Degree( angle),  Vector3::YAXIS );
     }
   }
   else if(!mChangeTurningDirection)  // reset rotation, translation
   {
     for( unsigned int idx = 0; idx < totalNum; idx++ )
     {
-      mTiles[mContainerIndex][idx].MoveBy( translation );
-      mTiles[mContainerIndex][idx].SetRotation( Degree( angle),  Vector3::YAXIS );
+      mTiles[mContainerIndex][idx].TranslateBy( translation );
+      mTiles[mContainerIndex][idx].SetOrientation( Degree( angle),  Vector3::YAXIS );
     }
   }
 
@@ -118,7 +118,7 @@ void CubeTransitionWaveEffect::OnStopTransition()
   unsigned int totalNum = mNumRows * mNumColumns;
   for( unsigned int idx = 0; idx < totalNum; idx++ )
   {
-    mBoxes[idx].SetRotation( Degree( angle ), Vector3::YAXIS );
+    mBoxes[idx].SetOrientation( Degree( angle ), Vector3::YAXIS );
   }
 }
 
index d67e38f..19e9fc6 100644 (file)
@@ -59,17 +59,34 @@ class DALI_IMPORT_API Button : public Control
 {
 public:
 
-  // Properties
-  static const Dali::Property::Index PROPERTY_DISABLED;                     ///< name "disabled",                     @see SetDisabled(),                  type BOOLEAN
-  static const Dali::Property::Index PROPERTY_AUTO_REPEATING;               ///< name "auto-repeating",               @see SetAutoRepeating(),             type BOOLEAN
-  static const Dali::Property::Index PROPERTY_INITIAL_AUTO_REPEATING_DELAY; ///< name "initial-auto-repeating-delay", @see SetInitialAutoRepeatingDelay(), type FLOAT
-  static const Dali::Property::Index PROPERTY_NEXT_AUTO_REPEATING_DELAY;    ///< name "next-auto-repeating-delay",    @see SetNextAutoRepeatingDelay(),    type FLOAT
-  static const Dali::Property::Index PROPERTY_TOGGLABLE;                    ///< name "togglable",                    @see SetTogglableButton(),           type BOOLEAN
-  static const Dali::Property::Index PROPERTY_SELECTED;                     ///< name "selected",                     @see SetSelected(),                  type BOOLEAN
-  static const Dali::Property::Index PROPERTY_NORMAL_STATE_ACTOR;           ///< name "normal-state-actor",           @see SetButtonImage(),               type MAP
-  static const Dali::Property::Index PROPERTY_SELECTED_STATE_ACTOR;         ///< name "selected-state-actor",         @see SetSelectedImage(),             type MAP
-  static const Dali::Property::Index PROPERTY_DISABLED_STATE_ACTOR;         ///< name "disabled-state-actor",         @see SetDisabledImage(),             type MAP
-  static const Dali::Property::Index PROPERTY_LABEL_ACTOR;                  ///< name "label-actor",                  @see SetLabel(),                     type MAP
+  /**
+   * @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
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the Button class.
+   */
+  struct Property
+  {
+    enum
+    {
+      DISABLED = PROPERTY_START_INDEX, ///< name "disabled",                     @see SetDisabled(),                  type bool
+      AUTO_REPEATING,                  ///< name "auto-repeating",               @see SetAutoRepeating(),             type bool
+      INITIAL_AUTO_REPEATING_DELAY,    ///< name "initial-auto-repeating-delay", @see SetInitialAutoRepeatingDelay(), type float
+      NEXT_AUTO_REPEATING_DELAY,       ///< name "next-auto-repeating-delay",    @see SetNextAutoRepeatingDelay(),    type float
+      TOGGLABLE,                       ///< name "togglable",                    @see SetTogglableButton(),           type bool
+      SELECTED,                        ///< name "selected",                     @see SetSelected(),                  type bool
+      NORMAL_STATE_ACTOR,              ///< name "normal-state-actor",           @see SetButtonImage(),               type Map
+      SELECTED_STATE_ACTOR,            ///< name "selected-state-actor",         @see SetSelectedImage(),             type Map
+      DISABLED_STATE_ACTOR,            ///< name "disabled-state-actor",         @see SetDisabledImage(),             type Map
+      LABEL_ACTOR,                     ///< name "label-actor",                  @see SetLabel(),                     type Map
+    };
+  };
 
 public:
 
index aff0afb..d417e0f 100644 (file)
@@ -54,7 +54,7 @@ public:
 
   // Custom properties
 
-  static const std::string CLUSTER_ACTOR_DEPTH;                           ///< Property, name "cluster-actor-depth",      type FLOAT
+  static const std::string CLUSTER_ACTOR_DEPTH;                           ///< Property, name "cluster-actor-depth",      type float
 
 public:
 
index 495d616..3aa01ef 100644 (file)
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 #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>
@@ -43,39 +43,9 @@ namespace Dali
 namespace Toolkit
 {
 
-const Property::Index Control::PROPERTY_BACKGROUND_COLOR      = Internal::Control::CONTROL_PROPERTY_START_INDEX;
-const Property::Index Control::PROPERTY_BACKGROUND            = Internal::Control::CONTROL_PROPERTY_START_INDEX + 1;
-const Property::Index Control::PROPERTY_WIDTH_POLICY          = Internal::Control::CONTROL_PROPERTY_START_INDEX + 2;
-const Property::Index Control::PROPERTY_HEIGHT_POLICY         = Internal::Control::CONTROL_PROPERTY_START_INDEX + 3;
-const Property::Index Control::PROPERTY_MINIMUM_SIZE          = Internal::Control::CONTROL_PROPERTY_START_INDEX + 4;
-const Property::Index Control::PROPERTY_MAXIMUM_SIZE          = Internal::Control::CONTROL_PROPERTY_START_INDEX + 5;
-const Property::Index Control::PROPERTY_KEY_INPUT_FOCUS       = Internal::Control::CONTROL_PROPERTY_START_INDEX + 6;
-
 namespace
 {
 
-// Signals
-
-const char* const SIGNAL_KEY_EVENT =    "key-event";
-const char* const SIGNAL_TAPPED =       "tapped";
-const char* const SIGNAL_PANNED =       "panned";
-const char* const SIGNAL_PINCHED =      "pinched";
-const char* const SIGNAL_LONG_PRESSED = "long-pressed";
-
-// Actions
-
-const char* const ACTION_CONTROL_ACTIVATED = "control-activated";
-
-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
@@ -89,17 +59,20 @@ BaseHandle Create()
   return Internal::Control::New();
 }
 
-TypeRegistration CONTROL_TYPE( typeid(Control), typeid(CustomActor), Create );
+// Setup signals and actions using the type-registry.
+DALI_TYPE_REGISTRATION_BEGIN( Control, CustomActor, Create );
 
-// Property Registration after Internal::Control::Impl definition below
+// Note: Properties are registered separately below,
 
-TypeAction ACTION_TYPE_1( CONTROL_TYPE, ACTION_CONTROL_ACTIVATED, &Internal::Control::DoAction );
+DALI_SIGNAL_REGISTRATION( Control, "key-event",                 SIGNAL_KEY_EVENT         )
+DALI_SIGNAL_REGISTRATION( Control, "tapped",                    SIGNAL_TAPPED            )
+DALI_SIGNAL_REGISTRATION( Control, "panned",                    SIGNAL_PANNED            )
+DALI_SIGNAL_REGISTRATION( Control, "pinched",                   SIGNAL_PINCHED           )
+DALI_SIGNAL_REGISTRATION( Control, "long-pressed",              SIGNAL_LONG_PRESSED      )
 
-SignalConnectorType SIGNAL_CONNECTOR_1( CONTROL_TYPE, SIGNAL_KEY_EVENT,     &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_2( CONTROL_TYPE, SIGNAL_TAPPED,        &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_3( CONTROL_TYPE, SIGNAL_PANNED,        &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_4( CONTROL_TYPE, SIGNAL_PINCHED,       &Internal::Control::DoConnectSignal );
-SignalConnectorType SIGNAL_CONNECTOR_5( CONTROL_TYPE, SIGNAL_LONG_PRESSED,  &Internal::Control::DoConnectSignal );
+DALI_ACTION_REGISTRATION( Control, "control-activated",         ACTION_CONTROL_ACTIVATED )
+
+DALI_TYPE_REGISTRATION_END()
 
 /**
  * Structure which holds information about the background of a control
@@ -119,70 +92,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;
-}
-
 
 /**
  * Sets all the required properties for the background actor.
@@ -197,11 +106,8 @@ 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 );
-
-  Constraint constraint = Constraint::New<Vector3>( constrainingIndex,
-                                                    ParentSource( Actor::Property::Size ),
-                                                    EqualToConstraint() );
-  actor.ApplyConstraint( constraint );
+  actor.SetRelayoutEnabled( true );
+  actor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS );
 }
 
 } // unnamed namespace
@@ -235,10 +141,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 )
@@ -307,13 +210,13 @@ public:
 
       switch ( index )
       {
-        case Toolkit::Control::PROPERTY_BACKGROUND_COLOR:
+        case Toolkit::Control::Property::BACKGROUND_COLOR:
         {
           controlImpl.SetBackgroundColor( value.Get< Vector4 >() );
           break;
         }
 
-        case Toolkit::Control::PROPERTY_BACKGROUND:
+        case Toolkit::Control::Property::BACKGROUND_IMAGE:
         {
           if ( value.HasKey( "image" ) )
           {
@@ -322,7 +225,7 @@ public:
 
             if ( image )
             {
-              controlImpl.SetBackground( image );
+              controlImpl.SetBackgroundImage( image );
             }
           }
           else if ( value.Get< Property::Map >().Empty() )
@@ -333,31 +236,7 @@ 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:
+        case Toolkit::Control::Property::KEY_INPUT_FOCUS:
         {
           if ( value.Get< bool >() )
           {
@@ -391,13 +270,13 @@ public:
 
       switch ( index )
       {
-        case Toolkit::Control::PROPERTY_BACKGROUND_COLOR:
+        case Toolkit::Control::Property::BACKGROUND_COLOR:
         {
           value = controlImpl.GetBackgroundColor();
           break;
         }
 
-        case Toolkit::Control::PROPERTY_BACKGROUND:
+        case Toolkit::Control::Property::BACKGROUND_IMAGE:
         {
           Property::Map map;
 
@@ -418,31 +297,7 @@ 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:
+        case Toolkit::Control::Property::KEY_INPUT_FOCUS:
         {
           value = controlImpl.HasKeyInputFocus();
           break;
@@ -453,79 +308,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;
@@ -541,33 +323,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 functions within this class.
+  // 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;
 };
 
-PropertyRegistration Control::Impl::PROPERTY_1( CONTROL_TYPE, "background-color", Toolkit::Control::PROPERTY_BACKGROUND_COLOR, Property::VECTOR4, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_2( CONTROL_TYPE, "background",       Toolkit::Control::PROPERTY_BACKGROUND,       Property::MAP,     &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_3( CONTROL_TYPE, "width-policy",     Toolkit::Control::PROPERTY_WIDTH_POLICY,     Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_4( CONTROL_TYPE, "height-policy",    Toolkit::Control::PROPERTY_HEIGHT_POLICY,    Property::STRING,  &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_5( CONTROL_TYPE, "minimum-size",     Toolkit::Control::PROPERTY_MINIMUM_SIZE,     Property::VECTOR3, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_6( CONTROL_TYPE, "maximum-size",     Toolkit::Control::PROPERTY_MAXIMUM_SIZE,     Property::VECTOR3, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-PropertyRegistration Control::Impl::PROPERTY_7( CONTROL_TYPE, "key-input-focus",  Toolkit::Control::PROPERTY_KEY_INPUT_FOCUS,  Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+// 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-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()
 {
@@ -589,79 +360,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 )
@@ -764,7 +477,7 @@ Vector4 Control::GetBackgroundColor() const
   return Color::TRANSPARENT;
 }
 
-void Control::SetBackground( Image image )
+void Control::SetBackgroundImage( Image image )
 {
   Background& background( mImpl->GetBackground() );
 
@@ -776,7 +489,7 @@ void Control::SetBackground( Image image )
   }
 
   ImageActor imageActor = ImageActor::New( image );
-  SetupBackgroundActor( imageActor, Actor::Property::Size, background.color );
+  SetupBackgroundActor( imageActor, Actor::Property::SIZE, background.color );
 
   // Set the background actor before adding so that we do not inform derived classes
   background.actor = imageActor;
@@ -836,116 +549,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;
@@ -1065,10 +668,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();
@@ -1144,32 +753,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()
 {
 }
@@ -1235,16 +818,26 @@ void Control::OnControlSizeSet( const Vector3& size )
 {
 }
 
-void Control::OnRelayout( const Vector2& size, ActorSizeContainer& container )
+void Control::OnCalculateRelayoutSize( Dimension dimension )
+{
+}
+
+void Control::OnLayoutNegotiated( float size, Dimension dimension )
 {
-  unsigned int numChildren = Self().GetChildCount();
+}
 
-  for( unsigned int i=0; i<numChildren; ++i )
+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
@@ -1280,15 +873,8 @@ bool Control::OnMouseWheelEvent(const MouseWheelEvent& event)
   return false; // Do not consume
 }
 
-Actor Control::GetChildByAlias(const std::string& actorAlias)
-{
-  return Actor();
-}
-
 void Control::OnStageConnection()
 {
-  RelayoutRequest();
-
   // Notify derived classes.
   OnControlStageConnection();
 }
@@ -1307,9 +893,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 );
 }
@@ -1322,16 +905,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 fcb1454..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
 {
 
@@ -62,13 +58,6 @@ class DALI_IMPORT_API Control : public CustomActorImpl, public ConnectionTracker
 {
 public:
 
-  // Properties
-  enum
-  {
-    CONTROL_PROPERTY_START_INDEX = PROPERTY_REGISTRATION_START_INDEX,
-    CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices
-  };
-
   // Creation & Destruction
 
   /**
@@ -87,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()
@@ -122,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.
@@ -231,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
@@ -298,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
 
   /**
@@ -438,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:
 
@@ -595,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.
@@ -654,9 +547,29 @@ private:
   virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
 
   /**
-   * @copydoc Dali::CustomActorImpl::GetChildByAlias(const std::string& actorAlias)
+   * @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 Actor GetChildByAlias(const std::string& actorAlias);
+  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 ada7c17..1e6f8d9 100644 (file)
@@ -65,37 +65,27 @@ class DALI_IMPORT_API Control : public CustomActor
 {
 public:
 
-  /// @name Properties
-  /** @{ */
-  static const Dali::Property::Index PROPERTY_BACKGROUND_COLOR;    ///< name "background-color",        @see SetBackgroundColor,        type VECTOR4
-  static const Dali::Property::Index PROPERTY_BACKGROUND;          ///< name "background",              @see SetBackground,             type MAP
-  static const Dali::Property::Index PROPERTY_WIDTH_POLICY;        ///< name "width-policy",            @see SetSizePolicy,             type STRING
-  static const Dali::Property::Index PROPERTY_HEIGHT_POLICY;       ///< name "height-policy",           @see SetSizePolicy,             type STRING
-  static const Dali::Property::Index PROPERTY_MINIMUM_SIZE;        ///< name "minimum-size",            @see SetMinimumSize,            type VECTOR3
-  static const Dali::Property::Index PROPERTY_MAXIMUM_SIZE;        ///< name "maximum-size",            @see SetMaximumSize,            type VECTOR3
-  static const Dali::Property::Index PROPERTY_KEY_INPUT_FOCUS;     ///< name "key-input-focus",         @see SetKeyInputFocus,          type BOOLEAN
-  /** @} */
-
   /**
-   * @brief Describes how a control could be resized.
+   * @brief The start and end property ranges for control.
    */
-  enum SizePolicy
+  enum PropertyRange
   {
-    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.
+    PROPERTY_START_INDEX = PROPERTY_REGISTRATION_START_INDEX,        ///< Start index is used by the property registration macro.
+    CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX,             ///< Start index of Control properties.
+    CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices.
   };
 
   /**
-   * @brief Describes what a control should do when a contained actor/control exceeds the boundary of the control.
+   * @brief An enumeration of properties belonging to the Control class.
    */
-  enum ExceedPolicy
+  struct Property
   {
-    Crop,   ///< Control's contents will be cropped.
-    Shrink, ///< Control's contents will be shrunk.
-    Scroll  ///< Control's contents will be added to a scroll.
+    enum
+    {
+      BACKGROUND_COLOR = PROPERTY_START_INDEX, ///< name "background-color", @see SetBackgroundColor, type Vector4
+      BACKGROUND_IMAGE,                        ///< name "background-image", @see SetBackgroundImage, type Map
+      KEY_INPUT_FOCUS,                         ///< name "key-input-focus",  @see SetKeyInputFocus,   type bool
+    };
   };
 
   /**
@@ -184,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
 
   /**
@@ -350,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 b474e76..0c604ec 100644 (file)
@@ -59,11 +59,11 @@ public:
    */
   enum CustomProperty
   {
-    BACKGROUND_COLOR,    ///< Name "background-color", type VECTOR4
-    SOURCE_SIZE,         ///< Name "source-size",      type VECTOR2
-    SOURCE_OFFSET,       ///< Name "source-offset",    type VECTOR2
-    MASK_SIZE,           ///< Name "mask-size",        type VECTOR2
-    MASK_OFFSET,         ///< Name "mask-offset",      type VECTOR2
+    BACKGROUND_COLOR,    ///< Name "background-color", type Vector4
+    SOURCE_SIZE,         ///< Name "source-size",      type Vector2
+    SOURCE_OFFSET,       ///< Name "source-offset",    type Vector2
+    MASK_SIZE,           ///< Name "mask-size",        type Vector2
+    MASK_OFFSET,         ///< Name "mask-offset",      type Vector2
 
     CUSTOM_PROPERTY_COUNT
   };
index 4538f81..ff6cee0 100644 (file)
@@ -47,7 +47,7 @@ public:
 
   // Custom properties
 
-  static const std::string SOURCE_POSITION_PROPERTY_NAME;                   ///< Property, name "source-position",              type VECTOR3
+  static const std::string SOURCE_POSITION_PROPERTY_NAME;                   ///< Property, name "source-position",              type Vector3
 
 public:
 
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 c9b04d8..70fcb9d 100755 (executable)
@@ -53,15 +53,32 @@ class DALI_IMPORT_API ScrollBar : public ScrollComponent
 {
 public:
 
+  /**
+   * @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
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the ScrollBar class.
+   */
+  struct Property
+  {
+    enum
+    {
+      INDICATOR_HEIGHT_POLICY = PROPERTY_START_INDEX, ///< name "indicator-height-policy", @see SetIndicatorHeightPolicy(), type std::string
+      INDICATOR_FIXED_HEIGHT,                         ///< name "indicator-fixed-height",  @see SetIndicatorFixedHeight(),  type float
+      INDICATOR_SHOW_DURATION,                        ///< name "indicator-show-duration", @see SetIndicatorShowDuration(), type float
+      INDICATOR_HIDE_DURATION,                        ///< name "indicator-hide-duration", @see SetIndicatorHideDuration(), type float
+    };
+  };
+
   // Signals
   typedef Signal< void ( float ) > ScrollPositionNotifiedSignalType;
 
-  // Properties
-  static const Dali::Property::Index PROPERTY_INDICATOR_HEIGHT_POLICY;         ///< name "indicator-height-policy", @see SetIndicatorHeightPolicy(), type STRING
-  static const Dali::Property::Index PROPERTY_INDICATOR_FIXED_HEIGHT;          ///< name "indicator-fixed-height",  @see SetIndicatorFixedHeight(),  type FLOAT
-  static const Dali::Property::Index PROPERTY_INDICATOR_SHOW_DURATION;         ///< name "indicator-show-duration", @see SetIndicatorShowDuration(), type FLOAT
-  static const Dali::Property::Index PROPERTY_INDICATOR_HIDE_DURATION;         ///< name "indicator-hide-duration", @see SetIndicatorHideDuration(), type FLOAT
-
 public:
 
   /**
index 33acbc4..54809c3 100644 (file)
@@ -200,10 +200,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d
     if (GetPositionConstraint(itemId, positionConstraint))
     {
       WrappedVector3Constraint wrapped(positionConstraint, itemId);
-      Constraint constraint = Constraint::New<Vector3>( Actor::Property::Position,
+      Constraint constraint = Constraint::New<Vector3>( Actor::Property::POSITION,
                                                         Source( scrollPositionObject, scrollPositionProperty ),
                                                         ParentSource( scrollSpeedProperty ),
-                                                        ParentSource( Actor::Property::Size ),
+                                                        ParentSource( Actor::Property::SIZE ),
                                                         wrapped );
       constraint.SetApplyTime(durationSeconds);
       constraint.SetAlphaFunction(mAlphaFunction);
@@ -215,10 +215,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d
     {
       WrappedQuaternionConstraint wrapped(rotationConstraint, itemId);
 
-      Constraint constraint = Constraint::New<Quaternion>( Actor::Property::Rotation,
+      Constraint constraint = Constraint::New<Quaternion>( Actor::Property::ORIENTATION,
                                                            Source( scrollPositionObject, scrollPositionProperty ),
                                                            ParentSource( scrollSpeedProperty ),
-                                                           ParentSource( Actor::Property::Size ),
+                                                           ParentSource( Actor::Property::SIZE ),
                                                            wrapped );
       constraint.SetApplyTime(durationSeconds);
       constraint.SetAlphaFunction(mAlphaFunction);
@@ -231,10 +231,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d
     {
       WrappedVector3Constraint wrapped(scaleConstraint, itemId);
 
-      Constraint constraint = Constraint::New<Vector3>( Actor::Property::Scale,
+      Constraint constraint = Constraint::New<Vector3>( Actor::Property::SCALE,
                                                         Source( scrollPositionObject, scrollPositionProperty ),
                                                         ParentSource( scrollSpeedProperty ),
-                                                        ParentSource( Actor::Property::Size ),
+                                                        ParentSource( Actor::Property::SIZE ),
                                                         wrapped );
       constraint.SetApplyTime(durationSeconds);
       constraint.SetAlphaFunction(mAlphaFunction);
@@ -247,10 +247,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d
     {
       WrappedVector4Constraint wrapped(colorConstraint, itemId);
 
-      Constraint constraint = Constraint::New<Vector4>( Actor::Property::Color,
+      Constraint constraint = Constraint::New<Vector4>( Actor::Property::COLOR,
                                                         Source( scrollPositionObject, scrollPositionProperty ),
                                                         ParentSource( scrollSpeedProperty ),
-                                                        ParentSource( Actor::Property::Size ),
+                                                        ParentSource( Actor::Property::SIZE ),
                                                         wrapped );
 
       constraint.SetApplyTime(durationSeconds);
@@ -265,10 +265,10 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d
     {
       WrappedBoolConstraint wrapped(visibilityConstraint, itemId);
 
-      Constraint constraint = Constraint::New<bool>( Actor::Property::Visible,
+      Constraint constraint = Constraint::New<bool>( Actor::Property::VISIBLE,
                                                      Source( scrollPositionObject, scrollPositionProperty ),
                                                      ParentSource( scrollSpeedProperty ),
-                                                     ParentSource( Actor::Property::Size ),
+                                                     ParentSource( Actor::Property::SIZE ),
                                                      wrapped );
 
       constraint.SetApplyTime(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.
diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/navigation-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/navigation-layout.cpp
deleted file mode 100755 (executable)
index d415d5e..0000000
+++ /dev/null
@@ -1,571 +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 <algorithm>
-
-#include <dali-toolkit/public-api/controls/scrollable/item-view/navigation-layout.h>
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace // unnamed namespace
-{
-const unsigned int DEFAULT_NUMBER_OF_COLUMNS = 3;
-const float DEFAULT_TOP_MARGIN     =  0.3f;
-const float DEFAULT_BOTTOM_MARGIN  =  0.3f;
-const float DEFAULT_SIDE_MARGIN    =  0.2f;
-const float DEFAULT_COLUMN_SPACING =  20.0f;
-const float DEFAULT_ROW_SPACING    =  20.0f;
-const float DEFAULT_SCROLL_SPEED_FACTOR = 0.01f;
-const float DEFAULT_MAXIMUM_SWIPE_SPEED = 3.0f;
-const float DEFAULT_ITEM_FLICK_ANIMATION_DURATION = 0.05f;
-const float DEFAULT_SIZE_EXTEND = 1.4f;
-const float DEFAULT_HEIGHT_FACTOR = 0.6f;
-
-// 4 orientations are supported
-struct NavigationPositionConstraintUp
-{
-  NavigationPositionConstraintUp(const unsigned int columnIndex,
-                                         const unsigned int numberOfColumns,
-                                         const float columnSpacing,
-                                         const float sizeExtend,
-                                         const float bottomMargin,
-                                         const float topMargin)
-  : mColumnIndex(columnIndex),
-    mNumberOfColumns(numberOfColumns),
-    mColumnSpacing(columnSpacing),
-    mSizeExtend(sizeExtend),
-    mBottomMargin(bottomMargin),
-    mTopMargin(topMargin)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float itemWidth = (layoutSize.width * mSizeExtend- mColumnSpacing * (mNumberOfColumns - 1))/( mNumberOfColumns );
-
-    Vector3 itemPosition;
-
-    float z = (sinf((layoutPosition + 1.0f) * Math::PI *0.5f) - 1.0f) * itemWidth * 2.0f;
-
-    itemPosition = Vector3( (layoutPosition + 1.0f) * (itemWidth + mColumnSpacing) + itemWidth * 0.5f - layoutSize.width * mSizeExtend * 0.5f,
-                             (- mBottomMargin + mTopMargin) * layoutSize.width * 0.5f ,
-                             z);
-    return itemPosition;
-  }
-
-public:
-  unsigned int mColumnIndex;
-  unsigned int mNumberOfColumns;
-  float mColumnSpacing;
-  float mSizeExtend;
-  float mBottomMargin;
-  float mTopMargin;
-};
-
-struct NavigationPositionConstraintLeft
-{
-  NavigationPositionConstraintLeft(const unsigned int columnIndex,
-                                          const unsigned int numberOfColumns,
-                                          const float columnSpacing,
-                                          const float sizeExtend,
-                                          const float bottomMargin,
-                                          const float topMargin)
-  : mColumnIndex(columnIndex),
-    mNumberOfColumns(numberOfColumns),
-    mColumnSpacing(columnSpacing),
-    mSizeExtend(sizeExtend),
-    mBottomMargin(bottomMargin),
-    mTopMargin(topMargin)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float itemWidth = (DEFAULT_HEIGHT_FACTOR * layoutSize.height * mSizeExtend- mColumnSpacing * (mNumberOfColumns - 1))/( mNumberOfColumns );
-    Vector3 itemPosition;
-    float z = (sinf((layoutPosition + 1.0f) * Math::PI *0.5f) - 1.0f) * itemWidth * 1.5f;
-    itemPosition = Vector3( (- mBottomMargin + mTopMargin) * 0.5f * layoutSize.width ,
-                            -((layoutPosition+ 1.0) * (itemWidth + mColumnSpacing) + itemWidth * 0.5f - DEFAULT_HEIGHT_FACTOR * layoutSize.height * mSizeExtend * 0.5f ),
-                            z);
-    return itemPosition;
-  }
-
-public:
-  unsigned int mColumnIndex;
-  unsigned int mNumberOfColumns;
-  float mColumnSpacing;
-  float mSizeExtend;
-  float mBottomMargin;
-  float mTopMargin;
-};
-
-struct NavigationPositionConstraintDown
-{
-  NavigationPositionConstraintDown(const unsigned int columnIndex,
-                                            const unsigned int numberOfColumns,
-                                            const float columnSpacing,
-                                            const float sizeExtend,
-                                            const float bottomMargin,
-                                            const float topMargin)
-  : mColumnIndex(columnIndex),
-    mNumberOfColumns(numberOfColumns),
-    mColumnSpacing(columnSpacing),
-    mSizeExtend(sizeExtend),
-    mBottomMargin(bottomMargin),
-    mTopMargin(topMargin)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float itemWidth = (layoutSize.width * mSizeExtend- mColumnSpacing * (mNumberOfColumns - 1))/( mNumberOfColumns );
-    Vector3 itemPosition;
-
-    float z = (sinf((layoutPosition + 1.0f ) * Math::PI *0.5f) - 1.0f) * itemWidth * 2.0f;
-    itemPosition = Vector3(  -((layoutPosition + 1.0f)  * (itemWidth + mColumnSpacing) + itemWidth * 0.5f - layoutSize.width * mSizeExtend * 0.5f),
-                             (- mBottomMargin + mTopMargin)* layoutSize.width * 0.5f,
-                             z);
-    return itemPosition;
-  }
-
-  public:
-    unsigned int mColumnIndex;
-    unsigned int mNumberOfColumns;
-    float mColumnSpacing;
-    float mSizeExtend;
-    float mBottomMargin;
-    float mTopMargin;
-};
-
-struct NavigationPositionConstraintRight
-{
-  NavigationPositionConstraintRight(const unsigned int columnIndex,
-                                            const unsigned int numberOfColumns,
-                                            const float columnSpacing,
-                                            const float sizeExtend,
-                                            const float bottomMargin,
-                                            const float topMargin)
-  : mColumnIndex(columnIndex),
-    mNumberOfColumns(numberOfColumns),
-    mColumnSpacing(columnSpacing),
-    mSizeExtend(sizeExtend),
-    mBottomMargin(bottomMargin),
-    mTopMargin(topMargin)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float itemWidth = (DEFAULT_HEIGHT_FACTOR * layoutSize.height * mSizeExtend- mColumnSpacing * (mNumberOfColumns - 1))/( mNumberOfColumns );
-    Vector3 itemPosition;
-    float z = (sinf((layoutPosition + 1.0f) * Math::PI *0.5f) - 1.0f) * itemWidth * 1.5f;
-    itemPosition = Vector3(  (- mBottomMargin + mTopMargin) * layoutSize.width * 0.5f,
-                             ((layoutPosition + 1.0f) * (itemWidth + mColumnSpacing) + itemWidth * 0.5f - DEFAULT_HEIGHT_FACTOR * layoutSize.height * mSizeExtend *0.5f ),
-                             z);
-  return itemPosition;
-  }
-
-public:
-  unsigned int mColumnIndex;
-  unsigned int mNumberOfColumns;
-  float mColumnSpacing;
-  float mSizeExtend;
-  float mBottomMargin;
-  float mTopMargin;
-};
-
-struct NavigationRotationConstraintUp
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float angle = 0.0f;
-    float _layoutPosition = layoutPosition + 1.0f;
-    if(_layoutPosition >= 1.0f)
-    {
-      angle = - sinf(Math::PI * _layoutPosition) * Math::PI * 0.2f;
-    }
-    else
-    {
-      angle =  sinf(Math::PI * _layoutPosition) * Math::PI * 0.2f;
-    }
-    return Quaternion(angle, Vector3::YAXIS);
-  }
-
-};
-
-struct NavigationRotationConstraintLeft
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float angle = 0.0f;
-    float _layoutPosition = layoutPosition + 1.0f;
-    if(_layoutPosition >= 1.0f)
-    {
-      angle = - sinf(Math::PI * _layoutPosition) * Math::PI * 0.2f;
-    }
-    else
-    {
-      angle =  sinf(Math::PI * _layoutPosition) * Math::PI * 0.2f;
-    }
-    return Quaternion(Math::PI * 0.5f, Vector3::ZAXIS) * Quaternion(angle, Vector3::YAXIS);
-  }
-};
-
-struct NavigationRotationConstraintDown
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float angle = 0.0f;
-    float _layoutPosition = layoutPosition + 1.0f;
-    if(_layoutPosition >= 1.0f)//right side
-    {
-      //rotation angle by z axis
-      angle = - sinf(Math::PI * _layoutPosition) * Math::PI * 0.2f;
-    }
-    else // left side
-    {
-      angle =  sinf(Math::PI * _layoutPosition) * Math::PI * 0.2f;
-    }
-    return Quaternion(Math::PI, Vector3::ZAXIS) * Quaternion(angle, Vector3::YAXIS);
-  }
-};
-
-struct NavigationRotationConstraintRight
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float angle = 0.0f;
-    float _layoutPosition = layoutPosition + 1.0f;
-    if(_layoutPosition >= 1.0f)
-    {
-      angle = - sinf(Math::PI * _layoutPosition) * Math::PI * 0.2f;
-    }
-    else
-    {
-      angle =  sinf(Math::PI * _layoutPosition) * Math::PI * 0.2f;
-    }
-    return Quaternion(Math::PI * 1.5f, Vector3::ZAXIS) * Quaternion(angle, Vector3::YAXIS);
-  }
-};
-
-struct NavigationColorConstraint
-{
-  NavigationColorConstraint(unsigned int numberOfColumns)
-  : mNumberOfColumns(numberOfColumns)
-  {
-
-  }
-  Vector4 operator()(const Vector4& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float darkness = 1.0f;
-    float alpha = 1.0f;
-
-    float pos = ( layoutPosition + 1.0f);
-    darkness = (-0.25f) * (pos + 1.0f) * (pos + 1.0f) + 1.0f * (pos + 1.0f) + 0.2f;
-
-    darkness = fabs(darkness);
-    darkness /= 1.2f;
-
-    return Vector4(darkness, darkness, darkness, current.a * alpha);
-  }
-  unsigned int mNumberOfColumns;
-
-};
-
-struct NavigationVisibilityConstraint
-{
-  NavigationVisibilityConstraint(const unsigned int columnIndex,
-                                      const unsigned int numberOfColumns,
-                                      const float columnSpacing )
-  : mColumnIndex(columnIndex),
-    mNumberOfColumns(numberOfColumns),
-    mColumnSpacing(columnSpacing)
-  {
-  }
-
-  bool operator()(const bool& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float index = layoutPosition + 1.0f;
-    return (index >= -1.0f) && (index <= mNumberOfColumns );
-  }
-
-public:
-  unsigned int mColumnIndex;
-  unsigned int mNumberOfColumns;
-  float mColumnSpacing;
-};
-}//end namespace
-
-namespace Dali
-{
-namespace Toolkit
-{
-struct NavigationLayout::Impl
-{
-  Impl()
-  : mNumberOfColumns(DEFAULT_NUMBER_OF_COLUMNS),
-    mColumnSpacing(DEFAULT_COLUMN_SPACING),
-    mTopMargin(DEFAULT_TOP_MARGIN),
-    mBottomMargin(DEFAULT_BOTTOM_MARGIN),
-    mSideMargin(DEFAULT_SIDE_MARGIN),
-    mScrollSpeedFactor(DEFAULT_SCROLL_SPEED_FACTOR),
-    mMaximumSwipeSpeed(DEFAULT_MAXIMUM_SWIPE_SPEED),
-    mItemFlickAnimationDuration(DEFAULT_ITEM_FLICK_ANIMATION_DURATION),
-    mSizeExtend(DEFAULT_SIZE_EXTEND)
-    {
-      mColorConstraint = NavigationColorConstraint(mNumberOfColumns);
-      mRotationConstraint[0] = NavigationRotationConstraintUp();
-      mRotationConstraint[1] = NavigationRotationConstraintLeft();
-      mRotationConstraint[2] = NavigationRotationConstraintDown();
-      mRotationConstraint[3] = NavigationRotationConstraintRight();
-    }
-
-  unsigned int mNumberOfColumns;
-  float mColumnSpacing;
-  float mTopMargin;
-  float mBottomMargin;
-  float mSideMargin;
-  float mScrollSpeedFactor;
-  float mMaximumSwipeSpeed;
-  float mItemFlickAnimationDuration;
-  float mSizeExtend;
-
-  ItemLayout::QuaternionFunction mRotationConstraint[4];
-
-  ItemLayout::Vector4Function mColorConstraint;
-};
-
-NavigationLayoutPtr NavigationLayout::New()
-{
-  return NavigationLayoutPtr(new NavigationLayout());
-}
-
-NavigationLayout::~NavigationLayout()
-{
-  delete mImpl;
-}
-
-void NavigationLayout::SetNumberOfColumns(unsigned int columns)
-{
-  mImpl->mNumberOfColumns = columns;
-}
-
-unsigned int NavigationLayout::GetNumberOfColumns() const
-{
-  return mImpl->mNumberOfColumns;
-}
-
-void NavigationLayout::SetColumnSpacing(float spacing)
-{
-  mImpl->mColumnSpacing = spacing;
-}
-
-float NavigationLayout::GetColumnSpacing() const
-{
-  return mImpl->mColumnSpacing;
-}
-
-void NavigationLayout::SetTopMargin(float margin)
-{
-  mImpl->mTopMargin = margin;
-}
-
-float NavigationLayout::GetTopMargin() const
-{
-  return mImpl->mTopMargin;
-}
-
-void NavigationLayout::SetBottomMargin(float margin)
-{
-  mImpl->mBottomMargin = margin;
-}
-
-float NavigationLayout::GetBottomMargin() const
-{
-  return mImpl->mBottomMargin;
-}
-
-void NavigationLayout::SetSideMargin(float margin)
-{
-  mImpl->mSideMargin = margin;
-  mImpl->mSizeExtend = (1.0f - margin) * 3.0f;
-}
-
-void NavigationLayout::SetScrollSpeedFactor(float scrollSpeed)
-{
-  mImpl->mScrollSpeedFactor = scrollSpeed;
-}
-
-void NavigationLayout::SetMaximumSwipeSpeed(float speed)
-{
-  mImpl->mMaximumSwipeSpeed = speed;
-}
-
-void NavigationLayout::SetItemFlickAnimationDuration(float durationSeconds)
-{
-  mImpl->mItemFlickAnimationDuration = durationSeconds;
-}
-
-float NavigationLayout::GetScrollSpeedFactor() const
-{
-  return mImpl->mScrollSpeedFactor;
-}
-
-float NavigationLayout::GetMaximumSwipeSpeed() const
-{
-  return mImpl->mMaximumSwipeSpeed;
-}
-
-float NavigationLayout::GetItemFlickAnimationDuration() const
-{
-  return mImpl->mItemFlickAnimationDuration;
-}
-
-float NavigationLayout::GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
-{
-  unsigned int itemsLastRow = numberOfItems % mImpl->mNumberOfColumns;
-  if (itemsLastRow == 0)
-  {
-    itemsLastRow = mImpl->mNumberOfColumns;
-  }
-
-  float itemsLastPage =  static_cast<float>(itemsLastRow);
-  return itemsLastPage - static_cast<float>(numberOfItems) - 2.0f;
-
-}
-
-float NavigationLayout::GetClosestAnchorPosition(float layoutPosition) const
-{
-  return round(layoutPosition);
-}
-
-float NavigationLayout::GetItemScrollToPosition(unsigned int itemId) const
-{
-  return - static_cast<float>(itemId);
-}
-
-ItemRange NavigationLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
-{
-  int itemsPerPage = mImpl->mNumberOfColumns;
-
-  int firstItemIndex = std::max(0.0f, -firstItemPosition -1.0f  );
-  int lastItemIndex = std::max(0.0f, -(firstItemPosition) + itemsPerPage );
-
-  return ItemRange(firstItemIndex , lastItemIndex );
-}
-
-unsigned int NavigationLayout::GetReserveItemCount(Vector3 layoutSize) const
-{
-  float layoutWidth = IsHorizontal(mOrientation) ? layoutSize.height : layoutSize.width;
-  float itemWidth = (layoutWidth * mImpl->mSizeExtend - mImpl->mColumnSpacing * (mImpl->mNumberOfColumns - 1))/( mImpl->mNumberOfColumns );
-  return static_cast<unsigned int>(layoutWidth / itemWidth);
-}
-
-bool NavigationLayout::GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const
-{
-  float layoutWidth = IsHorizontal(mOrientation) ? (DEFAULT_HEIGHT_FACTOR * layoutSize.height) : layoutSize.width;
-  layoutWidth = layoutWidth * mImpl->mSizeExtend;
-
-  float itemWidth = (layoutWidth -  mImpl->mColumnSpacing*(mImpl->mNumberOfColumns-1)) / mImpl->mNumberOfColumns;
-  float itemHeight = layoutWidth * (1.0f - mImpl->mBottomMargin - mImpl->mTopMargin);
-  itemSize = Vector3(itemWidth, itemHeight, (itemWidth/4)*3);
-
-  return true;
-}
-
-void NavigationLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
-{
-}
-
-bool NavigationLayout::GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const
-{
-  unsigned int columnIndex = itemId % mImpl->mNumberOfColumns;
-  if (mOrientation == ControlOrientation::Left)
-  {
-    constraint = NavigationPositionConstraintLeft(columnIndex, mImpl->mNumberOfColumns, mImpl->mColumnSpacing, mImpl->mSizeExtend, mImpl->mBottomMargin, mImpl->mTopMargin);
-  }
-  else if (mOrientation == ControlOrientation::Up)
-  {
-    constraint = NavigationPositionConstraintUp(columnIndex, mImpl->mNumberOfColumns, mImpl->mColumnSpacing, mImpl->mSizeExtend, mImpl->mBottomMargin, mImpl->mTopMargin);
-  }
-  else if (mOrientation == ControlOrientation::Down)
-  {
-    constraint = NavigationPositionConstraintDown(columnIndex, mImpl->mNumberOfColumns, mImpl->mColumnSpacing, mImpl->mSizeExtend, mImpl->mBottomMargin, mImpl->mTopMargin);
-  }
-  else if (mOrientation == ControlOrientation::Right)
-  {
-    constraint = NavigationPositionConstraintRight(columnIndex, mImpl->mNumberOfColumns, mImpl->mColumnSpacing, mImpl->mSizeExtend, mImpl->mBottomMargin, mImpl->mTopMargin);
-  }
-
-  return true;
-}
-
-bool NavigationLayout::GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const
-{
-  return false; // No scaling
-}
-
-bool NavigationLayout::GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const
-{
-  constraint = mImpl->mRotationConstraint[mOrientation];
-  return true;
-}
-
-bool NavigationLayout::GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const
-{
-  constraint = mImpl->mColorConstraint;
-  return true;
-}
-
-bool NavigationLayout::GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const
-{
-  unsigned int columnIndex = itemId % mImpl->mNumberOfColumns;
-  constraint = NavigationVisibilityConstraint(columnIndex, mImpl->mNumberOfColumns, mImpl->mColumnSpacing);
-  return true;
-}
-
-Degree NavigationLayout::GetScrollDirection() const
-{
-  Degree scrollDirection(0);
-  if (mOrientation == ControlOrientation::Down)
-  {
-    scrollDirection = 0.0f - 45.0f;
-  }
-  else if (mOrientation == ControlOrientation::Right)
-  {
-    scrollDirection = 90.0f - 45.0f;
-  }
-  else if (mOrientation == ControlOrientation::Up)
-  {
-    scrollDirection = 180.0f - 45.0f;
-  }
-  else // mOrientation == ControlOrientation::Left
-  {
-    scrollDirection = 270.0f - 45.0f;
-  }
-
-  return scrollDirection;
-}
-
-NavigationLayout::NavigationLayout()
-  :mImpl(NULL)
-{
-  mImpl = new Impl();
-}
-
-}
-}
diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/navigation-layout.h b/dali-toolkit/public-api/controls/scrollable/item-view/navigation-layout.h
deleted file mode 100755 (executable)
index eb49a07..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-#ifndef __DALI_TOOLKIT_NAVIGATION_LAYOUT_H__
-#define __DALI_TOOLKIT_NAVIGATION_LAYOUT_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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
-
-namespace Dali
-{
-namespace Toolkit
-{
-class NavigationLayout;
-
-typedef IntrusivePtr<NavigationLayout> NavigationLayoutPtr;
-
-/**
- * An ItemView layout which arranges items in navigation mode.
- */
-class DALI_IMPORT_API NavigationLayout: public ItemLayout
-{
-public:
-
-  typedef boost::function<Vector3 (const Vector3& layoutSize,
-                                   const unsigned int orientation,
-                                   const unsigned int numberOfColumns,
-                                   const float columnSpacing,
-                                   const float sideMargin)>  ResizeFunction;
-
-  /**
-   * Create a new navigation layout
-   */
-  static NavigationLayoutPtr New();
-
-  /**
-   * Virtual destructor.
-   */
-  virtual ~NavigationLayout();
-
-  /**
-   * Set the number of columns in the layout.
-   * @param[in] columns  The number of columns.
-   */
-  void SetNumberOfColumns(unsigned int columns);
-
-  /**
-   * Get the number of columns in the layout.
-   * @return The number of columns.
-   */
-  unsigned int GetNumberOfColumns() const;
-
-  /**
-   * Set the spacing between columns.
-   * @param[in] spacing The spacing.
-   */
-  void SetColumnSpacing(float spacing);
-
-  /**
-   * Get the spacing between columns.
-   * @return The spacing.
-   */
-  float GetColumnSpacing() const;
-
-  /**
-   * Set the margin in the top of the layout
-   * @param[in] margin The layout top margin.
-   */
-  void SetTopMargin(float margin);
-
-  /**
-   * Get the margin in the top of the layout
-   * @return The layout top margin.
-   */
-  float GetTopMargin() const;
-
-  /**
-   * Set the margin in the bottom of the layout
-   * @param[in] margin The layout bottom margin.
-   */
-  void SetBottomMargin(float margin);
-
-  /**
-   * Get the margin in the bottom of the layout
-   * @return The layout bottom margin.
-   */
-  float GetBottomMargin() const;
-
-  /**
-   * Set the margin in the left and right of the layout
-   * @param[in] margin The layout side margin.
-   */
-  void SetSideMargin(float margin);
-
-  /**
-   * Get the margin in the left and right of the layout
-   * @return The layout side margin.
-   */
-  float GetSideMargin() const;
-
-  /**
-   * Set the factor used to customise the scroll speed while dragging and swiping the layout.
-   * @param[in] scrollSpeed The scroll speed factor.
-   */
-  void SetScrollSpeedFactor(float scrollSpeed);
-
-  /**
-   * Set the maximum swipe speed in pixels per second.
-   * @param[in] speed The maximum swipe speed.
-   */
-  void SetMaximumSwipeSpeed(float speed);
-
-  /**
-   * Set the duration of the flick animation in second. This is the time taken to animate each
-   * item to its next layout position (e.g. from 1.0 to 2.0) when a flick animation is triggered
-   * by a swipe gesture.
-   * @pre durationSeconds must be greater than zero.
-   * @param[in] durationSeconds The duration of flick animation in seconds.
-   */
-  void SetItemFlickAnimationDuration(float durationSeconds);
-
-  /**
-   * @copydoc ItemLayout::GetScrollSpeedFactor()
-   */
-  virtual float GetScrollSpeedFactor() const;
-
-  /**
-   * @copydoc ItemLayout::GetMaximumSwipeSpeed()
-   */
-  virtual float GetMaximumSwipeSpeed() const;
-
-  /**
-   * @copydoc ItemLayout::GetItemFlickAnimationDuration()
-   */
-  virtual float GetItemFlickAnimationDuration() const;
-
-private:
-
-  /**
-   * @copydoc ItemLayout::GetMinimumLayoutPosition()
-   */
-  virtual float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const;
-
-  /**
-   * @copydoc ItemLayout::GetClosestAnchorPosition()
-   */
-  virtual float GetClosestAnchorPosition(float layoutPosition) const;
-
-  /**
-   * @copydoc ItemLayout::GetItemScrollToPosition()
-   */
-  virtual float GetItemScrollToPosition(unsigned int itemId) const;
-
-  /**
-   * @copydoc ItemLayout::GetItemsWithinArea()
-   */
-  virtual ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const;
-
-  /**
-   * @copydoc ItemLayout::GetReserveItemCount()
-   */
-  virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const;
-
-  /**
-   * @copydoc ItemLayout::GetItemSize()
-   */
-  virtual bool GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const;
-
-  /**
-   * @copydoc ItemLayout::GetResizeAnimation()
-   */
-  virtual void GetResizeAnimation(Animation& animation,
-                                        Actor actor,
-                                        Vector3 size,
-                                        float durationSeconds) const;
-
-  /**
-   * @copydoc ItemLayout::GetPositionConstraint()
-   */
-  virtual bool GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetRotationConstraint()
-   */
-  virtual bool GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetScaleConstraint()
-   */
-  virtual bool GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetColorConstraint()
-   */
-  virtual bool GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetVisibilityConstraint()
-   */
-  virtual bool GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetScrollDirection()
-   */
-  virtual Degree GetScrollDirection() const;
-
-protected:
-
-  /**
-   * Protected constructor; see also GridLayout::New()
-   */
-  NavigationLayout();
-
-private:
-
-  struct Impl;
-  Impl* mImpl;
-};
-
-}
-}
-#endif //__DALI_TOOLKIT_NAVIGATION_LAYOUT_H__
diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/roll-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/roll-layout.cpp
deleted file mode 100644 (file)
index 966b665..0000000
+++ /dev/null
@@ -1,591 +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 <dali-toolkit/public-api/controls/scrollable/item-view/roll-layout.h>
-
-// EXTERNAL INCLUDES
-#include <algorithm>
-#include <dali/public-api/animation/animation.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace // unnamed namespace
-{
-
-const float DEFAULT_ROW_SPACING = 20.0f;
-const float DEFAULT_SCROLL_SPEED_FACTOR = 0.0015f;
-const float DEFAULT_MAXIMUM_SWIPE_SPEED = 8.0f;
-const float DEFAULT_ITEM_FLICK_ANIMATION_DURATION = 0.4f;
-
-// 4 orientations are supported
-static const unsigned int ORIENTATION_COUNT = 4;
-
-static Vector3 GetItemSizeDefaultFunction(float layoutWidth, float layoutHeight, float rowSpacing)
-{
-  float height = (layoutHeight - rowSpacing) * 0.5f;
-  return Vector3(layoutWidth, height, height);
-}
-
-struct RollPositionConstraint0
-{
-  RollPositionConstraint0(const float rowSpacing, RollLayout::ItemSizeFunction itemSizeFunction)
-  : mRowSpacing(rowSpacing),
-    mItemSizeFunction(itemSizeFunction)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(layoutSize.width, layoutSize.height, mRowSpacing);
-
-    float adjustedLayoutPosition = layoutPosition;
-    float scrollSpeedFactor = scrollSpeed * scrollSpeed * scrollSpeed * scrollSpeed;
-    float y = 0.0f;
-
-    float adjustedRowSpacing = mRowSpacing + scrollSpeedFactor;
-
-    if(adjustedLayoutPosition > Math::MACHINE_EPSILON_0 && adjustedLayoutPosition -2.0f < Math::MACHINE_EPSILON_0)
-    {
-      float adjustment = 1.0f - Dali::AlphaFunctions::EaseInOutSine60((2.0f - adjustedLayoutPosition) * 0.5f);
-      adjustedLayoutPosition = adjustment * 2.0f;
-      y = ((itemSize.y + adjustedRowSpacing ) * adjustedLayoutPosition) - layoutSize.height * 0.5f + itemSize.y * 0.5f;
-    }
-    else
-    {
-      float yStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
-      y = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * yStep : (layoutSize.height * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * yStep;
-      y += itemSize.y * 0.5f - layoutSize.height * 0.5f;
-    }
-
-    float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
-    z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
-
-    return Vector3(itemSize.x * 0.5f - layoutSize.x * 0.5f, y, z);
-  }
-
-public:
-
-  float mRowSpacing;
-  RollLayout::ItemSizeFunction mItemSizeFunction;
-};
-
-struct RollPositionConstraint90
-{
-  RollPositionConstraint90(const float rowSpacing, RollLayout::ItemSizeFunction itemSizeFunction)
-  : mRowSpacing(rowSpacing),
-    mItemSizeFunction(itemSizeFunction)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(layoutSize.height, layoutSize.width, mRowSpacing);
-
-    float adjustedLayoutPosition = layoutPosition;
-    float scrollSpeedFactor = scrollSpeed * scrollSpeed * scrollSpeed;
-    float x = 0.0f;
-
-    float adjustedRowSpacing = mRowSpacing + scrollSpeedFactor;
-
-    if(adjustedLayoutPosition > Math::MACHINE_EPSILON_0 && adjustedLayoutPosition -2.0f < Math::MACHINE_EPSILON_0)
-    {
-      float adjustment = 1.0f - Dali::AlphaFunctions::EaseInOutSine60((2.0f - adjustedLayoutPosition) * 0.5f);
-      adjustedLayoutPosition = adjustment * 2.0f;
-      x = ((itemSize.y + adjustedRowSpacing ) * adjustedLayoutPosition) - layoutSize.width * 0.5f + itemSize.y * 0.5f;
-    }
-    else
-    {
-      float xStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
-      x = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * xStep : (layoutSize.width * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * xStep;
-      x += itemSize.y * 0.5f - layoutSize.width * 0.5f;
-    }
-
-    float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
-    z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
-
-    return Vector3(x, itemSize.x * 0.5f - layoutSize.y * 0.5f, z);
-  }
-
-public:
-
-  float mRowSpacing;
-  RollLayout::ItemSizeFunction mItemSizeFunction;
-};
-
-struct RollPositionConstraint180
-{
-  RollPositionConstraint180(const float rowSpacing, RollLayout::ItemSizeFunction itemSizeFunction)
-  : mRowSpacing(rowSpacing),
-    mItemSizeFunction(itemSizeFunction)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(layoutSize.width, layoutSize.height, mRowSpacing);
-
-    float adjustedLayoutPosition = layoutPosition;
-    float scrollSpeedFactor = scrollSpeed * scrollSpeed * scrollSpeed;
-    float y = 0.0f;
-
-    float adjustedRowSpacing = mRowSpacing + scrollSpeedFactor;
-
-    if(adjustedLayoutPosition > Math::MACHINE_EPSILON_0 && adjustedLayoutPosition -2.0f < Math::MACHINE_EPSILON_0)
-    {
-      float adjustment = 1.0f - Dali::AlphaFunctions::EaseInOutSine60((2.0f - adjustedLayoutPosition) * 0.5f);
-      adjustedLayoutPosition = adjustment * 2.0f;
-      y = ((itemSize.y + adjustedRowSpacing ) * adjustedLayoutPosition) - layoutSize.height * 0.5f + itemSize.y * 0.5f;
-    }
-    else
-    {
-      float yStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
-      y = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * yStep : (layoutSize.height * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * yStep;
-      y += itemSize.y * 0.5f - layoutSize.height * 0.5f;
-    }
-
-    float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
-    z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
-
-
-    return Vector3(-(itemSize.x * 0.5f - layoutSize.x * 0.5f),
-                   -y,
-                   z);
-  }
-
-public:
-
-  float mRowSpacing;
-  RollLayout::ItemSizeFunction mItemSizeFunction;
-};
-
-struct RollPositionConstraint270
-{
-  RollPositionConstraint270(const float rowSpacing, RollLayout::ItemSizeFunction itemSizeFunction)
-  : mRowSpacing(rowSpacing),
-    mItemSizeFunction(itemSizeFunction)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(layoutSize.height, layoutSize.width, mRowSpacing);
-
-    float adjustedLayoutPosition = layoutPosition;
-    float scrollSpeedFactor = scrollSpeed * scrollSpeed * scrollSpeed;
-    float x = 0.0f;
-
-    float adjustedRowSpacing = mRowSpacing + scrollSpeedFactor;
-
-    if(adjustedLayoutPosition > Math::MACHINE_EPSILON_0 && adjustedLayoutPosition -2.0f < Math::MACHINE_EPSILON_0)
-    {
-      float adjustment = 1.0f - Dali::AlphaFunctions::EaseInOutSine60((2.0f - adjustedLayoutPosition) * 0.5f);
-      adjustedLayoutPosition = adjustment * 2.0f;
-      x = ((itemSize.y + adjustedRowSpacing ) * adjustedLayoutPosition) - layoutSize.width * 0.5f + itemSize.y * 0.5f;
-    }
-    else
-    {
-      float xStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
-      x = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * xStep : (layoutSize.width * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * xStep;
-      x += itemSize.y * 0.5f - layoutSize.width * 0.5f;
-    }
-
-    float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
-    z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
-
-    return Vector3(-x,
-                   itemSize.x * 0.5f - layoutSize.y * 0.5f,
-                   z);
-  }
-
-public:
-
-  float mRowSpacing;
-  RollLayout::ItemSizeFunction mItemSizeFunction;
-};
-
-struct RollRotationConstraint0
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion(0.0f, Vector3::ZAXIS);
-  }
-};
-
-struct RollRotationConstraint90
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion(1.5f * Math::PI, Vector3::ZAXIS);
-  }
-};
-
-struct RollRotationConstraint180
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion(Math::PI, Vector3::ZAXIS);
-  }
-};
-
-struct RollRotationConstraint270
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion(0.5f * Math::PI, Vector3::ZAXIS);
-  }
-};
-
-struct RollScaleConstraint
-{
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float adjustedLayoutPosition = layoutPosition;
-    float factor = 0.0f;
-    if(adjustedLayoutPosition < Math::MACHINE_EPSILON_0)
-    {
-      factor = fabsf(adjustedLayoutPosition);
-    }
-    if(adjustedLayoutPosition - 1.0f > Math::MACHINE_EPSILON_0)
-    {
-      factor = adjustedLayoutPosition - 1.0f;
-    }
-
-    float scale = std::min(1.0f, std::max(0.1f, 1.0f - 0.1f * factor));
-    if(scrollSpeed > 0.0f)
-    {
-      scale *= std::min(1.0f, std::max(0.1f, 1.0f / (scrollSpeed * 0.05f)));
-    }
-
-    return Vector3(scale, scale, scale);
-  }
-};
-
-struct RollColorConstraint
-{
-  Vector4 operator()(const Vector4& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float adjustedLayoutPosition = layoutPosition;
-
-    float factor = 0.0f;
-    if(adjustedLayoutPosition < Math::MACHINE_EPSILON_0)
-    {
-      factor = fabsf(adjustedLayoutPosition);
-    }
-    if(adjustedLayoutPosition - 1.0f > Math::MACHINE_EPSILON_0)
-    {
-      factor = adjustedLayoutPosition - 1.0f;
-    }
-
-    float darkness = std::min(1.0f, std::max(0.5f, 1.0f - 0.5f * factor));
-    float alpha = std::min(1.0f, std::max(0.0f, 1.0f - 0.9f * factor));
-    return Vector4(darkness, darkness, darkness, alpha);
-  }
-};
-
-struct RollVisibilityConstraintPortrait
-{
-  RollVisibilityConstraintPortrait(const float rowSpacing, RollLayout::ItemSizeFunction itemSizeFunction)
-  : mRowSpacing(rowSpacing),
-    mItemSizeFunction(itemSizeFunction)
-  {
-  }
-
-  bool operator()(const bool& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(layoutSize.width, layoutSize.height, mRowSpacing);
-    int rowsPerPage = ceil(layoutSize.height / (itemSize.y + mRowSpacing));
-    return (layoutPosition > -rowsPerPage) && (layoutPosition < rowsPerPage);
-  }
-
-public:
-
-  float mRowSpacing;
-  RollLayout::ItemSizeFunction mItemSizeFunction;
-};
-
-struct RollVisibilityConstraintLandscape
-{
-  RollVisibilityConstraintLandscape(const float rowSpacing, RollLayout::ItemSizeFunction itemSizeFunction)
-  : mRowSpacing(rowSpacing),
-    mItemSizeFunction(itemSizeFunction)
-  {
-  }
-
-  bool operator()(const bool& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(layoutSize.height, layoutSize.width, mRowSpacing);
-    int rowsPerPage = ceil(layoutSize.width / (itemSize.y + mRowSpacing));
-    return (layoutPosition + 2.0f > Math::MACHINE_EPSILON_0) && (layoutPosition < rowsPerPage);
-  }
-
-public:
-
-  float mRowSpacing;
-  RollLayout::ItemSizeFunction mItemSizeFunction;
-};
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-struct RollLayout::Impl
-{
-  Impl()
-  : mRowSpacing(DEFAULT_ROW_SPACING),
-    mScrollSpeedFactor(DEFAULT_SCROLL_SPEED_FACTOR),
-    mMaximumSwipeSpeed(DEFAULT_MAXIMUM_SWIPE_SPEED),
-    mItemFlickAnimationDuration(DEFAULT_ITEM_FLICK_ANIMATION_DURATION),
-    mItemSizeFunction(GetItemSizeDefaultFunction)
-  {
-    mScaleConstraint = RollScaleConstraint();
-    mColorConstraint = RollColorConstraint();
-
-    mRotationConstraint[0] = RollRotationConstraint0();
-    mRotationConstraint[1] = RollRotationConstraint90();
-    mRotationConstraint[2] = RollRotationConstraint180();
-    mRotationConstraint[3] = RollRotationConstraint270();
-  }
-
-  float mRowSpacing;
-
-  float mScrollSpeedFactor;
-  float mMaximumSwipeSpeed;
-  float mItemFlickAnimationDuration;
-
-  ItemLayout::QuaternionFunction mRotationConstraint[ORIENTATION_COUNT];
-  ItemLayout::Vector3Function mScaleConstraint;
-  ItemLayout::Vector4Function mColorConstraint;
-
-  ItemSizeFunction mItemSizeFunction;
-};
-
-RollLayoutPtr RollLayout::New()
-{
-  return RollLayoutPtr(new RollLayout());
-}
-
-RollLayout::~RollLayout()
-{
-  delete mImpl;
-}
-
-void RollLayout::SetRowSpacing(float spacing)
-{
-  mImpl->mRowSpacing = spacing;
-}
-
-float RollLayout::GetRowSpacing() const
-{
-  return mImpl->mRowSpacing;
-}
-
-void RollLayout::SetItemSizeFunction(ItemSizeFunction function)
-{
-  mImpl->mItemSizeFunction = function;
-}
-
-RollLayout::ItemSizeFunction RollLayout::GetItemSizeFunction() const
-{
-  return mImpl->mItemSizeFunction;
-}
-
-void RollLayout::SetScrollSpeedFactor(float scrollSpeed)
-{
-  mImpl->mScrollSpeedFactor = scrollSpeed;
-}
-
-void RollLayout::SetMaximumSwipeSpeed(float speed)
-{
-  mImpl->mMaximumSwipeSpeed = speed;
-}
-
-void RollLayout::SetItemFlickAnimationDuration(float durationSeconds)
-{
-  mImpl->mItemFlickAnimationDuration = durationSeconds;
-}
-
-float RollLayout::GetScrollSpeedFactor() const
-{
-  return mImpl->mScrollSpeedFactor;
-}
-
-float RollLayout::GetMaximumSwipeSpeed() const
-{
-  return mImpl->mMaximumSwipeSpeed;
-}
-
-float RollLayout::GetItemFlickAnimationDuration() const
-{
-  return mImpl->mItemFlickAnimationDuration;
-}
-
-float RollLayout::GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
-{
-  return 2.0f - static_cast<float>(numberOfItems);
-}
-
-float RollLayout::GetClosestAnchorPosition(float layoutPosition) const
-{
-  return static_cast<float>(round(layoutPosition));
-}
-
-float RollLayout::GetItemScrollToPosition(unsigned int itemId) const
-{
-  return 0.0f - static_cast<float>(itemId);
-}
-
-ItemRange RollLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
-{
-  float layoutWidth = IsHorizontal(mOrientation) ? layoutSize.height : layoutSize.width;
-  float layoutHeight = IsHorizontal(mOrientation) ? layoutSize.width : layoutSize.height;
-
-  Vector3 itemSize = mImpl->mItemSizeFunction( layoutWidth,layoutHeight, mImpl->mRowSpacing);
-
-  float itemsPerPage = (layoutHeight / (itemSize.y + mImpl->mRowSpacing));
-  if(firstItemPosition + 0.001f >= Math::MACHINE_EPSILON_0)
-  {
-    itemsPerPage = std::max(0.0f, itemsPerPage - 1.0f);
-  }
-  int firstVisibleItem = -(static_cast<int>(firstItemPosition));
-
-  int firstItemIndex = std::max(0, firstVisibleItem);
-  int lastItemIndex  = std::max(0, static_cast<int>(ceil(firstVisibleItem + itemsPerPage - 1)));
-  return ItemRange(firstItemIndex, lastItemIndex);
-}
-
-unsigned int RollLayout::GetReserveItemCount(Vector3 layoutSize) const
-{
-  float layoutWidth = IsHorizontal(mOrientation) ? layoutSize.height : layoutSize.width;
-  float layoutHeight = IsHorizontal(mOrientation) ? layoutSize.width : layoutSize.height;
-
-  Vector3 itemSize = mImpl->mItemSizeFunction(layoutWidth, layoutHeight, mImpl->mRowSpacing);
-  int itemsPerPage = ceil(layoutHeight / (itemSize.y + mImpl->mRowSpacing));
-  return itemsPerPage * 5;
-}
-
-bool RollLayout::GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const
-{
-  // Note: itemId is not checked, since every item has the same size
-  float layoutWidth = IsHorizontal(mOrientation) ? layoutSize.height : layoutSize.width;
-  float layoutHeight = IsHorizontal(mOrientation) ? layoutSize.width : layoutSize.height;
-
-  itemSize = mImpl->mItemSizeFunction(layoutWidth, layoutHeight, mImpl->mRowSpacing);
-
-  return true;
-}
-
-void RollLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
-{
-  if(animation)
-  {
-    animation.Resize(actor, size);
-  }
-}
-
-bool RollLayout::GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const
-{
-  if (mOrientation == ControlOrientation::Up)
-  {
-    constraint = RollPositionConstraint0(mImpl->mRowSpacing, mImpl->mItemSizeFunction);
-  }
-  else if (mOrientation == ControlOrientation::Left)
-  {
-    constraint = RollPositionConstraint90(mImpl->mRowSpacing, mImpl->mItemSizeFunction);
-  }
-  else if (mOrientation == ControlOrientation::Down)
-  {
-    constraint = RollPositionConstraint180(mImpl->mRowSpacing, mImpl->mItemSizeFunction);
-  }
-  else // mOrientation == ControlOrientation::Right
-  {
-    constraint = RollPositionConstraint270(mImpl->mRowSpacing, mImpl->mItemSizeFunction);
-  }
-
-  return true;
-}
-
-bool RollLayout::GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const
-{
-  constraint = mImpl->mRotationConstraint[mOrientation];
-  return true;
-}
-
-bool RollLayout::GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const
-{
-  constraint = mImpl->mScaleConstraint;
-  return true;
-}
-
-bool RollLayout::GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const
-{
-  constraint = mImpl->mColorConstraint;
-  return true;
-}
-
-bool RollLayout::GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const
-{
-  if (IsVertical(mOrientation))
-  {
-    constraint = RollVisibilityConstraintPortrait(mImpl->mRowSpacing, mImpl->mItemSizeFunction);
-  }
-  else // horizontal
-  {
-    constraint = RollVisibilityConstraintLandscape(mImpl->mRowSpacing, mImpl->mItemSizeFunction);
-  }
-
-  return true;
-}
-
-Degree RollLayout::GetScrollDirection() const
-{
-  Degree scrollDirection(0.0f);
-
-  if (mOrientation == ControlOrientation::Up)
-  {
-    scrollDirection = 0.0f;
-  }
-  else if (mOrientation == ControlOrientation::Left)
-  {
-    scrollDirection = 90.0f;
-  }
-  else if (mOrientation == ControlOrientation::Down)
-  {
-    scrollDirection = 180.0f;
-  }
-  else // mOrientation == ControlOrientation::Right
-  {
-    scrollDirection = 270.0f;
-  }
-
-  return scrollDirection;
-}
-
-RollLayout::RollLayout()
-: mImpl(NULL)
-{
-  mImpl = new Impl();
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/roll-layout.h b/dali-toolkit/public-api/controls/scrollable/item-view/roll-layout.h
deleted file mode 100644 (file)
index bbaea00..0000000
+++ /dev/null
@@ -1,198 +0,0 @@
-#ifndef __DALI_TOOLKIT_ROLL_LAYOUT_H__
-#define __DALI_TOOLKIT_ROLL_LAYOUT_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.
- *
- */
-
-// INTERNAL INCLUDES
-
-#include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-class RollLayout;
-
-typedef IntrusivePtr<RollLayout> RollLayoutPtr;
-
-/**
- * An ItemView layout which arranges items in a roll.
- */
-class DALI_IMPORT_API RollLayout : public ItemLayout
-{
-public:
-
-  typedef boost::function<Vector3 (float layoutWidth, float layoutHeight, float rowSpacing)> ItemSizeFunction;
-
-  /**
-   * Create a new roll layout
-   */
-  static RollLayoutPtr New();
-
-  /**
-   * Virtual destructor.
-   */
-  virtual ~RollLayout();
-
-  /**
-   * Set the spacing between rows.
-   * @param[in] spacing The row spacing.
-   */
-  void SetRowSpacing(float spacing);
-
-  /**
-   * Get the spacing between rows.
-   * @return The row spacing.
-   */
-  float GetRowSpacing() const;
-
-  /**
-   * Set the function used to calculate the item-size, for a given layout-size.
-   * @param[in] function The item-size function.
-   */
-  void SetItemSizeFunction(ItemSizeFunction function);
-
-  /**
-   * Get the function used to calculate the item-size.
-   * @return The item-size function.
-   */
-  ItemSizeFunction GetItemSizeFunction() const;
-
-  /**
-   * Set the factor used to customise the scroll speed while dragging and swiping the layout.
-   * @param[in] scrollSpeed The scroll speed factor.
-   */
-  void SetScrollSpeedFactor(float scrollSpeed);
-
-  /**
-   * Set the maximum swipe speed in pixels per second.
-   * @param[in] speed The maximum swipe speed.
-   */
-  void SetMaximumSwipeSpeed(float speed);
-
-  /**
-   * Set the duration of the flick animation in second. This is the time taken to animate each
-   * item to its next layout position (e.g. from 1.0 to 2.0) when a flick animation is triggered
-   * by a swipe gesture.
-   * @pre durationSeconds must be greater than zero.
-   * @param[in] durationSeconds The duration of flick animation in seconds.
-   */
-  void SetItemFlickAnimationDuration(float durationSeconds);
-
-  /**
-   * @copydoc ItemLayout::GetScrollSpeedFactor()
-   */
-  virtual float GetScrollSpeedFactor() const;
-
-  /**
-   * @copydoc ItemLayout::GetMaximumSwipeSpeed()
-   */
-  virtual float GetMaximumSwipeSpeed() const;
-
-  /**
-   * @copydoc ItemLayout::GetItemFlickAnimationDuration()
-   */
-  virtual float GetItemFlickAnimationDuration() const;
-
-private:
-
-  /**
-   * @copydoc ItemLayout::GetMinimumLayoutPosition()
-   */
-  virtual float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const;
-
-  /**
-   * @copydoc ItemLayout::GetClosestAnchorPosition()
-   */
-  virtual float GetClosestAnchorPosition(float layoutPosition) const;
-
-  /**
-   * @copydoc ItemLayout::GetItemScrollToPosition()
-   */
-  virtual float GetItemScrollToPosition(unsigned int itemId) const;
-
-  /**
-   * @copydoc ItemLayout::GetItemsWithinArea()
-   */
-  virtual ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const;
-
-  /**
-   * @copydoc ItemLayout::GetReserveItemCount()
-   */
-  virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const;
-
-  /**
-   * @copydoc ItemLayout::GetItemSize()
-   */
-  virtual bool GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const;
-
-  /**
-   * @copydoc ItemLayout::GetResizeAnimation()
-   */
-  virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const;
-
-  /**
-   * @copydoc ItemLayout::GetPositionConstraint()
-   */
-  virtual bool GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetRotationConstraint()
-   */
-  virtual bool GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetScaleConstraint()
-   */
-  virtual bool GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetColorConstraint()
-   */
-  virtual bool GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetVisibilityConstraint()
-   */
-  virtual bool GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetScrollDirection()
-   */
-  virtual Degree GetScrollDirection() const;
-
-protected:
-
-  /**
-   * Protected constructor; see also RollLayout::New()
-   */
-  RollLayout();
-
-private:
-
-  struct Impl;
-  Impl* mImpl;
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_ROLL_LAYOUT_H__
index 818e4b4..6cf6331 100644 (file)
@@ -411,17 +411,17 @@ 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 BOOLEAN
-  static const std::string SCROLL_PANNING_PROPERTY_NAME;                ///< Property, name "scroll-panning",            type BOOLEAN
-  static const std::string SCROLL_SCROLLING_PROPERTY_NAME;              ///< Property, name "scroll-scrolling",          type BOOLEAN
-  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
+  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
 
index 3065a2c..0b315f3 100644 (file)
@@ -61,16 +61,31 @@ public:
 
   // 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
-
-  /// @name Properties
-  /** @{ */
-  static const Dali::Property::Index PROPERTY_OVERSHOOT_EFFECT_COLOR;         ///< Property, name "overshoot-effect-color",  @see SetOvershootEffectColor(),  type VECTOR4
-  static const Dali::Property::Index PROPERTY_OVERSHOOT_ANIMATION_SPEED;      ///< Property, name "overshoot-animation-speed",  @see SetOvershootAnimationSpeed(),  type FLOAT
-  /** @} */
+  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
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the Scrollable class.
+   */
+  struct Property
+  {
+    enum
+    {
+      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
+    };
+  };
 
 public:
 
index a9427c0..7b9ae6b 100644 (file)
@@ -45,34 +45,44 @@ class DALI_IMPORT_API Slider : public Control
 {
 public:
 
-  // Properties
-  static const Dali::Property::Index LOWER_BOUND_PROPERTY;            ///< Property, name "lower-bound",       type FLOAT
-  static const Dali::Property::Index UPPER_BOUND_PROPERTY;            ///< Property, name "upper-bound",       type FLOAT
-  static const Dali::Property::Index VALUE_PROPERTY;                  ///< Property, name "value",             type FLOAT
-
-  static const Dali::Property::Index HIT_REGION_PROPERTY;             ///< Property, name "hit-region",        type VECTOR2
-  static const Dali::Property::Index BACKING_REGION_PROPERTY;         ///< Property, name "backing-region",    type VECTOR2
-  static const Dali::Property::Index HANDLE_REGION_PROPERTY;          ///< Property, name "handle-region",     type VECTOR2
-
-  static const Dali::Property::Index BACKING_IMAGE_NAME_PROPERTY;     ///< Property, name "backing-image-name",  type STRING
-  static const Dali::Property::Index HANDLE_IMAGE_NAME_PROPERTY;      ///< Property, name "handle-image-name",   type STRING
-  static const Dali::Property::Index PROGRESS_IMAGE_NAME_PROPERTY;    ///< Property, name "progress-image-name", type STRING
-  static const Dali::Property::Index POPUP_IMAGE_NAME_PROPERTY;       ///< Property, name "popup-image-name",    type STRING
-  static const Dali::Property::Index POPUP_ARROW_IMAGE_NAME_PROPERTY; ///< Property, name "popup-arrow-image-name", type STRING
-
-  static const Dali::Property::Index DISABLE_COLOR_PROPERTY;          ///< Property, name "disable-color",    type VECTOR4
-  static const Dali::Property::Index POPUP_TEXT_COLOR_PROPERTY;       ///< Property, name "popup-text-color", type VECTOR4
-
-  static const Dali::Property::Index VALUE_PRECISION_PROPERTY;        ///< Property, name "value-precision",  type INT
-
-  static const Dali::Property::Index SHOW_POPUP_PROPERTY;             ///< Property, name "show-popup",       type BOOLEAN
-  static const Dali::Property::Index SHOW_VALUE_PROPERTY;             ///< Property, name "show-value",       type BOOLEAN
-
-  static const Dali::Property::Index ENABLED_PROPERTY;                ///< Property, name "enabled",          type BOOLEAN
+  /**
+   * @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              ///< Reserving 1000 property indices
+  };
 
-  static const Dali::Property::Index MARKS_PROPERTY;                  ///< Property, name "marks",            type Property::Array<float>
-  static const Dali::Property::Index SNAP_TO_MARKS_PROPERTY;          ///< Property, name "snap-to-marks",    type BOOLEAN
-  static const Dali::Property::Index MARK_TOLERANCE_PROPERTY;         ///< Property, name "mark-tolerance",   type FLOAT
+  /**
+   * @brief An enumeration of properties belonging to the Slider class.
+   */
+  struct Property
+  {
+    enum
+    {
+      LOWER_BOUND = PROPERTY_START_INDEX, ///< Property, name "lower-bound",            type float
+      UPPER_BOUND,                        ///< Property, name "upper-bound",            type float
+      VALUE,                              ///< Property, name "value",                  type float
+      HIT_REGION,                         ///< Property, name "hit-region",             type Vector2
+      BACKING_REGION,                     ///< Property, name "backing-region",         type Vector2
+      HANDLE_REGION,                      ///< Property, name "handle-region",          type Vector2
+      BACKING_IMAGE_NAME,                 ///< Property, name "backing-image-name",     type std::string
+      HANDLE_IMAGE_NAME,                  ///< Property, name "handle-image-name",      type std::string
+      PROGRESS_IMAGE_NAME,                ///< Property, name "progress-image-name",    type std::string
+      POPUP_IMAGE_NAME,                   ///< Property, name "popup-image-name",       type std::string
+      POPUP_ARROW_IMAGE_NAME,             ///< Property, name "popup-arrow-image-name", type std::string
+      DISABLE_COLOR,                      ///< Property, name "disable-color",          type Vector4
+      POPUP_TEXT_COLOR,                   ///< Property, name "popup-text-color",       type Vector4
+      VALUE_PRECISION,                    ///< Property, name "value-precision",        type int
+      SHOW_POPUP,                         ///< Property, name "show-popup",             type bool
+      SHOW_VALUE,                         ///< Property, name "show-value",             type bool
+      ENABLED,                            ///< Property, name "enabled",                type bool
+      MARKS,                              ///< Property, name "marks",                  type Property::Array<float>
+      SNAP_TO_MARKS,                      ///< Property, name "snap-to-marks",          type bool
+      MARK_TOLERANCE,                     ///< Property, name "mark-tolerance",         type float
+    };
+  };
 
 public:
 
index 734ea8f..c02c09c 100644 (file)
@@ -56,8 +56,25 @@ class DALI_IMPORT_API SuperBlurView : public Control
 {
 public:
 
-  // Properties
-  static const Dali::Property::Index PROPERTY_IMAGE;     ///< name "image",    @see SetImage,    type MAP
+  /**
+   * @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
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the SuperBlurView class.
+   */
+  struct Property
+  {
+    enum
+    {
+      IMAGE = PROPERTY_START_INDEX, ///< name "image",    @see SetImage,    type Map
+    };
+  };
 
   /**
    * @brief Signal type for notifications.
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 ffcf342..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>
@@ -45,14 +46,19 @@ class DALI_IMPORT_API TableView : public Control
 {
 public:
 
-  /// @name Properties
-  /** @{ */
-  static const Dali::Property::Index PROPERTY_ROWS;                       ///< name "rows",                      type UNSIGNED_INTEGER
-  static const Dali::Property::Index PROPERTY_COLUMNS;                    ///< name "columns",                   type UNSIGNED_INTEGER
-  static const Dali::Property::Index PROPERTY_CELL_PADDING;               ///< name "cell-padding",              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_LAYOUT_ROWS set the height of the rows
+  /**
+   * @brief An enumeration of properties belonging to the TableView class.
+   *
+   * LayoutRows: set the height of the rows.
    * It has the format as follows in script:
    * @code
    * "layout-rows":
@@ -61,11 +67,8 @@ public:
         "2": { "policy": "relative", "value": 0.33 }   //@see SetRelativeHeight
       }
    * @endcode
-   */
-  static const Dali::Property::Index PROPERTY_LAYOUT_ROWS;                ///< name "layout-rows",               type MAP
-
-  /*
-   * PROPERTY_LAYOUT_COLUMNS set the height of the rows
+   *
+   * LayoutColumns: set the height of the rows.
    * It has the format as follows in script:
    * @code
    * "layout-columns":
@@ -75,24 +78,31 @@ public:
       }
    * @endcode
    */
-  static const Dali::Property::Index PROPERTY_LAYOUT_COLUMNS;             ///< name "layout-columns",            type MAP
-  /** @} */
-
+  struct Property
+  {
+    enum
+    {
+      ROWS = PROPERTY_START_INDEX, ///< name "rows",           type unsigned int
+      COLUMNS,                     ///< name "columns",        type unsigned int
+      CELL_PADDING,                ///< name "cell-padding",   type Vector2
+      LAYOUT_ROWS,                 ///< name "layout-rows",    type Map
+      LAYOUT_COLUMNS,              ///< name "layout-columns", type Map
+    };
+  };
 
   // Custom properties for where to put the actor, these properties should be registered to the child which would be added to the table
-  static const std::string CELL_INDICES_PROPERTY_NAME;           ///< Property, name "cell-indices", type VECTOR2
-  static const std::string ROW_SPAN_PROPERTY_NAME;               ///< Property, name "row-span",     type FLOAT (Currently builder unable to differentiate integer and float from Json string)
-  static const std::string COLUMN_SPAN_PROPERTY_NAME;            ///< Property, name "column-span",  type FLOAT (Currently builder unable to differentiate integer and float from Json string)
-
+  static const std::string CELL_INDICES_PROPERTY_NAME;           ///< Property, name "cell-indices", type Vector2
+  static const std::string ROW_SPAN_PROPERTY_NAME;               ///< Property, name "row-span",     type float (Currently builder is unable to differentiate integer and float from Json string)
+  static const std::string COLUMN_SPAN_PROPERTY_NAME;            ///< Property, name "column-span",  type float (Currently builder is unable to differentiate integer and float from Json string)
 
   /**
    * @brief Describes how the size of a row / column been set
    */
   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
   };
 
   /**
@@ -262,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.
@@ -341,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 b0db235..0598988 100644 (file)
@@ -42,25 +42,40 @@ class DALI_IMPORT_API TextInput : public Control
 
 public:
 
-  /// @name Properties
-  /** @{ */
-  static const Dali::Property::Index HIGHLIGHT_COLOR_PROPERTY;                     // Property, name "highlight-color", type VECTOR4
-  static const Dali::Property::Index CUT_AND_PASTE_COLOR_PROPERTY;                 // Property, name "cut-and-paste-bg-color", type VECTOR4
-  static const Dali::Property::Index CUT_AND_PASTE_PRESSED_COLOR_PROPERTY;         // Property, name "cut-and-paste-pressed-color", type VECTOR4
-  static const Dali::Property::Index CUT_AND_PASTE_BORDER_COLOR_PROPERTY;          // Property, name "cut-and-paste-border-color", type VECTOR4
-  static const Dali::Property::Index CUT_AND_PASTE_ICON_COLOR_PROPERTY;            // Property, name "cut-and-paste-icon-color", type VECTOR4
-  static const Dali::Property::Index CUT_AND_PASTE_ICON_PRESSED_COLOR_PROPERTY;    // Property, name "cut-and-paste-icon-pressed-color", type VECTOR4
-  static const Dali::Property::Index CUT_AND_PASTE_TEXT_COLOR_PROPERTY;            // Property, name "cut-and-paste-text-color", type VECTOR4
-  static const Dali::Property::Index CUT_AND_PASTE_TEXT_PRESSED_COLOR_PROPERTY;    // Property, name "cut-and-paste-text-pressed-color", type VECTOR4
-  static const Dali::Property::Index CUT_BUTTON_POSITION_PRIORITY_PROPERTY;        // Property, name "cut-button-position-priority", type unsigned int
-  static const Dali::Property::Index COPY_BUTTON_POSITION_PRIORITY_PROPERTY;       // Property, name "copy-button-position-priority", type unsigned int
-  static const Dali::Property::Index PASTE_BUTTON_POSITION_PRIORITY_PROPERTY;      // Property, name "paste-button-position-priority", type unsigned int
-  static const Dali::Property::Index SELECT_BUTTON_POSITION_PRIORITY_PROPERTY;     // Property, name "select-button-position-priority", type unsigned int
-  static const Dali::Property::Index SELECT_ALL_BUTTON_POSITION_PRIORITY_PROPERTY; // Property, name "select-all-button-position-priority", type unsigned int
-  static const Dali::Property::Index CLIPBOARD_BUTTON_POSITION_PRIORITY_PROPERTY;  // Property, name "clipboard-button-position-priority", type unsigned int
-  static const Dali::Property::Index POP_UP_OFFSET_FROM_TEXT_PROPERTY;             // Property, name "popup-offset-from-text", type VECTOR4
-  static const Dali::Property::Index CURSOR_COLOR_PROPERTY;                        // Property, name "cursor-color", type VECTOR4
-  /** @} */
+  /**
+   * @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 + 512              ///< Reserve property indices
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the TextInput class.
+   */
+  struct Property
+  {
+    enum
+    {
+      HIGHLIGHT_COLOR = PROPERTY_START_INDEX, // Property, name "highlight-color",                     type Vector4
+      CUT_AND_PASTE_COLOR,                    // Property, name "cut-and-paste-bg-color",              type Vector4
+      CUT_AND_PASTE_PRESSED_COLOR,            // Property, name "cut-and-paste-pressed-color",         type Vector4
+      CUT_AND_PASTE_BORDER_COLOR,             // Property, name "cut-and-paste-border-color",          type Vector4
+      CUT_AND_PASTE_ICON_COLOR,               // Property, name "cut-and-paste-icon-color",            type Vector4
+      CUT_AND_PASTE_ICON_PRESSED_COLOR,       // Property, name "cut-and-paste-icon-pressed-color",    type Vector4
+      CUT_AND_PASTE_TEXT_COLOR,               // Property, name "cut-and-paste-text-color",            type Vector4
+      CUT_AND_PASTE_TEXT_PRESSED_COLOR,       // Property, name "cut-and-paste-text-pressed-color",    type Vector4
+      CUT_BUTTON_POSITION_PRIORITY,           // Property, name "cut-button-position-priority",        type unsigned int
+      COPY_BUTTON_POSITION_PRIORITY,          // Property, name "copy-button-position-priority",       type unsigned int
+      PASTE_BUTTON_POSITION_PRIORITY,         // Property, name "paste-button-position-priority",      type unsigned int
+      SELECT_BUTTON_POSITION_PRIORITY,        // Property, name "select-button-position-priority",     type unsigned int
+      SELECT_ALL_BUTTON_POSITION_PRIORITY,    // Property, name "select-all-button-position-priority", type unsigned int
+      CLIPBOARD_BUTTON_POSITION_PRIORITY,     // Property, name "clipboard-button-position-priority",  type unsigned int
+      POP_UP_OFFSET_FROM_TEXT,                // Property, name "popup-offset-from-text",              type Vector4
+      CURSOR_COLOR,                           // Property, name "cursor-color",                        type Vector4
+    };
+  };
 
 public:
 
index f4cfa2e..0eb8024 100644 (file)
@@ -52,17 +52,34 @@ class DALI_IMPORT_API TextView : public Control
 {
 public:
 
-  // Properties
-  static const Dali::Property::Index PROPERTY_MARKUP_ENABLED;         ///< name "markup-enabled",       @see SetMarkupProcessingEnabled(), type BOOLEAN
-  static const Dali::Property::Index PROPERTY_TEXT;                   ///< name "text",                 @see SetText(),                    type STRING
-  static const Dali::Property::Index PROPERTY_MULTILINE_POLICY;       ///< name "multiline-policy",     @see SetMultilinePolicy(),         type STRING
-  static const Dali::Property::Index PROPERTY_WIDTH_EXCEED_POLICY;    ///< name "width-exceed-policy",  @see SetWidthExceedPolicy(),       type STRING
-  static const Dali::Property::Index PROPERTY_HEIGHT_EXCEED_POLICY;   ///< name "height-exceed-policy", @see SetHeightExceedPolicy(),      type STRING
-  static const Dali::Property::Index PROPERTY_LINE_JUSTIFICATION;     ///< name "line-justification",   @see SetLineJustification(),       type STRING
-  static const Dali::Property::Index PROPERTY_FADE_BOUNDARY;          ///< name "fade-boundary",        @see SetFadeBoundary(),            type VECTOR4
-  static const Dali::Property::Index PROPERTY_LINE_HEIGHT_OFFSET;     ///< name "line-height-offset",   @see SetLineHeightOffset(),        type FLOAT
-  static const Dali::Property::Index PROPERTY_HORIZONTAL_ALIGNMENT;   ///< name "horizontal-alignment", @see SetTextAlignment(),           type STRING
-  static const Dali::Property::Index PROPERTY_VERTICAL_ALIGNMENT;     ///< name "vertical-alignment",   @see SetTextAlignment(),           type STRING
+  /**
+   * @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
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the TextView class.
+   */
+  struct Property
+  {
+    enum
+    {
+      MARKUP_ENABLED = PROPERTY_START_INDEX, ///< name "markup-enabled",       @see SetMarkupProcessingEnabled(), type bool
+      TEXT,                                  ///< name "text",                 @see SetText(),                    type std::string
+      MULTILINE_POLICY,                      ///< name "multiline-policy",     @see SetMultilinePolicy(),         type std::string
+      WIDTH_EXCEED_POLICY,                   ///< name "width-exceed-policy",  @see SetWidthExceedPolicy(),       type std::string
+      HEIGHT_EXCEED_POLICY,                  ///< name "height-exceed-policy", @see SetHeightExceedPolicy(),      type std::string
+      LINE_JUSTIFICATION,                    ///< name "line-justification",   @see SetLineJustification(),       type std::string
+      FADE_BOUNDARY,                         ///< name "fade-boundary",        @see SetFadeBoundary(),            type Vector4
+      LINE_HEIGHT_OFFSET,                    ///< name "line-height-offset",   @see SetLineHeightOffset(),        type float
+      HORIZONTAL_ALIGNMENT,                  ///< name "horizontal-alignment", @see SetTextAlignment(),           type std::string
+      VERTICAL_ALIGNMENT,                    ///< name "vertical-alignment",   @see SetTextAlignment(),           type std::string
+    };
+  };
 
   /**
    * @brief Structure used to retrieve Layout info per character.
index ba2e1d8..5487676 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 = 32;
+const unsigned int TOOLKIT_MICRO_VERSION = 35;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 3322360..dddcd30 100755 (executable)
@@ -28,8 +28,6 @@ public_api_src_files = \
   $(public_api_src_dir)/controls/scrollable/item-view/item-factory.cpp \
   $(public_api_src_dir)/controls/scrollable/item-view/item-layout.cpp \
   $(public_api_src_dir)/controls/scrollable/item-view/item-view.cpp \
-  $(public_api_src_dir)/controls/scrollable/item-view/navigation-layout.cpp \
-  $(public_api_src_dir)/controls/scrollable/item-view/roll-layout.cpp \
   $(public_api_src_dir)/controls/scrollable/item-view/spiral-layout.cpp \
   $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-carousel-effect.cpp \
   $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-constraints.cpp \
@@ -153,8 +151,6 @@ public_api_item_view_header_files = \
   $(public_api_src_dir)/controls/scrollable/item-view/item-layout.h \
   $(public_api_src_dir)/controls/scrollable/item-view/item-view-declarations.h \
   $(public_api_src_dir)/controls/scrollable/item-view/item-view.h \
-  $(public_api_src_dir)/controls/scrollable/item-view/navigation-layout.h \
-  $(public_api_src_dir)/controls/scrollable/item-view/roll-layout.h \
   $(public_api_src_dir)/controls/scrollable/item-view/spiral-layout.h
 
 public_api_magnifier_header_files = \
index 04d02f6..c6d68af 100644 (file)
@@ -106,7 +106,7 @@ DissolveEffect DissolveEffect::New( bool useHighPrecision )
   Dali::Toolkit::DissolveEffect handle( shaderEffectCustom );
 
   handle.SetUniform( DISTORTION_PROPERTY_NAME, 0.0f );
-  handle.SetProperty( ShaderEffect::Property::GridDensity, Dali::Property::Value(50.0f) );
+  handle.SetProperty( ShaderEffect::Property::GRID_DENSITY, Dali::Property::Value(50.0f) );
 
   handle.SetCentralLine( Vector2(1.0f,0.5f), Vector2(-1.0f, 0.0f) );
 
index 4a6fab3..bc20944 100644 (file)
@@ -108,7 +108,7 @@ DissolveLocalEffect DissolveLocalEffect::New( unsigned int numberOfDimples )
     handle.SetRadius(i, 0.f);
     handle.SetDistortion( i, 0.f );
   }
-  handle.SetProperty( ShaderEffect::Property::GridDensity, Dali::Property::Value(5.f) );
+  handle.SetProperty( ShaderEffect::Property::GRID_DENSITY, Dali::Property::Value(5.f) );
   handle.SetTransparency( 0.5f );
 
   return handle;
index 574c906..155a6e2 100644 (file)
@@ -88,4 +88,3 @@ private: // Not intended for application developers
 } // namespace Dali
 
 #endif // __DALI_TOOLKIT_MIRROR_EFFECT_H__
-
index 11b4c30..a444640 100644 (file)
@@ -94,7 +94,7 @@ MotionBlurEffect MotionBlurEffect::Apply( RenderableActor renderable )
   Dali::Property::Index uModelProperty = newEffect.GetPropertyIndex( MOTION_BLUR_MODEL_LASTFRAME );
 
   Constraint constraint = Constraint::New<Matrix>( uModelProperty,
-                                                   Source( renderable, Actor::Property::WorldMatrix ),
+                                                   Source( renderable, Actor::Property::WORLD_MATRIX ),
                                                    EqualToConstraint() );
 
   // and set up constraint.
index bc69f72..4dd15f2 100644 (file)
@@ -109,7 +109,7 @@ MotionStretchEffect MotionStretchEffect::Apply( RenderableActor renderable )
   Dali::Property::Index uModelProperty = newEffect.GetPropertyIndex( MOTION_STRETCH_MODELVIEW_LASTFRAME );
 
   Constraint constraint = Constraint::New<Matrix>( uModelProperty,
-                                                   Source( renderable, Actor::Property::WorldMatrix ),
+                                                   Source( renderable, Actor::Property::WORLD_MATRIX ),
                                                    EqualToConstraint() );
 
   // and set up constraint.
index f717d5c..0aef67f 100644 (file)
@@ -91,7 +91,7 @@ static void DoApply( ImageActor actor, const std::string& maskImage, const Vecto
 
   maskEffect.SetUniform( "uImageSize", Vector2(0,0) /*Constrained to actor size*/ );
   maskEffect.ApplyConstraint( Constraint::New<Vector2>( maskEffect.GetPropertyIndex("uImageSize"),
-                                                        Source(actor, Actor::Property::Size),
+                                                        Source(actor, Actor::Property::SIZE),
                                                         NinePatchMaskEffectSizeConstraint() ) );
 
   maskEffect.SetUniform( "uMaskSize", maskSize );
diff --git a/docs/content/example-code/property-example.cpp b/docs/content/example-code/property-example.cpp
new file mode 100644 (file)
index 0000000..35e7869
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * 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 <dali/dali.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <sstream>
+
+using namespace Dali;
+
+namespace
+{
+
+// The name we will use to register our custom property by.
+const char* const TAG_PROPERTY_NAME = "tag-identifier";
+
+const char* const PUSHBUTTON_PRESS_IMAGE =  DALI_IMAGE_DIR "button-down.9.png";
+const char* const PUSHBUTTON_BUTTON_IMAGE = DALI_IMAGE_DIR "button-up.9.png";
+
+// Define the grid geometry.
+#define BUTTON_ROWS    9.0f
+#define BUTTON_COLUMNS 7.0f
+#define BUTTON_GAP     10.0f
+
+}  // namespace
+
+/**
+ * This example shows how to register and look-up custom properties.
+ * A button grid is created, each with a new "tag" property which is set to a unique value.
+ * When pressed, the "tag" property is looked up to retrieve the unique value and display it.
+ */
+class PropertyButtonsController: public ConnectionTracker
+{
+  public:
+
+  PropertyButtonsController( Application& application )
+  {
+    // Connect to the Application's Init signal
+    application.InitSignal().Connect( this, &PropertyButtonsController::Create );
+  }
+
+  ~PropertyButtonsController()
+  {
+  }
+
+  void Create( Application& application )
+  {
+    // Setup precalculations for button size and start positions.
+    Toolkit::PushButton button;
+    int index = 0;
+    Vector2 stageSize = Stage::GetCurrent().GetSize();
+    float buttonSize = ( stageSize.x - ( BUTTON_GAP * ( BUTTON_COLUMNS + 1 ) ) ) / BUTTON_COLUMNS;
+    float yStart = ( stageSize.y - ( ( buttonSize * BUTTON_ROWS ) + ( BUTTON_GAP * ( BUTTON_ROWS - 1 ) ) ) ) / 2.0f;
+
+    // Create a grid of buttons.
+    for( int y = 0; y < BUTTON_ROWS; ++y )
+    {
+      for( int x = 0; x < BUTTON_COLUMNS; ++x )
+      {
+        // Create a button and position it.
+        button = Toolkit::PushButton::New();
+        button.SetParentOrigin( ParentOrigin::TOP_LEFT );
+        button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+        button.SetPosition( Vector3( BUTTON_GAP + ( x * ( buttonSize + BUTTON_GAP ) ), yStart + ( y * ( buttonSize + BUTTON_GAP ) ), 0.0f ) );
+        button.SetSize( Vector3( buttonSize, buttonSize, 0) );
+        button.SetSelectedImage( Dali::ResourceImage::New( PUSHBUTTON_PRESS_IMAGE ) );
+        button.SetButtonImage( Dali::ResourceImage::New( PUSHBUTTON_BUTTON_IMAGE ) );
+
+        // Label the button with a unique value.
+        std::stringstream label;
+        label << index;
+        button.SetLabel( label.str() );
+
+        // Register our custom property, and use it to store a unique number.
+        // Store the index to the property so we can look it up later.
+        // Note: This is much faster than looking the property up by name and should always be used if possible.
+        // As all our control types are the same (PushButtons) the indecies to our unique property is the same for each one.
+        Property::Value tag = ( float )index;
+        mTagPropertyIndex = button.RegisterProperty( TAG_PROPERTY_NAME, tag );
+
+        // Hook a callback when the button is clicked.
+        button.ClickedSignal().Connect( this, &PropertyButtonsController::OnButtonClicked );
+
+        // Add the button to the stage.
+        Stage::GetCurrent().Add( button );
+        index++;
+      }
+    }
+
+    // Create the last selected button text view.
+    mTagText = Toolkit::TextView::New( "None selected" );
+    mTagText.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+    mTagText.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+    mTagText.SetPosition( Vector3( 0.0f, -30.0f, 0.0f ) );
+    Stage::GetCurrent().Add( mTagText );
+  }
+
+  /**
+   * Called when any button within the grid is clicked.
+   * param[in] The clicked button control
+   * return Set to true if the signal was consumed correctly
+   */
+  bool OnButtonClicked( Toolkit::Button button )
+  {
+    std::stringstream valueText;
+    // Look up the tag property by the cached property index.
+    // Note: If the property belongs to a control in another library, or we do not know the index, we can look the index up first with:
+    // Property::Index index = button.GetPropertyIndex( TAG_PROPERTY_NAME );
+    valueText << "Selected: " << button.GetProperty< float >( mTagPropertyIndex );
+
+    mTagText.SetText( valueText.str() );
+
+    return true;
+  }
+
+  private:
+
+  Toolkit::TextView mTagText;        ///< A text label used to show the last button pressed.
+  Property::Index mTagPropertyIndex; ///< A cached property index of our custom tag property.
+};
+
+// Entry point for applications.
+int main( int argc, char **argv )
+{
+  Application application = Application::New( &argc, &argv );
+
+  PropertyButtonsController test( application );
+  application.MainLoop();
+
+  return 0;
+}
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 3d0a5d2..2e01044 100644 (file)
@@ -9,7 +9,7 @@
  *
  * @code
  * Dali::Actor actor;
- * actor.SetRotation(Quaternion(Radian(Degree(45.0f)).value, Vector3::XAXIS)),
+ * actor.SetOrientation(Quaternion(Radian(Degree(45.0f)).value, Vector3::XAXIS)),
  *
  * Quaternion q(Radian(Degree(30.0f)).value, Vector3(1.0f, 1.0f, 0.0f));
  * actor.RotateBy(q);
index c4a1d98..8e70c5d 100644 (file)
@@ -51,8 +51,8 @@
  * $ dali-demo
  * $
  * $ ...
- * $ I/DALI ( 5692): slp-logging.cpp: LogMessage(40) > Update , min 0.59 ms, max 6.43 ms, total (3.4 secs), avg 1.26 ms
- * $ I/DALI ( 5692): slp-logging.cpp: LogMessage(40) > Render , min 1.67 ms, max 5.01 ms, total (4.5 secs), avg 3.71 ms
+ * $ I/DALI ( 5692): tizen-logging.cpp: LogMessage(40) > Update , min 0.59 ms, max 6.43 ms, total (3.4 secs), avg 1.26 ms
+ * $ I/DALI ( 5692): tizen-logging.cpp: LogMessage(40) > Render , min 1.67 ms, max 5.01 ms, total (4.5 secs), avg 3.71 ms
  * \endcode
  *
  * If nothing is animating Dali will enter a paused state to save power. At this
index a8d452b..8838e78 100644 (file)
 /*! \page properties Properties
  *
+@section what-is-a-property What is a property?
+
+A property is a value used by an object that can be modified or read externally to that object.
+This could be from within Dali or externally by an application.
+
+<h2 class="pg">What is a property used for?</h2>
+
+Properties can be set externally by an application, allowing that application to change the configuration or behaviour of an actor.
+This could include the physical geometry of the actor, or how it is drawn or moves.
+
+Properties can also be read. This feature can be used in conjunction with constraints to allow changes to a property within one actor to cause changes to the property of another actor. For example, an actor following the movement of another separate actor (that it is not a child of). 
+
+Properties can be used to expose any useful information or behaviour of an actor.
+Other actor variables that are used to implement this bevahiour, or do not make useful sense from an application developers point of view should not be exposed.
+
+<h2 class="pg">How to implement a property within Dali-core:</h2>
+
+<b>There are two stages:</b>
+
+- Define the properties as an enum in the public-api header file.
+- Define the property details using the pre-defined macros to build up a table of property information.
+
+There are some pre-defined macros designed to help with and standardise the definition of the propery details table per class.
+
+These macros generate an array of property details which allow efficient lookup of flags like "animatable" or "constraint input".
+
+<b>Example: ImageActor</b>
+
+Within the public-api header file; image-actor.h:
+
+@code
+/**
+ * @brief An enumeration of properties belonging to the ImageActor class.
+ * Properties additional to RenderableActor.
+ */
+struct Property
+{
+  enum
+  {
+    PIXEL_AREA = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX, ///< name "pixel-area",  type Rect<int>
+    STYLE,                                                   ///< name "style",       type std::string
+    BORDER,                                                  ///< name "border",      type Vector4
+    IMAGE,                                                   ///< name "image",       type Map {"filename":"", "load-policy":...}
+  };
+};
+@endcode
+From @ref Dali::ImageActor::Property
+
+<b>Notes:</b>
+
+- The properties are enumerated within a named struct to give them a namespace.
+- The properties are then refered to as &lt;OBJECT&gt;::%Property::&lt;PROPERTY_NAME&gt;.
+
+Within the internal implementation; <b>image-actor-impl.cpp</b>:
+
+@code
+namespace // Unnamed namespace
+{
+
+// Properties
+
+//              Name           Type   writable animatable constraint-input  enum for index-checking
+DALI_PROPERTY_TABLE_BEGIN
+DALI_PROPERTY( "pixel-area",   RECTANGLE, true,    false,   true,    Dali::ImageActor::Property::PIXEL_AREA )
+DALI_PROPERTY( "style",        STRING,    true,    false,   true,    Dali::ImageActor::Property::STYLE      )
+DALI_PROPERTY( "border",       VECTOR4,   true,    false,   true,    Dali::ImageActor::Property::BORDER     )
+DALI_PROPERTY( "image",        MAP,       true,    false,   false,   Dali::ImageActor::Property::IMAGE      )
+DALI_PROPERTY_TABLE_END( DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX )
+@endcode
+
+<b>Notes:</b>
+
+- The table lays within an unnamed namespace.
+- The table should be in the same order as the enum.
+- The table should be the only place where the text names of the properties are defined.
+- The information in the table should be used within the classes IsDefaultPropertyWritable / Animatable / ConstraintInput methods for quick lookup.
+- The last entry in the table is optionally used in debug builds for index checking.
+- The parameter to DALI_PROPERTY_TABLE_END should match the start index of the property enumeration.
+
+<br>
+<h2 class="pg">How to implement a property within Dali-toolkit:</h2>
+
+Note that toolkit properties have extra limitations in that they cannot be animated or used as a constraint input. For this reason there is no requirement for a table of property details.
+Macros are still used to define properties, but for the following reasons:
+
+To standardise the way properties are defined.
+To handle type-registering for properties, signals and actions in one place.
+To facilitate the posibility of running the code with the type-registry disabled.
+
+<b>There are two stages:</b>
+
+- Define the properties as an enum in the public-api header file, along with a definition of the property ranges.
+- Define the property details using the pre-defined macros to perform the type-registering of the properties. This is done for signals and actions also.
+
+<b>Example: Button</b>
+
+Source file: <b>button.h</b>:
+Note that the “PropertyRange” contents “PROPERTY_START_INDEX” is also used by the macro for order checking.
+
+@code
+  /**
+   * @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
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the Button class.
+   */
+  struct Property
+  {
+    enum
+    {
+      DISABLED = PROPERTY_START_INDEX, ///< name "disabled",                     @see SetDisabled(),                  type bool
+      AUTO_REPEATING,                  ///< name "auto-repeating",               @see SetAutoRepeating(),             type bool
+      INITIAL_AUTO_REPEATING_DELAY,    ///< name "initial-auto-repeating-delay", @see SetInitialAutoRepeatingDelay(), type float
+      NEXT_AUTO_REPEATING_DELAY,       ///< name "next-auto-repeating-delay",    @see SetNextAutoRepeatingDelay(),    type float
+      TOGGLABLE,                       ///< name "togglable",                    @see SetTogglableButton(),           type bool
+      SELECTED,                        ///< name "selected",                     @see SetSelected(),                  type bool
+      NORMAL_STATE_ACTOR,              ///< name "normal-state-actor",           @see SetButtonImage(),               type Map
+      SELECTED_STATE_ACTOR,            ///< name "selected-state-actor",         @see SetSelectedImage(),             type Map
+      DISABLED_STATE_ACTOR,            ///< name "disabled-state-actor",         @see SetDisabledImage(),             type Map
+      LABEL_ACTOR,                     ///< name "label-actor",                  @see SetLabel(),                     type Map
+    };
+  };
+@endcode
+
+Source file: <b>button-impl.cpp</b>, within an unnamed namespace:
+
+@clip{"button-impl.cpp",DALI_TYPE_REGISTRATION_BEGIN,DALI_TYPE_REGISTRATION_END}
+
+<b>Notes:</b>
+
+- The “Create” parameter to the begin macro is the function pointer to the creation function.
+- Properties should be in the same order as in the enum.
+- Signals and actions are registered likewise in that order.
+- Properties type-registered using these macros will have their order checked at compile time. If you get an indexing compile error, check the order matches the enum order.
+
+
+<br>
+<hr>
 @section property-indices Property Indices
 
+The properties are enumerated to give them a unique index. This index can be used to access them.
+The indecies must be unique per flattened derivation heirachy.
+EG:
+- CameraActor derives from Actor. No property indicies in either CameraActor or Actor should collide with each other.
+- ActiveConstraintBase derives from Object. It CAN have property indices that match Actor or CameraActor.
+
+There are some predefined start indecies and ranges that should be used for common cases, these are defined below:
+
+
 DALi has a property system and provides several different kinds of properties. The following table
 shows the index range of the different properties in place.
 
 <table>
-  <tr> <td><b>Kind</b></td>     <td><b>Description</b></td>                                                                                <td style="text-align:center;"><b>Range</b></td>         </tr>
-  <tr> <td>Default</td>         <td>Properties defined within DALi Core, e.g. Dali::Actor, Dali::ShaderEffect default properties etc.</td> <td style="text-align:center;">0 to 9999999</td>         </tr>
-  <tr> <td>Registered</td>      <td>Properties registered using Dali::PropertyRegistration</td>                                            <td style="text-align:center;">10000000 to 19999999</td> </tr>
-  <tr> <td>Control</td>         <td>Property range reserved by Dali::Toolkit::Control</td>                                                 <td style="text-align:center;">10000000 to 10001000<br>
-                                                                                      \link Dali::Toolkit::Internal::Control::CONTROL_PROPERTY_START_INDEX CONTROL_PROPERTY_START_INDEX\endlink
-                                                                                      to \link Dali::Toolkit::Internal::Control::CONTROL_PROPERTY_END_INDEX CONTROL_PROPERTY_END_INDEX\endlink</td> </tr>
-  <tr> <td>Derived Control</td> <td>Property range for control deriving directly from Dali::Toolkit::Control</td>                          <td style="text-align:center;">10001001 to 19999999</td> </tr>
-  <tr> <td>Custom</td>          <td>Custom properties added to instance using Dali::Handle::RegisterProperty</td>                          <td style="text-align:center;">50000000 onwards</td>     </tr>
+  <tr> <td><b>Kind</b></td>     <td><b>Description</b></td>                                                                                <td style="text-align:center;"><b>Start Index</b></td><td><b>End Index</b></td>         </tr>
+  <tr> <td>Default</td>         <td>Properties defined within DALi Core, e.g. Dali::Actor, Dali::ShaderEffect default properties etc.</td> <td style="text-align:center;">\link Dali::DEFAULT_OBJECT_PROPERTY_START_INDEX DEFAULT_OBJECT_PROPERTY_START_INDEX\endlink (0)</td><td>9999999</td>         </tr>
+  <tr> <td>Registered</td>      <td>Properties registered using Dali::PropertyRegistration</td>                                            <td style="text-align:center;">\link Dali::PROPERTY_REGISTRATION_START_INDEX PROPERTY_REGISTRATION_START_INDEX\endlink (10000000)</td><td>\link Dali::PROPERTY_REGISTRATION_MAX_INDEX PROPERTY_REGISTRATION_MAX_INDEX\endlink (19999999)</td> </tr>
+  <tr> <td>Control</td>         <td>Property range reserved by Dali::Toolkit::Control</td>                                                 <td style="text-align:center;">\link Dali::Toolkit::Control::CONTROL_PROPERTY_START_INDEX CONTROL_PROPERTY_START_INDEX\endlink (10000000)</td><td>
+  \link Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX CONTROL_PROPERTY_END_INDEX\endlink (10001000)</td></tr>
+  <tr> <td>Derived Control</td> <td>Property range for control deriving directly from Dali::Toolkit::Control</td>                          <td style="text-align:center;">10001001</td><td>\link Dali::PROPERTY_REGISTRATION_MAX_INDEX PROPERTY_REGISTRATION_MAX_INDEX\endlink (19999999)</td> </tr>
+  <tr> <td>Custom</td>          <td>Custom properties added to instance using Dali::Handle::RegisterProperty</td>                          <td style="text-align:center;">\link Dali::PROPERTY_CUSTOM_START_INDEX PROPERTY_CUSTOM_START_INDEX\endlink (50000000)</td><td>Onwards...</td>     </tr>
 </table>
 
+
+<br>
+<hr>
+@section property-use-example-cpp Property use example C++
+
+Common uses for properties are constraints and animations.
+
+An application developer can use an existing property, or, if necessary, register their own.
+
+Here is a code example.
+
+This example shows how to register and look-up custom properties.
+A grid of buttons is created, each with a new "tag" property which is set to a unique value. The index to this property is cached for later use.
+When pressed, the property is looked up by index (as this is much faster than a text lookup of the property name).
+
+Property lookup via index should always be used unless the indecies cannot be known. If the property reader was completely decoupled from the creation, EG. A custom control with a custom property being used by external application code, then it may be necessary. In this case the application writer should aim to perform the text lookup once at start-up, and cache the property index locally.
+
+@clip{"property-example.cpp", void Create, return true;}
+
+Once run, a grid of buttons will appear. When a button is pressed, the unique number stored in the property (in this case the index) is displayed at the bottom of the screen.
+
+<br>
+<hr>
+@section property-use-example-js Property use in JavaScript
+
+Note that constraints cannot be used within JavaScript, so below is a simple example that sets one of the default properties; scale:
+
+@code
+var image = new dali.ResourceImage( {url:"background.png"} );
+var imageActor = new dali.ImageActor( image );
+
+// by default an actor is anchored to the top-left of it's parent actor
+// change it to the middle
+imageActor.parentOrigin = dali.CENTER;
+
+// scale it up by 2 times  in x,y
+imageActor.scale = [ 2, 2, 1  ];
+
+// add to the stage
+dali.stage.add( imageActor );
+@endcode
+
+For a more detailed example see the ShaderEffect example in the JavaScript documentation.
+
+<br>
+<hr>
+@section property-use-example-json Property use in JSON
+
+This is a basic example of a button defined in JSON by setting the default properties.
+
+@code
+{
+  "constants": {
+    "CONFIG_SCRIPT_LOG_LEVEL": "Verbose"
+  },
+  "stage": [
+    // First Button
+    {
+      "type": "PushButton",
+      "parent-origin": "TOP_CENTER",
+      "anchor-point": "TOP_CENTER",
+      "position": [0, 0, 0],
+      "size": [0, 200, 0],
+      "normal-state-actor": {
+        "type": "ImageActor",
+        "image": {
+          "filename": "{DALI_IMAGE_DIR}blocks-brick-1.png"
+        }
+      },
+      "selected-state-actor": {
+        "type": "ImageActor",
+        "image": {
+          "filename": "{DALI_IMAGE_DIR}blocks-brick-2.png"
+        }
+      },
+      "label-actor": {
+        "type": "TextView",
+        "text": "Normal"
+      }
+    }
+  ]
+}
+@endcode
+
 *
 */
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..641da16
--- /dev/null
@@ -0,0 +1,256 @@
+/*! \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( FILL_TO_PARENT, ALL_DIMENSIONS );
+mBackgroundImage.SetSizeMode( SIZE_FIXED_OFFSET_FROM_PARENT );
+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..536a8f8 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 SetPreferredSize
+- 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
+- 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.
+@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>
+
+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
-class ControlA : public Control
-{
-  ...
-private:
-  // Data
-  Actor mActorC; // Container to store children
-  TextView mControlD; // Some text we want to display
-  ImageActor mActorD; // An image
-};
+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 the following method. Calling this method will automatically set the resize policy to be DIMENSION_DEPENDENCY
+for the given dimension.
+@code void SetDimensionDependency( Dimension dimension, Dimension dependency ) @endcode
+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
-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;
-}
+TextView text = TextView::New( "Example" );
+text.SetMultilinePolicy( SplitByWord );
+text.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+text.SetDimensionDependency( HEIGHT, WIDTH );
 @endcode
 
-GetHeightForWidth() and GetWidthForHeight() can be created in a similar manner.
+<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 the following method.
+This method is to be used instead of SetSize when wishing to specify a size for an actor being size negotiated.
+@code void SetPreferredSize( const Vector2& size ) @endcode
+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
-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.
-  }
-}
+void SetMinimumSize( const Vector2& size )
+void SetMaximumSize( const Vector2& size )
 @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>
+<h3>Altering Negotiated Size</h3>
+
+The following method specifies a size mode to use. Use one of: USE_OWN_SIZE, SIZE_RELATIVE_TO_PARENT or SIZE_FIXED_OFFSET_FROM_PARENT. SIZE_RELATIVE_TO_PARENT will
+scale the image relative to it's parent size when the resize policy of FILL_TO_PARENT is in effect. While SIZE_FIXED_OFFSET_FROM_PARENT will
+add an offset to this parent size, for example when wanting an image to act as a border around its parent.
+@code void SetSizeMode( const SizeMode mode ) @endcode
+
+Use the following with SetSizeMode to specify either the size relative to parent or the fixed offset to apply.
+@code void SetSizeModeFactor( const Vector3& factor ) @endcode
+
+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
+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.SetDimensionDependency( HEIGHT, WIDTH );
+
+content.AddChild( text, Toolkit::TableView::CellPosition( 0, 0 ) );
+
+// Image
+ImageActor image = ImageActor::New( ResourceImage::New( IMAGE1 ) );
+image.SetResizePolicy( FILL_TO_PARENT, WIDTH );
+image.SetDimensionDependency( HEIGHT, WIDTH );
+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.SetPreferredSize( Vector2( 48, 48 ) );
+checkBox.SetResizePolicy( FIXED, ALL_DIMENSIONS );
+
+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 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.SetDimensionDependency( HEIGHT, WIDTH );
+@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.SetDimensionDependency( HEIGHT, WIDTH );
+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 3f3663f..bef67d0 100644 (file)
@@ -193,10 +193,10 @@ Dali::PROPERTY_REGISTRATION_MAX_INDEX.
 
 Furthermore, if deriving from \link Dali::Toolkit::Control Control\endlink, the control writer
 needs to be aware of their parent class's property range. Control reserves a property range between
-\link Dali::Toolkit::Internal::Control::CONTROL_PROPERTY_START_INDEX ControlImpl::CONTROL_PROPERTY_START_INDEX\endlink
-and \link Dali::Toolkit::Internal::Control::CONTROL_PROPERTY_END_INDEX Internal::Control::CONTROL_PROPERTY_END_INDEX\endlink.
+\link Dali::Toolkit::Control::CONTROL_PROPERTY_START_INDEX ControlImpl::CONTROL_PROPERTY_START_INDEX\endlink
+and \link Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX Control::CONTROL_PROPERTY_END_INDEX\endlink.
 Any deriving control should start their property indices from
-\link Dali::Toolkit::Internal::Control::CONTROL_PROPERTY_END_INDEX Internal::Control::CONTROL_PROPERTY_END_INDEX\endlink + 1.
+\link Dali::Toolkit::Control::CONTROL_PROPERTY_END_INDEX Control::CONTROL_PROPERTY_END_INDEX\endlink + 1.
 
 Please have a look at \ref property-indices for more information.
 
diff --git a/docs/content/shared-javascript-and-cpp-documentation/documentation-guide.md b/docs/content/shared-javascript-and-cpp-documentation/documentation-guide.md
new file mode 100644 (file)
index 0000000..3be5549
--- /dev/null
@@ -0,0 +1,18 @@
+/**
+ *
+## Writing documentation for the DALi programing guide
+
+To allow documentation to be shared between C++ and JavaScript, please follow these guidelines:
+
+ - Create a mark down file (.md) using GitHub Flavoured Markdown https://help.github.com/articles/github-flavored-markdown/
+ - Put it into the shared C++ / JavaScript documentation: ~dali-toolkit/docs/content/shared-javascript-and-cpp-documentation/~
+ - Include code samples for both C++ and JavaScript in the mark down.
+ - See multi-touch-guide.md in toolkit for an example
+  
+Why use GitHub flavoured markdown?
+ - Table support is good and language specific code blocks are easier to define ( javascript/C++).
+ - Doxygen and YUIDOC both support it.
+
+
+@class Writing_DALi_Programming_Guide_Documentation
+*/
index 4bd9dc0..6661aeb 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.0.32
+Version:    1.0.35
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index ce095cd..b2ea595 100644 (file)
@@ -119,7 +119,7 @@ function OnPressed( actor, touchEvent )
   
   var anim = new dali.Animation( 4 );
   var rotation = new dali.Rotation( 90, 0, 0 ); // pitch, yaw, roll
-  anim.animateBy( actor, "rotation", rotation );
+  anim.animateBy( actor, "orientation", rotation );
   anim.play();
   return true;
 }
@@ -196,8 +196,8 @@ See
  worldPositionX         |FLOAT       | &#10008;     | &#10008;
  worldPositionY         |FLOAT       | &#10008;     | &#10008;
  worldPositionZ         |FLOAT       | &#10008;     | &#10008;
rotation               |ROTATION    | &#10004;     | &#10004;
- worldRotation          |ROTATION    | &#10008;     | &#10008;
orientation            |ROTATION    | &#10004;     | &#10004;
+ worldOrientation       |ROTATION    | &#10008;     | &#10008;
  scale                  |VECTOR3     | &#10004;     | &#10004;
  scaleX                 |FLOAT       | &#10004;     | &#10004;
  scaleY                 |FLOAT       | &#10004;     | &#10004;
@@ -214,7 +214,7 @@ See
  name                   |STRING      | &#10004;     | &#10008;
  sensitive              |BOOLEAN     | &#10004;     | &#10008;
  leaveRequired          |BOOLEAN     | &#10004;     | &#10008;
- inheritRotation        |BOOLEAN     | &#10004;     | &#10008;
+ inheritOrientation     |BOOLEAN     | &#10004;     | &#10008;
  inheritScale           |BOOLEAN     | &#10004;     | &#10008;
  colorMode              |NUMBER      | &#10004;     | &#10008;
  positionInheritance    |NUMBER      | &#10004;     | &#10008;
@@ -381,19 +381,19 @@ WORLD_POSITION_Z
 
 
 /**
- * Actors rotation
- * @property rotation
- * @type dali Rotation object
+ * Actors orientation
+ * @property orientation
+ * @type dali orientation object
  */
-ROTATION
+ORIENTATION
 
 
 /**
- * Actors world-rotation
- * @property worldRotation
- * @type dali Rotation object ( read only)
+ * Actors world-orientation
+ * @property worldOrientation
+ * @type dali Orientation object ( read only)
  */
-WORLD_ROTATION
+WORLD_ORIENTATION
 
 /**
  * Actors scale
@@ -521,10 +521,10 @@ LEAVE_REQUIRED
 /**
  * Set whether a child actor inherits it's parent's orientation.
  * @type Boolean
- * @property inheritRotation
+ * @property inheritOrientation
  * @default true
  */
-INHERIT_ROTATION,
+INHERIT_ORIENTATION,
 
 
 /**
@@ -644,4 +644,4 @@ POSTITION_INHERITANCE
  * @type Vector3
  * @property sizeModeFactor
  */
-SIZE_MODE_FACTOR
\ No newline at end of file
+SIZE_MODE_FACTOR
index ec587fe..33c64f8 100644 (file)
@@ -68,8 +68,8 @@ myActor2.position=[ 100,0,-2000];  // x = 100, y = 0 , z = -2000
 function createAnimation() {
   
   var startRotation = new dali.Rotation(180, -180, 0);
-  myActor1.rotation = startRotation;
-  myActor2.rotation = startRotation;
+  myActor1.orientation = startRotation;
+  myActor2.orientation = startRotation;
   
   dali.stage.add( myActor1 );
   dali.stage.add( myActor2 );
@@ -90,7 +90,7 @@ function createAnimation() {
   var endRotation = new dali.Rotation(0,0,0);
   
   animOptions.alpha = "easeInOutSine";
-  anim.animateTo(myActor1, "rotation", endRotation, animOptions);
+  anim.animateTo(myActor1, "orientation", endRotation, animOptions);
   
   // Delay the myActor2  by  a second
   animOptions.delay = 0.0;
@@ -99,7 +99,7 @@ function createAnimation() {
   
   //  rotate back to correct orientation
   animOptions.alpha = "easeInOutSine";
-  anim.animateTo(myActor2, "rotation", endRotation, animOptions);
+  anim.animateTo(myActor2, "orientation", endRotation, animOptions);
 
   return anim;
 }
@@ -209,7 +209,7 @@ var shaderAnim = createShaderAnimation( shaderEffect, color,zoom, duration, dela
   
 // also rotate the imageActor 90 degrees at the same time.
 var rotation = new dali.Rotation(90,0,0,1);
-shaderAnim.animateTo(imageActor, "rotation", rotation, { alpha:"linear", duration:duration, delay:delay });
+shaderAnim.animateTo(imageActor, "orientation", rotation, { alpha:"linear", duration:duration, delay:delay });
 
 
 shaderAnim.play();
index 818bc85..71b750b 100644 (file)
@@ -7,10 +7,10 @@ Allows the developer to use actor semantics to control a camera.
 There are two types of camera actor, FREE_LOOK and LOOK_AT_TARGET. By default
 the camera actor will be FREE_LOOK.
 
-A FREE_LOOK camera uses actor's rotation to control where the camera is looking.
+A FREE_LOOK camera uses actor's orientation to control where the camera is looking.
 If no additional rotations are specified, the camera looks in the negative Z direction.
 
-For LOOK_AT_TARGET the actor's rotation is ignored, instead the camera looks at TARGET_POSITION
+For LOOK_AT_TARGET the actor's orientation is ignored, instead the camera looks at TARGET_POSITION
 in world coordinates.
 ```
 // get the camera currently used
index eedfafa..98e9c17 100644 (file)
@@ -5,7 +5,13 @@
 
 Shader effects provide a visual effect for actors.
 
-For a Custom shader you can provide the vertex and fragment shader code as strings.
+You can create a type-registered shader effect by its type name.
+```
+// create a new shader effect
+var shader = new dali.ShaderEffect("BlindEffect");
+```
+
+Alternatively you can create a Custom shader by providing the vertex and fragment shader code as strings.
 Each shader is provided with default uniforms and attributes.
 For a vertex shader this part contains the following code:
 ```
@@ -238,7 +244,7 @@ imageActor.setCullFace( dali.CULL_FACE_DISABLE ); // disable face culling so we
 dali.stage.add( imageActor );
   
 // start it of tilted around the y-axis
-imageActor.rotation=new dali.Rotation(90, 0, 1, 0);
+imageActor.orientation=new dali.Rotation(90, 0, 1, 0);
   
 var twistEffect = createTwistEffect();
 imageActor.setShaderEffect( twistEffect );
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 ebc1fa7..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
 {
@@ -335,39 +336,6 @@ void ActorApi::FindChildByName( const v8::FunctionCallbackInfo<v8::Value>& args
 }
 
 /**
- * Search through this actor's hierarchy for an actor with the given name or alias.
- *
- * Actors can customize this function to provide actors with preferred alias'
- * For example 'previous' could return the last selected child.
- * If no aliased actor is found then FindChildByName() is called.
- *
- * @for Actor
- * @method findChildByAlias
- * @param {String} actor alias
- * @return {Object} actor on success, empty actor handle if not found
- */
-void ActorApi::FindChildByAlias( const v8::FunctionCallbackInfo<v8::Value>& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  Actor parent = GetActor( isolate, args );
-  bool found( false );
-  std::string name = V8Utils::GetStringParameter( PARAMETER_0, found, isolate, args );
-  if( !found )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "String parameter not found" );
-    return;
-  }
-  Actor childActor = parent.FindChildByAlias( name );
-  if( childActor )
-  {
-    // wrap the child
-    v8::Local < v8::Object > wrappedLayer = ActorWrapper::WrapActor( isolate, childActor );
-    args.GetReturnValue().Set( wrappedLayer );
-  }
-}
-
-/**
  * Search through this actor's hierarchy for an actor with the given unique ID.
  * The actor itself is also considered in the search
  *
@@ -535,13 +503,13 @@ void ActorApi::GetActorType( const v8::FunctionCallbackInfo<v8::Value>& args )
  * @example
  *
  *    // using an array
- *    actor.moveBy( [20,40,0] );
+ *    actor.translateBy( [20,40,0] );
  *
  * @for Actor
- * @method moveBy
+ * @method translateBy
  * @param {object} an array of 3 numbers
  */
-void ActorApi::MoveBy( const v8::FunctionCallbackInfo<v8::Value>& args )
+void ActorApi::TranslateBy( const v8::FunctionCallbackInfo<v8::Value>& args )
 {
   v8::Isolate* isolate = args.GetIsolate();
   v8::HandleScope handleScope( isolate );
@@ -565,7 +533,7 @@ void ActorApi::MoveBy( const v8::FunctionCallbackInfo<v8::Value>& args )
     DALI_SCRIPT_EXCEPTION( isolate, "Vector3 move parameter missing" );
     return;
   }
-  actor.MoveBy( vector );
+  actor.TranslateBy( vector );
 
 }
 
@@ -641,74 +609,111 @@ void ActorApi::ScaleBy( const v8::FunctionCallbackInfo<v8::Value>& args )
   }
   actor.ScaleBy( vector );
 }
-/**
- * Apply a relative scale to an actor.
- * Actor opacity ranges from 0 (see through ) to 1 ( solid )
- * @example
- *    // reduce actor opactiy by a half
- *    actor.opaictyBy(-0.5);
- *
- * @for Actor
- * @method OpacityBy
- * @param {float} relative opacity
- */
-void ActorApi::OpacityBy( const v8::FunctionCallbackInfo<v8::Value>& args )
+
+void ActorApi::ApplyPathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args )
 {
   v8::Isolate* isolate = args.GetIsolate();
   v8::HandleScope handleScope( isolate );
-  Actor actor = GetActor( isolate, args );
 
-  // void OpacityBy(float relativeOpacity);
-  bool found;
-  float opacity = V8Utils::GetFloatParameter( PARAMETER_0, found, isolate, args, 0.f );
+  //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, "float parameter missing" );
+    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 0 (PathConstraint)" );
     return;
   }
-  actor.OpacityBy( opacity );
-}
+  PathConstraint pathConstraint = PathConstraint::DownCast(pathConstraintHandle);
 
-/**
- * Apply a relative color change to an actor.
- *
- * @example
- *    // increase actor red by half
- *    actor.colorBy( [0.5, 0, 0, 0]);
- *
- *
- * @for Actor
- * @method colorBy
- * @param {Object} Color JavaScript array
- */
-void ActorApi::ColorBy( const v8::FunctionCallbackInfo<v8::Value>& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  Actor actor = GetActor( isolate, args );
+  //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;
+  }
 
-  bool found;
-  int argCount( args.Length() );
-  Vector4 color;
+  // 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( argCount == 1 )
+    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 )
   {
-    color = V8Utils::GetVector4Parameter( PARAMETER_0, 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, "Vector4 parameter missing" );
+      DALI_SCRIPT_EXCEPTION( isolate, "Property not found" );
       return;
     }
   }
-  else
+
+  //Check if forward vector is specified
+  Vector3 forward( 0.0f,0.0f,0.0f);
+  if( args.Length() > 4 )
   {
-    DALI_SCRIPT_EXCEPTION( isolate, "Vector4 parameter missing" );
-    return;
+    forward =  V8Utils::GetVector3Parameter( PARAMETER_4, found, isolate, args );
+    if( !found )
+    {
+      DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 4 (Vector3)" );
+      return;
+    }
   }
 
-  actor.ColorBy( color );
+  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
 
index 38bc95a..b1dfd4b 100644 (file)
@@ -58,18 +58,21 @@ namespace ActorApi
   void Unparent( const v8::FunctionCallbackInfo< v8::Value >& args);
   void GetChildAt( const v8::FunctionCallbackInfo< v8::Value >& args);
   void FindChildByName( const v8::FunctionCallbackInfo< v8::Value >& args);
-  void FindChildByAlias( const v8::FunctionCallbackInfo< v8::Value >& args);
   void FindChildById( const v8::FunctionCallbackInfo< v8::Value >& args);
   void GetParent( const v8::FunctionCallbackInfo< v8::Value >& args );
   void GetChildCount( const v8::FunctionCallbackInfo< v8::Value >& args );
   void ScreenToLocal( const v8::FunctionCallbackInfo< v8::Value >& args );
   void SetKeyboardFocusable( const v8::FunctionCallbackInfo< v8::Value >& args );
   void IsKeyboardFocusable( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void MoveBy( const v8::FunctionCallbackInfo< v8::Value >& args );
+  void TranslateBy( const v8::FunctionCallbackInfo< v8::Value >& args );
   void RotateBy( const v8::FunctionCallbackInfo< v8::Value >& args );
   void ScaleBy( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void OpacityBy( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void ColorBy( 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
index 7d10f3a..7613178 100644 (file)
@@ -199,10 +199,11 @@ const ActorFunctions ActorFunctionTable[]=
     { "GetChildCount",     ActorApi::GetChildCount,    ACTOR_API },
     { "GetChildAt"   ,     ActorApi::GetChildAt,       ACTOR_API },
     { "FindChildByName",   ActorApi::FindChildByName,  ACTOR_API },
-    { "FindChildByAlias",  ActorApi::FindChildByAlias, ACTOR_API },
     { "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
@@ -212,17 +213,17 @@ const ActorFunctions ActorFunctionTable[]=
     // ignore. GetCurrentSize() use Actor.size
     // ignore. SetPosition(....) use Actor.position
     // ignore. SetX, SetY, SetZ,  use Actor.position.x, Actor.position.y, Actor.position.z
-    { "MoveBy",         ActorApi::MoveBy,              ACTOR_API },
+    { "TranslateBy",         ActorApi::TranslateBy,              ACTOR_API },
     // ignore GetCurrentPosition(). use Actor.position
     // ignore GetCurrentWorldPosition() use Actor.worldPosition
     // ignore SetPositionInheritanceMode() use Actor.positionInheritance
     // ignore GetPositionInheritanceMode()  use Actor.positionInheritance
-    // ignore SetRotation() use Actor.rotation
+    // ignore SetOrientation() use Actor.orientation
     { "RotateBy",         ActorApi::RotateBy,          ACTOR_API },
-    // ignore GetCurrentRotation() use Actor.rotation
-    // ignore SetInheritRotation() use Actor.inheritRotation
-    // ignore IsRotationInherited() use Actor.inheritRotation
-    // ignore GetCurrentWorldRotation() use Actor.worldRotation
+    // ignore GetCurrentOrientation() use Actor.orientation
+    // ignore SetInheritOrientation() use Actor.inheritOrientation
+    // ignore IsOrientationInherited() use Actor.inheritOrientation
+    // ignore GetCurrentWorldOrientation() use Actor.worldOrientation
     // ignore SetScale() use Actor.scale
     { "ScaleBy",         ActorApi::ScaleBy,            ACTOR_API },
     // ignore GetCurrentScale() use Actor.scale
@@ -233,10 +234,8 @@ const ActorFunctions ActorFunctionTable[]=
     // ignore SetVisible() use Actor.visible
     // ignore IsVisible() use Actor.visible
     // ignore SetOpacity() use Actor.opacity
-    { "OpactiyBy",         ActorApi::OpacityBy,        ACTOR_API },
     // ignore GetCurrentOpacity() use Actor.opacity
     // ignore SetColor() use Actor.color
-    { "ColorBy",         ActorApi::ColorBy,            ACTOR_API },
     // ignore GetCurrentColor() use Actor.color
     // ignore SetColorMode() use Actor.colorMode
     // ignore GetColorMode() use Actor.colorMode
index 79381ba..76eee47 100644 (file)
@@ -52,8 +52,7 @@ public:
     MESH_ACTOR   =3,
     LAYER_ACTOR  =4,
     CAMERA_ACTOR =5,
-    LIGHT_ACTOR  =6,
-    TEXT_VIEW    =7
+    TEXT_VIEW    =6
   };
 
   /**
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..938e485 100644 (file)
@@ -202,7 +202,6 @@ const IntegerPair EnumTable[] =
     { "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 },
 
index 55df482..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 },
@@ -183,7 +185,7 @@ void DaliWrapper::CreateContext( )
   // Context = multiple contexts can exist in a given Isolate, and share data between contexts
   v8::Handle<v8::Context> context  = v8::Context::New( mIsolate, NULL, global);
 
-  mGlobalObjectTemplate.Reset( mIsolate,  global); 
+  mGlobalObjectTemplate.Reset( mIsolate,  global);
 
   mContext.Reset( mIsolate, context);
 }
@@ -192,10 +194,16 @@ void DaliWrapper::Initialize()
 {
   if( !mIsolate )
   {
-    v8::V8::Initialize();
     v8::V8::InitializeICU();
+
+    v8::V8::Initialize();
+
+    // default isolate removed from V8 version 3.27.1 and beyond.
+    mIsolate = v8::Isolate::New();
+    mIsolate->Enter();
+
     v8::V8::SetFatalErrorHandler( FatalErrorCallback );
-    mIsolate = v8::Isolate::GetCurrent();
+
   }
   // if context is null, create it and add dali object to the global object.
   if( mContext.IsEmpty())
index c9d58ea..39b23d2 100644 (file)
@@ -170,11 +170,11 @@ bool ModuleLoader::ExecuteScriptFromFile( v8::Isolate* isolate,
  *
  *
  *     // ImageActor.js
- *     function ImageActor( position, rotation, image, name )
+ *     function ImageActor( position, orientation, image, name )
  *     {
  *         this = new dali.ImageActor( image );
  *         this.position = position;
- *         this.rotation = rotation;
+ *         this.orientation = orientation;
  *         this.name = name;
  *     }
  *     module.exports = ImageActor;
@@ -185,7 +185,7 @@ bool ModuleLoader::ExecuteScriptFromFile( v8::Isolate* isolate,
  *
  *     var ImageActor = require(" ImageActor.js");
  *
- *     var imageActor = new ImageActor( position, rotation, image, "my first image actor");
+ *     var imageActor = new ImageActor( position, orientation, image, "my first image actor");
  *
  * #### Exporting as a singleton
  *
index 74762f2..d7bd2a5 100644 (file)
@@ -19,6 +19,9 @@
 // CLASS HEADER
 #include "shader-effect-api.h"
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/type-registry.h>
+
 // INTERNAL INCLUDES
 #include <v8-utils.h>
 #include <shader-effects/shader-effect-wrapper.h>
@@ -187,14 +190,12 @@ ShaderEffect GetShaderEffect( v8::Isolate* isolate, const v8::FunctionCallbackIn
  */
 ShaderEffect ShaderEffectApi::New(  v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args )
 {
-
-
   v8::HandleScope handleScope( isolate );
 
-  ShaderParameters shaderParams;
-
   if( args[0]->IsObject() )
   {
+    ShaderParameters shaderParams;
+
     v8::Local<v8::Object > obj = args[0]->ToObject();
 
     v8::Local<v8::Value> geometryTypeValue = obj->Get(v8::String::NewFromUtf8( isolate, "geometryType"));
@@ -245,9 +246,39 @@ ShaderEffect ShaderEffectApi::New(  v8::Isolate* isolate, const v8::FunctionCall
       }
       shaderParams.ProcessHintsArray( hintsArray );
     }
+
+    return shaderParams.NewShader();
   }
-  return shaderParams.NewShader();
+  else
+  {
+    ShaderEffect effect;
+
+    bool found( false );
+    std::string typeName = V8Utils::GetStringParameter( PARAMETER_0, found, isolate, args );
+    if( !found )
+    {
+      DALI_SCRIPT_EXCEPTION( isolate, "string parameter missing" );
+    }
+    else
+    {
+      // create a new shader effect based on type, using the type registry.
+      Dali::TypeInfo typeInfo = Dali::TypeRegistry::Get().GetTypeInfo( typeName );
+      if( typeInfo ) // handle, check if it has a value
+      {
+        Dali::BaseHandle handle = typeInfo.CreateInstance();
+        if( handle )
+        {
+          effect = ShaderEffect::DownCast( handle );
+        }
+      }
+      else
+      {
+        DALI_SCRIPT_EXCEPTION(isolate,"Unknown shader effect type");
+      }
+    }
 
+    return effect;
+  }
 }
 
 ShaderEffect ShaderEffectApi::GetShaderEffectFromParams( int paramIndex,
index 04ae5fa..89f4ebe 100644 (file)
@@ -126,8 +126,11 @@ void ShaderEffectWrapper::NewShaderEffect( const v8::FunctionCallbackInfo< v8::V
   }
   Dali::ShaderEffect shaderEffect = ShaderEffectApi::New( isolate, args );
 
-  v8::Local<v8::Object> localObject = WrapShaderEffect( isolate, shaderEffect );
-  args.GetReturnValue().Set( localObject );
+  if(shaderEffect)
+  {
+    v8::Local<v8::Object> localObject = WrapShaderEffect( isolate, shaderEffect );
+    args.GetReturnValue().Set( localObject );
+  }
 }
 
 
index 7e473cd..fee9d8c 100644 (file)
@@ -71,6 +71,7 @@ public:
       CONNECTION,
       ANIMATION,
       PATH,
+      PATH_CONSTRAINT,
       BUILDER,
       STAGE,
       FONT,
index 1d73b9c..d9fbc7e 100644 (file)
@@ -332,7 +332,7 @@ bool GetBooleanValue( v8::Isolate* isolate, const v8::Local<v8::Value>& value )
   else if (value->IsBooleanObject() )
   {
     const v8::Local<v8::BooleanObject> object = v8::Local<v8::BooleanObject>::Cast(value);
-    return object->ValueOf();
+    return object->BooleanValue();
   }
   DALI_SCRIPT_EXCEPTION(isolate, "no bool found");
   return false;
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 );