[dali_1.0.39] Merge branch 'tizen' 47/38647/1
authorXiangyin Ma <x1.ma@samsung.com>
Thu, 23 Apr 2015 11:04:48 +0000 (12:04 +0100)
committerXiangyin Ma <x1.ma@samsung.com>
Thu, 23 Apr 2015 11:04:48 +0000 (12:04 +0100)
Change-Id: Ib81030d888030356df2ca1130e72e0d922eeff29

305 files changed:
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.h
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-Cluster.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-DepthLayout.cpp
automated-tests/src/dali-toolkit/utc-Dali-GridLayout.cpp
automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp
automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-SpiralLayout.cpp
automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-View.cpp
dali-toolkit/internal/atlas-manager/atlas-manager-impl.cpp
dali-toolkit/internal/atlas-manager/atlas-manager-impl.h
dali-toolkit/internal/atlas-manager/atlas-manager.cpp
dali-toolkit/internal/atlas-manager/atlas-manager.h
dali-toolkit/internal/controls/alignment/alignment-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/push-button-impl.cpp
dali-toolkit/internal/controls/buttons/push-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/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp
dali-toolkit/internal/controls/navigation-frame/page-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/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/scrollable/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-overshoot-indicator-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-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/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/controls/view/view-impl.cpp
dali-toolkit/internal/file.list
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/text/clipping/text-clipper.cpp
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/decorator/text-decorator.h
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/text-controller-impl.cpp [new file with mode: 0644]
dali-toolkit/internal/text/text-controller-impl.h [new file with mode: 0644]
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/public-api/builder/builder.cpp
dali-toolkit/public-api/builder/builder.h
dali-toolkit/public-api/builder/json-parser.cpp
dali-toolkit/public-api/builder/json-parser.h
dali-toolkit/public-api/builder/tree-node.cpp
dali-toolkit/public-api/builder/tree-node.h
dali-toolkit/public-api/controls/alignment/alignment.cpp
dali-toolkit/public-api/controls/alignment/alignment.h
dali-toolkit/public-api/controls/bloom-view/bloom-view.cpp
dali-toolkit/public-api/controls/bloom-view/bloom-view.h
dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.cpp
dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.h
dali-toolkit/public-api/controls/buttons/button.cpp
dali-toolkit/public-api/controls/buttons/button.h
dali-toolkit/public-api/controls/buttons/check-box-button.cpp
dali-toolkit/public-api/controls/buttons/check-box-button.h
dali-toolkit/public-api/controls/buttons/push-button.cpp
dali-toolkit/public-api/controls/buttons/push-button.h
dali-toolkit/public-api/controls/buttons/radio-button.cpp
dali-toolkit/public-api/controls/buttons/radio-button.h
dali-toolkit/public-api/controls/cluster/cluster-style.cpp
dali-toolkit/public-api/controls/cluster/cluster-style.h
dali-toolkit/public-api/controls/cluster/cluster.cpp
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/default-controls/check-button-factory.cpp
dali-toolkit/public-api/controls/default-controls/check-button-factory.h
dali-toolkit/public-api/controls/default-controls/push-button-factory.cpp
dali-toolkit/public-api/controls/default-controls/push-button-factory.h
dali-toolkit/public-api/controls/default-controls/solid-color-actor.cpp
dali-toolkit/public-api/controls/default-controls/solid-color-actor.h
dali-toolkit/public-api/controls/effects-view/effects-view.cpp
dali-toolkit/public-api/controls/effects-view/effects-view.h
dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.cpp
dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h
dali-toolkit/public-api/controls/image-view/masked-image-view.cpp
dali-toolkit/public-api/controls/image-view/masked-image-view.h
dali-toolkit/public-api/controls/magnifier/magnifier.cpp
dali-toolkit/public-api/controls/magnifier/magnifier.h
dali-toolkit/public-api/controls/navigation-frame/navigation-bar-style.h
dali-toolkit/public-api/controls/navigation-frame/navigation-control.cpp
dali-toolkit/public-api/controls/navigation-frame/navigation-control.h
dali-toolkit/public-api/controls/navigation-frame/page.cpp
dali-toolkit/public-api/controls/navigation-frame/page.h
dali-toolkit/public-api/controls/page-turn-view/page-factory.cpp
dali-toolkit/public-api/controls/page-turn-view/page-factory.h
dali-toolkit/public-api/controls/page-turn-view/page-turn-landscape-view.cpp
dali-toolkit/public-api/controls/page-turn-view/page-turn-landscape-view.h
dali-toolkit/public-api/controls/page-turn-view/page-turn-portrait-view.cpp
dali-toolkit/public-api/controls/page-turn-view/page-turn-portrait-view.h
dali-toolkit/public-api/controls/page-turn-view/page-turn-view.cpp
dali-toolkit/public-api/controls/page-turn-view/page-turn-view.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.cpp
dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h
dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.cpp
dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.h
dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.cpp
dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.h
dali-toolkit/public-api/controls/scrollable/item-view/item-factory.cpp
dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h
dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp
dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h
dali-toolkit/public-api/controls/scrollable/item-view/item-view-declarations.h
dali-toolkit/public-api/controls/scrollable/item-view/item-view.cpp
dali-toolkit/public-api/controls/scrollable/item-view/item-view.h
dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.cpp
dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.h
dali-toolkit/public-api/controls/scrollable/scroll-component-impl.cpp
dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h
dali-toolkit/public-api/controls/scrollable/scroll-component.cpp
dali-toolkit/public-api/controls/scrollable/scroll-component.h
dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp
dali-toolkit/public-api/controls/scrollable/scroll-connector.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h
dali-toolkit/public-api/controls/scrollable/scrollable.cpp
dali-toolkit/public-api/controls/scrollable/scrollable.h
dali-toolkit/public-api/controls/shadow-view/shadow-view.cpp
dali-toolkit/public-api/controls/shadow-view/shadow-view.h
dali-toolkit/public-api/controls/slider/slider.cpp
dali-toolkit/public-api/controls/slider/slider.h
dali-toolkit/public-api/controls/super-blur-view/super-blur-view.cpp
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/tool-bar/tool-bar.cpp
dali-toolkit/public-api/controls/tool-bar/tool-bar.h
dali-toolkit/public-api/controls/view/view.cpp
dali-toolkit/public-api/controls/view/view.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/dali-toolkit-version.h
dali-toolkit/public-api/enums.cpp
dali-toolkit/public-api/enums.h
dali-toolkit/public-api/focus-manager/focus-manager.cpp
dali-toolkit/public-api/focus-manager/focus-manager.h
dali-toolkit/public-api/focus-manager/keyboard-focus-manager.cpp
dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h
dali-toolkit/public-api/focus-manager/keyinput-focus-manager.cpp
dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h
dali-toolkit/public-api/scripting/script-plugin.h
dali-toolkit/public-api/scripting/script.cpp
dali-toolkit/public-api/scripting/script.h
dali-toolkit/public-api/shader-effects/alpha-discard-effect.cpp
dali-toolkit/public-api/shader-effects/alpha-discard-effect.h
dali-toolkit/public-api/shader-effects/bendy-effect.cpp
dali-toolkit/public-api/shader-effects/bendy-effect.h
dali-toolkit/public-api/shader-effects/blind-effect.cpp
dali-toolkit/public-api/shader-effects/blind-effect.h
dali-toolkit/public-api/shader-effects/bouncing-effect.cpp
dali-toolkit/public-api/shader-effects/bouncing-effect.h
dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.cpp
dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.h
dali-toolkit/public-api/shader-effects/bubble-effect/color-adjuster.cpp
dali-toolkit/public-api/shader-effects/bubble-effect/color-adjuster.h
dali-toolkit/public-api/shader-effects/carousel-effect.cpp
dali-toolkit/public-api/shader-effects/carousel-effect.h
dali-toolkit/public-api/shader-effects/displacement-effect.cpp
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-effect.h
dali-toolkit/public-api/shader-effects/dissolve-local-effect.cpp
dali-toolkit/public-api/shader-effects/dissolve-local-effect.h
dali-toolkit/public-api/shader-effects/distance-field-effect.cpp
dali-toolkit/public-api/shader-effects/distance-field-effect.h
dali-toolkit/public-api/shader-effects/image-region-effect.cpp
dali-toolkit/public-api/shader-effects/image-region-effect.h
dali-toolkit/public-api/shader-effects/iris-effect.cpp
dali-toolkit/public-api/shader-effects/iris-effect.h
dali-toolkit/public-api/shader-effects/mask-effect.cpp
dali-toolkit/public-api/shader-effects/mask-effect.h
dali-toolkit/public-api/shader-effects/mirror-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/nine-patch-mask-effect.h
dali-toolkit/public-api/shader-effects/overlay-effect.cpp
dali-toolkit/public-api/shader-effects/overlay-effect.h
dali-toolkit/public-api/shader-effects/page-turn-book-spine-effect.cpp
dali-toolkit/public-api/shader-effects/page-turn-book-spine-effect.h
dali-toolkit/public-api/shader-effects/page-turn-effect.cpp
dali-toolkit/public-api/shader-effects/page-turn-effect.h
dali-toolkit/public-api/shader-effects/quadratic-bezier.cpp
dali-toolkit/public-api/shader-effects/quadratic-bezier.h
dali-toolkit/public-api/shader-effects/ripple-effect.cpp
dali-toolkit/public-api/shader-effects/ripple-effect.h
dali-toolkit/public-api/shader-effects/ripple2d-effect.cpp
dali-toolkit/public-api/shader-effects/ripple2d-effect.h
dali-toolkit/public-api/shader-effects/shear-effect.cpp
dali-toolkit/public-api/shader-effects/shear-effect.h
dali-toolkit/public-api/shader-effects/soft-button-effect.cpp
dali-toolkit/public-api/shader-effects/soft-button-effect.h
dali-toolkit/public-api/shader-effects/spot-effect.cpp
dali-toolkit/public-api/shader-effects/spot-effect.h
dali-toolkit/public-api/shader-effects/square-dissolve-effect.cpp
dali-toolkit/public-api/shader-effects/square-dissolve-effect.h
dali-toolkit/public-api/shader-effects/swirl-effect.cpp
dali-toolkit/public-api/shader-effects/swirl-effect.h
dali-toolkit/public-api/shader-effects/water-effect.cpp
dali-toolkit/public-api/shader-effects/water-effect.h
dali-toolkit/public-api/styling/style-manager.cpp
dali-toolkit/public-api/styling/style-manager.h
dali-toolkit/public-api/transition-effects/cube-transition-cross-effect.cpp
dali-toolkit/public-api/transition-effects/cube-transition-cross-effect.h
dali-toolkit/public-api/transition-effects/cube-transition-effect.cpp
dali-toolkit/public-api/transition-effects/cube-transition-effect.h
dali-toolkit/public-api/transition-effects/cube-transition-fold-effect.cpp
dali-toolkit/public-api/transition-effects/cube-transition-fold-effect.h
dali-toolkit/public-api/transition-effects/cube-transition-wave-effect.cpp
dali-toolkit/public-api/transition-effects/cube-transition-wave-effect.h
docs/content/example-code/property-example.cpp
docs/content/images/actors/Text-Actor.png [deleted file]
docs/content/images/actors/Text-Label.png [new file with mode: 0644]
docs/content/images/text-controls/HelloWorld-HeightForWidth.png [new file with mode: 0644]
docs/content/images/text-controls/HelloWorld-NaturalSize.png [new file with mode: 0644]
docs/content/images/text-controls/PlainText.png [new file with mode: 0644]
docs/content/images/text-controls/RedText.png [new file with mode: 0644]
docs/content/images/text-controls/TextWith1pxUnderline.png [new file with mode: 0644]
docs/content/images/text-controls/TextWithBiggerShadow.png [new file with mode: 0644]
docs/content/images/text-controls/TextWithColorShadow.png [new file with mode: 0644]
docs/content/images/text-controls/TextWithColorUnderline.png [new file with mode: 0644]
docs/content/images/text-controls/TextWithShadow.png [new file with mode: 0644]
docs/content/images/text-controls/TextWithUnderline.png [new file with mode: 0644]
docs/content/programming-guide/hello-world.h
docs/content/programming-guide/properties.h
docs/content/programming-guide/script-hello.h
docs/content/programming-guide/size-negotiation-controls.h
docs/content/programming-guide/size-negotiation.h
docs/content/programming-guide/text-label.h
packaging/dali-toolkit.spec
plugins/dali-script-v8/file.list
plugins/dali-script-v8/src/actors/actor-wrapper.cpp
plugins/dali-script-v8/src/actors/image-actor-api.cpp
plugins/dali-script-v8/src/actors/image-actor-api.h
plugins/dali-script-v8/src/constants/constants-wrapper.cpp
plugins/dali-script-v8/src/dali-wrapper.cpp
plugins/dali-script-v8/src/image/image-attributes-api.cpp [deleted file]
plugins/dali-script-v8/src/image/image-attributes-api.h [deleted file]
plugins/dali-script-v8/src/image/image-attributes-wrapper.cpp [deleted file]
plugins/dali-script-v8/src/image/image-attributes-wrapper.h [deleted file]
plugins/dali-script-v8/src/image/resource-image-api.cpp
plugins/dali-script-v8/src/image/resource-image-api.h
plugins/dali-script-v8/src/object/property-value-wrapper.cpp

index 92d1390..9441e0a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
  * limitations under the License.
  *
  */
+// CLASS HEADER
+#include "dali-test-suite-utils.h"
+
+// EXTERNAL INCLUDES
+#include <ostream>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
-#include <stdarg.h>
-
-#include "dali-test-suite-utils.h"
 
 using namespace Dali;
 
@@ -72,9 +74,21 @@ bool operator==(TimePeriod a, TimePeriod b)
   return Equals(a.durationSeconds, b.durationSeconds) && Equals(a.delaySeconds, b.delaySeconds) ;
 }
 
-std::ostream& operator<< (std::ostream& o, const TimePeriod value)
+std::ostream& operator<< (std::ostream& ostream, const TimePeriod value)
+{
+  return ostream << "( Duration:" << value.durationSeconds << " Delay:" << value.delaySeconds << ")";
+}
+
+std::ostream& operator<<( std::ostream& ostream, Radian angle )
+{
+  ostream << angle.radian;
+  return ostream;
+}
+
+std::ostream& operator<<( std::ostream& ostream, Degree angle )
 {
-  return o << "( Duration:" << value.durationSeconds << " Delay:" << value.delaySeconds << ")";
+  ostream << angle.degree;
+  return ostream;
 }
 
 void DALI_TEST_EQUALS( const Matrix3& matrix1, const Matrix3& matrix2, const char* location)
index 88315d4..30ace77 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TEST_SUITE_UTILS_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * 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.
  *
  */
 
+// EXTERNAL INCLUDES
+#include <cstdarg>
+#include <iosfwd>
+
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-core.h>
 #include <stdarg.h>
@@ -139,17 +143,19 @@ inline bool CompareType<Quaternion>(Quaternion q1, Quaternion q2, float epsilon)
 template <>
 inline bool CompareType<Radian>(Radian q1, Radian q2, float epsilon)
 {
-  return CompareType<float>(float(q1), float(q2), epsilon);
+  return CompareType<float>(q1.radian, q2.radian, epsilon);
 }
 
 template <>
 inline bool CompareType<Degree>(Degree q1, Degree q2, float epsilon)
 {
-  return CompareType<float>(float(q1), float(q2), epsilon);
+  return CompareType<float>(q1.degree, q2.degree, epsilon);
 }
 
 bool operator==(TimePeriod a, TimePeriod b);
-std::ostream& operator<< (std::ostream& o, const TimePeriod value);
+std::ostream& operator<<( std::ostream& ostream, TimePeriod value );
+std::ostream& operator<<( std::ostream& ostream, Radian angle );
+std::ostream& operator<<( std::ostream& ostream, Degree angle );
 
 /**
  * Test whether two values are equal.
index 3d4d1d5..ddf0356 100644 (file)
@@ -64,20 +64,26 @@ void TestPlatformAbstraction::Resume()
   mTrace.PushCall("Resume", "");
 }
 
-void TestPlatformAbstraction::GetClosestImageSize( const std::string& filename,
-                                                   const ImageAttributes& attributes,
-                                                   Vector2& closestSize)
+ImageDimensions TestPlatformAbstraction::GetClosestImageSize( const std::string& filename,
+                                                              ImageDimensions size,
+                                                              FittingMode::Type scalingMode,
+                                                              SamplingMode::Type samplingMode,
+                                                              bool orientationCorrection )
 {
-  closestSize = mClosestSize;
+  ImageDimensions closestSize = ImageDimensions( mClosestSize.x, mClosestSize.y );
   mTrace.PushCall("GetClosestImageSize", "");
+  return closestSize;
 }
 
-void TestPlatformAbstraction::GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
-                                                   const ImageAttributes& attributes,
-                                                   Vector2& closestSize)
+ImageDimensions TestPlatformAbstraction::GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
+                                                   ImageDimensions size,
+                                                   FittingMode::Type scalingMode,
+                                                   SamplingMode::Type samplingMode,
+                                                   bool orientationCorrection )
 {
-  closestSize = mClosestSize;
+  ImageDimensions closestSize = ImageDimensions( mClosestSize.x, mClosestSize.y );
   mTrace.PushCall("GetClosestImageSize", "");
+  return closestSize;
 }
 
 /**
index a4ec8d3..c3beebe 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <stdint.h>
 #include <cstring>
+#include <dali/public-api/images/image-operations.h>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/set-wrapper.h>
@@ -97,13 +98,23 @@ public:
    */
   virtual void Resume();
 
-  virtual void GetClosestImageSize( const std::string& filename,
-                                    const ImageAttributes& attributes,
-                                    Vector2& closestSize);
+  /**
+   * @copydoc PlatformAbstraction::GetClosestImageSize()
+   */
+  virtual ImageDimensions GetClosestImageSize( const std::string& filename,
+                                                 ImageDimensions size,
+                                                 FittingMode::Type scalingMode,
+                                                 SamplingMode::Type samplingMode,
+                                                 bool orientationCorrection );
 
