[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 of glyphs.
+ * @param[out] glyphMetrics Some glyph metrics (font height, advance, ascender and x bearing).
+ * @param[in]
+ * @param[in]
+ */
+void GetGlyphsMetrics( GlyphIndex glyphIndex,
+                       Length numberOfGlyphs,
+                       GlyphMetrics& glyphMetrics,
+                       VisualModelPtr visualModel,
+                       TextAbstraction::FontClient& fontClient )
+{
+  const GlyphInfo* glyphsBuffer = visualModel->mGlyphs.Begin();
+
+  const GlyphInfo& firstGlyph = *( glyphsBuffer + glyphIndex );
+
+  Text::FontMetrics fontMetrics;
+  fontClient.GetFontMetrics( firstGlyph.fontId, fontMetrics );
+
+  glyphMetrics.fontHeight = fontMetrics.height;
+  glyphMetrics.advance = firstGlyph.advance;
+  glyphMetrics.ascender = fontMetrics.ascender;
+  glyphMetrics.xBearing = firstGlyph.xBearing;
+
+  for( unsigned int i = 1u; i < numberOfGlyphs; ++i )
+  {
+    const GlyphInfo& glyphInfo = *( glyphsBuffer + glyphIndex + i );
+
+    glyphMetrics.advance += glyphInfo.advance;
+  }
+}
+
+EventData::EventData( DecoratorPtr decorator )
+: mDecorator( decorator ),
+  mPlaceholderText(),
+  mEventQueue(),
+  mScrollPosition(),
+  mState( INACTIVE ),
+  mPrimaryCursorPosition( 0u ),
+  mSecondaryCursorPosition( 0u ),
+  mDecoratorUpdated( false ),
+  mCursorBlinkEnabled( true ),
+  mGrabHandleEnabled( true ),
+  mGrabHandlePopupEnabled( true ),
+  mSelectionEnabled( true ),
+  mHorizontalScrollingEnabled( true ),
+  mVerticalScrollingEnabled( false ),
+  mUpdateCursorPosition( false )
+{}
+
+EventData::~EventData()
+{}
+
+bool Controller::Impl::ProcessInputEvents()
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return false;
+  }
+
+  mEventData->mDecoratorUpdated = false;
+
+  if( mEventData->mDecorator )
+  {
+    for( std::vector<Event>::iterator iter = mEventData->mEventQueue.begin();
+         iter != mEventData->mEventQueue.end();
+         ++iter )
+    {
+      switch( iter->type )
+      {
+      case Event::KEYBOARD_FOCUS_GAIN_EVENT:
+      {
+        OnKeyboardFocus( true );
+        break;
+      }
+      case Event::KEYBOARD_FOCUS_LOST_EVENT:
+      {
+        OnKeyboardFocus( false );
+        break;
+      }
+      case Event::CURSOR_KEY_EVENT:
+      {
+        OnCursorKeyEvent( *iter );
+        break;
+      }
+      case Event::TAP_EVENT:
+      {
+        OnTapEvent( *iter );
+        break;
+      }
+      case Event::PAN_EVENT:
+      {
+        OnPanEvent( *iter );
+        break;
+      }
+      case Event::GRAB_HANDLE_EVENT:
+      {
+        OnGrabHandleEvent( *iter );
+        break;
+      }
+      }
+    }
+  }
+
+  // The cursor must also be repositioned after inserts into the model
+  if( mEventData->mUpdateCursorPosition )
+  {
+    UpdateCursorPosition();
+    mEventData->mUpdateCursorPosition = false;
+  }
+
+  mEventData->mEventQueue.clear();
+
+  return mEventData->mDecoratorUpdated;
+}
+
+void Controller::Impl::OnKeyboardFocus( bool hasFocus )
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return;
+  }
+
+  if( !hasFocus )
+  {
+    ChangeState( EventData::INACTIVE );
+  }
+  else
+  {
+    ChangeState( EventData::EDITING );
+  }
+}
+
+void Controller::Impl::OnCursorKeyEvent( const Event& event )
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return;
+  }
+
+  int keyCode = event.p1.mInt;
+
+  if( Dali::DALI_KEY_CURSOR_LEFT == keyCode )
+  {
+    if( mEventData->mPrimaryCursorPosition > 0u )
+    {
+      mEventData->mPrimaryCursorPosition = CalculateNewCursorIndex( mEventData->mPrimaryCursorPosition - 1u );
+    }
+  }
+  else if( Dali::DALI_KEY_CURSOR_RIGHT == keyCode )
+  {
+    if( mLogicalModel->GetNumberOfCharacters() > mEventData->mPrimaryCursorPosition )
+    {
+      mEventData->mPrimaryCursorPosition = CalculateNewCursorIndex( mEventData->mPrimaryCursorPosition );
+    }
+  }
+  else if( Dali::DALI_KEY_CURSOR_UP == keyCode )
+  {
+    // TODO
+  }
+  else if(   Dali::DALI_KEY_CURSOR_DOWN == keyCode )
+  {
+    // TODO
+  }
+
+  UpdateCursorPosition();
+}
+
+void Controller::Impl::HandleCursorKey( int keyCode )
+{
+  // TODO
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return;
+  }
+}
+
+void Controller::Impl::OnTapEvent( const Event& event )
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return;
+  }
+
+  const unsigned int tapCount = event.p1.mUint;
+
+  if( 1u == tapCount )
+  {
+    ChangeState( EventData::EDITING );
+
+    const float xPosition = event.p2.mFloat - mAlignmentOffset.x;
+    const float yPosition = event.p3.mFloat - mAlignmentOffset.y;
+
+    mEventData->mPrimaryCursorPosition = GetClosestCursorIndex( xPosition,
+                                                                yPosition );
+
+    UpdateCursorPosition();
+  }
+  else if( mEventData->mSelectionEnabled &&
+           ( 2u == tapCount ) )
+  {
+    ChangeState( EventData::SELECTING );
+
+    RepositionSelectionHandles( event.p2.mFloat, event.p3.mFloat );
+  }
+}
+
+void Controller::Impl::OnPanEvent( const Event& event )
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return;
+  }
+
+  int state = event.p1.mInt;
+
+  if( Gesture::Started    == state ||
+      Gesture::Continuing == state )
+  {
+    const Vector2& actualSize = mVisualModel->GetActualSize();
+
+    if( mEventData->mHorizontalScrollingEnabled )
+    {
+      const float displacementX = event.p2.mFloat;
+      mEventData->mScrollPosition.x += displacementX;
+
+      // Clamp between -space & 0 (and the text alignment).
+      if( actualSize.width > mControlSize.width )
+      {
+        const float space = ( actualSize.width - mControlSize.width ) + mAlignmentOffset.x;
+        mEventData->mScrollPosition.x = ( mEventData->mScrollPosition.x < -space ) ? -space : mEventData->mScrollPosition.x;
+        mEventData->mScrollPosition.x = ( mEventData->mScrollPosition.x > -mAlignmentOffset.x ) ? -mAlignmentOffset.x : mEventData->mScrollPosition.x;
+
+        mEventData->mDecoratorUpdated = true;
+      }
+      else
+      {
+        mEventData->mScrollPosition.x = 0.f;
+      }
+    }
+
+    if( mEventData->mVerticalScrollingEnabled )
+    {
+      const float displacementY = event.p3.mFloat;
+      mEventData->mScrollPosition.y += displacementY;
+
+      // Clamp between -space & 0 (and the text alignment).
+      if( actualSize.height > mControlSize.height )
+      {
+        const float space = ( actualSize.height - mControlSize.height ) + mAlignmentOffset.y;
+        mEventData->mScrollPosition.y = ( mEventData->mScrollPosition.y < -space ) ? -space : mEventData->mScrollPosition.y;
+        mEventData->mScrollPosition.y = ( mEventData->mScrollPosition.y > -mAlignmentOffset.y ) ? -mAlignmentOffset.y : mEventData->mScrollPosition.y;
+
+        mEventData->mDecoratorUpdated = true;
+      }
+      else
+      {
+        mEventData->mScrollPosition.y = 0.f;
+      }
+    }
+  }
+}
+
+void Controller::Impl::OnGrabHandleEvent( const Event& event )
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return;
+  }
+
+  unsigned int state = event.p1.mUint;
+
+  if( GRAB_HANDLE_PRESSED == state )
+  {
+    float xPosition = event.p2.mFloat + mEventData->mScrollPosition.x;
+    float yPosition = event.p3.mFloat + mEventData->mScrollPosition.y;
+
+    mEventData->mPrimaryCursorPosition = GetClosestCursorIndex( xPosition,
+                                                                yPosition );
+
+    UpdateCursorPosition();
+
+    //mDecorator->HidePopup();
+    ChangeState ( EventData::EDITING );
+  }
+  else if( mEventData->mGrabHandlePopupEnabled &&
+           ( GRAB_HANDLE_RELEASED == state ) )
+  {
+    //mDecorator->ShowPopup();
+    ChangeState ( EventData::EDITING_WITH_POPUP );
+    mEventData->mDecoratorUpdated = true;
+  }
+}
+
+void Controller::Impl::RepositionSelectionHandles( float visualX, float visualY )
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return;
+  }
+
+  // TODO - Find which word was selected
+
+  const Vector<GlyphInfo>& glyphs = mVisualModel->mGlyphs;
+  const Vector<Vector2>::SizeType glyphCount = glyphs.Count();
+
+  const Vector<Vector2>& positions = mVisualModel->mGlyphPositions;
+  const Vector<Vector2>::SizeType positionCount = positions.Count();
+
+  // Guard against glyphs which did not fit inside the layout
+  const Vector<Vector2>::SizeType count = (positionCount < glyphCount) ? positionCount : glyphCount;
+
+  if( count )
+  {
+    float primaryX   = positions[0].x;
+    float secondaryX = positions[count-1].x + glyphs[count-1].width;
+
+    // TODO - multi-line selection
+    const Vector<LineRun>& lines = mVisualModel->mLines;
+    float height = lines.Count() ? lines[0].ascender + -lines[0].descender : 0.0f;
+
+    mEventData->mDecorator->SetPosition( PRIMARY_SELECTION_HANDLE,   primaryX,   0.0f, height );
+    mEventData->mDecorator->SetPosition( SECONDARY_SELECTION_HANDLE, secondaryX, 0.0f, height );
+
+    mEventData->mDecorator->ClearHighlights();
+    mEventData->mDecorator->AddHighlight( primaryX, 0.0f, secondaryX, height );
+  }
+}
+
+void Controller::Impl::ChangeState( EventData::State newState )
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return;
+  }
+
+  if( mEventData->mState != newState )
+  {
+    mEventData->mState = newState;
+
+    if( EventData::INACTIVE == mEventData->mState )
+    {
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
+      mEventData->mDecorator->StopCursorBlink();
+      mEventData->mDecorator->SetGrabHandleActive( false );
+      mEventData->mDecorator->SetSelectionActive( false );
+      mEventData->mDecorator->SetPopupActive( false );
+      mEventData->mDecoratorUpdated = true;
+    }
+    else if ( EventData::SELECTING == mEventData->mState )
+    {
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
+      mEventData->mDecorator->StopCursorBlink();
+      mEventData->mDecorator->SetGrabHandleActive( false );
+      mEventData->mDecorator->SetSelectionActive( true );
+      mEventData->mDecoratorUpdated = true;
+    }
+    else if( EventData::EDITING == mEventData->mState )
+    {
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
+      if( mEventData->mCursorBlinkEnabled )
+      {
+        mEventData->mDecorator->StartCursorBlink();
+      }
+      if( mEventData->mGrabHandleEnabled )
+      {
+        mEventData->mDecorator->SetGrabHandleActive( true );
+      }
+      if( mEventData->mGrabHandlePopupEnabled )
+      {
+        mEventData->mDecorator->SetPopupActive( false );
+      }
+      mEventData->mDecorator->SetSelectionActive( false );
+      mEventData->mDecoratorUpdated = true;
+    }
+    else if( EventData::EDITING_WITH_POPUP == mEventData->mState )
+    {
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
+      if( mEventData->mCursorBlinkEnabled )
+      {
+        mEventData->mDecorator->StartCursorBlink();
+      }
+      if( mEventData->mGrabHandleEnabled )
+      {
+        mEventData->mDecorator->SetGrabHandleActive( true );
+      }
+      if( mEventData->mGrabHandlePopupEnabled )
+      {
+        mEventData->mDecorator->SetPopupActive( true );
+      }
+      mEventData->mDecorator->SetSelectionActive( false );
+      mEventData->mDecoratorUpdated = true;
+    }
+  }
+}
+
+LineIndex Controller::Impl::GetClosestLine( float y ) const
+{
+  float totalHeight = 0.f;
+  LineIndex lineIndex = 0u;
+
+  const Vector<LineRun>& lines = mVisualModel->mLines;
+  for( LineIndex endLine = lines.Count();
+       lineIndex < endLine;
+       ++lineIndex )
+  {
+    const LineRun& lineRun = lines[lineIndex];
+    totalHeight += lineRun.ascender + -lineRun.descender;
+    if( y < totalHeight )
+    {
+      return lineIndex;
+    }
+  }
+
+  return lineIndex-1;
+}
+
+CharacterIndex Controller::Impl::GetClosestCursorIndex( float visualX,
+                                                        float visualY )
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return 0u;
+  }
+
+  CharacterIndex logicalIndex = 0u;
+
+  const Length numberOfGlyphs = mVisualModel->mGlyphs.Count();
+  const Length numberOfLines  = mVisualModel->mLines.Count();
+  if( 0 == numberOfGlyphs ||
+      0 == numberOfLines )
+  {
+    return logicalIndex;
+  }
+
+  // Transform to visual model coords
+  visualX -= mEventData->mScrollPosition.x;
+  visualY -= mEventData->mScrollPosition.y;
+
+  // Find which line is closest
+  const LineIndex lineIndex = GetClosestLine( visualY );
+  const LineRun& line = mVisualModel->mLines[lineIndex];
+
+  // Get the positions of the glyphs.
+  const Vector<Vector2>& positions = mVisualModel->mGlyphPositions;
+  const Vector2* const positionsBuffer = positions.Begin();
+
+  // Get the visual to logical conversion tables.
+  const CharacterIndex* const visualToLogicalBuffer = ( 0u != mLogicalModel->mVisualToLogicalMap.Count() ) ? mLogicalModel->mVisualToLogicalMap.Begin() : NULL;
+  const CharacterIndex* const visualToLogicalCursorBuffer = mLogicalModel->mVisualToLogicalCursorMap.Begin();
+
+  // Get the character to glyph conversion table.
+  const GlyphIndex* const charactersToGlyphBuffer = mVisualModel->mCharactersToGlyph.Begin();
+
+  // Get the glyphs per character table.
+  const Length* const glyphsPerCharacterBuffer = mVisualModel->mGlyphsPerCharacter.Begin();
+
+  // If the vector is void, there is no right to left characters.
+  const bool hasRightToLeftCharacters = NULL != visualToLogicalBuffer;
+
+  const CharacterIndex startCharacter = line.characterRun.characterIndex;
+  const CharacterIndex endCharacter   = line.characterRun.characterIndex + line.characterRun.numberOfCharacters;
+  DALI_ASSERT_DEBUG( endCharacter <= mLogicalModel->mText.Count() && "Invalid line info" );
+
+  // Whether there is a hit on a glyph.
+  bool matched = false;
+
+  // Traverses glyphs in visual order. To do that use the visual to logical conversion table.
+  CharacterIndex visualIndex = startCharacter;
+  for( ; !matched && ( visualIndex < endCharacter ); ++visualIndex )
+  {
+    // The character in logical order.
+    const CharacterIndex characterLogicalOrderIndex = hasRightToLeftCharacters ? *( visualToLogicalBuffer + visualIndex ) : visualIndex;
+
+    // The first glyph for that character in logical order.
+    const GlyphIndex glyphLogicalOrderIndex = *( charactersToGlyphBuffer + characterLogicalOrderIndex );
+
+    // The number of glyphs for that character
+    const Length numberOfGlyphs = *( glyphsPerCharacterBuffer + characterLogicalOrderIndex );
+
+    // Get the metrics for the group of glyphs.
+    GlyphMetrics glyphMetrics;
+    GetGlyphsMetrics( glyphLogicalOrderIndex,
+                      numberOfGlyphs,
+                      glyphMetrics,
+                      mVisualModel,
+                      mFontClient );
+
+    const Vector2& position = *( positionsBuffer + glyphLogicalOrderIndex );
+
+    const float glyphX = -glyphMetrics.xBearing + position.x + 0.5f * glyphMetrics.advance;
+
+    if( visualX < glyphX )
+    {
+      matched = true;
+      break;
+    }
+  }
+
+  // Return the logical position of the cursor in characters.
+
+  if( !matched )
+  {
+    visualIndex = endCharacter;
+  }
+
+  return hasRightToLeftCharacters ? *( visualToLogicalCursorBuffer + visualIndex ) : visualIndex;
+}
+
+void Controller::Impl::GetCursorPosition( CharacterIndex logical,
+                                          CursorInfo& cursorInfo )
+{
+  // TODO: Check for multiline with \n, etc...
+
+  // Check if the logical position is the first or the last one of the text.
+  const bool isFirstPosition = 0u == logical;
+  const bool isLastPosition = mLogicalModel->GetNumberOfCharacters() == logical;
+
+  if( isFirstPosition && isLastPosition )
+  {
+    // There is zero characters. Get the default font.
+
+    FontId defaultFontId = 0u;
+    if( NULL == mFontDefaults )
+    {
+      defaultFontId = mFontClient.GetFontId( EMPTY_STRING,
+                                             EMPTY_STRING );
+    }
+    else
+    {
+      defaultFontId = mFontDefaults->GetFontId( mFontClient );
+    }
+
+    Text::FontMetrics fontMetrics;
+    mFontClient.GetFontMetrics( defaultFontId, fontMetrics );
+
+    cursorInfo.lineHeight = fontMetrics.ascender - fontMetrics.descender;
+    cursorInfo.primaryCursorHeight = cursorInfo.lineHeight;
+
+    cursorInfo.primaryPosition.x = 0.f;
+    cursorInfo.primaryPosition.y = 0.f;
+
+    // Nothing else to do.
+    return;
+  }
+
+  // Get the previous logical index.
+  const CharacterIndex previousLogical = isFirstPosition ? 0u : logical - 1u;
+
+  // Decrease the logical index if it's the last one.
+  if( isLastPosition )
+  {
+    --logical;
+  }
+
+  // Get the direction of the character and the previous one.
+  const CharacterDirection* const modelCharacterDirectionsBuffer = ( 0u != mLogicalModel->mCharacterDirections.Count() ) ? mLogicalModel->mCharacterDirections.Begin() : NULL;
+
+  CharacterDirection isCurrentRightToLeft = false;
+  CharacterDirection isPreviousRightToLeft = false;
+  if( NULL != modelCharacterDirectionsBuffer ) // If modelCharacterDirectionsBuffer is NULL, it means the whole text is left to right.
+  {
+    isCurrentRightToLeft = *( modelCharacterDirectionsBuffer + logical );
+    isPreviousRightToLeft = *( modelCharacterDirectionsBuffer + previousLogical );
+  }
+
+  // Get the line where the character is laid-out.
+  const LineRun* modelLines = mVisualModel->mLines.Begin();
+
+  const LineIndex lineIndex = mVisualModel->GetLineOfCharacter( logical );
+  const LineRun& line = *( modelLines + lineIndex );
+
+  // Get the paragraph's direction.
+  const CharacterDirection isRightToLeftParagraph = line.direction;
+
+  // Check whether there is an alternative position:
+
+  cursorInfo.isSecondaryCursor = ( isCurrentRightToLeft != isPreviousRightToLeft ) ||
+    ( isLastPosition && ( isRightToLeftParagraph != isCurrentRightToLeft ) );
+
+  // Set the line height.
+  cursorInfo.lineHeight = line.ascender + -line.descender;
+
+  // Convert the cursor position into the glyph position.
+  CharacterIndex characterIndex = logical;
+  if( cursorInfo.isSecondaryCursor &&
+      ( isRightToLeftParagraph != isCurrentRightToLeft ) )
+  {
+    characterIndex = previousLogical;
+  }
+
+  const GlyphIndex currentGlyphIndex = *( mVisualModel->mCharactersToGlyph.Begin() + characterIndex );
+  const Length numberOfGlyphs = *( mVisualModel->mGlyphsPerCharacter.Begin() + characterIndex );
+  const Length numberOfCharacters = *( mVisualModel->mCharactersPerGlyph.Begin() +currentGlyphIndex );
+
+  // Get the metrics for the group of glyphs.
+  GlyphMetrics glyphMetrics;
+  GetGlyphsMetrics( currentGlyphIndex,
+                    numberOfGlyphs,
+                    glyphMetrics,
+                    mVisualModel,
+                    mFontClient );
+
+  float interGlyphAdvance = 0.f;
+  if( !isLastPosition &&
+      ( numberOfCharacters > 1u ) )
+  {
+    const CharacterIndex firstIndex = *( mVisualModel->mGlyphsToCharacters.Begin() + currentGlyphIndex );
+    interGlyphAdvance = static_cast<float>( characterIndex - firstIndex ) * glyphMetrics.advance / static_cast<float>( numberOfCharacters );
+  }
+
+  // Get the glyph position and x bearing.
+  const Vector2& currentPosition = *( mVisualModel->mGlyphPositions.Begin() + currentGlyphIndex );
+
+  // Set the cursor's height.
+  cursorInfo.primaryCursorHeight = glyphMetrics.fontHeight;
+
+  // Set the position.
+  cursorInfo.primaryPosition.x = -glyphMetrics.xBearing + currentPosition.x + ( isCurrentRightToLeft ? glyphMetrics.advance : interGlyphAdvance );
+  cursorInfo.primaryPosition.y = line.ascender - glyphMetrics.ascender;
+
+  if( isLastPosition )
+  {
+    // The position of the cursor after the last character needs special
+    // care depending on its direction and the direction of the paragraph.
+
+    if( cursorInfo.isSecondaryCursor )
+    {
+      // Need to find the first character after the last character with the paragraph's direction.
+      // i.e l0 l1 l2 r0 r1 should find r0.
+
+      // TODO: check for more than one line!
+      characterIndex = isRightToLeftParagraph ? line.characterRun.characterIndex : line.characterRun.characterIndex + line.characterRun.numberOfCharacters - 1u;
+      characterIndex = mLogicalModel->GetLogicalCharacterIndex( characterIndex );
+
+      const GlyphIndex glyphIndex = *( mVisualModel->mCharactersToGlyph.Begin() + characterIndex );
+      const Length numberOfGlyphs = *( mVisualModel->mGlyphsPerCharacter.Begin() + characterIndex );
+
+      const Vector2& position = *( mVisualModel->mGlyphPositions.Begin() + glyphIndex );
+
+      // Get the metrics for the group of glyphs.
+      GlyphMetrics glyphMetrics;
+      GetGlyphsMetrics( glyphIndex,
+                        numberOfGlyphs,
+                        glyphMetrics,
+                        mVisualModel,
+                        mFontClient );
+
+      cursorInfo.primaryPosition.x = -glyphMetrics.xBearing + position.x + ( isRightToLeftParagraph ? 0.f : glyphMetrics.advance );
+
+      cursorInfo.primaryPosition.y = line.ascender - glyphMetrics.ascender;
+    }
+    else
+    {
+      if( !isCurrentRightToLeft )
+      {
+        cursorInfo.primaryPosition.x += glyphMetrics.advance;
+      }
+      else
+      {
+        cursorInfo.primaryPosition.x -= glyphMetrics.advance;
+      }
+    }
+  }
+
+  // Set the alternative cursor position.
+  if( cursorInfo.isSecondaryCursor )
+  {
+    // Convert the cursor position into the glyph position.
+    const CharacterIndex previousCharacterIndex = ( ( isRightToLeftParagraph != isCurrentRightToLeft ) ? logical : previousLogical );
+    const GlyphIndex previousGlyphIndex = *( mVisualModel->mCharactersToGlyph.Begin() + previousCharacterIndex );
+    const Length numberOfGlyphs = *( mVisualModel->mGlyphsPerCharacter.Begin() + previousCharacterIndex );
+
+    // Get the glyph position.
+    const Vector2& previousPosition = *( mVisualModel->mGlyphPositions.Begin() + previousGlyphIndex );
+
+    // Get the metrics for the group of glyphs.
+    GlyphMetrics glyphMetrics;
+    GetGlyphsMetrics( previousGlyphIndex,
+                      numberOfGlyphs,
+                      glyphMetrics,
+                      mVisualModel,
+                      mFontClient );
+
+    // Set the cursor position and height.
+    cursorInfo.secondaryPosition.x = -glyphMetrics.xBearing + previousPosition.x + ( ( ( isLastPosition && !isCurrentRightToLeft ) ||
+                                                                                       ( !isLastPosition && isCurrentRightToLeft )    ) ? glyphMetrics.advance : 0.f );
+
+    cursorInfo.secondaryCursorHeight = 0.5f * glyphMetrics.fontHeight;
+
+    cursorInfo.secondaryPosition.y = cursorInfo.lineHeight - cursorInfo.secondaryCursorHeight - line.descender - ( glyphMetrics.fontHeight - glyphMetrics.ascender );
+
+    // Update the primary cursor height as well.
+    cursorInfo.primaryCursorHeight *= 0.5f;
+  }
+}
+
+CharacterIndex Controller::Impl::CalculateNewCursorIndex( CharacterIndex index ) const
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return 0u;
+  }
+
+  CharacterIndex cursorIndex = mEventData->mPrimaryCursorPosition;
+
+  const Script script = mLogicalModel->GetScript( index );
+  const GlyphIndex* charactersToGlyphBuffer = mVisualModel->mCharactersToGlyph.Begin();
+  const Length* charactersPerGlyphBuffer = mVisualModel->mCharactersPerGlyph.Begin();
+
+  Length numberOfCharacters = 0u;
+  if( TextAbstraction::LATIN == script )
+  {
+    // Prevents to jump the whole Latin ligatures like fi, ff, ...
+    numberOfCharacters = 1u;
+  }
+  else
+  {
+    GlyphIndex glyphIndex = *( charactersToGlyphBuffer + index );
+    numberOfCharacters = *( charactersPerGlyphBuffer + glyphIndex );
+
+    while( 0u == numberOfCharacters )
+    {
+      numberOfCharacters = *( charactersPerGlyphBuffer + glyphIndex );
+      ++glyphIndex;
+    }
+  }
+
+  if( index < mEventData->mPrimaryCursorPosition )
+  {
+    cursorIndex -= numberOfCharacters;
+  }
+  else
+  {
+    cursorIndex += numberOfCharacters;
+  }
+
+  return cursorIndex;
+}
+
+void Controller::Impl::UpdateCursorPosition()
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return;
+  }
+
+  CursorInfo cursorInfo;
+  GetCursorPosition( mEventData->mPrimaryCursorPosition,
+                     cursorInfo );
+
+  mEventData->mDecorator->SetPosition( PRIMARY_CURSOR,
+                                       cursorInfo.primaryPosition.x,
+                                       cursorInfo.primaryPosition.y,
+                                       cursorInfo.primaryCursorHeight,
+                                       cursorInfo.lineHeight );
+
+  if( cursorInfo.isSecondaryCursor )
+  {
+    mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_BOTH );
+    mEventData->mDecorator->SetPosition( SECONDARY_CURSOR,
+                                         cursorInfo.secondaryPosition.x,
+                                         cursorInfo.secondaryPosition.y,
+                                         cursorInfo.secondaryCursorHeight,
+                                         cursorInfo.lineHeight );
+  }
+  else
+  {
+    mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
+  }
+
+  mEventData->mUpdateCursorPosition = false;
+  mEventData->mDecoratorUpdated = true;
+}
+
+void Controller::Impl::RequestRelayout()
+{
+  mControlInterface.RequestTextRelayout();
+}
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h
new file mode 100644 (file)
index 0000000..06e9463
--- /dev/null
@@ -0,0 +1,300 @@
+#ifndef __DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H__
+#define __DALI_TOOLKIT_TEXT_CONTROLLER_IMPL_H__
+
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/text-abstraction/font-client.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/layouts/layout-engine.h>
+#include <dali-toolkit/internal/text/logical-model-impl.h>
+#include <dali-toolkit/internal/text/text-controller.h>
+#include <dali-toolkit/internal/text/visual-model-impl.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+struct Event
+{
+  // Used to queue input events until DoRelayout()
+  enum Type
+  {
+    KEYBOARD_FOCUS_GAIN_EVENT,
+    KEYBOARD_FOCUS_LOST_EVENT,
+    CURSOR_KEY_EVENT,
+    TAP_EVENT,
+    PAN_EVENT,
+    GRAB_HANDLE_EVENT
+  };
+
+  union Param
+  {
+    int mInt;
+    unsigned int mUint;
+    float mFloat;
+  };
+
+  Event( Type eventType )
+  : type( eventType )
+  {
+    p1.mInt = 0;
+    p2.mInt = 0;
+  }
+
+  Type type;
+  Param p1;
+  Param p2;
+  Param p3;
+};
+
+struct CursorInfo
+{
+  CursorInfo()
+  : primaryPosition(),
+    secondaryPosition(),
+    lineHeight( 0.f ),
+    primaryCursorHeight( 0.f ),
+    secondaryCursorHeight( 0.f ),
+    isSecondaryCursor( false )
+  {}
+
+  ~CursorInfo()
+  {}
+
+  Vector2 primaryPosition;       ///< The primary cursor's position.
+  Vector2 secondaryPosition;     ///< The secondary cursor's position.
+  float   lineHeight;            ///< The height of the line where the cursor is placed.
+  float   primaryCursorHeight;   ///< The primary cursor's height.
+  float   secondaryCursorHeight; ///< The secondary cursor's height.
+  bool    isSecondaryCursor;     ///< Whether the secondary cursor is valid.
+};
+
+struct EventData
+{
+  enum State
+  {
+    INACTIVE,
+    SELECTING,
+    EDITING,
+    EDITING_WITH_POPUP
+  };
+
+  EventData( DecoratorPtr decorator );
+
+  ~EventData();
+
+  DecoratorPtr mDecorator;
+  std::string  mPlaceholderText;
+
+  /**
+   * This is used to delay handling events until after the model has been updated.
+   * The number of updates to the model is minimized to improve performance.
+   */
+  std::vector<Event> mEventQueue; ///< The queue of touch events etc.
+
+  /**
+   * 0,0 means that the top-left corner of the layout matches the top-left corner of the UI control.
+   * Typically this will have a negative value with scrolling occurs.
+   */
+  Vector2 mScrollPosition; ///< The text is offset by this position when scrolling.
+
+  State mState; ///< Selection mode, edit mode etc.
+
+  CharacterIndex mPrimaryCursorPosition;   ///< Index into logical model for primary cursor
+  CharacterIndex mSecondaryCursorPosition; ///< Index into logical model for secondary cursor
+
+  bool mDecoratorUpdated           : 1; ///< True if the decorator was updated during event processing
+  bool mCursorBlinkEnabled         : 1; ///< True if cursor should blink when active
+  bool mGrabHandleEnabled          : 1; ///< True if grab handle is enabled
+  bool mGrabHandlePopupEnabled     : 1; ///< True if the grab handle popu-up should be shown
+  bool mSelectionEnabled           : 1; ///< True if selection handles, highlight etc. are enabled
+  bool mHorizontalScrollingEnabled : 1; ///< True if horizontal scrolling is enabled
+  bool mVerticalScrollingEnabled   : 1; ///< True if vertical scrolling is enabled
+  bool mUpdateCursorPosition       : 1; ///< True if the visual position of the cursor must be recalculated
+};
+
+struct ModifyEvent
+{
+  enum Type
+  {
+    REPLACE_TEXT, ///< Replace the entire text
+    INSERT_TEXT,  ///< Insert characters at the current cursor position
+    DELETE_TEXT   ///< Delete a character at the current cursor position
+  };
+
+  Type type;
+  std::string text;
+};
+
+struct FontDefaults
+{
+  FontDefaults()
+  : mDefaultPointSize(0.0f),
+    mFontId(0u)
+  {
+  }
+
+  FontId GetFontId( TextAbstraction::FontClient& fontClient )
+  {
+    if( !mFontId )
+    {
+      Dali::TextAbstraction::PointSize26Dot6 pointSize = mDefaultPointSize*64;
+      mFontId = fontClient.GetFontId( mDefaultFontFamily, mDefaultFontStyle, pointSize );
+    }
+
+    return mFontId;
+  }
+
+  std::string mDefaultFontFamily;
+  std::string mDefaultFontStyle;
+  float mDefaultPointSize;
+  FontId mFontId;
+};
+
+struct Controller::Impl
+{
+  Impl( ControlInterface& controlInterface )
+  : mControlInterface( controlInterface ),
+    mLogicalModel(),
+    mVisualModel(),
+    mFontDefaults( NULL ),
+    mEventData( NULL ),
+    mFontClient(),
+    mView(),
+    mLayoutEngine(),
+    mModifyEvents(),
+    mControlSize(),
+    mAlignmentOffset(),
+    mOperationsPending( NO_OPERATION ),
+    mRecalculateNaturalSize( true )
+  {
+    mLogicalModel = LogicalModel::New();
+    mVisualModel  = VisualModel::New();
+
+    mFontClient = TextAbstraction::FontClient::Get();
+
+    mView.SetVisualModel( mVisualModel );
+
+    // Set the text properties to default
+    mVisualModel->SetTextColor( Color::WHITE );
+    mVisualModel->SetShadowOffset( Vector2::ZERO );
+    mVisualModel->SetShadowColor( Color::BLACK );
+    mVisualModel->SetUnderlineEnabled( false );
+    mVisualModel->SetUnderlineHeight( 0.0f );
+  }
+
+  ~Impl()
+  {
+    delete mEventData;
+  }
+
+  /**
+   * @brief Request a relayout using the ControlInterface.
+   */
+  void RequestRelayout();
+
+
+  /**
+   * @brief Helper to move the cursor, grab handle etc.
+   */
+  bool ProcessInputEvents();
+
+  void OnKeyboardFocus( bool hasFocus );
+
+  void OnCursorKeyEvent( const Event& event );
+
+  void HandleCursorKey( int keyCode );
+
+  void OnTapEvent( const Event& event );
+
+  void OnPanEvent( const Event& event );
+
+  void OnGrabHandleEvent( const Event& event );
+
+  void RepositionSelectionHandles( float visualX, float visualY );
+
+  void ChangeState( EventData::State newState );
+
+  LineIndex GetClosestLine( float y ) const;
+
+  /**
+   * @brief Retrieves the cursor's logical position for a given touch point x,y
+   *
+   * @param[in] visualX The touch point x.
+   * @param[in] visualY The touch point y.
+   *
+   * @return The logical cursor position (in characters). 0 is just before the first character, a value equal to the number of characters is just after the last character.
+   */
+  CharacterIndex GetClosestCursorIndex( float visualX,
+                                        float visualY );
+
+  /**
+   * @brief Calculates the cursor's position for a given character index in the logical order.
+   *
+   * It retrieves as well the line's height and the cursor's height and
+   * if there is a valid alternative cursor, its position and height.
+   *
+   * @param[in] logical The logical cursor position (in characters). 0 is just before the first character, a value equal to the number of characters is just after the last character.
+   * @param[out] cursorInfo The line's height, the cursor's height, the cursor's position and whether there is an alternative cursor.
+   */
+  void GetCursorPosition( CharacterIndex logical,
+                          CursorInfo& cursorInfo );
+
+  /**
+   * @brief Calculates the new cursor index.
+   *
+   * It takes into account that in some scripts multiple characters can form a glyph and all of them
+   * need to be jumped with one key event.
+   *
+   * @param[in] index The initial new index.
+   *
+   * @return The new cursor index.
+   */
+  CharacterIndex CalculateNewCursorIndex( CharacterIndex index ) const;
+
+  void UpdateCursorPosition();
+
+  ControlInterface& mControlInterface;     ///< Reference to the text controller.
+  LogicalModelPtr mLogicalModel;           ///< Pointer to the logical model.
+  VisualModelPtr  mVisualModel;            ///< Pointer to the visual model.
+  FontDefaults* mFontDefaults;             ///< Avoid allocating this when the user does not specify a font.
+  EventData* mEventData;                   ///< Avoid allocating everything for text input until EnableTextInput().
+  TextAbstraction::FontClient mFontClient; ///< Handle to the font client.
+  View mView;                              ///< The view interface to the rendering back-end.
+  LayoutEngine mLayoutEngine;              ///< The layout engine.
+  std::vector<ModifyEvent> mModifyEvents;  ///< Temporary stores the text set until the next relayout.
+  Size mControlSize;                       ///< The size of the control.
+  Vector2 mAlignmentOffset;                ///< Vertical and horizontal offset of the whole text inside the control due to alignment.
+  OperationsMask mOperationsPending;       ///< Operations pending to be done to layout the text.
+  bool mRecalculateNaturalSize:1;          ///< Whether the natural size needs to be recalculated.
+};
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_TEXT_CONTROLLER_H__
index 705b44b..02486bf 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <limits>
-#include <vector>
 #include <dali/public-api/adaptor-framework/key.h>
