Merge remote-tracking branch 'origin/tizen' into devel/new_mesh 83/38783/1
authorFrancisco Santos <f1.santos@samsung.com>
Mon, 27 Apr 2015 16:11:28 +0000 (17:11 +0100)
committerFrancisco Santos <f1.santos@samsung.com>
Mon, 27 Apr 2015 16:11:28 +0000 (17:11 +0100)
Conflicts:
automated-tests/src/dali-toolkit/utc-Dali-Cluster.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
automated-tests/src/dali-toolkit/utc-Dali-PushButton.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/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/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
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/scroll-view/scroll-base-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-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/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/view/view-impl.cpp
dali-toolkit/internal/controls/view/view-impl.h
dali-toolkit/internal/file.list
dali-toolkit/internal/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/text-atlas-renderer.cpp
dali-toolkit/internal/text/text-control-interface.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/transition-effects/cube-transition-cross-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-fold-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-wave-effect-impl.cpp
dali-toolkit/public-api/controls/buttons/push-button.cpp
dali-toolkit/public-api/controls/cluster/cluster-style.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.cpp
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/text-controls/text-field.cpp
dali-toolkit/public-api/controls/text-controls/text-field.h
dali-toolkit/public-api/controls/view/view.h
dali-toolkit/public-api/dali-toolkit-version.cpp
docs/content/programming-guide/animation-example.h
docs/content/programming-guide/animation-rotation.h
docs/content/programming-guide/dynamics-bodies.h
docs/content/programming-guide/size-negotiation.h
packaging/dali-toolkit.spec
plugins/dali-script-v8/src/object/property-value-wrapper.cpp

Change-Id: I5a0a9bc20a55ebcc9605c24d9ce1e688f0e6b9cc

302 files changed:
automated-tests/src/dali-toolkit/CMakeLists.txt
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 [deleted file]
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-PushButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollView.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 [deleted file]
dali-toolkit/dali-toolkit.h
dali-toolkit/images/insertpoint-icon-pressed.png [new file with mode: 0644]
dali-toolkit/internal/builder/builder-animations.cpp
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 [deleted file]
dali-toolkit/internal/controls/cluster/cluster-impl.h [deleted file]
dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp [deleted file]
dali-toolkit/internal/controls/cluster/cluster-style-impl.h [deleted file]
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-bar.h
dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp
dali-toolkit/internal/controls/navigation-frame/page-impl.cpp
dali-toolkit/internal/controls/navigation-frame/page-impl.h
dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.h
dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp
dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp
dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h
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-view-carousel-effect-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h
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-field-impl.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.h
dali-toolkit/internal/controls/view/view-impl.cpp [deleted file]
dali-toolkit/internal/controls/view/view-impl.h [deleted file]
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/text-atlas-renderer.cpp
dali-toolkit/internal/text/text-control-interface.h
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-cross-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-fold-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-wave-effect-impl.cpp
dali-toolkit/public-api/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 [deleted file]
dali-toolkit/public-api/controls/cluster/cluster-style.h [deleted file]
dali-toolkit/public-api/controls/cluster/cluster.cpp [deleted file]
dali-toolkit/public-api/controls/cluster/cluster.h [deleted file]
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/text-controls/text-field.cpp
dali-toolkit/public-api/controls/text-controls/text-field.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 [deleted file]
dali-toolkit/public-api/controls/view/view.h [deleted file]
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/file.list
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/programming-guide/animation-example.h
docs/content/programming-guide/animation-rotation.h
docs/content/programming-guide/dynamics-bodies.h
docs/content/programming-guide/size-negotiation-controls.h
docs/content/programming-guide/size-negotiation.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/animation/animation-api.cpp
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 62d0174..e522f31 100644 (file)
@@ -15,7 +15,6 @@ SET(TC_SOURCES
    utc-Dali-Builder.cpp
    utc-Dali-CarouselEffect.cpp
    utc-Dali-CheckBoxButton.cpp
-   utc-Dali-Cluster.cpp
    utc-Dali-CubeTransitionEffect.cpp
    utc-Dali-DepthLayout.cpp
    utc-Dali-DisplacementEffect.cpp
@@ -40,7 +39,6 @@ SET(TC_SOURCES
    utc-Dali-TextField.cpp
    utc-Dali-TextLabel.cpp
    utc-Dali-ToolBar.cpp
-   utc-Dali-View.cpp
    utc-Dali-WaterEffect.cpp
    utc-Dali-Button.cpp
    utc-Dali-Control.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 44f2da9..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>
@@ -149,7 +153,9 @@ inline bool CompareType<Degree>(Degree q1, Degree q2, float 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()
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Cluster.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Cluster.cpp
deleted file mode 100644 (file)
index b83ff8c..0000000
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <iostream>
-#include <stdlib.h>
-#include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace
-{
-
-static bool gObjectCreatedCallBackCalled;
-
-static void TestCallback(BaseHandle handle)
-{
-  gObjectCreatedCallBackCalled = true;
-}
-
-} // namespace
-
-
-void cluster_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void cluster_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-int UtcDaliClusterNew(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the Cluster actor
-  ClusterStyle style = ClusterStyleStandard::New(ClusterStyleStandard::ClusterStyle1);
-  Cluster cluster = Cluster::New(style);
-
-  DALI_TEST_CHECK(cluster);
-
-  //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);
-  {
-    ClusterStyle style = ClusterStyleStandard::New(ClusterStyleStandard::ClusterStyle1);
-    Cluster cluster = Cluster::New(style);
-  }
-  DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
-  END_TEST;
-}
-
-int UtcDaliClusterDownCast(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the Cluster actor
-  ClusterStyle style = ClusterStyleRandom::New();
-  const Cluster clusterConst = Cluster::New(style);
-  Cluster cluster(clusterConst);
-
-  BaseHandle handle(cluster);
-
-  Cluster newCluster = Cluster::DownCast( handle );
-  DALI_TEST_CHECK( cluster );
-  DALI_TEST_CHECK( newCluster == cluster );
-  END_TEST;
-}
-
-int UtcDaliClusterAddAndRemoveChild(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the Cluster actor
-  ClusterStyle style = ClusterStyleStandard::New(ClusterStyleStandard::ClusterStyle1);
-  Cluster cluster = Cluster::New(style);
-
-  Actor childActor1 = Actor::New();
-  Actor childActor2 = Actor::New();
-  Actor childActor3 = Actor::New();
-  Actor childActor4 = Actor::New();
-
-  // Add the first child and check it is added to the end
-  cluster.AddChild(childActor1);
-  DALI_TEST_CHECK( cluster.GetChildAt(0) == childActor1);
-  DALI_TEST_CHECK( !cluster.GetChildAt(1) );
-  DALI_TEST_CHECK( cluster.GetTotalCount() == 1 );
-
-  // Add the second child to the given position and check it is added
-  cluster.AddChild(childActor2, 1);
-  DALI_TEST_CHECK( cluster.GetChildAt(1) == childActor2);
-  DALI_TEST_CHECK( cluster.GetTotalCount() == 2 );
-
-  // Add the third child with depth index 1 and check it is added to the end
-  cluster.AddChildAt(childActor3, 1);
-  DALI_TEST_CHECK( cluster.GetChildAt(2) == childActor3);
-  DALI_TEST_CHECK( cluster.GetTotalCount() == 3 );
-
-  // Add the fourth child with depth index 2 to the given position and check it is added
-  cluster.AddChildAt(childActor4, 2, 3);
-  DALI_TEST_CHECK( cluster.GetChildAt(3) == childActor4);
-  DALI_TEST_CHECK( cluster.GetTotalCount() == 4 );
-
-  // Remove the child in the given position and check it's removed
-  cluster.RemoveChildAt(3);
-  DALI_TEST_CHECK( !cluster.GetChildAt(3) );
-  DALI_TEST_CHECK( cluster.GetTotalCount() == 3 );
-  END_TEST;
-}
-
-int UtcDaliClusterExpandAndCollapseChild(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the Cluster actor
-  ClusterStyle style = ClusterStyleStandard::New(ClusterStyleStandard::ClusterStyle1);
-  Cluster cluster = Cluster::New(style);
-
-  Actor childActor1 = Actor::New();
-  Actor childActor2 = Actor::New();
-  Actor childActor3 = Actor::New();
-  Actor childActor4 = Actor::New();
-
-  // Add the child actors
-  cluster.AddChild(childActor1);
-  cluster.AddChild(childActor2);
-  cluster.AddChildAt(childActor3, 1);
-  cluster.AddChildAt(childActor4, 2, 3);
-
-  // Expand child actor 3
-  cluster.ExpandChild(2);
-  DALI_TEST_CHECK( cluster.GetExpandedCount() == 1 );
-
-  // Expand child actor 4
-  cluster.ExpandChild(3);
-  DALI_TEST_CHECK( cluster.GetExpandedCount() == 2 );
-
-  // Collapse child actor 3
-  cluster.CollapseChild(2);
-  DALI_TEST_CHECK( cluster.GetExpandedCount() == 1 );
-
-  // Expand all children
-  cluster.ExpandAllChildren();
-  DALI_TEST_CHECK( cluster.GetExpandedCount() == 4 );
-
-  // Collpase all children
-  cluster.CollapseAllChildren();
-  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( Radian(0.0f), Vector3::YAXIS), AlphaFunctions::EaseOut, 0.5f);
-  cluster.RestoreChild(1, AlphaFunctions::EaseOut, 0.25f, true);
-  END_TEST;
-}
-
-int UtcDaliClusterSetAndGetStyle(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the default cluster style
-  ClusterStyle defaultStyle = ClusterStyleStandard::New(ClusterStyleStandard::ClusterStyle1);
-  DALI_TEST_CHECK( defaultStyle.GetMaximumNumberOfChildren() > 0 );
-
-  // Add style to background and title
-  Actor background = Actor::New();
-  Actor title = Actor::New();
-  defaultStyle.ApplyStyleToBackground(background, AlphaFunctions::EaseOut, 1.0f);
-  defaultStyle.ApplyStyleToTitle(title, AlphaFunctions::EaseOut, 1.0f);
-
-  // Create the Cluster actor with the default style
-  Cluster cluster = Cluster::New(defaultStyle);
-  DALI_TEST_CHECK( cluster.GetStyle() == defaultStyle );
-  cluster.SetBackgroundImage(background);
-  cluster.SetTitle(title);
-
-  // Create a new style and apply it to the cluster
-  ClusterStyle newStyle = ClusterStyleRandom::New();
-  cluster.SetStyle(newStyle);
-  DALI_TEST_CHECK( cluster.GetStyle() == newStyle );
-  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..8f363af 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);
@@ -639,39 +633,6 @@ int UtcDaliControlImplKeyEvent(void)
   END_TEST;
 }
 
-int UtcDaliControlImplStyleChange(void)
-{
-  ToolkitTestApplication application;
-
-  DummyControl dummy = DummyControl::New( true );
-  DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
-
-  Stage::GetCurrent().Add(dummy);
-
-  application.Render();
-  application.SendNotification();
-  application.Render();
-  application.SendNotification();
-
-  // Add a Control and normal Actor as children
-  DummyControl dummyChild = DummyControl::New();
-  dummy.Add(dummyChild);
-
-  Actor actor = Actor::New();
-  dummy.Add(actor);
-
-  DALI_TEST_EQUALS( dummyImpl.fontChangeCalled, false, TEST_LOCATION );
-  StyleChange styleChange;
-  styleChange.defaultFontChange = true;
-  Dali::StyleMonitor styleMonitor = StyleMonitor::Get();
-  styleMonitor.EmitStyleChangeSignal(styleChange);
-
-  DALI_TEST_EQUALS( dummyImpl.fontChangeCalled, true, TEST_LOCATION );
-
-  Stage::GetCurrent().Remove(dummy);
-  END_TEST;
-}
-
 int UtcDaliControlImplKeyInputFocusGained(void)
 {
   ToolkitTestApplication application;
@@ -773,7 +734,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 +761,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 0d259d9..b2f0324 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,9 +295,6 @@ int UtcDaliPushButtonSetImages(void)
 
   size = pushButton.GetCurrentSize();
 
-  DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
-
   END_TEST;
 }
 
index 39af3d3..493a795 100644 (file)
@@ -67,6 +67,8 @@ const float TEST_RATIO_TOLERANCE = 0.05;                        ///< +/-5% toler
 
 const int MAX_FRAMES_TO_TEST_OVERSHOOT = 600;                         ///< 10 seconds (at 60 frames per second).
 const Vector3 OVERSHOOT_START_SCROLL_POSITION(100.0f, 100.0f, 0.0f);  ///< Scroll start position for the Overshoot tests.
+const float SCROLL_ANIMATION_DURATION(0.33f);                   ///< Duration of scroll animation in Overshoot tests (i.e. 100 pixels of overshoot in the speed of 500 pixels per 100 frames, 100/(500/(60/100)) = 0.33)
+const Vector3 SNAP_POSITION_WITH_DECELERATED_VELOCITY(74.0f, 74.0f, 0.0f);  ///< the snap position for Overshoot tests with the decelerated velocity (i.e. Decelerated from 500 pixels per 100 frames).
 const float TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION = 0.05f;             ///< a Test duration
 const float TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION = 1.5f;              ///< another Test duration
 const float TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION = TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION * 0.5f; // Same as above, but different alpha function.
@@ -1027,8 +1029,11 @@ int UtcDaliScrollViewOvershoot(void)
   SendPan(application, Gesture::Finished, currentPos);
   timeToReachOrigin = TestOvershootSnapDuration(application, scrollView);
 
-  DALI_TEST_CHECK( (timeToReachOrigin > Toolkit::ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION - TIME_TOLERANCE) &&
-                   (timeToReachOrigin < Toolkit::ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION + TIME_TOLERANCE) );
+  float minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + Toolkit::ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
+  float maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + Toolkit::ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
+
+  DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
+                   (timeToReachOrigin < maxTimeToReachOrigin) );
 
   // 2. Repeat Scroll, but this time change overshoot snap duration to shorter time
   scrollView.SetSnapOvershootDuration(TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION);
@@ -1038,8 +1043,11 @@ int UtcDaliScrollViewOvershoot(void)
   SendPan(application, Gesture::Finished, currentPos);
   timeToReachOrigin = TestOvershootSnapDuration(application, scrollView);
 
-  DALI_TEST_CHECK( (timeToReachOrigin > TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION - TIME_TOLERANCE) &&
-                   (timeToReachOrigin < TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION + TIME_TOLERANCE) );
+  minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
+  maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
+
+  DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
+                   (timeToReachOrigin < maxTimeToReachOrigin) );
 
   // 3. Repeat Scroll, but this time change overshoot snap duration to longer time.
   scrollView.SetSnapOvershootDuration(TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION);
@@ -1049,8 +1057,11 @@ int UtcDaliScrollViewOvershoot(void)
   SendPan(application, Gesture::Finished, currentPos);
   timeToReachOrigin = TestOvershootSnapDuration(application, scrollView);
 
-  DALI_TEST_CHECK( (timeToReachOrigin > TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION - TIME_TOLERANCE) &&
-                   (timeToReachOrigin < TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION + TIME_TOLERANCE) );
+  minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
+  maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
+
+  DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
+                   (timeToReachOrigin < maxTimeToReachOrigin) );
 
   // 4. Repeat Scroll, but this time change overshoot function.
   scrollView.SetSnapOvershootDuration(TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION);
@@ -1061,8 +1072,11 @@ int UtcDaliScrollViewOvershoot(void)
   SendPan(application, Gesture::Finished, currentPos);
   timeToReachOrigin = TestOvershootSnapDuration(application, scrollView);
 
-  DALI_TEST_CHECK( (timeToReachOrigin > TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION - TIME_TOLERANCE) &&
-                   (timeToReachOrigin < TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION + TIME_TOLERANCE) );
+  minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
+  maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
+
+  DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
+                   (timeToReachOrigin < maxTimeToReachOrigin) );
   END_TEST;
 }
 
@@ -1073,15 +1087,14 @@ int UtcDaliScrollViewSnapAlphaFunction(void)
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
-  scrollView.SetScrollSnapAlphaFunction( AlphaFunctions::EaseIn );
-  DALI_TEST_CHECK( scrollView.GetScrollSnapAlphaFunction() == AlphaFunctions::EaseIn );
-  scrollView.SetScrollSnapAlphaFunction( AlphaFunctions::EaseOut );
-  DALI_TEST_CHECK( scrollView.GetScrollSnapAlphaFunction() == AlphaFunctions::EaseOut );
-
-  scrollView.SetScrollFlickAlphaFunction( AlphaFunctions::Bounce );
-  DALI_TEST_CHECK( scrollView.GetScrollFlickAlphaFunction() == AlphaFunctions::Bounce );
-  scrollView.SetScrollFlickAlphaFunction( AlphaFunctions::BounceBack );
-  DALI_TEST_CHECK( scrollView.GetScrollFlickAlphaFunction() == AlphaFunctions::BounceBack );
+  scrollView.SetScrollSnapAlphaFunction( AlphaFunction::EASE_IN );
+  DALI_TEST_CHECK( scrollView.GetScrollSnapAlphaFunction().GetBuiltinFunction() == AlphaFunction::EASE_IN );
+  scrollView.SetScrollSnapAlphaFunction( AlphaFunction::EASE_OUT );
+  DALI_TEST_CHECK( scrollView.GetScrollSnapAlphaFunction().GetBuiltinFunction() == AlphaFunction::EASE_OUT );
+
+  scrollView.SetScrollFlickAlphaFunction( AlphaFunction::BOUNCE );
+  DALI_TEST_CHECK( scrollView.GetScrollFlickAlphaFunction().GetBuiltinFunction() == AlphaFunction::BOUNCE );
+
   END_TEST;
 }
 
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..bf3111d 100644 (file)
@@ -36,59 +36,145 @@ void dali_textfield_cleanup(void)
 namespace
 {
 
-const char* const PROPERTY_NAME_RENDERING_BACKEND = "rendering-backend";
-const char* const PROPERTY_NAME_PLACEHOLDER_TEXT = "placeholder-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";
-const char* const PROPERTY_NAME_EXCEED_POLICY = "exceed-policy";
-const char* const PROPERTY_NAME_PRIMARY_CURSOR_COLOR = "primary-cursor-color";
-const char* const PROPERTY_NAME_SECONDARY_CURSOR_COLOR = "secondary-cursor-color";
-const char* const PROPERTY_NAME_ENABLE_CURSOR_BLINK = "enable-cursor-blink";
-const char* const PROPERTY_NAME_CURSOR_BLINK_INTERVAL = "cursor-blink-interval";
-const char* const PROPERTY_NAME_CURSOR_BLINK_DURATION = "cursor-blink-duration";
-const char* const PROPERTY_NAME_GRAB_HANDLE_IMAGE = "grab-handle-image";
+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";
+const char* const PROPERTY_NAME_EXCEED_POLICY           = "exceed-policy";
+const char* const PROPERTY_NAME_PRIMARY_CURSOR_COLOR    = "primary-cursor-color";
+const char* const PROPERTY_NAME_SECONDARY_CURSOR_COLOR  = "secondary-cursor-color";
+const char* const PROPERTY_NAME_ENABLE_CURSOR_BLINK     = "enable-cursor-blink";
+const char* const PROPERTY_NAME_CURSOR_BLINK_INTERVAL   = "cursor-blink-interval";
+const char* const PROPERTY_NAME_CURSOR_BLINK_DURATION   = "cursor-blink-duration";
+const char* const PROPERTY_NAME_GRAB_HANDLE_IMAGE       = "grab-handle-image";
 const char* const PROPERTY_NAME_DECORATION_BOUNDING_BOX = "decoration-bounding-box";
-const char* const PROPERTY_NAME_HORIZONTAL_ALIGNMENT = "horizontal-alignment";
-const char* const PROPERTY_NAME_VERTICAL_ALIGNMENT = "vertical-alignment";
+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 UtcDaliTextFieldNew(void)
+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 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,59 @@ 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, "" );
+
+  // Check that the MAX_LENGTH property can be correctly set
+  const int maxNumberOfCharacters = 20;
+  field.SetProperty( TextField::Property::MAX_LENGTH, maxNumberOfCharacters );
+  DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::MAX_LENGTH ), maxNumberOfCharacters, TEST_LOCATION );
+
+  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 +296,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 );
 
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-View.cpp b/automated-tests/src/dali-toolkit/utc-Dali-View.cpp
deleted file mode 100644 (file)
index ad124e1..0000000
+++ /dev/null
@@ -1,392 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <iostream>
-#include <stdlib.h>
-#include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-using namespace Dali;
-using namespace Toolkit;
-
-
-void dali_view_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void dali_view_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-
-namespace
-{
-
-static bool gAnimationStarted = false;
-
-void StartAnimation( View, Animation& animation, const Orientation& orientation )
-{
-  gAnimationStarted = true;
-}
-
-
-static bool gObjectCreatedCallBackCalled;
-static void TestCallback(BaseHandle handle)
-{
-  gObjectCreatedCallBackCalled = true;
-}
-
-
-}
-
-
-int UtcDaliViewNew(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliViewNew");
-
-  View view1;
-  DALI_TEST_CHECK( !view1 );
-
-  view1 = View::New();
-  DALI_TEST_CHECK( view1 );
-
-  View view2( view1 );
-  DALI_TEST_CHECK( view2 );
-
-  View view3 = view2;
-  DALI_TEST_CHECK( view3 );
-
-  view1.Reset();
-  view2.Reset();
-  view3.Reset();
-
-  //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 );
-  {
-    View view = View::New();
-  }
-  DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
-  END_TEST;
-}
-
-int UtcDaliViewAddGetRemoveContentLayer01(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliViewAddGetRemoveContentLayer01");
-
-  View view = View::New();
-  Layer layer1;
-  Layer layer2;
-  Layer layer3;
-  Layer layer4;
-
-  // Test: add and get layers.
-  try
-  {
-    layer1 = Layer::New();
-    layer1.SetName( "Layer1" );
-    layer2 = Layer::New();
-    layer2.SetName( "Layer2" );
-
-    unsigned int layerId1 = view.AddContentLayer( layer1 );
-    unsigned int layerId2 = view.AddContentLayer( layer2 );
-
-    layer3 = view.GetContentLayer( layerId1 );
-    layer4 = view.GetContentLayer( layerId2 );
-
-    DALI_TEST_EQUALS( layer1.GetName(), layer3.GetName(), TEST_LOCATION );
-    DALI_TEST_EQUALS( layer2.GetName(), layer4.GetName(), TEST_LOCATION );
-  }
-  catch( ... )
-  {
-    tet_printf( "UtcDaliViewAddGetRemoveContentLayer: Exception while adding and geting layers to/from view.\n" );
-    tet_result(TET_FAIL);
-  }
-
-  bool test1 = false;
-  bool test2 = false;
-  // Test: remove layers.
-  try
-  {
-    view.RemoveContentLayer( layer3 );
-    view.RemoveContentLayer( layer4 );
-    test1 = true;
-  }
-  catch( ... )
-  {
-    tet_printf( "UtcDaliViewAddGetRemoveContentLayer: Exception while removing layers from view.\n" );
-    tet_result(TET_FAIL);
-  }
-
-  // Test: add same layers again.
-  try
-  {
-    view.AddContentLayer( layer1 );
-    view.AddContentLayer( layer2 );
-    test2 = true;
-  }
-  catch( ... )
-  {
-    tet_printf( "UtcDaliViewAddGetRemoveContentLayer: Exception while adding layers from view after have been removed.\n" );
-    tet_result(TET_FAIL);
-  }
-
-  DALI_TEST_CHECK( test1 && test2 );
-  END_TEST;
-}
-
-int UtcDaliViewAddGetRemoveContentLayer02(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliViewAddGetRemoveContentLayer02");
-
-  View view = View::New();
-
-  Layer layer1 = Layer::New();
-  layer1.SetName( "Layer1" );
-  Layer layer2 = Layer::New();
-  layer2.SetName( "Layer2" );
-
-  view.AddContentLayer( layer1 );
-  view.AddContentLayer( layer2 );
-
-  // Test: add a layer twice.
-  try
-  {
-    view.AddContentLayer( layer1 );
-  }
-  catch( ... )
-  {
-    tet_result(TET_FAIL);
-  }
-
-  // Test: add an unitialized layer.
-  try
-  {
-    Layer layer;
-    view.AddContentLayer( layer );
-  }
-  catch( DaliException& e )
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS( e.condition, "layer", TEST_LOCATION );
-  }
-
-  // Test: get a layer which was not added before.
-  Layer layer = view.GetContentLayer( 100 );
-  DALI_TEST_CHECK( !layer );
-
-  // Test: Remove a layer which was not added before.
-  try
-  {
-    Layer layer = Layer::New();
-    view.RemoveContentLayer( layer );
-  }
-  catch( ... )
-  {
-    tet_result(TET_FAIL);
-  }
-
-  tet_result(TET_PASS);
-  END_TEST;
-}
-
-int UtcDaliViewSetGetBackgroundLayer01(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliViewSetGetBackgroundLayer01");
-
-  View view;
-  Layer layer1, layer2;
-
-  // Test with an actor.
-
-  view = View::New();
-  Stage::GetCurrent().Add( view );
-
-  ImageActor background = CreateSolidColorActor( Color::RED );
-
-  view.SetBackground( background );
-
-  layer1 = view.GetBackgroundLayer();
-
-  DALI_TEST_CHECK( layer1 );
-
-  background = CreateSolidColorActor( Color::GREEN );
-
-  view.SetBackground( background );
-
-  layer2 = view.GetBackgroundLayer();
-
-  DALI_TEST_CHECK( layer2 );
-
-  Stage::GetCurrent().Remove( view );
-  END_TEST;
-}
-
-int UtcDaliViewSetGetBackgroundLayer02(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliViewSetGetBackgroundLayer02");
-
-  bool assert = false;
-
-  try
-  {
-    View view = View::New();
-
-    ImageActor background = CreateSolidColorActor( Color::RED );
-
-    view.SetBackground( background );
-  }
-  catch( DaliException& e )
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS( e.condition, "mBackgroundLayer.OnStage()", TEST_LOCATION );
-    assert = true;
-  }
-
-  DALI_TEST_CHECK( assert );
-  END_TEST;
-}
-
-int UtcDaliViewSetOrientationFunction(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliViewSetOrientationFunction");
-
-  // Test it doesn't crash
-  try
-  {
-    View view = View::New();
-    Stage::GetCurrent().Add( view );
-
-    view.SetSize( 480, 800 );
-    view.SetOrientationFunction( Degree( 0.f ), Degree( 90.f ), Degree( 180.f ), Degree( 270.f ) );
-  }
-  catch( ... )
-  {
-    tet_result(TET_FAIL);
-  }
-
-  tet_result(TET_PASS);
-  END_TEST;
-}
-
-int UtcDaliViewOrientationChanged(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliViewOrientationChanged");
-
-  gAnimationStarted = false;
-
-  // Test it doesn't crash
-  try
-  {
-    View view = View::New();
-    view.SetRelayoutEnabled( true );
-    Stage::GetCurrent().Add( view );
-
-    view.SetSize( Vector2( 480, 800 ) );
-
-    view.OrientationAnimationStartedSignal().Connect( &StartAnimation );
-
-    application.SendNotification(); // Remove these two lines causes
-    application.Render();           // ToolkitTestApplication destructor to crash
-
-    //Orientation orientation = application.GetOrientation().GetHandle();
-    //application.GetOrientation().SetDegrees( 90 );
-    //view.OrientationChanged( orientation );
-  }
-  catch( ... )
-  {
-    tet_result(TET_FAIL);
-  }
-
-  // Check the view animation started.
-  DALI_TEST_CHECK( gAnimationStarted );
-  END_TEST;
-}
-
-int UtcSetAutoRotate(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcSetAutoRotate");
-
-  gAnimationStarted = false;
-
-  View view;
-
-  // Test it doesn't crash
-  try
-  {
-    view = View::New();
-    Stage::GetCurrent().Add( view );
-
-    view.SetSize( 480, 800 );
-
-    //view.OrientationAnimationStartedSignal().Connect( &StartAnimation );
-
-    application.SendNotification();
-    application.Render();
-
-    //Orientation orientation = application.GetOrientation().GetHandle();
-    //application.GetOrientation().SetDegrees( 90 );
-    //view.OrientationChanged( orientation );
-  }
-  catch( ... )
-  {
-    tet_result(TET_FAIL);
-  }
-
-  // Check the view animation started.
-  //DALI_TEST_CHECK( gAnimationStarted );
-
-
-  gAnimationStarted = false;
-
-  try
-  {
-    view = View::New();
-    view.SetAutoRotate( false ); // Animation shouldn't start.
-    Stage::GetCurrent().Add( view );
-
-    view.SetSize( 480, 800 );
-
-    application.SendNotification();
-    application.Render();
-
-    //Orientation orientation = application.GetOrientation().GetHandle();
-    //application.GetOrientation().SetDegrees( 180 );
-    //view.OrientationChanged( orientation );
-  }
-  catch( ... )
-  {
-    tet_result(TET_FAIL);
-  }
-
-  // Check the view animation didn't start.
-  DALI_TEST_CHECK( !gAnimationStarted );
-  END_TEST;
-}
index 0e705e2..f9bdac1 100644 (file)
@@ -30,8 +30,6 @@
 #include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
 #include <dali-toolkit/public-api/controls/buttons/radio-button.h>
-#include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
-#include <dali-toolkit/public-api/controls/cluster/cluster.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/controls/default-controls/check-button-factory.h>
@@ -76,7 +74,6 @@
 #include <dali-toolkit/public-api/controls/text-controls/text-field.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
 #include <dali-toolkit/public-api/controls/tool-bar/tool-bar.h>
-#include <dali-toolkit/public-api/controls/view/view.h>
 
 #include <dali-toolkit/public-api/focus-manager/focus-manager.h>
 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
diff --git a/dali-toolkit/images/insertpoint-icon-pressed.png b/dali-toolkit/images/insertpoint-icon-pressed.png
new file mode 100644 (file)
index 0000000..171b737
Binary files /dev/null and b/dali-toolkit/images/insertpoint-icon-pressed.png differ
index bea8368..6caf392 100644 (file)
@@ -110,34 +110,20 @@ AlphaFunction GetAlphaFunction( const std::string& alphaFunction )
   if( 0 == alphaFunctionLut.size() )
   {
     // coding convention is uppercase enums
-    alphaFunctionLut["DEFAULT"]                    = AlphaFunctions::Default;
-    alphaFunctionLut["LINEAR"]                     = AlphaFunctions::Linear;
-    alphaFunctionLut["SQUARE"]                     = AlphaFunctions::Square;
-    alphaFunctionLut["REVERSE"]                    = AlphaFunctions::Reverse;
-    alphaFunctionLut["EASE_IN"]                    = AlphaFunctions::EaseIn;
-    alphaFunctionLut["EASE_OUT"]                   = AlphaFunctions::EaseOut;
-    alphaFunctionLut["EASE_IN_OUT"]                = AlphaFunctions::EaseInOut;
-    alphaFunctionLut["EASE_IN_SINE"]               = AlphaFunctions::EaseInSine;
-    alphaFunctionLut["EASE_OUT_SINE"]              = AlphaFunctions::EaseOutSine;
-    alphaFunctionLut["EASE_IN_OUT_SINE"]           = AlphaFunctions::EaseInOutSine;
-    alphaFunctionLut["EASE_IN_SINE_33"]            = AlphaFunctions::EaseInSine33;
-    alphaFunctionLut["EASE_OUT_SINE_33"]           = AlphaFunctions::EaseOutSine33;
-    alphaFunctionLut["EASE_IN_OUT_SINE_33"]        = AlphaFunctions::EaseInOutSine33;
-    alphaFunctionLut["EASE_IN_OUT_SINE_50"]        = AlphaFunctions::EaseInOutSine50;
-    alphaFunctionLut["EASE_IN_OUT_SINE_60"]        = AlphaFunctions::EaseInOutSine60;
-    alphaFunctionLut["EASE_IN_OUT_SINE_70"]        = AlphaFunctions::EaseInOutSine70;
-    alphaFunctionLut["EASE_IN_OUT_SINE_80"]        = AlphaFunctions::EaseInOutSine80;
-    alphaFunctionLut["EASE_IN_OUT_SINE_90"]        = AlphaFunctions::EaseInOutSine90;
-    alphaFunctionLut["DOUBLE_EASE_IN_OUT_SINE_60"] = AlphaFunctions::DoubleEaseInOutSine60;
-    alphaFunctionLut["EASE_OUT_QUINT_50"]          = AlphaFunctions::EaseOutQuint50;
-    alphaFunctionLut["EASE_OUT_QUINT_80"]          = AlphaFunctions::EaseOutQuint80;
-    alphaFunctionLut["BOUNCE"]                     = AlphaFunctions::Bounce;
-    alphaFunctionLut["BOUNCE_BACK"]                = AlphaFunctions::BounceBack;
-    alphaFunctionLut["EASE_IN_BACK"]               = AlphaFunctions::EaseInBack;
-    alphaFunctionLut["EASE_OUT_BACK"]              = AlphaFunctions::EaseOutBack;
-    alphaFunctionLut["EASE_IN_OUT_BACK"]           = AlphaFunctions::EaseInOutBack;
-    alphaFunctionLut["SIN"]                        = AlphaFunctions::Sin;
-    alphaFunctionLut["SIN2X"]                      = AlphaFunctions::Sin2x;
+    alphaFunctionLut["DEFAULT"]                    = AlphaFunction(AlphaFunction::DEFAULT);
+    alphaFunctionLut["LINEAR"]                     = AlphaFunction(AlphaFunction::LINEAR);
+    alphaFunctionLut["REVERSE"]                    = AlphaFunction(AlphaFunction::REVERSE);
+    alphaFunctionLut["EASE_IN_SQUARE"]             = AlphaFunction(AlphaFunction::EASE_IN_SQUARE);
+    alphaFunctionLut["EASE_OUT_SQUARE"]            = AlphaFunction(AlphaFunction::EASE_OUT_SQUARE);
+    alphaFunctionLut["EASE_IN"]                    = AlphaFunction(AlphaFunction::EASE_IN);
+    alphaFunctionLut["EASE_OUT"]                   = AlphaFunction(AlphaFunction::EASE_OUT);
+    alphaFunctionLut["EASE_IN_OUT"]                = AlphaFunction(AlphaFunction::EASE_IN_OUT);
+    alphaFunctionLut["EASE_IN_SINE"]               = AlphaFunction(AlphaFunction::EASE_IN_SINE);
+    alphaFunctionLut["EASE_OUT_SINE"]              = AlphaFunction(AlphaFunction::EASE_OUT_SINE);
+    alphaFunctionLut["EASE_IN_OUT_SINE"]           = AlphaFunction(AlphaFunction::EASE_IN_OUT_SINE);
+    alphaFunctionLut["BOUNCE"]                     = AlphaFunction(AlphaFunction::BOUNCE);
+    alphaFunctionLut["SIN"]                        = AlphaFunction(AlphaFunction::SIN);
+    alphaFunctionLut["EASE_OUT_BACK"]              = AlphaFunction(AlphaFunction::EASE_OUT_BACK);
   }
 
   const AlphaFunctionLut::const_iterator iter( alphaFunctionLut.find( alphaFunction ) );