-  virtual void GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
-                                    const ImageAttributes& attributes,
-                                    Vector2& closestSize);
+  /**
+   * @copydoc PlatformAbstraction::GetClosestImageSize()
+   */
+  virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
+                                               ImageDimensions size,
+                                               FittingMode::Type scalingMode,
+                                               SamplingMode::Type samplingMode,
+                                               bool orientationCorrection );
 
   /**
    * @copydoc PlatformAbstraction::LoadResource()
index 6a35824..b83ff8c 100644 (file)
@@ -169,7 +169,7 @@ int UtcDaliClusterExpandAndCollapseChild(void)
   DALI_TEST_CHECK( cluster.GetExpandedCount() == 0 );
 
   // Transform and restore the child
-  cluster.TransformChild(1, Vector3(10.0f, 10.0f, 1.0f), Vector3(1.0f, 1.0f, 1.0f), Quaternion(0.0f, Vector3::YAXIS), AlphaFunctions::EaseOut, 0.5f);
+  cluster.TransformChild(1, Vector3(10.0f, 10.0f, 1.0f), Vector3(1.0f, 1.0f, 1.0f), Quaternion( Radian(0.0f), Vector3::YAXIS), AlphaFunctions::EaseOut, 0.5f);
   cluster.RestoreChild(1, AlphaFunctions::EaseOut, 0.25f, true);
   END_TEST;
 }
index beeb619..17e8456 100644 (file)
@@ -55,6 +55,15 @@ void TestVoidCallback()
 {
 }
 
+static bool gKeyInputFocusCallBackCalled;
+
+static void TestKeyInputFocusCallback( Control control )
+{
+  tet_infoline(" TestKeyInputFocusCallback");
+
+  gKeyInputFocusCallBackCalled = true;
+}
+
 } // namespace
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -475,3 +484,49 @@ int UtcDaliControlGestureSignals(void)
 
   END_TEST;
 }
+
+int UtcDaliControlImplKeyInputFocusGainedSignal(void)
+{
+  ToolkitTestApplication application;
+
+  Control control = Control::New();
+  Stage::GetCurrent().Add( control );
+
+  gKeyInputFocusCallBackCalled = false;
+  control.KeyInputFocusGainedSignal().Connect(&TestKeyInputFocusCallback);
+
+  application.SendNotification();
+  application.Render();
+
+  control.SetKeyInputFocus();
+
+  DALI_TEST_CHECK( control.HasKeyInputFocus() );
+
+  DALI_TEST_CHECK( gKeyInputFocusCallBackCalled );
+
+  END_TEST;
+}
+
+int UtcDaliControlImplKeyInputFocusLostSignal(void)
+{
+  ToolkitTestApplication application;
+
+  Control control = Control::New();
+  Stage::GetCurrent().Add( control );
+
+  gKeyInputFocusCallBackCalled = false;
+  control.KeyInputFocusLostSignal().Connect(&TestKeyInputFocusCallback);
+
+  application.SendNotification();
+  application.Render();
+
+  control.SetKeyInputFocus();
+
+  DALI_TEST_CHECK( control.HasKeyInputFocus() );
+
+  control.ClearKeyInputFocus();
+
+  DALI_TEST_CHECK( gKeyInputFocusCallBackCalled );
+
+  END_TEST;
+}
index f7926a5..75a2d85 100644 (file)
@@ -218,7 +218,6 @@ int UtcDaliControlImplOnGestureMethods(void)
   // Check gesture actually happens
   {
     DummyControl dummy = DummyControl::New(true);
-    dummy.SetRelayoutEnabled( true );
     dummy.SetSize( Vector2(100.0f, 100.0f ) );
 
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
@@ -279,7 +278,6 @@ int UtcDaliControlImplOnGestureMethods(void)
   // Ensure full code coverage
   {
     DummyControl dummy = DummyControl::New();
-    dummy.SetRelayoutEnabled( true );
     dummy.SetSize( Vector2( 100.0f, 100.0f ) );
 
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
@@ -445,7 +443,6 @@ int UtcDaliControlImplSizeSet(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    dummy.SetRelayoutEnabled( true );
     DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
 
     Stage::GetCurrent().Add(dummy);
@@ -470,7 +467,6 @@ int UtcDaliControlImplSizeSet(void)
   // Ensure full code coverage
   {
     DummyControl dummy = DummyControl::New();
-    dummy.SetRelayoutEnabled( true );
     Stage::GetCurrent().Add(dummy);
 
     Vector2 size(100.0f, 200.0f);
@@ -546,7 +542,6 @@ int UtcDaliControlImplTouchEvent(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    dummy.SetRelayoutEnabled( true );
     DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
 
     dummy.SetSize( Vector2( 100.0f, 100.0f ) );
@@ -571,7 +566,6 @@ int UtcDaliControlImplTouchEvent(void)
   // Ensure full code coverage
   {
     DummyControl dummy = DummyControl::New();
-    dummy.SetRelayoutEnabled( true );
 
     dummy.SetSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
@@ -773,7 +767,6 @@ int UtcDaliControlImplMouseWheelEvent(void)
 
   {
     DummyControl dummy = DummyControl::New( true );
-    dummy.SetRelayoutEnabled( true );
     DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
 
     dummy.SetSize( Vector2( 100.0f, 100.0f ) );
@@ -801,7 +794,6 @@ int UtcDaliControlImplMouseWheelEvent(void)
   // Ensure full code coverage
   {
     DummyControl dummy = DummyControl::New();
-    dummy.SetRelayoutEnabled( true );
 
     dummy.SetSize( Vector2( 100.0f, 100.0f ) );
     dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
index 28690e8..055b122 100644 (file)
@@ -386,28 +386,28 @@ int UtcDaliCubeTransitionWaveEffectStartTransition(void)
   waveEffect.SetTargetImage( imageActor );
   waveEffect.StartTransition(true);
   Wait( application, TRANSITION_DURATION );
-  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  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.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180,  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.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  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.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_180,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  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.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( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_180,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  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.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( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0,  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.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  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.GetCurrentOrientation(), Quaternion( -2.f*Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180,  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.GetCurrentOrientation(), Quaternion( -Math::PI_2,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  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.GetCurrentOrientation(), Quaternion( 0.f,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_180,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  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.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( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_180,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_180,  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.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( cube1.GetCurrentOrientation(), Quaternion( -Dali::ANGLE_90,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_90,  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.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( cube1.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0,  Vector3::YAXIS), FLT_EPISILON, TEST_LOCATION  );
+  DALI_TEST_EQUALS( cube0.GetCurrentOrientation(), Quaternion( Dali::ANGLE_0,  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;
index 9462c28..90b92f6 100644 (file)
@@ -164,7 +164,7 @@ int UtcDaliDepthLayoutSetAndGetTiltAngle(void)
   depthLayout->SetTiltAngle(Degree(25.0f));
 
   // Check whether we get the correct tilt angle
-  DALI_TEST_EQUALS(float(depthLayout->GetTiltAngle()), 25.0f, 0.001f, TEST_LOCATION );
+  DALI_TEST_EQUALS(depthLayout->GetTiltAngle(), Degree(25.0f), 0.001f, TEST_LOCATION );
   END_TEST;
 }
 
@@ -209,7 +209,7 @@ int UtcDaliDepthLayoutSetAndGetItemTiltAngle(void)
   depthLayout->SetItemTiltAngle(Degree(5.0f));
 
   // Check whether we get the correct item's tilt angle
-  DALI_TEST_EQUALS(float(depthLayout->GetItemTiltAngle()), 5.0f, 0.001f, TEST_LOCATION );
+  DALI_TEST_EQUALS(depthLayout->GetItemTiltAngle(), Degree(5.0f), 0.001f, TEST_LOCATION );
   END_TEST;
 }
 
@@ -587,7 +587,7 @@ int UtcDaliDepthLayoutScrollDirection(void)
   application.Render();
 
   Degree deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == 180.0f);
+  DALI_TEST_CHECK(deg.degree == 180.0f);
 
   navigationLayout->SetOrientation(ControlOrientation::Down);
   view.ActivateLayout(0, vec, 0.0f);
@@ -595,7 +595,7 @@ int UtcDaliDepthLayoutScrollDirection(void)
   application.Render();
 
   deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK((deg == 0.0f));
+  DALI_TEST_CHECK((deg.degree == 0.0f));
 
   layout->SetOrientation(ControlOrientation::Left);
   view.ActivateLayout(0, vec, 0.0f);
@@ -603,7 +603,7 @@ int UtcDaliDepthLayoutScrollDirection(void)
   application.Render();
 
   deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == 270.0f);
+  DALI_TEST_CHECK(deg.degree == 270.0f);
 
   navigationLayout->SetOrientation(ControlOrientation::Right);
   view.ActivateLayout(0, vec, 0.0f);
@@ -611,7 +611,7 @@ int UtcDaliDepthLayoutScrollDirection(void)
   application.Render();
 
   deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == 90.0f);
+  DALI_TEST_CHECK(deg.degree == 90.0f);
 
   Stage::GetCurrent().Remove(view);
   END_TEST;
index 7e9d341..6b050bc 100644 (file)
@@ -517,7 +517,7 @@ int UtcDaliGridLayoutScrollDirection(void)
   application.Render();
 
   Degree deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == 0.0f);
+  DALI_TEST_CHECK(deg.degree == 0.0f);
 
   gridLayout->SetOrientation(ControlOrientation::Down);
   view.ActivateLayout(0, vec, 0.0f);
@@ -525,7 +525,7 @@ int UtcDaliGridLayoutScrollDirection(void)
   application.Render();
 
   deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK((deg == 180.0f));
+  DALI_TEST_CHECK((deg.degree == 180.0f));
 
   layout->SetOrientation(ControlOrientation::Left);
   view.ActivateLayout(0, vec, 0.0f);
@@ -533,7 +533,7 @@ int UtcDaliGridLayoutScrollDirection(void)
   application.Render();
 
   deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == 90.f);
+  DALI_TEST_CHECK(deg.degree == 90.f);
 
   gridLayout->SetOrientation(ControlOrientation::Right);
   view.ActivateLayout(0, vec, 0.0f);
@@ -541,7 +541,7 @@ int UtcDaliGridLayoutScrollDirection(void)
   application.Render();
 
   deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == 270.0f);
+  DALI_TEST_CHECK(deg.degree == 270.0f);
 
   Stage::GetCurrent().Remove(view);
   END_TEST;
index 955f19d..443de6f 100644 (file)
@@ -371,7 +371,6 @@ int UtcDaliPageTurnViewEnterLeaveEditMode(void)
   factory.EnableOffscreenRendering( );
 
   PageTurnView pageTurnView = PageTurnLandscapeView::New( factory, PAGE_SIZE );
-  pageTurnView.SetRelayoutEnabled( false );
   pageTurnView.SetPositionInheritanceMode( USE_PARENT_POSITION );
   Stage::GetCurrent().Add( pageTurnView );
 
@@ -423,7 +422,6 @@ int UtcDaliPageTurnViewGetHitActor(void)
   factory.EnableOffscreenRendering( );
 
   PageTurnView pageTurnView = PageTurnPortraitView::New( factory, PAGE_SIZE );
-  pageTurnView.SetRelayoutEnabled( false );
   pageTurnView.SetParentOrigin( ParentOrigin::TOP_LEFT );
   pageTurnView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( pageTurnView );
@@ -460,7 +458,6 @@ int UtcDaliPageTurnViewRefresh(void)
   TestPageFactory factory(application);
   factory.EnableOffscreenRendering( );
   PageTurnView pageTurnView = PageTurnPortraitView::New( factory, PAGE_SIZE );
-  pageTurnView.SetRelayoutEnabled( false );
   pageTurnView.SetParentOrigin( ParentOrigin::TOP_LEFT );
   pageTurnView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   Stage::GetCurrent().Add( pageTurnView );
@@ -501,7 +498,6 @@ int UtcDaliPageTurnViewSignals(void)
   TestPageFactory factory(application);
   Vector2 size = Stage::GetCurrent().GetSize();
   PageTurnView portraitView = PageTurnPortraitView::New( factory, size );
-  portraitView.SetRelayoutEnabled( false );
   portraitView.SetPositionInheritanceMode( USE_PARENT_POSITION );
   Stage::GetCurrent().Add( portraitView );
 
index 0d259d9..4b62045 100644 (file)
@@ -287,8 +287,7 @@ int UtcDaliPushButtonSetImages(void)
   application.SendNotification();
   application.Render();
 
-  // Just check if check box button size changes when a bigger image is set.
-
+  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
   pushButton.SetButtonImage( image01 );
 
   application.SendNotification();
@@ -296,8 +295,8 @@ int UtcDaliPushButtonSetImages(void)
 
   size = pushButton.GetCurrentSize();
 
-  DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
+  DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
+  DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
 
   END_TEST;
 }
index ea4e8d1..2bed81a 100644 (file)
@@ -130,7 +130,7 @@ int UtcDaliSpiralSetAndGetItemSpacing(void)
   spiralLayout->SetItemSpacing(Radian(0.6f));
 
   // Check whether we get the correct item spacing
-  DALI_TEST_EQUALS(spiralLayout->GetItemSpacing(), 0.6f, TEST_LOCATION );
+  DALI_TEST_EQUALS(spiralLayout->GetItemSpacing(), Radian(0.6f), TEST_LOCATION );
   END_TEST;
 }
 
@@ -464,7 +464,7 @@ int UtcDaliSpiralLayoutScrollDirection(void)
   application.Render();
 
   Degree deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == -45.0f);
+  DALI_TEST_CHECK(deg.degree == -45.0f);
 
   navigationLayout->SetOrientation(ControlOrientation::Down);
   view.ActivateLayout(0, vec, 0.0f);
@@ -472,7 +472,7 @@ int UtcDaliSpiralLayoutScrollDirection(void)
   application.Render();
 
   deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK((deg == 180.0f - 45.0f));
+  DALI_TEST_CHECK((deg.degree == 180.0f - 45.0f));
 
   layout->SetOrientation(ControlOrientation::Left);
   view.ActivateLayout(0, vec, 0.0f);
@@ -480,7 +480,7 @@ int UtcDaliSpiralLayoutScrollDirection(void)
   application.Render();
 
   deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == 45.0f);
+  DALI_TEST_CHECK(deg.degree == 45.0f);
 
   navigationLayout->SetOrientation(ControlOrientation::Right);
   view.ActivateLayout(0, vec, 0.0f);
@@ -488,7 +488,7 @@ int UtcDaliSpiralLayoutScrollDirection(void)
   application.Render();
 
   deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg == (270.0f - 45.0f));
+  DALI_TEST_CHECK(deg.degree == (270.0f - 45.0f));
 
   Stage::GetCurrent().Remove(view);
   END_TEST;
index b7e662e..ed651ad 100644 (file)
@@ -197,7 +197,6 @@ int UtcDaliSuperBlurViewGetBlurredImage(void)
   tet_infoline( "UtcDaliSuperBlurViewGetBlurredImage" );
 
   SuperBlurView blurView = SuperBlurView::New( BLUR_LEVELS );
-  blurView.SetRelayoutEnabled( false );
   blurView.SetSize( 100.f,100.f );
   Image inputImage = CreateSolidColorImage( application, Color::GREEN, 100, 100 );
   blurView.SetImage( inputImage );
index dc6b0af..45dd92c 100644 (file)
@@ -70,8 +70,6 @@ static void SetupTableViewAndActors(TableView& tableView, Actor& actor1, Actor&
   tableView = TableView::New( 10, 10 ); // 10 by 10 grid.
   DALI_TEST_CHECK( tableView );
 
-  tableView.SetRelayoutEnabled( true );
-
   Stage::GetCurrent().Add( tableView );
   tableView.SetSize( Dali::Vector2( 100.0f, 100.0f ) );
 
@@ -79,11 +77,8 @@ static void SetupTableViewAndActors(TableView& tableView, Actor& actor1, Actor&
   actor2 = Actor::New();
   actor3 = Actor::New();
 
-  actor1.SetRelayoutEnabled( true );
   actor1.SetSize( Dali::Vector2( 10, 10 ) );
-  actor2.SetRelayoutEnabled( true );
   actor2.SetSize( Dali::Vector2( 10, 10 ) );
-  actor3.SetRelayoutEnabled( true );
   actor3.SetSize( Dali::Vector2( 10, 10 ) );
 
   tableView.AddChild( actor1, TableView::CellPosition( 0, 0 ) );
index 9069525..9c3d4f2 100644 (file)
@@ -38,6 +38,7 @@ namespace
 
 const char* const PROPERTY_NAME_RENDERING_BACKEND = "rendering-backend";
 const char* const PROPERTY_NAME_PLACEHOLDER_TEXT = "placeholder-text";
+const char* const PROPERTY_NAME_TEXT = "text";
 const char* const PROPERTY_NAME_FONT_FAMILY = "font-family";
 const char* const PROPERTY_NAME_FONT_STYLE = "font-style";
 const char* const PROPERTY_NAME_POINT_SIZE = "point-size";
@@ -52,43 +53,128 @@ const char* const PROPERTY_NAME_DECORATION_BOUNDING_BOX = "decoration-bounding-b
 const char* const PROPERTY_NAME_HORIZONTAL_ALIGNMENT = "horizontal-alignment";
 const char* const PROPERTY_NAME_VERTICAL_ALIGNMENT = "vertical-alignment";
 
-static bool gObjectCreatedCallBackCalled;
+} // namespace
 
-static void TestCallback(BaseHandle handle)
+int UtcDaliToolkitTextFieldConstructorP(void)
 {
-  gObjectCreatedCallBackCalled = true;
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldConstructorP");
+  TextField textField;
+  DALI_TEST_CHECK( !textField );
+  END_TEST;
 }
 
-} // namespace
+int UtcDaliToolkitTextFieldNewP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldNewP");
+  TextField textField = TextField::New();
+  DALI_TEST_CHECK( textField );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextFieldDownCastP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldDownCastP");
+  TextField textField1 = TextField::New();
+  BaseHandle object( textField1 );
+
+  TextField textField2 = TextField::DownCast( object );
+  DALI_TEST_CHECK( textField2 );
+
+  TextField textField3 = DownCast< TextField >( object );
+  DALI_TEST_CHECK( textField3 );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextFieldDownCastN(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldDownCastN");
+  BaseHandle uninitializedObject;
+  TextField textField1 = TextField::DownCast( uninitializedObject );
+  DALI_TEST_CHECK( !textField1 );
+
+  TextField textField2 = DownCast< TextField >( uninitializedObject );
+  DALI_TEST_CHECK( !textField2 );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextFieldCopyConstructorP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldCopyConstructorP");
+  TextField textField = TextField::New();
+  textField.SetProperty( TextField::Property::TEXT, "Test" );
+
+  TextField copy( textField );
+  DALI_TEST_CHECK( copy );
+  DALI_TEST_CHECK( copy.GetProperty<std::string>( TextLabel::Property::TEXT ) == textField.GetProperty<std::string>( TextLabel::Property::TEXT ) );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextFieldAssignmentOperatorP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldAssignmentOperatorP");
+  TextField textField = TextField::New();
+  textField.SetProperty( TextField::Property::TEXT, "Test" );
+
+  TextField copy = textField;
+  DALI_TEST_CHECK( copy );
+  DALI_TEST_CHECK( copy.GetProperty<std::string>( TextField::Property::TEXT ) == textField.GetProperty<std::string>( TextField::Property::TEXT ) );
+  END_TEST;
+}
+
+int UtcDaliTextFieldNewP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldNewP");
+  TextField textField = TextField::New();
+  DALI_TEST_CHECK( textField );
+  END_TEST;
+}
 
-int UtcDaliTextFieldNew(void)
+int UtcDaliTextFieldGetPropertyN(void)
 {
   ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldGetPropertyN");
   TextField field = TextField::New();
   DALI_TEST_CHECK( field );
 
-  //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);
+  bool assert = false;
+  try
+  {
+    Property::Value value = field.GetProperty<bool>( 0 );
+  }
+  catch ( ... )
+  {
+    assert = true;
+  }
+  if ( assert )
   {
-    TextField field = TextField::New();
+    tet_result(TET_PASS);
+  }
+  else
+  {
+    tet_result(TET_FAIL);
   }
-  DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
   END_TEST;
 }
 
-int UtcDaliTextFieldGetSetProperty(void)
+// Positive test case for a method
+int UtcDaliTextFieldGetPropertyP(void)
 {
   ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldGetPropertyP");
   TextField field = TextField::New();
   DALI_TEST_CHECK( field );
 
   // Check Property Indices are correct
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_RENDERING_BACKEND ) == TextField::Property::RENDERING_BACKEND );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_PLACEHOLDER_TEXT ) == TextField::Property::PLACEHOLDER_TEXT );
+  DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_TEXT ) == TextField::Property::TEXT );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_FONT_FAMILY ) == TextField::Property::FONT_FAMILY );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_FONT_STYLE ) == TextField::Property::FONT_STYLE );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_POINT_SIZE ) == TextField::Property::POINT_SIZE );
@@ -102,6 +188,16 @@ int UtcDaliTextFieldGetSetProperty(void)
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_DECORATION_BOUNDING_BOX ) == TextField::Property::DECORATION_BOUNDING_BOX );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_HORIZONTAL_ALIGNMENT ) == TextField::Property::HORIZONTAL_ALIGNMENT );
   DALI_TEST_CHECK( field.GetPropertyIndex( PROPERTY_NAME_VERTICAL_ALIGNMENT ) == TextField::Property::VERTICAL_ALIGNMENT );
+  END_TEST;
+}
+
+// Positive test case for a method
+int UtcDaliTextFieldSetPropertyP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldSetPropertyP");
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
 
   // Check exceed policy
   field.SetProperty( TextField::Property::EXCEED_POLICY, TextField::EXCEED_POLICY_CLIP );
@@ -117,9 +213,9 @@ int UtcDaliTextFieldGetSetProperty(void)
   field.SetProperty( TextField::Property::CURSOR_BLINK_DURATION, 10.0f );
   DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::CURSOR_BLINK_DURATION ), 10.0f, TEST_LOCATION );
 
-  // Blink interval gets converted to milliseconds....
+  // Blink interval
   field.SetProperty( TextField::Property::CURSOR_BLINK_INTERVAL, 1.0f );
-  DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::CURSOR_BLINK_INTERVAL ), 1000.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::CURSOR_BLINK_INTERVAL ), 1.0f, TEST_LOCATION );
 
   // Decoration bounding box
   field.SetProperty( TextField::Property::DECORATION_BOUNDING_BOX, Rect<int>( 0, 0, 1, 1 ) );
@@ -128,14 +224,54 @@ int UtcDaliTextFieldGetSetProperty(void)
   // Check that the Alignment properties can be correctly set
   field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "BEGIN" );
   DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::HORIZONTAL_ALIGNMENT ), "BEGIN", TEST_LOCATION );
-  field.SetProperty( TextField::Property::VERTICAL_ALIGNMENT, "TOP" );
-  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::VERTICAL_ALIGNMENT ), "TOP", TEST_LOCATION );
+  field.SetProperty( TextField::Property::VERTICAL_ALIGNMENT, "CENTER" );
+  DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::VERTICAL_ALIGNMENT ), "CENTER", TEST_LOCATION );
+
+  // Set text
+  field.SetProperty( TextField::Property::TEXT, "Setting Text" );
+
+  // Set placeholder text (currently not implemented)
+  field.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "Setting Text" );
+
+  // Set Grab Handle image
+  field.SetProperty( TextField::Property::GRAB_HANDLE_IMAGE, "" );
+
+  END_TEST;
+}
+
+// Negative test case for a method
+int UtcDaliTextFieldSetPropertyN(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldSetPropertyN");
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+
+  bool assert = false;
+  try
+  {
+    field.SetProperty( 0, true );
+  }
+  catch ( ... )
+  {
+    assert = true;
+  }
+  if ( assert )
+  {
+    tet_result(TET_PASS);
+  }
+  else
+  {
+    tet_result(TET_FAIL);
+  }
   END_TEST;
 }
 
-int utcDaliTextFieldBasicRender(void)
+// Positive Basic Text Renderer test
+int utcDaliTextFieldBasicRenderP(void)
 {
   ToolkitTestApplication application;
+  tet_infoline("UtcDaliToolkitTextFieldBasicRenderP");
   TextField field = TextField::New();
   DALI_TEST_CHECK( field );
 
@@ -155,9 +291,13 @@ int utcDaliTextFieldBasicRender(void)
   END_TEST;
 }
 
-int utcDaliTextFieldAtlasRender(void)
+// Positive Atlas Text Renderer test
+int utcDaliTextFieldAtlasRenderP(void)
 {
   ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextFieldAtlasRenderP");
+  StyleManager styleManager = StyleManager::Get();
+  styleManager.RequestDefaultTheme();
   TextField field = TextField::New();
   DALI_TEST_CHECK( field );
 
index 3365605..498c40e 100644 (file)
@@ -49,38 +49,114 @@ const char* const PROPERTY_NAME_SHADOW_OFFSET = "shadow-offset";
 const char* const PROPERTY_NAME_SHADOW_COLOR = "shadow-color";
 const char* const PROPERTY_NAME_UNDERLINE_ENABLED = "underline-enabled";
 const char* const PROPERTY_NAME_UNDERLINE_COLOR = "underline-color";
+const char* const PROPERTY_NAME_UNDERLINE_HEIGHT = "underline-height";
 
-static bool gObjectCreatedCallBackCalled;
+} // namespace
 
-static void TestCallback(BaseHandle handle)
+int UtcDaliToolkitTextLabelConstructorP(void)
 {
-  gObjectCreatedCallBackCalled = true;
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelConstructorP");
+  TextLabel textLabel;
+  DALI_TEST_CHECK( !textLabel );
+  END_TEST;
 }
 
-} // namespace
+int UtcDaliToolkitTextLabelNewP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelNewP");
+  TextLabel textLabel = TextLabel::New( "Test Text" );
+  DALI_TEST_CHECK( textLabel );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextLabelDownCastP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelDownCastP");
+  TextLabel textLabel1 = TextLabel::New();
+  BaseHandle object( textLabel1 );
+
+  TextLabel textLabel2 = TextLabel::DownCast( object );
+  DALI_TEST_CHECK( textLabel2 );
+
+  TextLabel textLabel3 = DownCast< TextLabel >( object );
+  DALI_TEST_CHECK( textLabel3 );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextLabelDownCastN(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelDownCastN");
+  BaseHandle uninitializedObject;
+  TextLabel textLabel1 = TextLabel::DownCast( uninitializedObject );
+  DALI_TEST_CHECK( !textLabel1 );
 
-int UtcDaliTextLabelNew(void)
+  TextLabel textLabel2 = DownCast< TextLabel >( uninitializedObject );
+  DALI_TEST_CHECK( !textLabel2 );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextLabelCopyConstructorP(void)
 {
   ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelCopyConstructorP");
+  TextLabel textLabel = TextLabel::New();
+  textLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
+
+  TextLabel copy( textLabel );
+  DALI_TEST_CHECK( copy );
+  DALI_TEST_CHECK( copy.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) == textLabel.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextLabelAssignmentOperatorP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelAssingmentOperatorP");
+  TextLabel textLabel = TextLabel::New();
+  textLabel.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
+
+  TextLabel copy = textLabel;
+  DALI_TEST_CHECK( copy );
+  DALI_TEST_CHECK( copy.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) == textLabel.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ) );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextLabelGetPropertyN(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelGetPropertyN");
   TextLabel label = TextLabel::New("Test Text");
   DALI_TEST_CHECK( label );
 
-  //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);
+  bool assert = false;
+  try
+  {
+    Property::Value value = label.GetProperty<bool>( 0 );
+  }
+  catch ( ... )
+  {
+    assert = true;
+  }
+  if ( assert )
   {
-    TextLabel label = TextLabel::New("Test Text");
+    tet_result(TET_PASS);
+  }
+  else
+  {
+    tet_result(TET_FAIL);
   }
-  DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
   END_TEST;
 }
 
-int UtcDaliTextLabelGetSetProperty(void)
+// Positive test case for a method
+int UtcDaliToolkitTextLabelGetPropertyP(void)
 {
   ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelGetPropertyP");
   TextLabel label = TextLabel::New("Test Text");
   DALI_TEST_CHECK( label );
 
@@ -98,13 +174,51 @@ int UtcDaliTextLabelGetSetProperty(void)
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_SHADOW_COLOR ) == TextLabel::Property::SHADOW_COLOR );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE_ENABLED ) == TextLabel::Property::UNDERLINE_ENABLED );
   DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE_COLOR ) == TextLabel::Property::UNDERLINE_COLOR );
+  DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_UNDERLINE_HEIGHT) == TextLabel::Property::UNDERLINE_HEIGHT );
 
   // Check label defaults are correct
   DALI_TEST_EQUALS( label.GetProperty<int>( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION );
   DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ), Color::WHITE, TEST_LOCATION );
   DALI_TEST_EQUALS( label.GetProperty<Vector2>( TextLabel::Property::SHADOW_OFFSET ), Vector2::ZERO, TEST_LOCATION );
-  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::SHADOW_COLOR ), Vector4::ZERO, TEST_LOCATION );
+  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::SHADOW_COLOR ), Color::BLACK, TEST_LOCATION );
   DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::UNDERLINE_ENABLED ), false, TEST_LOCATION );
+  DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::UNDERLINE_HEIGHT ), 0.0f, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextLabelSetPropertyN(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelSetPropertyN");
+  TextLabel label = TextLabel::New("Test Text");
+  DALI_TEST_CHECK( label );
+
+  bool assert = false;
+  try
+  {
+    label.SetProperty( 0, true );
+  }
+  catch ( ... )
+  {
+    assert = true;
+  }
+  if ( assert )
+  {
+    tet_result(TET_PASS);
+  }
+  else
+  {
+    tet_result(TET_FAIL);
+  }
+  END_TEST;
+}
+
+int UtcDaliToolkitTextLabelSetPropertyP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelSetPropertyP");
+  TextLabel label = TextLabel::New("Test Text");
+  DALI_TEST_CHECK( label );
 
   // Check that text can be correctly reset
   label.SetProperty( TextLabel::Property::TEXT, "Setting Text" );
@@ -127,6 +241,12 @@ int UtcDaliTextLabelGetSetProperty(void)
   DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::UNDERLINE_ENABLED ), true, TEST_LOCATION );
   label.SetProperty( TextLabel::Property::UNDERLINE_COLOR, Color::RED );
   DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::UNDERLINE_COLOR ), Color::RED, TEST_LOCATION );
+  label.SetProperty( TextLabel::Property::UNDERLINE_HEIGHT, 1.0f );
+  DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::UNDERLINE_HEIGHT ), 1.0f, TEST_LOCATION );
+
+  // Check that text color can be properly set
+  label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::BLUE );
+  DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ), Color::BLUE, TEST_LOCATION );
 
   // Toggle multi-line
   label.SetProperty( TextLabel::Property::MULTI_LINE, true );
@@ -134,9 +254,10 @@ int UtcDaliTextLabelGetSetProperty(void)
   END_TEST;
 }
 
-int utcDaliTextlabelBasicRender(void)
+int UtcDaliToolkitTextlabelBasicRenderP(void)
 {
   ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelBasicRenderP");
   TextLabel label = TextLabel::New("Test Text");
   DALI_TEST_CHECK( label );
 
@@ -157,9 +278,10 @@ int utcDaliTextlabelBasicRender(void)
   END_TEST;
 }
 
-int utcDaliTextlabelAtlasRender(void)
+int UtcDaliToolkitTextlabelAtlasRenderP(void)
 {
   ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitTextLabelAtlasRenderP");
   TextLabel label = TextLabel::New("Test Text");
   DALI_TEST_CHECK( label );
 
index ad124e1..72f32d2 100644 (file)
@@ -305,7 +305,6 @@ int UtcDaliViewOrientationChanged(void)
   try
   {
     View view = View::New();
-    view.SetRelayoutEnabled( true );
     Stage::GetCurrent().Add( view );
 
     view.SetSize( Vector2( 480, 800 ) );
index 83bb423..853c0ae 100644 (file)
@@ -33,19 +33,24 @@ namespace Internal
 
 namespace
 {
-  const Vector2 DEFAULT_ATLAS_SIZE( 512.0f, 512.0f );
-  const Vector2 DEFAULT_BLOCK_SIZE( 32.0f, 32.0f );
+  const uint32_t DEFAULT_ATLAS_WIDTH( 512u );
+  const uint32_t DEFAULT_ATLAS_HEIGHT( 512u );
+  const uint32_t DEFAULT_BLOCK_WIDTH( 16u );
+  const uint32_t DEFAULT_BLOCK_HEIGHT( 16u );
   const uint32_t SINGLE_PIXEL_PADDING( 1u );
   const uint32_t DOUBLE_PIXEL_PADDING( SINGLE_PIXEL_PADDING << 1 );
   const uint32_t FILLED_PIXEL( -1 );
+  Toolkit::AtlasManager::AtlasSize EMPTY_SIZE;
 }
 
 AtlasManager::AtlasManager()
-: mNewAtlasSize( DEFAULT_ATLAS_SIZE ),
-  mNewBlockSize( DEFAULT_BLOCK_SIZE ),
-  mAddFailPolicy( Toolkit::AtlasManager::FAIL_ON_ADD_CREATES ),
+: mAddFailPolicy( Toolkit::AtlasManager::FAIL_ON_ADD_CREATES ),
   mFilledPixel( FILLED_PIXEL )
 {
+  mNewAtlasSize.mWidth = DEFAULT_ATLAS_WIDTH;
+  mNewAtlasSize.mHeight = DEFAULT_ATLAS_HEIGHT;
+  mNewAtlasSize.mBlockWidth = DEFAULT_BLOCK_WIDTH;
+  mNewAtlasSize.mBlockHeight = DEFAULT_BLOCK_HEIGHT;
 }
 
 AtlasManagerPtr AtlasManager::New()
@@ -62,12 +67,13 @@ AtlasManager::~AtlasManager()
   }
 }
 
-Toolkit::AtlasManager::AtlasId AtlasManager::CreateAtlas( SizeType width,
-                                                          SizeType height,
-                                                          SizeType blockWidth,
-                                                          SizeType blockHeight,
-                                                          Pixel::Format pixelformat )
+Toolkit::AtlasManager::AtlasId AtlasManager::CreateAtlas( const Toolkit::AtlasManager::AtlasSize& size, Pixel::Format pixelformat )
 {
+  SizeType width = size.mWidth;
+  SizeType height = size.mHeight;
+  SizeType blockWidth = size.mBlockWidth;
+  SizeType blockHeight = size.mBlockHeight;
+
   // Check to see if the atlas is large enough to hold a single block even ?
   if ( blockWidth > width || blockHeight > height )
   {
@@ -79,10 +85,7 @@ Toolkit::AtlasManager::AtlasId AtlasManager::CreateAtlas( SizeType width,
   Dali::Atlas atlas = Dali::Atlas::New( width, height, pixelformat );
   AtlasDescriptor atlasDescriptor;
   atlasDescriptor.mAtlas = atlas;
-  atlasDescriptor.mWidth = width;
-  atlasDescriptor.mHeight = height;
-  atlasDescriptor.mBlockWidth = blockWidth;
-  atlasDescriptor.mBlockHeight = blockHeight;
+  atlasDescriptor.mSize = size;
   atlasDescriptor.mPixelFormat = pixelformat;
   std::stringstream materialLabel;
   materialLabel << "Atlas Material - ";
@@ -152,7 +155,7 @@ void AtlasManager::Add( const BufferImage& image,
   {
     if ( Toolkit::AtlasManager::FAIL_ON_ADD_CREATES == mAddFailPolicy )
     {
-      SizeType newAtlas = CreateAtlas( mNewAtlasSize.x, mNewAtlasSize.y, mNewBlockSize.x, mNewBlockSize.y, pixelFormat );
+      SizeType newAtlas = CreateAtlas( mNewAtlasSize, pixelFormat );
       if ( !newAtlas-- )
       {
         return;
@@ -237,8 +240,8 @@ AtlasManager::SizeType AtlasManager::CheckAtlas( SizeType atlas,
   if ( pixelFormat == mAtlasList[ atlas ].mPixelFormat )
   {
     // Check to see if there are any unused blocks in this atlas to accomodate our image
-    SizeType blocksInX = mAtlasList[ atlas ].mWidth / mAtlasList[ atlas ].mBlockWidth;
-    SizeType blocksInY = mAtlasList[ atlas ].mHeight / mAtlasList[ atlas ].mBlockHeight;
+    SizeType blocksInX = mAtlasList[ atlas ].mSize.mWidth / mAtlasList[ atlas ].mSize.mBlockWidth;
+    SizeType blocksInY = mAtlasList[ atlas ].mSize.mHeight / mAtlasList[ atlas ].mSize.mBlockHeight;
     totalBlocks = blocksInX * blocksInY;
     SizeType blocksFree = mAtlasList[ atlas ].mNextFreeBlock ?
                           totalBlocks - mAtlasList[ atlas ].mNextFreeBlock + 1u :
@@ -246,8 +249,8 @@ AtlasManager::SizeType AtlasManager::CheckAtlas( SizeType atlas,
 
     // Check to see if the image will fit in these blocks, if not we'll need to create a new atlas
     if ( blocksFree
-         && width + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mBlockWidth
-         && height + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mBlockHeight )
+         && width + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mSize.mBlockWidth
+         && height + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mSize.mBlockHeight )
     {
       blockArea = 1u;
       return ( atlas + 1u );
@@ -273,14 +276,14 @@ void AtlasManager::CreateMesh( SizeType atlas,
   meshData.SetHasColor( true );
   meshData.SetHasTextureCoords( true );
 
-  SizeType blockWidth = mAtlasList[ atlas ].mBlockWidth;
-  SizeType blockHeight = mAtlasList[ atlas ].mBlockHeight;
+  SizeType blockWidth = mAtlasList[ atlas ].mSize.mBlockWidth;
+  SizeType blockHeight = mAtlasList[ atlas ].mSize.mBlockHeight;
 
   float vertexBlockWidth = static_cast< float >( blockWidth );
   float vertexBlockHeight = static_cast< float >( blockHeight );
 
-  SizeType width = mAtlasList[ atlas ].mWidth;
-  SizeType height = mAtlasList[ atlas ].mHeight;
+  SizeType width = mAtlasList[ atlas ].mSize.mWidth;
+  SizeType height = mAtlasList[ atlas ].mSize.mHeight;
 
   SizeType atlasWidthInBlocks = width / blockWidth;
 
@@ -581,9 +584,9 @@ void AtlasManager::UploadImage( const BufferImage& image,
     return;
   }
 
-  SizeType atlasBlockWidth = mAtlasList[ atlas ].mBlockWidth;
-  SizeType atlasBlockHeight = mAtlasList[ atlas ].mBlockHeight;
-  SizeType atlasWidthInBlocks = mAtlasList[ atlas ].mWidth / mAtlasList[ atlas ].mBlockWidth;
+  SizeType atlasBlockWidth = mAtlasList[ atlas ].mSize.mBlockWidth;
+  SizeType atlasBlockHeight = mAtlasList[ atlas ].mSize.mBlockHeight;
+  SizeType atlasWidthInBlocks = mAtlasList[ atlas ].mSize.mWidth / mAtlasList[ atlas ].mSize.mBlockWidth;
 
   SizeType block = desc.mBlocksList[ 0 ];
   SizeType blockX = block % atlasWidthInBlocks;
@@ -624,7 +627,7 @@ void AtlasManager::UploadImage( const BufferImage& image,
   }
 
   // Blit bottom strip
-  if ( blockOffsetY + height + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mHeight )
+  if ( blockOffsetY + height + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mSize.mHeight )
   {
     if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mHorizontalStrip,
                                              blockOffsetX,
@@ -635,7 +638,7 @@ void AtlasManager::UploadImage( const BufferImage& image,
   }
 
   // Blit right strip
-  if ( blockOffsetX + width + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mWidth )
+  if ( blockOffsetX + width + DOUBLE_PIXEL_PADDING <= mAtlasList[ atlas ].mSize.mWidth )
   {
     if ( !mAtlasList[ atlas ].mAtlas.Upload( mAtlasList[ atlas ].mVerticalStrip,
                                              blockOffsetX + width + SINGLE_PIXEL_PADDING,
@@ -656,13 +659,13 @@ void AtlasManager::GenerateMeshData( ImageId id,
   SizeType width = mImageList[ imageId ].mImageWidth;
   SizeType height = mImageList[ imageId ].mImageHeight;
 
-  SizeType widthInBlocks = width / mAtlasList[ atlas ].mBlockWidth;
-  if ( width % mAtlasList[ atlas ].mBlockWidth )
+  SizeType widthInBlocks = width / mAtlasList[ atlas ].mSize.mBlockWidth;
+  if ( width % mAtlasList[ atlas ].mSize.mBlockWidth )
   {
     widthInBlocks++;
   }
-  SizeType heightInBlocks = height / mAtlasList[ atlas ].mBlockHeight;
-  if ( height % mAtlasList[ atlas ].mBlockHeight )
+  SizeType heightInBlocks = height / mAtlasList[ atlas ].mSize.mBlockHeight;
+  if ( height % mAtlasList[ atlas ].mSize.mBlockHeight )
   {
     heightInBlocks++;
   }
@@ -704,7 +707,7 @@ bool AtlasManager::Remove( ImageId id )
     return false;
   }
 
-  if ( 1u == --mImageList[ imageId ].mCount )
+  if ( 2u > --mImageList[ imageId ].mCount )
   {
     // 'Remove the blocks' from this image and add to the atlas' freelist
     removed = true;
@@ -730,37 +733,20 @@ AtlasManager::AtlasId AtlasManager::GetAtlas( ImageId id ) const
   }
 }
 
-void AtlasManager::SetNewAtlasSize( const Vector2& size,
-                                    const Vector2& blockSize )
+void AtlasManager::SetNewAtlasSize( const Toolkit::AtlasManager::AtlasSize& size )
 {
   mNewAtlasSize = size;
-  mNewBlockSize = blockSize;
-}
-
-Vector2 AtlasManager::GetBlockSize( AtlasId atlas )
-{
-  if ( atlas && atlas <= mAtlasList.size() )
-  {
-  return Vector2( static_cast< float >( mAtlasList[ atlas - 1u ].mBlockWidth ),
-                  static_cast< float >( mAtlasList[ atlas - 1u ].mBlockHeight) );
-  }
-  else
-  {
-    return Vector2::ZERO;
-  }
+  mNewAtlasSize.mBlockWidth += DOUBLE_PIXEL_PADDING;
+  mNewAtlasSize.mBlockHeight += DOUBLE_PIXEL_PADDING;
 }
 
-Vector2 AtlasManager::GetAtlasSize( AtlasId atlas )
+const Toolkit::AtlasManager::AtlasSize& AtlasManager::GetAtlasSize( AtlasId atlas )
 {
-  if ( atlas && atlas <= mAtlasList.size() )
+  if ( atlas && atlas-- <= mAtlasList.size() )
   {
-    return Vector2( static_cast< float >( mAtlasList[ atlas - 1u ].mWidth ),
-                    static_cast< float >( mAtlasList[ atlas - 1u ].mHeight ) );
-  }
-  else
-  {
-    return Vector2::ZERO;
+    return mAtlasList[ atlas ].mSize;
   }
+  return EMPTY_SIZE;
 }
 
 AtlasManager::SizeType AtlasManager::GetFreeBlocks( AtlasId atlas ) const
@@ -768,17 +754,24 @@ AtlasManager::SizeType AtlasManager::GetFreeBlocks( AtlasId atlas ) const
   if ( atlas && atlas <= mAtlasList.size() )
   {
     uint32_t index = atlas - 1u;
-    uint32_t width = mAtlasList[ index ].mWidth;
-    uint32_t height = mAtlasList[ index ].mHeight;
-    uint32_t blockWidth = mAtlasList[ index ].mBlockWidth;
-    uint32_t blockHeight = mAtlasList[ index ].mBlockHeight;
+    uint32_t width = mAtlasList[ index ].mSize.mWidth;
+    uint32_t height = mAtlasList[ index ].mSize.mHeight;
+    uint32_t blockWidth = mAtlasList[ index ].mSize.mBlockWidth;
+    uint32_t blockHeight = mAtlasList[ index ].mSize.mBlockHeight;
 
     SizeType widthInBlocks = width / blockWidth;
     SizeType heightInBlocks = height / blockHeight;
     uint32_t blockCount = widthInBlocks * heightInBlocks;
 
     // Check free previously unallocated blocks and any free blocks
-    blockCount -= mAtlasList[ index ].mNextFreeBlock - mAtlasList[ index ].mFreeBlocksList.Size();
+    if ( mAtlasList[ index ].mNextFreeBlock )
+    {
+      blockCount -= mAtlasList[ index ].mNextFreeBlock -1u - mAtlasList[ index ].mFreeBlocksList.Size();
+    }
+    else
+    {
+      blockCount = mAtlasList[ index ].mFreeBlocksList.Size();
+    }
     return blockCount;
   }
   else
@@ -813,23 +806,15 @@ void AtlasManager::GetMetrics( Toolkit::AtlasManager::Metrics& metrics )
 
   for ( uint32_t i = 0; i < atlasCount; ++i )
   {
-    SizeType width = mAtlasList[ i ].mWidth;
-    SizeType height = mAtlasList[ i ].mHeight;
-    SizeType blockWidth = mAtlasList[ i ].mBlockWidth;
-    SizeType blockHeight = mAtlasList[ i ].mBlockHeight;
-
-    entry.mWidth = width;
-    entry.mHeight = height;
-    entry.mBlockWidth = blockWidth;
-    entry.mBlockHeight = blockHeight;
-    entry.mTotalBlocks = ( width / blockWidth ) * ( height / blockHeight );
+    entry.mSize = mAtlasList[ i ].mSize;
+    entry.mTotalBlocks = ( entry.mSize.mWidth / entry.mSize.mBlockWidth ) * ( entry.mSize.mHeight / entry.mSize.mBlockHeight );
     uint32_t reuseBlocks = mAtlasList[ i ].mFreeBlocksList.Size();
     entry.mBlocksUsed = mAtlasList[ i ].mNextFreeBlock ? mAtlasList[ i ].mNextFreeBlock - reuseBlocks - 1u: entry.mTotalBlocks - reuseBlocks;
     entry.mPixelFormat = GetPixelFormat( i + 1 );
 
       metrics.mAtlasMetrics.PushBack( entry );
 
-    uint32_t size = width * height;
+    uint32_t size = entry.mSize.mWidth * entry.mSize.mHeight;
     if ( entry.mPixelFormat == Pixel::BGRA8888 )
     {
       size <<= 2;
index 0656da7..ef078f8 100644 (file)
@@ -60,10 +60,7 @@ public:
   struct AtlasDescriptor
   {
     Dali::Atlas mAtlas;                                                 // atlas image
-    SizeType mWidth;                                                    // width of atlas
-    SizeType mHeight;                                                   // height of atlas
-    SizeType mBlockWidth;                                               // width of a block in atlas
-    SizeType mBlockHeight;                                              // height of a block in atlas
+    Toolkit::AtlasManager::AtlasSize mSize;                             // size of atlas
     Pixel::Format mPixelFormat;                                         // pixel format used by atlas
     BufferImage mHorizontalStrip;                                       // Image used to pad upload
     BufferImage mVerticalStrip;                                         // Image used to pad upload
@@ -95,11 +92,7 @@ public:
   /**
    * @copydoc: Toolkit::AtlasManager::CreateAtlas
    */