-#include <dali/public-api/text-abstraction/font-client.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/bidirectional-support.h>
 #include <dali-toolkit/internal/text/character-set-conversion.h>
-#include <dali-toolkit/internal/text/layouts/layout-engine.h>
 #include <dali-toolkit/internal/text/layouts/layout-parameters.h>
-#include <dali-toolkit/internal/text/logical-model-impl.h>
 #include <dali-toolkit/internal/text/multi-language-support.h>
 #include <dali-toolkit/internal/text/script-run.h>
 #include <dali-toolkit/internal/text/segmentation.h>
 #include <dali-toolkit/internal/text/shaper.h>
+#include <dali-toolkit/internal/text/text-controller-impl.h>
 #include <dali-toolkit/internal/text/text-io.h>
 #include <dali-toolkit/internal/text/text-view.h>
-#include <dali-toolkit/internal/text/visual-model-impl.h>
-
-using std::vector;
 
 namespace
 {
 
 const float MAX_FLOAT = std::numeric_limits<float>::max();
 
-enum ModifyType
-{
-  REPLACE_TEXT, ///< Replace the entire text
-  INSERT_TEXT,  ///< Insert characters at the current cursor position
-  DELETE_TEXT   ///< Delete a character at the current cursor position
-};
-
-struct ModifyEvent
-{
-  ModifyType type;
-  std::string text;
-};
-
 const std::string EMPTY_STRING("");
 
 } // namespace