@@ -149,7 +135,7 @@ AlphaFunction GetAlphaFunction( const std::string& alphaFunction )
   else
   {
     DALI_ASSERT_ALWAYS( iter != alphaFunctionLut.end() && "Unknown Anchor Constant" );
-    return Dali::AlphaFunctions::Default;
+    return Dali::AlphaFunction::DEFAULT;
   }
 }
 
@@ -278,7 +264,7 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D
       }
 
       // these are the defaults
-      AlphaFunction alphaFunction( AlphaFunctions::Default );
+      AlphaFunction alphaFunction( AlphaFunction::DEFAULT );
       TimePeriod timePeriod( 0.f );
 
       OptionalChild timeChild = IsChild( pKeyChild.second, "time-period" );
@@ -326,7 +312,7 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D
             throw;
           }
 
-          AlphaFunction kfAlphaFunction( AlphaFunctions::Default );
+          AlphaFunction kfAlphaFunction( AlphaFunction::DEFAULT );
           if( OptionalString alphaFuncStr = constant.IsString( IsChild(pKeyChild.second, "alpha-function") ) )
           {
             kfAlphaFunction = GetAlphaFunction( *alphaFuncStr );
index 9713587..b06e57b 100644 (file)
@@ -377,7 +377,7 @@ Toolkit::Alignment Alignment::New( Toolkit::Alignment::Type horizontal, Toolkit:
   // Create the implementation, temporarily owned on stack
   IntrusivePtr< Alignment > internalAlignment = new Alignment( horizontal, vertical );
 
-  // Pass ownership to Toolkit::View
+  // Pass ownership to Toolkit::Alignment
   Toolkit::Alignment alignment( *internalAlignment );
 
   // Second-phase init of the implementation
@@ -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..ae17a0d 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 ),
@@ -261,14 +261,14 @@ void BubbleEmitter::EmitBubble( Animation& animation, const Vector2& emitPositio
   unsigned int groupIdx = mCurrentUniform / mNumBubblePerShader;
   SetBubbleParameter( mEffect[groupIdx], curUniform, emitPosition, direction, displacement);
   animation.AnimateTo( Property( mEffect[groupIdx], mEffect[groupIdx].GetPercentagePropertyName(curUniform) ),
-                       1.f, AlphaFunctions::Linear );
+                       1.f, AlphaFunction::LINEAR );
 
   if( mCurrentUniform % mNumShader == 0 )
   {
     unsigned int uniform = mCurrentUniform / mNumShader;
     SetBubbleParameter(mEffectForNoise, uniform, emitPosition, displacement);
     animation.AnimateTo( Property( mEffectForNoise, mEffectForNoise.GetPercentagePropertyName(uniform) ),
-                         1.f, AlphaFunctions::Linear );
+                         1.f, AlphaFunction::LINEAR );
   }
 
   mCurrentUniform = (mCurrentUniform + 1) % mTotalNumOfBubble;
@@ -280,10 +280,10 @@ void BubbleEmitter::StartExplosion( float duration, float multiple )
   for(unsigned int i=0; i < mNumShader; i++ )
   {
     animation.AnimateTo( Property( mEffect[i], mEffect[i].GetMagnificationPropertyName() ),
-                         multiple, AlphaFunctions::EaseOut);
+                         multiple, AlphaFunction::EASE_OUT);
   }
   animation.AnimateTo( Property( mEffectForNoise, mEffectForNoise.GetMagnificationPropertyName() ),
-                       multiple, AlphaFunctions::EaseOut);
+                       multiple, AlphaFunction::EASE_OUT);
   animation.Play();
 
   animation.FinishedSignal().Connect(this, &BubbleEmitter::OnExplosionFinished);
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
 
   /**
diff --git a/dali-toolkit/internal/controls/cluster/cluster-impl.cpp b/dali-toolkit/internal/controls/cluster/cluster-impl.cpp
deleted file mode 100644 (file)
index e2b4297..0000000
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali-toolkit/internal/controls/cluster/cluster-impl.h>
-
-// EXTERNAL INCLUDES
-#include <algorithm>
-#include <cstring> // for strcmp
-#include <dali/public-api/animation/animation.h>
-#include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
-#include <dali-toolkit/internal/controls/cluster/cluster-style-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace
-{
-
-BaseHandle Create()
-{
-  Toolkit::ClusterStyleStandard s = Toolkit::ClusterStyleStandard::New( Toolkit::ClusterStyleStandard::ClusterStyle1 );
-  return Toolkit::Cluster::New( s );
-}
-
-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_TYPE_REGISTRATION_END()
-
-const float CLUSTER_STYLE_CONSTRAINT_DURATION = 1.0f;
-
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Cluster
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-Dali::Toolkit::Cluster Cluster::New(Toolkit::ClusterStyle& style)
-{
-  // Create the implementation
-  ClusterPtr cluster(new Cluster(style));
-
-  // Pass ownership to CustomActor via derived handle
-  Dali::Toolkit::Cluster handle(*cluster);
-
-  // Second-phase init of the implementation
-  // This can only be done after the CustomActor connection has been made...
-  cluster->Initialize();
-
-  return handle;
-}
-
-Cluster::Cluster(Toolkit::ClusterStyle& style)
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
-  mClusterStyle(style),
-  mExpandedCount(0)
-{
-}
-
-void Cluster::OnInitialize()
-{
-}
-
-void Cluster::OnControlSizeSet( const Vector3& targetSize )
-{
-  mClusterSize = targetSize;
-  GetImpl(mClusterStyle).SetClusterSize(targetSize);
-
-  for(ChildInfoIter iter = mChildren.begin(); iter != mChildren.end(); ++iter)
-  {
-
-    if((*iter).mActor)
-    {
-      mClusterStyle.ApplyStyle( (*iter).mActor,
-                                (*iter).mPositionIndex,
-                                AlphaFunctions::EaseOut,
-                                0.f );
-    }
-  }
-
-  UpdateBackground(0.f);
-  UpdateTitle(0.f);
-}
-
-Cluster::~Cluster()
-{
-}
-
-void Cluster::AddChild( Actor child )
-{
-  // automatically add child with a position at end.
-  AddChild( child, mChildren.size() );
-}
-
-void Cluster::AddChild( Actor child, unsigned int positionIndex )
-{
-  AddChildInfo( ChildInfo(child, positionIndex) );
-}
-
-void Cluster::AddChildAt( Actor child, unsigned int index )
-{
-  // automatically add child with a position at end.
-  AddChild( child, mChildren.size() );
-}
-
-void Cluster::AddChildAt( Actor child, unsigned int positionIndex, unsigned int index )
-{
-  AddChildInfoAt( ChildInfo(child, positionIndex), index );
-}
-
-void Cluster::AddChildInfo( ChildInfo childInfo )
-{
-  AddChildInfoAt(childInfo, mChildren.size());
-}
-
-void Cluster::AddChildInfoAt( ChildInfo childInfo, unsigned int index )
-{
-  // check that the child is valid
-  DALI_ASSERT_ALWAYS( childInfo.mActor );
-
-  ChildInfoIter offset = index < mChildren.size() ? (mChildren.begin() + index) : mChildren.end();
-  // now perform customization on this child.
-
-  // adopt the child
-  if(childInfo.mActor.GetParent() != Self())
-  {
-    Actor& child = childInfo.mActor;
-    const float depth = std::distance(mChildren.begin(), offset);
-
-    Property::Index depthProperty = child.GetPropertyIndex(Toolkit::Cluster::CLUSTER_ACTOR_DEPTH);
-    if(depthProperty == Property::INVALID_INDEX)
-    {
-      child.RegisterProperty(Toolkit::Cluster::CLUSTER_ACTOR_DEPTH, depth);
-    }
-
-    // not added prior
-    Self().Add( childInfo.mActor );
-    mChildren.insert( offset, childInfo );
-
-    // Use parent position plus relative position.
-    child.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
-
-    // remove old constraints
-    child.RemoveConstraints();
-
-    // apply new constraints to the child
-    mClusterStyle.ApplyStyle(child, childInfo.mPositionIndex, AlphaFunctions::EaseOut, 0.0f);
-  }
-  else
-  {
-    // already added.
-    ChildInfoContainer mNewChildren;
-    ChildInfoIter iter = mChildren.begin();
-    float depth = 0.0f;
-
-    for( ; iter != mChildren.end(); ++iter)
-    {
-      if(iter == offset)
-      {
-        SetDepth(childInfo, depth);
-        depth++;
-        // insert the new childInfo before offset.
-        mNewChildren.push_back(childInfo);
-      }
-      // copy all children except the one that we wish to move.
-      if((*iter).mActor != childInfo.mActor)
-      {
-        SetDepth(*iter, depth);
-        depth++;
-        mNewChildren.push_back(*iter);
-      }
-    } // end for.
-
-    if(iter == offset)
-    {
-      SetDepth(childInfo, depth);
-      // insert the new childInfo before offset (end).
-      mNewChildren.push_back(childInfo);
-    }
-
-    mChildren = mNewChildren;
-
-    // Todo somehow adjust their perceived depth.
-  }
-}
-
-void Cluster::SetDepth( ChildInfo& childInfo, float depth )
-{
-  Property::Index depthProperty = childInfo.mActor.GetPropertyIndex(Toolkit::Cluster::CLUSTER_ACTOR_DEPTH);
-  childInfo.mActor.SetProperty( depthProperty, depth );
-}
-
-ChildInfo Cluster::GetChildInfoAt( unsigned int index )
-{
-  // check if we have this position in the cluster
-  if( index < mChildren.size() )
-  {
-    // return the child handle
-    return mChildren[ index ];
-  }
-
-  // return an empty handle
-  return ChildInfo();
-}
-
-Actor Cluster::GetChildAt( unsigned int index )
-{
-  // check if we have this position in the cluster
-  if( index < mChildren.size() )
-  {
-    // return the child handle
-    return mChildren[ index ].mActor;
-  }
-
-  // return an empty handle
-  return Actor();
-}
-
-Actor Cluster::RemoveChildAt( unsigned int index )
-{
-  DALI_ASSERT_ALWAYS( index < mChildren.size() );
-
-  ChildInfoIter iter = mChildren.begin() + index;
-  Actor child = (*iter).mActor;
-  mChildren.erase( iter );
-  Self().Remove(child);
-  // note: constraints will automatically be removed in OnControlChildRemove
-
-  // update depths.
-  float depth = 0.0f;
-
-  for(ChildInfoIter iter = mChildren.begin(); iter != mChildren.end(); ++iter)
-  {
-    SetDepth(*iter, depth);
-    depth++;
-  } // end for.
-
-  return child;
-}
-
-void Cluster::ExpandChild( unsigned int index )
-{
-  if( index < mChildren.size() )
-  {
-    ChildInfo& childInfo = mChildren[ index ];
-    DALI_ASSERT_ALWAYS(childInfo.mActor);
-
-    if(!childInfo.mExpanded)
-    {
-      // expand child to a random position/angle.
-      const Vector3 clusterSize = Self().GetCurrentSize();
-      const float length = clusterSize.Length() * 0.1f;
-      const float zOffset = 50.0f;
-      const float angle = (rand()%360) * Math::PI / 180.0f;
-      Vector3 position(sin(angle) * length, -cos(angle) * length, zOffset);
-      const float scale(1.2f);
-      const Radian rotate( Degree( (rand()%30) - 15 ) );
-
-      position += childInfo.mActor.GetCurrentPosition();
-
-      TransformChild(index,
-                     position,
-                     Vector3::ONE * scale,
-                     Quaternion(rotate, Vector3::ZAXIS),
-                     AlphaFunctions::EaseOut,
-                     0.5f);
-    }
-  }
-}
-
-void Cluster::ExpandAllChildren()
-{
-  for(unsigned int index = 0;index < mChildren.size(); index++)
-  {
-    ExpandChild( index );
-  }
-}
-
-void Cluster::CollapseChild( unsigned int index, bool front )
-{
-  if( index < mChildren.size() )
-  {
-    RestoreChild(index,
-                 AlphaFunctions::EaseOut,
-                 0.25f,
-                 front);
-  }
-}
-
-void Cluster::CollapseAllChildren( bool front )
-{
-  for(unsigned int index = 0;index < mChildren.size(); index++)
-  {
-    RestoreChild(index,
-                 AlphaFunctions::EaseOut,
-                 0.25f,
-                 front);
-  }
-}
-
-void Cluster::TransformChild( unsigned int index, const Vector3& position, const Vector3& scale, const Quaternion& rotation, AlphaFunction alpha, const TimePeriod& period )
-{
-  if( index < mChildren.size() )
-  {
-    ChildInfo& childInfo = mChildren[ index ];
-    DALI_ASSERT_ALWAYS(childInfo.mActor);
-
-    if(!childInfo.mExpanded)
-    {
-      Actor child = childInfo.mActor;
-      childInfo.mExpanded = true;
-      mExpandedCount++;
-
-      child.RemoveConstraints();
-      Animation animation = Animation::New(period.delaySeconds + period.durationSeconds);
-      animation.AnimateTo( Property(child, Actor::Property::POSITION), position, AlphaFunctions::EaseOut, period);
-      animation.AnimateTo( Property(child, Actor::Property::SCALE), scale, AlphaFunctions::EaseOut, period);
-      animation.AnimateTo( Property(child, Actor::Property::ORIENTATION), rotation, AlphaFunctions::EaseOut, period);
-      animation.Play();
-    }
-  }
-}
-
-void Cluster::RestoreChild( unsigned int index, AlphaFunction alpha, const TimePeriod& period, bool front )
-{
-  if( index < mChildren.size() )
-  {
-    ChildInfo& childInfo = mChildren[ index ];
-    DALI_ASSERT_ALWAYS(childInfo.mActor);
-
-    if(childInfo.mExpanded)
-    {
-      Actor child = childInfo.mActor;
-      childInfo.mExpanded = false;
-      mExpandedCount--;
-      mClusterStyle.ApplyStyle( child, childInfo.mPositionIndex, alpha, period );
-
-      const unsigned int hideIndex = front ? mChildren.size() : 0;
-      AddChildInfoAt(childInfo, hideIndex); // move child info to the back or front of the pack.
-    }
-  }
-}
-
-void Cluster::SetBackgroundImage( Actor image )
-{
-  // Replaces the background image.
-  if(mBackgroundImage && mBackgroundImage.GetParent())
-  {
-    mBackgroundImage.GetParent().Remove(mBackgroundImage);
-  }
-
-  mBackgroundImage = image;
-  Self().Add(mBackgroundImage);
-
-  mBackgroundImage.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  mBackgroundImage.SetParentOrigin( ParentOrigin::TOP_LEFT );
-
-  UpdateBackground(0.0f);
-}
-
-void Cluster::SetTitle( Actor text )
-{
-  // Replaces the title actor.
-  if(mTitle && mTitle.GetParent())
-  {
-    mTitle.GetParent().Remove( mTitle );
-  }
-
-  mTitle = text;
-  Self().Add( mTitle );
-
-  mTitle.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  mTitle.SetParentOrigin( ParentOrigin::TOP_LEFT );
-
-  UpdateTitle(0.0f);
-}
-
-void Cluster::SetStyle(Toolkit::ClusterStyle style)
-{
-  unsigned int previousChildrenNum = mChildren.size();
-  mClusterStyle = style;
-  GetImpl(mClusterStyle).SetClusterSize(mClusterSize);
-  unsigned int newChildrenNum = mClusterStyle.GetMaximumNumberOfChildren();
-
-  // New style supports less children (remove those that no longer belong)
-  if(newChildrenNum < previousChildrenNum)
-  {
-    ChildInfoIter removeStart = mChildren.begin() + newChildrenNum;
-
-    for(ChildInfoIter iter = removeStart; iter != mChildren.end(); ++iter)
-    {
-      Actor child = (*iter).mActor;
-      child.RemoveConstraints();
-      Self().Remove(child);
-    }
-
-    mChildren.erase( removeStart, mChildren.end() );
-  }
-
-  for(ChildInfoIter iter = mChildren.begin(); iter != mChildren.end(); ++iter)
-  {
-
-    if((*iter).mActor)
-    {
-      mClusterStyle.ApplyStyle( (*iter).mActor,
-                        (*iter).mPositionIndex,
-                        AlphaFunctions::EaseOut,
-                        CLUSTER_STYLE_CONSTRAINT_DURATION );
-    }
-  }
-
-  UpdateBackground(CLUSTER_STYLE_CONSTRAINT_DURATION);
-  UpdateTitle(CLUSTER_STYLE_CONSTRAINT_DURATION);
-}
-
-Toolkit::ClusterStyle Cluster::GetStyle() const
-{
-  return mClusterStyle;
-}
-
-unsigned int Cluster::GetExpandedCount() const
-{
-  return mExpandedCount;
-}
-
-unsigned int Cluster::GetTotalCount() const
-{
-  return mChildren.size();
-}
-
-void Cluster::UpdateBackground(float duration)
-{
-  if (mBackgroundImage)
-  {
-    mClusterStyle.ApplyStyleToBackground(mBackgroundImage, AlphaFunctions::EaseOut, duration);
-  }
-}
-
-void Cluster::UpdateTitle(float duration)
-{
-  if (mTitle)
-  {
-    mClusterStyle.ApplyStyleToTitle(mTitle, AlphaFunctions::EaseOut, duration);
-  }
-}
-
-void Cluster::DoExpandAction(const PropertyValueContainer& attributes)
-{
-  if(attributes.size() >= 1)
-  {
-    for(PropertyValueConstIter iter = attributes.begin(); iter != attributes.end(); ++iter)
-    {
-      const Property::Value& value = *iter;
-
-      DALI_ASSERT_ALWAYS(value.GetType() == Property::FLOAT);
-      unsigned int index = value.Get<float>();
-      ExpandChild( index );
-    }
-  }
-  else
-  {
-    ExpandAllChildren();
-  }
-}
-
-void Cluster::DoCollapseAction(const PropertyValueContainer& attributes)
-{
-  if(attributes.size() >= 1)
-  {
-    for(PropertyValueConstIter iter = attributes.begin(); iter != attributes.end(); ++iter)
-    {
-      const Property::Value& value = *iter;
-
-      DALI_ASSERT_ALWAYS(value.GetType() == Property::FLOAT);
-      unsigned int index = value.Get<float>();
-      CollapseChild( index, false );
-    }
-  }
-  else
-  {
-    CollapseAllChildren( false );
-  }
-}
-
-void Cluster::DoTransformAction(const PropertyValueContainer& attributes)
-{
-  DALI_ASSERT_ALWAYS(attributes.size() >= 2);
-
-  DALI_ASSERT_ALWAYS(attributes[0].GetType() == Property::FLOAT);
-  unsigned int index = attributes[0].Get<float>();
-  Vector3 position;
-  Vector3 scale(Vector3::ONE);
-  Quaternion rotation( Dali::ANGLE_0, Vector3::ZAXIS );
-
-  DALI_ASSERT_ALWAYS(attributes[1].GetType() == Property::VECTOR3);
-  attributes[1].Get(position);
-
-  if(attributes.size()>2)
-  {
-    attributes[2].Get(scale);
-  }
-
-  if(attributes.size()>3)
-  {
-    attributes[3].Get(rotation);
-  }
-
-  // wrap index around -1 => size - 1
-  index%= mChildren.size();
-
-  TransformChild(index, position, scale, rotation, AlphaFunctions::EaseOut, 0.5f);
-}
-
-void Cluster::OnControlChildRemove(Actor& child)
-{
-  child.RemoveConstraints();
-}
-
-bool Cluster::DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes)
-{
-  bool ret = false;
-
-  Dali::BaseHandle handle( object );
-
-  Toolkit::Cluster cluster = Toolkit::Cluster::DownCast( handle );
-
-  DALI_ASSERT_ALWAYS( cluster );
-
-  if( 0 == strcmp( actionName.c_str(), ACTION_EXPAND ) )
-  {
-    GetImpl( cluster ).DoExpandAction( attributes );
-    ret = true;
-  }
-  else if( 0 == strcmp( actionName.c_str(), ACTION_COLLAPSE ) )
-  {
-    GetImpl( cluster ).DoCollapseAction( attributes );
-    ret = true;
-  }
-  else if( 0 == strcmp( actionName.c_str(), ACTION_TRANSFORM ) )
-  {
-    GetImpl( cluster ).DoTransformAction( attributes );
-    ret = true;
-  }
-
-  return ret;
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/cluster/cluster-impl.h b/dali-toolkit/internal/controls/cluster/cluster-impl.h
deleted file mode 100644 (file)
index 17585fe..0000000
+++ /dev/null
@@ -1,325 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_CLUSTER_H__
-#define __DALI_TOOLKIT_INTERNAL_CLUSTER_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/ref-object.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/cluster/cluster.h>
-#include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
-#include <dali-toolkit/public-api/controls/control-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-class Cluster;
-
-typedef IntrusivePtr<Cluster> ClusterPtr;
-
-class ChildInfo
-{
-
-public:
-
-  ChildInfo()
-  : mExpanded(false)
-  {
-  }
-
-  ChildInfo(Actor actor, unsigned int positionIndex)
-  : mActor(actor),
-    mExpanded(false),
-    mPositionIndex(positionIndex)
-  {
-  }
-
-  Actor mActor;
-  bool mExpanded;
-  unsigned int mPositionIndex;
-};
-
-typedef std::vector<ChildInfo> ChildInfoContainer;
-typedef ChildInfoContainer::iterator ChildInfoIter;
-typedef ChildInfoContainer::const_iterator ChildInfoConstIter;
-
-/**
- * Cluster is a container of grouped actors positioned in different cluster styles.
- * Multiple cluster styles may be provided, to determine the position, size, rotation, scale, color and visibility
- * of the child actors in the cluster.
- */
-class Cluster : public Control
-{
-public:
-
-  /**
-   * Create a new Cluster.
-   * @param[in] style of the cluster
-   * @return A public handle to the newly allocated Cluster.
-   */
-  static Dali::Toolkit::Cluster New(Toolkit::ClusterStyle& style);
-
-  /**
-   * @copydoc Toolkit::Cluster::AddChild( Actor child )
-   */
-  void AddChild( Actor child );
-
-  /**
-   * @copydoc Toolkit::Cluster::AddChild( Actor child, unsigned int positionIndex )
-   */
-  void AddChild( Actor child, unsigned int positionIndex );
-
-  /**
-   * @copydoc Toolkit::Cluster::AddChildAt( Actor child, unsigned int index );
-   */
-  void AddChildAt( Actor child, unsigned int index );
-
-  /**
-   * @copydoc Toolkit::Cluster::AddChildAt( Actor child, unsigned int positionIndex, unsigned int index );
-   */
-  void AddChildAt( Actor child, unsigned int positionIndex, unsigned int index );
-
-  /**
-   * Adds a ChildInfo struct to the end of the children list.
-   * @param[in] childInfo the child info to that to children list.
-   */
-  void AddChildInfo( ChildInfo childInfo );
-
-  /**
-   * Adds a ChildInfo struct before the specified index.
-   * @param[in] childInfo the child info to that to children list.
-   * @param[in] index the index within the children list to insert
-   * ChildInfo
-   */
-  void AddChildInfoAt( ChildInfo childInfo, unsigned int index );
-
-  /**
-   * @copydoc Toolkit::Cluster::GetChildAt
-   */
-  Actor GetChildAt( unsigned int index );
-
-  /**
-   * @copydoc Toolkit::Cluster::RemoveChildAt
-   */
-  Actor RemoveChildAt( unsigned int index );
-
-  /**
-   * @copydoc Toolkit::Cluster::ExpandChild
-   */
-  void ExpandChild( unsigned int index );
-
-  /**
-   * @copydoc Toolkit::Cluster::ExpandAllChildren
-   */
-  void ExpandAllChildren();
-
-  /**
-   * @copydoc Toolkit::Cluster::CollapseChild
-   */
-  void CollapseChild( unsigned int index, bool front );
-
-  /**
-   * @copydoc Toolkit::Cluster::CollapseAllChildren
-   */
-  void CollapseAllChildren( bool front );
-
-  /**
-   * @copydoc Toolkit::Cluster::TransformChild
-   */
-  void TransformChild( unsigned int index, const Vector3& position, const Vector3& scale, const Quaternion& rotation, AlphaFunction alpha, const TimePeriod& period );
-
-  /**
-   * @copydoc Toolkit::Cluster::RestoreChild
-   */
-  void RestoreChild( unsigned int index, AlphaFunction alpha, const TimePeriod& period, bool front );
-
-  /**
-   * @copydoc Toolkit::Cluster::SetBackgroundImage
-   */
-  void SetBackgroundImage( Actor image );
-
-  /**
-   * @copydoc Toolkit::Cluster::SetTitle
-   */
-  void SetTitle( Actor text );
-
-  /**
-   * @copydoc Toolkit::Cluster::SetStyle
-   */
-  void SetStyle(Toolkit::ClusterStyle style);
-
-  /**
-   * @copydoc Toolkit::Cluster::GetStyle
-   */
-  Toolkit::ClusterStyle GetStyle() const;
-
-  /**
-   * @copydoc Toolkit::Cluster::GetExpandedCount
-   */
-  unsigned int GetExpandedCount() const;
-
-  /**
-   * @copydoc Toolkit::Cluster::GetTotalCount
-   */
-  unsigned int GetTotalCount() const;
-
-private:
-
-  ChildInfo GetChildInfoAt( unsigned int index );
-
-  void SetDepth( ChildInfo& childInfo, float depth );
-
-  /**
-   * Updates the style of the Background
-   * (occurs when either background changes or style changes)
-   * @param[in] duration apply duration for style
-   */
-  void UpdateBackground(float duration);
-
-  /**
-   * Updates the style of the Title
-   * (occurs when either background changes or style changes)
-   * @param[in] duration apply duration for style
-   */
-  void UpdateTitle(float duration);
-
-  /**
-   * Action: Expand
-   * Expands one or more actors.
-   *
-   * @param[in] attributes list of indices of actors to expand.
-   * (if no attributes specifies, then all actors expand)
-   */
-  void DoExpandAction(const PropertyValueContainer& attributes);
-
-  /**
-   * Action: Collapse
-   * Collapses one or more actors.
-   *
-   * @param[in] attributes list of indices of actors to collapse.
-   * (if no attributes specifies, then all actors collapse)
-   */
-  void DoCollapseAction(const PropertyValueContainer& attributes);
-
-  /**
-   * Action: Transform
-   * Transforms one actor (index) to a specified position (Vector3),
-   * scale (Vector3), and rotation (Quaternion).
-   *
-   * @param[in] attributes index and transform values.
-   */
-  void DoTransformAction(const PropertyValueContainer& attributes);
-
-private: // From Control
-  /**
-   * From Control; called shortly before a child is removed from the owning actor.
-   * @param[in] child The child being removed.Ptr
-   */
-  virtual void OnControlChildRemove(Actor& child);
-
-public:
-
-  /**
-   * Performs actions as requested using the action name.
-   * @param[in] object The object on which to perform the action.
-   * @param[in] actionName The action to perform.
-   * @param[in] attributes The attributes with which to perfrom this action.
-   * @return true if action has been accepted by this control
-   */
-  static bool DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes);
-
-private: // From Control
-
-  /**
-   * @copydoc Toolkit::Control::OnInitialize()
-   */
-  virtual void OnInitialize();
-
-  /**
-   *
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
-   */
-  virtual void OnControlSizeSet( const Vector3& targetSize );
-
-protected:
-
-  /**
-   * Construct a new Cluster.
-   * @param[in] style of the cluster
-   */
-  Cluster(Toolkit::ClusterStyle& style);
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~Cluster();
-
-private:
-
-  // Undefined
-  Cluster(const Cluster&);
-
-  // Undefined
-  Cluster& operator=(const Cluster& rhs);
-
-private:
-
-  Toolkit::ClusterStyle mClusterStyle;
-  ChildInfoContainer mChildren;
-  Vector3 mClusterSize;
-
-  Actor mBackgroundImage;           ///< Stores the background image.
-  Actor mTitle;                     ///< Stores the text title.
-  unsigned int mExpandedCount;      ///< A count of how many children have been expanded.
-
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Toolkit::Internal::Cluster& GetImpl(Toolkit::Cluster& cluster)
-{
-  DALI_ASSERT_ALWAYS(cluster);
-
-  Dali::RefObject& handle = cluster.GetImplementation();
-
-  return static_cast<Toolkit::Internal::Cluster&>(handle);
-}
-
-inline const Toolkit::Internal::Cluster& GetImpl(const Toolkit::Cluster& cluster)
-{
-  DALI_ASSERT_ALWAYS(cluster);
-
-  const Dali::RefObject& handle = cluster.GetImplementation();
-
-  return static_cast<const Toolkit::Internal::Cluster&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_CLUSTER_H__
diff --git a/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp b/dali-toolkit/internal/controls/cluster/cluster-style-impl.cpp
deleted file mode 100644 (file)
index 16dd5ea..0000000
+++ /dev/null
@@ -1,486 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali-toolkit/internal/controls/cluster/cluster-style-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/animation/animation.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/cluster/cluster.h>
-
-namespace Dali
-{
-
-namespace // unnamed namespace
-{
-// Cluster style one
-
-const unsigned int STYLE_1_CHILDREN_NUMBER = 8;
-
-const float STYLE_1_BACKGROUND_IMAGE_OFFSET_Z = 1.0f;
-
-const float STYLE_1_CHILD_OFFSET_Z = 2.0f;
-const float STYLE_1_CHILD_GAP_FACTOR = 0.03f;
-const float STYLE_1_CHILD_SIZE_FACTOR[] = { 0.4f, 0.15f, 0.25f, 0.15f, 0.4f, 0.15f, 0.25f, 0.15f };
-const Vector3 STYLE_1_CHILD_POSITION_FACTOR[] = { Vector3(0.5f - STYLE_1_CHILD_SIZE_FACTOR[0] - STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            0.5f - STYLE_1_CHILD_SIZE_FACTOR[0] - STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            STYLE_1_CHILD_OFFSET_Z),
-                                                    Vector3(0.5f + STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            0.5f - STYLE_1_CHILD_SIZE_FACTOR[1] - STYLE_1_CHILD_SIZE_FACTOR[2] - STYLE_1_CHILD_GAP_FACTOR * 1.5f,
-                                                            STYLE_1_CHILD_OFFSET_Z + 0.5f),
-                                                    Vector3(0.5f + STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            0.5f - STYLE_1_CHILD_SIZE_FACTOR[2] - STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            STYLE_1_CHILD_OFFSET_Z + 1.0f),
-                                                    Vector3(0.5f + STYLE_1_CHILD_SIZE_FACTOR[2] + STYLE_1_CHILD_GAP_FACTOR * 1.5f,
-                                                            0.5f - STYLE_1_CHILD_SIZE_FACTOR[3] - STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            STYLE_1_CHILD_OFFSET_Z + 1.5f),
-                                                    Vector3(0.5f + STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            0.5f + STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            STYLE_1_CHILD_OFFSET_Z + 2.0f),
-                                                    Vector3(0.5f - STYLE_1_CHILD_SIZE_FACTOR[5] - STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            0.5f + STYLE_1_CHILD_SIZE_FACTOR[6] + STYLE_1_CHILD_GAP_FACTOR * 1.5f,
-                                                            STYLE_1_CHILD_OFFSET_Z + 2.5f),
-                                                    Vector3(0.5f - STYLE_1_CHILD_SIZE_FACTOR[6] - STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            0.5f + STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            STYLE_1_CHILD_OFFSET_Z + 3.0f),
-                                                    Vector3(0.5f - STYLE_1_CHILD_SIZE_FACTOR[6] - STYLE_1_CHILD_SIZE_FACTOR[7] - STYLE_1_CHILD_GAP_FACTOR * 1.5f,
-                                                            0.5f + STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                            STYLE_1_CHILD_OFFSET_Z + 3.5f) };
-
-const Vector3 STYLE_1_TITLE_SIZE_FACTOR = Vector3(0.3f, 0.11f, 1.0f);
-const Vector3 STYLE_1_TITLE_POSITION_FACTOR = Vector3(0.5f - STYLE_1_CHILD_SIZE_FACTOR[0] - STYLE_1_CHILD_GAP_FACTOR * 0.5f,
-                                                        0.5f - STYLE_1_CHILD_SIZE_FACTOR[0] - STYLE_1_CHILD_GAP_FACTOR * 0.5f - STYLE_1_TITLE_SIZE_FACTOR.height + 0.02f,
-                                                        0.0f);
-const Vector3 STYLE_1_TITLE_POSITION_OFFSET = Vector3(0.0f, 0.0f, 8.0f);
-
-// Cluster style two
-
-const unsigned int STYLE_2_CHILDREN_NUMBER = 6;
-
-const float STYLE_2_BACKGROUND_IMAGE_OFFSET_Z = 1.0f;
-
-const float STYLE_2_CHILD_OFFSET_Z = 2.0f;
-const float STYLE_2_CHILD_GAP_FACTOR = 0.03f;
-const float STYLE_2_CHILD_SIZE_FACTOR[] = { 0.4f, 0.25f, 0.15f, 0.4f, 0.25f, 0.15f };
-const Vector3 STYLE_2_CHILD_POSITION_FACTOR[] = { Vector3(0.5f - STYLE_2_CHILD_SIZE_FACTOR[0] - STYLE_2_CHILD_GAP_FACTOR * 0.5f,
-                                                            0.5f - STYLE_2_CHILD_SIZE_FACTOR[0] * 0.75f,
-                                                            STYLE_2_CHILD_OFFSET_Z),
-                                                    Vector3(0.5f + STYLE_2_CHILD_GAP_FACTOR * 0.5f,
-                                                            0.5f - STYLE_2_CHILD_SIZE_FACTOR[1] - STYLE_2_CHILD_SIZE_FACTOR[3] * 0.25f - STYLE_2_CHILD_GAP_FACTOR,
-                                                            STYLE_2_CHILD_OFFSET_Z + 0.5f),
-                                                    Vector3(0.5f + STYLE_2_CHILD_SIZE_FACTOR[1] + STYLE_2_CHILD_GAP_FACTOR * 1.5f,
-                                                            0.5f - STYLE_2_CHILD_SIZE_FACTOR[2] - STYLE_2_CHILD_SIZE_FACTOR[3] * 0.25f - STYLE_2_CHILD_GAP_FACTOR,
-                                                            STYLE_2_CHILD_OFFSET_Z + 1.0f),
-                                                    Vector3(0.5f + STYLE_2_CHILD_GAP_FACTOR * 0.5f,
-                                                            0.5f - STYLE_2_CHILD_SIZE_FACTOR[3] * 0.25f,
-                                                            STYLE_2_CHILD_OFFSET_Z + 1.5f),
-                                                    Vector3(0.5f - STYLE_2_CHILD_SIZE_FACTOR[4] - STYLE_2_CHILD_GAP_FACTOR * 0.5f,
-                                                            0.5f + STYLE_2_CHILD_SIZE_FACTOR[0] * 0.25f + STYLE_2_CHILD_GAP_FACTOR,
-                                                            STYLE_2_CHILD_OFFSET_Z + 2.0f),
-                                                    Vector3(0.5f - STYLE_2_CHILD_SIZE_FACTOR[4] - STYLE_2_CHILD_SIZE_FACTOR[5] - STYLE_2_CHILD_GAP_FACTOR * 1.5f,
-                                                            0.5f + STYLE_2_CHILD_SIZE_FACTOR[0] * 0.25f + STYLE_2_CHILD_GAP_FACTOR,
-                                                            STYLE_2_CHILD_OFFSET_Z + 2.5f) };
-
-const Vector3 STYLE_2_TITLE_SIZE_FACTOR = Vector3(0.3f, 0.11f, 1.0f);
-const Vector3 STYLE_2_TITLE_POSITION_FACTOR = Vector3(0.5f - STYLE_2_CHILD_SIZE_FACTOR[0] - STYLE_2_CHILD_GAP_FACTOR * 0.5f,
-                                                        0.5f - STYLE_2_CHILD_SIZE_FACTOR[0] * 0.75f - STYLE_2_TITLE_SIZE_FACTOR.height + 0.02f,
-                                                        0.0f);
-const Vector3 STYLE_2_TITLE_POSITION_OFFSET = Vector3(0.0f, 0.0f, 8.0f);
-
-// Cluster style three
-
-const unsigned int STYLE_3_CHILDREN_NUMBER = 6;
-
-const Vector3 STYLE_3_TITLE_SIZE_FACTOR = Vector3(0.4f, 0.15f, 1.0f);
-
-const float STYLE_3_BACKGROUND_IMAGE_OFFSET_Z = 1.0f;
-
-const float STYLE_3_CHILD_OFFSET_Z = 2.0f;
-const float STYLE_3_CHILD_GAP_FACTOR = 0.03f;
-const float STYLE_3_CHILD_SIZE_FACTOR[] = { 0.4f, 0.4f, 0.15f, 0.25f, 0.25f, 0.15f };
-const float STYLE_3_CHILD_POSITION_OFFSET_Y = (1.0f - STYLE_3_CHILD_SIZE_FACTOR[0] - STYLE_3_CHILD_SIZE_FACTOR[3] - STYLE_3_CHILD_GAP_FACTOR - STYLE_3_TITLE_SIZE_FACTOR.height) * 0.5f;
-const Vector3 STYLE_3_CHILD_POSITION_FACTOR[] = { Vector3(0.5f - STYLE_3_CHILD_SIZE_FACTOR[0] - STYLE_3_CHILD_GAP_FACTOR * 0.5f,
-                                                              0.5f - STYLE_3_CHILD_SIZE_FACTOR[0] - STYLE_3_CHILD_GAP_FACTOR * 0.5f + STYLE_3_CHILD_POSITION_OFFSET_Y,
-                                                              STYLE_3_CHILD_OFFSET_Z),
-                                                      Vector3(0.5f + STYLE_3_CHILD_GAP_FACTOR * 0.5f,
-                                                              0.5f - STYLE_3_CHILD_SIZE_FACTOR[1] - STYLE_3_CHILD_GAP_FACTOR * 0.5f + STYLE_3_CHILD_POSITION_OFFSET_Y,
-                                                              STYLE_3_CHILD_OFFSET_Z + 0.5f),
-                                                      Vector3(0.5f + STYLE_3_CHILD_SIZE_FACTOR[3] + STYLE_3_CHILD_GAP_FACTOR * 1.5f,
-                                                              0.5f + STYLE_3_CHILD_GAP_FACTOR * 0.5f + STYLE_3_CHILD_POSITION_OFFSET_Y,
-                                                              STYLE_3_CHILD_OFFSET_Z + 1.0f),
-                                                      Vector3(0.5f + STYLE_3_CHILD_GAP_FACTOR * 0.5f,
-                                                              0.5f + STYLE_3_CHILD_GAP_FACTOR * 0.5f + STYLE_3_CHILD_POSITION_OFFSET_Y,
-                                                              STYLE_3_CHILD_OFFSET_Z + 1.5f),
-                                                      Vector3(0.5f - STYLE_3_CHILD_SIZE_FACTOR[4] - STYLE_3_CHILD_GAP_FACTOR * 0.5f,
-                                                              0.5f + STYLE_3_CHILD_GAP_FACTOR * 0.5f + STYLE_3_CHILD_POSITION_OFFSET_Y,
-                                                              STYLE_3_CHILD_OFFSET_Z + 2.0f),
-                                                      Vector3(0.5f - STYLE_3_CHILD_SIZE_FACTOR[4] - STYLE_3_CHILD_SIZE_FACTOR[5] - STYLE_3_CHILD_GAP_FACTOR * 1.5f,
-                                                              0.5f + STYLE_3_CHILD_GAP_FACTOR * 0.5f + STYLE_3_CHILD_POSITION_OFFSET_Y,
-                                                              STYLE_3_CHILD_OFFSET_Z + 2.5f) };
-
-const Vector3 STYLE_3_TITLE_POSITION_FACTOR = Vector3(0.5f - STYLE_3_CHILD_SIZE_FACTOR[0] - STYLE_3_CHILD_GAP_FACTOR * 0.5f,
-                                                          0.5f - STYLE_3_CHILD_SIZE_FACTOR[0] - STYLE_3_CHILD_GAP_FACTOR * 0.5f + STYLE_3_CHILD_POSITION_OFFSET_Y - STYLE_3_TITLE_SIZE_FACTOR.height + 0.02f,
-                                                          0.0f);
-const Vector3 STYLE_3_TITLE_POSITION_OFFSET = Vector3(0.0f, 0.0f, 8.0f);
-
-// Cluster style four
-
-const unsigned int STYLE_4_CHILDREN_NUMBER = 6;
-
-const float STYLE_4_BACKGROUND_IMAGE_OFFSET_Z = 1.0f;
-
-const float STYLE_4_CHILD_OFFSET_Z = 2.0f;
-const float STYLE_4_CHILD_GAP_FACTOR = 0.03f;
-const float STYLE_4_CHILD_SIZE_FACTOR[] = { 0.4f, 0.22f, 0.13f, 0.4f, 0.22f, 0.13f };
-const Vector3 STYLE_4_CHILD_POSITION_FACTOR[] = { Vector3(0.5f - STYLE_4_CHILD_SIZE_FACTOR[0] * 0.9f,
-                                                             0.5f - STYLE_4_CHILD_SIZE_FACTOR[0] - STYLE_4_CHILD_GAP_FACTOR * 0.5f,
-                                                             STYLE_4_CHILD_OFFSET_Z),
-                                                     Vector3(0.5f + STYLE_4_CHILD_SIZE_FACTOR[0] * 0.1f + STYLE_4_CHILD_GAP_FACTOR,
-                                                             0.5f - STYLE_4_CHILD_SIZE_FACTOR[1] - STYLE_4_CHILD_GAP_FACTOR * 0.5f,
-                                                             STYLE_4_CHILD_OFFSET_Z + 0.5f),
-                                                     Vector3(0.5f + STYLE_4_CHILD_SIZE_FACTOR[0] * 0.1f + STYLE_4_CHILD_SIZE_FACTOR[1] + STYLE_4_CHILD_GAP_FACTOR * 2.0f,
-                                                             0.5f - STYLE_4_CHILD_SIZE_FACTOR[2] - STYLE_4_CHILD_GAP_FACTOR * 0.5f,
-                                                             STYLE_4_CHILD_OFFSET_Z + 1.0f),
-                                                     Vector3(0.5f - STYLE_4_CHILD_SIZE_FACTOR[3] * 0.1f,
-                                                             0.5f + STYLE_4_CHILD_GAP_FACTOR * 0.5f,
-                                                             STYLE_4_CHILD_OFFSET_Z + 1.5f),
-                                                     Vector3(0.5f - STYLE_4_CHILD_SIZE_FACTOR[3] * 0.1f - STYLE_4_CHILD_SIZE_FACTOR[4] - STYLE_4_CHILD_GAP_FACTOR,
-                                                             0.5f + STYLE_4_CHILD_GAP_FACTOR * 0.5f,
-                                                             STYLE_4_CHILD_OFFSET_Z + 2.0f),
-                                                     Vector3(0.5f - STYLE_4_CHILD_SIZE_FACTOR[3] * 0.1f - STYLE_4_CHILD_SIZE_FACTOR[4] - STYLE_4_CHILD_SIZE_FACTOR[5] - STYLE_4_CHILD_GAP_FACTOR * 2.0f,
-                                                             0.5f + STYLE_4_CHILD_GAP_FACTOR * 0.5f,
-                                                             STYLE_4_CHILD_OFFSET_Z + 2.5f) };
-
-const Vector3 STYLE_4_TITLE_SIZE_FACTOR = Vector3(0.3f, 0.11f, 1.0f);
-const Vector3 STYLE_4_TITLE_POSITION_FACTOR = Vector3(0.5f - STYLE_4_CHILD_SIZE_FACTOR[0] * 0.9f,
-                                                         0.5f - STYLE_4_CHILD_SIZE_FACTOR[0] - STYLE_4_CHILD_GAP_FACTOR * 0.5f - STYLE_4_TITLE_SIZE_FACTOR.height + 0.02f,
-                                                         0.0f);
-const Vector3 STYLE_4_TITLE_POSITION_OFFSET = Vector3(0.0f, 0.0f, 8.0f);
-const unsigned int CLUSTER_RANDOM_SEED(0x17eac9f3);         ///< Random seed for cluster data.
-
-const int STYLE_RANDOM_CHILDREN_NUMBER = 16;
-
-Vector3 FirstOrderEquation( const Vector3& source, const Vector3& relative, const Vector3& offset = Vector3::ZERO  )
-{
-  return source * relative + offset;
-}
-
-// random data generator //////////////////////////////////////////////////////
-
-const unsigned int GEN_RAND_CONST = 0x15d9a373;
-
-unsigned int genRandom(unsigned int& seed, unsigned int offset)
-{
-  unsigned int shft = offset&31;
-
-  offset++;
-
-  seed^= (seed << (shft) | seed >> (32 - shft)) * (offset * GEN_RAND_CONST);
-
-  return seed;
-}
-
-float genRandomFloat(unsigned int& seed, unsigned int offset, float min, float max)
-{
-  const float f = static_cast<float>(genRandom(seed, offset)) / 0xffffffff;
-  return f * (max - min) + min;
-}
-
-} // unnamed namespace
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-// ClusterStyle ///////////////////////////////////////////////////////////////
-
-ClusterStyle::ClusterStyle()
-: mMaxChildren(0),
-  mTitlePositionRelative(Vector3::ONE),
-  mTitlePositionOffset(Vector3::ZERO),
-  mTitleSize(Vector3::ONE),
-  mBackgroundPositionRelative(Vector3::ONE),
-  mBackgroundPositionOffset(Vector3::ZERO),
-  mBackgroundSize(Vector3::ONE),
-  mClusterSize( Vector3::ZERO )
-{
-}
-
-ClusterStyle::~ClusterStyle()
-{
-
-}
-
-void ClusterStyle::SetMaximumNumberOfChildren(unsigned int maxChildren)
-{
-  mMaxChildren = maxChildren;
-}
-
-unsigned int ClusterStyle::GetMaximumNumberOfChildren() const
-{
-  return mMaxChildren;
-}
-
-void ClusterStyle::ApplyStyleToBackground(Actor background, AlphaFunction alpha, const TimePeriod& durationSeconds)
-{
-  Apply( background,
-         FirstOrderEquation( GetClusterSize(), mBackgroundPositionRelative, mBackgroundPositionOffset ),
-         FirstOrderEquation( GetClusterSize(), mBackgroundSize ),
-         alpha,
-         durationSeconds);
-}
-
-void ClusterStyle::ApplyStyleToTitle(Actor title, AlphaFunction alpha, const TimePeriod& durationSeconds)
-{
-  Apply( title,
-         FirstOrderEquation( GetClusterSize(), mTitlePositionRelative, mTitlePositionOffset ),
-         FirstOrderEquation( GetClusterSize(), mTitleSize ),
-         alpha,
-         durationSeconds);
-}
-
-void ClusterStyle::SetTitleProperties(const Vector3& relativePosition,
-                                      const Vector3& offsetPosition,
-                                      const Vector3& size)
-{
-  mTitlePositionRelative = relativePosition;
-  mTitlePositionOffset = offsetPosition;
-  mTitleSize = size;
-}
-
-void ClusterStyle::SetBackgroundProperties(const Vector3& relativePosition,
-                                           const Vector3& offsetPosition,
-                                           const Vector3& size)
-{
-  mBackgroundPositionRelative = relativePosition;
-  mBackgroundPositionOffset = offsetPosition;
-  mBackgroundSize = size;
-}
-
-void ClusterStyle::SetClusterSize( const Vector3& clusterSize )
-{
-  mClusterSize = clusterSize;
-}
-
-Vector3 ClusterStyle::GetClusterSize() const
-{
-  return mClusterSize;
-}
-
-void ClusterStyle::Apply( Actor actor,
-                          const Vector3& position,
-                          const Vector3& size,
-                          AlphaFunction alpha,
-                          const TimePeriod& durationSeconds)
-{
-  float animationDuration = durationSeconds.delaySeconds + durationSeconds.durationSeconds;
-  if( animationDuration > 0.f )
-  {
-    Animation animation = Animation::New(animationDuration);
-    animation.AnimateTo( Property( actor, Actor::Property::POSITION ), position, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
-    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
-    animation.Play();
-  }
-  else
-  {
-    actor.SetPosition( position );
-    actor.SetSize( size );
-  }
-}
-
-void ClusterStyle::Apply( Actor actor,
-                          const Vector3& position,
-                          const Vector3& size,
-                          const Quaternion& rotation,
-                          const Vector3& scale,
-                          AlphaFunction alpha,
-                          const TimePeriod& durationSeconds)
-{
-  float animationDuration = durationSeconds.delaySeconds + durationSeconds.durationSeconds;
-  if( animationDuration > 0.f )
-  {
-    Animation animation = Animation::New(animationDuration);
-    animation.AnimateTo( Property( actor, Actor::Property::POSITION ), position, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
-    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
-    animation.AnimateTo( Property( actor, Actor::Property::ORIENTATION ), rotation, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
-    animation.AnimateTo( Property( actor, Actor::Property::SCALE ), scale, alpha, TimePeriod( durationSeconds.delaySeconds, durationSeconds.durationSeconds ) );
-    animation.Play();
-  }
-  else
-  {
-    actor.SetPosition( position );
-    actor.SetSize( size );
-    actor.SetOrientation( rotation );
-    actor.SetScale( scale );
-  }
-}
-
-// ClusterStyleStandard ///////////////////////////////////////////////////////
-
-ClusterStylePtr ClusterStyleStandard::New(StyleType style)
-{
-  ClusterStylePtr impl( new ClusterStyleStandard(style) );
-
-  return impl;
-}
-
-ClusterStyleStandard::ClusterStyleStandard(StyleType style)
-: ClusterStyle(),
-  mSizes(NULL),
-  mPositions(NULL)
-{
-  switch(style)
-  {
-    case Toolkit::ClusterStyleStandard::ClusterStyle1:
-    {
-      SetMaximumNumberOfChildren(STYLE_1_CHILDREN_NUMBER);
-      SetSizes(STYLE_1_CHILD_SIZE_FACTOR);
-      SetPositions(STYLE_1_CHILD_POSITION_FACTOR);
-      SetTitleProperties(STYLE_1_TITLE_POSITION_FACTOR,
-                         STYLE_1_TITLE_POSITION_OFFSET,
-                         STYLE_1_TITLE_SIZE_FACTOR);
-      SetBackgroundProperties(Vector3::ZERO,
-                              Vector3(0.0f, 0.0f, STYLE_1_BACKGROUND_IMAGE_OFFSET_Z),
-                              Vector3::ONE);
-      break;
-    }
-    case Toolkit::ClusterStyleStandard::ClusterStyle2:
-    {
-      SetMaximumNumberOfChildren(STYLE_2_CHILDREN_NUMBER);
-      SetSizes(STYLE_2_CHILD_SIZE_FACTOR);
-      SetPositions(STYLE_2_CHILD_POSITION_FACTOR);
-      SetTitleProperties(STYLE_2_TITLE_POSITION_FACTOR,
-                         STYLE_2_TITLE_POSITION_OFFSET,
-                         STYLE_2_TITLE_SIZE_FACTOR);
-      SetBackgroundProperties(Vector3::ZERO,
-                              Vector3(0.0f, 0.0f, STYLE_2_BACKGROUND_IMAGE_OFFSET_Z),
-                              Vector3::ONE);
-      break;
-    }
-    case Toolkit::ClusterStyleStandard::ClusterStyle3:
-    {
-      SetMaximumNumberOfChildren(STYLE_3_CHILDREN_NUMBER);
-      SetSizes(STYLE_3_CHILD_SIZE_FACTOR);
-      SetPositions(STYLE_3_CHILD_POSITION_FACTOR);
-      SetTitleProperties(STYLE_3_TITLE_POSITION_FACTOR,
-                         STYLE_3_TITLE_POSITION_OFFSET,
-                         STYLE_3_TITLE_SIZE_FACTOR);
-      SetBackgroundProperties(Vector3::ZERO,
-                              Vector3(0.0f, 0.0f, STYLE_3_BACKGROUND_IMAGE_OFFSET_Z),
-                              Vector3::ONE);
-      break;
-    }
-    case Toolkit::ClusterStyleStandard::ClusterStyle4:
-    {
-      SetMaximumNumberOfChildren(STYLE_4_CHILDREN_NUMBER);
-      SetSizes(STYLE_4_CHILD_SIZE_FACTOR);
-      SetPositions(STYLE_4_CHILD_POSITION_FACTOR);
-      SetTitleProperties(STYLE_4_TITLE_POSITION_FACTOR,
-                         STYLE_4_TITLE_POSITION_OFFSET,
-                         STYLE_4_TITLE_SIZE_FACTOR);
-      SetBackgroundProperties(Vector3::ZERO,
-                              Vector3(0.0f, 0.0f, STYLE_4_BACKGROUND_IMAGE_OFFSET_Z),
-                              Vector3::ONE);
-      break;
-    }
-    default:
-    {
-      DALI_ASSERT_ALWAYS(false && "Invalid Style");
-      break;
-    }
-  } // end switch
-}
-
-void ClusterStyleStandard::SetSizes(const float *sizes)
-{
-  mSizes = sizes;
-}
-
-void ClusterStyleStandard::SetPositions(const Vector3 *positions)
-{
-  mPositions = positions;
-}
-
-void ClusterStyleStandard::ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds)
-{
-  if(mPositions)
-  {
-    const float& size = mSizes[index];
-    // counter top-left parent origin and top-left anchor point.
-    const Vector3 position = mPositions[index] - Vector3(0.5f, 0.5f, 0.0f) + Vector3(size, size, 0.0f) * 0.5f;
-
-    Apply( child,
-           FirstOrderEquation( GetClusterSize(), Vector3(position.x, position.y, 0.0f), Vector3(0.0f, 0.0f, position.z) ),
-           FirstOrderEquation( GetClusterSize(), Vector3::ONE * size ),
-           Quaternion(),
-           Vector3::ONE,
-           alpha,
-           durationSeconds);
-  }
-}
-
-// ClusterStyleRandom /////////////////////////////////////////////////////////
-
-ClusterStylePtr ClusterStyleRandom::New()
-{
-  ClusterStylePtr impl( new ClusterStyleRandom() );
-
-  return impl;
-}
-
-ClusterStyleRandom::ClusterStyleRandom()
-: ClusterStyle()
-{
-  SetMaximumNumberOfChildren(STYLE_RANDOM_CHILDREN_NUMBER);
-  SetTitleProperties(Vector3::ZERO,
-                     Vector3::ZERO,
-                     Vector3::ONE);
-  SetBackgroundProperties(Vector3::ZERO,
-                          Vector3(0.0f, 0.0f, 0.0f),
-                          Vector3::ONE);
-}
-
-void ClusterStyleRandom::ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds)
-{
-  unsigned int seed = CLUSTER_RANDOM_SEED;
-  const float size = 0.5f;
-  const float rotation = genRandomFloat(seed, index, -1.0f, 1.0f) * Math::PI * 0.1; // +/- 18 degrees
-  const Vector3 position(genRandomFloat(seed, index, -0.1f, 0.1f),
-                         genRandomFloat(seed, index, -0.1f, 0.1f),
-                         0.0f);
-
-  Property::Index depthProperty = child.GetPropertyIndex(Toolkit::Cluster::CLUSTER_ACTOR_DEPTH);
-  float depthPropertyValue = child.GetProperty<float>( depthProperty );
-
-  Apply( child,
-         FirstOrderEquation( GetClusterSize(), Vector3(position.x, position.y, 0.0f), Vector3(0.0f, 0.0f, depthPropertyValue) ),
-         FirstOrderEquation( GetClusterSize(), Vector3::ONE * size),
-         Quaternion( Radian( rotation ), Vector3::ZAXIS ),
-         Vector3::ONE,
-         alpha,
-         durationSeconds);
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/cluster/cluster-style-impl.h b/dali-toolkit/internal/controls/cluster/cluster-style-impl.h
deleted file mode 100644 (file)
index bf7b75d..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/ref-object.h>
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/math/vector3.h>
-#include <dali/public-api/object/base-object.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-class ClusterStyle;
-
-typedef IntrusivePtr<ClusterStyle>       ClusterStylePtr;
-
-/**
- * ClusterStyle internal implementation
- */
-class ClusterStyle : public Dali::BaseObject
-{
-public:
-
-  /**
-   * @copydoc Toolkit::ClusterStyle::GetMaximumNumberOfChildren
-   */
-  unsigned int GetMaximumNumberOfChildren() const;
-
-  /**
-   * @copydoc Toolkit::ClusterStyle::ApplyStyle
-   */
-  virtual void ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds) = 0;
-
-  /**
-   * @copydoc Toolkit::ClusterStyle::ApplyStyleToBackground
-   */
-  virtual void ApplyStyleToBackground(Actor background, AlphaFunction alpha, const TimePeriod& durationSeconds);
-
-  /**
-   * @copydoc Toolkit::ClusterStyle::ApplyStyleToTitle
-   */
-  virtual void ApplyStyleToTitle(Actor title, AlphaFunction alpha, const TimePeriod& durationSeconds);
-
-  /**
-    * Set the size of cluster
-    */
-  void SetClusterSize( const Vector3& clusterSize );
-
-protected:
-
-  /**
-   * Set the maximum number of children this Style can handle.
-   * @param[in] The maximum number of children.
-   */
-  void SetMaximumNumberOfChildren(unsigned int children);
-
-  /**
-   * Set the title properties
-   * @param[in] relativePosition Relative position of the title
-   * @param[in] offsetPosition Offset position of the title
-   * @param[in] size The size of the title
-   */
-  void SetTitleProperties(const Vector3& relativePosition,
-                          const Vector3& offsetPosition,
-                          const Vector3& size);
-
-  /**
-   * Set the background properties
-   * @param[in] relativePosition Relative position of the background
-   * @param[in] offsetPosition Offset position of the background
-   * @param[in] size The size of the title
-   */
-  void SetBackgroundProperties(const Vector3& relativePosition,
-                               const Vector3& offsetPosition,
-                               const Vector3& size);
-
-  /**
-   * Get the size of cluster.
-   * @return the cluster size
-   */
-   Vector3 GetClusterSize() const;
-
-   /**
-    * Apply the given position & size to the actor
-    * @param[in] position The target position
-    * @param[in] size The target size
-    * @param[in] size The size to resize to
-    * @param[in] alpha The alpha function to use.
-    * @param[in] durationSeconds The time period to apply this style.
-    */
-   void Apply( Actor actor,
-               const Vector3& position,
-               const Vector3& size,
-               AlphaFunction alpha,
-               const TimePeriod& durationSeconds);
-   /**
-    * Apply the given position & size to the actor
-    * @param[in] actor The actor to apply the changes
-    * @param[in] position The target position
-    * @param[in] size The target size
-    * @param[in] rotation The target Quaternion value
-    * @param[in] scale The target scale
-    * @param[in] alpha The alpha function to use.
-    * @param[in] durationSeconds The time period to apply this style.
-    */
-   void Apply( Actor actor,
-               const Vector3& position,
-               const Vector3& size,
-               const Quaternion& rotation,
-               const Vector3& scale,
-               AlphaFunction alpha,
-               const TimePeriod& durationSeconds);
-
-protected:
-
-  /**
-   * Protected constructor see ClusterStyle::New().
-   */
-  ClusterStyle();
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ClusterStyle();
-
-protected:
-
-  unsigned int mMaxChildren;                      ///< Maximum number of children that this style supports
-  Vector3 mTitlePositionRelative;                 ///< Title's position relative to size of cluster
-  Vector3 mTitlePositionOffset;                   ///< Title's position offset
-  Vector3 mTitleSize;                             ///< Title's size relative to size of cluster
-  Vector3 mBackgroundPositionRelative;            ///< Background's position relative to size of cluster
-  Vector3 mBackgroundPositionOffset;              ///< Background's position offset
-  Vector3 mBackgroundSize;                        ///< Background's size relative to size of cluster
-  Vector3 mClusterSize;                           ///< The size of cluster
-};
-
-/**
- * ClusterStyleStandard internal implementation
- */
-class ClusterStyleStandard : public ClusterStyle
-{
-public:
-
-  typedef Toolkit::ClusterStyleStandard::StyleType StyleType;
-
-public:
-
-  /**
-   * Create a new cluster style.
-   * @param[in] style The style type to create.
-   * @return A smart-pointer to the newly allocated ClusterStyle.
-   */
-  static ClusterStylePtr New(StyleType style);
-
-public:
-
-  /**
-   * @copydoc Toolkit::ClusterStyle::ApplyStyle
-   */
-  void ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds);
-
-private:
-
-  /**
-   * Set the relative sizes of the children
-   * @param[in] size The list of sizes for the children
-   */
-  void SetSizes(const float *sizes);
-
-  /**
-   * Set the relative positions of the children
-   * @param[in] positions The list of positions for the children
-   */
-  void SetPositions(const Vector3 *positions);
-
-protected:
-
-  /**
-   * Protected constructor see ClusterStyleRandom::New().
-   */
-  ClusterStyleStandard(StyleType style);
-
-private:
-
-  const float *mSizes;                            ///< List of sizes
-  const Vector3 *mPositions;                      ///< List of positions
-
-};
-
-/**
- * ClusterStyleRandom internal implementation
- */
-class ClusterStyleRandom : public ClusterStyle
-{
-public:
-
-  /**
-   * Create a new cluster style.
-   * @return A smart-pointer to the newly allocated ClusterStyle.
-   */
-  static ClusterStylePtr New();
-
-public:
-
-  /**
-   * @copydoc Toolkit::ClusterStyle::ApplyStyle
-   */
-  void ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds);
-
-protected:
-
-  /**
-   * Protected constructor see ClusterStyleRandom::New().
-   */
-  ClusterStyleRandom();
-
-private:
-
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::ClusterStyle& GetImpl(Toolkit::ClusterStyle& pub)
-{
-  DALI_ASSERT_ALWAYS(pub);
-
-  Dali::RefObject& handle = pub.GetBaseObject();
-
-  return static_cast<Internal::ClusterStyle&>(handle);
-}
-
-inline const Internal::ClusterStyle& GetImpl(const Toolkit::ClusterStyle& pub)
-{
-  DALI_ASSERT_ALWAYS(pub);
-
-  const Dali::RefObject& handle = pub.GetBaseObject();
-
-  return static_cast<const Internal::ClusterStyle&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
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 ae6c948..0a30fdd 100644 (file)
@@ -22,7 +22,7 @@
 #include <string>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
 #include <dali-toolkit/public-api/controls/navigation-frame/page.h>
 #include <dali-toolkit/public-api/controls/navigation-frame/navigation-bar-style.h>
index 26956dc..042fe35 100644 (file)
@@ -52,20 +52,20 @@ 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 ),
   mOrientationAnimationDuration( 1.0f ),
-  mOrientationAnimationAlphaFunc( AlphaFunctions::EaseOut ),
+  mOrientationAnimationAlphaFunc( AlphaFunction::EASE_OUT ),
   mItemPositionCoefficient( Vector3( 0.0f, 1.0f, 0.0f) ),
   mItemPushedSignal( ),
   mItemPoppedSignal( )
index 7ca18c9..82fb886 100644 (file)
@@ -40,16 +40,16 @@ BaseHandle Create()
 }
 
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Page, Toolkit::Control, Create )
+DALI_PROPERTY_REGISTRATION( Toolkit, Page, "title",     STRING, TITLE     )
+DALI_PROPERTY_REGISTRATION( Toolkit, Page, "sub-title", STRING, SUB_TITLE )
 DALI_TYPE_REGISTRATION_END()
 
 } // unnamed namespace
 
 Page::Page()