-  AtlasId CreateAtlas( SizeType width,
-                       SizeType height,
-                       SizeType blockWidth,
-                       SizeType blockHeight,
-                       Pixel::Format pixelformat );
+  AtlasId CreateAtlas( const Toolkit::AtlasManager::AtlasSize& size, Pixel::Format pixelformat );
 
   /**
    * @copydoc Toolkit::AtlasManager::SetAddPolicy
@@ -152,13 +145,12 @@ public:
   /**
    * @copydoc Toolkit::AtlasManager::SetNewAtlasSize
    */
-  void SetNewAtlasSize( const Vector2& size,
-                        const Vector2& blockSize );
+  void SetNewAtlasSize( const Toolkit::AtlasManager::AtlasSize& size );
 
   /**
    * @copydoc Toolkit::AtlasManager::GetAtlasSize
    */
-  Vector2 GetAtlasSize( AtlasId atlas );
+  const Toolkit::AtlasManager::AtlasSize& GetAtlasSize( AtlasId atlas );
 
   /**
    * @copydoc Toolkit::AtlasManager::GetBlockSize
@@ -215,8 +207,7 @@ private:
 
   void PrintMeshData( const MeshData& meshData );
 
-  Vector2 mNewAtlasSize;
-  Vector2 mNewBlockSize;
+  Toolkit::AtlasManager::AtlasSize mNewAtlasSize;
   Toolkit::AtlasManager::AddFailPolicy mAddFailPolicy;
   uint32_t mFilledPixel;
 };
index 6d21245..e46eb1d 100644 (file)
@@ -45,13 +45,9 @@ AtlasManager::AtlasManager(Internal::AtlasManager *impl)
 {
 }
 
-AtlasManager::AtlasId AtlasManager::CreateAtlas( SizeType width,
-                                                 SizeType height,
-                                                 SizeType blockWidth,
-                                                 SizeType blockHeight,
-                                                 Pixel::Format pixelformat )
+AtlasManager::AtlasId AtlasManager::CreateAtlas( const AtlasManager::AtlasSize& size, Pixel::Format pixelformat )
 {
-  return GetImplementation(*this).CreateAtlas( width, height, blockWidth, blockHeight, pixelformat );
+  return GetImplementation(*this).CreateAtlas( size, pixelformat );
 }
 
 void AtlasManager::SetAddPolicy( AddFailPolicy policy )
@@ -105,12 +101,7 @@ AtlasManager::AtlasId AtlasManager::GetAtlas( ImageId id )
   return GetImplementation(*this).GetAtlas( id );
 }
 
-Vector2 AtlasManager::GetBlockSize( AtlasId atlas )
-{
-  return GetImplementation(*this).GetBlockSize( atlas );
-}
-
-Vector2 AtlasManager::GetAtlasSize( AtlasId atlas )
+const AtlasManager::AtlasSize& AtlasManager::GetAtlasSize( AtlasId atlas )
 {
   return GetImplementation(*this).GetAtlasSize( atlas );
 }
@@ -120,10 +111,9 @@ AtlasManager::SizeType AtlasManager::GetFreeBlocks( AtlasId atlas )
   return GetImplementation(*this).GetFreeBlocks( atlas );
 }
 
-void AtlasManager::SetNewAtlasSize( const Vector2& size,
-                                    const Vector2& blockSize )
+void AtlasManager::SetNewAtlasSize( const AtlasSize& size )
 {
-  GetImplementation(*this).SetNewAtlasSize( size, blockSize );
+  GetImplementation(*this).SetNewAtlasSize( size );
 }
 
 AtlasManager::SizeType AtlasManager::GetAtlasCount() const
index 9263ea4..5fc10d0 100644 (file)
@@ -160,16 +160,21 @@ public:
   typedef SizeType ImageId;
   static const bool MESH_OPTIMIZE = true;
 
+  struct AtlasSize
+  {
+    SizeType mWidth;              // width of the atlas in pixels
+    SizeType mHeight;             // height of the atlas in pixels
+    SizeType mBlockWidth;         // width of a block in pixels
+    SizeType mBlockHeight;        // height of a block in pixels
+  };
+
   /**
    * Metrics structures to describe Atlas Manager state
    *
    */
   struct AtlasMetricsEntry
   {
-    SizeType mWidth;                 // width of the atlas in pixels
-    SizeType mHeight;;               // height of the atlas in pixels
-    SizeType mBlockWidth;            // width of a block in pixels
-    SizeType mBlockHeight;           // height of a block in pixels
+    AtlasSize mSize;                 // size of atlas and blocks
     SizeType mBlocksUsed;            // number of blocks used in the atlas
     SizeType mTotalBlocks;           // total blocks used by atlas
     Pixel::Format mPixelFormat;      // pixel format of the atlas
@@ -225,19 +230,12 @@ public:
   /**
    * @brief Create a blank atlas of specific dimensions and pixel format with a certain block size
    *
-   * @param[in] width desired atlas width in pixels
-   * @param[in] height desired atlas height in pixels
-   * @param[in] blockWidth block width to use in atlas in pixels
-   * @param[in] blockHeight block height to use in atlas in pixels
+   * @param[in] size desired atlas dimensions
    * @param[in] pixelformat format of a pixel in atlas
    *
    * @return atlas Id
    */
-  AtlasId CreateAtlas(  SizeType width,
-                        SizeType height,
-                        SizeType blockWidth,
-                        SizeType blockHeight,
-                        Pixel::Format pixelformat = Pixel::RGBA8888 );
+  AtlasId CreateAtlas( const AtlasSize& size, Pixel::Format pixelformat = Pixel::RGBA8888 );
 
   /**
    * @brief Set the policy on failure to add an image to an atlas
@@ -322,24 +320,14 @@ public:
    * @return Atlas Id
    */
   AtlasId GetAtlas( ImageId id );
-
-  /**
-   * @brief Get the size of the blocks used in an atlas
-   *
-   * @param[in] atlas AtlasId
-   *
-   * @return width and height of the blocks used
-   */
-  Vector2 GetBlockSize( AtlasId atlas );
-
   /**
    * @brief Get the current size of an atlas
    *
    * @param[in] atlas AtlasId
    *
-   * @return width and height of the atlas
+   * @return AtlasSize structure for the atlas
    */
-  Vector2 GetAtlasSize( AtlasId atlas );
+  const AtlasSize& GetAtlasSize( AtlasId atlas );
 
   /**
    * @brief Get the number of blocks available in an atlas
@@ -353,12 +341,11 @@ public:
   /**
    * @brief Sets the pixel area of any new atlas and also the individual block size
    *
-   * @param[in] size pixel area of atlas
+   * @param[in] size Atlas size structure
    *
    * @param blockSize pixel area in atlas for a block
    */
-  void SetNewAtlasSize( const Vector2& size,
-                        const Vector2& blockSize );
+  void SetNewAtlasSize( const AtlasSize& size );
 
   /**
    * @brief Get the number of atlases created
index 9713587..16d0cab 100644 (file)
@@ -548,7 +548,7 @@ void Alignment::OnRelayout( const Vector2& size, RelayoutContainer& container )
 }
 
 Alignment::Alignment( Toolkit::Alignment::Type horizontal, Toolkit::Alignment::Type vertical )
-: Control( CONTROL_BEHAVIOUR_NONE ),
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
   mHorizontal( horizontal ),
   mVertical( vertical ),
   mScaling( Toolkit::Alignment::ScaleNone ),
index df9b6ed..ac56224 100644 (file)
@@ -126,7 +126,7 @@ const char* const COMPOSITE_FRAGMENT_SOURCE =
 
 
 BloomView::BloomView()
-  : Control( CONTROL_BEHAVIOUR_NONE )
+  : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) )
   , mBlurNumSamples(BLOOM_GAUSSIAN_BLUR_VIEW_DEFAULT_NUM_SAMPLES)
   , mBlurBellCurveWidth(BLOOM_GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_BELL_CURVE_WIDTH)
   , mPixelFormat(BLOOM_GAUSSIAN_BLUR_VIEW_DEFAULT_RENDER_TARGET_PIXEL_FORMAT)
@@ -148,7 +148,7 @@ BloomView::BloomView()
 
 BloomView::BloomView( const unsigned int blurNumSamples, const float blurBellCurveWidth, const Pixel::Format renderTargetPixelFormat,
                                     const float downsampleWidthScale, const float downsampleHeightScale)
-  : Control( CONTROL_BEHAVIOUR_NONE )
+  : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) )
   , mBlurNumSamples(blurNumSamples)
   , mBlurBellCurveWidth(blurBellCurveWidth)
   , mPixelFormat(renderTargetPixelFormat)
index 1306475..0661494 100644 (file)
@@ -39,7 +39,7 @@ BubbleEmitter::BubbleEmitter( const Vector2& movementArea,
                               Image shapeImage,
                               unsigned int maximumNumberOfBubble,
                               const Vector2& bubbleSizeRange )
-: Control( REQUIRES_TOUCH_EVENTS ),
+: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),
   mMovementArea( movementArea ),
   mShapeImage( shapeImage ),
   mTotalNumOfBubble( maximumNumberOfBubble ),
index d1f30bc..40ff196 100644 (file)
@@ -74,23 +74,23 @@ BaseHandle 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                  )
-
-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         )
-
-DALI_ACTION_REGISTRATION(   Button, "button-click",                          ACTION_BUTTON_CLICK          )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "disabled",                     BOOLEAN, DISABLED                     )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "auto-repeating",               BOOLEAN, AUTO_REPEATING               )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "initial-auto-repeating-delay", FLOAT,   INITIAL_AUTO_REPEATING_DELAY )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "next-auto-repeating-delay",    FLOAT,   NEXT_AUTO_REPEATING_DELAY    )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "togglable",                    BOOLEAN, TOGGLABLE                    )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "selected",                     BOOLEAN, SELECTED                     )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "normal-state-actor",           MAP,     NORMAL_STATE_ACTOR           )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "selected-state-actor",         MAP,     SELECTED_STATE_ACTOR         )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "disabled-state-actor",         MAP,     DISABLED_STATE_ACTOR         )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "label-actor",                  MAP,     LABEL_ACTOR                  )
+
+DALI_SIGNAL_REGISTRATION(   Toolkit, Button, "pressed",                               SIGNAL_PRESSED               )
+DALI_SIGNAL_REGISTRATION(   Toolkit, Button, "released",                              SIGNAL_RELEASED              )
+DALI_SIGNAL_REGISTRATION(   Toolkit, Button, "clicked",                               SIGNAL_CLICKED               )
+DALI_SIGNAL_REGISTRATION(   Toolkit, Button, "state-changed",                         SIGNAL_STATE_CHANGED         )
+
+DALI_ACTION_REGISTRATION(   Toolkit, Button, "button-click",                          ACTION_BUTTON_CLICK          )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -674,6 +674,8 @@ void Button::SetButtonImage( Actor image )
   }
 
   OnButtonImageSet();
+
+  RelayoutRequest();
 }
 
 Actor Button::GetButtonImage() const
@@ -709,6 +711,8 @@ void Button::SetSelectedImage( Actor image )
   }
 
   OnSelectedImageSet();
+
+  RelayoutRequest();
 }
 
 Actor Button::GetSelectedImage() const
@@ -742,6 +746,8 @@ void Button::SetBackgroundImage( Actor image )
   }
 
   OnBackgroundImageSet();
+
+  RelayoutRequest();
 }
 
 Actor Button::GetBackgroundImage() const
@@ -782,6 +788,8 @@ void Button::SetSelectedBackgroundImage( Actor image )
   }
 
   OnSelectedBackgroundImageSet();
+
+  RelayoutRequest();
 }
 
 Actor Button::GetSelectedBackgroundImage() const
index cf34f85..f07eb32 100644 (file)
@@ -113,7 +113,6 @@ void PushButton::OnLabelSet()
   {
     label.SetAnchorPoint( AnchorPoint::CENTER );
     label.SetParentOrigin( ParentOrigin::CENTER );
-    label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
 
     Toolkit::TextLabel textLabel = Toolkit::TextLabel::DownCast( label );
     if( textLabel )
@@ -122,68 +121,44 @@ void PushButton::OnLabelSet()
       textLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
       textLabel.SetProperty( Toolkit::TextLabel::Property::MULTI_LINE, true );
     }
+
+    ConfigureSizeNegotiation();
   }
 }
 
 void PushButton::OnButtonImageSet()
 {
-  Actor& buttonImage = GetButtonImage();
-
-  buttonImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-
-  buttonImage.RelayoutRequestTree();
-
+  ConfigureSizeNegotiation();
   RelayoutRequest();
 }
 
 void PushButton::OnSelectedImageSet()
 {
-  Actor& selectedImage = GetSelectedImage();
-
-  selectedImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-
-  selectedImage.RelayoutRequestTree();
-
+  ConfigureSizeNegotiation();
   RelayoutRequest();
 }
 
 void PushButton::OnBackgroundImageSet()
 {
-  Actor& backgroundImage = GetBackgroundImage();
-
-  backgroundImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-
-  backgroundImage.RelayoutRequestTree();
-
+  ConfigureSizeNegotiation();
   RelayoutRequest();
 }
 
 void PushButton::OnSelectedBackgroundImageSet()
 {
-  Actor& selectedBackgroundImage = GetSelectedBackgroundImage();
-
-  selectedBackgroundImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+  ConfigureSizeNegotiation();
+  RelayoutRequest();
 }
 
 void PushButton::OnDisabledImageSet()
 {
-  Actor& disabledImage = GetDisabledImage();
-
-  disabledImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-
-  disabledImage.RelayoutRequestTree();
-
+  ConfigureSizeNegotiation();
   RelayoutRequest();
 }
 
 void PushButton::OnDisabledBackgroundImageSet()
 {
-  Actor& disabledBackgroundImage = GetDisabledBackgroundImage();
-
-  disabledBackgroundImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-
-  disabledBackgroundImage.RelayoutRequestTree();
-
+  ConfigureSizeNegotiation();
   RelayoutRequest();
 }
 
@@ -578,27 +553,6 @@ void PushButton::OnControlSizeSet( const Vector3& targetSize )
   }
 }
 
-Vector3 PushButton::GetNaturalSize()
-{
-  Vector3 size;
-
-  // Check Image and Background image and use the largest size as the control's Natural size.
-  SizeOfActorIfLarger( GetButtonImage(), size );
-  SizeOfActorIfLarger( GetBackgroundImage(), size );
-
-  // If label, test against it's size
-  Toolkit::TextLabel label = Toolkit::TextLabel::DownCast( GetLabel() );
-  if( label )
-  {
-    Vector3 labelSize = label.GetNaturalSize();
-
-    size.width  = std::max( size.width,  labelSize.width  + TEXT_PADDING * 2.0f );
-    size.height = std::max( size.height, labelSize.height + TEXT_PADDING * 2.0f );
-  }
-
-  return size;
-}
-
 void PushButton::StartTransitionAnimation()
 {
   if( mTransitionAnimation )
@@ -659,6 +613,103 @@ void PushButton::TransitionAnimationFinished( Dali::Animation& source )
   StopTransitionAnimation();
 }
 
+Vector3 PushButton::GetNaturalSize()
+{
+  Vector3 size;
+
+  // If label, test against it's size
+  Toolkit::TextLabel label = Toolkit::TextLabel::DownCast( GetLabel() );
+  if( label )
+  {
+    size.width  = std::max( size.width,  label.GetRelayoutSize( Dimension::WIDTH ) );
+    size.height = std::max( size.height, label.GetRelayoutSize( Dimension::HEIGHT ) );
+  }
+  else
+  {
+    // Check Image and Background image and use the largest size as the control's Natural size.
+    SizeOfActorIfLarger( GetButtonImage(), size );
+    SizeOfActorIfLarger( GetBackgroundImage(), size );
+  }
+
+  return size;
+}
+
+void PushButton::OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension )
+{
+  ConfigureSizeNegotiation();
+}
+
+void PushButton::ConfigureSizeNegotiation()
+{
+  ActorContainer images;
+  images.reserve( 7 );
+
+  images.push_back( GetButtonImage() );
+  images.push_back( GetSelectedImage() );
+  images.push_back( GetSelectedBackgroundImage() );
+  images.push_back( GetBackgroundImage() );
+  images.push_back( GetDisabledImage() );
+  images.push_back( GetDisabledSelectedImage() );
+  images.push_back( GetDisabledBackgroundImage() );
+
+  Actor label = GetLabel();
+
+  for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
+  {
+    ConfigureSizeNegotiationDimension( static_cast< Dimension::Type >( 1 << i ), images, label );
+  }
+
+  if( label )
+  {
+    label.SetPadding( Padding( TEXT_PADDING, TEXT_PADDING, TEXT_PADDING, TEXT_PADDING) );
+  }
+}
+
+void PushButton::ConfigureSizeNegotiationDimension( Dimension::Type dimension, const ActorContainer& images, Actor& label )
+{
+  ResizePolicy::Type imageResizePolicy = ResizePolicy::FILL_TO_PARENT;
+  ResizePolicy::Type labelResizePolicy = ResizePolicy::FILL_TO_PARENT;
+
+  switch( Self().GetResizePolicy( dimension ) )
+  {
+    case ResizePolicy::FIT_TO_CHILDREN:
+    {
+      imageResizePolicy = labelResizePolicy = ResizePolicy::USE_NATURAL_SIZE;
+      break;
+    }
+    case ResizePolicy::USE_NATURAL_SIZE:
+    {
+      if( label )
+      {
+        labelResizePolicy = ResizePolicy::USE_NATURAL_SIZE;
+      }
+      else
+      {
+        imageResizePolicy = ResizePolicy::USE_NATURAL_SIZE;
+      }
+      break;
+    }
+    default:
+    {
+      break;
+    }
+  }
+
+  if( label )
+  {
+    label.SetResizePolicy( labelResizePolicy, dimension );
+  }
+
+  for( ActorConstIter it = images.begin(), itEnd = images.end(); it != itEnd; ++it )
+  {
+    Actor actor = *it;
+    if( actor )
+    {
+      actor.SetResizePolicy( imageResizePolicy, dimension );
+    }
+  }
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index 3eddddc..7a23474 100644 (file)
@@ -137,9 +137,14 @@ private: // From Control
   virtual void OnControlSizeSet( const Vector3& targetSize );
 
   /**
-   * @copydoc Toolkit::Control::GetNaturalSize()
+   * @copydoc Toolkit::Control::GetNaturalSize
    */
-  virtual Vector3 GetNaturalSize();
+  Vector3 GetNaturalSize();
+
+  /**
+   * @copydoc Toolkit::Control::OnSetResizePolicy
+   */
+  virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension );
 
 private:
 