@@ -71,947 +52,6 @@ namespace Toolkit
 namespace Text
 {
 
-struct Controller::FontDefaults
-{
-  FontDefaults()
-  : mDefaultPointSize(0.0f),
-    mFontId(0u)
-  {
-  }
-
-  FontId GetFontId( TextAbstraction::FontClient& fontClient )
-  {
-    if( !mFontId )
-    {
-      Dali::TextAbstraction::PointSize26Dot6 pointSize = mDefaultPointSize*64;
-      mFontId = fontClient.GetFontId( mDefaultFontFamily, mDefaultFontStyle, pointSize );
-    }
-
-    return mFontId;
-  }
-
-  std::string mDefaultFontFamily;
-  std::string mDefaultFontStyle;
-  float mDefaultPointSize;
-  FontId mFontId;
-};
-
-struct Controller::TextInput
-{
-  // Used to queue input events until DoRelayout()
-  enum EventType
-  {
-    KEYBOARD_FOCUS_GAIN_EVENT,
-    KEYBOARD_FOCUS_LOST_EVENT,
-    CURSOR_KEY_EVENT,
-    TAP_EVENT,
-    PAN_EVENT,
-    GRAB_HANDLE_EVENT
-  };
-
-  union Param
-  {
-    int mInt;
-    unsigned int mUint;
-    float mFloat;
-  };
-
-  struct Event
-  {
-    Event( EventType eventType )
-    : type( eventType )
-    {
-      p1.mInt = 0;
-      p2.mInt = 0;
-    }
-
-    EventType type;
-    Param p1;
-    Param p2;
-    Param p3;
-  };
-
-  struct CursorInfo
-  {
-    CursorInfo()
-    : primaryPosition(),
-      secondaryPosition(),
-      lineHeight( 0.f ),
-      primaryCursorHeight( 0.f ),
-      secondaryCursorHeight( 0.f ),
-      isSecondaryCursor( false )
-    {}
-
-    ~CursorInfo()
-    {}
-
-    Vector2 primaryPosition;       ///< The primary cursor's position.
-    Vector2 secondaryPosition;     ///< The secondary cursor's position.
-    float   lineHeight;            ///< The height of the line where the cursor is placed.
-    float   primaryCursorHeight;   ///< The primary cursor's height.
-    float   secondaryCursorHeight; ///< The secondary cursor's height.
-    bool    isSecondaryCursor;     ///< Whether the secondary cursor is valid.
-  };
-
-  /**
-   * @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.
-  };
-
-  enum State
-  {
-    INACTIVE,
-    SELECTING,
-    EDITING,
-    EDITING_WITH_POPUP
-  };
-
-  TextInput( LogicalModelPtr logicalModel,
-             VisualModelPtr visualModel,
-             DecoratorPtr decorator,
-             FontDefaults* fontDefaults,
-             TextAbstraction::FontClient& fontClient )
-  : mLogicalModel( logicalModel ),
-    mVisualModel( visualModel ),
-    mDecorator( decorator ),
-    mFontDefaults( fontDefaults ),
-    mFontClient( fontClient ),
-    mState( INACTIVE ),
-    mPrimaryCursorPosition( 0u ),
-    mSecondaryCursorPosition( 0u ),
-    mDecoratorUpdated( false ),
-    mCursorBlinkEnabled( true ),
-    mGrabHandleEnabled( true ),
-    mGrabHandlePopupEnabled( true ),
-    mSelectionEnabled( true ),
-    mHorizontalScrollingEnabled( true ),
-    mVerticalScrollingEnabled( false ),
-    mUpdateCursorPosition( false )
-  {}
-
-  /**
-   * @brief Helper to move the cursor, grab handle etc.
-   */
-  bool ProcessInputEvents( const Vector2& controlSize,
-                           const Vector2& alignmentOffset )
-  {
-    mDecoratorUpdated = false;
-
-    if( mDecorator )
-    {
-      for( vector<TextInput::Event>::iterator iter = mEventQueue.begin(); iter != mEventQueue.end(); ++iter )
-      {
-        switch( iter->type )
-        {
-          case KEYBOARD_FOCUS_GAIN_EVENT:
-          {
-            OnKeyboardFocus( true );
-            break;
-          }
-          case KEYBOARD_FOCUS_LOST_EVENT:
-          {
-            OnKeyboardFocus( false );
-            break;
-          }
-          case CURSOR_KEY_EVENT:
-          {
-            OnCursorKeyEvent( *iter );
-            break;
-          }
-          case TAP_EVENT:
-          {
-            OnTapEvent( *iter, alignmentOffset );
-            break;
-          }
-          case PAN_EVENT:
-          {
-            OnPanEvent( *iter, controlSize, alignmentOffset );
-            break;
-          }
-          case GRAB_HANDLE_EVENT:
-          {
-            OnGrabHandleEvent( *iter );
-            break;
-          }
-        }
-      }
-    }
-
-    // The cursor must also be repositioned after inserts into the model
-    if( mUpdateCursorPosition )
-    {
-      UpdateCursorPosition();
-      mUpdateCursorPosition = false;
-    }
-
-    mEventQueue.clear();
-
-    return mDecoratorUpdated;
-  }
-
-  void OnKeyboardFocus( bool hasFocus )
-  {
-    if( !hasFocus )
-    {
-      ChangeState( INACTIVE );
-    }
-    else
-    {
-      ChangeState( EDITING );
-    }
-  }
-
-  void OnCursorKeyEvent( const Event& event )
-  {
-    int keyCode = event.p1.mInt;
-
-    if( Dali::DALI_KEY_CURSOR_LEFT == keyCode )
-    {
-      if( mPrimaryCursorPosition > 0u )
-      {
-        mPrimaryCursorPosition = CalculateNewCursorIndex( mPrimaryCursorPosition - 1u );
-      }
-    }
-    else if( Dali::DALI_KEY_CURSOR_RIGHT == keyCode )
-    {
-      if( mLogicalModel->GetNumberOfCharacters() > mPrimaryCursorPosition )
-      {
-        mPrimaryCursorPosition = CalculateNewCursorIndex( mPrimaryCursorPosition );
-      }
-    }
-    else if( Dali::DALI_KEY_CURSOR_UP == keyCode )
-    {
-      // TODO
-    }
-    else if(   Dali::DALI_KEY_CURSOR_DOWN == keyCode )
-    {
-      // TODO
-    }
-
-    UpdateCursorPosition();
-  }
-
-  void HandleCursorKey( int keyCode )
-  {
-    // TODO
-  }
-
-  void OnTapEvent( const Event& event,
-                   const Vector2& alignmentOffset  )
-  {
-    unsigned int tapCount = event.p1.mUint;
-
-    if( 1u == tapCount )
-    {
-      ChangeState( EDITING );
-
-      float xPosition = event.p2.mFloat - alignmentOffset.x;
-      float yPosition = event.p3.mFloat - alignmentOffset.y;
-
-      mPrimaryCursorPosition = GetClosestCursorIndex( xPosition,
-                                                      yPosition );
-
-      UpdateCursorPosition();
-    }
-    else if( mSelectionEnabled &&
-             2u == tapCount )
-    {
-      ChangeState( SELECTING );
-
-      RepositionSelectionHandles( event.p2.mFloat, event.p3.mFloat );
-    }
- }
-
-  void OnPanEvent( const Event& event,
-                   const Vector2& controlSize,
-                   const Vector2& alignmentOffset )
-  {
-    int state = event.p1.mInt;
-
-    if( Gesture::Started    == state ||
-        Gesture::Continuing == state )
-    {
-      const Vector2& actualSize = mVisualModel->GetActualSize();
-
-      if( mHorizontalScrollingEnabled )
-      {
-        const float displacementX = event.p2.mFloat;
-        mScrollPosition.x += displacementX;
-
-        // Clamp between -space & 0 (and the text alignment).
-        const float contentWidth = actualSize.width;
-        if( contentWidth > controlSize.width )
-        {
-          const float space = ( contentWidth - controlSize.width ) + alignmentOffset.x;
-          mScrollPosition.x = ( mScrollPosition.x < -space ) ? -space : mScrollPosition.x;
-          mScrollPosition.x = ( mScrollPosition.x > -alignmentOffset.x ) ? -alignmentOffset.x : mScrollPosition.x;
-
-          mDecoratorUpdated = true;
-        }
-        else
-        {
-          mScrollPosition.x = 0.f;
-        }
-      }
-
-      if( mVerticalScrollingEnabled )
-      {
-        const float displacementY = event.p3.mFloat;
-        mScrollPosition.y += displacementY;
-
-        // Clamp between -space & 0 (and the text alignment).
-        if( actualSize.height > controlSize.height )
-        {
-          const float space = ( actualSize.height - controlSize.height ) + alignmentOffset.y;
-          mScrollPosition.y = ( mScrollPosition.y < -space ) ? -space : mScrollPosition.y;
-          mScrollPosition.y = ( mScrollPosition.y > -alignmentOffset.y ) ? -alignmentOffset.y : mScrollPosition.y;
-
-          mDecoratorUpdated = true;
-        }
-        else
-        {
-          mScrollPosition.y = 0.f;
-        }
-      }
-    }
-  }
-
-  void OnGrabHandleEvent( const Event& event )
-  {
-    unsigned int state = event.p1.mUint;
-
-    if( GRAB_HANDLE_PRESSED == state )
-    {
-      float xPosition = event.p2.mFloat + mScrollPosition.x;
-      float yPosition = event.p3.mFloat + mScrollPosition.y;
-
-      mPrimaryCursorPosition = GetClosestCursorIndex( xPosition,
-                                                      yPosition );
-
-      UpdateCursorPosition();
-
-      //mDecorator->HidePopup();
-      ChangeState ( EDITING );
-    }
-    else if ( mGrabHandlePopupEnabled &&
-              GRAB_HANDLE_RELEASED == state )
-    {
-      //mDecorator->ShowPopup();
-      ChangeState ( EDITING_WITH_POPUP );
-      mDecoratorUpdated = true;
-    }
-  }
-
-  void RepositionSelectionHandles( float visualX, float visualY )
-  {
-    // TODO - Find which word was selected
-
-    const Vector<GlyphInfo>& glyphs = mVisualModel->mGlyphs;
-    const Vector<Vector2>::SizeType glyphCount = glyphs.Count();
-
-    const Vector<Vector2>& positions = mVisualModel->mGlyphPositions;
-    const Vector<Vector2>::SizeType positionCount = positions.Count();
-
-    // Guard against glyphs which did not fit inside the layout
-    const Vector<Vector2>::SizeType count = (positionCount < glyphCount) ? positionCount : glyphCount;
-
-    if( count )
-    {
-      float primaryX   = positions[0].x;
-      float secondaryX = positions[count-1].x + glyphs[count-1].width;
-
-      // TODO - multi-line selection
-      const Vector<LineRun>& lines = mVisualModel->mLines;
-      float height = lines.Count() ? lines[0].ascender + -lines[0].descender : 0.0f;
-
-      mDecorator->SetPosition( PRIMARY_SELECTION_HANDLE,   primaryX,   0.0f, height );
-      mDecorator->SetPosition( SECONDARY_SELECTION_HANDLE, secondaryX, 0.0f, height );
-
-      mDecorator->ClearHighlights();
-      mDecorator->AddHighlight( primaryX, 0.0f, secondaryX, height );
-    }
-  }
-
-  void ChangeState( State newState )
-  {
-    if( mState != newState )
-    {
-      mState = newState;
-
-      if( INACTIVE == mState )
-      {
-        mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
-        mDecorator->StopCursorBlink();
-        mDecorator->SetGrabHandleActive( false );
-        mDecorator->SetSelectionActive( false );
-        mDecorator->SetPopupActive( false );
-        mDecoratorUpdated = true;
-      }
-      else if ( SELECTING == mState )
-      {
-        mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
-        mDecorator->StopCursorBlink();
-        mDecorator->SetGrabHandleActive( false );
-        mDecorator->SetSelectionActive( true );
-        mDecoratorUpdated = true;
-      }
-      else if( EDITING == mState )
-      {
-        mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
-        if( mCursorBlinkEnabled )
-        {
-          mDecorator->StartCursorBlink();
-        }
-        if( mGrabHandleEnabled )
-        {
-          mDecorator->SetGrabHandleActive( true );
-        }
-        if( mGrabHandlePopupEnabled )
-        {
-          mDecorator->SetPopupActive( false );
-        }
-        mDecorator->SetSelectionActive( false );
-        mDecoratorUpdated = true;
-      }
-      else if( EDITING_WITH_POPUP == mState )
-      {
-        mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
-        if( mCursorBlinkEnabled )
-        {
-          mDecorator->StartCursorBlink();
-        }
-        if( mGrabHandleEnabled )
-        {
-          mDecorator->SetGrabHandleActive( true );
-        }
-        if( mGrabHandlePopupEnabled )
-        {
-          mDecorator->SetPopupActive( true );
-        }
-        mDecorator->SetSelectionActive( false );
-        mDecoratorUpdated = true;
-      }
-    }
-  }
-
-  LineIndex GetClosestLine( float y ) const
-  {
-    float totalHeight = 0.f;
-    LineIndex lineIndex = 0u;
-
-    const Vector<LineRun>& lines = mVisualModel->mLines;
-    for( LineIndex endLine = lines.Count();
-         lineIndex < endLine;
-         ++lineIndex )
-    {
-      const LineRun& lineRun = lines[lineIndex];
-      totalHeight += lineRun.ascender + -lineRun.descender;
-      if( y < totalHeight )
-      {
-        return lineIndex;
-      }
-    }
-
-    return lineIndex-1;
-  }
-
-  /**
-   * @brief Retrieves the cursor's logical position for a given touch point x,y
-   *
-   * @param[in] visualX The touch point x.
-   * @param[in] visualY The touch point y.
-   *
-   * @return The logical cursor position (in characters). 0 is just before the first character, a value equal to the number of characters is just after the last character.
-   */
-  CharacterIndex GetClosestCursorIndex( float visualX,
-                                        float visualY ) const
-  {
-    CharacterIndex logicalIndex = 0u;
-
-    const Length numberOfGlyphs = mVisualModel->mGlyphs.Count();
-    const Length numberOfLines  = mVisualModel->mLines.Count();
-    if( 0 == numberOfGlyphs ||
-        0 == numberOfLines )
-    {
-      return logicalIndex;
-    }
-
-    // Transform to visual model coords
-    visualX -= mScrollPosition.x;
-    visualY -= mScrollPosition.y;
-
-    // Find which line is closest
-    const LineIndex lineIndex = GetClosestLine( visualY );
-    const LineRun& line = mVisualModel->mLines[lineIndex];
-
-    // Get the positions of the glyphs.
-    const Vector<Vector2>& positions = mVisualModel->mGlyphPositions;
-    const Vector2* const positionsBuffer = positions.Begin();
-
-    // Get the visual to logical conversion tables.
-    const CharacterIndex* const visualToLogicalBuffer = ( 0u != mLogicalModel->mVisualToLogicalMap.Count() ) ? mLogicalModel->mVisualToLogicalMap.Begin() : NULL;
-    const CharacterIndex* const visualToLogicalCursorBuffer = mLogicalModel->mVisualToLogicalCursorMap.Begin();
-
-    // Get the character to glyph conversion table.
-    const GlyphIndex* const charactersToGlyphBuffer = mVisualModel->mCharactersToGlyph.Begin();
-
-    // Get the glyphs per character table.
-    const Length* const glyphsPerCharacterBuffer = mVisualModel->mGlyphsPerCharacter.Begin();
-
-    // If the vector is void, there is no right to left characters.
-    const bool hasRightToLeftCharacters = NULL != visualToLogicalBuffer;
-
-    const CharacterIndex startCharacter = line.characterRun.characterIndex;
-    const CharacterIndex endCharacter   = line.characterRun.characterIndex + line.characterRun.numberOfCharacters;
-    DALI_ASSERT_DEBUG( endCharacter <= mLogicalModel->mText.Count() && "Invalid line info" );
-
-    // Whether there is a hit on a glyph.
-    bool matched = false;
-
-    // Traverses glyphs in visual order. To do that use the visual to logical conversion table.
-    CharacterIndex visualIndex = startCharacter;
-    for( ; !matched && ( visualIndex < endCharacter ); ++visualIndex )
-    {
-      // The character in logical order.
-      const CharacterIndex characterLogicalOrderIndex = hasRightToLeftCharacters ? *( visualToLogicalBuffer + visualIndex ) : visualIndex;
-
-      // The first glyph for that character in logical order.
-      const GlyphIndex glyphLogicalOrderIndex = *( charactersToGlyphBuffer + characterLogicalOrderIndex );
-
-      // The number of glyphs for that character
-      const Length numberOfGlyphs = *( glyphsPerCharacterBuffer + characterLogicalOrderIndex );
-
-      // Get the metrics for the group of glyphs.
-      GlyphMetrics glyphMetrics;
-      GetGlyphsMetrics( glyphLogicalOrderIndex,
-                        numberOfGlyphs,
-                        glyphMetrics );
-
-      const Vector2& position = *( positionsBuffer + glyphLogicalOrderIndex );
-
-      const float glyphX = -glyphMetrics.xBearing + position.x + 0.5f * glyphMetrics.advance;
-
-      if( visualX < glyphX )
-      {
-        matched = true;
-        break;
-      }
-    }
-
-    // Return the logical position of the cursor in characters.
-
-    if( !matched )
-    {
-      visualIndex = endCharacter;
-    }
-
-    return hasRightToLeftCharacters ? *( visualToLogicalCursorBuffer + visualIndex ) : visualIndex;
-  }
-
-  /**
-   * @brief Calculates the cursor's position for a given character index in the logical order.
-   *
-   * It retrieves as well the line's height and the cursor's height and
-   * if there is a valid alternative cursor, its position and height.
-   *
-   * @param[in] logical The logical cursor position (in characters). 0 is just before the first character, a value equal to the number of characters is just after the last character.
-   * @param[out] cursorInfo The line's height, the cursor's height, the cursor's position and whether there is an alternative cursor.
-   */
-  void GetCursorPosition( CharacterIndex logical,
-                          CursorInfo& cursorInfo ) const
-  {
-    // TODO: Check for multiline with \n, etc...
-
-    // Check if the logical position is the first or the last one of the text.
-    const bool isFirstPosition = 0u == logical;
-    const bool isLastPosition = mLogicalModel->GetNumberOfCharacters() == logical;
-
-    if( isFirstPosition && isLastPosition )
-    {
-      // There is zero characters. Get the default font.
-
-      FontId defaultFontId = 0u;
-      if( NULL == mFontDefaults )
-      {
-        defaultFontId = mFontClient.GetFontId( EMPTY_STRING,
-                                               EMPTY_STRING );
-      }
-      else
-      {
-        defaultFontId = mFontDefaults->GetFontId( mFontClient );
-      }
-
-      Text::FontMetrics fontMetrics;
-      mFontClient.GetFontMetrics( defaultFontId, fontMetrics );
-
-      cursorInfo.lineHeight = fontMetrics.ascender - fontMetrics.descender;
-      cursorInfo.primaryCursorHeight = cursorInfo.lineHeight;
-
-      cursorInfo.primaryPosition.x = 0.f;
-      cursorInfo.primaryPosition.y = 0.f;
-
-      // Nothing else to do.
-      return;
-    }
-
-    // Get the previous logical index.
-    const CharacterIndex previousLogical = isFirstPosition ? 0u : logical - 1u;
-
-    // Decrease the logical index if it's the last one.
-    if( isLastPosition )
-    {
-      --logical;
-    }
-
-    // Get the direction of the character and the previous one.
-    const CharacterDirection* const modelCharacterDirectionsBuffer = ( 0u != mLogicalModel->mCharacterDirections.Count() ) ? mLogicalModel->mCharacterDirections.Begin() : NULL;
-
-    CharacterDirection isCurrentRightToLeft = false;
-    CharacterDirection isPreviousRightToLeft = false;
-    if( NULL != modelCharacterDirectionsBuffer ) // If modelCharacterDirectionsBuffer is NULL, it means the whole text is left to right.
-    {
-      isCurrentRightToLeft = *( modelCharacterDirectionsBuffer + logical );
-      isPreviousRightToLeft = *( modelCharacterDirectionsBuffer + previousLogical );
-    }
-
-    // Get the line where the character is laid-out.
-    const LineRun* modelLines = mVisualModel->mLines.Begin();
-
-    const LineIndex lineIndex = mVisualModel->GetLineOfCharacter( logical );
-    const LineRun& line = *( modelLines + lineIndex );
-
-    // Get the paragraph's direction.
-    const CharacterDirection isRightToLeftParagraph = line.direction;
-
-    // Check whether there is an alternative position:
-
-    cursorInfo.isSecondaryCursor = ( isCurrentRightToLeft != isPreviousRightToLeft ) ||
-                                   ( isLastPosition && ( isRightToLeftParagraph != isCurrentRightToLeft ) );
-
-    // Set the line height.
-    cursorInfo.lineHeight = line.ascender + -line.descender;
-
-    // Convert the cursor position into the glyph position.
-    CharacterIndex characterIndex = logical;
-    if( cursorInfo.isSecondaryCursor &&
-        ( isRightToLeftParagraph != isCurrentRightToLeft ) )
-    {
-      characterIndex = previousLogical;
-    }
-
-    const GlyphIndex currentGlyphIndex = *( mVisualModel->mCharactersToGlyph.Begin() + characterIndex );
-    const Length numberOfGlyphs = *( mVisualModel->mGlyphsPerCharacter.Begin() + characterIndex );
-    const Length numberOfCharacters = *( mVisualModel->mCharactersPerGlyph.Begin() +currentGlyphIndex );
-
-    // Get the metrics for the group of glyphs.
-    GlyphMetrics glyphMetrics;
-    GetGlyphsMetrics( currentGlyphIndex,
-                      numberOfGlyphs,
-                      glyphMetrics );
-
-    float interGlyphAdvance = 0.f;
-    if( !isLastPosition &&
-        ( numberOfCharacters > 1u ) )
-    {
-      const CharacterIndex firstIndex = *( mVisualModel->mGlyphsToCharacters.Begin() + currentGlyphIndex );
-      interGlyphAdvance = static_cast<float>( characterIndex - firstIndex ) * glyphMetrics.advance / static_cast<float>( numberOfCharacters );
-    }
-
-    // Get the glyph position and x bearing.
-    const Vector2& currentPosition = *( mVisualModel->mGlyphPositions.Begin() + currentGlyphIndex );
-
-    // Set the cursor's height.
-    cursorInfo.primaryCursorHeight = glyphMetrics.fontHeight;
-
-    // Set the position.
-    cursorInfo.primaryPosition.x = -glyphMetrics.xBearing + currentPosition.x + ( isCurrentRightToLeft ? glyphMetrics.advance : interGlyphAdvance );
-    cursorInfo.primaryPosition.y = line.ascender - glyphMetrics.ascender;
-
-    if( isLastPosition )
-    {
-      // The position of the cursor after the last character needs special
-      // care depending on its direction and the direction of the paragraph.
-
-      if( cursorInfo.isSecondaryCursor )
-      {
-        // Need to find the first character after the last character with the paragraph's direction.
-        // i.e l0 l1 l2 r0 r1 should find r0.
-
-        // TODO: check for more than one line!
-        characterIndex = isRightToLeftParagraph ? line.characterRun.characterIndex : line.characterRun.characterIndex + line.characterRun.numberOfCharacters - 1u;
-        characterIndex = mLogicalModel->GetLogicalCharacterIndex( characterIndex );
-
-        const GlyphIndex glyphIndex = *( mVisualModel->mCharactersToGlyph.Begin() + characterIndex );
-        const Length numberOfGlyphs = *( mVisualModel->mGlyphsPerCharacter.Begin() + characterIndex );
-
-        const Vector2& position = *( mVisualModel->mGlyphPositions.Begin() + glyphIndex );
-
-        // Get the metrics for the group of glyphs.
-        GlyphMetrics glyphMetrics;
-        GetGlyphsMetrics( glyphIndex,
-                          numberOfGlyphs,
-                          glyphMetrics );
-
-        cursorInfo.primaryPosition.x = -glyphMetrics.xBearing + position.x + ( isRightToLeftParagraph ? 0.f : glyphMetrics.advance );
-
-        cursorInfo.primaryPosition.y = line.ascender - glyphMetrics.ascender;
-      }
-      else
-      {
-        if( !isCurrentRightToLeft )
-        {
-          cursorInfo.primaryPosition.x += glyphMetrics.advance;
-        }
-        else
-        {
-          cursorInfo.primaryPosition.x -= glyphMetrics.advance;
-        }
-      }
-    }
-
-    // Set the alternative cursor position.
-    if( cursorInfo.isSecondaryCursor )
-    {
-      // Convert the cursor position into the glyph position.
-      const CharacterIndex previousCharacterIndex = ( ( isRightToLeftParagraph != isCurrentRightToLeft ) ? logical : previousLogical );
-      const GlyphIndex previousGlyphIndex = *( mVisualModel->mCharactersToGlyph.Begin() + previousCharacterIndex );
-      const Length numberOfGlyphs = *( mVisualModel->mGlyphsPerCharacter.Begin() + previousCharacterIndex );
-
-      // Get the glyph position.
-      const Vector2& previousPosition = *( mVisualModel->mGlyphPositions.Begin() + previousGlyphIndex );
-
-      // Get the metrics for the group of glyphs.
-      GlyphMetrics glyphMetrics;
-      GetGlyphsMetrics( previousGlyphIndex,
-                        numberOfGlyphs,
-                        glyphMetrics );
-
-      // Set the cursor position and height.
-      cursorInfo.secondaryPosition.x = -glyphMetrics.xBearing + previousPosition.x + ( ( ( isLastPosition && !isCurrentRightToLeft ) ||
-                                                                                         ( !isLastPosition && isCurrentRightToLeft )    ) ? glyphMetrics.advance : 0.f );
-
-      cursorInfo.secondaryCursorHeight = 0.5f * glyphMetrics.fontHeight;
-
-      cursorInfo.secondaryPosition.y = cursorInfo.lineHeight - cursorInfo.secondaryCursorHeight - line.descender - ( glyphMetrics.fontHeight - glyphMetrics.ascender );
-
-      // Update the primary cursor height as well.
-      cursorInfo.primaryCursorHeight *= 0.5f;
-    }
-  }
-
-  /**
-   * @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 of glyphs.
-   * @param[out] glyphMetrics Some glyph metrics (font height, advance, ascender and x bearing).
-   */
-  void GetGlyphsMetrics( GlyphIndex glyphIndex,
-                         Length numberOfGlyphs,
-                         GlyphMetrics& glyphMetrics ) const
-  {
-    const GlyphInfo* glyphsBuffer = mVisualModel->mGlyphs.Begin();
-
-    const GlyphInfo& firstGlyph = *( glyphsBuffer + glyphIndex );
-
-    Text::FontMetrics fontMetrics;
-    mFontClient.GetFontMetrics( firstGlyph.fontId, fontMetrics );
-
-    glyphMetrics.fontHeight = fontMetrics.height;
-    glyphMetrics.advance = firstGlyph.advance;
-    glyphMetrics.ascender = fontMetrics.ascender;
-    glyphMetrics.xBearing = firstGlyph.xBearing;
-
-    for( unsigned int i = 1u; i < numberOfGlyphs; ++i )
-    {
-      const GlyphInfo& glyphInfo = *( glyphsBuffer + glyphIndex + i );
-
-      glyphMetrics.advance += glyphInfo.advance;
-    }
-  }
-
-  /**
-   * @brief Calculates the new cursor index.
-   *
-   * It takes into account that in some scripts multiple characters can form a glyph and all of them
-   * need to be jumped with one key event.
-   *
-   * @param[in] index The initial new index.
-   *
-   * @return The new cursor index.
-   */
-  CharacterIndex CalculateNewCursorIndex( CharacterIndex index ) const
-  {
-    CharacterIndex cursorIndex = mPrimaryCursorPosition;
-
-    const Script script = mLogicalModel->GetScript( index );
-    const GlyphIndex* charactersToGlyphBuffer = mVisualModel->mCharactersToGlyph.Begin();
-    const Length* charactersPerGlyphBuffer = mVisualModel->mCharactersPerGlyph.Begin();
-
-    Length numberOfCharacters = 0u;
-    if( TextAbstraction::LATIN == script )
-    {
-      // Prevents to jump the whole Latin ligatures like fi, ff, ...
-      numberOfCharacters = 1u;
-    }
-    else
-    {
-      GlyphIndex glyphIndex = *( charactersToGlyphBuffer + index );
-      numberOfCharacters = *( charactersPerGlyphBuffer + glyphIndex );
-
-      while( 0u == numberOfCharacters )
-      {
-        numberOfCharacters = *( charactersPerGlyphBuffer + glyphIndex );
-        ++glyphIndex;
-      }
-    }
-
-    if( index < mPrimaryCursorPosition )
-    {
-      cursorIndex -= numberOfCharacters;
-    }
-    else
-    {
-      cursorIndex += numberOfCharacters;
-    }
-
-    return cursorIndex;
-  }
-
-  void UpdateCursorPosition()
-  {
-    CursorInfo cursorInfo;
-
-    GetCursorPosition( mPrimaryCursorPosition,
-                       cursorInfo );
-
-    mDecorator->SetPosition( PRIMARY_CURSOR,
-                             cursorInfo.primaryPosition.x,
-                             cursorInfo.primaryPosition.y,
-                             cursorInfo.primaryCursorHeight,
-                             cursorInfo.lineHeight );
-
-    if( cursorInfo.isSecondaryCursor )
-    {
-      mDecorator->SetActiveCursor( ACTIVE_CURSOR_BOTH );
-      mDecorator->SetPosition( SECONDARY_CURSOR,
-                               cursorInfo.secondaryPosition.x,
-                               cursorInfo.secondaryPosition.y,
-                               cursorInfo.secondaryCursorHeight,
-                               cursorInfo.lineHeight );
-    }
-    else
-    {
-      mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
-    }
-
-    mUpdateCursorPosition = false;
-    mDecoratorUpdated = true;
-  }
-
-  LogicalModelPtr              mLogicalModel;
-  VisualModelPtr               mVisualModel;
-  DecoratorPtr                 mDecorator;
-  FontDefaults*                mFontDefaults;
-  TextAbstraction::FontClient& mFontClient;
-  std::string                  mPlaceholderText;
-
-  /**
-   * This is used to delay handling events until after the model has been updated.
-   * The number of updates to the model is minimized to improve performance.
-   */
-  vector<Event> mEventQueue; ///< The queue of touch events etc.
-
-  State mState; ///< Selection mode, edit mode etc.
-
-  CharacterIndex mPrimaryCursorPosition;   ///< Index into logical model for primary cursor
-  CharacterIndex mSecondaryCursorPosition; ///< Index into logical model for secondary cursor
-
-  /**
-   * 0,0 means that the top-left corner of the layout matches the top-left corner of the UI control.
-   * Typically this will have a negative value with scrolling occurs.
-   */
-  Vector2 mScrollPosition; ///< The text is offset by this position when scrolling.
-
-  bool mDecoratorUpdated           : 1; ///< True if the decorator was updated during event processing
-  bool mCursorBlinkEnabled         : 1; ///< True if cursor should blink when active
-  bool mGrabHandleEnabled          : 1; ///< True if grab handle is enabled
-  bool mGrabHandlePopupEnabled     : 1; ///< True if the grab handle popu-up should be shown
-  bool mSelectionEnabled           : 1; ///< True if selection handles, highlight etc. are enabled
-  bool mHorizontalScrollingEnabled : 1; ///< True if horizontal scrolling is enabled
-  bool mVerticalScrollingEnabled   : 1; ///< True if vertical scrolling is enabled
-  bool mUpdateCursorPosition       : 1; ///< True if the visual position of the cursor must be recalculated
-};
-
-struct Controller::Impl
-{
-  Impl( ControlInterface& controlInterface )
-  : mControlInterface( controlInterface ),
-    mLogicalModel(),
-    mVisualModel(),
-    mFontDefaults( NULL ),
-    mTextInput( NULL ),
-    mFontClient(),
-    mView(),
-    mLayoutEngine(),
-    mModifyEvents(),
-    mControlSize(),
-    mAlignmentOffset(),
-    mOperationsPending( NO_OPERATION ),
-    mRecalculateNaturalSize( true )
-  {
-    mLogicalModel = LogicalModel::New();
-    mVisualModel  = VisualModel::New();
-
-    mFontClient = TextAbstraction::FontClient::Get();
-
-    mView.SetVisualModel( mVisualModel );
-
-    // Set the text properties to default
-    mVisualModel->SetTextColor( Color::WHITE );
-    mVisualModel->SetShadowOffset( Vector2::ZERO );
-    mVisualModel->SetShadowColor( Vector4::ZERO );
-    mVisualModel->SetUnderlineEnabled( false );
-    mVisualModel->SetUnderlineHeight( 0.0f );
-  }
-
-  ~Impl()
-  {
-    delete mTextInput;
-  }
-
-  ControlInterface& mControlInterface;     ///< Reference to the text controller.
-  LogicalModelPtr mLogicalModel;           ///< Pointer to the logical model.
-  VisualModelPtr  mVisualModel;            ///< Pointer to the visual model.
-  FontDefaults* mFontDefaults;             ///< Avoid allocating this when the user does not specify a font.
-  Controller::TextInput* mTextInput;       ///< Avoid allocating everything for text input until EnableTextInput().
-  TextAbstraction::FontClient mFontClient; ///< Handle to the font client.
-  View mView;                              ///< The view interface to the rendering back-end.
-  LayoutEngine mLayoutEngine;              ///< The layout engine.
-  std::vector<ModifyEvent> mModifyEvents;  ///< Temporary stores the text set until the next relayout.
-  Size mControlSize;                       ///< The size of the control.
-  Vector2 mAlignmentOffset;                ///< Vertical and horizontal offset of the whole text inside the control due to alignment.
-  OperationsMask mOperationsPending;       ///< Operations pending to be done to layout the text.
-  bool mRecalculateNaturalSize:1;          ///< Whether the natural size needs to be recalculated.
-};
-
 ControllerPtr Controller::New( ControlInterface& controlInterface )
 {
   return ControllerPtr( new Controller( controlInterface ) );
@@ -1024,14 +64,14 @@ void Controller::SetText( const std::string& text )
 
   // Keep until size negotiation
   ModifyEvent event;
-  event.type = REPLACE_TEXT;
+  event.type = ModifyEvent::REPLACE_TEXT;
   event.text = text;
   mImpl->mModifyEvents.push_back( event );
 
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
     // Cancel previously queued events
-    mImpl->mTextInput->mEventQueue.clear();
+    mImpl->mEventData->mEventQueue.clear();
 
     // TODO - Hide selection decorations
   }
@@ -1040,7 +80,7 @@ void Controller::SetText( const std::string& text )
 void Controller::GetText( std::string& text ) const
 {
   if( !mImpl->mModifyEvents.empty() &&
-       REPLACE_TEXT == mImpl->mModifyEvents[0].type )
+       ModifyEvent::REPLACE_TEXT == mImpl->mModifyEvents[0].type )
   {
     text = mImpl->mModifyEvents[0].text;
   }
@@ -1052,17 +92,17 @@ void Controller::GetText( std::string& text ) const
 
 void Controller::SetPlaceholderText( const std::string& text )
 {
-  if( !mImpl->mTextInput )
+  if( !mImpl->mEventData )
   {
-    mImpl->mTextInput->mPlaceholderText = text;
+    mImpl->mEventData->mPlaceholderText = text;
   }
 }
 
 void Controller::GetPlaceholderText( std::string& text ) const
 {
-  if( !mImpl->mTextInput )
+  if( !mImpl->mEventData )
   {
-    text = mImpl->mTextInput->mPlaceholderText;
+    text = mImpl->mEventData->mPlaceholderText;
   }
 }
 
@@ -1070,7 +110,7 @@ void Controller::SetDefaultFontFamily( const std::string& defaultFontFamily )
 {
   if( !mImpl->mFontDefaults )
   {
-    mImpl->mFontDefaults = new Controller::FontDefaults();
+    mImpl->mFontDefaults = new FontDefaults();
   }
 
   mImpl->mFontDefaults->mDefaultFontFamily = defaultFontFamily;
@@ -1089,7 +129,7 @@ void Controller::SetDefaultFontFamily( const std::string& defaultFontFamily )
   mImpl->mVisualModel->mLines.Clear();
   mImpl->mVisualModel->ClearCaches();
 
-  RequestRelayout();
+  mImpl->RequestRelayout();
 }
 
 const std::string& Controller::GetDefaultFontFamily() const
@@ -1106,7 +146,7 @@ void Controller::SetDefaultFontStyle( const std::string& defaultFontStyle )
 {
   if( !mImpl->mFontDefaults )
   {
-    mImpl->mFontDefaults = new Controller::FontDefaults();
+    mImpl->mFontDefaults = new FontDefaults();
   }
 
   mImpl->mFontDefaults->mDefaultFontStyle = defaultFontStyle;
@@ -1125,7 +165,7 @@ void Controller::SetDefaultFontStyle( const std::string& defaultFontStyle )
   mImpl->mVisualModel->mLines.Clear();
   mImpl->mVisualModel->ClearCaches();
 
-  RequestRelayout();
+  mImpl->RequestRelayout();
 }
 
 const std::string& Controller::GetDefaultFontStyle() const
@@ -1142,7 +182,7 @@ void Controller::SetDefaultPointSize( float pointSize )
 {
   if( !mImpl->mFontDefaults )
   {
-    mImpl->mFontDefaults = new Controller::FontDefaults();
+    mImpl->mFontDefaults = new FontDefaults();
   }
 
   mImpl->mFontDefaults->mDefaultPointSize = pointSize;
@@ -1161,7 +201,7 @@ void Controller::SetDefaultPointSize( float pointSize )
   mImpl->mVisualModel->mLines.Clear();
   mImpl->mVisualModel->ClearCaches();
 
-  RequestRelayout();
+  mImpl->RequestRelayout();
 }
 
 float Controller::GetDefaultPointSize() const
@@ -1188,99 +228,95 @@ void Controller::GetDefaultFonts( Vector<FontRun>& fonts, Length numberOfCharact
   }
 }
 