-: Control( CONTROL_BEHAVIOUR_NONE ),
+: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
   mTitle(""),
-  mSubTitle(""),
-  mPropertyTitle(Property::INVALID_INDEX),
-  mPropertySubTitle(Property::INVALID_INDEX)
+  mSubTitle("")
 {
 }
 
@@ -161,26 +161,54 @@ Toolkit::Popup Page::GetPopupMenu() const
   return mPopupMenu;
 }
 
-void Page::OnInitialize()
+void Page::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
 {
-  Actor self = Self();
+  Toolkit::Page page = Toolkit::Page::DownCast( Dali::BaseHandle( object ) );
 
-  mPropertyTitle = self.RegisterProperty( Dali::Toolkit::Page::PROPERTY_TITLE, "", Property::READ_WRITE );
-  mPropertySubTitle = self.RegisterProperty( Dali::Toolkit::Page::PROPERTY_SUB_TITLE, "", Property::READ_WRITE );
+  if ( page )
+  {
+    switch ( index )
+    {
+      case Toolkit::Page::Property::TITLE:
+      {
+        GetImpl( page ).SetTitle( value.Get< std::string >() );
+        break;
+      }
+
+      case Toolkit::Page::Property::SUB_TITLE:
+      {
+        GetImpl( page ).SetSubTitle( value.Get< std::string >() );
+        break;
+      }
+    }
+  }
 }
 
-void Page::OnPropertySet( Property::Index index, Property::Value propertyValue )
+Property::Value Page::GetProperty( BaseObject* object, Property::Index propertyIndex )
 {
-  if( index == mPropertyTitle )
-  {
-    std::string title( propertyValue.Get<std::string>() );
-    SetTitle(title);
-  }
-  else if( index == mPropertySubTitle )
+  Property::Value value;
+
+  Toolkit::Page page = Toolkit::Page::DownCast( Dali::BaseHandle( object ) );
+
+  if ( page )
   {
-    std::string subTitle( propertyValue.Get<std::string>() );
-    SetSubTitle(subTitle);
+    switch ( propertyIndex )
+    {
+      case Toolkit::Page::Property::TITLE:
+      {
+        value = GetImpl( page ).mTitle;
+        break;
+      }
+
+      case Toolkit::Page::Property::SUB_TITLE:
+      {
+        value = GetImpl( page ).mSubTitle;
+        break;
+      }
+    }
   }
+
+  return value;
 }
 
 } // namespace Internal
index 333aada..8d2711d 100644 (file)
@@ -116,17 +116,23 @@ public:
    */
   Toolkit::Popup GetPopupMenu() const;
 
-private: // From Control
+  // Properties
 
   /**
-   * @copydoc Toolkit::Control::OnInitialize()
+   * 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.
    */
-  virtual void OnInitialize();
+  static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
 
   /**
-   * @copydoc Dali::CustomActorImpl::OnPropertySet()
+   * Called to retrieve a property of an object of this type.
+   * @param[in] object The object whose property is to be retrieved.
+   * @param[in] index The property index.
+   * @return The current value of the property.
    */
-  virtual void OnPropertySet( Property::Index index, Property::Value propertyValue );
+  static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
 
 private:
 
@@ -144,9 +150,6 @@ private:
 
   ActorContainer                        mTitleBarControls;
   Toolkit::Page::ControlOnBarContainer  mToolBarControls;
-
-  Property::Index  mPropertyTitle;       ///< Property index for title.
-  Property::Index  mPropertySubTitle;    ///< Property index for sub title.
 };
 
 } // namespace Internal
index ef5c223..6e2ffc7 100644 (file)
@@ -153,8 +153,8 @@ void PageTurnPortraitView::OnPossibleOutwardsFlick( const Vector2& panPosition,
 
     animation.AnimateTo( Property( mTurnEffect[mIndex], mTurnEffect[mIndex].PageTurnEffect::GetCurrentCenterPropertyName() ),
                          originalCenter,
-                         AlphaFunctions::EaseOut, PAGE_TURN_OVER_ANIMATION_DURATION*0.75f );
-    animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), AngleAxis( Degree( 180.0f ), Vector3::YAXIS ) ,AlphaFunctions::EaseOut );
+                         AlphaFunction::EASE_OUT, TimePeriod(PAGE_TURN_OVER_ANIMATION_DURATION*0.75f) );
+    animation.AnimateBy( Property( actor, Actor::Property::ORIENTATION ), AngleAxis( Degree( 180.0f ), Vector3::YAXIS ) ,AlphaFunction::EASE_OUT );
     animation.Play();
     ImageActor::DownCast(actor).SetCullFace( CullBack );
     animation.FinishedSignal().Connect( this, &PageTurnPortraitView::OnTurnedOver );
index fc464ad..6ede563 100644 (file)
@@ -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 ),
@@ -953,9 +953,9 @@ void PageTurnView::PanFinished( const Vector2& gesturePosition, float gestureSpe
       float width = mPageSize.width*(1.f+PAGE_TURN_OVER_THRESHOLD_RATIO);
       Animation animation = Animation::New( std::max(0.1f,PAGE_TURN_OVER_ANIMATION_DURATION * (1.0f - mPanDisplacement / width)) );
       animation.AnimateTo( Property(self, mPropertyPanDisplacement[mIndex]),
-                           width,AlphaFunctions::EaseOutSine33);
+                           width,AlphaFunction::EASE_OUT_SINE);
       animation.AnimateTo( Property(self, mPropertyCurrentCenter[mIndex]),
-                           Vector2(-mPageSize.width, 0.5f*mPageSize.height), AlphaFunctions::EaseOutSine33);
+                           Vector2(-mPageSize.width, 0.5f*mPageSize.height), AlphaFunction::EASE_OUT_SINE);
       mAnimationActorPair[animation] = actor;
       mAnimationIndexPair[animation] = mIndex;
       animation.Play();