@@ -172,6 +177,20 @@ private:
    */
   void FadeOutImage( Actor& image, float opacity = 1.f, Vector3 scale = Vector3( 1.f, 1.f, 1.f ) );
 
+  /**
+   * @brief Custom configuration for size negotiation
+   */
+  void ConfigureSizeNegotiation();
+
+  /**
+   * @brief Configure size negotiation for a given dimension
+   *
+   * @param[in] dimension The dimension to configure
+   * @param[in] images The list of images to configure
+   * @param[in] label The text label to configure
+   */
+  void ConfigureSizeNegotiationDimension( Dimension::Type dimension, const ActorContainer& images, Actor& label );
+
   // slots
 
   /**
index d43d63a..73d13c8 100644 (file)
@@ -52,9 +52,9 @@ BaseHandle 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 )
+DALI_ACTION_REGISTRATION( Toolkit, Cluster, "expand",    ACTION_EXPAND    )
+DALI_ACTION_REGISTRATION( Toolkit, Cluster, "collapse",  ACTION_COLLAPSE  )
+DALI_ACTION_REGISTRATION( Toolkit, Cluster, "transform", ACTION_TRANSFORM )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -82,7 +82,7 @@ Dali::Toolkit::Cluster Cluster::New(Toolkit::ClusterStyle& style)
 }
 
 Cluster::Cluster(Toolkit::ClusterStyle& style)
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | DISABLE_SIZE_NEGOTIATION ) ),
   mClusterStyle(style),
   mExpandedCount(0)
 {
@@ -285,7 +285,7 @@ void Cluster::ExpandChild( unsigned int index )
       const float angle = (rand()%360) * Math::PI / 180.0f;
       Vector3 position(sin(angle) * length, -cos(angle) * length, zOffset);
       const float scale(1.2f);
-      const float rotate = ((rand()%30) - 15) * Math::PI / 180.0f;
+      const Radian rotate( Degree( (rand()%30) - 15 ) );
 
       position += childInfo.mActor.GetCurrentPosition();
 
@@ -521,7 +521,7 @@ void Cluster::DoTransformAction(const PropertyValueContainer& attributes)
   unsigned int index = attributes[0].Get<float>();
   Vector3 position;
   Vector3 scale(Vector3::ONE);
-  Quaternion rotation(0.0f, Vector3::ZAXIS);
+  Quaternion rotation( Dali::ANGLE_0, Vector3::ZAXIS );
 
   DALI_ASSERT_ALWAYS(attributes[1].GetType() == Property::VECTOR3);
   attributes[1].Get(position);
index 4974ce1..16dd5ea 100644 (file)
@@ -473,7 +473,7 @@ void ClusterStyleRandom::ApplyStyle(Actor child, unsigned int index, AlphaFuncti
   Apply( child,
          FirstOrderEquation( GetClusterSize(), Vector3(position.x, position.y, 0.0f), Vector3(0.0f, 0.0f, depthPropertyValue) ),
          FirstOrderEquation( GetClusterSize(), Vector3::ONE * size),
-         Quaternion(rotation, Vector3::ZAXIS),
+         Quaternion( Radian( rotation ), Vector3::ZAXIS ),
          Vector3::ONE,
          alpha,
          durationSeconds);
index 21b6e23..e0a5ea5 100644 (file)
@@ -112,7 +112,7 @@ Toolkit::EffectsView EffectsView::New()
 }
 
 EffectsView::EffectsView()
-: Control( CONTROL_BEHAVIOUR_NONE ),
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
   mEffectType( Toolkit::EffectsView::INVALID_TYPE ),
   mPixelFormat( EFFECTS_VIEW_DEFAULT_PIXEL_FORMAT ),
   mSpread(0.0f),
index 8a38163..f233cf4 100644 (file)
@@ -116,7 +116,7 @@ const char* const GAUSSIAN_BLUR_FRAGMENT_SOURCE =
 
 
 GaussianBlurView::GaussianBlurView()
-  : Control( CONTROL_BEHAVIOUR_NONE )
+  : Control( ControlBehaviour( DISABLE_SIZE_NEGOTIATION ) )
   , mNumSamples(GAUSSIAN_BLUR_VIEW_DEFAULT_NUM_SAMPLES)
   , mBlurBellCurveWidth( 0.001f )
   , mPixelFormat(GAUSSIAN_BLUR_VIEW_DEFAULT_RENDER_TARGET_PIXEL_FORMAT)
@@ -138,7 +138,7 @@ GaussianBlurView::GaussianBlurView()
 GaussianBlurView::GaussianBlurView( const unsigned int numSamples, const float blurBellCurveWidth, const Pixel::Format renderTargetPixelFormat,
                                     const float downsampleWidthScale, const float downsampleHeightScale,
                                     bool blurUserImage)
-  : Control( NO_SIZE_NEGOTIATION )
+  : Control( ControlBehaviour( DISABLE_SIZE_NEGOTIATION ) )
   , mNumSamples(numSamples)
   , mBlurBellCurveWidth( 0.001f )
   , mPixelFormat(renderTargetPixelFormat)
@@ -266,14 +266,12 @@ void GaussianBlurView::OnInitialize()
 
   // Create an ImageActor for performing a horizontal blur on the texture
   mImageActorHorizBlur = ImageActor::New();
-  mImageActorHorizBlur.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   mImageActorHorizBlur.SetParentOrigin(ParentOrigin::CENTER);
   mImageActorHorizBlur.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
   mImageActorHorizBlur.SetShaderEffect( mHorizBlurShader );
 
   // Create an ImageActor for performing a vertical blur on the texture
   mImageActorVertBlur = ImageActor::New();
-  mImageActorVertBlur.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   mImageActorVertBlur.SetParentOrigin(ParentOrigin::CENTER);
   mImageActorVertBlur.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
   mImageActorVertBlur.SetShaderEffect( mVertBlurShader );
@@ -285,7 +283,6 @@ void GaussianBlurView::OnInitialize()
   if(!mBlurUserImage)
   {
     mImageActorComposite = ImageActor::New();
-    mImageActorComposite.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
     mImageActorComposite.SetParentOrigin(ParentOrigin::CENTER);
     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
@@ -296,7 +293,6 @@ void GaussianBlurView::OnInitialize()
 
     // Create an ImageActor for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task
     mTargetActor = ImageActor::New();
-    mTargetActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
     mTargetActor.SetParentOrigin(ParentOrigin::CENTER);
     mTargetActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME
 
index fc6f71a..29e5bec 100644 (file)
@@ -123,7 +123,7 @@ Dali::Toolkit::Magnifier Magnifier::New()
 }
 
 Magnifier::Magnifier()
-: Control( REQUIRES_TOUCH_EVENTS ),
+: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),
   mPropertySourcePosition(Property::INVALID_INDEX),
   mDefaultCameraDistance(1000.f),
   mActorSize(Vector3::ZERO),
@@ -247,11 +247,13 @@ 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);
+    mFrame.SetResizePolicy( ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT, Dimension::ALL_DIMENSIONS );
+    Vector3 sizeOffset(IMAGE_BORDER_INDENT*2.f - 2.f, IMAGE_BORDER_INDENT*2.f - 2.f, 0.0f);
+    mFrame.SetSizeModeFactor( sizeOffset );
 
     Constraint constraint = Constraint::New<Vector3>( mFrame, Actor::Property::POSITION, EqualToConstraint() );
     constraint.AddSource( ParentSource( Actor::Property::WORLD_POSITION ) );
@@ -259,9 +261,6 @@ void Magnifier::SetFrameVisibility(bool visible)
 
     mFrame.SetNinePatchBorder( Vector4::ONE * IMAGE_BORDER_INDENT );
     self.Add(mFrame);
-
-    Vector3 sizeOffset(IMAGE_BORDER_INDENT*2.f - 2.f, IMAGE_BORDER_INDENT*2.f - 2.f, 0.0f);
-    mFrame.SetSize(mActorSize + sizeOffset);
   }
   else if(!visible && mFrame)
   {
@@ -271,12 +270,6 @@ void Magnifier::SetFrameVisibility(bool visible)
 
 void Magnifier::OnControlSizeSet(const Vector3& targetSize)
 {
-  if( mFrame )
-  {
-    Vector3 sizeOffset(IMAGE_BORDER_INDENT*2.f - 2.f, IMAGE_BORDER_INDENT*2.f - 2.f, 0.0f);
-    mFrame.SetSize(targetSize + sizeOffset);
-  }
-
   // TODO: Once Camera/CameraActor properties function as proper animatable properties
   // this code can disappear.
   // whenever the size of the magnifier changes, the field of view needs to change
index 26956dc..3a11d46 100644 (file)
@@ -52,15 +52,15 @@ BaseHandle 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  )
+DALI_ACTION_REGISTRATION( Toolkit, NavigationControl, "push", ACTION_PUSH )
+DALI_ACTION_REGISTRATION( Toolkit, NavigationControl, "pop",  ACTION_POP  )
 
 DALI_TYPE_REGISTRATION_END()
 
 }
 
 NavigationControl::NavigationControl()
-: Control( REQUIRES_TOUCH_EVENTS ),
+: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),
   mToolBar(NULL),
   mTitleBar(NULL),
   mOrientationAngle( 0 ),
index 7ca18c9..9d17d8c 100644 (file)
@@ -45,7 +45,7 @@ DALI_TYPE_REGISTRATION_END()
 } // unnamed namespace
 
 Page::Page()
-: Control( CONTROL_BEHAVIOUR_NONE ),
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
   mTitle(""),
   mSubTitle(""),
   mPropertyTitle(Property::INVALID_INDEX),
index 39f8be3..ef4a396 100644 (file)
@@ -113,7 +113,7 @@ struct RotationConstraint
     mStep = 1.f / pageWidth;
     mSign = isTurnBack ? -1.0f : 1.0f;
     mConst = isTurnBack ? -1.0f : 0.f;
-    mRotation = isTurnBack ? Quaternion( -Math::PI, Vector3::YAXIS ) : Quaternion( 0.f, Vector3::YAXIS );
+    mRotation = isTurnBack ? Quaternion( Radian( -Math::PI ), Vector3::YAXIS ) : Quaternion( Radian(0.f), Vector3::YAXIS );
   }
 
   void operator()( Quaternion& current, const PropertyInputContainer& inputs )
@@ -127,7 +127,7 @@ struct RotationConstraint
     {
       float coef = std::max(-1.0f, mStep*(mDistance-displacement));
       float angle = Math::PI * ( mConst + mSign * coef );
-      current = Quaternion( angle, Vector3::YAXIS );
+      current = Quaternion( Radian( angle ), Vector3::YAXIS );
     }
   }
 
@@ -259,7 +259,7 @@ const int PageTurnView::NUMBER_OF_CACHED_PAGES = NUMBER_OF_CACHED_PAGES_EACH_SID
 const float PageTurnView::STATIC_PAGE_INTERVAL_DISTANCE = 1.0f;
 
 PageTurnView::PageTurnView( PageFactory& pageFactory, const Vector2& pageSize )
-: Control( REQUIRES_TOUCH_EVENTS ),
+: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),
   mPageFactory( pageFactory ),
   mPageSize( pageSize ),
   mTotalPageCount( 0 ),
index a5aed9b..f63398d 100755 (executable)
@@ -61,8 +61,8 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Popup, Toolkit::Control, Create )
 
-DALI_SIGNAL_REGISTRATION( Popup, "touched-outside", SIGNAL_TOUCHED_OUTSIDE )
-DALI_SIGNAL_REGISTRATION( Popup, "hidden",          SIGNAL_HIDDEN          )
+DALI_SIGNAL_REGISTRATION( Toolkit, Popup, "touched-outside", SIGNAL_TOUCHED_OUTSIDE )
+DALI_SIGNAL_REGISTRATION( Toolkit, Popup, "hidden",          SIGNAL_HIDDEN          )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -172,12 +172,6 @@ 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 )
@@ -302,7 +296,6 @@ void Popup::CreateFooter()
     // Adds bottom background
     mBottomBg = Actor::New();
     mBottomBg.SetName( "POPUP_BOTTOM_BG" );
-    mBottomBg.SetRelayoutEnabled( true );
     mBottomBg.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
 
     mPopupLayout.SetFixedHeight( 2, mPopupStyle->bottomSize.height );   // Buttons
index f695c74..9c67474 100755 (executable)
@@ -131,11 +131,6 @@ public:
    */
   PopupStylePtr GetStyle() const;
 