-const Vector4& Controller::GetTextColor() const
+void Controller::SetTextColor( const Vector4& textColor )
 {
-  return mImpl->mVisualModel->GetTextColor();
+  mImpl->mVisualModel->SetTextColor( textColor );
 }
 
-const Vector2& Controller::GetShadowOffset() const
+const Vector4& Controller::GetTextColor() const
 {
-  return mImpl->mVisualModel->GetShadowOffset();
+  return mImpl->mVisualModel->GetTextColor();
 }
 
-const Vector4& Controller::GetShadowColor() const
+void Controller::SetShadowOffset( const Vector2& shadowOffset )
 {
-  return mImpl->mVisualModel->GetShadowColor();
+  mImpl->mVisualModel->SetShadowOffset( shadowOffset );
 }
 
-const Vector4& Controller::GetUnderlineColor() const
+const Vector2& Controller::GetShadowOffset() const
 {
-  return mImpl->mVisualModel->GetUnderlineColor();
+  return mImpl->mVisualModel->GetShadowOffset();
 }
 
-bool Controller::IsUnderlineEnabled() const
+void Controller::SetShadowColor( const Vector4& shadowColor )
 {
-  return mImpl->mVisualModel->IsUnderlineEnabled();
+  mImpl->mVisualModel->SetShadowColor( shadowColor );
 }
 
-float Controller::GetUnderlineHeight() const
+const Vector4& Controller::GetShadowColor() const
 {
-  return mImpl->mVisualModel->GetUnderlineHeight();
+  return mImpl->mVisualModel->GetShadowColor();
 }
 
-void Controller::SetTextColor( const Vector4& textColor )
+void Controller::SetUnderlineColor( const Vector4& color )
 {
-  mImpl->mVisualModel->SetTextColor( textColor );
+  mImpl->mVisualModel->SetUnderlineColor( color );
 }
 
-void Controller::SetShadowOffset( const Vector2& shadowOffset )
+const Vector4& Controller::GetUnderlineColor() const
 {
-  mImpl->mVisualModel->SetShadowOffset( shadowOffset );
+  return mImpl->mVisualModel->GetUnderlineColor();
 }
 
-void Controller::SetShadowColor( const Vector4& shadowColor )
+void Controller::SetUnderlineEnabled( bool enabled )
 {
-  mImpl->mVisualModel->SetShadowColor( shadowColor );
+  mImpl->mVisualModel->SetUnderlineEnabled( enabled );
 }
 
-void Controller::SetUnderlineColor( const Vector4& color )
+bool Controller::IsUnderlineEnabled() const
 {
-  mImpl->mVisualModel->SetUnderlineColor( color );
+  return mImpl->mVisualModel->IsUnderlineEnabled();
 }
 
-void Controller::SetUnderlineEnabled( bool enabled )
+void Controller::SetUnderlineHeight( float height )
 {
-  mImpl->mVisualModel->SetUnderlineEnabled( enabled );
+  mImpl->mVisualModel->SetUnderlineHeight( height );
 }
 
-void Controller::SetUnderlineHeight( float height )
+float Controller::GetUnderlineHeight() const
 {
-  mImpl->mVisualModel->SetUnderlineHeight( height );
+  return mImpl->mVisualModel->GetUnderlineHeight();
 }
 
 void Controller::EnableTextInput( DecoratorPtr decorator )
 {
-  if( !mImpl->mTextInput )
+  if( !mImpl->mEventData )
   {
-    mImpl->mTextInput = new TextInput( mImpl->mLogicalModel,
-                                       mImpl->mVisualModel,
-                                       decorator,
-                                       mImpl->mFontDefaults,
-                                       mImpl->mFontClient );
+    mImpl->mEventData = new EventData( decorator );
   }
 }
 
 void Controller::SetEnableCursorBlink( bool enable )
 {
-  DALI_ASSERT_DEBUG( NULL != mImpl->mTextInput && "TextInput disabled" );
+  DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "TextInput disabled" );
 
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
-    mImpl->mTextInput->mCursorBlinkEnabled = enable;
+    mImpl->mEventData->mCursorBlinkEnabled = enable;
 
     if( !enable &&
-        mImpl->mTextInput->mDecorator )
+        mImpl->mEventData->mDecorator )
     {
-      mImpl->mTextInput->mDecorator->StopCursorBlink();
+      mImpl->mEventData->mDecorator->StopCursorBlink();
     }
   }
 }
 
 bool Controller::GetEnableCursorBlink() const
 {
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
-    return mImpl->mTextInput->mCursorBlinkEnabled;
+    return mImpl->mEventData->mCursorBlinkEnabled;
   }
 
   return false;
@@ -1288,9 +324,9 @@ bool Controller::GetEnableCursorBlink() const
 
 const Vector2& Controller::GetScrollPosition() const
 {
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
-    return mImpl->mTextInput->mScrollPosition;
+    return mImpl->mEventData->mScrollPosition;
   }
 
   return Vector2::ZERO;
@@ -1406,7 +442,6 @@ bool Controller::Relayout( const Size& size )
       mImpl->mVisualModel->SetGlyphPositions( NULL, 0u );
       glyphsRemoved = true;
     }
-
     // Not worth to relayout if width or height is equal to zero.
     return glyphsRemoved;
   }
@@ -1438,10 +473,10 @@ bool Controller::Relayout( const Size& size )
   // After doing the text layout, the alignment offset to place the actor in the desired position can be calculated.
   CalculateTextAlignment( size );
 
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
     // Move the cursor, grab handle etc.
-    updated = mImpl->mTextInput->ProcessInputEvents( mImpl->mControlSize, mImpl->mAlignmentOffset ) || updated;
+    updated = mImpl->ProcessInputEvents() || updated;
   }
 
   return updated;
@@ -1453,18 +488,18 @@ void Controller::ProcessModifyEvents()
 
   for( unsigned int i=0; i<events.size(); ++i )
   {
-    if( REPLACE_TEXT == events[0].type )
+    if( ModifyEvent::REPLACE_TEXT == events[0].type )
     {
       // A (single) replace event should come first, otherwise we wasted time processing NOOP events
       DALI_ASSERT_DEBUG( 0 == i && "Unexpected REPLACE event" );
 
       ReplaceTextEvent( events[0].text );
     }
-    else if( INSERT_TEXT == events[0].type )
+    else if( ModifyEvent::INSERT_TEXT == events[0].type )
     {
       InsertTextEvent( events[0].text );
     }
-    else if( DELETE_TEXT == events[0].type )
+    else if( ModifyEvent::DELETE_TEXT == events[0].type )
     {
       DeleteTextEvent();
     }
@@ -1509,9 +544,9 @@ void Controller::ReplaceTextEvent( const std::string& text )
   utf32Characters.Resize( characterCount );
 
   // Reset the cursor position
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
-    mImpl->mTextInput->mPrimaryCursorPosition = characterCount;
+    mImpl->mEventData->mPrimaryCursorPosition = characterCount;
     // TODO - handle secondary cursor
   }
 
@@ -1529,7 +564,7 @@ void Controller::ReplaceTextEvent( const std::string& text )
 
 void Controller::InsertTextEvent( const std::string& text )
 {
-  DALI_ASSERT_DEBUG( NULL != mImpl->mTextInput && "Unexpected InsertTextEvent" );
+  DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "Unexpected InsertTextEvent" );
 
   // TODO - Optimize this
   mImpl->mLogicalModel->mScriptRuns.Clear();
@@ -1564,7 +599,7 @@ void Controller::InsertTextEvent( const std::string& text )
 
   // Insert at current cursor position
   Vector<Character>& modifyText = mImpl->mLogicalModel->mText;
-  CharacterIndex& cursorIndex = mImpl->mTextInput->mPrimaryCursorPosition;
+  CharacterIndex& cursorIndex = mImpl->mEventData->mPrimaryCursorPosition;
 
   if( cursorIndex < modifyText.Count() )
   {
@@ -1590,12 +625,12 @@ void Controller::InsertTextEvent( const std::string& text )
                                                            REORDER );
 
   // Queue a cursor reposition event; this must wait until after DoRelayout()
-  mImpl->mTextInput->mUpdateCursorPosition = true;
+  mImpl->mEventData->mUpdateCursorPosition = true;
 }
 
 void Controller::DeleteTextEvent()
 {
-  DALI_ASSERT_DEBUG( NULL != mImpl->mTextInput && "Unexpected InsertTextEvent" );
+  DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "Unexpected InsertTextEvent" );
 
   // TODO - Optimize this
   mImpl->mLogicalModel->mScriptRuns.Clear();
@@ -1618,7 +653,7 @@ void Controller::DeleteTextEvent()
 
   // Delte at current cursor position
   Vector<Character>& modifyText = mImpl->mLogicalModel->mText;
-  CharacterIndex& cursorIndex = mImpl->mTextInput->mPrimaryCursorPosition;
+  CharacterIndex& cursorIndex = mImpl->mEventData->mPrimaryCursorPosition;
 
   if( cursorIndex > 0 &&
       cursorIndex-1 < modifyText.Count() )
@@ -1641,7 +676,7 @@ void Controller::DeleteTextEvent()
                                                            REORDER );
 
   // Queue a cursor reposition event; this must wait until after DoRelayout()
-  mImpl->mTextInput->mUpdateCursorPosition = true;
+  mImpl->mEventData->mUpdateCursorPosition = true;
 }
 
 void Controller::UpdateModel( OperationsMask operationsRequired )
@@ -1992,52 +1027,47 @@ void Controller::CalculateTextAlignment( const Size& size )
   }
 }
 
-View& Controller::GetView()
-{
-  return mImpl->mView;
-}
-
 LayoutEngine& Controller::GetLayoutEngine()
 {
   return mImpl->mLayoutEngine;
 }
 
-void Controller::RequestRelayout()
+View& Controller::GetView()
 {
-  mImpl->mControlInterface.RequestTextRelayout();
+  return mImpl->mView;
 }
 
 void Controller::KeyboardFocusGainEvent()
 {
-  DALI_ASSERT_DEBUG( mImpl->mTextInput && "Unexpected KeyboardFocusGainEvent" );
+  DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected KeyboardFocusGainEvent" );
 
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
-    TextInput::Event event( TextInput::KEYBOARD_FOCUS_GAIN_EVENT );
-    mImpl->mTextInput->mEventQueue.push_back( event );
+    Event event( Event::KEYBOARD_FOCUS_GAIN_EVENT );
+    mImpl->mEventData->mEventQueue.push_back( event );
 
-    RequestRelayout();
+    mImpl->RequestRelayout();
   }
 }
 
 void Controller::KeyboardFocusLostEvent()
 {
-  DALI_ASSERT_DEBUG( mImpl->mTextInput && "Unexpected KeyboardFocusLostEvent" );
+  DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected KeyboardFocusLostEvent" );
 
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
-    TextInput::Event event( TextInput::KEYBOARD_FOCUS_LOST_EVENT );
-    mImpl->mTextInput->mEventQueue.push_back( event );
+    Event event( Event::KEYBOARD_FOCUS_LOST_EVENT );
+    mImpl->mEventData->mEventQueue.push_back( event );
 
-    RequestRelayout();
+    mImpl->RequestRelayout();
   }
 }
 
 bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
 {
-  DALI_ASSERT_DEBUG( mImpl->mTextInput && "Unexpected KeyEvent" );
+  DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected KeyEvent" );
 
-  if( mImpl->mTextInput &&
+  if( mImpl->mEventData &&
       keyEvent.state == KeyEvent::Down )
   {
     int keyCode = keyEvent.keyCode;
@@ -2054,29 +1084,29 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
              Dali::DALI_KEY_CURSOR_UP    == keyCode ||
              Dali::DALI_KEY_CURSOR_DOWN  == keyCode )
     {
-      TextInput::Event event( TextInput::CURSOR_KEY_EVENT );
+      Event event( Event::CURSOR_KEY_EVENT );
       event.p1.mInt = keyCode;
-      mImpl->mTextInput->mEventQueue.push_back( event );
+      mImpl->mEventData->mEventQueue.push_back( event );
     }
     else if( Dali::DALI_KEY_BACKSPACE == keyCode )
     {
       // Queue a delete event
       ModifyEvent event;
-      event.type = DELETE_TEXT;
+      event.type = ModifyEvent::DELETE_TEXT;
       mImpl->mModifyEvents.push_back( event );
     }
     else if( !keyString.empty() )
     {
       // Queue an insert event
       ModifyEvent event;
-      event.type = INSERT_TEXT;
+      event.type = ModifyEvent::INSERT_TEXT;
       event.text = keyString;
       mImpl->mModifyEvents.push_back( event );
     }
 
-    mImpl->mTextInput->ChangeState( TextInput::EDITING ); // todo Confirm this is the best place to change the state of
+    mImpl->ChangeState( EventData::EDITING ); // todo Confirm this is the best place to change the state of
 
-    RequestRelayout();
+    mImpl->RequestRelayout();
   }
 
   return false;
@@ -2084,49 +1114,50 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
 
 void Controller::TapEvent( unsigned int tapCount, float x, float y )
 {
-  DALI_ASSERT_DEBUG( mImpl->mTextInput && "Unexpected TapEvent" );
+  DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected TapEvent" );
 
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
-    TextInput::Event event( TextInput::TAP_EVENT );
+    Event event( Event::TAP_EVENT );
     event.p1.mUint = tapCount;
     event.p2.mFloat = x;
     event.p3.mFloat = y;
-    mImpl->mTextInput->mEventQueue.push_back( event );
+    mImpl->mEventData->mEventQueue.push_back( event );
 
-    RequestRelayout();
+    mImpl->RequestRelayout();
   }
 }
 
 void Controller::PanEvent( Gesture::State state, const Vector2& displacement )
 {
-  DALI_ASSERT_DEBUG( mImpl->mTextInput && "Unexpected PanEvent" );
+  DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected PanEvent" );
 
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
-    TextInput::Event event( TextInput::PAN_EVENT );
+    Event event( Event::PAN_EVENT );
     event.p1.mInt = state;
     event.p2.mFloat = displacement.x;
     event.p3.mFloat = displacement.y;
-    mImpl->mTextInput->mEventQueue.push_back( event );
+    mImpl->mEventData->mEventQueue.push_back( event );
 
-    RequestRelayout();
+    mImpl->RequestRelayout();
   }
 }
 
 void Controller::GrabHandleEvent( GrabHandleState state, float x, float y )
 {
-  DALI_ASSERT_DEBUG( mImpl->mTextInput && "Unexpected GrabHandleEvent" );
+  DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected GrabHandleEvent" );
 
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
-    TextInput::Event event( TextInput::GRAB_HANDLE_EVENT );
+    Event event( Event::GRAB_HANDLE_EVENT );
     event.p1.mUint  = state;
     event.p2.mFloat = x;
     event.p3.mFloat = y;
-    mImpl->mTextInput->mEventQueue.push_back( event );
+    
+    mImpl->mEventData->mEventQueue.push_back( event );
 
-    RequestRelayout();
+    mImpl->RequestRelayout();
   }
 }
 
index a5dd91b..d37efab 100644 (file)
@@ -427,11 +427,6 @@ protected:
 private:
 
   /**
-   * @brief Request a relayout using the ControlInterface.
-   */
-  void RequestRelayout();
-
-  /**
    * @brief Private constructor.
    */
   Controller( ControlInterface& controlInterface );
@@ -446,12 +441,6 @@ private:
 
   struct Impl;
   Impl* mImpl;
-
-  // Avoid allocating this when the user does not specify a font
-  struct FontDefaults;
-
-  // Avoid allocating this for non-editable controls
-  struct TextInput;
 };
 
 } // namespace Text
index 888322a..b05107b 100644 (file)
@@ -41,7 +41,7 @@ namespace
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::CubeTransitionEffect, Dali::BaseHandle, NULL );
 
-DALI_SIGNAL_REGISTRATION( CubeTransitionEffect, "transition-completed", SIGNAL_TRANSITION_COMPLETED )
+DALI_SIGNAL_REGISTRATION( Toolkit, CubeTransitionEffect, "transition-completed", SIGNAL_TRANSITION_COMPLETED )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -117,8 +117,7 @@ void CubeTransitionEffect::Initialize()
 
   // helper actor to create a off-screen image using shader effect
   mEmptyImage = ImageActor::New( placeHolder );
-  mEmptyImage.SetRelayoutEnabled( false );
-  mEmptyImage.SetSize(Stage::GetCurrent().GetSize());
+  mEmptyImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   mEmptyImage.SetParentOrigin( ParentOrigin::CENTER );
   mEmptyImage.SetAnchorPoint( AnchorPoint::CENTER );
   mFullImageCreator = FullAreaImageCreator::New();
@@ -141,7 +140,6 @@ void CubeTransitionEffect::Initialize()
 ImageActor CubeTransitionEffect::CreateTile( Image image, const Vector4& color )
 {
   ImageActor tile = ImageActor::New( image );
-  tile.SetRelayoutEnabled( false );
   tile.SetParentOrigin( ParentOrigin::CENTER );
   tile.SetAnchorPoint( AnchorPoint::CENTER );
   tile.SetSize( mTileSize );
index 38c5475..3ab0ba8 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.
index e8e4ad4..a975014 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_UIBUILDER_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.
index 640517c..9ca5189 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.
index c409d64..0b5c515 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_JSON_PARSER_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.
index f5d295c..cf6dacb 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.
index 69e6e47..893caee 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_SCRIPT_TREE_NODE_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.
index 99566dc..6778b63 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.
index e4db745..1f34eb5 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_ALIGNMENT_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.
index 6fa395a..94b8170 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.
index 25f2287..51c3ab1 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_BLOOM_VIEW_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.
index 62389fa..b719b22 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.
index 5648280..0141454 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_BUBBLE_EMMITER_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.
index ab953bf..86746c3 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.
index 19e9fc6..a49a9e0 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_BUTTON_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.
index 179304d..de1c2b0 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.
index 2e905d6..9752213 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_CHECK_BOX_BUTTON_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.
index d9e395e..0ef9698 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.
@@ -77,7 +77,6 @@ PushButton PushButton::DownCast( BaseHandle handle )
 void PushButton::SetButtonImage( Image image )
 {
   Actor imageActor = ImageActor::New( image );
-  imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor );
 }
 