@@ -965,7 +965,7 @@ void PageTurnView::PanFinished( const Vector2& gesturePosition, float gestureSpe
     {
       Animation animation= Animation::New( PAGE_SLIDE_BACK_ANIMATION_DURATION * (mOriginalCenter.x - mCurrentCenter.x) / mPageSize.width / PAGE_TURN_OVER_THRESHOLD_RATIO );
       animation.AnimateTo( Property( mTurnEffect[mIndex], mTurnEffect[mIndex].PageTurnEffect::GetCurrentCenterPropertyName() ),
-                           mOriginalCenter, AlphaFunctions::Linear );
+                           mOriginalCenter, AlphaFunction::LINEAR );
       mAnimationActorPair[animation] = actor;
       mAnimationIndexPair[animation] = mIndex;
       animation.Play();
index a5aed9b..4ba3a03 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
@@ -526,13 +519,13 @@ void Popup::HandleStateChange( Toolkit::Popup::PopupState state, float duration
 
     if(mShowing)
     {
-      mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
-      mAnimation.AnimateTo( Property(self, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(duration * 0.5f, duration * 0.5f) );
+      mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunction::EASE_IN_OUT, TimePeriod(0.0f, duration * 0.5f) );
+      mAnimation.AnimateTo( Property(self, Actor::Property::SCALE), targetSize, AlphaFunction::EASE_IN_OUT, TimePeriod(duration * 0.5f, duration * 0.5f) );
     }
     else
     {
-      mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
-      mAnimation.AnimateTo( Property(self, Actor::Property::SCALE), targetSize, AlphaFunctions::EaseInOut, TimePeriod(0.0f, duration * 0.5f) );
+      mAnimation.AnimateTo( Property(mBacking, Actor::Property::COLOR_ALPHA), targetBackingAlpha, AlphaFunction::EASE_IN_OUT, TimePeriod(0.0f, duration * 0.5f) );
+      mAnimation.AnimateTo( Property(self, Actor::Property::SCALE), targetSize, AlphaFunction::EASE_IN_OUT, TimePeriod(0.0f, duration * 0.5f) );
     }
     mAnimation.Play();
     mAnimation.FinishedSignal().Connect(this, &Popup::OnStateAnimationFinished);
index f695c74..9c67474 100755 (executable)
@@ -131,11 +131,6 @@ public:
    */
   PopupStylePtr GetStyle() const;
 
-  /**
-   * @copydoc Toolkit::Popup::MarkDirtyForRelayout
-   */
-  void MarkDirtyForRelayout();
-
 protected:
 
   /**
index 0d7b833..2bcca2f 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()
 
@@ -252,7 +252,7 @@ void ScrollBar::Show()
   if(mIndicatorShowDuration > 0.0f)
   {
     mAnimation = Animation::New( mIndicatorShowDuration );
-    mAnimation.AnimateTo( Property( self, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::EaseIn );
+    mAnimation.AnimateTo( Property( self, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN );
     mAnimation.Play();
   }
   else
@@ -275,7 +275,7 @@ void ScrollBar::Hide()
   if(mIndicatorHideDuration > 0.0f)
   {
     mAnimation = Animation::New( mIndicatorHideDuration );
-    mAnimation.AnimateTo( Property( self, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunctions::EaseIn );
+    mAnimation.AnimateTo( Property( self, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunction::EASE_IN );
     mAnimation.Play();
   }
   else
index 4b7760e..933add8 100755 (executable)
@@ -534,8 +534,8 @@ void ScrollBarInternal::Show()
   }
 
   mAnimation = Animation::New( BAR_SHOW_TIME );
-  mAnimation.AnimateTo( Property( mSlider, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::EaseIn );
-  mAnimation.AnimateTo( Property( mSliderWrap, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunctions::EaseIn );
+  mAnimation.AnimateTo( Property( mSlider, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN );
+  mAnimation.AnimateTo( Property( mSliderWrap, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN );
   mAnimation.Play();
 
   DestructTimer();
@@ -551,8 +551,8 @@ void ScrollBarInternal::Hide()
   }
 
   mAnimation = Animation::New( BAR_HIDE_TIME );
-  mAnimation.AnimateTo( Property( mSlider, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunctions::EaseIn );
-  mAnimation.AnimateTo( Property( mSliderWrap, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunctions::EaseIn );
+  mAnimation.AnimateTo( Property( mSlider, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunction::EASE_IN );
+  mAnimation.AnimateTo( Property( mSliderWrap, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunction::EASE_IN );
   mAnimation.Play();
 }
 
index 0fd1b69..5261f60 100644 (file)
@@ -50,7 +50,7 @@ namespace Internal
 
  *  // start the bouncing animation
  *  Animation anim = Animation::New(2.0f);
- *  anim.AnimateTo( Property( bounceActor, bouncePropertyIndex ), 1.f, AlphaFunctions::Sin );
+ *  anim.AnimateTo( Property( bounceActor, bouncePropertyIndex ), 1.f, AlphaFunction::SIN );
  *  anim.Play();
  * @endcode
  *
index a3f222e..a9f342c 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 );
@@ -466,8 +461,8 @@ void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSiz
   {
     RemoveAnimation(mScrollAnimation);
     mScrollAnimation = Animation::New(durationSeconds);
-    mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunctions::EaseOut );
-    mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, targetSize), AlphaFunctions::EaseOut );
+    mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunction::EASE_OUT );
+    mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, targetSize), AlphaFunction::EASE_OUT );
     mScrollAnimation.FinishedSignal().Connect(this, &ItemView::OnLayoutActivationScrollFinished);
     mScrollAnimation.Play();
   }
@@ -1162,9 +1157,9 @@ void ItemView::OnPan( const PanGesture& gesture )
                                        , DEFAULT_MINIMUM_SWIPE_DURATION, DEFAULT_MAXIMUM_SWIPE_DURATION);
 
         mScrollAnimation = Animation::New(flickAnimationDuration);
-        mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunctions::EaseOut );
-        mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, layoutSize), AlphaFunctions::EaseOut );
-        mScrollAnimation.AnimateTo( Property(self, mPropertyScrollSpeed), 0.0f, AlphaFunctions::EaseOut );
+        mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunction::EASE_OUT );
+        mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, layoutSize), AlphaFunction::EASE_OUT );
+        mScrollAnimation.AnimateTo( Property(self, mPropertyScrollSpeed), 0.0f, AlphaFunction::EASE_OUT );
 
         mIsFlicking = true;
         // Check whether it has already scrolled to the end
@@ -1306,9 +1301,9 @@ Animation ItemView::DoAnchoring()
     float anchorPosition = mActiveLayout->GetClosestAnchorPosition( GetCurrentLayoutPosition(0) );
 
     anchoringAnimation = Animation::New(mAnchoringDuration);
-    anchoringAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), anchorPosition, AlphaFunctions::EaseOut );
-    anchoringAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(anchorPosition, self.GetCurrentSize()), AlphaFunctions::EaseOut );
-    anchoringAnimation.AnimateTo( Property(self, mPropertyScrollSpeed), 0.0f, AlphaFunctions::EaseOut );
+    anchoringAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), anchorPosition, AlphaFunction::EASE_OUT );
+    anchoringAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(anchorPosition, self.GetCurrentSize()), AlphaFunction::EASE_OUT );
+    anchoringAnimation.AnimateTo( Property(self, mPropertyScrollSpeed), 0.0f, AlphaFunction::EASE_OUT );
     if(!mIsFlicking)
     {
       AnimateScrollOvershoot(0.0f);
@@ -1368,8 +1363,8 @@ void ItemView::ScrollToItem(unsigned int itemId, float durationSeconds)
   {
     RemoveAnimation(mScrollAnimation);
     mScrollAnimation = Animation::New(durationSeconds);
-    mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunctions::EaseOut );
-    mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, layoutSize), AlphaFunctions::EaseOut );
+    mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunction::EASE_OUT );
+    mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, layoutSize), AlphaFunction::EASE_OUT );
     mScrollAnimation.FinishedSignal().Connect(this, &ItemView::OnScrollFinished);
     mScrollAnimation.Play();
   }
@@ -1485,8 +1480,8 @@ void ItemView::ScrollTo(const Vector3& position, float duration)
   {
     RemoveAnimation(mScrollAnimation);
     mScrollAnimation = Animation::New(duration);
-    mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunctions::EaseOut );
-    mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, layoutSize), AlphaFunctions::EaseOut );
+    mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunction::EASE_OUT );
+    mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, layoutSize), AlphaFunction::EASE_OUT );
     mScrollAnimation.FinishedSignal().Connect(this, &ItemView::OnScrollFinished);
     mScrollAnimation.Play();
   }
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 bf13222..ff6c6be 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/object/ref-object.h>
 
index ecfce55..3d9e2d3 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/object/ref-object.h>
 
index 8625530..80d4896 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/object/ref-object.h>
 
index 496d20f..043ca8d 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()
 
@@ -489,8 +489,8 @@ void InternalPositionDeltaConstraint( Vector3& current, const PropertyInputConta
  */
 struct InternalFinalConstraint
 {
-  InternalFinalConstraint(AlphaFunction functionX,
-                          AlphaFunction functionY)
+  InternalFinalConstraint(AlphaFunctionPrototype functionX,
+                          AlphaFunctionPrototype functionY)
   : mFunctionX(functionX),
     mFunctionY(functionY)
   {
@@ -507,8 +507,8 @@ struct InternalFinalConstraint
     current = inputs[0]->GetVector3() - offset;
   }
 
-  AlphaFunction mFunctionX;
-  AlphaFunction mFunctionY;
+  AlphaFunctionPrototype mFunctionX;
+  AlphaFunctionPrototype mFunctionY;
 };
 
 }
@@ -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),
@@ -543,13 +543,13 @@ ScrollView::ScrollView()
   mMaxOvershoot(Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT, Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT),
   mUserMaxOvershoot(Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT, Toolkit::ScrollView::DEFAULT_MAX_OVERSHOOT),
   mSnapOvershootDuration(Toolkit::ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION),
-  mSnapOvershootAlphaFunction(AlphaFunctions::EaseOut),
+  mSnapOvershootAlphaFunction(AlphaFunction::EASE_OUT),
   mSnapDuration(Toolkit::ScrollView::DEFAULT_SLOW_SNAP_ANIMATION_DURATION),
-  mSnapAlphaFunction(AlphaFunctions::EaseOut),
+  mSnapAlphaFunction(AlphaFunction::EASE_OUT),
   mMinFlickDistance(DEFAULT_MIN_FLICK_DISTANCE),
   mFlickSpeedThreshold(DEFAULT_MIN_FLICK_SPEED_THRESHOLD),
   mFlickDuration(Toolkit::ScrollView::DEFAULT_FAST_SNAP_ANIMATION_DURATION),
-  mFlickAlphaFunction(AlphaFunctions::EaseOut),
+  mFlickAlphaFunction(AlphaFunction::EASE_OUT),
   mAxisAutoLockGradient(Toolkit::ScrollView::DEFAULT_AXIS_AUTO_LOCK_GRADIENT),
   mFrictionCoefficient(Toolkit::ScrollView::DEFAULT_FRICTION_COEFFICIENT),
   mFlickSpeedCoefficient(Toolkit::ScrollView::DEFAULT_FLICK_SPEED_COEFFICIENT),
@@ -570,7 +570,6 @@ ScrollView::ScrollView()
   mCanScrollHorizontal(true),
   mCanScrollVertical(true)
 {
-  SetRequiresMouseWheelEvents(true);
 }
 
 void ScrollView::OnInitialize()
@@ -2091,7 +2090,7 @@ void ScrollView::AnimateInternalXTo( float position, float duration, AlphaFuncti
     mInternalXAnimation = Animation::New(duration);
     DALI_LOG_SCROLL_STATE("[0x%X], mInternalXAnimation[0x%X]", this, mInternalXAnimation.GetObjectPtr() );
     mInternalXAnimation.FinishedSignal().Connect(this, &ScrollView::OnScrollAnimationFinished);
-    mInternalXAnimation.AnimateTo( Property(self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, 0), position, alpha, duration);
+    mInternalXAnimation.AnimateTo( Property(self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, 0), position, alpha, TimePeriod(duration));
     mInternalXAnimation.Play();
 
     // erase current state flags
index 6f6cab6..b57ba4a 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/object/ref-object.h>
 
index b0c74c1..5e1c5bd 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/object/ref-object.h>
 
index 405223d..ec76adf 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/object/ref-object.h>
 
index 573b792..6a2a9e6 100644 (file)
@@ -260,7 +260,7 @@ void ScrollViewWobbleEffect::ContinueAnimation(float endTime)
   Actor scrollView = GetScrollView();
 
   mAnimation = Animation::New(WOBBLEEFFECT_ANIMATION_MAX_TIME);
-  mAnimation.AnimateTo( Property(scrollView, mPropertyTime), endTime, AlphaFunctions::Linear );
+  mAnimation.AnimateTo( Property(scrollView, mPropertyTime), endTime, AlphaFunction::LINEAR );
   mAnimation.FinishedSignal().Connect(this, &ScrollViewWobbleEffect::OnAnimationFinished);
   mAnimation.Play();
 
index e8bf3b5..8aafda9 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/actors/custom-actor.h>
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..d6e763d 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
+#include <cstring>
 #include <dali/public-api/adaptor-framework/key.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/resource-image.h>
@@ -79,22 +80,37 @@ 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, "max-length",                           INTEGER,   MAX_LENGTH                           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "exceed-policy",                        INTEGER,   EXCEED_POLICY                        )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "horizontal-alignment",                 STRING,    HORIZONTAL_ALIGNMENT                 )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "vertical-alignment",                   STRING,    VERTICAL_ALIGNMENT                   )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "text-color",                           VECTOR4,   TEXT_COLOR                           )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadow-offset",                        VECTOR2,   SHADOW_OFFSET                        )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "shadow-color",                         VECTOR4,   SHADOW_COLOR                         )
+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, "grab-handle-pressed-image",            VECTOR4,   GRAB_HANDLE_PRESSED_IMAGE            )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "scroll-threshold",                     FLOAT,     SCROLL_THRESHOLD                     )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "scroll-speed",                         FLOAT,     SCROLL_SPEED                         )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-left",          STRING,    SELECTION_HANDLE_IMAGE_LEFT          )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-image-right",         STRING,    SELECTION_HANDLE_IMAGE_RIGHT         )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-left",  STRING,    SELECTION_HANDLE_PRESSED_IMAGE_LEFT  )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-right", STRING,    SELECTION_HANDLE_PRESSED_IMAGE_RIGHT )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-highlight-color",            STRING,    SELECTION_HIGHLIGHT_COLOR            )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "decoration-bounding-box",              RECTANGLE, DECORATION_BOUNDING_BOX              )
+
+DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "max-length-reached", SIGNAL_MAX_LENGTH_REACHED )
+
 DALI_TYPE_REGISTRATION_END()
 
 } // namespace