-  /**
-   * @copydoc Toolkit::Popup::MarkDirtyForRelayout
-   */
-  void MarkDirtyForRelayout();
-
 protected:
 
   /**
index 0d7b833..b6e9e90 100755 (executable)
@@ -117,12 +117,12 @@ BaseHandle 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         )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicator-height-policy", STRING, INDICATOR_HEIGHT_POLICY         )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicator-fixed-height",  FLOAT,  INDICATOR_FIXED_HEIGHT          )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicator-show-duration", FLOAT,  INDICATOR_SHOW_DURATION         )
+DALI_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "indicator-hide-duration", FLOAT,  INDICATOR_HIDE_DURATION         )
 
-DALI_SIGNAL_REGISTRATION(   ScrollBar, "scroll-position-notified",        SCROLL_POSITION_NOTIFIED_SIGNAL )
+DALI_SIGNAL_REGISTRATION(   Toolkit, ScrollBar, "scroll-position-notified",        SCROLL_POSITION_NOTIFIED_SIGNAL )
 
 DALI_TYPE_REGISTRATION_END()
 
index a19e988..4b7760e 100755 (executable)
@@ -134,11 +134,11 @@ struct ScrollBarInternalRotationConstraint
 
     if( (mVertical && Toolkit::IsVertical(orientation)) || (!mVertical && Toolkit::IsHorizontal(orientation)) )
     {
-      current = Quaternion(0.0f, Vector3::ZAXIS);
+      current = Quaternion( Radian( 0.0f ), Vector3::ZAXIS );
     }
     else
     {
-      current = Quaternion(0.5f * Math::PI, Vector3::ZAXIS);
+      current = Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS);
     }
   }
 
index a3f222e..7657f5b 100644 (file)
@@ -293,7 +293,7 @@ Dali::Toolkit::ItemView ItemView::New(ItemFactory& factory)
 }
 
 ItemView::ItemView(ItemFactory& factory)
-: Scrollable(),
+: Scrollable( ControlBehaviour( DISABLE_SIZE_NEGOTIATION | REQUIRES_MOUSE_WHEEL_EVENTS | REQUIRES_KEYBOARD_NAVIGATION_SUPPORT ) ),
   mItemFactory(factory),
   mActiveLayout(NULL),
   mAnimatingOvershootOn(false),
@@ -319,17 +319,12 @@ ItemView::ItemView(ItemFactory& factory)
   mItemsParentOrigin( ParentOrigin::CENTER),
   mItemsAnchorPoint( AnchorPoint::CENTER)
 {
-  SetRequiresMouseWheelEvents(true);
-  SetKeyboardNavigationSupport(true);
 }
 
 void ItemView::OnInitialize()
 {
   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 );
index a789981..9e8eb84 100644 (file)
@@ -40,8 +40,8 @@ namespace
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollConnector, Dali::BaseHandle, NULL )
 
-DALI_SIGNAL_REGISTRATION( ScrollConnector, "domain-changed",          DOMAIN_CHANGED_SIGNAL_NAME          )
-DALI_SIGNAL_REGISTRATION( ScrollConnector, "scroll-position-changed", SCROLL_POSITION_CHANGED_SIGNAL_NAME )
+DALI_SIGNAL_REGISTRATION( Toolkit, ScrollConnector, "domain-changed",          DOMAIN_CHANGED_SIGNAL_NAME          )
+DALI_SIGNAL_REGISTRATION( Toolkit, ScrollConnector, "scroll-position-changed", SCROLL_POSITION_CHANGED_SIGNAL_NAME )
 
 DALI_TYPE_REGISTRATION_END()
 
index 44ceade..ffc7570 100644 (file)
@@ -40,6 +40,13 @@ ScrollBase::ScrollBase()
 {
 }
 
+ScrollBase::ScrollBase( ControlBehaviour behaviourFlags )
+: Scrollable( behaviourFlags ),
+  mParent(NULL),
+  mDelay(0.0f)
+{
+}
+
 void ScrollBase::SetParent(ScrollBase *parent)
 {
   mParent = parent;
index d4fe048..dcc5f74 100644 (file)
@@ -191,6 +191,13 @@ protected:
    */
   ScrollBase();
 
+  /**
+   * @brief Construct a new ScrollBase.
+   *
+   * @param[in] behaviourFlags Flags to enable
+   */
+  ScrollBase( ControlBehaviour behaviourFlags );
+
 protected:
 
   ScrollBase *mParent;                              ///< Pointer to ScrollBase parent, if exists.
index 35a61ac..0d2e728 100644 (file)
@@ -254,12 +254,12 @@ void ScrollOvershootEffectRipple::UpdateVisibility( bool visible )
       const Vector3 parentSize = self.GetCurrentSize();
       if(IsVertical())
       {
-        mOvershootOverlay.SetOrientation(Quaternion(0.0f, Vector3::ZAXIS));
+        mOvershootOverlay.SetOrientation( Quaternion( Radian( 0.0f ), Vector3::ZAXIS ) );
         mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width), size.depth);
       }
       else
       {
-        mOvershootOverlay.SetOrientation(Quaternion(1.5f * Math::PI, Vector3::ZAXIS));
+        mOvershootOverlay.SetOrientation( Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS ) );
         mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height), size.depth);
         relativeOffset = Vector3(0.0f, 1.0f, 0.0f);
       }
@@ -273,13 +273,13 @@ void ScrollOvershootEffectRipple::UpdateVisibility( bool visible )
       const Vector3 parentSize = self.GetCurrentSize();
       if(IsVertical())
       {
-        mOvershootOverlay.SetOrientation(Quaternion(Math::PI, Vector3::ZAXIS));
+        mOvershootOverlay.SetOrientation( Quaternion( Radian( Math::PI ), Vector3::ZAXIS ) );
         mOvershootOverlay.SetSize(parentSize.width, GetBounceActorHeight(parentSize.width), size.depth);
         relativeOffset = Vector3(1.0f, 1.0f, 0.0f);
       }
       else
       {
-        mOvershootOverlay.SetOrientation(Quaternion(0.5f * Math::PI, Vector3::ZAXIS));
+        mOvershootOverlay.SetOrientation( Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS ) );
         mOvershootOverlay.SetSize(parentSize.height, GetBounceActorHeight(parentSize.height), size.depth);
         relativeOffset = Vector3(1.0f, 0.0f, 0.0f);
       }
index 4f467f2..86ad736 100644 (file)
@@ -144,8 +144,8 @@ public:
 
     angle *= activate;
 
-    current = Quaternion(-angle.x, Vector3::YAXIS) *
-              Quaternion(angle.y, Vector3::XAXIS) *
+    current = Quaternion( Radian( -angle.x ), Vector3::YAXIS ) *
+              Quaternion( Radian( angle.y ), Vector3::XAXIS ) *
               current;
   }
 
index cf28691..f7f3384 100644 (file)
@@ -117,9 +117,9 @@ public:
     Vector2 angle( Clamp(position.x, -1.0f,1.0f),
                    Clamp(position.y, -1.0f,1.0f) );
 
-    current = Quaternion( angle.x * mAngleSwing.x, Vector3::YAXIS) *
-                          Quaternion(-angle.y * mAngleSwing.y, Vector3::XAXIS) *
-                          current;
+    current = Quaternion( Radian( angle.x * mAngleSwing.x ), Vector3::YAXIS ) *
+              Quaternion( Radian( -angle.y * mAngleSwing.y ), Vector3::XAXIS ) *
+              current;
   }
 
   /**
@@ -255,9 +255,9 @@ public:
 
     // Rotate position (current) about point.
     Vector3 position = current - mAnchor;
-    Quaternion rotatorY(angle.x, Vector3::YAXIS);
+    Quaternion rotatorY( Radian( angle.x ), Vector3::YAXIS);
     position = rotatorY.Rotate(position);
-    Quaternion rotatorX(-angle.y, Vector3::XAXIS);
+    Quaternion rotatorX( Radian( -angle.y ), Vector3::XAXIS);
     position = rotatorX.Rotate(position);
     position += mAnchor;
     position += relativePosition * mPositionSwing;
index 496d20f..98d81f9 100644 (file)
@@ -209,19 +209,19 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollView, Toolkit::Scrollable, Create )
 
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-position", VECTOR3, SCROLL_POSITION)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-pre-position", VECTOR3, SCROLL_PRE_POSITION)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "overshoot-x", FLOAT, OVERSHOOT_X)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "overshoot-y", FLOAT, OVERSHOOT_Y)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-final", VECTOR3, SCROLL_FINAL)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "wrap", BOOLEAN, WRAP)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "panning", BOOLEAN, PANNING)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scrolling", BOOLEAN, SCROLLING)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-domain-offset", VECTOR3, SCROLL_DOMAIN_OFFSET)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "scroll-position-delta", VECTOR3, SCROLL_POSITION_DELTA)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( ScrollView, "start-page-position", VECTOR3, START_PAGE_POSITION)
-
-DALI_SIGNAL_REGISTRATION( ScrollView, "value-changed", SIGNAL_SNAP_STARTED )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-position",       VECTOR3, SCROLL_POSITION       )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position",   VECTOR3, SCROLL_PRE_POSITION   )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "overshoot-x",           FLOAT,   OVERSHOOT_X           )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "overshoot-y",           FLOAT,   OVERSHOOT_Y           )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-final",          VECTOR3, SCROLL_FINAL          )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "wrap",                  BOOLEAN, WRAP                  )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "panning",               BOOLEAN, PANNING               )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scrolling",             BOOLEAN, SCROLLING             )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-domain-offset",  VECTOR3, SCROLL_DOMAIN_OFFSET  )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-position-delta", VECTOR3, SCROLL_POSITION_DELTA )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "start-page-position",   VECTOR3, START_PAGE_POSITION   )
+
+DALI_SIGNAL_REGISTRATION( Toolkit, ScrollView, "value-changed", SIGNAL_SNAP_STARTED )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -534,7 +534,7 @@ Dali::Toolkit::ScrollView ScrollView::New()
 }
 
 ScrollView::ScrollView()
-: ScrollBase(),
+: ScrollBase( ControlBehaviour( REQUIRES_MOUSE_WHEEL_EVENTS ) ),   // Enable size negotiation
   mTouchDownTime(0u),
   mGestureStackDepth(0),
   mScrollStateFlags(0),
@@ -570,7 +570,6 @@ ScrollView::ScrollView()
   mCanScrollHorizontal(true),
   mCanScrollVertical(true)
 {
-  SetRequiresMouseWheelEvents(true);
 }
 
 void ScrollView::OnInitialize()
index 66855a6..1184ca6 100644 (file)
@@ -108,8 +108,8 @@ public:
     // our page by calculating the amount we've moved as a fraction of the total size of the page.
     Vector2 angle( position / pageSize * Dali::Math::PI_2 );
 
-    current = Quaternion( -angle.x * mAngleSwing.x, Vector3::YAXIS ) *
-              Quaternion(  angle.y * mAngleSwing.y, Vector3::XAXIS ) *
+    current = Quaternion( Radian( -angle.x * mAngleSwing.x ), Vector3::YAXIS ) *
+              Quaternion( Radian( angle.y * mAngleSwing.y ), Vector3::XAXIS ) *
               current;
   }
 
index 0871b57..10d6d1e 100644 (file)
@@ -145,8 +145,8 @@ public:
     }
     ClampInPlace( angle.y, -angleMaxMin.y, angleMaxMin.y );
 
-    current = Quaternion( angle.x, Vector3::YAXIS ) *
-              Quaternion( angle.y, Vector3::XAXIS ) *
+    current = Quaternion( Radian( angle.x ), Vector3::YAXIS ) *
+              Quaternion( Radian( angle.y ), Vector3::XAXIS ) *
               current;
   }
 
index 5f7cf72..36934c5 100644 (file)
@@ -47,19 +47,19 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Scrollable, Toolkit::Control, Create );
 
-DALI_PROPERTY_REGISTRATION( Scrollable, "overshoot-effect-color",    VECTOR4, OVERSHOOT_EFFECT_COLOR    )
-DALI_PROPERTY_REGISTRATION( Scrollable, "overshoot-animation-speed", FLOAT,   OVERSHOOT_ANIMATION_SPEED )
+DALI_PROPERTY_REGISTRATION( Toolkit, Scrollable, "overshoot-effect-color",    VECTOR4, OVERSHOOT_EFFECT_COLOR    )
+DALI_PROPERTY_REGISTRATION( Toolkit, Scrollable, "overshoot-animation-speed", FLOAT,   OVERSHOOT_ANIMATION_SPEED )
 
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-relative-position", VECTOR3, SCROLL_RELATIVE_POSITION)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-position-min",      VECTOR3, SCROLL_POSITION_MIN)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-position-max",      VECTOR3, SCROLL_POSITION_MAX)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "scroll-direction",         VECTOR3, SCROLL_DIRECTION)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "can-scroll-vertical",      BOOLEAN, CAN_SCROLL_VERTICAL)
-DALI_ANIMATABLE_PROPERTY_REGISTRATION( Scrollable, "can-scroll-horizontal",    BOOLEAN, CAN_SCROLL_HORIZONTAL)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "scroll-relative-position", VECTOR3, SCROLL_RELATIVE_POSITION )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "scroll-position-min",      VECTOR3, SCROLL_POSITION_MIN      )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "scroll-position-max",      VECTOR3, SCROLL_POSITION_MAX      )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "scroll-direction",         VECTOR3, SCROLL_DIRECTION         )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "can-scroll-vertical",      BOOLEAN, CAN_SCROLL_VERTICAL      )
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "can-scroll-horizontal",    BOOLEAN, CAN_SCROLL_HORIZONTAL    )
 
-DALI_SIGNAL_REGISTRATION(   Scrollable, "scroll-started",                     SIGNAL_SCROLL_STARTED     )
-DALI_SIGNAL_REGISTRATION(   Scrollable, "scroll-completed",                   SIGNAL_SCROLL_COMPLETED   )
-DALI_SIGNAL_REGISTRATION(   Scrollable, "scroll-updated",                     SIGNAL_SCROLL_UPDATED     )
+DALI_SIGNAL_REGISTRATION(              Toolkit, Scrollable, "scroll-started",                    SIGNAL_SCROLL_STARTED    )
+DALI_SIGNAL_REGISTRATION(              Toolkit, Scrollable, "scroll-completed",                  SIGNAL_SCROLL_COMPLETED  )
+DALI_SIGNAL_REGISTRATION(              Toolkit, Scrollable, "scroll-updated",                    SIGNAL_SCROLL_UPDATED    )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -75,7 +75,15 @@ const float DEFAULT_OVERSHOOT_ANIMATION_SPEED(120.0f); // 120 pixels per second
 // Scrollable controls are not layout containers so they dont need size negotiation..
 // we dont want size negotiation while scrolling if we can avoid it
 Scrollable::Scrollable()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | NO_SIZE_NEGOTIATION ) ),
+: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | DISABLE_SIZE_NEGOTIATION ) ),
+  mOvershootEffectColor(  DEFAULT_OVERSHOOT_COLOUR ),
+  mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),
+  mOvershootEnabled(false)
+{
+}
+
+Scrollable::Scrollable( ControlBehaviour behaviourFlags )
+: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS | behaviourFlags ) ),
   mOvershootEffectColor(  DEFAULT_OVERSHOOT_COLOUR ),
   mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),
   mOvershootEnabled(false)
index eb9f377..1f876ad 100644 (file)
@@ -182,6 +182,13 @@ protected:
   Scrollable();
 
   /**
+   * @brief Construct a new Scrollable.
+   *
+   * @param[in] behaviourFlags Flags to enable
+   */
+  Scrollable( ControlBehaviour behaviourFlags );
+
+  /**
    * A reference counted object may only be deleted by calling Unreference()
    */
   virtual ~Scrollable();
index 2011b7f..8a24887 100644 (file)
@@ -108,7 +108,7 @@ const char* const RENDER_SHADOW_FRAGMENT_SOURCE =
 } // namespace
 
 ShadowView::ShadowView( float downsampleWidthScale, float downsampleHeightScale )
-: Control( CONTROL_BEHAVIOUR_NONE ),
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
   mChildrenRoot(Actor::New()),
   mCachedShadowColor(DEFAULT_SHADOW_COLOR),
   mCachedBackgroundColor(DEFAULT_SHADOW_COLOR.r, DEFAULT_SHADOW_COLOR.g, DEFAULT_SHADOW_COLOR.b, 0.0f),
@@ -226,7 +226,6 @@ 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.SetRelayoutEnabled( true );
   mChildrenRoot.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
 
   Vector2 stageSize = Stage::GetCurrent().GetSize();
@@ -263,7 +262,6 @@ void ShadowView::OnInitialize()
 
   mBlurRootActor = Actor::New();
   mBlurRootActor.SetName( "BLUR_ROOT_ACTOR" );
-  mBlurRootActor.SetRelayoutEnabled( true );
 
   // Turn off inheritance to ensure filter renders properly
   mBlurRootActor.SetPositionInheritanceMode(USE_PARENT_POSITION);
index 4c1b2fa..94d4bbe 100755 (executable)
@@ -52,29 +52,29 @@ BaseHandle Create()
 // 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_PROPERTY_REGISTRATION( Toolkit, Slider, "lower-bound",            FLOAT,    LOWER_BOUND            )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "upper-bound",            FLOAT,    UPPER_BOUND            )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "value",                  FLOAT,    VALUE                  )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "hit-region",             VECTOR2,  HIT_REGION             )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "backing-region",         VECTOR2,  BACKING_REGION         )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "handle-region",          VECTOR2,  HANDLE_REGION          )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "backing-image-name",     STRING,   BACKING_IMAGE_NAME     )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "handle-image-name",      STRING,   HANDLE_IMAGE_NAME      )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "progress-image-name",    STRING,   PROGRESS_IMAGE_NAME    )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "popup-image-name",       STRING,   POPUP_IMAGE_NAME       )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "popup-arrow-image-name", STRING,   POPUP_ARROW_IMAGE_NAME )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "disable-color",          VECTOR4,  DISABLE_COLOR          )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "popup-text-color",       VECTOR4,  POPUP_TEXT_COLOR       )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "value-precision",        INTEGER,  VALUE_PRECISION        )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "show-popup",             BOOLEAN,  SHOW_POPUP             )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "show-value",             BOOLEAN,  SHOW_VALUE             )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "enabled",                BOOLEAN,  ENABLED                )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "marks",                  ARRAY,    MARKS                  )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "snap-to-marks",          BOOLEAN,  SNAP_TO_MARKS          )
+DALI_PROPERTY_REGISTRATION( Toolkit, Slider, "mark-tolerance",         FLOAT,    MARK_TOLERANCE         )
+
+DALI_SIGNAL_REGISTRATION(   Toolkit, Slider, "value-changed",                    SIGNAL_VALUE_CHANGED   )
+DALI_SIGNAL_REGISTRATION(   Toolkit, Slider, "mark",                             SIGNAL_MARK            )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -96,6 +96,7 @@ const float DEFAULT_WIDTH = 0.0f;
 const float DEFAULT_HEIGHT = 27.0f;
 const float DEFAULT_HIT_HEIGHT = 72.0f;
 const float DEFAULT_HANDLE_HEIGHT = DEFAULT_HIT_HEIGHT;
+const float POPUP_TEXT_PADDING = 10.0f;
 
 const char* SKINNED_BACKING_IMAGE_NAME = DALI_IMAGE_DIR "slider-skin.9.png";
 const char* SKINNED_HANDLE_IMAGE_NAME = DALI_IMAGE_DIR "slider-skin-handle.png";;
@@ -326,15 +327,7 @@ void Slider::DisplayValue( float value, bool raiseSignals )
   // Progress bar
   if( mProgress )
   {
-    if( clampledValue > 0.0f )
-    {
-      mProgress.SetVisible( true ); // Deliberately set this in case multiple SetValues are fired at once
-      mProgress.SetSize( x, GetBackingRegion().y );
-    }
-    else
-    {
-      mProgress.SetVisible( false );
-    }
+    mProgress.SetSize( x, GetBackingRegion().y );
   }
 
   // Signals
@@ -400,7 +393,6 @@ 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 );
@@ -430,7 +422,6 @@ 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 );
@@ -506,7 +497,6 @@ 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 );
@@ -517,7 +507,6 @@ 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 );
@@ -530,18 +519,21 @@ Toolkit::TextLabel Slider::CreatePopupText()
   Toolkit::TextLabel textLabel = Toolkit::TextLabel::New();
   textLabel.SetParentOrigin( ParentOrigin::CENTER );
   textLabel.SetAnchorPoint( AnchorPoint::CENTER );
+  textLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   textLabel.SetProperty( Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
   textLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "CENTER" );
+  textLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, DEFAULT_POPUP_TEXT_COLOR );
   textLabel.SetZ( VALUE_DISPLAY_TEXT_Z );
+  textLabel.SetPadding( Padding( POPUP_TEXT_PADDING, POPUP_TEXT_PADDING, 0.0f, 0.0f ) );
   return textLabel;
 }
 
 ImageActor Slider::CreatePopup()
 {
   ImageActor popup = ImageActor::New();
-  popup.SetRelayoutEnabled( false );
   popup.SetParentOrigin( ParentOrigin::TOP_CENTER );
   popup.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+  popup.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::WIDTH );
 
   mValueTextLabel = CreatePopupText();
   popup.Add( mValueTextLabel );
index f2b8a5f..008a0e5 100644 (file)
@@ -97,14 +97,14 @@ BaseHandle 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 )
+DALI_PROPERTY_REGISTRATION( Toolkit, SuperBlurView, "image", MAP, IMAGE )
 
 DALI_TYPE_REGISTRATION_END()
 
 } // unnamed namespace
 
 SuperBlurView::SuperBlurView( unsigned int blurLevels )
-: Control( CONTROL_BEHAVIOUR_NONE ),
+: Control( ControlBehaviour( DISABLE_SIZE_NEGOTIATION ) ),
   mBlurLevels( blurLevels ),
   mBlurStrengthPropertyIndex(Property::INVALID_INDEX),
   mResourcesCleared( true ),
index ec8e324..3dc2be3 100644 (file)
@@ -126,11 +126,11 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TableView, Toolkit::Control, Create );
 