@@ -94,7 +93,6 @@ Actor PushButton::GetButtonImage() const
 void PushButton::SetBackgroundImage( Image image )
 {
   Actor imageActor = ImageActor::New( image );
-  imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( imageActor );
 }
 
index 0b4fa5f..dd3ffb6 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_PUSH_BUTTON_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.
index c698225..b43523d 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.
index f8dbf59..2dc26b1 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_RADIO_BUTTON_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.
index 0e2d988..6fd1c4e 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.
index 7596b66..955f8e5 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_CLUSTER_STYLE_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.
index aab2765..ad90d64 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.
index d417e0f..11dc5ae 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_CLUSTER_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.
index d65c16b..e825767 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.
@@ -65,15 +65,17 @@ BaseHandle Create()
 // Setup signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Control, CustomActor, Create );
 
-// Note: Properties are registered separately below,
+// Note: Properties are registered separately below.
 
-DALI_SIGNAL_REGISTRATION( Control, "key-event",                 SIGNAL_KEY_EVENT         )
-DALI_SIGNAL_REGISTRATION( Control, "tapped",                    SIGNAL_TAPPED            )
-DALI_SIGNAL_REGISTRATION( Control, "panned",                    SIGNAL_PANNED            )
-DALI_SIGNAL_REGISTRATION( Control, "pinched",                   SIGNAL_PINCHED           )
-DALI_SIGNAL_REGISTRATION( Control, "long-pressed",              SIGNAL_LONG_PRESSED      )
+DALI_SIGNAL_REGISTRATION( Toolkit, Control, "key-event",              SIGNAL_KEY_EVENT              )
+DALI_SIGNAL_REGISTRATION( Toolkit, Control, "key-input-focus-gained", SIGNAL_KEY_INPUT_FOCUS_GAINED )
+DALI_SIGNAL_REGISTRATION( Toolkit, Control, "key-input-focus-lost",   SIGNAL_KEY_INPUT_FOCUS_LOST   )
+DALI_SIGNAL_REGISTRATION( Toolkit, Control, "tapped",                 SIGNAL_TAPPED                 )
+DALI_SIGNAL_REGISTRATION( Toolkit, Control, "panned",                 SIGNAL_PANNED                 )
+DALI_SIGNAL_REGISTRATION( Toolkit, Control, "pinched",                SIGNAL_PINCHED                )
+DALI_SIGNAL_REGISTRATION( Toolkit, Control, "long-pressed",           SIGNAL_LONG_PRESSED           )
 
-DALI_ACTION_REGISTRATION( Control, "control-activated",         ACTION_CONTROL_ACTIVATED )
+DALI_ACTION_REGISTRATION( Toolkit, Control, "control-activated",      ACTION_CONTROL_ACTIVATED      )
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -130,16 +132,30 @@ Mesh CreateMesh()
  * Sets all the required properties for the background actor.
  *
  * @param[in]  actor              The actor to set the properties on.
+ * @param[in]  color              The required color of the actor.
+ */
+void SetupBackgroundActor( Actor actor, const Vector4& color )
+{
+  actor.SetColor( color );
+  actor.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
+  actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
+  actor.SetZ( BACKGROUND_ACTOR_Z_POSITION );
+  actor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
+}
+
+/**
+ * Sets all the required properties for the background actor.
+ *
+ * @param[in]  actor              The actor to set the properties on.
  * @param[in]  constrainingIndex  The property index to constrain the parent's size on.
  * @param[in]  color              The required color of the actor.
  */
-void SetupBackgroundActor( Actor actor, Property::Index constrainingIndex, const Vector4& color )
+void SetupBackgroundActorConstrained( Actor actor, Property::Index constrainingIndex, const Vector4& color )
 {
   actor.SetColor( color );
   actor.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
   actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
   actor.SetZ( BACKGROUND_ACTOR_Z_POSITION );
-  actor.SetRelayoutEnabled( false );
 
   Constraint constraint = Constraint::New<Vector3>( actor,
                                                     constrainingIndex,
@@ -180,7 +196,7 @@ public:
     mLongPressGestureDetector(),
     mCurrentSize(),
     mNaturalSize(),
-    mFlags( Control::CONTROL_BEHAVIOUR_NONE ),
+    mFlags( Control::ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
     mIsKeyboardNavigationSupported( false ),
     mIsKeyboardFocusGroup( false ),
     mInitialized( false )
@@ -366,6 +382,8 @@ public:
   Background* mBackground;           ///< Only create the background if we use it
   Vector3* mStartingPinchScale;      ///< The scale when a pinch gesture starts, TODO: consider removing this
   Toolkit::Control::KeyEventSignalType mKeyEventSignal;
+  Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusGainedSignal;
+  Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusLostSignal;
 
   // Gesture Detection
   PinchGestureDetector mPinchGestureDetector;
@@ -376,7 +394,7 @@ public:
   Vector3 mCurrentSize; ///< Stores the current control's size, this is the negotiated size
   Vector3 mNaturalSize; ///< Stores the size set through the Actor's API. This is size the actor wants to be. Useful when reset to the initial size is needed.
 
-  ControlBehaviour mFlags :6;              ///< Flags passed in from constructor. Need to increase this size when new enums are added
+  ControlBehaviour mFlags :CONTROL_BEHAVIOUR_FLAG_COUNT;    ///< Flags passed in from constructor.
   bool mIsKeyboardNavigationSupported :1;  ///< Stores whether keyboard navigation is supported by the control.
   bool mIsKeyboardFocusGroup :1;           ///< Stores whether the control is a focus group.
   bool mInitialized :1;
@@ -397,7 +415,7 @@ PropertyRegistration Control::Impl::PROPERTY_4( typeRegistration, "key-input-foc
 Toolkit::Control Control::New()
 {
   // Create the implementation, temporarily owned on stack
-  IntrusivePtr<Control> controlImpl = new Control( CONTROL_BEHAVIOUR_NONE );
+  IntrusivePtr<Control> controlImpl = new Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) );
 
   // Pass ownership to handle
   Toolkit::Control handle( *controlImpl );
@@ -540,7 +558,7 @@ void Control::SetBackgroundColor( const Vector4& color )
     // Create Mesh Actor
     MeshActor meshActor = MeshActor::New( CreateMesh() );
 
-    SetupBackgroundActor( meshActor, Actor::Property::SCALE, color );
+    SetupBackgroundActorConstrained( meshActor, Actor::Property::SCALE, color );
 
     // Set the background actor before adding so that we do not inform deriving classes
     background.actor = meshActor;
@@ -571,7 +589,7 @@ void Control::SetBackgroundImage( Image image )
   }
 
   ImageActor imageActor = ImageActor::New( image );
-  SetupBackgroundActor( imageActor, Actor::Property::SIZE, background.color );
+  SetupBackgroundActor( imageActor, background.color );
 
   // Set the background actor before adding so that we do not inform derived classes
   background.actor = imageActor;
@@ -685,6 +703,14 @@ bool Control::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* t
     {
       controlImpl.KeyEventSignal().Connect( tracker, functor );
     }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_GAINED ) )
+    {
+      controlImpl.KeyInputFocusGainedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_LOST ) )
+    {
+      controlImpl.KeyInputFocusLostSignal().Connect( tracker, functor );
+    }
     else if( 0 == strcmp( signalName.c_str(), SIGNAL_TAPPED ) )
     {
       controlImpl.EnableGestureDetection( Gesture::Tap );
@@ -719,6 +745,16 @@ Toolkit::Control::KeyEventSignalType& Control::KeyEventSignal()
   return mImpl->mKeyEventSignal;
 }
 
+Toolkit::Control::KeyInputFocusSignalType& Control:: KeyInputFocusGainedSignal()
+{
+  return mImpl->mKeyInputFocusGainedSignal;
+}
+
+Toolkit::Control::KeyInputFocusSignalType& Control:: KeyInputFocusLostSignal()
+{
+  return mImpl->mKeyInputFocusLostSignal;
+}
+
 bool Control::EmitKeyEventSignal( const KeyEvent& event )
 {
   // Guard against destruction during signal emission
@@ -742,7 +778,7 @@ bool Control::EmitKeyEventSignal( const KeyEvent& event )
 }
 
 Control::Control( ControlBehaviour behaviourFlags )
-: CustomActorImpl( behaviourFlags & REQUIRES_TOUCH_EVENTS ),
+: CustomActorImpl( static_cast< ActorFlags >( behaviourFlags ) ),
   mImpl(new Impl(*this))
 {
   mImpl->mFlags = behaviourFlags;
@@ -753,13 +789,6 @@ void Control::Initialize()
   // Calling deriving classes
   OnInitialize();
 
-  // Test if the no size negotiation flag is not set
-  if( ( mImpl->mFlags & NO_SIZE_NEGOTIATION ) == 0 )
-  {
-    // Size negotiate disabled by default, so turn it on for this actor
-    Self().SetRelayoutEnabled( true );
-  }
-
   if( mImpl->mFlags & REQUIRES_STYLE_CHANGE_SIGNALS )
   {
     Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
@@ -771,8 +800,10 @@ void Control::Initialize()
     GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
   }
 
-  SetRequiresHoverEvents(mImpl->mFlags & REQUIRES_HOVER_EVENTS);
-  SetRequiresMouseWheelEvents(mImpl->mFlags & REQUIRES_MOUSE_WHEEL_EVENTS);
+  if( mImpl->mFlags & REQUIRES_KEYBOARD_NAVIGATION_SUPPORT )
+  {
+    SetKeyboardNavigationSupport( true );
+  }
 
   mImpl->mInitialized = true;
 }
@@ -920,14 +951,36 @@ void Control::OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dime
 {
 }
 
+void Control::EmitKeyInputFocusSignal( bool focusGained )
+{
+  Dali::Toolkit::Control handle( GetOwner() );
+
+  if ( focusGained )
+  {
+     // signals are allocated dynamically when someone connects
+     if ( !mImpl->mKeyInputFocusGainedSignal.Empty() )
+     {
+      mImpl->mKeyInputFocusGainedSignal.Emit( handle );
+     }
+  }
+  else
+  {
+    // signals are allocated dynamically when someone connects
+    if ( !mImpl->mKeyInputFocusLostSignal.Empty() )
+    {
+      mImpl->mKeyInputFocusLostSignal.Emit( handle );
+    }
+  }
+}
+
 void Control::OnKeyInputFocusGained()
 {
-  // Do Nothing
+  EmitKeyInputFocusSignal( true );
 }
 
 void Control::OnKeyInputFocusLost()
 {
-  // Do Nothing
+  EmitKeyInputFocusSignal( false );
 }
 
 void Control::OnSizeAnimation(Animation& animation, const Vector3& targetSize)
index 5c29c39..35e679f 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_CONTROL_IMPL_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.
@@ -209,7 +209,7 @@ public:
   /**
    * @brief Sets whether this control supports two dimensional
    * keyboard navigation (i.e. whether it knows how to handle the
-   * keyboardn focus movement between its child actors).
+   * keyboard focus movement between its child actors).
    *
    * The control doesn't support it by default.
    * @param[in] isSupported Whether this control supports two dimensional keyboard navigation.
@@ -296,6 +296,15 @@ public:
    */
   virtual void OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor);
 
+  /**
+   * @brief Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal
+   *
+   * Should be called last by the control after it acts on the Input Focus change.
+   *
+   * @param[in] focusGained True if gained, False if lost
+   */
+  void EmitKeyInputFocusSignal( bool focusGained );
+
   // Actions & Signals
 
   /**
@@ -325,6 +334,16 @@ public:
   Toolkit::Control::KeyEventSignalType& KeyEventSignal();
 
   /**
+   * @copydoc Dali::Toolkit::Control::KeyInputFocusGainedSignal()
+   */
+  Toolkit::Control::KeyInputFocusSignalType& KeyInputFocusGainedSignal();
+
+  /**
+   * @copydoc Dali::Toolkit::Control::KeyInputFocusLostSignal()
+   */
+  Toolkit::Control::KeyInputFocusSignalType& KeyInputFocusLostSignal();
+
+  /**
    * @brief Called by the KeyInputFocusManager to emit key event signals.
    *
    * @param[in] event The key event.
@@ -339,14 +358,14 @@ protected:
   // Flags for the constructor
   enum ControlBehaviour
   {
-    CONTROL_BEHAVIOUR_NONE        = 0,
-    REQUIRES_TOUCH_EVENTS         = 1<<1,     ///< True if the OnTouchEvent() callback is required.
-    REQUIRES_STYLE_CHANGE_SIGNALS = 1<<2,     ///< True if needs to monitor style change signals such as theme/font change
-    NO_SIZE_NEGOTIATION           = 1<<3,     ///< True if control does not need size negotiation, i.e. it can be skipped in the algorithm
-    REQUIRES_HOVER_EVENTS         = 1<<4,     ///< True if the OnHoverEvent() callback is required.
-    REQUIRES_MOUSE_WHEEL_EVENTS   = 1<<5      ///< True if the OnMouseWheelEvent() callback is required.
+    REQUIRES_STYLE_CHANGE_SIGNALS        = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 0 ),     ///< True if needs to monitor style change signals such as theme/font change
+    REQUIRES_KEYBOARD_NAVIGATION_SUPPORT = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 1 ),     ///< True if needs to support keyboard navigation
+
+    LAST_CONTROL_BEHAVIOUR_FLAG
   };
 
+  static const int CONTROL_BEHAVIOUR_FLAG_COUNT = Log< LAST_CONTROL_BEHAVIOUR_FLAG - 1 >::value + 1;      ///< Total count of flags
+
   /**
    * @brief Create a Control.
    *
index 4ceae4f..5bbc4e7 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.
@@ -144,6 +144,16 @@ Control::KeyEventSignalType& Control::KeyEventSignal()
   return GetImplementation().KeyEventSignal();
 }
 
+Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal()
+{
+  return GetImplementation().KeyInputFocusGainedSignal();
+}
+
+Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal()
+{
+  return GetImplementation().KeyInputFocusLostSignal();
+}
+
 Control::Control(Internal::Control& implementation)
 : CustomActor(implementation)
 {
index b4373c7..7e4e693 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_CONTROL_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.
@@ -48,13 +48,15 @@ class Control;
  * @see Internal::Control
  *
  * Signals
- * | %Signal Name      | Method                                              |
- * |-------------------|-----------------------------------------------------|
- * | key-event         | @ref KeyEventSignal()                               |
- * | tapped            | @ref GetTapGestureDetector().DetectedSignal()       |
- * | panned            | @ref GetPanGestureDetector().DetectedSignal()       |
- * | pinched           | @ref GetPinchGestureDetector().DetectedSignal()     |
- * | long-pressed      | @ref GetLongPressGestureDetector().DetectedSignal() |
+ * | %Signal Name           | Method                                              |
+ * |------------------------|-----------------------------------------------------|
+ * | key-event              | @ref KeyEventSignal()                               |
+ * | key-input-focus-gained | @ref KeyInputFocusGainedSignal()                    |
+ * | key-input-focus-lost   | @ref KeyInputFocusLostSignal()                      |
+ * | tapped                 | @ref GetTapGestureDetector().DetectedSignal()       |
+ * | panned                 | @ref GetPanGestureDetector().DetectedSignal()       |
+ * | pinched                | @ref GetPinchGestureDetector().DetectedSignal()     |
+ * | long-pressed           | @ref GetLongPressGestureDetector().DetectedSignal() |
  *
  * Actions
  * | %Action Name      | %Control method called                              |
@@ -105,6 +107,9 @@ public:
   /// @brief Key Event signal type;
   typedef Signal<bool ( Control, const KeyEvent& ) > KeyEventSignalType;
 
+  /// @brief Key InputFocusType signal type;
+  typedef Signal<void ( Control ) > KeyInputFocusSignalType;
+
 public: // Creation & Destruction
 
   /**
@@ -307,13 +312,43 @@ public:
    * @code
    *   bool YourCallbackName(Control control, const KeyEvent& event);
    * @endcode
-   * The return value of True, indicates that the touch event should be consumed.
-   * Otherwise the signal will be emitted on the next sensitive parent of the actor.
+   * The return value of True, indicates that the event should be consumed.
+   * Otherwise the signal will be emitted on the next parent of the actor.
    * @pre The Control has been initialized.
    * @return The signal to connect to.
    */
   KeyEventSignalType& KeyEventSignal();
 
+  /**
+   * @brief This signal is emitted when the control gets Key Input Focus
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   bool YourCallbackName( Control control );
+   * @endcode
+   * The return value of True, indicates that the event should be consumed.
+   * Otherwise the signal will be emitted on the next parent of the actor.
+   * @pre The Control has been initialized.
+   * @return The signal to connect to.
+   */
+  KeyInputFocusSignalType& KeyInputFocusGainedSignal();
+
+  /**
+   * @brief This signal is emitted when the control loses Key Input Focus
+   * which could be due to it being gained by another Control or Actor or just cleared from
+   * this control as no longer required.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   bool YourCallbackName( Control control );
+   * @endcode
+   * The return value of True, indicates that the event should be consumed.
+   * Otherwise the signal will be emitted on the next parent of the actor.
+   * @pre The Control has been initialized.
+   * @return The signal to connect to.
+   */
+  KeyInputFocusSignalType& KeyInputFocusLostSignal();
+
 public: // Intended for control developers
 
   /**
index d803317..87fbb94 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.
index 3ca9a94..e78c1b8 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_CHECK_BUTTON_FACTORY_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.
index bba811b..6558ed5 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.
index 8be96dd..c04991d 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_PUSH_BUTTON_FACTORY_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.
index 5a6ae0e..a43c874 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.
index 1949a60..23b00e2 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SOLID_COLOR_ACTOR_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.
index 1925c62..679a308 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.
index d198192..2255e1f 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_EFFECTS_VIEW_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.
index c944368..c1e1c97 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.
index f50d045..ed3f117 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_GAUSSIAN_BLUR_EFFECT_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.
index 0ccc83f..1b7bd37 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.
index 0c604ec..b4e6208 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_MASKED_IMAGE_VIEW_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.
index 6a18f78..f245dee 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.
index ff6cee0..95c5a2b 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_MAGNIFIER_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.
index 4a06591..52f1d07 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_NAVIGATION_BAR_STYLE_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.
index a1d8513..747847a 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.
index 87924f5..d701efc 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_NAVIGATION_CONTROL_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.
index ad075ef..4de539c 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.
index 02b71bc..8093c7c 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_PAGE_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.
index 60bfce9..6d448d0 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.
index dbf9fc9..c0d09a2 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_PAGE_FACTORY_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.
index a3091ce..aadbffb 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.
index 4d6c877..37215a1 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_PAGE_TURN_LANDSCAPE_VIEW_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.
index 7c6bc50..bb30f23 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.
index 124913f..5da3a97 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_PAGE_TURN_PORTRAIT_VIEW_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.
index c2c44a5..2f582d3 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.
index fa068ec..6b4ee7e 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_PAGE_TURN_VIEW_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.
index b557f01..5c851b7 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.
@@ -132,11 +132,6 @@ void Popup::HideTail()
   GetImpl(*this).HideTail();
 }
 
-void Popup::MarkDirtyForRelayout()
-{
-  GetImpl(*this).MarkDirtyForRelayout();
-}
-
 Popup::TouchedOutsideSignalType& Popup::OutsideTouchedSignal()
 {
   return GetImpl(*this).OutsideTouchedSignal();
index 1ab708b..32322e2 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_POPUP_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.
@@ -244,11 +244,6 @@ public:
    */
   void HideTail();
 