@@ -185,7 +201,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         {
           float pointSize = value.Get< float >();
 
-          if( impl.mController->GetDefaultPointSize() != pointSize /*TODO - epsilon*/ )
+          if( !Equals( impl.mController->GetDefaultPointSize(), pointSize ) )
           {
             impl.mController->SetDefaultPointSize( pointSize );
             impl.RequestTextRelayout();
@@ -198,6 +214,73 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         impl.mExceedPolicy = value.Get< int >();
         break;
       }
+      case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT:
+      {
+        LayoutEngine& engine = impl.mController->GetLayoutEngine();
+        const LayoutEngine::HorizontalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::HorizontalAlignment >( value.Get< std::string >().c_str(),
+                                                                                                                                           HORIZONTAL_ALIGNMENT_STRING_TABLE,
+                                                                                                                                           HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT );
+
+        if( engine.GetHorizontalAlignment() != alignment )
+        {
+          engine.SetHorizontalAlignment( alignment );
+          impl.RequestTextRelayout();
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::VERTICAL_ALIGNMENT:
+      {
+        LayoutEngine& engine = impl.mController->GetLayoutEngine();
+        const LayoutEngine::VerticalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::VerticalAlignment >( value.Get< std::string >().c_str(),
+                                                                                                                                       VERTICAL_ALIGNMENT_STRING_TABLE,
+                                                                                                                                       VERTICAL_ALIGNMENT_STRING_TABLE_COUNT );
+
+        if( engine.GetVerticalAlignment() != alignment )
+        {
+          engine.SetVerticalAlignment( alignment );
+          impl.RequestTextRelayout();
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::TEXT_COLOR:
+      {
+        if ( impl.mController )
+        {
+          Vector4 textColor = value.Get< Vector4 >();
+          if ( impl.mController->GetTextColor() != textColor )
+          {
+            impl.mController->SetTextColor( textColor );
+            impl.RequestTextRelayout();
+          }
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SHADOW_OFFSET:
+      {
+        if( impl.mController )
+        {
+          Vector2 shadowOffset = value.Get< Vector2 >();
+          if ( impl.mController->GetShadowOffset() != shadowOffset )
+          {
+            impl.mController->SetShadowOffset( shadowOffset );
+            impl.RequestTextRelayout();
+          }
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SHADOW_COLOR:
+      {
+        if( impl.mController )
+        {
+          Vector4 shadowColor = value.Get< Vector4 >();
+          if ( impl.mController->GetShadowColor() != shadowColor )
+          {
+            impl.mController->SetShadowColor( shadowColor );
+            impl.RequestTextRelayout();
+          }
+        }
+        break;
+      }
       case Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR:
       {
         if( impl.mDecorator )
@@ -244,43 +327,103 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
 
         if( impl.mDecorator )
         {
-          impl.mDecorator->SetGrabHandleImage( image );
+          impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED, image );
         }
         break;
       }
-      case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX:
+      case Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE:
       {
+        ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+
         if( impl.mDecorator )
         {
-          impl.mDecorator->SetBoundingBox( value.Get< Rect<int> >() );
+          impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED, image );
         }
         break;
       }
-      case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT:
+      case Toolkit::TextField::Property::SCROLL_THRESHOLD:
       {
-        LayoutEngine& engine = impl.mController->GetLayoutEngine();
-        const LayoutEngine::HorizontalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::HorizontalAlignment >( value.Get< std::string >().c_str(),
-                                                                                                                                           HORIZONTAL_ALIGNMENT_STRING_TABLE,
-                                                                                                                                           HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT );
+        float threshold = value.Get< float >();
 
-        if( engine.GetHorizontalAlignment() != alignment )
+        if( impl.mDecorator )
         {
-          engine.SetHorizontalAlignment( alignment );
-          impl.RequestTextRelayout();
+          impl.mDecorator->SetScrollThreshold( threshold );
         }
         break;
       }
-      case Toolkit::TextField::Property::VERTICAL_ALIGNMENT:
+      case Toolkit::TextField::Property::SCROLL_SPEED:
       {
-        LayoutEngine& engine = impl.mController->GetLayoutEngine();
-        const LayoutEngine::VerticalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::VerticalAlignment >( value.Get< std::string >().c_str(),
-                                                                                                                                       VERTICAL_ALIGNMENT_STRING_TABLE,
-                                                                                                                                       VERTICAL_ALIGNMENT_STRING_TABLE_COUNT );
+        float speed = value.Get< float >();
 
-        if( engine.GetVerticalAlignment() != alignment )
+        if( impl.mDecorator )
         {
-          engine.SetVerticalAlignment( alignment );
-          impl.RequestTextRelayout();
+          impl.mDecorator->SetScrollSpeed( speed );
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT:
+      {
+        ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+
+        if( impl.mDecorator )
+        {
+          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT:
+      {
+        ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+
+        if( impl.mDecorator )
+        {
+          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
+      {
+        ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+
+        if( impl.mDecorator )
+        {
+          impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
+      {
+        ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+
+        if( impl.mDecorator )
+        {
+          impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR:
+      {
+        Vector4 color = value.Get< Vector4 >();
+
+        if( impl.mDecorator )
+        {
+          impl.mDecorator->SetHighlightColor( color );
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX:
+      {
+        if( impl.mDecorator )
+        {
+          impl.mDecorator->SetBoundingBox( value.Get< Rect<int> >() );
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::MAX_LENGTH:
+      {
+        if( impl.mController )
+        {
+          impl.mController->SetMaximumNumberOfCharacters( value.Get< int >() );
         }
         break;
       }
@@ -330,6 +473,50 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
         value = impl.mExceedPolicy;
         break;
       }
+      case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT:
+      {
+        if( impl.mController )
+        {
+          value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::HorizontalAlignment >( impl.mController->GetLayoutEngine().GetHorizontalAlignment(),
+                                                                                                                  HORIZONTAL_ALIGNMENT_STRING_TABLE,
+                                                                                                                  HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT ) );
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::VERTICAL_ALIGNMENT:
+      {
+        if( impl.mController )
+        {
+          value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::VerticalAlignment >( impl.mController->GetLayoutEngine().GetVerticalAlignment(),
+                                                                                                                  VERTICAL_ALIGNMENT_STRING_TABLE,
+                                                                                                                  VERTICAL_ALIGNMENT_STRING_TABLE_COUNT ) );
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::TEXT_COLOR:
+      {
+        if ( impl.mController )
+        {
+          value = impl.mController->GetTextColor();
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SHADOW_OFFSET:
+      {
+        if ( impl.mController )
+        {
+          value = impl.mController->GetShadowOffset();
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SHADOW_COLOR:
+      {
+        if ( impl.mController )
+        {
+          value = impl.mController->GetShadowColor();
+        }
+        break;
+      }
       case Toolkit::TextField::Property::PRIMARY_CURSOR_COLOR:
       {
         if( impl.mDecorator )
@@ -367,31 +554,115 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
         }
         break;
       }
-      case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX:
+      case Toolkit::TextField::Property::GRAB_HANDLE_IMAGE:
       {
         if( impl.mDecorator )
         {
-          value = impl.mDecorator->GetBoundingBox();
+          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED ) );
+          if( image )
+          {
+            value = image.GetUrl();
+          }
         }
         break;
       }
-      case Toolkit::TextField::Property::HORIZONTAL_ALIGNMENT:
+      case Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE:
       {
-        if( impl.mController )
+        if( impl.mDecorator )
         {
-          value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::HorizontalAlignment >( impl.mController->GetLayoutEngine().GetHorizontalAlignment(),
-                                                                                                                  HORIZONTAL_ALIGNMENT_STRING_TABLE,
-                                                                                                                  HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT ) );
+          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED ) );
+          if( image )
+          {
+            value = image.GetUrl();
+          }
         }
         break;
       }
-      case Toolkit::TextField::Property::VERTICAL_ALIGNMENT:
+      case Toolkit::TextField::Property::SCROLL_THRESHOLD:
+      {
+        if( impl.mDecorator )
+        {
+          value = impl.mDecorator->GetScrollThreshold();
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SCROLL_SPEED:
+      {
+        if( impl.mDecorator )
+        {
+          value = impl.mDecorator->GetScrollSpeed();
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT:
+      {
+        if( impl.mDecorator )
+        {
+          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED ) );
+          if( image )
+          {
+            value = image.GetUrl();
+          }
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT:
+      {
+        if( impl.mDecorator )
+        {
+          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED ) );
+          if( image )
+          {
+            value = image.GetUrl();
+          }
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
+      {
+        if( impl.mDecorator )
+        {
+          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED ) );
+          if( image )
+          {
+            value = image.GetUrl();
+          }
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
+      {
+        if( impl.mDecorator )
+        {
+          ResourceImage image = ResourceImage::DownCast( impl.mDecorator->GetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED ) );
+          if( image )
+          {
+            value = image.GetUrl();
+          }
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR:
+      {
+        if( impl.mDecorator )
+        {
+          value = impl.mDecorator->GetHighlightColor();
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::DECORATION_BOUNDING_BOX:
+      {
+        if( impl.mDecorator )
+        {
+          value = impl.mDecorator->GetBoundingBox();
+        }
+        break;
+      }
+      case Toolkit::TextField::Property::MAX_LENGTH:
       {
         if( impl.mController )
         {
-          value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::VerticalAlignment >( impl.mController->GetLayoutEngine().GetVerticalAlignment(),
-                                                                                                                  VERTICAL_ALIGNMENT_STRING_TABLE,
-                                                                                                                  VERTICAL_ALIGNMENT_STRING_TABLE_COUNT ) );
+          value = impl.mController->GetMaximumNumberOfCharacters();
         }
         break;
       }
@@ -401,6 +672,31 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
   return value;
 }
 
+bool TextField::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
+{
+  Dali::BaseHandle handle( object );
+
+  bool connected( true );
+  Toolkit::TextField field = Toolkit::TextField::DownCast( handle );
+
+  if( 0 == strcmp( signalName.c_str(), SIGNAL_MAX_LENGTH_REACHED ) )
+  {
+    field.MaxLengthReachedSignal().Connect( tracker, functor );
+  }
+  else
+  {
+    // signalName does not match any signal
+    connected = false;
+  }
+
+  return connected;
+}
+
+Toolkit::TextField::MaxLengthReachedSignalType& TextField::MaxLengthReachedSignal()
+{
+  return mMaxLengthReachedSignal;
+}
+
 void TextField::OnInitialize()
 {
   Actor self = Self();
@@ -450,14 +746,9 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
   if( mController->Relayout( size ) ||
       !mRenderer )
   {
-    const Vector2& scrollPosition = mController->GetScrollPosition();
-    const Vector2& alignmentOffset = mController->GetAlignmentOffset();
-
-    Vector2 offset = scrollPosition + alignmentOffset;
-
     if( mDecorator )
     {
-      mDecorator->Relayout( size, offset );
+      mDecorator->Relayout( size );
     }
 
     if( !mRenderer )
@@ -481,6 +772,8 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
     if( mRenderableActor )
     {
+      const Vector2 offset = mController->GetScrollPosition() + mController->GetAlignmentOffset();
+
       mRenderableActor.SetPosition( offset.x, offset.y );
 
       // Make sure the actor is parented correctly with/without clipping
@@ -514,6 +807,8 @@ void TextField::OnKeyInputFocusGained()
   }
 
   mController->KeyboardFocusGainEvent();
+
+  EmitKeyInputFocusSignal( true ); // Calls back into the Control hence done last.
 }
 
 void TextField::OnKeyInputFocusLost()
@@ -533,6 +828,8 @@ void TextField::OnKeyInputFocusLost()
   }
 
   mController->KeyboardFocusLostEvent();
+
+  EmitKeyInputFocusSignal( false ); // Calls back into the Control hence done last.
 }
 
 void TextField::OnTap( const TapGesture& gesture )
@@ -590,6 +887,12 @@ void TextField::RequestTextRelayout()
   RelayoutRequest();
 }
 
+void TextField::MaxLengthReached()
+{
+  Dali::Toolkit::TextField handle( GetOwner() );
+  mMaxLengthReachedSignal.Emit( handle );
+}
+
 void TextField::EnableClipping( bool clipping, const Vector2& size )
 {
   if( clipping )
index 5428275..63ded84 100644 (file)
@@ -71,6 +71,22 @@ public:
    */
   static Property::Value GetProperty( BaseObject* object, Property::Index index );
 
+  /**
+   * Connects a callback function with the object's signals.
+   * @param[in] object The object providing the signal.
+   * @param[in] tracker Used to disconnect the signal.
+   * @param[in] signalName The signal to connect to.
+   * @param[in] functor A newly allocated FunctorDelegate.
+   * @return True if the signal was connected.
+   * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
+   */
+  static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+
+  /**
+   * @copydoc TextField::MaxLengthReachedSignal()
+   */
+  Toolkit::TextField::MaxLengthReachedSignalType&  MaxLengthReachedSignal();
+
 private: // From Control
 
   /**
@@ -137,6 +153,11 @@ private: // From Control
    */
   virtual void RequestTextRelayout();
 
+  /**
+   * @copydoc Text::ControlInterface::MaxLengthReached()
+   */
+  virtual void MaxLengthReached();
+
 private: // Implementation
 
   /**
@@ -164,14 +185,15 @@ private: // Implementation
    */
   virtual ~TextField();
 
-private:
-
   // Undefined copy constructor and assignment operators
   TextField(const TextField&);
   TextField& operator=(const TextField& rhs);
 
 private: // Data
 
+  // Signals
+  Toolkit::TextField::MaxLengthReachedSignalType mMaxLengthReachedSignal;
+
   Text::ControllerPtr mController;
   Text::RendererPtr mRenderer;
   Text::DecoratorPtr mDecorator;
index afe74e2..3f0cf0d 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
@@ -172,7 +173,7 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr
         {
           float pointSize = value.Get< float >();
 
-          if( fabsf(impl.mController->GetDefaultPointSize() - pointSize) > Math::MACHINE_EPSILON_1 )
+          if( !Equals( impl.mController->GetDefaultPointSize(), pointSize ) )
           {
             impl.mController->SetDefaultPointSize( pointSize );
             impl.RequestTextRelayout();
@@ -480,6 +481,11 @@ void TextLabel::RequestTextRelayout()
   RelayoutRequest();
 }
 
+void TextLabel::MaxLengthReached()
+{
+  // Pure Virtual from TextController Interface, only needed when inputting text
+}
+
 TextLabel::TextLabel()
 : Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
   mRenderingBackend( DEFAULT_RENDERING_BACKEND )
index c69bd7c..54c2554 100644 (file)
@@ -97,6 +97,11 @@ private: // From Control
    */
   virtual void RequestTextRelayout();
 
+  /**
+   * @copydoc Text::ControlInterface::MaxLengthReached()
+   */
+  virtual void MaxLengthReached();
+
 private: // Implementation
 
   /**
index 7347fd3..d66a70a 100644 (file)
@@ -481,7 +481,6 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part )
    option.SetName( name );
    option.SetAnimationTime( 0.0f );
    option.SetSize( OPTION_ICON_SIZE );
-   option.SetRelayoutEnabled( false );
    //option.ClickedSignal().Connect( this, &TextInputPopup::OnButtonPressed );
 
    // 6. Set the normal option image.
@@ -529,7 +528,6 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part )
    Actor scrollview = Actor::New(); //todo make a scrollview
    scrollview.SetResizePolicy( ResizePolicy::FIT_TO_CHILDREN, Dimension::ALL_DIMENSIONS );
    scrollview.SetParentOrigin( ParentOrigin::CENTER );
-   scrollview.SetRelayoutEnabled( true );
 
    mTableOfButtons.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
    mTableOfButtons.SetFitHeight( 0 );
@@ -545,6 +543,7 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part )
  void TextSelectionPopup::AddPopupOptions( bool createTail, bool showIcons, bool showCaptions )
  {
    mContentSize = Vector2::ZERO;
+
    // Add the options into the buttons container.
 
    // 1. Determine how many buttons are active and should be added to container.
@@ -589,7 +588,7 @@ Dali::Image TextSelectionPopup::GetPopupImage( PopupParts part )
  }
 
 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 ),
index 0bcfe26..a04ff9a 100644 (file)
@@ -57,7 +57,7 @@ Toolkit::ToolBar ToolBar::New()
   // Create the implementation, temporarily owned on stack
   IntrusivePtr< ToolBar > internalToolBar = new ToolBar();
 
-  // Pass ownership to Toolkit::View
+  // Pass ownership to Toolkit::Toolbar
   Toolkit::ToolBar toolBar( *internalToolBar );
 
   // Second-phase init of the implementation
@@ -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 933943e..ebf0fcd 100644 (file)
@@ -52,17 +52,17 @@ public:
   static Toolkit::ToolBar New();
 
   /**
-   * @copydoc Dali::Toolkit::View::SetBackground()
+   * @copydoc Dali::Toolkit::ToolBar::SetBackground()
    */
   void SetBackground( Actor background );
 
   /**
-   * @copydoc Dali::Toolkit::View::AddControl()
+   * @copydoc Dali::Toolkit::ToolBar::AddControl()
    */
   void AddControl( Dali::Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding );
 
   /**
-   * @copydoc Dali::Toolkit::View::RemoveControl()
+   * @copydoc Dali::Toolkit::ToolBar::RemoveControl()
    */
   void RemoveControl( Dali::Actor control );
 
diff --git a/dali-toolkit/internal/controls/view/view-impl.cpp b/dali-toolkit/internal/controls/view/view-impl.cpp
deleted file mode 100644 (file)
index 0262bb7..0000000
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include "view-impl.h"
-
-// EXTERNAL INCLUDES
-#include <cstring> // for strcmp
-#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
-#include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace
-{
-
-BaseHandle Create()
-{
-  return Toolkit::View::New();
-}
-
-DALI_TYPE_REGISTRATION_BEGIN( Toolkit::View, Toolkit::Control, Create )
-
-DALI_SIGNAL_REGISTRATION( View, "orientation-animation-start", SIGNAL_ORIENTATION_ANIMATION_START )
-
-DALI_TYPE_REGISTRATION_END()
-
-const float ROTATION_ANIMATION_DURATION = 0.5f;
-
-}
-
-Toolkit::View View::New( bool fullscreen )
-{
-  // Create the implementation, temporarily owned by this handle on stack
-  IntrusivePtr< View > internalView = new View(fullscreen);
-
-  // Pass ownership to CustomActor handle
-  Toolkit::View view( *internalView );
-
-  // Second-phase init of the implementation
-  // This can only be done after the CustomActor connection has been made...
-  internalView->Initialize();
-
-  return view;
-}
-
-Layer View::GetContentLayer( unsigned int index ) const
-{
-  // Returns the layer stored in the layer map.
-  Layer layer;
-
-  LayerConstIt it = mContentLayers.find( index );
-
-  if( it != mContentLayers.end() )
-  {
-    layer = it->second;
-  }
-
-  return layer;
-}
-
-unsigned int View::AddContentLayer( Layer layer )
-{
-  // layer must exist.
-  DALI_ASSERT_ALWAYS( layer );
-
-  unsigned int index = mNextLayerIndex;
-  LayerIt it = FindLayer( layer );
-
-  if( it == mContentLayers.end() )
-  {
-    // Add layer to the custom actor.
-    Self().Add( layer );
-
-    // Store the layer.
-    mContentLayers[mNextLayerIndex] = layer;
-
-    // Increase the index.
-    ++mNextLayerIndex;
-  }
-
-  return index;
-}
-
-void View::RemoveContentLayer( Layer layer )
-{
-  // Check if layer was added in this view.
-  LayerIt it = FindLayer( layer );
-  if( it != mContentLayers.end() )
-  {
-    // Remove layer from custom actor.
-    Self().Remove( layer );
-
-    // Remove layer from layer map.
-    mContentLayers.erase( it );
-  }
-}
-
-Layer View::GetBackgroundLayer() const
-{
-  return mBackgroundLayer;
-}
-
-void View::SetBackground( ImageActor backgroundImage )
-{
-  // Create background layer if doesn't exist.
-
-  if( !mBackgroundLayer )
-  {
-    mBackgroundLayer = Layer::New();
-
-    mBackgroundLayer.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
-    mBackgroundLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-
-    // Add background layer to custom actor.
-    Self().Add( mBackgroundLayer );
-
-    // Drop the background layer
-
-    DALI_ASSERT_ALWAYS( mBackgroundLayer.OnStage() ); // We need to be on-stage to drop the layer
-    mBackgroundLayer.LowerToBottom();
-  }
-  else
-  {
-    // It removes the old background
-    if( 0 < mBackgroundLayer.GetChildCount() )
-    {
-      mBackgroundLayer.Remove( mBackgroundLayer.GetChildAt(0) );
-    }
-  }
-
-  backgroundImage.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
-  backgroundImage.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
-  backgroundImage.SetSizeScalePolicy( SizeScalePolicy::FILL_WITH_ASPECT_RATIO );
-  mBackgroundLayer.Add( backgroundImage );
-
-  RelayoutRequest();
-}
-
-void View::SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree 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 )
-{
-  Actor self = Self();
-
-  // Nothing to do if orientation doesn't really change.
-  if ( orientation.GetDegrees() == mOrientation || !mAutoRotateEnabled )
-  {
-    return;
-  }
-
-  mOrientation = orientation.GetDegrees();
-
-  // has parent so we expect it to be on stage
-  mRotateAnimation = Animation::New( ROTATION_ANIMATION_DURATION );
-  mRotateAnimation.AnimateTo( Property( self, Actor::Property::ORIENTATION ), Quaternion( Radian( -orientation.GetRadians() ), Vector3::ZAXIS ), AlphaFunctions::EaseOut );
-
-  // Resize the view
-  if( mFullScreen )
-  {
-    const Vector2& stageSize( Stage::GetCurrent().GetSize() );
-    const Vector3& currentSize( self.GetCurrentSize() );
-
-    float minSize = std::min( stageSize.width, stageSize.height );
-    float maxSize = std::max( stageSize.width, stageSize.height );
-
-    Vector3 targetSize;
-    View::Orientation viewOrientation = DegreeToViewOrientation( Degree( orientation.GetDegrees() ) );
-    switch( viewOrientation )
-    {
-      case View::PORTRAIT:          // Fallthrough
-      case View::PORTRAIT_INVERSE:
-        targetSize = Vector3( minSize, maxSize, currentSize.depth );
-        break;
-      case View::LANDSCAPE:         // Fallthrough
-      case View::LANDSCAPE_INVERSE:
-        targetSize = Vector3( maxSize, minSize, currentSize.depth );
-        break;
-      default:
-        DALI_ASSERT_ALWAYS( false );
-    }
-
-    // if we linearly resize from portrait to landscape halfway through the animation
-    // we get size which is square between the both. This would cause a square image to grow
-    // if it is fitted to be 100% of view size. Therefore we do a nonlinear size animation
-    // where we shrink faster
-    // which one grows
-    if( targetSize.width > currentSize.width )
-    {
-      // width grows, shrink height faster
-      Vector3 shrink( currentSize );shrink.height = targetSize.height;
-      mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), shrink, AlphaFunctions::EaseOut, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION * 0.5f ) );
-      mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), targetSize, AlphaFunctions::EaseIn, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION ) );
-    }
-    else
-    {
-      // height grows, shrink width faster
-      Vector3 shrink( currentSize );shrink.width = targetSize.width;
-      mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), shrink, AlphaFunctions::EaseOut, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION * 0.5f ) );
-      mRotateAnimation.AnimateTo( Property( self, Actor::Property::SIZE ), targetSize, AlphaFunctions::EaseIn, TimePeriod( 0.0f, ROTATION_ANIMATION_DURATION ) );
-    }
-  }
-
-  Toolkit::View handle( GetOwner() );
-  mOrientationAnimationStartedSignal.Emit( handle, mRotateAnimation, orientation );
-
-  mRotateAnimation.Play();
-}
-
-void View::SetAutoRotate( bool enabled )
-{
-  mAutoRotateEnabled = enabled;
-}
-
-Toolkit::View::OrientationAnimationStartedSignalType& View::OrientationAnimationStartedSignal()
-{
-  return mOrientationAnimationStartedSignal;
-}
-
-bool View::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
-{
-  Dali::BaseHandle handle( object );
-
-  bool connected( true );
-  Toolkit::View view = Toolkit::View::DownCast(handle);
-
-  if( 0 == strcmp( signalName.c_str(), SIGNAL_ORIENTATION_ANIMATION_START ) )
-  {
-    view.OrientationAnimationStartedSignal().Connect( tracker, functor );
-  }
-  else
-  {
-    // signalName does not match any signal
-    connected = false;
-  }
-
-  return connected;
-}
-
-View::View(bool fullscreen)
-: Control( CONTROL_BEHAVIOUR_NONE ),
-  mOrientation( -1 ),
-  mFullScreen(fullscreen),
-  mContentLayers(),
-  mNextLayerIndex( 0 ),
-  mOrientationFunction(),
-  mAutoRotateEnabled( true )
-{
-  mOrientationFunction[View::PORTRAIT] = 0.f;
-  mOrientationFunction[View::LANDSCAPE] = 90.f;
-  mOrientationFunction[View::PORTRAIT_INVERSE] = 180.f;
-  mOrientationFunction[View::LANDSCAPE_INVERSE] =  270.f;
-}
-
-View::~View()
-{
-}
-
-void View::OnInitialize()
-{
-  Self().SetAnchorPoint( AnchorPoint::CENTER );
-  Self().SetParentOrigin( ParentOrigin::CENTER );
-
-  if( mFullScreen )
-  {
-    Self().SetSize( Stage::GetCurrent().GetSize() );
-  }
-}
-
-View::Orientation View::DegreeToViewOrientation( Degree degree )
-{
-  View::Orientation orientation = PORTRAIT;
-
-  if( fabsf( mOrientationFunction[PORTRAIT] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT], degree.degree ) )
-  {
-    orientation =  PORTRAIT;
-  }
-  else if( fabsf( mOrientationFunction[LANDSCAPE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE], degree.degree ) )
-  {
-    orientation = LANDSCAPE;
-  }
-  else if( fabsf( mOrientationFunction[PORTRAIT_INVERSE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[PORTRAIT_INVERSE], degree.degree ) )
-  {
-    orientation = PORTRAIT_INVERSE;
-  }
-  else if( fabsf( mOrientationFunction[LANDSCAPE_INVERSE] - degree.degree ) <= GetRangedEpsilon( mOrientationFunction[LANDSCAPE_INVERSE], degree.degree ) )
-  {
-    orientation = LANDSCAPE_INVERSE;
-  }
-
-  return orientation;
-}
-
-View::LayerIt View::FindLayer( Layer layer )
-{
-  for( LayerIt it = mContentLayers.begin(); it != mContentLayers.end(); ++it )
-  {
-    if(layer == it->second)
-    {
-      return it;
-    }
-  }
-
-  return mContentLayers.end();
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/view/view-impl.h b/dali-toolkit/internal/controls/view/view-impl.h
deleted file mode 100644 (file)
index b956eae..0000000
+++ /dev/null
@@ -1,208 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_VIEW_H__
-#define __DALI_TOOLKIT_INTERNAL_VIEW_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/layer.h>
-#include <dali/public-api/animation/animation.h>
-#include <dali/public-api/common/map-wrapper.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/view/view.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-class View;
-
-namespace Internal
-{
-
-/**
- * View is a control to add layers and a background.
- * @see Dali::Toolkit::View for more details.
- */
-class View : public Control
-{
-private:
-  typedef std::map<unsigned int,Layer> LayerContainer;
-  typedef std::map<unsigned int,Layer>::iterator LayerIt;
-  typedef std::map<unsigned int,Layer>::const_iterator LayerConstIt;
-
-  /**
-   * Orientation declaration used internally to rotate the view.
-   * The angles associated with each enum value could be changed with the SetOrientationFunction method.
-   */
-  enum Orientation
-  {
-    PORTRAIT,          ///< portrait orientation.
-    LANDSCAPE,         ///< landscape orientation.
-    PORTRAIT_INVERSE,  ///< portrait inverse orientation.
-    LANDSCAPE_INVERSE  ///< landscape inverse orientation.
-  };
-
-public:
-
-  /**
-   * Create an initialized View.
-   * @param fullscreen If true, the view's size is going to be set with the Dali::Stage size. Otherwise a size must be provided.
-   * @return A handle to a newly allocated Dali resource.
-   */
-  static Toolkit::View New( bool fullscreen );
-
-  /**
-   * @copydoc Dali::Toolkit::View::GetContentLayer()
-   */
-  Layer GetContentLayer( unsigned int index ) const;
-
-  /**
-   * @copydoc Dali::Toolkit::View::AddContentLayer()
-   */
-  unsigned int AddContentLayer( Layer layer );
-
-  /**
-   * @copydoc Dali::Toolkit::View::RemoveContentLayer()
-   */
-  void RemoveContentLayer( Layer layer );
-
-  /**
-   * @copydoc Dali::Toolkit::View::GetBackgroundLayer()
-   */
-  Layer GetBackgroundLayer() const;
-
-  /**
-   * @copydoc Dali::Toolkit::View::SetBackground()
-   */
-  void SetBackground( ImageActor image );
-
-  /**
-   * @copydoc Dali::Toolkit::View::SetOrientationFunction()
-   */
-  void SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree landscapeInverse );
-
-  /**
-   * @copydoc Dali::Toolkit::View::OrientationChanged()
-   *
-   */
-  void OrientationChanged( Dali::Orientation orientation );
-
-  /**
-   * @copydoc Dali::Toolkit::View::SetAutoRotate()
-   *
-   */
-  void SetAutoRotate( bool enabled );
-
-public:
-
-  /**
-   * @copydoc Dali::Toolkit::View::AnimationStartedSignalOrientation()
-   */
-  Toolkit::View::OrientationAnimationStartedSignalType& OrientationAnimationStartedSignal();
-
-  /**
-   * Connects a callback function with the object's signals.
-   * @param[in] object The object providing the signal.
-   * @param[in] tracker Used to disconnect the signal.
-   * @param[in] signalName The signal to connect to.
-   * @param[in] functor A newly allocated FunctorDelegate.
-   * @return True if the signal was connected.
-   * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
-   */
-  static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
-
-private: // From Control
-
-  /**
-   * @copydoc Toolkit::Control::OnInitialize()
-   */
-  virtual void OnInitialize();
-
-private:
-
-
-  /**
-   * Constructor.
-   * It initializes View members.
-   * It initializes orientations as follows: portrait 0, landscape 90, portrait inverse 180, landscape inverse 270.
-   * @param fullscreen If true, the view's size is going to be set with the Dali::Stage size. Otherwise a size must be provided.
-   */
-  View(bool fullscreen);
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~View();
-
-  /**
-   * Return an orientation for the given angle in degrees.
-   * @param degree angle in degrees.
-   * @return An internal orientation.
-   */
-  View::Orientation DegreeToViewOrientation( Degree degree );
-
-  /**
-   * Find a layer in the layer container. Non const method
-   */
-  LayerIt FindLayer( Layer layer );
-
-private:
-  int            mOrientation;            ///< Stores the given orientation in degrees.
-  bool           mFullScreen;             ///< Stores if the view is fullscreen or not.
-  LayerContainer mContentLayers;          ///< Layer container.
-  unsigned int   mNextLayerIndex;         ///< Next index to be used when a layer is added.
-  Layer          mBackgroundLayer;        ///< The background layer.
-  Animation      mRotateAnimation;        ///< The animation which rotates the view (and all layers added to it)
-  float          mOrientationFunction[4]; ///< The orientation function used to transform from degrees to the internal orientation.
-  bool           mAutoRotateEnabled;      ///< Whether the view rotates if the OrientationChanged method is called.
-
-  Toolkit::View::OrientationAnimationStartedSignalType mOrientationAnimationStartedSignal;
-};
-
-} // namespace Internal
-
-
-// Helpers for public-api forwarding methods
-
-inline Toolkit::Internal::View& GetImpl( Toolkit::View& view )
-{
-  DALI_ASSERT_ALWAYS( view );
-
-  Dali::RefObject& handle = view.GetImplementation();
-
-  return static_cast<Toolkit::Internal::View&>( handle );
-}
-
-inline const Toolkit::Internal::View& GetImpl( const Toolkit::View& view )
-{
-  DALI_ASSERT_ALWAYS( view );
-
-  const Dali::RefObject& handle = view.GetImplementation();
-
-  return static_cast<const Toolkit::Internal::View&>( handle );
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_VIEW_H__
index 838592c..a6b0fb1 100644 (file)
@@ -19,8 +19,6 @@ toolkit_src_files = \
    $(toolkit_src_dir)/controls/buttons/check-box-button-impl.cpp \
    $(toolkit_src_dir)/controls/buttons/push-button-impl.cpp \
    $(toolkit_src_dir)/controls/buttons/radio-button-impl.cpp \
-   $(toolkit_src_dir)/controls/cluster/cluster-impl.cpp \
-   $(toolkit_src_dir)/controls/cluster/cluster-style-impl.cpp \
    $(toolkit_src_dir)/controls/effects-view/effects-view-impl.cpp \
    $(toolkit_src_dir)/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp \
    $(toolkit_src_dir)/controls/image-view/masked-image-view-impl.cpp \
@@ -62,7 +60,6 @@ toolkit_src_files = \
    $(toolkit_src_dir)/controls/text-controls/text-label-impl.cpp \
    $(toolkit_src_dir)/controls/text-controls/text-selection-popup-impl.cpp \
    $(toolkit_src_dir)/controls/tool-bar/tool-bar-impl.cpp \
-   $(toolkit_src_dir)/controls/view/view-impl.cpp \
    $(toolkit_src_dir)/focus-manager/focus-manager-impl.cpp \
    $(toolkit_src_dir)/focus-manager/keyboard-focus-manager-impl.cpp \
    $(toolkit_src_dir)/focus-manager/keyinput-focus-manager-impl.cpp \
@@ -82,6 +79,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 3a6d7da..871b3d6 100644 (file)
@@ -54,7 +54,6 @@
 
 #endif
 
-
 namespace Dali
 {
 namespace Internal
@@ -73,20 +72,28 @@ Integration::Log::Filter* gLogFilter( Integration::Log::Filter::New(Debug::NoLog
 namespace
 {
 
-const char* DEFAULT_GRAB_HANDLE_IMAGE( DALI_IMAGE_DIR "insertpoint-icon.png" );
+const char* DEFAULT_GRAB_HANDLE_IMAGE_RELEASED( DALI_IMAGE_DIR "insertpoint-icon.png" );
+const char* DEFAULT_GRAB_HANDLE_IMAGE_PRESSED( DALI_IMAGE_DIR "insertpoint-icon-pressed.png" );
 const char* DEFAULT_SELECTION_HANDLE_ONE( DALI_IMAGE_DIR "text-input-selection-handle-left.png" );
 const char* DEFAULT_SELECTION_HANDLE_TWO( DALI_IMAGE_DIR "text-input-selection-handle-right.png" );
-//const char* DEFAULT_SELECTION_HANDLE_ONE_PRESSED( DALI_IMAGE_DIR "text-input-selection-handle-left-press.png" );
-//const char* DEFAULT_SELECTION_HANDLE_TWO_PRESSED( DALI_IMAGE_DIR "text-input-selection-handle-right-press.png" );
 
 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 Dali::Vector4 LIGHT_BLUE( 0.07f, 0.41f, 0.59f, 1.0f ); // The text highlight color.
+
+const unsigned int CURSOR_BLINK_INTERVAL = 500u; // Cursor blink interval
+const float TO_MILLISECONDS = 1000.f;
+const float TO_SECONDS = 1.f / TO_MILLISECONDS;
 
 const float DISPLAYED_HIGHLIGHT_Z_OFFSET( -0.05f );
 
+const unsigned int SCROLL_TICK_INTERVAL = 50u;
+
+const float SCROLL_THRESHOLD = 10.f;
+const float SCROLL_SPEED = 300.f;
+const float SCROLL_DISTANCE = SCROLL_SPEED * SCROLL_TICK_INTERVAL * TO_SECONDS;
+
 /**
  * structure to hold coordinates of each quad, which will make up the mesh.
  */
@@ -151,69 +158,81 @@ namespace Text
 
 struct Decorator::Impl : public ConnectionTracker
 {
+  enum ScrollDirection
+  {
+    SCROLL_NONE,
+    SCROLL_RIGHT,
+    SCROLL_LEFT,
+    SCROLL_TOP,
+    SCROLL_BOTTOM
+  };
+
   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
+  struct HandleImpl
   {
-    SelectionHandleImpl()
-    : x(0.0f),
-      y(0.0f),
-      lineHeight(0.0f),
-      flipped(false)
+    HandleImpl()
+    : position(),
+      lineHeight( 0.0f ),
+      grabDisplacementX( 0.f ),
+      grabDisplacementY( 0.f ),
+      active( false ),
+      visible( false ),
+      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
+    float grabDisplacementX;
+    float grabDisplacementY;
+    bool active  : 1;
+    bool visible : 1;
+    bool flipped : 1;
   };
 
   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( LIGHT_BLUE ),
+    mActiveCursor( ACTIVE_CURSOR_NONE ),
     mCursorBlinkInterval( CURSOR_BLINK_INTERVAL ),
     mCursorBlinkDuration( 0.0f ),
+    mHandleScrolling( HANDLE_TYPE_COUNT ),
+    mScrollDirection( SCROLL_NONE ),
+    mScrollThreshold( SCROLL_THRESHOLD ),
+    mScrollSpeed( SCROLL_SPEED ),
+    mScrollDistance( SCROLL_DISTANCE ),
+    mActiveCopyPastePopup( false ),
     mCursorBlinkStatus( true ),
-    mGrabDisplacementX( 0.0f ),
-    mGrabDisplacementY( 0.0f ),
-    mHighlightColor( 0.07f, 0.41f, 0.59f, 1.0f ), // light blue
-    mBoundingBox( Rect<int>() )
+    mPrimaryCursorVisible( false ),
+    mSecondaryCursorVisible( false )
   {
   }
 
   /**
    * 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 )
+  void Relayout( const Vector2& size )
   {
     // TODO - Remove this if nothing is active
     CreateActiveLayer();
@@ -222,54 +241,100 @@ struct Decorator::Impl : public ConnectionTracker
     CreateCursors();
     if( mPrimaryCursor )
     {
-      mPrimaryCursor.SetPosition( mCursor[PRIMARY_CURSOR].x + scrollPosition.x,
-                                  mCursor[PRIMARY_CURSOR].y + scrollPosition.y );
-      mPrimaryCursor.SetSize( Size( 1.0f, mCursor[PRIMARY_CURSOR].cursorHeight ) );
+      const CursorImpl& cursor = mCursor[PRIMARY_CURSOR];
+      mPrimaryCursorVisible = ( cursor.position.x <= size.width ) && ( cursor.position.x >= 0.f );
+      if( mPrimaryCursorVisible )
+      {
+        Vector2 position = cursor.position;
+        if( GRAB_HANDLE == mHandleScrolling )
+        {
+          if( mScrollDirection == SCROLL_RIGHT )
+          {
+            position.x = 0.f;
+          }
+          else
+          {
+            position.x = size.width;
+          }
+        }
+
+        mPrimaryCursor.SetPosition( position.x,
+                                    position.y );
+        mPrimaryCursor.SetSize( Size( 1.0f, cursor.cursorHeight ) );
+      }
+      mPrimaryCursor.SetVisible( mPrimaryCursorVisible );
     }
     if( mSecondaryCursor )
     {
-      mSecondaryCursor.SetPosition( mCursor[SECONDARY_CURSOR].x + scrollPosition.x,
-                                    mCursor[SECONDARY_CURSOR].y + scrollPosition.y );
-      mSecondaryCursor.SetSize( Size( 1.0f, mCursor[SECONDARY_CURSOR].cursorHeight ) );
+      const CursorImpl& cursor = mCursor[SECONDARY_CURSOR];
+      mSecondaryCursorVisible = ( cursor.position.x <= size.width ) && ( cursor.position.x >= 0.f );
+      if( mSecondaryCursorVisible )
+      {
+        mSecondaryCursor.SetPosition( cursor.position.x,
+                                      cursor.position.y );
+        mSecondaryCursor.SetSize( Size( 1.0f, cursor.cursorHeight ) );
+      }
+      mSecondaryCursor.SetVisible( mSecondaryCursorVisible );
     }
 
     // Show or hide the grab handle
-    if( mActiveGrabHandle )
+    HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
+    if( grabHandle.active )
     {
-      SetupTouchEvents();
+      Vector2 position = grabHandle.position;
 
-      CreateGrabHandle();
+      if( GRAB_HANDLE == mHandleScrolling )
+      {
+        if( mScrollDirection == SCROLL_RIGHT )
+        {
+          position.x = 0.f;
+        }
+        else
+        {
+          position.x = size.width;
+        }
+      }
+
+      const bool isVisible = ( position.x <= size.width ) && ( position.x >= 0.f );
+
+      if( isVisible )
+      {
+        SetupTouchEvents();
+
+        CreateGrabHandle();
 
-      mGrabHandle.SetPosition( mCursor[PRIMARY_CURSOR].x + scrollPosition.x,
-                               mCursor[PRIMARY_CURSOR].lineHeight + scrollPosition.y );
+        grabHandle.actor.SetPosition( position.x,
+                                      position.y + grabHandle.lineHeight );
+      }
+      grabHandle.actor.SetVisible( isVisible );
     }
-    else if( mGrabHandle )
+    else if( grabHandle.actor )
     {
-      UnparentAndReset( mGrabHandle );
+      UnparentAndReset( grabHandle.actor );
     }
 
     // Show or hide the selection handles/highlight
-    if( mActiveSelection )
+    HandleImpl& primary = mHandle[ LEFT_SELECTION_HANDLE ];
+    HandleImpl& secondary = mHandle[ RIGHT_SELECTION_HANDLE ];
+    if( primary.active || secondary.active )
     {
       SetupTouchEvents();
 
       CreateSelectionHandles();
 
-      SelectionHandleImpl& primary = mSelectionHandle[ PRIMARY_SELECTION_HANDLE ];
-      primary.actor.SetPosition( primary.x + scrollPosition.x,
-                                 primary.lineHeight + scrollPosition.y );
+      primary.actor.SetPosition( primary.position.x,
+                                 primary.position.y + primary.lineHeight );
 
-      SelectionHandleImpl& secondary = mSelectionHandle[ SECONDARY_SELECTION_HANDLE ];
-      secondary.actor.SetPosition( secondary.x + scrollPosition.x,
-                                   secondary.lineHeight + scrollPosition.y );
+      secondary.actor.SetPosition( secondary.position.x,
+                                   secondary.position.y + secondary.lineHeight );
 
       CreateHighlight();
       UpdateHighlight();
     }
     else
     {
-      UnparentAndReset( mSelectionHandle[ PRIMARY_SELECTION_HANDLE ].actor );
-      UnparentAndReset( mSelectionHandle[ SECONDARY_SELECTION_HANDLE ].actor );
+      UnparentAndReset( primary.actor );
+      UnparentAndReset( secondary.actor );
       UnparentAndReset( mHighlightMeshActor );
     }
 
@@ -295,13 +360,24 @@ struct Decorator::Impl : public ConnectionTracker
     }
   }
 
+  void UpdatePositions( const Vector2& scrollOffset )
+  {
+    mCursor[PRIMARY_CURSOR].position += scrollOffset;
+    mCursor[SECONDARY_CURSOR].position += scrollOffset;
+    mHandle[ GRAB_HANDLE ].position += scrollOffset;
+    mHandle[ LEFT_SELECTION_HANDLE ].position += scrollOffset;
+    mHandle[ RIGHT_SELECTION_HANDLE ].position += scrollOffset;
+
+    // TODO Highlight box??
+  }
+
   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].x, mCursor[PRIMARY_CURSOR].y -100.0f , 0.0f); //todo 100 to be an offset Property
+    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 );
 
@@ -312,12 +388,11 @@ struct Decorator::Impl : public ConnectionTracker
     mCopyPastePopup.SetPosition( popupPosition ); //todo grabhandle(cursor) or selection handle positions to be used
   }
 
-  void CreateCursor( ImageActor& cursor )
+  void CreateCursor( ImageActor& cursor, const Vector4& color )
   {
-    cursor = CreateSolidColorActor( Color::WHITE );
+    cursor = CreateSolidColorActor( color );
     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
@@ -336,11 +411,11 @@ struct Decorator::Impl : public ConnectionTracker
       {
         if ( !mPrimaryCursor )
         {
-          CreateCursor( mPrimaryCursor );
+          CreateCursor( mPrimaryCursor, mCursor[PRIMARY_CURSOR].color );
 #ifdef DECORATOR_DEBUG
           mPrimaryCursor.SetName( "PrimaryCursorActor" );
 #endif
-          mActiveLayer.Add( mPrimaryCursor);
+          mActiveLayer.Add( mPrimaryCursor );
         }
       }
 
@@ -348,11 +423,11 @@ struct Decorator::Impl : public ConnectionTracker
       {
         if ( !mSecondaryCursor )
         {
-          CreateCursor( mSecondaryCursor );
+          CreateCursor( mSecondaryCursor, mCursor[SECONDARY_CURSOR].color );
 #ifdef DECORATOR_DEBUG
           mSecondaryCursor.SetName( "SecondaryCursorActor" );
 #endif
-          mActiveLayer.Add( mSecondaryCursor);
+          mActiveLayer.Add( mSecondaryCursor );
         }
       }
       else
@@ -367,11 +442,11 @@ struct Decorator::Impl : public ConnectionTracker
     // Cursor blinking
     if ( mPrimaryCursor )
     {
-      mPrimaryCursor.SetVisible( mCursorBlinkStatus );
+      mPrimaryCursor.SetVisible( mPrimaryCursorVisible && mCursorBlinkStatus );
     }
     if ( mSecondaryCursor )
     {
-      mSecondaryCursor.SetVisible( mCursorBlinkStatus );
+      mSecondaryCursor.SetVisible( mSecondaryCursorVisible && mCursorBlinkStatus );
     }
 
     mCursorBlinkStatus = !mCursorBlinkStatus;
@@ -417,59 +492,62 @@ struct Decorator::Impl : public ConnectionTracker
 
   void CreateGrabHandle()
   {
-    if( !mGrabHandle )
+    HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
+    if( !grabHandle.actor )
     {
-      if ( !mGrabHandleImage )
+      if( !mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] )
+      {
+        mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] = ResourceImage::New( DEFAULT_GRAB_HANDLE_IMAGE_RELEASED );
+      }
+      if( !mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_PRESSED] )
       {
-        mGrabHandleImage = ResourceImage::New( DEFAULT_GRAB_HANDLE_IMAGE );
+        mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_PRESSED] = ResourceImage::New( DEFAULT_GRAB_HANDLE_IMAGE_PRESSED );
       }
 
-      mGrabHandle = ImageActor::New( mGrabHandleImage );
-      mGrabHandle.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-      mGrabHandle.SetDrawMode( DrawMode::OVERLAY );
+      grabHandle.actor = ImageActor::New( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] );
+      grabHandle.actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+      grabHandle.actor.SetDrawMode( DrawMode::OVERLAY );
       // Area that Grab handle responds to, larger than actual handle so easier to move
 #ifdef DECORATOR_DEBUG
-      mGrabHandle.SetName( "GrabHandleActor" );
+      grabHandle.actor.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" );
+        grabHandle.grabArea = Toolkit::CreateSolidColorActor( Vector4(0.0f, 0.0f, 0.0f, 0.0f), true, Color::RED, 1 );
+        grabHandle.grabArea.SetName( "GrabArea" );
       }
       else
       {
-        mGrabArea = Actor::New();
-        mGrabArea.SetRelayoutEnabled( true );
-        mGrabArea.SetName( "GrabArea" );
+        grabHandle.grabArea = Actor::New();
+        grabHandle.grabArea.SetName( "GrabArea" );
       }
 #else
-      mGrabArea = Actor::New();
-      mGrabArea.SetRelayoutEnabled( true );
+      grabHandle.grabArea = Actor::New();
 #endif
 
-      mGrabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
-      mGrabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
-      mGrabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
-      mGrabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
-      mGrabHandle.Add( mGrabArea );
+      grabHandle.grabArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
+      grabHandle.grabArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+      grabHandle.grabArea.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
+      grabHandle.grabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
+      grabHandle.actor.Add( grabHandle.grabArea );
 
-      mTapDetector.Attach( mGrabArea );
-      mPanGestureDetector.Attach( mGrabArea );
+      mTapDetector.Attach( grabHandle.grabArea );
+      mPanGestureDetector.Attach( grabHandle.grabArea );
 
-      mActiveLayer.Add( mGrabHandle );
+      mActiveLayer.Add( grabHandle.actor );
     }
   }
 
   void CreateSelectionHandles()
   {
-    SelectionHandleImpl& primary = mSelectionHandle[ PRIMARY_SELECTION_HANDLE ];
-    if ( !primary.actor )
+    HandleImpl& primary = mHandle[ LEFT_SELECTION_HANDLE ];
+    if( !primary.actor )
     {
-      if ( !primary.releasedImage )
+      if( !mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
       {
-        primary.releasedImage = ResourceImage::New( DEFAULT_SELECTION_HANDLE_ONE );
+        mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] = ResourceImage::New( DEFAULT_SELECTION_HANDLE_ONE );
       }
 
-      primary.actor = ImageActor::New( primary.releasedImage );
+      primary.actor = ImageActor::New( mHandleImages[LEFT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
 #ifdef DECORATOR_DEBUG
       primary.actor.SetName("SelectionHandleOne");
 #endif
@@ -478,7 +556,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
@@ -494,15 +571,15 @@ struct Decorator::Impl : public ConnectionTracker
       mActiveLayer.Add( primary.actor );
     }
 
-    SelectionHandleImpl& secondary = mSelectionHandle[ SECONDARY_SELECTION_HANDLE ];
-    if ( !secondary.actor )
+    HandleImpl& secondary = mHandle[ RIGHT_SELECTION_HANDLE ];
+    if( !secondary.actor )
     {
-      if ( !secondary.releasedImage )
+      if( !mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] )
       {
-        secondary.releasedImage = ResourceImage::New( DEFAULT_SELECTION_HANDLE_TWO );
+        mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] = ResourceImage::New( DEFAULT_SELECTION_HANDLE_TWO );
       }
 
-      secondary.actor = ImageActor::New( secondary.releasedImage );
+      secondary.actor = ImageActor::New( mHandleImages[RIGHT_SELECTION_HANDLE][HANDLE_IMAGE_RELEASED] );
 #ifdef DECORATOR_DEBUG
       secondary.actor.SetName("SelectionHandleTwo");
 #endif
@@ -511,7 +588,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
@@ -526,8 +602,6 @@ struct Decorator::Impl : public ConnectionTracker
       secondary.actor.Add( secondary.grabArea );
       mActiveLayer.Add( secondary.actor );
     }
-
-    //SetUpHandlePropertyNotifications(); TODO
   }
 
   void CreateHighlight()
@@ -648,37 +722,85 @@ struct Decorator::Impl : public ConnectionTracker
 
   void OnTap( Actor actor, const TapGesture& tap )
   {
-    if( actor == mGrabHandle )
+    if( actor == mHandle[GRAB_HANDLE].actor )
     {
       // TODO
     }
   }
 
-  void OnPan( Actor actor, const PanGesture& gesture )
+  void DoPan( HandleImpl& handle, HandleType type, const PanGesture& gesture )
   {
-    if( actor == mGrabArea )
+    if( Gesture::Started == gesture.state )
     {
-      if( Gesture::Started == gesture.state )
+      handle.grabDisplacementX = handle.grabDisplacementY = 0;
+      if( mHandleImages[type][HANDLE_IMAGE_PRESSED] )
       {
-        mGrabDisplacementX = mGrabDisplacementY = 0;
+        handle.actor.SetImage( mHandleImages[type][HANDLE_IMAGE_PRESSED] );
       }
+    }
 
-      mGrabDisplacementX += gesture.displacement.x;
-      mGrabDisplacementY += gesture.displacement.y;
+    handle.grabDisplacementX += gesture.displacement.x;
+    handle.grabDisplacementY += 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 = handle.position.x + handle.grabDisplacementX;
+    const float y = handle.position.y + handle.lineHeight*0.5f + handle.grabDisplacementY;
 
-      if( Gesture::Started    == gesture.state ||
-          Gesture::Continuing == gesture.state )
+    if( Gesture::Started    == gesture.state ||
+        Gesture::Continuing == gesture.state )
+    {
+      if( x < mScrollThreshold )
+      {
+        mScrollDirection = SCROLL_RIGHT;
+        mHandleScrolling = type;
+        StartScrollTimer();
+      }
+      else if( x > mTextControlParent.GetControlSize().width - mScrollThreshold )
+      {
+        mScrollDirection = SCROLL_LEFT;
+        mHandleScrolling = type;
+        StartScrollTimer();
+      }
+      else
+      {
+        mHandleScrolling = HANDLE_TYPE_COUNT;
+        StopScrollTimer();
+        mObserver.HandleEvent( type, HANDLE_PRESSED, x, y );
+      }
+    }
+    else if( Gesture::Finished  == gesture.state ||
+             Gesture::Cancelled == gesture.state )
+    {
+      if( mScrollTimer && mScrollTimer.IsRunning() )
       {
-        mObserver.GrabHandleEvent( GRAB_HANDLE_PRESSED, x, y );
+        mHandleScrolling = HANDLE_TYPE_COUNT;
+        StopScrollTimer();
+        mObserver.HandleEvent( type, HANDLE_STOP_SCROLLING, x, y );
       }
-      else if( Gesture::Finished  == gesture.state ||
-               Gesture::Cancelled == gesture.state )
+      else
       {
-        mObserver.GrabHandleEvent( GRAB_HANDLE_RELEASED, x, y );
+        mObserver.HandleEvent( type, HANDLE_RELEASED, x, y );
       }
+      handle.actor.SetImage( mHandleImages[type][HANDLE_IMAGE_RELEASED] );
+    }
+  }
+
+  void OnPan( Actor actor, const PanGesture& gesture )
+  {
+    HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
+    HandleImpl& primarySelectionHandle = mHandle[LEFT_SELECTION_HANDLE];
+    HandleImpl& secondarySelectionHandle = mHandle[RIGHT_SELECTION_HANDLE];
+
+    if( actor == grabHandle.grabArea )
+    {
+      DoPan( grabHandle, GRAB_HANDLE, gesture );
+    }
+    else if( actor == primarySelectionHandle.grabArea )
+    {
+      DoPan( primarySelectionHandle, LEFT_SELECTION_HANDLE, gesture );
+    }
+    else if( actor == secondarySelectionHandle.grabArea )
+    {
+      DoPan( secondarySelectionHandle, RIGHT_SELECTION_HANDLE, gesture );
     }
   }
 
@@ -703,12 +825,12 @@ struct Decorator::Impl : public ConnectionTracker
     if ( mPrimaryCursor ) // Secondary cursor not used for paste
     {
       Cursor cursor = PRIMARY_CURSOR;
-      alternativePosition = mCursor[cursor].y;
+      alternativePosition = mCursor[cursor].position.y;
     }
 
     const float popupHeight = 120.0f; // todo Set as a MaxSize Property in Control or retrieve from CopyPastePopup class.
 
-    if (  mActiveGrabHandle )
+    if( mHandle[GRAB_HANDLE].active )
     {
       // If grab handle enabled then position pop-up below the grab handle.
       const Vector2 grabHandleSize( 59.0f, 56.0f ); // todo
@@ -726,16 +848,10 @@ struct Decorator::Impl : public ConnectionTracker
   void PopUpLeavesVerticalBoundary( PropertyNotification& source )
   {
     float alternativeYPosition=0.0f;
-  // todo
-  //  if( mHighlightMeshActor ) // Text Selection mode
-  //  {
-  //    alternativePosition = AlternatePopUpPositionRelativeToSelectionHandles();
-  //  }
-  //  else // Not in Text Selection mode
-  //  {
+    // todo use AlternatePopUpPositionRelativeToSelectionHandles() if text is highlighted
     // if can't be positioned above, then position below row.
     alternativeYPosition = AlternatePopUpPositionRelativeToCursor();
-   // }
+
     mCopyPastePopup.SetY( alternativeYPosition );
   }
 
@@ -792,49 +908,116 @@ struct Decorator::Impl : public ConnectionTracker
     requiredPopupPosition.x = requiredPopupPosition.x + xOffSetToKeepWithinBounds;
   }
 
-  Internal::Control& mTextControlParent;
-  Observer& mObserver;
-
-  Layer mActiveLayer; // Layer for active handles and alike that ensures they are above all else.
-
-  unsigned int mActiveCursor;
-  bool         mActiveGrabHandle;
-  bool         mActiveSelection;
-  bool         mActiveCopyPastePopup;
-
-  CursorImpl mCursor[CURSOR_COUNT];
+  void SetScrollThreshold( float threshold )
+  {
+    mScrollThreshold = threshold;
+  }
 
-  Timer mCursorBlinkTimer; // Timer to signal cursor to blink
-  unsigned int mCursorBlinkInterval;
-  float mCursorBlinkDuration;
-  bool mCursorBlinkStatus; // Flag to switch between blink on and blink off
+  float GetScrollThreshold() const
+  {
+    return mScrollThreshold;
+  }
 
-  ImageActor mPrimaryCursor;
-  ImageActor mSecondaryCursor;
+  void SetScrollSpeed( float speed )
+  {
+    mScrollSpeed = speed;
+    mScrollDistance = speed * SCROLL_TICK_INTERVAL * TO_SECONDS;
+  }
 
-  ImageActor mGrabHandle;
-  Actor mGrabArea;
-  float mGrabDisplacementX;
-  float mGrabDisplacementY;
+  float GetScrollSpeed() const
+  {
+    return mScrollSpeed;
+  }
 
-  SelectionHandleImpl mSelectionHandle[SELECTION_HANDLE_COUNT];
+  /**
+   * Creates and starts a timer to scroll the text when handles are close to the edges of the text.
+   *
+   * It only starts the timer if it's already created.
+   */
+  void StartScrollTimer()
+  {
+    if( !mScrollTimer )
+    {
+      mScrollTimer = Timer::New( SCROLL_TICK_INTERVAL );
+      mScrollTimer.TickSignal().Connect( this, &Decorator::Impl::OnScrollTimerTick );
+    }
 
-  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
+    if( !mScrollTimer.IsRunning() )
+    {
+      mScrollTimer.Start();
+    }
+  }
 
-  TextSelectionPopup mCopyPastePopup;
+  /**
+   * Stops the timer used to scroll the text.
+   */
+  void StopScrollTimer()
+  {
+    if( mScrollTimer )
+    {
+      mScrollTimer.Stop();
+    }
+  }
 
-  Image mCursorImage;
-  Image mGrabHandleImage;
+  /**
+   * Callback called by the timer used to scroll the text.
+   *
+   * It calculates and sets a new scroll position.
+   */
+  bool OnScrollTimerTick()
+  {
+    if( HANDLE_TYPE_COUNT != mHandleScrolling )
+    {
+      mObserver.HandleEvent( mHandleScrolling,
+                             HANDLE_SCROLLING,
+                             mScrollDirection == SCROLL_RIGHT ? mScrollDistance : -mScrollDistance,
+                             0.f );
+    }
 
-  TapGestureDetector mTapDetector;
-  PanGestureDetector mPanGestureDetector;
+    return true;
+  }
 
-  Rect<int> mBoundingBox;
+  Internal::Control&  mTextControlParent;
+  Observer&           mObserver;
+
+  TapGestureDetector  mTapDetector;
+  PanGestureDetector  mPanGestureDetector;
+  Timer               mCursorBlinkTimer;          ///< Timer to signal cursor to blink
+  Timer               mScrollTimer;               ///< Timer used to scroll the text when the grab handle is moved close to the edges.
+
+  Layer               mActiveLayer;               ///< Layer for active handles and alike that ensures they are above all else.
+  ImageActor          mPrimaryCursor;
+  ImageActor          mSecondaryCursor;
+  MeshActor           mHighlightMeshActor;        ///< Mesh Actor to display highlight
+  TextSelectionPopup  mCopyPastePopup;
+
+  Image               mHandleImages[HANDLE_TYPE_COUNT][HANDLE_IMAGE_TYPE_COUNT];
+  Image               mCursorImage;
+  Mesh                mHighlightMesh;             ///< Mesh for highlight
+  MeshData            mHighlightMeshData;         ///< Mesh Data for highlight
+  Material            mHighlightMaterial;         ///< Material used for highlight
+
+  CursorImpl          mCursor[CURSOR_COUNT];
+  HandleImpl          mHandle[HANDLE_TYPE_COUNT];
+  QuadContainer       mHighlightQuadList;         ///< Sub-selections that combine to create the complete selection highlight
+
+  Rect<int>           mBoundingBox;
+  Vector4             mHighlightColor;            ///< Color of the highlight
+
+  unsigned int        mActiveCursor;
+  unsigned int        mCursorBlinkInterval;
+  float               mCursorBlinkDuration;
+  HandleType          mHandleScrolling;         ///< The handle which is scrolling.
+  ScrollDirection     mScrollDirection;         ///< The direction of the scroll.
+  float               mScrollThreshold;         ///< Defines a square area inside the control, close to the edge. A cursor entering this area will trigger scroll events.
+  float               mScrollSpeed;             ///< The scroll speed in pixels per second.
+  float               mScrollDistance;          ///< Distance the text scrolls during a scroll interval.
+  unsigned int        mScrollInterval;          ///< Time in milliseconds of a scroll interval.
+
+  bool                mActiveCopyPastePopup   : 1;
+  bool                mCursorBlinkStatus      : 1; ///< Flag to switch between blink on and blink off.
+  bool                mPrimaryCursorVisible   : 1; ///< Whether the primary cursor is visible.
+  bool                mSecondaryCursorVisible : 1; ///< Whether the secondary cursor is visible.
 };
 
 DecoratorPtr Decorator::New( Internal::Control& parent, Observer& observer )
@@ -852,9 +1035,14 @@ const Rect<int>& Decorator::GetBoundingBox() const
   return mImpl->mBoundingBox;
 }
 
-void Decorator::Relayout( const Vector2& size, const Vector2& scrollPosition )
+void Decorator::Relayout( const Vector2& size )
+{
+  mImpl->Relayout( size );
+}
+
+void Decorator::UpdatePositions( const Vector2& scrollOffset )
 {
-  mImpl->Relayout( size, scrollPosition );
+  mImpl->UpdatePositions( scrollOffset );
 }
 
 /** Cursor **/
@@ -871,24 +1059,25 @@ 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->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;
 }
 
+const Vector2& Decorator::GetPosition( Cursor cursor ) const
+{
+  return mImpl->mCursor[cursor].position;
+}
+
 void Decorator::SetColor( Cursor cursor, const Dali::Vector4& color )
 {
   mImpl->mCursor[cursor].color = color;
@@ -923,12 +1112,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 )
@@ -941,94 +1130,100 @@ float Decorator::GetCursorBlinkDuration() const
   return mImpl->mCursorBlinkDuration;
 }
 
-/** GrabHandle **/
+/** Handles **/
 
-void Decorator::SetGrabHandleActive( bool active )
+void Decorator::SetHandleActive( HandleType handleType, bool active )
 {
-  mImpl->mActiveGrabHandle = active;
+  mImpl->mHandle[handleType].active = active;
 }
 
-bool Decorator::IsGrabHandleActive() const
+bool Decorator::IsHandleActive( HandleType handleType ) const
 {
-  return mImpl->mActiveGrabHandle;
+  return mImpl->mHandle[handleType].active ;
 }
 
-void Decorator::SetGrabHandleImage( Dali::Image image )
+void Decorator::SetHandleImage( HandleType handleType, HandleImageType handleImageType, Dali::Image image )
 {
-  mImpl->mGrabHandleImage = image;
+  mImpl->mHandleImages[handleType][handleImageType] = image;
 }
 
-Dali::Image Decorator::GetGrabHandleImage() const
+Dali::Image Decorator::GetHandleImage( HandleType handleType, HandleImageType handleImageType ) const
 {
-  return mImpl->mGrabHandleImage;
+  return mImpl->mHandleImages[handleType][handleImageType];
 }
 
-/** Selection **/
+void Decorator::SetPosition( HandleType handleType, float x, float y, float height )
+{
+  // Adjust grab handle displacement
+  Impl::HandleImpl& handle = mImpl->mHandle[handleType];
 
-void Decorator::SetSelectionActive( bool active )
+  handle.grabDisplacementX -= x - handle.position.x;
+  handle.grabDisplacementY -= y - handle.position.y;
+
+  handle.position.x = x;
+  handle.position.y = y;
+  handle.lineHeight = height;
+}
+
+void Decorator::GetPosition( HandleType handleType, float& x, float& y, float& height ) const
 {
-  mImpl->mActiveSelection = active;
+  Impl::HandleImpl& handle = mImpl->mHandle[handleType];
+
+  x = handle.position.x;
+  y = handle.position.y;
+  height = handle.lineHeight;
 }
 
-bool Decorator::IsSelectionActive() const
+void Decorator::AddHighlight( float x1, float y1, float x2, float y2 )
 {
-  return mImpl->mActiveSelection;
+  mImpl->mHighlightQuadList.push_back( QuadCoordinates(x1, y1, x2, y2) );
 }
 
-void Decorator::SetPosition( SelectionHandle handle, float x, float y, float height )
+void Decorator::ClearHighlights()
 {
-  mImpl->mSelectionHandle[handle].x = x;
-  mImpl->mSelectionHandle[handle].y = y;
-  mImpl->mSelectionHandle[handle].lineHeight = height;
+  mImpl->mHighlightQuadList.clear();
 }
 
-void Decorator::GetPosition( SelectionHandle handle, float& x, float& y, float& height ) const
+void Decorator::SetHighlightColor( const Vector4& color )
 {
-  x = mImpl->mSelectionHandle[handle].x;
-  y = mImpl->mSelectionHandle[handle].y;
-  height = mImpl->mSelectionHandle[handle].lineHeight;
+  mImpl->mHighlightColor = color;
 }
 
-void Decorator::SetImage( SelectionHandle handle, SelectionHandleState state, Dali::Image image )
+const Vector4& Decorator::GetHighlightColor() const
 {
-  if( SELECTION_HANDLE_PRESSED == state )
-  {
-    mImpl->mSelectionHandle[handle].pressedImage = image;
-  }
-  else
-  {
-    mImpl->mSelectionHandle[handle].releasedImage = image;
-  }
+  return mImpl->mHighlightColor;
 }
 
-Dali::Image Decorator::GetImage( SelectionHandle handle, SelectionHandleState state ) const
+void Decorator::SetPopupActive( bool active )
 {
-  if( SELECTION_HANDLE_PRESSED == state )
-  {
-    return mImpl->mSelectionHandle[handle].pressedImage;
-  }
+  mImpl->mActiveCopyPastePopup = active;
+}
 
-  return mImpl->mSelectionHandle[handle].releasedImage;
+bool Decorator::IsPopupActive() const
+{
+  return mImpl->mActiveCopyPastePopup ;
 }
 
-void Decorator::AddHighlight( float x1, float y1, float x2, float y2 )
+/** Scroll **/
+
+void Decorator::SetScrollThreshold( float threshold )
 {
-  mImpl->mHighlightQuadList.push_back( QuadCoordinates(x1, y1, x2, y2) );
+  mImpl->SetScrollThreshold( threshold );
 }
 
-void Decorator::ClearHighlights()
+float Decorator::GetScrollThreshold() const
 {
-  mImpl->mHighlightQuadList.clear();
+  return mImpl->GetScrollThreshold();
 }
 
-void Decorator::SetPopupActive( bool active )
+void Decorator::SetScrollSpeed( float speed )
 {
-  mImpl->mActiveCopyPastePopup = active;
+  mImpl->SetScrollSpeed( speed );
 }
 
-bool Decorator::IsPopupActive() const
+float Decorator::GetScrollSpeed() const
 {
-  return mImpl->mActiveCopyPastePopup ;
+  return mImpl->GetScrollSpeed();
 }
 
 Decorator::~Decorator()
index 939c815..e341e2b 100644 (file)
@@ -61,26 +61,31 @@ enum ActiveCursor
   ACTIVE_CURSOR_BOTH     ///< Both primary and secondary cursor are active
 };
 
-// The state information for grab handle events
-enum GrabHandleState
+// The state information for handle events.
+enum HandleState
 {
-  GRAB_HANDLE_TAPPED,
-  GRAB_HANDLE_PRESSED,
-  GRAB_HANDLE_RELEASED
+  HANDLE_TAPPED,
+  HANDLE_PRESSED,
+  HANDLE_RELEASED,
+  HANDLE_SCROLLING,
+  HANDLE_STOP_SCROLLING
 };
 
-// The set the selection-handle positions etc.
-enum SelectionHandle
+// Used to set different handle images
+enum HandleImageType
 {
-  PRIMARY_SELECTION_HANDLE,
-  SECONDARY_SELECTION_HANDLE,
-  SELECTION_HANDLE_COUNT
+  HANDLE_IMAGE_PRESSED,
+  HANDLE_IMAGE_RELEASED,
+  HANDLE_IMAGE_TYPE_COUNT
 };
 
-enum SelectionHandleState
+// Types of handles.
+enum HandleType
 {
-  SELECTION_HANDLE_PRESSED,
-  SELECTION_HANDLE_RELEASED
+  GRAB_HANDLE,
+  LEFT_SELECTION_HANDLE,
+  RIGHT_SELECTION_HANDLE,
+  HANDLE_TYPE_COUNT
 };
 
 /**
@@ -115,13 +120,14 @@ public:
     virtual ~Observer() {};
 
     /**
-     * @brief An input event from the grab handle.
+     * @brief An input event from one of the handles.
      *
-     * @param[in] state The grab handle state.
+     * @param[in] handleType The handle's type.
+     * @param[in] state The handle's state.
      * @param[in] x The x position relative to the top-left of the parent control.
      * @param[in] y The y position relative to the top-left of the parent control.
      */
-    virtual void GrabHandleEvent( GrabHandleState state, float x, float y ) = 0;
+    virtual void HandleEvent( HandleType handleType, HandleState state, float x, float y ) = 0;
   };
 
   /**
@@ -167,9 +173,15 @@ public:
    * @brief The decorator waits until a relayout before creating actors etc.
    *
    * @param[in] size The size of the parent control after size-negotiation.
-   * @param[in] scrollPosition The cursor, grab-handle positions etc. should be offset by this.
    */
-  void Relayout( const Dali::Vector2& size, const Vector2& scrollPosition );
+  void Relayout( const Dali::Vector2& size );
+
+  /**
+   * @brief Updates the decorator's actor positions after scrolling.
+   *
+   * @param[in] scrollOffset The scroll offset.
+   */
+  void UpdatePositions( const Vector2& scrollOffset );
 
   /**
    * @brief Sets which of the cursors are active.
@@ -198,7 +210,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.
@@ -209,6 +221,15 @@ public:
   void GetPosition( Cursor cursor, float& x, float& y, float& cursorHeight, float& lineHeight ) const;
 
   /**
+   * @brief Retrieves the position of a cursor.
+   *
+   * @param[in] cursor The cursor to get.
+   *
+   * @return The position.
+   */
+  const Vector2& GetPosition( Cursor cursor ) const;
+
+  /**
    * @brief Sets the color for a cursor.
    *
    * @param[in] cursor Whether this color is for the primary or secondary cursor.
@@ -263,85 +284,61 @@ public:
   float GetCursorBlinkDuration() const;
 
   /**
-   * @brief Sets whether the grab handle is active.
+   * @brief Sets whether a handle is active.
    *
-   * @note The grab handle follows the cursor position set with SetPosition(Cursor, ...)
-   * @param[in] active True if the grab handle should be active.
+   * @param[in] handleType One of the handles.
+   * @param[in] active True if the handle should be active.
    */
-  void SetGrabHandleActive( bool active );
+  void SetHandleActive( HandleType handleType,
+                        bool active );
 
   /**
-   * @brief Query whether the grab handle is active.
+   * @brief Query whether a handle is active.
    *
-   * @return True if the grab handle should be active.
-   */
-  bool IsGrabHandleActive() const;
-
-  /**
-   * @brief Sets the image for the grab handle.
+   * @param[in] handleType One of the handles.
    *
-   * @param[in] image The image to use.
+   * @return True if the handle is active.
    */
-  void SetGrabHandleImage( Dali::Image image );
+  bool IsHandleActive( HandleType handleType ) const;
 
   /**
-   * @brief Retrieves the image for the grab handle.
+   * @brief Sets the image for one of the handles.
    *
-   * @return The grab handle image.
+   * @param[in] handleType One of the handles.
+   * @param[in] handleImageType A different image can be set for the pressed/released states.
+   * @param[in] image The image to use.
    */
-  Dali::Image GetGrabHandleImage() const;
+  void SetHandleImage( HandleType handleType, HandleImageType handleImageType, Dali::Image image );
 
   /**
-   * @brief Sets whether the selection handles and highlight are active.
+   * @brief Retrieves the image for one of the handles.
    *
-   * @param[in] active True if the selection handles and highlight are active.
-   */
-  void SetSelectionActive( bool active );
-
-  /**
-   * @brief Query whether the selection handles and highlight are active.
+   * @param[in] handleType One of the handles.
+   * @param[in] handleImageType A different image can be set for the pressed/released states.
    *
-   * @return True if the selection handles and highlight are active.
+   * @return The grab handle image.
    */
-  bool IsSelectionActive() const;
+  Dali::Image GetHandleImage( HandleType handleType, HandleImageType handleImageType ) const;
 
   /**
    * @brief Sets the position of a selection handle.
    *
-   * @param[in] handle The handle to set.
+   * @param[in] handleType The handle to set.
    * @param[in] x The x position relative to the top-left of the parent control.
    * @param[in] y The y position relative to the top-left of the parent control.
    * @param[in] lineHeight The logical line height at this position.
    */
-  void SetPosition( SelectionHandle handle, float x, float y, float lineHeight );
+  void SetPosition( HandleType handleType, float x, float y, float lineHeight );
 
   /**
    * @brief Retrieves the position of a selection handle.
    *
-   * @param[in] handle The handle to get.
+   * @param[in] handleType The handle to get.
    * @param[out] x The x position relative to the top-left of the parent control.
    * @param[out] y The y position relative to the top-left of the parent control.
-   * @param[out] cursorHeight The logical cursor height at this position.
+   * @param[out] lineHeight The logical line height at this position.
    */
-  void GetPosition( SelectionHandle handle, float& x, float& y, float& cursorHeight ) const;
-
-  /**
-   * @brief Sets the image for one of the selection handles.
-   *
-   * @param[in] handle The selection handle.
-   * @param[in] state A different image can be set for the pressed/released states.
-   * @param[in] image The image to use.
-   */
-  void SetImage( SelectionHandle handle, SelectionHandleState state, Dali::Image image );
-
-  /**
-   * @brief Retrieves the image for a selection handle.
-   *
-   * @param[in] handle The selection handle.
-   * @param[in] state A different image can be set for the pressed/released states.
-   * @return The image.
-   */
-  Dali::Image GetImage( SelectionHandle handle, SelectionHandleState state ) const;
+  void GetPosition( HandleType handleType, float& x, float& y, float& lineHeight ) const;
 
   /**
    * @brief Adds a quad to the existing selection highlights.
@@ -359,6 +356,20 @@ public:
   void ClearHighlights();
 
   /**
+   * @brief Sets the selection highlight color.
+   *
+   * @param[in] image The image to use.
+   */
+  void SetHighlightColor( const Vector4& color );
+
+  /**
+   * @brief Retrieves the selection highlight color.
+   *
+   * @return The image.
+   */
+  const Vector4& GetHighlightColor() const;
+
+  /**
    * @brief Set the Selection Popup to show or hide via the active flaf
    * @param[in] active true to show, false to hide
    */
@@ -371,6 +382,52 @@ public:
    */
   bool IsPopupActive() const;
 
+  /**
+   * @brief Sets the scroll threshold.
+   *
+   * It defines a square area inside the control, close to the edge.
+   * When the cursor enters this area, the decorator starts to send scroll events.
+   *
+   * @param[in] threshold The scroll threshold.
+   */
+  void SetScrollThreshold( float threshold );
+
+  /**
+   * @brief Retrieves the scroll threshold.
+   *
+   * @retunr The scroll threshold.
+   */
+  float GetScrollThreshold() const;
+
+  /**
+   * @brief Sets the scroll speed.
+   *
+   * Is the distance the text is going to be scrolled during a scroll interval.
+   *
+   * @param[in] speed The scroll speed.
+   */
+  void SetScrollSpeed( float speed );
+
+  /**
+   * @brief Retrieves the scroll speed.
+   *
+   * @return The scroll speed.
+   */
+  float GetScrollSpeed() const;
+
+  /**
+   * @brief Sets the scroll interval.
+   *
+   * @param[in] seconds The scroll interval in seconds.
+   */
+  void SetScrollTickInterval( float seconds );
+
+  /**
+   * @brief Retrieves the scroll interval.
+   *
+   * @return The scroll interval.
+   */
+  float GetScrollTickInterval() const;
 
 protected:
 
index b82b07b..1825840 100644 (file)
@@ -207,36 +207,38 @@ struct AtlasRenderer::Impl : public ConnectionTracker
 
           // Create a new image for the glyph
           BufferImage bitmap = mFontClient.CreateBitmap( glyph.fontId, glyph.index );
-
-          // 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 )
+          if ( bitmap )
           {
-            setSize = true;
-            mBlockSizes[ currentBlockSize ].mNeededBlockHeight = bitmap.GetHeight();
-          }
+            // 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();
+            }
 
-          if ( setSize )
-          {
-            mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
-                                           DEFAULT_ATLAS_HEIGHT,
-                                           mBlockSizes[ currentBlockSize ].mNeededBlockWidth,
-                                           mBlockSizes[ currentBlockSize ].mNeededBlockHeight );
-          }
+            if ( setSize )
+            {
+              mGlyphManager.SetNewAtlasSize( DEFAULT_ATLAS_WIDTH,
+                                             DEFAULT_ATLAS_HEIGHT,
+                                             mBlockSizes[ currentBlockSize ].mNeededBlockWidth,
+                                             mBlockSizes[ currentBlockSize ].mNeededBlockHeight );
+            }
 
-          // Locate a new slot for our glyph
-          mGlyphManager.Add( glyph, bitmap, slot );
+            // 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 );
+            // 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)
@@ -248,7 +250,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker
                         currentUnderlinePosition,
                         currentUnderlineThickness,
                         slot );
-       lastFontId = glyph.fontId;
+        lastFontId = glyph.fontId;
       }
     }
 
index 3eb26b6..d7ed8f4 100644 (file)
@@ -48,6 +48,11 @@ public:
    * @brief Called to request a text relayout.
    */
   virtual void RequestTextRelayout() = 0;
+
+  /**
+   * @brief Called when the number of characters to be inserted exceeds the maximum limit
+   */
+  virtual void MaxLengthReached() = 0;
 };
 
 } // namespace Text
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..f7f1739
--- /dev/null
@@ -0,0 +1,1037 @@
+/*
+ * 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 ),
+  mLeftSelectionPosition( 0u ),
+  mRightSelectionPosition( 0u ),
+  mDecoratorUpdated( false ),
+  mCursorBlinkEnabled( true ),
+  mGrabHandleEnabled( true ),
+  mGrabHandlePopupEnabled( false ),
+  mSelectionEnabled( false ),
+  mHorizontalScrollingEnabled( true ),
+  mVerticalScrollingEnabled( false ),
+  mUpdateCursorPosition( false ),
+  mUpdateLeftSelectionPosition( false ),
+  mUpdateRightSelectionPosition( false ),
+  mScrollAfterUpdateCursorPosition( 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:
+      case Event::LEFT_SELECTION_HANDLE_EVENT:
+      case Event::RIGHT_SELECTION_HANDLE_EVENT: // Fall through
+      {
+        OnHandleEvent( *iter );
+        break;
+      }
+      }
+    }
+  }
+
+  // The cursor must also be repositioned after inserts into the model
+  if( mEventData->mUpdateCursorPosition )
+  {
+    // Updates the cursor position and scrolls the text to make it visible.
+
+    UpdateCursorPosition();
+
+    if( mEventData->mScrollAfterUpdateCursorPosition )
+    {
+      ScrollToMakeCursorVisible();
+      mEventData->mScrollAfterUpdateCursorPosition = false;
+    }
+
+    mEventData->mDecoratorUpdated = true;
+    mEventData->mUpdateCursorPosition = false;
+  }
+  else if( mEventData->mUpdateLeftSelectionPosition )
+  {
+    UpdateSelectionHandle( LEFT_SELECTION_HANDLE );
+
+    if( mEventData->mScrollAfterUpdateCursorPosition )
+    {
+      ScrollToMakeCursorVisible();
+      mEventData->mScrollAfterUpdateCursorPosition = false;
+    }
+
+    mEventData->mDecoratorUpdated = true;
+    mEventData->mUpdateLeftSelectionPosition = false;
+  }
+  else if( mEventData->mUpdateRightSelectionPosition )
+  {
+    UpdateSelectionHandle( RIGHT_SELECTION_HANDLE );
+
+    if( mEventData->mScrollAfterUpdateCursorPosition )
+    {
+      ScrollToMakeCursorVisible();
+      mEventData->mScrollAfterUpdateCursorPosition = false;
+    }
+
+    mEventData->mDecoratorUpdated = true;
+    mEventData->mUpdateRightSelectionPosition = 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
+  }
+
+  mEventData->mUpdateCursorPosition = true;
+  mEventData->mScrollAfterUpdateCursorPosition = true;
+}
+
+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 - mEventData->mScrollPosition.x - mAlignmentOffset.x;
+    const float yPosition = event.p3.mFloat - mEventData->mScrollPosition.y - mAlignmentOffset.y;
+
+    mEventData->mPrimaryCursorPosition = GetClosestCursorIndex( xPosition,
+                                                                yPosition );
+
+    mEventData->mUpdateCursorPosition = true;
+    mEventData->mScrollAfterUpdateCursorPosition = true;
+  }
+  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();
+    const Vector2 currentScroll = mEventData->mScrollPosition;
+
+    if( mEventData->mHorizontalScrollingEnabled )
+    {
+      const float displacementX = event.p2.mFloat;
+      mEventData->mScrollPosition.x += displacementX;
+
+      ClampHorizontalScroll( actualSize );
+    }
+
+    if( mEventData->mVerticalScrollingEnabled )
+    {
+      const float displacementY = event.p3.mFloat;
+      mEventData->mScrollPosition.y += displacementY;
+
+      ClampVerticalScroll( actualSize );
+    }
+
+    if( mEventData->mDecorator )
+    {
+      mEventData->mDecorator->UpdatePositions( mEventData->mScrollPosition - currentScroll );
+    }
+  }
+}
+
+void Controller::Impl::OnHandleEvent( const Event& event )
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return;
+  }
+
+  const unsigned int state = event.p1.mUint;
+
+  if( HANDLE_PRESSED == state )
+  {
+    // The event.p2 and event.p3 are in decorator coords. Need to transforms to text coords.
+    const float xPosition = event.p2.mFloat - mEventData->mScrollPosition.x - mAlignmentOffset.x;
+    const float yPosition = event.p3.mFloat - mEventData->mScrollPosition.y - mAlignmentOffset.y;
+
+    const CharacterIndex handleNewPosition = GetClosestCursorIndex( xPosition, yPosition );
+
+    if( Event::GRAB_HANDLE_EVENT == event.type )
+    {
+      ChangeState ( EventData::EDITING );
+
+      if( handleNewPosition != mEventData->mPrimaryCursorPosition )
+      {
+        mEventData->mPrimaryCursorPosition = handleNewPosition;
+        mEventData->mUpdateCursorPosition = true;
+      }
+    }
+    else if( Event::LEFT_SELECTION_HANDLE_EVENT == event.type )
+    {
+      if( handleNewPosition != mEventData->mLeftSelectionPosition )
+      {
+        mEventData->mLeftSelectionPosition = handleNewPosition;
+        mEventData->mUpdateLeftSelectionPosition = true;
+      }
+    }
+    else if( Event::RIGHT_SELECTION_HANDLE_EVENT == event.type )
+    {
+      if( handleNewPosition != mEventData->mRightSelectionPosition )
+      {
+        mEventData->mRightSelectionPosition = handleNewPosition;
+        mEventData->mUpdateRightSelectionPosition = true;
+      }
+    }
+  }
+  else if( ( HANDLE_RELEASED == state ) ||
+           ( HANDLE_STOP_SCROLLING == state ) )
+  {
+    if( mEventData->mGrabHandlePopupEnabled )
+    {
+      ChangeState( EventData::EDITING_WITH_POPUP );
+    }
+    if( Event::GRAB_HANDLE_EVENT == event.type )
+    {
+      mEventData->mUpdateCursorPosition = true;
+
+      if( HANDLE_STOP_SCROLLING == state )
+      {
+        // The event.p2 and event.p3 are in decorator coords. Need to transforms to text coords.
+        const float xPosition = event.p2.mFloat - mEventData->mScrollPosition.x - mAlignmentOffset.x;
+        const float yPosition = event.p3.mFloat - mEventData->mScrollPosition.y - mAlignmentOffset.y;
+
+        mEventData->mPrimaryCursorPosition = GetClosestCursorIndex( xPosition, yPosition );
+
+        mEventData->mScrollAfterUpdateCursorPosition = true;
+      }
+    }
+    mEventData->mDecoratorUpdated = true;
+  }
+  else if( HANDLE_SCROLLING == state )
+  {
+    const float xSpeed = event.p2.mFloat;
+    const Vector2& actualSize = mVisualModel->GetActualSize();
+
+    mEventData->mScrollPosition.x += xSpeed;
+
+    ClampHorizontalScroll( actualSize );
+
+   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 + mEventData->mScrollPosition.x;
+    float secondaryX = positions[count-1].x + glyphs[count-1].width + mEventData->mScrollPosition.x;
+
+    // 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( LEFT_SELECTION_HANDLE,     primaryX, mEventData->mScrollPosition.y, height );
+    mEventData->mDecorator->SetPosition( RIGHT_SELECTION_HANDLE, secondaryX, mEventData->mScrollPosition.y, height );
+
+    mEventData->mDecorator->ClearHighlights();
+    mEventData->mDecorator->AddHighlight( primaryX, mEventData->mScrollPosition.y, secondaryX, height + mEventData->mScrollPosition.y );
+  }
+}
+
+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->SetHandleActive( GRAB_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, 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->SetHandleActive( GRAB_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, true );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, 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->SetHandleActive( GRAB_HANDLE, true );
+      }
+      if( mEventData->mGrabHandlePopupEnabled )
+      {
+        mEventData->mDecorator->SetPopupActive( false );
+      }
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, 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->SetHandleActive( LEFT_SELECTION_HANDLE, true );
+        mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, true );
+      }
+      if( mEventData->mGrabHandlePopupEnabled )
+      {
+        mEventData->mDecorator->SetPopupActive( true );
+      }
+      mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
+      mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, 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;
+  }
+
+  // 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 );
+
+  const Vector2 offset = mEventData->mScrollPosition + mAlignmentOffset;
+  const Vector2 cursorPosition = cursorInfo.primaryPosition + offset;
+
+  // Sets the cursor position.
+  mEventData->mDecorator->SetPosition( PRIMARY_CURSOR,
+                                       cursorPosition.x,
+                                       cursorPosition.y,
+                                       cursorInfo.primaryCursorHeight,
+                                       cursorInfo.lineHeight );
+
+  // Sets the grab handle position.
+  mEventData->mDecorator->SetPosition( GRAB_HANDLE,
+                                       cursorPosition.x,
+                                       cursorPosition.y,
+                                       cursorInfo.lineHeight );
+
+  if( cursorInfo.isSecondaryCursor )
+  {
+    mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_BOTH );
+    mEventData->mDecorator->SetPosition( SECONDARY_CURSOR,
+                                         cursorInfo.secondaryPosition.x + offset.x,
+                                         cursorInfo.secondaryPosition.y + offset.y,
+                                         cursorInfo.secondaryCursorHeight,
+                                         cursorInfo.lineHeight );
+  }
+  else
+  {
+    mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
+  }
+}
+
+void Controller::Impl::UpdateSelectionHandle( HandleType handleType )
+{
+  if( ( LEFT_SELECTION_HANDLE != handleType ) &&
+      ( RIGHT_SELECTION_HANDLE != handleType ) )
+  {
+    return;
+  }
+
+  const bool leftSelectionHandle = LEFT_SELECTION_HANDLE == handleType;
+  const CharacterIndex index = leftSelectionHandle ? mEventData->mLeftSelectionPosition : mEventData->mRightSelectionPosition;
+
+  CursorInfo cursorInfo;
+  GetCursorPosition( index,
+                     cursorInfo );
+
+  const Vector2 offset = mEventData->mScrollPosition + mAlignmentOffset;
+  const Vector2 cursorPosition = cursorInfo.primaryPosition + offset;
+
+  // Sets the grab handle position.
+  mEventData->mDecorator->SetPosition( handleType,
+                                       cursorPosition.x,
+                                       cursorPosition.y,
+                                       cursorInfo.lineHeight );
+}
+
+void Controller::Impl::ClampHorizontalScroll( const Vector2& actualSize )
+{
+  // 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;
+  }
+}
+
+void Controller::Impl::ClampVerticalScroll( const Vector2& actualSize )
+{
+  // 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::ScrollToMakeCursorVisible()
+{
+  if( NULL == mEventData )
+  {
+    // Nothing to do if there is no text input.
+    return;
+  }
+
+  const Vector2& primaryCursorPosition = mEventData->mDecorator->GetPosition( PRIMARY_CURSOR );
+
+  Vector2 offset;
+  bool updateDecorator = false;
+  if( primaryCursorPosition.x < 0.f )
+  {
+    offset.x = -primaryCursorPosition.x;
+    mEventData->mScrollPosition.x += offset.x;
+    updateDecorator = true;
+  }
+  else if( primaryCursorPosition.x > mControlSize.width )
+  {
+    offset.x = mControlSize.width - primaryCursorPosition.x;
+    mEventData->mScrollPosition.x += offset.x;
+    updateDecorator = true;
+  }
+
+  if( updateDecorator && mEventData->mDecorator )
+  {
+    mEventData->mDecorator->UpdatePositions( offset );
+  }
+
+  // TODO : calculate the vertical scroll.
+}
+
+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..51927a6
--- /dev/null
@@ -0,0 +1,343 @@
+#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,
+    LEFT_SELECTION_HANDLE_EVENT,
+    RIGHT_SELECTION_HANDLE_EVENT
+  };
+
+  union Param
+  {
+    int mInt;
+    unsigned int mUint;
+    float mFloat;
+  };
+
+  Event( Type eventType )
+  : type( eventType )
+  {
+    p1.mInt = 0;
+    p2.mInt = 0;
+    p3.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;               ///< Pointer to the decorator
+  std::string        mPlaceholderText;         ///< The plaxe holder text
+
+  /**
+   * 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     mLeftSelectionPosition;   ///< Index into logical model for left selection handle.
+  CharacterIndex     mRightSelectionPosition;  ///< Index into logical model for right selection handle.
+
+  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.
+  bool mUpdateLeftSelectionPosition     : 1;   ///< True if the visual position of the left selection handle must be recalculated.
+  bool mUpdateRightSelectionPosition    : 1;   ///< True if the visual position of the right selection handle must be recalculated.
+  bool mScrollAfterUpdateCursorPosition : 1;   ///< Whether to scroll after the cursor position is updated.
+};
+
+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 ),
+    mMaximumNumberOfCharacters( 50 ),
+    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 OnHandleEvent( 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;
+
+  /**
+   * @brief Updates the cursor position.
+   *
+   * Retrieves the x,y position of the cursor logical position and sets it into the decorator.
+   * It sets the position of the secondary cursor if it's a valid one.
+   * Sets which cursors are active.
+   */
+  void UpdateCursorPosition();
+
+  /**
+   * @brief Updates the position of the given selection handle.
+   *
+   * @param[in] handleType One of the selection handles.
+   */
+  void UpdateSelectionHandle( HandleType handleType );
+
+  /**
+   * @biref Clamps the horizontal scrolling to get the control always filled with text.
+   *
+   * @param[in] actualSize The size of the laid out text.
+   */
+  void ClampHorizontalScroll( const Vector2& actualSize );
+
+  /**
+   * @biref Clamps the vertical scrolling to get the control always filled with text.
+   *
+   * @param[in] actualSize The size of the laid out text.
+   */
+  void ClampVerticalScroll( const Vector2& actualSize );
+
+  /**
+   * @brief Scrolls the text to make the cursor visible.
+   *
+   * This method is called after inserting, deleting or moving the cursor with the keypad.
+   */
+  void ScrollToMakeCursorVisible();
+
+  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.
+  Length mMaximumNumberOfCharacters;       ///< Maximum number of characters that can be inserted.
+  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..d599bdd 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,25 +92,38 @@ 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;
   }
 }
 
+void Controller::SetMaximumNumberOfCharacters( int maxCharacters )
+{
+  if ( maxCharacters >= 0 )
+  {
+    mImpl->mMaximumNumberOfCharacters = maxCharacters;
+  }
+}
+
+int Controller::GetMaximumNumberOfCharacters()
+{
+  return mImpl->mMaximumNumberOfCharacters;
+}
+
 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 +142,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 +159,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 +178,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 +195,7 @@ void Controller::SetDefaultPointSize( float pointSize )
 {
   if( !mImpl->mFontDefaults )
   {
-    mImpl->mFontDefaults = new Controller::FontDefaults();
+    mImpl->mFontDefaults = new FontDefaults();
   }
 
   mImpl->mFontDefaults->mDefaultPointSize = pointSize;
@@ -1161,7 +214,7 @@ void Controller::SetDefaultPointSize( float pointSize )
   mImpl->mVisualModel->mLines.Clear();
   mImpl->mVisualModel->ClearCaches();
 
-  RequestRelayout();
+  mImpl->RequestRelayout();
 }
 
 float Controller::GetDefaultPointSize() const
@@ -1188,99 +241,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 +337,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 +455,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 +486,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 +501,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 +557,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 +577,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();
@@ -1562,21 +610,26 @@ void Controller::InsertTextEvent( const std::string& text )
   Length characterCount = Utf8ToUtf32( utf8, text.size(), utf32Characters.Begin() );
   utf32Characters.Resize( characterCount );
 
+  const Length numberOfCharactersInModel = mImpl->mLogicalModel->GetNumberOfCharacters();
+
+  // Restrict new text to fit within Maximum characters setting
+  Length maxSizeOfNewText = std::min ( ( mImpl->mMaximumNumberOfCharacters - numberOfCharactersInModel ), characterCount );
+
   // Insert at current cursor position
+  CharacterIndex& cursorIndex = mImpl->mEventData->mPrimaryCursorPosition;
+
   Vector<Character>& modifyText = mImpl->mLogicalModel->mText;
-  CharacterIndex& cursorIndex = mImpl->mTextInput->mPrimaryCursorPosition;
 
-  if( cursorIndex < modifyText.Count() )
+  if( cursorIndex < numberOfCharactersInModel )
   {
-    modifyText.Insert( modifyText.Begin() + cursorIndex, utf32Characters.Begin(), utf32Characters.End() );
+    modifyText.Insert( modifyText.Begin() + cursorIndex, utf32Characters.Begin(), utf32Characters.Begin()+ maxSizeOfNewText );
   }
   else
   {
-    modifyText.Insert( modifyText.End(), utf32Characters.Begin(), utf32Characters.End() );
+    modifyText.Insert( modifyText.End(), utf32Characters.Begin(), utf32Characters.Begin() + maxSizeOfNewText );
   }
 
-  // Advance the cursor position
-  ++cursorIndex;
+  cursorIndex += maxSizeOfNewText;
 
   // The natural size needs to be re-calculated.
   mImpl->mRecalculateNaturalSize = true;
@@ -1590,12 +643,18 @@ 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;
+  mImpl->mEventData->mScrollAfterUpdateCursorPosition = true;
+
+  if ( characterCount > maxSizeOfNewText )
+  {
+    mImpl->mControlInterface.MaxLengthReached();
+  }
 }
 
 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 +677,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 +700,8 @@ void Controller::DeleteTextEvent()
                                                            REORDER );
 
   // Queue a cursor reposition event; this must wait until after DoRelayout()
-  mImpl->mTextInput->mUpdateCursorPosition = true;
+  mImpl->mEventData->mUpdateCursorPosition = true;
+  mImpl->mEventData->mScrollAfterUpdateCursorPosition = true;
 }
 
 void Controller::UpdateModel( OperationsMask operationsRequired )
@@ -1992,52 +1052,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 +1109,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 +1139,81 @@ 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 )
+void Controller::HandleEvent( HandleType handleType, HandleState state, float x, float y )
 {
-  DALI_ASSERT_DEBUG( mImpl->mTextInput && "Unexpected GrabHandleEvent" );
+  DALI_ASSERT_DEBUG( mImpl->mEventData && "Controller::HandleEvent. Unexpected HandleEvent" );
 
-  if( mImpl->mTextInput )
+  if( mImpl->mEventData )
   {
-    TextInput::Event event( TextInput::GRAB_HANDLE_EVENT );
-    event.p1.mUint  = state;
-    event.p2.mFloat = x;
-    event.p3.mFloat = y;
-    mImpl->mTextInput->mEventQueue.push_back( event );
+    switch( handleType )
+    {
+      case GRAB_HANDLE:
+      {
+        Event event( Event::GRAB_HANDLE_EVENT );
+        event.p1.mUint  = state;
+        event.p2.mFloat = x;
+        event.p3.mFloat = y;
+
+        mImpl->mEventData->mEventQueue.push_back( event );
+        break;
+      }
+      case LEFT_SELECTION_HANDLE:
+      {
+        Event event( Event::LEFT_SELECTION_HANDLE_EVENT );
+        event.p1.mUint  = state;
+        event.p2.mFloat = x;
+        event.p3.mFloat = y;
+
+        mImpl->mEventData->mEventQueue.push_back( event );
+        break;
+      }
+      case RIGHT_SELECTION_HANDLE:
+      {
+        Event event( Event::RIGHT_SELECTION_HANDLE_EVENT );
+        event.p1.mUint  = state;
+        event.p2.mFloat = x;
+        event.p3.mFloat = y;
+
+        mImpl->mEventData->mEventQueue.push_back( event );
+        break;
+      }
+      case HANDLE_TYPE_COUNT:
+      {
+        DALI_ASSERT_DEBUG( !"Controller::HandleEvent. Unexpected handle type" );
+      }
+    }
 
-    RequestRelayout();
+    mImpl->RequestRelayout();
   }
 }
 
index a5dd91b..5ef498d 100644 (file)
@@ -123,6 +123,20 @@ public:
   void GetPlaceholderText( std::string& text ) const;
 
   /**
+   * @brief Sets the maximum number of characters that can be inserted into the TextModel
+   *
+   * @param[in] maxCharacters maximum number of characters to be accepted
+   */
+  void SetMaximumNumberOfCharacters( int maxCharacters );
+
+  /**
+   * @brief Sets the maximum number of characters that can be inserted into the TextModel
+   *
+   * @param[in] maxCharacters maximum number of characters to be accepted
+   */
+  int GetMaximumNumberOfCharacters();
+
+  /**
    * @brief Set the default font family.
    *
    * @param[in] defaultFontFamily The default font family.
@@ -413,9 +427,9 @@ public:
   void PanEvent( Gesture::State state, const Vector2& displacement );
 
   /**
-   * @copydoc Dali::Toolkit::Text::Decorator::Observer::GrabHandleEvent()
+   * @copydoc Dali::Toolkit::Text::Decorator::Observer::HandleEvent()
    */
-  virtual void GrabHandleEvent( GrabHandleState state, float x, float y );
+  virtual void HandleEvent( HandleType handle, HandleState state, float x, float y );
 
 protected:
 
@@ -427,11 +441,6 @@ protected:
 private:
 
   /**
-   * @brief Request a relayout using the ControlInterface.
-   */
-  void RequestRelayout();
-
-  /**
    * @brief Private constructor.
    */
   Controller( ControlInterface& controlInterface );
@@ -446,12 +455,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 5a0188a..6196d91 100644 (file)
@@ -127,11 +127,11 @@ void CubeTransitionCrossEffect::SetupAnimation(unsigned int actorIndex, float an
     mTiles[mContainerIndex][actorIndex].TranslateBy( resetTranslation );
     mTiles[mContainerIndex][actorIndex].SetOrientation( Radian( angle),  axis );
   }
-  mAnimation.AnimateTo( Property( mBoxes[actorIndex], Actor::Property::ORIENTATION ), Quaternion( Radian( -angle ), axis ), AlphaFunctions::EaseInOutSine );
+  mAnimation.AnimateTo( Property( mBoxes[actorIndex], Actor::Property::ORIENTATION ), Quaternion( Radian( -angle ), axis ), AlphaFunction::EASE_IN_OUT_SINE );
   Vector3 position(mBoxes[actorIndex].GetCurrentPosition());
-  mAnimation.AnimateTo( Property( mBoxes[actorIndex], Actor::Property::POSITION ), position * mDisplacementRatio + Vector3( 0.f, 0.f, mCubeDisplacement ), AlphaFunctions::Bounce );
-  mAnimation.AnimateTo( Property( mTiles[mContainerIndex^1][actorIndex], Actor::Property::COLOR ), HALF_BRIGHTNESS, AlphaFunctions::EaseOut );
-  mAnimation.AnimateTo( Property( mTiles[mContainerIndex][actorIndex], Actor::Property::COLOR ), FULL_BRIGHTNESS, AlphaFunctions::EaseIn );
+  mAnimation.AnimateTo( Property( mBoxes[actorIndex], Actor::Property::POSITION ), position * mDisplacementRatio + Vector3( 0.f, 0.f, mCubeDisplacement ), AlphaFunction::BOUNCE );
+  mAnimation.AnimateTo( Property( mTiles[mContainerIndex^1][actorIndex], Actor::Property::COLOR ), HALF_BRIGHTNESS, AlphaFunction::EASE_OUT );
+  mAnimation.AnimateTo( Property( mTiles[mContainerIndex][actorIndex], Actor::Property::COLOR ), FULL_BRIGHTNESS, AlphaFunction::EASE_IN );
 }
 
 } // namespace Internal
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 37a3a06..6989478 100644 (file)
@@ -125,11 +125,11 @@ void CubeTransitionFoldEffect::SetupAnimation(unsigned int actorIndex, float ang
     sideTile.TranslateBy( resetTranslation );
     sideTile.SetOrientation( Radian( angle),   Vector3::YAXIS );
   }