-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_PROPERTY_REGISTRATION( Toolkit, TableView, "rows",           UNSIGNED_INTEGER, ROWS           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "columns",        UNSIGNED_INTEGER, COLUMNS        )
+DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "cell-padding",   VECTOR2,          CELL_PADDING   )
+DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layout-rows",    MAP,              LAYOUT_ROWS    )
+DALI_PROPERTY_REGISTRATION( Toolkit, TableView, "layout-columns", MAP,              LAYOUT_COLUMNS )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -1461,10 +1461,11 @@ void TableView::CalculateFixedSizes( RowColumnArray& data, Dimension::Type dimen
         DALI_ASSERT_DEBUG( row < mCellData.GetRows() );
         DALI_ASSERT_DEBUG( column < mCellData.GetColumns() );
 
-        Actor& actor = mCellData[ row ][ column ].actor;
+        const CellData& cellData = mCellData[ row ][ column ];
+        const Actor& actor = cellData.actor;
         if( actor )
         {
-          if( FitToChild( actor, dimension ) )
+          if( FitToChild( actor, dimension ) && ( dimension == Dimension::WIDTH ) ? ( cellData.position.columnSpan == 1 ) : ( cellData.position.rowSpan == 1 )  )
           {
             maxActorHeight = std::max( maxActorHeight, actor.GetRelayoutSize( dimension ) + cellPadding.x + cellPadding.y );
           }
index f17ea34..286bc33 100644 (file)
@@ -79,22 +79,23 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextField, Toolkit::Control, Create );
 
-DALI_PROPERTY_REGISTRATION( TextField, "rendering-backend",       INTEGER,   RENDERING_BACKEND       )
-DALI_PROPERTY_REGISTRATION( TextField, "placeholder-text",        STRING,    PLACEHOLDER_TEXT        )
-DALI_PROPERTY_REGISTRATION( TextField, "text",                    STRING,    TEXT                    )
-DALI_PROPERTY_REGISTRATION( TextField, "font-family",             STRING,    FONT_FAMILY             )
-DALI_PROPERTY_REGISTRATION( TextField, "font-style",              STRING,    FONT_STYLE              )
-DALI_PROPERTY_REGISTRATION( TextField, "point-size",              FLOAT,     POINT_SIZE              )
-DALI_PROPERTY_REGISTRATION( TextField, "exceed-policy",           INTEGER,   EXCEED_POLICY           )
-DALI_PROPERTY_REGISTRATION( TextField, "primary-cursor-color",    VECTOR4,   PRIMARY_CURSOR_COLOR    )
-DALI_PROPERTY_REGISTRATION( TextField, "secondary-cursor-color",  VECTOR4,   SECONDARY_CURSOR_COLOR  )
-DALI_PROPERTY_REGISTRATION( TextField, "enable-cursor-blink",     BOOLEAN,   ENABLE_CURSOR_BLINK     )
-DALI_PROPERTY_REGISTRATION( TextField, "cursor-blink-interval",   FLOAT,     CURSOR_BLINK_INTERVAL   )
-DALI_PROPERTY_REGISTRATION( TextField, "cursor-blink-duration",   FLOAT,     CURSOR_BLINK_DURATION   )
-DALI_PROPERTY_REGISTRATION( TextField, "grab-handle-image",       STRING,    GRAB_HANDLE_IMAGE       )
-DALI_PROPERTY_REGISTRATION( TextField, "decoration-bounding-box", RECTANGLE, DECORATION_BOUNDING_BOX )
-DALI_PROPERTY_REGISTRATION( TextField, "horizontal-alignment",    STRING,    HORIZONTAL_ALIGNMENT    )
-DALI_PROPERTY_REGISTRATION( TextField, "vertical-alignment",      STRING,    VERTICAL_ALIGNMENT      )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "rendering-backend",       INTEGER,   RENDERING_BACKEND       )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "placeholder-text",        STRING,    PLACEHOLDER_TEXT        )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "text",                    STRING,    TEXT                    )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "font-family",             STRING,    FONT_FAMILY             )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "font-style",              STRING,    FONT_STYLE              )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "point-size",              FLOAT,     POINT_SIZE              )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "exceed-policy",           INTEGER,   EXCEED_POLICY           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "primary-cursor-color",    VECTOR4,   PRIMARY_CURSOR_COLOR    )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "secondary-cursor-color",  VECTOR4,   SECONDARY_CURSOR_COLOR  )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "enable-cursor-blink",     BOOLEAN,   ENABLE_CURSOR_BLINK     )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "cursor-blink-interval",   FLOAT,     CURSOR_BLINK_INTERVAL   )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "cursor-blink-duration",   FLOAT,     CURSOR_BLINK_DURATION   )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "grab-handle-image",       STRING,    GRAB_HANDLE_IMAGE       )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "decoration-bounding-box", RECTANGLE, DECORATION_BOUNDING_BOX )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "horizontal-alignment",    STRING,    HORIZONTAL_ALIGNMENT    )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "vertical-alignment",      STRING,    VERTICAL_ALIGNMENT      )
+
 DALI_TYPE_REGISTRATION_END()
 
 } // namespace
@@ -514,6 +515,8 @@ void TextField::OnKeyInputFocusGained()
   }
 
   mController->KeyboardFocusGainEvent();
+
+  EmitKeyInputFocusSignal( true ); // Calls back into the Control hence done last.
 }
 
 void TextField::OnKeyInputFocusLost()
@@ -533,6 +536,8 @@ void TextField::OnKeyInputFocusLost()
   }
 
   mController->KeyboardFocusLostEvent();
+
+  EmitKeyInputFocusSignal( false ); // Calls back into the Control hence done last.
 }
 
 void TextField::OnTap( const TapGesture& gesture )
index afe74e2..f247c61 100644 (file)
@@ -75,20 +75,21 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::TextLabel, Toolkit::Control, Create );
 
-DALI_PROPERTY_REGISTRATION( TextLabel, "rendering-backend",    INTEGER, RENDERING_BACKEND    )
-DALI_PROPERTY_REGISTRATION( TextLabel, "text",                 STRING,  TEXT                 )
-DALI_PROPERTY_REGISTRATION( TextLabel, "font-family",          STRING,  FONT_FAMILY          )
-DALI_PROPERTY_REGISTRATION( TextLabel, "font-style",           STRING,  FONT_STYLE           )
-DALI_PROPERTY_REGISTRATION( TextLabel, "point-size",           FLOAT,   POINT_SIZE           )
-DALI_PROPERTY_REGISTRATION( TextLabel, "multi-line",           BOOLEAN, MULTI_LINE           )
-DALI_PROPERTY_REGISTRATION( TextLabel, "horizontal-alignment", STRING,  HORIZONTAL_ALIGNMENT )
-DALI_PROPERTY_REGISTRATION( TextLabel, "vertical-alignment",   STRING,  VERTICAL_ALIGNMENT   )
-DALI_PROPERTY_REGISTRATION( TextLabel, "text-color",           VECTOR4, TEXT_COLOR           )
-DALI_PROPERTY_REGISTRATION( TextLabel, "shadow-offset",        VECTOR2, SHADOW_OFFSET        )
-DALI_PROPERTY_REGISTRATION( TextLabel, "shadow-color",         VECTOR4, SHADOW_COLOR         )
-DALI_PROPERTY_REGISTRATION( TextLabel, "underline-enabled",    BOOLEAN, UNDERLINE_ENABLED    )
-DALI_PROPERTY_REGISTRATION( TextLabel, "underline-color",      VECTOR4, UNDERLINE_COLOR      )
-DALI_PROPERTY_REGISTRATION( TextLabel, "underline-height",     FLOAT,   UNDERLINE_HEIGHT       )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "rendering-backend",    INTEGER, RENDERING_BACKEND    )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "text",                 STRING,  TEXT                 )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "font-family",          STRING,  FONT_FAMILY          )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "font-style",           STRING,  FONT_STYLE           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "point-size",           FLOAT,   POINT_SIZE           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "multi-line",           BOOLEAN, MULTI_LINE           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "horizontal-alignment", STRING,  HORIZONTAL_ALIGNMENT )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "vertical-alignment",   STRING,  VERTICAL_ALIGNMENT   )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "text-color",           VECTOR4, TEXT_COLOR           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadow-offset",        VECTOR2, SHADOW_OFFSET        )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "shadow-color",         VECTOR4, SHADOW_COLOR         )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline-enabled",    BOOLEAN, UNDERLINE_ENABLED    )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline-color",      VECTOR4, UNDERLINE_COLOR      )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "underline-height",     FLOAT,   UNDERLINE_HEIGHT     )
+
 DALI_TYPE_REGISTRATION_END()
 
 } // namespace
index 01ede36..d66a70a 100644 (file)
@@ -29,6 +29,7 @@
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector4.h>
 #include <libintl.h>
+#include <cfloat>
 
 // todo Move this to adaptor??
 #define GET_LOCALE_TEXT(string) dgettext("elementary", string)
@@ -48,7 +49,7 @@ const Dali::Vector4 DEFAULT_POPUP_BACKGROUND( Dali::Vector4( .20f, 0.29f, 0.44f,
 const Dali::Vector4 DEFAULT_POPUP_BACKGROUND_PRESSED( Dali::Vector4( 0.07f, 0.10f, 0.17f, 1.0f ) );
 const Dali::Vector4 DEFAULT_POPUP_LINE_COLOR( Dali::Vector4( 0.36f, 0.45f, 0.59f, 1.0f ) );
 const Dali::Vector4 DEFAULT_OPTION_ICON( Dali::Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
-const Dali::Vector4 DEFAULT_OPTION_ICON_PRESSED( Dali::Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
+const Dali::Vector4 DEFAULT_OPTION_ICON_PRESSED( Dali::Vector4( 0.5f, 1.0f, 1.0f, 1.0f ) );
 const Dali::Vector4 DEFAULT_OPTION_TEXT( Dali::Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
 const Dali::Vector4 DEFAULT_OPTION_TEXT_PRESSED( Dali::Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
 
@@ -60,16 +61,13 @@ 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 Dali::Vector2 DEFAULT_POPUP_MAX_SIZE( 470.0f, 120.0f ); ///< The maximum size of the popup.
+const Dali::Vector2 DEFAULT_POPUP_MAX_SIZE( 450.0f, 100.0f ); ///< The maximum size of the popup.
 
-const float OPTION_TEXT_LINE_HEIGHT( 32.0f );     ///< The line height of the text.
-const Dali::Vector2 OPTION_ICON_SIZE( 0.f, 0.f );       ///< The size of the icon.
-const float OPTION_GAP_ICON_TEXT( 6.f );          ///< The gap between the icon and the text
+const Dali::Vector2 OPTION_ICON_SIZE( 65.0f, 65.0f );       ///< The size of the icon.
 const float OPTION_MARGIN_WIDTH( 10.f );          ///< The margin between the right or lefts edge and the text or icon.
-const float OPTION_MAX_WIDTH( DEFAULT_POPUP_MAX_SIZE.width / 6 ); ///< The maximum width of the option (currently set to the max)
-const float OPTION_MIN_WIDTH( 86.0f );           ///< The minimum width of the option.
-
-const float POPUP_DIVIDER_WIDTH( 1.f );        ///< The size of the divider.
+const float OPTION_MAX_WIDTH( 110.0f );          ///< The maximum width of the option   //todo Make Property
+const float OPTION_MIN_WIDTH( 86.0f );           ///< The minimum width of the option. //todo Make Property
+const float POPUP_DIVIDER_WIDTH( 3.f );        ///< The size of the divider.
 
 const Dali::Vector2 POPUP_TAIL_SIZE( 20.0f, 16.0f ); ///< The size of the tail.
 const float POPUP_TAIL_Y_OFFSET( 5.f );        ///< The y offset of the tail (when its position is on the bottom).
@@ -411,183 +409,141 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part )
 
  void TextSelectionPopup::CreateBackground()
  {
-   if ( !mBackgroundImage )
+   if ( mBackgroundImage )
    {
-     mBackgroundImage = ResourceImage::New( DEFAULT_POPUP_BACKGROUND_IMAGE );
+     SetBackgroundImage (  mBackgroundImage );
    }
 
-   NinePatchImage backgroundImageNinePatch = NinePatchImage::DownCast( mBackgroundImage );
-   if( backgroundImageNinePatch )
-   {
-     const Size ninePatchImageSize = Size( static_cast<float>( mBackgroundImage.GetWidth() ), static_cast<float>( mBackgroundImage.GetHeight() ) );
-     Rect<int> childRect = backgroundImageNinePatch.GetChildRectangle();
-
-     // -1u because of the cropping.
-     mNinePatchMargins.x = childRect.x - 1u;
-     mNinePatchMargins.y = ninePatchImageSize.width - ( childRect.x + childRect.width ) - 1u;
-     mNinePatchMargins.z = childRect.y - 1u;
-     mNinePatchMargins.w = ninePatchImageSize.height - ( childRect.y + childRect.height ) - 1u;
-   }
-
-   SetBackgroundImage( mBackgroundImage );
    SetBackgroundColor( mBackgroundColor );
  }
 
- void TextSelectionPopup::AddOption( Actor& parent, const std::string& name, const std::string& caption, const Image iconImage, bool finalOption, bool showIcons )
+ void TextSelectionPopup::AddOption( Dali::Toolkit::TableView& parent, const std::string& name, const std::string& caption, const Image iconImage, bool finalOption, bool showIcons, bool showCaption, std::size_t& indexInTable )
  {
    // 1. Create the backgrounds for the popup option both normal and pressed.
    // Both containers will be added to a button.
-   Actor optionContainer = Actor::New();
-   optionContainer.SetRelayoutEnabled( true );
+
+   Toolkit::TableView optionContainer = Toolkit::TableView::New( (showIcons)?2:1 , 1 );
    optionContainer.SetDrawMode( DrawMode::OVERLAY );
-   optionContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+   optionContainer.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+   optionContainer.SetMinimumSize( Vector2( OPTION_MIN_WIDTH, 0 ) );
+   optionContainer.SetFitWidth( 0 );
 
-   ImageActor optionPressedContainer = Toolkit::CreateSolidColorActor( mBackgroundPressedColor );
+   Toolkit::TableView  optionPressedContainer = Toolkit::TableView::New( (showIcons)?2:1 , 1 );
    optionPressedContainer.SetDrawMode( DrawMode::OVERLAY );
-   optionPressedContainer.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-
+   optionPressedContainer.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+   optionPressedContainer.SetMinimumSize( Vector2( OPTION_MIN_WIDTH, 0 ) );
+   optionPressedContainer.SetFitWidth( 0 );
+#ifdef DECORATOR_DEBUG
+   optionContainer.SetName("optionContainer");
+   optionPressedContainer.SetName("optionPressedContainer");
+#endif
    // 2. Add text.
+
+   if ( showCaption )
+   {
    Toolkit::TextLabel captionTextLabel = Toolkit::TextLabel::New();
    captionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption );
-   // optionContainer.Add( captionTextLabel ); Temporary removed.
+   optionContainer.SetFitHeight( 0 );
 
    Toolkit::TextLabel pressedCaptionTextLabel = Toolkit::TextLabel::New();
    pressedCaptionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption );
-   // optionPressedContainer.Add( pressedCaptionTextLabel ); Temporary removed.
+   optionPressedContainer.SetFitHeight( 0 );
+
+   captionTextLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::WIDTH );
+   captionTextLabel.SetMaximumSize( Vector2( OPTION_MAX_WIDTH - 2.f * OPTION_MARGIN_WIDTH , FLT_MAX ) ); //todo FLT_MAX Size negotiation feature needed
+
+   pressedCaptionTextLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::WIDTH );
+   pressedCaptionTextLabel.SetMaximumSize( Vector2( OPTION_MAX_WIDTH - 2.f * OPTION_MARGIN_WIDTH , FLT_MAX) ); //todo FLT_MAX Size negotiation feature needed
 
-   // Calculates the icon/text position.
-   float iconTextOffsetY = 0.0f;
+   optionContainer.AddChild( captionTextLabel, Toolkit::TableView::CellPosition( 1, 0 )  ); // todo Labels need ellipsis or similar
+   optionPressedContainer.AddChild( pressedCaptionTextLabel, Toolkit::TableView::CellPosition( 1, 0 )  ); // todo Labels need ellipsis or similar
+   }
 
    if ( showIcons )
    {
      // 3. Create the icons
      ImageActor pressedIcon = ImageActor::New(  iconImage );
      ImageActor icon = ImageActor::New(  iconImage );
-
-     optionContainer.Add( icon );
-     optionPressedContainer.Add( pressedIcon );
-
-     iconTextOffsetY = 0.5f * ( ( DEFAULT_POPUP_MAX_SIZE.height - mNinePatchMargins.z - mNinePatchMargins.w ) - ( OPTION_ICON_SIZE.height + OPTION_GAP_ICON_TEXT + OPTION_TEXT_LINE_HEIGHT ) );
-
-     icon.SetParentOrigin( ParentOrigin::TOP_CENTER );
-     icon.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-     icon.SetY( iconTextOffsetY );
-
-     pressedIcon.SetParentOrigin( ParentOrigin::TOP_CENTER );
-     pressedIcon.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-     pressedIcon.SetY( iconTextOffsetY );
-
-     // Layout icon + gap + text
-     captionTextLabel.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-     pressedCaptionTextLabel.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-     pressedCaptionTextLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
-     captionTextLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
-     pressedCaptionTextLabel.SetY( -iconTextOffsetY );
-     captionTextLabel.SetY( -iconTextOffsetY );
-   }
-   else
-   {
-     // Centre option text
-     captionTextLabel.SetAnchorPoint( AnchorPoint::CENTER );
-     captionTextLabel.SetParentOrigin( ParentOrigin::CENTER );
-     pressedCaptionTextLabel.SetAnchorPoint( AnchorPoint::CENTER );
-     pressedCaptionTextLabel.SetParentOrigin( ParentOrigin::CENTER );
+     icon.SetName("image-icon-2014");
+     icon.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+     pressedIcon.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+     pressedIcon.SetColor( mIconPressedColor );
+     optionContainer.SetFitHeight( 0 );
+     optionPressedContainer.SetFitHeight( 0 );
+     optionContainer.AddChild( icon, Toolkit::TableView::CellPosition( 0, 0 )  );
+     optionPressedContainer.AddChild( pressedIcon, Toolkit::TableView::CellPosition( 0, 0 )  );
+     icon.SetPadding( Padding( 10.0f, 10.0f, 10.0f, 10.0f ) );
+     pressedIcon.SetPadding( Padding( 10.0f, 10.0f, 10.0f, 10.0f ) );
    }
 
-   // Calculate the size of the text.
-   Vector3 textSize = captionTextLabel.GetNaturalSize();
-   textSize.width = std::min( textSize.width, OPTION_MAX_WIDTH - 2.f * OPTION_MARGIN_WIDTH );
-
-   // Set the size to the text. Text will be ellipsized if exceeds the max width.
-   captionTextLabel.SetSize( textSize.GetVectorXY() );
-   pressedCaptionTextLabel.SetSize( textSize.GetVectorXY() );
-
-   // 4. Calculate the size of option.
-
-   // The width is the max size of the text or the icon plus the margins clamped between the option min and max size.
-   // The height is the whole popup height minus the ninepatch margins.
-   const Vector2 optionSize( std::min( OPTION_MAX_WIDTH, std::max( OPTION_MIN_WIDTH, std::max( textSize.width, OPTION_ICON_SIZE.width ) + 2.f * OPTION_MARGIN_WIDTH ) ),
-                             DEFAULT_POPUP_MAX_SIZE.height - mNinePatchMargins.z - mNinePatchMargins.w );
-
-   optionContainer.SetSize( optionSize );
-   optionPressedContainer.SetSize( optionSize );
-
    // 5. Create a option.
    Toolkit::PushButton option = Toolkit::PushButton::New();
-   option.SetSize( optionSize );
-   option.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-   option.SetX( mContentSize.width );
    option.SetName( name );
    option.SetAnimationTime( 0.0f );
+   option.SetSize( OPTION_ICON_SIZE );
    //option.ClickedSignal().Connect( this, &TextInputPopup::OnButtonPressed );
 
-   parent.Add( option );
-
    // 6. Set the normal option image.
    option.SetButtonImage( optionContainer );
 
    // 7. Set the pressed option image
    option.SetSelectedImage( optionPressedContainer );
 
-   // 8. Update the content size.
-   mContentSize.width += optionSize.width;
-   mContentSize.height = std::max ( optionSize.height, mContentSize.height );
+   // 9 Add option to table view
+   parent.SetFitWidth( indexInTable );
+   parent.AddChild( option, Toolkit::TableView::CellPosition( 0, indexInTable )  );
+   indexInTable++;
 
-   // 9. Add the divider
+   // 10. Add the divider
    if( !finalOption )
    {
-     const Size size( POPUP_DIVIDER_WIDTH, mContentSize.height );
+     const Size size( POPUP_DIVIDER_WIDTH, 0.0f ); // Height FILL_TO_PARENT
+
+     ImageActor divider = Toolkit::CreateSolidColorActor( Color::WHITE );
 
-     ImageActor divider =  Toolkit::CreateSolidColorActor( Color::WHITE );
      divider.SetSize( size );
-     divider.SetParentOrigin( ParentOrigin::TOP_LEFT );
-     divider.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-     divider.SetPosition( mContentSize.width - POPUP_DIVIDER_WIDTH, 0.0f );
-     parent.Add( divider );
+     divider.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
+     parent.SetFitWidth( indexInTable );
+     parent.AddChild( divider, Toolkit::TableView::CellPosition( 0, indexInTable )  );
+     indexInTable++;
    }
  }
 
- void TextSelectionPopup::SetUpPopup( Size& size )
+ void TextSelectionPopup::SetUpPopup()
  {
    Actor self = Self();
+   self.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
 
    // Create Layer and Stencil.
    mStencilLayer = Layer::New();
+   mStencilLayer.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
+   mStencilLayer.SetParentOrigin( ParentOrigin::CENTER );
+
    ImageActor stencil = CreateSolidColorActor( Color::RED );
    stencil.SetDrawMode( DrawMode::STENCIL );
    stencil.SetVisible( true );
-   Actor scrollview = Actor::New(); //todo make a scrollview
-   stencil.SetRelayoutEnabled( true );
-
-   self.SetSize( mRequiredPopUpSize ); // control matches stencil size
-
-   mStencilLayer.SetSize( size ); // matches stencil size
-
-   stencil.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-   scrollview.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-   mButtons.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+   stencil.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
+   stencil.SetParentOrigin( ParentOrigin::CENTER );
 
-   mStencilLayer.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-   scrollview.SetAnchorPoint(AnchorPoint::TOP_LEFT);
-   mButtons.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+   Actor scrollview = Actor::New(); //todo make a scrollview
+   scrollview.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
+   scrollview.SetParentOrigin( ParentOrigin::CENTER );
 
-   mStencilLayer.SetPosition( mNinePatchMargins.x,  mNinePatchMargins.y );
+   mTableOfButtons.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+   mTableOfButtons.SetFitHeight( 0 );
+   mTableOfButtons.SetParentOrigin( ParentOrigin::CENTER );
 
-   self.Add( mStencilLayer );
    mStencilLayer.Add( stencil );
    mStencilLayer.Add( scrollview );
-   scrollview.Add( mButtons );
+   scrollview.Add( mTableOfButtons );
+   self.Add( mStencilLayer );
+   //self.Add ( mTableOfButtons );
  }
 
- void TextSelectionPopup::AddPopupOptions( bool createTail, bool showIcons )
+ void TextSelectionPopup::AddPopupOptions( bool createTail, bool showIcons, bool showCaptions )
  {
-   mShowIcons = showIcons;
-
    mContentSize = Vector2::ZERO;
 
-   mButtons = Actor::New();
-   mButtons.SetRelayoutEnabled( true );
-
    // Add the options into the buttons container.
 
    // 1. Determine how many buttons are active and should be added to container.
@@ -603,21 +559,19 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part )
 
    // 2. Iterate list of buttons and add active ones.
    std::size_t optionsAdded = 0u;
+
+   numberOfOptions = ( numberOfOptions*2 ) - 1 ; // Last Option does not get a divider so -1 or if only one option then also no divider
+
+   mTableOfButtons = Dali::Toolkit::TableView::New( 1, numberOfOptions );
+
    for( std::vector<ButtonRequirement>::const_iterator it = mOrderListOfButtons.begin(), endIt = mOrderListOfButtons.end(); ( it != endIt ); ++it )
    {
      const ButtonRequirement& button( *it );
      if ( button.enabled )
      {
-       ++optionsAdded;
-       AddOption( mButtons, button.name, button.caption, button.icon, optionsAdded == numberOfOptions, mShowIcons );
+       AddOption( mTableOfButtons, button.name, button.caption, button.icon, optionsAdded == numberOfOptions - 1, showIcons, showCaptions, optionsAdded ); // -1 to ignore the last divider
      }
    }
-
-   // Calculate the size of the whole popup which may not be all visible.
-   mRequiredPopUpSize = Size( std::min( mMaxSize.width, mContentSize.width + mNinePatchMargins.x + mNinePatchMargins.y ), DEFAULT_POPUP_MAX_SIZE.height );
-
-   // Size of the contents within the popup
-   mVisiblePopUpSize = Size( mRequiredPopUpSize.width - mNinePatchMargins.x - mNinePatchMargins.y, mRequiredPopUpSize.height - mNinePatchMargins.z - mNinePatchMargins.w );
  }
 
  void TextSelectionPopup::CreatePopup()
@@ -626,15 +580,15 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part )
    {
      CreateOrderedListOfPopupOptions();  //todo Currently causes all options to be shown
      CreateBackground();
-     AddPopupOptions( true, true );
-     SetUpPopup( mVisiblePopUpSize );
+     AddPopupOptions( true, true, false );  // todo false so not to show Labels until ellipses or similar possible.
+     SetUpPopup();
    }
 
    mStencilLayer.RaiseToTop();
  }
 
 TextSelectionPopup::TextSelectionPopup()
-: Control( ControlBehaviour( CONTROL_BEHAVIOUR_NONE ) ),
+: Control( ControlBehaviour( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ) ),
   mMaxSize ( DEFAULT_POPUP_MAX_SIZE ),
   mVisiblePopUpSize( DEFAULT_POPUP_MAX_SIZE ),
   mRequiredPopUpSize( DEFAULT_POPUP_MAX_SIZE ),