-  /**
-   * @brief Flag the popup as dirty for relayout
-   */
-  void MarkDirtyForRelayout();
-
 public: // Not intended for application developers
 
   /**
index 8475482..0ca355d 100755 (executable)
@@ -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.
index 70fcb9d..6adfd17 100755 (executable)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_BAR_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.
index 564235c..abd03b0 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.
@@ -235,62 +235,62 @@ struct DepthPositionConstraint270
 
 struct DepthRotationConstraint0
 {
-  DepthRotationConstraint0(float angleRadians)
+  DepthRotationConstraint0(Radian angleRadians)
   : mTiltAngle(angleRadians)
   {
   }
 
   Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
   {
-    return Quaternion(0.0f, Vector3::ZAXIS) * Quaternion(mTiltAngle, Vector3::XAXIS);
+    return Quaternion( Radian( 0.0f ), Vector3::ZAXIS ) * Quaternion( mTiltAngle, Vector3::XAXIS );
   }
 
-  float mTiltAngle;
+  Radian mTiltAngle;
 };
 
 struct DepthRotationConstraint90
 {
-  DepthRotationConstraint90(float angleRadians)
+  DepthRotationConstraint90(Radian angleRadians)
   : mTiltAngle(angleRadians)
   {
   }
 
   Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
   {
-    return Quaternion(1.5f * Math::PI, Vector3::ZAXIS) * Quaternion(mTiltAngle, Vector3::XAXIS);
+    return Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS) * Quaternion( mTiltAngle, Vector3::XAXIS );
   }
 
-  float mTiltAngle;
+  Radian mTiltAngle;
 };
 
 struct DepthRotationConstraint180
 {
-  DepthRotationConstraint180(float angleRadians)
+  DepthRotationConstraint180(Radian angleRadians)
   : mTiltAngle(angleRadians)
   {
   }
 
   Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
   {
-    return Quaternion(-Math::PI, Vector3::ZAXIS) * Quaternion(mTiltAngle, Vector3::XAXIS);
+    return Quaternion( Radian( -Math::PI ), Vector3::ZAXIS) * Quaternion( mTiltAngle, Vector3::XAXIS );
   }
 
-  float mTiltAngle;
+  Radian mTiltAngle;
 };
 
 struct DepthRotationConstraint270
 {
-  DepthRotationConstraint270(float angleRadians)
+  DepthRotationConstraint270(Radian angleRadians)
   : mTiltAngle(angleRadians)
   {
   }
 
   Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
   {
-    return Quaternion(0.5f * Math::PI, Vector3::ZAXIS) * Quaternion(mTiltAngle, Vector3::XAXIS);
+    return Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS) * Quaternion( mTiltAngle, Vector3::XAXIS );
   }
 
-  float mTiltAngle;
+  Radian mTiltAngle;
 };
 
 struct DepthColorConstraint
@@ -450,12 +450,12 @@ float DepthLayout::GetRowSpacing() const
 
 void DepthLayout::SetTiltAngle(Degree angle)
 {
-  mImpl->mTiltAngle = Degree( Clamp<float>(angle, -45.0f, 45.0f) );
+  mImpl->mTiltAngle = Degree( Clamp( angle, -45.0f, 45.0f ) );
 }
 
 Degree DepthLayout::GetTiltAngle() const
 {
-  return mImpl->mTiltAngle;
+  return Degree( mImpl->mTiltAngle );
 }
 
 void DepthLayout::SetItemSizeFunction(ItemSizeFunction function)
@@ -485,7 +485,7 @@ void DepthLayout::SetItemTiltAngle(Degree angle)
 
 Degree DepthLayout::GetItemTiltAngle() const
 {
-  return mImpl->mItemTiltAngle;
+  return Degree( mImpl->mItemTiltAngle );
 }
 
 void DepthLayout::SetColumnPositionFunction(ColumnPositionFunction function)
@@ -673,19 +673,19 @@ Degree DepthLayout::GetScrollDirection() const
 
   if (mOrientation == ControlOrientation::Up)
   {
-    scrollDirection = 180.0f;
+    scrollDirection = Degree( 180.0f );
   }
   else if (mOrientation == ControlOrientation::Left)
   {
-    scrollDirection = 270.0f;
+    scrollDirection = Degree( 270.0f );
   }
   else if (mOrientation == ControlOrientation::Down)
   {
-    scrollDirection = 0.0f;
+    scrollDirection = Degree( 0.0f );
   }
   else // mOrientation == ControlOrientation::Right
   {
-    scrollDirection = 90.0f;
+    scrollDirection = Degree( 90.0f );
   }
 
   return scrollDirection;
index f9b12af..9452931 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_DEPTH_LAYOUT_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.
index 93e9956..d7fca94 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.
@@ -193,7 +193,7 @@ struct GridRotationConstraint0
 {
   Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
   {
-    return Quaternion(0.0f, Vector3::ZAXIS);
+    return Quaternion( Radian( 0.0f ), Vector3::ZAXIS);
   }
 };
 
@@ -201,7 +201,7 @@ struct GridRotationConstraint90
 {
   Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
   {
-    return Quaternion(1.5f * Math::PI, Vector3::ZAXIS);
+    return Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS);
   }
 };
 
@@ -209,7 +209,7 @@ struct GridRotationConstraint180
 {
   Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
   {
-    return Quaternion(Math::PI, Vector3::ZAXIS);
+    return Quaternion( Radian( Math::PI ), Vector3::ZAXIS);
   }
 };
 
@@ -217,7 +217,7 @@ struct GridRotationConstraint270
 {
   Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
   {
-    return Quaternion(0.5f * Math::PI, Vector3::ZAXIS);
+    return Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS);
   }
 };
 
@@ -692,19 +692,19 @@ Degree GridLayout::GetScrollDirection() const
 
   if (mOrientation == ControlOrientation::Up)
   {
-    scrollDirection = 0.0f;
+    scrollDirection = Degree( 0.0f );
   }
   else if (mOrientation == ControlOrientation::Left)
   {
-    scrollDirection = 90.0f;
+    scrollDirection = Degree( 90.0f );
   }
   else if (mOrientation == ControlOrientation::Down)
   {
-    scrollDirection = 180.0f;
+    scrollDirection = Degree( 180.0f );
   }
   else // mOrientation == ControlOrientation::Right
   {
-    scrollDirection = 270.0f;
+    scrollDirection = Degree( 270.0f );
   }
 
   return scrollDirection;
index 8824ffe..aa52d9d 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_GRID_LAYOUT_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.
index d441242..4aec6f3 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.
index a8bdb3c..e02c62b 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_ITEM_FACTORY_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.
index 918b9bb..81f50bc 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.
index ee9ca7d..b8485f7 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_ITEM_LAYOUT_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.
index be7e56c..7772d45 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_ITEM_VIEW_DECLARATIONS_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.
index 26a232f..034bcbe 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.
index aefa4f1..d1f29a5 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_ITEM_VIEW_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.
index 07b5a78..4d9cede 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.
@@ -178,7 +178,7 @@ struct SpiralRotationConstraintUp
   {
     float angle = -mItemSpacingRadians * layoutPosition;
 
-    return Quaternion(angle, Vector3::YAXIS);
+    return Quaternion( Radian( angle ), Vector3::YAXIS);
   }
 
   float mItemSpacingRadians;
@@ -195,7 +195,7 @@ struct SpiralRotationConstraintLeft
   {
     float angle = -mItemSpacingRadians * layoutPosition;
 
-    return Quaternion(-Math::PI*0.5f, Vector3::ZAXIS) * Quaternion(angle, Vector3::YAXIS);
+    return Quaternion( Radian( -Math::PI * 0.5f ), Vector3::ZAXIS ) * Quaternion( Radian( angle ), Vector3::YAXIS );
   }
 
   float mItemSpacingRadians;
@@ -212,7 +212,7 @@ struct SpiralRotationConstraintDown
   {
     float angle = -mItemSpacingRadians * layoutPosition;
 
-    return Quaternion(-Math::PI, Vector3::ZAXIS) * Quaternion(angle, Vector3::YAXIS);
+    return Quaternion( Radian( -Math::PI ), Vector3::ZAXIS) * Quaternion( Radian( angle ), Vector3::YAXIS );
   }
 
   float mItemSpacingRadians;
@@ -229,7 +229,7 @@ struct SpiralRotationConstraintRight
   {
     float angle = -mItemSpacingRadians * layoutPosition;
 
-    return Quaternion(-Math::PI*1.5f, Vector3::ZAXIS) * Quaternion(angle, Vector3::YAXIS);
+    return Quaternion( Radian( -Math::PI * 1.5f ), Vector3::ZAXIS) * Quaternion( Radian( angle ), Vector3::YAXIS );
   }
 
   float mItemSpacingRadians;
@@ -244,10 +244,9 @@ struct SpiralColorConstraint
 
   Vector4 operator()(const Vector4& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
   {
-    Degree angle = Radian(mItemSpacingRadians * fabsf(layoutPosition));
-    angle = (float)((int)angle % 360);
+    Radian angle( mItemSpacingRadians * fabsf(layoutPosition) / Dali::ANGLE_360 );
 
-    float progress = angle / 360.0f;
+    float progress = angle - floorf( angle ); // take fractional bit only to get between 0.0 - 1.0
     progress = (progress > 0.5f) ? 2.0f*(1.0f - progress) : progress*2.0f;
 
     float darkness(1.0f);
@@ -568,19 +567,19 @@ Degree SpiralLayout::GetScrollDirection() const
 
   if (mOrientation == ControlOrientation::Up)
   {
-    scrollDirection = 0.0f - 45.0f; // Allow swiping horizontally & vertically
+    scrollDirection = Degree( -45.0f ); // Allow swiping horizontally & vertically
   }
   else if (mOrientation == ControlOrientation::Left)
   {
-    scrollDirection = 90.0f - 45.0f;
+    scrollDirection = Degree( 45.0f );
   }
   else if (mOrientation == ControlOrientation::Down)
   {
-    scrollDirection = 180.0f - 45.0f;
+    scrollDirection = Degree( 180.0f - 45.0f );
   }
   else // mOrientation == ControlOrientation::Right
   {
-    scrollDirection = 270.0f - 45.0f;
+    scrollDirection = Degree( 270.0f - 45.0f );
   }
 
   return scrollDirection;
index 7b608c9..af01ee1 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SPIRAL_LAYOUT_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.
index e9a1fa7..3b9bc31 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.
index c5f0bb8..1543367 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_COMPONENT_IMPL_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.
index 21984f9..ebf8b63 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.
index cbfdf5b..bdde4d8 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_COMPONENT_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.
index a8dac9e..ac15652 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.
index 986f12f..e235de9 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_CONNECTOR_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.
index e5b11cd..a3edca4 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.
index 868ebca..d7b47a1 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_VIEW_CAROUSEL_EFFECT_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.
index 995bfc2..e7cec29 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.
index dcb8e34..40a1f45 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_VIEW_CONSTRAINTS_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.
index 2bb8a26..67eaa51 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.
index 3546a28..c4fb603 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_VIEW_CUBE_EFFECT_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.
index 82577a2..fa65001 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.
index 1c8a605..57bc1bc 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_VIEW_DEPTH_EFFECT_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.
index 781c7c9..abdd901 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.
index 40ca06e..3b2fb13 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_VIEW_EFFECT_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.
index f5483d0..08ec102 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.
index 60a936a..357a5b4 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_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.
index 350907d..06a989b 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.
index ffafbd5..0337b15 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CUBE_EFFECT_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.
index 2bd499d..b76ed79 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.
index 11c48cc..a31d6af 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_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.
index 8b3449d..6c9f882 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.
index c5558e8..93a9b20 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_VIEW_WOBBLE_EFFECT_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.
index be7a991..a61025e 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.
index 3ba77ed..cf579ac 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLL_VIEW_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.
index ff955ff..cbad738 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.
index 62f6100..a00aeff 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCROLLABLE_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.
index 41716b3..461e36f 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.
index 3e16e1e..f9142fe 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADOW_VIEW_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.
index f26a05e..86de16e 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.
index 7b9ae6b..6981a69 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SLIDER_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.
index efbfc36..22e347c 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.
index c02c09c..ab9ec44 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SUPER_BLUR_VIEW_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.
index 82e6e10..c92f36e 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.
index 4340d45..46e3437 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_TABLE_VIEW_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.
index 746340c..328007b 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.
index 1bbb0d1..17f9a63 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_TOOL_BAR_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.
index 277e975..c072360 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.
index 99bcc31..50de7bd 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_VIEW_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.
@@ -63,7 +63,7 @@ class View;
  * mView.SetBackground( backgroundImageActor );
  *
  * // Connects the orientation signal with the View::OrientationChanged method.
- * application.GetOrientation().ChangedSignal().Connect( &view, &Toolkit::View::OrientationChanged );
+ * application.GetWindow().GetOrientation().ChangedSignal().Connect( &view, &Toolkit::View::OrientationChanged );
  *
  * // Create a content layer.
  * Layer contentLayer = Layer::New();
index 8cfc291..23cc8f0 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.
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 38;
+const unsigned int TOOLKIT_MICRO_VERSION = 39;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 8c5bf2a..9c59162 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_VERSION_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.
index a664aee..e520bbc 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.
index e1e34ec..5582ba3 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_ENUMS_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.
index a480129..b2dc756 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.
index 67a359c..ef44fc6 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_FOCUS_MANAGER_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.
index cc315c0..316af96 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.
index a1e51f5..68638a3 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_KEYBOARD_FOCUS_MANAGER_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.
index ca6a3d0..c3df2f0 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.
index 07c8aa4..6240350 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_KEYINPUT_FOCUS_MANAGER_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.
index b40dcb4..428d82f 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_SCRIPT_PLUGIN_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.
index 5fbb1e1..fb846f9 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.
index a3dd4bc..e49a0d7 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SCRIPT_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.
index c09f7c0..acccbf8 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.
index 656fa40..c96f143 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_ALPHA_DISCARD_EFFECT_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.
index 9ad0a86..7563108 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.
index 8ce19a0..0fd1374 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_BENDY_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.
index f2b74d9..f9f7945 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.
index ede89ca..4c7405a 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_BLIND_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.
index 9961fdf..4c99eb7 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.
index eebe525..d5a2e75 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_BOUNCING_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.
index 9752e3b..2a4f043 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.
index 862e923..1384f9b 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_BUBBLE_EFFECT_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.
index c0a2b19..d0c49d9 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.
index 74a9c9c..e35e02e 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_COLOR_ADJUSTER_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.
index 49246cd..32772ab 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.
index 777b303..f5bc686 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_CAROUSEL_EFFECT_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.
index c0c142c..523f711 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.
index e59c388..dbc38ba 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_DISPLACEMENT_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.
index c6d68af..97709b5 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.
index 481735d..7ead044 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_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.
index bc20944..26430d0 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.
index 9dbbfbf..f140eee 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_LOCAL_DISSOLVE_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.
index 6c120b2..9bde48e 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.
index 9adf92b..7d0b883 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_DISTANCEFIELD_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.
index ee9b256..9b1b0b1 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.
index 7a3b372..a74f5b8 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_IMAGE_REGION_EFFECT_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.
index 38a83dd..9680775 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.
index 4d1cdaf..7bad71e 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_IRIS_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.
index 50b4c2c..a0a44bb 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.
index c9f1881..a950ecb 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_MASK_EFFECT_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.
index 8a11c06..0464150 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.
index 155a6e2..1eafac1 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_MIRROR_EFFECT_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.
index 9c281b4..205327d 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.
index e9da7f2..5455fef 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_MOTION_BLUR_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.
index 8817171..3a631bf 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.
index 15cfcbf..5cc7bcf 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_MOTION_STRETCH_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.
index d2b8967..c03537d 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.
@@ -108,19 +108,19 @@ static void DoApply( ImageActor actor, const std::string& maskImage, const Vecto
 
 void Apply( ImageActor actor, const std::string& maskImage )
 {
-  Vector2 maskSize = ResourceImage::GetImageSize( maskImage );
+  const Uint16Pair maskSize = ResourceImage::GetImageSize( maskImage );
 
-  const float leftRight = (maskSize.width  - 1.0f) * 0.5f;
-  const float topBottom = (maskSize.height - 1.0f) * 0.5f;
+  const float leftRight = (maskSize.GetWidth()  - 1.0f) * 0.5f;
+  const float topBottom = (maskSize.GetHeight() - 1.0f) * 0.5f;
 
-  DoApply( actor, maskImage, maskSize, Vector4( leftRight, topBottom, leftRight, topBottom ) );
+  DoApply( actor, maskImage, Vector2( maskSize.GetWidth(), maskSize.GetHeight() ), Vector4( leftRight, topBottom, leftRight, topBottom ) );
 }
 
 void Apply( ImageActor actor, const std::string& maskImage, const Vector4& maskBorder )
 {
-  Vector2 maskSize = ResourceImage::GetImageSize( maskImage );
+  const Uint16Pair maskSize = ResourceImage::GetImageSize( maskImage );
 
-  DoApply( actor, maskImage, maskSize, maskBorder );
+  DoApply( actor, maskImage, Vector2( maskSize.GetWidth(), maskSize.GetHeight() ), maskBorder );
 }
 
 } // namespace NinePatchMaskEffect
index e61401f..0b21228 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_NINE_PATCH_MASK_EFFECT_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.
index dd0334b..4479084 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.
index aadd5e2..ece950b 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_OVERLAY_EFFECT_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.
index eae9ac7..36d1849 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.
index 98f0ebe..cb41e99 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_PAGE_TURN_BOOK_SPINE_EFFECT_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.
index 2732952..1a2f817 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.
index f48070f..1d2b8e6 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_PAGE_TURN_EFFECT_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.
index 7c8965c..d197be8 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.
index 7d5e199..e3e0ad8 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_QUADRATIC_BEZIER_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.
index bdbeaec..ec354c9 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.
index 5a4a0e4..72e3883 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_RIPPLE_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.
index cfbb685..972631d 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.
index 76d1d07..f93ce79 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_RIPPLE2D_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.
index fb0dd37..031c8aa 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.
index 444ae3f..a9b819b 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHEAR_EFFECT_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.
index f516973..fbf3da2 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.
index 6013115..7404066 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_SOFT_BUTTON_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.
index 2eef696..09408fb 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.
index 5c69baa..0788309 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_SPOT_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.
index 0d3d348..5a5b0a3 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.
index 63e26b1..31ee848 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_SQUARE_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.
index 67cf84d..66e330b 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.
index b052476..6327fdc 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_SHADER_EFFECT_SWIRL_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.
index 663d5ae..caf29ca 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.
index bd69308..a6be02c 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_WATER_EFFECT_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.
index d2bc299..126c208 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.
index f7f22a6..f3b8b7a 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_STYLE_MANAGER_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.
@@ -51,7 +51,7 @@ class StyleManager;
  *   void OnInit(Application& app)
  *   {
  *      Toolkit::StyleManager::Get().RequestThemeChange( CUSTOM_THEME );
- *      Toolkit::StyleManager::Get().SetOrientation( app.GetOrientation() );
+ *      Toolkit::StyleManager::Get().SetOrientation( app.GetWindow().GetOrientation() );
  *      ...
  *   }
  * @endcode
index 076a708..9af4758 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.
index a9ff0c3..01b7bea 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_CUBE_TRANSITION_CROSS_EFFECT_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.
index aec216f..6ba444e 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.
index e640296..5afab34 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_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.
index 32816f7..633d01b 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.
index a6bb252..44c9871 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_CUBE_TRANSITION_FOLD_EFFECT_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.
index d55710f..33d292c 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.
index e807b80..7ca30ba 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_CUBE_TRANSITION_WAVE_EFFECT_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.
index 35e7869..e0f40e6 100644 (file)
@@ -101,7 +101,7 @@ class PropertyButtonsController: public ConnectionTracker
     }
 
     // Create the last selected button text view.
-    mTagText = Toolkit::TextView::New( "None selected" );
+    mTagText = Toolkit::TextLabel::New( "None selected" );
     mTagText.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
     mTagText.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
     mTagText.SetPosition( Vector3( 0.0f, -30.0f, 0.0f ) );
@@ -121,14 +121,14 @@ class PropertyButtonsController: public ConnectionTracker
     // Property::Index index = button.GetPropertyIndex( TAG_PROPERTY_NAME );
     valueText << "Selected: " << button.GetProperty< float >( mTagPropertyIndex );
 
-    mTagText.SetText( valueText.str() );
+    mTagText.SetProperty( TextLabel::Property::TEXT, valueText.str() );
 
     return true;
   }
 
   private:
 
-  Toolkit::TextView mTagText;        ///< A text label used to show the last button pressed.
+  Toolkit::TextLabel mTagText;        ///< A text label used to show the last button pressed.
   Property::Index mTagPropertyIndex; ///< A cached property index of our custom tag property.
 };
 
diff --git a/docs/content/images/actors/Text-Actor.png b/docs/content/images/actors/Text-Actor.png
deleted file mode 100644 (file)
index 6bba38e..0000000
Binary files a/docs/content/images/actors/Text-Actor.png and /dev/null differ
diff --git a/docs/content/images/actors/Text-Label.png b/docs/content/images/actors/Text-Label.png
new file mode 100644 (file)
index 0000000..cc2dc30
Binary files /dev/null and b/docs/content/images/actors/Text-Label.png differ
diff --git a/docs/content/images/text-controls/HelloWorld-HeightForWidth.png b/docs/content/images/text-controls/HelloWorld-HeightForWidth.png
new file mode 100644 (file)
index 0000000..915862c
Binary files /dev/null and b/docs/content/images/text-controls/HelloWorld-HeightForWidth.png differ
diff --git a/docs/content/images/text-controls/HelloWorld-NaturalSize.png b/docs/content/images/text-controls/HelloWorld-NaturalSize.png
new file mode 100644 (file)
index 0000000..28d24d1
Binary files /dev/null and b/docs/content/images/text-controls/HelloWorld-NaturalSize.png differ
diff --git a/docs/content/images/text-controls/PlainText.png b/docs/content/images/text-controls/PlainText.png
new file mode 100644 (file)
index 0000000..5ef9ff1
Binary files /dev/null and b/docs/content/images/text-controls/PlainText.png differ
diff --git a/docs/content/images/text-controls/RedText.png b/docs/content/images/text-controls/RedText.png
new file mode 100644 (file)
index 0000000..f2fe9fe
Binary files /dev/null and b/docs/content/images/text-controls/RedText.png differ
diff --git a/docs/content/images/text-controls/TextWith1pxUnderline.png b/docs/content/images/text-controls/TextWith1pxUnderline.png
new file mode 100644 (file)
index 0000000..082d19e
Binary files /dev/null and b/docs/content/images/text-controls/TextWith1pxUnderline.png differ
diff --git a/docs/content/images/text-controls/TextWithBiggerShadow.png b/docs/content/images/text-controls/TextWithBiggerShadow.png
new file mode 100644 (file)
index 0000000..921f745
Binary files /dev/null and b/docs/content/images/text-controls/TextWithBiggerShadow.png differ
diff --git a/docs/content/images/text-controls/TextWithColorShadow.png b/docs/content/images/text-controls/TextWithColorShadow.png
new file mode 100644 (file)
index 0000000..a82635d
Binary files /dev/null and b/docs/content/images/text-controls/TextWithColorShadow.png differ
diff --git a/docs/content/images/text-controls/TextWithColorUnderline.png b/docs/content/images/text-controls/TextWithColorUnderline.png
new file mode 100644 (file)
index 0000000..42ec4ff
Binary files /dev/null and b/docs/content/images/text-controls/TextWithColorUnderline.png differ
diff --git a/docs/content/images/text-controls/TextWithShadow.png b/docs/content/images/text-controls/TextWithShadow.png
new file mode 100644 (file)
index 0000000..1cde8d2
Binary files /dev/null and b/docs/content/images/text-controls/TextWithShadow.png differ
diff --git a/docs/content/images/text-controls/TextWithUnderline.png b/docs/content/images/text-controls/TextWithUnderline.png
new file mode 100644 (file)
index 0000000..530920a
Binary files /dev/null and b/docs/content/images/text-controls/TextWithUnderline.png differ
index 8031d99..2065659 100644 (file)
@@ -12,56 +12,71 @@ Let's take a look at the code for this test application.
 
 <h2 class="pg"> Example code </h2>
 \code
-#include <dali/dali.h>
 
-using namespace Dali;
+#include <dali-toolkit/dali-toolkit.h>
 
-/******************************************************
- * Demonstrates how to display "Hello World" on screen
- ******************************************************/
+using namespace Dali;
+using Dali::Toolkit::TextLabel;
 
-class ExampleApp
+// This example shows how to create and display Hello World! using a simple TextActor
+//
+class HelloWorldController : public ConnectionTracker
 {
 public:
-  ExampleApp(Application &app)
-  : mApp(app)
+
+  HelloWorldController( Application& application )
+  : mApplication( application )
   {
-    // Connect to Dali::Application init signal. Do not make calls to Dali before this signal is received.
-    app.SignalInit().Connect(this, &ExampleApp::Create);
+    // Connect to the Application's Init signal
+    mApplication.InitSignal().Connect( this, &HelloWorldController::Create );
   }
 
-  ~ExampleApp()
+  ~HelloWorldController()
   {
-    // Remove Hello World TextActor from stage
-    Stage::GetCurrent().Remove(mTextActor);
+    // Remove Hello World actor from stage
+    Stage::GetCurrent().Remove(mTextLabel);
   }
 
-public:
-
-  void Create(Application& app)
+  // The Init signal is received once (only) during the Application lifetime
+  void Create( Application& application )
   {
-    // Initialize the actor
-    mTextActor = TextActor::New("Hello World");
+    // Get a handle to the stage
+    Stage stage = Stage::GetCurrent();
+
+    mTextLabel = TextLabel::New( "Hello World" );
+    mTextLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    stage.Add( mTextLabel );
 
-    // Center the actor. Note: default anchor point is CENTER
-    mTextActor.SetParentOrigin(ParentOrigin::CENTER);
+    // Respond to a click anywhere on the stage
+    stage.GetRootLayer().TouchedSignal().Connect( this, &HelloWorldController::OnTouch );
+  }
 
-    // Display the actor on the stage
-    Stage::GetCurrent().Add(mTextActor);
+  bool OnTouch( Actor actor, const TouchEvent& touch )
+  {
+    // quit the application
+    mApplication.Quit();
+    return true;
   }
 
 private:
-  Application& mApp;
-  TextActor mTextActor;
+  Application&  mApplication;
+  TextLabel mTextLabel;
 };
 
-int
-main(int argc, char **argv)
+void RunTest( Application& application )
+{
+  HelloWorldController test( application );
+
+  application.MainLoop();
+}
+
+// Entry point for Linux & Tizen applications
+//
+int main( int argc, char **argv )
 {
-  Application daliApp(&argc, &argv);
+  Application application = Application::New( &argc, &argv );
 
-  ExampleApp helloApp (daliApp);
-  daliApp.MainLoop();
+  RunTest( application );
 
   return 0;
 }
@@ -85,10 +100,10 @@ main(int argc, char **argv)
  That's why we store the Actor's handle:
  \code
    ...
-   mTextActor = TextActor::New("Hello World");
+   mTextLabel = TextLabel::New("Hello World");
    ...
  \endcode
- Even if the TextActor is removed from the stage, it will be kept alive through our reference.\n
+ Even if the TextLabel is removed from the stage, it will be kept alive through our reference.\n
  You can read more about implicit smart-pointer semantics in chapter \link handle-body-idiom Handle â€“ body\endlink.
 
  <h2 class="pg"> Main loop </h2>