-  mAnimation.AnimateTo( Property( currentCube, Actor::Property::ORIENTATION ), Quaternion( Radian( -angle ), Vector3::YAXIS ), AlphaFunctions::Linear );
+  mAnimation.AnimateTo( Property( currentCube, Actor::Property::ORIENTATION ), Quaternion( Radian( -angle ), Vector3::YAXIS ), AlphaFunction::LINEAR );
   Vector3 position(currentCube.GetCurrentPosition());
-  mAnimation.AnimateTo( Property( currentCube, Actor::Property::POSITION ), Vector3( position.x*mDisplacementRatio, position.y, position.z ), AlphaFunctions::Bounce );
-  mAnimation.AnimateTo( Property( frontTile, Actor::Property::COLOR ), HALF_BRIGHTNESS, AlphaFunctions::EaseOut );
-  mAnimation.AnimateTo( Property( sideTile, Actor::Property::COLOR ), FULL_BRIGHTNESS, AlphaFunctions::EaseIn );
+  mAnimation.AnimateTo( Property( currentCube, Actor::Property::POSITION ), Vector3( position.x*mDisplacementRatio, position.y, position.z ), AlphaFunction::BOUNCE );
+  mAnimation.AnimateTo( Property( frontTile, Actor::Property::COLOR ), HALF_BRIGHTNESS, AlphaFunction::EASE_OUT );
+  mAnimation.AnimateTo( Property( sideTile, Actor::Property::COLOR ), FULL_BRIGHTNESS, AlphaFunction::EASE_IN );
 }
 
 } // namespace Internal