@@ -651,7 +605,8 @@ TextSelectionPopup::TextSelectionPopup()
   mCopyOptionPriority ( 4 ),
   mPasteOptionPriority ( 5 ),
   mClipboardOptionPriority( 6 ),
-  mShowIcons( true )
+  mShowIcons( true ),
+  mShowCaptions( false )
 {
 }
 
index ffca9dd..0753579 100644 (file)
@@ -20,6 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/public-api/controls/table-view/table-view.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-selection-popup.h>
 
 // EXTERNAL INCLUDES
@@ -119,7 +120,6 @@ public:
 
   /**
    * @brief Called when a property of an object of this type is set.
-   *
    * @param[in] object The object whose property is set.
    * @param[in] index The property index.
    * @param[in] value The new property value.
@@ -203,11 +203,11 @@ private: // From Control
 
   void CreateBackground();
 
-  void AddOption( Actor& parent, const std::string& name, const std::string& caption, const Image iconImage, bool finalOption, bool showIcons );
+  void AddOption( Dali::Toolkit::TableView& parent, const std::string& name, const std::string& caption, const Image iconImage, bool finalOption, bool showIcons, bool showCaption, std::size_t& indexInTable  );
 
-  void SetUpPopup( Size& size );
+  void SetUpPopup();
 
-  void AddPopupOptions( bool createTail, bool showIcons );
+  void AddPopupOptions( bool createTail, bool showIcons, bool showCaptions );
 
 private: // Implementation
 
@@ -229,7 +229,7 @@ private:
 
 private: // Data
 
-  Actor mButtons;                                     // Actor which holds all the buttons, sensitivity can be set oActor buttons via this actor
+  Dali::Toolkit::TableView mTableOfButtons;                          // Actor which holds all the buttons, sensitivity can be set on buttons via this actor
   Layer mStencilLayer;                                // Layer to enable clipping when buttons exceed popup
 
   // Images to be used by the Popup
@@ -274,6 +274,7 @@ private: // Data
   std::size_t mClipboardOptionPriority; // Position of Clipboard button
 
   bool mShowIcons; // Flag to show icons
+  bool mShowCaptions; // Flag to show text captions
 
 };
 
index 0bcfe26..7ba35c5 100644 (file)
@@ -296,7 +296,7 @@ void ToolBar::RemoveControl( Actor control )
 }
 
 ToolBar::ToolBar()
-: Control( CONTROL_BEHAVIOUR_NONE ),
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
   mLayout(),
   mLeftOffset( 0 ),
   mCenterBase( 1 ),
index 19dd781..70a2a15 100644 (file)
@@ -44,7 +44,7 @@ BaseHandle Create()
 
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::View, Toolkit::Control, Create )
 
-DALI_SIGNAL_REGISTRATION( View, "orientation-animation-start", SIGNAL_ORIENTATION_ANIMATION_START )
+DALI_SIGNAL_REGISTRATION( Toolkit, View, "orientation-animation-start", SIGNAL_ORIENTATION_ANIMATION_START )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -162,10 +162,10 @@ void View::SetBackground( ImageActor backgroundImage )
 
 void View::SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree landscapeInverse )
 {
-  mOrientationFunction[View::PORTRAIT] = portrait;
-  mOrientationFunction[View::LANDSCAPE] = landscale;
-  mOrientationFunction[View::PORTRAIT_INVERSE] = portraitInverse;
-  mOrientationFunction[View::LANDSCAPE_INVERSE] = landscapeInverse;
+  mOrientationFunction[View::PORTRAIT] = portrait.degree;
+  mOrientationFunction[View::LANDSCAPE] = landscale.degree;
+  mOrientationFunction[View::PORTRAIT_INVERSE] = portraitInverse.degree;
+  mOrientationFunction[View::LANDSCAPE_INVERSE] = landscapeInverse.degree;
 }
 
 void View::OrientationChanged( Dali::Orientation orientation )
@@ -182,7 +182,7 @@ void View::OrientationChanged( Dali::Orientation orientation )
 
   // has parent so we expect it to be on stage
   mRotateAnimation = Animation::New( ROTATION_ANIMATION_DURATION );
-  mRotateAnimation.AnimateTo( Property( self, Actor::Property::ORIENTATION ), Quaternion( -orientation.GetRadians(), Vector3::ZAXIS ), AlphaFunctions::EaseOut );
+  mRotateAnimation.AnimateTo( Property( self, Actor::Property::ORIENTATION ), Quaternion( Radian( -orientation.GetRadians() ), Vector3::ZAXIS ), AlphaFunctions::EaseOut );
 
   // Resize the view
   if( mFullScreen )
@@ -267,7 +267,7 @@ bool View::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* trac
 }
 
 View::View(bool fullscreen)
-: Control( CONTROL_BEHAVIOUR_NONE ),
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
   mOrientation( -1 ),
   mFullScreen(fullscreen),
   mContentLayers(),
@@ -300,19 +300,19 @@ View::Orientation View::DegreeToViewOrientation( Degree degree )
 {
   View::Orientation orientation = PORTRAIT;
 
-  if( fabsf( mOrientationFunction[PORTRAIT] - degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT], degree ) )
+  if( fabsf( mOrientationFunction[PORTRAIT] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT], degree.degree ) )
   {
     orientation =  PORTRAIT;
   }
-  else if( fabsf( mOrientationFunction[LANDSCAPE] - degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE], degree ) )
+  else if( fabsf( mOrientationFunction[LANDSCAPE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE], degree.degree ) )
   {
     orientation = LANDSCAPE;
   }
-  else if( fabsf( mOrientationFunction[PORTRAIT_INVERSE] - degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT_INVERSE], degree ) )
+  else if( fabsf( mOrientationFunction[PORTRAIT_INVERSE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT_INVERSE], degree.degree ) )
   {
     orientation = PORTRAIT_INVERSE;
   }
-  else if( fabsf( mOrientationFunction[LANDSCAPE_INVERSE] - degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE_INVERSE], degree ) )
+  else if( fabsf( mOrientationFunction[LANDSCAPE_INVERSE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE_INVERSE], degree.degree ) )
   {
     orientation = LANDSCAPE_INVERSE;
   }
index 838592c..34350b1 100644 (file)
@@ -82,6 +82,7 @@ toolkit_src_files = \
    $(toolkit_src_dir)/text/shaper.cpp \
    $(toolkit_src_dir)/text/text-control-interface.cpp \
    $(toolkit_src_dir)/text/text-controller.cpp \
+   $(toolkit_src_dir)/text/text-controller-impl.cpp \
    $(toolkit_src_dir)/text/text-io.cpp \
    $(toolkit_src_dir)/text/text-view.cpp \
    $(toolkit_src_dir)/text/text-view-interface.cpp \
index 5b0bcb5..b054f2d 100644 (file)
@@ -78,10 +78,10 @@ BaseHandle Create()
 
 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 )
+DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboard-pre-focus-change",        SIGNAL_PRE_FOCUS_CHANGE        )
+DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboard-focus-changed",           SIGNAL_FOCUS_CHANGED           )
+DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboard-focus-group-changed",     SIGNAL_FOCUS_GROUP_CHANGED     )
+DALI_SIGNAL_REGISTRATION( Toolkit, KeyboardFocusManager, "keyboard-focused-actor-activated", SIGNAL_FOCUSED_ACTOR_ACTIVATED )
 
 DALI_TYPE_REGISTRATION_END()
 
index 7a79e4c..8b0f77f 100644 (file)
@@ -97,7 +97,6 @@ void Clipper::Initialize( const Vector2& size )
 
   // Create a root actor and an image actor for offscreen rendering.
   mOffscreenRootActor = Layer::New();
-  mOffscreenRootActor.SetRelayoutEnabled( false );
   mOffscreenRootActor.SetColorMode( USE_OWN_COLOR );
   mOffscreenRootActor.SetPositionInheritanceMode( DONT_INHERIT_POSITION );
   mOffscreenRootActor.SetInheritScale( false );
@@ -105,7 +104,6 @@ void Clipper::Initialize( const Vector2& size )
   mOffscreenRootActor.SetSize( offscreenSize );
 
   mImageActor = ImageActor::New();
-  mImageActor.SetRelayoutEnabled( false );
   mImageActor.SetParentOrigin( ParentOrigin::CENTER );
   mImageActor.SetBlendFunc( BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA,
                             BlendingFactor::ONE, BlendingFactor::ONE );
index 67ae642..c324edc 100644 (file)
 #include <dali-toolkit/internal/text/decorator/text-decorator.h>
 
 // EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/actors/mesh-actor.h>
+#include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/constants.h>
+#include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/tap-gesture.h>
 #include <dali/public-api/events/tap-gesture-detector.h>
 #include <dali/public-api/events/pan-gesture.h>
 #include <dali/public-api/geometry/mesh.h>
 #include <dali/public-api/geometry/mesh-data.h>
 #include <dali/public-api/images/resource-image.h>
+#include <dali/public-api/math/rect.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector4.h>
-//#include <dali/public-api/images/nine-patch-image.h>
+#include <dali/public-api/object/property-notification.h>
 #include <dali/public-api/signals/connection-tracker.h>
 
 // INTERNAL INCLUDES
 
 #ifdef DEBUG_ENABLED
 #define DECORATOR_DEBUG
+
+#endif
+
+namespace Dali
+{
+namespace Internal
+{
+namespace
+{
+#ifdef DECORATOR_DEBUG
+Integration::Log::Filter* gLogFilter( Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_TEXT_DECORATOR") );
 #endif
+}
+}
+}
+
 
 // Local Data
 namespace
@@ -62,8 +81,9 @@ const char* DEFAULT_SELECTION_HANDLE_TWO( DALI_IMAGE_DIR "text-input-selection-h
 const Dali::Vector3 DEFAULT_GRAB_HANDLE_RELATIVE_SIZE( 1.5f, 2.0f, 1.0f );
 const Dali::Vector3 DEFAULT_SELECTION_HANDLE_RELATIVE_SIZE( 1.5f, 1.5f, 1.0f );
 
-const std::size_t CURSOR_BLINK_INTERVAL = 500; // Cursor blink interval
-const std::size_t MILLISECONDS = 1000;
+const unsigned int CURSOR_BLINK_INTERVAL = 500u; // Cursor blink interval
+const float TO_MILLISECONDS = 1000.f;
+const float TO_SECONDS = 1.f / 1000.f;
 
 const float DISPLAYED_HIGHLIGHT_Z_OFFSET( -0.05f );
 
@@ -98,6 +118,26 @@ struct QuadCoordinates
 
 typedef std::vector<QuadCoordinates> QuadContainer;
 
+/**
+ * @brief Takes a bounding rectangle in the local coordinates of an actor and returns the world coordinates Bounding Box.
+ * @param[in] boundingRectangle local bounding
+ * @param[out] Vector4 World coordinate bounding Box.
+ */
+void LocalToWorldCoordinatesBoundingBox( const Dali::Rect<int>& boundingRectangle, Dali::Vector4& boundingBox )
+{
+  // Convert to world coordinates and store as a Vector4 to be compatible with Property Notifications.
+  Dali::Vector2 stageSize = Dali::Stage::GetCurrent().GetSize();
+
+  const float originX = boundingRectangle.x - 0.5f * stageSize.width;
+  const float originY = boundingRectangle.y - 0.5f * stageSize.height;
+
+  boundingBox = Dali::Vector4( originX,
+                               originY,
+                               originX + boundingRectangle.width,
+                               originY + boundingRectangle.height );
+}
+
+
 } // end of namespace
 
 namespace Dali
@@ -114,64 +154,59 @@ struct Decorator::Impl : public ConnectionTracker
   struct CursorImpl
   {
     CursorImpl()
-    : x(0.0f),
-      y(0.0f),
-      cursorHeight(0.0f),
-      lineHeight(0.0f),
-      color(Dali::Color::WHITE)
+    : color( Dali::Color::WHITE ),
+      position(),
+      cursorHeight( 0.0f ),
+      lineHeight( 0.0f )
     {
     }
 
-    float x;
-    float y;
+    Vector4 color;
+    Vector2 position;
     float cursorHeight;
     float lineHeight;
-
-    Vector4 color;
   };
 
   struct SelectionHandleImpl
   {
     SelectionHandleImpl()
-    : x(0.0f),
-      y(0.0f),
-      lineHeight(0.0f),
-      flipped(false)
+    : position(),
+      lineHeight( 0.0f ),
+      flipped( false )
     {
     }
 
-    float x;
-    float y;
-    float lineHeight; ///< Not the handle height
-    bool flipped;
-
     ImageActor actor;
     Actor grabArea;
 
     Image pressedImage;
     Image releasedImage;
+
+    Vector2 position;
+    float lineHeight; ///< Not the handle height
+    bool flipped;
   };
 
   Impl( Dali::Toolkit::Internal::Control& parent, Observer& observer )
-  : mTextControlParent(parent),
-    mObserver(observer),
-    mActiveCursor(ACTIVE_CURSOR_NONE),
-    mActiveGrabHandle(false),
-    mActiveSelection( false ),
-    mActiveCopyPastePopup( false ),
+  : mTextControlParent( parent ),
+    mObserver( observer ),
+    mBoundingBox( Rect<int>() ),
+    mHighlightColor( 0.07f, 0.41f, 0.59f, 1.0f ), // light blue
+    mActiveCursor( ACTIVE_CURSOR_NONE ),
     mCursorBlinkInterval( CURSOR_BLINK_INTERVAL ),
     mCursorBlinkDuration( 0.0f ),
-    mCursorBlinkStatus( true ),
     mGrabDisplacementX( 0.0f ),
     mGrabDisplacementY( 0.0f ),
-    mHighlightColor( 0.07f, 0.41f, 0.59f, 1.0f ), // light blue
-    mBoundingBox( Rect<int>() )
+    mActiveGrabHandle( false ),
+    mActiveSelection( false ),
+    mActiveCopyPastePopup( false ),
+    mCursorBlinkStatus( true )
   {
   }
 
   /**
    * Relayout of the decorations owned by the decorator.
-   * @param[in] size The Size of the UI control the decorater is adding it's decorations to.
+   * @param[in] size The Size of the UI control the decorator is adding it's decorations to.
    */
   void Relayout( const Vector2& size, const Vector2& scrollPosition )
   {
@@ -182,14 +217,14 @@ struct Decorator::Impl : public ConnectionTracker
     CreateCursors();
     if( mPrimaryCursor )
     {
-      mPrimaryCursor.SetPosition( mCursor[PRIMARY_CURSOR].x + scrollPosition.x,
-                                  mCursor[PRIMARY_CURSOR].y + scrollPosition.y );
+      mPrimaryCursor.SetPosition( mCursor[PRIMARY_CURSOR].position.x + scrollPosition.x,
+                                  mCursor[PRIMARY_CURSOR].position.y + scrollPosition.y );
       mPrimaryCursor.SetSize( Size( 1.0f, mCursor[PRIMARY_CURSOR].cursorHeight ) );
     }
     if( mSecondaryCursor )
     {
-      mSecondaryCursor.SetPosition( mCursor[SECONDARY_CURSOR].x + scrollPosition.x,
-                                    mCursor[SECONDARY_CURSOR].y + scrollPosition.y );
+      mSecondaryCursor.SetPosition( mCursor[SECONDARY_CURSOR].position.x + scrollPosition.x,
+                                    mCursor[SECONDARY_CURSOR].position.y + scrollPosition.y );
       mSecondaryCursor.SetSize( Size( 1.0f, mCursor[SECONDARY_CURSOR].cursorHeight ) );
     }
 
@@ -200,8 +235,8 @@ struct Decorator::Impl : public ConnectionTracker
 
       CreateGrabHandle();
 
-      mGrabHandle.SetPosition( mCursor[PRIMARY_CURSOR].x + scrollPosition.x,
-                               mCursor[PRIMARY_CURSOR].lineHeight + scrollPosition.y );
+      mGrabHandle.SetPosition( mCursor[PRIMARY_CURSOR].position.x + scrollPosition.x,
+                               mCursor[PRIMARY_CURSOR].position.y + mCursor[PRIMARY_CURSOR].lineHeight + scrollPosition.y );
     }
     else if( mGrabHandle )
     {
@@ -216,12 +251,12 @@ struct Decorator::Impl : public ConnectionTracker
       CreateSelectionHandles();
 
       SelectionHandleImpl& primary = mSelectionHandle[ PRIMARY_SELECTION_HANDLE ];
-      primary.actor.SetPosition( primary.x + scrollPosition.x,
-                                 primary.lineHeight + scrollPosition.y );
+      primary.actor.SetPosition( primary.position.x + scrollPosition.x,
+                                 primary.position.y + primary.lineHeight + scrollPosition.y );
 
       SelectionHandleImpl& secondary = mSelectionHandle[ SECONDARY_SELECTION_HANDLE ];
-      secondary.actor.SetPosition( secondary.x + scrollPosition.x,
-                                   secondary.lineHeight + scrollPosition.y );
+      secondary.actor.SetPosition( secondary.position.x + scrollPosition.x,
+                                   secondary.position.y + secondary.lineHeight + scrollPosition.y );
 
       CreateHighlight();
       UpdateHighlight();
@@ -238,9 +273,13 @@ struct Decorator::Impl : public ConnectionTracker
       if ( !mCopyPastePopup )
       {
         mCopyPastePopup = TextSelectionPopup::New();
+#ifdef DECORATOR_DEBUG
+        mCopyPastePopup.SetName("mCopyPastePopup");
+#endif
+        mCopyPastePopup.SetAnchorPoint( AnchorPoint::CENTER );
+        mCopyPastePopup.OnRelayoutSignal().Connect( this,  &Decorator::Impl::PopUpRelayoutComplete  ); // Position popup after size negotiation
         mActiveLayer.Add ( mCopyPastePopup );
       }
-      mCopyPastePopup.SetPosition( Vector3( 200.0f, -100.0f, 0.0f ) ); //todo grabhandle or selection handle positions to be used
     }
     else
     {
@@ -251,12 +290,28 @@ struct Decorator::Impl : public ConnectionTracker
     }
   }
 
+  void PopUpRelayoutComplete( Actor actor )
+  {
+    // Size negotiation for CopyPastePopup complete so can get the size and constrain position within bounding box.
+
+    mCopyPastePopup.OnRelayoutSignal().Disconnect( this, &Decorator::Impl::PopUpRelayoutComplete  );
+
+    Vector3 popupPosition( mCursor[PRIMARY_CURSOR].position.x, mCursor[PRIMARY_CURSOR].position.y -100.0f , 0.0f); //todo 100 to be an offset Property
+
+    Vector3 popupSize = Vector3( mCopyPastePopup.GetRelayoutSize( Dimension::WIDTH ), mCopyPastePopup.GetRelayoutSize( Dimension::HEIGHT ), 0.0f );
+
+    GetConstrainedPopupPosition( popupPosition, popupSize, AnchorPoint::CENTER, mActiveLayer, mBoundingBox );
+
+    SetUpPopUpPositionNotifications();
+
+    mCopyPastePopup.SetPosition( popupPosition ); //todo grabhandle(cursor) or selection handle positions to be used
+  }
+
   void CreateCursor( ImageActor& cursor )
   {
     cursor = CreateSolidColorActor( Color::WHITE );
     cursor.SetParentOrigin( ParentOrigin::TOP_LEFT ); // Need to set the default parent origin as CreateSolidColorActor() sets a different one.
     cursor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-    cursor.SetRelayoutEnabled( false );
   }
 
   // Add or Remove cursor(s) from parent
@@ -279,7 +334,7 @@ struct Decorator::Impl : public ConnectionTracker
 #ifdef DECORATOR_DEBUG
           mPrimaryCursor.SetName( "PrimaryCursorActor" );
 #endif
-          mActiveLayer.Add( mPrimaryCursor);
+          mActiveLayer.Add( mPrimaryCursor );
         }
       }
 
@@ -291,7 +346,7 @@ struct Decorator::Impl : public ConnectionTracker
 #ifdef DECORATOR_DEBUG
           mSecondaryCursor.SetName( "SecondaryCursorActor" );
 #endif
-          mActiveLayer.Add( mSecondaryCursor);
+          mActiveLayer.Add( mSecondaryCursor );
         }
       }
       else
@@ -364,19 +419,25 @@ struct Decorator::Impl : public ConnectionTracker
       }
 
       mGrabHandle = ImageActor::New( mGrabHandleImage );
-#ifdef DECORATOR_DEBUG
-      mGrabHandle.SetName( "GrabHandleActor" );
-#endif
       mGrabHandle.SetAnchorPoint( AnchorPoint::TOP_CENTER );
       mGrabHandle.SetDrawMode( DrawMode::OVERLAY );
       // Area that Grab handle responds to, larger than actual handle so easier to move
 #ifdef DECORATOR_DEBUG
-     mGrabArea = Toolkit::CreateSolidColorActor( Vector4(0.0f, 0.0f, 0.0f, 0.0f), true, Color::RED, 1 );
-     mGrabArea.SetName( "GrabArea" );
+      mGrabHandle.SetName( "GrabHandleActor" );
+      if ( Dali::Internal::gLogFilter->IsEnabledFor( Debug::Verbose ) )
+      {
+        mGrabArea = Toolkit::CreateSolidColorActor( Vector4(0.0f, 0.0f, 0.0f, 0.0f), true, Color::RED, 1 );
+        mGrabArea.SetName( "GrabArea" );
+      }
+      else
+      {
+        mGrabArea = Actor::New();
+        mGrabArea.SetName( "GrabArea" );
+      }
 #else
       mGrabArea = Actor::New();
-      mGrabArea.SetRelayoutEnabled( true );
 #endif
+
       mGrabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
       mGrabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
       mGrabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
@@ -386,7 +447,7 @@ struct Decorator::Impl : public ConnectionTracker
       mTapDetector.Attach( mGrabArea );
       mPanGestureDetector.Attach( mGrabArea );
 
-      mActiveLayer.Add(mGrabHandle);
+      mActiveLayer.Add( mGrabHandle );
     }
   }
 
@@ -409,7 +470,6 @@ struct Decorator::Impl : public ConnectionTracker
       primary.flipped = false;
 
       primary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
-      primary.grabArea.SetRelayoutEnabled( true );
 #ifdef DECORATOR_DEBUG
       primary.grabArea.SetName("SelectionHandleOneGrabArea");
 #endif
@@ -442,7 +502,6 @@ struct Decorator::Impl : public ConnectionTracker
       secondary.flipped = false;
 
       secondary.grabArea = Actor::New(); // Area that Grab handle responds to, larger than actual handle so easier to move
-      secondary.grabArea.SetRelayoutEnabled( true );
 #ifdef DECORATOR_DEBUG
       secondary.grabArea.SetName("SelectionHandleTwoGrabArea");
 #endif
@@ -597,8 +656,8 @@ struct Decorator::Impl : public ConnectionTracker
       mGrabDisplacementX += gesture.displacement.x;
       mGrabDisplacementY += gesture.displacement.y;
 
-      float x = mCursor[PRIMARY_CURSOR].x + mGrabDisplacementX;
-      float y = mCursor[PRIMARY_CURSOR].y + mCursor[PRIMARY_CURSOR].lineHeight*0.5f + mGrabDisplacementY;
+      const float x = mCursor[PRIMARY_CURSOR].position.x + mGrabDisplacementX;
+      const float y = mCursor[PRIMARY_CURSOR].position.y + mCursor[PRIMARY_CURSOR].lineHeight*0.5f + mGrabDisplacementY;
 
       if( Gesture::Started    == gesture.state ||
           Gesture::Continuing == gesture.state )
@@ -625,50 +684,142 @@ struct Decorator::Impl : public ConnectionTracker
     return false;
   }
 
+  // Popup
 