@@ -107,6 +122,12 @@ main(int argc, char **argv)
 
  After running './hello' this should be visible on the screen:
 
- \image html Text-Actor.png "Hello world example"
+<table border=0 cellpadding=10>
+<tr>
+  <td>
+  \image html Text-Label.png "Hello world example"
+  </td>
+</tr>
+</table>
 
 */
index 8838e78..0a85d51 100644 (file)
@@ -244,7 +244,7 @@ This is a basic example of a button defined in JSON by setting the default prope
         }
       },
       "label-actor": {
-        "type": "TextView",
+        "type": "TextLabel",
         "text": "Normal"
       }
     }
index 837e022..3bb5ece 100644 (file)
@@ -6,19 +6,13 @@
  *
  * @code
  * {
- *     "fonts":
- *     {
- *         "freesans": {"name": "FreeSans", "point-size": 12.0, "weight": "WEIGHT_REGULAR" }
- *     },
- *     "actors":
- *     [
- *         {"name":"text-actor",
- *          "type":"Text",
- *          "text":"Hello World",
- *          "font":"freesans",
- *          "parent-origin":"CENTER"
- *         }
- *     ]
+ *  // a tree of actors
+ *  "stage": [{
+ *    "name": "text-label",
+ *    "type": "TextLabel",
+ *    "text": "Hello World",
+ *    "parent-origin": "CENTER"
+ *  }]
  * }
  * @endcode
  *
@@ -31,7 +25,7 @@
  *
  * builder.LoadFromString(json_data);
  *
- * Actor actor = builder.GetActor("text-actor");
+ * Actor actor = builder.GetActor("text-label");
  *
  * Stage::GetCurrent().Add(actor);
  * @endcode
  * daliscript hello-world.js
  * @endcode
  *
- * The TextActor control to display Hello World can be constructed using Javascript dot notation accessing Dali Actor Properties.
+ * The TextLabel control to display Hello World can be constructed using Javascript dot notation accessing Dali Actor Properties.
  *
  * @code
- * var textActor = Dali.TextActor();
+ * var textLabel = Dali.TextLabel();
  *
- * textActor.text          = "Hello World";
- * textActor.font          = "FreeSans";
- * textActor.font-weight   = "WEIGHT_REGULAR";
- * textActor.parent-origin = "CENTER";
+ * textLabel.text          = "Hello World";
+ * textLabel.font-family   = "FreeSans";
+ * textLabel.font-style    = "Regular";
+ * textLabel.parent-origin = "CENTER";
  *
  * Dali.Run();
  * @endcode
index d0a8a93..a69d1e8 100644 (file)
@@ -34,7 +34,7 @@ method derived from Actor when passing back controls to be negotiated using the
 
 <h3>Initialization</h3>
 Size negotiation is enabled on controls by default. If a control is desired to not have size negotiation enabled then simply pass in the
-NO_SIZE_NEGOTIATION flag into the Control constructor. This will then call SetRelayoutEnabled( false ) on the base class.
+DISABLE_SIZE_NEGOTIATION flag into the Control constructor.
 
 The other step to perform is to set default resize policies for width and height.
 
index 8259359..92beacd 100644 (file)
@@ -45,11 +45,7 @@ This section details how an actor may be used with size negotiation.
 
 <h3>Enabling Size Negotiation</h3>
 
-The first thing to do is to specify whether you want an actor to be included or excluded from the relayout process. The following method is used to enable or disable the relayout
-for an individual actor. Make sure this is the first thing that is called after the actor is created otherwise the actor may still be negotiated.
-@code void SetRelayoutEnabled( bool enabled ) @endcode
-Text and image actors have relayout enabled by default, while a plain Actor is disabled. Be aware that if desiring to use an Actor in relayout
-then relayout needs to be explicitly enabled first.
+Text and image actors have relayout enabled by default, while a plain Actor is disabled unless a call to SetResizePolicy is made.
 
 <h3>Specifying Size Policies</h3>
 
@@ -69,7 +65,6 @@ the height of the root actor will fit to the height of the child image.
 
 @code
 Actor rootActor = Actor::New();
-rootActor.SetRelayoutEnabled( true );
 rootActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 rootActor.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::HEIGHT );
 ImageActor image = ImageActor::New( Image::New( MY_IMAGE_PATH ) );
@@ -92,8 +87,7 @@ Dimension::WIDTH then there is a height-for-width dependency in effect. The clas
 is a text view that wraps its text. The following example snippet shows a text view that expands its width to the size of its parent, wraps its
 contents and then determines its height based on the width.
 @code
-TextView text = TextView::New( "Example" );
-text.SetMultilinePolicy( SplitByWord );
+TextLabel text = TextLabel::New( "Example" );
 text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
 @endcode
@@ -140,11 +134,7 @@ content.SetFitHeight( 1 );
 content.SetPadding( Padding( 20.0f, 20.0f, 20.0f, 0.0f ) );
 
 // Text
-Toolkit::TextView text = Toolkit::TextView::New();
-text.SetText( "Do you really want to quit?" );
-text.SetMultilinePolicy( Toolkit::TextView::SplitByWord );
-text.SetWidthExceedPolicy( Toolkit::TextView::Split );
-text.SetLineJustification( Toolkit::TextView::Left );
+Toolkit::TextLabel text = Toolkit::TextLabel::New( "Do you really want to quit?" );
 text.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 text.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
 
@@ -174,9 +164,7 @@ checkBox.SetSize( Vector2( 48, 48 ) );
 
 root.AddChild( checkBox, Toolkit::TableView::CellPosition( 0, 0 ) );
 
-Toolkit::TextView text2 = Toolkit::TextView::New();
-text2.SetText( "Don't show again" );
-text2.SetLineJustification( Toolkit::TextView::Left );
+Toolkit::TextLabel text2 = Toolkit::TextLabel::New( "Don't show again" );
 text2.SetPadding( Padding( 20.0f, 0.0f, 0.0f, 10.0f ) );
 
 root.AddChild( text2, Toolkit::TableView::CellPosition( 0, 1 ) );
index 35754de..24f8b1b 100644 (file)
@@ -11,39 +11,33 @@ To display a TextLabel the TEXT property must be set using a UTF-8 string.
 \code
 TextLabel label = TextLabel::New();
 label.SetProperty( TextLabel::Property::TEXT, "Hello World" );
+label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
 Stage::GetCurrent().Add( label );
 \endcode
 
 The label must also be added to the stage, or to an actor which is on the stage.\n
-In this example the text-label will be automatically given a natural size i.e. large enough to fit the text.\n
-The position of the label on-screen is dependent on the parent-origin and anchor-point properties:
+The position of the label on-screen is dependent on the parent-origin and anchor-point properties.\n
 
 <table border=0 cellpadding=10>
 <tr>
   <td>
   \image html TextLabelTopLeft.png
   </td>
-  <td>
-  \image html TextLabelCenter.png
-  </td>
 </tr>
 <tr>
   <td>
   (ParentOrigin::TOP_LEFT, AnchorPoint::TOP_LEFT)
   </td>
-  <td>
-  (ParentOrigin::CENTER, AnchorPoint::CENTER)
-  </td>
 </tr>
 </table>
 
-\subsection fontselection Font Selection
+\subsection fontSelection Font Selection
 
 By default TextLabel will automatically select a suitable font from the platform.\n
 Typically fonts do not support all scripts, for example Latin fonts often do not provide Arabic glyphs.\n
 Therefore you should expect TextLabel to select different fonts for each script.
 
-Alternatively a font may be requested using eiter or all of FONT_FAMILY, FONT_STYLE, and POINT_SIZE properties:
+Alternatively a font may be requested using either or all of FONT_FAMILY, FONT_STYLE, and POINT_SIZE properties:
 \code
 label.SetProperty( TextLabel::Property::FONT_FAMILY, "HelveticaNue" );
 label.SetProperty( TextLabel::Property::FONT_STYLE,  "Regular" );
@@ -51,16 +45,70 @@ label.SetProperty( TextLabel::Property::POINT_SIZE,  12.0f );
 \endcode
 However the TextLabel will fall-back to using the default font, if the requested font does not support the required scripts.
 
-\subsection fontselection Text Alignment
+\subsection fontStyles Font Styles
+
+Setting a font size programmatically is not ideal for applications which support multiple screen resolutions etc.\n
+A more flexible approach is to prepare various JSON stylesheets, and request a different style for each platform:\n
+
+\code
+StyleManager styleManager = StyleManager::Get();
+styleManager.RequestThemeChange( "example-path/example.json" );
+\endcode
+
+To change the font for standard text labels, this JSON syntax can be used:
+
+\code
+{
+  "styles":
+  {
+    "textlabel":
+    {
+      "font-family":"Arial",
+      "font-style":"Regular",
+      "point-size":8
+    }
+  }
+}
+\endcode
+
+However the same point-size is unlikely to be suitable for all labels in an application.\n
+To set custom sizes simply set a "style name" for each case, and then provide a style override in JSON:
+
+\code
+  label.SetProperty( Control::Property::STYLE_NAME, "custom" );
+\endcode
+
+\code
+{
+  "styles":
+  {
+    "textlabel":
+    {
+      "font-family":"Arial",
+      "font-style":"Regular",
+      "point-size":8
+    },
+
+    "custom":
+    {
+      "point-size":10
+    }
+  }
+}
+\endcode
+
+In the example above, standard text labels will have point-size 8, and "custom" labels will have point-size 10.\n
+
+\subsection textAlignment Text Alignment
 
 Wrapping can be enabled using the MULTI_LINE property:\n
 \code
 label.SetProperty( TextLabel::Property::MULTI_LINE, true );
 \endcode
 
-The text can be either aligned to the start, end, or center of the available area:
+The text can be either aligned horizontally to the beginning, end, or center of the available area:
 \code
-label.SetProperty( TextLabel::Property::ALIGNMENT, "BEGIN" ); // "CENTER" or "END"
+label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "BEGIN" ); // "CENTER" or "END"
 \endcode
 
 <table border=0 cellpadding=10>
@@ -105,4 +153,191 @@ label.SetProperty( TextLabel::Property::ALIGNMENT, "BEGIN" ); // "CENTER" or "EN
 </tr>
 </table>
 
+The examples above assume that the TextLabel size greater than the minimum required.\n
+The next section provides details about the other size related options.
+
+\subsection negotiatingSize Negotiating size
+
+\link size-negotiation Size negotiation \endlink is a layouting feature supported by UI controls such as TextLabel.\n
+There are several resize policies which are commonly used with TextLabels.\n
+The following examples show TextLabels actual size by setting a colored background, whilst the black area represents the size of the parent control:\n
+
+<h3>Using natural size</h3>
+
+With a "natural" size TextLabel will be large enough to display the text without wrapping, and will not have extra space to align the text within.\n
+Therefore in this example the same result would be displayed, regardless of the alignment or multi-line properties.\n
+
+\code
+TextLabel label = TextLabel::New( "Hello World" );
+label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
+label.SetBackgroundColor( Color::BLUE );
+Stage::GetCurrent().Add( label );
+\endcode
+
+<table border=0 cellpadding=10>
+<tr>
+  <td>
+  \image html HelloWorld-NaturalSize.png
+  </td>
+</tr>
+</table>
+
+<h3>Height-for-width negotiation</h3>
+
+To layout text labels vertically, a fixed (maximum) width should be provided by the parent control.\n
+Each TextLabel will then report a desired height for the given width.\n
+Here is an example of this behavior using TableView as the parent:
+
+\code
+TableView parent = TableView::New( 3, 1 );
+parent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+parent.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
+parent.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+Stage::GetCurrent().Add( parent );
+
+TextLabel label = TextLabel::New( "Hello World" );
+label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+label.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
+label.SetBackgroundColor( Color::BLUE );
+parent.AddChild( label, TableView::CellPosition( 0, 0 ) );
+parent.SetFitHeight( 0 );
+
+label = TextLabel::New( "A Quick Brown Fox Jumps Over The Lazy Dog" );
+label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+label.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
+label.SetBackgroundColor( Color::GREEN );
+label.SetProperty( TextLabel::Property::MULTI_LINE, true );
+parent.AddChild( label, TableView::CellPosition( 1, 0 ) );
+parent.SetFitHeight( 1 );
+
+label = TextLabel::New( "لإعادة ØªØ±ØªÙŠØ¨ Ø§Ù„شاشات، ÙŠØ¬Ø¨ ØªØºÙŠÙŠØ± Ù†ÙˆØ¹ Ø§Ù„عرض Ø¥Ù„Ù‰ Ø´Ø¨ÙƒØ© Ù‚ابلة Ù„لتخصيص." );
+label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+label.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
+label.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
+label.SetBackgroundColor( Color::BLUE );
+label.SetProperty( TextLabel::Property::MULTI_LINE, true );
+parent.AddChild( label, TableView::CellPosition( 2, 0 ) );
+parent.SetFitHeight( 2 );
+\endcode
+
+<table border=0 cellpadding=10>
+<tr>
+  <td>
+  \image html HelloWorld-HeightForWidth.png
+  </td>
+</tr>
+</table>
+
+Note that the "Hello World" text label (above) has been given the full width, not the natural width.
+
+\subsection textLabelDecorations TextLabel Decorations
+
+<h3>Color</h3>
+
+To change the color of the text, the recommended way is to use the TEXT_COLOR property.\n
+Note that unlike the Actor::COLOR property, this will not affect child Actors added to the TextLabel.\n
+
+\code
+label.SetProperty( TextLabel::Property::TEXT, "Red Text" );
+label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
+\endcode
+
+<table border=0 cellpadding=10>
+<tr>
+  <td>
+  \image html RedText.png
+  </td>
+</tr>
+</table>
+
+<h3>Drop Shadow</h3>
+
+To add a drop-shadow to the text, simply set the SHADOW_OFFSET property with non-zero values.\n
+The color can also be selected using the SHADOW_COLOR property.\n
+
+\code
+stage.SetBackgroundColor( Color::BLUE );
+
+label1.SetProperty( TextLabel::Property::TEXT, "Plain Text" );
+
+label2.SetProperty( TextLabel::Property::TEXT, "Text with Shadow" );
+label2.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 1.0f, 1.0f ) );
+label4.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK );
+
+label3.SetProperty( TextLabel::Property::TEXT, "Text with Bigger Shadow" );
+label3.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) );
+label4.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK );
+
+label4.SetProperty( TextLabel::Property::TEXT, "Text with Color Shadow" );
+label4.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 1.0f, 1.0f ) );
+label4.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::RED );
+\endcode
+
+<table border=0 cellpadding=10>
+<tr>
+  <td>
+  \image html PlainText.png
+  </td>
+</tr>
+<tr>
+  <td>
+  \image html TextWithShadow.png
+  </td>
+</tr>
+<tr>
+  <td>
+  \image html TextWithBiggerShadow.png
+  </td>
+</tr>
+<tr>
+  <td>
+  \image html TextWithColorShadow.png
+  </td>
+</tr>
+</table>
+
+<h3>Underline</h3>
+
+The text can be underlined by setting UNDERLINE_ENABLED.\n
+The color can also be selected using the UNDERLINE_COLOR property.\n
+
+\code
+label1.SetProperty( TextLabel::Property::TEXT, "Text with Underline" );
+label1.SetProperty( TextLabel::Property::UNDERLINE_ENABLED, true );
+
+label2.SetProperty( TextLabel::Property::TEXT, "Text with Color Underline" );
+label2.SetProperty( TextLabel::Property::UNDERLINE_ENABLED, true );
+label2.SetProperty( TextLabel::Property::UNDERLINE_COLOR, Color::GREEN );
+\endcode
+
+<table border=0 cellpadding=10>
+<tr>
+  <td>
+  \image html TextWithUnderline.png
+  </td>
+</tr>
+<tr>
+  <td>
+  \image html TextWithColorUnderline.png
+  </td>
+</tr>
+</table>
+
+By default the underline height will be taken from the font metrics, however this can be overridden using the UNDERLINE_HEIGHT property:
+
+\code
+label1.SetProperty( TextLabel::Property::UNDERLINE_HEIGHT, 1.0f );
+\endcode
+
+<table border=0 cellpadding=10>
+<tr>
+  <td>
+  \image html TextWith1pxUnderline.png
+  </td>
+</tr>
+</table>
+
 */
index 07f1c1e..d53e83b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.0.38
+Version:    1.0.39
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index 91b3661..9dc4293 100644 (file)
@@ -27,10 +27,8 @@ script_v8_plugin_src_files = \
    $(v8_plugin_dir)/events/pan-gesture-detector-api.cpp \
    $(v8_plugin_dir)/events/pan-gesture-detector-wrapper.cpp \
    $(v8_plugin_dir)/stage/stage-api.cpp \
-   $(v8_plugin_dir)/image/image-attributes-api.cpp \
    $(v8_plugin_dir)/shader-effects/shader-effect-api.cpp \
    $(v8_plugin_dir)/shader-effects/shader-effect-wrapper.cpp \
-   $(v8_plugin_dir)/image/image-attributes-wrapper.cpp \
    $(v8_plugin_dir)/image/image-wrapper.cpp \
    $(v8_plugin_dir)/image/image-api.cpp \
    $(v8_plugin_dir)/image/buffer-image-api.cpp \
index 112dfeb..4df5d5c 100644 (file)
@@ -294,7 +294,6 @@ const ActorFunctions ActorFunctionTable[]=
 
     { "SetImage",           ImageActorApi::SetImage,              IMAGE_ACTOR_API },
     { "GetImage",           ImageActorApi::GetImage,              IMAGE_ACTOR_API },
-    { "SetToNaturalSize",   ImageActorApi::SetToNaturalSize,      IMAGE_ACTOR_API },
     // ignore SetPixelArea, use imageActor.pixelArea
     // ignore GetPixelArea, use imageActor.pixelArea
     { "IsPixelAreaSet",     ImageActorApi::IsPixelAreaSet,        IMAGE_ACTOR_API },
index fa93c7f..9a30b21 100644 (file)
@@ -151,28 +151,6 @@ void ImageActorApi::GetImage( const v8::FunctionCallbackInfo<v8::Value>& args )
 }
 
 /**
- * Tell the image actor to use the natural size of the current image
- * or future images.
- *
- * Calling SetSize on this actor or animating the size of the actor
- * overrides this behaviour.
- *
- * The image actor uses the natural image size after an image
- * has been loaded.
- * @for ImageActor
- * @method setToNaturalSize
- */
-void ImageActorApi::SetToNaturalSize( const v8::FunctionCallbackInfo<v8::Value>& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageActor imageActor = GetImageActor( isolate, args );
-
-  imageActor.SetToNaturalSize();
-
-}
-
-/**
  * Query whether a pixel area has been set.
  * @for ImageActor
  * @method isPixelAreaSet
index 3c75cf6..d6b9f3a 100644 (file)
@@ -42,7 +42,6 @@ namespace ImageActorApi
    */
   void SetImage( const v8::FunctionCallbackInfo< v8::Value >& args );
   void GetImage( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void SetToNaturalSize( const v8::FunctionCallbackInfo< v8::Value >& args );
   void IsPixelAreaSet( const v8::FunctionCallbackInfo< v8::Value >& args );
   void ClearPixelArea( const v8::FunctionCallbackInfo< v8::Value >& args );
 }; // namespace ImageActorApi
index 9815aa7..4217d98 100644 (file)
@@ -168,8 +168,18 @@ const IntegerPair EnumTable[] =
     { "RESOURCE_LOADING_SUCCEEDED",                         Dali::ResourceLoadingSucceeded  },
     { "RESOUCE_LOADING_FAILED",                             Dali::ResourceLoadingFailed  },
 
-
-
+    { "FITTING_MODE_SHRINK_TO_FIT",     FittingMode::SHRINK_TO_FIT },
+    { "FITTING_MODE_SCALE_TO_FILL",     FittingMode::SCALE_TO_FILL },
+    { "FITTING_MODE_FIT_WIDTH",         FittingMode::FIT_WIDTH },
+    { "FITTING_MODE_FIT_HEIGHT",        FittingMode::FIT_HEIGHT },
+
+    { "SAMPLING_MODE_BOX",              SamplingMode::BOX },
+    { "SAMPLING_MODE_NEAREST",          SamplingMode::NEAREST },
+    { "SAMPLING_MODE_LINEAR",           SamplingMode::LINEAR },
+    { "SAMPLING_MODE_BOX_THEN_NEAREST", SamplingMode::BOX_THEN_NEAREST },
+    { "SAMPLING_MODE_BOX_THEN_LINEAR",  SamplingMode::BOX_THEN_LINEAR },
+    { "SAMPLING_MODE_NO_FILTER",        SamplingMode::NO_FILTER },
+    { "SAMPLING_MODE_DONT_CARE",        SamplingMode::DONT_CARE },
 
     { "BLEND_FACTOR_ZERO",                                  BlendingFactor::ZERO                    },
     { "BLEND_FACTOR_ONE",                                   BlendingFactor::ONE                     },
index f674551..38231b8 100644 (file)
@@ -24,7 +24,6 @@
 #include <dali/integration-api/debug.h>
 #include <actors/actor-wrapper.h>
 #include <stage/stage-wrapper.h>
-#include <image/image-attributes-wrapper.h>
 #include <image/image-wrapper.h>
 #include <animation/path-wrapper.h>
 #include <animation/path-constraint-wrapper.h>
@@ -72,7 +71,6 @@ const ApiFunction ConstructorFunctionTable[]=
     { "BufferImage",        ImageWrapper::NewImage },
     { "NinePatchImage",     ImageWrapper::NewImage },
     { "FrameBufferImage",   ImageWrapper::NewImage },
-    { "ImageAttributes",    ImageAttributesWrapper::NewImageAttributes },
     { "Animation",          AnimationWrapper::NewAnimation},
     { "ShaderEffect",       ShaderEffectWrapper::NewShaderEffect},
     { "Builder",            BuilderWrapper::NewBuilder},