index 1b0063d..818e670 100644 (file)
@@ -98,13 +98,13 @@ void CubeTransitionWaveEffect::OnStartTransition( Vector2 panPosition, Vector2 p
       float delay = thirdAnimationDuration * CalculateDelay(x*mTileSize.width,y*mTileSize.height);
 
       mAnimation.AnimateTo( Property( mBoxes[idx], Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -angle ) ), Vector3::YAXIS ),
-                            AlphaFunctions::EaseOutSine, TimePeriod( delay, thirdAnimationDuration ) );
+                            AlphaFunction::EASE_OUT_SINE, TimePeriod( delay, thirdAnimationDuration ) );
       mAnimation.AnimateBy( Property( mBoxes[idx], Actor::Property::POSITION ), Vector3( 0.f, 0.f, -mCubeDisplacement ),
-                         AlphaFunctions::Bounce, TimePeriod( delay, thirdAnimationDuration ) );
+                         AlphaFunction::BOUNCE, TimePeriod( delay, thirdAnimationDuration ) );
       mAnimation.AnimateTo( Property( mTiles[anotherIndex][idx], Actor::Property::COLOR ), HALF_BRIGHTNESS,
-                          AlphaFunctions::EaseOut, TimePeriod( delay, thirdAnimationDuration ) );
+                          AlphaFunction::EASE_OUT, TimePeriod( delay, thirdAnimationDuration ) );
       mAnimation.AnimateTo( Property( mTiles[mContainerIndex][idx], Actor::Property::COLOR ), FULL_BRIGHTNESS,
-                          AlphaFunctions::EaseIn, TimePeriod( delay, thirdAnimationDuration ) );
+                          AlphaFunction::EASE_IN, TimePeriod( delay, thirdAnimationDuration ) );
     }
   }
 
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.
diff --git a/dali-toolkit/public-api/controls/cluster/cluster-style.cpp b/dali-toolkit/public-api/controls/cluster/cluster-style.cpp
deleted file mode 100644 (file)
index 0e2d988..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
-
-// EXTERNAL INCLUDES
-#include <limits>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/cluster/cluster-style-impl.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-// ClusterStyle ///////////////////////////////////////////////////////////////
-
-const unsigned int ClusterStyle::UNLIMITED_CHILDREN = std::numeric_limits<unsigned int>::max();
-
-ClusterStyle::ClusterStyle()
-{
-}
-
-ClusterStyle::~ClusterStyle()
-{
-}
-
-ClusterStyle::ClusterStyle(Internal::ClusterStyle* internal)
-: BaseHandle(internal)
-{
-}
-
-unsigned int ClusterStyle::GetMaximumNumberOfChildren() const
-{
-  return GetImpl(*this).GetMaximumNumberOfChildren();
-}
-
-void ClusterStyle::ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds)
-{
-  GetImpl(*this).ApplyStyle(child, index, alpha, durationSeconds);
-}
-
-void ClusterStyle::ApplyStyleToBackground(Actor background, AlphaFunction alpha, const TimePeriod& durationSeconds)
-{
-  GetImpl(*this).ApplyStyleToBackground(background, alpha, durationSeconds);
-}
-
-void ClusterStyle::ApplyStyleToTitle(Actor title, AlphaFunction alpha, const TimePeriod& durationSeconds)
-{
-  GetImpl(*this).ApplyStyleToTitle(title, alpha, durationSeconds);
-}
-
-// ClusterStyleStandard ///////////////////////////////////////////////////////
-
-ClusterStyleStandard ClusterStyleStandard::New(StyleType style)
-{
-  Internal::ClusterStylePtr internal = Internal::ClusterStyleStandard::New(style);
-
-  return ClusterStyleStandard(internal.Get());
-}
-
-ClusterStyleStandard::ClusterStyleStandard(Internal::ClusterStyle* internal)
-: ClusterStyle(internal)
-{
-}
-
-// ClusterStyleRandom /////////////////////////////////////////////////////////
-
-ClusterStyleRandom ClusterStyleRandom::New()
-{
-  Internal::ClusterStylePtr internal = Internal::ClusterStyleRandom::New();
-
-  return ClusterStyleRandom(internal.Get());
-}
-
-ClusterStyleRandom::ClusterStyleRandom(Internal::ClusterStyle* internal)
-: ClusterStyle(internal)
-{
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/cluster/cluster-style.h b/dali-toolkit/public-api/controls/cluster/cluster-style.h
deleted file mode 100644 (file)
index 7596b66..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-#ifndef __DALI_TOOLKIT_CLUSTER_STYLE_H__
-#define __DALI_TOOLKIT_CLUSTER_STYLE_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/actor.h>
-#include <dali/public-api/animation/alpha-functions.h>
-#include <dali/public-api/animation/time-period.h>
-#include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/object/base-handle.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/enums.h>
-
-namespace Dali
-{
-
-class Actor;
-
-namespace Toolkit
-{
-
-namespace Internal DALI_INTERNAL
-{
-class ClusterStyle;
-class ClusterStyleRandom;
-}
-
-class ClusterStyle;
-
-typedef IntrusivePtr<ClusterStyle> ClusterStylePtr; ///< Pointer to a Dali::Toolkit::ClusterStyle object
-
-/**
- * @brief A ClusterStyle describes the constraints which are imposed on the child actors in the cluster.
- */
-class DALI_IMPORT_API ClusterStyle : public Dali::BaseHandle
-{
-public:
-
-  static const unsigned int UNLIMITED_CHILDREN; ///< Constant that represents an unlimited number of children.
-
-public:
-
-  /**
-   * @brief Destructor
-   *
-   * This is non-virtual since derived Handle types must not contain data or virtual methods.
-   */
-  ~ClusterStyle();
-
-  /**
-   * @brief Query the maximum number of children this Style can handle.
-   *
-   * If return value is UNLIMITED_CHILDREN, then this style has no
-   * limit.
-   * @return The maximum number of children.
-   */
-  unsigned int GetMaximumNumberOfChildren() const;
-
-  /**
-   * @brief Applies style (position) to child actor over a specified time duration.
-   *
-   * @param[in] child The child actor to apply
-   * @param[in] index The style position index for the actor to transform to.
-   * @param[in] alpha The alpha function to use.
-   * @param[in] durationSeconds The time period to apply this style.
-   */
-  void ApplyStyle(Actor child, unsigned int index, AlphaFunction alpha, const TimePeriod& durationSeconds);
-
-  /**
-   * @brief Applies style to background actor over a specified time duration.
-   *
-   * @param[in] background The background actor to apply
-   * @param[in] alpha The alpha function to use.
-   * @param[in] durationSeconds The time period to apply this style.
-   */
-  void ApplyStyleToBackground(Actor background, AlphaFunction alpha, const TimePeriod& durationSeconds);
-
-  /**
-   * @brief Applies style to title actor over a specified time duration.
-   *
-   * @param[in] title The title actor to apply
-   * @param[in] alpha The alpha function to use.
-   * @param[in] durationSeconds The time period to apply this style.
-   */
-  void ApplyStyleToTitle(Actor title, AlphaFunction alpha, const TimePeriod& durationSeconds);
-
-protected:
-
-  /**
-   * @brief Create a new ClusterStyle; Only derived versions are instantiatable.
-   */
-  ClusterStyle();
-
-public: // Not intended for application developers
-
-  /**
-   * @brief This constructor is used by Dali New() methods.
-   *
-   * @param [in] internal A pointer to a newly allocated Dali resource
-   */
-  explicit DALI_INTERNAL ClusterStyle(Internal::ClusterStyle* internal);
-};
-
-/**
- * @brief A ClusterStyle describes the constraints, which are imposed on the child actors in the cluster.
- */
-class DALI_IMPORT_API ClusterStyleStandard : public ClusterStyle
-{
-public:
-
-  /**
-   * @brief Cluster Style type.
-   */
-  enum StyleType
-  {
-    ClusterStyle1,     ///< Style number 1
-    ClusterStyle2,     ///< Style number 2
-    ClusterStyle3,     ///< Style number 3
-    ClusterStyle4,     ///< Style number 4
-    TotalClusterStyles ///< The number of styles
-  };
-
-public:
-
-  /**
-   * @brief Create an initialized style.
-   */
-  static ClusterStyleStandard New(StyleType style);
-
-public: // Not intended for application developers
-
-  /**
-   * @brief This constructor is used by Dali New() methods.
-   *
-   * @param [in] internal A pointer to a newly allocated Dali resource
-   */
-  explicit DALI_INTERNAL ClusterStyleStandard(Internal::ClusterStyle* internal);
-};
-
-/**
- * @brief A ClusterStyle describes the constraints, which are imposed on the child actors in the cluster.
- */
-class DALI_IMPORT_API ClusterStyleRandom : public ClusterStyle
-{
-public:
-
-  /**
-   * @brief Create an initialized style.
-   */
-  static ClusterStyleRandom New();
-
-public: // Not intended for application developers
-
-  /**
-   * @brief This constructor is used by Dali New() methods.
-   *
-   * @param [in] internal A pointer to a newly allocated Dali resource
-   */
-  explicit DALI_INTERNAL ClusterStyleRandom(Internal::ClusterStyle* internal);
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_CLUSTER_STYLE_H__
diff --git a/dali-toolkit/public-api/controls/cluster/cluster.cpp b/dali-toolkit/public-api/controls/cluster/cluster.cpp
deleted file mode 100644 (file)
index aab2765..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-
-#include <dali-toolkit/public-api/controls/cluster/cluster.h>
-
-// INTERNAL INCLUDES
-
-#include <dali-toolkit/internal/controls/cluster/cluster-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Cluster
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-const std::string Cluster::CLUSTER_ACTOR_DEPTH( "cluster-actor-depth" );
-
-Cluster::Cluster()
-{
-}
-
-Cluster::Cluster(const Cluster& cluster)
-: Control(cluster)
-{
-}
-
-Cluster& Cluster::operator =(const Cluster& cluster)
-{
-  if( &cluster != this )
-  {
-    Control::operator=( cluster );
-  }
-  return *this;
-}
-
-Cluster::~Cluster()
-{
-}
-
-Cluster Cluster::New( ClusterStyle& style )
-{
-  return Internal::Cluster::New(style);
-}
-
-Cluster Cluster::DownCast( BaseHandle handle )
-{
-  return Control::DownCast<Cluster, Internal::Cluster>(handle);
-}
-
-void Cluster::AddChild( Actor child )
-{
-  GetImpl(*this).AddChild( child );
-}
-
-void Cluster::AddChild( Actor child, unsigned int positionIndex )
-{
-  GetImpl(*this).AddChild( child, positionIndex);
-}
-
-void Cluster::AddChildAt( Actor child, unsigned int index )
-{
-  GetImpl(*this).AddChildAt( child, index );
-}
-
-void Cluster::AddChildAt( Actor child, unsigned int positionIndex, unsigned int index )
-{
-  GetImpl(*this).AddChildAt( child, positionIndex, index );
-}
-
-Actor Cluster::GetChildAt( unsigned int index )
-{
-  return GetImpl(*this).GetChildAt(index);
-}
-
-Actor Cluster::RemoveChildAt( unsigned int index )
-{
-  return GetImpl(*this).RemoveChildAt(index);
-}
-
-void Cluster::ExpandChild( unsigned int index )
-{
-  GetImpl(*this).ExpandChild(index);
-}
-
-void Cluster::ExpandAllChildren()
-{
-  GetImpl(*this).ExpandAllChildren();
-}
-
-void Cluster::CollapseChild( unsigned int index, bool front )
-{
-  GetImpl(*this).CollapseChild(index, front);
-}
-
-void Cluster::CollapseAllChildren( bool front )
-{
-  GetImpl(*this).CollapseAllChildren( front );
-}
-
-void Cluster::TransformChild( unsigned int index, const Vector3& position, const Vector3& scale, const Quaternion& rotation, AlphaFunction alpha, const TimePeriod& period )
-{
-  GetImpl(*this).TransformChild( index, position, scale, rotation, alpha, period );
-}
-
-void Cluster::RestoreChild( unsigned int index, AlphaFunction alpha, const TimePeriod& period, bool front )
-{
-  GetImpl(*this).RestoreChild( index, alpha, period, front );
-}
-
-void Cluster::SetBackgroundImage( Actor image )
-{
-  GetImpl(*this).SetBackgroundImage(image);
-}
-
-void Cluster::SetTitle( Actor text )
-{
-  GetImpl(*this).SetTitle(text);
-}
-
-void Cluster::SetStyle(ClusterStyle style)
-{
-  GetImpl(*this).SetStyle(style);
-}
-
-ClusterStyle Cluster::GetStyle() const
-{
-  return GetImpl(*this).GetStyle();
-}
-
-unsigned int Cluster::GetExpandedCount() const
-{
-  return GetImpl(*this).GetExpandedCount();
-}
-
-unsigned int Cluster::GetTotalCount() const
-{
-  return GetImpl(*this).GetTotalCount();
-}
-
-Cluster::Cluster( Internal::Cluster& impl )
-: Control( impl )
-{
-}
-
-Cluster::Cluster( Dali::Internal::CustomActor* internal )
-: Control( internal )
-{
-  VerifyCustomActorPointer<Internal::Cluster>(internal);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/cluster/cluster.h b/dali-toolkit/public-api/controls/cluster/cluster.h
deleted file mode 100644 (file)
index d417e0f..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-#ifndef __DALI_TOOLKIT_CLUSTER_H__
-#define __DALI_TOOLKIT_CLUSTER_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/animation/alpha-functions.h>
-#include <dali/public-api/animation/time-period.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal DALI_INTERNAL
-{
-class Cluster;
-}
-
-class ClusterStyle;
-
-/**
- * @brief Cluster is a container of grouped actors positioned in different cluster styles.
- *
- * Actions
- * | %Action Name              | Method                    |
- * |---------------------------|---------------------------|
- * | expand                    | DoExpandAction()          |
- * | collapse                  | DoCollapseAction()        |
- * | transform                 | DoTransformAction()       |
- */
-class DALI_IMPORT_API Cluster : public Control
-{
-public:
-
-  // Custom properties
-
-  static const std::string CLUSTER_ACTOR_DEPTH;                           ///< Property, name "cluster-actor-depth",      type float
-
-public:
-
-  /**
-   * Create a Cluster handle; this can be initialised with Cluster::New()
-   * Calling member functions with an uninitialised handle is not allowed.
-   */
-  Cluster();
-
-  /**
-   * Copy Constructor.
-   */
-  Cluster( const Cluster& cluster );
-
-  /**
-   * Assignment Operator.
-   */
-  Cluster& operator=( const Cluster& cluster );
-
-  /**
-   * @brief Destructor
-   *
-   * This is non-virtual since derived Handle types must not contain data or virtual methods.
-   */
-  ~Cluster();
-
-  /**
-   * Create the Cluster control with the given style.
-   * @param[in] style The style of the cluster
-   * @return A handle to the Cluster control.
-   */
-  static Cluster New( ClusterStyle& style );
-
-  /**
-   * Downcast an Object handle to Cluster. If handle points to a Cluster the
-   * downcast produces valid handle. If not the returned handle is left uninitialized.
-   * @param[in] handle Handle to an object
-   * @return handle to a Cluster or an uninitialized handle
-   */
-  static Cluster DownCast( BaseHandle handle );
-
-  /**
-   * Adds a child to the Cluster
-   * Will automatically choose a position for the child.
-   * @pre The child actor has been initialized.
-   * @param[in] child The child to add
-   */
-  void AddChild( Actor child );
-
-  /**
-   * Adds a child to the Cluster
-   * User specifies the position for the child.
-   * @pre The child actor has been initialized.
-   * @param[in] child The child to add
-   * @param[in] positionIndex The position for this child
-   */
-  void AddChild( Actor child, unsigned int positionIndex );
-
-  /**
-   * Adds a child to the Cluster to be inserted at a specified
-   * depth index.
-   * Will automatically choose a position for the child.
-   * @pre The child actor has been initialized.
-   * @param[in] child The child to add
-   * @param[in] index The depth position for this child
-   */
-  void AddChildAt( Actor child, unsigned int index );
-
-  /**
-   * Adds a child to the Cluster to be inserted at a specified
-   * depth index.
-   * User specifies the position for the child.
-   * @pre The child actor has been initialized.
-   * @param[in] child The child to add
-   * @param[in] positionIndex The position for this child
-   * @param[in] index The depth position for this child
-   */
-  void AddChildAt( Actor child, unsigned int positionIndex, unsigned int index );
-
-  /**
-   * Returns a child from the given layout position
-   * Note! if there is no child in this layout position this method returns an uninitialized
-   * Actor handle
-   * @param[in] index The child index in the cluster
-   * @return The child that was in the layout position or an uninitialized handle
-   */
-  Actor GetChildAt( unsigned int index );
-
-  /**
-   * Removes a child from the given layout position
-   * Note! if there is no child in this layout position this method does nothing
-   * @param[in] index The index of the child to remove
-   * @return The child that was removed or an uninitialized handle
-   */
-  Actor RemoveChildAt( unsigned int index );
-
-  /**
-   * Expands a child
-   * A child will move away from the cluster.
-   * @param[in] index The child position index to expand
-   */
-  void ExpandChild( unsigned int index );
-
-  /**
-   * Expands all children
-   * All children that have been collapsed will
-   * move away from the cluster
-   */
-  void ExpandAllChildren();
-
-  /**
-   * Collapses a child
-   * A child that has been expanded will move
-   * back to its original positions.
-   * @param[in] index The child index to collapse
-   * @param[in] front Whether to move child to the front or
-   * back of cluster (depth).
-   */
-  void CollapseChild( unsigned int index, bool front = false );
-
-  /**
-   * Collapses all children.
-   * All children that have been expanded will move
-   * back to their original positions.
-   * @param[in] front Whether to move child to the front or
-   * back of cluster (depth).
-   */
-  void CollapseAllChildren( bool front = false );
-
-  /**
-   * Transforms Actor from default transform to new transform
-   * @param[in] index The child index to move
-   * @param[in] position The position to move to
-   * @param[in] scale The scale to change to
-   * @param[in] rotation The rotation to change to
-   * @param[in] alpha The alpha function to use to tween to this transform
-   * @param[in] period The duration for this transformation to take
-   */
-  void TransformChild( unsigned int index, const Vector3& position, const Vector3& scale, const Quaternion& rotation, AlphaFunction alpha, const TimePeriod& period );
-
-  /**
-   * Restores Actor to the default transform (based on current style)
-   * @param[in] index The child index to move back
-   * @param[in] alpha The alpha function to use to tween to this transform
-   * @param[in] period The duration for this transformation to take
-   * @param[in] front Whether to move child to the front or
-   * back of cluster (depth).
-   */
-  void RestoreChild( unsigned int index, AlphaFunction alpha, const TimePeriod& period, bool front = false );
-
-  /**
-   * Sets the background image.
-   * @param[in] image The background image.
-   */
-  void SetBackgroundImage( Actor image );
-
-  /**
-   * Sets the title.
-   *
-   * @param[in] text Title text.
-   */
-  void SetTitle( Actor text );
-
-  /**
-   * Sets the style of the cluster
-   * @param[in] style The style of the cluster
-   */
-  void SetStyle(ClusterStyle style);
-
-  /**
-   * Gets the style of the cluster
-   * @return style of the cluster
-   */
-  ClusterStyle GetStyle() const;
-
-  /**
-   * Gets the number of children that have been expanded in this cluster.
-   * @return the number of children expanded.
-   */
-  unsigned int GetExpandedCount() const;
-
-  /**
-   * Gets the number of children that have been added to this cluster.
-   * @return the total number of children.
-   */
-  unsigned int GetTotalCount() const;
-
-public: // Not intended for application developers
-
-  /**
-   * Creates a handle using the Toolkit::Internal implementation.
-   * @param[in]  implementation  The Control implementation.
-   */
-  DALI_INTERNAL Cluster( Internal::Cluster& implementation );
-
-  /**
-   * Allows the creation of this Control from an Internal::CustomActor pointer.
-   * @param[in]  internal  A pointer to the internal CustomActor.
-   */
-  explicit DALI_INTERNAL Cluster( Dali::Internal::CustomActor* internal );
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_CLUSTER_H__
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..00cab60 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.
@@ -19,7 +19,7 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/controls/navigation-frame/page.h>
 #include <dali-toolkit/public-api/controls/navigation-frame/navigation-bar-style.h>
index ad075ef..46287a4 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.
@@ -29,9 +29,6 @@ namespace Dali
 namespace Toolkit
 {
 
-const char* const Page::PROPERTY_TITLE = "title";
-const char* const Page::PROPERTY_SUB_TITLE = "sub-title";
-
 Page::Page()
 {
 }
index 02b71bc..e0cf616 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.
@@ -49,11 +49,25 @@ class DALI_IMPORT_API Page : public Control
 public:
 
   /**
-   * The names of custom properties installed by this control.
+   * @brief The start and end property ranges for this control.
    */
-  // Property Names
-  static const char* const PROPERTY_TITLE;       ///< name "title", type std::string
-  static const char* const PROPERTY_SUB_TITLE;   ///< name "sub-title", type std::string
+  enum PropertyRange
+  {
+    PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
+    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserve property indices
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the Page class.
+   */
+  struct Property
+  {
+    enum
+    {
+      TITLE = PROPERTY_START_INDEX, ///< name "title",          @see SetTitle(),         type string
+      SUB_TITLE,                    ///< name "sub-title",      @see SetSubTitle(),      type string
+    };
+  };
 
   /**
    * Structure to indicate a control on the navigation tool bar and its group (HorizontalLeft, HorizontalRight or HorizontalCenter)
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 7b4e3f6..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.
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 35d5ab6..d855167 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.
@@ -624,8 +624,8 @@ void GridLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 s
 
     // Do a nonlinear size animation to shrink the actor first when the actor size changes,
     // so that we can avoid the actors overlapping during orientation change.
-    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), shrink, AlphaFunctions::EaseOut, TimePeriod( 0.0f, durationSeconds * 0.5f ) );
-    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, AlphaFunctions::EaseIn, TimePeriod( 0.0f, durationSeconds ) );
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), shrink, AlphaFunction::EASE_OUT, TimePeriod( 0.0f, durationSeconds * 0.5f ) );
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, AlphaFunction::EASE_IN, TimePeriod( 0.0f, durationSeconds ) );
   }
 }
 
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..7d6d17f 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.
@@ -130,7 +130,7 @@ namespace Toolkit
 
 ItemLayout::ItemLayout()
 : mOrientation( ControlOrientation::Up ),
-  mAlphaFunction( AlphaFunctions::Linear ),
+  mAlphaFunction( AlphaFunction::LINEAR ),
   mWeightObject()
 {
 }
@@ -291,7 +291,7 @@ void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float d
     keyFrames.Add( 1.0f, 1.0f );
 
     Animation applyAnimation = Dali::Animation::New( durationSeconds );
-    applyAnimation.AnimateBetween( Property( mWeightObject, WeightObject::WEIGHT ), keyFrames, mAlphaFunction, durationSeconds );
+    applyAnimation.AnimateBetween( Property( mWeightObject, WeightObject::WEIGHT ), keyFrames, mAlphaFunction, TimePeriod(durationSeconds) );
     applyAnimation.Play();
   }
 }
index ee9ca7d..169ad2b 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.
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <boost/function.hpp>
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/common/vector-wrapper.h>
 
 // INTERNAL INCLUDES
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 71bf4a8..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.
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..e7b02f2 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.
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
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 7935752..5340137 100644 (file)
@@ -59,6 +59,11 @@ TextField TextField::DownCast( BaseHandle handle )
   return Control::DownCast<TextField, Internal::TextField>(handle);
 }
 
+TextField::MaxLengthReachedSignalType& TextField::MaxLengthReachedSignal()
+{
+  return Dali::Toolkit::GetImpl( *this ).MaxLengthReachedSignal();
+}
+
 TextField::TextField( Internal::TextField& implementation )
 : Control(implementation)
 {
index 3736a2f..0af8dc0 100644 (file)
@@ -34,6 +34,12 @@ class TextField;
 
 /**
  * @brief A control which provides a single-line editable text field.
+ *
+ *  * Signals
+ * | %Signal Name           | Method                                              |
+ * |------------------------|-----------------------------------------------------|
+ * | max-length-reached     | @ref MaxLengthReachedSignal()                       |
+ *
  */
 class DALI_IMPORT_API TextField : public Control
 {
@@ -55,22 +61,34 @@ public:
   {
     enum
     {
-      RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "rendering-backend",       The type or rendering e.g. bitmap-based,                                  type INT
-      PLACEHOLDER_TEXT,                         ///< name "placeholder-text",        The text to display when the TextField is empty,                          type STRING
-      TEXT,                                     ///< name "text",                    The text to display in UTF-8 format,                                      type STRING
-      FONT_FAMILY,                              ///< name "font-family",             The requested font family,                                                type STRING
-      FONT_STYLE,                               ///< name "font-style",              The requested font style e.g. Regular/Italic,                             type STRING
-      POINT_SIZE,                               ///< name "point-size",              The size of font in points,                                               type FLOAT
-      EXCEED_POLICY,                            ///< name "exceed-policy"            Specifies how the text is truncated when it does not fit,                 type INT
-      PRIMARY_CURSOR_COLOR,                     ///< name "primary-cursor-color",    The color to apply to the primary cursor,                                 type VECTOR4
-      SECONDARY_CURSOR_COLOR,                   ///< name "secondary-cursor-color",  The color to apply to the secondary cursor,                               type VECTOR4
-      ENABLE_CURSOR_BLINK,                      ///< name "enable-cursor-blink",     Whether the cursor should blink or not,                                   type BOOLEAN
-      CURSOR_BLINK_INTERVAL,                    ///< name "cursor-blink-interval",   The time interval between cursor on/off states,                           type FLOAT
-      CURSOR_BLINK_DURATION,                    ///< name "cursor-blink-duration",   The cursor will stop blinking after this duration (if non-zero),          type FLOAT
-      GRAB_HANDLE_IMAGE,                        ///< name "grab-handle-image",       The image to display for grab handle,                                     type STRING
-      DECORATION_BOUNDING_BOX,                  ///< name "decoration-bounding-box", The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE
-      HORIZONTAL_ALIGNMENT,                     ///< name "horizontal-alignment",    The line horizontal alignment,                                            type STRING,  values "BEGIN", "CENTER", "END"
-      VERTICAL_ALIGNMENT                        ///< name "vertical-alignment",      The line vertical alignment,                                              type STRING,  values   "TOP",   "CENTER",   "BOTTOM"
+      RENDERING_BACKEND = PROPERTY_START_INDEX, ///< name "rendering-backend",                   The type or rendering e.g. bitmap-based,                                  type INT
+      PLACEHOLDER_TEXT,                         ///< name "placeholder-text",                    The text to display when the TextField is empty,                          type STRING
+      TEXT,                                     ///< name "text",                                The text to display in UTF-8 format,                                      type STRING
+      FONT_FAMILY,                              ///< name "font-family",                         The requested font family,                                                type STRING
+      FONT_STYLE,                               ///< name "font-style",                          The requested font style e.g. Regular/Italic,                             type STRING
+      POINT_SIZE,                               ///< name "point-size",                          The size of font in points,                                               type FLOAT
+      MAX_LENGTH,                               ///< name "max-length"                           The maximum number of characters that can be inserted,                    type INTEGER
+      EXCEED_POLICY,                            ///< name "exceed-policy"                        Specifies how the text is truncated when it does not fit,                 type INTEGER
+      HORIZONTAL_ALIGNMENT,                     ///< name "horizontal-alignment",                The line horizontal alignment,                                            type STRING,  values "BEGIN", "CENTER", "END"
+      VERTICAL_ALIGNMENT,                       ///< name "vertical-alignment",                  The line vertical alignment,                                              type STRING,  values   "TOP",   "CENTER",   "BOTTOM"
+      TEXT_COLOR,                               ///< name "text-color",                          The text color,                                                           type VECTOR4
+      SHADOW_OFFSET,                            ///< name "shadow-offset",                       The drop shadow offset 0 indicates no shadow,                             type VECTOR2
+      SHADOW_COLOR,                             ///< name "shadow-color",                        The color of a drop shadow,                                               type VECTOR4
+      PRIMARY_CURSOR_COLOR,                     ///< name "primary-cursor-color",                The color to apply to the primary cursor,                                 type VECTOR4
+      SECONDARY_CURSOR_COLOR,                   ///< name "secondary-cursor-color",              The color to apply to the secondary cursor,                               type VECTOR4
+      ENABLE_CURSOR_BLINK,                      ///< name "enable-cursor-blink",                 Whether the cursor should blink or not,                                   type BOOLEAN
+      CURSOR_BLINK_INTERVAL,                    ///< name "cursor-blink-interval",               The time interval in seconds between cursor on/off states,                type FLOAT
+      CURSOR_BLINK_DURATION,                    ///< name "cursor-blink-duration",               The cursor will stop blinking after this number of seconds (if non-zero), type FLOAT
+      GRAB_HANDLE_IMAGE,                        ///< name "grab-handle-image",                   The image to display for the grab handle,                                 type STRING
+      GRAB_HANDLE_PRESSED_IMAGE,                ///< name "grab-handle-pressed-image",           The image to display when the grab handle is pressed,                     type STRING
+      SCROLL_THRESHOLD,                         ///< name "scroll-threshold"                     Scrolling will occur if the cursor is this close to the control border,   type FLOAT
+      SCROLL_SPEED,                             ///< name "scroll-speed"                         The scroll speed in pixels per second,                                    type FLOAT
+      SELECTION_HANDLE_IMAGE_LEFT,              ///< name "selection-handle-image-left",         The image to display for the left selection handle,                       type STRING
+      SELECTION_HANDLE_IMAGE_RIGHT,             ///< name "selection-handle-image-right",        The image to display for the right selection handle,                      type STRING
+      SELECTION_HANDLE_PRESSED_IMAGE_LEFT,      ///< name "selection-handle-pressed-image-left"  The image to display when the left selection handle is pressed,           type STRING
+      SELECTION_HANDLE_PRESSED_IMAGE_RIGHT,     ///< name "selection-handle-pressed-image-right" The image to display when the right selection handle is pressed,          type STRING
+      SELECTION_HIGHLIGHT_COLOR,                ///< name "selection-highlight-color"            The color of the selection highlight,                                     type VECTOR4
+      DECORATION_BOUNDING_BOX                   ///< name "decoration-bounding-box"              The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE
     };
   };
 
@@ -85,6 +103,11 @@ public:
     EXCEED_POLICY_CLIP             ///< The end of text will be clipped to fit within the TextField.
   };
 
+  // Type Defs
+
+  /// @brief Max Characters Exceed signal type;
+  typedef Signal<void ( TextField ) > MaxLengthReachedSignalType;
+
   /**
    * Create the TextField control.
    * @return A handle to the TextField control.
@@ -129,6 +152,19 @@ public:
    */
   static TextField DownCast( BaseHandle handle );
 
+  // Signals
+
+  /**
+   * @brief This signal is emitted when inserted text exceeds the maximum character limit.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName( TextField textField );
+   * @endcode
+   * @return The signal to connect to.
+   */
+  MaxLengthReachedSignalType& MaxLengthReachedSignal();
+
 public: // Not intended for application developers
 
   /**
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.
diff --git a/dali-toolkit/public-api/controls/view/view.cpp b/dali-toolkit/public-api/controls/view/view.cpp
deleted file mode 100644 (file)
index 277e975..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-
-#include "view.h"
-
-// EXTERNAL INCLUDES
-
-// INTERNAL INCLUDES
-
-#include <dali-toolkit/internal/controls/view/view-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-View::View()
-{
-}
-
-View::View( const View& handle )
-: Control( handle )
-{
-}
-
-View& View::operator=( const View& handle )
-{
-  if( &handle != this )
-  {
-    Control::operator=( handle );
-  }
-  return *this;
-}
-
-View::~View()
-{
-}
-
-View View::New( bool fullscreen )
-{
-  return Internal::View::New( fullscreen );
-}
-
-View View::DownCast( BaseHandle handle )
-{
-  return Control::DownCast<View, Internal::View>(handle);
-}
-
-Layer View::GetContentLayer( unsigned int index ) const
-{
-  return GetImpl( *this ).GetContentLayer( index );
-}
-
-unsigned int View::AddContentLayer( Layer layer )
-{
-  return GetImpl( *this ).AddContentLayer( layer );
-}
-
-void View::RemoveContentLayer( Layer layer )
-{
-  GetImpl( *this ).RemoveContentLayer( layer );
-}
-
-Layer View::GetBackgroundLayer() const
-{
-  return GetImpl( *this ).GetBackgroundLayer();
-}
-
-void View::SetBackground( ImageActor image )
-{
-  GetImpl( *this ).SetBackground( image );
-}
-
-void View::SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree landscapeInverse )
-{
-  GetImpl( *this ).SetOrientationFunction( portrait, landscale, portraitInverse, landscapeInverse );
-}
-
-void View::OrientationChanged( Orientation orientation )
-{
-  GetImpl( *this ).OrientationChanged( orientation );
-}
-
-void View::SetAutoRotate( bool enabled )
-{
-  GetImpl( *this ).SetAutoRotate( enabled );
-}
-
-View::OrientationAnimationStartedSignalType& View::OrientationAnimationStartedSignal()
-{
-  return GetImpl( *this ).OrientationAnimationStartedSignal();
-}
-
-View::View( Internal::View& implementation )
-: Control( implementation )
-{
-}
-
-View::View( Dali::Internal::CustomActor* internal )
-: Control( internal )
-{
-  VerifyCustomActorPointer<Internal::View>(internal);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/view/view.h b/dali-toolkit/public-api/controls/view/view.h
deleted file mode 100644 (file)
index b42340c..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-#ifndef __DALI_TOOLKIT_VIEW_H__
-#define __DALI_TOOLKIT_VIEW_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/adaptor-framework/orientation.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal DALI_INTERNAL
-{
-// Forward declarations
-class View;
-}
-
-/**
- * View provides a container where different Dali::Layer instances and a background could be added. It
- * also provides a View::OrientationChanged() method which could be connected to the Dali::Orientation::SignalChange() signal.
- * This method rotates all layers accordingly with the given orientation, it emits an OrientationAnimationStartsSignal signal just before the rotation animation starts.
- *
- * By default view anchor point and parent origin are centered, the size is full screen and is got directly from the Dali::Stage. However, by passing \e false to the
- * Toolkit::View::New() method a custom size could be specified, and after initialization, anchor point and parent origin could be updated.
- *
- * If a background is set, a background layer will be created and dropped to the bottom.
- *
- * Use example (application is a Dali::Application object):
- * \code{.cpp}
- * Stage stage = Stage::GetCurrent();
- *
- * // Create default View. By default it gets the stage size.
- * Toolkit::View view = Toolkit::View::New();
- *
- * // Add the view to the stage before setting the background.
- * stage.Add( view );
- *
- * // Set background image. BACKGROUND_IMAGE is a string with the background image file path.
- * Image backgroundImage = Image::New( BACKGROUND_IMAGE );
- * ImageActor backgroundImageActor = ImageActor::New( backgroundImage );
- * mView.SetBackground( backgroundImageActor );
- *
- * // Connects the orientation signal with the View::OrientationChanged method.
- * application.GetWindow().GetOrientation().ChangedSignal().Connect( &view, &Toolkit::View::OrientationChanged );
- *
- * // Create a content layer.
- * Layer contentLayer = Layer::New();
- * contentLayer.SetAnchorPoint( AnchorPoint::CENTER );
- * contentLayer.SetParentOrigin( ParentOrigin::CENTER );
- * view.AddContentLayer( contentLayer );
- * \endcode
- *
- * Signals
- * | %Signal Name                | Method                                   |
- * |-----------------------------|------------------------------------------|
- * | orientation-animation-start | @ref OrientationAnimationStartedSignal() |
-
- */
-class DALI_IMPORT_API View : public Control
-{
-
-public:
-
-  /**
-   * Create a View handle; this can be initialised with View::New()
-   * Calling member functions with an uninitialised handle is not allowed.
-   */
-  View();
-
-  /**
-   * Copy constructor. Creates another handle that points to the same real object
-   * @param handle to copy from
-   */
-  View( const View& handle );
-
-  /**
-   * Assignment operator. Changes this handle to point to another real object
-   */
-  View& operator=( const View& handle );
-
-  /**
-   * @brief Destructor
-   *
-   * This is non-virtual since derived Handle types must not contain data or virtual methods.
-   */
-  ~View();
-
-  /**
-   * Create an initialized View.
-   * @param fullscreen If true, the view's size is going to be set with the Dali::Stage size. Otherwise a size must be provided. By default fullscreen is set to true.
-   * @return A handle to a newly allocated Dali resource.
-   */
-  static View New( bool fullscreen = true );
-
-  /**
-   * Downcast an Object handle to View. If handle points to a View the
-   * downcast produces valid handle. If not the returned handle is left uninitialized.
-   * @param[in] handle Handle to an object
-   * @return handle to a View or an uninitialized handle
-   */
-  static View DownCast( BaseHandle handle );
-
-  /**
-   * Returns a content layer.
-   * @param index to the layer container.
-   * @return A Layer handle if it exists, otherwise it returns an uninitialized handle.
-   */
-  Layer GetContentLayer( unsigned int index ) const;
-
-  /**
-   * Adds a new layer in the view.
-   * @pre layer must be initialized.
-   * @param layer A Layer handle.
-   * @return the an index that can be used to access the layer stores in the view.
-   */
-  unsigned int AddContentLayer( Layer layer );
-
-  /**
-   * Removes a layer from the view.
-   * @param layer The layer to be removed.
-   */
-  void RemoveContentLayer( Layer layer );
-
-  /**
-   * Returns the background layer.
-   * @return the background layer or an empty handle if any background has been set before.
-   */
-  Layer GetBackgroundLayer() const;
-
-  /**
-   * Sets a background image.
-   *
-   * It creates a background layer the first time this method is called and it is dropped to the bottom.
-   * Any previous set background will be replaced by the new one.
-   *
-   * @pre View must be on stage before calling SetBackground.
-   * @param image An image actor.
-   */
-  void SetBackground( ImageActor image );
-
-  /**
-   * Sets the angle values for portrait, landscape, portrait inverse and landscape inverse.
-   *
-   * These angles are used to rotate the views.
-   * By default, orientation angles are initialized as follows: portrait 0, landscape 90, portrait inverse 180, landscape inverse 270.
-   *
-   * @param portrait angle in degrees.
-   * @param landscale angle in degrees.
-   * @param portraitInverse angle in degrees.
-   * @param landscapeInverse angle in degrees.
-   */
-  void SetOrientationFunction( Degree portrait, Degree landscale, Degree portraitInverse, Degree landscapeInverse );
-
-  /**
-   * It rotates all layers to the new given orientation.
-   *
-   * @param orientation The new orientation.
-   */
-  void OrientationChanged( Orientation orientation );
-
-  /**
-   * Enables or disables the view's rotation when device orientation changes.
-   * @param enabled Whether auto-rotate should be enabled or disabled. By default is enabled.
-   */
-  void SetAutoRotate( bool enabled );
-
-public: //Signals
-
-  // Orientation change animation starts.
-  typedef Signal< void ( View, Animation&, const Orientation& ) > OrientationAnimationStartedSignalType;
-
-  /**
-   * Signal emitted just before the rotate animation starts when the device orientation changes.
-   */
-  OrientationAnimationStartedSignalType& OrientationAnimationStartedSignal();
-
-public: // Not intended for application developers
-
-  /**
-   * Creates a handle using the Toolkit::Internal implementation.
-   * @param[in]  implementation  The Control implementation.
-   */
-  DALI_INTERNAL View( Internal::View& implementation );
-
-  /**
-   * Allows the creation of this Control from an Internal::CustomActor pointer.
-   * @param[in]  internal  A pointer to the internal CustomActor.
-   */
-  explicit DALI_INTERNAL View( Dali::Internal::CustomActor* internal );
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_VIEW_H__
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 41c390a..3eea93c 100755 (executable)
@@ -53,12 +53,9 @@ public_api_src_files = \
   $(public_api_src_dir)/controls/text-controls/text-selection-popup.cpp \
   $(public_api_src_dir)/controls/tool-bar/tool-bar.cpp \
   $(public_api_src_dir)/controls/bloom-view/bloom-view.cpp \
-  $(public_api_src_dir)/controls/cluster/cluster-style.cpp \
-  $(public_api_src_dir)/controls/cluster/cluster.cpp \
   $(public_api_src_dir)/controls/effects-view/effects-view.cpp \
   $(public_api_src_dir)/controls/gaussian-blur-view/gaussian-blur-view.cpp \
   $(public_api_src_dir)/controls/image-view/masked-image-view.cpp \
-  $(public_api_src_dir)/controls/view/view.cpp \
   $(public_api_src_dir)/focus-manager/focus-manager.cpp \
   $(public_api_src_dir)/focus-manager/keyboard-focus-manager.cpp \
   $(public_api_src_dir)/focus-manager/keyinput-focus-manager.cpp \
@@ -131,10 +128,6 @@ public_api_bloom_view_header_files = \
 public_api_bubble_emitter_header_files = \
   $(public_api_src_dir)/controls/bubble-effect/bubble-emitter.h
 
-public_api_cluster_header_files = \
-  $(public_api_src_dir)/controls/cluster/cluster-style.h \
-  $(public_api_src_dir)/controls/cluster/cluster.h
-
 public_api_default_controls_header_files = \
   $(public_api_src_dir)/controls/default-controls/check-button-factory.h \
   $(public_api_src_dir)/controls/default-controls/push-button-factory.h \
@@ -216,9 +209,6 @@ public_api_navigation_frame_header_files = \
   $(public_api_src_dir)/controls/navigation-frame/navigation-control.h \
   $(public_api_src_dir)/controls/navigation-frame/page.h
 
-public_api_view_header_files = \
-  $(public_api_src_dir)/controls/view/view.h
-
 public_api_focus_manager_header_files = \
   $(public_api_src_dir)/focus-manager/focus-manager.h \
   $(public_api_src_dir)/focus-manager/keyboard-focus-manager.h \
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..655f0c6 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.
@@ -43,7 +43,7 @@ namespace Toolkit
  *   // Start the animation
  *   Animation animation = Animation::New(1.f);
  *   animation.AnimateTo( Property( bouncingEffect, bouncingEffect.GetProgressRatePropertyName() ),
- *                        1.f, AlphaFunctions::Bounce );
+ *                        1.f, AlphaFunction::BOUNCE );
  *   animation.Play();
  */
 class DALI_IMPORT_API BouncingEffect : public ShaderEffect
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..aabb087 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.
@@ -62,11 +62,11 @@ namespace Toolkit
  * ImageActor fancyButton = ImageActor::New( ... );\n
  * fancyButton.SetShaderEffect( buttonEffect );
  *
- * // animate a button push, using e.g. AlphaFunctions::Bounce. With these values the button pushes in and out (animates to and fro between the two states)
+ * // animate a button push, using e.g. AlphaFunction::BOUNCE. With these values the button pushes in and out (animates to and fro between the two states)
  *
  *
  * Animation animation = Animation::New( ... );\n
- * animation.AnimateTo( Property(buttonEffect, buttonEffect.GetStatePropertyName()), 1.0f, AlphaFunctions::Bounce, ... );\n
+ * animation.AnimateTo( Property(buttonEffect, buttonEffect.GetStatePropertyName()), 1.0f, AlphaFunction::BOUNCE, ... );\n
  * animation.Play();\n
  *
  */
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..3e9abb4 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.
@@ -64,7 +64,7 @@ class PageTurnEffect;
  * Animation animation[mAnimationIndex] = Animation::New( ... );\n
  * animation.AnimateTo(Property( pageTurnEffect, pageTurnEffect.PageTurnEffect::GetCurrentCenterPropertyName() ),
  *                            currentCenter,
- *                            AlphaFunctions::...);\n
+ *                            AlphaFunction::...);\n
  * animation[mAnimationIndex].Play(); \n
  */
 
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..2464aa0 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.
@@ -40,12 +40,12 @@ namespace Toolkit
  * ImageActor imageActor = ImageActor::New( ... );\n
  * imageActor.SetShaderEffect( softButtonEffect );
  *
- * // animate a button push, using e.g. AlphaFunctions::Bounce. With these values the button pushes in and pops out slightly at the end\n
+ * // animate a button push, using e.g. AlphaFunction::BOUNCE. With these values the button pushes in and pops out slightly at the end\n
  * Animation animation = Animation::New( ... );\n
- * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetLightingIndentationAmountPropertyName()), 0.25f, AlphaFunctions::Bounce, ... );\n
- * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetLightingIndentationAmountPropertyName()), -0.05f, AlphaFunctions::Bounce, ... );\n
- * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetTextureDistortionAmountPropertyName()), 0.25f, AlphaFunctions::Bounce, ... );\n
- * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetTextureDistortionAmountPropertyName()), -0.05f, AlphaFunctions::Bounce, ... );\n
+ * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetLightingIndentationAmountPropertyName()), 0.25f, AlphaFunction::BOUNCE, ... );\n
+ * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetLightingIndentationAmountPropertyName()), -0.05f, AlphaFunction::BOUNCE, ... );\n
+ * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetTextureDistortionAmountPropertyName()), 0.25f, AlphaFunction::BOUNCE, ... );\n
+ * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetTextureDistortionAmountPropertyName()), -0.05f, AlphaFunction::BOUNCE, ... );\n
  * animation.Play();\n
  *
  */
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 2d19f4b..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.
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 d133614..347fc5e 100644 (file)
 
    AnimateBy and AnimateTo, method names are appended by 'By' or 'To' either animate to a supplied value or animate by a supplied value.  For example an actor at (10,10,10) calling AnimateBy(Property(actor, Actor::Property::POSITION), 50,0,0) would mean its location is (60,0,0) whilst AnimateTo(Property(actor, Actor::Property::POSITION), 50,0,0) would result in a location (50,0,0).
 