-  Internal::Control& mTextControlParent;
-  Observer& mObserver;
+  float AlternatePopUpPositionRelativeToCursor()
+  {
+    float alternativePosition=0.0f;;
+
+    if ( mPrimaryCursor ) // Secondary cursor not used for paste
+    {
+      Cursor cursor = PRIMARY_CURSOR;
+      alternativePosition = mCursor[cursor].position.y;
+    }
 
-  Layer mActiveLayer; // Layer for active handles and alike that ensures they are above all else.
+    const float popupHeight = 120.0f; // todo Set as a MaxSize Property in Control or retrieve from CopyPastePopup class.
 
-  unsigned int mActiveCursor;
-  bool         mActiveGrabHandle;
-  bool         mActiveSelection;
-  bool         mActiveCopyPastePopup;
+    if( mActiveGrabHandle )
+    {
+      // If grab handle enabled then position pop-up below the grab handle.
+      const Vector2 grabHandleSize( 59.0f, 56.0f ); // todo
+      const float BOTTOM_HANDLE_BOTTOM_OFFSET = 1.5; //todo Should be a property
+      alternativePosition +=  grabHandleSize.height  + popupHeight + BOTTOM_HANDLE_BOTTOM_OFFSET ;
+    }
+    else
+    {
+      alternativePosition += popupHeight;
+    }
 
-  CursorImpl mCursor[CURSOR_COUNT];
+    return alternativePosition;
+  }
 
-  Timer mCursorBlinkTimer; // Timer to signal cursor to blink
-  unsigned int mCursorBlinkInterval;
-  float mCursorBlinkDuration;
-  bool mCursorBlinkStatus; // Flag to switch between blink on and blink off
+  void PopUpLeavesVerticalBoundary( PropertyNotification& source )
+  {
+    float alternativeYPosition=0.0f;
+  // todo
+  //  if( mHighlightMeshActor ) // Text Selection mode
+  //  {
+  //    alternativePosition = AlternatePopUpPositionRelativeToSelectionHandles();
+  //  }
+  //  else // Not in Text Selection mode
+  //  {
+    // if can't be positioned above, then position below row.
+    alternativeYPosition = AlternatePopUpPositionRelativeToCursor();
+   // }
+    mCopyPastePopup.SetY( alternativeYPosition );
+  }
 
-  ImageActor mPrimaryCursor;
-  ImageActor mSecondaryCursor;
 
-  ImageActor mGrabHandle;
-  Actor mGrabArea;
-  float mGrabDisplacementX;
-  float mGrabDisplacementY;
+  void SetUpPopUpPositionNotifications( )
+  {
+    // Note Property notifications ignore any set anchor point so conditions must allow for this.  Default is Top Left.
 
-  SelectionHandleImpl mSelectionHandle[SELECTION_HANDLE_COUNT];
+    // Exceeding vertical boundary
 
-  MeshActor         mHighlightMeshActor;        ///< Mesh Actor to display highlight
-  Mesh              mHighlightMesh;             ///< Mesh for highlight
-  MeshData          mHighlightMeshData;         ///< Mesh Data for highlight
-  Material          mHighlightMaterial;         ///< Material used for highlight
-  Vector4           mHighlightColor;            ///< Color of the highlight
-  QuadContainer     mHighlightQuadList;         ///< Sub-selections that combine to create the complete selection highlight
+    Vector4 worldCoordinatesBoundingBox;
+    LocalToWorldCoordinatesBoundingBox( mBoundingBox, worldCoordinatesBoundingBox );
 
-  TextSelectionPopup mCopyPastePopup;
+    float popupHeight = mCopyPastePopup.GetRelayoutSize( Dimension::HEIGHT);
+
+    PropertyNotification verticalExceedNotification = mCopyPastePopup.AddPropertyNotification( Actor::Property::WORLD_POSITION_Y,
+                                                      OutsideCondition( worldCoordinatesBoundingBox.y + popupHeight/2,
+                                                                        worldCoordinatesBoundingBox.w - popupHeight/2 ) );
+
+    verticalExceedNotification.NotifySignal().Connect( this, &Decorator::Impl::PopUpLeavesVerticalBoundary );
+  }
+
+  void GetConstrainedPopupPosition( Vector3& requiredPopupPosition, Vector3& popupSize, Vector3 anchorPoint, Actor& parent, Rect<int>& boundingBox )
+  {
+    DALI_ASSERT_DEBUG ( "Popup parent not on stage" && parent.OnStage() )
+
+    // Parent must already by added to Stage for these Get calls to work
+    Vector3 parentAnchorPoint = parent.GetCurrentAnchorPoint();
+    Vector3 parentWorldPositionLeftAnchor = parent.GetCurrentWorldPosition() - parent.GetCurrentSize()*parentAnchorPoint;
+    Vector3 popupWorldPosition = parentWorldPositionLeftAnchor + requiredPopupPosition;  // Parent World position plus popup local position gives World Position
+    Vector3 popupDistanceFromAnchorPoint = popupSize*anchorPoint;
+
+    // Bounding rectangle is supplied as screen coordinates, bounding will be done in world coordinates.
+    Vector4 boundingRectangleWorld;
+    LocalToWorldCoordinatesBoundingBox( boundingBox, boundingRectangleWorld );
+
+    // Calculate distance to move popup (in local space) so fits within the boundary
+    float xOffSetToKeepWithinBounds = 0.0f;
+    if( popupWorldPosition.x - popupDistanceFromAnchorPoint.x < boundingRectangleWorld.x )
+    {
+      xOffSetToKeepWithinBounds = boundingRectangleWorld.x - ( popupWorldPosition.x - popupDistanceFromAnchorPoint.x );
+    }
+    else if ( popupWorldPosition.x +  popupDistanceFromAnchorPoint.x > boundingRectangleWorld.z )
+    {
+      xOffSetToKeepWithinBounds = boundingRectangleWorld.z - ( popupWorldPosition.x +  popupDistanceFromAnchorPoint.x );
+    }
+
+    // Ensure initial display of Popup is in alternative position if can not fit above. As Property notification will be a frame behind.
+    if ( popupWorldPosition.y - popupDistanceFromAnchorPoint.y < boundingRectangleWorld.y )
+    {
+      requiredPopupPosition.y = AlternatePopUpPositionRelativeToCursor();
+    }
+
+    requiredPopupPosition.x = requiredPopupPosition.x + xOffSetToKeepWithinBounds;
+  }
+
+  Internal::Control&  mTextControlParent;
+  Observer&           mObserver;
+
+  TapGestureDetector  mTapDetector;
+  PanGestureDetector  mPanGestureDetector;
+  Timer               mCursorBlinkTimer;          ///< Timer to signal cursor to blink
+
+  Layer               mActiveLayer;               ///< Layer for active handles and alike that ensures they are above all else.
+  ImageActor          mPrimaryCursor;
+  ImageActor          mSecondaryCursor;
+  ImageActor          mGrabHandle;
+  Actor               mGrabArea;
+  MeshActor           mHighlightMeshActor;        ///< Mesh Actor to display highlight
+  TextSelectionPopup  mCopyPastePopup;
+
+  Image               mCursorImage;
+  Image               mGrabHandleImage;
+  Mesh                mHighlightMesh;             ///< Mesh for highlight
+  MeshData            mHighlightMeshData;         ///< Mesh Data for highlight
+  Material            mHighlightMaterial;         ///< Material used for highlight
+
+  CursorImpl          mCursor[CURSOR_COUNT];
+  SelectionHandleImpl mSelectionHandle[SELECTION_HANDLE_COUNT];
+  QuadContainer       mHighlightQuadList;         ///< Sub-selections that combine to create the complete selection highlight
 
-  Image mCursorImage;
-  Image mGrabHandleImage;
+  Rect<int>           mBoundingBox;
+  Vector4             mHighlightColor;            ///< Color of the highlight
 
-  TapGestureDetector mTapDetector;
-  PanGestureDetector mPanGestureDetector;
+  unsigned int        mActiveCursor;
+  unsigned int        mCursorBlinkInterval;
+  float               mCursorBlinkDuration;
+  float               mGrabDisplacementX;
+  float               mGrabDisplacementY;
 
-  Rect<int> mBoundingBox;
+  bool                mActiveGrabHandle:1;
+  bool                mActiveSelection:1;
+  bool                mActiveCopyPastePopup:1;
+  bool                mCursorBlinkStatus:1;       ///< Flag to switch between blink on and blink off
 };
 
 DecoratorPtr Decorator::New( Internal::Control& parent, Observer& observer )
@@ -706,19 +857,19 @@ unsigned int Decorator::GetActiveCursor() const
 void Decorator::SetPosition( Cursor cursor, float x, float y, float cursorHeight, float lineHeight )
 {
   // Adjust grab handle displacement
-  mImpl->mGrabDisplacementX -= x - mImpl->mCursor[cursor].x;
-  mImpl->mGrabDisplacementY -= y - mImpl->mCursor[cursor].y;
+  mImpl->mGrabDisplacementX -= x - mImpl->mCursor[cursor].position.x;
+  mImpl->mGrabDisplacementY -= y - mImpl->mCursor[cursor].position.y;
 
-  mImpl->mCursor[cursor].x = x;
-  mImpl->mCursor[cursor].y = y;
+  mImpl->mCursor[cursor].position.x = x;
+  mImpl->mCursor[cursor].position.y = y;
   mImpl->mCursor[cursor].cursorHeight = cursorHeight;
   mImpl->mCursor[cursor].lineHeight = lineHeight;
 }
 
 void Decorator::GetPosition( Cursor cursor, float& x, float& y, float& cursorHeight, float& lineHeight ) const
 {
-  x = mImpl->mCursor[cursor].x;
-  y = mImpl->mCursor[cursor].y;
+  x = mImpl->mCursor[cursor].position.x;
+  y = mImpl->mCursor[cursor].position.y;
   cursorHeight = mImpl->mCursor[cursor].cursorHeight;
   lineHeight = mImpl->mCursor[cursor].lineHeight;
 }
@@ -757,12 +908,12 @@ void Decorator::StopCursorBlink()
 
 void Decorator::SetCursorBlinkInterval( float seconds )
 {
-  mImpl->mCursorBlinkInterval = seconds*MILLISECONDS; // Convert to milliseconds
+  mImpl->mCursorBlinkInterval = static_cast<unsigned int>( seconds * TO_MILLISECONDS ); // Convert to milliseconds
 }
 
 float Decorator::GetCursorBlinkInterval() const
 {
-  return mImpl->mCursorBlinkInterval;
+  return static_cast<float>( mImpl->mCursorBlinkInterval ) * TO_SECONDS;
 }
 
 void Decorator::SetCursorBlinkDuration( float seconds )
@@ -811,15 +962,15 @@ bool Decorator::IsSelectionActive() const
 
 void Decorator::SetPosition( SelectionHandle handle, float x, float y, float height )
 {
-  mImpl->mSelectionHandle[handle].x = x;
-  mImpl->mSelectionHandle[handle].y = y;
+  mImpl->mSelectionHandle[handle].position.x = x;
+  mImpl->mSelectionHandle[handle].position.y = y;
   mImpl->mSelectionHandle[handle].lineHeight = height;
 }
 
 void Decorator::GetPosition( SelectionHandle handle, float& x, float& y, float& height ) const
 {
-  x = mImpl->mSelectionHandle[handle].x;
-  y = mImpl->mSelectionHandle[handle].y;
+  x = mImpl->mSelectionHandle[handle].position.x;
+  y = mImpl->mSelectionHandle[handle].position.y;
   height = mImpl->mSelectionHandle[handle].lineHeight;
 }
 
index 939c815..9f2c693 100644 (file)
@@ -198,7 +198,7 @@ public:
   void SetPosition( Cursor cursor, float x, float y, float cursorHeight, float lineHeight );
 
   /**
-   * @brief Retrieves the position of a cursor.
+   * @brief Retrieves the position, height and lineHeight of a cursor.
    *
    * @param[in] cursor The cursor to get.
    * @param[out] x The x position relative to the top-left of the parent control.
@@ -371,7 +371,6 @@ public:
    */
   bool IsPopupActive() const;
 
-
 protected:
 
   /**
index 16fdc8a..734b82a 100644 (file)
@@ -110,13 +110,18 @@ void AtlasGlyphManager::Cached( Text::FontId fontId,
 
 Vector2 AtlasGlyphManager::GetAtlasSize( uint32_t atlasId )
 {
-  return mAtlasManager.GetAtlasSize( atlasId );
+  Toolkit::AtlasManager::AtlasSize size = mAtlasManager.GetAtlasSize( atlasId );
+  return Vector2( static_cast< float >( size.mWidth ), static_cast< float >( size.mHeight ) );
 }
 
-void AtlasGlyphManager::SetNewAtlasSize( const Vector2& size,
-                                         const Vector2& blockSize )
+void AtlasGlyphManager::SetNewAtlasSize( uint32_t width, uint32_t height, uint32_t blockWidth, uint32_t blockHeight )
 {
-    mAtlasManager.SetNewAtlasSize( size, blockSize );
+  Toolkit::AtlasManager::AtlasSize size;
+  size.mWidth = width;
+  size.mHeight = height;
+  size.mBlockWidth = blockWidth;
+  size.mBlockHeight = blockHeight;
+  mAtlasManager.SetNewAtlasSize( size );
 }
 
 void AtlasGlyphManager::Remove( uint32_t imageId )
index 5068426..cbbe732 100644 (file)
@@ -100,8 +100,7 @@ public:
   /**
    * @copydoc Toolkit::AtlasGlyphManager::SetNewAtlasSize
    */
-  void SetNewAtlasSize( const Vector2& size,
-                        const Vector2& blockSize );
+  void SetNewAtlasSize( uint32_t width, uint32_t height, uint32_t blockWidth, uint32_t blockHeight );
 
   /**
    * @copydoc Toolkit::AtlasGlyphManager::Remove
index d46ef18..ccb0efc 100644 (file)
@@ -98,10 +98,9 @@ void AtlasGlyphManager::Cached( Text::FontId fontId,
   GetImplementation(*this).Cached( fontId, index, slot );
 }
 
-void AtlasGlyphManager::SetNewAtlasSize( const Vector2& size,
-                                         const Vector2& blockSize )
+void AtlasGlyphManager::SetNewAtlasSize( uint32_t width, uint32_t height, uint32_t blockWidth, uint32_t blockHeight )
 {
-  GetImplementation(*this).SetNewAtlasSize( size, blockSize );
+  GetImplementation(*this).SetNewAtlasSize( width, height, blockWidth, blockHeight );
 }
 
 Vector2 AtlasGlyphManager::GetAtlasSize( uint32_t atlasId )
index 6a10947..ad2c5ea 100644 (file)
@@ -119,14 +119,15 @@ public:
    */
   Vector2 GetAtlasSize( uint32_t atlasId );
 
-  /**
-   * @brief Set the Atlas size and block size for subsequent atlas generation
-   *
-   * @param[in] size size of the atlas in pixels
-   * @param[in] blockSize size of a block in this atlas in pixels
-   */
-  void SetNewAtlasSize( const Vector2& size,
-                        const Vector2& blockSize );
+   /**
+    * @brief Set the atlas size and block size for subsequent Atlas generation
+    *
+    * @param[in] width width of atlas in pixels
+    * @param[in] height height of atlas in pixels
+    * @param[in] blockWidth width of a block in pixels
+    * @param[in] blockHeight height of a block in pixels
+    */
+  void SetNewAtlasSize( uint32_t width, uint32_t height, uint32_t blockWidth, uint32_t blockHeight );
 
   /**
    * @brief Unreference an image from the atlas and remove from cache if no longer needed
index b06d4e6..1825840 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/dali.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/text-abstraction/text-abstraction.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/atlas-manager/atlas-manager.h>
@@ -38,13 +39,12 @@ using namespace Dali::Toolkit::Text;
 
 namespace
 {
-  const Vector2 DEFAULT_ATLAS_SIZE( 512.0f, 512.0f );
-  const Vector2 DEFAULT_BLOCK_SIZE( 16.0f, 16.0f );
-  const Vector2 PADDING( 4.0f, 4.0f ); // Allow for variation in font glyphs
   const float ZERO( 0.0f );
   const float HALF( 0.5f );
   const float ONE( 1.0f );
   const float TWO( 2.0f );
+  const uint32_t DEFAULT_ATLAS_WIDTH = 512u;
+  const uint32_t DEFAULT_ATLAS_HEIGHT = 512u;
 }
 
 struct AtlasRenderer::Impl : public ConnectionTracker
@@ -84,14 +84,14 @@ struct AtlasRenderer::Impl : public ConnectionTracker
   struct MaxBlockSize
   {
     FontId mFontId;
-    Vector2 mNeededBlockSize;
+    uint32_t mNeededBlockWidth;
+    uint32_t mNeededBlockHeight;
   };
 
   Impl()
   {
     mGlyphManager = AtlasGlyphManager::Get();
     mFontClient = TextAbstraction::FontClient::Get();
-    mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_SIZE, DEFAULT_BLOCK_SIZE );
     mBasicShader = BasicShader::New();
     mBgraShader = BgraShader::New();
     mBasicShadowShader = BasicShadowShader::New();
@@ -116,7 +116,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker
 
     float currentUnderlinePosition = ZERO;
     float currentUnderlineThickness = underlineHeight;
-
+    uint32_t currentBlockSize = 0;
     FontId lastFontId = 0;
     Style style = STYLE_NORMAL;
 
@@ -196,23 +196,49 @@ struct AtlasRenderer::Impl : public ConnectionTracker
             {
               if ( mBlockSizes[ j ].mFontId == glyph.fontId )
               {
-                mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_SIZE, mBlockSizes[ j ].mNeededBlockSize );
+                currentBlockSize = j;
+                mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
+                                               DEFAULT_ATLAS_HEIGHT,
+                                               mBlockSizes[ j ].mNeededBlockWidth,
+                                               mBlockSizes[ j ].mNeededBlockHeight );
               }
             }
-            lastFontId = glyph.fontId;
           }
 
-          // Glyph doesn't currently exist in atlas so upload
+          // Create a new image for the glyph
           BufferImage bitmap = mFontClient.CreateBitmap( glyph.fontId, glyph.index );
+          if ( bitmap )
+          {
+            // Ensure that the next image will fit into the current block size
+            bool setSize = false;
+            if ( bitmap.GetWidth() > mBlockSizes[ currentBlockSize ].mNeededBlockWidth )
+            {
+              setSize = true;
+              mBlockSizes[ currentBlockSize ].mNeededBlockWidth = bitmap.GetWidth();
+            }
+            if ( bitmap.GetHeight() > mBlockSizes[ currentBlockSize ].mNeededBlockHeight )
+            {
+              setSize = true;
+              mBlockSizes[ currentBlockSize ].mNeededBlockHeight = bitmap.GetHeight();
+            }
 
-          // Locate a new slot for our glyph
-          mGlyphManager.Add( glyph, bitmap, slot );
+            if ( setSize )
+            {
+              mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
+                                             DEFAULT_ATLAS_HEIGHT,
+                                             mBlockSizes[ currentBlockSize ].mNeededBlockWidth,
+                                             mBlockSizes[ currentBlockSize ].mNeededBlockHeight );
+            }
 
-          // Generate mesh data for this quad, plugging in our supplied position
-          if ( slot.mImageId )
-          {
-            mGlyphManager.GenerateMeshData( slot.mImageId, position, newMeshData );
-            mImageIds.PushBack( slot.mImageId );
+            // Locate a new slot for our glyph
+            mGlyphManager.Add( glyph, bitmap, slot );
+
+            // Generate mesh data for this quad, plugging in our supplied position
+            if ( slot.mImageId )
+            {
+              mGlyphManager.GenerateMeshData( slot.mImageId, position, newMeshData );
+              mImageIds.PushBack( slot.mImageId );
+            }
           }
         }
         // Find an existing mesh data object to attach to ( or create a new one, if we can't find one using the same atlas)
@@ -224,6 +250,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker
                         currentUnderlinePosition,
                         currentUnderlineThickness,
                         slot );
+        lastFontId = glyph.fontId;
       }
     }
 
@@ -240,6 +267,9 @@ struct AtlasRenderer::Impl : public ConnectionTracker
       {
         MeshActor actor = MeshActor::New( Mesh::New( mIt->mMeshData ) );
         actor.SetColor( mIt->mColor );
+
+        // Ensure that text rendering is unfiltered
+        actor.SetFilterMode( FilterMode::NEAREST, FilterMode::NEAREST );
         if ( mIt->mIsUnderline )
         {
           actor.SetColorMode( USE_OWN_COLOR );
@@ -286,10 +316,10 @@ struct AtlasRenderer::Impl : public ConnectionTracker
       DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Atlas [%i] %sPixels: %s Size: %ix%i, BlockSize: %ix%i, BlocksUsed: %i/%i\n",
                                                  i + 1, i > 8 ? "" : " ",
                                                  metrics.mAtlasMetrics.mAtlasMetrics[ i ].mPixelFormat == Pixel::L8 ? "L8  " : "BGRA",
-                                                 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mWidth,
-                                                 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mHeight,
-                                                 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mBlockWidth,
-                                                 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mBlockHeight,
+                                                 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mWidth,
+                                                 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mHeight,
+                                                 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mBlockWidth,
+                                                 metrics.mAtlasMetrics.mAtlasMetrics[ i ].mSize.mBlockHeight,
                                                  metrics.mAtlasMetrics.mAtlasMetrics[ i ].mBlocksUsed,
                                                  metrics.mAtlasMetrics.mAtlasMetrics[ i ].mTotalBlocks );
     }
@@ -419,31 +449,21 @@ struct AtlasRenderer::Impl : public ConnectionTracker
     MaxBlockSize maxBlockSize;
     for ( uint32_t i = 0; i < glyphs.Size(); ++i )
     {
-      // Get the fontId of this glyph and check to see if a max size exists?
       FontId fontId = glyphs[ i ].fontId;
-      float paddedWidth = glyphs[ i ].width + PADDING.x;
-      float paddedHeight = glyphs[ i ].height + PADDING.y;
       bool foundFont = false;
-
       for ( uint32_t j = 0; j < mBlockSizes.size(); ++j )
       {
         if ( mBlockSizes[ j ].mFontId == fontId )
         {
           foundFont = true;
-          if ( mBlockSizes[ j ].mNeededBlockSize.x < paddedWidth )
-          {
-            mBlockSizes[ j ].mNeededBlockSize.x = paddedWidth;
-          }
-          if ( mBlockSizes[ j ].mNeededBlockSize.y < paddedHeight )
-          {
-            mBlockSizes[ j ].mNeededBlockSize.y = paddedHeight;
-          }
         }
       }
-
       if ( !foundFont )
       {
-        maxBlockSize.mNeededBlockSize = Vector2( paddedWidth, paddedHeight );
+        FontMetrics fontMetrics;
+        mFontClient.GetFontMetrics( fontId, fontMetrics );
+        maxBlockSize.mNeededBlockWidth = static_cast< uint32_t >( fontMetrics.height );
+        maxBlockSize.mNeededBlockHeight = static_cast< uint32_t >( fontMetrics.height );
         maxBlockSize.mFontId = fontId;
         mBlockSizes.push_back( maxBlockSize );
       }
@@ -705,4 +725,4 @@ AtlasRenderer::AtlasRenderer()
 AtlasRenderer::~AtlasRenderer()
 {
   delete mImpl;
-}
\ No newline at end of file
+}
diff --git a/dali-toolkit/internal/text/text-controller-impl.cpp b/dali-toolkit/internal/text/text-controller-impl.cpp
new file mode 100644 (file)
index 0000000..4f90795
--- /dev/null
@@ -0,0 +1,861 @@
+/*
+ * 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 <dali-toolkit/internal/text/text-controller-impl.h>
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/adaptor-framework/key.h>
+
+namespace
+{
+
+/**
+ * @brief Some characters can be shaped in more than one glyph.
+ * This struct is used to retrieve metrics from these group of glyphs.
+ */
+struct GlyphMetrics
+{
+  GlyphMetrics()
+  : fontHeight( 0.f ),
+    advance( 0.f ),
+    ascender( 0.f ),
+    xBearing( 0.f )
+  {}
+
+  ~GlyphMetrics()
+  {}
+
+  float fontHeight; ///< The font's height of that glyphs.
+  float advance;    ///< The sum of all the advances of all the glyphs.
+  float ascender;   ///< The font's ascender.
+  float xBearing;   ///< The x bearing of the first glyph.
+};
+
+const std::string EMPTY_STRING("");
+
+} // namespace
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+/**
+ * @brief Get some glyph's metrics of a group of glyphs formed as a result of shaping one character.
+ *
+ * @param[in] glyphIndex The index to the first glyph.
+ * @param[in] numberOfGlyphs The number