diff --git a/plugins/dali-script-v8/src/image/image-attributes-api.cpp b/plugins/dali-script-v8/src/image/image-attributes-api.cpp
deleted file mode 100644 (file)
index 5e7006e..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * 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 "image-attributes-api.h"
-
-// INTERNAL INCLUDES
-#include <v8-utils.h>
-#include <image/image-attributes-wrapper.h>
-#include <object/property-value-wrapper.h>
-#include <shared/base-wrapped-object.h>
-
-namespace Dali
-{
-
-namespace V8Plugin
-{
-
-ImageAttributes ImageAttributesApi::GetImageAttributesFromObject( v8::Isolate* isolate, v8::Local<v8::Object> object )
-{
-  v8::HandleScope handleScope( isolate);
-
-  if( BaseWrappedObject::IsWrappedType ( isolate, object, BaseWrappedObject::IMAGE_ATTRIBUTES ))
-  {
-    v8::Local<v8::External> field = v8::Local<v8::External>::Cast( object->GetInternalField(0) );
-    void* ptr = field->Value();
-    BaseWrappedObject* wrappedObject = static_cast< BaseWrappedObject *>(ptr);
-    ImageAttributesWrapper* wrapper = static_cast< ImageAttributesWrapper*>( wrappedObject );;
-    return  wrapper->GetImageAttributes();
-  }
-  else
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "bad image attributes url");
-    return ImageAttributes();
-  }
-
-}
-
-/***************************************
- * IMAGE ATTRIBUTES FUNCTIONS
- *
- ****************************************/
-ImageAttributes ImageAttributesApi::New( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  // two combinations of constructor
-  // 1 = no parameters
-  // 2 = width, height
-  bool foundParams( false );
-  int params[2];
-
-  V8Utils::ReadIntegerArguments( foundParams, &params[0],2,args,0);
-  if( !foundParams )
-  {
-    if( args.Length() != 0 )
-    {
-      DALI_SCRIPT_EXCEPTION( isolate, " ImageAttributes::New invalid params");
-      return Dali::ImageAttributes();
-    }
-    return Dali::ImageAttributes::New();
-  }
-  else
-  {
-    return  Dali::ImageAttributes::New( params[0], params[1] );
-  }
-
-}
-
-ImageAttributes& ImageAttributesApi::GetImageAttributes( v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Local<v8::Object> object = args.This();
-  v8::Local<v8::External> field = v8::Local<v8::External>::Cast( object->GetInternalField(0) );
-  void* ptr = field->Value();
-
-  ImageAttributesWrapper* wrapper = static_cast< ImageAttributesWrapper *>(ptr);
-  return wrapper->GetImageAttributes();
-}
-
-void ImageAttributesApi::SetSize( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageAttributes& attribs( GetImageAttributes( isolate, args ));
-
-  bool found;
-  Vector2 size = V8Utils::GetVector2Parameter( PARAMETER_0, found, isolate, args );
-  if (!found)
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "invalid size parameter" );
-    return;
-  }
-  else
-  {
-    attribs.SetSize( size );
-  }
-}
-
-void ImageAttributesApi::SetScalingMode( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageAttributes& attribs( GetImageAttributes( isolate, args ));
-
-  bool found(false);
-  int value = V8Utils::GetIntegerParameter( PARAMETER_0, found, isolate, args, 0);
-  if( !found  )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "invalid scaling mode parameter");
-    return;
-  }
-  if( value!= ImageAttributes::ShrinkToFit ||
-      value!= ImageAttributes::ScaleToFill ||
-      value!= ImageAttributes::FitWidth ||
-      value!= ImageAttributes::FitHeight )
-  {
-     DALI_SCRIPT_EXCEPTION( isolate, "invalid scaling mode parameter");
-     return;
-  }
-
-  attribs.SetScalingMode(static_cast<ImageAttributes::ScalingMode >( value) );
-}
-
-void ImageAttributesApi::SetOrientationCorrection( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageAttributes& attribs( GetImageAttributes( isolate, args ));
-
-  bool parameterFound(false);
-  bool value = V8Utils::GetBooleanParameter( PARAMETER_0 , parameterFound, isolate, args );
-
-  if( !parameterFound )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "boolean parameter not found");
-    return;
-  }
-  attribs.SetOrientationCorrection( value );
-}
-
-void ImageAttributesApi::GetWidth( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageAttributes& attribs( GetImageAttributes( isolate, args ));
-
-  args.GetReturnValue().Set( v8::Integer::New( isolate, attribs.GetWidth() ) );
-}
-
-void ImageAttributesApi::GetHeight( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageAttributes& attribs( GetImageAttributes( isolate, args ));
-
-  args.GetReturnValue().Set( v8::Integer::New( isolate, attribs.GetHeight() ) );
-
-}
-
-void ImageAttributesApi::GetSize( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageAttributes& attribs( GetImageAttributes( isolate, args ));
-
-  Vector2 vec( attribs.GetSize() );
-  Dali::Property::Value value( vec );
-
-  v8::Local <v8::Object> object = PropertyValueWrapper::WrapDaliProperty( isolate, value);
-  args.GetReturnValue().Set(  object );
-}
-
-void ImageAttributesApi::GetScalingMode( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageAttributes& attribs( GetImageAttributes( isolate, args ));
-
-  args.GetReturnValue().Set( v8::Integer::New( isolate, attribs.GetScalingMode() ) );
-
-}
-
-void ImageAttributesApi::GetOrientationCorrection( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageAttributes& attribs( GetImageAttributes( isolate, args ));
-
-  args.GetReturnValue().Set(  v8::Boolean::New(  isolate, attribs.GetOrientationCorrection() ) );
-
-}
-
-
-} // namespace V8Plugin
-
-} // namespace Dali
diff --git a/plugins/dali-script-v8/src/image/image-attributes-api.h b/plugins/dali-script-v8/src/image/image-attributes-api.h
deleted file mode 100644 (file)
index c474ef0..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef __DALI_V8PLUGIN_IMAGE_ATTRIBUTES_API_H__
-#define __DALI_V8PLUGIN_IMAGE_ATTRIBUTES_API_H__
-
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <v8.h>
-#include <dali/public-api/images/image-attributes.h>
-
-
-namespace Dali
-{
-
-namespace V8Plugin
-{
-
-namespace ImageAttributesApi
-{
-  ImageAttributes& GetImageAttributes( v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args );
-
-  ImageAttributes GetImageAttributesFromObject( v8::Isolate* isolate, v8::Local<v8::Object> object );
-
-  /**
-   * @brief Creates a new Image Attribute object based on some JavaScript parameters.
-   * @param[in] args constructor parameters
-   * @return ImageAttributes
-   */
-  ImageAttributes New( const v8::FunctionCallbackInfo< v8::Value >& args );
-
-  /**
-   * ImageAttributes API see image-attributes.h for a description
-   */
-  void SetSize( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void SetScalingMode( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void SetOrientationCorrection( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void GetWidth( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void GetHeight( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void GetSize( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void GetScalingMode( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void GetOrientationCorrection( const v8::FunctionCallbackInfo< v8::Value >& args );
-
-}; // namespace ImageAttributesApi
-
-} // namespace V8Plugin
-
-} // namespace Dali
-
-#endif // header __DALI_V8PLUGIN_IMAGE_ATTRIBUTES_API_H__
diff --git a/plugins/dali-script-v8/src/image/image-attributes-wrapper.cpp b/plugins/dali-script-v8/src/image/image-attributes-wrapper.cpp
deleted file mode 100644 (file)
index fa89f79..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * 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 "image-attributes-wrapper.h"
-
-// INTERNAL INCLUDES
-#include <v8-utils.h>
-#include <image/image-attributes-api.h>
-#include <dali-wrapper.h>
-#include <shared/api-function.h>
-#include <shared/object-template-helper.h>
-
-namespace Dali
-{
-
-namespace V8Plugin
-{
-
-v8::Persistent<v8::ObjectTemplate> ImageAttributesWrapper::mImageAttributesTemplate;
-
-namespace
-{
-
-/**
- * Contains a list of all functions that can be called
- */
-const ApiFunction ImageAttributeFunctionTable[]=
-{
-    /**************************************
-    * ImageAttributes API (in order of image-attributes.h)
-    **************************************/
-    { "SetSize",                    ImageAttributesApi::SetSize },
-    { "SetScalingMode",             ImageAttributesApi::SetScalingMode },
-    { "SetOrientationCorrection",   ImageAttributesApi::SetOrientationCorrection },
-    { "GetWidth",                   ImageAttributesApi::GetWidth },
-    { "GetHeight",                  ImageAttributesApi::GetHeight },
-    { "GetSize",                    ImageAttributesApi::GetSize },
-    { "GetScalingMode",             ImageAttributesApi::GetScalingMode },
-    { "GetOrientationCorrection",   ImageAttributesApi::GetOrientationCorrection },
-};
-
-const unsigned int ImageAttributeFunctionTableCount = sizeof(ImageAttributeFunctionTable)/sizeof(ImageAttributeFunctionTable[0]);
-} //un-named space
-
-
-ImageAttributesWrapper::ImageAttributesWrapper( const Dali::ImageAttributes& imageAttributes, GarbageCollectorInterface& gc )
-: BaseWrappedObject( BaseWrappedObject::IMAGE_ATTRIBUTES , gc )
-{
-    mImageAttributes = imageAttributes;
-}
-
-v8::Handle<v8::Object> ImageAttributesWrapper::WrapImageAttributes(v8::Isolate* isolate, const Dali::ImageAttributes& attributes )
-{
-  v8::EscapableHandleScope handleScope( isolate );
-  v8::Local<v8::ObjectTemplate> objectTemplate;
-
-  objectTemplate = GetImageAttributesTemplate( isolate);
-
-  // create an instance of the template
-  v8::Local<v8::Object> localObject = objectTemplate->NewInstance();
-
-  // create the ImageAttributes wrapper
-  ImageAttributesWrapper* pointer =  new ImageAttributesWrapper( attributes, Dali::V8Plugin::DaliWrapper::Get().GetDaliGarbageCollector() );
-
-  // assign the JavaScript object to the wrapper.
-  pointer->SetJavascriptObject( isolate, localObject );
-
-  return handleScope.Escape( localObject );
-}
-
-v8::Local<v8::ObjectTemplate> ImageAttributesWrapper::GetImageAttributesTemplate( v8::Isolate* isolate)
-{
-  v8::EscapableHandleScope handleScope( isolate );
-  v8::Local<v8::ObjectTemplate> objectTemplate;
-
-
-  if( mImageAttributesTemplate.IsEmpty() )
-  {
-    objectTemplate = MakeImageAttributesTemplate( isolate );
-    mImageAttributesTemplate.Reset( isolate, objectTemplate );
-  }
-  else
-  {
-    // get the object template
-    objectTemplate = v8::Local<v8::ObjectTemplate>::New( isolate, mImageAttributesTemplate );
-  }
-  return handleScope.Escape( objectTemplate );
-}
-
-v8::Handle<v8::ObjectTemplate> ImageAttributesWrapper::MakeImageAttributesTemplate( v8::Isolate* isolate )
-{
-  v8::EscapableHandleScope handleScope( isolate );
-
-  v8::Local<v8::ObjectTemplate> objTemplate = v8::ObjectTemplate::New();
-
-  objTemplate->SetInternalFieldCount( BaseWrappedObject::FIELD_COUNT );
-
-  // add our function properties
-  ObjectTemplateHelper::InstallFunctions( isolate, objTemplate, ImageAttributeFunctionTable, ImageAttributeFunctionTableCount );
-
-  return handleScope.Escape( objTemplate );
-}
-
-void ImageAttributesWrapper::NewImageAttributes( const v8::FunctionCallbackInfo< v8::Value >& args)
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate);
-
-  if(!args.IsConstructCall())
-  {
-      DALI_SCRIPT_EXCEPTION(isolate, "ImageAttributes constructor called without 'new'");
-      return;
-  }
-
-  // attribs can be passed by value
-  Dali::ImageAttributes attribs = ImageAttributesApi::New( args );
-  v8::Local<v8::Object> localObject = WrapImageAttributes( isolate, attribs );
-  args.GetReturnValue().Set( localObject );
-}
-
-
-ImageAttributes& ImageAttributesWrapper::GetImageAttributes()
-{
-  return mImageAttributes;
-}
-
-
-} // namespace V8Plugin
-
-} // namespace Dali
diff --git a/plugins/dali-script-v8/src/image/image-attributes-wrapper.h b/plugins/dali-script-v8/src/image/image-attributes-wrapper.h
deleted file mode 100644 (file)
index 91511ea..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef __DALI_V8PLUGIN_IMAGE_ATTRIBUTES_WRAPPER_H__
-#define __DALI_V8PLUGIN_IMAGE_ATTRIBUTES_WRAPPER_H__
-
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <v8.h>
-#include <dali/public-api/images/image-attributes.h>
-
-// INTERNAL INCLUDES
-#include <shared/base-wrapped-object.h>
-
-namespace Dali
-{
-
-namespace V8Plugin
-{
-
-
-/**
- * An Image Attributes wrapper.
- * Provides access to ImageAttributes specific functionality and V8 memory handling.
- */
-class ImageAttributesWrapper : public BaseWrappedObject
-{
-
-public:
-
-  /**
-   * Constructor
-   */
-  ImageAttributesWrapper( const ImageAttributes& imageAttributes,
-                GarbageCollectorInterface& gc );
-
-  /**
-    * Destructor
-    */
-  virtual ~ImageAttributesWrapper(){};
-
-  /**
-   * Constructors
-   */
-  static void NewImageAttributes( const v8::FunctionCallbackInfo< v8::Value >& args);
-
-  /**
-   * Wraps an image attributes
-   */
-  static v8::Handle<v8::Object> WrapImageAttributes(v8::Isolate* isolate, const Dali::ImageAttributes& attributes);
-
-
-  // The ImageAttribute ObjectTemplate, we cache templates so we don't have
-  // keep generating them everytime we want to create an ImageAttribute
-  static v8::Persistent<v8::ObjectTemplate> mImageAttributesTemplate;
-
-  ImageAttributes& GetImageAttributes();
-private:
-
-  // ImageAttributes
-  ImageAttributes mImageAttributes;
-
-  static v8::Handle<v8::ObjectTemplate> MakeImageAttributesTemplate( v8::Isolate* isolate );
-  static v8::Local<v8::ObjectTemplate> GetImageAttributesTemplate( v8::Isolate* isolate );
-
-};
-
-} // namespace V8Plugin
-
-} // namespace Dali
-
-#endif // header
index fe4ff2a..8e7df33 100644 (file)
 // CLASS HEADER
 #include "resource-image-api.h"
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/images/image-operations.h>
+
 // INTERNAL INCLUDES
 #include <v8-utils.h>
 #include <image/image-wrapper.h>
-#include <image/image-attributes-wrapper.h>
-#include <image/image-attributes-api.h>
-
 
 namespace Dali
 {
@@ -51,7 +51,6 @@ ResourceImage ResourceImageApi::GetResourceImage( v8::Isolate* isolate, const v8
  * @for ResourceImage
  * @param {Object} options
  * @param {String} options.url The URL of the image file to use.
- * @param {Object} [option.imageAttributes] image attributes object
  * @param {Integer} [options.loadPolicy] The LoadPolicy to apply when loading the image resource.
  * @param {Integer} [options.releasePolicy] optionally release memory when image is not visible on screen.
  * @return {Object} Image
@@ -62,10 +61,12 @@ Image ResourceImageApi::New( const v8::FunctionCallbackInfo< v8::Value >& args )
   v8::HandleScope handleScope( isolate );
 
   std::string url;
+  ImageDimensions dimensions;
+  FittingMode::Type fittingMode = FittingMode::DEFAULT;
+  SamplingMode::Type samplingMode = SamplingMode::DEFAULT;
+  bool orientationCorrection = true;
   ResourceImage::LoadPolicy loadPolicy( ResourceImage::IMMEDIATE );
   Image::ReleasePolicy releasePolicy( Image::NEVER);
-  ImageAttributes imageAttributes;
-  bool useImageAttributes = false;
 
   v8::Local<v8::Value> options( args[0] );
 
@@ -88,13 +89,37 @@ Image ResourceImageApi::New( const v8::FunctionCallbackInfo< v8::Value >& args )
     return Image();
   }
 
-  v8::Local<v8::Value> imageAttribsValue= optionsObject->Get( v8::String::NewFromUtf8( isolate, "imageAttributes" ) );
-  if( imageAttribsValue->IsObject() )
+  v8::Local<v8::Value> widthValue = optionsObject->Get( v8::String::NewFromUtf8( isolate, "width" ) );
+  if( widthValue->IsUint32() )
   {
-    imageAttributes = ImageAttributesApi::GetImageAttributesFromObject( isolate, imageAttribsValue->ToObject() );
+    const uint32_t width = widthValue->ToUint32()->Value();
+    dimensions = ImageDimensions( width, dimensions.GetHeight() );
   }
 
+  v8::Local<v8::Value> heightValue = optionsObject->Get( v8::String::NewFromUtf8( isolate, "height" ) );
+  if( heightValue->IsUint32() )
+  {
+    const uint32_t height = heightValue->ToUint32()->Value();
+    dimensions = ImageDimensions( dimensions.GetWidth(), height );
+  }
 
+  v8::Local<v8::Value> fittingModeValue = optionsObject->Get( v8::String::NewFromUtf8( isolate, "fittingMode" ) );
+  if( fittingModeValue->IsUint32() )
+  {
+    fittingMode = static_cast<FittingMode::Type>( fittingModeValue->ToUint32()->Value() );
+  }
+
+  v8::Local<v8::Value> samplingModeValue = optionsObject->Get( v8::String::NewFromUtf8( isolate, "samplingMode" ) );
+  if( samplingModeValue->IsUint32() )
+  {
+    samplingMode = static_cast<SamplingMode::Type>( samplingModeValue->ToUint32()->Value() );
+  }
+
+  v8::Local<v8::Value> orientationCorrectionValue = optionsObject->Get( v8::String::NewFromUtf8( isolate, "orientationCorrection" ) );
+  if( orientationCorrectionValue->IsBoolean() )
+  {
+    orientationCorrection = orientationCorrectionValue->ToBoolean()->Value();
+  }
 
   v8::Local<v8::Value> releasePolicyValue = optionsObject->Get( v8::String::NewFromUtf8( isolate, "releasePolicy" ) );
   if( releasePolicyValue->IsUint32() )
@@ -108,14 +133,7 @@ Image ResourceImageApi::New( const v8::FunctionCallbackInfo< v8::Value >& args )
     loadPolicy = static_cast< ResourceImage::LoadPolicy >( loadPolicyValue->ToUint32()->Value());
   }
 
-  if( useImageAttributes )
-  {
-    return ResourceImage::New( url, imageAttributes, loadPolicy, releasePolicy);
-  }
-  else
-  {
-    return ResourceImage::New( url, loadPolicy, releasePolicy);
-  }
+  return ResourceImage::New( url, loadPolicy, releasePolicy, dimensions, fittingMode, samplingMode, orientationCorrection );
 }
 
 /**
@@ -176,7 +194,6 @@ void ResourceImageApi::GetUrl( const v8::FunctionCallbackInfo< v8::Value >& args
 
 /**
  * Reload the image
- * The set ImageAttributes are used when requesting the image again.
  * @note if Image is offstage and OnDemand policy is set, reload request is ignored.
  * @method reload
  * @for ResourceImage
@@ -190,28 +207,6 @@ void ResourceImageApi::Reload( const v8::FunctionCallbackInfo< v8::Value >& args
   image.Reload();
 }
 
-
-/**
- * Return attributes for the image
- * Only to be used after the image has finished loading.
- * (Ticket's LoadingSucceeded callback was called)
- * The returned value will reflect the true image dimensions once the asynchronous loading has finished.
- *
- * @method getAttributes
- * @for ResourceImage
- * @return {Object} ImageAttributes
- */
-void ResourceImageApi::GetAttributes( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  ResourceImage image = GetResourceImage( isolate, args );
-
-  v8::Local<v8::Object> localObject = ImageAttributesWrapper::WrapImageAttributes(isolate, image.GetAttributes());
-
-  args.GetReturnValue().Set( localObject );
-}
 } // namespace V8Plugin
 
 } // namespace Dali
index 46d7d13..a9af141 100644 (file)
@@ -49,7 +49,6 @@ namespace ResourceImageApi
   void GetLoadingState( const v8::FunctionCallbackInfo< v8::Value >& args );
   void GetUrl( const v8::FunctionCallbackInfo< v8::Value >& args );
   void Reload( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void GetAttributes( const v8::FunctionCallbackInfo< v8::Value >& args );
 
 }; // namespace ResourceImageApi
 
index 5dccbee..29bfb01 100644 (file)
@@ -224,14 +224,14 @@ v8::Handle< v8::Value > GetV8ValueFrom( v8::Isolate* isolate,
        else if(field == "axis")
       {
         Dali::Vector3 axis;
-        float angle;
+        Radian angle;
         value.Get<Dali::Quaternion>().ToAxisAngle(axis, angle);
         ret = PropertyValueWrapper::WrapDaliProperty( isolate , Dali::Property::Value( axis ) );
       }
       else if(field == "angle")
       {
         Dali::Vector3 axis;
-        float angle;
+        Radian angle;
         value.Get<Dali::Quaternion>().ToAxisAngle(axis, angle);
         ret = PropertyValueWrapper::WrapDaliProperty( isolate , Dali::Property::Value( angle ) );
       }
@@ -384,24 +384,24 @@ void SetFromV8Value(v8::Isolate* isolate,
       {
         Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
         v4.z = asFloat;
-        value = Dali::Quaternion(v4.x, v4.y, v4.z);
+        value = Dali::Quaternion( Radian(Degree(v4.x)), Radian(Degree(v4.y)), Radian(Degree(v4.z)) );
       }
       else if(field == "pitch")
       {
         Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
         v4.x = asFloat;
-        value = Dali::Quaternion(v4.x, v4.y, v4.z);
+        value = Dali::Quaternion( Radian(Degree(v4.x)), Radian(Degree(v4.y)), Radian(Degree(v4.z)) );
       }
       else if(field == "yaw")
       {
         Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
         v4.y = asFloat;
-        value = Dali::Quaternion(v4.x, v4.y, v4.z);
+        value = Dali::Quaternion( Radian(Degree(v4.x)), Radian(Degree(v4.y)), Radian(Degree(v4.z)) );
       }
       else if(field == "axis")
       {
         Dali::Vector3 axis;
-        float angle;
+        Radian angle;
         value.Get<Dali::Quaternion>().ToAxisAngle(axis, angle);
 
         if( v8Value->IsObject() )
@@ -426,9 +426,9 @@ void SetFromV8Value(v8::Isolate* isolate,
       else if(field == "angle")
       {
         Dali::Vector3 axis;
-        float angle;
-        value.Get<Dali::Quaternion>().ToAxisAngle(axis, angle);
-        value = Dali::Quaternion(asFloat, axis);
+        Radian angle;
+        value.Get<Dali::Quaternion>().ToAxisAngle( axis, angle );
+        value = Dali::Quaternion( Degree( asFloat ), axis );
       }
       else
       {
@@ -734,9 +734,9 @@ Dali::Property::Value PropertyValueWrapper::ExtractPropertyValue( v8::Isolate* i
       }
       else if(array.GetType() == Dali::Property::VECTOR3)
       {
-        // v3 treated as euler
+        // v3 treated as euler in degrees
         Dali::Vector3 v = array.Get<Dali::Vector3>();
-        daliPropertyValue = Dali::Quaternion(v[0], v[1], v[2]);
+        daliPropertyValue = Dali::Quaternion( Radian(Degree(v[0])), Radian(Degree(v[1])), Radian(Degree(v[2])) );
       }
       break;
     }
@@ -785,24 +785,23 @@ void PropertyValueWrapper::NewRotation( const v8::FunctionCallbackInfo< v8::Valu
   bool foundAllArguments(false);
   V8Utils::ReadFloatArguments( foundAllArguments, v, 4, args, 0.f );
 
-  int len = args.Length();
+  int length = args.Length();
 
   // if length = 4 create AngleAxis, else create Quaternion
 
-  if(len > 3)
+  if( length > 3 )
   {
-    Dali::AngleAxis axis(  Dali::Degree(v[0] ), Dali::Vector3(v[1], v[2], v[3]) );
-    object = WrapDaliProperty( isolate ,   Dali::Property::Value( axis ) );
+    const Dali::AngleAxis axis(  Degree( v[0] ), Vector3(v[1], v[2], v[3]) );
+    object = WrapDaliProperty( isolate, Dali::Property::Value( axis ) );
   }
-  else if(len > 2)
+  else if( length > 2 )
   {
-    Dali::Quaternion quaternion( v[0], v[1], v[2] );
-    object = WrapDaliProperty( isolate ,  Dali::Property::Value( quaternion ) );
+    object = WrapDaliProperty( isolate, Dali::Quaternion( Degree(v[0]), Degree(v[1]), Degree(v[2]) ) );
   }
   else
   {
-    Dali::Quaternion quaternion( Dali::Quaternion(0.f, Dali::Vector4::YAXIS));
-    object = WrapDaliProperty( isolate , Dali::Property::Value( quaternion ) );
+    const Dali::Quaternion quaternion( Dali::Quaternion( Dali::ANGLE_0, Dali::Vector3::YAXIS));
+    object = WrapDaliProperty( isolate, quaternion );
   }
 
   args.GetReturnValue().Set( object );