-   Dali::AlphaFunctions can be used to give interesting effects to the animation, for example the MOVEment of an actor on screen can speed up and slow down following a sine curve by using the Dali::AlphaFunctions::EaseInOutSine instead of AlphaFunctions::Linear.
+   Dali::AlphaFunction can be used to give interesting effects to the animation, for example the MOVEment of an actor on screen can speed up and slow down following a sine curve by using the Dali::AlphaFunction::EASE_IN_OUT_SINE instead of AlphaFunction::LINEAR
 
    @code
-   myAnimation.AnimateTo(Property(actor, Actor::Property::POSITION), Vector3(x, y, z), AlphaFunctions::Linear, delay, ANIMATOR_DURATION);
-   myAnimation.AnimateTo(Property(actor, Actor::Property::SIZE), actorSize, AlphaFunctions::EaseIn, delay, ANIMATOR_DURATION);
+   myAnimation.AnimateTo(Property(actor, Actor::Property::POSITION), Vector3(x, y, z), AlphaFunction::LINEAR, delay, ANIMATOR_DURATION);
+   myAnimation.AnimateTo(Property(actor, Actor::Property::SIZE), actorSize, AlphaFunction::EASE_IN, delay, ANIMATOR_DURATION);
    @endcode
    \section playback-control Controlling a playing animation
 
index 0351ec9..0bd51a0 100644 (file)
@@ -23,7 +23,7 @@
  * Quaternion q(Radian(Degree(45.0f)).value, Vector3::YAXIS);
  * Quaternion r(Radian(Degree(30.0f)).value, Vector3::ZAXIS);
  * q *= r;
- * mAnimation.AnimateTo(Property(mActor, Actor::Property::ORIENTATION), q, AlphaFunctions::EaseInOut);
+ * mAnimation.AnimateTo(Property(mActor, Actor::Property::ORIENTATION), q, AlphaFunction::EASE_IN_OUT);
  * mAnimation.Play();
  * @endcode
  */
index a6761d5..42c8195 100644 (file)
  * body.SetKinematic( true );
  * // create a second animation to move the actor 100 units to the right
  * Animation animation( Animation::New( 1 ) );
- * animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Vector3( 100, 0, 0 ), AlphaFunctions::Linear );
+ * animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Vector3( 100, 0, 0 ), AlphaFunction::LINEAR );
  * animation.Play();
  * \endcode
  * <hr>
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 2f64d83..334c709 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 ) );
@@ -249,7 +244,7 @@ PushButton, OKAY_BUTTON - Pos: [185, 0, 0.1] Size: [165, 76, 76], Dirty: (FALSE,
 
 The format is as follows:
 
-[Actor type], [Actor name] â€“ Pos:[X, Y, Z] Size[Dimension::WIDTH, Dimension::HEIGHT, DEPTH], Dirty:(Dimension::WIDTH, Dimension::HEIGHT), Negotiated: (Dimension::WIDTH, Dimension::HEIGHT), Enabled: BOOLEAN, (Object address)
+[Actor type], [Actor name] ? Pos:[X, Y, Z] Size[Dimension::WIDTH, Dimension::HEIGHT, DEPTH], Dirty:(Dimension::WIDTH, Dimension::HEIGHT), Negotiated: (Dimension::WIDTH, Dimension::HEIGHT), Enabled: BOOLEAN, (Object address)
 - <i>Actor type</i>: The type name of the actor E.g. PushButton
 - <i>Actor name</i>: The name set on the actor with SetName(). Useful for debugging.
 - <i>Pos</i>: The position of the actor
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 1a11440..9378742 100644 (file)
@@ -49,38 +49,30 @@ struct AlphaFuncStruct
  */
 const AlphaFuncStruct AlphaFunctionTable[]=
 {
- {"default"               , AlphaFunctions::Default              },
- {"linear"                , AlphaFunctions::Linear               },
- {"square"                , AlphaFunctions::Square               },
- {"reverse"               , AlphaFunctions::Reverse              },
- {"easeIn"                , AlphaFunctions::EaseIn               },
- {"easeOut"               , AlphaFunctions::EaseOut              },
- {"easeInOut"             , AlphaFunctions::EaseInOut            },
- {"easeInSine"            , AlphaFunctions::EaseInSine           },
- {"easeOutSine"           , AlphaFunctions::EaseOutSine          },
- {"easeInOutSine"         , AlphaFunctions::EaseInOutSine        },
- {"easeInSine33"          , AlphaFunctions::EaseInSine33         },
- {"easeOutSine33"         , AlphaFunctions::EaseOutSine33        },
- {"easeInOutSine33"       , AlphaFunctions::EaseInOutSine33      },
- {"easeInOutSine50"       , AlphaFunctions::EaseInOutSine50      },
- {"easeInOutSine60"       , AlphaFunctions::EaseInOutSine60      },
- {"easeInOutSine70"       , AlphaFunctions::EaseInOutSine70      },
- {"easeInOutSine80"       , AlphaFunctions::EaseInOutSine80      },
- {"easeInOutSine90"       , AlphaFunctions::EaseInOutSine90      },
- {"doubleEaseInOutSine60" , AlphaFunctions::DoubleEaseInOutSine60},
- {"easeOutQuint50"        , AlphaFunctions::EaseOutQuint50       },
- {"easeOutQuint80"        , AlphaFunctions::EaseOutQuint80       },
- {"bounce"                , AlphaFunctions::Bounce               },
- {"bounceBack"            , AlphaFunctions::BounceBack           },
- {"easeInBack"            , AlphaFunctions::EaseInBack           },
- {"easeOutBack"           , AlphaFunctions::EaseOutBack          },
- {"easeInOutBack"         , AlphaFunctions::EaseInOutBack        },
- {"sin"                   , AlphaFunctions::Sin                  },
- {"sin2x"                 , AlphaFunctions::Sin2x                }
+
+ {"default"               , AlphaFunction::DEFAULT              },
+ {"linear"                , AlphaFunction::LINEAR               },
+ {"reverse"               , AlphaFunction::REVERSE              },
+
+ {"easeInSquare"          , AlphaFunction::EASE_IN_SQUARE       },
+ {"easeOutSquare"         , AlphaFunction::EASE_OUT_SQUARE      },
+
+ {"easeIn"                , AlphaFunction::EASE_IN               },
+ {"easeOut"               , AlphaFunction::EASE_OUT              },
+ {"easeInOut"             , AlphaFunction::EASE_IN_OUT           },
+
+ {"easeInSine"            , AlphaFunction::EASE_IN_SINE          },
+ {"easeOutSine"           , AlphaFunction::EASE_OUT_SINE         },
+ {"easeInOutSine"         , AlphaFunction::EASE_IN_OUT_SINE      },
+
+ {"bounce"                , AlphaFunction::BOUNCE                },
+ {"sin"                   , AlphaFunction::SIN                   },
+ {"easeOutBack"           , AlphaFunction::EASE_OUT_BACK         },
+
 };
 const unsigned int AlphaFunctionTableCount = sizeof(AlphaFunctionTable)/sizeof(AlphaFunctionTable[0]);
 const char* const DEFAULT_ALPHA_NAME = "default";
-static AlphaFunction DEFAULT_ALPHA_FUNCTION = AlphaFunctions::Default;
+static AlphaFunction DEFAULT_ALPHA_FUNCTION = AlphaFunction::DEFAULT;
 
 
 
@@ -98,7 +90,7 @@ AlphaFunction GetAlphaFunction( const std::string& alphaFuncName )
   }
 
   DALI_LOG_ERROR("Failed to find alpha func |%s| \n", alphaFuncName.c_str() );
-  return AlphaFunctions::Default;
+  return DEFAULT_ALPHA_FUNCTION;
 }
 
 const char* const GetAlphaFunctionName(  AlphaFunction alphaFunc )
@@ -111,7 +103,7 @@ const char* const GetAlphaFunctionName(  AlphaFunction alphaFunc )
     const AlphaFuncStruct& alphaStruct( AlphaFunctionTable[i] );
 
 
-    if( alphaStruct.alphaFunc  == alphaFunc )
+    if( alphaStruct.alphaFunc.GetBuiltinFunction()  == alphaFunc.GetBuiltinFunction() )
     {
       return alphaStruct.name;
     }
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 61159e6..29bfb01 100644 (file)
@@ -428,7 +428,7 @@ void SetFromV8Value(v8::Isolate* isolate,
         Dali::Vector3 axis;
         Radian angle;
         value.Get<Dali::Quaternion>().ToAxisAngle( axis, angle );
-        value = Dali::Quaternion( Radian( Degree( asFloat ) ), axis );
+        value = Dali::Quaternion( Degree( asFloat ), axis );
       }
       else
       {
@@ -791,17 +791,17 @@ void PropertyValueWrapper::NewRotation( const v8::FunctionCallbackInfo< v8::Valu
 
   if( length > 3 )
   {
-    Dali::AngleAxis axis(  Degree( v[0] ), Vector3(v[1], v[2], v[3]) );
+    const Dali::AngleAxis axis(  Degree( v[0] ), Vector3(v[1], v[2], v[3]) );
     object = WrapDaliProperty( isolate, Dali::Property::Value( axis ) );
   }
   else if( length > 2 )
   {
-    object = WrapDaliProperty( isolate, Dali::Property::Value( Dali::Quaternion( Radian( Degree(v[0]) ), Radian( Degree(v[1]) ), Radian( Degree(v[2]) ) ) ) );
+    object = WrapDaliProperty( isolate, Dali::Quaternion( Degree(v[0]), Degree(v[1]), Degree(v[2]) ) );
   }
   else
   {
-    Dali::Quaternion quaternion( Dali::Quaternion( Dali::ANGLE_0, Dali::Vector3::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 );