Merge remote-tracking branch 'origin/tizen' into devel/new_mesh 99/39599/1
authorFrancisco Santos <f1.santos@samsung.com>
Tue, 19 May 2015 10:05:42 +0000 (11:05 +0100)
committerFrancisco Santos <f1.santos@samsung.com>
Tue, 19 May 2015 10:05:42 +0000 (11:05 +0100)
Conflicts:
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
dali-toolkit/internal/atlas-manager/atlas-manager.h
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h
dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/file.list
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/rendering/basic/text-basic-renderer.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
docs/content/main-page.h
docs/content/programming-guide/script-overview.h
packaging/dali-toolkit.spec

Change-Id: I672b8fe4c79dcabd9a3fe323ad55a1a368cc0b0e

270 files changed:
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.cpp
automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp
automated-tests/src/dali-toolkit/utc-Dali-DepthLayout.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-GridLayout.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-ItemLayout.cpp
automated-tests/src/dali-toolkit/utc-Dali-ItemView.cpp
automated-tests/src/dali-toolkit/utc-Dali-NavigationControl.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-Page.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollBar.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollViewEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp
automated-tests/src/dali-toolkit/utc-Dali-SpiralLayout.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
build/tizen/docs/dali.doxy.in
dali-toolkit/dali-toolkit.h
dali-toolkit/internal/atlas-manager/atlas-manager.h
dali-toolkit/internal/builder/builder-actor.cpp
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/builder-impl.h
dali-toolkit/internal/builder/builder-set-property.cpp
dali-toolkit/internal/builder/builder-signals.cpp
dali-toolkit/internal/builder/replacement.cpp
dali-toolkit/internal/controls/alignment/alignment-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-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/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/navigation-frame/navigation-bar.cpp [deleted file]
dali-toolkit/internal/controls/navigation-frame/navigation-bar.h [deleted file]
dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp [deleted file]
dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h [deleted file]
dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.cpp [deleted file]
dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.h [deleted file]
dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.cpp [deleted file]
dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.h [deleted file]
dali-toolkit/internal/controls/navigation-frame/page-impl.cpp [deleted file]
dali-toolkit/internal/controls/navigation-frame/page-impl.h [deleted file]
dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
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-bar/scroll-bar-impl.h
dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp [deleted file]
dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.h [deleted file]
dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.cpp [deleted file]
dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.h [deleted file]
dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp
dali-toolkit/internal/controls/scrollable/item-view/depth-layout.cpp [new file with mode: 0644]
dali-toolkit/internal/controls/scrollable/item-view/depth-layout.h [moved from dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.h with 67% similarity]
dali-toolkit/internal/controls/scrollable/item-view/grid-layout.cpp [new file with mode: 0644]
dali-toolkit/internal/controls/scrollable/item-view/grid-layout.h [moved from dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.h with 78% similarity]
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp
dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h
dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.cpp [new file with mode: 0644]
dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.h [moved from dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.h with 72% similarity]
dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.cpp [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.h [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp [new file with mode: 0644]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.h [new file with mode: 0644]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.cpp [deleted file]
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h [deleted file]
dali-toolkit/internal/controls/scrollable/scrollable-impl.cpp
dali-toolkit/internal/controls/scrollable/scrollable-impl.h
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/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/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.h
dali-toolkit/internal/file.list
dali-toolkit/internal/focus-manager/focus-manager-impl.cpp
dali-toolkit/internal/focus-manager/focus-manager-impl.h
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h
dali-toolkit/internal/styling/style-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.h
dali-toolkit/internal/text/bidirectional-support.cpp
dali-toolkit/internal/text/character-set-conversion.cpp
dali-toolkit/internal/text/character-set-conversion.h
dali-toolkit/internal/text/layouts/layout-engine.cpp
dali-toolkit/internal/text/layouts/layout-engine.h
dali-toolkit/internal/text/line-run.h
dali-toolkit/internal/text/logical-model-impl.cpp
dali-toolkit/internal/text/multi-language-support-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/rendering/basic/text-basic-renderer.cpp
dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp [new file with mode: 0644]
dali-toolkit/internal/text/rendering/text-backend-impl.cpp
dali-toolkit/internal/text/segmentation.cpp
dali-toolkit/internal/text/shaper.cpp
dali-toolkit/internal/text/text-controller-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-definitions.h
dali-toolkit/internal/text/text-io.cpp
dali-toolkit/internal/text/text-view-interface.h
dali-toolkit/internal/text/text-view.cpp
dali-toolkit/internal/text/text-view.h
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h
dali-toolkit/public-api/builder/builder.cpp
dali-toolkit/public-api/builder/builder.h
dali-toolkit/public-api/controls/bloom-view/bloom-view.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h
dali-toolkit/public-api/controls/navigation-frame/navigation-bar-style.h [deleted file]
dali-toolkit/public-api/controls/navigation-frame/navigation-control.cpp [deleted file]
dali-toolkit/public-api/controls/navigation-frame/navigation-control.h [deleted file]
dali-toolkit/public-api/controls/navigation-frame/page.cpp [deleted file]
dali-toolkit/public-api/controls/navigation-frame/page.h [deleted file]
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/default-item-layout.cpp [new file with mode: 0644]
dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.h [new file with mode: 0644]
dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.cpp [deleted file]
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.cpp
dali-toolkit/public-api/controls/scrollable/item-view/item-view.h
dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-component-impl.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-component.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-component.h [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-connector.h [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.h [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.h [deleted file]
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 [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.cpp [moved from dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.cpp with 52% similarity]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.h [moved from dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.h with 50% similarity]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.cpp [deleted file]
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h [deleted file]
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.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/public-api/file.list
dali-toolkit/public-api/focus-manager/focus-manager.cpp
dali-toolkit/public-api/focus-manager/keyinput-focus-manager.cpp
docs/content/images/animation/keyframe-animation.png [moved from plugins/dali-script-v8/docs/dali-theme/assets/img/keyframe-animation.png with 100% similarity]
docs/content/images/example-documentation/example-code.png [new file with mode: 0644]
docs/content/images/focus-manager/focus-manager.png [moved from plugins/dali-script-v8/docs/dali-theme/assets/img/focus-manager.png with 100% similarity]
docs/content/images/javascript-wrapping-guide/adding-function.png [new file with mode: 0644]
docs/content/images/javascript-wrapping-guide/base-wrapped-types.png [new file with mode: 0644]
docs/content/images/javascript-wrapping-guide/constructors.png [new file with mode: 0644]
docs/content/images/javascript-wrapping-guide/folder-view.png [new file with mode: 0644]
docs/content/images/javascript-wrapping-guide/high-level-design.png [new file with mode: 0644]
docs/content/images/javascript-wrapping-guide/plugin-creation.png [new file with mode: 0644]
docs/content/images/javascript-wrapping-guide/plugin-execution.png [new file with mode: 0644]
docs/content/images/javascript-wrapping-guide/scripting-overview.png [new file with mode: 0644]
docs/content/images/path/path.png [moved from plugins/dali-script-v8/docs/dali-theme/assets/img/path.png with 100% similarity]
docs/content/images/performance/update-render.png [new file with mode: 0644]
docs/content/images/screen-shot.png [new file with mode: 0644]
docs/content/images/screenshot.png [deleted file]
docs/content/images/shaders/fragment-shader-color.png [moved from plugins/dali-script-v8/docs/dali-theme/assets/img/fragment-shader-color.png with 100% similarity]
docs/content/images/shaders/fragment-shader-reveal.png [moved from plugins/dali-script-v8/docs/dali-theme/assets/img/fragment-shader-reveal.png with 100% similarity]
docs/content/images/shaders/shader-animation.png [moved from plugins/dali-script-v8/docs/dali-theme/assets/img/shader-animation.png with 100% similarity]
docs/content/images/shaders/shader-grid-hint.png [moved from plugins/dali-script-v8/docs/dali-theme/assets/img/shader-grid-hint.png with 100% similarity]
docs/content/images/shaders/vertex-shader.png [moved from plugins/dali-script-v8/docs/dali-theme/assets/img/vertex-shader.png with 100% similarity]
docs/content/images/spinner.gif [moved from plugins/dali-script-v8/docs/dali-theme/assets/img/spinner.gif with 100% similarity]
docs/content/images/stage/stage.png [moved from plugins/dali-script-v8/docs/dali-theme/assets/img/stage.png with 100% similarity]
docs/content/images/texture-atlas/example-javascript-code.jpg [new file with mode: 0644]
docs/content/main-page.h [deleted file]
docs/content/main.md [new file with mode: 0644]
docs/content/programming-guide/dali-application.h
docs/content/programming-guide/performance-profiling.h [deleted file]
docs/content/programming-guide/performance-tips.h [deleted file]
docs/content/programming-guide/resource-tracking.h [deleted file]
docs/content/programming-guide/script-hello.h [deleted file]
docs/content/programming-guide/script-overview.h [deleted file]
docs/content/programming-guide/texture-atlases.h [deleted file]
docs/content/programming-guide/texture-compression.h [deleted file]
docs/content/shared-javascript-and-cpp-documentation/documentation-guide.md
docs/content/shared-javascript-and-cpp-documentation/fundamentals.md [moved from docs/content/programming-guide/fundamentals.h with 81% similarity]
docs/content/shared-javascript-and-cpp-documentation/javascript-wrapping-guide.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/performance-profiling.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/performance-tips.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/resource-tracking.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/scene-graph.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/script-hello.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/script-json-specification.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/script-overview.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/text-label.md [moved from docs/content/programming-guide/text-label.h with 51% similarity]
docs/content/shared-javascript-and-cpp-documentation/texture-atlas.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/texture-compression.md [moved from plugins/dali-script-v8/docs/content/texture-compression.js with 50% similarity]
packaging/dali-toolkit.spec
plugins/dali-script-v8/docs/content/actor.js
plugins/dali-script-v8/docs/content/animation.js
plugins/dali-script-v8/docs/content/constants.js
plugins/dali-script-v8/docs/content/dali.js
plugins/dali-script-v8/docs/content/image-actor.js
plugins/dali-script-v8/docs/content/image.js
plugins/dali-script-v8/docs/content/keyboard-focus-manager.js
plugins/dali-script-v8/docs/content/path-animation.js
plugins/dali-script-v8/docs/content/renderable-actor.js
plugins/dali-script-v8/docs/content/shader-effect.js
plugins/dali-script-v8/docs/content/stage.js
plugins/dali-script-v8/docs/content/text-actor.js [deleted file]
plugins/dali-script-v8/docs/content/texture-atlases.js [deleted file]
plugins/dali-script-v8/docs/dali-theme/assets/img [new symlink]
plugins/dali-script-v8/docs/dali-theme/assets/img/example-javascript-code.png [deleted file]
plugins/dali-script-v8/docs/dali-theme/assets/img/shared [deleted symlink]
plugins/dali-script-v8/file.list
plugins/dali-script-v8/src/actors/actor-api.cpp
plugins/dali-script-v8/src/actors/actor-api.h
plugins/dali-script-v8/src/actors/actor-wrapper.cpp
plugins/dali-script-v8/src/actors/image-actor-api.cpp
plugins/dali-script-v8/src/actors/image-actor-api.h
plugins/dali-script-v8/src/actors/mesh-actor-api.h
plugins/dali-script-v8/src/actors/renderable-actor-api.cpp
plugins/dali-script-v8/src/actors/renderable-actor-api.h
plugins/dali-script-v8/src/animation/animation-api.cpp
plugins/dali-script-v8/src/animation/constrainer-api.cpp [new file with mode: 0644]
plugins/dali-script-v8/src/animation/constrainer-api.h [new file with mode: 0644]
plugins/dali-script-v8/src/animation/linear-constrainer-wrapper.cpp [new file with mode: 0644]
plugins/dali-script-v8/src/animation/linear-constrainer-wrapper.h [new file with mode: 0644]
plugins/dali-script-v8/src/animation/path-constrainer-wrapper.cpp [moved from plugins/dali-script-v8/src/animation/path-constraint-wrapper.cpp with 54% similarity]
plugins/dali-script-v8/src/animation/path-constrainer-wrapper.h [moved from plugins/dali-script-v8/src/animation/path-constraint-wrapper.h with 51% similarity]
plugins/dali-script-v8/src/dali-wrapper.cpp
plugins/dali-script-v8/src/garbage-collector/garbage-collector.h
plugins/dali-script-v8/src/image/resource-image-api.cpp
plugins/dali-script-v8/src/object/property-value-wrapper.cpp
plugins/dali-script-v8/src/shared/base-wrapped-object.h
texture-atlas-exporter/dali-exporter/dali3d_exporter.cpp

index e522f31..2b30d02 100644 (file)
@@ -16,23 +16,20 @@ SET(TC_SOURCES
    utc-Dali-CarouselEffect.cpp
    utc-Dali-CheckBoxButton.cpp
    utc-Dali-CubeTransitionEffect.cpp
-   utc-Dali-DepthLayout.cpp
    utc-Dali-DisplacementEffect.cpp
    utc-Dali-DistanceFieldEffect.cpp
    utc-Dali-GaussianBlurView.cpp
    utc-Dali-JsonParser.cpp
    utc-Dali-KeyInputFocusManager.cpp
-   utc-Dali-NavigationControl.cpp
    utc-Dali-OverlayEffect.cpp
-   utc-Dali-Page.cpp
    utc-Dali-PageTurnEffect.cpp
    utc-Dali-PageTurnView.cpp
+   utc-Dali-ScrollBar.cpp
    utc-Dali-ScrollView.cpp
    utc-Dali-ShadowView.cpp
    utc-Dali-ShearEffect.cpp
    utc-Dali-Slider.cpp
    utc-Dali-SoftButtonEffect.cpp
-   utc-Dali-SpiralLayout.cpp
    utc-Dali-SpotEffect.cpp
    utc-Dali-SquareDissolveEffect.cpp
    utc-Dali-TableView.cpp
@@ -46,7 +43,6 @@ SET(TC_SOURCES
    utc-Dali-DefaultControls.cpp
    utc-Dali-DissolveEffect.cpp
    utc-Dali-FocusManager.cpp
-   utc-Dali-GridLayout.cpp
    utc-Dali-IrisEffect.cpp
    utc-Dali-ItemLayout.cpp
    utc-Dali-ItemView.cpp
index c3beebe..2fce6a2 100644 (file)
 // EXTERNAL INCLUDES
 #include <stdint.h>
 #include <cstring>
-#include <dali/public-api/images/image-operations.h>
+#include <dali/devel-api/images/image-operations.h>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/set-wrapper.h>
+#include <dali/devel-api/common/set-wrapper.h>
 #include <dali/integration-api/platform-abstraction.h>
 
 #include "test-trace-call-stack.h"
index 2f6a046..73cd4c8 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/object/base-object.h>
-#include <dali/public-api/common/map-wrapper.h>
+#include <dali/devel-api/common/map-wrapper.h>
 #include <dali/public-api/signals/dali-signal.h>
 
 namespace Dali
index b15d1e6..e6062f2 100644 (file)
@@ -24,6 +24,8 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali/devel-api/actors/mesh-actor.h>
+#include <dali/devel-api/modeling/material.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-DepthLayout.cpp b/automated-tests/src/dali-toolkit/utc-Dali-DepthLayout.cpp
deleted file mode 100644 (file)
index 90b92f6..0000000
+++ /dev/null
@@ -1,618 +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 <float.h>       // for FLT_MAX
-#include <stdlib.h>
-#include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-using namespace Dali;
-using namespace Toolkit;
-
-namespace
-{
-const unsigned int TOTAL_ITEM_NUMBER = 200;
-
-Vector3 DepthLayoutItemSizeFunction(unsigned int numberOfColumns, float layoutWidth)
-{
-  float width = (layoutWidth / static_cast<float>(numberOfColumns + 1)) * 0.8f;
-  return Vector3(width, width, width);
-}
-
-float DepthLayoutBottomMarginFunction(float layoutHeight)
-{
-  return layoutHeight * 0.25f;
-}
-
-float DepthLayoutColumnPositionFunction(unsigned int numberOfColumns, unsigned int columnNumber, const Vector3& itemSize, float layoutWidth)
-{
-  float availableSpace = layoutWidth - itemSize.width * numberOfColumns;
-  float leftMargin = availableSpace / numberOfColumns * 0.5f;
-  float columnPosition = leftMargin + itemSize.width * 0.5f + columnNumber * (itemSize.width + availableSpace / numberOfColumns);
-  return columnPosition - layoutWidth * 0.5f;
-}
-} // namespace
-
-
-// Implementation of ItemFactory for providing actors to ItemView
-class TestItemFactory : public ItemFactory
-{
-public:
-
-  /**
-   * Constructor
-   * @param application class, stored as reference
-   */
-  TestItemFactory()
-  {
-  }
-
-public: // From ItemFactory
-
-  /**
-   * Query the number of items available from the factory.
-   * The maximum available item has an ID of GetNumberOfItems() - 1.
-   */
-  virtual unsigned int GetNumberOfItems()
-  {
-    return TOTAL_ITEM_NUMBER;
-  }
-
-  /**
-   * Create an Actor to represent a visible item.
-   * @param itemId
-   * @return the created actor.
-   */
-  virtual Actor NewItem(unsigned int itemId)
-  {
-    // Create an test actor for this item
-    ImageActor actor = CreateSolidColorActor(Color::RED);
-    actor.SetSize(64.0f, 64.0f);
-
-    return actor;
-  }
-};
-
-
-void depth_layout_startup(void)
-{
-}
-
-void depth_layout_cleanup(void)
-{
-}
-
-int UtcDaliDepthLayoutNew(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  DALI_TEST_CHECK(depthLayout);
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutSetAndGetNumberOfColumns(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  // Set the number of columns
-  depthLayout->SetNumberOfColumns(5);
-
-  // Check whether we get the correct number of columns
-  DALI_TEST_CHECK(depthLayout->GetNumberOfColumns() == 5);
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutSetAndGetNumberOfRows(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  // Set the number of rows
-  depthLayout->SetNumberOfRows(15);
-
-  // Check whether we get the correct number of rows
-  DALI_TEST_CHECK(depthLayout->GetNumberOfRows() == 15);
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutSetAndGetRowSpacing(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  // Set the row spacing
-  depthLayout->SetRowSpacing(30.0f);
-
-  // Check whether we get the correct row spacing
-  DALI_TEST_EQUALS(depthLayout->GetRowSpacing(), 30.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutSetAndGetTiltAngle(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  // Set the tilt angle
-  depthLayout->SetTiltAngle(Degree(25.0f));
-
-  // Check whether we get the correct tilt angle
-  DALI_TEST_EQUALS(depthLayout->GetTiltAngle(), Degree(25.0f), 0.001f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutSetAndGetItemSizeFunction(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  // Set the item size function
-  depthLayout->SetItemSizeFunction(DepthLayoutItemSizeFunction);
-
-  // Check whether we get the correct item size function
-  DALI_TEST_CHECK(depthLayout->GetItemSizeFunction() == DepthLayoutItemSizeFunction);
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutSetAndGetBottomMarginFunction(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  // Set the bottom margin function
-  depthLayout->SetBottomMarginFunction(DepthLayoutBottomMarginFunction);
-
-  // Check whether we get the correct bottom margin function
-  DALI_TEST_CHECK(depthLayout->GetBottomMarginFunction() == DepthLayoutBottomMarginFunction);
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutSetAndGetItemTiltAngle(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  // Set the item's tilt angle
-  depthLayout->SetItemTiltAngle(Degree(5.0f));
-
-  // Check whether we get the correct item's tilt angle
-  DALI_TEST_EQUALS(depthLayout->GetItemTiltAngle(), Degree(5.0f), 0.001f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutSetAndGetColumnPositionFunction(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  // Set the column position function
-  depthLayout->SetColumnPositionFunction(DepthLayoutColumnPositionFunction);
-
-  // Check whether we get the correct column position function
-  DALI_TEST_CHECK(depthLayout->GetColumnPositionFunction() == DepthLayoutColumnPositionFunction);
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutSetAndGetScrollSpeedFactor(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  // Set the scroll speed factor
-  depthLayout->SetScrollSpeedFactor(0.05f);
-
-  // Check whether we get the correct scroll speed factor
-  DALI_TEST_EQUALS(depthLayout->GetScrollSpeedFactor(), 0.05f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutSetAndGetMaximumSwipeSpeed(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  // Set the maximum swipe speed
-  depthLayout->SetMaximumSwipeSpeed(50.0f);
-
-  // Check whether we get the correct maximum swipe speed
-  DALI_TEST_EQUALS(depthLayout->GetMaximumSwipeSpeed(), 50.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutSetAndGetItemFlickAnimationDuration(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a depth layout
-  DepthLayoutPtr depthLayout = DepthLayout::New();
-
-  // Set the flick animaiton duration
-  depthLayout->SetItemFlickAnimationDuration(0.35f);
-
-  // Check whether we get the correct flick animaiton duration
-  DALI_TEST_EQUALS( depthLayout->GetItemFlickAnimationDuration(), 0.35f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutConstraintLeft(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  DepthLayoutPtr navigationLayout = DepthLayout::New();
-  navigationLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*navigationLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  navigationLayout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutConstraintRight(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  DepthLayoutPtr navigationLayout = DepthLayout::New();
-  navigationLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*navigationLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  navigationLayout->SetOrientation(ControlOrientation::Right);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutConstraintUp(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  DepthLayoutPtr navigationLayout = DepthLayout::New();
-  navigationLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*navigationLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  navigationLayout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutConstraintDown(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  DepthLayoutPtr navigationLayout = DepthLayout::New();
-  navigationLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*navigationLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  navigationLayout->SetOrientation(ControlOrientation::Down);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutGetScrollToPosition(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  DepthLayoutPtr layout = DepthLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*layout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  layout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view.
-  std::vector<unsigned int> indices;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      indices.push_back(i);
-    }
-  }
-
-  try
-  {
-    if (!indices.empty())
-    {
-      const unsigned int firstTargetIndex = indices[indices.size()-1];
-      // scroll to last item
-      view.ScrollToItem(firstTargetIndex, 0.00f);
-      application.Render(16); // 60hz frames
-
-      std::size_t moveCount = 0;
-      for(std::size_t i = 0; i < indices.size(); i++)
-      {
-        float layoutPosBefore = view.GetCurrentLayoutPosition(i);
-        view.ScrollToItem(indices[i], 0.0f);
-
-        application.Render(16); // 60hz frame
-
-        float layoutPosAfter = view.GetCurrentLayoutPosition(i);
-
-        if (fabs(layoutPosBefore-layoutPosAfter) <= FLT_EPSILON)
-        {
-          ++moveCount;
-        }
-      }
-
-      DALI_TEST_CHECK((moveCount == indices.size()));
-    }
-  }
-  catch(...)
-  {
-    tet_result(TET_FAIL);
-  }
-
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliDepthLayoutScrollDirection(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  DepthLayoutPtr navigationLayout = DepthLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*navigationLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  navigationLayout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  ItemLayoutPtr layout = navigationLayout;
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  navigationLayout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  Degree deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg.degree == 180.0f);
-
-  navigationLayout->SetOrientation(ControlOrientation::Down);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK((deg.degree == 0.0f));
-
-  layout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg.degree == 270.0f);
-
-  navigationLayout->SetOrientation(ControlOrientation::Right);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg.degree == 90.0f);
-
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-GridLayout.cpp b/automated-tests/src/dali-toolkit/utc-Dali-GridLayout.cpp
deleted file mode 100644 (file)
index 6b050bc..0000000
+++ /dev/null
@@ -1,548 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <iostream>
-#include <stdlib.h>
-#include <float.h>       // for FLT_MAX
-
-// Need to override adaptor classes for toolkit test harness, so include
-// test harness headers before dali headers.
-#include <dali-toolkit-test-suite-utils.h>
-
-#include <dali.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-using namespace Dali;
-using namespace Toolkit;
-
-void utc_dali_toolkit_grid_layout_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void utc_dali_toolkit_grid_layout_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-
-namespace
-{
-
-const unsigned int TOTAL_ITEM_NUMBER = 200;
-
-Vector3 GridLayoutItemSizeFunction(unsigned int numberOfColumns, float layoutWidth, float sideMargin, float columnSpacing)
-{
-  float width = (layoutWidth - sideMargin * 2.0f - columnSpacing * static_cast<float>(numberOfColumns - 1)) / static_cast<float>(numberOfColumns);
-
-  return Vector3(width, width, width);
-}
-
-
-// Implementation of ItemFactory for providing actors to ItemView
-class TestItemFactory : public ItemFactory
-{
-public:
-
-  /**
-   * Constructor
-   * @param application class, stored as reference
-   */
-  TestItemFactory()
-  {
-  }
-
-public: // From ItemFactory
-
-  /**
-   * Query the number of items available from the factory.
-   * The maximum available item has an ID of GetNumberOfItems() - 1.
-   */
-  virtual unsigned int GetNumberOfItems()
-  {
-    return TOTAL_ITEM_NUMBER;
-  }
-
-  /**
-   * Create an Actor to represent a visible item.
-   * @param itemId
-   * @return the created actor.
-   */
-  virtual Actor NewItem(unsigned int itemId)
-  {
-    // Create an test actor for this item
-    ImageActor actor = CreateSolidColorActor(Color::RED);
-    actor.SetSize(64.0f, 64.0f);
-    return actor;
-  }
-};
-
-} // namespace
-
-
-
-int UtcDaliGridLayoutNew(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  DALI_TEST_CHECK(gridLayout);
-  END_TEST;
-}
-
-int UtcDaliGridLayoutSetAndGetNumberOfColumns(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  // Set the number of columns
-  gridLayout->SetNumberOfColumns(6);
-
-  // Check whether we get the correct number of columns
-  DALI_TEST_CHECK(gridLayout->GetNumberOfColumns() == 6);
-  END_TEST;
-}
-
-int UtcDaliGridLayoutSetAndGetRowSpacing(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  // Set the row spacing
-  gridLayout->SetRowSpacing(10.0f);
-
-  // Check whether we get the correct row spacing
-  DALI_TEST_EQUALS(gridLayout->GetRowSpacing(), 10.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliGridLayoutSetAndGetColumnSpacing(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  // Set the column spacing
-  gridLayout->SetColumnSpacing(10.0f);
-
-  // Check whether we get the correct column spacing
-  DALI_TEST_EQUALS(gridLayout->GetColumnSpacing(), 10.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliGridLayoutSetAndGetTopMargin(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  // Set the top margin
-  gridLayout->SetTopMargin(30.0f);
-
-  // Check whether we get the correct top margin
-  DALI_TEST_EQUALS(gridLayout->GetTopMargin(), 30.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliGridLayoutSetAndGetBottomMargin(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  // Set the bottom margin
-  gridLayout->SetBottomMargin(30.0f);
-
-  // Check whether we get the correct bottom margin
-  DALI_TEST_EQUALS(gridLayout->GetBottomMargin(), 30.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliGridLayoutSetAndGetSideMargin(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  // Set the side margin
-  gridLayout->SetSideMargin(10.0f);
-
-  // Check whether we get the correct side margin
-  DALI_TEST_EQUALS(gridLayout->GetSideMargin(), 10.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliGridLayoutSetAndGetZGap(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  // Set the gap of items in the Z axis in different columns
-  gridLayout->SetZGap(5.0f);
-
-  // Check whether we get the correct Z gap
-  DALI_TEST_EQUALS(gridLayout->GetZGap(), 5.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliGridLayoutSetAndGetItemSizeFunction(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  // Set the item size function
-  gridLayout->SetItemSizeFunction(GridLayoutItemSizeFunction);
-
-  // Check whether we get the correct item size function
-  DALI_TEST_CHECK(gridLayout->GetItemSizeFunction() == GridLayoutItemSizeFunction);
-  END_TEST;
-}
-
-int UtcDaliGridLayoutSetAndGetScrollSpeedFactor(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  // Set the scroll speed factor
-  gridLayout->SetScrollSpeedFactor(0.05f);
-
-  // Check whether we get the correct scroll speed factor
-  DALI_TEST_EQUALS(gridLayout->GetScrollSpeedFactor(), 0.05f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliGridLayoutSetAndGetMaximumSwipeSpeed(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  // Set the maximum swipe speed
-  gridLayout->SetMaximumSwipeSpeed(50.0f);
-
-  // Check whether we get the correct maximum swipe speed
-  DALI_TEST_EQUALS(gridLayout->GetMaximumSwipeSpeed(), 50.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliGridLayoutSetAndGetItemFlickAnimationDuration(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a grid layout
-  GridLayoutPtr gridLayout = GridLayout::New();
-
-  // Set the flick animaiton duration
-  gridLayout->SetItemFlickAnimationDuration(0.35f);
-
-  // Check whether we get the correct flick animaiton duration
-  DALI_TEST_EQUALS( gridLayout->GetItemFlickAnimationDuration(), 0.35f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliGridLayoutConstraintLeft(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  GridLayoutPtr gridLayout = GridLayout::New();
-  gridLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*gridLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  gridLayout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliGridLayoutConstraintRight(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  GridLayoutPtr gridLayout = GridLayout::New();
-  gridLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*gridLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  gridLayout->SetOrientation(ControlOrientation::Right);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliGridLayoutConstraintUp(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  GridLayoutPtr gridLayout = GridLayout::New();
-  gridLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*gridLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  gridLayout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-
-  ItemLayoutPtr layout = gridLayout;
-  layout->GetClosestOnScreenLayoutPosition(0, 0.0f, vec);
-  int nextItem = layout->GetNextFocusItemID(0, 10, Dali::Toolkit::Control::Right, false);
-  DALI_TEST_CHECK(nextItem == 1);
-
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliGridLayoutConstraintDown(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  GridLayoutPtr gridLayout = GridLayout::New();
-  gridLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*gridLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  gridLayout->SetOrientation(ControlOrientation::Down);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliGridLayoutScrollDirection(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  GridLayoutPtr gridLayout = GridLayout::New();
-  gridLayout->SetNumberOfColumns(6);
-
-  view.SetName("view actor");
-  view.AddLayout(*gridLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  gridLayout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  ItemLayoutPtr layout = gridLayout;
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  gridLayout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  Degree deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg.degree == 0.0f);
-
-  gridLayout->SetOrientation(ControlOrientation::Down);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK((deg.degree == 180.0f));
-
-  layout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg.degree == 90.f);
-
-  gridLayout->SetOrientation(ControlOrientation::Right);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg.degree == 270.0f);
-
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
index dea4d52..b04201b 100644 (file)
@@ -83,7 +83,7 @@ int UtcDaliItemLayoutSetAndGetOrientation(void)
   ItemView view = ItemView::New(factory);
 
   // Create a grid layout and add it to ItemView
-  GridLayoutPtr gridLayout = GridLayout::New();
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
   view.AddLayout(*gridLayout);
 
   // Set the orientation of the layout to be horizontal from left to right
index c66a650..920e152 100644 (file)
@@ -143,21 +143,21 @@ int UtcDaliItemViewAddAndGetLayout(void)
   ItemView view = ItemView::New(factory);
 
   // Create a grid layout and add it to ItemView
-  GridLayoutPtr gridLayout = GridLayout::New();
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
   view.AddLayout(*gridLayout);
 
   // As we have added one layout, check the number of layout is now 1
   DALI_TEST_CHECK(view.GetLayoutCount() == 1);
 
   // Create a depth layout and add it to ItemView
-  DepthLayoutPtr depthLayout = DepthLayout::New();
+  ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
   view.AddLayout(*depthLayout);
 
   // As we have added another layout, check the number of layout is now 2
   DALI_TEST_CHECK(view.GetLayoutCount() == 2);
 
   // Create a spiral layout and add it to ItemView
-  SpiralLayoutPtr spiralLayout = SpiralLayout::New();
+  ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
   view.AddLayout(*spiralLayout);
 
   // As we have added another layout, check the number of layout is now 3
@@ -179,14 +179,14 @@ int UtcDaliItemViewAddAndRemoveLayout(void)
   ItemView view = ItemView::New(factory);
 
   // Create a grid layout and add it to ItemView
-  GridLayoutPtr gridLayout = GridLayout::New();
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
   view.AddLayout(*gridLayout);
 
   // As we have added one layout, check the number of layout is now 1
   DALI_TEST_CHECK(view.GetLayoutCount() == 1);
 
   // Create a depth layout and add it to ItemView
-  DepthLayoutPtr depthLayout = DepthLayout::New();
+  ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
   view.AddLayout(*depthLayout);
 
   // As we have added another layout, check the number of layout is now 2
@@ -222,15 +222,15 @@ int UtcDaliItemViewActivateLayoutAndGetActiveLayout(void)
   ItemView view = ItemView::New(factory);
 
   // Create a grid layout and add it to ItemView
-  GridLayoutPtr gridLayout = GridLayout::New();
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
   view.AddLayout(*gridLayout);
 
   // Create a depth layout and add it to ItemView
-  DepthLayoutPtr depthLayout = DepthLayout::New();
+  ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
   view.AddLayout(*depthLayout);
 
   // Create a spiral layout and add it to ItemView
-  SpiralLayoutPtr spiralLayout = SpiralLayout::New();
+  ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
   view.AddLayout(*spiralLayout);
 
   // As we have added three layouts, check the number of layout is now 3
@@ -269,7 +269,7 @@ int UtcDaliItemViewDeactivateCurrentLayout(void)
   ItemView view = ItemView::New(factory);
 
   // Create a grid layout and add it to ItemView
-  GridLayoutPtr gridLayout = GridLayout::New();
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
   view.AddLayout(*gridLayout);
 
   // Check there is no active layout at the moment
@@ -299,7 +299,7 @@ int UtcDaliItemViewGetItemAndGetItemId(void)
   ItemView view = ItemView::New(factory);
 
   // Create a grid layout and add it to ItemView
-  GridLayoutPtr gridLayout = GridLayout::New();
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
   view.AddLayout(*gridLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
@@ -323,7 +323,7 @@ int UtcDaliItemViewRemoveItem(void)
   ItemView view = ItemView::New(factory);
 
   // Create a grid layout and add it to ItemView
-  GridLayoutPtr gridLayout = GridLayout::New();
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
   view.AddLayout(*gridLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
@@ -356,7 +356,7 @@ int UtcDaliItemViewGetCurrentLayoutPosition(void)
   ItemView view = ItemView::New(factory);
 
   // Create a grid layout and add it to ItemView
-  GridLayoutPtr gridLayout = GridLayout::New();
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
   view.AddLayout(*gridLayout);
 
   // Activate the grid layout so that the items will be created and added to ItemView
@@ -456,7 +456,7 @@ int UtcDaliItemViewScrollToItem(void)
   TestItemFactory factory;
   ItemView view = ItemView::New(factory);
   Vector3 vec(480.0f, 800.0f, 0.0f);
-  GridLayoutPtr layout = GridLayout::New();
+  ItemLayoutPtr layout = DefaultItemLayout::New( DefaultItemLayout::GRID );
 
   view.SetName("view actor");
   view.AddLayout(*layout);
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-NavigationControl.cpp b/automated-tests/src/dali-toolkit/utc-Dali-NavigationControl.cpp
deleted file mode 100644 (file)
index 4e81bf6..0000000
+++ /dev/null
@@ -1,354 +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;
-}
-
-}
-
-
-void navigation_control_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void navigation_control_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-int UtcDaliNavigationControlNew(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline("UtcDaliNavigationControlNew");
-
-  NavigationControl naviControl;
-  // Check that this handle is uninitialized
-  DALI_TEST_CHECK( !naviControl );
-
-  naviControl = NavigationControl::New();
-  // Check that the Dali resource is successfully created
-  DALI_TEST_CHECK( naviControl );
-
-  NavigationControl naviControl2( naviControl );
-  DALI_TEST_CHECK( naviControl2 == naviControl );
-
-  //Additional check to ensure object is created by checking whether it is registered
-  ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
-  DALI_TEST_CHECK( registry );
-  gObjectCreatedCallBackCalled = false;
-  registry.ObjectCreatedSignal().Connect( TestCallback );
-  {
-    NavigationControl naviControl = NavigationControl::New();
-  }
-  DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
-  END_TEST;
-}
-
-int UtcDaliNavigationControlDownCast(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliNavigationControlDownCast" );
-
-  NavigationControl naviControl = NavigationControl::New();
-  BaseHandle handle( naviControl );
-
-  NavigationControl newNaviControl = NavigationControl::DownCast( handle );
-  DALI_TEST_CHECK( naviControl );
-  DALI_TEST_CHECK( newNaviControl == naviControl );
-  END_TEST;
-}
-
-int UtcDaliNavigationControlPushItem(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliNavigationControlPushItem" );
-
-  // Create a NavigationControl object, and add it to stage
-  NavigationControl naviControl = NavigationControl::New();
-  Stage::GetCurrent().Add(naviControl);
-  // Check there is no item in the stack
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 0 );
-
-  // Create two NavigationItem objects
-  Page firstItem = Page::New();
-  Page secondItem = Page::New();
-
-  // Push the first item into stack
-  naviControl.PushItem( firstItem );
-  // Check the item count in stack
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 1 );
-  // Check the current item
-  DALI_TEST_CHECK( naviControl.GetCurrentItem() == firstItem );
-  // Check that the newly pushed item is displayed on stage
-  DALI_TEST_CHECK( firstItem.OnStage() );
-
-  // Push the second item into stack
-  naviControl.PushItem( secondItem );
-  // Check the item count in stack
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 2 );
-  // Check the current item
-  DALI_TEST_CHECK( naviControl.GetCurrentItem() == secondItem );
-  // Check the bottom item in the stack
-  DALI_TEST_CHECK( naviControl.GetItem(0) == firstItem );
-  // Check that the previous item is off stage
-  DALI_TEST_CHECK( !firstItem.OnStage() );
-  // Check that the newly pushed item is displayed on stage
-  DALI_TEST_CHECK( secondItem.OnStage() );
-
-  Page thirdItem;
-  Page fourthItem(secondItem);
-  naviControl.PushItem( thirdItem );
-  // Check that an uninitialized item cannot be pushed into the stack
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 2 );
-  naviControl.PushItem( fourthItem );
-  // Check that an duplicated item with the current item cannot be pushed into the stack
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 2 );
-  // Check that the current item and the item on the stage is still the secondItem
-  DALI_TEST_CHECK( naviControl.GetCurrentItem() == secondItem );
-  DALI_TEST_CHECK( secondItem.OnStage() );
-  END_TEST;
-}
-
-int UtcDaliNavigationControlPopItem(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliNavigationControlPopItem" );
-
-  // Create a NavigationControl object, and add it to stage
-  NavigationControl naviControl = NavigationControl::New();
-  Stage::GetCurrent().Add(naviControl);
-  // Create three NavigationItem objects
-  Page firstItem = Page::New();
-  Page secondItem = Page::New();
-  Page thirdItem = Page::New();
-  naviControl.PushItem( firstItem );
-  naviControl.PushItem( secondItem );
-  naviControl.PushItem( thirdItem );
-
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 3 );
-
-  // pop an item out from the stack
-  Page poppedItem = naviControl.PopItem();
-  // check that the item count is decrease by one
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 2 );
-  // check that the item popped out is the thirdItem
-  DALI_TEST_CHECK( poppedItem == thirdItem );
-  // check that the item popped out is disappeared from the stage
-  DALI_TEST_CHECK( !poppedItem.OnStage() );
-  // check that the new top item is displayed on the stage
-  DALI_TEST_CHECK( secondItem.OnStage() );
-
-  // repeat the above steps again
-  poppedItem = naviControl.PopItem();
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 1 );
-  DALI_TEST_CHECK( poppedItem == secondItem );
-  DALI_TEST_CHECK( !poppedItem.OnStage() );
-  DALI_TEST_CHECK( firstItem.OnStage() );
-
-  // check that the bottom-most item can not be popped out from the stack
-  poppedItem = naviControl.PopItem();
-  // when trying to pop the bottom-most item, it returns an uninitialized handle and does nothing else
-  DALI_TEST_CHECK( !poppedItem );
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 1 );
-  DALI_TEST_CHECK( firstItem.OnStage() );
-  END_TEST;
-}
-
-int UtcDaliNavigationControlGetItemCount(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliNavigationControlGetItemCount" );
-
-  // Create a NavigationControl object
-  NavigationControl naviControl = NavigationControl::New();
-  // Create three NavigationItem objects
-  Page firstItem = Page::New();
-  Page secondItem = Page::New();
-  Page thirdItem = Page::New();
-
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 0 );
-  naviControl.PushItem( firstItem );
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 1 );
-  naviControl.PushItem( secondItem );
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 2 );
-  naviControl.PushItem( thirdItem );
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 3 );
-  naviControl.PopItem();
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 2 );
-  naviControl.PopItem();
-  DALI_TEST_CHECK( naviControl.GetItemCount() == 1 );
-  END_TEST;
-}
-
-int UtcDaliNavigationControlGetItem(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliNavigationControlGetItem" );
-
-  // Create a NavigationControl object
-  NavigationControl naviControl = NavigationControl::New();
-  // Create three NavigationItem objects and push them into stack
-  Page firstItem = Page::New();
-  Page secondItem = Page::New();
-  Page thirdItem = Page::New();
-  naviControl.PushItem( firstItem );
-  naviControl.PushItem( secondItem );
-  naviControl.PushItem( thirdItem );
-
-  // check every item by get it by index
-  DALI_TEST_CHECK( naviControl.GetItem(0) == firstItem );
-  DALI_TEST_CHECK( naviControl.GetItem(1) == secondItem );
-  DALI_TEST_CHECK( naviControl.GetItem(2) == thirdItem);
-  END_TEST;
-}
-
-int UtcDaliNavigationControlGetCurrentItem(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliNavigationControlGetCurrentItem" );
-
-  // Create a NavigationControl object
-  NavigationControl naviControl = NavigationControl::New();
-  // Create three NavigationItem objects
-  Page firstItem = Page::New();
-  Page secondItem = Page::New();
-  Page thirdItem = Page::New();
-
-  naviControl.PushItem( firstItem );
-  DALI_TEST_CHECK( naviControl.GetCurrentItem() == firstItem );
-  naviControl.PushItem( secondItem );
-  DALI_TEST_CHECK( naviControl.GetCurrentItem() == secondItem );
-  naviControl.PushItem( thirdItem );
-  DALI_TEST_CHECK( naviControl.GetCurrentItem() == thirdItem );
-  naviControl.PopItem();
-  DALI_TEST_CHECK( naviControl.GetCurrentItem() == secondItem );
-  naviControl.PopItem();
-  DALI_TEST_CHECK( naviControl.GetCurrentItem() == firstItem );
-  END_TEST;
-}
-
-int UtcDaliNavigationControlSetBackground(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliNavigationControlSetBackground" );
-
-  try
-  {
-    NavigationControl naviControl = NavigationControl::New();
-    Stage::GetCurrent().Add( naviControl );
-
-    ImageActor background = CreateSolidColorActor( Color::RED );
-    naviControl.SetBackground( background );
-  }
-  catch (Dali::DaliException& e)
-  {
-    DALI_TEST_PRINT_ASSERT( e );
-    DALI_TEST_EQUALS(e.condition, "segmentIndex+1 < mKnots.size() && segmentIndex < mKnots.size()", TEST_LOCATION);
-    tet_result(TET_FAIL);
-  }
-
-  tet_result(TET_PASS);
-  END_TEST;
-}
-
-int UtcDaliNavigationControlCreateNavigationToolBar(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliNavigationControlCreateNavigationToolBar" );
-
-  ImageActor background = CreateSolidColorActor( Color::RED );
-  Stage stage = Stage::GetCurrent();
-
-  NavigationControl naviControl = NavigationControl::New();
-  stage.Add( naviControl );
-
-  Toolkit::NaviToolBarStyle toolbarStyle( background, 720, 98, 496, 182, 72, 16, 63, 26);
-
-  naviControl.CreateNavigationToolBar( toolbarStyle, toolbarStyle);
-
-  Page naviItem = Page::New();
-  PushButton firstControl = PushButton::New();
-  naviItem.AddControlToToolBar(firstControl, Alignment::HorizontalLeft);
-  PushButton secondControl = PushButton::New();
-  naviItem.AddControlToToolBar(secondControl, Alignment::HorizontalCenter);
-  PushButton thirdControl = PushButton::New();
-  naviItem.AddControlToToolBar(thirdControl, Alignment::HorizontalCenter);
-  PushButton fourthControl = PushButton::New();
-  naviItem.AddControlToToolBar(fourthControl, Alignment::HorizontalRight);
-  PushButton fifthControl = PushButton::New();
-  naviItem.AddControlToToolBar(fifthControl, Alignment::HorizontalRight);
-
-  naviControl.PushItem( naviItem );
-
-  DALI_TEST_CHECK( firstControl.OnStage() );
-  // Can add multiple controls to the central group
-  DALI_TEST_CHECK( secondControl.OnStage() );
-  DALI_TEST_CHECK( thirdControl.OnStage() );
-  // Can only have one control in the side groups
-  DALI_TEST_CHECK( !fourthControl.OnStage() );
-  DALI_TEST_CHECK( fifthControl.OnStage() );
-
-  END_TEST;
-}
-
-int UtcDaliNavigationControlCreateNavigationTitleBar(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliNavigationControlCreateNavigationTitleBar" );
-
-  ImageActor background = CreateSolidColorActor( Color::RED );
-  Stage stage = Stage::GetCurrent();
-
-  NavigationControl naviControl = NavigationControl::New();
-  stage.Add( naviControl );
-
-  Toolkit::NaviTitleBarStyle titleBarStyle( background, 720, 111, 68, 48, 34, 16, 11, 45, 63, 26, 14, 22 );
-  naviControl.CreateNavigationTitleBar( titleBarStyle, titleBarStyle );
-
-  Page naviItem = Page::New();
-
-  PushButton firstControl = PushButton::New();
-  naviItem.AddControlToTitleBar( firstControl );
-  PushButton secondControl = PushButton::New();
-  naviItem.AddControlToTitleBar( secondControl );
-
-  Actor titleIcon = Actor::New();
-  naviItem.SetTitleIcon( titleIcon );
-
-  naviControl.PushItem( naviItem );
-
-  DALI_TEST_CHECK( firstControl.OnStage() );
-  DALI_TEST_CHECK( secondControl.OnStage() );
-  DALI_TEST_CHECK( titleIcon.OnStage() );
-  END_TEST;
-}
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Page.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Page.cpp
deleted file mode 100644 (file)
index 93f2293..0000000
+++ /dev/null
@@ -1,228 +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;
-
-void dali_page_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void dali_page_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-namespace
-{
-static bool gObjectCreatedCallBackCalled;
-static void TestCallback(BaseHandle handle)
-{
-  gObjectCreatedCallBackCalled = true;
-}
-
-}
-
-
-
-int UtcDaliPageNew(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline("UtcDaliPageNew");
-
-  Page naviItem;
-  // Check that this handle is uninitialized
-  DALI_TEST_CHECK( !naviItem );
-
-  naviItem = Page::New();
-  // Check that the Dali resource is successfully created
-  DALI_TEST_CHECK( naviItem );
-
-  Page naviItem2( naviItem );
-  DALI_TEST_CHECK( naviItem2 == naviItem );
-
-  // Additional check to ensure the object is created by checking whether it is registered
-  ObjectRegistry registry = Stage::GetCurrent().GetObjectRegistry();
-  DALI_TEST_CHECK( registry );
-  gObjectCreatedCallBackCalled = false;
-  registry.ObjectCreatedSignal().Connect( TestCallback );
-  {
-    Page naviItem = Page::New();
-  }
-  DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
-  END_TEST;
-}
-
-int UtcDaliPageDownCast(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliPageDownCast" );
-
-  Page naviItem = Page::New();
-  BaseHandle handle( naviItem );
-
-  Page newNaviItem = Page::DownCast( handle );
-  DALI_TEST_CHECK( naviItem );
-  DALI_TEST_CHECK( newNaviItem == naviItem );
-  END_TEST;
-}
-
-int UtcDaliPageSetGetTitle(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliPageSetGetTitle" );
-
-  Page naviItem = Page::New();
-  DALI_TEST_CHECK( naviItem.GetTitle().empty() );
-
-  std::string str( "ItemTitle" );
-  naviItem.SetTitle( str );
-  DALI_TEST_CHECK( naviItem.GetTitle() == str );
-  END_TEST;
-}
-
-int UtcDaliPageSetGetSubTitle(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliPageSetGetSubTitle" );
-
-  Page naviItem = Page::New();
-  DALI_TEST_CHECK( naviItem.GetSubTitle().empty() );
-
-  std::string str( "ItemSubTitle" );
-  naviItem.SetSubTitle( str );
-  DALI_TEST_CHECK( naviItem.GetSubTitle() == str );
-  END_TEST;
-}
-
-int UtcDaliPageSetGetTitleIcon(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliPageSetGetTitleIcon" );
-
-  Page naviItem = Page::New();
-  DALI_TEST_CHECK( !naviItem.GetTitleIcon() );
-
-  Actor titleIcon = Actor::New();
-  naviItem.SetTitleIcon( titleIcon );
-  DALI_TEST_CHECK( naviItem.GetTitleIcon() == titleIcon );
-  END_TEST;
-}
-
-int UtcDaliPageAddGetToolBarControl(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliPageAddGetToolBarControl" );
-
-  Page naviItem = Page::New();
-  Page::ControlOnBarContainer container = naviItem.GetControlsOnToolBar();
-  // Check that the container is empty in the beginning
-  DALI_TEST_CHECK( container.empty() );
-
-  // Add control, check whether adding successfully, also check the container size
-  PushButton firstControl = PushButton::New();
-  DALI_TEST_CHECK( naviItem.AddControlToToolBar(firstControl, Alignment::HorizontalLeft) );
-  container = naviItem.GetControlsOnToolBar();
-  DALI_TEST_CHECK( container.size() == 1 );
-
-  // Add control, check whether adding successfully, also check the container size
-  PushButton secondControl = PushButton::New();
-  DALI_TEST_CHECK( naviItem.AddControlToToolBar(secondControl, Alignment::HorizontalCenter) );
-  container = naviItem.GetControlsOnToolBar();
-  DALI_TEST_CHECK( container.size() == 2 );
-
-  // The control adding fails, as the alignment is not HorizontalLeft/HorizontalCenter/HorizontalRight
-  PushButton thirdControl = PushButton::New();
-  DALI_TEST_CHECK( !naviItem.AddControlToToolBar(thirdControl, Alignment::VerticalCenter) );
-  container = naviItem.GetControlsOnToolBar();
-  DALI_TEST_CHECK( container.size() == 2 );
-
-  // Add control, check whether adding successfully, also check the container size
-  PushButton fourthControl = PushButton::New();
-  DALI_TEST_CHECK( naviItem.AddControlToToolBar(fourthControl, Alignment::HorizontalRight) );
-  container = naviItem.GetControlsOnToolBar();
-  DALI_TEST_CHECK( container.size() == 3 );
-
-  // The control adding fails, as the control itself is uninitialized
-  PushButton fifthControl;
-  DALI_TEST_CHECK( !naviItem.AddControlToToolBar(fifthControl, Alignment::HorizontalCenter) );
-  container = naviItem.GetControlsOnToolBar();
-  DALI_TEST_CHECK( container.size() == 3 );
-
-  // check the content of the three successfully added ControlOnBar objects
-  DALI_TEST_CHECK( container[0]->control == firstControl );
-  DALI_TEST_CHECK( container[0]->alignment == Alignment::HorizontalLeft );
-  DALI_TEST_CHECK( container[1]->control == secondControl );
-  DALI_TEST_CHECK( container[1]->alignment == Alignment::HorizontalCenter );
-  DALI_TEST_CHECK( container[2]->control == fourthControl );
-  DALI_TEST_CHECK( container[2]->alignment == Alignment::HorizontalRight );
-  END_TEST;
-}
-
-int UtcDaliPageAddGetTitleBarControl(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliPageAddGetTitleBarControl" );
-
-  Page naviItem = Page::New();
-  ActorContainer container = naviItem.GetControlsOnTitleBar();
-  // Check that the container is empty in the beginning
-  DALI_TEST_CHECK( container.empty() );
-
-  // Add control, check whether adding successfully, also check the container size
-  PushButton firstControl = PushButton::New();
-  DALI_TEST_CHECK( naviItem.AddControlToTitleBar(firstControl) );
-  container = naviItem.GetControlsOnTitleBar();
-  DALI_TEST_CHECK( container.size() == 1 );
-
-  // The control adding fails, as the control itself is uninitialized
-  PushButton secondControl;
-  DALI_TEST_CHECK( !naviItem.AddControlToTitleBar(secondControl) );
-  container = naviItem.GetControlsOnTitleBar();
-  DALI_TEST_CHECK( container.size() == 1 );
-
-  // Add control, check whether adding successfully, also check the container size
-  PushButton thirdControl = PushButton::New();
-  DALI_TEST_CHECK( naviItem.AddControlToTitleBar(thirdControl) );
-  container = naviItem.GetControlsOnTitleBar();
-  DALI_TEST_CHECK( container.size() == 2 );
-
-  // check the content of the three successfully added Controls
-  DALI_TEST_CHECK( container[0] == firstControl );
-  DALI_TEST_CHECK( container[1] == thirdControl );
-  END_TEST;
-}
-
-int UtcDaliPageSetGetPopupMenu(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline( "UtcDaliPageSetGetPopupMenu" );
-
-  Page naviItem = Page::New();
-  DALI_TEST_CHECK( !naviItem.GetPopupMenu() );
-
-  Toolkit::Popup menu = Toolkit::Popup::New();
-  naviItem.SetPopupMenu( menu );
-  DALI_TEST_CHECK( menu == naviItem.GetPopupMenu() );
-  END_TEST;
-}
index 955f19d..5fc9c90 100644 (file)
@@ -19,9 +19,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sstream>
-
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali/integration-api/events/pan-gesture-event.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ScrollBar.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ScrollBar.cpp
new file mode 100644 (file)
index 0000000..a56ca7c
--- /dev/null
@@ -0,0 +1,1639 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics 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>
+#include <dali/integration-api/events/pan-gesture-event.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+void dali_scrollbar_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void dali_scrollbar_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+namespace
+{
+
+const int RENDER_FRAME_INTERVAL = 16;                       ///< Duration of each frame in ms. (at approx 60FPS)
+
+// Generate a PanGestureEvent to send to Core
+Integration::PanGestureEvent GeneratePan(
+    Gesture::State state,
+    const Vector2& previousPosition,
+    const Vector2& currentPosition,
+    unsigned long timeDelta,
+    unsigned int numberOfTouches = 1)
+{
+  Integration::PanGestureEvent pan(state);
+
+  pan.previousPosition = previousPosition;
+  pan.currentPosition = currentPosition;
+  pan.timeDelta = timeDelta;
+  pan.numberOfTouches = numberOfTouches;
+
+  return pan;
+}
+
+/**
+ * Helper to generate PanGestureEvent
+ *
+ * @param[in] application Application instance
+ * @param[in] state The Gesture State
+ * @param[in] pos The current position of touch.
+ */
+static void SendPan(ToolkitTestApplication& application, Gesture::State state, const Vector2& pos)
+{
+  static Vector2 last;
+
+  if( (state == Gesture::Started) ||
+      (state == Gesture::Possible) )
+  {
+    last.x = pos.x;
+    last.y = pos.y;
+  }
+
+  application.ProcessEvent(GeneratePan(state, last, pos, RENDER_FRAME_INTERVAL));
+
+  last.x = pos.x;
+  last.y = pos.y;
+}
+
+/*
+ * Simulate time passed by.
+ *
+ * @note this will always process at least 1 frame (1/60 sec)
+ *
+ * @param application Test application instance
+ * @param duration Time to pass in milliseconds.
+ * @return The actual time passed in milliseconds
+ */
+int Wait(ToolkitTestApplication& application, int duration = 0)
+{
+  int time = 0;
+
+  for(int i = 0; i <= ( duration / RENDER_FRAME_INTERVAL); i++)
+  {
+    application.SendNotification();
+    application.Render(RENDER_FRAME_INTERVAL);
+    time += RENDER_FRAME_INTERVAL;
+  }
+
+  return time;
+}
+
+// Callback probes.
+
+static bool gOnPanFinishedCalled;                         ///< Whether the PanFinished signal was invoked.
+static bool gOnScrollPositionIntervalReachedSignalCalled;        ///< Whether the ScrollPositionIntervalReached signal was invoked.
+
+/**
+ * Invoked when pan gesture is finished on the scroll indicator.
+ */
+static void OnPanFinished()
+{
+  gOnPanFinishedCalled = true;
+}
+
+/**
+ * Invoked when the current scroll position of the scrollable content goes above or below the values
+ * specified by SCROLL_POSITION_INTERVALS property.
+ *
+ * @param[in] position The current scroll position.
+ */
+static void OnScrollPositionIntervalReached( float position )
+{
+  gOnScrollPositionIntervalReachedSignalCalled = true;
+}
+
+static Vector2 PerformGestureSwipe(ToolkitTestApplication& application, Vector2 start, Vector2 direction, int frames)
+{
+  gOnPanFinishedCalled = false;
+
+  // Now do a pan starting from (start) and heading (direction)
+  Vector2 pos(start);
+  SendPan(application, Gesture::Possible, pos);
+  SendPan(application, Gesture::Started, pos);
+  Wait(application);
+
+  for(int i = 0; i < frames; i++)
+  {
+    pos += direction; // Move in this direction
+    SendPan(application, Gesture::Continuing, pos);
+    Wait(application);
+  }
+
+  pos += direction; // Move in this direction.
+  SendPan(application, Gesture::Finished, pos);
+  Wait(application);
+
+  return pos;
+}
+
+} // namespace
+
+int UtcDaliToolkitScrollBarConstructorP(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollBar scrollBar;
+  DALI_TEST_CHECK( !scrollBar );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarCopyConstructorP(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollBar scrollBar = ScrollBar::New();
+  scrollBar.SetProperty( ScrollBar::Property::INDICATOR_FIXED_HEIGHT, 38.2f );
+
+  ScrollBar copy( scrollBar );
+  DALI_TEST_CHECK( copy );
+  DALI_TEST_CHECK( copy.GetProperty<float>( ScrollBar::Property::INDICATOR_FIXED_HEIGHT ) == scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_FIXED_HEIGHT ) );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarAssignmentOperatorP(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollBar scrollBar = ScrollBar::New();
+  scrollBar.SetProperty( ScrollBar::Property::INDICATOR_FIXED_HEIGHT, 38.2f );
+
+  ScrollBar copy = scrollBar;
+  DALI_TEST_CHECK( copy );
+  DALI_TEST_CHECK( copy.GetProperty<float>( ScrollBar::Property::INDICATOR_FIXED_HEIGHT ) == scrollBar.GetProperty<float>( ScrollBar::Property::INDICATOR_FIXED_HEIGHT ) );
+  END_TEST;
+}
+
+int UtcDaliScrollBarDestructorP(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollBar* scrollBar = new ScrollBar();
+  delete scrollBar;
+
+  DALI_TEST_CHECK( true );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarNewP(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+  END_TEST;
+
+  ScrollBar vertical = ScrollBar::New(ScrollBar::Vertical);
+  DALI_TEST_CHECK( vertical );
+  DALI_TEST_CHECK( vertical.GetScrollDirection() == ScrollBar::Vertical );
+
+  ScrollBar horizontal = ScrollBar::New(ScrollBar::Horizontal);
+  DALI_TEST_CHECK( horizontal );
+  DALI_TEST_CHECK( horizontal.GetScrollDirection() == ScrollBar::Horizontal );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarDownCastP(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollBar scrollBar1 = ScrollBar::New();
+  BaseHandle object( scrollBar1 );
+
+  ScrollBar scrollBar2 = ScrollBar::DownCast( object );
+  DALI_TEST_CHECK( scrollBar2 );
+
+  ScrollBar scrollBar3 = DownCast< ScrollBar >( object );
+  DALI_TEST_CHECK( scrollBar3 );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarDownCastN(void)
+{
+  ToolkitTestApplication application;
+
+  BaseHandle uninitializedObject;
+  ScrollBar scrollBar1 = ScrollBar::DownCast( uninitializedObject );
+  DALI_TEST_CHECK( !scrollBar1 );
+
+  ScrollBar scrollBar2 = DownCast< ScrollBar >( uninitializedObject );
+  DALI_TEST_CHECK( !scrollBar2 );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarSetScrollPropertySourceP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a vertical scroll bar
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  DALI_TEST_CHECK( scrollBar );
+  DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::Vertical );
+
+  float scrollBarHeight = 100.0f;
+  scrollBar.SetSize(20.0f, scrollBarHeight, 0.0f);
+  Stage::GetCurrent().Add( scrollBar );
+
+  // Create a source actor that owns the scroll properties required by the scroll bar
+  Actor sourceActor = Actor::New();
+  Stage::GetCurrent().Add( sourceActor );
+
+  // Register the scroll properties
+  Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "source-position", 0.0f );
+  Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "source-position-min", 0.0f );
+  Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "source-position-max", 100.0f );
+  Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "source-content-size", 500.0f );
+
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position" ), propertyScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-min" ), propertyMinScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-max" ), propertyMaxScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-content-size" ), propertyScrollContentSize, TEST_LOCATION );
+
+  // Set the source of the scroll position properties.
+  scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Check that the indicator size should be: scroll bar size * (scroll bar size / content size).
+  // i.e. The bigger the content size, the smaller the indicator size
+  float indicatorHeight = indicator.GetCurrentSize().y;
+  DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 500.0f, TEST_LOCATION );
+
+  // Decrease the content length
+  sourceActor.SetProperty( propertyScrollContentSize, 250.0f );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator size is changed accordingly
+  indicatorHeight = indicator.GetCurrentSize().y;
+  DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 250.0f, TEST_LOCATION );
+
+  // As scroll position is 0, check that the indicator position should be 0.0f.
+  float indicatorPosition = indicator.GetCurrentPosition().y;
+  DALI_TEST_EQUALS( indicatorPosition, 0.0f, TEST_LOCATION );
+
+  // Set the scroll position to the middle
+  sourceActor.SetProperty( propertyScrollPosition, -50.0f );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator should be in the middle of the scroll bar
+  indicatorPosition = indicator.GetCurrentPosition().y;
+  DALI_TEST_EQUALS( indicatorPosition, (scrollBarHeight - indicatorHeight) * 0.5f, TEST_LOCATION );
+
+  // Set the scroll position to the maximum
+  sourceActor.SetProperty( propertyScrollPosition, -100.0f );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator should be in the end of the scroll bar
+  indicatorPosition = indicator.GetCurrentPosition().y;
+  DALI_TEST_EQUALS( indicatorPosition, scrollBarHeight - indicatorHeight, TEST_LOCATION );
+
+  // Increase the maximum scroll position to double
+  sourceActor.SetProperty( propertyMaxScrollPosition, 200.0f );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator should be now in the middle of the scroll bar
+  indicatorPosition = indicator.GetCurrentPosition().y;
+  DALI_TEST_EQUALS( indicatorPosition, (scrollBarHeight - indicatorHeight) * 0.5f, TEST_LOCATION );
+
+  // Create another source actor
+  Actor newSourceActor = Actor::New();
+  Stage::GetCurrent().Add( newSourceActor );
+
+  // Register the scroll properties
+  Property::Index newPropertyScrollPosition = newSourceActor.RegisterProperty( "source-position", 0.0f );
+  Property::Index newPropertyMinScrollPosition = newSourceActor.RegisterProperty( "source-position-min", 0.0f );
+  Property::Index newPropertyMaxScrollPosition = newSourceActor.RegisterProperty( "source-position-max", 200.0f );
+  Property::Index newPropertyScrollContentSize = newSourceActor.RegisterProperty( "source-content-size", 400.0f );
+
+  DALI_TEST_EQUALS( newSourceActor.GetPropertyIndex( "source-position" ), newPropertyScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( newSourceActor.GetPropertyIndex( "source-position-min" ), newPropertyMinScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( newSourceActor.GetPropertyIndex( "source-position-max" ), newPropertyMaxScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( newSourceActor.GetPropertyIndex( "source-content-size" ), newPropertyScrollContentSize, TEST_LOCATION );
+
+  // Change the source of the scroll position properties to be the new source actor.
+  scrollBar.SetScrollPropertySource(newSourceActor, newPropertyScrollPosition, newPropertyMinScrollPosition, newPropertyMaxScrollPosition, newPropertyScrollContentSize);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator size is changed accordingly
+  indicatorHeight = indicator.GetCurrentSize().y;
+  DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 400.0f, TEST_LOCATION );
+
+  // Check that the indicator position goes back to the beginning of the scroll bar
+  indicatorPosition = indicator.GetCurrentPosition().y;
+  DALI_TEST_EQUALS( indicatorPosition, 0.0f, TEST_LOCATION );
+
+  // Set the scroll position to one fifth of the maximum
+  newSourceActor.SetProperty( propertyScrollPosition, -40.0f );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator should be in one fifth from the beginning of the scroll bar
+  indicatorPosition = indicator.GetCurrentPosition().y;
+  DALI_TEST_EQUALS( indicatorPosition, (scrollBarHeight - indicatorHeight) * 0.2f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarSetScrollPropertySourceN(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  // Set empty handle of source object and invalid source property index.
+  Actor sourceActor;
+  scrollBar.SetScrollPropertySource(sourceActor, Property::INVALID_INDEX, Property::INVALID_INDEX, Property::INVALID_INDEX, Property::INVALID_INDEX);
+
+  DALI_TEST_CHECK( true );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarSetScrollIndicatorP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Set a new indicator
+  Actor newIndicator = Actor::New();
+  scrollBar.SetScrollIndicator(newIndicator);
+
+  // Check that the new indicator is successfully set
+  DALI_TEST_CHECK( indicator != scrollBar.GetScrollIndicator() );
+  DALI_TEST_CHECK( newIndicator == scrollBar.GetScrollIndicator() );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarSetScrollIndicatorN(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Try to set an uninitialized actor as the indicator
+  Actor uninitializedIndicator;
+  scrollBar.SetScrollIndicator(uninitializedIndicator);
+
+  // Check that the uninitialized actor can not be set as the indicator
+  DALI_TEST_CHECK( indicator == scrollBar.GetScrollIndicator() );
+  DALI_TEST_CHECK( uninitializedIndicator != scrollBar.GetScrollIndicator() );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarGetScrollIndicatorP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Set a new indicator
+  Actor newIndicator = Actor::New();
+  scrollBar.SetScrollIndicator(newIndicator);
+
+  // Check that the new indicator is successfully set
+  DALI_TEST_CHECK( scrollBar.GetScrollIndicator() );
+  DALI_TEST_CHECK( indicator != scrollBar.GetScrollIndicator() );
+  DALI_TEST_CHECK( newIndicator == scrollBar.GetScrollIndicator() );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarGetScrollIndicatorN(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Try to set an uninitialized actor as the indicator
+  Actor uninitializedIndicator;
+  scrollBar.SetScrollIndicator(uninitializedIndicator);
+
+  // Check that the indicator has not been changed
+  DALI_TEST_CHECK( indicator == scrollBar.GetScrollIndicator() );
+  DALI_TEST_CHECK( uninitializedIndicator != scrollBar.GetScrollIndicator() );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarSetScrollPositionIntervalsP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a vertical scroll bar
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  DALI_TEST_CHECK( scrollBar );
+
+  scrollBar.SetParentOrigin(ParentOrigin::TOP_LEFT);
+  scrollBar.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  scrollBar.SetSize(20.0f, 800.0f, 0.0f);
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  // Connect to the ScrollPositionIntervalReached signal
+  scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Create a source actor that owns the scroll properties required by the scroll bar
+  Actor sourceActor = Actor::New();
+  Stage::GetCurrent().Add( sourceActor );
+
+  // Register the scroll properties
+  Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "source-position", 0.0f );
+  Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "source-position-min", 0.0f );
+  Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "source-position-max", 800.0f );
+  Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "source-content-size", 2000.0f );
+
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position" ), propertyScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-min" ), propertyMinScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-max" ), propertyMaxScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-content-size" ), propertyScrollContentSize, TEST_LOCATION );
+
+  // Set the source of the scroll position properties.
+  scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Set the values to get notified when the scroll positions of the source actor goes above or below these values
+  Dali::Vector<float> positionIntervals;
+  for( size_t i = 0; i != 10; ++i )
+  {
+    positionIntervals.PushBack( -80.0f * i ); // should get notified for each 80 pixels
+  }
+  scrollBar.SetScrollPositionIntervals(positionIntervals);
+
+  // Get the list of scroll position intervals for notification
+  Dali::Vector<float> results = scrollBar.GetScrollPositionIntervals();
+
+  // Check that the result is the same as the list previously set.
+  DALI_TEST_EQUALS( positionIntervals.Count(), results.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[0], results[0], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[1], results[1], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[2], results[2], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[3], results[3], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[4], results[4], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[5], results[5], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[6], results[6], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[7], results[7], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[8], results[8], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[9], results[9], TEST_LOCATION );
+
+  // Reset the flag
+  gOnScrollPositionIntervalReachedSignalCalled = false;
+
+  // Animate the scroll position to cross the specified value
+  Animation animation = Animation::New(0.1f);
+  animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -85.0f );
+  animation.Play();
+
+  // Wait for 0.1 second
+  Wait(application, 100);
+
+  // Check that the signal callback is called
+  DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+
+  // Reset the flag
+  gOnScrollPositionIntervalReachedSignalCalled = false;
+
+  // Rest and clear the animation
+  animation.Clear();
+  animation.Reset();
+
+  // Animate the scroll position to cross another specified value
+  animation = Animation::New(0.1f);
+  animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -170.0f );
+  animation.Play();
+
+  // Wait for 0.1 second
+  Wait(application, 100);
+
+  // Check that the signal callback is called
+  DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+
+  // Reset the flag
+  gOnScrollPositionIntervalReachedSignalCalled = false;
+
+  // Rest and clear the animation
+  animation.Clear();
+  animation.Reset();
+
+  // Animate the scroll position back to the previous value
+  animation = Animation::New(0.1f);
+  animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -85.0f );
+  animation.Play();
+
+  // Wait for 0.1 second
+  Wait(application, 100);
+
+  // Check that the signal callback is called
+  DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarGetScrollPositionIntervalsP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a vertical scroll bar
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  DALI_TEST_CHECK( scrollBar );
+
+  // Set the values to get notified when the scroll positions of the source actor goes above or below these values
+  Dali::Vector<float> positionIntervals;
+  for( size_t i = 0; i != 10; ++i )
+  {
+    positionIntervals.PushBack( -80.0f * i ); // should get notified for each 80 pixels
+  }
+  scrollBar.SetScrollPositionIntervals(positionIntervals);
+
+  // Get the list of scroll position intervals for notification
+  Dali::Vector<float> results = scrollBar.GetScrollPositionIntervals();
+
+  // Check that the result is the same as the list previously set.
+  DALI_TEST_EQUALS( positionIntervals.Count(), results.Count(), TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[0], results[0], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[1], results[1], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[2], results[2], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[3], results[3], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[4], results[4], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[5], results[5], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[6], results[6], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[7], results[7], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[8], results[8], TEST_LOCATION );
+  DALI_TEST_EQUALS( positionIntervals[9], results[9], TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarGetScrollDirectionP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a vertical scroll bar
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  DALI_TEST_CHECK( scrollBar );
+  DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::Vertical );
+
+  // Change the direction of scroll bar to horizontal
+  scrollBar.SetScrollDirection(ScrollBar::Horizontal);
+  DALI_TEST_CHECK( scrollBar.GetScrollDirection() == ScrollBar::Horizontal );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarSetIndicatorHeightPolicyP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  float scrollBarHeight = 100.0f;
+  scrollBar.SetSize(20.0f, scrollBarHeight, 0.0f);
+  Stage::GetCurrent().Add( scrollBar );
+
+  // Create a source actor that owns the scroll properties required by the scroll bar
+  Actor sourceActor = Actor::New();
+  Stage::GetCurrent().Add( sourceActor );
+
+  // Register the scroll properties
+  Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "source-position", 0.0f );
+  Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "source-position-min", 0.0f );
+  Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "source-position-max", 100.0f );
+  Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "source-content-size", 500.0f );
+
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position" ), propertyScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-min" ), propertyMinScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-max" ), propertyMaxScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-content-size" ), propertyScrollContentSize, TEST_LOCATION );
+
+  // Set the source of the scroll position properties.
+  scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Check that the indicator size should be: scroll bar size * (scroll bar size / content size).
+  // i.e. The bigger the content size, the smaller the indicator size
+  float indicatorHeight = indicator.GetCurrentSize().y;
+  DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 500.0f, TEST_LOCATION );
+
+  // Set the indicator height to be fixed to 50.0f
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+  scrollBar.SetIndicatorFixedHeight(50.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator size should be 50.0f
+  indicatorHeight = indicator.GetCurrentSize().y;
+  DALI_TEST_EQUALS( indicatorHeight, 50.0f, TEST_LOCATION );
+
+  // Set the indicator height to be variable
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Variable);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator size should be: scroll bar size * (scroll bar size / content size).
+  indicatorHeight = indicator.GetCurrentSize().y;
+  DALI_TEST_EQUALS( indicatorHeight, scrollBarHeight * scrollBarHeight / 500.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarGetIndicatorHeightPolicyP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  // Set the indicator height to be fixed
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Fixed, TEST_LOCATION );
+
+  // Set the indicator height to be variable
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Variable);
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHeightPolicy(), Toolkit::ScrollBar::Variable, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarSetIndicatorFixedHeightP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  float scrollBarHeight = 100.0f;
+  scrollBar.SetSize(20.0f, scrollBarHeight, 0.0f);
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Set the indicator height to be fixed to 50.0f
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+  scrollBar.SetIndicatorFixedHeight(50.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator size should be 50.0f
+  DALI_TEST_EQUALS( indicator.GetCurrentSize().y, 50.0f, TEST_LOCATION );
+
+  // Set the indicator height to be fixed to 25.0f
+  scrollBar.SetIndicatorFixedHeight(25.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator size should be 25.0f
+  DALI_TEST_EQUALS( indicator.GetCurrentSize().y, 25.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarGetIndicatorFixedHeightP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  // Set the fixed indicator height to be 50.0f
+  scrollBar.SetIndicatorFixedHeight(50.0f);
+
+  // Check that the indicator size should be 50.0f
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorFixedHeight(), 50.0f, TEST_LOCATION );
+
+  // Set the indicator height to be fixed to 25.0f
+  scrollBar.SetIndicatorFixedHeight(25.0f);
+
+  // Check that the indicator size should be 50.0f
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorFixedHeight(), 25.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarSetIndicatorShowDurationP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Set the duration to show the indicator to be 0.35 second
+  scrollBar.SetIndicatorShowDuration(0.35);
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), 0.35f, TEST_LOCATION );
+
+  // Make the indicator invisible
+  indicator.SetOpacity(0.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  // Show the indicator
+  scrollBar.ShowIndicator();
+
+  // Wait for 0.35 second
+  Wait(application, 350);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Set the duration to show the indicator to be 0.75 second
+  scrollBar.SetIndicatorShowDuration(0.75);
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), 0.75f, TEST_LOCATION );
+
+  // Make the indicator invisible
+  indicator.SetOpacity(0.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  // Show the indicator
+  scrollBar.ShowIndicator();
+
+  // Wait for 0.35 second first
+  Wait(application, 350);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is not fully visible yet
+  DALI_TEST_CHECK( indicator.GetCurrentOpacity() != 1.0f );
+
+  // Wait for another 0.4 second
+  Wait(application, 400);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now fully visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarSetIndicatorShowDurationN(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Get the default duration to show the indicator
+  float duration = scrollBar.GetIndicatorShowDuration();
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( duration > 0.0f );
+
+  // Make the indicator invisible
+  indicator.SetOpacity(0.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  // Show the indicator
+  scrollBar.ShowIndicator();
+
+  // Wait for the specified duration
+  Wait(application, duration * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Now set the duration to show the indicator to be a negative value (which should be ignored and therefore means instant)
+  scrollBar.SetIndicatorShowDuration(-0.25f);
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), -0.25f, TEST_LOCATION );
+
+  // Make the indicator invisible
+  indicator.SetOpacity(0.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  // Show the indicator
+  scrollBar.ShowIndicator();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator becomes instantly visible in the next frame
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarGetIndicatorShowDurationP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  // Set the duration to show the indicator to be 0.35 second
+  scrollBar.SetIndicatorShowDuration(0.35f);
+
+  // Check that the duration to show the indicator is 0.35 second
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), 0.35f, TEST_LOCATION );
+
+  // Set the duration to show the indicator to be 0.75 second
+  scrollBar.SetIndicatorShowDuration(0.75f);
+
+  // Check that the duration to show the indicator is 0.75 second
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorShowDuration(), 0.75f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarSetIndicatorHideDurationP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Set the duration to hide the indicator to be 0.15 second
+  scrollBar.SetIndicatorHideDuration(0.15f);
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), 0.15f, TEST_LOCATION );
+
+  // Make the indicator visible
+  indicator.SetOpacity(1.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Hide the indicator
+  scrollBar.HideIndicator();
+
+  // Wait for 0.15 second
+  Wait(application, 150);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  // Set the duration to hide the indicator to be 0.65 second
+  scrollBar.SetIndicatorHideDuration(0.65f);
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), 0.65f, TEST_LOCATION );
+
+  // Make the indicator visible
+  indicator.SetOpacity(1.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Hide the indicator
+  scrollBar.HideIndicator();
+
+  // Wait for 0.15 second first
+  Wait(application, 150);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is not fully invisible yet
+  DALI_TEST_CHECK( indicator.GetCurrentOpacity() != 0.0f );
+
+  // Wait for another 0.5 second
+  Wait(application, 500);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now fully invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarSetIndicatorHideDurationN(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Get the default duration to hide the indicator
+  float duration = scrollBar.GetIndicatorHideDuration();
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( duration > 0.0f );
+
+  // Make the indicator visible
+  indicator.SetOpacity(1.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Hide the indicator
+  scrollBar.HideIndicator();
+
+  // Wait for the specified duration
+  Wait(application, duration * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  // Now set the duration to hide the indicator to be a negative value (which should be ignored and therefore means instant)
+  scrollBar.SetIndicatorHideDuration(-0.25f);
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), -0.25f, TEST_LOCATION );
+
+  // Make the indicator visible
+  indicator.SetOpacity(1.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Hide the indicator
+  scrollBar.HideIndicator();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator becomes instantly invisible in the next frame
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarGetIndicatorHideDurationP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  // Set the duration to hide the indicator to be 0.15 second
+  scrollBar.SetIndicatorHideDuration(0.15f);
+
+  // Check that the duration to hide the indicator is 0.15 second
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), 0.15f, TEST_LOCATION );
+
+  // Set the duration to hide the indicator to be 0.65 second
+  scrollBar.SetIndicatorHideDuration(0.65f);
+
+  // Check that the duration to hide the indicator is 0.65 second
+  DALI_TEST_EQUALS( scrollBar.GetIndicatorHideDuration(), 0.65f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarShowIndicatorP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Get the default duration to show the indicator
+  float duration = scrollBar.GetIndicatorShowDuration();
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( duration > 0.0f );
+
+  // Make the indicator invisible
+  indicator.SetOpacity(0.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  // Show the indicator
+  scrollBar.ShowIndicator();
+
+  // Wait for the specified duration
+  Wait(application, duration * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarShowIndicatorN(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Make the indicator initially visible
+  indicator.SetOpacity(1.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is initially visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Get the default duration to show the indicator
+  float duration = scrollBar.GetIndicatorShowDuration();
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( duration > 0.0f );
+
+  // Show the indicator
+  scrollBar.ShowIndicator();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is still visible in the very next frame
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarHideIndicatorP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Get the default duration to hide the indicator
+  float duration = scrollBar.GetIndicatorHideDuration();
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( duration > 0.0f );
+
+  // Make the indicator visible
+  indicator.SetOpacity(1.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is visible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 1.0f, TEST_LOCATION );
+
+  // Hide the indicator
+  scrollBar.HideIndicator();
+
+  // Wait for the specified duration
+  Wait(application, duration * 1000);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is now invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarHideIndicatorN(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a scroll bar
+  ScrollBar scrollBar = ScrollBar::New();
+  DALI_TEST_CHECK( scrollBar );
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  Actor indicator = scrollBar.GetScrollIndicator();
+  DALI_TEST_CHECK( indicator );
+
+  // Make the indicator initially invisible
+  indicator.SetOpacity(0.0f);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is initially invisible
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  // Get the default duration to hide the indicator
+  float duration = scrollBar.GetIndicatorHideDuration();
+
+  // Check that the default duration is greater than 0
+  DALI_TEST_CHECK( duration > 0.0f );
+
+  // Hide the indicator
+  scrollBar.HideIndicator();
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Check that the indicator is still invisible in the very next frame
+  DALI_TEST_EQUALS( indicator.GetCurrentOpacity(), 0.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarPanFinishedSignalP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a vertical scroll bar
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  DALI_TEST_CHECK( scrollBar );
+
+  scrollBar.SetParentOrigin(ParentOrigin::TOP_LEFT);
+  scrollBar.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  scrollBar.SetSize(20.0f, 800.0f, 0.0f);
+
+  // Set the indicator height to be fixed to 50.0f
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+  scrollBar.SetIndicatorFixedHeight(50.0f);
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  // Connect the pan finished signal
+  scrollBar.PanFinishedSignal().Connect( &OnPanFinished );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Create a source actor that owns the scroll properties required by the scroll bar
+  Actor sourceActor = Actor::New();
+  Stage::GetCurrent().Add( sourceActor );
+
+  // Register the scroll properties
+  Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "source-position", 0.0f );
+  Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "source-position-min", 0.0f );
+  Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "source-position-max", 100.0f );
+  Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "source-content-size", 500.0f );
+
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position" ), propertyScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-min" ), propertyMinScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-max" ), propertyMaxScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-content-size" ), propertyScrollContentSize, TEST_LOCATION );
+
+  // Set the source of the scroll position properties.
+  scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Perform a swipe gesture on the indicator
+  PerformGestureSwipe(application, Vector2(1.0f, 1.0f), Vector2(Vector2::YAXIS * 1.0f), 20);
+  DALI_TEST_EQUALS( gOnPanFinishedCalled, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarPanFinishedSignalN(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a vertical scroll bar
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  DALI_TEST_CHECK( scrollBar );
+
+  scrollBar.SetParentOrigin(ParentOrigin::TOP_LEFT);
+  scrollBar.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  scrollBar.SetSize(20.0f, 800.0f, 0.0f);
+
+  // Set the indicator height to be fixed to 50.0f
+  scrollBar.SetIndicatorHeightPolicy(Toolkit::ScrollBar::Fixed);
+  scrollBar.SetIndicatorFixedHeight(50.0f);
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  // Connect the pan finished signal
+  scrollBar.PanFinishedSignal().Connect( &OnPanFinished );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Perform a vertical swipe gesture on the indicator when there is no source object set on the scroll bar
+  PerformGestureSwipe(application, Vector2(1.0f, 1.0f), Vector2(Vector2::YAXIS * 1.0f), 20);
+  DALI_TEST_EQUALS( gOnPanFinishedCalled, false, TEST_LOCATION );
+
+  // Create a source actor that owns the scroll properties required by the scroll bar
+  Actor sourceActor = Actor::New();
+  Stage::GetCurrent().Add( sourceActor );
+
+  // Register the scroll properties
+  Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "source-position", 0.0f );
+  Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "source-position-min", 0.0f );
+  Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "source-position-max", 100.0f );
+  Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "source-content-size", 500.0f );
+
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position" ), propertyScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-min" ), propertyMinScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-max" ), propertyMaxScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-content-size" ), propertyScrollContentSize, TEST_LOCATION );
+
+  // Set the source of the scroll position properties.
+  scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Perform a swipe gesture on the scroll bar but not on the indicator
+  PerformGestureSwipe(application, Vector2(1.0f, 780.0f), Vector2(Vector2::YAXIS * -1.0f), 20);
+  DALI_TEST_EQUALS( gOnPanFinishedCalled, false, TEST_LOCATION );
+
+  // Perform a swipe gesture on the indicator
+  PerformGestureSwipe(application, Vector2(1.0f, 1.0f), Vector2(Vector2::YAXIS * 1.0f), 20);
+  DALI_TEST_EQUALS( gOnPanFinishedCalled, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a vertical scroll bar
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  DALI_TEST_CHECK( scrollBar );
+
+  scrollBar.SetParentOrigin(ParentOrigin::TOP_LEFT);
+  scrollBar.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  scrollBar.SetSize(20.0f, 800.0f, 0.0f);
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  // Connect to the ScrollPositionIntervalReached signal
+  scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Create a source actor that owns the scroll properties required by the scroll bar
+  Actor sourceActor = Actor::New();
+  Stage::GetCurrent().Add( sourceActor );
+
+  // Register the scroll properties
+  Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "source-position", 0.0f );
+  Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "source-position-min", 0.0f );
+  Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "source-position-max", 800.0f );
+  Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "source-content-size", 2000.0f );
+
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position" ), propertyScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-min" ), propertyMinScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-max" ), propertyMaxScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-content-size" ), propertyScrollContentSize, TEST_LOCATION );
+
+  // Set the source of the scroll position properties.
+  scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Set the values to get notified when the scroll positions of the source actor goes above or below these values
+  Dali::Vector<float> positionIntervals;
+  for( size_t i = 0; i != 10; ++i )
+  {
+    positionIntervals.PushBack( -80.0f * i ); // should get notified for each 80 pixels
+  }
+  scrollBar.SetScrollPositionIntervals(positionIntervals);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Reset the flag
+  gOnScrollPositionIntervalReachedSignalCalled = false;
+
+  // Animate the scroll position to cross the specified value
+  Animation animation = Animation::New(0.1f);
+  animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -85.0f );
+  animation.Play();
+
+  // Wait for 0.1 second
+  Wait(application, 100);
+
+  // Check that the signal callback is called
+  DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+
+  // Reset the flag
+  gOnScrollPositionIntervalReachedSignalCalled = false;
+
+  // Rest and clear the animation
+  animation.Clear();
+  animation.Reset();
+
+  // Animate the scroll position to cross another specified value
+  animation = Animation::New(0.1f);
+  animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -170.0f );
+  animation.Play();
+
+  // Wait for 0.1 second
+  Wait(application, 100);
+
+  // Check that the signal callback is called
+  DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+
+  // Reset the flag
+  gOnScrollPositionIntervalReachedSignalCalled = false;
+
+  // Rest and clear the animation
+  animation.Clear();
+  animation.Reset();
+
+  // Animate the scroll position back to the previous value
+  animation = Animation::New(0.1f);
+  animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -85.0f );
+  animation.Play();
+
+  // Wait for 0.1 second
+  Wait(application, 100);
+
+  // Check that the signal callback is called
+  DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollBarScrollPositionIntervalReachedSignalN(void)
+{
+  ToolkitTestApplication application;
+
+  // Create a vertical scroll bar
+  ScrollBar scrollBar = ScrollBar::New(ScrollBar::Vertical);
+  DALI_TEST_CHECK( scrollBar );
+
+  scrollBar.SetParentOrigin(ParentOrigin::TOP_LEFT);
+  scrollBar.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+  scrollBar.SetSize(20.0f, 800.0f, 0.0f);
+
+  Stage::GetCurrent().Add( scrollBar );
+
+  // Connect to the ScrollPositionIntervalReached signal
+  scrollBar.ScrollPositionIntervalReachedSignal().Connect( &OnScrollPositionIntervalReached );
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Create a source actor that owns the scroll properties required by the scroll bar
+  Actor sourceActor = Actor::New();
+  Stage::GetCurrent().Add( sourceActor );
+
+  // Register the scroll properties
+  Property::Index propertyScrollPosition = sourceActor.RegisterProperty( "source-position", 0.0f );
+  Property::Index propertyMinScrollPosition = sourceActor.RegisterProperty( "source-position-min", 0.0f );
+  Property::Index propertyMaxScrollPosition = sourceActor.RegisterProperty( "source-position-max", 800.0f );
+  Property::Index propertyScrollContentSize = sourceActor.RegisterProperty( "source-content-size", 2000.0f );
+
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position" ), propertyScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-min" ), propertyMinScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-position-max" ), propertyMaxScrollPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( sourceActor.GetPropertyIndex( "source-content-size" ), propertyScrollContentSize, TEST_LOCATION );
+
+  // Set the source of the scroll position properties.
+  scrollBar.SetScrollPropertySource(sourceActor, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Set the values to get notified when the scroll positions of the source actor goes above or below these values
+  Dali::Vector<float> positionIntervals;
+  for( size_t i = 0; i != 10; ++i )
+  {
+    positionIntervals.PushBack( -80.0f * i ); // should get notified for each 80 pixels
+  }
+  scrollBar.SetScrollPositionIntervals(positionIntervals);
+
+  // Render and notify
+  application.SendNotification();
+  application.Render();
+
+  // Reset the flag
+  gOnScrollPositionIntervalReachedSignalCalled = false;
+
+  // Animate the scroll position not to cross the specified value
+  Animation animation = Animation::New(0.1f);
+  animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -70.0f );
+  animation.Play();
+
+  // Wait for 0.1 second
+  Wait(application, 100);
+
+  // Check that the signal callback is not called
+  DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, false, TEST_LOCATION );
+
+  // Rest and clear the animation
+  animation.Clear();
+  animation.Reset();
+
+  // Animate the scroll position to cross another specified value
+  animation = Animation::New(0.1f);
+  animation.AnimateTo( Property( sourceActor, propertyScrollPosition ), -85.0f );
+  animation.Play();
+
+  // Wait for 0.1 second
+  Wait(application, 100);
+
+  // Check that the signal callback is called
+  DALI_TEST_EQUALS( gOnScrollPositionIntervalReachedSignalCalled, true, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
index 493a795..10d2e61 100644 (file)
@@ -57,7 +57,7 @@ const int CLAMP_STEP_0_CHECK_NOTCLAMPED = 0;                    ///< FSM: "First
 const int CLAMP_STEP_1_CHECK_CLAMPED_WEST = 1;                  ///< FSM: "Next check that scrollview clamps against left side"
 const int CLAMP_STEP_2_CHECK_CLAMPED_SOUTH_WEST = 2;            ///< FSM: "Then check that scrollview clamps against bottom-left side"
 const int CLAMP_STEP_3_SUCCESS = 3;                             ///< FSM: "Finished (Success)"
-const Vector3 CLAMP_START_SCROLL_POSITION(30.0f, 100.0f, 0.0f); ///< Scroll start position for the Clamping tests.
+const Vector2 CLAMP_START_SCROLL_POSITION(30.0f, 100.0f);       ///< Scroll start position for the Clamping tests.
 const Vector2 CLAMP_TOUCH_START( 100.0f, 100.0f );              ///< Start point to touch from for the Clamping tests.
 const Vector2 CLAMP_TOUCH_MOVEMENT( 5.0f, -5.0f );              ///< Amount to move touch for each frame for the Clamping tests.
 const int CLAMP_GESTURE_FRAMES = 100;                           ///< Number of Frames to synthesize a gesture for the Clamping tests.
@@ -65,14 +65,17 @@ const Vector3 TEST_ACTOR_POSITION(100.0f, 100.0f, 0.0f);        ///< A Test acto
 const Vector3 TEST_CONSTRAINT_OFFSET(1.0f, 2.0f, 0.0f);         ///< A Test constraint offset (arbitrary value to test effects)
 const float TEST_RATIO_TOLERANCE = 0.05;                        ///< +/-5% tolerance for ratio comparisons.
 
-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 DEFAULT_SNAP_OVERSHOOT_DURATION(0.5f);                  ///< Default overshoot snapping animation time.
+const float DEFAULT_MAX_OVERSHOOT(100.0f);                          ///< Default maximum allowed overshoot in pixels
+
+const int MAX_FRAMES_TO_TEST_OVERSHOOT = 600;                       ///< 10 seconds (at 60 frames per second).
+const Vector2 OVERSHOOT_START_SCROLL_POSITION(100.0f, 100.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/(100/60)) = 0.33)
+const Vector2 SNAP_POSITION_WITH_DECELERATED_VELOCITY(74.0f, 74.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.
-const float TIME_TOLERANCE = 0.05f;                                   ///< Allow testing tolerance between a 10th of second (+/- 3 frames)
+const float TIME_TOLERANCE = 0.05f;                                 ///< Allow testing tolerance between a 10th of second (+/- 3 frames)
 
 
 // Generate a PanGestureEvent to send to Core
@@ -154,7 +157,7 @@ static Vector3 gConstraintResult;                       ///< Result from constra
  *
  * @param[in] position The current scroll position.
  */
-static void OnScrollStart( const Vector3& position )
+static void OnScrollStart( const Vector2& position )
 {
   gOnScrollStartCalled = true;
 }
@@ -164,7 +167,7 @@ static void OnScrollStart( const Vector3& position )
  *
  * @param[in] position The current scroll position.
  */
-static void OnScrollUpdate( const Vector3& position )
+static void OnScrollUpdate( const Vector2& position )
 {
   gOnScrollUpdateCalled = true;
 }
@@ -174,7 +177,7 @@ static void OnScrollUpdate( const Vector3& position )
  *
  * @param[in] position The current scroll position.
  */
-static void OnScrollComplete( const Vector3& position )
+static void OnScrollComplete( const Vector2& position )
 {
   gOnScrollCompleteCalled = true;
 }
@@ -214,7 +217,7 @@ struct TestSumConstraint
    */
   void operator()( Vector3& current, const PropertyInputContainer& inputs )
   {
-    gConstraintResult = current + inputs[0]->GetVector3() + mOffset;
+    gConstraintResult = current + Vector3(inputs[0]->GetVector2()) + mOffset;
     current = gConstraintResult;
   }
 
@@ -315,8 +318,8 @@ int UtcDaliScrollViewScrollToPosition(void)
   ScrollView scrollView = ScrollView::New();
   Stage::GetCurrent().Add( scrollView );
 
-  const Vector3 target = Vector3(100.0f, 200.0f, 0.0f);
-  const Vector3 target2 = Vector3(300.0f, 100.0f, 0.0f);
+  const Vector2 target = Vector2(100.0f, 200.0f);
+  const Vector2 target2 = Vector2(300.0f, 100.0f);
 
   scrollView.ScrollTo( target, 0.0f );
   Wait(application);
@@ -346,29 +349,29 @@ int UtcDaliScrollViewScrollToPage(void)
 
   scrollView.ScrollTo( 1, 0.0f );
   Wait(application);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector3(100.0f, 0.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 0.0f), TEST_LOCATION );
 
   scrollView.ScrollTo( 5, 0.0f );
   Wait(application);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector3(500.0f, 0.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(500.0f, 0.0f), TEST_LOCATION );
 
   scrollView.ScrollTo( 10, 0.0f );
   Wait(application);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector3(200.0f, 100.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(200.0f, 100.0f), TEST_LOCATION );
 
   scrollView.ScrollTo( 15, 0.0f );
   Wait(application);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector3(700.0f, 100.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(700.0f, 100.0f), TEST_LOCATION );
   DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 15, TEST_LOCATION );
 
   scrollView.ScrollTo( 3 );
   Wait(application, RENDER_DELAY_SCROLL);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector3(300.0f, 0.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(300.0f, 0.0f), TEST_LOCATION );
   DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 3, TEST_LOCATION );
 
   scrollView.ScrollTo( 9 );
   Wait(application, RENDER_DELAY_SCROLL);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector3(100.0f, 100.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 100.0f), TEST_LOCATION );
   DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 9, TEST_LOCATION );
 
   // Apply DefaultRulers instead and see what happens.
@@ -383,7 +386,7 @@ int UtcDaliScrollViewScrollToPage(void)
   // This time should always scroll to origin (0.0f, 0.0f)
   scrollView.ScrollTo( 1, 0.0f );
   Wait(application);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION );
   DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 0, TEST_LOCATION );
 
   Wait(application);
@@ -412,20 +415,20 @@ int UtcDaliScrollViewScrollToActor(void)
 
   scrollView.ScrollTo(actorA, 0.0f);
   Wait(application);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionA, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionA.GetVectorXY(), TEST_LOCATION );
 
   Wait(application);
   scrollView.ScrollTo(actorB, 0.0f);
   Wait(application);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionB, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionB.GetVectorXY(), TEST_LOCATION );
 
   scrollView.ScrollTo(actorA);
   Wait(application, RENDER_DELAY_SCROLL);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionA, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionA.GetVectorXY(), TEST_LOCATION );
 
   scrollView.ScrollTo(actorB);
   Wait(application, RENDER_DELAY_SCROLL);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionB, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), positionB.GetVectorXY(), TEST_LOCATION );
   END_TEST;
 }
 
@@ -444,14 +447,14 @@ int UtcDaliScrollViewScrollToSnapPoint(void)
   scrollView.SetRulerX( rulerX );
   scrollView.SetRulerY( rulerY );
 
-  scrollView.ScrollTo( Vector3(120.0f, 190.0f, 0.0f), 0.0f );
+  scrollView.ScrollTo( Vector2(120.0f, 190.0f), 0.0f );
   Wait(application);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector3(120.0f, 190.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(120.0f, 190.0f), TEST_LOCATION );
 
   scrollView.ScrollToSnapPoint();
 
   Wait(application, RENDER_DELAY_SCROLL);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector3(100.0f, 200.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 200.0f), TEST_LOCATION );
   END_TEST;
 }
 
@@ -488,7 +491,7 @@ int UtcDaliScrollViewWrapMode(void)
   scrollView.SetRulerY(rulerY);
 
   scrollView.SetWrapMode(false);
-  scrollView.ScrollTo(Vector3(225.0f, 125.0f, 0.0f), 0.0f); // 5th (1st) page across, and 3rd (3rd) page down. (wrapped)
+  scrollView.ScrollTo(Vector2(225.0f, 125.0f), 0.0f); // 5th (1st) page across, and 3rd (3rd) page down. (wrapped)
   Wait(application);
   DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 17, TEST_LOCATION );
   scrollView.SetWrapMode(true);
@@ -523,7 +526,7 @@ int UtcDaliScrollViewActorAutoSnap(void)
   b.SetPosition(bPosition);
 
   // Goto a random position, and execute snap (should not move)
-  Vector3 targetScroll = Vector3(500.0f, 500.0f, 0.0f);
+  Vector2 targetScroll = Vector2(500.0f, 500.0f);
   scrollView.ScrollTo(targetScroll, 0.0f);
   Wait(application);
   scrollView.ScrollToSnapPoint();
@@ -534,13 +537,13 @@ int UtcDaliScrollViewActorAutoSnap(void)
   scrollView.SetActorAutoSnap(true);
   scrollView.ScrollToSnapPoint();
   Wait(application, RENDER_DELAY_SCROLL);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), bPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), bPosition.GetVectorXY(), TEST_LOCATION );
 
-  scrollView.ScrollTo(Vector3(0.0f, 0.0f, 0.0f), 0.0f);
+  scrollView.ScrollTo(Vector2(0.0f, 0.0f), 0.0f);
   Wait(application);
   scrollView.ScrollToSnapPoint();
   Wait(application, RENDER_DELAY_SCROLL);
-  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), aPosition, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), aPosition.GetVectorXY(), TEST_LOCATION );
   END_TEST;
 }
 
@@ -565,7 +568,7 @@ int UtcDaliScrollViewSignalsStartComplete(void)
   scrollView.ScrollStartedSignal().Connect( &OnScrollStart );
   scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
   scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
-  scrollView.ScrollTo( Vector3(100.0f, 100.0f, 0.0f) );
+  scrollView.ScrollTo( Vector2(100.0f, 100.0f) );
   Wait(application, RENDER_DELAY_SCROLL);
 
   DALI_TEST_CHECK(gOnScrollStartCalled);
@@ -734,20 +737,20 @@ int UtcDaliScrollViewAxisAutoLock(void)
   scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
 
   // Normal
-  scrollView.ScrollTo(Vector3(100.0f, 100.0f, 0.0f), 0.0f); // move in a little.
+  scrollView.ScrollTo(Vector2(100.0f, 100.0f), 0.0f); // move in a little.
   Wait(application);
-  Vector3 startPosition = scrollView.GetCurrentScrollPosition();
+  Vector2 startPosition = scrollView.GetCurrentScrollPosition();
   PerformGestureDiagonalSwipe(application, CLAMP_TOUCH_START, Vector2(5.0f, 1.0f), 50, true); // mostly horizontal
-  const Vector3 positionAfterNormal = scrollView.GetCurrentScrollPosition();
+  const Vector2 positionAfterNormal = scrollView.GetCurrentScrollPosition();
 
   // Autolock
   scrollView.SetAxisAutoLock(true);
   DALI_TEST_CHECK(scrollView.GetAxisAutoLock());
 
-  scrollView.ScrollTo(Vector3(100.0f, 100.0f, 0.0f), 0.0f); // move in a little.
+  scrollView.ScrollTo(Vector2(100.0f, 100.0f), 0.0f); // move in a little.
   Wait(application);
   PerformGestureDiagonalSwipe(application, CLAMP_TOUCH_START, Vector2(5.0f, 1.0f), 50, true); // mostly horizontal
-  const Vector3 positionAfterAutoLock = scrollView.GetCurrentScrollPosition();
+  const Vector2 positionAfterAutoLock = scrollView.GetCurrentScrollPosition();
 
   // compare how much the Y position has deviated for normal and autolock.
   const float devianceNormal = fabsf(startPosition.y - positionAfterNormal.y);
@@ -1018,10 +1021,10 @@ int UtcDaliScrollViewOvershoot(void)
   currentPos = PerformGestureDiagonalSwipe(application, currentPos, Vector2(5.0f, 5.0f), 100, false);
   float overshootXValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_X);
   float overshootYValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_Y);
-  Vector3 positionValue = scrollView.GetProperty<Vector3>(ScrollView::Property::SCROLL_POSITION);
+  Vector2 positionValue = scrollView.GetProperty<Vector2>(ScrollView::Property::SCROLL_POSITION);
   DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION);
   DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS(positionValue, Vector3::ZERO, TEST_LOCATION);
+  DALI_TEST_EQUALS(positionValue, Vector2::ZERO, TEST_LOCATION);
 
   float timeToReachOrigin;
 
@@ -1029,8 +1032,8 @@ int UtcDaliScrollViewOvershoot(void)
   SendPan(application, Gesture::Finished, currentPos);
   timeToReachOrigin = TestOvershootSnapDuration(application, scrollView);
 
-  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;
+  float minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + DEFAULT_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
+  float maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + DEFAULT_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
 
   DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
                    (timeToReachOrigin < maxTimeToReachOrigin) );
@@ -1043,8 +1046,8 @@ int UtcDaliScrollViewOvershoot(void)
   SendPan(application, Gesture::Finished, currentPos);
   timeToReachOrigin = TestOvershootSnapDuration(application, scrollView);
 
-  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;
+  minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
+  maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM1_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
 
   DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
                    (timeToReachOrigin < maxTimeToReachOrigin) );
@@ -1057,8 +1060,8 @@ int UtcDaliScrollViewOvershoot(void)
   SendPan(application, Gesture::Finished, currentPos);
   timeToReachOrigin = TestOvershootSnapDuration(application, scrollView);
 
-  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;
+  minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
+  maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM2_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
 
   DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
                    (timeToReachOrigin < maxTimeToReachOrigin) );
@@ -1072,8 +1075,8 @@ int UtcDaliScrollViewOvershoot(void)
   SendPan(application, Gesture::Finished, currentPos);
   timeToReachOrigin = TestOvershootSnapDuration(application, scrollView);
 
-  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;
+  minTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) - TIME_TOLERANCE;
+  maxTimeToReachOrigin = SCROLL_ANIMATION_DURATION + TEST_CUSTOM3_SNAP_OVERSHOOT_DURATION * (SNAP_POSITION_WITH_DECELERATED_VELOCITY.x / DEFAULT_MAX_OVERSHOOT) + TIME_TOLERANCE;
 
   DALI_TEST_CHECK( (timeToReachOrigin > minTimeToReachOrigin) &&
                    (timeToReachOrigin < maxTimeToReachOrigin) );
index 1b6f1c6..8a1f1a0 100644 (file)
@@ -43,10 +43,7 @@ void utc_dali_toolkit_scroll_view_effect_cleanup(void)
 namespace
 {
 
-const int MILLISECONDS_PER_SECOND = 1000;
 const int RENDER_FRAME_INTERVAL = 16;                           ///< Duration of each frame in ms. (at approx 60FPS)
-const int RENDER_ANIMATION_TEST_DURATION_MS = 1000;             ///< 1000ms to test animation
-const int RENDER_DELAY_SCROLL = 1000;                           ///< duration to wait for any scroll to complete.
 
 /*
  * Simulate time passed by.
@@ -96,7 +93,8 @@ static bool gOnScrollUpdateCalled;                      ///< Whether the OnScrol
 static bool gOnScrollCompleteCalled;                    ///< Whether the OnScrollComplete signal was invoked.
 static Vector3 gConstraintResult;                       ///< Result from constraint.
 
-static ActorContainer gPages;                                ///< Keeps track of all the pages for applying effects.
+static std::vector< Actor > gPages;                                ///< Keeps track of all the pages for applying effects.
+typedef std::vector< Actor >::iterator ActorIter;
 
 static void ResetScrollCallbackResults()
 {
@@ -110,7 +108,7 @@ static void ResetScrollCallbackResults()
  *
  * @param[in] position The current scroll position.
  */
-static void OnScrollStart( const Vector3& position )
+static void OnScrollStart( const Vector2& position )
 {
   gOnScrollStartCalled = true;
 }
@@ -120,7 +118,7 @@ static void OnScrollStart( const Vector3& position )
  *
  * @param[in] position The current scroll position.
  */
-static void OnScrollUpdate( const Vector3& position )
+static void OnScrollUpdate( const Vector2& position )
 {
   gOnScrollUpdateCalled = true;
 }
@@ -130,7 +128,7 @@ static void OnScrollUpdate( const Vector3& position )
  *
  * @param[in] position The current scroll position.
  */
-static void OnScrollComplete( const Vector3& position )
+static void OnScrollComplete( const Vector2& position )
 {
   gOnScrollCompleteCalled = true;
 }
@@ -242,103 +240,70 @@ Actor AddActorToPage(Actor page, float x, float y, float cols, float rows)
 
 } // unnamed namespace
 
-
-int UtcDaliScrollViewCubeEffectSetup(void)
+int UtcDaliScrollViewPagePathEffectSetup(void)
 {
-  tet_infoline(" UtcDaliScrollViewCubeEffectSetup");
+  tet_infoline(" UtcDaliScrollViewPagePathEffectSetup");
 
-  ScrollViewCubeEffect effect;
+  ScrollViewPagePathEffect effect;
 
   DALI_TEST_CHECK( !effect );
 
-  BaseHandle handle = ScrollViewCubeEffect::New();
+  BaseHandle handle = ScrollViewPagePathEffect::New(Dali::Path::New(), Vector3::ZERO,Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3::ZERO,0);
 
   DALI_TEST_CHECK( handle );
 
-  effect = ScrollViewCubeEffect::DownCast(handle);
+  effect = ScrollViewPagePathEffect::DownCast(handle);
 
   DALI_TEST_CHECK( effect );
   END_TEST;
 }
 
-int UtcDaliScrollViewSpiralEffectSetup(void)
-{
-  tet_infoline(" UtcDaliScrollViewSpiralEffectSetup");
-
-  ScrollViewPageSpiralEffect effect;
-
-  DALI_TEST_CHECK( !effect );
-
-  BaseHandle handle = ScrollViewPageSpiralEffect::New();
-
-  DALI_TEST_CHECK( handle );
-
-  effect = ScrollViewPageSpiralEffect::DownCast(handle);
-
-  DALI_TEST_CHECK( effect );
-  END_TEST;
-}
-
-int UtcDaliScrollViewCubeEffectTest(void)
+int UtcDaliScrollViewPagePathEffectTest(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewCubeEffectTest");
+  tet_infoline(" UtcDaliScrollViewPagePathEffectTest");
 
   Vector2 size = Stage::GetCurrent().GetSize();
 
   ScrollView scrollView = SetupTestScrollView(1, 3, size);
-  Actor page = gPages[1];
+  Actor testPage = gPages[2];
   Wait(application, 500);
 
-  ScrollViewCubeEffect effect = ScrollViewCubeEffect::New();
-  scrollView.ApplyEffect(effect);
-
-  Actor actor = AddActorToPage(page, 0.5f, 0.5f, 3, 3);
-  Wait(application);
-  Vector3 actorPrePosition = actor.GetCurrentPosition();
-
-  effect.ApplyToActor(actor, page, Vector3(-105.0f, 30.0f, -240.0f), Vector2(Math::PI * 0.5f, Math::PI * 0.5f), Vector2(0.25f, 0.25f) * size);
-
-  Actor actor2 = AddActorToPage(page, 0.5f, 0.5f, 3, 3);
-  effect.ApplyToActor(actor2, Vector3(-105.0f, 30.0f, -240.0f), Vector2(Math::PI * 0.5f, Math::PI * 0.5f), Vector2(0.25f, 0.25f) * size);
-
-  scrollView.ScrollTo(1);
-  while(!gOnScrollCompleteCalled)
-  {
-    Wait(application);
-  }
-  // test that the first page has reached centre of screen
-  Vector3 actorPostPosition = actor.GetCurrentPosition();
-  // just check the actor has moved
-  DALI_TEST_CHECK((actorPostPosition - actorPrePosition).Length() > Math::MACHINE_EPSILON_1);
-  CleanupTest();
-  END_TEST;
-}
-
-
-int UtcDaliScrollViewSpiralEffectTest(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewSpiralEffectTest");
-
-  Vector2 size = Stage::GetCurrent().GetSize();
-
-  ScrollView scrollView = SetupTestScrollView(1, 3, size);
-  Actor testPage = gPages[1];
-  Wait(application, 500);
-
-  ScrollViewPageSpiralEffect effect = ScrollViewPageSpiralEffect::New();
+  //Create path
+  float xHalfSize( size.x * 0.5f);
+
+  Dali::Path path = Dali::Path::New();
+  Dali::Property::Array points;
+  points.Resize(3);
+  points[0] = Vector3( xHalfSize, 0.0f,  -xHalfSize);
+  points[1] = Vector3( 0.0f, 0.0f, 0.0f );
+  points[2] = Vector3( -xHalfSize, 0.0f,  -xHalfSize);
+  path.SetProperty( Path::Property::POINTS, points );
+
+  Dali::Property::Array controlPoints;
+  controlPoints.Resize(4);
+  controlPoints[0] = Vector3( xHalfSize, 0.0f, 0.0f );
+  controlPoints[1] = Vector3( xHalfSize, 0.0f, 0.0f );
+  controlPoints[2] = Vector3(-xHalfSize, 0.0f, 0.0f );
+  controlPoints[3] = Vector3(-xHalfSize, 0.0f, 0.0f );
+  path.SetProperty( Path::Property::CONTROL_POINTS, controlPoints );
+
+  ScrollViewPagePathEffect effect = ScrollViewPagePathEffect::New(path,
+                                                                  Vector3::ZERO,
+                                                                  Toolkit::ScrollView::Property::SCROLL_FINAL_X,
+                                                                  Vector3(size.x,size.y,0.0f),
+                                                                  3);
   scrollView.ApplyEffect(effect);
 
+  unsigned int pageCounter(0);
   for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter)
   {
     Actor page = *pageIter;
     page.RemoveConstraints();
-
     Constraint constraint = Constraint::New<Vector3>( page, Actor::Property::SIZE, EqualToConstraint() );
     constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
     constraint.Apply();
-    effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f));
+    effect.ApplyToPage(page, pageCounter++);
   }
   Wait(application);
 
@@ -347,228 +312,12 @@ int UtcDaliScrollViewSpiralEffectTest(void)
   {
     Wait(application);
   }
-  // test that the first page has reached centre of screen
-  Vector3 pagePos = testPage.GetCurrentPosition();
-  DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
-  CleanupTest();
-  END_TEST;
-}
-
-int UtcDaliScrollViewPageCubeEffectSetup(void)
-{
-  tet_infoline(" UtcDaliScrollViewPageCubeEffectSetup");
-
-  ScrollViewPageCubeEffect effect;
-
-  DALI_TEST_CHECK( !effect );
-
-  BaseHandle handle = ScrollViewPageCubeEffect::New();
-
-  DALI_TEST_CHECK( handle );
-
-  effect = ScrollViewPageCubeEffect::DownCast(handle);
-
-  DALI_TEST_CHECK( effect );
-  END_TEST;
-}
-
-
-int UtcDaliScrollViewPageCarouselEffectSetup(void)
-{
-  tet_infoline(" UtcDaliScrollViewCarouselEffectSetup");
-
-  ScrollViewPageCarouselEffect effect;
-
-  DALI_TEST_CHECK( !effect );
-
-  BaseHandle handle = ScrollViewPageCarouselEffect::New();
-
-  DALI_TEST_CHECK( handle );
-
-  effect = ScrollViewPageCarouselEffect::DownCast(handle);
-
-  DALI_TEST_CHECK( effect );
-  END_TEST;
-}
-
-int UtcDaliScrollViewCarouselEffectSetup(void)
-{
-  tet_infoline(" UtcDaliScrollViewCarouselEffectSetup");
-
-  ScrollViewCarouselEffect effect;
-
-  DALI_TEST_CHECK( !effect );
-
-  BaseHandle handle = ScrollViewCarouselEffect::New();
-
-  DALI_TEST_CHECK( handle );
-
-  effect = ScrollViewCarouselEffect::DownCast(handle);
-
-  DALI_TEST_CHECK( effect );
-  END_TEST;
-}
-
-int UtcDaliScrollViewDepthEffectSetup(void)
-{
-  tet_infoline(" UtcDaliScrollViewDepthEffectSetup");
-
-  ScrollViewDepthEffect effect;
-
-  DALI_TEST_CHECK( !effect );
-
-  BaseHandle handle = ScrollViewDepthEffect::New();
-
-  DALI_TEST_CHECK( handle );
-
-  effect = ScrollViewDepthEffect::DownCast(handle);
-
-  DALI_TEST_CHECK( effect );
-  END_TEST;
-}
-
 
-int UtcDaliScrollViewPageCubeEffectTest(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewPageCubeEffectTest");
-
-  Vector2 size = Stage::GetCurrent().GetSize();
-
-  ScrollView scrollView = SetupTestScrollView(1, 3, size);
-  Actor testPage = gPages[1];
-  Wait(application, 500);
-
-  ScrollViewPageCubeEffect effect = ScrollViewPageCubeEffect::New();
-  scrollView.ApplyEffect(effect);
-
-  for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter)
-  {
-    Actor page = *pageIter;
-    page.RemoveConstraints();
-    Constraint constraint = Constraint::New<Vector3>( page, Actor::Property::SIZE, EqualToConstraint() );
-    constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
-    constraint.Apply();
-    effect.ApplyToPage(page, Vector2(Math::PI_2, 0.0f));
-  }
-  Wait(application);
-
-  scrollView.ScrollTo(1);
-  while(!gOnScrollCompleteCalled)
-  {
-    Wait(application);
-  }
-  // test that the first page has reached centre of screen
+  // test that the test page has reached centre of screen
   Vector3 pagePos = testPage.GetCurrentPosition();
   DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
-  CleanupTest();
-  END_TEST;
-}
-
-int UtcDaliScrollViewPageCarouselEffectTest(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewPageCarouselEffectTest");
-
-  Vector2 size = Stage::GetCurrent().GetSize();
-
-  ScrollView scrollView = SetupTestScrollView(1, 3, size);
-  Actor testPage = gPages[1];
-  Wait(application, 500);
-
-  ScrollViewPageCarouselEffect effect = ScrollViewPageCarouselEffect::New();
-  scrollView.ApplyEffect(effect);
-
-  for(ActorIter pageIter = gPages.begin(); pageIter != gPages.end(); ++pageIter)
-  {
-    Actor page = *pageIter;
-    page.RemoveConstraints();
-    Constraint constraint = Constraint::New<Vector3>( page, Actor::Property::SIZE, EqualToConstraint() );
-    constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
-    constraint.Apply();
-    effect.ApplyToPage(page);
-  }
-  Wait(application);
 
-  scrollView.ScrollTo(1, 0.5f, DirectionBiasNone);
-  while(!gOnScrollCompleteCalled)
-  {
-    Wait(application);
-  }
-  // test that the first page has reached centre of screen
-  Vector3 pagePos = testPage.GetCurrentPosition();
-  DALI_TEST_EQUALS(pagePos, Vector3::ZERO, Math::MACHINE_EPSILON_0, TEST_LOCATION);
-  CleanupTest();
-  END_TEST;
-}
-
-int UtcDaliScrollViewCarouselEffectTest(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewCarouselEffectTest");
-
-  Vector2 size = Stage::GetCurrent().GetSize();
-
-  ScrollView scrollView = SetupTestScrollView(1, 3, size);
-  Actor testPage = gPages[1];
-  Wait(application, 500);
-
-  ScrollViewCarouselEffect effect = ScrollViewCarouselEffect::New();
-  scrollView.ApplyEffect(effect);
-
-  Actor actor = AddActorToPage(testPage, 0.5f, 0.5f, 3, 3);
-  Wait(application);
-  Vector3 actorPrePosition = actor.GetCurrentPosition();
-
-  effect.ApplyToActor( actor, Vector2(1.2f, 1.2f) );
-
-  scrollView.ScrollTo(Vector3(size.x, 0.0f, 0.0f), 0.5f, DirectionBiasNone, DirectionBiasNone);
-  while(!gOnScrollCompleteCalled)
-  {
-    Wait(application);
-  }
-  // test that the first page has reached centre of screen
-  Vector3 actorPostPosition = actor.GetCurrentPosition();
-  // just check the actor has moved
-  DALI_TEST_CHECK((actorPostPosition - actorPrePosition).Length() > Math::MACHINE_EPSILON_1);
   CleanupTest();
   END_TEST;
 }
 
-int UtcDaliScrollViewDepthEffectTest(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewDepthEffectTest");
-
-  Vector2 size = Stage::GetCurrent().GetSize();
-
-  ScrollView scrollView = SetupTestScrollView(1, 3, size);
-  Actor testPage = gPages[1];
-  Wait(application, 500);
-
-  ScrollViewDepthEffect effect = ScrollViewDepthEffect::New();
-  scrollView.ApplyEffect(effect);
-
-  Actor actor = AddActorToPage(testPage, 0.5f, 0.5f, 3, 3);
-  Wait(application);
-  Vector3 actorPrePosition = actor.GetCurrentPosition();
-
-  const Vector2 positionExtent(0.5f, 2.5f);
-  const Vector2 offsetExtent(1.0f, 1.0f);
-  const float positionScale(1.5f);
-  const float scaleExtent(0.5f);
-
-  effect.ApplyToActor( actor, positionExtent, offsetExtent, positionScale, scaleExtent );
-
-  scrollView.ScrollTo(1);
-  while(!gOnScrollCompleteCalled)
-  {
-    Wait(application);
-  }
-  // test that the first page has reached centre of screen
-  Vector3 actorPostPosition = actor.GetCurrentPosition();
-  // just check the actor has moved
-  DALI_TEST_CHECK((actorPostPosition - actorPrePosition).Length() > Math::MACHINE_EPSILON_1);
-  CleanupTest();
-  END_TEST;
-}
index 89090da..29b1ef6 100644 (file)
@@ -21,7 +21,6 @@
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 
-
 using namespace Dali;
 using namespace Dali::Toolkit;
 
@@ -134,7 +133,7 @@ int UtcDaliSliderSignals(void)
   Property::Array marks;
   for( int i = 0; i < NUM_MARKS; ++i )
   {
-    marks.push_back( MIN_BOUND + ( static_cast<float>(i) / ( NUM_MARKS - 1) ) * ( MAX_BOUND - MIN_BOUND ) );
+    marks.PushBack( MIN_BOUND + ( static_cast<float>(i) / ( NUM_MARKS - 1) ) * ( MAX_BOUND - MIN_BOUND ) );
   }
   slider.SetProperty( Slider::Property::MARKS, marks );
   slider.SetProperty( Slider::Property::MARK_TOLERANCE, 0.1f );
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-SpiralLayout.cpp b/automated-tests/src/dali-toolkit/utc-Dali-SpiralLayout.cpp
deleted file mode 100644 (file)
index 2bed81a..0000000
+++ /dev/null
@@ -1,570 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <iostream>
-#include <stdlib.h>
-#include <float.h>       // for FLT_MAX
-#include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/dali-toolkit.h>
-
-
-using namespace Dali;
-using namespace Toolkit;
-
-void spiral_layout_startup(void)
-{
-  test_return_value = TET_UNDEF;
-}
-
-void spiral_layout_cleanup(void)
-{
-  test_return_value = TET_PASS;
-}
-
-namespace
-{
-const unsigned int TOTAL_ITEM_NUMBER = 200;
-
-Vector3 SpiralLayoutItemSizeFunction(const Vector3& layoutSize)
-{
-  float width = layoutSize.width * 0.2f;
-  return Vector3(width, width, width);
-}
-
-float SpiralLayoutSpiralRadiusFunction(const Vector3& layoutSize)
-{
-  return layoutSize.width * 0.5f;
-}
-
-
-// Implementation of ItemFactory for providing actors to ItemView
-class TestItemFactory : public ItemFactory
-{
-public:
-
-  /**
-   * Constructor
-   * @param application class, stored as reference
-   */
-  TestItemFactory()
-  {
-  }
-
-public: // From ItemFactory
-
-  /**
-   * Query the number of items available from the factory.
-   * The maximum available item has an ID of GetNumberOfItems() - 1.
-   */
-  virtual unsigned int GetNumberOfItems()
-  {
-    return TOTAL_ITEM_NUMBER;
-  }
-
-  /**
-   * Create an Actor to represent a visible item.
-   * @param itemId
-   * @return the created actor.
-   */
-  virtual Actor NewItem(unsigned int itemId)
-  {
-    // Create an test actor for this item
-    ImageActor actor = CreateSolidColorActor(Color::RED);
-    actor.SetSize(64.0f, 64.0f);
-
-    return actor;
-  }
-};
-
-} // namespace
-
-
-int UtcDaliSpiralLayoutNew(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a spiral layout
-  SpiralLayoutPtr spiralLayout = SpiralLayout::New();
-
-  DALI_TEST_CHECK(spiralLayout);
-  END_TEST;
-}
-
-int UtcDaliSpiralSetAndGetItemSizeFunction(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a spiral layout
-  SpiralLayoutPtr spiralLayout = SpiralLayout::New();
-
-  // Set the item size function
-  spiralLayout->SetItemSizeFunction(SpiralLayoutItemSizeFunction);
-
-  // Check whether we get the correct item size function
-  DALI_TEST_CHECK(spiralLayout->GetItemSizeFunction() == SpiralLayoutItemSizeFunction);
-  END_TEST;
-}
-
-int UtcDaliSpiralSetAndGetItemSpacing(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a spiral layout
-  SpiralLayoutPtr spiralLayout = SpiralLayout::New();
-
-  // Set the item spacing
-  spiralLayout->SetItemSpacing(Radian(0.6f));
-
-  // Check whether we get the correct item spacing
-  DALI_TEST_EQUALS(spiralLayout->GetItemSpacing(), Radian(0.6f), TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliSpiralSetAndGetRevolutionDistance(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a spiral layout
-  SpiralLayoutPtr spiralLayout = SpiralLayout::New();
-
-  // Set the revolution distance
-  spiralLayout->SetRevolutionDistance(150.0f);
-
-  // Check whether we get the correct revolution distance
-  DALI_TEST_EQUALS(spiralLayout->GetRevolutionDistance(), 150.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliSpiralSetAndGetSpiralRadiusFunction(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a spiral layout
-  SpiralLayoutPtr spiralLayout = SpiralLayout::New();
-
-  // Set the spiral radius function
-  spiralLayout->SetSpiralRadiusFunction(SpiralLayoutSpiralRadiusFunction);
-
-  // Check whether we get the correct spiral radius function
-  DALI_TEST_CHECK(spiralLayout->GetSpiralRadiusFunction() == SpiralLayoutSpiralRadiusFunction);
-  END_TEST;
-}
-
-int UtcDaliSpiralSetAndGetTopItemAlignment(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a spiral layout
-  SpiralLayoutPtr spiralLayout = SpiralLayout::New();
-
-  // Set the alignment of the top item
-  spiralLayout->SetTopItemAlignment(-0.25f);
-
-  // Check whether we get the correct alignment of the top item
-  DALI_TEST_EQUALS(spiralLayout->GetTopItemAlignment(), -0.25f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliSpiralSetAndGetScrollSpeedFactor(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a spiral layout
-  SpiralLayoutPtr spiralLayout = SpiralLayout::New();
-
-  // Set the scroll speed factor
-  spiralLayout->SetScrollSpeedFactor(0.05f);
-
-  // Check whether we get the correct scroll speed factor
-  DALI_TEST_EQUALS(spiralLayout->GetScrollSpeedFactor(), 0.05f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliSpiralSetAndGetMaximumSwipeSpeed(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a spiral layout
-  SpiralLayoutPtr spiralLayout = SpiralLayout::New();
-
-  // Set the maximum swipe speed
-  spiralLayout->SetMaximumSwipeSpeed(50.0f);
-
-  // Check whether we get the correct maximum swipe speed
-  DALI_TEST_EQUALS(spiralLayout->GetMaximumSwipeSpeed(), 50.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliSpiralLayoutSetAndGetItemFlickAnimationDuration(void)
-{
-  ToolkitTestApplication application;
-
-  // Create a spiral layout
-  SpiralLayoutPtr spiralLayout = SpiralLayout::New();
-
-  // Set the flick animaiton duration
-  spiralLayout->SetItemFlickAnimationDuration(0.35f);
-
-  // Check whether we get the correct flick animaiton duration
-  DALI_TEST_EQUALS( spiralLayout->GetItemFlickAnimationDuration(), 0.35f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliSpiralLayoutConstraintLeft(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  SpiralLayoutPtr layout = SpiralLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*layout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  layout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliSpiralLayoutConstraintRight(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  SpiralLayoutPtr layout = SpiralLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*layout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  layout->SetOrientation(ControlOrientation::Right);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliSpiralLayoutConstraintUp(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  SpiralLayoutPtr layout = SpiralLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*layout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  layout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-
-  layout->GetClosestOnScreenLayoutPosition(0, 0.0f, vec);
-  int nextItem = layout->GetNextFocusItemID(0, 10, Dali::Toolkit::Control::Right, false);
-  DALI_TEST_CHECK(nextItem == 1);
-
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliSpiralLayoutConstraintDown(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  SpiralLayoutPtr layout = SpiralLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*layout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  layout->SetOrientation(ControlOrientation::Down);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view and they are positioned some distance from the origin.
-  int nonZeroCount = 0;
-  int elementsFound = 0;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      elementsFound++;
-      Vector3 pos = testActor.GetCurrentPosition();
-
-      if (pos.LengthSquared() > 0.0f)
-      {
-        nonZeroCount++;
-      }
-    }
-  }
-
-  DALI_TEST_CHECK((elementsFound > 0) && (nonZeroCount == elementsFound));
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliSpiralLayoutScrollDirection(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  SpiralLayoutPtr navigationLayout = SpiralLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*navigationLayout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  navigationLayout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  ItemLayoutPtr layout = navigationLayout;
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  navigationLayout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  Degree deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg.degree == -45.0f);
-
-  navigationLayout->SetOrientation(ControlOrientation::Down);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK((deg.degree == 180.0f - 45.0f));
-
-  layout->SetOrientation(ControlOrientation::Left);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg.degree == 45.0f);
-
-  navigationLayout->SetOrientation(ControlOrientation::Right);
-  view.ActivateLayout(0, vec, 0.0f);
-  application.SendNotification();
-  application.Render();
-
-  deg = layout->GetScrollDirection();
-  DALI_TEST_CHECK(deg.degree == (270.0f - 45.0f));
-
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
-
-int UtcDaliSpiralLayoutGetScrollToPosition(void)
-{
-  ToolkitTestApplication application;
-
-  // Create the ItemView actor
-  TestItemFactory factory;
-  ItemView view = ItemView::New(factory);
-  Vector3 vec(480.0f, 800.0f, 0.0f);
-  SpiralLayoutPtr layout = SpiralLayout::New();
-
-  view.SetName("view actor");
-  view.AddLayout(*layout);
-  view.SetSize(vec);
-
-  Stage::GetCurrent().Add(view);
-  layout->SetOrientation(ControlOrientation::Up);
-  view.ActivateLayout(0, vec, 0.0f);
-
-  application.SendNotification();
-  application.Render(0);
-
-  // render 10 frames
-  for(int i = 0; i < 10; ++i)
-  {
-    application.Render(16); // 60hz frames
-  }
-
-  // Confirm: we have actors in the view.
-  std::vector<unsigned int> indices;
-  for(unsigned int i = 0; i < 10; i++)
-  {
-    Actor testActor = view.GetItem(i);
-    if (testActor)
-    {
-      indices.push_back(i);
-    }
-  }
-
-  try
-  {
-    if (!indices.empty())
-    {
-      const unsigned int firstTargetIndex = indices[indices.size()-1];
-      // scroll to last item
-      view.ScrollToItem(firstTargetIndex, 0.00f);
-      application.Render(16); // 60hz frames
-
-      std::size_t moveCount = 0;
-      for(std::size_t i = 0; i < indices.size(); i++)
-      {
-        float layoutPosBefore = view.GetCurrentLayoutPosition(i);
-        view.ScrollToItem(indices[i], 0.0f);
-
-        application.Render(16); // 60hz frame
-
-        float layoutPosAfter = view.GetCurrentLayoutPosition(i);
-
-        if (fabs(layoutPosBefore-layoutPosAfter) <= FLT_EPSILON)
-        {
-          ++moveCount;
-        }
-      }
-
-      DALI_TEST_CHECK((moveCount == indices.size()));
-    }
-  }
-  catch(...)
-  {
-    tet_result(TET_FAIL);
-  }
-
-  Stage::GetCurrent().Remove(view);
-  END_TEST;
-}
index b7e662e..bed13ae 100644 (file)
@@ -208,8 +208,8 @@ int UtcDaliSuperBlurViewGetBlurredImage(void)
   DALI_TEST_CHECK( image1 );
 
   Image image2 = blurView.GetBlurredImage( 2 );
-  DALI_TEST_EQUALS( image2.GetWidth(), 25, TEST_LOCATION );
-  DALI_TEST_EQUALS( image2.GetHeight(), 25, TEST_LOCATION );
+  DALI_TEST_EQUALS( image2.GetWidth(), 25u, TEST_LOCATION );
+  DALI_TEST_EQUALS( image2.GetHeight(), 25u, TEST_LOCATION );
 
   Image image3 = blurView.GetBlurredImage( 3 );
   DALI_TEST_CHECK( FrameBufferImage::DownCast( image2 ) );
index 2578643..c0e4bec 100644 (file)
@@ -178,6 +178,7 @@ int UtcDaliToolkitTextLabelGetPropertyP(void)
 
   // 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::BLACK, 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 ), Color::BLACK, TEST_LOCATION );
   DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::UNDERLINE_ENABLED ), false, TEST_LOCATION );
index e072023..bbb08c2 100644 (file)
@@ -931,7 +931,7 @@ FILTER_SOURCE_PATTERNS =
 # (index.html). This can be useful if you have a project on for instance GitHub
 # and want to reuse the introduction page also for the doxygen output.
 
-USE_MDFILE_AS_MAINPAGE =
+USE_MDFILE_AS_MAINPAGE = main.md
 
 #---------------------------------------------------------------------------
 # Configuration options related to source browsing
index f9bdac1..7664649 100644 (file)
 #include <dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h>
 #include <dali-toolkit/public-api/controls/image-view/masked-image-view.h>
 #include <dali-toolkit/public-api/controls/magnifier/magnifier.h>
-#include <dali-toolkit/public-api/controls/navigation-frame/navigation-control.h>
-#include <dali-toolkit/public-api/controls/navigation-frame/page.h>
 #include <dali-toolkit/public-api/controls/page-turn-view/page-factory.h>
 #include <dali-toolkit/public-api/controls/page-turn-view/page-turn-view.h>
 #include <dali-toolkit/public-api/controls/page-turn-view/page-turn-landscape-view.h>
 #include <dali-toolkit/public-api/controls/page-turn-view/page-turn-portrait-view.h>
 #include <dali-toolkit/public-api/controls/popup/popup.h>
 #include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-component.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
-#include <dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.h>
-#include <dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.h>
+#include <dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.h>
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h>
+#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
 #include <dali-toolkit/public-api/controls/shadow-view/shadow-view.h>
index 2b0c851..2b8a122 100644 (file)
@@ -20,7 +20,7 @@
 // EXTERNAL INCLUDES
 #include <stdint.h>
 #include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/images/atlas.h>
+#include <dali/devel-api/images/atlas.h>
 #include <dali/public-api/images/buffer-image.h>
 #include <dali/public-api/shader-effects/material.h>
 
@@ -409,4 +409,4 @@ private:
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_ATLAS_MANAGER_H__
\ No newline at end of file
+#endif // __DALI_TOOLKIT_ATLAS_MANAGER_H__
index d8271e4..287663c 100644 (file)
@@ -18,7 +18,7 @@
 // EXTERNAL INCLUDES
 #include <string>
 #include <dali/integration-api/debug.h>
-#include <dali/public-api/scripting/scripting.h>
+#include <dali/devel-api/scripting/scripting.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/builder/replacement.h>
index a6c74b0..aaf3f22 100644 (file)
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/public-api/object/type-info.h>
 #include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/property-array.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/actors/camera-actor.h>
-#include <dali/public-api/scripting/scripting.h>
+#include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -167,7 +168,7 @@ std::string PropertyValueToString( const Property::Value& value )
     }
     case Property::ARRAY:
     {
-      ret = std::string("Array Size=") + ToString( value.Get<Property::Array>().size() );
+      ret = std::string("Array Size=") + ToString( value.Get<Property::Array>().Size() );
       break;
     }
     case Property::MAP:
@@ -814,6 +815,212 @@ Path Builder::GetPath( const std::string& name )
   return ret;
 }
 
+PathConstrainer Builder::GetPathConstrainer( const std::string& name )
+{
+  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
+
+  //Search the pathConstrainer in the LUT
+  size_t count( mPathConstrainerLut.size() );
+  for( size_t i(0); i!=count; ++i )
+  {
+    if( mPathConstrainerLut[i].name == name )
+    {
+      //PathConstrainer has already been created
+      return mPathConstrainerLut[i].pathConstrainer;
+    }
+  }
+
+  //Create a new PathConstrainer
+  PathConstrainer ret;
+  if( OptionalChild constrainers = IsChild( *mParser.GetRoot(), "constrainers") )
+  {
+    if( OptionalChild pathConstrainer = IsChild( *constrainers, name ) )
+    {
+      OptionalString constrainerType(IsString(IsChild(*pathConstrainer, "type")));
+      if(!constrainerType)
+      {
+        DALI_SCRIPT_WARNING("Constrainer type not specified for constrainer '%s'\n", name.c_str() );
+      }
+      else if( *constrainerType == "PathConstrainer")
+      {
+        //points property
+        if( OptionalChild pointsProperty = IsChild( *pathConstrainer, "points") )
+        {
+          Dali::Property::Value points(Property::ARRAY);
+          if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
+          {
+            ret = PathConstrainer::New();
+            ret.SetProperty( PathConstrainer::Property::POINTS, points);
+
+            //control-points property
+            if( OptionalChild pointsProperty = IsChild( *pathConstrainer, "control-points") )
+            {
+              Dali::Property::Value points(Property::ARRAY);
+              if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
+              {
+                ret.SetProperty( PathConstrainer::Property::CONTROL_POINTS, points);
+              }
+
+              //Forward vector
+              OptionalVector3 forward( IsVector3( IsChild(*pathConstrainer, "forward" ) ) );
+              if( forward )
+              {
+                ret.SetProperty( PathConstrainer::Property::FORWARD, *forward);
+              }
+
+              //Add the new constrainer to the vector of PathConstrainer
+              PathConstrainerEntry entry = {name,ret};
+              mPathConstrainerLut.push_back( entry );
+            }
+            else
+            {
+              //Control points not specified
+              DALI_SCRIPT_WARNING("Control points not specified for pathConstrainer '%s'\n", name.c_str() );
+            }
+          }
+        }
+        else
+        {
+          //Interpolation points not specified
+          DALI_SCRIPT_WARNING("Interpolation points not specified for pathConstrainer '%s'\n", name.c_str() );
+        }
+      }
+      else
+      {
+        DALI_SCRIPT_WARNING("Constrainer '%s' is not a PathConstrainer\n", name.c_str() );
+      }
+    }
+  }
+
+  return ret;
+}
+
+bool Builder::IsPathConstrainer( const std::string& name )
+{
+  size_t count( mPathConstrainerLut.size() );
+  for( size_t i(0); i!=count; ++i )
+  {
+    if( mPathConstrainerLut[i].name == name )
+    {
+      return true;
+    }
+  }
+
+  if( OptionalChild constrainers = IsChild( *mParser.GetRoot(), "constrainers") )
+  {
+    if( OptionalChild constrainer = IsChild( *constrainers, name ) )
+    {
+      OptionalString constrainerType(IsString(IsChild(*constrainer, "type")));
+      if(!constrainerType)
+      {
+        return false;
+      }
+      else
+      {
+         return *constrainerType == "PathConstrainer";
+      }
+    }
+  }
+  return false;
+}
+
+Dali::LinearConstrainer Builder::GetLinearConstrainer( const std::string& name )
+{
+  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
+
+  //Search the LinearConstrainer in the LUT
+  size_t count( mLinearConstrainerLut.size() );
+  for( size_t i(0); i!=count; ++i )
+  {
+    if( mLinearConstrainerLut[i].name == name )
+    {
+      //LinearConstrainer has already been created
+      return mLinearConstrainerLut[i].linearConstrainer;
+    }
+  }
+
+  //Create a new LinearConstrainer
+  LinearConstrainer ret;
+  if( OptionalChild constrainers = IsChild( *mParser.GetRoot(), "constrainers") )
+  {
+    if( OptionalChild linearConstrainer = IsChild( *constrainers, name ) )
+    {
+      OptionalString constrainerType(IsString(IsChild(*linearConstrainer, "type")));
+      if(!constrainerType)
+      {
+        DALI_SCRIPT_WARNING("Constrainer type not specified for constrainer '%s'\n", name.c_str() );
+      }
+      else if( *constrainerType == "LinearConstrainer")
+      {
+        //points property
+        if( OptionalChild pointsProperty = IsChild( *linearConstrainer, "value") )
+        {
+          Dali::Property::Value points(Property::ARRAY);
+          if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
+          {
+            ret = Dali::LinearConstrainer::New();
+            ret.SetProperty( LinearConstrainer::Property::VALUE, points);
+
+            //control-points property
+            if( OptionalChild pointsProperty = IsChild( *linearConstrainer, "progress") )
+            {
+              Dali::Property::Value points(Property::ARRAY);
+              if( SetPropertyFromNode( *pointsProperty, Property::ARRAY, points ) )
+              {
+                ret.SetProperty( LinearConstrainer::Property::PROGRESS, points);
+              }
+            }
+            //Add the new constrainer to vector of LinearConstrainer
+            LinearConstrainerEntry entry = {name,ret};
+            mLinearConstrainerLut.push_back( entry );
+          }
+        }
+        else
+        {
+          //Interpolation points not specified
+          DALI_SCRIPT_WARNING("Values not specified for LinearConstrainer '%s'\n", name.c_str() );
+        }
+      }
+      else
+      {
+        DALI_SCRIPT_WARNING("Constrainer '%s' is not a LinearConstrainer\n", name.c_str() );
+      }
+    }
+  }
+
+  return ret;
+}
+
+bool Builder::IsLinearConstrainer( const std::string& name )
+{
+  //Search the LinearConstrainer in the LUT
+  size_t count( mLinearConstrainerLut.size() );
+  for( size_t i(0); i!=count; ++i )
+  {
+    if( mLinearConstrainerLut[i].name == name )
+    {
+      return true;
+    }
+  }
+
+  if( OptionalChild constrainers = IsChild( *mParser.GetRoot(), "constrainers") )
+  {
+    if( OptionalChild constrainer = IsChild( *constrainers, name ) )
+    {
+      OptionalString constrainerType(IsString(IsChild(*constrainer, "type")));
+      if(!constrainerType)
+      {
+        return false;
+      }
+      else
+      {
+         return *constrainerType == "LinearConstrainer";
+      }
+    }
+  }
+  return false;
+}
+
 Toolkit::Builder::BuilderSignalType& Builder::QuitSignal()
 {
   return mQuitSignal;
index 4fb7aba..af1c85c 100644 (file)
@@ -186,6 +186,33 @@ public:
    * @copydoc Toolkit::Builder::GetPath
    */
   Path GetPath( const std::string &name );
+
+  /**
+   * @copydoc Toolkit::Builder::GetPathConstrainer
+   */
+  Dali::PathConstrainer GetPathConstrainer( const std::string& name );
+
+  /*
+   * Check if a given constrainer is of type PathConstrainer
+   * @param[in] name The name of the constrainer
+   * @return True if constainer is of type PathConstrainer, False otherwise
+   *
+   */
+  bool IsPathConstrainer( const std::string& name );
+
+  /**
+   * @copydoc Toolkit::Builder::GetLinearConstrainer
+   */
+  Dali::LinearConstrainer GetLinearConstrainer( const std::string& name );
+
+  /*
+   * Check if a given constrainer is of type LinearConstrainer
+   * @param[in] name The name of the constrainer
+   * @return True if constainer is of type LinearConstrainer, False otherwise
+   *
+   */
+  bool IsLinearConstrainer( const std::string& name );
+
   /**
    * @copydoc Toolkit::Builder::QuitSignal
    */
@@ -219,6 +246,14 @@ private:
   typedef std::map<const std::string, Path> PathLut;
   PathLut mPathLut;
 
+  typedef struct{ std::string name; Dali::PathConstrainer pathConstrainer; } PathConstrainerEntry;
+  typedef std::vector<PathConstrainerEntry> PathConstrainerLut;
+  PathConstrainerLut mPathConstrainerLut;
+
+  typedef struct{ std::string name; Dali::LinearConstrainer linearConstrainer; } LinearConstrainerEntry;
+  typedef std::vector<LinearConstrainerEntry> LinearConstrainerLut;
+  LinearConstrainerLut mLinearConstrainerLut;
+
   SlotDelegate<Builder> mSlotDelegate;
 
   Property::Map mReplacementMap;
index 184d253..cd90217 100644 (file)
@@ -17,7 +17,7 @@
 
 // EXTERNAL INCLUDES
 #include <sstream>
-#include <dali/public-api/adaptor-framework/color-controller.h>
+#include <dali/devel-api/adaptor-framework/color-controller.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/builder/builder-impl.h>
index f832721..804deb3 100644 (file)
 // EXTERNAL INCLUDES
 #include <boost/function.hpp>
 #include <dali/public-api/actors/layer.h>
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/type-info.h>
 #include <dali/public-api/object/property-notification.h>
 #include <dali/integration-api/debug.h>
+#include <limits>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/builder/builder-impl.h>
@@ -142,6 +144,182 @@ struct DelayedAnimationPlay
   };
 };
 
+// Delay a pathConstrainer apply
+struct DelayedConstrainerApply
+{
+  std::string     constrainerName;
+
+  std::vector<std::string> targetActorNames;
+  std::vector<std::string> sourceActorNames;
+  std::vector<std::string> targetPropertyNames;
+  std::vector<std::string> sourcePropertyNames;
+  std::vector<Vector2>  ranges;
+  std::vector<Vector2>  wrapRanges;
+
+  Dali::IntrusivePtr<Dali::Toolkit::Internal::Builder>  builder;
+
+  /*
+   * Helper function to get the parameters to apply each constraint
+   * @param[in] i i-essim element
+   * @param[out] tagetActor Target actor for the constraint
+   * @param[out] tagetPropertyIndex Target property index for the constraint
+   * @param[out] sourceActor Source actor for the constraint
+   * @param[out] sourcePropertyIndex Source property index for the constraint
+   */
+  bool GetApplyParameters( size_t i,
+                           Actor& targetActor, Property::Index& targetPropertyIndex,
+                           Actor& sourceActor, Property::Index& sourcePropertyIndex)
+  {
+
+    targetActor = Stage::GetCurrent().GetRootLayer().FindChildByName(targetActorNames[i]);
+    targetPropertyIndex = Property::INVALID_INDEX;
+    if(targetActor)
+    {
+      targetPropertyIndex = targetActor.GetPropertyIndex(targetPropertyNames[i]);
+      if( targetPropertyIndex ==  Property::INVALID_INDEX )
+      {
+        DALI_SCRIPT_WARNING("Property '%s' not founded in actor '%s'\n", targetPropertyNames[i].c_str(), targetActorNames[i].c_str() );
+        return false;
+      }
+    }
+    else
+    {
+      DALI_SCRIPT_WARNING("Actor '%s' not founded\n", targetActorNames[i].c_str() );
+      return false;
+    }
+
+
+    sourceActor = Stage::GetCurrent().GetRootLayer().FindChildByName(sourceActorNames[i]);
+    sourcePropertyIndex = Property::INVALID_INDEX;
+    if(sourceActor)
+    {
+      sourcePropertyIndex = sourceActor.GetPropertyIndex(sourcePropertyNames[i]);
+      if( sourcePropertyIndex ==  Property::INVALID_INDEX )
+      {
+        DALI_SCRIPT_WARNING("Property '%s' not founded in actor '%s'\n", sourcePropertyNames[i].c_str(), sourceActorNames[i].c_str() );
+        return false;
+      }
+    }
+    else
+    {
+      DALI_SCRIPT_WARNING("Actor '%s' not founded\n", targetActorNames[i].c_str() );
+      return false;
+    }
+    return true;
+  }
+
+  void operator()(void)
+  {
+    Actor sourceActor, targetActor;
+    Property::Index targetPropertyIndex(Property::INVALID_INDEX);
+    Property::Index sourcePropertyIndex(Property::INVALID_INDEX);
+    size_t actorCount( targetActorNames.size() );
+    if( builder.Get()->IsPathConstrainer( constrainerName ))
+    {
+      PathConstrainer constrainer = builder.Get()->GetPathConstrainer(constrainerName);
+      if( constrainer )
+      {
+        for(size_t i(0); i<actorCount; ++i )
+        {
+
+          if( GetApplyParameters( i, targetActor, targetPropertyIndex, sourceActor, sourcePropertyIndex ) )
+          {
+            constrainer.Apply( Property(targetActor,targetPropertyIndex),
+                               Property(sourceActor,sourcePropertyIndex),
+                               ranges[i],
+                               wrapRanges[i]);
+          }
+        }
+      }
+      else
+      {
+        DALI_SCRIPT_WARNING("Constrainer %s not found\n", constrainerName.c_str());
+      }
+    }
+    else if( builder.Get()->IsLinearConstrainer( constrainerName ) )
+    {
+      Dali::LinearConstrainer constrainer( builder.Get()->GetLinearConstrainer(constrainerName));
+      if( constrainer )
+      {
+        for(size_t i(0); i<actorCount; ++i )
+        {
+
+          if( GetApplyParameters( i, targetActor, targetPropertyIndex, sourceActor, sourcePropertyIndex ) )
+          {
+            constrainer.Apply( Property(targetActor,targetPropertyIndex),
+                               Property(sourceActor,sourcePropertyIndex),
+                               ranges[i],
+                               wrapRanges[i]);
+          }
+        }
+      }
+      else
+      {
+        DALI_SCRIPT_WARNING("Constrainer %s not found\n", constrainerName.c_str());
+      }
+    }
+    else
+    {
+      DALI_SCRIPT_WARNING("Constrainer %s is not of a valid type\n", constrainerName.c_str());
+    }
+  }
+};
+
+// Delay a pathConstrainer remove
+struct DelayedConstrainerRemove
+{
+  std::string     constrainerName;
+  std::vector<std::string> targetActorNames;
+  Dali::IntrusivePtr<Dali::Toolkit::Internal::Builder>  builder;
+
+  void operator()(void)
+  {
+    size_t actorCount( targetActorNames.size() );
+    if( builder.Get()->IsPathConstrainer( constrainerName ))
+    {
+      PathConstrainer constrainer = builder.Get()->GetPathConstrainer(constrainerName);
+      if( constrainer )
+      {
+        for(size_t i(0); i<actorCount; ++i )
+        {
+          Actor targetActor = Stage::GetCurrent().GetRootLayer().FindChildByName(targetActorNames[i]);
+          if(targetActor)
+          {
+            constrainer.Remove( targetActor );
+          }
+        }
+      }
+      else
+      {
+        DALI_SCRIPT_WARNING("Constrainer %s not found\n", constrainerName.c_str());
+      }
+    }
+    else if(builder.Get()->IsLinearConstrainer( constrainerName ))
+    {
+      LinearConstrainer constrainer = builder.Get()->GetLinearConstrainer(constrainerName);
+      if( constrainer )
+      {
+        for(size_t i(0); i<actorCount; ++i )
+        {
+          Actor targetActor = Stage::GetCurrent().GetRootLayer().FindChildByName(targetActorNames[i]);
+          if(targetActor)
+          {
+            constrainer.Remove( targetActor );
+          }
+        }
+      }
+      else
+      {
+        DALI_SCRIPT_WARNING("Constrainer %s not found\n", constrainerName.c_str());
+      }
+    }
+    else
+    {
+      DALI_SCRIPT_WARNING("Constrainer %s is not of a valid type\n", constrainerName.c_str());
+    }
+  }
+};
+
 /*
  * Gets Property::Value from child
  */
@@ -298,6 +476,115 @@ boost::function<void (void)> GetAction(const TreeNode &root, const TreeNode &chi
       DALI_SCRIPT_WARNING("Cannot find animations section\n");
     }
   }
+  else if("applyConstraint" == *actionName )
+  {
+    OptionalString constrainerName = IsString( IsChild(child, "constrainer") );
+    if( !constrainerName )
+    {
+      DALI_SCRIPT_WARNING("Need to specify a constrainer\n");
+    }
+    else
+    {
+      DelayedConstrainerApply action;
+      action.constrainerName = *constrainerName;
+      action.builder = builder;
+      OptionalChild propertiesNode = IsChild(child, "properties");
+      if(propertiesNode)
+      {
+        const TreeNode::ConstIterator endIter = (*propertiesNode).CEnd();
+        for( TreeNode::ConstIterator iter = (*propertiesNode).CBegin(); endIter != iter; ++iter )
+        {
+          const TreeNode::KeyNodePair& pKeyChild = *iter;
+          OptionalString sourceActorName(IsString(IsChild(pKeyChild.second, "source")));
+          if(!sourceActorName)
+          {
+            DALI_SCRIPT_WARNING("Need to specify source actor to apply the constraint\n");
+            continue;
+          }
+          OptionalString sourcePropertyName( IsString( IsChild(pKeyChild.second, "sourceProperty" ) ) );
+          if(!sourcePropertyName)
+          {
+            DALI_SCRIPT_WARNING("Need to specify source property to apply the constraint\n");
+            continue;
+          }
+
+          OptionalString targetActorName(IsString(IsChild(pKeyChild.second, "target")));
+          if(!targetActorName)
+          {
+            DALI_SCRIPT_WARNING("Need to specify target actor to apply the constraint\n");
+            continue;
+          }
+
+          OptionalString targetPropertyName( IsString( IsChild(pKeyChild.second, "targetProperty" ) ) );
+          if(!targetPropertyName)
+          {
+            DALI_SCRIPT_WARNING("Need to specify target property name to apply the constraint\n");
+            continue;
+          }
+
+          OptionalVector2 range(IsVector2(IsChild(pKeyChild.second, "range")));
+          if(!range)
+          {
+            DALI_SCRIPT_WARNING("Constrainer range not specified\n");
+            continue;
+          }
+
+          Vector2 wrap(-std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
+          OptionalVector2 wrapRange(IsVector2(IsChild(pKeyChild.second, "wrap")));
+          if(wrapRange)
+          {
+            wrap = *wrapRange;
+          }
+
+          action.sourceActorNames.push_back(*sourceActorName);
+          action.sourcePropertyNames.push_back(*sourcePropertyName);
+          action.targetActorNames.push_back(*targetActorName);
+          action.targetPropertyNames.push_back(*targetPropertyName);
+          action.ranges.push_back(*range);
+          action.wrapRanges.push_back(wrap);
+        }
+
+        callback = action;
+      }
+    }
+
+
+  }
+  else if("removeConstraints" == *actionName )
+  {
+    OptionalString constrainerName = IsString( IsChild(child, "constrainer") );
+    if( !constrainerName )
+    {
+      DALI_SCRIPT_WARNING("Need to specify a constrainer\n");
+    }
+    else
+    {
+
+      DelayedConstrainerRemove action;
+      action.constrainerName = *constrainerName;
+      action.builder = builder;
+      OptionalChild propertiesNode = IsChild(child, "properties");
+      if(propertiesNode)
+      {
+        const TreeNode::ConstIterator endIter = (*propertiesNode).CEnd();
+        for( TreeNode::ConstIterator iter = (*propertiesNode).CBegin(); endIter != iter; ++iter )
+        {
+          const TreeNode::KeyNodePair& pKeyChild = *iter;
+          OptionalString targetActorName(IsString(IsChild(pKeyChild.second, "target")));
+          if(targetActorName)
+          {
+            action.targetActorNames.push_back(*targetActorName);
+          }
+          else
+          {
+            DALI_SCRIPT_WARNING("Need to specify target actor to remove the constraint\n");
+            continue;
+          }
+        }
+      }
+      callback = action;
+    }
+  }
   else
   {
     // no named actor; presume self
index 7dc7818..49e7365 100644 (file)
@@ -292,10 +292,7 @@ OptionalString Replacement::IsString( const TreeNode& node ) const
       }
       else
       {
-        if( Property::STRING == value.GetType() )
-        {
-          ret = v; // sets the unexpanded. Expansion may occur later in processing with include files
-        }
+        ret = v; // sets the unexpanded. Expansion may occur later in processing with include files
       }
     }
   }
index b06e57b..7161df5 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/property-input.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 
 namespace Dali
index ac56224..22a131d 100644 (file)
@@ -25,7 +25,7 @@
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 // INTERNAL INCLUDES
index 40ff196..1c31fe5 100644 (file)
@@ -22,9 +22,9 @@
 #include <cstring> // for strcmp
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/scripting/scripting.h>
+#include <dali/devel-api/scripting/scripting.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
index f07eb32..7632f79 100644 (file)
@@ -641,7 +641,7 @@ void PushButton::OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type d
 
 void PushButton::ConfigureSizeNegotiation()
 {
-  ActorContainer images;
+  std::vector< Actor > images;
   images.reserve( 7 );
 
   images.push_back( GetButtonImage() );
@@ -661,11 +661,25 @@ void PushButton::ConfigureSizeNegotiation()
 
   if( label )
   {
-    label.SetPadding( Padding( TEXT_PADDING, TEXT_PADDING, TEXT_PADDING, TEXT_PADDING) );
+    Padding padding;
+
+    if( label.GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::USE_NATURAL_SIZE )
+    {
+      padding.left = TEXT_PADDING;
+      padding.right = TEXT_PADDING;
+    }
+
+    if( label.GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::USE_NATURAL_SIZE )
+    {
+      padding.top = TEXT_PADDING;
+      padding.bottom = TEXT_PADDING;
+    }
+
+    label.SetPadding( padding );
   }
 }
 
-void PushButton::ConfigureSizeNegotiationDimension( Dimension::Type dimension, const ActorContainer& images, Actor& label )
+void PushButton::ConfigureSizeNegotiationDimension( Dimension::Type dimension, const std::vector< Actor >& images, Actor& label )
 {
   ResizePolicy::Type imageResizePolicy = ResizePolicy::FILL_TO_PARENT;
   ResizePolicy::Type labelResizePolicy = ResizePolicy::FILL_TO_PARENT;
@@ -700,7 +714,7 @@ void PushButton::ConfigureSizeNegotiationDimension( Dimension::Type dimension, c
     label.SetResizePolicy( labelResizePolicy, dimension );
   }
 
-  for( ActorConstIter it = images.begin(), itEnd = images.end(); it != itEnd; ++it )
+  for( std::vector< Actor >::const_iterator it = images.begin(), itEnd = images.end(); it != itEnd; ++it )
   {
     Actor actor = *it;
     if( actor )
index 7a23474..6aa58e1 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/animation/animation.h>
 
 // INTERNAL INCLUDES
@@ -189,7 +189,7 @@ private:
    * @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 );
+  void ConfigureSizeNegotiationDimension( Dimension::Type dimension, const std::vector< Actor >& images, Actor& label );
 
   // slots
 
index e0a5ea5..df8a6ea 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 // INTERNAL INCLUDES
index f233cf4..e5cd600 100644 (file)
@@ -25,7 +25,7 @@
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/integration-api/debug.h>
 
diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-bar.cpp b/dali-toolkit/internal/controls/navigation-frame/navigation-bar.cpp
deleted file mode 100644 (file)
index 6e34571..0000000
+++ /dev/null
@@ -1,123 +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 "navigation-bar.h"
-
-// EXTERNAL INCLUDES
-
-// INTERNAL INCLUDES
-
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-NavigationBar::NavigationBar(NavigationControl& naviControl,
-                             Toolkit::BasicNaviBarStyle barStylePortrait,
-                             Toolkit::BasicNaviBarStyle barStyleLandscape )
-:mInternalNavigationControl( naviControl ),
- mBasicStylePortrait( barStylePortrait ),
- mBasicStyleLandscape( barStyleLandscape ),
- mBasicCurrentStyle( &mBasicStylePortrait ),
- mIsPortrait( true ),
- mVisible( true )
-{
-  mInternalNavigationControl.ItemPushedSignal().Connect( this, &NavigationBar::OnItemPushed );
-  mInternalNavigationControl.ItemPoppedSignal().Connect( this, &NavigationBar::OnItemPopped );
-
-  mLayout = Toolkit::TableView::New(1,3);
-  mInternalNavigationControl.GetBarLayer().Add(mLayout);
-  mLayout.SetSize(mBasicCurrentStyle->referenceWidth, mBasicCurrentStyle->height);
-  mLayout.SetFixedHeight(0, mBasicCurrentStyle->height);
-  mLayout.SetDrawMode(DrawMode::OVERLAY);
-
-  SetBackground( mBasicCurrentStyle->background );
-}
-
-NavigationBar::~NavigationBar()
-{
-}
-
-void NavigationBar::ScaleStyleUpdate( Vector2 naviControlSize, int orientation )
-{
-  bool isPortrait( orientation == 0 || orientation == 180 );
-  // change in orientation.
-  if(mIsPortrait != isPortrait)
-  {
-    mIsPortrait = isPortrait;
-    mBasicCurrentStyle = isPortrait ? &mBasicStylePortrait : &mBasicStyleLandscape;
-    OrientationUpdate( isPortrait );
-    mLayout.SetSize(mBasicCurrentStyle->referenceWidth, mBasicCurrentStyle->height);
-    mLayout.SetFixedHeight(0, mBasicCurrentStyle->height);
-    if(mBackground)
-    {
-      mBackground.SetSize(mBasicCurrentStyle->referenceWidth, mBasicCurrentStyle->height);
-    }
-  }
-
-  mRelativeScale = naviControlSize.x / static_cast<float>( mBasicCurrentStyle->referenceWidth);
-  mLayout.SetScale(mRelativeScale);
-  mBarHeight = mBasicCurrentStyle->height * mRelativeScale;
-  if(mBackground)
-  {
-    mBackground.SetScale(mRelativeScale);
-  }
-}
-
-float NavigationBar::GetBarHeight() const
-{
-  if( mVisible )
-  {
-    return mBarHeight;
-  }
-  else
-  {
-    return 0.0f;
-  }
-}
-
-void NavigationBar::SetBackground( Actor background )
-{
-  mBackground = background;
-  mBackground.SetSize(mBasicCurrentStyle->referenceWidth, mBasicCurrentStyle->height);
-  mInternalNavigationControl.GetBarLayer().Add( mBackground );
-  mBackground.SetScale(mRelativeScale);
-}
-
-void NavigationBar::OnItemPushed( Toolkit::NavigationControl naviControl, Toolkit::Page naviItem )
-{
-  mCurrentItem = naviItem;
-  Update( mCurrentItem );
-}
-
-void NavigationBar::OnItemPopped( Toolkit::NavigationControl naviControl, Toolkit::Page naviItem )
-{
-  mCurrentItem = mInternalNavigationControl.GetCurrentItem();
-  Update( mCurrentItem );
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-bar.h b/dali-toolkit/internal/controls/navigation-frame/navigation-bar.h
deleted file mode 100644 (file)
index 0a30fdd..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_NAVIGATION_BAR_H__
-#define __DALI_TOOLKIT_INTERNAL_NAVIGATION_BAR_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 <string>
-
-// INTERNAL INCLUDES
-#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>
-#include <dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-/**
- * Base class for different navigation bars such as tool bar, title bar.
- */
-class NavigationBar : public Dali::RefObject, public ConnectionTracker
-{
-
-public:
-  /**
-   * Constructor
-   * Pass in the navigationControl with which the bar associates and its style.
-   */
-  NavigationBar( NavigationControl& naviControl,
-                 Toolkit::BasicNaviBarStyle barStylePortrait,
-                 Toolkit::BasicNaviBarStyle barStyleLandscape);
-
-  /**
-   * Update the bar scale when the size of the navigation control is set / reset
-   * Also Update the style when the orientation( portrait/landscape) is changed
-   * @param[in] naviControlSize The size of the navigation control
-   * @param[in] orientation The angle of the current orientation
-   */
-  void ScaleStyleUpdate( Vector2 naviControlSize, int orientation );
-
-  /**
-   * Retrieve the height of the bar
-   * @return The height of the bar
-   */
-  float GetBarHeight() const;
-
-private:
-
-  /**
-   * Set a background image and add it onto the NavigaionControl's bar layer.
-   *
-   */
-  void SetBackground( Actor background );
-
-  /**
-   * Call the update function when it receives the page pushed signal.
-   */
-  void OnItemPushed( Toolkit::NavigationControl naviControl, Toolkit::Page naviItem );
-
-  /**
-   * Call the update function when it receives the page popped signal.
-   */
-  void OnItemPopped( Toolkit::NavigationControl naviControl, Toolkit::Page naviItem );
-
-protected:
-
-  /**
-   * virtual destructor
-   */
-  virtual ~NavigationBar();
-
-  /**
-   * Given the current page, update the bar content.
-   * @param[in] naviItem the item on the top of the navigation stack
-   */
-  virtual void Update( Toolkit::Page naviItem ) = 0;
-
-  /**
-   * update the bar style when the orientation is changed
-   * @param[in] isPortrait Whether the current orientation is portrait mode
-   */
-  virtual void OrientationUpdate( bool isPortrait ) = 0;
-
-private:
-
-  // Undefined
-  NavigationBar(const NavigationBar&);
-
-  // Undefined
-  NavigationBar& operator=(const NavigationBar& rhs);
-
-
-protected:
-  NavigationControl&                 mInternalNavigationControl;
-  Toolkit::BasicNaviBarStyle         mBasicStylePortrait;
-  Toolkit::BasicNaviBarStyle         mBasicStyleLandscape;
-  const Toolkit::BasicNaviBarStyle*  mBasicCurrentStyle;
-  float                              mRelativeScale;
-  float                              mBarHeight;
-
-  Toolkit::TableView                 mLayout;
-  Actor                              mBackground;
-
-  bool                               mIsPortrait;
-  Toolkit::Page            mCurrentItem;
-
-  bool                               mVisible;
-};
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-
-#endif /* __DALI_TOOLKIT_INTERNAL_NAVIGATION_BAR_H__ */
diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp b/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.cpp
deleted file mode 100644 (file)
index 042fe35..0000000
+++ /dev/null
@@ -1,468 +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 "navigation-control-impl.h"
-
-// EXTERNAL INCLUDES
-#include <cstring> // for strcmp
-#include <dali/public-api/animation/animation.h>
-#include <dali/public-api/events/key-event.h>
-#include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/size-negotiation/relayout-container.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
-#include <dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.h>
-#include <dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.h>
-#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace // to register type
-{
-
-BaseHandle Create()
-{
-  return Toolkit::NavigationControl::New();
-}
-
-// Setup properties, signals and actions using the type-registry.
-DALI_TYPE_REGISTRATION_BEGIN( Toolkit::NavigationControl, Toolkit::Control, Create )
-
-DALI_ACTION_REGISTRATION( Toolkit, NavigationControl, "push", ACTION_PUSH )
-DALI_ACTION_REGISTRATION( Toolkit, NavigationControl, "pop",  ACTION_POP  )
-
-DALI_TYPE_REGISTRATION_END()
-
-}
-
-NavigationControl::NavigationControl()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS ) ),
-  mToolBar(NULL),
-  mTitleBar(NULL),
-  mOrientationAngle( 0 ),
-  mOrientationAnimationDuration( 1.0f ),
-  mOrientationAnimationAlphaFunc( AlphaFunction::EASE_OUT ),
-  mItemPositionCoefficient( Vector3( 0.0f, 1.0f, 0.0f) ),
-  mItemPushedSignal( ),
-  mItemPoppedSignal( )
-{
-}
-
-NavigationControl::~NavigationControl()
-{
-  // Clear all the items in the stack, forces their destruction before NavigationControl is destroyed.
-  mItemStack.clear();
-}
-
-void NavigationControl::OnInitialize()
-{
-  //create layers for display background, current item, and bars respectively
-  mBackgroundLayer = CreateLayer();
-  mContentLayer = CreateLayer();
-  mBarLayer = CreateLayer();
-  mPopupLayer = CreateLayer();
-}
-
-void NavigationControl::OnControlChildAdd( Actor& child )
-{
-  Toolkit::Page page = Toolkit::Page::DownCast(child);
-
-  // If it's a page then store it locally, Off stage.
-  if(page)
-  {
-    mUnpushedItems.push_back(page);
-
-    // Orphan it until needed later during "push".
-    Self().Remove( child );
-  }
-}
-
-Toolkit::NavigationControl NavigationControl::New()
-{
-  // Create the implementation, temporarily owned by this handle on stack
-  IntrusivePtr< NavigationControl > internalNavigationControl = new NavigationControl();
-
-  // Pass ownership to CustomActor handle
-  Toolkit::NavigationControl navigationControl( *internalNavigationControl );
-
-  // Second-phase init of the implementation
-  // This can only be done after the CustomActor connection has been made...
-  internalNavigationControl->Initialize();
-
-  return navigationControl;
-}
-
-void NavigationControl::OnStageConnection()
-{
-  //only works when navigation control is already on stage!
-  mContentLayer.RaiseAbove( mBackgroundLayer );
-  mBarLayer.RaiseAbove( mContentLayer );
-  mPopupLayer.RaiseAbove( mBarLayer );
-  Self().SetSensitive(true);
-  SetKeyInputFocus();
-}
-
-void NavigationControl::PushItem( Toolkit::Page page )
-{
-  // check the uninitialized item
-  // check the duplicated push for the top item
-  if(!page || page == mCurrentItem)
-  {
-    return;
-  }
-
-  if( mCurrentItem )
-  {
-    mContentLayer.Remove( mCurrentItem );
-  }
-
-  //push the new item into the stack and show it
-  mItemStack.push_back(page);
-  mCurrentItem = page;
-  mContentLayer.Add(page);
-  mCurrentItem.SetPositionInheritanceMode(USE_PARENT_POSITION_PLUS_LOCAL_POSITION);
-
-  //set up the popup menu which would response to the KEY_MENU
-  SetupPopupMenu();
-
-  //Emit singal
-  Toolkit::NavigationControl handle( GetOwner() );
-  mItemPushedSignal.Emit(handle, page);
-}
-
-Toolkit::Page NavigationControl::PopItem()
-{
-  // cannot pop out the bottom-most item
-  Toolkit::Page poppedItem;
-  if(mItemStack.size() > 1)
-  {
-    // pop out the top item of the stack and show the new item right under the old one.
-    mContentLayer.Remove(mCurrentItem);
-    poppedItem = mItemStack.back();
-    mItemStack.pop_back();
-    mCurrentItem = mItemStack.back();
-    mContentLayer.Add(mCurrentItem);
-
-    //set up the popup menu which would response to the KEY_MENU
-    SetupPopupMenu();
-  }
-
-  //Emit signal
-  Toolkit::NavigationControl handle( GetOwner() );
-  mItemPoppedSignal.Emit(handle, poppedItem);
-
-  return poppedItem;
-}
-
-size_t NavigationControl::GetItemCount() const
-{
-  return mItemStack.size();
-}
-
-Toolkit::Page NavigationControl::GetItem(std::size_t index) const
-{
-  DALI_ASSERT_ALWAYS( index < mItemStack.size() );
-  return mItemStack[index];
-}
-
-Toolkit::Page NavigationControl::GetCurrentItem() const
-{
-  return mCurrentItem;
-}
-
-void NavigationControl::SetBackground( Actor background)
-{
-  // It removes the old background
-  if( mBackground )
-  {
-    mBackgroundLayer.Remove( mBackground );
-  }
-  mBackgroundLayer.Add( background );
-  mBackground = background;
-  mBackground.SetSize( mControlSize );
-}
-
-void NavigationControl::CreateNavigationToolBar(Toolkit::NaviToolBarStyle toolBarStylePortrait,
-                                                Toolkit::NaviToolBarStyle toolBarStyleLandscape )
-{
-  // Set a navigation tool bar at the bottom of the navigation frame
-  // the controls on the tool bar will update automatically when item is pushed or popped by responding to the signals
-  mToolBar = new NavigationToolBar(*this, toolBarStylePortrait, toolBarStyleLandscape);
-}
-
-void NavigationControl::CreateNavigationTitleBar(Toolkit::NaviTitleBarStyle titleBarStylePortrait,
-                                                 Toolkit::NaviTitleBarStyle titleBarStyleLandscape)
-{
-  // Set a navigation title bar at the top of the navigation frame
-  // the tile/subtitle/titl icon/buttons will update automatically when item is pushed or popped by responding to the signals
-  mTitleBar = new NavigationTitleBar(*this, titleBarStylePortrait, titleBarStyleLandscape);
-}
-
-void NavigationControl::OrientationChanged( int angle )
-{
-  if( mOrientationAngle != angle )
-  {
-    Vector2 targetSize = Vector2(GetSizeSet());
-
-    // checking to see if changing from landscape -> portrait, or portrait -> landscape
-    if( mOrientationAngle%180 != angle%180 )
-    {
-      targetSize = Vector2( targetSize.height, targetSize.width );
-    }
-
-    mOrientationAngle = angle;
-
-    switch(angle)
-    {
-      case 0:
-      {
-        mItemPositionCoefficient = Vector3(0.0f, 1.0f, 0.0f);
-        break;
-      }
-      case 90:
-      {
-        mItemPositionCoefficient = Vector3(1.0f, 0.0f, 0.0f);
-        break;
-      }
-      case 180:
-      {
-        mItemPositionCoefficient = Vector3(0.0f, -1.0f, 0.0f);
-        break;
-      }
-      case 270:
-      {
-        mItemPositionCoefficient = Vector3(-1.0f, 0.0f, 0.0f);
-        break;
-      }
-      default:
-      {
-        DALI_ASSERT_ALWAYS(false);
-        break;
-      }
-    }
-
-    Actor self = Self();
-    Animation animation = Animation::New( mOrientationAnimationDuration );
-    animation.AnimateTo( Property( self, Actor::Property::ORIENTATION ), Quaternion( Radian( Degree( -angle ) ), Vector3::ZAXIS ), mOrientationAnimationAlphaFunc );
-    animation.Play();
-
-    self.SetSize( targetSize );
-
-    RelayoutRequest();
-  }
-}
-
-void NavigationControl::SetOrientationRotateAnimation( float duration, AlphaFunction alphaFunc)
-{
-  mOrientationAnimationDuration = duration;
-  mOrientationAnimationAlphaFunc = alphaFunc;
-}
-
-Layer NavigationControl::GetBarLayer() const
-{
-  return mBarLayer;
-}
-
-void NavigationControl::OnRelayout( const Vector2& size, RelayoutContainer& container )
-{
-  const Vector2 setSize( size );
-
-  if( mCurrentItem )
-  {
-    // always set the current item to fully occupy navigationControl space apart from the bars,
-    // here the bars might be hidden if the current item does not need them
-    float positionOffset = 0.0f;
-    float sizeShrink = 0.0f;
-    if(mTitleBar)
-    {
-      positionOffset += mTitleBar->GetBarHeight()*0.5f;
-      sizeShrink += mTitleBar->GetBarHeight();
-    }
-    if(mToolBar)
-    {
-      positionOffset -= mToolBar->GetBarHeight()*0.5f;
-      sizeShrink += mToolBar->GetBarHeight();
-    }
-    mCurrentItem.SetPosition( mItemPositionCoefficient * positionOffset);
-    Vector2 itemSize( setSize.x, setSize.y-sizeShrink );
-
-    container.Add( mCurrentItem, itemSize );
-  }
-
-  container.Add( mBarLayer, setSize );
-  container.Add( mPopupLayer, setSize );
-}
-
-void NavigationControl::OnControlSizeSet( const Vector3& size )
-{
-  if( mControlSize == Vector2(size) )
-  {
-    return;
-  }
-  mControlSize = Vector2(size);
-
-  mBarLayer.SetSize(mControlSize);
-  mPopupLayer.SetSize(mControlSize);
-
-  if( mBackground )
-  {
-    mBackground.SetSize( mControlSize );
-  }
-  if( mToolBar )
-  {
-    mToolBar->ScaleStyleUpdate( mControlSize, mOrientationAngle );
-  }
-  if( mTitleBar )
-  {
-    mTitleBar->ScaleStyleUpdate( mControlSize, mOrientationAngle );
-  }
-}
-
-bool NavigationControl::OnKeyEvent( const KeyEvent& event )
-{
-  bool consumed = false;
-
-  if(event.state == KeyEvent::Down)
-  {
-    if(event.keyCode == 96 ) // F12 == for test
-    //if( event.keyCode == Dali::DALI_KEY_BACK || event.keyCode == Dali::DALI_KEY_ESCAPE )
-    {
-      if( mPopupMenu && mPopupMenu.IsSensitive() ) // State:POPUP_SHOW
-      {
-        mPopupMenu.Hide();
-        consumed = true;
-      }
-      else if(PopItem())
-      {
-        consumed = true;
-      }
-    }
-
-    if( mPopupMenu && event.keyCode == 9)
-    //if( mPopupMenu && ( event.keyCode == Dali::DALI_KEY_MENU  || event.keyCode == Dali::DALI_KEY_SEND ) )
-    //Todo: replace with dali key enum after the mapping between X key definition and dali key enum is implemented in dali-adapto
-    //if( mPopupMenu && event.keyPressedName == "XF86Send" )
-    {
-      if( !mPopupMenu.IsSensitive() ) // State: POPUP_HIDE
-      {
-        mPopupMenu.Show();
-      }
-      else // State:POPUP_SHOW
-      {
-        mPopupMenu.Hide();
-      }
-      consumed = true;
-    }
-  }
-
-  return consumed;
-}
-
-Layer NavigationControl::CreateLayer()
-{
-  Layer layer = Layer::New();
-  layer.SetPositionInheritanceMode(USE_PARENT_POSITION);
-  Self().Add(layer);
-  return layer;
-}
-
-void NavigationControl::SetupPopupMenu()
-{
-  if(mPopupMenu)
-  {
-    mPopupLayer.Remove( mPopupMenu );
-  }
-  mPopupMenu = mCurrentItem.GetPopupMenu();
-  if( mPopupMenu )
-  {
-    mPopupLayer.Add( mPopupMenu );
-    mPopupMenu.OutsideTouchedSignal().Connect(this, &NavigationControl::OnPopupTouchedOutside);
-  }
-}
-
-void NavigationControl::OnPopupTouchedOutside()
-{
-  if( mPopupMenu )
-  {
-    mPopupMenu.Hide();
-  }
-}
-
-Toolkit::NavigationControl::ItemPushedSignalType& NavigationControl::ItemPushedSignal()
-{
-  return mItemPushedSignal;
-}
-
-Toolkit::NavigationControl::ItemPoppedSignalType& NavigationControl::ItemPoppedSignal()
-{
-  return mItemPoppedSignal;
-}
-
-bool NavigationControl::DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes )
-{
-  bool ret = false;
-
-  Dali::BaseHandle handle( object );
-  Toolkit::NavigationControl control = Toolkit::NavigationControl::DownCast( handle );
-  DALI_ASSERT_ALWAYS( control );
-
-  if( 0 == strcmp( actionName.c_str(), ACTION_PUSH ) )
-  {
-    for( PropertyValueConstIter iter = attributes.begin(); iter != attributes.end(); ++iter )
-    {
-      const Property::Value& value = *iter;
-
-      DALI_ASSERT_ALWAYS( value.GetType() == Property::STRING );
-      std::string itemName = value.Get<std::string>();
-
-      for( std::list<Toolkit::Page>::iterator itemsIter = GetImpl( control ).mUnpushedItems.begin(); itemsIter != GetImpl( control ).mUnpushedItems.end(); ++itemsIter )
-      {
-        Toolkit::Page page = *itemsIter;
-        if( page.GetName() == itemName )
-        {
-          GetImpl( control ).PushItem( page );
-          ret = true;
-          break;
-        }
-      }
-    }
-  }
-  else if( 0 == strcmp( actionName.c_str(), ACTION_POP ) )
-  {
-    GetImpl( control ).PopItem();
-
-    ret = true;
-  }
-
-  return ret;
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h b/dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h
deleted file mode 100644 (file)
index 1e7f0a2..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_NAVIGATION_CONTROL_H__
-#define __DALI_TOOLKIT_INTERNAL_NAVIGATION_CONTROL_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 <list>
-#include <dali/public-api/actors/layer.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/navigation-frame/navigation-control.h>
-#include <dali-toolkit/public-api/controls/navigation-frame/page.h>
-#include <dali-toolkit/public-api/controls/popup/popup.h>
-#include <dali-toolkit/internal/controls/navigation-frame/navigation-bar.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-class NavigationControl;
-class Page;
-
-namespace Internal
-{
-
-class NavigationBar;
-
-/**
- * NavigationControl implements a controller than manages the navigation of hierarchical contents.
- * @see Dali::Toolkit::NavigationControl for more details.
- */
-class NavigationControl : public Control
-{
-public:
-
-  /**
-   * Create an initialized NavigationControl.
-   * @return A handle to a newly allocated Dali resource
-   */
-  static Toolkit::NavigationControl New();
-
-  /**
-   * @copydoc Dali::Toolkit::NavigationControl::PushItem()
-   */
-  void PushItem( Toolkit::Page page );
-
-  /**
-   * @copydoc Dali::Toolkit::NavigationControl::PopItem()
-   */
-  Toolkit::Page PopItem();
-
-  /**
-   * @copydoc Dali::Toolkit::NavigationControl::GetItemCount()
-   */
-  size_t GetItemCount() const;
-
-  /**
-   * @copydoc Dali::Toolkit::NavigationControl::GetItem()
-   */
-  Toolkit::Page GetItem(std::size_t index) const;
-
-  /**
-   * @copydoc Dali::Toolkit::NavigationControl::GetCurrentItem()
-   */
-  Toolkit::Page GetCurrentItem() const;
-
-  /**
-   * @copydoc Dali::Toolkit::NavigationControl::SetBackground()
-   */
-  void SetBackground( Actor background);
-
-  /**
-   * @copydoc Dali::Toolkit::NavigationControl::CreateNavigationToolBar()
-   */
-  void CreateNavigationToolBar( Toolkit::NaviToolBarStyle toolBarStylePortrait,
-                                Toolkit::NaviToolBarStyle toolBarStyleLandscape );
-
-  /**
-   * @copydoc Dali::Toolkit::NavigationControl::CreateNavigationTitleBar()
-   */
-  void CreateNavigationTitleBar( Toolkit::NaviTitleBarStyle titleBarStylePortrait,
-                                 Toolkit::NaviTitleBarStyle titleBarStyleLandscape );
-
-  /**
-   * @copydoc Dali::Toolkit::NavigationControl::OrientationChanged()
-   */
-  void OrientationChanged( int angle );
-
-  /**
-   * @copydoc Dali::Toolkit::NavigationControl::SetOrientationRotateAnimation()
-   */
-  void SetOrientationRotateAnimation( float duration, AlphaFunction alphaFunc);
-
-  /**
-   * Retrieve the layer for displaying navigation bar
-   * @return The layer for navigation bar
-   */
-  Layer GetBarLayer() const;
-
-  /**
-   * 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);
-
-public:
-
-  /**
-   * @copydoc Dali::Toolkit::NavigatinControl::ItemPushedSignal()
-   */
-  Toolkit::NavigationControl::ItemPushedSignalType& ItemPushedSignal();
-
-  /**
-   * @copydoc Dali::Toolkit::NavigatinControl::ItemPoppedSignal()
-   */
-  Toolkit::NavigationControl::ItemPoppedSignalType& ItemPoppedSignal();
-
-private: // override functions from Control
-
-  /**
-   * @copydoc Control::OnInitialize()
-   */
-  virtual void OnInitialize();
-
-  /**
-   * From Control; called after a child has been added to the owning actor.
-   * @param[in] child The child which has been added.
-   */
-  virtual void OnControlChildAdd( Actor& child );
-
-  /**
-   * @copydoc Control::OnStageConnection()
-   */
-  virtual void OnStageConnection();
-
-  /**
-   * @copydoc Control::OnRelayout()
-   */
-  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
-
-  /**
-   * @copydoc Control::OnControlSizeSet
-   */
-  virtual void OnControlSizeSet( const Vector3& size );
-
-  /**
-   * @copydoc Control::OnKeyEvent()
-   */
-  virtual bool OnKeyEvent( const KeyEvent& event );
-
-protected:
-
-  /**
-   * Constructor.
-   * It initializes the NavigationControl members
-   */
-  NavigationControl();
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~NavigationControl();
-
-private:
-
-  // Undefined
-  NavigationControl(const NavigationControl&);
-
-  // Undefined
-  NavigationControl& operator=(const NavigationControl& rhs);
-
-  /**
-   * Create a Layer and add it to the navigation control
-   * @return The newly created layer
-   */
-  Layer CreateLayer();
-
-  /**
-   * Setup the pop up menu which would show when KEY_MENU is pressed
-   * This function is called when pushing/popping item
-   */
-  void SetupPopupMenu();
-
-  /**
-   * Signal handler called when the user touches outside of pop up menu.
-   */
-  void OnPopupTouchedOutside();
-
-public:
-  std::list< Toolkit::Page >           mUnpushedItems;
-
-private:
-
-  std::vector< Toolkit::Page > mItemStack;
-  Toolkit::Page                mCurrentItem;
-  Vector2                      mControlSize;
-
-  Layer                        mBackgroundLayer;
-  Layer                        mBarLayer;
-  Layer                        mContentLayer;
-  Layer                        mPopupLayer;
-
-  Actor                        mBackground;
-
-  NavigationBar*               mToolBar;
-  NavigationBar*               mTitleBar;
-
-  int                          mOrientationAngle;
-  float                        mOrientationAnimationDuration;
-  AlphaFunction                mOrientationAnimationAlphaFunc;
-  Vector3                      mItemPositionCoefficient;
-
-  Toolkit::Popup               mPopupMenu;
-
-private:
-  Toolkit::NavigationControl::ItemPushedSignalType mItemPushedSignal;   ///< The signal to notify the item push
-  Toolkit::NavigationControl::ItemPoppedSignalType mItemPoppedSignal;   ///< The signal to notify the item pop
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Toolkit::Internal::NavigationControl& GetImpl( Toolkit::NavigationControl& navigationControl )
-{
-  DALI_ASSERT_ALWAYS( navigationControl );
-
-  Dali::RefObject& handle = navigationControl.GetImplementation();
-
-  return static_cast<Toolkit::Internal::NavigationControl&>( handle );
-}
-
-inline const Toolkit::Internal::NavigationControl& GetImpl( const Toolkit::NavigationControl& navigationControl )
-{
-  DALI_ASSERT_ALWAYS( navigationControl );
-
-  const Dali::RefObject& handle = navigationControl.GetImplementation();
-
-  return static_cast<const Toolkit::Internal::NavigationControl&>( handle );
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif /* __DALI_TOOLKIT_INTERNAL_NAVIGATION_CONTROL_H__ */
diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.cpp b/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.cpp
deleted file mode 100644 (file)
index e8ce9e0..0000000
+++ /dev/null
@@ -1,169 +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 "navigation-title-bar.h"
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-//ToDo: use const variables instead of magic numbers
-
-NavigationTitleBar::NavigationTitleBar(NavigationControl& naviControl,
-                                       Toolkit::NaviTitleBarStyle titleBarStylePortrait,
-                                       Toolkit::NaviTitleBarStyle titleBarStyleLandscape )
-: NavigationBar(naviControl, titleBarStylePortrait, titleBarStyleLandscape ),
-  mStylePortrait( titleBarStylePortrait ),
-  mStyleLandscape( titleBarStyleLandscape ),
-  mCurrentStyle( &mStylePortrait )
-{
-  // title bar is located at the top of the frame
-  mLayout.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
-  mLayout.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
-  if(mBackground)
-  {
-    mBackground.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
-    mBackground.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
-  }
-
-  // button layout: three rows, controls will be put in the middle row, the top and bottom rows are just for margins
-  mButtonLayout = Toolkit::TableView::New(3, 1);
-  // title layout: fours rows, the top and bottom rows are just for margins
-  // if subtitle exists, title in the second row and subtitle in the third row
-  // if no subtitle, title will occupy both second and third row
-  mTitleLayout= Toolkit::TableView::New( 4,1 );
-  // title icon layout: the top row, the bottom row and the left column are all for margins
-  mTitleIconLayout= Toolkit::TableView::New( 3,2 );
-  SetFixedSizes();
-
-  mTitle = Toolkit::TextLabel::New();
-  mSubTitle = Toolkit::TextLabel::New();
-}
-
-void NavigationTitleBar::Update( Toolkit::Page page )
-{
-  const std::vector<Actor>& controls = page.GetControlsOnTitleBar();
-
-  // if there is no control to place on the bar ano no title is set, hide the bar
-  if(controls.empty() && page.GetTitle().empty())
-  {
-    mVisible = false;
-    mLayout.SetVisible(false);
-    mBackground.SetVisible(false);
-    return;
-  }
-
-  if(mLayout.GetColumns() == 4)// | leftMargin | titleLayout(may have icon and subtitle) | buttonLayout | rightMargin |
-  {
-    //remove buttonLayout
-    mLayout.DeleteColumn(2);
-  }
-  // remove titleLayout
-  mLayout.RemoveChildAt( Toolkit::TableView::CellPosition(0,1) );
-  //Remove the controls in the buttonLayout
-  mButtonLayout.Resize(3,1);
-  //remove titleIcon
-  if(mTitleLayout.GetColumns() == 2)
-  {
-    mTitleLayout.DeleteColumn( 0 );
-  }
-  // remove title and subtitle
-  mTitleLayout.RemoveChildAt( Toolkit::TableView::CellPosition(2,0) );
-  mTitleLayout.RemoveChildAt( Toolkit::TableView::CellPosition(1,0) );
-
-  // add controls at the right part of the bar(if exist)
-  if(!controls.empty())
-  {
-    int numControls = controls.size();
-
-    for( int index = 0; index < numControls; index++)
-    {
-      mButtonLayout.AddChild( controls[index], Toolkit::TableView::CellPosition(1, 2*index + 1) );
-      mButtonLayout.SetFixedWidth (2*index, mCurrentStyle->gapBetweenButtons);
-      mButtonLayout.SetFixedWidth (2*index+1, mCurrentStyle->buttonSize);
-    }
-
-    mLayout.InsertColumn(2);
-    mLayout.SetFixedWidth(2, numControls * ( mCurrentStyle->buttonSize + mCurrentStyle->gapBetweenButtons) );
-    mLayout.AddChild(mButtonLayout, Toolkit::TableView::CellPosition(0,2));
-  }
-
-  // add title and subtitle(if exist)
-  mTitle.SetProperty( Toolkit::TextLabel::Property::TEXT, page.GetTitle() );
-  if( page.GetSubTitle().empty() )  //display title
-  {
-    mTitleLayout.SetFixedHeight( 1,mCurrentStyle->titleHeightWithoutSubtitle - mCurrentStyle->subtitleHeight );
-    mTitleLayout.AddChild( mTitle, Toolkit::TableView::CellPosition(1,0,2,1) );
-  }
-  else //display title and subtitle
-  {
-    mTitleLayout.SetFixedHeight( 1, mCurrentStyle->titleHeightWithSubtitle );
-    mTitleLayout.AddChild( mTitle, Toolkit::TableView::CellPosition(1,0) );
-    mSubTitle.SetProperty( Toolkit::TextLabel::Property::TEXT, page.GetSubTitle() );
-    mTitleLayout.AddChild( mSubTitle, Toolkit::TableView::CellPosition(2,0) );
-  }
-
-  // insert title icon to the left of the title(if exist)
-  if( page.GetTitleIcon() )
-  {
-    mTitleIconLayout.RemoveChildAt(Toolkit::TableView::CellPosition(1,0) );
-    mTitleIconLayout.AddChild( page.GetTitleIcon(), Toolkit::TableView::CellPosition(1,0) );
-    mTitleLayout.InsertColumn( 0 );
-    mTitleLayout.SetFixedWidth( 0, mCurrentStyle->titleLeftMargin + mCurrentStyle->titleIconSize);
-    mTitleLayout.AddChild( mTitleIconLayout, Toolkit::TableView::CellPosition(1,0,2,1) );
-  }
-
-  mLayout.AddChild( mTitleLayout, Toolkit::TableView::CellPosition(0,1) );
-
-  mVisible = true;
-  mLayout.SetVisible(true);
-  mBackground.SetVisible(true);
-}
-
-void NavigationTitleBar::OrientationUpdate( bool isPortrait )
-{
-  mCurrentStyle = isPortrait ? &mStylePortrait : &mStyleLandscape;
-  SetFixedSizes();
-  Update( mCurrentItem );
-}
-
-void NavigationTitleBar::SetFixedSizes()
-{
-  mLayout.SetFixedWidth(0, mCurrentStyle->titleLeftMargin);
-  mLayout.SetFixedWidth(2, mCurrentStyle->buttonRightMargin);
-
-  mButtonLayout.SetFixedHeight(2, mCurrentStyle->buttonBottomMargin);
-  mButtonLayout.SetFixedHeight(1, mCurrentStyle->buttonSize);
-
-  mTitleLayout.SetFixedHeight( 3,mCurrentStyle->titleBottomMargin );
-  mTitleLayout.SetFixedHeight( 2,mCurrentStyle->subtitleHeight );
-
-  mTitleIconLayout.SetFixedWidth( 0, mCurrentStyle->titleIconSize );
-  mTitleIconLayout.SetFixedHeight( 1, mCurrentStyle->titleIconSize );
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.h b/dali-toolkit/internal/controls/navigation-frame/navigation-title-bar.h
deleted file mode 100644 (file)
index c8200ed..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_NAVIGATION_TITLE_BAR_H__
-#define __DALI_TOOLKIT_INTERNAL_NAVIGATION_TITLE_BAR_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/navigation-frame/page.h>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
-#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
-#include <dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h>
-#include <dali-toolkit/internal/controls/navigation-frame/navigation-bar.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-/**
- * The title bar locates in the top of the frame where title, subtitle, title icon and other controls could be placed.
- * The title bar contains two groups: the left group includes title icon, title and subtitle (subtitle and title icon are not must);
- * while the right group can have multiple controls placed on, and it is also fine to have no control on it.
- * If the current NavigationOtem provides no control for the bar at all and also has not set a title, the bar is hidden.
- *               +----------------------------------------+
- *               | +-+ Title                   +-+  +-+   |
- *               | +-+ Subtitle                +-+  +-+   |
- *               +----------------------------------------+
- */
-class NavigationTitleBar : public NavigationBar
-{
-public:
-
-  NavigationTitleBar(NavigationControl& naviControl,
-                     Toolkit::NaviTitleBarStyle titleBarStylePortrait,
-                     Toolkit::NaviTitleBarStyle titleBarStyleLandscape );
-
-protected:
-
-  /**
-   * @copydoc Toolkit::Internal::NavigationBar::Update
-   */
-  void Update( Toolkit::Page page );
-
-  /**
-   * @copydoc Toolkit::Internal::NavigationBar::OrientationUpdate
-   */
-  void OrientationUpdate( bool isPortrait );
-
-private:
-  /**
-   * Set the fixed width and height to the cells of the layout
-   * These sizes need to be updated when the orientation is changing.
-   */
-  void SetFixedSizes();
-
-private:
-
-  Toolkit::NaviTitleBarStyle        mStylePortrait;
-  Toolkit::NaviTitleBarStyle        mStyleLandscape;
-  const Toolkit::NaviTitleBarStyle* mCurrentStyle;
-
-  Toolkit::TableView mButtonLayout;
-  Toolkit::TableView mTitleLayout;
-  Toolkit::TableView mTitleIconLayout;
-
-  Toolkit::TextLabel  mTitle;
-  Toolkit::TextLabel  mSubTitle;
-
-};
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-
-#endif /* __DALI_TOOLKIT_INTERNAL_NAVIGATION_TITLE_BAR_H__ */
diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.cpp b/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.cpp
deleted file mode 100644 (file)
index aad04b7..0000000
+++ /dev/null
@@ -1,183 +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 "navigation-tool-bar.h"
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-//ToDo: use const variables instead of magic numbers
-
-NavigationToolBar::NavigationToolBar( NavigationControl& naviControl,
-                                      Toolkit::NaviToolBarStyle toolBarStylePortrait,
-                                      Toolkit::NaviToolBarStyle toolBarStyleLandscape )
-: NavigationBar(naviControl, toolBarStylePortrait, toolBarStyleLandscape),
-  mStylePortrait( toolBarStylePortrait ),
-  mStyleLandscape( toolBarStyleLandscape ),
-  mCurrentStyle( &mStylePortrait),
-  mNumCentralActor( 0 )
-{
-  // tool bar is located at the bottom of the frame
-  mLayout.SetParentOrigin( Dali::ParentOrigin::BOTTOM_CENTER );
-  mLayout.SetAnchorPoint( Dali::AnchorPoint::BOTTOM_CENTER );
-  if(mBackground)
-  {
-    mBackground.SetParentOrigin( Dali::ParentOrigin::BOTTOM_CENTER );
-    mBackground.SetAnchorPoint( Dali::AnchorPoint::BOTTOM_CENTER );
-  }
-
-  // layout of the left part, which contains only one control at CellPosition(1,1)
-  mLeftLayout = Toolkit::TableView::New(3,3);
-  mLayout.AddChild(mLeftLayout, Toolkit::TableView::CellPosition(0,0));
-
-  // layout of the right part, which contains only one control at CellPosition(1,1)
-  mRightLayout = Toolkit::TableView::New(3,3);
-  mLayout.AddChild(mRightLayout, Toolkit::TableView::CellPosition(0,2));
-
-  // layout of the central part, which contains multiples control, will add cells dynamically
-  mCentralLayout = Toolkit::TableView::New(3,2);
-  mLayout.AddChild(mCentralLayout, Toolkit::TableView::CellPosition(0,1));
-
-  SetFixedSizes();
-}
-
-void NavigationToolBar::AddControl(Actor actor, Toolkit::Alignment::Type alignment)
-{
-  switch( alignment )
-  {
-    case Toolkit::Alignment::HorizontalLeft:   // can only have one control on the left side of the bar
-    {
-      mLeftLayout.RemoveChildAt(Toolkit::TableView::CellPosition(1,1));
-      mLeftLayout.AddChild(actor, Toolkit::TableView::CellPosition(1,1));
-      break;
-    }
-    case Toolkit::Alignment::HorizontalRight:  // can only have one control on the right side of the bar
-    {
-      mRightLayout.RemoveChildAt(Toolkit::TableView::CellPosition(1,1));
-      mRightLayout.AddChild(actor, Toolkit::TableView::CellPosition(1,1));
-      break;
-    }
-    case Toolkit::Alignment::HorizontalCenter: // can only have multiple controls on the central part of the bar
-    {
-      // already have button in central part
-      if( mCentralLayout.GetChildAt(Toolkit::TableView::CellPosition(1,1)))
-      {
-        unsigned int columnIndex = mCentralLayout.GetColumns() ;
-        mCentralLayout.InsertColumn( columnIndex-1 );
-        mCentralLayout.SetFixedWidth( columnIndex-1, mCurrentStyle->centralButtonGap );
-
-        mCentralLayout.InsertColumn( columnIndex );
-        mCentralLayout.AddChild(actor, Toolkit::TableView::CellPosition( 1, columnIndex ) );
-      }
-      else // have no button in central part
-      {
-        mCentralLayout.InsertColumn( 1 );
-        mCentralLayout.AddChild(actor, Toolkit::TableView::CellPosition(1,1));
-      }
-      mNumCentralActor++;
-      break;
-    }
-    default:
-      DALI_ASSERT_ALWAYS( false );
-  }
-
-}
-
-void NavigationToolBar::Update( Toolkit::Page page )
-{
-  const Toolkit::Page::ControlOnBarContainer& controls = page.GetControlsOnToolBar();
-
-  // if there is no control to place on the bar, hide the bar
-  if( controls.empty() )
-  {
-    mVisible = false;
-    mLayout.SetVisible(false);
-    mBackground.SetVisible(false);
-    return;
-  }
-
-  //clear central controls
-  unsigned int numColumns = mCentralLayout.GetColumns() ;
-  unsigned int idx = numColumns-2;
-  while(idx > 0)
-  {
-    mCentralLayout.DeleteColumn(idx);
-    idx--;
-  }
-  mNumCentralActor = 0;
-  mLeftLayout.RemoveChildAt(Toolkit::TableView::CellPosition(1,1));
-  mRightLayout.RemoveChildAt(Toolkit::TableView::CellPosition(1,1));
-
-  Toolkit::Page::ControlOnBarContainer::const_iterator iter;
-
-  for( iter = controls.begin(); iter != controls.end(); iter++ )
-  {
-    AddControl( (*iter)->control, (*iter)->alignment );
-  }
-
-  float buttonWidth = static_cast<float>( mCurrentStyle->centralMinimum );
-  int length = mNumCentralActor * (mCurrentStyle->centralMinimum + mCurrentStyle->centralButtonGap) - mCurrentStyle->centralButtonGap;
-  if(  length > mCurrentStyle->centralMaximum ) // shrink the width to make sure all the controls can be fit in
-  {
-    buttonWidth = static_cast<float>( mCurrentStyle->centralMaximum - (mNumCentralActor - 1) * mCurrentStyle->centralButtonGap )
-                / static_cast<float>( mNumCentralActor );
-  }
-  numColumns = mCentralLayout.GetColumns();
-  idx = 1;
-  while(idx < numColumns-1 )
-  {
-    mCentralLayout.SetFixedWidth( idx, buttonWidth );
-    idx += 2;
-  }
-  mVisible = true;
-  mLayout.SetVisible(true);
-  mBackground.SetVisible(true);
-}
-
-void NavigationToolBar::OrientationUpdate( bool isPortrait )
-{
-  mCurrentStyle = isPortrait ? &mStylePortrait : &mStyleLandscape;
-  SetFixedSizes();
-  Update( mCurrentItem );
-}
-
-void NavigationToolBar::SetFixedSizes()
-{
-  mLayout.SetFixedWidth(1, mCurrentStyle->centralMaximum);
-
-  mLeftLayout.SetFixedWidth(0,mCurrentStyle->hotizontalMargin);
-  mLeftLayout.SetFixedWidth(1,mCurrentStyle->sideButtonSize );
-  mLeftLayout.SetFixedHeight(1,mCurrentStyle->sideButtonSize );
-
-  mRightLayout.SetFixedWidth(2,mCurrentStyle->hotizontalMargin);
-  mRightLayout.SetFixedWidth(1,mCurrentStyle->sideButtonSize );
-  mRightLayout.SetFixedHeight(1,mCurrentStyle->sideButtonSize );
-
-  mCentralLayout.SetFixedHeight(1,mCurrentStyle->centralButtonHeight );
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.h b/dali-toolkit/internal/controls/navigation-frame/navigation-tool-bar.h
deleted file mode 100644 (file)
index 80603d8..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_NAVIGATION_TOOL_BAR_H__
-#define __DALI_TOOLKIT_INTERNAL_NAVIGATION_TOOL_BAR_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
-#include <dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h>
-#include <dali-toolkit/internal/controls/navigation-frame/navigation-bar.h>
-#include <dali-toolkit/public-api/controls/navigation-frame/page.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-/**
- * The tool bar locates in the bottom of the frame where other controls (such as PushButton ) could be placed.
- * Controls could be added into three groups: HorizontalLeft, HorizontalCenter or HorizontalRight.
- * The left and right groups can only have one control maximum each, while the central group can have multiple controls.
- * It is also fine to have no control in each group.
- * If the current NavigationOtem provides no control for the bar at all, the bar is hidden.
- *               +----------------------------------------+
- *               | +-+        +-----+  +-----+        +-+ |
- *               | +-+        +-----+  +-----+        +-+ |
- *               +----------------------------------------+
- */
-class NavigationToolBar : public NavigationBar
-{
-public:
-
-  NavigationToolBar(NavigationControl& naviControl,
-                    Toolkit::NaviToolBarStyle toolBarStylePortrait,
-                    Toolkit::NaviToolBarStyle toolBarStyleLandscape );
-
-protected:
-
-  /**
-   * @copydoc Toolkit::Internal::NavigationBar::Update
-   */
-  void Update( Toolkit::Page page );
-
-  /**
-   * @copydoc Toolkit::Internal::NavigationBar::OrientationUpdate
-   */
-  void OrientationUpdate( bool isPortrait );
-
-private:
-
-  /**
-   * Set a control onto the navigation tool bar when the page is on the top.
-   * @param[in] control The control on the navigation tool bar.
-   * @param[in] alignment The position of the control, can be HorizontalLeft/HorizontalRight/HorizontalCenter.
-   */
-  void AddControl(Actor actor, Toolkit::Alignment::Type alignment);
-
-  /**
-   * Set the fixed width and height to the cells of the layout
-   * These sizes need to be updated when the orientation is changing.
-   */
-  void SetFixedSizes();
-
-private:
-
-  Toolkit::NaviToolBarStyle         mStylePortrait;
-  Toolkit::NaviToolBarStyle         mStyleLandscape;
-  const Toolkit::NaviToolBarStyle*  mCurrentStyle;
-
-  Toolkit::TableView                mLeftLayout;
-  Toolkit::TableView                mRightLayout;
-  Toolkit::TableView                mCentralLayout;
-
-  int                               mNumCentralActor;
-};
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif /* __DALI_TOOLKIT_INTERNAL_NAVIGATION_TOOL_BAR_H__ */
diff --git a/dali-toolkit/internal/controls/navigation-frame/page-impl.cpp b/dali-toolkit/internal/controls/navigation-frame/page-impl.cpp
deleted file mode 100644 (file)
index 82fb886..0000000
+++ /dev/null
@@ -1,218 +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 "page-impl.h"
-
-// EXTERNAL INCLUDES
-#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::Page::New();
-}
-
-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( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
-  mTitle(""),
-  mSubTitle("")
-{
-}
-
-Page::~Page()
-{
-  Toolkit::Page::ControlOnBarContainer::const_iterator iter;
-
-  if( !mToolBarControls.empty() )
-  {
-    for( iter = mToolBarControls.begin(); iter != mToolBarControls.end(); iter++ )
-    {
-      delete( *iter );
-    }
-  }
-
-}
-
-Toolkit::Page Page::New()
-{
-  // Create the implementation, temporarily owned by this handle on stack
-  IntrusivePtr< Page > internalpage = new Page();
-
-  // Pass ownership to CustomActor handle
-  Toolkit::Page page( *internalpage );
-
-  // Second-phase init of the implementation
-  // This can only be done after the CustomActor connection has been made...
-  internalpage->Initialize();
-
-  return page;
-
-}
-
-void Page::SetTitle(const std::string& title)
-{
-  mTitle = title;
-}
-
-const std::string& Page::GetTitle() const
-{
-  return mTitle;
-}
-
-void Page::SetSubTitle(const std::string& subtitle)
-{
-  mSubTitle = subtitle;
-}
-
-const std::string& Page::GetSubTitle() const
-{
-  return mSubTitle;
-}
-
-void Page::SetTitleIcon( Actor titleIcon)
-{
-  mTitleIcon = titleIcon;
-}
-
-Actor Page::GetTitleIcon() const
-{
-  return mTitleIcon;
-}
-
-bool Page::AddControlToToolBar(Actor control, Toolkit::Alignment::Type alignment)
-{
-  if( !control || ( alignment!=Toolkit::Alignment::HorizontalLeft
-                 && alignment!=Toolkit::Alignment::HorizontalCenter
-                 && alignment!=Toolkit::Alignment::HorizontalRight ) )
-  {
-    return false;
-  }
-  else
-  {
-    mToolBarControls.push_back(new Toolkit::Page::ControlOnBar(control, alignment));
-    return true;
-  }
-}
-
-const Toolkit::Page::ControlOnBarContainer& Page::GetControlsOnToolBar() const
-{
-  return mToolBarControls;
-}
-
-bool Page::AddControlToTitleBar(Actor control)
-{
-  if( !control )
-  {
-    return false;
-  }
-  else
-  {
-    mTitleBarControls.push_back(control);
-    return true;
-  }
-}
-
-const ActorContainer& Page::GetControlsOnTitleBar() const
-{
-  return mTitleBarControls;
-}
-
-void Page::SetPopupMenu( Toolkit::Popup popupMenu )
-{
-  mPopupMenu = popupMenu;
-}
-
-Toolkit::Popup Page::GetPopupMenu() const
-{
-  return mPopupMenu;
-}
-
-void Page::SetProperty( BaseObject* object, Property::Index index, const Property::Value& value )
-{
-  Toolkit::Page page = Toolkit::Page::DownCast( Dali::BaseHandle( object ) );
-
-  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;
-      }
-    }
-  }
-}
-
-Property::Value Page::GetProperty( BaseObject* object, Property::Index propertyIndex )
-{
-  Property::Value value;
-
-  Toolkit::Page page = Toolkit::Page::DownCast( Dali::BaseHandle( object ) );
-
-  if ( page )
-  {
-    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
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/navigation-frame/page-impl.h b/dali-toolkit/internal/controls/navigation-frame/page-impl.h
deleted file mode 100644 (file)
index 8d2711d..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_PAGE_IMPL_H__
-#define __DALI_TOOLKIT_INTERNAL_PAGE_IMPL_H__
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/navigation-frame/page.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-class Page;
-
-namespace Internal
-{
-
-/**
- * Page object is a custom control which can be pushed into the stack of navigation control.
- * @see Dali::Toolkit::Page for more details
- */
-
-class Page : public Control
-{
-
-public:
-
-  /**
-   * destructor
-   */
-  virtual ~Page();
-
-  /**
-   * Create an initialized Page.
-   * @return A handle to a newly allocated Dali resource
-   */
-  static Toolkit::Page New();
-
-  /**
-   * @copydoc Dali::Toolkit::Page::SetTitle
-   */
-  void SetTitle(const std::string& title);
-
-  /**
-   * @copydoc Dali::Toolkit::Page::GetTitle
-   */
-  const std::string& GetTitle() const;
-
-  /**
-   * @copydoc Dali::Toolkit::Page::SetSubTitle
-   */
-  void SetSubTitle(const std::string& subtitle);
-
-  /**
-   * @copydoc Dali::Toolkit::Page::GetSubTitle
-   */
-  const std::string& GetSubTitle() const;
-
-  /**
-   * @copydoc Dali::Toolkit::Page::SetTitleIcon
-   */
-  void SetTitleIcon( Actor titleIcon);
-
-  /**
-   * @copydoc Dali::Toolkit::Page::GetTitleIcon
-   */
-  Actor GetTitleIcon() const;
-
-  /**
-   * @copydoc Dali::Toolkit::Page::AddControlToToolBar
-   */
-  bool AddControlToToolBar(Actor control, Toolkit::Alignment::Type alignment);
-
-  /**
-   * @copydoc Dali::Toolkit::Page::GetControlsOnToolBar
-   */
-  const Toolkit::Page::ControlOnBarContainer& GetControlsOnToolBar() const;
-
-  /**
-   * @copydoc Dali::Toolkit::Page::AddControlToTitleBar
-   */
-  bool AddControlToTitleBar(Actor control);
-
-  /**
-   * @copydoc Dali::Toolkit::Page::GetControlsOnTitleBar
-   */
-  const ActorContainer& GetControlsOnTitleBar() const;
-
-  /**
-   * @copydoc Dali::Toolkit::Page::SetPopupMenu
-   */
-  void SetPopupMenu( Toolkit::Popup popupMenu );
-
-  /**
-   * @copydoc Dali::Toolkit::Page::GetPopupMenu
-   */
-  Toolkit::Popup GetPopupMenu() const;
-
-  // Properties
-
-  /**
-   * 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.
-   */
-  static void SetProperty( BaseObject* object, Property::Index index, const Property::Value& value );
-
-  /**
-   * 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.
-   */
-  static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
-
-private:
-
-  /**
-   * Constructor.
-   * It initializes the Page members
-   */
-  Page();
-
-private:
-  std::string        mTitle;
-  std::string        mSubTitle;
-  Actor              mTitleIcon;
-  Toolkit::Popup     mPopupMenu;
-
-  ActorContainer                        mTitleBarControls;
-  Toolkit::Page::ControlOnBarContainer  mToolBarControls;
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Toolkit::Internal::Page& GetImpl( Toolkit::Page& page )
-{
-  DALI_ASSERT_ALWAYS( page );
-
-  Dali::RefObject& handle = page.GetImplementation();
-
-  return static_cast<Toolkit::Internal::Page&>( handle );
-}
-
-inline const Toolkit::Internal::Page& GetImpl( const Toolkit::Page& page )
-{
-  DALI_ASSERT_ALWAYS( page );
-
-  const Dali::RefObject& handle = page.GetImplementation();
-
-  return static_cast<const Toolkit::Internal::Page&>( handle );
-}
-
-}// namespace Toolkit
-
-} // namespace Dali
-
-
-#endif /* __DALI_TOOLKIT_INTERNAL_PAGE_IMPL_H__*/
index 8397530..104c334 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 
 namespace Dali
 {
index 6e2ffc7..129301e 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 
 namespace Dali
 {
index 6ede563..0f5400a 100644 (file)
@@ -21,9 +21,9 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/events/hit-test-algorithm.h>
+#include <dali/devel-api/events/hit-test-algorithm.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 // INTERNAL INCLUDES
index d36ab2f..dcc0b39 100644 (file)
@@ -19,9 +19,9 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/devel-api/common/map-wrapper.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/actors/camera-actor.h>
-#include <dali/public-api/common/map-wrapper.h>
 #include <dali/public-api/images/frame-buffer-image.h>
 #include <dali/public-api/render-tasks/render-task.h>
 
index 4ba3a03..b9b9da7 100755 (executable)
 // EXTERNAL INCLUDES
 #include <cstring> // for strcmp
 #include <dali/public-api/adaptor-framework/key.h>
-#include <dali/public-api/adaptor-framework/physical-keyboard.h>
+#include <dali/devel-api/adaptor-framework/physical-keyboard.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/key-event.h>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/integration-api/debug.h>
 
@@ -646,7 +646,7 @@ void Popup::OnRelayout( const Vector2& size, RelayoutContainer& container )
   mBackgroundImage.SetVisible( !( mButtons.empty() && mPopupLayout.GetChildCount() == 0 ) );
 
   // Relayout All buttons
-  if ( !mButtons.empty() )
+  if( !mButtons.empty() )
   {
     // All buttons should be the same size and fill the button area. The button spacing needs to be accounted for as well.
     Vector2 buttonSize( ( ( size.width - mPopupStyle->buttonSpacing * ( mButtons.size() + 1 ) ) / mButtons.size() ),
@@ -654,7 +654,7 @@ void Popup::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
     Vector3 buttonPosition( mPopupStyle->buttonSpacing, 0.0f, 0.0f );
 
-    for ( ActorIter iter = mButtons.begin(), endIter = mButtons.end();
+    for( std::vector< Actor >::iterator iter = mButtons.begin(), endIter = mButtons.end();
           iter != endIter;
           ++iter, buttonPosition.x += mPopupStyle->buttonSpacing + buttonSize.width )
     {
@@ -832,7 +832,7 @@ Actor Popup::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::C
   else
   {
     // Rebuild the focus chain because button or content can be added or removed dynamically
-    ActorContainer focusableActors;
+    std::vector< Actor > focusableActors;
     if( mContent && mContent.IsKeyboardFocusable() )
     {
       focusableActors.push_back(mContent);
@@ -846,7 +846,7 @@ Actor Popup::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::C
       }
     }
 
-    for ( ActorContainer::iterator iter = focusableActors.begin(), end = focusableActors.end(); iter != end; ++iter )
+    for( std::vector< Actor >::iterator iter = focusableActors.begin(), end = focusableActors.end(); iter != end; ++iter )
     {
       if ( currentFocusedActor == *iter )
       {
index 9c67474..2d36e68 100755 (executable)
@@ -321,7 +321,7 @@ private:
   Actor mBottomBg;                        ///< bottom button bar background. ImageActor is replaced with Actor due to hidden image.
   Actor mTailImage;                       ///< Stores the tail image
 
-  ActorContainer mButtons;                ///< Keeps track of the buttons added to this popup.
+  std::vector< Actor > mButtons;          ///< Keeps track of the buttons added to this popup.
   Toolkit::Popup::PopupState mState;      ///< Popup current state.
   Animation mAnimation;                   ///< The animation instance managing state changing.
   bool mAlterAddedChild;                  ///< Flag used to control whether children are reparented or not.
index 2bcca2f..f1573b6 100755 (executable)
 
 // EXTERNAL INCLUDES
 #include <cstring> // for strcmp
+#include <dali/integration-api/debug.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/images/resource-image.h>
 
 // INTERNAL INCLUDES
@@ -44,15 +45,33 @@ const float DEFAULT_PAN_GESTURE_PROCESS_TIME(16.7f); // 16.7 milliseconds, i.e.
 const float DEFAULT_INDICATOR_FIXED_HEIGHT(80.0f);
 
 /**
+ * Indicator size constraint
  * Indicator size depends on both indicator's parent size and the scroll content size
  */
-Vector3 IndicatorSize( const Vector3& parentSize, float contentSize)
+struct IndicatorSizeConstraint
 {
-  float height = contentSize > parentSize.height ?
-                 parentSize.height * ( parentSize.height / contentSize ) :
-                 parentSize.height * ( (parentSize.height - contentSize * 0.5f) / parentSize.height);
-  return Vector3( parentSize.width, std::max(MINIMUM_INDICATOR_HEIGHT, height), parentSize.depth );
-}
+  IndicatorSizeConstraint()
+  {
+  }
+
+  /**
+   * Constraint operator
+   * @param[in] current The current indicator size
+   * @param[in] parentSizeProperty The parent size of scroll indicator.
+   * @return The new scroll indicator size.
+   */
+  void operator()(Vector3& current, const PropertyInputContainer& inputs )
+  {
+    const Vector3& parentSize = inputs[0]->GetVector3();
+    const float contentSize = inputs[1]->GetFloat();
+
+    float height = contentSize > parentSize.height ?
+                   parentSize.height * ( parentSize.height / contentSize ) :
+                   parentSize.height * ( (parentSize.height - contentSize * 0.5f) / parentSize.height);
+
+    current.y = std::max(MINIMUM_INDICATOR_HEIGHT, height);
+  }
+};
 
 /**
  * Indicator position constraint
@@ -64,9 +83,7 @@ struct IndicatorPositionConstraint
    * @param[in] minPosition The minimum limit of scroll position
    * @param[in] maxPosition the maximum limit of scroll position
    */
-  IndicatorPositionConstraint(float minPosition, float maxPosition)
-  : mMinPosition(minPosition),
-    mMaxPosition(maxPosition)
+  IndicatorPositionConstraint()
   {
   }
 
@@ -80,17 +97,14 @@ struct IndicatorPositionConstraint
   {
     const Vector3& indicatorSize = inputs[0]->GetVector3();
     const Vector3& parentSize = inputs[1]->GetVector3();
-    float scrollPosition = inputs[2]->GetFloat();
+    const float scrollPosition = -inputs[2]->GetFloat();
+    const float minScrollPosition = inputs[3]->GetFloat();
+    const float maxScrollPosition = inputs[4]->GetFloat();
 
-    const float domainSize = fabs(mMaxPosition - mMinPosition);
-    float relativePosition = (mMaxPosition - scrollPosition) / domainSize;
-
-    current.y = relativePosition * ( parentSize.height - indicatorSize.height );
+    float relativePosition = std::max( 0.0f, std::min( 1.0f, (scrollPosition - minScrollPosition) / (maxScrollPosition - minScrollPosition) ) );
+    current.y = ( parentSize.height - indicatorSize.height ) * relativePosition;
     current.z = DEFAULT_SLIDER_DEPTH;
   }
-
-  float mMinPosition;  ///< The minimum scroll position
-  float mMaxPosition;  ///< The maximum scroll position
 };
 
 } // unnamed namespace
@@ -115,30 +129,40 @@ BaseHandle Create()
 }
 
 // Setup properties, signals and actions using the type-registry.
-DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollBar, Toolkit::ScrollComponent, Create );
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollBar, Toolkit::Control, Create );
 
-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_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scroll-direction",                  STRING, SCROLL_DIRECTION          )
+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_PROPERTY_REGISTRATION( Toolkit, ScrollBar, "scroll-position-intervals",         ARRAY,  SCROLL_POSITION_INTERVALS )
 
-DALI_SIGNAL_REGISTRATION(   Toolkit, ScrollBar, "scroll-position-notified",        SCROLL_POSITION_NOTIFIED_SIGNAL )
+DALI_SIGNAL_REGISTRATION(   Toolkit, ScrollBar, "pan-finished",                      PAN_FINISHED_SIGNAL )
+DALI_SIGNAL_REGISTRATION(   Toolkit, ScrollBar, "scroll-position-interval-reached",  SCROLL_POSITION_INTERVAL_REACHED_SIGNAL )
 
 DALI_TYPE_REGISTRATION_END()
 
+const char* SCROLL_DIRECTION_NAME[] = {"Vertical", "Horizontal"};
 const char* INDICATOR_HEIGHT_POLICY_NAME[] = {"Variable", "Fixed"};
 
 }
 
-ScrollBar::ScrollBar()
-: mIndicatorShowDuration(DEFAULT_INDICATOR_SHOW_DURATION),
+ScrollBar::ScrollBar(Toolkit::ScrollBar::Direction direction)
+: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+  mDirection(direction),
+  mScrollableObject(Handle()),
+  mPropertyScrollPosition(Property::INVALID_INDEX),
+  mPropertyMinScrollPosition(Property::INVALID_INDEX),
+  mPropertyMaxScrollPosition(Property::INVALID_INDEX),
+  mPropertyScrollContentSize(Property::INVALID_INDEX),
+  mIndicatorShowDuration(DEFAULT_INDICATOR_SHOW_DURATION),
   mIndicatorHideDuration(DEFAULT_INDICATOR_HIDE_DURATION),
   mScrollStart(0.0f),
   mIsPanning(false),
   mCurrentScrollPosition(0.0f),
   mIndicatorHeightPolicy(Toolkit::ScrollBar::Variable),
-  mIndicatorFixedHeight(DEFAULT_INDICATOR_FIXED_HEIGHT),
-  mPropertyIndicatorPosition(Property::INVALID_INDEX)
+  mIndicatorFixedHeight(DEFAULT_INDICATOR_FIXED_HEIGHT)
 {
 }
 
@@ -148,43 +172,77 @@ ScrollBar::~ScrollBar()
 
 void ScrollBar::OnInitialize()
 {
-  Actor self = Self();
-
-  Image indicatorImage = ResourceImage::New( DEFAULT_INDICATOR_IMAGE_PATH );
-  mIndicator = ImageActor::New( indicatorImage );
-  mIndicator.SetNinePatchBorder( DEFAULT_INDICATOR_NINE_PATCH_BORDER );
-  mIndicator.SetStyle( ImageActor::STYLE_NINE_PATCH );
-  mIndicator.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  mIndicator.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  self.Add(mIndicator);
-
-  self.SetDrawMode(DrawMode::OVERLAY);
-
-  // Enable the pan gesture which is attached to the control
-  EnableGestureDetection(Gesture::Type(Gesture::Pan));
+  CreateDefaultIndicatorActor();
 }
 
-void ScrollBar::OnScrollConnectorSet( Toolkit::ScrollConnector oldConnector )
+void ScrollBar::SetScrollPropertySource( Handle handle, Property::Index propertyScrollPosition, Property::Index propertyMinScrollPosition, Property::Index propertyMaxScrollPosition, Property::Index propertyScrollContentSize )
 {
-  if( oldConnector )
+  if( handle
+      && propertyScrollPosition != Property::INVALID_INDEX
+      && propertyMinScrollPosition != Property::INVALID_INDEX
+      && propertyMaxScrollPosition != Property::INVALID_INDEX
+      && propertyScrollContentSize != Property::INVALID_INDEX )
   {
-    oldConnector.DomainChangedSignal().Disconnect(this, &ScrollBar::OnScrollDomainChanged);
+    mScrollableObject = handle;
+    mPropertyScrollPosition = propertyScrollPosition;
+    mPropertyMinScrollPosition = propertyMinScrollPosition;
+    mPropertyMaxScrollPosition = propertyMaxScrollPosition;
+    mPropertyScrollContentSize = propertyScrollContentSize;
 
-    mScrollPositionObject.Reset();
+    ApplyConstraints();
   }
-
-  if( mScrollConnector )
+  else
   {
-    mScrollPositionObject = mScrollConnector.GetScrollPositionObject();
-
-    ApplyConstraints();
-    mScrollConnector.DomainChangedSignal().Connect(this, &ScrollBar::OnScrollDomainChanged);
+    DALI_LOG_ERROR("Can not set empty handle of source object or invalid source property index\n");
   }
 }
 
-void ScrollBar::SetIndicatorImage( Image image )
+void ScrollBar::CreateDefaultIndicatorActor()
+{
+  Image indicatorImage = ResourceImage::New( DEFAULT_INDICATOR_IMAGE_PATH );
+  ImageActor indicator = ImageActor::New( indicatorImage );
+  indicator.SetNinePatchBorder( DEFAULT_INDICATOR_NINE_PATCH_BORDER );
+  indicator.SetStyle( ImageActor::STYLE_NINE_PATCH );
+  indicator.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  indicator.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+
+  SetScrollIndicator(indicator);
+}
+
+void ScrollBar::SetScrollIndicator( Actor indicator )
 {
-  mIndicator.SetImage(image);
+  // Don't allow empty handle
+  if( indicator )
+  {
+    mIndicator = indicator;
+
+    Actor self = Self();
+    self.Add(mIndicator);
+    self.SetDrawMode(DrawMode::OVERLAY);
+
+    if( !mPanGestureDetector )
+    {
+      mPanGestureDetector = PanGestureDetector::New();
+      mPanGestureDetector.DetectedSignal().Connect(this, &ScrollBar::OnPan);
+    }
+
+    mPanGestureDetector.DetachAll();
+    mPanGestureDetector.Attach( mIndicator );
+
+    unsigned int childCount = mIndicator.GetChildCount();
+    for ( unsigned int index = 0; index < childCount; index++ )
+    {
+      Actor child = mIndicator.GetChildAt( index );
+      if ( child )
+      {
+        mPanGestureDetector.Attach( child );
+      }
+    }
+  }
+  else
+  {
+    DALI_LOG_ERROR("Empty handle of scroll indicator\n");
+  }
 }
 
 Actor ScrollBar::GetScrollIndicator()
@@ -194,8 +252,13 @@ Actor ScrollBar::GetScrollIndicator()
 
 void ScrollBar::ApplyConstraints()
 {
-  if( mScrollConnector )
+  if( mScrollableObject )
   {
+    if(mIndicatorSizeConstraint)
+    {
+      mIndicatorSizeConstraint.Remove();
+    }
+
     // Set indicator height according to the indicator's height policy
     if(mIndicatorHeightPolicy == Toolkit::ScrollBar::Fixed)
     {
@@ -203,7 +266,10 @@ void ScrollBar::ApplyConstraints()
     }
     else
     {
-      mIndicator.SetSize( IndicatorSize( Self().GetCurrentSize(), mScrollConnector.GetContentLength() ) );
+      mIndicatorSizeConstraint = Constraint::New<Vector3>( mIndicator, Actor::Property::SIZE, IndicatorSizeConstraint() );
+      mIndicatorSizeConstraint.AddSource( ParentSource( Actor::Property::SIZE ) );
+      mIndicatorSizeConstraint.AddSource( Source( mScrollableObject, mPropertyScrollContentSize ) );
+      mIndicatorSizeConstraint.Apply();
     }
 
     if(mIndicatorPositionConstraint)
@@ -211,37 +277,48 @@ void ScrollBar::ApplyConstraints()
       mIndicatorPositionConstraint.Remove();
     }
 
-    mIndicatorPositionConstraint = Constraint::New<Vector3>( mIndicator, Actor::Property::POSITION, IndicatorPositionConstraint( mScrollConnector.GetMinLimit(), mScrollConnector.GetMaxLimit() ) );
+    mIndicatorPositionConstraint = Constraint::New<Vector3>( mIndicator, Actor::Property::POSITION, IndicatorPositionConstraint() );
     mIndicatorPositionConstraint.AddSource( LocalSource( Actor::Property::SIZE ) );
     mIndicatorPositionConstraint.AddSource( ParentSource( Actor::Property::SIZE ) );
-    mIndicatorPositionConstraint.AddSource( Source( mScrollPositionObject, Toolkit::ScrollConnector::SCROLL_POSITION ) );
+    mIndicatorPositionConstraint.AddSource( Source( mScrollableObject, mPropertyScrollPosition ) );
+    mIndicatorPositionConstraint.AddSource( Source( mScrollableObject, mPropertyMinScrollPosition ) );
+    mIndicatorPositionConstraint.AddSource( Source( mScrollableObject, mPropertyMaxScrollPosition ) );
     mIndicatorPositionConstraint.Apply();
   }
 }
 
-void ScrollBar::SetPositionNotifications( const std::vector<float>& positions )
+void ScrollBar::SetScrollPositionIntervals( const Dali::Vector<float>& positions )
 {
-  if(mScrollPositionObject)
+  mScrollPositionIntervals = positions;
+
+  if( mScrollableObject )
   {
-    if(mPositionNotification)
+    if( mPositionNotification )
     {
-      mScrollPositionObject.RemovePropertyNotification(mPositionNotification);
+      mScrollableObject.RemovePropertyNotification(mPositionNotification);
     }
-    mPositionNotification = mScrollPositionObject.AddPropertyNotification( Toolkit::ScrollConnector::SCROLL_POSITION, VariableStepCondition(positions) );
-    mPositionNotification.NotifySignal().Connect( this, &ScrollBar::OnScrollPositionNotified );
+
+    mPositionNotification = mScrollableObject.AddPropertyNotification( mPropertyScrollPosition, VariableStepCondition(mScrollPositionIntervals) );
+    mPositionNotification.NotifySignal().Connect( this, &ScrollBar::OnScrollPositionIntervalReached );
   }
 }
 
-void ScrollBar::OnScrollPositionNotified(PropertyNotification& source)
+Dali::Vector<float> ScrollBar::GetScrollPositionIntervals() const
 {
-  // Emit the signal to notify the scroll position crossing
-  mScrollPositionNotifiedSignal.Emit(mScrollConnector.GetScrollPosition());
+  return mScrollPositionIntervals;
 }
 
-void ScrollBar::Show()
+void ScrollBar::OnScrollPositionIntervalReached(PropertyNotification& source)
 {
-  Actor self = Self();
+  // Emit the signal to notify the scroll position crossing
+  if(mScrollableObject)
+  {
+    mScrollPositionIntervalReachedSignal.Emit(mScrollableObject.GetProperty<float>(mPropertyScrollPosition));
+  }
+}
 
+void ScrollBar::ShowIndicator()
+{
   // Cancel any animation
   if(mAnimation)
   {
@@ -252,19 +329,17 @@ void ScrollBar::Show()
   if(mIndicatorShowDuration > 0.0f)
   {
     mAnimation = Animation::New( mIndicatorShowDuration );
-    mAnimation.AnimateTo( Property( self, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN );
+    mAnimation.AnimateTo( Property( mIndicator, Actor::Property::COLOR_ALPHA ), 1.0f, AlphaFunction::EASE_IN );
     mAnimation.Play();
   }
   else
   {
-    self.SetOpacity(1.0f);
+    mIndicator.SetOpacity(1.0f);
   }
 }
 
-void ScrollBar::Hide()
+void ScrollBar::HideIndicator()
 {
-  Actor self = Self();
-
   // Cancel any animation
   if(mAnimation)
   {
@@ -275,46 +350,46 @@ void ScrollBar::Hide()
   if(mIndicatorHideDuration > 0.0f)
   {
     mAnimation = Animation::New( mIndicatorHideDuration );
-    mAnimation.AnimateTo( Property( self, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunction::EASE_IN );
+    mAnimation.AnimateTo( Property( mIndicator, Actor::Property::COLOR_ALPHA ), 0.0f, AlphaFunction::EASE_IN );
     mAnimation.Play();
   }
   else
   {
-    self.SetOpacity(0.0f);
+    mIndicator.SetOpacity(0.0f);
   }
 }
 
 bool ScrollBar::OnPanGestureProcessTick()
 {
   // Update the scroll position property.
-  if( mScrollConnector )
+  if( mScrollableObject )
   {
-    mScrollConnector.SetScrollPosition(mCurrentScrollPosition);
+    mScrollableObject.SetProperty(mPropertyScrollPosition, mCurrentScrollPosition);
   }
 
   return true;
 }
 
-void ScrollBar::OnPan( PanGesture gesture )
+void ScrollBar::OnPan( Actor source, const PanGesture& gesture )
 {
-  if(mScrollConnector)
+  if(mScrollableObject)
   {
-    Dali::Toolkit::ItemView itemView = Dali::Toolkit::ItemView::DownCast(Self().GetParent());
+    Dali::Toolkit::ItemView itemView = Dali::Toolkit::ItemView::DownCast(mScrollableObject);
 
     switch(gesture.state)
     {
       case Gesture::Started:
       {
-        if( !mTimer )
+        if( !mPanProcessTimer )
         {
           // Make sure the pan gesture is only being processed once per frame.
-          mTimer = Timer::New( DEFAULT_PAN_GESTURE_PROCESS_TIME );
-          mTimer.TickSignal().Connect( this, &ScrollBar::OnPanGestureProcessTick );
-          mTimer.Start();
+          mPanProcessTimer = Timer::New( DEFAULT_PAN_GESTURE_PROCESS_TIME );
+          mPanProcessTimer.TickSignal().Connect( this, &ScrollBar::OnPanGestureProcessTick );
+          mPanProcessTimer.Start();
         }
 
-        Show();
-        mScrollStart = mScrollConnector.GetScrollPosition();
+        ShowIndicator();
+        mScrollStart = mScrollableObject.GetProperty<float>(mPropertyScrollPosition);
         mGestureDisplacement = Vector3::ZERO;
         mIsPanning = true;
 
@@ -326,9 +401,12 @@ void ScrollBar::OnPan( PanGesture gesture )
         mGestureDisplacement+=delta;
 
         Vector3 span = Self().GetCurrentSize() - mIndicator.GetCurrentSize();
-        const float domainSize = fabs(mScrollConnector.GetMaxLimit() - mScrollConnector.GetMinLimit());
+        float minScrollPosition = mScrollableObject.GetProperty<float>(mPropertyMinScrollPosition);
+        float maxScrollPosition = mScrollableObject.GetProperty<float>(mPropertyMaxScrollPosition);
+        float domainSize = maxScrollPosition - minScrollPosition;
+
         mCurrentScrollPosition = mScrollStart - mGestureDisplacement.y * domainSize / span.y;
-        mCurrentScrollPosition = std::min(mScrollConnector.GetMaxLimit(), std::max(mCurrentScrollPosition, mScrollConnector.GetMinLimit()));
+        mCurrentScrollPosition = 0.0f - std::min(maxScrollPosition, std::max(-mCurrentScrollPosition, minScrollPosition));
 
         break;
       }
@@ -336,12 +414,12 @@ void ScrollBar::OnPan( PanGesture gesture )
       {
         mIsPanning = false;
 
-        if( mTimer )
+        if( mPanProcessTimer )
         {
           // Destroy the timer when pan gesture is finished.
-          mTimer.Stop();
-          mTimer.TickSignal().Disconnect( this, &ScrollBar::OnPanGestureProcessTick );
-          mTimer.Reset();
+          mPanProcessTimer.Stop();
+          mPanProcessTimer.TickSignal().Disconnect( this, &ScrollBar::OnPanGestureProcessTick );
+          mPanProcessTimer.Reset();
         }
 
         if(itemView)
@@ -350,6 +428,8 @@ void ScrollBar::OnPan( PanGesture gesture )
           GetImpl(itemView).DoRefresh(mCurrentScrollPosition, true);
         }
 
+        mPanFinishedSignal.Emit();
+
         break;
       }
     }
@@ -357,23 +437,27 @@ void ScrollBar::OnPan( PanGesture gesture )
     if(itemView)
     {
       // Disable automatic refresh in ItemView during fast scrolling
-      GetImpl(itemView).SetRefreshEnabled(!mIsPanning);
+      GetImpl(itemView).SetRefreshEnabled(true);//!mIsPanning);
     }
   }
 }
 
 void ScrollBar::OnControlSizeSet( const Vector3& size )
 {
-  if(mIndicatorHeightPolicy != Toolkit::ScrollBar::Fixed && mScrollConnector)
+  if(mIndicatorHeightPolicy == Toolkit::ScrollBar::Fixed)
   {
-    mIndicator.SetSize( IndicatorSize( size, mScrollConnector.GetContentLength() ) );
+    mIndicator.SetSize(Self().GetCurrentSize().width, mIndicatorFixedHeight);
   }
 }
 
-void ScrollBar::OnScrollDomainChanged(float minPosition, float maxPosition, float contentSize)
+void ScrollBar::SetScrollDirection( Toolkit::ScrollBar::Direction direction )
 {
-  // Reapply constraints when the scroll domain is changed
-  ApplyConstraints();
+  mDirection = direction;
+}
+
+Toolkit::ScrollBar::Direction ScrollBar::GetScrollDirection() const
+{
+  return mDirection;
 }
 
 void ScrollBar::SetIndicatorHeightPolicy( Toolkit::ScrollBar::IndicatorHeightPolicy policy )
@@ -382,7 +466,7 @@ void ScrollBar::SetIndicatorHeightPolicy( Toolkit::ScrollBar::IndicatorHeightPol
   ApplyConstraints();
 }
 
-Toolkit::ScrollBar::IndicatorHeightPolicy ScrollBar::GetIndicatorHeightPolicy()
+Toolkit::ScrollBar::IndicatorHeightPolicy ScrollBar::GetIndicatorHeightPolicy() const
 {
   return mIndicatorHeightPolicy;
 }
@@ -390,10 +474,14 @@ Toolkit::ScrollBar::IndicatorHeightPolicy ScrollBar::GetIndicatorHeightPolicy()
 void ScrollBar::SetIndicatorFixedHeight( float height )
 {
   mIndicatorFixedHeight = height;
-  ApplyConstraints();
+
+  if(mIndicatorHeightPolicy == Toolkit::ScrollBar::Fixed)
+  {
+    mIndicator.SetSize(Self().GetCurrentSize().width, mIndicatorFixedHeight);
+  }
 }
 
-float ScrollBar::GetIndicatorFixedHeight()
+float ScrollBar::GetIndicatorFixedHeight() const
 {
   return mIndicatorFixedHeight;
 }
@@ -403,7 +491,7 @@ void ScrollBar::SetIndicatorShowDuration( float durationSeconds )
   mIndicatorShowDuration = durationSeconds;
 }
 
-float ScrollBar::GetIndicatorShowDuration()
+float ScrollBar::GetIndicatorShowDuration() const
 {
   return mIndicatorShowDuration;
 }
@@ -413,11 +501,28 @@ void ScrollBar::SetIndicatorHideDuration( float durationSeconds )
   mIndicatorHideDuration = durationSeconds;
 }
 
-float ScrollBar::GetIndicatorHideDuration()
+float ScrollBar::GetIndicatorHideDuration() const
 {
   return mIndicatorHideDuration;
 }
 
+void ScrollBar::OnScrollDirectionPropertySet( Property::Value propertyValue )
+{
+  std::string directionName( propertyValue.Get<std::string>() );
+  if(directionName == "Vertical")
+  {
+    SetScrollDirection(Toolkit::ScrollBar::Vertical);
+  }
+  else if(directionName == "Horizontal")
+  {
+    SetScrollDirection(Toolkit::ScrollBar::Horizontal);
+  }
+  else
+  {
+    DALI_ASSERT_ALWAYS( !"ScrollBar::OnScrollDirectionPropertySet(). Invalid Property value." );
+  }
+}
+
 void ScrollBar::OnIndicatorHeightPolicyPropertySet( Property::Value propertyValue )
 {
   std::string policyName( propertyValue.Get<std::string>() );
@@ -442,9 +547,13 @@ bool ScrollBar::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface*
   bool connected( true );
   Toolkit::ScrollBar scrollBar = Toolkit::ScrollBar::DownCast( handle );
 
-  if( 0 == strcmp( signalName.c_str(), SCROLL_POSITION_NOTIFIED_SIGNAL ) )
+  if( 0 == strcmp( signalName.c_str(), PAN_FINISHED_SIGNAL ) )
   {
-    scrollBar.ScrollPositionNotifiedSignal().Connect( tracker, functor );
+    scrollBar.PanFinishedSignal().Connect( tracker, functor );
+  }
+  else if( 0 == strcmp( signalName.c_str(), SCROLL_POSITION_INTERVAL_REACHED_SIGNAL ) )
+  {
+    scrollBar.ScrollPositionIntervalReachedSignal().Connect( tracker, functor );
   }
   else
   {
@@ -464,6 +573,11 @@ void ScrollBar::SetProperty( BaseObject* object, Property::Index index, const Pr
     ScrollBar& scrollBarImpl( GetImpl( scrollBar ) );
     switch( index )
     {
+      case Toolkit::ScrollBar::Property::SCROLL_DIRECTION:
+      {
+        scrollBarImpl.OnScrollDirectionPropertySet( value );
+        break;
+      }
       case Toolkit::ScrollBar::Property::INDICATOR_HEIGHT_POLICY:
       {
         scrollBarImpl.OnIndicatorHeightPolicyPropertySet( value );
@@ -484,6 +598,20 @@ void ScrollBar::SetProperty( BaseObject* object, Property::Index index, const Pr
         scrollBarImpl.SetIndicatorHideDuration(value.Get<float>());
         break;
       }
+      case Toolkit::ScrollBar::Property::SCROLL_POSITION_INTERVALS:
+      {
+        Dali::Vector<float> positions;
+        size_t positionCount = value.GetSize();
+        positions.Resize( positionCount );
+
+        for( size_t i = 0; i != positionCount; ++i )
+        {
+          value.GetItem(i).Get( positions[i] );
+        }
+
+        scrollBarImpl.SetScrollPositionIntervals(positions);
+        break;
+      }
     }
   }
 }
@@ -499,6 +627,11 @@ Property::Value ScrollBar::GetProperty( BaseObject* object, Property::Index inde
     ScrollBar& scrollBarImpl( GetImpl( scrollBar ) );
     switch( index )
     {
+      case Toolkit::ScrollBar::Property::SCROLL_DIRECTION:
+      {
+        value = SCROLL_DIRECTION_NAME[ scrollBarImpl.GetScrollDirection() ];
+        break;
+      }
       case Toolkit::ScrollBar::Property::INDICATOR_HEIGHT_POLICY:
       {
         value = INDICATOR_HEIGHT_POLICY_NAME[ scrollBarImpl.GetIndicatorHeightPolicy() ];
@@ -519,15 +652,26 @@ Property::Value ScrollBar::GetProperty( BaseObject* object, Property::Index inde
         value = scrollBarImpl.GetIndicatorHideDuration();
         break;
       }
+      case Toolkit::ScrollBar::Property::SCROLL_POSITION_INTERVALS:
+      {
+        Property::Value value;
+        Dali::Vector<float> positions = scrollBarImpl.GetScrollPositionIntervals();
+        size_t positionCount( positions.Size() );
+        for( size_t i( 0 ); i != positionCount; ++i )
+        {
+          value.AppendItem( positions[i] );
+        }
+        break;
+      }
     }
   }
   return value;
 }
 
-Toolkit::ScrollBar ScrollBar::New()
+Toolkit::ScrollBar ScrollBar::New(Toolkit::ScrollBar::Direction direction)
 {
   // Create the implementation, temporarily owned by this handle on stack
-  IntrusivePtr< ScrollBar > impl = new ScrollBar();
+  IntrusivePtr< ScrollBar > impl = new ScrollBar(direction);
 
   // Pass ownership to CustomActor handle
   Toolkit::ScrollBar handle( *impl );
index f6e85dd..8c90758 100755 (executable)
 #include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/animation.h>
+#include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/object/property-notification.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
+#include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
 
 namespace Dali
@@ -47,50 +47,56 @@ typedef IntrusivePtr<ScrollBar> ScrollBarPtr;
  * ScrollBar is a UI component that can be added to the scrollable controls
  * indicating the current scroll position of the scrollable content.
  */
-class ScrollBar : public ScrollComponentImpl
+class ScrollBar : public Control
 {
 
 public:
 
   // Signals
-  typedef Toolkit::ScrollBar::ScrollPositionNotifiedSignalType ScrollPositionNotifiedSignalType;
+  typedef Toolkit::ScrollBar::PanFinishedSignalType PanFinishedSignalType;
+  typedef Toolkit::ScrollBar::ScrollPositionIntervalReachedSignalType ScrollPositionIntervalReachedSignalType;
 
 public:
 
   /**
-   * @copydoc Toolkit::ScrollBar::ScrollBar()
+   * @copydoc Toolkit::ScrollBar::New()
    */
-  ScrollBar();
+  static Toolkit::ScrollBar New(Toolkit::ScrollBar::Direction direction);
 
   /**
-   * @copydoc Toolkit::ScrollBar::~ScrollBar()
+   * @copydoc Toolkit::ScrollBar::SetScrollPropertySource()
    */
-  virtual ~ScrollBar();
+  void SetScrollPropertySource( Handle handle, Property::Index propertyScrollPosition, Property::Index propertyMinScrollPosition, Property::Index propertyMaxScrollPosition, Property::Index propertyScrollContentSize );
 
   /**
-   * @copydoc Toolkit::ScrollBar::New()
+   * @copydoc Toolkit::ScrollBar::SetScrollIndicator()
    */
-  static Toolkit::ScrollBar New();
+  void SetScrollIndicator( Actor indicator );
 
   /**
-   * @copydoc Toolkit::ScrollComponentImpl::OnScrollConnectorSet()
+   * @copydoc Toolkit::ScrollBar::GetScrollIndicator()
    */
-  void OnScrollConnectorSet( Toolkit::ScrollConnector connector );
+  Actor GetScrollIndicator();
 
   /**
-   * @copydoc Toolkit::ScrollBar::SetIndicatorImage()
+   * @copydoc Toolkit::ScrollBar::SetScrollPositionIntervals()
    */
-  void SetIndicatorImage( Image image );
+  void SetScrollPositionIntervals( const Dali::Vector<float>& positions );
 
   /**
-   * @copydoc Toolkit::ScrollBar::GetScrollIndicator()
+   * @copydoc Toolkit::ScrollBar::GetScrollPositionIntervals()
    */
-  Actor GetScrollIndicator();
+  Dali::Vector<float> GetScrollPositionIntervals() const;
 
   /**
-   * @copydoc Toolkit::ScrollBar::SetPositionNotifications()
+   * @copydoc Toolkit::ScrollBar::SetScrollDirection()
    */
-  void SetPositionNotifications( const std::vector<float>& positions );
+  void SetScrollDirection( Toolkit::ScrollBar::Direction direction );
+
+  /**
+   * @copydoc Toolkit::ScrollBar::GetScrollDirection()
+   */
+  Toolkit::ScrollBar::Direction GetScrollDirection() const;
 
   /**
    * @copydoc Toolkit::ScrollBar::SetIndicatorHeightPolicy()
@@ -100,7 +106,7 @@ public:
   /**
    * @copydoc Toolkit::ScrollBar::GetIndicatorHeightPolicy()
    */
-  Toolkit::ScrollBar::IndicatorHeightPolicy GetIndicatorHeightPolicy();
+  Toolkit::ScrollBar::IndicatorHeightPolicy GetIndicatorHeightPolicy() const;
 
   /**
    * @copydoc Toolkit::ScrollBar::SetIndicatorFixedHeight()
@@ -110,7 +116,7 @@ public:
   /**
    * @copydoc Toolkit::ScrollBar::GetIndicatorFixedHeight()
    */
-  float GetIndicatorFixedHeight();
+  float GetIndicatorFixedHeight() const;
 
   /**
    * @copydoc Toolkit::ScrollBar::SetIndicatorShowDuration()
@@ -120,7 +126,7 @@ public:
   /**
    * @copydoc Toolkit::ScrollBar::GetIndicatorShowDuration()
    */
-  float GetIndicatorShowDuration();
+  float GetIndicatorShowDuration() const;
 
   /**
    * @copydoc Toolkit::ScrollBar::SetIndicatorHideDuration()
@@ -130,24 +136,32 @@ public:
   /**
    * @copydoc Toolkit::ScrollBar::GetIndicatorHideDuration()
    */
-  float GetIndicatorHideDuration();
+  float GetIndicatorHideDuration() const;
 
   /**
-   * @copydoc Toolkit::ScrollBar::Show()
+   * @copydoc Toolkit::ScrollBar::ShowIndicator()
    */
-  void Show();
+  void ShowIndicator();
 
   /**
-   * @copydoc Toolkit::ScrollBar::Hide()
+   * @copydoc Toolkit::ScrollBar::HideIndicator()
    */
- void Hide();
+ void HideIndicator();
 
  /**
-  * Signal emitted after the SetScrollDomain() method has been called.
+  * @copydoc Toolkit::ScrollBar::PanFinishedSignal()
   */
ScrollPositionNotifiedSignalType& ScrollPositionNotifiedSignal()
PanFinishedSignalType& PanFinishedSignal()
  {
-   return mScrollPositionNotifiedSignal;
+   return mPanFinishedSignal;
+ }
+
+ /**
+  * @copydoc Toolkit::ScrollBar::ScrollPositionIntervalReachedSignal()
+  */
+ ScrollPositionIntervalReachedSignalType& ScrollPositionIntervalReachedSignal()
+ {
+   return mScrollPositionIntervalReachedSignal;
  }
 
  /**
@@ -187,11 +201,6 @@ private: // from Control
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnPan
-   */
-  virtual void OnPan( PanGesture gesture );
-
-  /**
    * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& size )
    */
   virtual void OnControlSizeSet( const Vector3& size );
@@ -199,25 +208,22 @@ private: // from Control
 private:
 
   /**
-   * Apply constraints for background and indicator.
-   * These constraints are based on values from the scroll connector.
+   * Create the default indicator actor.
    */
-  void ApplyConstraints();
+  void CreateDefaultIndicatorActor();
 
   /**
-   * Callback when the start & end position and size of the scrollable content are changed.
-   * @param[in] minPosition The minimum position.
-   * @param[in] maxPosition The maximum position.
-   * @param[in] contentSize The size of scrollable content.
+   * Apply constraints for background and indicator.
+   * These constraints are based on values from the scroll connector.
    */
-  void OnScrollDomainChanged(float minPosition, float maxPosition, float contentSize);
+  void ApplyConstraints();
 
   /**
    * Callback when the current scroll position of the scrollable content goes above or
-   * below the values specified by SetPositionNotifications().
+   * below the values specified by SetScrollPositionIntervals().
    * @param[in] source the property notification that triggered this callback
    */
-  void OnScrollPositionNotified(PropertyNotification& source);
+  void OnScrollPositionIntervalReached(PropertyNotification& source);
 
   /**
    * Process the pan gesture per predefined timeout until the gesture is finished.
@@ -226,22 +232,56 @@ private:
   bool OnPanGestureProcessTick();
 
   /**
+   * Handle SetProperty for scroll direction.
+   * @param[in] propertyValue The new property value.
+   */
+  void OnScrollDirectionPropertySet(Property::Value propertyValue);
+
+  /**
    * Handle SetProperty for scroll indicator height policy.
    * @param[in] propertyValue The new property value.
    */
   void OnIndicatorHeightPolicyPropertySet(Property::Value propertyValue);
 
+  /**
+   * Pan gesture callback
+   *
+   * @param[in] actor The actor the event is raised for
+   * @param[in] gesture The pan event info
+   */
+  void OnPan(Actor source, const PanGesture& gesture);
+
 private:
 
-  Handle mScrollPositionObject;                               ///< From mScrollConnector
+  /**
+   * Constructor.
+   * It initializes ScrollBar members.
+   */
+  ScrollBar( Toolkit::ScrollBar::Direction direction );
+
+  /**
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~ScrollBar();
 
-  ImageActor mIndicator;                                             ///< Image of scroll indicator.
+private:
+
+  Actor mIndicator;                                                  ///< Image of scroll indicator.
   Animation mAnimation;                                              ///< Scroll indicator Show/Hide Animation.
 
+  Toolkit::ScrollBar::Direction mDirection;                          ///< The direction of scroll bar (vertical or horizontal)
+
+  Handle mScrollableObject;                                          ///< Object to be scrolled
+
+  Property::Index mPropertyScrollPosition;                           ///< Index of scroll position property owned by the object to be scrolled
+  Property::Index mPropertyMinScrollPosition;                        ///< Index of minimum scroll position property owned by the object to be scrolled
+  Property::Index mPropertyMaxScrollPosition;                        ///< Index of maximum scroll position property owned by the object to be scrolled
+  Property::Index mPropertyScrollContentSize;                        ///< Index of scroll content size property owned by the object to be scrolled
+
   float mIndicatorShowDuration;                                     ///< The duration of scroll indicator show animation
   float mIndicatorHideDuration;                                     ///< The duration of scroll indicator hide animation
 
-  float mScrollStart;                                               ///< Scroll Start position (start of drag)
+  float mScrollStart;                                                ///< Scroll Start position (start of drag)
   Vector3 mGestureDisplacement;                                      ///< Gesture Displacement.
 
   bool mIsPanning;                                                  ///< Whether the scroll bar is being panned.
@@ -250,15 +290,20 @@ private:
   Toolkit::ScrollBar::IndicatorHeightPolicy mIndicatorHeightPolicy;  ///< The height policy of scroll indicator (variable or fixed)
   float mIndicatorFixedHeight;                                      ///< The fixed height of scroll indicator
 
-  Timer mTimer;                                                      ///< The timer to process the pan gesture after the gesture is started.
+  PanGestureDetector mPanGestureDetector;                            ///< The pan gesture detector for scroll indicator
 
-  Property::Index mPropertyIndicatorPosition;                        ///< Indicatore Position ("indicator-position")
+  Timer mContractDelayTimer;                                         ///< Timer guarantee contract delay time.
+  Timer mPanProcessTimer;                                            ///< The timer to process the pan gesture after the gesture is started.
 
+  Dali::Vector<float> mScrollPositionIntervals;                     ///< List of values to receive notification for when the current scroll position goes above or below them
   PropertyNotification mPositionNotification;                        ///< Stores the property notification used for scroll position changes
 
-  ScrollPositionNotifiedSignalType mScrollPositionNotifiedSignal;
+  PanFinishedSignalType mPanFinishedSignal;
+  ScrollPositionIntervalReachedSignalType mScrollPositionIntervalReachedSignal;
 
   Constraint mIndicatorPositionConstraint;
+  Constraint mIndicatorSizeConstraint;
+  Constraint mScrollPositionInCurrentAxisConstraint;
 };
 
 } // namespace Internal
diff --git a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp
deleted file mode 100755 (executable)
index 933add8..0000000
+++ /dev/null
@@ -1,604 +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/scroll-component/scroll-bar-internal-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/object/property-input.h>
-#include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/images/resource-image.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/enums.h>
-
-using namespace Dali;
-
-namespace
-{
-/**
- * Squares input value
- * i.e. y = x*x
- * @param[in] x Input value to be squared
- * @return Result (x*x)
- */
-template<typename T>
-inline T Square(T x)
-{
-  return x*x;
-}
-
-const char* BAR_TAB_IMAGE_PATH = DALI_IMAGE_DIR "popup_scroll.png";
-const Vector4 BAR_TAB_NINE_PATCH_BORDER(0.0f, 12.0f, 14.0f, 14.0f);
-const Vector3 BAR_TAB_SIZE(18.0f, 72.0f, 0.0f);
-const Vector3 BAR_TAB_OFFSET_V(-18.0f, 0.0f, 0.1f);
-const Vector3 BAR_TAB_OFFSET_H(0.0f, -18.0f, 0.1f);
-const float BAR_CONTRACT_DELAY(0.8f);
-const float BAR_SHOW_TIME(0.4f);
-const float BAR_HIDE_TIME(0.5f);
-const int SECOND_UNIT(1000);
-
-/**
- * ScrollBarInternal Visibility Constraint
- * Returns whether scroll bar is visible
- */
-void ScrollBarInternalVisibilityConstraint( bool& current, const PropertyInputContainer& inputs )
-{
-  current = inputs[0]->GetBoolean();
-}
-
-/**
- * ScrollBarInternal Size Constraint
- * Resize ScrollBarInternal Size depends on both ScrollSize and DomainSize
- */
-struct ScrollBarInternalSizeConstraint
-{
-  /**
-   * @param[in] vertical Whether this constraint controls a vertical scrollbar (true)
-   * or a horizontal one (false)
-   */
-  ScrollBarInternalSizeConstraint(bool vertical)
-  : mVertical(vertical)
-  {
-  }
-
-  /**
-   * Constraint operator
-   * @param[in,out] current The current ScrollBarInternal size
-   * @param[in] inputs Contains the container's minimum position, its maximum position, its scroll direction & its size of viewport.
-   * @return The new ScrollBarInternal position is returned.
-   */
-  void operator()( Vector3& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& min = inputs[0]->GetVector3();
-    const Vector3& max = inputs[1]->GetVector3();
-    const Vector3& scrollDirection = inputs[2]->GetVector3();
-    const Toolkit::ControlOrientation::Type& orientation = static_cast<Toolkit::ControlOrientation::Type>(scrollDirection.z);
-    const Vector3& size = inputs[3]->GetVector3();
-    const Vector3 domainSize = max - min;
-
-    if (mVertical && Toolkit::IsVertical(orientation))
-    {
-      current.height = fabsf(domainSize.height) > size.height ? size.height * ( size.height / fabsf(domainSize.height) ) : size.height * ( (size.height - fabsf(domainSize.height * 0.5f)) / size.height);
-    }
-    else
-    {
-      current.height = fabsf(domainSize.height) > size.width ? size.width * ( size.width / fabsf(domainSize.height) ) : size.width * ( (size.width - fabsf(domainSize.height * 0.5f)) / size.width);
-    }
-  }
-
-  bool mVertical;  ///< Whether vertical or horizontal
-};
-
-/**
- * ScrollBarInternal rotation Constraint
- * Rotate ScrollBarInternal depends on the scroll direction
- */
-struct ScrollBarInternalRotationConstraint
-{
-  /**
-   * @param[in] vertical Whether this constraint controls a vertical scrollbar (true)
-   * or a horizontal one (false)
-   */
-  ScrollBarInternalRotationConstraint(bool vertical)
-  : mVertical(vertical)
-  {
-  }
-
-  /**
-   * Constraint operator
-   * @param[in,out] current The current ScrollBarInternal rotation
-   * @param[in] scrollDirectionProperty The container's scroll direction.
-   * @return The new ScrollBarInternal rotation is returned.
-   */
-  void operator()( Quaternion& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& scrollDirection = inputs[0]->GetVector3();
-    const Toolkit::ControlOrientation::Type& orientation = static_cast<Toolkit::ControlOrientation::Type>(scrollDirection.z);
-
-    if( (mVertical && Toolkit::IsVertical(orientation)) || (!mVertical && Toolkit::IsHorizontal(orientation)) )
-    {
-      current = Quaternion( Radian( 0.0f ), Vector3::ZAXIS );
-    }
-    else
-    {
-      current = Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS);
-    }
-  }
-
-  bool mVertical;  ///< Whether vertical or horizontal
-};
-
-/**
- * ScrollBarInternal Position Constraint
- * Positions the scroll bar to reflect the current scroll position
- * within the domain.
- */
-struct ScrollBarInternalPositionConstraint
-{
-  /**
-   * @param[in] vertical Whether this constraint controls a vertical scrollbar (true)
-   * or a horizontal one (false)
-   * @param[in] wrap Whether to base scrollbar on original position or wrapped position
-   */
-  ScrollBarInternalPositionConstraint(bool vertical, bool wrap = false)
-  : mVertical(vertical),
-    mWrap(wrap)
-  {
-  }
-
-  /**
-   * Constraint operator
-   * @param[in] finalPosition The current ScrollBarInternal position
-   * @param[in] inputs Contains:
-   *                    The ScrollBarInternal size,
-   *                    The container's relative position (from 0.0 -> 1.0 in each axis),
-   *                    The container's minimum position,
-   *                    The container's maximum position,
-   *                    The container's scroll direction,
-   *                    The container's size of viewport.
-   * @return The new ScrollBarInternal position is returned.
-   */
-  void operator()( Vector3& finalPosition, const PropertyInputContainer& inputs )
-  {
-    const Vector3& barSize = inputs[0]->GetVector3();
-    const Vector3& relativePosition = inputs[1]->GetVector3();
-    const Vector3& min = inputs[2]->GetVector3();
-    const Vector3& max = inputs[3]->GetVector3();
-    const Vector3& scrollDirection = inputs[4]->GetVector3();
-    const Vector3& size = inputs[5]->GetVector3();
-    const Toolkit::ControlOrientation::Type& orientation = static_cast<Toolkit::ControlOrientation::Type>(scrollDirection.z);
-
-    Vector3 domainSize = max - min;
-    domainSize.x = fabsf(domainSize.x);
-    domainSize.y = fabsf(domainSize.y);
-    domainSize -= size;
-
-    Vector3 mask;            // Mask movement aspect of scroll bar
-    Vector3 relativeOffset;  // base position of scroll bar in relation to the container
-    Vector3 absoluteOffset;  // absolute offset position of scroll bar
-
-    if(mVertical)
-    {
-      switch(orientation)
-      {
-        case Toolkit::ControlOrientation::Up:
-        {
-          mask = Vector3::YAXIS;
-          relativeOffset = (scrollDirection.y < 0.0f && relativePosition.y <= 0.0f) ? Vector3(1.0f, 1.0f, 0.0f) : Vector3(1.0f, 0.0f, 0.0f); // Right side of stage.
-          absoluteOffset = (scrollDirection.y < 0.0f && relativePosition.y <= 0.0f) ? BAR_TAB_OFFSET_V + Vector3( barSize.width * 0.5f, -barSize.height * 0.5f, 1.0f ) : BAR_TAB_OFFSET_V + Vector3( barSize.width * 0.5f, barSize.height * 0.5f, 1.0f );
-          break;
-        }
-        case Toolkit::ControlOrientation::Left:
-        {
-          mask = Vector3::XAXIS;
-          relativeOffset = (scrollDirection.x <= 0.0f && relativePosition.y <= 0.0f) ? Vector3(1.0f, 0.0f, 0.0f) : Vector3(0.0f, 0.0f, 0.0f); // Bottom side of stage.
-          absoluteOffset = (scrollDirection.x <= 0.0f && relativePosition.y <= 0.0f) ? Vector3( -barSize.height * 0.5f, barSize.width * 0.5f, 1.0f ) : Vector3( barSize.height * 0.5f, barSize.width * 0.5f, 1.0f );
-          break;
-        }
-        case Toolkit::ControlOrientation::Down:
-        {
-          mask = Vector3::YAXIS;
-          relativeOffset = (scrollDirection.y <= 0.0f && relativePosition.y <= 0.0f) ? Vector3(0.0f, 1.0f, 0.0f) : Vector3(0.0f, 0.0f, 0.0f); // Left side of stage.
-          absoluteOffset = (scrollDirection.y <= 0.0f && relativePosition.y <= 0.0f) ? Vector3( barSize.width * 0.5f, -barSize.height * 0.5f, 1.0f ) : Vector3( barSize.width * 0.5f, barSize.height * 0.5f, 1.0f );
-          break;
-        }
-        case Toolkit::ControlOrientation::Right:
-        {
-          mask = Vector3::XAXIS;
-          relativeOffset = (scrollDirection.x <= 0.0f && relativePosition.y <= 0.0f) ? Vector3(1.0f, 1.0f, 0.0f) : Vector3(0.0f, 1.0f, 0.0f); // Up side of stage.
-          absoluteOffset = (scrollDirection.x <= 0.0f && relativePosition.y <= 0.0f) ? Vector3( -barSize.height * 0.5f, -barSize.width * 0.5f, 1.0f ) : Vector3( barSize.height * 0.5f, -barSize.width * 0.5f, 1.0f );
-          break;
-        }
-      }
-    }
-    else
-    {
-      mask = Vector3::XAXIS;
-      relativeOffset = Vector3(0.0f, 1.0f, 0.0f); // Bottom side of stage.
-      absoluteOffset = BAR_TAB_OFFSET_H + Vector3( barSize.height * 0.5f, barSize.width * 0.5f, 1.0f );
-    }
-
-    Vector3 maskedRelativePosition = Toolkit::IsVertical(orientation) ? Vector3(relativePosition.x * (size.x-barSize.y), relativePosition.y * (size.y-barSize.y), 0.0f) * mask
-                                   : Vector3(relativePosition.y * (size.x-barSize.y), relativePosition.x * (size.y-barSize.y), 0.0f) * mask;
-
-    finalPosition = relativeOffset * size + absoluteOffset + maskedRelativePosition;
-
-    // If Wrapped Slider, then position 1 domain either before or after current slider.
-    if(mWrap)
-    {
-      if(finalPosition.x < 0.5f)
-      {
-        finalPosition.x += size.x;
-      }
-      else
-      {
-        finalPosition.x -= size.x;
-      }
-
-      if(finalPosition.y < 0.5f)
-      {
-        finalPosition.y += size.y;
-      }
-      else
-      {
-        finalPosition.y -= size.y;
-      }
-    }
-  }
-
-  bool mVertical;           ///< Whether vertical or horizontal.
-  bool mWrap;               ///< Whether to wrap this position.
-};
-
-/**
- * ScrollBarInternal HitSize Constraint
- * Resizes HitArea to size of the container.
- */
-struct ScrollBarInternalHitSizeConstraint
-{
-  /**
-   * @param[in] vertical Whether this constraint controls a vertical scrollbar (true)
-   * or a horizontal one (false)
-   * @param[in] thickness The thickness of the scrollbar
-   */
-  ScrollBarInternalHitSizeConstraint(bool vertical,
-                             float thickness)
-  : mVertical(vertical),
-    mThickness(thickness)
-  {
-  }
-
-  /**
-   * Constraint operator
-   * @param[in] current The current HitSize
-   * @param[in] inputs Contains the container's scroll direction and size of its viewport.
-   * @return The new ScrollBarInternal Hit Area size is returned.
-   */
-  void operator()( Vector3& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& scrollDirection = inputs[0]->GetVector3();
-    const Toolkit::ControlOrientation::Type& orientation = static_cast<Toolkit::ControlOrientation::Type>(scrollDirection.z);
-    const Vector3& size = inputs[1]->GetVector3();
-
-    Vector3 mask;            // Mask size aspect of hit area.
-    Vector3 offset;          // Add Offset size.
-
-    if( (mVertical && Toolkit::IsVertical(orientation)) || (!mVertical && Toolkit::IsHorizontal(orientation)) )
-    {
-      mask = Vector3::YAXIS;
-      offset = Vector3::XAXIS * mThickness;
-    }
-    else
-    {
-      mask = Vector3::XAXIS;
-      offset = Vector3::YAXIS * mThickness;
-    }
-
-    current = size * mask + offset;
-  }
-
-  bool mVertical;           ///< Whether vertical or horizontal.
-  float mThickness;          ///< Thickness of the scroll bar
-};
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace
-{
-
-using namespace Dali;
-
-BaseHandle Create()
-{
-  return BaseHandle();
-}
-
-DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollBarInternal, Toolkit::ScrollComponent, Create )
-DALI_TYPE_REGISTRATION_END()
-
-}
-
-ScrollBarInternal::ScrollBarInternal(Toolkit::Scrollable& container, bool vertical)
-: mContainer(static_cast<Toolkit::Internal::Scrollable&>(container.GetImplementation())),
-  mVertical(vertical),
-  mAxisMask(vertical ? Vector3::YAXIS : Vector3::XAXIS),
-  mDragMode(false)
-{
-  Image sliderImage = ResourceImage::New( BAR_TAB_IMAGE_PATH );
-
-  mSlider = ImageActor::New( sliderImage );
-  mSlider.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  mSlider.SetAnchorPoint( AnchorPoint::CENTER );
-  mSlider.SetSize( BAR_TAB_SIZE );
-  mSlider.SetStyle( ImageActor::STYLE_NINE_PATCH );
-  mSlider.SetNinePatchBorder( BAR_TAB_NINE_PATCH_BORDER );
-
-  // A duplicate Slider should appear 1 domain away from the original Slider
-  mSliderWrap = ImageActor::New( sliderImage );
-  mSliderWrap.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  mSliderWrap.SetAnchorPoint( AnchorPoint::CENTER );
-  mSliderWrap.SetSize( BAR_TAB_SIZE );
-  mSliderWrap.SetStyle( ImageActor::STYLE_NINE_PATCH );
-  mSliderWrap.SetNinePatchBorder( BAR_TAB_NINE_PATCH_BORDER );
-
-  // target the container to observe for scrolling
-  Actor target = mContainer.Self();
-  Constraint constraint = Constraint::New<bool>( mSlider, Actor::Property::VISIBLE, ScrollBarInternalVisibilityConstraint );
-  constraint.AddSource( Source( target, vertical ? Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL : Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL ) );
-  constraint.Apply();
-
-  constraint = constraint.Clone( mSliderWrap );
-  constraint.Apply();
-
-  constraint = Constraint::New<Vector3>( mSlider, Actor::Property::SIZE, ScrollBarInternalSizeConstraint( vertical ) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ) );
-  constraint.AddSource( Source( target, Actor::Property::SIZE ) );
-  constraint.Apply();
-
-  constraint = constraint.Clone( mSliderWrap );
-  constraint.Apply();
-
-  constraint = Constraint::New<Quaternion>( mSlider, Actor::Property::ORIENTATION, ScrollBarInternalRotationConstraint( vertical ) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ) );
-  constraint.Apply();
-
-  constraint = constraint.Clone( mSliderWrap );
-  constraint.Apply();
-
-  constraint = Constraint::New<Vector3>( mSlider, Actor::Property::POSITION, ScrollBarInternalPositionConstraint(vertical) );
-  constraint.AddSource( Source( mSlider, Actor::Property::SIZE) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION ) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ) );
-  constraint.AddSource( Source( target, Actor::Property::SIZE ) );
-  constraint.Apply();
-
-  constraint = Constraint::New<Vector3>( mSliderWrap, Actor::Property::POSITION, ScrollBarInternalPositionConstraint(vertical, true) );
-  constraint.AddSource( Source( mSlider, Actor::Property::SIZE) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION ) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ) );
-  constraint.AddSource( Source( target, Actor::Property::SIZE ) );
-  constraint.Apply();
-
-  // Add Sliders to internal Actor, to avoid mixing up with regular
-  // Actors added by user.
-  mContainer.AddOverlay( mSlider );
-  mContainer.AddOverlay( mSliderWrap );
-  mContainer.ScrollStartedSignal().Connect( this, &ScrollBarInternal::OnStarted );
-  mContainer.ScrollCompletedSignal().Connect( this, &ScrollBarInternal::OnCompleted );
-
-  // Hit Area for dragging slider /////////////////////////////////////////////
-  mHitArea = Actor::New();
-  mHitArea.SetPosition(0.0f, 0.0f, 0.2f);
-
-  mContainer.AddOverlay( mHitArea );
-  constraint = Constraint::New<Vector3>( mHitArea, Actor::Property::SIZE, ScrollBarInternalHitSizeConstraint(vertical, BAR_TAB_SIZE.width) );
-  constraint.AddSource( Source( target, Toolkit::Scrollable::Property::SCROLL_DIRECTION ) );
-  constraint.AddSource( Source( target, Actor::Property::SIZE ) );
-  constraint.Apply();
-
-  if(vertical)
-  {
-    mHitArea.SetParentOrigin(ParentOrigin::CENTER_RIGHT);
-    mHitArea.SetAnchorPoint(AnchorPoint::CENTER_RIGHT);
-  }
-  else
-  {
-    mHitArea.SetParentOrigin(ParentOrigin::BOTTOM_CENTER);
-    mHitArea.SetAnchorPoint(AnchorPoint::BOTTOM_CENTER);
-  }
-
-  WaitingContractDelay();
-}
-
-ScrollBarInternal::~ScrollBarInternal()
-{
-  DestructTimer();
-}
-
-void ScrollBarInternal::OnInitialize()
-{
-  EnableGestureDetection(Gesture::Type(Gesture::Pan));
-}
-
-void ScrollBarInternal::OnDisconnect()
-{
-  // Disconnect all connected callback functions.
-  mContainer.RemoveOverlay( mSlider );
-  mContainer.RemoveOverlay( mSliderWrap );
-}
-
-void ScrollBarInternal::OnPanGesture(Actor actor, PanGesture gesture)
-{
-  switch(gesture.state)
-  {
-    case Gesture::Started:
-    {
-      mDragMode = true;
-      Show();
-      mScrollStart = mContainer.GetCurrentScrollPosition();
-      mGestureDisplacement = Vector3::ZERO;
-      break;
-    }
-    case Gesture::Continuing:
-    {
-      Vector3 delta(gesture.displacement.x, gesture.displacement.y, 0.0f);
-      mGestureDisplacement+=delta;
-
-      Vector3 size = mContainer.Self().GetCurrentSize();
-      Vector3 span = size - Vector3(BAR_TAB_SIZE.y, BAR_TAB_SIZE.y, 1.0f);
-      Vector3 domainSize = mContainer.GetDomainSize();
-
-      Vector3 position = mScrollStart + mGestureDisplacement * mAxisMask * domainSize / span;
-      mContainer.ScrollTo(position, 0.0f);
-      break;
-    }
-    default:
-    {
-      mDragMode = false;
-      break;
-    }
-  }
-}
-
-void ScrollBarInternal::OnStarted(const Vector3& position)
-{
-  // TODO: Need to disable this for the scrollbar which isn't being scrolled.
-  if(!mDragMode)
-  {
-    mDragMode = true;
-    Show();
-  }
-}
-
-void ScrollBarInternal::OnCompleted(const Vector3& position)
-{
-  if( mDragMode )
-  {
-    mDragMode = false;
-
-    WaitingContractDelay();
-  }
-}
-
-bool ScrollBarInternal::OnContractDelayExpired()
-{
-  if ( !mDragMode )
-  {
-    Hide();
-  }
-
-  DestructTimer();
-
-  return true;
-}
-
-void ScrollBarInternal::Show()
-{
-  // Cancel any animation
-  if(mAnimation)
-  {
-    mAnimation.Clear();
-    mAnimation.Reset();
-  }
-
-  mAnimation = Animation::New( BAR_SHOW_TIME );
-  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();
-}
-
-void ScrollBarInternal::Hide()
-{
-  // Cancel any animation
-  if(mAnimation)
-  {
-    mAnimation.Clear();
-    mAnimation.Reset();
-  }
-
-  mAnimation = Animation::New( BAR_HIDE_TIME );
-  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();
-}
-
-void ScrollBarInternal::CreateTimer()
-{
-  if( !mTimer )
-  {
-    // Create timer for contract delay
-    mTimer = Timer::New( BAR_CONTRACT_DELAY * SECOND_UNIT );
-    mTimer.TickSignal().Connect( this, &ScrollBarInternal::OnContractDelayExpired );
-  }
-}
-
-void ScrollBarInternal::DestructTimer()
-{
-  if( mTimer )
-  {
-    mTimer.Stop();
-    mTimer.TickSignal().Disconnect( this, &ScrollBarInternal::OnContractDelayExpired );
-    mTimer.Reset();
-  }
-}
-
-void ScrollBarInternal::WaitingContractDelay()
-{
-  CreateTimer();
-  mTimer.Start();
-}
-
-Toolkit::ScrollBarInternal ScrollBarInternal::New(Toolkit::Scrollable& container, bool vertical)
-{
-  // Create the implementation, temporarily owned by this handle on stack
-  IntrusivePtr< ScrollBarInternal > impl = new ScrollBarInternal( container, vertical );
-
-  // Pass ownership to CustomActor handle
-  Toolkit::ScrollBarInternal handle( *impl );
-
-  // Second-phase init of the implementation
-  // This can only be done after the CustomActor connection has been made...
-  impl->Initialize();
-
-  return handle;
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.h b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.h
deleted file mode 100755 (executable)
index 790f596..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_BAR_INTERNAL_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_BAR_INTERNAL_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/adaptor-framework/timer.h>
-#include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/animation/animation.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
-#include <dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-/**
- * ScrollBarInternal is a UI component that can be added to the sides of the ScrollView
- * indicating the current scroll position within the domain.
- */
-class ScrollBarInternal : public ScrollComponentImpl
-{
-
-public:
-
-  /**
-   * ScrollBarInternal constructor.
-   * @param[in] container Reference to the container of scroll bar
-   * @param[in] vertical Whether ScrollBarInternal should be oriented vertically (true)
-   * or horizontally (false)
-   */
-  ScrollBarInternal(Toolkit::Scrollable& container, bool vertical);
-
-  /**
-   * Virtual destructor
-   */
-  virtual ~ScrollBarInternal();
-
-  /**
-   * Create an initialized ScrollBarInternal
-   * @param[in] container Reference to the container of scroll bar
-   * @param[in] vertical Whether ScrollBarInternal should be oriented vertically (true)
-   * or horizontally (false)
-   * @return A pointer to the created ScrollBarInternal.
-   */
-  static Toolkit::ScrollBarInternal New(Toolkit::Scrollable& container, bool vertical);
-
-  /**
-   * Show ScrollBarInternal
-   */
-  void Show();
-
-  /**
-   * Hide ScrollBarInternal
-   */
-  void Hide();
-
-private:
-
-  /**
-   * @copydoc Toolkit::Control::OnInitialize()
-   */
-  virtual void OnInitialize();
-
-  /**
-   * @copydoc Toolkit::ScrollComponent::OnDisconnect()
-   */
-  virtual void OnDisconnect();
-
-  /**
-   * Called when scrollbar is dragged.
-   * @param[in] actor Actor under touch
-   * @param[in] gesture The pan gesture data.
-   */
-  void OnPanGesture(Actor actor, PanGesture gesture);
-
-  /**
-   * Called when scrolling starts (scroll bars should extend out)
-   * @param[in] position current scroll position.
-   */
-  void OnStarted(const Vector3& position);
-
-  /**
-   * Called when scrolling ends (scroll bars should contract)
-   * @param[in] position current scroll position.
-   */
-  void OnCompleted(const Vector3& position);
-
-  /**
-   * Called when timer is finished. This time guarantee contract animation time.
-   * @return Timer is used or not.
-   */
-  bool OnContractDelayExpired(void);
-
-  /**
-   * Create timer. This timer used for wating contract.
-   */
-  void CreateTimer();
-
-  /**
-   * Destruct timer.
-   */
-  void DestructTimer();
-
-  /**
-   * Wait ContractTime
-   */
-  void WaitingContractDelay();
-
-private:
-  Scrollable& mContainer;                                 ///< Container of scroll bar
-  ImageActor mSlider;                                     ///< Scroll Slider.
-  ImageActor mSliderWrap;                                 ///< Scroll Slider (wrapped view).
-  Actor mHitArea;                                         ///< Hit Area for dragging scroll slider.
-  PanGestureDetector mPanGesture;                         ///< Pan Gesture detector for dragging scrollbar.
-  Animation mAnimation;                                   ///< Scroll Contract/Expand Animation.
-  bool mVertical;                                         ///< Scroll Axis (Vertical or Horizontal)
-  Vector3 mAxisMask;                                      ///< Scroll Axis mask (Vector3::YAXIS for vert. or Vector3::XAXIS for horiz.)
-  Vector3 mScrollStart;                                   ///< Scroll Start position (start of drag)
-  Vector3 mGestureDisplacement;                           ///< Gesture Displacement.
-  bool mDragMode;                                         ///< Flag indicating whether currently dragging or not.
-  Timer mTimer;                                           ///< Timer guarantee contract delay time.
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Toolkit::Internal::ScrollBarInternal& GetImpl(Toolkit::ScrollBarInternal& scrollBar)
-{
-  DALI_ASSERT_ALWAYS(scrollBar);
-
-  Dali::RefObject& handle = scrollBar.GetImplementation();
-
-  return static_cast<Toolkit::Internal::ScrollBarInternal&>(handle);
-}
-
-inline const Toolkit::Internal::ScrollBarInternal& GetImpl(const Toolkit::ScrollBarInternal& scrollBar)
-{
-  DALI_ASSERT_ALWAYS(scrollBar);
-
-  const Dali::RefObject& handle = scrollBar.GetImplementation();
-
-  return static_cast<const Toolkit::Internal::ScrollBarInternal&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_BAR_INTERNAL_H__
diff --git a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.cpp b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.cpp
deleted file mode 100755 (executable)
index 4728f81..0000000
+++ /dev/null
@@ -1,83 +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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.h>
-#include <dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-ScrollBarInternal::ScrollBarInternal()
-{
-}
-
-ScrollBarInternal::ScrollBarInternal(Internal::ScrollBarInternal& implementation)
-: ScrollComponent(implementation)
-{
-}
-
-ScrollBarInternal::ScrollBarInternal( Dali::Internal::CustomActor* internal )
-: ScrollComponent( internal )
-{
-  VerifyCustomActorPointer<Internal::ScrollBarInternal>(internal);
-}
-
-ScrollBarInternal::ScrollBarInternal( const ScrollBarInternal& scrollBar )
-: ScrollComponent(scrollBar)
-{
-}
-
-ScrollBarInternal& ScrollBarInternal::operator=( const ScrollBarInternal& scrollBar )
-{
-  if( &scrollBar != this )
-  {
-    Control::operator=( scrollBar );
-  }
-  return *this;
-}
-
-ScrollBarInternal ScrollBarInternal::New(Scrollable& container, bool vertical)
-{
-  return Internal::ScrollBarInternal::New(container, vertical);
-}
-
-ScrollBarInternal ScrollBarInternal::DownCast( BaseHandle handle )
-{
-  return Control::DownCast<ScrollBarInternal, Internal::ScrollBarInternal>(handle);
-}
-
-ScrollBarInternal::~ScrollBarInternal()
-{
-}
-
-void ScrollBarInternal::Show()
-{
-  GetImpl(*this).Show();
-}
-
-void ScrollBarInternal::Hide()
-{
-  GetImpl(*this).Hide();
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.h b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal.h
deleted file mode 100755 (executable)
index 25169ec..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef __DALI_TOOLKIT_SCROLL_BAR_INTERNAL_H__
-#define __DALI_TOOLKIT_SCROLL_BAR_INTERNAL_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-component.h>
-#include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-// Forward declarations
-
-namespace Internal
-{
-// Forward declarations
-
-class ScrollBarInternal;
-}
-
-/**
- * ScrollBarInternal is a UI component that can be added to the sides of the scrollable controls
- * indicating the current scroll position.
- */
-class ScrollBarInternal : public ScrollComponent
-{
-
-public:
-
-  /**
-   * Create an uninitialized ScrollBarInternal; this can be initialized with ScrollBarInternal::New()
-   * Calling member functions with an uninitialized Dali::Object is not allowed.
-   * or horizontally (false)
-   */
-  ScrollBarInternal();
-
-  /**
-   * Copy constructor.
-   */
-  ScrollBarInternal( const ScrollBarInternal& scrollBar );
-
-  /**
-   * Assignment operator.
-   */
-  ScrollBarInternal& operator=( const ScrollBarInternal& scrollBar );
-
-  /**
-   * Virtual destructor.
-   * Dali::Object derived classes typically do not contain member data.
-   */
-  virtual ~ScrollBarInternal();
-
-    /**
-   * Create an initialized ScrollBarInternal
-   * @param[in] container Reference to the container of scroll bar
-   * @param[in] vertical Whether ScrollBarInternal should be oriented vertically (true)
-   * or horizontally (false)
-   * @return A pointer to the created ScrollBarInternal.
-   */
-  static ScrollBarInternal New(Scrollable& container, bool vertical);
-
-  /**
-   * Downcast an Object handle to ScrollBarInternal. If handle points to a ScrollBarInternal the
-   * downcast produces valid handle. If not the returned handle is left uninitialized.
-   * @param[in] handle Handle to an object
-   * @return handle to a ScrollBarInternal or an uninitialized handle
-   */
-  static ScrollBarInternal DownCast( BaseHandle handle );
-
-  /**
-   * Show ScrollBarInternal
-   */
-  void Show();
-
-  /**
-   * Hide ScrollBarInternal
-   */
-  void Hide();
-
-public: // Not intended for application developers
-
-  /**
-   * Creates a handle using the Toolkit::Internal implementation.
-   * @param[in]  implementation  The Control implementation.
-   */
-  ScrollBarInternal( Internal::ScrollBarInternal& implementation );
-
-  /**
-   * Allows the creation of this Control from an Internal::CustomActor pointer.
-   * @param[in]  internal  A pointer to the internal CustomActor.
-   */
-  ScrollBarInternal( Dali::Internal::CustomActor* internal );
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_BAR_INTERNAL_H__
index 7225beb..d78801a 100644 (file)
@@ -38,14 +38,14 @@ namespace
 // Bouncing effect is presented by stacked three layers with same color and opacity
 const size_t NUM_LAYERS( 3 );
 const Vector3 LAYER_HEIGHTS( 1.f, 27.f/42.f, 13.f/42.f);
-
+/*
 // use the actor color to paint every layer
 const char* MESH_FRAGMENT_SHADER =
 "void main()\n"
 "{\n"
 "  gl_FragColor = uColor;\n"
 "}\n";
-
+*/
 // Constraint to move the vertices vertically
 struct VertexPositionConstraint
 {
@@ -68,6 +68,8 @@ struct VertexPositionConstraint
 
 Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex )
 {
+  Actor meshActor;
+/*
   Dali::AnimatableMesh             mesh;
   Dali::MeshActor                  meshActor;
 
@@ -110,7 +112,7 @@ Actor CreateBouncingEffectActor( Property::Index& bouncePropertyIndex )
     constraint = Constraint::New<Vector3>( mesh, mesh.GetPropertyIndex(j+3,  AnimatableVertex::Property::POSITION), VertexPositionConstraint(-0.5f, LAYER_HEIGHTS[i]) );
     constraint.AddSource( Source(meshActor, bouncePropertyIndex) );
     constraint.Apply();
-  }
+  }*/
 
   return meshActor;
 }
diff --git a/dali-toolkit/internal/controls/scrollable/item-view/depth-layout.cpp b/dali-toolkit/internal/controls/scrollable/item-view/depth-layout.cpp
new file mode 100644 (file)
index 0000000..34838ad
--- /dev/null
@@ -0,0 +1,618 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics 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/scrollable/item-view/depth-layout.h>
+
+// EXTERNAL INCLUDES
+#include <algorithm>
+#include <dali/public-api/animation/animation.h>
+#include <dali/public-api/animation/constraint.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace // unnamed namespace
+{
+
+const unsigned int DEFAULT_NUMBER_OF_COLUMNS    = 3;
+const float        DEFAULT_NUMBER_OF_ROWS       = 26.0f;
+const float        DEFAULT_ROW_SPACING          = 55.0f;
+const float        DEFAULT_BOTTOM_MARGIN_FACTOR = 0.2f;
+const Radian       DEFAULT_TILT_ANGLE           ( Math::PI*0.15f );
+const Radian       DEFAULT_ITEM_TILT_ANGLE      ( -Math::PI*0.025f );
+const float        DEFAULT_SCROLL_SPEED_FACTOR  = 0.02f;
+const float        DEFAULT_MAXIMUM_SWIPE_SPEED  = 50.0f;
+const float        DEFAULT_ITEM_FLICK_ANIMATION_DURATION = 0.03f;
+
+inline float GetColumnPosition( unsigned int numberOfColumns, unsigned int columnNumber, const Vector3& itemSize, float layoutWidth )
+{
+  // Share the available space between margins & column spacings
+  float availableSpace = std::max( 0.0f, ( layoutWidth - itemSize.width * numberOfColumns ) );
+
+  float leftMargin = availableSpace / numberOfColumns * 0.5f;
+
+  float columnPosition = leftMargin + itemSize.width * 0.5f + columnNumber * ( itemSize.width + availableSpace / numberOfColumns );
+
+  return columnPosition - layoutWidth * 0.5f;
+}
+
+struct DepthPositionConstraint
+{
+  DepthPositionConstraint( unsigned int itemId,
+                           unsigned int numberOfColumns,
+                           unsigned int columnNumber,
+                           const Vector3& itemSize,
+                           float heightScale,
+                           float depthScale )
+  : mItemSize( itemSize ),
+    mItemId( itemId ),
+    mNumberOfColumns( numberOfColumns ),
+    mColumnNumber( columnNumber ),
+    mHeightScale( heightScale ),
+    mDepthScale( depthScale )
+  {
+  }
+
+  inline void Orientation0( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    float rowLayoutPositon = layoutPosition - static_cast< float >( mColumnNumber );
+
+    current.x = GetColumnPosition( mNumberOfColumns, mColumnNumber, mItemSize, layoutSize.width );
+    current.y = rowLayoutPositon * mHeightScale + layoutSize.height * 0.5f - DEFAULT_BOTTOM_MARGIN_FACTOR * layoutSize.height - mItemSize.height * 0.5f;
+    current.z = -rowLayoutPositon * mDepthScale;
+  }
+
+  inline void Orientation90( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    float rowLayoutPositon = layoutPosition - static_cast< float >( mColumnNumber ) + mNumberOfColumns * 0.5f;
+
+    current.x = rowLayoutPositon * mHeightScale + layoutSize.width * 0.5f - DEFAULT_BOTTOM_MARGIN_FACTOR * layoutSize.width - mItemSize.height * 0.5f;
+    current.y = -GetColumnPosition( mNumberOfColumns, mColumnNumber, mItemSize, layoutSize.height );
+    current.z = -rowLayoutPositon * mDepthScale;
+  }
+
+  inline void Orientation180( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    float rowLayoutPositon = layoutPosition - static_cast< float >( mColumnNumber );
+
+    current.x = -GetColumnPosition( mNumberOfColumns, mColumnNumber, mItemSize, layoutSize.width );
+    current.y = -( rowLayoutPositon * mHeightScale + layoutSize.height * 0.5f - DEFAULT_BOTTOM_MARGIN_FACTOR * layoutSize.height - mItemSize.height * 0.5f );
+    current.z = -rowLayoutPositon * mDepthScale;
+  }
+
+  inline void Orientation270( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    float rowLayoutPositon = layoutPosition - static_cast< float >( mColumnNumber ) + mNumberOfColumns * 0.5f;
+
+    current.x = -( rowLayoutPositon * mHeightScale + layoutSize.width * 0.5f - DEFAULT_BOTTOM_MARGIN_FACTOR * layoutSize.width - mItemSize.height * 0.5f );
+    current.y = GetColumnPosition( mNumberOfColumns, mColumnNumber, mItemSize, layoutSize.height );
+    current.z = -rowLayoutPositon * mDepthScale;
+  }
+
+  void Orientation0( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    Orientation0( current, layoutPosition, layoutSize );
+  }
+
+  void Orientation90( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    Orientation90( current, layoutPosition, layoutSize );
+  }
+
+  void Orientation180( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    Orientation180( current, layoutPosition, layoutSize );
+  }
+
+  void Orientation270( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    Orientation270( current, layoutPosition, layoutSize );
+  }
+
+  Vector3 mItemSize;
+  unsigned int mItemId;
+  unsigned int mNumberOfColumns;
+  unsigned int mColumnNumber;
+  float mHeightScale;
+  float mDepthScale;
+};
+
+struct DepthRotationConstraint
+{
+  DepthRotationConstraint( Radian angleRadians, ControlOrientation::Type orientation )
+  : mTiltAngle( angleRadians ),
+    mMultiplier( 0.0f )
+  {
+    if ( orientation == ControlOrientation::Up )
+    {
+      mMultiplier = 0.0f;
+    }
+    else if ( orientation == ControlOrientation::Left )
+    {
+      mMultiplier = 1.5f;
+    }
+    else if ( orientation == ControlOrientation::Down )
+    {
+      mMultiplier = -1.0f;
+    }
+    else // orientation == ControlOrientation::Right
+    {
+      mMultiplier = 0.5f;
+    }
+  }
+
+  void operator()( Quaternion& current, const PropertyInputContainer& /* inputs */ )
+  {
+    current = Quaternion( Radian( mMultiplier * Math::PI ), Vector3::ZAXIS ) * Quaternion( mTiltAngle, Vector3::XAXIS );
+  }
+
+  Radian mTiltAngle;
+  float mMultiplier;
+};
+
+struct DepthColorConstraint
+{
+  DepthColorConstraint( unsigned int itemId, unsigned int numberOfColumns, float numberOfRows, unsigned int columnNumber )
+  : mItemId( itemId ),
+    mNumberOfColumns( numberOfColumns ),
+    mNumberOfRows( numberOfRows ),
+    mColumnNumber( columnNumber )
+  {
+  }
+
+  void operator()( Vector4& current, const Dali::PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    float row = ( layoutPosition - static_cast<float>( mColumnNumber ) ) / mNumberOfColumns;
+
+    float darkness(1.0f);
+    float alpha(1.0f);
+
+    if (row < 0.0f)
+    {
+      darkness = alpha = std::max(0.0f, 1.0f + row);
+    }
+    else
+    {
+      if (row > mNumberOfRows)
+      {
+        darkness = 0.0f;
+      }
+      else
+      {
+        darkness = 1.0f - ( 1.0f * (row / mNumberOfRows) );
+      }
+
+      if (row > (mNumberOfRows-1.0f))
+      {
+        alpha = std::max(0.0f, 1.0f - (row-(mNumberOfRows-1.0f)));
+      }
+    }
+
+    current.r = current.g = current.b = darkness;
+    current.a *= alpha;
+  }
+
+  unsigned int mItemId;
+  unsigned int mNumberOfColumns;
+  float mNumberOfRows;
+  unsigned int mColumnNumber;
+};
+
+struct DepthVisibilityConstraint
+{
+  DepthVisibilityConstraint( unsigned int itemId, unsigned int numberOfColumns, float numberOfRows, unsigned int columnNumber )
+  : mItemId( itemId ),
+    mNumberOfColumns(numberOfColumns),
+    mNumberOfRows(numberOfRows),
+    mColumnNumber(columnNumber)
+  {
+  }
+
+  void operator()( bool& current, const Dali::PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    float row = ( layoutPosition - static_cast< float >( mColumnNumber ) ) / mNumberOfColumns;
+
+    current = ( row > -1.0f ) && ( row < mNumberOfRows );
+  }
+
+  unsigned int mItemId;
+  unsigned int mNumberOfColumns;
+  float mNumberOfRows;
+  unsigned int mColumnNumber;
+};
+
+} // unnamed namespace
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+struct DepthLayout::Impl
+{
+  Impl()
+  : mNumberOfColumns(DEFAULT_NUMBER_OF_COLUMNS),
+    mNumberOfRows(DEFAULT_NUMBER_OF_ROWS),
+    mRowSpacing(DEFAULT_ROW_SPACING),
+    mTiltAngle(DEFAULT_TILT_ANGLE),
+    mItemTiltAngle(DEFAULT_ITEM_TILT_ANGLE),
+    mScrollSpeedFactor(DEFAULT_SCROLL_SPEED_FACTOR),
+    mMaximumSwipeSpeed(DEFAULT_MAXIMUM_SWIPE_SPEED),
+    mItemFlickAnimationDuration(DEFAULT_ITEM_FLICK_ANIMATION_DURATION)
+  {
+  }
+
+  unsigned int mNumberOfColumns;
+  unsigned int mNumberOfRows;
+
+  float mRowSpacing;
+
+  Radian mTiltAngle;
+  Radian mItemTiltAngle;
+
+  float mScrollSpeedFactor;
+  float mMaximumSwipeSpeed;
+  float mItemFlickAnimationDuration;
+};
+
+DepthLayoutPtr DepthLayout::New()
+{
+  return DepthLayoutPtr(new DepthLayout());
+}
+
+DepthLayout::~DepthLayout()
+{
+  delete mImpl;
+}
+
+void DepthLayout::SetNumberOfColumns(unsigned int columns)
+{
+  mImpl->mNumberOfColumns = columns;
+}
+
+unsigned int DepthLayout::GetNumberOfColumns() const
+{
+  return mImpl->mNumberOfColumns;
+}
+
+void DepthLayout::SetNumberOfRows(unsigned int rows)
+{
+  mImpl->mNumberOfRows = rows;
+}
+
+unsigned int DepthLayout::GetNumberOfRows() const
+{
+  return mImpl->mNumberOfRows;
+}
+
+void DepthLayout::SetRowSpacing(float spacing)
+{
+  mImpl->mRowSpacing = spacing;
+}
+
+float DepthLayout::GetRowSpacing() const
+{
+  return mImpl->mRowSpacing;
+}
+
+void DepthLayout::SetTiltAngle(Degree angle)
+{
+  mImpl->mTiltAngle = Degree( Clamp( angle, -45.0f, 45.0f ) );
+}
+
+Degree DepthLayout::GetTiltAngle() const
+{
+  return Degree( mImpl->mTiltAngle );
+}
+
+void DepthLayout::SetItemTiltAngle(Degree angle)
+{
+  mImpl->mItemTiltAngle = angle;
+}
+
+Degree DepthLayout::GetItemTiltAngle() const
+{
+  return Degree( mImpl->mItemTiltAngle );
+}
+
+void DepthLayout::SetScrollSpeedFactor(float scrollSpeed)
+{
+  mImpl->mScrollSpeedFactor = scrollSpeed;
+}
+
+void DepthLayout::SetMaximumSwipeSpeed(float speed)
+{
+  mImpl->mMaximumSwipeSpeed = speed;
+}
+
+void DepthLayout::SetItemFlickAnimationDuration(float durationSeconds)
+{
+  mImpl->mItemFlickAnimationDuration = durationSeconds;
+}
+
+float DepthLayout::GetScrollSpeedFactor() const
+{
+  return mImpl->mScrollSpeedFactor;
+}
+
+float DepthLayout::GetMaximumSwipeSpeed() const
+{
+  return mImpl->mMaximumSwipeSpeed;
+}
+
+float DepthLayout::GetItemFlickAnimationDuration() const
+{
+  return mImpl->mItemFlickAnimationDuration;
+}
+
+float DepthLayout::GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
+{
+  return static_cast<float>(mImpl->mNumberOfColumns) - static_cast<float>(numberOfItems);
+}
+
+float DepthLayout::GetClosestAnchorPosition(float layoutPosition) const
+{
+  float rowIndex = static_cast<float>(round(layoutPosition / mImpl->mNumberOfColumns));
+  return rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
+}
+
+float DepthLayout::GetItemScrollToPosition(unsigned int itemId) const
+{
+  float rowIndex = static_cast<float>(itemId / mImpl->mNumberOfColumns);
+  return -rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
+}
+
+ItemRange DepthLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
+{
+  float firstRow = -(firstItemPosition/mImpl->mNumberOfColumns);
+  float lastRow = firstRow + mImpl->mNumberOfRows * 0.5f;
+
+  unsigned int firstItem = static_cast<unsigned int>(std::max(0.0f, firstRow * mImpl->mNumberOfColumns));
+  unsigned int lastItem  = static_cast<unsigned int>(std::max(0.0f, lastRow  * mImpl->mNumberOfColumns));
+
+  return ItemRange(firstItem, lastItem+1);
+}
+
+unsigned int DepthLayout::GetReserveItemCount(Vector3 layoutSize) const
+{
+  float itemsWithinLayout = (layoutSize.depth * mImpl->mNumberOfColumns) / (cosf(mImpl->mTiltAngle) * mImpl->mRowSpacing);
+
+  return static_cast<unsigned int>(itemsWithinLayout);
+}
+
+void DepthLayout::GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const
+{
+  // 1x1 aspect ratio
+  itemSize.width = itemSize.height = itemSize.depth = ( IsVertical( GetOrientation() ) ? layoutSize.width : layoutSize.height ) / static_cast<float>( mImpl->mNumberOfColumns + 1 );
+}
+
+void DepthLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
+{
+  if(animation)
+  {
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size );
+  }
+}
+
+Degree DepthLayout::GetScrollDirection() const
+{
+  Degree scrollDirection(0.0f);
+  ControlOrientation::Type orientation = GetOrientation();
+
+  if ( orientation == ControlOrientation::Up )
+  {
+    scrollDirection = Degree( 180.0f );
+  }
+  else if ( orientation == ControlOrientation::Left )
+  {
+    scrollDirection = Degree( 270.0f );
+  }
+  else if ( orientation == ControlOrientation::Down )
+  {
+    scrollDirection = Degree( 0.0f );
+  }
+  else // orientation == ControlOrientation::Right
+  {
+    scrollDirection = Degree( 90.0f );
+  }
+
+  return scrollDirection;
+}
+
+void DepthLayout::ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor )
+{
+  Dali::Toolkit::ItemView itemView = Dali::Toolkit::ItemView::DownCast( itemViewActor );
+  if( itemView )
+  {
+    Vector3 itemSize;
+    GetItemSize( itemId, layoutSize, itemSize );
+
+    ControlOrientation::Type orientation = GetOrientation();
+
+    // Position constraint
+    Constraint constraint;
+    DepthPositionConstraint depthPositionStruct( itemId,
+                                                 mImpl->mNumberOfColumns,
+                                                 itemId % mImpl->mNumberOfColumns,
+                                                 itemSize,
+                                                 -sinf( mImpl->mTiltAngle ) * mImpl->mRowSpacing,
+                                                 cosf( mImpl->mTiltAngle ) * mImpl->mRowSpacing );
+    if ( orientation == ControlOrientation::Up )
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, depthPositionStruct, &DepthPositionConstraint::Orientation0 );
+    }
+    else if ( orientation == ControlOrientation::Left )
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, depthPositionStruct, &DepthPositionConstraint::Orientation90 );
+    }
+    else if ( orientation == ControlOrientation::Down )
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, depthPositionStruct, &DepthPositionConstraint::Orientation180 );
+    }
+    else // orientation == ControlOrientation::Right
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, depthPositionStruct, &DepthPositionConstraint::Orientation270 );
+    }
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
+    constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
+    constraint.Apply();
+
+    // Rotation constraint
+    constraint = Constraint::New< Quaternion >( actor, Actor::Property::ORIENTATION, DepthRotationConstraint( mImpl->mItemTiltAngle, orientation ) );
+    constraint.Apply();
+
+    // Color constraint
+    constraint = Constraint::New< Vector4 >( actor, Actor::Property::COLOR, DepthColorConstraint( itemId, mImpl->mNumberOfColumns, mImpl->mNumberOfRows*0.5f, itemId % mImpl->mNumberOfColumns ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
+    constraint.SetRemoveAction( Dali::Constraint::Discard );
+    constraint.Apply();
+
+    // Visibility constraint
+    constraint = Constraint::New< bool >( actor, Actor::Property::VISIBLE, DepthVisibilityConstraint( itemId, mImpl->mNumberOfColumns, mImpl->mNumberOfRows*0.5f, itemId % mImpl->mNumberOfColumns ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
+    constraint.SetRemoveAction( Dali::Constraint::Discard );
+    constraint.Apply();
+  }
+}
+
+Vector3 DepthLayout::GetItemPosition( int itemID, float currentLayoutPosition, const Vector3& layoutSize ) const
+{
+  Vector3 itemPosition = Vector3::ZERO;
+
+  const float heightScale = -sinf( mImpl->mTiltAngle ) * mImpl->mRowSpacing;
+  const float depthScale  =  cosf( mImpl->mTiltAngle ) * mImpl->mRowSpacing;
+
+  Vector3 itemSize;
+  GetItemSize( itemID, layoutSize, itemSize );
+  DepthPositionConstraint positionFunctor = DepthPositionConstraint( itemID,
+                                                                     mImpl->mNumberOfColumns,
+                                                                     itemID % mImpl->mNumberOfColumns,
+                                                                     itemSize,
+                                                                     heightScale,
+                                                                     depthScale );
+  ControlOrientation::Type orientation = GetOrientation();
+  if ( orientation == ControlOrientation::Up )
+  {
+    positionFunctor.Orientation0( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+  else if ( orientation == ControlOrientation::Left )
+  {
+    positionFunctor.Orientation90( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+  else if ( orientation == ControlOrientation::Down )
+  {
+    positionFunctor.Orientation180( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+  else // orientation == ControlOrientation::Right
+  {
+    positionFunctor.Orientation270( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+
+  return itemPosition;
+}
+
+DepthLayout::DepthLayout()
+: mImpl(NULL)
+{
+  mImpl = new Impl();
+}
+
+float DepthLayout::GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize)
+{
+  float scrollTo = currentLayoutPosition;
+  float row = (currentLayoutPosition + itemID - static_cast<float>(itemID % mImpl->mNumberOfColumns)) / mImpl->mNumberOfColumns;
+
+  // Check whether item is not within viewable area
+  if(row <= -1.0f)
+  {
+    scrollTo = GetItemScrollToPosition(itemID);
+  }
+  else if(row > mImpl->mNumberOfRows * 0.5f - 1.0f)
+  {
+    scrollTo = GetItemScrollToPosition(itemID) + (mImpl->mNumberOfRows - 1.0f) * 0.5f * mImpl->mNumberOfColumns;
+  }
+
+  return scrollTo;
+}
+
+int DepthLayout::GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled)
+{
+  switch( direction )
+  {
+    case Toolkit::Control::Left:
+    {
+      itemID--;
+      if( itemID < 0 )
+      {
+        itemID = loopEnabled ? maxItems - 1 : 0;
+      }
+      break;
+    }
+    case Toolkit::Control::Up:
+    {
+      itemID += mImpl->mNumberOfColumns;
+      if( itemID >= maxItems )
+      {
+        itemID = loopEnabled ? 0 : itemID - mImpl->mNumberOfColumns;
+      }
+      break;
+    }
+    case Toolkit::Control::Right:
+    {
+      itemID++;
+      if( itemID >= maxItems )
+      {
+        itemID = loopEnabled ? 0 : maxItems - 1;
+      }
+      break;
+    }
+    case Toolkit::Control::Down:
+    {
+      itemID -= mImpl->mNumberOfColumns;
+      if( itemID < 0 )
+      {
+        itemID = loopEnabled ? itemID + maxItems : itemID + mImpl->mNumberOfColumns;
+      }
+      break;
+    }
+  }
+  return itemID;
+}
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
@@ -27,6 +27,9 @@ namespace Dali
 namespace Toolkit
 {
 
+namespace Internal
+{
+
 class DepthLayout;
 
 typedef IntrusivePtr<DepthLayout> DepthLayoutPtr;
@@ -34,19 +37,10 @@ typedef IntrusivePtr<DepthLayout> DepthLayoutPtr;
 /**
  * This layout arranges items in a grid, which scrolls along the Z-Axis.
  */
-class DALI_IMPORT_API DepthLayout : public ItemLayout
+class DepthLayout : public ItemLayout
 {
 public:
 
-  typedef boost::function<Vector3 (unsigned int numberOfColumns, float layoutWidth)> ItemSizeFunction;
-
-  typedef boost::function<float (float layoutHeight)> BottomMarginFunction;
-
-  typedef boost::function<float (unsigned int numberOfColumns,
-                                 unsigned int columnNumber,
-                                 const Vector3& itemSize,
-                                 float layoutWidth)> ColumnPositionFunction;
-
   /**
    * Create a new spiral layout
    */
@@ -107,30 +101,6 @@ public:
   Degree GetTiltAngle() const;
 
   /**
-   * Set the function used to calculate the item-size, for a given layout-size.
-   * @param[in] function The item-size function.
-   */
-  void SetItemSizeFunction(ItemSizeFunction function);
-
-  /**
-   * Get the function used to calculate the item-size.
-   * @return The item-size function.
-   */
-  ItemSizeFunction GetItemSizeFunction() const;
-
-  /**
-   * Set the function used to calculate the margin in the bottom of the layout, for a given layout-size.
-   * @param[in] function The bottom margin function.
-   */
-  void SetBottomMarginFunction(BottomMarginFunction function);
-
-  /**
-   * Get the function used to calculate the margin in the bottom of the layout.
-   * @return The bottom margin function.
-   */
-  BottomMarginFunction GetBottomMarginFunction() const;
-
-  /**
    * Set the tilt angle of the individual items in the layout.
    * @param[in] angle The item tilt angle in degrees.
    */
@@ -143,18 +113,6 @@ public:
   Degree GetItemTiltAngle() const;
 
   /**
-   * Set the function used to calculate the horizontal position of each column, for a given column, item-size & layout-size.
-   * @param[in] function The column-position function.
-   */
-  void SetColumnPositionFunction(ColumnPositionFunction function);
-
-  /**
-   * Get the function used to calculate the horizontal position of each column
-   * @return The column-position function.
-   */
-  ColumnPositionFunction GetColumnPositionFunction() const;
-
-  /**
    * Set the factor used to customise the scroll speed while dragging and swiping the layout.
    * @param[in] scrollSpeed The scroll speed factor.
    */
@@ -228,9 +186,9 @@ private:
   virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const;
 
   /**
-   * @copydoc ItemLayout::GetItemSize()
+   * @copydoc ItemLayout::GetDefaultItemSize()
    */
-  virtual bool GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const;
+  virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const;
 
   /**
    * @copydoc ItemLayout::GetResizeAnimation()
@@ -238,34 +196,19 @@ private:
   virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const;
 
   /**
-   * @copydoc ItemLayout::GetPositionConstraint()
-   */
-  virtual bool GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetRotationConstraint()
-   */
-  virtual bool GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetScaleConstraint()
-   */
-  virtual bool GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetColorConstraint()
+   * @copydoc ItemLayout::GetScrollDirection()
    */
-  virtual bool GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const;
+  virtual Degree GetScrollDirection() const;
 
   /**
-   * @copydoc ItemLayout::GetVisibilityConstraint()
+   * @copydoc ItemLayout::ApplyConstraints()
    */
-  virtual bool GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const;
+  virtual void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor );
 
   /**
-   * @copydoc ItemLayout::GetScrollDirection()
+   * @copydoc ItemLayout::GetItemPosition()
    */
-  virtual Degree GetScrollDirection() const;
+  virtual Vector3 GetItemPosition( int itemID, float currentLayoutPosition, const Vector3& layoutSize ) const;
 
 protected:
 
@@ -280,6 +223,8 @@ private:
   Impl* mImpl;
 };
 
+} // namespace Internal
+
 } // namespace Toolkit
 
 } // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/item-view/grid-layout.cpp b/dali-toolkit/internal/controls/scrollable/item-view/grid-layout.cpp
new file mode 100644 (file)
index 0000000..020bbcf
--- /dev/null
@@ -0,0 +1,733 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics 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/scrollable/item-view/grid-layout.h>
+
+// EXTERNAL INCLUDES
+#include <algorithm>
+#include <dali/public-api/animation/animation.h>
+#include <dali/public-api/animation/constraint.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace // unnamed namespace
+{
+
+const unsigned int DEFAULT_NUMBER_OF_COLUMNS = 4;
+const float DEFAULT_TOP_MARGIN     =  95.0f;
+const float DEFAULT_BOTTOM_MARGIN  =  20.0f;
+const float DEFAULT_SIDE_MARGIN    =  20.0f;
+const float DEFAULT_COLUMN_SPACING =  20.0f;
+const float DEFAULT_ROW_SPACING    =  20.0f;
+const float DEFAULT_SCROLL_SPEED_FACTOR = 0.03f;
+const float DEFAULT_MAXIMUM_SWIPE_SPEED = 100.0f;
+const float DEFAULT_ITEM_FLICK_ANIMATION_DURATION = 0.015f;
+
+struct GridPositionConstraint
+{
+  GridPositionConstraint(
+      unsigned int itemId,
+      const unsigned int columnIndex,
+      const unsigned int numberOfColumns,
+      const float rowSpacing,
+      const float columnSpacing,
+      const float topMargin,
+      const float sideMargin,
+      const Vector3& itemSize,
+      const float gap )
+  : mItemSize( itemSize ),
+    mItemId( itemId ),
+    mColumnIndex( columnIndex ),
+    mNumberOfColumns( numberOfColumns ),
+    mRowSpacing( rowSpacing ),
+    mColumnSpacing( columnSpacing ),
+    mTopMargin( topMargin ),
+    mSideMargin( sideMargin ),
+    mZGap( gap )
+  {
+  }
+
+  inline void Orientation0( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    current.x = mSideMargin + ( mColumnIndex * ( mItemSize.x + mColumnSpacing ) ) + mItemSize.x * 0.5f - layoutSize.x * 0.5f;
+    current.y = ( ( mItemSize.y + mRowSpacing ) * ( layoutPosition - mColumnIndex) ) / mNumberOfColumns - layoutSize.height * 0.5f + mItemSize.y * 0.5f + mTopMargin;
+    current.z = mColumnIndex * mZGap;
+  }
+
+  inline void Orientation90( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    current.x = ( ( mItemSize.y + mRowSpacing ) * ( layoutPosition - mColumnIndex ) ) / mNumberOfColumns - layoutSize.width * 0.5f + mItemSize.y * 0.5f + mTopMargin;
+    current.y = -( mSideMargin + ( mColumnIndex * ( mItemSize.x + mColumnSpacing ) ) + mItemSize.x * 0.5f - layoutSize.y * 0.5f );
+    current.z = mColumnIndex * mZGap;
+  }
+
+  inline void Orientation180( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    current.x = -(mSideMargin + (mColumnIndex * (mItemSize.x + mColumnSpacing)) + mItemSize.x * 0.5f - layoutSize.x * 0.5f);
+    current.y = -( ( ( mItemSize.y + mRowSpacing ) * ( layoutPosition - mColumnIndex ) ) / mNumberOfColumns - layoutSize.height * 0.5f + mItemSize.y * 0.5f + mTopMargin );
+    current.z = mColumnIndex * mZGap;
+  }
+
+  inline void Orientation270( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    current.x = -( ( ( mItemSize.y + mRowSpacing ) * ( layoutPosition - mColumnIndex ) ) / mNumberOfColumns - layoutSize.width * 0.5f + mItemSize.y * 0.5f + mTopMargin );
+    current.y = mSideMargin + ( mColumnIndex * ( mItemSize.x + mColumnSpacing ) ) + mItemSize.x * 0.5f - layoutSize.y * 0.5f;
+    current.z = mColumnIndex * mZGap;
+  }
+
+  void Orientation0( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    Orientation0( current, layoutPosition, layoutSize );
+  }
+
+  void Orientation90( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    Orientation90( current, layoutPosition, layoutSize );
+  }
+
+  void Orientation180( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    Orientation180( current, layoutPosition, layoutSize );
+  }
+
+  void Orientation270( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    Orientation270( current, layoutPosition, layoutSize );
+  }
+
+public:
+
+  Vector3 mItemSize;
+  unsigned int mItemId;
+  unsigned int mColumnIndex;
+  unsigned int mNumberOfColumns;
+  float mRowSpacing;
+  float mColumnSpacing;
+  float mTopMargin;
+  float mSideMargin;
+  float mZGap;
+};
+
+void GridRotationConstraint0( Quaternion& current, const PropertyInputContainer& /* inputs */ )
+{
+  current = Quaternion( Radian( 0.0f ), Vector3::ZAXIS );
+}
+
+void GridRotationConstraint90( Quaternion& current, const PropertyInputContainer& /* inputs */ )
+{
+  current = Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS );
+}
+
+void GridRotationConstraint180( Quaternion& current, const PropertyInputContainer& /* inputs */ )
+{
+  current = Quaternion( Radian( Math::PI ), Vector3::ZAXIS );
+}
+
+void GridRotationConstraint270( Quaternion& current, const PropertyInputContainer& /* inputs */ )
+{
+  current = Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS );
+}
+
+void GridColorConstraint( Vector4& current, const PropertyInputContainer& /* inputs */ )
+{
+  current.r = current.g = current.b = 1.0f;
+}
+
+struct GridVisibilityConstraint
+{
+  GridVisibilityConstraint(
+      unsigned int itemId,
+      const unsigned int columnIndex,
+      const unsigned int numberOfColumns,
+      const float rowSpacing,
+      const float columnSpacing,
+      const float sideMargin,
+      const Vector3& itemSize )
+  : mItemSize( itemSize ),
+    mItemId( itemId ),
+    mColumnIndex( columnIndex ),
+    mNumberOfColumns( numberOfColumns ),
+    mRowSpacing( rowSpacing ),
+    mColumnSpacing( columnSpacing ),
+    mSideMargin( sideMargin )
+  {
+  }
+
+  void Portrait( bool& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+
+    float row = ( layoutPosition - static_cast< float >( mColumnIndex ) ) / mNumberOfColumns;
+    int rowsPerPage = ceil( layoutSize.height / ( mItemSize.y + mRowSpacing ) );
+
+    current = ( row > -2.0f ) && ( row < rowsPerPage );
+  }
+
+  void Landscape( bool& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+
+    float row = ( layoutPosition - static_cast< float >( mColumnIndex ) ) / mNumberOfColumns;
+    int rowsPerPage = ceil( layoutSize.width / ( mItemSize.y + mRowSpacing ) );
+
+    current = ( row > -2.0f ) && ( row < rowsPerPage );
+  }
+
+public:
+
+  Vector3 mItemSize;
+  unsigned int mItemId;
+  unsigned int mColumnIndex;
+  unsigned int mNumberOfColumns;
+  float mRowSpacing;
+  float mColumnSpacing;
+  float mSideMargin;
+};
+
+} // unnamed namespace
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+struct GridLayout::Impl
+{
+  Impl()
+  : mNumberOfColumns(DEFAULT_NUMBER_OF_COLUMNS),
+    mRowSpacing(DEFAULT_ROW_SPACING),
+    mColumnSpacing(DEFAULT_COLUMN_SPACING),
+    mTopMargin(DEFAULT_TOP_MARGIN),
+    mBottomMargin(DEFAULT_BOTTOM_MARGIN),
+    mSideMargin(DEFAULT_SIDE_MARGIN),
+    mZGap(0.f),
+    mScrollSpeedFactor(DEFAULT_SCROLL_SPEED_FACTOR),
+    mMaximumSwipeSpeed(DEFAULT_MAXIMUM_SWIPE_SPEED),
+    mItemFlickAnimationDuration(DEFAULT_ITEM_FLICK_ANIMATION_DURATION)
+  {
+  }
+
+  unsigned int mNumberOfColumns;
+  float mRowSpacing;
+  float mColumnSpacing;
+  float mTopMargin;
+  float mBottomMargin;
+  float mSideMargin;
+  float mZGap;
+
+  float mScrollSpeedFactor;
+  float mMaximumSwipeSpeed;
+  float mItemFlickAnimationDuration;
+};
+
+GridLayoutPtr GridLayout::New()
+{
+  return GridLayoutPtr(new GridLayout());
+}
+
+GridLayout::~GridLayout()
+{
+  delete mImpl;
+}
+
+void GridLayout::SetNumberOfColumns(unsigned int columns)
+{
+  mImpl->mNumberOfColumns = columns;
+}
+
+unsigned int GridLayout::GetNumberOfColumns() const
+{
+  return mImpl->mNumberOfColumns;
+}
+
+void GridLayout::SetRowSpacing(float spacing)
+{
+  mImpl->mRowSpacing = spacing;
+}
+
+float GridLayout::GetRowSpacing() const
+{
+  return mImpl->mRowSpacing;
+}
+
+void GridLayout::SetColumnSpacing(float spacing)
+{
+  mImpl->mColumnSpacing = spacing;
+}
+
+float GridLayout::GetColumnSpacing() const
+{
+  return mImpl->mColumnSpacing;
+}
+
+void GridLayout::SetTopMargin(float margin)
+{
+  mImpl->mTopMargin = margin;
+}
+
+float GridLayout::GetTopMargin() const
+{
+  return mImpl->mTopMargin;
+}
+
+void GridLayout::SetBottomMargin(float margin)
+{
+  mImpl->mBottomMargin = margin;
+}
+
+float GridLayout::GetBottomMargin() const
+{
+  return mImpl->mBottomMargin;
+}
+
+void GridLayout::SetSideMargin(float margin)
+{
+  mImpl->mSideMargin = margin;
+}
+
+float GridLayout::GetSideMargin() const
+{
+  return mImpl->mSideMargin;
+}
+
+void GridLayout::SetZGap(float gap)
+{
+  mImpl->mZGap = gap;
+}
+
+float GridLayout::GetZGap() const
+{
+  return mImpl->mZGap;
+}
+
+void GridLayout::SetScrollSpeedFactor(float scrollSpeed)
+{
+  mImpl->mScrollSpeedFactor = scrollSpeed;
+}
+
+void GridLayout::SetMaximumSwipeSpeed(float speed)
+{
+  mImpl->mMaximumSwipeSpeed = speed;
+}
+
+void GridLayout::SetItemFlickAnimationDuration(float durationSeconds)
+{
+  mImpl->mItemFlickAnimationDuration = durationSeconds;
+}
+
+float GridLayout::GetScrollSpeedFactor() const
+{
+  return mImpl->mScrollSpeedFactor;
+}
+
+float GridLayout::GetMaximumSwipeSpeed() const
+{
+  return mImpl->mMaximumSwipeSpeed;
+}
+
+float GridLayout::GetItemFlickAnimationDuration() const
+{
+  return mImpl->mItemFlickAnimationDuration;
+}
+
+float GridLayout::GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
+{
+  float layoutHeight = IsHorizontal( GetOrientation() ) ? layoutSize.width : layoutSize.height;
+
+  Vector3 itemSize;
+  GetItemSize( 0, layoutSize, itemSize );
+
+  unsigned int itemsLastRow = numberOfItems % mImpl->mNumberOfColumns;
+  if (itemsLastRow == 0)
+  {
+    itemsLastRow = mImpl->mNumberOfColumns;
+  }
+
+  float rowsLastPage = (layoutHeight - mImpl->mBottomMargin - mImpl->mTopMargin + mImpl->mRowSpacing) / (itemSize.y + mImpl->mRowSpacing);
+  float itemsLastPage = (rowsLastPage - 1.0f) * static_cast<float>(mImpl->mNumberOfColumns) + static_cast<float>(itemsLastRow);
+
+  return itemsLastPage - static_cast<float>(numberOfItems);
+}
+
+float GridLayout::GetClosestAnchorPosition(float layoutPosition) const
+{
+  float rowIndex = static_cast<float>(round(layoutPosition / mImpl->mNumberOfColumns));
+  return rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
+}
+
+float GridLayout::GetItemScrollToPosition(unsigned int itemId) const
+{
+  float rowIndex = static_cast<float>(itemId / mImpl->mNumberOfColumns);
+  return -rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
+}
+
+ItemRange GridLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
+{
+  float layoutHeight = IsHorizontal( GetOrientation() ) ? layoutSize.width : layoutSize.height;
+
+  Vector3 itemSize;
+  GetItemSize( 0, layoutSize, itemSize );
+
+  int itemsPerPage = mImpl->mNumberOfColumns * ceil(layoutHeight / (itemSize.y + mImpl->mRowSpacing));
+  int firstVisibleItem = -(static_cast<int>(firstItemPosition / mImpl->mNumberOfColumns)) * mImpl->mNumberOfColumns;
+
+  int firstItemIndex = std::max(0, firstVisibleItem - static_cast<int>(mImpl->mNumberOfColumns));
+  int lastItemIndex  = std::max(0, firstVisibleItem + itemsPerPage);
+
+  return ItemRange(firstItemIndex, lastItemIndex);
+}
+
+float GridLayout::GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize)
+{
+  Vector3 itemPosition = GetItemPosition( itemID, currentLayoutPosition, layoutSize );
+  Vector3 itemSize;
+  ControlOrientation::Type orientation = GetOrientation();
+
+  GetItemSize(itemID, layoutSize, itemSize);
+  Vector3 onScreenArea = ( layoutSize - ( IsVertical( orientation ) ? itemSize : Vector3( itemSize.y, itemSize.x, itemSize.z ) ) ) * 0.5f;
+  if (itemPosition.x < -onScreenArea.x
+      || itemPosition.x > onScreenArea.x
+      || itemPosition.y < -onScreenArea.y
+      || itemPosition.y > onScreenArea.y)
+  {
+    // item not within viewable area
+    float rowHeight = itemSize.y + mImpl->mRowSpacing;
+    Vector3 firstItemPosition = GetItemPosition( itemID, 0.0f, layoutSize );
+    float offset = 0.0f;
+    switch( orientation )
+    {
+      case ControlOrientation::Up:
+      {
+        if(itemPosition.y > onScreenArea.y)
+        {
+          offset = ((layoutSize.y - rowHeight) * 0.5f) - firstItemPosition.y;
+        }
+        else
+        {
+          offset = ((-layoutSize.y + rowHeight) * 0.5f) - firstItemPosition.y;
+        }
+        break;
+      }
+      case ControlOrientation::Down:
+      {
+        if(itemPosition.y < -onScreenArea.y)
+        {
+          offset = ((layoutSize.y - rowHeight) * 0.5f) - firstItemPosition.y;
+        }
+        else
+        {
+          offset = ((-layoutSize.y + rowHeight) * 0.5f) - firstItemPosition.y;
+        }
+        break;
+      }
+      case ControlOrientation::Left:
+      {
+        if(itemPosition.x > onScreenArea.x)
+        {
+          offset = ((layoutSize.x - rowHeight) * 0.5f) - firstItemPosition.x;
+        }
+        else
+        {
+          offset = ((-layoutSize.x + rowHeight) * 0.5f) - firstItemPosition.x;
+        }
+        break;
+      }
+      case ControlOrientation::Right:
+      {
+        if(itemPosition.x < -onScreenArea.x)
+        {
+          offset = ((layoutSize.x - rowHeight) * 0.5f) - firstItemPosition.x;
+        }
+        else
+        {
+          offset = ((-layoutSize.x + rowHeight) * 0.5f) - firstItemPosition.x;
+        }
+        break;
+      }
+    }
+    // work out number of rows from first item position to an item aligned to bottom of screen
+    float rowDiff = offset / rowHeight;
+    float layoutPositionOffset = rowDiff * mImpl->mNumberOfColumns;
+    float scrollTo = GetItemScrollToPosition(itemID) + layoutPositionOffset;
+    return scrollTo;
+  }
+  return currentLayoutPosition;
+}
+
+unsigned int GridLayout::GetReserveItemCount(Vector3 layoutSize) const
+{
+  float layoutHeight = IsHorizontal( GetOrientation() ) ? layoutSize.width : layoutSize.height;
+
+  Vector3 itemSize;
+  GetItemSize( 0, layoutSize, itemSize );
+  int itemsPerPage = mImpl->mNumberOfColumns * ceil(layoutHeight / (itemSize.y + mImpl->mRowSpacing));
+  return itemsPerPage;
+}
+
+void GridLayout::GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const
+{
+  float layoutWidth = IsHorizontal( GetOrientation() ) ? layoutSize.height : layoutSize.width;
+  itemSize.width = ( layoutWidth - mImpl->mSideMargin * 2.0f - mImpl->mColumnSpacing * static_cast<float>( mImpl->mNumberOfColumns - 1 ) ) / static_cast<float>( mImpl->mNumberOfColumns );
+
+  // 4x3 aspect ratio
+  itemSize.height = itemSize.depth = itemSize.width * 0.75f;
+}
+
+void GridLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
+{
+  if(animation)
+  {
+    Vector3 currentSize( actor.GetCurrentSize() );
+    Vector3 shrink( currentSize );
+
+    shrink.width = std::min(size.width, currentSize.width);
+    shrink.height = std::min(size.height, currentSize.height);
+
+    // 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, AlphaFunction::EASE_OUT, TimePeriod( 0.0f, durationSeconds * 0.5f ) );
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, AlphaFunction::EASE_IN, TimePeriod( 0.0f, durationSeconds ) );
+  }
+}
+
+Degree GridLayout::GetScrollDirection() const
+{
+  Degree scrollDirection(0.0f);
+  ControlOrientation::Type orientation = GetOrientation();
+
+  if ( orientation == ControlOrientation::Up )
+  {
+    scrollDirection = Degree( 0.0f );
+  }
+  else if ( orientation == ControlOrientation::Left )
+  {
+    scrollDirection = Degree( 90.0f );
+  }
+  else if ( orientation == ControlOrientation::Down )
+  {
+    scrollDirection = Degree( 180.0f );
+  }
+  else // orientation == ControlOrientation::Right
+  {
+    scrollDirection = Degree( 270.0f );
+  }
+
+  return scrollDirection;
+}
+
+void GridLayout::ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor )
+{
+  // This just implements the default behaviour of constraint application.
+  // Custom layouts can override this function to apply their custom constraints.
+  Dali::Toolkit::ItemView itemView = Dali::Toolkit::ItemView::DownCast( itemViewActor );
+  if( itemView )
+  {
+    Vector3 itemSize;
+    GetItemSize( itemId, layoutSize, itemSize );
+    const unsigned int columnIndex = itemId % mImpl->mNumberOfColumns;
+    const ControlOrientation::Type orientation = GetOrientation();
+
+    // Position constraint
+    GridPositionConstraint positionConstraint( itemId,
+                                               columnIndex,
+                                               mImpl->mNumberOfColumns,
+                                               mImpl->mRowSpacing,
+                                               mImpl->mColumnSpacing,
+                                               mImpl->mTopMargin,
+                                               mImpl->mSideMargin,
+                                               itemSize,
+                                               mImpl->mZGap );
+    Constraint constraint;
+    if ( orientation == ControlOrientation::Up )
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, positionConstraint, &GridPositionConstraint::Orientation0 );
+    }
+    else if ( orientation == ControlOrientation::Left )
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, positionConstraint, &GridPositionConstraint::Orientation90 );
+    }
+    else if ( orientation == ControlOrientation::Down )
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, positionConstraint, &GridPositionConstraint::Orientation180 );
+    }
+    else // orientation == ControlOrientation::Right
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, positionConstraint, &GridPositionConstraint::Orientation270 );
+    }
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
+    constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
+    constraint.Apply();
+
+    // Rotation constraint
+    if ( orientation == ControlOrientation::Up )
+    {
+      constraint = Constraint::New< Quaternion >( actor, Actor::Property::ORIENTATION, &GridRotationConstraint0 );
+    }
+    else if ( orientation == ControlOrientation::Left )
+    {
+      constraint = Constraint::New< Quaternion >( actor, Actor::Property::ORIENTATION, &GridRotationConstraint90 );
+    }
+    else if ( orientation == ControlOrientation::Down )
+    {
+      constraint = Constraint::New< Quaternion >( actor, Actor::Property::ORIENTATION, &GridRotationConstraint180 );
+    }
+    else // orientation == ControlOrientation::Right
+    {
+      constraint = Constraint::New< Quaternion >( actor, Actor::Property::ORIENTATION, &GridRotationConstraint270 );
+    }
+    constraint.Apply();
+
+    // Color constraint
+    constraint = Constraint::New< Vector4 >( actor, Actor::Property::COLOR, &GridColorConstraint );
+    constraint.SetRemoveAction( Dali::Constraint::Discard );
+    constraint.Apply();
+
+    // Visibility constraint
+    GridVisibilityConstraint visibilityConstraint( itemId,
+                                                   columnIndex,
+                                                   mImpl->mNumberOfColumns,
+                                                   mImpl->mRowSpacing,
+                                                   mImpl->mColumnSpacing,
+                                                   mImpl->mSideMargin,
+                                                   itemSize );
+    if ( IsVertical( orientation ) )
+    {
+      constraint = Constraint::New<bool>( actor, Actor::Property::VISIBLE, visibilityConstraint, &GridVisibilityConstraint::Portrait );
+    }
+    else // horizontal
+    {
+      constraint = Constraint::New<bool>( actor, Actor::Property::VISIBLE, visibilityConstraint, &GridVisibilityConstraint::Landscape );
+    }
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
+    constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
+    constraint.SetRemoveAction( Dali::Constraint::Discard );
+    constraint.Apply();
+  }
+}
+
+Vector3 GridLayout::GetItemPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) const
+{
+  Vector3 itemPosition = Vector3::ZERO;
+  const unsigned int columnIndex = itemID % mImpl->mNumberOfColumns;
+  const ControlOrientation::Type orientation = GetOrientation();
+  Vector3 itemSize;
+  GetItemSize( itemID, layoutSize, itemSize );
+
+  GridPositionConstraint positionConstraintStruct( itemID,
+                                                   columnIndex,
+                                                   mImpl->mNumberOfColumns,
+                                                   mImpl->mRowSpacing,
+                                                   mImpl->mColumnSpacing,
+                                                   mImpl->mTopMargin,
+                                                   mImpl->mSideMargin,
+                                                   itemSize,
+                                                   mImpl->mZGap );
+
+  if ( orientation == ControlOrientation::Up )
+  {
+    positionConstraintStruct.Orientation0( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+  else if ( orientation == ControlOrientation::Left )
+  {
+    positionConstraintStruct.Orientation90( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+  else if ( orientation == ControlOrientation::Down )
+  {
+    positionConstraintStruct.Orientation180( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+  else // orientation == ControlOrientation::Right
+  {
+    positionConstraintStruct.Orientation270( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+
+  return itemPosition;
+}
+
+int GridLayout::GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled)
+{
+  switch( direction )
+  {
+    case Toolkit::Control::Left:
+    {
+      itemID--;
+      if( itemID < 0 )
+      {
+        itemID = loopEnabled ? maxItems - 1 : 0;
+      }
+      break;
+    }
+    case Toolkit::Control::Up:
+    {
+      itemID -= mImpl->mNumberOfColumns;
+      if( itemID < 0 )
+      {
+        itemID = loopEnabled ? itemID + maxItems : itemID + mImpl->mNumberOfColumns;
+      }
+      break;
+    }
+    case Toolkit::Control::Right:
+    {
+      itemID++;
+      if( itemID >= maxItems )
+      {
+        itemID = loopEnabled ? 0 : maxItems - 1;
+      }
+      break;
+    }
+    case Toolkit::Control::Down:
+    {
+      itemID += mImpl->mNumberOfColumns;
+      if( itemID >= maxItems )
+      {
+        itemID = loopEnabled ? 0 : itemID - mImpl->mNumberOfColumns;
+      }
+      break;
+    }
+  }
+  return itemID;
+}
+
+GridLayout::GridLayout()
+: mImpl(NULL)
+{
+  mImpl = new Impl();
+}
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
@@ -28,6 +28,9 @@ namespace Dali
 namespace Toolkit
 {
 
+namespace Internal
+{
+
 class GridLayout;
 
 typedef IntrusivePtr<GridLayout> GridLayoutPtr; ///< Pointer to a Dali::Toolkit::GridLayout object
@@ -35,18 +38,11 @@ typedef IntrusivePtr<GridLayout> GridLayoutPtr; ///< Pointer to a Dali::Toolkit:
 /**
  * @brief An ItemView layout which arranges items in a grid.
  */
-class DALI_IMPORT_API GridLayout : public ItemLayout
+class GridLayout : public ItemLayout
 {
 public:
 
   /**
-   * @brief Function signature for a method to calculate the item size.
-   *
-   * @see SetItemSizeFunction()
-   */
-  typedef boost::function<Vector3 (unsigned int numberOfColumns, float layoutWidth, float sideMargin, float columnSpacing)> ItemSizeFunction;
-
-  /**
    * @brief Create a new grid layout.
    */
   static GridLayoutPtr New();
@@ -155,20 +151,6 @@ public:
   float GetZGap() const;
 
   /**
-   * @brief Set the function used to calculate the item-size, for a given layout-size.
-   *
-   * @param[in] function The item-size function.
-   */
-  void SetItemSizeFunction(ItemSizeFunction function);
-
-  /**
-   * @brief Get the function used to calculate the item-size.
-   *
-   * @return The item-size function.
-   */
-  ItemSizeFunction GetItemSizeFunction() const;
-
-  /**
    * @brief Set the factor used to customise the scroll speed while dragging and swiping the layout.
    *
    * @param[in] scrollSpeed The scroll speed factor.
@@ -247,9 +229,9 @@ private:
   virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const;
 
   /**
-   * @copydoc ItemLayout::GetItemSize()
+   * @copydoc ItemLayout::GetDefaultItemSize()
    */
-  virtual bool GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const;
+  virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const;
 
   /**
    * @copydoc ItemLayout::GetResizeAnimation()
@@ -257,34 +239,19 @@ private:
   virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const;
 
   /**
-   * @copydoc ItemLayout::GetPositionConstraint()
-   */
-  virtual bool GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetRotationConstraint()
-   */
-  virtual bool GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetScaleConstraint()
-   */
-  virtual bool GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetColorConstraint()
+   * @copydoc ItemLayout::GetScrollDirection()
    */
-  virtual bool GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const;
+  virtual Degree GetScrollDirection() const;
 
   /**
-   * @copydoc ItemLayout::GetVisibilityConstraint()
+   * @copydoc ItemLayout::ApplyConstraints()
    */
-  virtual bool GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const;
+  virtual void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor );
 
   /**
-   * @copydoc ItemLayout::GetScrollDirection()
+   * @copydoc ItemLayout::GetItemPosition()
    */
-  virtual Degree GetScrollDirection() const;
+  virtual Vector3 GetItemPosition( int itemID, float currentLayoutPosition, const Vector3& layoutSize ) const;
 
 protected:
 
@@ -299,6 +266,8 @@ private:
   Impl* mImpl;
 };
 
+} // namespace Internal
+
 } // namespace Toolkit
 
 } // namespace Dali
index d122e38..ddf9427 100644 (file)
 #include <algorithm>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/set-wrapper.h>
+#include <dali/devel-api/common/set-wrapper.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/mouse-wheel-event.h>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
 #include <dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h>
 
 using std::string;
 using std::set;
@@ -44,7 +44,15 @@ namespace // Unnamed namespace
 
 //Type registration
 
-DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ItemView, Toolkit::Scrollable, NULL )
+DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ItemView, Toolkit::Scrollable, NULL)
+
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ItemView, "layout-position",     FLOAT,    LAYOUT_POSITION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ItemView, "scroll-speed",        FLOAT,    SCROLL_SPEED)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ItemView, "overshoot",           FLOAT,    OVERSHOOT)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ItemView, "scroll-direction",    VECTOR2,  SCROLL_DIRECTION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ItemView, "layout-orientation",  INTEGER,  LAYOUT_ORIENTATION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ItemView, "scroll-content-size", FLOAT,    SCROLL_CONTENT_SIZE)
+
 DALI_TYPE_REGISTRATION_END()
 
 const float DEFAULT_MINIMUM_SWIPE_SPEED = 1.0f;
@@ -66,13 +74,6 @@ const float OVERSHOOT_BOUNCE_ACTOR_RESIZE_THRESHOLD = 180.0f;
 const Vector4 OVERSHOOT_OVERLAY_NINE_PATCH_BORDER(0.0f, 0.0f, 1.0f, 12.0f);
 const float DEFAULT_KEYBOARD_FOCUS_SCROLL_DURATION = 0.2f;
 
-const string LAYOUT_POSITION_PROPERTY_NAME( "item-view-layout-position" );
-const string POSITION_PROPERTY_NAME( "item-view-position" );
-const string MINIMUM_LAYOUT_POSITION_PROPERTY_NAME( "item-view-minimum-layout-position" );
-const string SCROLL_SPEED_PROPERTY_NAME( "item-view-scroll-speed" );
-const string SCROLL_DIRECTION_PROPERTY_NAME( "item-view-scroll-direction" );
-const string OVERSHOOT_PROPERTY_NAME( "item-view-overshoot" );
-
 /**
  * Local helper to convert pan distance (in actor coordinates) to the layout-specific scrolling direction
  */
@@ -89,11 +90,11 @@ float CalculateScrollDistance(Vector2 panDistance, Toolkit::ItemLayout& layout)
 // Overshoot overlay constraints
 void OvershootOverlaySizeConstraint( Vector3& current, const PropertyInputContainer& inputs )
 {
-  const Vector3& parentScrollDirection = inputs[0]->GetVector3();
-  const Vector3& parentSize = inputs[1]->GetVector3();
-  const Toolkit::ControlOrientation::Type& parentOrientation = static_cast<Toolkit::ControlOrientation::Type>(parentScrollDirection.z);
+  const Vector2& parentScrollDirection = inputs[0]->GetVector2();
+  const Toolkit::ControlOrientation::Type& layoutOrientation = static_cast<Toolkit::ControlOrientation::Type>(inputs[1]->GetInteger());
+  const Vector3& parentSize = inputs[2]->GetVector3();
 
-  if(Toolkit::IsVertical(parentOrientation))
+  if(Toolkit::IsVertical(layoutOrientation))
   {
     current.width = fabsf(parentScrollDirection.y) > Math::MACHINE_EPSILON_1 ? parentSize.x : parentSize.y;
   }
@@ -107,17 +108,17 @@ void OvershootOverlaySizeConstraint( Vector3& current, const PropertyInputContai
 
 void OvershootOverlayRotationConstraint( Quaternion& current, const PropertyInputContainer& inputs )
 {
-  const Vector3& parentScrollDirection = inputs[0]->GetVector3();
-  const float parentOvershoot = inputs[1]->GetFloat();
-  const Toolkit::ControlOrientation::Type& parentOrientation = static_cast<Toolkit::ControlOrientation::Type>(parentScrollDirection.z);
+  const Vector2& parentScrollDirection = inputs[0]->GetVector2();
+  const Toolkit::ControlOrientation::Type& layoutOrientation = static_cast<Toolkit::ControlOrientation::Type>(inputs[1]->GetInteger());
+  const float parentOvershoot = inputs[2]->GetFloat();
 
   float multiplier = 0;
-  if(Toolkit::IsVertical(parentOrientation))
+  if(Toolkit::IsVertical(layoutOrientation))
   {
     if(fabsf(parentScrollDirection.y) <= Math::MACHINE_EPSILON_1)
     {
-      if( (parentOrientation == Toolkit::ControlOrientation::Up && parentOvershoot < Math::MACHINE_EPSILON_0)
-          || (parentOrientation == Toolkit::ControlOrientation::Down && parentOvershoot > Math::MACHINE_EPSILON_0) )
+      if( (layoutOrientation == Toolkit::ControlOrientation::Up && parentOvershoot < Math::MACHINE_EPSILON_0)
+          || (layoutOrientation == Toolkit::ControlOrientation::Down && parentOvershoot > Math::MACHINE_EPSILON_0) )
       {
         multiplier = 0.5f;
       }
@@ -140,8 +141,8 @@ void OvershootOverlayRotationConstraint( Quaternion& current, const PropertyInpu
   {
     if(fabsf(parentScrollDirection.x) <= Math::MACHINE_EPSILON_1)
     {
-      if( (parentOrientation == Toolkit::ControlOrientation::Left && parentOvershoot > Math::MACHINE_EPSILON_0)
-          ||(parentOrientation == Toolkit::ControlOrientation::Right && parentOvershoot < Math::MACHINE_EPSILON_0) )
+      if( (layoutOrientation == Toolkit::ControlOrientation::Left && parentOvershoot > Math::MACHINE_EPSILON_0)
+          ||(layoutOrientation == Toolkit::ControlOrientation::Right && parentOvershoot < Math::MACHINE_EPSILON_0) )
       {
         multiplier = 1.0f;
       }
@@ -167,18 +168,18 @@ void OvershootOverlayRotationConstraint( Quaternion& current, const PropertyInpu
 void OvershootOverlayPositionConstraint( Vector3& current, const PropertyInputContainer& inputs )
 {
   const Vector3& parentSize = inputs[0]->GetVector3();
-  const Vector3& parentScrollDirection = inputs[1]->GetVector3();
-  const float parentOvershoot = inputs[2]->GetFloat();
-  const Toolkit::ControlOrientation::Type& parentOrientation = static_cast<Toolkit::ControlOrientation::Type>(parentScrollDirection.z);
+  const Vector2& parentScrollDirection = inputs[1]->GetVector2();
+  const Toolkit::ControlOrientation::Type& layoutOrientation = static_cast<Toolkit::ControlOrientation::Type>(inputs[2]->GetInteger());
+  const float parentOvershoot = inputs[3]->GetFloat();
 
   Vector3 relativeOffset;
 
-  if(Toolkit::IsVertical(parentOrientation))
+  if(Toolkit::IsVertical(layoutOrientation))
   {
     if(fabsf(parentScrollDirection.y) <= Math::MACHINE_EPSILON_1)
     {
-      if( (parentOrientation == Toolkit::ControlOrientation::Up && parentOvershoot < Math::MACHINE_EPSILON_0)
-          || (parentOrientation == Toolkit::ControlOrientation::Down && parentOvershoot > Math::MACHINE_EPSILON_0) )
+      if( (layoutOrientation == Toolkit::ControlOrientation::Up && parentOvershoot < Math::MACHINE_EPSILON_0)
+          || (layoutOrientation == Toolkit::ControlOrientation::Down && parentOvershoot > Math::MACHINE_EPSILON_0) )
       {
         relativeOffset = Vector3(1.0f, 0.0f, 0.0f);
       }
@@ -201,8 +202,8 @@ void OvershootOverlayPositionConstraint( Vector3& current, const PropertyInputCo
   {
     if(fabsf(parentScrollDirection.x) <= Math::MACHINE_EPSILON_1)
     {
-      if( (parentOrientation == Toolkit::ControlOrientation::Left && parentOvershoot < Math::MACHINE_EPSILON_0)
-          || (parentOrientation == Toolkit::ControlOrientation::Right && parentOvershoot > Math::MACHINE_EPSILON_0) )
+      if( (layoutOrientation == Toolkit::ControlOrientation::Left && parentOvershoot < Math::MACHINE_EPSILON_0)
+          || (layoutOrientation == Toolkit::ControlOrientation::Right && parentOvershoot > Math::MACHINE_EPSILON_0) )
       {
         relativeOffset = Vector3(0.0f, 0.0f, 0.0f);
       }
@@ -230,24 +231,6 @@ void OvershootOverlayVisibilityConstraint( bool& current, const PropertyInputCon
   current = inputs[0]->GetBoolean();
 }
 
-/**
- * Relative position Constraint
- * Generates the relative position value of the item view based on the layout position,
- * and it's relation to the layout domain. This is a value from 0.0f to 1.0f in each axis.
- */
-void RelativePositionConstraint( Vector3& current, const PropertyInputContainer& inputs )
-{
-  const Vector3& position = Vector3(0.0f, inputs[0]->GetFloat(), 0.0f);
-  const Vector3& min = inputs[1]->GetVector3();
-  const Vector3& max = inputs[2]->GetVector3();
-
-  Vector3 domainSize = max - min;
-
-  current.x = fabsf(domainSize.x) > Math::MACHINE_EPSILON_1 ? ((min.x - position.x) / fabsf(domainSize.x)) : 0.0f;
-  current.y = fabsf(domainSize.y) > Math::MACHINE_EPSILON_1 ? ((min.y - position.y) / fabsf(domainSize.y)) : 0.0f;
-  current.z = 0.0f;
-}
-
 } // unnamed namespace
 
 namespace Dali
@@ -298,7 +281,7 @@ ItemView::ItemView(ItemFactory& factory)
   mActiveLayout(NULL),
   mAnimatingOvershootOn(false),
   mAnimateOvershootOff(false),
-  mAnchoringEnabled(true),
+  mAnchoringEnabled(false),
   mAnchoringDuration(DEFAULT_ANCHORING_DURATION),
   mRefreshIntervalLayoutPositions(0.0f),
   mRefreshOrderHint(true/*Refresh item 0 first*/),
@@ -312,9 +295,6 @@ ItemView::ItemView(ItemFactory& factory)
   mIsFlicking(false),
   mGestureState(Gesture::Clear),
   mAddingItems(false),
-  mPropertyPosition(Property::INVALID_INDEX),
-  mPropertyMinimumLayoutPosition(Property::INVALID_INDEX),
-  mPropertyScrollSpeed(Property::INVALID_INDEX),
   mRefreshEnabled(true),
   mItemsParentOrigin( ParentOrigin::CENTER),
   mItemsAnchorPoint( AnchorPoint::CENTER)
@@ -325,21 +305,7 @@ void ItemView::OnInitialize()
 {
   Actor self = Self();
 
-  mScrollConnector = Dali::Toolkit::ScrollConnector::New();
-  mScrollPositionObject = mScrollConnector.GetScrollPositionObject();
-  mScrollConnector.ScrollPositionChangedSignal().Connect( this, &ItemView::OnScrollPositionChanged );
-
-  mPropertyMinimumLayoutPosition = self.RegisterProperty(MINIMUM_LAYOUT_POSITION_PROPERTY_NAME, 0.0f);
-  mPropertyPosition = self.RegisterProperty(POSITION_PROPERTY_NAME, 0.0f);
-  mPropertyScrollSpeed = self.RegisterProperty(SCROLL_SPEED_PROPERTY_NAME, 0.0f);
-
-  EnableScrollComponent(Toolkit::Scrollable::OvershootIndicator);
-
-  Constraint constraint = Constraint::New<Vector3>( self, Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION, RelativePositionConstraint );
-  constraint.AddSource( LocalSource( mPropertyPosition ) );
-  constraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.Apply();
+  SetOvershootEnabled(true);
 
   Vector2 stageSize = Stage::GetCurrent().GetSize();
   mMouseWheelScrollDistanceStep = stageSize.y * DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
@@ -356,11 +322,6 @@ ItemView::~ItemView()
 {
 }
 
-Dali::Toolkit::ScrollConnector ItemView::GetScrollConnector() const
-{
-  return mScrollConnector;
-}
-
 unsigned int ItemView::GetLayoutCount() const
 {
   return mLayouts.size();
@@ -395,7 +356,7 @@ ItemLayoutPtr ItemView::GetActiveLayout() const
 
 float ItemView::GetCurrentLayoutPosition(unsigned int itemId) const
 {
-  return mScrollConnector.GetScrollPosition() + static_cast<float>( itemId );
+  return Self().GetProperty<float>( Toolkit::ItemView::Property::LAYOUT_POSITION ) + static_cast<float>( itemId );
 }
 
 void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSize, float durationSeconds)
@@ -424,18 +385,15 @@ void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSiz
     actor.RemoveConstraints();
 
     Vector3 size;
-    if(mActiveLayout->GetItemSize(itemId, targetSize, size))
-    {
-      // resize immediately
-      actor.SetSize( size.GetVectorXY() );
-    }
+    mActiveLayout->GetItemSize( itemId, targetSize, size );
+    actor.SetSize( size.GetVectorXY() );
 
-    mActiveLayout->ApplyConstraints(actor, itemId, durationSeconds, mScrollPositionObject, Self() );
+    mActiveLayout->ApplyConstraints(actor, itemId, targetSize, Self() );
   }
 
   // Refresh the new layout
   ItemRange range = GetItemRange(*mActiveLayout, targetSize, GetCurrentLayoutPosition(0), false/* don't reserve extra*/);
-  AddActorsWithinRange( range, durationSeconds );
+  AddActorsWithinRange( range, targetSize );
 
   // Scroll to an appropriate layout position
 
@@ -444,7 +402,6 @@ void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSiz
 
   float current = GetCurrentLayoutPosition(0);
   float minimum = ClampFirstItemPosition(current, targetSize, *mActiveLayout);
-  self.SetProperty(mPropertyPosition, GetScrollPosition(current, targetSize));
 
   if (current < minimum)
   {
@@ -461,21 +418,18 @@ void ItemView::ActivateLayout(unsigned int layoutIndex, const Vector3& targetSiz
   {
     RemoveAnimation(mScrollAnimation);
     mScrollAnimation = Animation::New(durationSeconds);
-    mScrollAnimation.AnimateTo( Property( mScrollPositionObject, ScrollConnector::SCROLL_POSITION ), firstItemScrollPosition, AlphaFunction::EASE_OUT );
-    mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, targetSize), AlphaFunction::EASE_OUT );
+    mScrollAnimation.AnimateTo( Property(self, Toolkit::ItemView::Property::LAYOUT_POSITION), firstItemScrollPosition, AlphaFunction::EASE_OUT );
     mScrollAnimation.FinishedSignal().Connect(this, &ItemView::OnLayoutActivationScrollFinished);
     mScrollAnimation.Play();
   }
 
-  self.SetProperty(mPropertyMinimumLayoutPosition, mActiveLayout->GetMinimumLayoutPosition(mItemFactory.GetNumberOfItems(), targetSize));
   AnimateScrollOvershoot(0.0f);
   mScrollOvershoot = 0.0f;
 
   Radian scrollDirection(mActiveLayout->GetScrollDirection());
-  float orientation = static_cast<float>(mActiveLayout->GetOrientation());
-  self.SetProperty(Toolkit::Scrollable::Property::SCROLL_DIRECTION, Vector3(sinf(scrollDirection), cosf(scrollDirection), orientation));
-
-  self.SetProperty(mPropertyScrollSpeed, mScrollSpeed);
+  self.SetProperty(Toolkit::ItemView::Property::SCROLL_DIRECTION, Vector2(sinf(scrollDirection), cosf(scrollDirection)));
+  self.SetProperty(Toolkit::ItemView::Property::LAYOUT_ORIENTATION, static_cast<int>(mActiveLayout->GetOrientation()));
+  self.SetProperty(Toolkit::ItemView::Property::SCROLL_SPEED, mScrollSpeed);
 
   CalculateDomainSize(targetSize);
 }
@@ -520,9 +474,9 @@ void ItemView::DoRefresh(float currentLayoutPosition, bool cacheExtra)
   {
     ItemRange range = GetItemRange(*mActiveLayout, mActiveLayoutTargetSize, currentLayoutPosition, cacheExtra/*reserve extra*/);
     RemoveActorsOutsideRange( range );
-    AddActorsWithinRange( range, 0.0f/*immediate*/ );
+    AddActorsWithinRange( range, Self().GetCurrentSize() );
 
-    mScrollUpdatedSignal.Emit( Vector3(0.0f, currentLayoutPosition, 0.0f) );
+    mScrollUpdatedSignal.Emit( Vector2(0.0f, currentLayoutPosition) );
   }
 }
 
@@ -582,11 +536,12 @@ void ItemView::SetRefreshInterval(float intervalLayoutPositions)
   {
     mRefreshIntervalLayoutPositions = intervalLayoutPositions;
 
+    Actor self = Self();
     if(mRefreshNotification)
     {
-      mScrollPositionObject.RemovePropertyNotification(mRefreshNotification);
+      self.RemovePropertyNotification(mRefreshNotification);
     }
-    mRefreshNotification = mScrollPositionObject.AddPropertyNotification( ScrollConnector::SCROLL_POSITION, StepCondition(mRefreshIntervalLayoutPositions, 0.0f) );
+    mRefreshNotification = self.AddPropertyNotification( Toolkit::ItemView::Property::LAYOUT_POSITION, StepCondition(mRefreshIntervalLayoutPositions, 0.0f) );
     mRefreshNotification.NotifySignal().Connect( this, &ItemView::OnRefreshNotification );
   }
 }
@@ -633,6 +588,7 @@ unsigned int ItemView::GetItemId( Actor actor ) const
 void ItemView::InsertItem( Item newItem, float durationSeconds )
 {
   mAddingItems = true;
+  Vector3 layoutSize = Self().GetCurrentSize();
 
   Actor displacedActor;
   ItemPoolIter afterDisplacedIter = mItemPool.end();
@@ -640,7 +596,7 @@ void ItemView::InsertItem( Item newItem, float durationSeconds )
   ItemPoolIter foundIter = mItemPool.find( newItem.first );
   if( mItemPool.end() != foundIter )
   {
-    SetupActor( newItem, durationSeconds );
+    SetupActor( newItem, layoutSize );
     Self().Add( newItem.second );
 
     displacedActor = foundIter->second;
@@ -672,7 +628,7 @@ void ItemView::InsertItem( Item newItem, float durationSeconds )
       displacedActor = temp;
 
       iter->second.RemoveConstraints();
-      mActiveLayout->ApplyConstraints( iter->second, iter->first, durationSeconds, mScrollPositionObject, Self() );
+      mActiveLayout->ApplyConstraints( iter->second, iter->first, layoutSize, Self() );
     }
 
     // Create last item
@@ -684,11 +640,11 @@ void ItemView::InsertItem( Item newItem, float durationSeconds )
       mItemPool.insert( lastItem );
 
       lastItem.second.RemoveConstraints();
-      mActiveLayout->ApplyConstraints( lastItem.second, lastItem.first, durationSeconds, mScrollPositionObject, Self() );
+      mActiveLayout->ApplyConstraints( lastItem.second, lastItem.first, layoutSize, Self() );
     }
   }
 
-  CalculateDomainSize(Self().GetCurrentSize());
+  CalculateDomainSize( layoutSize );
 
   mAddingItems = false;
 }
@@ -696,6 +652,7 @@ void ItemView::InsertItem( Item newItem, float durationSeconds )
 void ItemView::InsertItems( const ItemContainer& newItems, float durationSeconds )
 {
   mAddingItems = true;
+  Vector3 layoutSize = Self().GetCurrentSize();
 
   // Insert from lowest id to highest
   std::set<Item> sortedItems;
@@ -739,16 +696,16 @@ void ItemView::InsertItems( const ItemContainer& newItems, float durationSeconds
     // If newly inserted
     if( FindById( newItems, iter->first ) )
     {
-      SetupActor( *iter, durationSeconds );
+      SetupActor( *iter, layoutSize );
     }
     else
     {
       iter->second.RemoveConstraints();
-      mActiveLayout->ApplyConstraints( iter->second, iter->first, durationSeconds, mScrollPositionObject, Self() );
+      mActiveLayout->ApplyConstraints( iter->second, iter->first, layoutSize, Self() );
     }
   }
 
-  CalculateDomainSize(Self().GetCurrentSize());
+  CalculateDomainSize( layoutSize );
 
   mAddingItems = false;
 }
@@ -758,7 +715,7 @@ void ItemView::RemoveItem( unsigned int itemId, float durationSeconds )
   bool actorsReordered = RemoveActor( itemId );
   if( actorsReordered )
   {
-    ReapplyAllConstraints( durationSeconds );
+    ReapplyAllConstraints();
 
     OnItemsRemoved();
   }
@@ -785,7 +742,7 @@ void ItemView::RemoveItems( const ItemIdContainer& itemIds, float durationSecond
 
   if( actorsReordered )
   {
-    ReapplyAllConstraints( durationSeconds );
+    ReapplyAllConstraints();
 
     OnItemsRemoved();
   }
@@ -844,8 +801,9 @@ bool ItemView::RemoveActor(unsigned int itemId)
 void ItemView::ReplaceItem( Item replacementItem, float durationSeconds )
 {
   mAddingItems = true;
+  Vector3 layoutSize = Self().GetCurrentSize();
 
-  SetupActor( replacementItem, durationSeconds );
+  SetupActor( replacementItem, layoutSize );
   Self().Add( replacementItem.second );
 
   const ItemPoolIter iter = mItemPool.find( replacementItem.first );
@@ -859,7 +817,7 @@ void ItemView::ReplaceItem( Item replacementItem, float durationSeconds )
     mItemPool.insert( replacementItem );
   }
 
-  CalculateDomainSize(Self().GetCurrentSize());
+  CalculateDomainSize( layoutSize );
 
   mAddingItems = false;
 }
@@ -892,7 +850,7 @@ void ItemView::RemoveActorsOutsideRange( ItemRange range )
   }
 }
 
-void ItemView::AddActorsWithinRange( ItemRange range, float durationSeconds )
+void ItemView::AddActorsWithinRange( ItemRange range, const Vector3& layoutSize )
 {
   range.end = std::min(mItemFactory.GetNumberOfItems(), range.end);
 
@@ -901,14 +859,14 @@ void ItemView::AddActorsWithinRange( ItemRange range, float durationSeconds )
   {
     for (unsigned int itemId = range.begin; itemId < range.end; ++itemId)
     {
-      AddNewActor( itemId, durationSeconds );
+      AddNewActor( itemId, layoutSize );
     }
   }
   else
   {
     for (unsigned int itemId = range.end; itemId > range.begin; --itemId)
     {
-      AddNewActor( itemId-1, durationSeconds );
+      AddNewActor( itemId-1, layoutSize );
     }
   }
 
@@ -917,7 +875,7 @@ void ItemView::AddActorsWithinRange( ItemRange range, float durationSeconds )
   CalculateDomainSize(Self().GetCurrentSize());
 }
 
-void ItemView::AddNewActor( unsigned int itemId, float durationSeconds )
+void ItemView::AddNewActor( unsigned int itemId, const Vector3& layoutSize )
 {
   mAddingItems = true;
 
@@ -931,7 +889,7 @@ void ItemView::AddNewActor( unsigned int itemId, float durationSeconds )
 
       mItemPool.insert( newItem );
 
-      SetupActor( newItem, durationSeconds );
+      SetupActor( newItem, layoutSize );
       Self().Add( actor );
     }
   }
@@ -939,7 +897,7 @@ void ItemView::AddNewActor( unsigned int itemId, float durationSeconds )
   mAddingItems = false;
 }
 
-void ItemView::SetupActor( Item item, float durationSeconds )
+void ItemView::SetupActor( Item item, const Vector3& layoutSize )
 {
   item.second.SetParentOrigin( mItemsParentOrigin );
   item.second.SetAnchorPoint( mItemsAnchorPoint );
@@ -947,12 +905,10 @@ void ItemView::SetupActor( Item item, float durationSeconds )
   if( mActiveLayout )
   {
     Vector3 size;
-    if( mActiveLayout->GetItemSize( item.first, mActiveLayoutTargetSize, size ) )
-    {
-      item.second.SetSize( size.GetVectorXY() );
-    }
+    mActiveLayout->GetItemSize( item.first, mActiveLayoutTargetSize, size );
+    item.second.SetSize( size.GetVectorXY() );
 
-    mActiveLayout->ApplyConstraints( item.second, item.first, durationSeconds, mScrollPositionObject, Self() );
+    mActiveLayout->ApplyConstraints( item.second, item.first, layoutSize, Self() );
   }
 }
 
@@ -986,11 +942,15 @@ void ItemView::OnChildAdd(Actor& child)
   if(!mAddingItems)
   {
     // We don't want to do this downcast check for any item added by ItemView itself.
-    Dali::Toolkit::ScrollComponent scrollComponent = Dali::Toolkit::ScrollComponent::DownCast(child);
-    if(scrollComponent)
+    Dali::Toolkit::ScrollBar scrollBar = Dali::Toolkit::ScrollBar::DownCast(child);
+    if(scrollBar)
     {
-      // Set the scroll connector when scroll bar is being added
-      scrollComponent.SetScrollConnector(mScrollConnector);
+      scrollBar.SetScrollPropertySource(Self(),
+                                        Toolkit::ItemView::Property::LAYOUT_POSITION,
+                                        Toolkit::Scrollable::Property::SCROLL_POSITION_MIN_Y,
+                                        Toolkit::Scrollable::Property::SCROLL_POSITION_MAX_Y,
+                                        Toolkit::ItemView::Property::SCROLL_CONTENT_SIZE);
+      scrollBar.ScrollPositionIntervalReachedSignal().Connect( this, &ItemView::OnScrollPositionChanged );
     }
   }
 }
@@ -1010,7 +970,7 @@ bool ItemView::OnTouchEvent(const TouchEvent& event)
 
     mScrollDistance = 0.0f;
     mScrollSpeed = 0.0f;
-    Self().SetProperty(mPropertyScrollSpeed, mScrollSpeed);
+    Self().SetProperty(Toolkit::ItemView::Property::SCROLL_SPEED, mScrollSpeed);
 
     mScrollOvershoot = 0.0f;
     AnimateScrollOvershoot(0.0f);
@@ -1036,8 +996,8 @@ bool ItemView::OnMouseWheelEvent(const MouseWheelEvent& event)
     float layoutPositionDelta = GetCurrentLayoutPosition(0) - (event.z * mMouseWheelScrollDistanceStep * mActiveLayout->GetScrollSpeedFactor());
     float firstItemScrollPosition = ClampFirstItemPosition(layoutPositionDelta, layoutSize, *mActiveLayout);
 
-    mScrollPositionObject.SetProperty( ScrollConnector::SCROLL_POSITION, firstItemScrollPosition );
-    self.SetProperty(mPropertyPosition, GetScrollPosition(firstItemScrollPosition, layoutSize));
+    self.SetProperty(Toolkit::ItemView::Property::LAYOUT_POSITION, firstItemScrollPosition );
+
     mScrollStartedSignal.Emit(GetCurrentScrollPosition());
     mRefreshEnabled = true;
   }
@@ -1077,15 +1037,17 @@ bool ItemView::OnMouseWheelEventFinished()
   return false;
 }
 
-void ItemView::ReapplyAllConstraints( float durationSeconds )
+void ItemView::ReapplyAllConstraints()
 {
+  Vector3 layoutSize = Self().GetCurrentSize();
+
   for (ConstItemPoolIter iter = mItemPool.begin(); iter != mItemPool.end(); ++iter)
   {
     unsigned int id = iter->first;
     Actor actor = iter->second;
 
     actor.RemoveConstraints();
-    mActiveLayout->ApplyConstraints(actor, id, durationSeconds, mScrollPositionObject, Self());
+    mActiveLayout->ApplyConstraints(actor, id, layoutSize, Self());
   }
 }
 
@@ -1097,8 +1059,7 @@ void ItemView::OnItemsRemoved()
   if( mActiveLayout )
   {
     float firstItemScrollPosition = ClampFirstItemPosition(GetCurrentLayoutPosition(0), Self().GetCurrentSize(), *mActiveLayout);
-
-    mScrollPositionObject.SetProperty( ScrollConnector::SCROLL_POSITION, firstItemScrollPosition );
+    Self().SetProperty( Toolkit::ItemView::Property::LAYOUT_POSITION, firstItemScrollPosition );
   }
 }
 
@@ -1108,7 +1069,7 @@ float ItemView::ClampFirstItemPosition(float targetPosition, const Vector3& targ
   float minLayoutPosition = layout.GetMinimumLayoutPosition(mItemFactory.GetNumberOfItems(), targetSize);
   float clamppedPosition = std::min(0.0f, std::max(minLayoutPosition, targetPosition));
   mScrollOvershoot = targetPosition - clamppedPosition;
-  self.SetProperty(mPropertyMinimumLayoutPosition, minLayoutPosition);
+  self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX, Vector2(0.0f, -minLayoutPosition));
 
   return clamppedPosition;
 }
@@ -1157,9 +1118,8 @@ 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, AlphaFunction::EASE_OUT );
-        mScrollAnimation.AnimateTo( Property(self, mPropertyPosition), GetScrollPosition(firstItemScrollPosition, layoutSize), AlphaFunction::EASE_OUT );
-        mScrollAnimation.AnimateTo( Property(self, mPropertyScrollSpeed), 0.0f, AlphaFunction::EASE_OUT );
+        mScrollAnimation.AnimateTo( Property(self, Toolkit::ItemView::Property::LAYOUT_POSITION ), firstItemScrollPosition, AlphaFunction::EASE_OUT );
+        mScrollAnimation.AnimateTo( Property(self, Toolkit::ItemView::Property::SCROLL_SPEED), 0.0f, AlphaFunction::EASE_OUT );
 
         mIsFlicking = true;
         // Check whether it has already scrolled to the end
@@ -1204,18 +1164,17 @@ void ItemView::OnPan( const PanGesture& gesture )
 
       float firstItemScrollPosition = ClampFirstItemPosition(layoutPositionDelta, layoutSize, *mActiveLayout);
 
-      float currentOvershoot = mScrollPositionObject.GetProperty<float>(ScrollConnector::OVERSHOOT);
+      float currentOvershoot = self.GetProperty<float>(Toolkit::ItemView::Property::OVERSHOOT);
 
-      mScrollPositionObject.SetProperty( ScrollConnector::SCROLL_POSITION, firstItemScrollPosition );
-      self.SetProperty(mPropertyPosition, GetScrollPosition(firstItemScrollPosition, layoutSize));
+      self.SetProperty(Toolkit::ItemView::Property::LAYOUT_POSITION, firstItemScrollPosition );
 
-      if( (firstItemScrollPosition >= 0.0f && currentOvershoot < 1.0f) || (firstItemScrollPosition <= mActiveLayout->GetMinimumLayoutPosition(mItemFactory.GetNumberOfItems(), layoutSize) && currentOvershoot > -1.0f) )
+      if( (firstItemScrollPosition >= 0.0f && currentOvershoot < 1.0f) || (firstItemScrollPosition >= mActiveLayout->GetMinimumLayoutPosition(mItemFactory.GetNumberOfItems(), layoutSize) && currentOvershoot > -1.0f) )
       {
         mTotalPanDisplacement += gesture.displacement;
       }
 
       mScrollOvershoot = CalculateScrollOvershoot();
-      mScrollPositionObject.SetProperty( ScrollConnector::OVERSHOOT, mScrollOvershoot );
+      self.SetProperty( Toolkit::ItemView::Property::OVERSHOOT, mScrollOvershoot );
     }
     break;
 
@@ -1287,7 +1246,7 @@ void ItemView::OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor)
     Vector3 layoutSize = Self().GetCurrentSize();
 
     float scrollTo = mActiveLayout->GetClosestOnScreenLayoutPosition(nextItemID, layoutPosition, layoutSize);
-    ScrollTo(Vector3(0.0f, scrollTo, 0.0f), DEFAULT_KEYBOARD_FOCUS_SCROLL_DURATION);
+    ScrollTo(Vector2(0.0f, scrollTo), DEFAULT_KEYBOARD_FOCUS_SCROLL_DURATION);
   }
 }
 
@@ -1301,9 +1260,8 @@ Animation ItemView::DoAnchoring()
     float anchorPosition = mActiveLayout->GetClosestAnchorPosition( GetCurrentLayoutPosition(0) );
 
     anchoringAnimation = Animation::New(mAnchoringDuration);
-    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 );
+    anchoringAnimation.AnimateTo( Property(self, Toolkit::ItemView::Property::LAYOUT_POSITION), anchorPosition, AlphaFunction::EASE_OUT );
+    anchoringAnimation.AnimateTo( Property(self, Toolkit::ItemView::Property::SCROLL_SPEED), 0.0f, AlphaFunction::EASE_OUT );
     if(!mIsFlicking)
     {
       AnimateScrollOvershoot(0.0f);
@@ -1363,14 +1321,13 @@ void ItemView::ScrollToItem(unsigned int itemId, float durationSeconds)
   {
     RemoveAnimation(mScrollAnimation);
     mScrollAnimation = Animation::New(durationSeconds);
-    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, Toolkit::ItemView::Property::LAYOUT_POSITION), firstItemScrollPosition, AlphaFunction::EASE_OUT );
     mScrollAnimation.FinishedSignal().Connect(this, &ItemView::OnScrollFinished);
     mScrollAnimation.Play();
   }
   else
   {
-    mScrollPositionObject.SetProperty( ScrollConnector::SCROLL_POSITION, firstItemScrollPosition );
+    self.SetProperty( Toolkit::ItemView::Property::LAYOUT_POSITION, firstItemScrollPosition );
     AnimateScrollOvershoot(0.0f);
   }
 
@@ -1400,25 +1357,23 @@ void ItemView::CalculateDomainSize(const Vector3& layoutSize)
     firstItemPosition = mActiveLayout->GetItemPosition( 0,0,layoutSize );
 
     float minLayoutPosition = mActiveLayout->GetMinimumLayoutPosition(mItemFactory.GetNumberOfItems(), layoutSize);
-    self.SetProperty(mPropertyMinimumLayoutPosition, minLayoutPosition);
     lastItemPosition = mActiveLayout->GetItemPosition( fabs(minLayoutPosition),fabs(minLayoutPosition),layoutSize );
 
     float domainSize;
 
     if(IsHorizontal(mActiveLayout->GetOrientation()))
     {
-      self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN, Vector3(0.0f, firstItemPosition.x, 0.0f));
-      self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX, Vector3(0.0f, lastItemPosition.x, 0.0f));
       domainSize = fabs(firstItemPosition.x - lastItemPosition.x);
     }
     else
     {
-      self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN, Vector3(0.0f, firstItemPosition.y, 0.0f));
-      self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX, Vector3(0.0f, lastItemPosition.y, 0.0f));
       domainSize = fabs(firstItemPosition.y - lastItemPosition.y);
     }
 
-    mScrollConnector.SetScrollDomain(minLayoutPosition, 0.0f, domainSize);
+    self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN, Vector2::ZERO);
+    self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX, Vector2(0.0f, -minLayoutPosition));
+
+    self.SetProperty(Toolkit::ItemView::Property::SCROLL_CONTENT_SIZE, domainSize);
 
     bool isLayoutScrollable = IsLayoutScrollable(layoutSize);
     self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL, isLayoutScrollable);
@@ -1426,14 +1381,14 @@ void ItemView::CalculateDomainSize(const Vector3& layoutSize)
   }
 }
 
-Vector3 ItemView::GetDomainSize() const
+Vector2 ItemView::GetDomainSize() const
 {
   Actor self = Self();
 
-  float minScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN);
-  float maxScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX);
+  float minScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MIN_Y);
+  float maxScrollPosition = self.GetProperty<float>(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX_Y);
 
-  return Vector3(0.0f, fabs(maxScrollPosition - minScrollPosition), 0.0f);
+  return Vector2(0.0f, fabs(GetScrollPosition(minScrollPosition, self.GetCurrentSize()) - GetScrollPosition(-maxScrollPosition, self.GetCurrentSize())));
 }
 
 bool ItemView::IsLayoutScrollable(const Vector3& layoutSize)
@@ -1453,10 +1408,9 @@ float ItemView::GetScrollPosition(float layoutPosition, const Vector3& layoutSiz
   return IsHorizontal(mActiveLayout->GetOrientation()) ? firstItemPosition.x: firstItemPosition.y;
 }
 
-Vector3 ItemView::GetCurrentScrollPosition() const
+Vector2 ItemView::GetCurrentScrollPosition() const
 {
-  float currentLayoutPosition = GetCurrentLayoutPosition(0);
-  return Vector3(0.0f, GetScrollPosition(currentLayoutPosition, Self().GetCurrentSize()), 0.0f);
+  return Vector2(0.0f, GetScrollPosition(GetCurrentLayoutPosition(0), Self().GetCurrentSize()));
 }
 
 void ItemView::AddOverlay(Actor actor)
@@ -1469,7 +1423,7 @@ void ItemView::RemoveOverlay(Actor actor)
   Self().Remove(actor);
 }
 
-void ItemView::ScrollTo(const Vector3& position, float duration)
+void ItemView::ScrollTo(const Vector2& position, float duration)
 {
   Actor self = Self();
   const Vector3 layoutSize = Self().GetCurrentSize();
@@ -1480,14 +1434,13 @@ void ItemView::ScrollTo(const Vector3& position, float duration)
   {
     RemoveAnimation(mScrollAnimation);
     mScrollAnimation = Animation::New(duration);
-    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, Toolkit::ItemView::Property::LAYOUT_POSITION), firstItemScrollPosition, AlphaFunction::EASE_OUT );
     mScrollAnimation.FinishedSignal().Connect(this, &ItemView::OnScrollFinished);
     mScrollAnimation.Play();
   }
   else
   {
-    mScrollPositionObject.SetProperty( ScrollConnector::SCROLL_POSITION, firstItemScrollPosition );
+    self.SetProperty( Toolkit::ItemView::Property::LAYOUT_POSITION, firstItemScrollPosition );
     AnimateScrollOvershoot(0.0f);
   }
 
@@ -1504,9 +1457,8 @@ void ItemView::SetOvershootEffectColor( const Vector4& color )
   }
 }
 
-void ItemView::SetOvershootEnabled( bool enable )
+void ItemView::EnableScrollOvershoot( bool enable )
 {
-/**
   Actor self = Self();
   if( enable )
   {
@@ -1517,22 +1469,26 @@ void ItemView::SetOvershootEnabled( bool enable )
     mOvershootOverlay.SetAnchorPoint(AnchorPoint::TOP_LEFT);
     mOvershootOverlay.SetDrawMode(DrawMode::OVERLAY);
     self.Add(mOvershootOverlay);
+
     Constraint constraint = Constraint::New<Vector3>( mOvershootOverlay, Actor::Property::SIZE, OvershootOverlaySizeConstraint );
-    constraint.AddSource( ParentSource( Toolkit::Scrollable::Property::SCROLL_DIRECTION ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::SCROLL_DIRECTION ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_ORIENTATION ) );
     constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
     constraint.Apply();
 
     mOvershootOverlay.SetSize(OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.width, OVERSHOOT_BOUNCE_ACTOR_DEFAULT_SIZE.height);
 
     constraint = Constraint::New<Quaternion>( mOvershootOverlay, Actor::Property::ORIENTATION, OvershootOverlayRotationConstraint );
-    constraint.AddSource( ParentSource( Toolkit::Scrollable::Property::SCROLL_DIRECTION ) );
-    constraint.AddSource( Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::SCROLL_DIRECTION ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_ORIENTATION ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::OVERSHOOT ) );
     constraint.Apply();
 
     constraint = Constraint::New<Vector3>( mOvershootOverlay, Actor::Property::POSITION, OvershootOverlayPositionConstraint );
     constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
-    constraint.AddSource( ParentSource( Toolkit::Scrollable::Property::SCROLL_DIRECTION ) );
-    constraint.AddSource( Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::SCROLL_DIRECTION ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_ORIENTATION ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::OVERSHOOT ) );
     constraint.Apply();
 
     constraint = Constraint::New<bool>( mOvershootOverlay, Actor::Property::VISIBLE, OvershootOverlayVisibilityConstraint );
@@ -1540,7 +1496,7 @@ void ItemView::SetOvershootEnabled( bool enable )
     constraint.Apply();
 
     constraint = Constraint::New<float>( mOvershootOverlay, effectOvershootPropertyIndex, EqualToConstraint() );
-    constraint.AddSource( Source( mScrollPositionObject, ScrollConnector::OVERSHOOT ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::OVERSHOOT ) );
     constraint.Apply();
   }
   else
@@ -1551,7 +1507,6 @@ void ItemView::SetOvershootEnabled( bool enable )
       mOvershootOverlay.Reset();
     }
   }
-*/
 }
 
 float ItemView::CalculateScrollOvershoot()
@@ -1566,7 +1521,7 @@ float ItemView::CalculateScrollOvershoot()
     float scrollDistance = CalculateScrollDistance(mTotalPanDisplacement, *mActiveLayout) * mActiveLayout->GetScrollSpeedFactor();
     float positionDelta = GetCurrentLayoutPosition(0) + scrollDistance;
     float minLayoutPosition = mActiveLayout->GetMinimumLayoutPosition(mItemFactory.GetNumberOfItems(), Self().GetCurrentSize());
-    self.SetProperty(mPropertyMinimumLayoutPosition, minLayoutPosition);
+    self.SetProperty(Toolkit::Scrollable::Property::SCROLL_POSITION_MAX, Vector2(0.0f, -minLayoutPosition));
     float clamppedPosition = std::min(0.0f, std::max(minLayoutPosition, positionDelta));
     overshoot = positionDelta - clamppedPosition;
   }
@@ -1587,29 +1542,29 @@ void ItemView::AnimateScrollOvershoot(float overshootAmount, bool animateBack)
     return;
   }
 
+  Actor self = Self();
+
   if(mOvershootAnimationSpeed > Math::MACHINE_EPSILON_0)
   {
-    //float currentOvershoot = mScrollPositionObject.GetProperty<float>(ScrollConnector::OVERSHOOT);
+    float currentOvershoot = self.GetProperty<float>(Toolkit::ItemView::Property::OVERSHOOT);
     float duration = 0.0f;
 
-    /**
     if (mOvershootOverlay)
     {
       duration = mOvershootOverlay.GetCurrentSize().height * (animatingOn ? (1.0f - fabsf(currentOvershoot)) : fabsf(currentOvershoot)) / mOvershootAnimationSpeed;
     }
-    */
 
     RemoveAnimation(mScrollOvershootAnimation);
     mScrollOvershootAnimation = Animation::New(duration);
     mScrollOvershootAnimation.FinishedSignal().Connect(this, &ItemView::OnOvershootOnFinished);
-    mScrollOvershootAnimation.AnimateTo( Property(mScrollPositionObject, ScrollConnector::OVERSHOOT), overshootAmount, TimePeriod(0.0f, duration) );
+    mScrollOvershootAnimation.AnimateTo( Property(self, Toolkit::ItemView::Property::OVERSHOOT), overshootAmount, TimePeriod(0.0f, duration) );
     mScrollOvershootAnimation.Play();
 
     mAnimatingOvershootOn = animatingOn;
   }
   else
   {
-    mScrollPositionObject.SetProperty( ScrollConnector::OVERSHOOT, overshootAmount );
+    self.SetProperty( Toolkit::ItemView::Property::OVERSHOOT, overshootAmount );
   }
 }
 
index 7c41d1f..5260c5c 100644 (file)
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/object/property-notification.h>
+#include <dali/devel-api/common/map-wrapper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
 #include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
 
@@ -61,11 +61,6 @@ public:
   static Dali::Toolkit::ItemView New(ItemFactory& factory);
 
   /**
-   * @copydoc Toolkit::ItemView::GetScrollConnector
-   */
-  Dali::Toolkit::ScrollConnector GetScrollConnector() const;
-
-  /**
    * @copydoc Toolkit::ItemView::GetLayoutCount
    */
   unsigned int GetLayoutCount() const;
@@ -218,12 +213,12 @@ public:
   /**
    * @copydoc Toolkit::Scrollable::GetDomainSize
    */
-  Vector3 GetDomainSize() const;
+  Vector2 GetDomainSize() const;
 
   /**
    * @copydoc Toolkit::Scrollable::GetCurrentScrollPosition
    */
-  Vector3 GetCurrentScrollPosition() const;
+  Vector2 GetCurrentScrollPosition() const;
 
   /**
    * @copydoc Toolkit::Scrollable::AddOverlay()
@@ -236,9 +231,9 @@ public:
   void RemoveOverlay(Actor actor);
 
   /**
-   * @copydoc Toolkit::Scrollable::ScrollTo(const Vector3& position, float duration)
+   * @copydoc Toolkit::Scrollable::ScrollTo(const Vector2& position, float duration)
    */
-  void ScrollTo(const Vector3& position, float duration);
+  void ScrollTo(const Vector2& position, float duration);
 
   /**
    * @copydoc Toolkit::Internal::Scrollable::SetOvershootEffectColor
@@ -307,23 +302,23 @@ private:
   /**
    * Add a range of Actors, if they are not already in the ItemPool.
    * @param[in] range The range of Item IDs to associate with the new actors.
-   * @param[in] durationSeconds The time taken to fully constrain the newly added actor.
+   * @param[in] layoutSize The layout-size.
    */
-  void AddActorsWithinRange( ItemRange range, float durationSeconds );
+  void AddActorsWithinRange( ItemRange range, const Vector3& layoutSize );
 
   /**
    * Add a new Actor, if not already in the ItemPool.
    * @param[in] item The ID for the new item.
-   * @param[in] durationSeconds The time taken to fully constrain the new actor.
+   * @param[in] layoutSize The layout-size.
    */
-  void AddNewActor( ItemId item, float durationSeconds );
+  void AddNewActor( ItemId item, const Vector3& layoutSize );
 
   /**
    * Apply the constraints etc. that are required for ItemView children.
    * @param[in] item The item to setup.
-   * @param[in] durationSeconds The time taken to fully constrain the actor.
+   * @param[in] layoutSize The layout-size.
    */
-  void SetupActor( Item item, float durationSeconds );
+  void SetupActor( Item item, const Vector3& layoutSize );
 
   /**
    * Remove the Actor from the ItemPool and notify the ItemFactory the actor has been released by ItemView.
@@ -401,7 +396,7 @@ private:
    * Helper to re-apply all the constraints after items have been inserted, removed etc.
    * @param[in] durationSeconds The time taken to fully constrain the actors.
    */
-  void ReapplyAllConstraints( float durationSeconds );
+  void ReapplyAllConstraints();
 
   /**
    * Helper to relayout after item(s) are removed.
@@ -494,9 +489,9 @@ private:
   void RemoveAnimation(Animation& animation);
 
   /**
-   * @copydoc Toolkit::Internal::Scrollable::SetOvershootEnabled
+   * @copydoc Toolkit::Internal::Scrollable::EnableScrollOvershoot
    */
-  virtual void SetOvershootEnabled( bool enable );
+  virtual void EnableScrollOvershoot( bool enable );
 
   /**
    * Helper to calculate the scroll overshoot according to the pan gesture displacement.
@@ -541,7 +536,7 @@ private:
   void OnRefreshNotification(PropertyNotification& source);
 
   /**
-   * This is called when scroll position has been changed by ScrollConnector::SetScrollPosition.
+   * This is called when the change of scroll position is notified by ScrollBar.
    * @param[in] position The new scroll position
    */
   void OnScrollPositionChanged( float position );
@@ -556,7 +551,7 @@ private:
 
   ItemPool mItemPool;
 
-  ItemLayoutContainer mLayouts;
+  std::vector< ItemLayoutPtr >  mLayouts;  ///<  Container of Dali::Toolkit::ItemLayout objects
   ItemLayout* mActiveLayout;
   Vector3 mActiveLayoutTargetSize;
 
@@ -592,15 +587,8 @@ private:
 
   Actor mOvershootOverlay;           ///< The overlay actor for overshoot effect
 
-  Dali::Toolkit::ScrollConnector mScrollConnector; ///< Connects ItemView with scrollable components e.g. scroll bars
-  Handle   mScrollPositionObject;     ///< From mScrollConnector
-
   bool mAddingItems;
 
-  Property::Index mPropertyPosition; ///< The physical position of the first item within the layout
-  Property::Index mPropertyMinimumLayoutPosition; ///< The minimum valid layout position in the layout.
-  Property::Index mPropertyScrollSpeed; ///< The current scroll speed of item view
-
   bool mRefreshEnabled; ///< Whether to refresh the cache automatically
 
   Vector3 mItemsParentOrigin;
diff --git a/dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.cpp b/dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.cpp
new file mode 100644 (file)
index 0000000..731fa90
--- /dev/null
@@ -0,0 +1,551 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics 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/scrollable/item-view/spiral-layout.h>
+
+// EXTERNAL INCLUDES
+#include <algorithm>
+#include <dali/public-api/animation/animation.h>
+#include <dali/public-api/animation/constraint.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace // unnamed namespace
+{
+
+const float DEFAULT_ITEMS_PER_SPIRAL_TURN = 9.5f;
+const float DEFAULT_ITEM_SPACING_RADIANS = Math::PI*2.0f/DEFAULT_ITEMS_PER_SPIRAL_TURN;
+
+const float DEFAULT_REVOLUTION_DISTANCE = 190.0f;
+const float DEFAULT_ITEM_DESCENT = DEFAULT_REVOLUTION_DISTANCE / DEFAULT_ITEMS_PER_SPIRAL_TURN;
+
+const float DEFAULT_TOP_ITEM_ALIGNMENT = -0.125f;
+
+const float DEFAULT_SCROLL_SPEED_FACTOR = 0.01f;
+const float DEFAULT_MAXIMUM_SWIPE_SPEED = 30.0f;
+const float DEFAULT_ITEM_FLICK_ANIMATION_DURATION = 0.1f;
+
+float GetDefaultSpiralRadiusFunction(const Vector3& layoutSize)
+{
+  return layoutSize.width*0.4f;
+}
+
+struct SpiralPositionConstraint
+{
+  SpiralPositionConstraint( unsigned int itemId, float spiralRadius, float itemSpacingRadians, float itemDescent, float topItemAlignment )
+  : mItemId( itemId ),
+    mSpiralRadius( spiralRadius ),
+    mItemSpacingRadians( itemSpacingRadians ),
+    mItemDescent( itemDescent ),
+    mTopItemAlignment( topItemAlignment )
+  {
+  }
+
+  inline void OrientationUp( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    float angle = -Math::PI * 0.5f + mItemSpacingRadians * layoutPosition;
+
+    current.x = -mSpiralRadius * cosf( angle );
+    current.y = ( mItemDescent * layoutPosition ) + layoutSize.height * mTopItemAlignment;
+    current.z = -mSpiralRadius * sinf( angle );
+  }
+
+  inline void OrientationLeft( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    float angle = Math::PI * 0.5f + mItemSpacingRadians * layoutPosition;
+
+    current.x = ( mItemDescent * layoutPosition ) + layoutSize.width * mTopItemAlignment;
+    current.y = -mSpiralRadius * cosf( angle );
+    current.z = mSpiralRadius * sinf( angle );
+  }
+
+  inline void OrientationDown( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    float angle = Math::PI * 0.5f + mItemSpacingRadians * layoutPosition;
+
+    current.x = -mSpiralRadius * cosf( angle );
+    current.y = ( -mItemDescent * layoutPosition ) - layoutSize.height * mTopItemAlignment;
+    current.z = mSpiralRadius * sinf(angle);
+  }
+
+  inline void OrientationRight( Vector3& current, float layoutPosition, const Vector3& layoutSize )
+  {
+    float angle = -Math::PI*0.5f + mItemSpacingRadians * layoutPosition;
+
+    current.x = (-mItemDescent * layoutPosition) - layoutSize.width * mTopItemAlignment;
+    current.y = -mSpiralRadius * cosf( angle );
+    current.z = -mSpiralRadius * sinf( angle );
+  }
+
+  void OrientationUp( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    OrientationUp( current, layoutPosition, layoutSize );
+  }
+
+  void OrientationLeft( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    OrientationLeft( current, layoutPosition, layoutSize );
+  }
+
+  void OrientationDown( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    OrientationDown( current, layoutPosition, layoutSize );
+  }
+
+  void OrientationRight( Vector3& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    OrientationRight( current, layoutPosition, layoutSize );
+  }
+
+  unsigned int mItemId;
+  float mSpiralRadius;
+  float mItemSpacingRadians;
+  float mItemDescent;
+  float mTopItemAlignment;
+};
+
+struct SpiralRotationConstraint
+{
+  SpiralRotationConstraint( unsigned int itemId, float itemSpacingRadians )
+  : mItemId( itemId ),
+    mItemSpacingRadians( itemSpacingRadians )
+  {
+  }
+
+  void OrientationUp( Quaternion& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    float angle = -mItemSpacingRadians * layoutPosition;
+
+    current = Quaternion( Radian( angle ), Vector3::YAXIS);
+  }
+
+  void OrientationLeft( Quaternion& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    float angle = -mItemSpacingRadians * layoutPosition;
+
+    current = Quaternion( Radian( -Math::PI * 0.5f ), Vector3::ZAXIS ) * Quaternion( Radian( angle ), Vector3::YAXIS );
+  }
+
+  void OrientationDown( Quaternion& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    float angle = -mItemSpacingRadians * layoutPosition;
+
+    current = Quaternion( Radian( -Math::PI ), Vector3::ZAXIS) * Quaternion( Radian( angle ), Vector3::YAXIS );
+  }
+
+  void OrientationRight( Quaternion& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    float angle = -mItemSpacingRadians * layoutPosition;
+
+    current = Quaternion( Radian( -Math::PI * 1.5f ), Vector3::ZAXIS) * Quaternion( Radian( angle ), Vector3::YAXIS );
+  }
+
+  unsigned int mItemId;
+  float mItemSpacingRadians;
+};
+
+struct SpiralColorConstraint
+{
+  SpiralColorConstraint( unsigned int itemId, float itemSpacingRadians )
+  : mItemId( itemId ),
+    mItemSpacingRadians( itemSpacingRadians )
+  {
+  }
+
+  void operator()( Vector4& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    Radian angle( mItemSpacingRadians * fabsf( layoutPosition ) / Dali::ANGLE_360 );
+
+    float progress = angle - floorf( angle ); // take fractional bit only to get between 0.0 - 1.0
+    progress = (progress > 0.5f) ? 2.0f*(1.0f - progress) : progress*2.0f;
+
+    float darkness(1.0f);
+    {
+      const float startMarker = 0.10f; // The progress at which darkening starts
+      const float endMarker   = 0.35f; // The progress at which darkening ends
+      const float minDarkness = 0.15f; // The darkness at end marker
+
+      if (progress > endMarker)
+      {
+        darkness = minDarkness;
+      }
+      else if (progress > startMarker)
+      {
+        darkness = 1.0f - ( (1.0f - minDarkness) * ((progress-startMarker) / (endMarker-startMarker)) );
+      }
+    }
+
+    current.r = current.g = current.b = darkness;
+  }
+
+  unsigned int mItemId;
+  float mItemSpacingRadians;
+};
+
+struct SpiralVisibilityConstraint
+{
+  SpiralVisibilityConstraint( unsigned int itemId, float itemSpacingRadians, float itemDescent, float topItemAlignment )
+  : mItemId( itemId ),
+    mItemSpacingRadians( itemSpacingRadians ),
+    mItemDescent( itemDescent ),
+    mTopItemAlignment( topItemAlignment )
+  {
+  }
+
+  void Portrait( bool& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    float itemsCachedBeforeTopItem = layoutSize.height*(mTopItemAlignment+0.5f) / mItemDescent;
+    current = ( layoutPosition >= -itemsCachedBeforeTopItem - 1.0f && layoutPosition <= ( layoutSize.height / mItemDescent ) + 1.0f );
+  }
+
+  void Landscape( bool& current, const PropertyInputContainer& inputs )
+  {
+    float layoutPosition = inputs[0]->GetFloat() + static_cast< float >( mItemId );
+    const Vector3& layoutSize = inputs[1]->GetVector3();
+    float itemsCachedBeforeTopItem = layoutSize.width*(mTopItemAlignment+0.5f) / mItemDescent;
+    current = ( layoutPosition >= -itemsCachedBeforeTopItem - 1.0f && layoutPosition <= ( layoutSize.width / mItemDescent ) + 1.0f );
+  }
+
+  unsigned int mItemId;
+  float mItemSpacingRadians;
+  float mItemDescent;
+  float mTopItemAlignment;
+};
+
+} // unnamed namespace
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+struct SpiralLayout::Impl
+{
+  Impl()
+  : mItemSpacingRadians(DEFAULT_ITEM_SPACING_RADIANS),
+    mRevolutionDistance(DEFAULT_REVOLUTION_DISTANCE),
+    mItemDescent(DEFAULT_ITEM_DESCENT),
+    mTopItemAlignment(DEFAULT_TOP_ITEM_ALIGNMENT),
+    mScrollSpeedFactor(DEFAULT_SCROLL_SPEED_FACTOR),
+    mMaximumSwipeSpeed(DEFAULT_MAXIMUM_SWIPE_SPEED),
+    mItemFlickAnimationDuration(DEFAULT_ITEM_FLICK_ANIMATION_DURATION)
+  {
+  }
+
+  float mItemSpacingRadians;
+  float mRevolutionDistance;
+  float mItemDescent;
+  float mTopItemAlignment;
+  float mScrollSpeedFactor;
+  float mMaximumSwipeSpeed;
+  float mItemFlickAnimationDuration;
+};
+
+SpiralLayoutPtr SpiralLayout::New()
+{
+  return SpiralLayoutPtr(new SpiralLayout());
+}
+
+SpiralLayout::~SpiralLayout()
+{
+  delete mImpl;
+}
+
+void SpiralLayout::SetItemSpacing(Radian itemSpacing)
+{
+  mImpl->mItemSpacingRadians = itemSpacing;
+
+  float itemsPerSpiral = std::max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
+  mImpl->mItemDescent = mImpl->mRevolutionDistance / itemsPerSpiral;
+}
+
+Radian SpiralLayout::GetItemSpacing() const
+{
+  return Radian( mImpl->mItemSpacingRadians );
+}
+
+void SpiralLayout::SetRevolutionDistance(float distance)
+{
+  mImpl->mRevolutionDistance = distance;
+
+  float itemsPerSpiral = std::max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
+  mImpl->mItemDescent = mImpl->mRevolutionDistance / itemsPerSpiral;
+}
+
+float SpiralLayout::GetRevolutionDistance() const
+{
+  return mImpl->mRevolutionDistance;
+}
+
+void SpiralLayout::SetTopItemAlignment(float alignment)
+{
+  mImpl->mTopItemAlignment = alignment;
+}
+
+float SpiralLayout::GetTopItemAlignment() const
+{
+  return mImpl->mTopItemAlignment;
+}
+
+void SpiralLayout::SetScrollSpeedFactor(float scrollSpeed)
+{
+  mImpl->mScrollSpeedFactor = scrollSpeed;
+}
+
+void SpiralLayout::SetMaximumSwipeSpeed(float speed)
+{
+  mImpl->mMaximumSwipeSpeed = speed;
+}
+
+void SpiralLayout::SetItemFlickAnimationDuration(float durationSeconds)
+{
+  mImpl->mItemFlickAnimationDuration = durationSeconds;
+}
+
+float SpiralLayout::GetScrollSpeedFactor() const
+{
+  return mImpl->mScrollSpeedFactor;
+}
+
+float SpiralLayout::GetMaximumSwipeSpeed() const
+{
+  return mImpl->mMaximumSwipeSpeed;
+}
+
+float SpiralLayout::GetItemFlickAnimationDuration() const
+{
+  return mImpl->mItemFlickAnimationDuration;
+}
+
+float SpiralLayout::GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
+{
+  return 1.0f - static_cast<float>(numberOfItems);
+}
+
+float SpiralLayout::GetClosestAnchorPosition(float layoutPosition) const
+{
+  return round(layoutPosition);
+}
+
+float SpiralLayout::GetItemScrollToPosition(unsigned int itemId) const
+{
+  return -(static_cast<float>(itemId));
+}
+
+ItemRange SpiralLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
+{
+  float layoutHeight = IsHorizontal( GetOrientation() ) ? layoutSize.width : layoutSize.height;
+  float itemsPerSpiral = layoutHeight / mImpl->mItemDescent;
+  float itemsCachedBeforeTopItem = layoutHeight * (mImpl->mTopItemAlignment + 0.5f) / mImpl->mItemDescent;
+  float itemsViewable = std::min(itemsPerSpiral, itemsPerSpiral - itemsCachedBeforeTopItem - firstItemPosition + 1.0f);
+
+  unsigned int firstItem = static_cast<unsigned int>(std::max(0.0f, -firstItemPosition - itemsCachedBeforeTopItem - 1.0f));
+  unsigned int lastItem  = static_cast<unsigned int>(std::max(0.0f, firstItem + itemsViewable));
+
+  return ItemRange(firstItem, lastItem+1);
+}
+
+unsigned int SpiralLayout::GetReserveItemCount(Vector3 layoutSize) const
+{
+  float layoutHeight = IsHorizontal( GetOrientation() ) ? layoutSize.width : layoutSize.height;
+  return static_cast<unsigned int>(layoutHeight / mImpl->mItemDescent);
+}
+
+void SpiralLayout::GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const
+{
+  itemSize.width = layoutSize.width * 0.25f;
+
+  // 4x3 aspect ratio
+  itemSize.height = itemSize.depth = ( itemSize.width / 4.0f ) * 3.0f;
+}
+
+void SpiralLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
+{
+  if(animation)
+  {
+    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size );
+  }
+}
+
+Degree SpiralLayout::GetScrollDirection() const
+{
+  Degree scrollDirection(0);
+  const ControlOrientation::Type orientation = GetOrientation();
+
+  if ( orientation == ControlOrientation::Up )
+  {
+    scrollDirection = Degree( -45.0f ); // Allow swiping horizontally & vertically
+  }
+  else if ( orientation == ControlOrientation::Left )
+  {
+    scrollDirection = Degree( 45.0f );
+  }
+  else if ( orientation == ControlOrientation::Down )
+  {
+    scrollDirection = Degree( 180.0f - 45.0f );
+  }
+  else // orientation == ControlOrientation::Right
+  {
+    scrollDirection = Degree( 270.0f - 45.0f );
+  }
+
+  return scrollDirection;
+}
+
+void SpiralLayout::ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor )
+{
+  // This just implements the default behaviour of constraint application.
+  // Custom layouts can override this function to apply their custom constraints.
+  Dali::Toolkit::ItemView itemView = Dali::Toolkit::ItemView::DownCast( itemViewActor );
+  if( itemView )
+  {
+    const ControlOrientation::Type orientation = GetOrientation();
+
+    // Position constraint
+    SpiralPositionConstraint positionConstraint( itemId, GetDefaultSpiralRadiusFunction( layoutSize ), mImpl->mItemSpacingRadians, mImpl->mItemDescent, mImpl->mTopItemAlignment );
+    Constraint constraint;
+    if ( orientation == ControlOrientation::Up )
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, positionConstraint, &SpiralPositionConstraint::OrientationUp );
+    }
+    else if ( orientation == ControlOrientation::Left )
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, positionConstraint, &SpiralPositionConstraint::OrientationLeft );
+    }
+    else if ( orientation == ControlOrientation::Down )
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, positionConstraint, &SpiralPositionConstraint::OrientationDown );
+    }
+    else // orientation == ControlOrientation::Right
+    {
+      constraint = Constraint::New< Vector3 >( actor, Actor::Property::POSITION, positionConstraint, &SpiralPositionConstraint::OrientationRight );
+    }
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
+    constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
+    constraint.Apply();
+
+    // Rotation constraint
+    SpiralRotationConstraint rotationConstraint( itemId, mImpl->mItemSpacingRadians );
+    if ( orientation == ControlOrientation::Up )
+    {
+      constraint = Constraint::New< Quaternion >( actor, Actor::Property::ORIENTATION, rotationConstraint, &SpiralRotationConstraint::OrientationUp );
+    }
+    else if ( orientation == ControlOrientation::Left )
+    {
+      constraint = Constraint::New< Quaternion >( actor, Actor::Property::ORIENTATION, rotationConstraint, &SpiralRotationConstraint::OrientationLeft );
+    }
+    else if ( orientation == ControlOrientation::Down )
+    {
+      constraint = Constraint::New< Quaternion >( actor, Actor::Property::ORIENTATION, rotationConstraint, &SpiralRotationConstraint::OrientationDown );
+    }
+    else // orientation == ControlOrientation::Right
+    {
+      constraint = Constraint::New< Quaternion >( actor, Actor::Property::ORIENTATION, rotationConstraint, &SpiralRotationConstraint::OrientationRight );
+    }
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
+    constraint.Apply();
+
+    // Color constraint
+    constraint = Constraint::New< Vector4 >( actor, Actor::Property::COLOR, SpiralColorConstraint( itemId, mImpl->mItemSpacingRadians ) );
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
+    constraint.SetRemoveAction(Dali::Constraint::Discard);
+    constraint.Apply();
+
+    // Visibility constraint
+    SpiralVisibilityConstraint visibilityConstraint( itemId, mImpl->mItemSpacingRadians, mImpl->mItemDescent, mImpl->mTopItemAlignment );
+    if (IsVertical( orientation ) )
+    {
+      constraint = Constraint::New< bool >( actor, Actor::Property::VISIBLE, visibilityConstraint, &SpiralVisibilityConstraint::Portrait );
+    }
+    else // horizontal
+    {
+      constraint = Constraint::New< bool >( actor, Actor::Property::VISIBLE, visibilityConstraint, &SpiralVisibilityConstraint::Landscape );
+    }
+    constraint.AddSource( ParentSource( Toolkit::ItemView::Property::LAYOUT_POSITION ) );
+    constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
+    constraint.SetRemoveAction(Dali::Constraint::Discard);
+    constraint.Apply();
+  }
+}
+
+Vector3 SpiralLayout::GetItemPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) const
+{
+  Vector3 itemPosition = Vector3::ZERO;
+  const ControlOrientation::Type orientation = GetOrientation();
+
+  SpiralPositionConstraint positionConstraint( itemID, GetDefaultSpiralRadiusFunction( layoutSize ), mImpl->mItemSpacingRadians, mImpl->mItemDescent, mImpl->mTopItemAlignment );
+
+  if ( orientation == ControlOrientation::Up )
+  {
+    positionConstraint.OrientationUp( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+  else if ( orientation == ControlOrientation::Left )
+  {
+    positionConstraint.OrientationLeft( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+  else if ( orientation == ControlOrientation::Down )
+  {
+    positionConstraint.OrientationDown( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+  else // orientation == ControlOrientation::Right
+  {
+    positionConstraint.OrientationRight( itemPosition, currentLayoutPosition + itemID, layoutSize );
+  }
+
+  return itemPosition;
+}
+
+SpiralLayout::SpiralLayout()
+: mImpl(NULL)
+{
+  mImpl = new Impl();
+}
+
+float SpiralLayout::GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize)
+{
+  return GetItemScrollToPosition(itemID);
+}
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
@@ -28,6 +28,9 @@ namespace Dali
 namespace Toolkit
 {
 
+namespace Internal
+{
+
 class SpiralLayout;
 
 typedef IntrusivePtr<SpiralLayout> SpiralLayoutPtr;
@@ -35,13 +38,10 @@ typedef IntrusivePtr<SpiralLayout> SpiralLayoutPtr;
 /**
  * An ItemView layout which arranges items in a spiral.
  */
-class DALI_IMPORT_API SpiralLayout : public ItemLayout
+class SpiralLayout : public ItemLayout
 {
 public:
 
-  typedef boost::function<Vector3 (const Vector3& layoutSize)> ItemSizeFunction;
-  typedef boost::function<float   (const Vector3& layoutSize)> SpiralRadiusFunction;
-
   /**
    * Create a new spiral layout
    */
@@ -53,18 +53,6 @@ public:
   virtual ~SpiralLayout();
 
   /**
-   * Set the function used to calculate the item-size, for a given layout-size.
-   * @param[in] function The item-size function.
-   */
-  void SetItemSizeFunction(ItemSizeFunction function);
-
-  /**
-   * Get the function used to calculate the item-size
-   * @return The item-size function.
-   */
-  ItemSizeFunction GetItemSizeFunction() const;
-
-  /**
    * Set spacing angle between items.
    * @param[in] itemSpacing The angle in radians.
    */
@@ -89,18 +77,6 @@ public:
   float GetRevolutionDistance() const;
 
   /**
-   * Set the function used to calculate the spiral radius, for a given layout-size.
-   * @param[in] function The spiral-radius function.
-   */
-  void SetSpiralRadiusFunction(SpiralRadiusFunction function);
-
-  /**
-   * Get the function used to calculate the spiral radius.
-   * @return The spiral-radius function.
-   */
-  SpiralRadiusFunction GetSpiralRadiusFunction() const;
-
-  /**
    * Set the alignment of the top-item, when at the beginning of the spiral (with a first-item layout-position of zero).
    * A value of 0 indicates that the top-item is centered in the middle of the layout. A value of -0.5 or 0.5 indicates
    * that the top-item is centred at the top or bottom of the layout respectively.
@@ -183,9 +159,9 @@ private:
   virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const;
 
   /**
-   * @copydoc ItemLayout::GetItemSize()
+   * @copydoc ItemLayout::GetDefaultItemSize()
    */
-  virtual bool GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const;
+  virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const;
 
   /**
    * @copydoc ItemLayout::GetResizeAnimation()
@@ -193,34 +169,19 @@ private:
   virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const;
 
   /**
-   * @copydoc ItemLayout::GetPositionConstraint()
-   */
-  virtual bool GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetRotationConstraint()
-   */
-  virtual bool GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetScaleConstraint()
-   */
-  virtual bool GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const;
-
-  /**
-   * @copydoc ItemLayout::GetColorConstraint()
+   * @copydoc ItemLayout::GetScrollDirection()
    */
-  virtual bool GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const;
+  virtual Degree GetScrollDirection() const;
 
   /**
-   * @copydoc ItemLayout::GetVisibilityConstraint()
+   * @copydoc ItemLayout::ApplyConstraints()
    */
-  virtual bool GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const;
+  virtual void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor );
 
   /**
-   * @copydoc ItemLayout::GetScrollDirection()
+   * @copydoc ItemLayout::GetItemPosition()
    */
-  virtual Degree GetScrollDirection() const;
+  virtual Vector3 GetItemPosition( int itemID, float currentLayoutPosition, const Vector3& layoutSize ) const;
 
 protected:
 
@@ -235,6 +196,8 @@ private:
   Impl* mImpl;
 };
 
+} // namespace Internal
+
 } // namespace Toolkit
 
 } // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp
deleted file mode 100644 (file)
index 9e8eb84..0000000
+++ /dev/null
@@ -1,116 +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/scrollable/scroll-connector-impl.h>
-
-// EXTERNAL INCLUDES
-#include <cstring> // for strcmp
-#include <dali/public-api/object/property-index-ranges.h>
-#include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
-#include <dali/integration-api/debug.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace
-{
-
-// Setup properties, signals and actions using the type-registry.
-DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollConnector, Dali::BaseHandle, NULL )
-
-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()
-
-}
-
-const Property::Index ScrollConnector::SCROLL_POSITION = Dali::PROPERTY_CUSTOM_START_INDEX;
-const Property::Index ScrollConnector::OVERSHOOT       = Dali::PROPERTY_CUSTOM_START_INDEX + 1;
-
-ScrollConnector* ScrollConnector::New()
-{
-  return new ScrollConnector();
-}
-
-void ScrollConnector::SetScrollDomain( float min, float max, float length )
-{
-  mMinLimit = min;
-  mMaxLimit = max;
-  mContentLength = length;
-
-  mDomainChangedSignal.Emit( mMinLimit, mMaxLimit, mContentLength );
-}
-
-void ScrollConnector::SetScrollPosition( float position )
-{
-  mScrollPositionObject.SetProperty( Toolkit::ScrollConnector::SCROLL_POSITION, position );
-  mScrollPositionChangedSignal.Emit( position );
-}
-
-bool ScrollConnector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
-{
-  Dali::BaseHandle handle( object );
-
-  bool connected( true );
-  Toolkit::ScrollConnector scrollConnector = Toolkit::ScrollConnector::DownCast( handle );
-
-  if( 0 == strcmp( signalName.c_str(), DOMAIN_CHANGED_SIGNAL_NAME ) )
-  {
-    scrollConnector.DomainChangedSignal().Connect( tracker, functor );
-  }
-  else if( 0 == strcmp( signalName.c_str(), SCROLL_POSITION_CHANGED_SIGNAL_NAME ) )
-  {
-    scrollConnector.ScrollPositionChangedSignal().Connect( tracker, functor );
-  }
-  else
-  {
-    // signalName does not match any signal
-    connected = false;
-  }
-
-  return connected;
-}
-
-ScrollConnector::ScrollConnector()
-: mMinLimit( 0.0f ),
-  mMaxLimit( 0.0f ),
-  mContentLength( 0.0f )
-{
-  mScrollPositionObject = Handle::New();
-
-  mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::SCROLL_POSITION_PROPERTY_NAME, 0.0f );
-  mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::OVERSHOOT_PROPERTY_NAME, 0.0f );
-}
-
-ScrollConnector::~ScrollConnector()
-{
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h
deleted file mode 100644 (file)
index ff91e1b..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_CONNECTOR_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_CONNECTOR_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/base-object.h>
-#include <dali/public-api/signals/dali-signal.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-/**
- * @copydoc Toolkit::ScrollConnector
- */
-class ScrollConnector : public Dali::BaseObject
-{
-public:
-
-  typedef Toolkit::ScrollConnector::DomainChangedSignalType DomainChangedSignalType;
-  typedef Toolkit::ScrollConnector::ScrollPositionChangedSignalType ScrollPositionChangedSignalType;
-
-  static const Property::Index SCROLL_POSITION;
-  static const Property::Index OVERSHOOT;
-
-  /**
-   * Create a ScrollConnector.
-   * @return A newly allocated ScrollConnector.
-   */
-  static ScrollConnector* New();
-
-  /**
-   * @copydoc Toolkit::ScrollConnector::SetScrollDomain()
-   */
-  void SetScrollDomain( float min, float max, float length );
-
-  /**
-   * @copydoc Toolkit::ScrollConnector::GetMinLimit()
-   */
-  float GetMinLimit() const
-  {
-    return mMinLimit;
-  }
-
-  /**
-   * @copydoc Toolkit::ScrollConnector::GetMaxLimit()
-   */
-  float GetMaxLimit() const
-  {
-    return mMaxLimit;
-  }
-
-  /**
-   * @copydoc Toolkit::ScrollConnector::GetContentLength()
-   */
-  float GetContentLength() const
-  {
-    return mContentLength;
-  }
-
-  /**
-   * @copydoc Toolkit::ScrollConnector::SetScrollPosition()
-   */
-  void SetScrollPosition( float position );
-
-  /**
-   * @copydoc Toolkit::ScrollConnector::GetScrollPosition()
-   */
-  float GetScrollPosition() const
-  {
-    return mScrollPositionObject.GetProperty<float>( Toolkit::ScrollConnector::SCROLL_POSITION );
-  }
-
-  /**
-   * Signal emitted after the SetScrollPosition() method has been called.
-   */
-  ScrollPositionChangedSignalType& ScrollPositionChangedSignal()
-  {
-    return mScrollPositionChangedSignal;
-  }
-
-  /**
-   * Signal emitted after the SetScrollDomain() method has been called.
-   */
-  DomainChangedSignalType& DomainChangedSignal()
-  {
-    return mDomainChangedSignal;
-  }
-
-  /**
-   * Retrieve the object which provides the "scroll-position" property.
-   * @return The scroll-position object.
-   */
-  Handle GetScrollPositionObject() const
-  {
-    return mScrollPositionObject;
-  }
-
-  /**
-   * 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:
-
-  /**
-   * Create a new ScrollConnector.
-   */
-  ScrollConnector();
-
-  /**
-   * Virtual destructor
-   */
-  virtual ~ScrollConnector();
-
-  // Undefined
-  ScrollConnector(const ScrollConnector&);
-
-  // Undefined
-  ScrollConnector& operator=(const ScrollConnector& rhs);
-
-private:
-
-  Handle mScrollPositionObject;
-
-  DomainChangedSignalType mDomainChangedSignal;
-  ScrollPositionChangedSignalType mScrollPositionChangedSignal;
-
-  float mMinLimit;
-  float mMaxLimit;
-  float mContentLength;
-};
-
-} // namespace Internal
-
-inline Internal::ScrollConnector& GetImpl(Dali::Toolkit::ScrollConnector& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  Dali::BaseObject& handle = obj.GetBaseObject();
-
-  return static_cast<Internal::ScrollConnector&>(handle);
-}
-
-inline const Internal::ScrollConnector& GetImpl(const Dali::Toolkit::ScrollConnector& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  const Dali::BaseObject& handle = obj.GetBaseObject();
-
-  return static_cast<const Internal::ScrollConnector&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_CONNECTOR_H__
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp
deleted file mode 100644 (file)
index 86ad736..0000000
+++ /dev/null
@@ -1,290 +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/animation/constraint.h>
-#include <dali/public-api/object/property-input.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h>
-
-using namespace Dali;
-
-namespace // unnamed namespace
-{
-
-/**
- * Gets a property index. If the property doesn't already exist, then
- * it will create the property.
- * @param[in] handle The handle that owns or will own the property
- * @param[in] name The name for this property
- * @param[in] propertyValue The initial value for this property
- * @return The property index for this property is returned.
- */
-Property::Index SafeRegisterProperty( Handle& handle, const std::string& name, Property::Value propertyValue )
-{
-  Property::Index index = handle.GetPropertyIndex( name );
-
-  if(index == Property::INVALID_INDEX)
-  {
-    index = handle.RegisterProperty( name, propertyValue );
-  }
-
-  return index;
-}
-
-/**
- * ScrollCarouselEffectInfo
- *
- * Visibility constraint: switches off the visibility when Actor
- * is outside of bounds, for performance reasons.
- *
- * Rotate constraint: adjusts the angle of the Actors
- * based on their position relative to the edges of the screen.
- * When in the middle portion of the screen Angle does not change.
- * When leaving the edge of the screen screen rotation changes.
- *
- * Position constraint: adjusts the position of the Actors
- * based on their parent page's position relative to the edges of the screen.
- * The position constraint compensates for the rotation which would otherwise
- * move the Actor's edge visually away from the neighboring actor, as they rotate
- * around their default anchor point.
- */
-class ScrollCarouselEffectInfo
-{
-public:
-
-  ScrollCarouselEffectInfo(const Vector2& angleSwing)
-  : mAngleSwing(angleSwing),
-    mCanvasMargin( 0.0f, 0.0f ),
-    mVisibilityThreshold( 1.0f, 1.0f )
-  {
-  }
-
-  /**
-   * @param[in,out] current The current visibility of this Actor
-   * @param[in] inputs Contains:
-   *                    The Actor's Position
-   *                    The Actor's Scale
-   *                    The Actor's Size
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The size of the scroll-view (scrollView SIZE)
-   * @return The new visibility of this Actor.
-   */
-  void VisibilityConstraint( bool& current, const PropertyInputContainer& inputs )
-  {
-    const Vector2& anchor(AnchorPoint::CENTER.GetVectorXY());
-    Vector2 position( inputs[0]->GetVector3() + inputs[3]->GetVector3());
-    Vector2 scaledSize( inputs[2]->GetVector3() * inputs[1]->GetVector3());
-
-    Vector2 domain( inputs[4]->GetVector3() );
-
-    position -= (anchor - mVisibilityThreshold) * scaledSize;
-    domain -= (Vector2::ONE - mVisibilityThreshold * 2.0f) * scaledSize;
-
-    current = ( position.x >= 0 &&
-                position.x <= domain.x &&
-                position.y >= 0 &&
-                position.y <= domain.y );
-  }
-
-  /**
-   * @param[in,out] current The current orientation of this Actor
-   * @param[in] inputs Contains:
-   *                    The Actor's Position.
-   *                    The Actor's Scale.
-   *                    The Actor's Size
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The size of the scroll-view (scrollView SIZE)
-   *                    Activation value (0 - normal, 1.0 - full effect)
-   * @return The new orientation of this Actor.
-   */
-  void RotationConstraint( Quaternion& current, const PropertyInputContainer& inputs )
-  {
-    const float activate(inputs[5]->GetFloat());
-
-    if(activate <= Math::MACHINE_EPSILON_0)
-    {
-      return;
-    }
-
-    const Vector2& anchor(AnchorPoint::CENTER.GetVectorXY());
-    Vector2 position(inputs[0]->GetVector3() + inputs[3]->GetVector3());
-    Vector2 scaledSize(inputs[2]->GetVector3() * inputs[1]->GetVector3());
-    Vector2 domain(inputs[4]->GetVector3());
-
-    position -= (anchor - mCanvasMargin) * scaledSize;
-    domain -= (Vector2::ONE - mCanvasMargin * 2.0f) * scaledSize;
-
-    Vector2 angle;
-
-    if( position.y < 0 )
-    {
-      angle.y = (-position.y / scaledSize.height) * mAngleSwing.y;
-    }
-    else if( position.y > domain.y )
-    {
-      angle.y = ((domain.y - position.y) / scaledSize.height) * mAngleSwing.y;
-    }
-
-    angle *= activate;
-
-    current = Quaternion( Radian( -angle.x ), Vector3::YAXIS ) *
-              Quaternion( Radian( angle.y ), Vector3::XAXIS ) *
-              current;
-  }
-
-  /**
-   * @param[in,out] current The current position of this Actor
-   * @param[in] inputs Contains:
-   *                    The Actor's Scale.
-   *                    The Actor's Size
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The size of the scroll-view (scrollView SIZE)
-   *                    Activation value (0 - normal, 1.0 - full effect)
-   * @return The new position of this Actor.
-   */
-  void PositionConstraint( Vector3& position, const PropertyInputContainer& inputs )
-  {
-    const float activate(inputs[4]->GetFloat());
-
-    if(activate <= Math::MACHINE_EPSILON_0)
-    {
-      return;
-    }
-
-    position += inputs[2]->GetVector3();
-
-    const Vector2& anchor(AnchorPoint::CENTER.GetVectorXY());
-    Vector2 scaledSize(inputs[1]->GetVector3() * inputs[0]->GetVector3());
-    Vector2 domain(inputs[3]->GetVector3());
-
-    position.GetVectorXY() -= (anchor - mCanvasMargin) * scaledSize;
-    domain -= (Vector2::ONE - mCanvasMargin * 2.0f) * scaledSize;
-
-    Vector2 angle;
-
-    if(position.y < 0)
-    {
-      angle.y = (-position.y / scaledSize.height) * mAngleSwing.y * activate;
-      position.y += (1.0f - cosf(angle.y)) * scaledSize.height * 0.5f;
-      position.z -= sinf(angle.y) * scaledSize.height * 0.5f;
-    }
-    else if(position.y > domain.y)
-    {
-      angle.y = ((domain.y - position.y) / scaledSize.height) * mAngleSwing.y * activate;
-      position.y -= (1.0f - cosf(angle.y)) * scaledSize.height * 0.5f;
-      position.z -= sinf(-angle.y) * scaledSize.height * 0.5f;
-    }
-
-    position.GetVectorXY() += (anchor - mCanvasMargin) * scaledSize;
-  }
-
-  Vector2 mAngleSwing;                                    ///< Maximum amount in X and Y axes to rotate.
-  Vector2 mCanvasMargin;                                  ///< Margin around the canvas for when to start rotating
-  Vector2 mVisibilityThreshold;                           ///< Threshold for when to to switch off visibility of Actor (for performance)
-};
-
-/**
- * Helper: Applies the 3D scroll carousel constraints to the child actor
- *
- * @param[in] scrollView The ScrollView containing the pages.
- * @param[in] child The child to be affected with the 3D Effect.
- * @param[in] info The effect info for the constraints
- */
-void ApplyScrollCarouselConstraints(Toolkit::ScrollView scrollView,
-                                    Actor child,
-                                    ScrollCarouselEffectInfo& info)
-{
-  // Apply constraints to this actor //
-  Constraint constraint;
-
-  constraint = Constraint::New<bool>( child, Actor::Property::VISIBLE, info, &ScrollCarouselEffectInfo::VisibilityConstraint );
-  constraint.AddSource( LocalSource( Actor::Property::POSITION ) );
-  constraint.AddSource( LocalSource( Actor::Property::SCALE ) );
-  constraint.AddSource( LocalSource( Actor::Property::SIZE ) );
-  constraint.AddSource( Source( scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
-  constraint.AddSource( Source( scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source( scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-
-  constraint = Constraint::New<Quaternion>( child, Actor::Property::ORIENTATION, info, &ScrollCarouselEffectInfo::RotationConstraint );
-  constraint.AddSource( LocalSource( Actor::Property::POSITION ) );
-  constraint.AddSource( LocalSource( Actor::Property::SCALE ) );
-  constraint.AddSource( LocalSource( Actor::Property::SIZE ) );
-  constraint.AddSource( Source( scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
-  constraint.AddSource( Source( scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source( scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-
-  constraint = Constraint::New<Vector3>( child, Actor::Property::POSITION, info, &ScrollCarouselEffectInfo::PositionConstraint );
-  constraint.AddSource( LocalSource( Actor::Property::SCALE ) );
-  constraint.AddSource( LocalSource( Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, scrollView.GetPropertyIndex( Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE ) ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-}
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-ScrollViewCarouselEffect::ScrollViewCarouselEffect()
-: mPropertyActivate(Property::INVALID_INDEX)
-{
-}
-
-ScrollViewCarouselEffect::~ScrollViewCarouselEffect()
-{
-}
-
-void ScrollViewCarouselEffect::ApplyToActor(Actor child, const Vector2& angleSwing)
-{
-  ScrollCarouselEffectInfo info( angleSwing );
-
-  ApplyScrollCarouselConstraints( GetScrollView(), child, info );
-}
-
-void ScrollViewCarouselEffect::OnAttach(Toolkit::ScrollView& scrollView)
-{
-  if(mPropertyActivate == Property::INVALID_INDEX)
-  {
-    mPropertyActivate = SafeRegisterProperty( scrollView, Toolkit::ScrollViewCarouselEffect::EFFECT_ACTIVATE, 1.0f );
-  }
-}
-
-void ScrollViewCarouselEffect::OnDetach(Toolkit::ScrollView& scrollView)
-{
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h
deleted file mode 100644 (file)
index ff6c6be..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CAROUSEL_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CAROUSEL_EFFECT_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/animation.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>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h>
-
-namespace Dali
-{
-
-class Animation;
-
-namespace Toolkit
-{
-
-class ScrollView;
-
-namespace Internal
-{
-
-class ScrollViewEffect;
-
-/**
- * @copydoc Toolkit::ScrollViewCarouselEffect
- */
-class ScrollViewCarouselEffect : public ScrollViewEffect
-{
-
-public:
-
-  /**
-   * Constructor
-   */
-  ScrollViewCarouselEffect();
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::ApplyToActor
-   */
-  void ApplyToActor(Actor child, const Vector2& angleSwing);
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::OnAttach
-   */
-  virtual void OnAttach(Toolkit::ScrollView& scrollView);
-
-  /**
-   * @copydoc ScrollViewEffect::OnDetach
-   */
-  virtual void OnDetach(Toolkit::ScrollView& scrollView);
-
-protected:
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ScrollViewCarouselEffect();
-
-private:
-
-  Property::Index mPropertyActivate;                      ///< Activation property (0.0 - deactivated, 1.0 - fully activated)
-
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::ScrollViewCarouselEffect& GetImpl(Dali::Toolkit::ScrollViewCarouselEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<Internal::ScrollViewCarouselEffect&>(handle);
-}
-
-inline const Internal::ScrollViewCarouselEffect& GetImpl(const Dali::Toolkit::ScrollViewCarouselEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  const Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<const Internal::ScrollViewCarouselEffect&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CAROUSEL_EFFECT_H__
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp
deleted file mode 100644 (file)
index f7f3384..0000000
+++ /dev/null
@@ -1,371 +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/animation/constraint.h>
-#include <dali/public-api/object/property-input.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h>
-
-using namespace Dali;
-
-namespace // unnamed namespace
-{
-
-/**
- * ScrollCubeEffectInfo
- *
- * Rotate constraint: adjusts the angle of the Actors
- * based on their parent page's position relative to the middle of the screen.
- * When at middle of screen Angles on X and Y Axes is 0.
- * When one screen away from the middle Angle is 90 degrees (pi/2)
- *
- * Color constraint: adjusts the alpha of the Actors
- * based on their parent page's position relative to the middle of the screen.
- * When at middle of screen Alpha is 100% opacity.
- * When one screen away from middle Alpha is at 0% opacity (invisble).
- *
- * Position constraint: adjusts the position of the Actors
- * based on their parent page's position relative to the middle of the screen.
- * When at middle of the screen the position is not altered.
- * When one screen away from middle the position is rotated about it's origin + mAnchor
- */
-class ScrollCubeEffectInfo
-{
-public:
-
-  ScrollCubeEffectInfo(const Vector3& anchor,
-                       const Vector2& angleSwing,
-                       const Vector2& positionSwing)
-  : mAnchor(anchor),
-    mAngleSwing(angleSwing),
-    mPositionSwing(positionSwing)
-  {
-  }
-
-  /**
-   * @param[in,out] current The current orientation of this Actor
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    Whether scroll wrap has been enabled or not (SCROLL_WRAP)
-   * @return The new orientation of this Actor.
-   */
-  void RotationConstraint( Quaternion& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: for orthognal view.
-    if( (fabsf(position.x) < Math::MACHINE_EPSILON_1) && (fabsf(position.y) < Math::MACHINE_EPSILON_1) )
-    {
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-    bool wrap = inputs[5]->GetBoolean();
-
-    if(wrap)
-    {
-      const Vector3& min = inputs[2]->GetVector3();
-      const Vector3& max = inputs[3]->GetVector3();
-
-      if(fabsf(min.x - max.x) > Math::MACHINE_EPSILON_1)
-      {
-        // WRAP X (based on the position of the right side)
-        position.x = WrapInDomain(position.x + pageSize.x, min.x, max.x) - pageSize.x;
-      }
-
-      if(fabsf(min.y - max.y) > Math::MACHINE_EPSILON_1)
-      {
-        // WRAP Y (based on the position of the bottom side)
-        position.y = WrapInDomain(position.y + pageSize.y, min.y, max.y) - pageSize.y;
-      }
-    }
-
-    // short circuit: for pages outside of view.
-    if( (fabsf(position.x) >= pageSize.x) || (fabsf(position.y) >= pageSize.y) )
-    {
-      return;
-    }
-
-    position.x /= pageSize.x;
-    position.y /= pageSize.y;
-
-    Vector2 angle( Clamp(position.x, -1.0f,1.0f),
-                   Clamp(position.y, -1.0f,1.0f) );
-
-    current = Quaternion( Radian( angle.x * mAngleSwing.x ), Vector3::YAXIS ) *
-              Quaternion( Radian( -angle.y * mAngleSwing.y ), Vector3::XAXIS ) *
-              current;
-  }
-
-  /**
-   * @param[in,out] current The current color of this Actor
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    Whether scroll wrap has been enabled or not (SCROLL_WRAP)
-   * @return The new color of this Actor.
-   */
-  void ColorConstraint( Vector4& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: for orthognal view.
-    if( (fabsf(position.x) < Math::MACHINE_EPSILON_1) && (fabsf(position.y) < Math::MACHINE_EPSILON_1) )
-    {
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-    bool wrap = inputs[5]->GetBoolean();
-
-    if(wrap)
-    {
-      const Vector3& min = inputs[2]->GetVector3();
-      const Vector3& max = inputs[3]->GetVector3();
-
-      if(fabsf(min.x - max.x) > Math::MACHINE_EPSILON_1)
-      {
-        // WRAP X (based on the position of the right side)
-        position.x = WrapInDomain(position.x + pageSize.x, min.x, max.x) - pageSize.x;
-      }
-
-      if(fabsf(min.y - max.y) > Math::MACHINE_EPSILON_1)
-      {
-        // WRAP Y (based on the position of the bottom side)
-        position.y = WrapInDomain(position.y + pageSize.y, min.y, max.y) - pageSize.y;
-      }
-    }
-
-    // short circuit: for pages outside of view.
-    if( (fabsf(position.x) >= pageSize.x) || (fabsf(position.y) >= pageSize.y) )
-    {
-      // note preserve color channels incase there is a shader/further constraint
-      // that wishes to do something with that information.
-      current.a = 0.0f;
-      return;
-    }
-
-    position.x /= pageSize.x;
-    position.y /= pageSize.y;
-
-    Vector2 angle( Clamp(position.x, -1.0f,1.0f),
-                   Clamp(position.y, -1.0f,1.0f) );
-
-    float f = (1.0f - fabsf(angle.x)) * (1.0f - fabsf(angle.y));
-    f = f*f;
-
-    current.a *= f;
-  }
-
-  /**
-   * @param[in,out] current The current position
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    Whether scroll wrap has been enabled or not (SCROLL_WRAP)
-   * @return The new position of this Actor.
-   */
-  void PositionConstraint( Vector3& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-
-    // Get position of page.
-    Vector3 relativePosition = pagePosition + scrollPosition;
-
-    // short circuit: for orthognal view.
-    if( (fabsf(relativePosition.x) < Math::MACHINE_EPSILON_1) && (fabsf(relativePosition.y) < Math::MACHINE_EPSILON_1) )
-    {
-      current += scrollPosition;
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-    bool wrap = inputs[5]->GetBoolean();
-
-    if(wrap)
-    {
-      const Vector3& min = inputs[2]->GetVector3();
-      const Vector3& max = inputs[3]->GetVector3();
-
-      if(fabsf(min.x - max.x) > Math::MACHINE_EPSILON_1)
-      {
-        // WRAP X (based on the position of the right side)
-        relativePosition.x = WrapInDomain(relativePosition.x + pageSize.x, min.x, max.x) - pageSize.x;
-      }
-
-      if(fabsf(min.y - max.y) > Math::MACHINE_EPSILON_1)
-      {
-        // WRAP Y (based on the position of the bottom side)
-        relativePosition.y = WrapInDomain(relativePosition.y + pageSize.y, min.y, max.y) - pageSize.y;
-      }
-    }
-
-    // short circuit: for pages outside of view.
-    if( (fabsf(relativePosition.x) >= pageSize.x) || (fabsf(relativePosition.y) >= pageSize.y) )
-    {
-      // position actors at: scrollposition (Property) + pagePosition (Parent) + current (this)
-      // they will be invisible so doesn't have to be precise, just away from stage.
-      current += scrollPosition;
-      return;
-    }
-
-    relativePosition.x /= pageSize.x;
-    relativePosition.y /= pageSize.y;
-    relativePosition.z = 0.0f;
-
-    Vector3 angle( Clamp(relativePosition.x, -1.0f,1.0f) * mAngleSwing.x,
-                   Clamp(relativePosition.y, -1.0f,1.0f) * mAngleSwing.y,
-                   0.0f);
-
-    // Rotate position (current) about point.
-    Vector3 position = current - mAnchor;
-    Quaternion rotatorY( Radian( angle.x ), Vector3::YAXIS);
-    position = rotatorY.Rotate(position);
-    Quaternion rotatorX( Radian( -angle.y ), Vector3::XAXIS);
-    position = rotatorX.Rotate(position);
-    position += mAnchor;
-    position += relativePosition * mPositionSwing;
-
-    current = position - pagePosition;
-  }
-
-  Vector3 mAnchor;                                        ///< Anchor point where Actor should rotate about.
-  Vector2 mAngleSwing;                                    ///< Maximum amount in X and Y axes to rotate.
-  Vector3 mPositionSwing;                                 ///< Maximum amount in X and Y axes to alter position.
-};
-
-/**
- * Helper: Applies the 3D scroll cube constraints to the child actor
- *
- * @param[in] scrollView The ScrollView containing the pages.
- * @param[in] child The child to be affected with the 3D Effect.
- * @param[in] info The effect info for the constraints
- */
-void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
-                                Actor child,
-                                Actor parentPage,
-                                const ScrollCubeEffectInfo& info)
-{
-  // Apply constraints to this actor //
-  Constraint constraint;
-  constraint = Constraint::New<Quaternion>( child, Actor::Property::ORIENTATION, info, &ScrollCubeEffectInfo::RotationConstraint );
-  constraint.AddSource( Source(parentPage, Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-
-  constraint = Constraint::New<Vector4>( child, Actor::Property::COLOR, info, &ScrollCubeEffectInfo::ColorConstraint );
-  constraint.AddSource( Source(parentPage, Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-
-  constraint = Constraint::New<Vector3>( child, Actor::Property::POSITION, info, &ScrollCubeEffectInfo::PositionConstraint );
-  constraint.AddSource( Source(parentPage, Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-}
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-ScrollViewCubeEffect::ScrollViewCubeEffect()
-{
-
-}
-
-ScrollViewCubeEffect::~ScrollViewCubeEffect()
-{
-}
-
-void ScrollViewCubeEffect::ApplyToActor(Actor child,
-                                        const Vector3& anchor,
-                                        const Vector2& angleSwing,
-                                        const Vector2& positionSwing)
-{
-  ScrollCubeEffectInfo info( anchor, angleSwing, positionSwing );
-
-  ApplyScrollCubeConstraints( GetScrollView(), child, child.GetParent(), info );
-}
-
-void ScrollViewCubeEffect::ApplyToActor(Actor child,
-                                        Actor parentPage,
-                                        const Vector3& anchor,
-                                        const Vector2& angleSwing,
-                                        const Vector2& positionSwing)
-{
-  ScrollCubeEffectInfo info( anchor, angleSwing, positionSwing );
-
-  ApplyScrollCubeConstraints( GetScrollView(), child, parentPage, info );
-}
-
-void ScrollViewCubeEffect::OnAttach(Toolkit::ScrollView& scrollView)
-{
-}
-
-void ScrollViewCubeEffect::OnDetach(Toolkit::ScrollView& scrollView)
-{
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h
deleted file mode 100644 (file)
index 3d9e2d3..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CUBE_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CUBE_EFFECT_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/animation.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>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.h>
-
-namespace Dali
-{
-
-class Animation;
-
-namespace Toolkit
-{
-
-class ScrollView;
-
-namespace Internal
-{
-
-class ScrollViewEffect;
-
-/**
- * @copydoc Toolkit::ScrollViewCubeEffect
- */
-class ScrollViewCubeEffect : public ScrollViewEffect
-{
-
-public:
-
-  /**
-   * Constructor
-   */
-  ScrollViewCubeEffect();
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::ApplyToActor
-   */
-  void ApplyToActor(Actor child,
-                    const Vector3& anchor,
-                    const Vector2& angleSwing,
-                    const Vector2& positionSwing);
-
-  /**
-   * @copydoc ScrollViewEffect::ApplyToActor
-   */
-  void ApplyToActor(Actor child,
-                    Actor parentPage,
-                    const Vector3& anchor,
-                    const Vector2& angleSwing,
-                    const Vector2& positionSwing);
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::OnAttach
-   */
-  virtual void OnAttach(Toolkit::ScrollView& scrollView);
-
-  /**
-   * @copydoc ScrollViewEffect::OnDetach
-   */
-  virtual void OnDetach(Toolkit::ScrollView& scrollView);
-
-protected:
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ScrollViewCubeEffect();
-
-private:
-
-  Vector3 mPageSize;                  ///< The logical page size for the 3D effect.
-
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::ScrollViewCubeEffect& GetImpl(Dali::Toolkit::ScrollViewCubeEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<Internal::ScrollViewCubeEffect&>(handle);
-}
-
-inline const Internal::ScrollViewCubeEffect& GetImpl(const Dali::Toolkit::ScrollViewCubeEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  const Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<const Internal::ScrollViewCubeEffect&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CUBE_EFFECT_H__
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp
deleted file mode 100644 (file)
index eaa99eb..0000000
+++ /dev/null
@@ -1,390 +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/animation/constraint.h>
-#include <dali/public-api/object/property-input.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h>
-
-using namespace Dali;
-
-namespace // unnamed namespace
-{
-
-// constraints ////////////////////////////////////////////////////////////////
-
-/**
- * Ramp equation is a variable easing equation
- * of the form f(x) = |x|^y * x / |x|
- *
- * An exponent (y) of 1 will result in a fast (linear graph)
- * Increasing the exponent will increase the Ease In
- *
- * @param[in] x mantissa (value from -1.0f to 1.0f)
- * @param[in] y exponent (+ve value)
- * @return The signed progress value from -1.0f to 1.0f
- */
-inline float RampFunction(float x, float y)
-{
-  if(x < 0.0f)
-  {
-    return -powf(fabsf(x), y);
-  }
-
-  return powf(fabsf(x), y);
-}
-
-/**
- * ScrollDepthScaleConstraint
- *
- * Scale constraint adjusts the scale of the Actors
- * based on their parent page's position relative to the middle of the screen.
- * When at middle of the screen the scale is not altered.
- * As the page is moved away from the middle, Actors shrink in scale but at
- * different rates defined by the RampFunction(x, f).
- * All Actors eventually shrink to the same amount once at their destination.
- */
-struct ScrollDepthScaleConstraint
-{
-  /**
-   * The scaling constraint uses the amount the actors
-   * have moved in position to determine scaling extent.
-   * So essentially very similar calculations are used here.
-   *
-   * @param[in] positionExtent Controls how much Actor's X and Y
-   * position affects their alpha function's exponent value
-   * @param[in] offsetExtent exponent offset for X and Y scrolling
-   * axes.
-   * @param[in] positionScale Changes the amount the page as a whole
-   * moves by.
-   * @param[in] scaleExtent Scale factor to reach when page is one whole
-   * page away from screen.
-   */
-  ScrollDepthScaleConstraint( Vector2 positionExtent = Vector2(0.5f, 1.0f),
-                              Vector2 offsetExtent = Vector2(1.0f, 1.0f),
-                              float positionScale = 1.5f,
-                              float scaleExtent = 0.5f)
-  : mPositionExtent(positionExtent),
-    mOffsetExtent(offsetExtent),
-    mMaxExtent(positionExtent.x + positionExtent.y),
-    mPositionScale(positionScale),
-    mScaleExtent(scaleExtent)
-  {
-  }
-
-  /**
-   * @param[in,out] current The current scale
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    Whether scroll wrap has been enabled or not (SCROLL_WRAP)
-   * @return The new scale of this Actor.
-   */
-  void operator()( Vector3& currentScale, const PropertyInputContainer& inputs )
-  {
-    const Vector3& currentPosition = inputs[0]->GetVector3();
-    const Vector3& pagePosition = inputs[1]->GetVector3();
-    const Vector3& scrollPosition = inputs[2]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: for orthognal view.
-    if( (fabsf(position.x) < Math::MACHINE_EPSILON_1) && (fabsf(position.y) < Math::MACHINE_EPSILON_1) )
-    {
-      return;
-    }
-
-    const Vector3& pageSize = inputs[5]->GetVector3();
-
-    // Don't have enough parameters, to provide Wrap mode (need a way of having 'uniforms' instead of scrollWrap.GetBoolean())
-
-    const Vector3& min = inputs[3]->GetVector3();
-    const Vector3& max = inputs[4]->GetVector3();
-
-    if(fabsf(min.x - max.x) > Math::MACHINE_EPSILON_1)
-    {
-      // WRAP X (based on the position of the right side)
-      position.x = WrapInDomain(position.x + pageSize.x, min.x, max.x) - pageSize.x;
-    }
-
-    if(fabsf(min.y - max.y) > Math::MACHINE_EPSILON_1)
-    {
-      // WRAP Y (based on the position of the bottom side)
-      position.y = WrapInDomain(position.y + pageSize.y, min.y, max.y) - pageSize.y;
-    }
-
-    // short circuit: for pages outside of view.
-    if( (fabsf(position.x) >= pageSize.x) || (fabsf(position.y) >= pageSize.y) )
-    {
-      return;
-    }
-
-    // Calculate scale ////////////////////////////////////////////////////////
-
-    position.x /= pageSize.x;
-    position.y /= pageSize.y;
-
-    position *= mPositionScale;
-
-    Vector3 relCurrentPosition = currentPosition;
-    relCurrentPosition.x = relCurrentPosition.x / pageSize.x + 0.5f;
-    relCurrentPosition.y = relCurrentPosition.y / pageSize.y + 0.5f;
-
-    Vector3 extent( (relCurrentPosition.x * mPositionExtent.x + relCurrentPosition.y * mPositionExtent.y) * 1.0f,
-                    (relCurrentPosition.x * mPositionExtent.y + relCurrentPosition.y * mPositionExtent.x) * 1.0f,
-                    0.0f);
-
-    if(position.x>0.0f)
-    {
-      extent.x = mMaxExtent - extent.x; // Flip for right.
-    }
-    if(position.y>0.0f)
-    {
-      extent.y = mMaxExtent - extent.y; // Flip for bottom.
-    }
-
-    position.x = RampFunction(position.x, mOffsetExtent.x + extent.x);
-    position.y = RampFunction(position.y, mOffsetExtent.y + extent.y);
-
-    float f = mScaleExtent + cos(position.x * Math::PI_2) * cos(position.y * Math::PI_2) * (1.0f - mScaleExtent);
-
-    currentScale *= f;
-  }
-
-  const Vector2 mPositionExtent;                                ///< Determines how much of the Actor's X and Y position affects exponent value.
-  const Vector2 mOffsetExtent;                                  ///< Offset for exponent value.
-  const float mMaxExtent;                                       ///< Maximum possible extent (mOffsetExtent.x + mOffsetExtent.y)
-  const float mPositionScale;                                   ///< Position scaling factor (spreads out pages, to avoid overlap)
-  const float mScaleExtent;                                     ///< Scale factor when page is at furthest from
-};
-
-/**
- * ScrollDepthPositionConstraint
- *
- * Position constraint adjusts the position of the Actors
- * based on their parent page's position relative to the middle of the screen.
- * When at middle of the screen the position is not altered.
- * As the page is moved away from the middle, Actors move away but at
- * different rates defined by the RampFunction(x, f).
- * All Actors eventually arrive at their destination at the same time.
- */
-struct ScrollDepthPositionConstraint
-{
-  /**
-   * @param [in] positionExtent Controls how much Actor's X and Y
-   * position affects their alpha function's exponent value
-   * @param [in] offsetExtent exponent offset for X and Y scrolling
-   * axes.
-   * @param [in] positionScale Changes the amount the page as a whole
-   * moves by.
-   */
-  ScrollDepthPositionConstraint( Vector2 positionExtent = Vector2(0.5f, 1.0f),
-                                 Vector2 offsetExtent = Vector2(1.0f, 1.0f),
-                                 float positionScale = 1.5f )
-  : mPositionExtent(positionExtent),
-    mOffsetExtent(offsetExtent),
-    mMaxExtent(positionExtent.x + positionExtent.y),
-    mPositionScale(positionScale)
-  {
-  }
-
-  /**
-   * @param[in,out] current The current position
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    Whether scroll wrap has been enabled or not (SCROLL_WRAP)
-   * @return The new position of this Actor.
-   */
-  void operator()( Vector3& currentPosition, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: for orthognal view.
-    if( (fabsf(position.x) < Math::MACHINE_EPSILON_1) && (fabsf(position.y) < Math::MACHINE_EPSILON_1) )
-    {
-      currentPosition += scrollPosition;
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-    bool wrap = inputs[5]->GetBoolean();
-
-    if(wrap)
-    {
-      const Vector3& min = inputs[2]->GetVector3();
-      const Vector3& max = inputs[3]->GetVector3();
-
-      if(fabsf(min.x - max.x) > Math::MACHINE_EPSILON_1)
-      {
-        // WRAP X (based on the position of the right side)
-        position.x = WrapInDomain(position.x + pageSize.x, min.x, max.x) - pageSize.x;
-      }
-
-      if(fabsf(min.y - max.y) > Math::MACHINE_EPSILON_1)
-      {
-        // WRAP Y (based on the position of the bottom side)
-        position.y = WrapInDomain(position.y + pageSize.y, min.y, max.y) - pageSize.y;
-      }
-    }
-
-    // short circuit: for pages outside of view.
-    if( (fabsf(position.x) >= pageSize.x) || (fabsf(position.y) >= pageSize.y) )
-    {
-      // position actors at: scrollposition (Property) + pagePosition (Parent) + current (this)
-      // they will be invisible so doesn't have to be precise, just away from stage.
-      currentPosition += scrollPosition;
-      return;
-    }
-
-    // Calculate position /////////////////////////////////////////////////////
-
-    position.x /= pageSize.x;
-    position.y /= pageSize.y;
-
-    position *= mPositionScale;
-
-    Vector3 relCurrentPosition = currentPosition;
-    relCurrentPosition.x = relCurrentPosition.x / pageSize.x + 0.5f;
-    relCurrentPosition.y = relCurrentPosition.y / pageSize.y + 0.5f;
-
-    Vector3 extent( (relCurrentPosition.x * mPositionExtent.x + relCurrentPosition.y * mPositionExtent.y) * 1.0f,
-                   (relCurrentPosition.x * mPositionExtent.y + relCurrentPosition.y * mPositionExtent.x) * 1.0f,
-                   0.0f);
-
-    if(position.x>0.0f)
-    {
-      extent.x = mMaxExtent - extent.x; // Flip for right.
-    }
-    if(position.y>0.0f)
-    {
-      extent.y = mMaxExtent - extent.y; // Flip for bottom.
-    }
-
-    position.x = RampFunction(position.x, mOffsetExtent.x + extent.x);
-    position.y = RampFunction(position.y, mOffsetExtent.y + extent.y);
-
-    currentPosition -= pagePosition;
-    currentPosition += pageSize * position;
-  }
-
-  const Vector2 mPositionExtent;                                ///< Determines how much of the Actor's X and Y position affects exponent value.
-  const Vector2 mOffsetExtent;                                  ///< Offset for exponent value.
-  const float mMaxExtent;                                       ///< Maximum possible extent (mOffsetExtent.x + mOffsetExtent.y)
-  const float mPositionScale;                                   ///< Position scaling factor (spreads out pages, to avoid overlap)
-};
-
-/**
- * Applies the scroll depth constraints to the child actor
- *
- * @param[in] scrollView The ScrollView containing the pages.
- * @param[in] child The child to be affected with the 3D Effect.
- * @param[in] positionExtent Controls how much Actor's X and Y
- * position affects their alpha function's exponent value
- * @param[in] offsetExtent exponent offset for X and Y scrolling
- * axes.
- * @param[in] positionScale Changes the amount the page as a whole
- * moves by.
- * @param[in] scaleExtent Scale factor to reach when page is one whole
- * page away from screen.
- */
-void ApplyScrollDepthConstraints(Toolkit::ScrollView scrollView,
-                                 Actor child,
-                                 const Vector2& positionExtent,
-                                 const Vector2& offsetExtent,
-                                 float positionScale,
-                                 float scaleExtent)
-{
-  // Scale Constraint
-  Constraint constraint = Constraint::New<Vector3>( child, Actor::Property::SCALE, ScrollDepthScaleConstraint( positionExtent, offsetExtent, positionScale, scaleExtent ) );
-  constraint.AddSource( LocalSource( Actor::Property::POSITION ) );
-  constraint.AddSource( ParentSource( Actor::Property::POSITION ) );
-  constraint.AddSource( Source( scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
-  constraint.AddSource( Source( scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source( scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source( scrollView, Actor::Property::SIZE ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-
-  // Position Constraint (apply last as other constraints use Actor::POSITION as a function input)
-  constraint = Constraint::New<Vector3>( child, Actor::Property::POSITION, ScrollDepthPositionConstraint( positionExtent, offsetExtent, positionScale ) );
-  constraint.AddSource( ParentSource(Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-}
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-ScrollViewDepthEffect::ScrollViewDepthEffect()
-{
-
-}
-
-ScrollViewDepthEffect::~ScrollViewDepthEffect()
-{
-}
-
-void ScrollViewDepthEffect::ApplyToActor(Actor child,
-                                         const Vector2& positionExtent,
-                                         const Vector2& offsetExtent,
-                                         float positionScale,
-                                         float scaleExtent)
-{
-  ApplyScrollDepthConstraints( GetScrollView(), child, positionExtent, offsetExtent, positionScale, scaleExtent );
-}
-
-void ScrollViewDepthEffect::OnAttach(Toolkit::ScrollView& scrollView)
-{
-}
-
-void ScrollViewDepthEffect::OnDetach(Toolkit::ScrollView& scrollView)
-{
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h
deleted file mode 100644 (file)
index 80d4896..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_DEPTH_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_DEPTH_EFFECT_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/animation.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>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.h>
-
-namespace Dali
-{
-
-class Animation;
-
-namespace Toolkit
-{
-
-class ScrollView;
-
-namespace Internal
-{
-
-class ScrollViewEffect;
-
-/**
- * @copydoc Toolkit::ScrollViewDepthEffect
- */
-class ScrollViewDepthEffect : public ScrollViewEffect
-{
-
-public:
-
-  /**
-   * Constructor
-   */
-  ScrollViewDepthEffect();
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::ApplyToActor
-   */
-  void ApplyToActor(Actor child,
-                    const Vector2& positionExtent,
-                    const Vector2& offsetExtent,
-                    float positionScale,
-                    float scaleExtent);
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::OnAttach
-   */
-  virtual void OnAttach(Toolkit::ScrollView& scrollView);
-
-  /**
-   * @copydoc ScrollViewEffect::OnDetach
-   */
-  virtual void OnDetach(Toolkit::ScrollView& scrollView);
-
-protected:
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ScrollViewDepthEffect();
-
-private:
-
-  Vector3 mPageSize;                  ///< The logical page size for the 3D effect.
-
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::ScrollViewDepthEffect& GetImpl(Dali::Toolkit::ScrollViewDepthEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<Internal::ScrollViewDepthEffect&>(handle);
-}
-
-inline const Internal::ScrollViewDepthEffect& GetImpl(const Dali::Toolkit::ScrollViewDepthEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  const Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<const Internal::ScrollViewDepthEffect&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_CUBE_EFFECT_H__
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.cpp
deleted file mode 100644 (file)
index ae70701..0000000
+++ /dev/null
@@ -1,67 +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.
- *
- */
-
-// HEADER
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/math/math-utils.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace ScrollViewHelperFunctions
-{
-
-bool IsStraightOnView( const Vector3& position )
-{
-  return ( fabsf(position.x) < Math::MACHINE_EPSILON_1 ) && ( fabsf( position.y ) < Math::MACHINE_EPSILON_1 );
-}
-
-void WrapPositionWithinDomain( Vector3& position, const Vector3& pageSize, const Vector3& min, const Vector3& max )
-{
-  if( fabsf( min.x - max.x ) > Math::MACHINE_EPSILON_1 )
-  {
-    // WRAP X (based on the position of the right side)
-    position.x = WrapInDomain( position.x + pageSize.width, min.x, max.x ) - pageSize.width;
-  }
-
-  if( fabsf( min.y - max.y ) > Math::MACHINE_EPSILON_1 )
-  {
-    // WRAP Y (based on the position of the bottom side)
-    position.y = WrapInDomain( position.y + pageSize.height, min.y, max.y ) - pageSize.height;
-  }
-}
-
-bool IsOutsideView( const Vector3& position, const Vector3& pageSize )
-{
-  return ( fabsf( position.x ) >= pageSize.width ) || ( fabsf( position.y ) >= pageSize.height );
-}
-
-} // namespace ScrollViewHelperFunctions
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.h
deleted file mode 100644 (file)
index 7541825..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_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/math/vector3.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-/// Some helper methods with common functionality used in scroll view constraints
-namespace ScrollViewHelperFunctions
-{
-
-/**
- * Checks whether the we're looking straight at the page and if we are, it returns true.
- *
- * @param[in]  position  The position of the page.
- */
-bool IsStraightOnView( const Vector3& position );
-
-/**
- * Modifies the position to wrap within the given domain.
- *
- * @param[in/out]  position  The position of the page, this is modified accordingly.
- * @param[in]      pageSize  The size of each page.
- * @param[in]      min       The minimum position of the scroll-view.
- * @param[in]      max       The maximum position of the scroll-view.
- */
-void WrapPositionWithinDomain( Vector3& position, const Vector3& pageSize, const Vector3& min, const Vector3& max );
-
-/**
- * Checks whether the page is positioned outside of our view and returns true if it is.
- *
- * @param[in]  position  The position of the page.
- * @param[in]  pageSize  The size of each page.
- */
-bool IsOutsideView( const Vector3& position, const Vector3& pageSize );
-
-} // namespace ScrollViewHelperFunctions
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_HELPER_FUNCTIONS_H__
index 043ca8d..4c2770b 100644 (file)
 #include <dali/public-api/events/mouse-wheel-event.h>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
+#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
 #include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
 #include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.h>
@@ -54,16 +54,27 @@ using namespace Dali;
 
 namespace
 {
-
-const Vector2 DEFAULT_MIN_FLICK_DISTANCE(30.0f, 30.0f);                                   ///< minimum distance for pan before flick allowed
-const float DEFAULT_MIN_FLICK_SPEED_THRESHOLD(500.0f);                          ///< Minimum pan speed required for flick in pixels/s
-const float FREE_FLICK_SPEED_THRESHOLD = 200.0f;                                          ///< Free-Flick threshold in pixels/ms
-const float AUTOLOCK_AXIS_MINIMUM_DISTANCE2 = 100.0f;                                     ///< Auto-lock axis after minimum distance squared.
-const float FLICK_ORTHO_ANGLE_RANGE = 75.0f;                                              ///< degrees. (if >45, then supports diagonal flicking)
+const float DEFAULT_SLOW_SNAP_ANIMATION_DURATION(0.5f);             ///< Default Drag-Release animation time.
+const float DEFAULT_FAST_SNAP_ANIMATION_DURATION(0.25f);            ///< Default Drag-Flick animation time.
+const float DEFAULT_SNAP_OVERSHOOT_DURATION(0.5f);                  ///< Default Overshoot snapping animation time.
+const float DEFAULT_MAX_OVERSHOOT(100.0f);                          ///< Default maximum allowed overshoot in pixels
+
+const float DEFAULT_AXIS_AUTO_LOCK_GRADIENT(0.36f);                 ///< Default Axis-AutoLock gradient threshold. default is 0.36:1 (20 degrees)
+const float DEFAULT_FRICTION_COEFFICIENT(1.0f);                     ///< Default Friction Co-efficient. (in stage diagonals per second)
+const float DEFAULT_FLICK_SPEED_COEFFICIENT(1.0f);                  ///< Default Flick speed coefficient (multiples input touch velocity)
+const float DEFAULT_MAX_FLICK_SPEED(3.0f);                          ///< Default Maximum flick speed. (in stage diagonals per second)
+
+const Vector2 DEFAULT_MIN_FLICK_DISTANCE(30.0f, 30.0f);              ///< minimum distance for pan before flick allowed
+const float DEFAULT_MIN_FLICK_SPEED_THRESHOLD(500.0f);              ///< Minimum pan speed required for flick in pixels/s
+const float FREE_FLICK_SPEED_THRESHOLD = 200.0f;                    ///< Free-Flick threshold in pixels/ms
+const float AUTOLOCK_AXIS_MINIMUM_DISTANCE2 = 100.0f;               ///< Auto-lock axis after minimum distance squared.
+const float FLICK_ORTHO_ANGLE_RANGE = 75.0f;                        ///< degrees. (if >45, then supports diagonal flicking)
 const Vector2 DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION = Vector2(0.17f, 0.1f); ///< The step of horizontal scroll distance in the proportion of stage size for each mouse wheel event received.
 const unsigned long MINIMUM_TIME_BETWEEN_DOWN_AND_UP_FOR_RESET( 150u );
 const float TOUCH_DOWN_TIMER_INTERVAL = 100.0f;
-const float DEFAULT_SCROLL_UPDATE_DISTANCE( 30.0f );                               ///< Default distance to travel in pixels for scroll update signal
+const float DEFAULT_SCROLL_UPDATE_DISTANCE( 30.0f );                ///< Default distance to travel in pixels for scroll update signal
+
+const std::string INTERNAL_MAX_POSITION_PROPERTY_NAME( "internal-max-position" );
 
 // Helpers ////////////////////////////////////////////////////////////////////////////////////////
 
@@ -170,21 +181,45 @@ float ConstantDecelerationAlphaFunction(float progress)
  * scroll domain. This is a value from 0.0f to 1.0f in each
  * scroll position axis.
  */
-void InternalRelativePositionConstraint( Vector3& relativePosition, const PropertyInputContainer& inputs)
+void InternalRelativePositionConstraint( Vector2& relativePosition, const PropertyInputContainer& inputs)
 {
-  Vector3 position = -inputs[0]->GetVector3();
-  const Vector3& min = inputs[1]->GetVector3();
-  const Vector3& max = inputs[2]->GetVector3();
+  Vector2 position = -inputs[0]->GetVector2();
+  const Vector2& min = inputs[1]->GetVector2();
+  const Vector2& max = inputs[2]->GetVector2();
   const Vector3& size = inputs[3]->GetVector3();
 
   position.x = WrapInDomain(position.x, min.x, max.x);
   position.y = WrapInDomain(position.y, min.y, max.y);
 
-  Vector3 domainSize = (max - min) - size;
+  Vector2 domainSize = (max - min) - size.GetVectorXY();
 
   relativePosition.x = domainSize.x > Math::MACHINE_EPSILON_1 ? fabsf((position.x - min.x) / domainSize.x) : 0.0f;
   relativePosition.y = domainSize.y > Math::MACHINE_EPSILON_1 ? fabsf((position.y - min.y) / domainSize.y) : 0.0f;
-  relativePosition.z = 0.0f;
+}
+
+/**
+ * Internal scroll domain Constraint
+ * Generates the scroll domain of the scroll view.
+ */
+void InternalScrollDomainConstraint( Vector2& scrollDomain, const PropertyInputContainer& inputs)
+{
+  const Vector2& min = inputs[0]->GetVector2();
+  const Vector2& max = inputs[1]->GetVector2();
+  const Vector3& size = inputs[2]->GetVector3();
+
+  scrollDomain = (max - min) - size.GetVectorXY();
+}
+
+/**
+ * Internal maximum scroll position Constraint
+ * Generates the maximum scroll position of the scroll view.
+ */
+void InternalPrePositionMaxConstraint( Vector2& scrollMax, const PropertyInputContainer& inputs)
+{
+  const Vector2& max = inputs[0]->GetVector2();
+  const Vector3& size = inputs[1]->GetVector3();
+
+  scrollMax = max - size.GetVectorXY();
 }
 
 } // unnamed namespace
@@ -209,17 +244,27 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ScrollView, Toolkit::Scrollable, Create )
 
-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_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-position", VECTOR2, SCROLL_POSITION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position", VECTOR2, SCROLL_PRE_POSITION)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position-x", SCROLL_PRE_POSITION_X, SCROLL_PRE_POSITION, 0)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position-y", SCROLL_PRE_POSITION_Y, SCROLL_PRE_POSITION, 1)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position-max", VECTOR2, SCROLL_PRE_POSITION_MAX)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position-max-x", SCROLL_PRE_POSITION_MAX_X, SCROLL_PRE_POSITION_MAX, 0)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-pre-position-max-y", SCROLL_PRE_POSITION_MAX_Y, SCROLL_PRE_POSITION_MAX, 1)
+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", VECTOR2, SCROLL_FINAL)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-final-x", SCROLL_FINAL_X, SCROLL_FINAL,0)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-final-y", SCROLL_FINAL_Y, SCROLL_FINAL,1)
+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-size", VECTOR2, SCROLL_DOMAIN_SIZE)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-domain-size-x", SCROLL_DOMAIN_SIZE_X, SCROLL_DOMAIN_SIZE, 0)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, ScrollView, "scroll-domain-size-y", SCROLL_DOMAIN_SIZE_Y, SCROLL_DOMAIN_SIZE, 1)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-domain-offset", VECTOR2, SCROLL_DOMAIN_OFFSET)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, ScrollView, "scroll-position-delta", VECTOR2, 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 )
 
@@ -289,7 +334,7 @@ struct InternalPrePositionConstraint
   {
   }
 
-  void operator()( Vector3& scrollPostPosition, const PropertyInputContainer& inputs )
+  void operator()( Vector2& scrollPostPosition, const PropertyInputContainer& inputs )
   {
     const Vector2& panPosition = inputs[0]->GetVector2();
 
@@ -324,7 +369,7 @@ struct InternalPrePositionConstraint
 
     // Perform Position transform based on input deltas...
     scrollPostPosition = mPrePosition;
-    scrollPostPosition.GetVectorXY() += panDelta;
+    scrollPostPosition += panDelta;
 
     // if no wrapping then clamp preposition to maximum overshoot amount
     const Vector3& size = inputs[1]->GetVector3();
@@ -352,7 +397,7 @@ struct InternalPrePositionConstraint
     }
   }
 
-  Vector3 mPrePosition;
+  Vector2 mPrePosition;
   Vector2 mLocalStart;
   Vector2 mInitialPanMask;              ///< Initial pan mask (based on ruler settings)
   Vector2 mCurrentPanMask;              ///< Current pan mask that can be altered by axis lock mode.
@@ -387,12 +432,12 @@ struct InternalPositionConstraint
   {
   }
 
-  void operator()( Vector3& position, const PropertyInputContainer& inputs )
+  void operator()( Vector2& position, const PropertyInputContainer& inputs )
   {
-    position = inputs[0]->GetVector3();
+    position = inputs[0]->GetVector2();
     const Vector2& size = inputs[3]->GetVector3().GetVectorXY();
-    const Vector3& min = inputs[1]->GetVector3();
-    const Vector3& max = inputs[2]->GetVector3();
+    const Vector2& min = inputs[1]->GetVector2();
+    const Vector2& max = inputs[2]->GetVector2();
 
     if( mWrap )
     {
@@ -427,8 +472,8 @@ struct OvershootXConstraint
   {
     if( inputs[2]->GetBoolean() )
     {
-      const Vector3& scrollPrePosition = inputs[0]->GetVector3();
-      const Vector3& scrollPostPosition = inputs[1]->GetVector3();
+      const Vector2& scrollPrePosition = inputs[0]->GetVector2();
+      const Vector2& scrollPostPosition = inputs[1]->GetVector2();
       float newOvershoot = scrollPrePosition.x - scrollPostPosition.x;
       current = (newOvershoot > 0.0f ? std::min(newOvershoot, mMaxOvershoot) : std::max(newOvershoot, -mMaxOvershoot)) / mMaxOvershoot;
     }
@@ -453,8 +498,8 @@ struct OvershootYConstraint
   {
     if( inputs[2]->GetBoolean() )
     {
-      const Vector3& scrollPrePosition = inputs[0]->GetVector3();
-      const Vector3& scrollPostPosition = inputs[1]->GetVector3();
+      const Vector2& scrollPrePosition = inputs[0]->GetVector2();
+      const Vector2& scrollPostPosition = inputs[1]->GetVector2();
       float newOvershoot = scrollPrePosition.y - scrollPostPosition.y;
       current = (newOvershoot > 0.0f ? std::min(newOvershoot, mMaxOvershoot) : std::max(newOvershoot, -mMaxOvershoot)) / mMaxOvershoot;
     }
@@ -472,10 +517,10 @@ struct OvershootYConstraint
  *
  * Generates position-delta property based on scroll-position + scroll-offset properties.
  */
-void InternalPositionDeltaConstraint( Vector3& current, const PropertyInputContainer& inputs )
+void InternalPositionDeltaConstraint( Vector2& current, const PropertyInputContainer& inputs )
 {
-  const Vector3& scrollPosition = inputs[0]->GetVector3();
-  const Vector3& scrollOffset = inputs[1]->GetVector3();
+  const Vector2& scrollPosition = inputs[0]->GetVector2();
+  const Vector2& scrollOffset = inputs[1]->GetVector2();
 
   current = scrollPosition + scrollOffset;
 }
@@ -496,15 +541,14 @@ struct InternalFinalConstraint
   {
   }
 
-  void operator()( Vector3& current, const PropertyInputContainer& inputs )
+  void operator()( Vector2& current, const PropertyInputContainer& inputs )
   {
     const float& overshootx = inputs[1]->GetFloat();
     const float& overshooty = inputs[2]->GetFloat();
-    Vector3 offset( mFunctionX(overshootx),
-                    mFunctionY(overshooty),
-                    0.0f);
+    Vector2 offset( mFunctionX(overshootx),
+                    mFunctionY(overshooty) );
 
-    current = inputs[0]->GetVector3() - offset;
+    current = inputs[0]->GetVector2() - offset;
   }
 
   AlphaFunctionPrototype mFunctionX;
@@ -540,20 +584,21 @@ ScrollView::ScrollView()
   mScrollStateFlags(0),
   mLockAxis(LockPossible),
   mScrollUpdateDistance(DEFAULT_SCROLL_UPDATE_DISTANCE),
-  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),
+  mMaxOvershoot(DEFAULT_MAX_OVERSHOOT, DEFAULT_MAX_OVERSHOOT),
+  mUserMaxOvershoot(DEFAULT_MAX_OVERSHOOT, DEFAULT_MAX_OVERSHOOT),
+  mSnapOvershootDuration(DEFAULT_SNAP_OVERSHOOT_DURATION),
   mSnapOvershootAlphaFunction(AlphaFunction::EASE_OUT),
-  mSnapDuration(Toolkit::ScrollView::DEFAULT_SLOW_SNAP_ANIMATION_DURATION),
+  mSnapDuration(DEFAULT_SLOW_SNAP_ANIMATION_DURATION),
   mSnapAlphaFunction(AlphaFunction::EASE_OUT),
   mMinFlickDistance(DEFAULT_MIN_FLICK_DISTANCE),
   mFlickSpeedThreshold(DEFAULT_MIN_FLICK_SPEED_THRESHOLD),
-  mFlickDuration(Toolkit::ScrollView::DEFAULT_FAST_SNAP_ANIMATION_DURATION),
+  mFlickDuration(DEFAULT_FAST_SNAP_ANIMATION_DURATION),
   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),
-  mMaxFlickSpeed(Toolkit::ScrollView::DEFAULT_MAX_FLICK_SPEED),
+  mAxisAutoLockGradient(DEFAULT_AXIS_AUTO_LOCK_GRADIENT),
+  mFrictionCoefficient(DEFAULT_FRICTION_COEFFICIENT),
+  mFlickSpeedCoefficient(DEFAULT_FLICK_SPEED_COEFFICIENT),
+  mMaxFlickSpeed(DEFAULT_MAX_FLICK_SPEED),
+  mMouseWheelScrollDistanceStep(Vector2::ZERO),
   mInAccessibilityPan(false),
   mInitialized(false),
   mScrolling(false),
@@ -581,15 +626,14 @@ void ScrollView::OnInitialize()
   mInternalActor = Actor::New();
   mInternalActor.SetDrawMode(DrawMode::OVERLAY);
   self.Add(mInternalActor);
-  Constraint constraint = Constraint::New<Vector3>( mInternalActor, Actor::Property::SIZE, EqualToConstraint() );
-  constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
-  constraint.Apply();
+
   mInternalActor.SetParentOrigin(ParentOrigin::CENTER);
   mInternalActor.SetAnchorPoint(AnchorPoint::CENTER);
+  mInternalActor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
 
   mAlterChild = true;
 
-  mScrollPostPosition = mScrollPrePosition = Vector3::ZERO;
+  mScrollPostPosition = mScrollPrePosition = Vector2::ZERO;
 
   mMouseWheelScrollDistanceStep = Stage::GetCurrent().GetSize() * DEFAULT_MOUSE_WHEEL_SCROLL_DISTANCE_STEP_PROPORTION;
 
@@ -605,7 +649,7 @@ void ScrollView::OnInitialize()
   mRulerX = ruler;
   mRulerY = ruler;
 
-  EnableScrollComponent(Toolkit::Scrollable::OvershootIndicator);
+  SetOvershootEnabled(true);
 
   self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_VERTICAL, mCanScrollVertical);
   self.SetProperty(Toolkit::Scrollable::Property::CAN_SCROLL_HORIZONTAL, mCanScrollHorizontal);
@@ -624,10 +668,10 @@ void ScrollView::OnControlStageConnection()
     SetScrollSensitive( false );
     SetScrollSensitive( true );
   }
-  if(IsScrollComponentEnabled(Toolkit::Scrollable::OvershootIndicator))
+  if(IsOvershootEnabled())
   {
     // try and make sure property notifications are set
-    EnableScrollComponent(Toolkit::Scrollable::OvershootIndicator);
+    EnableScrollOvershoot(true);
   }
 }
 
@@ -786,8 +830,8 @@ void ScrollView::SetRulerY(RulerPtr ruler)
 void ScrollView::UpdatePropertyDomain(const Vector3& size)
 {
   Actor self = Self();
-  Vector3 min = mMinScroll;
-  Vector3 max = mMaxScroll;
+  Vector2 min = mMinScroll;
+  Vector2 max = mMaxScroll;
   bool scrollPositionChanged = false;
   bool domainChanged = false;
 
@@ -1054,7 +1098,7 @@ Vector2 ScrollView::GetMouseWheelScrollDistanceStep() const
 unsigned int ScrollView::GetCurrentPage() const
 {
   // in case animation is currently taking place.
-  Vector3 position = GetPropertyPosition();
+  Vector2 position = GetPropertyPosition();
 
   Actor self = Self();
   unsigned int page = 0;
@@ -1069,34 +1113,36 @@ unsigned int ScrollView::GetCurrentPage() const
   return volume * pagesPerVolume + page;
 }
 
-Vector3 ScrollView::GetCurrentScrollPosition() const
+Vector2 ScrollView::GetCurrentScrollPosition() const
 {
   return -GetPropertyPosition();
 }
 
-void ScrollView::SetScrollPosition(const Vector3& position)
+void ScrollView::SetScrollPosition(const Vector2& position)
 {
   mScrollPrePosition = position;
 }
 
-Vector3 ScrollView::GetDomainSize() const
+Vector2 ScrollView::GetDomainSize() const
 {
   Vector3 size = Self().GetCurrentSize();
 
   const RulerDomain& xDomain = GetRulerX()->GetDomain();
   const RulerDomain& yDomain = GetRulerY()->GetDomain();
 
-  Vector3 domainSize = Vector3( xDomain.max - xDomain.min, yDomain.max - yDomain.min, 0.0f ) - size;
+  Vector2 domainSize;
+  domainSize.x = xDomain.max - xDomain.min - size.x;
+  domainSize.y = yDomain.max - yDomain.min - size.y;
   return domainSize;
 }
 
-void ScrollView::TransformTo(const Vector3& position,
+void ScrollView::TransformTo(const Vector2& position,
                              DirectionBias horizontalBias, DirectionBias verticalBias)
 {
   TransformTo(position, mSnapDuration, mSnapAlphaFunction, horizontalBias, verticalBias);
 }
 
-void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunction alpha,
+void ScrollView::TransformTo(const Vector2& position, float duration, AlphaFunction alpha,
                              DirectionBias horizontalBias, DirectionBias verticalBias)
 {
   // If this is called while the timer is running, then cancel it
@@ -1111,8 +1157,8 @@ void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunct
   DALI_LOG_SCROLL_STATE("[0x%X] pos[%.2f,%.2f], duration[%.2f] bias[%d, %d]",
     this, position.x, position.y, duration, int(horizontalBias), int(verticalBias));
 
-  Vector3 currentScrollPosition = GetCurrentScrollPosition();
-  self.SetProperty( Toolkit::ScrollView::Property::START_PAGE_POSITION, currentScrollPosition );
+  Vector2 currentScrollPosition = GetCurrentScrollPosition();
+  self.SetProperty( Toolkit::ScrollView::Property::START_PAGE_POSITION, Vector3(currentScrollPosition) );
 
   if( mScrolling ) // are we interrupting a current scroll?
   {
@@ -1141,7 +1187,7 @@ void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunct
   DALI_LOG_SCROLL_STATE("[0x%X] mScrollStartedSignal 1 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
   mScrollStartedSignal.Emit( currentScrollPosition );
   bool animating = AnimateTo(-position,
-                             Vector3::ONE * duration,
+                             Vector2::ONE * duration,
                              alpha,
                              true,
                              horizontalBias,
@@ -1156,7 +1202,7 @@ void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunct
 
     // If we have no duration, then in the next update frame, we will be at the position specified as we just set.
     // In this scenario, we cannot return the currentScrollPosition as this is out-of-date and should instead return the requested final position
-    Vector3 completedPosition( currentScrollPosition );
+    Vector2 completedPosition( currentScrollPosition );
     if( duration <= Math::MACHINE_EPSILON_10 )
     {
       completedPosition = position;
@@ -1168,28 +1214,28 @@ void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunct
   }
 }
 
-void ScrollView::ScrollTo(const Vector3& position)
+void ScrollView::ScrollTo(const Vector2& position)
 {
   ScrollTo(position, mSnapDuration );
 }
 
-void ScrollView::ScrollTo(const Vector3& position, float duration)
+void ScrollView::ScrollTo(const Vector2& position, float duration)
 {
   ScrollTo(position, duration, DirectionBiasNone, DirectionBiasNone);
 }
 
-void ScrollView::ScrollTo(const Vector3& position, float duration, AlphaFunction alpha)
+void ScrollView::ScrollTo(const Vector2& position, float duration, AlphaFunction alpha)
 {
   ScrollTo(position, duration, alpha, DirectionBiasNone, DirectionBiasNone);
 }
 
-void ScrollView::ScrollTo(const Vector3& position, float duration,
+void ScrollView::ScrollTo(const Vector2& position, float duration,
                           DirectionBias horizontalBias, DirectionBias verticalBias)
 {
   ScrollTo(position, duration, mSnapAlphaFunction, horizontalBias, verticalBias);
 }
 
-void ScrollView::ScrollTo(const Vector3& position, float duration, AlphaFunction alpha,
+void ScrollView::ScrollTo(const Vector2& position, float duration, AlphaFunction alpha,
                 DirectionBias horizontalBias, DirectionBias verticalBias)
 {
   DALI_LOG_SCROLL_STATE("[0x%X] position[%.2f, %.2f] duration[%.2f], bias[%d, %d]", this, position.x, position.y, duration, int(horizontalBias), int(verticalBias));
@@ -1203,7 +1249,7 @@ void ScrollView::ScrollTo(unsigned int page)
 
 void ScrollView::ScrollTo(unsigned int page, float duration, DirectionBias bias)
 {
-  Vector3 position;
+  Vector2 position;
   unsigned int volume;
   unsigned int libraries;
 
@@ -1231,9 +1277,10 @@ void ScrollView::ScrollTo(Actor &actor, float duration)
   Actor self = Self();
   Vector3 size = self.GetCurrentSize();
   Vector3 position = actor.GetCurrentPosition();
-  position -= GetPropertyPrePosition();
+  Vector2 prePosition = GetPropertyPrePosition();
+  position.GetVectorXY() -= prePosition;
 
-  ScrollTo(Vector3(position.x - size.width * 0.5f, position.y - size.height * 0.5f, 0.0f), duration);
+  ScrollTo(Vector2(position.x - size.width * 0.5f, position.y - size.height * 0.5f), duration);
 }
 
 Actor ScrollView::FindClosestActor()
@@ -1354,7 +1401,7 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
   float angle = atan2(velocity.y, velocity.x);
   float speed2 = velocity.LengthSquared();
   AlphaFunction alphaFunction = mSnapAlphaFunction;
-  Vector3 positionDuration = Vector3::ONE * mSnapDuration;
+  Vector2 positionDuration = Vector2::ONE * mSnapDuration;
   float biasX = 0.5f;
   float biasY = 0.5f;
   FindDirection horizontal = None;
@@ -1366,7 +1413,7 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
   const float orthoAngleRange = FLICK_ORTHO_ANGLE_RANGE * M_PI / 180.0f;
   const float flickSpeedThreshold2 = mFlickSpeedThreshold * mFlickSpeedThreshold;
 
-  Vector3 positionSnap = mScrollPrePosition;
+  Vector2 positionSnap = mScrollPrePosition;
 
   // Flick logic X Axis
 
@@ -1423,7 +1470,7 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
 
   if(isFlick || isFreeFlick)
   {
-    positionDuration = Vector3::ONE * mFlickDuration;
+    positionDuration = Vector2::ONE * mFlickDuration;
     alphaFunction = mFlickAlphaFunction;
   }
 
@@ -1443,7 +1490,7 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
 
     if(child)
     {
-      Vector3 position = Self().GetProperty<Vector3>(Toolkit::ScrollView::Property::SCROLL_POSITION);
+      Vector2 position = Self().GetProperty<Vector2>(Toolkit::ScrollView::Property::SCROLL_POSITION);
 
       // Get center-point of the Actor.
       Vector3 childPosition = GetPositionOfAnchor(child, AnchorPoint::CENTER);
@@ -1459,11 +1506,11 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
     }
   }
 
-  Vector3 startPosition = positionSnap;
+  Vector2 startPosition = positionSnap;
   positionSnap.x = -mRulerX->Snap(-positionSnap.x, biasX);  // NOTE: X & Y rulers think in -ve coordinate system.
   positionSnap.y = -mRulerY->Snap(-positionSnap.y, biasY);  // That is scrolling RIGHT (e.g. 100.0, 0.0) means moving LEFT.
 
-  Vector3 clampDelta(Vector3::ZERO);
+  Vector2 clampDelta(Vector2::ZERO);
   ClampPosition(positionSnap);
 
   if( (mRulerX->GetType() == Ruler::Free || mRulerY->GetType() == Ruler::Free)
@@ -1509,7 +1556,7 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
     }
     else
     {
-      clampDelta = Vector3::ZERO;
+      clampDelta = Vector2::ZERO;
     }
 
     // If Axis is Free and has velocity, then calculate time taken
@@ -1543,7 +1590,7 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
     }
   }
 
-  if(IsScrollComponentEnabled(Toolkit::Scrollable::OvershootIndicator))
+  if(IsOvershootEnabled())
   {
     // Scroll to the end of the overshoot only when overshoot is enabled.
     positionSnap += clampDelta;
@@ -1576,7 +1623,7 @@ void ScrollView::StopAnimation(Animation& animation)
   }
 }
 
-bool ScrollView::AnimateTo(const Vector3& position, const Vector3& positionDuration,
+bool ScrollView::AnimateTo(const Vector2& position, const Vector2& positionDuration,
                            AlphaFunction alpha, bool findShortcuts,
                            DirectionBias horizontalBias, DirectionBias verticalBias,
                            SnapType snapType)
@@ -1640,7 +1687,7 @@ bool ScrollView::AnimateTo(const Vector3& position, const Vector3& positionDurat
     }
 
     DALI_LOG_SCROLL_STATE("[0x%X] position-changed, mScrollTargetPosition[%.2f, %.2f], mScrollPrePosition[%.2f, %.2f], mScrollPostPosition[%.2f, %.2f]", this, mScrollTargetPosition.x, mScrollTargetPosition.y, mScrollPrePosition.x, mScrollPrePosition.y, mScrollPostPosition.x, mScrollPostPosition.y );
-    DALI_LOG_SCROLL_STATE("[0x%X] SCROLL_PRE_POSITION[%.2f, %.2f], SCROLL_POSITION[%.2f, %.2f]", this, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ).Get<Vector3>().x, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ).Get<Vector3>().y, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_POSITION ).Get<Vector3>().x, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_POSITION ).Get<Vector3>().y );
+    DALI_LOG_SCROLL_STATE("[0x%X] SCROLL_PRE_POSITION[%.2f, %.2f], SCROLL_POSITION[%.2f, %.2f]", this, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ).Get<Vector2>().x, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_PRE_POSITION ).Get<Vector2>().y, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_POSITION ).Get<Vector2>().x, self.GetProperty( Toolkit::ScrollView::Property::SCROLL_POSITION ).Get<Vector2>().y );
   }
 
   SetScrollUpdateNotification(true);
@@ -1657,13 +1704,13 @@ bool ScrollView::AnimateTo(const Vector3& position, const Vector3& positionDurat
   return (mScrollStateFlags & SCROLL_ANIMATION_FLAGS) != 0;
 }
 
-void ScrollView::SetOvershootEnabled(bool enabled)
+void ScrollView::EnableScrollOvershoot(bool enable)
 {
-  if(enabled && !mOvershootIndicator)
+  if(enable && !mOvershootIndicator)
   {
     mOvershootIndicator = ScrollOvershootIndicator::New();
   }
-  if( enabled )
+  if( enable )
   {
     mOvershootIndicator->AttachToScrollable(*this);
   }
@@ -1719,16 +1766,16 @@ void ScrollView::FindAndUnbindActor(Actor child)
   UnbindActor(child);
 }
 
-Vector3 ScrollView::GetPropertyPrePosition() const
+Vector2 ScrollView::GetPropertyPrePosition() const
 {
-  Vector3 position = Self().GetProperty<Vector3>(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION);
+  Vector2 position = Self().GetProperty<Vector2>(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION);
   WrapPosition(position);
   return position;
 }
 
-Vector3 ScrollView::GetPropertyPosition() const
+Vector2 ScrollView::GetPropertyPosition() const
 {
-  Vector3 position = Self().GetProperty<Vector3>(Toolkit::ScrollView::Property::SCROLL_POSITION);
+  Vector2 position = Self().GetProperty<Vector2>(Toolkit::ScrollView::Property::SCROLL_POSITION);
   WrapPosition(position);
 
   return position;
@@ -1746,14 +1793,14 @@ void ScrollView::HandleSnapAnimationFinished()
   Actor self = Self();
   self.SetProperty(Toolkit::ScrollView::Property::SCROLLING, false);
 
-  Vector3 deltaPosition(mScrollPrePosition);
+  Vector2 deltaPosition(mScrollPrePosition);
 
   UpdateLocalScrollProperties();
   WrapPosition(mScrollPrePosition);
   DALI_LOG_SCROLL_STATE("[0x%X] Setting SCROLL_PRE_POSITION To[%.2f, %.2f]", this, mScrollPrePosition.x, mScrollPrePosition.y );
   self.SetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION, mScrollPrePosition);
 
-  Vector3 currentScrollPosition = GetCurrentScrollPosition();
+  Vector2 currentScrollPosition = GetCurrentScrollPosition();
   DALI_LOG_SCROLL_STATE("[0x%X] mScrollCompletedSignal 3 current[%.2f, %.2f], mScrollTargetPosition[%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y, -mScrollTargetPosition.x, -mScrollTargetPosition.y );
   mScrollCompletedSignal.Emit( currentScrollPosition );
 
@@ -1798,7 +1845,7 @@ void ScrollView::OnScrollUpdateNotification(Dali::PropertyNotification& source)
   // Guard against destruction during signal emission
   Toolkit::ScrollView handle( GetOwner() );
 
-  Vector3 currentScrollPosition = GetCurrentScrollPosition();
+  Vector2 currentScrollPosition = GetCurrentScrollPosition();
   mScrollUpdatedSignal.Emit( currentScrollPosition );
 }
 
@@ -1835,14 +1882,14 @@ void ScrollView::OnControlSizeSet( const Vector3& size )
   {
     mUserMaxOvershoot.x = size.x * 0.5f;
     mUserMaxOvershoot.y = size.y * 0.5f;
-    if( !IsScrollComponentEnabled(Toolkit::Scrollable::OvershootIndicator) )
+    if( !IsOvershootEnabled() )
     {
       mMaxOvershoot = mUserMaxOvershoot;
     }
   }
   UpdatePropertyDomain(size);
   UpdateMainInternalConstraint();
-  if( IsScrollComponentEnabled(Toolkit::Scrollable::OvershootIndicator) )
+  if( IsOvershootEnabled() )
   {
     mOvershootIndicator->Reset();
   }
@@ -1850,7 +1897,28 @@ void ScrollView::OnControlSizeSet( const Vector3& size )
 
 void ScrollView::OnChildAdd(Actor& child)
 {
-  if(mAlterChild)
+  Dali::Toolkit::ScrollBar scrollBar = Dali::Toolkit::ScrollBar::DownCast(child);
+  if(scrollBar)
+  {
+    mInternalActor.Add(scrollBar);
+    if(scrollBar.GetScrollDirection() == Toolkit::ScrollBar::Horizontal)
+    {
+      scrollBar.SetScrollPropertySource(Self(),
+                                        Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_X,
+                                        Toolkit::Scrollable::Property::SCROLL_POSITION_MIN_X,
+                                        Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_MAX_X,
+                                        Toolkit::ScrollView::Property::SCROLL_DOMAIN_SIZE_X);
+    }
+    else
+    {
+      scrollBar.SetScrollPropertySource(Self(),
+                                        Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_Y,
+                                        Toolkit::Scrollable::Property::SCROLL_POSITION_MIN_Y,
+                                        Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_MAX_Y,
+                                        Toolkit::ScrollView::Property::SCROLL_DOMAIN_SIZE_Y);
+    }
+  }
+  else if(mAlterChild)
   {
     BindActor(child);
   }
@@ -1899,11 +1967,11 @@ bool ScrollView::OnTouchDownTimeout()
 
       mScrollInterrupted = true;
       // reset domain offset as scrolling from original plane.
-      mDomainOffset = Vector3::ZERO;
-      Self().SetProperty(Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET, Vector3::ZERO);
+      mDomainOffset = Vector2::ZERO;
+      Self().SetProperty(Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET, Vector2::ZERO);
 
       UpdateLocalScrollProperties();
-      Vector3 currentScrollPosition = GetCurrentScrollPosition();
+      Vector2 currentScrollPosition = GetCurrentScrollPosition();
       DALI_LOG_SCROLL_STATE("[0x%X] mScrollCompletedSignal 4 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
       mScrollCompletedSignal.Emit( currentScrollPosition );
     }
@@ -1989,7 +2057,7 @@ bool ScrollView::OnMouseWheelEvent(const MouseWheelEvent& event)
     return false;
   }
 
-  Vector3 targetScrollPosition = GetPropertyPosition();
+  Vector2 targetScrollPosition = GetPropertyPosition();
 
   if(mRulerX->IsEnabled() && !mRulerY->IsEnabled())
   {
@@ -2052,7 +2120,7 @@ void ScrollView::PreAnimatedScrollSetup()
 
   Actor self = Self();
 
-  Vector3 deltaPosition(mScrollPostPosition);
+  Vector2 deltaPosition(mScrollPostPosition);
   WrapPosition(mScrollPostPosition);
   mDomainOffset += deltaPosition - mScrollPostPosition;
   Self().SetProperty(Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET, mDomainOffset);
@@ -2086,7 +2154,7 @@ void ScrollView::AnimateInternalXTo( float position, float duration, AlphaFuncti
   if( duration > Math::MACHINE_EPSILON_10 )
   {
     Actor self = Self();
-    DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector3>().x, position );
+    DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector2>().x, position );
     mInternalXAnimation = Animation::New(duration);
     DALI_LOG_SCROLL_STATE("[0x%X], mInternalXAnimation[0x%X]", this, mInternalXAnimation.GetObjectPtr() );
     mInternalXAnimation.FinishedSignal().Connect(this, &ScrollView::OnScrollAnimationFinished);
@@ -2107,7 +2175,7 @@ void ScrollView::AnimateInternalYTo( float position, float duration, AlphaFuncti
   if( duration > Math::MACHINE_EPSILON_10 )
   {
     Actor self = Self();
-    DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector3>().y, position );
+    DALI_LOG_SCROLL_STATE("[0x%X], Animating from[%.2f] to[%.2f]", this, self.GetProperty(Toolkit::ScrollView::Property::SCROLL_PRE_POSITION).Get<Vector2>().y, position );
     mInternalYAnimation = Animation::New(duration);
     DALI_LOG_SCROLL_STATE("[0x%X], mInternalYAnimation[0x%X]", this, mInternalYAnimation.GetObjectPtr() );
     mInternalYAnimation.FinishedSignal().Connect(this, &ScrollView::OnScrollAnimationFinished);
@@ -2134,7 +2202,7 @@ void ScrollView::OnScrollAnimationFinished( Animation& source )
 
   if( source == mInternalXAnimation )
   {
-    DALI_LOG_SCROLL_STATE("[0x%X] mInternalXAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalXAnimation.GetObjectPtr(), mScrollTargetPosition.x, Self().GetProperty(SCROLL_PRE_POSITION).Get<Vector3>().x, mScrollPostPosition.x );
+    DALI_LOG_SCROLL_STATE("[0x%X] mInternalXAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalXAnimation.GetObjectPtr(), mScrollTargetPosition.x, Self().GetProperty(SCROLL_PRE_POSITION).Get<Vector2>().x, mScrollPostPosition.x );
 
     if( !(mScrollStateFlags & AnimatingInternalY) )
     {
@@ -2154,7 +2222,7 @@ void ScrollView::OnScrollAnimationFinished( Animation& source )
 
   if( source == mInternalYAnimation )
   {
-    DALI_LOG_SCROLL_STATE("[0x%X] mInternalYAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalYAnimation.GetObjectPtr(), mScrollTargetPosition.y, Self().GetProperty(SCROLL_PRE_POSITION).Get<Vector3>().y, mScrollPostPosition.y );
+    DALI_LOG_SCROLL_STATE("[0x%X] mInternalYAnimation[0x%X], expected[%.2f], actual[%.2f], post[%.2f]", this, mInternalYAnimation.GetObjectPtr(), mScrollTargetPosition.y, Self().GetProperty(SCROLL_PRE_POSITION).Get<Vector2>().y, mScrollPostPosition.y );
 
     if( !(mScrollStateFlags & AnimatingInternalX) )
     {
@@ -2265,8 +2333,8 @@ void ScrollView::GestureStarted()
     Actor self = Self();
     StopTouchDownTimer();
     StopAnimation();
-    mPanDelta = Vector3::ZERO;
-    mLastVelocity = Vector2(0.0f, 0.0f);
+    mPanDelta = Vector2::ZERO;
+    mLastVelocity = Vector2::ZERO;
     if( !mScrolling )
     {
       mLockAxis = LockPossible;
@@ -2308,7 +2376,7 @@ void ScrollView::GestureContinuing(const Vector2& panDelta)
   // appears mostly horizontal or mostly vertical respectively.
   if(mAxisAutoLock)
   {
-    mLockAxis = GetLockAxis(mPanDelta.GetVectorXY(), mLockAxis, mAxisAutoLockGradient);
+    mLockAxis = GetLockAxis(mPanDelta, mLockAxis, mAxisAutoLockGradient);
   } // end if mAxisAutoLock
 }
 
@@ -2410,7 +2478,7 @@ void ScrollView::OnGestureEx(Gesture::State state)
 
   if(state == Gesture::Started)
   {
-    Vector3 currentScrollPosition = GetCurrentScrollPosition();
+    Vector2 currentScrollPosition = GetCurrentScrollPosition();
     Self().SetProperty(Toolkit::ScrollView::Property::SCROLLING, true);
     mScrolling = true;
     DALI_LOG_SCROLL_STATE("[0x%X] mScrollStartedSignal 2 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
@@ -2467,16 +2535,16 @@ void ScrollView::FinishTransform()
     {
       SnapInternalYTo(mScrollTargetPosition.y);
     }
-    Vector3 currentScrollPosition = GetCurrentScrollPosition();
+    Vector2 currentScrollPosition = GetCurrentScrollPosition();
     DALI_LOG_SCROLL_STATE("[0x%X] mScrollCompletedSignal 6 [%.2f, %.2f]", this, currentScrollPosition.x, currentScrollPosition.y);
     mScrollCompletedSignal.Emit( currentScrollPosition );
   }
 }
 
-Vector3 ScrollView::GetOvershoot(Vector3& position) const
+Vector2 ScrollView::GetOvershoot(Vector2& position) const
 {
   Vector3 size = Self().GetCurrentSize();
-  Vector3 overshoot;
+  Vector2 overshoot;
 
   const RulerDomain rulerDomainX = mRulerX->GetDomain();
   const RulerDomain rulerDomainY = mRulerY->GetDomain();
@@ -2522,23 +2590,21 @@ bool ScrollView::OnAccessibilityPan(PanGesture gesture)
   return true;
 }
 
-void ScrollView::ClampPosition(Vector3& position) const
+void ScrollView::ClampPosition(Vector2& position) const
 {
-  ClampState3D clamped;
+  ClampState2D clamped;
   ClampPosition(position, clamped);
 }
 
-void ScrollView::ClampPosition(Vector3& position, ClampState3D &clamped) const
+void ScrollView::ClampPosition(Vector2& position, ClampState2D &clamped) const
 {
   Vector3 size = Self().GetCurrentSize();
 
   position.x = -mRulerX->Clamp(-position.x, size.width, 1.0f, clamped.x);    // NOTE: X & Y rulers think in -ve coordinate system.
   position.y = -mRulerY->Clamp(-position.y, size.height, 1.0f, clamped.y);   // That is scrolling RIGHT (e.g. 100.0, 0.0) means moving LEFT.
-
-  clamped.z = NotClamped;
 }
 
-void ScrollView::WrapPosition(Vector3& position) const
+void ScrollView::WrapPosition(Vector2& position) const
 {
   if(mWrapMode)
   {
@@ -2570,6 +2636,8 @@ void ScrollView::UpdateMainInternalConstraint()
     mScrollMainInternalDeltaConstraint.Remove();
     mScrollMainInternalFinalConstraint.Remove();
     mScrollMainInternalRelativeConstraint.Remove();
+    mScrollMainInternalDomainConstraint.Remove();
+    mScrollMainInternalPrePositionMaxConstraint.Remove();
   }
   if( mScrollMainInternalPrePositionConstraint )
   {
@@ -2593,7 +2661,7 @@ void ScrollView::UpdateMainInternalConstraint()
 
   if( mPanning )
   {
-    mScrollMainInternalPrePositionConstraint = Constraint::New<Vector3>( self,
+    mScrollMainInternalPrePositionConstraint = Constraint::New<Vector2>( self,
                                                                          Toolkit::ScrollView::Property::SCROLL_PRE_POSITION,
                                                                          InternalPrePositionConstraint( mPanStartPosition,
                                                                                                         initialPanMask,
@@ -2609,7 +2677,7 @@ void ScrollView::UpdateMainInternalConstraint()
   }
 
   // 2. Second calculate the clamped position (actual position)
-  mScrollMainInternalPositionConstraint = Constraint::New<Vector3>( self,
+  mScrollMainInternalPositionConstraint = Constraint::New<Vector2>( self,
                                                                     Toolkit::ScrollView::Property::SCROLL_POSITION,
                                                                     InternalPositionConstraint( mRulerX->GetDomain(),
                                                                                                 mRulerY->GetDomain(),
@@ -2620,26 +2688,37 @@ void ScrollView::UpdateMainInternalConstraint()
   mScrollMainInternalPositionConstraint.AddSource( Source( self, Actor::Property::SIZE ) );
   mScrollMainInternalPositionConstraint.Apply();
 
-  mScrollMainInternalDeltaConstraint = Constraint::New<Vector3>( self, Toolkit::ScrollView::Property::SCROLL_POSITION_DELTA, InternalPositionDeltaConstraint );
+  mScrollMainInternalDeltaConstraint = Constraint::New<Vector2>( self, Toolkit::ScrollView::Property::SCROLL_POSITION_DELTA, InternalPositionDeltaConstraint );
   mScrollMainInternalDeltaConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ) );
   mScrollMainInternalDeltaConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_DOMAIN_OFFSET ) );
   mScrollMainInternalDeltaConstraint.Apply();
 
-  mScrollMainInternalFinalConstraint = Constraint::New<Vector3>( self, Toolkit::ScrollView::Property::SCROLL_FINAL,
+  mScrollMainInternalFinalConstraint = Constraint::New<Vector2>( self, Toolkit::ScrollView::Property::SCROLL_FINAL,
                                                                  InternalFinalConstraint( FinalDefaultAlphaFunction,
                                                                                           FinalDefaultAlphaFunction ) );
-  mScrollMainInternalFinalConstraint .AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ) );
-  mScrollMainInternalFinalConstraint .AddSource( LocalSource( Toolkit::ScrollView::Property::OVERSHOOT_X ) );
-  mScrollMainInternalFinalConstraint .AddSource( LocalSource( Toolkit::ScrollView::Property::OVERSHOOT_Y ) );
+  mScrollMainInternalFinalConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ) );
+  mScrollMainInternalFinalConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::OVERSHOOT_X ) );
+  mScrollMainInternalFinalConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::OVERSHOOT_Y ) );
   mScrollMainInternalFinalConstraint.Apply();
 
-  mScrollMainInternalRelativeConstraint = Constraint::New<Vector3>( self, Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION, InternalRelativePositionConstraint );
+  mScrollMainInternalRelativeConstraint = Constraint::New<Vector2>( self, Toolkit::Scrollable::Property::SCROLL_RELATIVE_POSITION, InternalRelativePositionConstraint );
   mScrollMainInternalRelativeConstraint.AddSource( LocalSource( Toolkit::ScrollView::Property::SCROLL_POSITION ) );
   mScrollMainInternalRelativeConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
   mScrollMainInternalRelativeConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
   mScrollMainInternalRelativeConstraint.AddSource( LocalSource( Actor::Property::SIZE ) );
   mScrollMainInternalRelativeConstraint.Apply();
 
+  mScrollMainInternalDomainConstraint = Constraint::New<Vector2>( self, Toolkit::ScrollView::Property::SCROLL_DOMAIN_SIZE, InternalScrollDomainConstraint );
+  mScrollMainInternalDomainConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
+  mScrollMainInternalDomainConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
+  mScrollMainInternalDomainConstraint.AddSource( LocalSource( Actor::Property::SIZE ) );
+  mScrollMainInternalDomainConstraint.Apply();
+
+  mScrollMainInternalPrePositionMaxConstraint = Constraint::New<Vector2>( self, Toolkit::ScrollView::Property::SCROLL_PRE_POSITION_MAX, InternalPrePositionMaxConstraint );
+  mScrollMainInternalPrePositionMaxConstraint.AddSource( LocalSource( Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
+  mScrollMainInternalPrePositionMaxConstraint.AddSource( LocalSource( Actor::Property::SIZE ) );
+  mScrollMainInternalPrePositionMaxConstraint.Apply();
+
   // When panning we want to make sure overshoot values are affected by pre position and post position
   SetOvershootConstraintsEnabled(!mWrapMode);
 }
index f4d211b..aa9073f 100644 (file)
@@ -90,6 +90,11 @@ public:
   static const unsigned int SCROLL_ANIMATION_FLAGS = AnimatingInternalX | AnimatingInternalY;
   static const unsigned int SNAP_ANIMATION_FLAGS = SnappingInternalX | SnappingInternalY;
 
+private:
+
+  typedef std::vector<Dali::Toolkit::ScrollViewEffect> ScrollViewEffectContainer; ///< Container of Dali::Toolkit::ScrollViewEffect
+  typedef ScrollViewEffectContainer::iterator ScrollViewEffectIter; ///< Iterator for Dali::Toolkit::ScrollViewEffectContainer
+
 public:
 
   /**
@@ -335,55 +340,55 @@ public:
   /**
    * @copydoc Toolkit::ScrollView::GetCurrentScrollPosition
    */
-  Vector3 GetCurrentScrollPosition() const;
+  Vector2 GetCurrentScrollPosition() const;
 
   /**
    * @copydoc Toolkit::ScrollView::SetScrollPosition
    */
-  void SetScrollPosition(const Vector3& position);
+  void SetScrollPosition(const Vector2& position);
 
   /**
    * @copydoc Toolkit::Scrollable::GetDomainSize
    */
-  Vector3 GetDomainSize() const;
+  Vector2 GetDomainSize() const;
 
   /**
-   * @copydoc ScrollTo(const Vector3&)
+   * @copydoc ScrollTo(const Vector2&)
    */
-  void TransformTo(const Vector3& position,
+  void TransformTo(const Vector2& position,
                    DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
 
   /**
-   * @copydoc ScrollTo(const Vector3&, float, AlhpaFunction, DirectionBias, DirectionBias)
+   * @copydoc ScrollTo(const Vector2&, float, AlhpaFunction, DirectionBias, DirectionBias)
    */
-  void TransformTo(const Vector3& position, float duration, AlphaFunction alpha,
+  void TransformTo(const Vector2& position, float duration, AlphaFunction alpha,
                    DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
 
   /**
-   * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position)
+   * @copydoc Toolkit::ScrollView::ScrollTo(const Vector2 &position)
    */
-  void ScrollTo(const Vector3 &position);
+  void ScrollTo(const Vector2 &position);
 
   /**
-   * @copydoc Toolkit::Scrollable::ScrollTo(const Vector3& position, float duration)
+   * @copydoc Toolkit::Scrollable::ScrollTo(const Vector2& position, float duration)
    */
-  void ScrollTo(const Vector3& position, float duration);
+  void ScrollTo(const Vector2& position, float duration);
 
   /**
-   * @copydoc Toolkit::Scrollable::ScrollTo(const Vector3& position, float duration, AlphaFunction alpha)
+   * @copydoc Toolkit::Scrollable::ScrollTo(const Vector2& position, float duration, AlphaFunction alpha)
    */
-  void ScrollTo(const Vector3& position, float duration, AlphaFunction alpha);
+  void ScrollTo(const Vector2& position, float duration, AlphaFunction alpha);
 
   /**
-   * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias)
+   * @copydoc Toolkit::ScrollView::ScrollTo(const Vector2 &position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias)
    */
-  void ScrollTo(const Vector3& position, float duration,
+  void ScrollTo(const Vector2& position, float duration,
                 DirectionBias horizontalBias, DirectionBias verticalBias);
 
   /**
-   * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha, DirectionBias horizontalBias, DirectionBias verticalBias)
+   * @copydoc Toolkit::ScrollView::ScrollTo(const Vector2 &position, float duration, AlphaFunction alpha, DirectionBias horizontalBias, DirectionBias verticalBias)
    */
-  void ScrollTo(const Vector3& position, float duration, AlphaFunction alpha,
+  void ScrollTo(const Vector2& position, float duration, AlphaFunction alpha,
                 DirectionBias horizontalBias, DirectionBias verticalBias);
 
   /**
@@ -462,7 +467,7 @@ public:
    * @param[in] verticalBias (optional) Whether to bias animation to top or bottom (or no biasing)
    * @return True if animation necessary and taking place to reach desired transform.
    */
-  bool AnimateTo(const Vector3& position, const Vector3& positionDuration,
+  bool AnimateTo(const Vector2& position, const Vector2& positionDuration,
                              AlphaFunction alpha, bool findShortcuts = true,
                              DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone,
                              SnapType snapType = Snap);
@@ -562,9 +567,9 @@ private: // private overriden functions from CustomActorImpl and Controls
   virtual bool OnAccessibilityPan(PanGesture gesture);
 
   /**
-   * @copydoc Toolkit::Scrollable::SetOvershootEnabled()
+   * @copydoc Toolkit::Scrollable::EnableScrollOvershoot()
    */
-  virtual void SetOvershootEnabled(bool enable);
+  virtual void EnableScrollOvershoot(bool enable);
 
 private:
 
@@ -712,14 +717,14 @@ private:
    *
    * @param[in] position The position for which you wish to obtain overshoot vector
    */
-  Vector3 GetOvershoot(Vector3& position) const;
+  Vector2 GetOvershoot(Vector2& position) const;
 
   /**
    * Clamps position within the domain set up by X/Y Rulers
    *
    * @param[in,out] position The position you wish to clamp
    */
-  void ClampPosition(Vector3& position) const;
+  void ClampPosition(Vector2& position) const;
 
   /**
    * Clamps position within the domain set up by X/Y Rulers
@@ -727,7 +732,7 @@ private:
    * @param[in,out] position The position you wish to clamp
    * @param[out] clamped The results of the clamping.
    */
-  void ClampPosition(Vector3& position, ClampState3D &clamped) const;
+  void ClampPosition(Vector2& position, ClampState2D &clamped) const;
 
   /**
    * Wraps position within the domain set up by X/Y Rulers
@@ -737,7 +742,7 @@ private:
    *
    * @param[in,out] position The position you wish to wrap
    */
-  void WrapPosition(Vector3& position) const;
+  void WrapPosition(Vector2& position) const;
 
   /**
    * Updates the main internal scroll constraints with new ruler and domain
@@ -786,14 +791,14 @@ private:
    *
    * @return The current position
    */
-  Vector3 GetPropertyPrePosition() const;
+  Vector2 GetPropertyPrePosition() const;
 
   /**
    * Gets position property.
    *
    * @return The current position
    */
-  Vector3 GetPropertyPosition() const;
+  Vector2 GetPropertyPosition() const;
 
   /**
    * Handles a Stopped animation. Its position properties need to be saved, and the animation flag
@@ -833,22 +838,22 @@ private:
 
   int mGestureStackDepth;               ///< How many gestures are currently occuring.
   Vector2 mPanStartPosition;            ///< Where the pan gesture's touch down occured
-  Vector3 mPanDelta;                    ///< Amount currently panned.
+  Vector2 mPanDelta;                    ///< Amount currently panned.
 
   unsigned int mScrollStateFlags;       ///< flags indicating current state of scrolling
   // Scroll delegate pre and post position properties...
-  Vector3 mScrollPrePosition;           ///< Wrapped scroll position, but not clamped
-  Vector3 mScrollPostPosition;          ///< Wrapped and clamped, this is the final scroll position used
-  Vector3 mScrollTargetPosition;        ///< Final target position for an animated scroll
-  Vector3 mDomainOffset;                ///< Domain offset (this keeps track of the domain boundaries that scroll positions traverses)
+  Vector2 mScrollPrePosition;           ///< Wrapped scroll position, but not clamped
+  Vector2 mScrollPostPosition;          ///< Wrapped and clamped, this is the final scroll position used
+  Vector2 mScrollTargetPosition;        ///< Final target position for an animated scroll
+  Vector2 mDomainOffset;                ///< Domain offset (this keeps track of the domain boundaries that scroll positions traverses)
 
   // Rulers for each axes...
   RulerPtr mRulerX;
   RulerPtr mRulerY;
 
   // Last property values set to ScrollView
-  Vector3 mMinScroll;
-  Vector3 mMaxScroll;
+  Vector2 mMinScroll;
+  Vector2 mMaxScroll;
 
   Animation mInternalXAnimation;        ///< Animates mPropertyX to a snap position or application requested scroll position
   Animation mInternalYAnimation;        ///< Animates mPropertyY to a snap position or application requested scroll position
@@ -869,7 +874,7 @@ private:
 
   Vector2   mMaxOvershoot;                      ///< Number of scrollable pixels that will take overshoot from 0.0f to 1.0f
   Vector2   mUserMaxOvershoot;                  ///< Set by user, allows overriding of default max overshoot for the scroll indicator
-  float     mSnapOvershootDuration;             ///< Duration for overshoot snapping back to Vector3::ZERO
+  float     mSnapOvershootDuration;             ///< Duration for overshoot snapping back to Vector2::ZERO
   AlphaFunction mSnapOvershootAlphaFunction;    ///< AlphaFunction to be used for this overshoot.
 
   float mSnapDuration;                          ///< Time for the snap animation to take (in seconds).
@@ -895,6 +900,8 @@ private:
   Constraint mScrollMainInternalDeltaConstraint;
   Constraint mScrollMainInternalFinalConstraint;
   Constraint mScrollMainInternalRelativeConstraint;
+  Constraint mScrollMainInternalDomainConstraint;
+  Constraint mScrollMainInternalPrePositionMaxConstraint;
 
   ScrollOvershootIndicatorPtr mOvershootIndicator;
 
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp
deleted file mode 100644 (file)
index e44800d..0000000
+++ /dev/null
@@ -1,232 +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/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/object/property-input.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace // unnamed namespace
-{
-
-const float PAGE_SIZE_MULTIPLIER( 1.15f );
-
-using namespace ScrollViewHelperFunctions;
-
-/**
- * ScrollPageCarouselEffectInfo
- *
- * Color constraint: adjusts the alpha of the page based on their parent page's position relative
- * to the middle of the screen.
- * When at middle of screen Alpha is 100% opacity.
- * When outside the viewable area, the opacity is 0%.
- *
- * Position constraint: adjusts the position of the page based on their parent page's position
- * relative to the middle of the screen.
- * When at middle of the screen the position is not altered.
- * When one screen away from middle the position is rotated as per expected in a 3D carousel.
- */
-class ScrollPageCarouselEffectInfo
-{
-public:
-
-  ScrollPageCarouselEffectInfo( const Vector2& positionToPageSizeRatio )
-  : mPositionToPageSizeRatio( positionToPageSizeRatio )
-  {
-  }
-
-  /**
-   * @param[in,out] current The current color of this Actor
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    Whether scroll wrap has been enabled or not (SCROLL_WRAP)
-   * @return The new color of this Actor.
-   */
-  void ColorConstraint( Vector4& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: if we're looking straight on at the page.
-    if( IsStraightOnView( position ) )
-    {
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-
-    if( inputs[5]->GetBoolean() )
-    {
-      WrapPositionWithinDomain( position, pageSize, inputs[2]->GetVector3(), inputs[3]->GetVector3() );
-    }
-
-    // short circuit: for pages outside of view.
-    if( IsOutsideView( position, pageSize ) )
-    {
-      // note preserve color channels incase there is a shader/further constraint
-      // that wishes to do something with that information.
-      current.a = 0.0f;
-      return;
-    }
-
-    Vector2 distance( position / pageSize * PAGE_SIZE_MULTIPLIER );
-    current.a = Clamp( 1.0f - distance.Length(), 0.0f, 1.0f );
-  }
-
-  /**
-   * @param[in,out] current The current position
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    Whether scroll wrap has been enabled or not (SCROLL_WRAP)
-   * @return The new position of this Actor.
-   */
-  void PositionConstraint( Vector3& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: if we're looking straight on at the page.
-    if( IsStraightOnView( position ) )
-    {
-      current += scrollPosition;
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-
-    if( inputs[5]->GetBoolean() )
-    {
-      WrapPositionWithinDomain( position, pageSize, inputs[2]->GetVector3(), inputs[3]->GetVector3() );
-    }
-
-    // short circuit: for pages outside of view.
-    if( IsOutsideView( position, pageSize ) )
-    {
-      // position actors at: scrollposition (Property) + pagePosition (Parent) + current (this)
-      // they will be invisible so doesn't have to be precise, just away from stage.
-      current += scrollPosition;
-      return;
-    }
-
-    Vector3 angle( position / pageSize * PAGE_SIZE_MULTIPLIER );
-
-    position.x = pageSize.x * sinf( angle.x );
-    position.y = pageSize.y * sinf( angle.y );
-
-    Vector2 zMovement( pageSize );
-    zMovement *= mPositionToPageSizeRatio;
-    position.z = - ( ( zMovement.x - ( zMovement.x * cos( angle.x ) ) ) + ( zMovement.y - ( zMovement.y * cos( angle.y ) ) ) );
-
-    current = position;
-  }
-
-  const Vector2 mPositionToPageSizeRatio; ///< The page will move its position according to this ratio.
-};
-
-/**
- * Helper: Applies the 3D scroll cube constraints to the child actor
- *
- * @param[in] scrollView The ScrollView containing the pages.
- * @param[in] child The child to be affected with the 3D Effect.
- * @param[in] info The effect info for the constraints
- */
-void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
-                                Actor child,
-                                ScrollPageCarouselEffectInfo& info)
-{
-  // Apply constraints to this actor //
-  Constraint constraint;
-  constraint = Constraint::New<Vector4>( child, Actor::Property::COLOR, info, &ScrollPageCarouselEffectInfo::ColorConstraint );
-  constraint.AddSource( LocalSource(Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-
-  constraint = Constraint::New<Vector3>( child, Actor::Property::POSITION, info, &ScrollPageCarouselEffectInfo::PositionConstraint );
-  constraint.AddSource( LocalSource(Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-}
-
-} // unnamed namespace
-
-ScrollViewPageCarouselEffect::ScrollViewPageCarouselEffect()
-{
-
-}
-
-ScrollViewPageCarouselEffect::~ScrollViewPageCarouselEffect()
-{
-}
-
-void ScrollViewPageCarouselEffect::ApplyToPage( Actor page, const Vector2& positionToPageSizeRatio )
-{
-  ScrollPageCarouselEffectInfo info( positionToPageSizeRatio );
-
-  ApplyScrollCubeConstraints( GetScrollView(), page, info );
-}
-
-void ScrollViewPageCarouselEffect::OnAttach(Toolkit::ScrollView& scrollView)
-{
-}
-
-void ScrollViewPageCarouselEffect::OnDetach(Toolkit::ScrollView& scrollView)
-{
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h
deleted file mode 100644 (file)
index b57ba4a..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_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/animation.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>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-
-namespace Dali
-{
-
-class Animation;
-
-namespace Toolkit
-{
-
-class ScrollGroup;
-class ScrollView;
-
-namespace Internal
-{
-
-/**
- * @copydoc Toolkit::ScrollViewPageCarouselEffect
- */
-class ScrollViewPageCarouselEffect : public ScrollViewEffect
-{
-
-public:
-
-  /**
-   * Constructor
-   */
-  ScrollViewPageCarouselEffect();
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::ApplyToActor
-   */
-  void ApplyToPage( Actor child, const Vector2& positionToPageSizeRatio );
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::OnAttach
-   */
-  virtual void OnAttach( Toolkit::ScrollView& scrollView );
-
-  /**
-   * @copydoc ScrollViewEffect::OnDetach
-   */
-  virtual void OnDetach( Toolkit::ScrollView& scrollView );
-
-protected:
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ScrollViewPageCarouselEffect();
-
-private:
-
-  Vector3 mPageSize; ///< The logical page size for the 3D effect.
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::ScrollViewPageCarouselEffect& GetImpl(Dali::Toolkit::ScrollViewPageCarouselEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<Internal::ScrollViewPageCarouselEffect&>(handle);
-}
-
-inline const Internal::ScrollViewPageCarouselEffect& GetImpl(const Dali::Toolkit::ScrollViewPageCarouselEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  const Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<const Internal::ScrollViewPageCarouselEffect&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp
deleted file mode 100644 (file)
index 1184ca6..0000000
+++ /dev/null
@@ -1,303 +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/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/object/property-input.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace // unnamed namespace
-{
-
-using namespace ScrollViewHelperFunctions;
-
-/**
- * ScrollPageCubeEffectInfo
- *
- * Rotate constraint: adjusts the angle of the page based on its position relative to the middle of
- * the screen.
- * When at middle of screen Angles on X and Y Axes is 0.
- * When one screen away from the middle Angle is 90 degrees (pi/2)
- *
- * Color constraint: adjusts the alpha of the page based on their parent page's position relative
- * to the middle of the screen.
- * When at middle of screen Alpha is 100% opacity.
- * When outside the viewable area, the opacity is 0%.
- *
- * Position constraint: adjusts the position of the page based on their parent page's position
- * relative to the middle of the screen.
- * When at middle of the screen the position is not altered.
- * When one screen away from middle the position is rotated as per expected in a 3D inner cube.
- */
-class ScrollPageCubeEffectInfo
-{
-public:
-
-  ScrollPageCubeEffectInfo( const Vector2& angleSwing )
-  : mAngleSwing(angleSwing)
-  {
-  }
-
-  /**
-   * @param[in,out] current The current orientation of this Actor
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    Whether scroll wrap has been enabled or not (SCROLL_WRAP)
-   * @return The new orientation of this Actor.
-   */
-  void RotationConstraint( Quaternion& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: if we're looking straight on at the page.
-    if( IsStraightOnView( position ) )
-    {
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-
-    if( inputs[5]->GetBoolean() )
-    {
-      WrapPositionWithinDomain( position, pageSize, inputs[2]->GetVector3(), inputs[3]->GetVector3() );
-    }
-
-    // short circuit: for pages outside of view.
-    if( IsOutsideView( position, pageSize ) )
-    {
-      return;
-    }
-
-    // Our target is a 90 degree (PI/2) rotation per page, so calculate the angle we should be rotate
-    // our page by calculating the amount we've moved as a fraction of the total size of the page.
-    Vector2 angle( position / pageSize * Dali::Math::PI_2 );
-
-    current = Quaternion( Radian( -angle.x * mAngleSwing.x ), Vector3::YAXIS ) *
-              Quaternion( Radian( angle.y * mAngleSwing.y ), Vector3::XAXIS ) *
-              current;
-  }
-
-  /**
-   * @param[in,out] current The current color of this Actor
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    Whether scroll wrap has been enabled or not (SCROLL_WRAP)
-   * @return The new color of this Actor.
-   */
-  void ColorConstraint( Vector4& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: if we're looking straight on at the page.
-    if( IsStraightOnView( position ) )
-    {
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-
-    if( inputs[5]->GetBoolean() )
-    {
-      WrapPositionWithinDomain( position, pageSize, inputs[2]->GetVector3(), inputs[3]->GetVector3() );
-    }
-
-    // short circuit: for pages outside of view.
-    if( IsOutsideView( position, pageSize ) )
-    {
-      // note preserve color channels incase there is a shader/further constraint
-      // that wishes to do something with that information.
-      current.a = 0.0f;
-      return;
-    }
-
-    // Calculate the distance of this page from our view and ensure it falls within the appropriate
-    // visual bounds.
-    // If it does not, then the opacity is set to 0.0f.
-    position.x /= pageSize.width;
-    position.y /= pageSize.height;
-    float distanceFactor = sqrt( position.x * position.x + position.y * position.y );
-
-    if ( distanceFactor > 1.0f )
-    {
-      current.a = 0.0f;
-    }
-  }
-
-  /**
-   * @param[in,out] current The current position
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    Whether scroll wrap has been enabled or not (SCROLL_WRAP)
-   * @return The new position of this Actor.
-   */
-  void PositionConstraint( Vector3& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: if we're looking straight on at the page.
-    if( IsStraightOnView( position ) )
-    {
-      current += scrollPosition;
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-
-    if( inputs[5]->GetBoolean() )
-    {
-      WrapPositionWithinDomain( position, pageSize, inputs[2]->GetVector3(), inputs[3]->GetVector3() );
-    }
-
-    // short circuit: for pages outside of view.
-    if( IsOutsideView( position, pageSize ) )
-    {
-      // position actors at: scrollposition (Property) + pagePosition (Parent) + current (this)
-      // they will be invisible so doesn't have to be precise, just away from stage.
-      current += scrollPosition;
-      return;
-    }
-
-    // Our target when scrolling is moving from the origin to the following points around a curve:
-    //  Right To Left: (-pageWidth, 0, pageWidth)
-    //  Left To Right: ( pageWidth, 0, pageWidth)
-    //  Down To Up:    ( 0, -pageHeight, pageWidth)
-    //  Up To Down:    ( 0,  pageHeight, pageWidth)
-
-    Vector2 angle( position / pageSize * Dali::Math::PI_2 );
-    Vector2 radius( pageSize * 0.5 );
-
-    current.x = radius.x * sin( angle.x );
-    current.y = radius.y * sin( angle.y );
-    current.z = ( radius.x - ( radius.x * cos( angle.x ) ) ) + ( radius.y - ( radius.y * cos( angle.y ) ) );
-  }
-
-  Vector2 mAngleSwing;                                    ///< Maximum amount in X and Y axes to rotate.
-};
-
-/**
- * Helper: Applies the 3D scroll cube constraints to the child actor
- *
- * @param[in] scrollView The ScrollView containing the pages.
- * @param[in] child The child to be affected with the 3D Effect.
- * @param[in] info The effect info for the constraints
- */
-void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
-                                Actor child,
-                                ScrollPageCubeEffectInfo& info)
-{
-  // Apply constraints to this actor //
-  Constraint constraint;
-  constraint = Constraint::New<Quaternion>( child, Actor::Property::ORIENTATION, info, &ScrollPageCubeEffectInfo::RotationConstraint );
-  constraint.AddSource( LocalSource(Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-
-  constraint = Constraint::New<Vector4>( child, Actor::Property::COLOR, info, &ScrollPageCubeEffectInfo::ColorConstraint );
-  constraint.AddSource( LocalSource(Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-
-  constraint = Constraint::New<Vector3>( child, Actor::Property::POSITION, info, &ScrollPageCubeEffectInfo::PositionConstraint );
-  constraint.AddSource( LocalSource(Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::WRAP ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-}
-
-} // unnamed namespace
-
-ScrollViewPageCubeEffect::ScrollViewPageCubeEffect()
-{
-
-}
-
-ScrollViewPageCubeEffect::~ScrollViewPageCubeEffect()
-{
-}
-
-void ScrollViewPageCubeEffect::ApplyToPage( Actor page, const Vector2& angleSwing )
-{
-  ScrollPageCubeEffectInfo info( angleSwing );
-
-  ApplyScrollCubeConstraints( GetScrollView(), page, info );
-}
-
-void ScrollViewPageCubeEffect::OnAttach(Toolkit::ScrollView& scrollView)
-{
-}
-
-void ScrollViewPageCubeEffect::OnDetach(Toolkit::ScrollView& scrollView)
-{
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h
deleted file mode 100644 (file)
index 5e1c5bd..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CUBE_EFFECT_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/animation.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>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-
-namespace Dali
-{
-
-class Animation;
-
-namespace Toolkit
-{
-
-class ScrollGroup;
-class ScrollView;
-
-namespace Internal
-{
-
-/**
- * @copydoc Toolkit::ScrollViewPageCubeEffect
- */
-class ScrollViewPageCubeEffect : public ScrollViewEffect
-{
-
-public:
-
-  /**
-   * Constructor
-   */
-  ScrollViewPageCubeEffect();
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::ApplyToActor
-   */
-  void ApplyToPage( Actor child,
-                   const Vector2& angleSwing );
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::OnAttach
-   */
-  virtual void OnAttach( Toolkit::ScrollView& scrollView );
-
-  /**
-   * @copydoc ScrollViewEffect::OnDetach
-   */
-  virtual void OnDetach( Toolkit::ScrollView& scrollView );
-
-protected:
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ScrollViewPageCubeEffect();
-
-private:
-
-  Vector3 mPageSize; ///< The logical page size for the 3D effect.
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::ScrollViewPageCubeEffect& GetImpl(Dali::Toolkit::ScrollViewPageCubeEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<Internal::ScrollViewPageCubeEffect&>(handle);
-}
-
-inline const Internal::ScrollViewPageCubeEffect& GetImpl(const Dali::Toolkit::ScrollViewPageCubeEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  const Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<const Internal::ScrollViewPageCubeEffect&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp
new file mode 100644 (file)
index 0000000..439dd8f
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics 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/scrollable/scroll-view/scroll-view-page-path-effect-impl.h>
+
+//INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+ScrollViewPagePathEffect::ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount)
+:mPageSize(pageSize),
+ mInputPropertyIndex(inputPropertyIndex),
+ mPageCount(pageCount)
+{
+  //Create path constrainer
+  mPathConstrainer = Dali::PathConstrainer::New();
+  mPathConstrainer.SetProperty( PathConstrainer::Property::FORWARD, forward );
+
+  Dali::Property::Value pointsProperty = path.GetProperty(Path::Property::POINTS);
+  mPathConstrainer.SetProperty( PathConstrainer::Property::POINTS, pointsProperty );
+
+  pointsProperty = path.GetProperty(Path::Property::CONTROL_POINTS);
+  mPathConstrainer.SetProperty( PathConstrainer::Property::CONTROL_POINTS, pointsProperty );
+
+  //Create linear constrainer
+  pointsProperty = Property::Value(Property::ARRAY);
+  pointsProperty.AppendItem(0.0f);
+  pointsProperty.AppendItem(1.0f);
+  pointsProperty.AppendItem(0.0f);
+  mLinearConstrainer = Dali::LinearConstrainer::New();
+  mLinearConstrainer.SetProperty( LinearConstrainer::Property::VALUE, pointsProperty );
+}
+
+ScrollViewPagePathEffect::~ScrollViewPagePathEffect()
+{
+}
+
+void ScrollViewPagePathEffect::ApplyToPage( Actor page, unsigned int pageOrder )
+{
+  float pageHalfSize = mPageSize.x * 0.5f;
+  Vector2 range = Vector2( pageHalfSize - (pageHalfSize*pageOrder),  -pageHalfSize - (pageHalfSize*pageOrder) );
+  Vector2 wrap  = Vector2( range.x, -pageHalfSize*(mPageCount-2) + range.y);
+
+  Toolkit::ScrollView scrollView = GetScrollView();
+
+  //Position
+  mPathConstrainer.Apply( Dali::Property( page, Dali::Actor::Property::POSITION ),
+                          Dali::Property( scrollView, mInputPropertyIndex),
+                          range, wrap
+                        );
+
+  //Rotation
+  mPathConstrainer.Apply( Dali::Property( page, Dali::Actor::Property::ORIENTATION ),
+                          Dali::Property( scrollView, mInputPropertyIndex ),
+                          range, wrap
+                        );
+
+  //Alpha
+  mLinearConstrainer.Apply( Dali::Property( page, Dali::Actor::Property::COLOR_ALPHA ),
+                            Dali::Property( scrollView, mInputPropertyIndex ),
+                            range, wrap
+                          );
+
+}
+
+void ScrollViewPagePathEffect::OnAttach(Toolkit::ScrollView& scrollView)
+{
+}
+
+void ScrollViewPagePathEffect::OnDetach(Toolkit::ScrollView& scrollView)
+{
+}
+
+} // namespace Internal
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.h
new file mode 100644 (file)
index 0000000..8ab45f6
--- /dev/null
@@ -0,0 +1,117 @@
+#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_PATH_EFFECT_H__
+#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_PATH_EFFECT_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/animation/linear-constrainer.h>
+#include <dali/devel-api/animation/path-constrainer.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
+#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Internal
+{
+
+/**
+ * @copydoc Toolkit::ScrollViewPagePathEffect
+ */
+class ScrollViewPagePathEffect : public ScrollViewEffect
+{
+
+public:
+
+  /**
+   * Constructor
+   * @param[in] path Pages will follow this path
+   * @param[in] forward Vector in page local space which will be aligned with tangent of the path
+   * @param[in] inputPropertyIndex index of the property in the scrollview used to drivce the path
+   * @param[in] pageSize size of a page in the scrollview
+   * @param[in] pageCount total number of pages in the scrollview
+   */
+  ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount );
+
+public:
+
+  /**
+   * @copydoc ScrollViewEffect::ApplyToActor
+   */
+  void ApplyToPage( Actor child, unsigned int pageOrder );
+
+public:
+
+  /**
+   * @copydoc ScrollViewEffect::OnAttach
+   */
+  virtual void OnAttach( Toolkit::ScrollView& scrollView );
+
+  /**
+   * @copydoc ScrollViewEffect::OnDetach
+   */
+  virtual void OnDetach( Toolkit::ScrollView& scrollView );
+
+protected:
+
+  /**
+   * A reference counted object may only be deleted by calling Unreference()
+   */
+  virtual ~ScrollViewPagePathEffect();
+
+private:
+
+  Vector3               mPageSize;            ///< The logical page size for the 3D effect.
+  PathConstrainer       mPathConstrainer;     ///< PathConstrainer used to constraint position and orientation
+  LinearConstrainer     mLinearConstrainer;   ///< LinearConstrainer used to constraint opacity
+  Dali::Property::Index mInputPropertyIndex;  ///< Index of the property in the scrollview used as the parameter for the path
+  unsigned int          mPageCount;           ///< Total number of pages (Needed for wrapping)
+};
+
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::ScrollViewPagePathEffect& GetImpl(Dali::Toolkit::ScrollViewPagePathEffect& obj)
+{
+  DALI_ASSERT_ALWAYS(obj);
+
+  Dali::RefObject& handle = obj.GetBaseObject();
+
+  return static_cast<Internal::ScrollViewPagePathEffect&>(handle);
+}
+
+inline const Internal::ScrollViewPagePathEffect& GetImpl(const Dali::Toolkit::ScrollViewPagePathEffect& obj)
+{
+  DALI_ASSERT_ALWAYS(obj);
+
+  const Dali::RefObject& handle = obj.GetBaseObject();
+
+  return static_cast<const Internal::ScrollViewPagePathEffect&>(handle);
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp
deleted file mode 100644 (file)
index 10d6d1e..0000000
+++ /dev/null
@@ -1,397 +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/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-helper-functions.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace // unnamed namespace
-{
-
-const float PAGE_EPSILON_FACTOR( 0.25f );
-
-const float PAGE_SIZE_RELATIVE_ANGLE_FACTOR( 0.75f );
-const float NON_SCROLL_PAGE_SPIRAL_ANGLE_FACTOR( 1.5f );
-
-const float SCROLL_PAGE_OPAQUE_BEFORE( 0.4f );
-const float SCROLL_PAGE_FULLY_TRANSPARENT_AFTER( 0.9f );
-const float NON_SCROLL_PAGE_OPAQUE_BEFORE( 0.8f );
-const float NON_SCROLL_PAGE_FULLY_TRANSPARENT_AFTER( 1.0f );
-
-const float RADIUS_FACTOR( 0.95f );
-const float SCROLL_PAGE_Z_POSITION_FACTOR( -2.0f );
-const float NON_SCROLL_PAGE_Z_POSITION_FACTOR( -0.75f );
-
-using namespace ScrollViewHelperFunctions;
-
-/**
- * ScrollPageSpiralEffectInfo
- *
- * Rotate constraint: adjusts the angle of the page based on its position relative to the middle of
- * the screen.
- * When at middle of screen Angles on X and Y Axes is 0.
- *
- * Color constraint: adjusts the alpha of the page based on their parent page's position relative
- * to the middle of the screen.
- * When at middle of screen Alpha is 100% opacity.
- * When outside the viewable area, the opacity is 0%.
- *
- * Position constraint: adjusts the position of the page based on their parent page's position
- * relative to the middle of the screen.
- * When at middle of the screen the position is not altered.
- */
-class ScrollPageSpiralEffectInfo
-{
-public:
-
-  ScrollPageSpiralEffectInfo( const Vector2& spiralAngle, bool scrollWrap )
-  : mSpiralAngle( spiralAngle ),
-    mScrollWrap( scrollWrap )
-  {
-  }
-
-  /**
-   * @param[in,out] current The current orientation of this Actor
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION)
-   * @return The new orientation of this Actor.
-   */
-  void RotationConstraint( Quaternion& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-    const Vector3& scrollStartPagePosition = inputs[5]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: if we're looking straight on at the page.
-    if( IsStraightOnView( position ) )
-    {
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-    const Vector3& minScrollPosition( inputs[2]->GetVector3() );
-    const Vector3& maxScrollPosition( inputs[3]->GetVector3() );
-
-    if( mScrollWrap )
-    {
-      WrapPositionWithinDomain( position, pageSize, minScrollPosition, maxScrollPosition );
-    }
-
-    // short circuit: for pages outside of view.
-    if( IsOutsideView( position, pageSize ) )
-    {
-      return;
-    }
-
-    Vector2 angle( position / ( pageSize * PAGE_SIZE_RELATIVE_ANGLE_FACTOR ) * Vector3( mSpiralAngle ) );
-    const Vector2 epsilon( pageSize * PAGE_EPSILON_FACTOR );
-    Vector2 distanceFromScrollPage;
-    distanceFromScrollPage.x = ShortestDistanceInDomain( scrollStartPagePosition.x, pagePosition.x, minScrollPosition.x, maxScrollPosition.x );
-    distanceFromScrollPage.y = ShortestDistanceInDomain( scrollStartPagePosition.y, pagePosition.y, minScrollPosition.y, maxScrollPosition.y );
-
-    Vector2 angleMaxMin( mSpiralAngle );
-
-    // X rotation
-    if ( fabsf( distanceFromScrollPage.x ) <= epsilon.x ) // Did scroll start on this page?
-    {
-      angle.x = -angle.x * 0.9f;
-    }
-    else
-    {
-      // If not then multiply by angle factor.
-      angleMaxMin.x *= NON_SCROLL_PAGE_SPIRAL_ANGLE_FACTOR;
-    }
-    ClampInPlace( angle.x, -angleMaxMin.x, angleMaxMin.x );
-
-    // Y rotation
-    if ( fabsf( distanceFromScrollPage.y ) > epsilon.y ) // If not on the scroll page then multiply by angle factor.
-    {
-      angleMaxMin.y *= NON_SCROLL_PAGE_SPIRAL_ANGLE_FACTOR;
-      angle.y = -angle.y;
-    }
-    ClampInPlace( angle.y, -angleMaxMin.y, angleMaxMin.y );
-
-    current = Quaternion( Radian( angle.x ), Vector3::YAXIS ) *
-              Quaternion( Radian( angle.y ), Vector3::XAXIS ) *
-              current;
-  }
-
-  /**
-   * @param[in,out] current The current color of this Actor
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION)
-   * @return The new color of this Actor.
-   */
-  void ColorConstraint( Vector4& color, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-    const Vector3& scrollStartPagePosition = inputs[5]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: if we're looking straight on at the page.
-    if( IsStraightOnView( position ) )
-    {
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-    const Vector3& minScrollPosition( inputs[2]->GetVector3() );
-    const Vector3& maxScrollPosition( inputs[3]->GetVector3() );
-
-    if( mScrollWrap )
-    {
-      WrapPositionWithinDomain( position, pageSize, minScrollPosition, maxScrollPosition );
-    }
-
-    // short circuit: for pages outside of view.
-    if( IsOutsideView( position, pageSize ) )
-    {
-      // note preserve color channels incase there is a shader/further constraint
-      // that wishes to do something with that information.
-      color.a = 0.0f;
-      return;
-    }
-
-    Vector2 distance( position / pageSize );
-    float distanceLength( distance.Length() );
-    const Vector2 epsilon( pageSize * PAGE_EPSILON_FACTOR );
-    Vector2 distanceFromScrollPage;
-    distanceFromScrollPage.x = ShortestDistanceInDomain( scrollStartPagePosition.x, pagePosition.x, minScrollPosition.x, maxScrollPosition.x );
-    distanceFromScrollPage.y = ShortestDistanceInDomain( scrollStartPagePosition.y, pagePosition.y, minScrollPosition.y, maxScrollPosition.y );
-
-    float fullyOpaqueBefore( 0.0f );
-    float fullyTransparentAfter( 1.0f );
-
-    if ( ( fabsf( distanceFromScrollPage.x ) <= epsilon.x ) && ( fabsf( distanceFromScrollPage.y ) <= epsilon.y )) // Did scroll start on this page?
-    {
-      fullyOpaqueBefore = SCROLL_PAGE_OPAQUE_BEFORE;
-      fullyTransparentAfter = SCROLL_PAGE_FULLY_TRANSPARENT_AFTER;
-    }
-    else
-    {
-      fullyOpaqueBefore = NON_SCROLL_PAGE_OPAQUE_BEFORE;
-      fullyTransparentAfter = NON_SCROLL_PAGE_FULLY_TRANSPARENT_AFTER;
-    }
-
-    if ( distanceLength <= fullyOpaqueBefore )
-    {
-      color.a = 1.0f;
-    }
-    else if ( distanceLength <= fullyTransparentAfter )
-    {
-      float opacity( distanceLength - fullyOpaqueBefore );
-      opacity /= fullyTransparentAfter - fullyOpaqueBefore;
-      color.a = Clamp( 1.0f - opacity, 0.0f, 1.0f );
-    }
-    else
-    {
-      color.a = 0.0f;
-    }
-  }
-
-  /**
-   * @param[in,out] current The current position
-   * @param[in] inputs Contains:
-   *                    The page's position.
-   *                    The scroll-view's position property (SCROLL_POSITION)
-   *                    The minimum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The maximum extent of this scroll domain. (SCROLL_POSITION_MIN)
-   *                    The size of the page. (scrollView SIZE)
-   *                    The position of the page where scrolling started. (SCROLL_START_PAGE_POSITION)
-   * @return The new position of this Actor.
-   */
-  void PositionConstraint( Vector3& current, const PropertyInputContainer& inputs )
-  {
-    const Vector3& pagePosition = inputs[0]->GetVector3();
-    const Vector3& scrollPosition = inputs[1]->GetVector3();
-    const Vector3& scrollStartPagePosition = inputs[5]->GetVector3();
-
-    // Get position of page.
-    Vector3 position = pagePosition + scrollPosition;
-
-    // short circuit: if we're looking straight on at the page.
-    if( IsStraightOnView( position ) )
-    {
-      current += scrollPosition;
-      return;
-    }
-
-    const Vector3& pageSize = inputs[4]->GetVector3();
-    const Vector3& minScrollPosition( inputs[2]->GetVector3() );
-    const Vector3& maxScrollPosition( inputs[3]->GetVector3() );
-
-    if( mScrollWrap )
-    {
-      WrapPositionWithinDomain( position, pageSize, minScrollPosition, maxScrollPosition );
-    }
-
-    // short circuit: for pages outside of view.
-    if( IsOutsideView( position, pageSize ) )
-    {
-      // position actors at: scrollposition (Property) + pagePosition (Parent) + current (this)
-      // they will be invisible so doesn't have to be precise, just away from stage.
-      current += scrollPosition;
-      return;
-    }
-
-    const Vector2 angle( position / pageSize * ( Dali::Math::PI_4 ) );
-    const Vector2 radius( pageSize * RADIUS_FACTOR );
-    const Vector2 epsilon( pageSize * PAGE_EPSILON_FACTOR  );
-    Vector2 distanceFromScrollPage;
-    distanceFromScrollPage.x = ShortestDistanceInDomain( scrollStartPagePosition.x, pagePosition.x, minScrollPosition.x, maxScrollPosition.x );
-    distanceFromScrollPage.y = ShortestDistanceInDomain( scrollStartPagePosition.y, pagePosition.y, minScrollPosition.y, maxScrollPosition.y );
-
-    // X position and relative Z position
-    if ( fabsf( distanceFromScrollPage.x ) <= epsilon.x ) // Did scroll start on this page?
-    {
-      position.x = radius.x * sin( angle.x ) * 0.77f;
-      position.z = fabsf( position.x ) * SCROLL_PAGE_Z_POSITION_FACTOR;
-    }
-    else
-    {
-      position.x = radius.x * ( sinf( angle.x * Math::PI * 0.4f ) );
-
-      position.z = fabsf( position.x ) * NON_SCROLL_PAGE_Z_POSITION_FACTOR;
-    }
-
-    // Y position and relative Z position
-    if ( fabsf( distanceFromScrollPage.y ) <= epsilon.y ) // Did scroll start on this page?
-    {
-      position.y = radius.y * sin( angle.y ) * 0.77f;
-      position.z += fabsf( position.y ) * SCROLL_PAGE_Z_POSITION_FACTOR;
-    }
-    else
-    {
-      position.y = radius.y * ( sinf( angle.y * Math::PI * 0.4f ) );
-
-      position.z += fabsf( position.y ) * NON_SCROLL_PAGE_Z_POSITION_FACTOR;
-    }
-
-    current = position;
-  }
-
-  Vector2 mSpiralAngle; ///< The angle of the spirald page
-  bool mScrollWrap;      ///< Whether the scroll view wraps or not.
-};
-
-/**
- * Helper: Applies the 3D scroll cube constraints to the child actor
- *
- * @param[in] scrollView The ScrollView containing the pages.
- * @param[in] child The child to be affected with the 3D Effect.
- * @param[in] info The effect info for the constraints
- */
-void ApplyScrollCubeConstraints(Toolkit::ScrollView scrollView,
-                                Actor child,
-                                ScrollPageSpiralEffectInfo& info)
-{
-  // Apply constraints to this actor //
-  Constraint constraint;
-  constraint = Constraint::New<Quaternion>( child, Actor::Property::ORIENTATION, info, &ScrollPageSpiralEffectInfo::RotationConstraint );
-  constraint.AddSource( LocalSource(Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-
-  constraint = Constraint::New<Vector4>( child, Actor::Property::COLOR, info, &ScrollPageSpiralEffectInfo::ColorConstraint );
-  constraint.AddSource( LocalSource(Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-
-  constraint = Constraint::New<Vector3>( child, Actor::Property::POSITION, info, &ScrollPageSpiralEffectInfo::PositionConstraint );
-  constraint.AddSource( LocalSource(Actor::Property::POSITION) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::SCROLL_FINAL ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MIN ) );
-  constraint.AddSource( Source(scrollView, Toolkit::Scrollable::Property::SCROLL_POSITION_MAX ) );
-  constraint.AddSource( Source(scrollView, Actor::Property::SIZE ) );
-  constraint.AddSource( Source(scrollView, Toolkit::ScrollView::Property::START_PAGE_POSITION ) );
-  constraint.SetRemoveAction( Constraint::Discard );
-  constraint.Apply();
-}
-
-} // unnamed namespace
-
-ScrollViewPageSpiralEffect::ScrollViewPageSpiralEffect()
-{
-
-}
-
-ScrollViewPageSpiralEffect::~ScrollViewPageSpiralEffect()
-{
-}
-
-void ScrollViewPageSpiralEffect::ApplyToPage( Actor page, const Vector2& spiralAngle )
-{
-  Toolkit::ScrollView scrollView( GetScrollView() );
-
-  if ( scrollView )
-  {
-    ScrollPageSpiralEffectInfo info( spiralAngle, GetImpl( scrollView ).GetWrapMode() );
-    ApplyScrollCubeConstraints( scrollView, page, info );
-  }
-}
-
-void ScrollViewPageSpiralEffect::OnAttach(Toolkit::ScrollView& scrollView)
-{
-}
-
-void ScrollViewPageSpiralEffect::OnDetach(Toolkit::ScrollView& scrollView)
-{
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h
deleted file mode 100644 (file)
index ec76adf..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_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/animation.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>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-
-namespace Dali
-{
-
-class Animation;
-
-namespace Toolkit
-{
-
-class ScrollGroup;
-class ScrollView;
-
-namespace Internal
-{
-
-/**
- * @copydoc Toolkit::ScrollViewPageSpiralEffect
- */
-class ScrollViewPageSpiralEffect : public ScrollViewEffect
-{
-
-public:
-
-  /**
-   * Constructor
-   */
-  ScrollViewPageSpiralEffect();
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::ApplyToActor
-   */
-  void ApplyToPage( Actor child, const Vector2& spiralAngle );
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::OnAttach
-   */
-  virtual void OnAttach( Toolkit::ScrollView& scrollView );
-
-  /**
-   * @copydoc ScrollViewEffect::OnDetach
-   */
-  virtual void OnDetach( Toolkit::ScrollView& scrollView );
-
-protected:
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ScrollViewPageSpiralEffect();
-
-private:
-
-  Vector3 mPageSize; ///< The logical page size for the 3D effect.
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::ScrollViewPageSpiralEffect& GetImpl(Dali::Toolkit::ScrollViewPageSpiralEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<Internal::ScrollViewPageSpiralEffect&>(handle);
-}
-
-inline const Internal::ScrollViewPageSpiralEffect& GetImpl(const Dali::Toolkit::ScrollViewPageSpiralEffect& obj)
-{
-  DALI_ASSERT_ALWAYS(obj);
-
-  const Dali::RefObject& handle = obj.GetBaseObject();
-
-  return static_cast<const Internal::ScrollViewPageSpiralEffect&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.cpp
deleted file mode 100644 (file)
index 6a2a9e6..0000000
+++ /dev/null
@@ -1,305 +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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.h>
-
-using namespace Dali;
-
-namespace // unnamed namespace
-{
-
-const float WOBBLEEFFECT_FRICTION_COEFFICIENT = 0.8f;     ///< (deacc) - velocity multiplier per unit time (80%)
-const float WOBBLEEFFECT_IMPULSE_DISTANCE_FACTOR = 0.1f;  ///< (acc) - move by 10% of distance-delta per unit time
-const float WOBBLEEFFECT_TIME_FACTOR = 30.0f;             ///< (T) - 30 times faster (unit time = 1/30th sec)
-const float WOBBLEEFFECT_ANIMATION_MAX_TIME = 60.0f;      ///< Animation time (every time finishes, checks if it needs to go again)
-const float WOBBLEEFFECT_STABLE_TIME_THRESHOLD = 0.5f;    ///< Must be stable for more than half a second to stop animating.
-const float STABILITY_DELTA_THRESHOLD = Math::MACHINE_EPSILON_10000;  ///< When velocity delta is greater than this threshold it is considered in motion.
-
-/**
- * Gets a property index. If the property doesn't already exist, then
- * it will create the property.
- * @param[in] handle The handle that owns or will own the property
- * @param[in] name The name for this property
- * @param[in] propertyValue The initial value for this property
- * @return The property index for this property is returned.
- */
-Property::Index SafeRegisterProperty( Handle& handle, const std::string& name, Property::Value propertyValue )
-{
-  Property::Index index = handle.GetPropertyIndex( name );
-
-  if(index == Property::INVALID_INDEX)
-  {
-    index = handle.RegisterProperty( name, propertyValue );
-  }
-
-  return index;
-}
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-/**
- * ScrollView WobbleEffect constraint
- * This constraint has a chase position and velocity, that chases
- * a target position (scroll-position + scroll-offset). As it has a
- * velocity. It will eventually pass it's target position, and chase back
- * in the opposite direction. As it has a friction coefficient, it will
- * gradually slow, and reach it's target position (stabilized).
- */
-struct ScrollViewWobbleEffectConstraint
-{
-  /**
-   * @param[in,out] wobbleEffect Reference to wobbleEffect instance
-   */
-  ScrollViewWobbleEffectConstraint(ScrollViewWobbleEffect& wobbleEffect)
-  : mChase(Vector3::ZERO),
-    mVelocity(Vector3::ZERO),
-    mTime(0.0f),
-    mStabilityTimeCounter(0),
-    mStabilized(true),
-    mWobbleEffect(wobbleEffect),
-    mAnimationCycleId(0)
-  {
-
-  }
-
-  /**
-   * @param[in,out] direction The new wobble value
-   * @param[in] inputs Contains:
-   *                    The current time since the wobble effect started
-   *                    The scroll-position
-   *                    The scroll-overshoot x & y
-   */
-  void operator()( Vector3& direction, const PropertyInputContainer& inputs )
-  {
-    if(mStabilized)
-    {
-      // check if animation cycle id has changed (if so then this spells
-      // the start of a new animation)
-      if(mAnimationCycleId != mWobbleEffect.GetAnimationCycleId())
-      {
-        mStabilized = false;
-      }
-    }
-    else
-    {
-      // not stable (i.e. wobbling)
-      Vector3 offset(inputs[2]->GetFloat(), inputs[3]->GetFloat(), 0.0f);
-      const Vector3& position = inputs[1]->GetVector3() - offset;
-      const float time = inputs[0]->GetFloat();
-      const float timePassed = time - mTime;
-
-      mTime = time;
-
-      if(timePassed>0)
-      {
-        const Vector3 delta = position - mChase;
-
-        // Check to see if wobble has stabilized.
-        if( (fabsf(delta.x) < STABILITY_DELTA_THRESHOLD) &&
-            (fabsf(mVelocity.x) < STABILITY_DELTA_THRESHOLD) )
-        {
-          mStabilityTimeCounter+=timePassed;
-
-          if(mStabilityTimeCounter > WOBBLEEFFECT_STABLE_TIME_THRESHOLD)
-          {
-            mStabilityTimeCounter = 0.0f;
-            mStabilized = true;
-            mWobbleEffect.IncrementStableCount();
-            mAnimationCycleId = mWobbleEffect.GetAnimationCycleId();
-          }
-        }
-        else
-        {
-          mStabilityTimeCounter = 0.0f;
-        }
-
-        if(!mStabilized)
-        {
-          float t = timePassed * WOBBLEEFFECT_TIME_FACTOR;
-
-          mVelocity *= pow( WOBBLEEFFECT_FRICTION_COEFFICIENT, t );
-          mVelocity += delta * 0.1f * t;
-          mChase += mVelocity;
-        }
-        else
-        {
-          // stabilized, so chase should be exactly on position.
-          mChase = position;
-        }
-      }
-
-      direction.x = position.x - mChase.x;
-      direction.y = position.y - mChase.y;
-    } // end else
-  }
-
-  Vector3 mChase;                                 ///< Chaser position
-  Vector3 mVelocity;                              ///< Velocity of Chaser
-  float mTime;                                    ///< Current time.
-  float mStabilityTimeCounter;                    ///< Time in seconds that stable for.
-  bool mStabilized;                               ///< Stabilized flag.
-  ScrollViewWobbleEffect& mWobbleEffect;          ///< Reference to Wobble Effect
-  unsigned int mAnimationCycleId;                 ///< Animation Cycle Id
-};
-
-ScrollViewWobbleEffect::ScrollViewWobbleEffect()
-: mPropertyTime(Property::INVALID_INDEX),
-  mStableCurrent(0),
-  mAnimationCycleId(0)
-{
-}
-
-ScrollViewWobbleEffect::~ScrollViewWobbleEffect()
-{
-}
-
-void ScrollViewWobbleEffect::IncrementStableCount()
-{
-  mStableCurrent++;
-}
-
-unsigned int ScrollViewWobbleEffect::GetAnimationCycleId() const
-{
-  return mAnimationCycleId;
-}
-
-void ScrollViewWobbleEffect::OnAttach(Toolkit::ScrollView& scrollView)
-{
-  mStableCurrent = 0;
-  mAnimationCycleId = 0;
-
-  // Create effect-time property if not already created.
-  if(mPropertyTime == Property::INVALID_INDEX)
-  {
-    mPropertyTime = SafeRegisterProperty( scrollView, Toolkit::ScrollViewWobbleEffect::EFFECT_TIME, 0.0f );
-  }
-
-  // Connect to the scroll view signals
-  scrollView.ScrollStartedSignal().Connect(this, &ScrollViewWobbleEffect::OnScrollStart);
-  scrollView.ScrollUpdatedSignal().Connect(this, &ScrollViewWobbleEffect::OnScrollUpdate);
-  scrollView.ScrollCompletedSignal().Connect(this, &ScrollViewWobbleEffect::OnScrollComplete);
-
-  AttachActor(scrollView);
-}
-
-void ScrollViewWobbleEffect::OnDetach(Toolkit::ScrollView& scrollView)
-{
-  scrollView.ScrollStartedSignal().Disconnect(this, &ScrollViewWobbleEffect::OnScrollStart);
-  scrollView.ScrollUpdatedSignal().Disconnect(this, &ScrollViewWobbleEffect::OnScrollUpdate);
-  scrollView.ScrollCompletedSignal().Disconnect(this, &ScrollViewWobbleEffect::OnScrollComplete);
-
-  if(mAnimation)
-  {
-    mAnimation.FinishedSignal().Disconnect(this, &ScrollViewWobbleEffect::OnAnimationFinished);
-    mAnimation.Clear();
-    mAnimation.Reset();
-  }
-}
-
-void ScrollViewWobbleEffect::AttachActor(Actor actor)
-{
-  // Create effect-overshoot property if not already created.
-  Property::Index propertyEffectOvershoot = actor.GetPropertyIndex(Toolkit::ScrollViewWobbleEffect::EFFECT_OVERSHOOT);
-  if(propertyEffectOvershoot == Property::INVALID_INDEX)
-  {
-    propertyEffectOvershoot = actor.RegisterProperty(Toolkit::ScrollViewWobbleEffect::EFFECT_OVERSHOOT, Vector3::ZERO);
-  }
-
-  Actor scrollView = GetScrollView();
-
-  Constraint constraint = Constraint::New<Vector3>( actor, propertyEffectOvershoot, ScrollViewWobbleEffectConstraint(*this) );
-  constraint.AddSource( Source( scrollView, mPropertyTime ) );
-  constraint.AddSource( Source( actor, Toolkit::ScrollView::Property::SCROLL_POSITION ) );
-  constraint.AddSource( Source( actor, Toolkit::ScrollView::Property::OVERSHOOT_X ) );
-  constraint.AddSource( Source( actor, Toolkit::ScrollView::Property::OVERSHOOT_Y ) );
-  constraint.Apply();
-}
-
-void ScrollViewWobbleEffect::DetachActor(Actor actor)
-{
-  // TODO: remove the specific constraint defined in AttachActor (and possibly
-  // unregister property) - neither functionality exists in Dali.
-}
-
-void ScrollViewWobbleEffect::ContinueAnimation(float endTime)
-{
-
-  // continue animating
-  if(mAnimation)
-  {
-    mAnimation.FinishedSignal().Disconnect(this, &ScrollViewWobbleEffect::OnAnimationFinished);
-    mAnimation.Clear();
-  }
-
-  Actor scrollView = GetScrollView();
-
-  mAnimation = Animation::New(WOBBLEEFFECT_ANIMATION_MAX_TIME);
-  mAnimation.AnimateTo( Property(scrollView, mPropertyTime), endTime, AlphaFunction::LINEAR );
-  mAnimation.FinishedSignal().Connect(this, &ScrollViewWobbleEffect::OnAnimationFinished);
-  mAnimation.Play();
-
-}
-
-void ScrollViewWobbleEffect::OnScrollStart( const Vector3& position )
-{
-  // When animation starts, all constraints all unstable,
-  // and we change the animation cycle id.
-  mStableCurrent = 0;
-  mAnimationCycleId++;
-
-  GetScrollView().SetProperty(mPropertyTime, 0.0f);
-
-  ContinueAnimation(WOBBLEEFFECT_ANIMATION_MAX_TIME);
-}
-
-void ScrollViewWobbleEffect::OnScrollUpdate( const Vector3& position )
-{
-  // nothing to do
-}
-
-void ScrollViewWobbleEffect::OnScrollComplete( const Vector3& position )
-{
-  // nothing to do
-}
-
-void ScrollViewWobbleEffect::OnAnimationFinished( Animation& animation )
-{
-  if(mStableCurrent!=1)
-  {
-    // still unstable, so continue animating.
-    float endTime = GetScrollView().GetProperty<float>(mPropertyTime) + WOBBLEEFFECT_ANIMATION_MAX_TIME;
-    ContinueAnimation(endTime);
-  }
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h
deleted file mode 100644 (file)
index 8aafda9..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_EFFECT_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/animation.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>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h>
-
-namespace Dali
-{
-
-class Animation;
-
-namespace Toolkit
-{
-
-class ScrollView;
-
-namespace Internal
-{
-
-class ScrollViewEffect;
-
-/**
- * @copydoc Toolkit::ScrollViewWobbleEffect
- */
-class ScrollViewWobbleEffect : public ScrollViewEffect
-{
-
-public:
-
-  /**
-   * Constructor
-   */
-  ScrollViewWobbleEffect();
-
-  /**
-   * Increases the Stable Count (when this reaches mStableTotal)
-   * Then all constraints are stable, and the animation can stop.
-   */
-  void IncrementStableCount();
-
-  /**
-   * Returns animation cycle id. Every time a new animation starts
-   * this cycle id is increased.
-   *
-   * @return The Animation Cycle id is returned.
-   */
-  unsigned int GetAnimationCycleId() const;
-
-public:
-
-  /**
-   * @copydoc ScrollViewEffect::OnAttach
-   */
-  virtual void OnAttach(Toolkit::ScrollView& scrollView);
-
-  /**
-   * @copydoc ScrollViewEffect::OnDetach
-   */
-  virtual void OnDetach(Toolkit::ScrollView& scrollView);
-
-protected:
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ScrollViewWobbleEffect();
-
-private:
-
-  /**
-   * Signal handler, called when the ScrollView starts to move
-   *
-   * @param[in] position The current scroll position
-   */
-  void OnScrollStart( const Vector3& position );
-
-  /**
-   * Signal handler, called when the ScrollView is moving
-   *
-   * @param[in] position The current scroll position
-   */
-  void OnScrollUpdate( const Vector3& position );
-
-  /**
-   * Signal handler, called when the ScrollView has completed movement
-   *
-   * @param[in] position The current scroll position
-   */
-  void OnScrollComplete( const Vector3& position );
-
-  /**
-   * Signal handler, called when the Wobble Effect animation has completed.
-   *
-   * @param[in] animation The animation.
-   */
-  void OnAnimationFinished( Animation& animation );
-
-  /**
-   * Attaches effect to Scroll Actor (ScrollView)
-   *
-   * Applies the same wobble effect to each Scroll Actor.
-   *
-   * @param[in] actor The attached Actor
-   */
-  void AttachActor(Actor actor);
-
-  /**
-   * Detaches effect from Scroll Actor (ScrollView)
-   *
-   * @param[in] actor The attached Actor
-   */
-  void DetachActor(Actor actor);
-
-  /**
-   * Continues Animation to time reaches endTime
-   *
-   * @param[in] endTime the target time to reach.
-   */
-  void ContinueAnimation(float endTime);
-
-private:
-
-  Animation mAnimation;                         ///< Animation Timer to drive the wobble effect constraint.
-  Property::Index mPropertyTime;                ///< Time property used by wobble effect constraint to calculate timePassed.
-
-  int mStableCurrent;                           ///< Stability current - how many wobble constraints are not wobbling (or have neglible wobble).
-  unsigned int mAnimationCycleId;               ///< The start of each new animation cycle is a unique number.
-
-};
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_WOBBLE_EFFECT_H__
index 36934c5..b3a2152 100644 (file)
 // EXTERNAL INCLUDES
 #include <cstring> // for strcmp
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/scrollable/scrollable-impl.h>
-#include <dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.h>
 
 using namespace Dali;
 
@@ -50,12 +49,15 @@ DALI_TYPE_REGISTRATION_BEGIN( Toolkit::Scrollable, Toolkit::Control, Create );
 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( 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_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "scroll-relative-position", VECTOR2, SCROLL_RELATIVE_POSITION)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "scroll-position-min",      VECTOR2, SCROLL_POSITION_MIN)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, Scrollable, "scroll-position-min-x", SCROLL_POSITION_MIN_X, SCROLL_POSITION_MIN, 0)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, Scrollable, "scroll-position-min-y", SCROLL_POSITION_MIN_Y, SCROLL_POSITION_MIN, 1)
+DALI_ANIMATABLE_PROPERTY_REGISTRATION( Toolkit, Scrollable, "scroll-position-max",      VECTOR2, SCROLL_POSITION_MAX)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, Scrollable, "scroll-position-max-x", SCROLL_POSITION_MAX_X, SCROLL_POSITION_MAX, 0)
+DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, Scrollable, "scroll-position-max-y", SCROLL_POSITION_MAX_Y, SCROLL_POSITION_MAX, 1)
+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(              Toolkit, Scrollable, "scroll-started",                    SIGNAL_SCROLL_STARTED    )
 DALI_SIGNAL_REGISTRATION(              Toolkit, Scrollable, "scroll-completed",                  SIGNAL_SCROLL_COMPLETED  )
@@ -92,65 +94,17 @@ Scrollable::Scrollable( ControlBehaviour behaviourFlags )
 
 Scrollable::~Scrollable()
 {
-  // Clear scroll components, forces their destruction before Scrollable is destroyed.
-  mComponents.clear();
 }
 
-bool Scrollable::IsScrollComponentEnabled(Toolkit::Scrollable::ScrollComponentType type) const
+bool Scrollable::IsOvershootEnabled() const
 {
-  if(type == Toolkit::Scrollable::OvershootIndicator)
-  {
-    return mOvershootEnabled;
-  }
-  return (mComponents.find(type) != mComponents.end());
+  return mOvershootEnabled;
 }
 
-void Scrollable::EnableScrollComponent(Toolkit::Scrollable::ScrollComponentType type)
+void Scrollable::SetOvershootEnabled(bool enable)
 {
-  if(type == Toolkit::Scrollable::OvershootIndicator)
-  {
-    if( !mOvershootEnabled )
-    {
-      SetOvershootEnabled(true);
-      mOvershootEnabled = true;
-    }
-    return;
-  }
-  if( mComponents.find(type) == mComponents.end() )
-  {
-    // Create ScrollComponent
-    Toolkit::Scrollable scrollable = Toolkit::Scrollable::DownCast(Self());
-    Toolkit::ScrollComponent scrollComponent = NewScrollComponent(scrollable, type);
-    Toolkit::ScrollComponentImpl& component = static_cast<Toolkit::ScrollComponentImpl&>(scrollComponent.GetImplementation());
-    ScrollComponentPtr componentPtr(&component);
-
-    mComponents[type] = componentPtr;
-  }
-}
-
-void Scrollable::DisableScrollComponent(Toolkit::Scrollable::ScrollComponentType type)
-{
-  if(type == Toolkit::Scrollable::OvershootIndicator)
-  {
-    if( mOvershootEnabled )
-    {
-      SetOvershootEnabled(false);
-      mOvershootEnabled = false;
-    }
-    return;
-  }
-  ComponentIter pair = mComponents.find( type );
-
-  if( mComponents.end() != pair )
-  {
-    ScrollComponentPtr component = pair->second;
-
-    // Disconnect the scroll component first.
-    component->OnDisconnect();
-
-    // Destroy ScrollComponent.
-    mComponents.erase( type );
-  }
+  EnableScrollOvershoot(enable);
+  mOvershootEnabled = enable;
 }
 
 Vector4 Scrollable::GetOvershootEffectColor() const
@@ -261,32 +215,6 @@ Property::Value Scrollable::GetProperty( BaseObject* object, Property::Index ind
   return value;
 }
 
-Toolkit::ScrollComponent Scrollable::NewScrollComponent(Toolkit::Scrollable& scrollable, Toolkit::Scrollable::ScrollComponentType type)
-{
-  Toolkit::ScrollComponent instance;
-
-  switch(type)
-  {
-    case Toolkit::Scrollable::VerticalScrollBar:
-    {
-      instance = static_cast<Toolkit::ScrollComponent>(Toolkit::ScrollBarInternal::New(scrollable, true));
-      break;
-    }
-    case Toolkit::Scrollable::HorizontalScrollBar:
-    {
-      instance = static_cast<Toolkit::ScrollComponent>(Toolkit::ScrollBarInternal::New(scrollable, false));
-      break;
-    }
-    case Toolkit::Scrollable::OvershootIndicator:
-    {
-      DALI_ASSERT_ALWAYS(!"Unrecognized component type");
-      break;
-    }
-  }
-
-  return instance;
-}
-
 } // namespace Internal
 
 } // namespace Toolkit
index 1f876ad..0b349f5 100644 (file)
  *
  */
 
-// EXTERNAL INCLUDES
-#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/scrollable/scrollable.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
 
 namespace Dali
 {
@@ -46,25 +42,20 @@ class Scrollable : public Control
 public:
 
   /**
-   * @copydoc Dali::Toolkit::Scrollable::IsScrollComponentEnabled(Scrollable::ScrollComponentType type)
+   * @copydoc Dali::Toolkit::Scrollable::IsOvershootEnabled
    */
-  bool IsScrollComponentEnabled(Toolkit::Scrollable::ScrollComponentType type) const;
+  bool IsOvershootEnabled() const;
 
   /**
-   * @copydoc Dali::Toolkit::Scrollable::EnableScrollComponent(Scrollable::ScrollComponentType type)
+   * @copydoc Dali::Toolkit::Scrollable::SetOvershootEnabled
    */
-  void EnableScrollComponent(Toolkit::Scrollable::ScrollComponentType type);
-
-  /**
-   * @copydoc Dali::Toolkit::Scrollable::DisableScrollComponent(Scrollable::ScrollComponentType type)
-   */
-  void DisableScrollComponent(Toolkit::Scrollable::ScrollComponentType type);
+  void SetOvershootEnabled(bool enable);
 
   /**
    * Gets the size of the domain (minimum/maximum extents for each axis to scroll to)
    * @return the domain size
    */
-  virtual Vector3 GetDomainSize() const = 0;
+  virtual Vector2 GetDomainSize() const = 0;
 
   /**
    * Adds actor as an Overlay to Scrollable
@@ -86,7 +77,7 @@ public:
    * Retrieves current scroll position.
    * @returns The current scroll position.
    */
-  virtual Vector3 GetCurrentScrollPosition() const = 0;
+  virtual Vector2 GetCurrentScrollPosition() const = 0;
 
   /**
    * Scrolls Scrollable to position specified (contents will scroll to this position)
@@ -95,7 +86,7 @@ public:
    * @param[in] position The position to scroll to.
    * @param[in] duration The duration of the animation in seconds
    */
-  virtual void ScrollTo(const Vector3 &position, float duration) = 0;
+  virtual void ScrollTo(const Vector2 &position, float duration) = 0;
 
   /**
    * Set the color of the overshoot effect.
@@ -122,11 +113,11 @@ public:
 private:
 
   /**
-   * Temporary function to override EnableScrollComponent functionality for overshoot
+   * Temporary function to override EnableScrollOvershoot functionality for overshoot
    * Only ScrollView needs to override this as HQ has not requested disable functionality in ItemView
    * @param[in] enable true to enable, false to disable overshoot indicator
    */
-  virtual void SetOvershootEnabled(bool enable) {}
+  virtual void EnableScrollOvershoot(bool enable) {}
 
 public: //Signals
 
@@ -200,7 +191,7 @@ private:
    *
    * @return The current position
    */
-  Vector3 GetPropertyPosition() const;
+  Vector2 GetPropertyPosition() const;
 
 private:
 
@@ -210,31 +201,17 @@ private:
   // Undefined
   Scrollable& operator=(const Scrollable& rhs);
 
-  /**
-   * Helper to create an initialized ScrollComponent
-   * @param[in] scrollable reference to ScrollView implementation
-   * @param[in] type the type of scroll component to create.
-   * @return A pointer to the created ScrollComponent.
-   */
-  Toolkit::ScrollComponent NewScrollComponent(Toolkit::Scrollable& scrollable, Toolkit::Scrollable::ScrollComponentType type);
-
 protected:
 
   Vector4         mOvershootEffectColor;    ///<The color of the overshoot bouncing effect
   float           mOvershootAnimationSpeed; ///<The speed of the overshoot animation (pixels per second)
 
-  std::map<Toolkit::Scrollable::ScrollComponentType, ScrollComponentPtr> mComponent;  ///< ScrollComponent (such as a scrollbar/page indicator/status)
-
   Toolkit::Scrollable::ScrollStartedSignalType mScrollStartedSignal;
   Toolkit::Scrollable::ScrollUpdatedSignalType mScrollUpdatedSignal;
   Toolkit::Scrollable::ScrollCompletedSignalType mScrollCompletedSignal;
 
 private:
 
-  typedef std::map<Toolkit::Scrollable::ScrollComponentType, ScrollComponentPtr> ComponentContainer;
-  typedef ComponentContainer::iterator ComponentIter;
-
-  ComponentContainer mComponents;  ///< ScrollComponent (such as a scrollbar/page indicator/status)
   bool mOvershootEnabled:1;
 };
 
index 8a24887..e445a65 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/integration-api/debug.h>
 
index 94d4bbe..489e204 100755 (executable)
@@ -24,7 +24,7 @@
 #include <limits>
 #include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/images/resource-image.h>
 
 // INTERNAL INCLUDES
@@ -355,14 +355,7 @@ void Slider::DisplayValue( float value, bool raiseSignals )
 
 void Slider::SetMarks( const MarkList& marks )
 {
-  float value;
-  for( MarkList::const_iterator it = marks.begin(), itEnd = marks.end(); it != itEnd; ++it )
-  {
-    const Property::Value& propertyValue = *it;
-    propertyValue.Get( value );
-
-    mMarks.push_back( value );
-  }
+  mMarks = marks;
 }
 
 const Slider::MarkList& Slider::GetMarks() const
@@ -732,9 +725,9 @@ float Slider::MarkFilter( float value )
   const float MARK_TOLERANCE = GetMarkTolerance();
 
   float mark;
-  for( MarkList::iterator it = mMarks.begin(), itEnd = mMarks.end(); it != itEnd; ++it )
+  for( std::size_t i = 0; i < mMarks.Size(); ++i)
   {
-    const Property::Value& propertyValue = *it;
+    const Property::Value& propertyValue = mMarks[i];
     propertyValue.Get( mark );
     mark = MapValuePercentage( mark );
 
@@ -754,9 +747,9 @@ float Slider::SnapToMark( float value )
   float closestDist = std::numeric_limits<float>::max();
 
   float mark;
-  for( MarkList::iterator it = mMarks.begin(), itEnd = mMarks.end(); it != itEnd; ++it )
+  for( std::size_t i = 0; i < mMarks.Size(); ++i)
   {
-    const Property::Value& propertyValue = *it;
+    const Property::Value& propertyValue = mMarks[i];
     propertyValue.Get( mark );
     mark = MapValuePercentage( mark );
 
@@ -777,7 +770,7 @@ bool Slider::MarkReached( float value, int& outIndex )
 
   // Binary search
   int head = 0,
-      tail = mMarks.size() - 1;
+      tail = mMarks.Size() - 1;
   int current;
   float mark;
 
index a8003c7..b265d25 100755 (executable)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/adaptor-framework/timer.h>
+#include <dali/public-api/object/property-array.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
index 008a0e5..6e6dc1b 100644 (file)
@@ -23,8 +23,8 @@
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/scripting/scripting.h>
+#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
 namespace //Unnamed namespace
index 3dc2be3..5a49cf4 100644 (file)
@@ -22,8 +22,8 @@
 #include <sstream>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/scripting/scripting.h>
+#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/devel-api/scripting/scripting.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/integration-api/debug.h>
 
index 8778a9a..aec9e08 100644 (file)
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/scripting/scripting.h>
+#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/devel-api/scripting/scripting.h>
+#include <dali/devel-api/adaptor-framework/virtual-keyboard.h>
 #include <dali/integration-api/debug.h>
-#include <dali/public-api/adaptor-framework/virtual-keyboard.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/text/rendering-backend.h>
@@ -48,10 +48,16 @@ namespace Toolkit
 namespace Internal
 {
 
-namespace
+namespace // unnamed namespace
 {
+
+#if defined(DEBUG_ENABLED)
+  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_CONTROLS");
+#endif
+
   const unsigned int DEFAULT_RENDERING_BACKEND = Dali::Toolkit::Text::DEFAULT_RENDERING_BACKEND;
-}
+
+} // unnamed namespace
 
 namespace
 {
@@ -146,6 +152,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::TextField::Property::RENDERING_BACKEND:
       {
         int backend = value.Get< int >();
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p RENDERING_BACKEND %d\n", impl.mController.Get(), backend );
 
         if( impl.mRenderingBackend != backend )
         {
@@ -158,7 +165,10 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       {
         if( impl.mController )
         {
-          impl.mController->SetText( value.Get< std::string >() );
+          std::string text = value.Get< std::string >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p TEXT %s\n", impl.mController.Get(), text.c_str() );
+
+          impl.mController->SetText( text );
         }
         break;
       }
@@ -166,7 +176,10 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       {
         if( impl.mController )
         {
-          impl.mController->SetPlaceholderText( PLACEHOLDER_TYPE_INACTIVE, value.Get< std::string >() );
+          std::string text = value.Get< std::string >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PLACEHOLDER_TEXT %s\n", impl.mController.Get(), text.c_str() );
+
+          impl.mController->SetPlaceholderText( PLACEHOLDER_TYPE_INACTIVE, text );
         }
         break;
       }
@@ -174,7 +187,10 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       {
         if( impl.mController )
         {
-          impl.mController->SetPlaceholderText( PLACEHOLDER_TYPE_ACTIVE, value.Get< std::string >() );
+          std::string text = value.Get< std::string >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PLACEHOLDER_TEXT_FOCUSED %s\n", impl.mController.Get(), text.c_str() );
+
+          impl.mController->SetPlaceholderText( PLACEHOLDER_TYPE_ACTIVE, text );
         }
         break;
       }
@@ -183,6 +199,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         if( impl.mController )
         {
           std::string fontFamily = value.Get< std::string >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p FONT_FAMILY %s\n", impl.mController.Get(), fontFamily.c_str() );
 
           if( impl.mController->GetDefaultFontFamily() != fontFamily )
           {
@@ -197,6 +214,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         if( impl.mController )
         {
           std::string fontStyle = value.Get< std::string >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p FONT_STYLE %s\n", impl.mController.Get(), fontStyle.c_str() );
 
           if( impl.mController->GetDefaultFontStyle() != fontStyle )
           {
@@ -211,6 +229,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         if( impl.mController )
         {
           float pointSize = value.Get< float >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p FONT_STYLE %f\n", impl.mController.Get(), pointSize );
 
           if( !Equals( impl.mController->GetDefaultPointSize(), pointSize ) )
           {
@@ -222,34 +241,46 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       }
       case Toolkit::TextField::Property::EXCEED_POLICY:
       {
-        impl.mExceedPolicy = value.Get< int >();
+        // TODO
         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 )
+        if( impl.mController )
         {
-          engine.SetHorizontalAlignment( alignment );
-          impl.RequestTextRelayout();
+          std::string alignStr = value.Get< std::string >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p HORIZONTAL_ALIGNMENT %f\n", impl.mController.Get(), alignStr.c_str() );
+
+          LayoutEngine& engine = impl.mController->GetLayoutEngine();
+          LayoutEngine::HorizontalAlignment alignment = Scripting::GetEnumeration< LayoutEngine::HorizontalAlignment >( alignStr.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 )
+        if( impl.mController )
         {
-          engine.SetVerticalAlignment( alignment );
-          impl.RequestTextRelayout();
+          std::string alignStr = value.Get< std::string >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p VERTICAL_ALIGNMENT %f\n", impl.mController.Get(), alignStr.c_str() );
+
+          LayoutEngine& engine = impl.mController->GetLayoutEngine();
+          LayoutEngine::VerticalAlignment alignment = Scripting::GetEnumeration< LayoutEngine::VerticalAlignment >( alignStr.c_str(),
+                                                                                                                    VERTICAL_ALIGNMENT_STRING_TABLE,
+                                                                                                                    VERTICAL_ALIGNMENT_STRING_TABLE_COUNT );
+
+          if( engine.GetVerticalAlignment() != alignment )
+          {
+            engine.SetVerticalAlignment( alignment );
+            impl.RequestTextRelayout();
+          }
         }
         break;
       }
@@ -258,6 +289,8 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         if ( impl.mController )
         {
           Vector4 textColor = value.Get< Vector4 >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p TEXT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), textColor.r, textColor.g, textColor.b, textColor.a );
+
           if ( impl.mController->GetTextColor() != textColor )
           {
             impl.mController->SetTextColor( textColor );
@@ -271,6 +304,8 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         if ( impl.mController )
         {
           Vector4 textColor = value.Get< Vector4 >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PLACEHOLDER_TEXT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), textColor.r, textColor.g, textColor.b, textColor.a );
+
           if ( impl.mController->GetPlaceholderTextColor() != textColor )
           {
             impl.mController->SetPlaceholderTextColor( textColor );
@@ -284,6 +319,8 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         if( impl.mController )
         {
           Vector2 shadowOffset = value.Get< Vector2 >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SHADOW_OFFSET %f,%f\n", impl.mController.Get(), shadowOffset.x, shadowOffset.y );
+
           if ( impl.mController->GetShadowOffset() != shadowOffset )
           {
             impl.mController->SetShadowOffset( shadowOffset );
@@ -297,6 +334,8 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         if( impl.mController )
         {
           Vector4 shadowColor = value.Get< Vector4 >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SHADOW_COLOR %f,%f,%f,%f\n", impl.mController.Get(), shadowColor.r, shadowColor.g, shadowColor.b, shadowColor.a );
+
           if ( impl.mController->GetShadowColor() != shadowColor )
           {
             impl.mController->SetShadowColor( shadowColor );
@@ -309,7 +348,10 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       {
         if( impl.mDecorator )
         {
-          impl.mDecorator->SetColor( PRIMARY_CURSOR, value.Get< Vector4 >() );
+          Vector4 color = value.Get< Vector4 >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PRIMARY_CURSOR_COLOR %f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a );
+
+          impl.mDecorator->SetColor( PRIMARY_CURSOR, color );
         }
         break;
       }
@@ -317,7 +359,10 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       {
         if( impl.mDecorator )
         {
-          impl.mDecorator->SetColor( SECONDARY_CURSOR, value.Get< Vector4 >() );
+          Vector4 color = value.Get< Vector4 >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SECONDARY_CURSOR_COLOR %f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a );
+
+          impl.mDecorator->SetColor( SECONDARY_CURSOR, color );
         }
         break;
       }
@@ -325,7 +370,10 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       {
         if( impl.mController )
         {
-          impl.mController->SetEnableCursorBlink( value.Get< bool >() );
+          bool enable = value.Get< bool >();
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p ENABLE_CURSOR_BLINK %d\n", impl.mController.Get(), enable );
+
+          impl.mController->SetEnableCursorBlink( enable );
         }
         break;
       }
@@ -333,7 +381,10 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       {
         if( impl.mDecorator )
         {
-          impl.mDecorator->SetCursorBlinkInterval( value.Get< float >() );
+          float interval = value.Get< float >();
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p CURSOR_BLINK_INTERVAL %f\n", impl.mController.Get(), interval );
+
+          impl.mDecorator->SetCursorBlinkInterval( interval );
         }
         break;
       }
@@ -341,13 +392,17 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       {
         if( impl.mDecorator )
         {
-          impl.mDecorator->SetCursorBlinkDuration( value.Get< float >() );
+          float duration = value.Get< float >();
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p CURSOR_BLINK_INTERVAL %f\n", impl.mController.Get(), duration );
+
+          impl.mDecorator->SetCursorBlinkDuration( duration );
         }
         break;
       }
       case Toolkit::TextField::Property::GRAB_HANDLE_IMAGE:
       {
         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p GRAB_HANDLE_IMAGE %s\n", impl.mController.Get(), image.GetUrl().c_str() );
 
         if( impl.mDecorator )
         {
@@ -358,6 +413,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE:
       {
         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p GRAB_HANDLE_PRESSED_IMAGE %s\n", impl.mController.Get(), image.GetUrl().c_str() );
 
         if( impl.mDecorator )
         {
@@ -368,6 +424,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::TextField::Property::SCROLL_THRESHOLD:
       {
         float threshold = value.Get< float >();
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SCROLL_THRESHOLD %f\n", impl.mController.Get(), threshold );
 
         if( impl.mDecorator )
         {
@@ -378,6 +435,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::TextField::Property::SCROLL_SPEED:
       {
         float speed = value.Get< float >();
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SCROLL_SPEED %f\n", impl.mController.Get(), speed );
 
         if( impl.mDecorator )
         {
@@ -388,6 +446,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT:
       {
         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_IMAGE_LEFT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
 
         if( impl.mDecorator )
         {
@@ -398,6 +457,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT:
       {
         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_IMAGE_RIGHT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
 
         if( impl.mDecorator )
         {
@@ -408,6 +468,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
       {
         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_PRESSED_IMAGE_LEFT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
 
         if( impl.mDecorator )
         {
@@ -418,6 +479,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
       {
         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_PRESSED_IMAGE_RIGHT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
 
         if( impl.mDecorator )
         {
@@ -428,6 +490,7 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       case Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR:
       {
         Vector4 color = value.Get< Vector4 >();
+        DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SELECTION_HIGHLIGHT_COLOR %f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a );
 
         if( impl.mDecorator )
         {
@@ -439,7 +502,10 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       {
         if( impl.mDecorator )
         {
-          impl.mDecorator->SetBoundingBox( value.Get< Rect<int> >() );
+          Rect<int> box = value.Get< Rect<int> >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p DECORATION_BOUNDING_BOX %d,%d %dx%d\n", impl.mController.Get(), box.x, box.y, box.width, box.height );
+
+          impl.mDecorator->SetBoundingBox( box );
         }
         break;
       }
@@ -447,7 +513,10 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
       {
         if( impl.mController )
         {
-          impl.mController->SetMaximumNumberOfCharacters( value.Get< int >() );
+          int max = value.Get< int >();
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p MAX_LENGTH %d\n", impl.mController.Get(), max );
+
+          impl.mController->SetMaximumNumberOfCharacters( max );
         }
         break;
       }
@@ -478,6 +547,7 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
         {
           std::string text;
           impl.mController->GetText( text );
+          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p returning text: %s\n", impl.mController.Get(), text.c_str() );
           value = text;
         }
         break;
@@ -788,6 +858,8 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
   if( mController->Relayout( size ) ||
       !mRenderer )
   {
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnRelayout %p Displaying new contents\n", mController.Get() );
+
     if( mDecorator )
     {
       mDecorator->Relayout( size );
@@ -833,6 +905,8 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
 void TextField::OnKeyInputFocusGained()
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyInputFocusGained %p\n", mController.Get() );
+
   VirtualKeyboard::StatusChangedSignal().Connect( this, &TextField::KeyboardStatusChanged );
 
   ImfManager imfManager = ImfManager::Get();
@@ -855,6 +929,8 @@ void TextField::OnKeyInputFocusGained()
 
 void TextField::OnKeyInputFocusLost()
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField:OnKeyInputFocusLost %p\n", mController.Get() );
+
   VirtualKeyboard::StatusChangedSignal().Disconnect( this, &TextField::KeyboardStatusChanged );
 
   ImfManager imfManager = ImfManager::Get();
@@ -876,6 +952,8 @@ void TextField::OnKeyInputFocusLost()
 
 void TextField::OnTap( const TapGesture& gesture )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnTap %p\n", mController.Get() );
+
   // Show the keyboard if it was hidden.
   if (!VirtualKeyboard::IsVisible())
   {
@@ -895,6 +973,8 @@ void TextField::OnPan( const PanGesture& gesture )
 
 bool TextField::OnKeyEvent( const KeyEvent& event )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyEvent %p keyCode %d\n", mController.Get(), event.keyCode );
+
   if( Dali::DALI_KEY_ESCAPE == event.keyCode ||
       "Return" == event.keyPressedName ) // Make a Dali key code for this
   {
@@ -907,6 +987,8 @@ bool TextField::OnKeyEvent( const KeyEvent& event )
 
 ImfManager::ImfCallbackData TextField::OnImfEvent( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnImfEvent %p eventName %d\n", mController.Get(), imfEvent.eventName );
+
   bool update( false );
 
   std::string text;
@@ -998,6 +1080,8 @@ void TextField::EnableClipping( bool clipping, const Vector2& size )
 
 void TextField::KeyboardStatusChanged(bool keyboardShown)
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::KeyboardStatusChanged %p keyboardShown %d\n", mController.Get(), keyboardShown );
+
   // Just hide the grab handle when keyboard is hidden.
   if (!keyboardShown )
   {
index 3d29f40..b57a171 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/imf-manager.h>
+#include <dali/devel-api/adaptor-framework/imf-manager.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
index c260a63..e888911 100644 (file)
@@ -20,8 +20,8 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/scripting/scripting.h>
+#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
@@ -426,6 +426,10 @@ void TextLabel::OnInitialize()
   // Use height-for-width negotiation by default
   self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
   self.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
+
+  // Enable the text ellipsis.
+  LayoutEngine& engine = mController->GetLayoutEngine();
+  engine.SetTextEllipsisEnabled( true );
 }
 
 void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange change )
index a0ca86e..d9e85c5 100644 (file)
@@ -22,7 +22,7 @@
 #include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/alignment/alignment.h>
index ebf0fcd..7fa6b3a 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/common/map-wrapper.h>
+#include <dali/devel-api/common/map-wrapper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
index e864fd2..7eaa5cd 100644 (file)
@@ -22,34 +22,23 @@ toolkit_src_files = \
    $(toolkit_src_dir)/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp \
    $(toolkit_src_dir)/controls/image-view/masked-image-view-impl.cpp \
    $(toolkit_src_dir)/controls/magnifier/magnifier-impl.cpp \
-   $(toolkit_src_dir)/controls/navigation-frame/navigation-bar.cpp \
-   $(toolkit_src_dir)/controls/navigation-frame/navigation-control-impl.cpp \
-   $(toolkit_src_dir)/controls/navigation-frame/navigation-title-bar.cpp \
-   $(toolkit_src_dir)/controls/navigation-frame/navigation-tool-bar.cpp \
-   $(toolkit_src_dir)/controls/navigation-frame/page-impl.cpp \
    $(toolkit_src_dir)/controls/popup/popup-impl.cpp \
    $(toolkit_src_dir)/controls/popup/popup-style-impl.cpp \
    $(toolkit_src_dir)/controls/page-turn-view/page-turn-portrait-view-impl.cpp \
    $(toolkit_src_dir)/controls/page-turn-view/page-turn-landscape-view-impl.cpp \
    $(toolkit_src_dir)/controls/page-turn-view/page-turn-view-impl.cpp \
    $(toolkit_src_dir)/controls/scroll-bar/scroll-bar-impl.cpp \
-   $(toolkit_src_dir)/controls/scroll-component/scroll-bar-internal-impl.cpp \
-   $(toolkit_src_dir)/controls/scroll-component/scroll-bar-internal.cpp \
+   $(toolkit_src_dir)/controls/scrollable/bouncing-effect-actor.cpp \
+   $(toolkit_src_dir)/controls/scrollable/item-view/depth-layout.cpp \
+   $(toolkit_src_dir)/controls/scrollable/item-view/grid-layout.cpp \
    $(toolkit_src_dir)/controls/scrollable/item-view/item-view-impl.cpp \
+   $(toolkit_src_dir)/controls/scrollable/item-view/spiral-layout.cpp \
    $(toolkit_src_dir)/controls/scrollable/scrollable-impl.cpp \
-   $(toolkit_src_dir)/controls/scrollable/scroll-connector-impl.cpp \
    $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-base-impl.cpp \
    $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-overshoot-indicator-impl.cpp \
    $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-effect-impl.cpp \
-   $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp \
-   $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp \
-   $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp \
-   $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-helper-functions.cpp \
    $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-impl.cpp \
-   $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp \
-   $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp \
-   $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.cpp \
-   $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.cpp \
+   $(toolkit_src_dir)/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp \
    $(toolkit_src_dir)/controls/shadow-view/shadow-view-impl.cpp \
    $(toolkit_src_dir)/controls/slider/slider-impl.cpp \
    $(toolkit_src_dir)/controls/super-blur-view/super-blur-view-impl.cpp \
@@ -92,6 +81,7 @@ toolkit_src_files = \
    $(toolkit_src_dir)/text/rendering/atlas/atlas-glyph-manager-impl.cpp \
    $(toolkit_src_dir)/text/rendering/basic/text-basic-renderer.cpp \
    $(toolkit_src_dir)/text/rendering/shaders/text-basic-shader.cpp \
+   $(toolkit_src_dir)/text/rendering/shaders/text-basic-shadow-shader.cpp \
    $(toolkit_src_dir)/text/rendering/shaders/text-bgra-shader.cpp \
    $(toolkit_src_dir)/text/rendering/text-backend-impl.cpp \
    $(toolkit_src_dir)/transition-effects/cube-transition-effect-impl.cpp \
index b1f3c14..f1dab7e 100644 (file)
 // EXTERNAL INCLUDES
 #include <cstring> // for strcmp
 #include <dali/public-api/actors/layer.h>
-#include <dali/public-api/adaptor-framework/accessibility-manager.h>
-#include <dali/public-api/adaptor-framework/sound-player.h>
-#include <dali/public-api/adaptor-framework/tts-player.h>
+#include <dali/devel-api/adaptor-framework/accessibility-manager.h>
+#include <dali/devel-api/adaptor-framework/sound-player.h>
+#include <dali/devel-api/adaptor-framework/tts-player.h>
 #include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/events/hit-test-algorithm.h>
+#include <dali/devel-api/events/hit-test-algorithm.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/integration-api/debug.h>
 
index 3c3b027..da2a7b0 100644 (file)
@@ -20,9 +20,9 @@
 
 // EXTERNAL INCLUDES
 #include <string>
-#include <dali/public-api/adaptor-framework/accessibility-action-handler.h>
-#include <dali/public-api/adaptor-framework/accessibility-gesture-handler.h>
-#include <dali/public-api/common/map-wrapper.h>
+#include <dali/devel-api/common/map-wrapper.h>
+#include <dali/devel-api/adaptor-framework/accessibility-action-handler.h>
+#include <dali/devel-api/adaptor-framework/accessibility-gesture-handler.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/integration-api/events/pan-gesture-event.h>
 
index b054f2d..facff71 100644 (file)
 // EXTERNAL INCLUDES
 #include <cstring> // for strcmp
 #include <dali/public-api/actors/layer.h>
-#include <dali/public-api/adaptor-framework/accessibility-manager.h>
-#include <dali/public-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/adaptor-framework/accessibility-manager.h>
+#include <dali/devel-api/adaptor-framework/singleton-service.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/key-event.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/integration-api/debug.h>
 
index 42adfc3..1cd958a 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
-#include <dali/public-api/adaptor-framework/physical-keyboard.h>
+#include <dali/devel-api/adaptor-framework/physical-keyboard.h>
 #include <dali/public-api/object/base-object.h>
 
 // INTERNAL INCLUDES
index 4378e84..16fde99 100644 (file)
@@ -21,9 +21,9 @@
 #include <fstream>
 #include <iostream>
 #include <sstream>
-#include <dali/public-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/adaptor-framework/singleton-service.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
index 09d0c13..a658707 100644 (file)
@@ -20,8 +20,8 @@
 // EXTERNAL INCLUDES
 #include <string>
 #include <list>
-#include <dali/public-api/adaptor-framework/style-monitor.h>
-#include <dali/public-api/common/map-wrapper.h>
+#include <dali/devel-api/common/map-wrapper.h>
+#include <dali/devel-api/adaptor-framework/style-monitor.h>
 #include <dali/public-api/object/base-object.h>
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/signals/connection-tracker.h>
index c58c126..135f71b 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <memory.h>
-#include <dali/public-api/text-abstraction/bidirectional-support.h>
+#include <dali/devel-api/text-abstraction/bidirectional-support.h>
 
 namespace Dali
 {
index 3afecbb..b1b9993 100644 (file)
@@ -211,6 +211,17 @@ uint32_t Utf32ToUtf8( const uint32_t* const utf32, uint32_t numberOfCharacters,
   return utf8 - utf8Begin;
 }
 
+void Utf32ToUtf8( const uint32_t* const utf32, uint32_t numberOfCharacters, std::string& utf8 )
+{
+  utf8.clear();
+
+  uint32_t numberOfBytes = GetNumberOfUtf8Bytes( &utf32[0], numberOfCharacters );
+  utf8.resize( numberOfBytes );
+
+  // This is a bit horrible but std::string returns a (signed) char*
+  Utf32ToUtf8( utf32, numberOfCharacters, reinterpret_cast<uint8_t*>(&utf8[0]) );
+}
+
 } // namespace Toolkit
 
 } // namespace Dali
index 7a62498..19784fb 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <stdint.h>
+#include <string>
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -76,6 +77,15 @@ uint32_t Utf8ToUtf32( const uint8_t* const utf8, uint32_t length, uint32_t* utf3
  */
 uint32_t Utf32ToUtf8( const uint32_t* const utf32, uint32_t numberOfCharacters, uint8_t* utf8 );
 
+/**
+ * @brief Converts a text array encoded in UTF32 into a text array encoded in UTF8.
+ *
+ * @param[in] utf32 The pointer to the UTF32 array.
+ * @param[in] numberOfCharacters The number of characters of the UTF32 array.
+ * @param[out] utf8 The UTF8 characters will be stored here.
+ */
+void Utf32ToUtf8( const uint32_t* const utf32, uint32_t numberOfCharacters, std::string& utf8 );
+
 } // namespace Toolkit
 
 } // namespace Dali
index e165103..d1c38e2 100644 (file)
@@ -21,7 +21,8 @@
 // EXTERNAL INCLUDES
 #include <limits>
 #include <dali/public-api/math/vector2.h>
-#include <dali/public-api/text-abstraction/font-client.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/layouts/layout-parameters.h>
@@ -39,6 +40,10 @@ namespace Text
 namespace
 {
 
+#if defined(DEBUG_ENABLED)
+  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_LAYOUT");
+#endif
+
 const float MAX_FLOAT = std::numeric_limits<float>::max();
 const bool RTL = true;
 
@@ -52,8 +57,8 @@ struct LineLayout
   LineLayout()
   : glyphIndex( 0u ),
     characterIndex( 0u ),
-    numberOfCharacters( 0u ),
     numberOfGlyphs( 0u ),
+    numberOfCharacters( 0u ),
     length( 0.f ),
     widthAdvanceDiff( 0.f ),
     wsLengthEndOfLine( 0.f ),
@@ -68,8 +73,8 @@ struct LineLayout
   {
     glyphIndex = 0u;
     characterIndex = 0u;
-    numberOfCharacters = 0u;
     numberOfGlyphs = 0u;
+    numberOfCharacters = 0u;
     length = 0.f;
     widthAdvanceDiff = 0.f;
     wsLengthEndOfLine = 0.f;
@@ -79,8 +84,8 @@ struct LineLayout
 
   GlyphIndex     glyphIndex;         ///< Index of the first glyph to be laid-out.
   CharacterIndex characterIndex;     ///< Index of the first character to be laid-out.
-  Length         numberOfCharacters; ///< The number of characters which fit in one line.
   Length         numberOfGlyphs;     ///< The number of glyph which fit in one line.
+  Length         numberOfCharacters; ///< The number of characters which fit in one line.
   float          length;             ///< The length of the glyphs which fit in one line.
   float          widthAdvanceDiff;   ///< The difference between the xBearing + width and the advance of the last glyph.
   float          wsLengthEndOfLine;  ///< The length of the white spaces at the end of the line.
@@ -93,7 +98,8 @@ struct LayoutEngine::Impl
   Impl()
   : mLayout( LayoutEngine::SINGLE_LINE_BOX ),
     mHorizontalAlignment( LayoutEngine::HORIZONTAL_ALIGN_BEGIN ),
-    mVerticalAlignment( LayoutEngine::VERTICAL_ALIGN_TOP )
+    mVerticalAlignment( LayoutEngine::VERTICAL_ALIGN_TOP ),
+    mEllipsisEnabled( false )
   {
     mFontClient = TextAbstraction::FontClient::Get();
   }
@@ -160,10 +166,17 @@ struct LayoutEngine::Impl
 
   /**
    * Retrieves the line layout for a given box width.
+   *
+   * @param[in] parameters The layout parameters.
+   * @param[out] lineLayout The line layout.
+   * @param[in] completelyFill Whether to completely fill the line ( even if the last word exceeds the boundaries ).
    */
   void GetLineLayoutForBox( const LayoutParameters& parameters,
-                            LineLayout& lineLayout )
+                            LineLayout& lineLayout,
+                            bool completelyFill )
   {
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->GetLineLayoutForBox\n" );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "  initial glyph index : %d\n", lineLayout.glyphIndex );
     // Stores temporary line layout which has not been added to the final line layout.
     LineLayout tmpLineLayout;
 
@@ -209,6 +222,7 @@ struct LayoutEngine::Impl
          glyphIndex < parameters.totalNumberOfGlyphs;
          ++glyphIndex )
     {
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "  glyph index : %d\n", glyphIndex );
       const bool isLastGlyph = glyphIndex == lastGlyphIndex;
 
       // Get the glyph info.
@@ -237,6 +251,10 @@ struct LayoutEngine::Impl
       const Character character = *( parameters.textBuffer + characterFirstIndex );
       const bool isWhiteSpace = TextAbstraction::IsWhiteSpace( character );
 
+      // Used to restore the temporal line layout when a single word does not fit in the control's width and is split by character.
+      const float previousTmpLineLength = tmpLineLayout.length;
+      const float previousTmpWidthAdvanceDiff = tmpLineLayout.widthAdvanceDiff;
+
       // Increase the accumulated length.
       if( isWhiteSpace )
       {
@@ -261,10 +279,31 @@ struct LayoutEngine::Impl
       }
 
       // Check if the accumulated length fits in the width of the box.
-      if( isMultiline && oneWordLaidOut && !isWhiteSpace &&
+      if( ( completelyFill || isMultiline ) && !isWhiteSpace &&
           ( lineLayout.length + lineLayout.wsLengthEndOfLine + tmpLineLayout.length + tmpLineLayout.widthAdvanceDiff > boundingBoxWidth ) )
       {
         // Current word does not fit in the box's width.
+        if( !oneWordLaidOut || completelyFill )
+        {
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "  Break the word by character\n" );
+
+          // The word's with doesn't fit in the control's with. It needs to be split by character.
+          if( tmpLineLayout.numberOfGlyphs > 0u )
+          {
+            tmpLineLayout.numberOfCharacters -= charactersPerGlyph;
+            --tmpLineLayout.numberOfGlyphs;
+            tmpLineLayout.length = previousTmpLineLength;
+            tmpLineLayout.widthAdvanceDiff = previousTmpWidthAdvanceDiff;
+          }
+
+          // Add part of the word to the line layout.
+          MergeLineLayout( lineLayout, tmpLineLayout );
+        }
+        else
+        {
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "  Current word does not fit.\n" );
+        }
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--GetLineLayoutForBox\n" );
         return;
       }
 
@@ -274,16 +313,16 @@ struct LayoutEngine::Impl
         // Must break the line. Update the line layout and return.
         MergeLineLayout( lineLayout, tmpLineLayout );
 
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "  Must break\n" );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--GetLineLayoutForBox\n" );
         return;
       }
 
       if( isMultiline &&
           ( TextAbstraction::WORD_BREAK == wordBreakInfo ) )
       {
-        if( !oneWordLaidOut && !isWhiteSpace )
-        {
-          oneWordLaidOut = true;
-        }
+        oneWordLaidOut = true;
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "  One word laid out\n" );
 
         // Current glyph is the last one of the current word.
         // Add the temporal layout to the current one.
@@ -300,6 +339,37 @@ struct LayoutEngine::Impl
         lastFontId = glyphInfo.fontId;
       }
     }
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--GetLineLayoutForBox\n" );
+  }
+
+  void SetGlyphPositions( const GlyphInfo* const glyphsBuffer,
+                          Length numberOfGlyphs,
+                          float penY,
+                          Vector2* glyphPositionsBuffer )
+  {
+    // Traverse the glyphs and set the positions.
+
+    // Check if the x bearing of the first character is negative.
+    // If it has a negative x bearing, it will exceed the boundaries of the actor,
+    // so the penX position needs to be moved to the right.
+    float penX = 0.f;
+
+    const GlyphInfo& glyph = *glyphsBuffer;
+    if( 0.f > glyph.xBearing )
+    {
+      penX = -glyph.xBearing;
+    }
+
+    for( GlyphIndex i = 0u; i < numberOfGlyphs; ++i )
+    {
+      const GlyphInfo& glyph = *( glyphsBuffer + i );
+      Vector2& position = *( glyphPositionsBuffer + i );
+
+      position.x = penX + glyph.xBearing;
+      position.y = penY - glyph.yBearing;
+
+      penX += glyph.advance;
+    }
   }
 
   bool LayoutText( const LayoutParameters& layoutParameters,
@@ -307,7 +377,8 @@ struct LayoutEngine::Impl
                    Vector<LineRun>& lines,
                    Size& actualSize )
   {
-    Vector2* glyphPositionsBuffer = glyphPositions.Begin();
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->LayoutText\n" );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "  box size %f, %f\n", layoutParameters.boundingBox.width, layoutParameters.boundingBox.height );
 
     float penY = 0.f;
     for( GlyphIndex index = 0u; index < layoutParameters.totalNumberOfGlyphs; )
@@ -316,67 +387,127 @@ struct LayoutEngine::Impl
       LineLayout layout;
       layout.glyphIndex = index;
       GetLineLayoutForBox( layoutParameters,
-                           layout );
+                           layout,
+                           false );
+
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "           glyph index %d\n", layout.glyphIndex );
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "       character index %d\n", layout.characterIndex );
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "      number of glyphs %d\n", layout.numberOfGlyphs );
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "  number of characters %d\n", layout.numberOfCharacters );
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "                length %f\n", layout.length );
 
       if( 0u == layout.numberOfGlyphs )
       {
         // The width is too small and no characters are laid-out.
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--LayoutText width too small!\n\n" );
         return false;
       }
 
-      LineRun lineRun;
-      lineRun.glyphIndex = index;
-      lineRun.numberOfGlyphs = layout.numberOfGlyphs;
-      lineRun.characterRun.characterIndex = layout.characterIndex;
-      lineRun.characterRun.numberOfCharacters = layout.numberOfCharacters;
-      lineRun.width = layout.length + layout.widthAdvanceDiff;
-      lineRun.ascender = layout.ascender;
-      lineRun.descender = layout.descender;
-      lineRun.extraLength = layout.wsLengthEndOfLine > 0.f ? layout.wsLengthEndOfLine - layout.widthAdvanceDiff : 0.f;
-      lineRun.direction = false;
-
-      lines.PushBack( lineRun );
-
-      // Update the actual size.
-      if( lineRun.width > actualSize.width )
+      // Set the line position. Discard if ellipsis is enabled and the position exceeds the boundaries
+      // of the box.
+      penY += layout.ascender;
+
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "  pen y %f\n", penY );
+      if( mEllipsisEnabled &&
+          ( ( penY - layout.descender > layoutParameters.boundingBox.height ) ||
+            ( ( mLayout == SINGLE_LINE_BOX ) &&
+              ( layout.length + layout.widthAdvanceDiff > layoutParameters.boundingBox.width ) ) ) )
       {
-        actualSize.width = lineRun.width;
-      }
+        // Do not layout more lines if ellipsis is enabled.
 
-      actualSize.height += ( lineRun.ascender + -lineRun.descender );
+        // The last line needs to be completely filled with characters.
+        // Part of a word may be used.
 
-      // Traverse the glyphs and set the positions.
+        const Length numberOfLines = lines.Count();
 
-      penY += layout.ascender;
+        LineRun lineRun;
+        LineLayout ellipsisLayout;
+        if( 0u != numberOfLines )
+        {
+          // Get the last line and layout it again with the 'completelyFill' flag to true.
+          lineRun = *( lines.Begin() + ( numberOfLines - 1u ) );
 
-      // Check if the x bearing of the first character is negative.
-      // If it has a negative x bearing, it will exceed the boundaries of the actor,
-      // so the penX position needs to be moved to the right.
-      float penX = 0.f;
+          penY -= layout.ascender - lineRun.descender;
 
-      const GlyphInfo& glyph = *( layoutParameters.glyphsBuffer + index );
-      if( 0.f > glyph.xBearing )
-      {
-        penX = -glyph.xBearing;
-      }
+          ellipsisLayout.glyphIndex = lineRun.glyphIndex;
+        }
+        else
+        {
+          lineRun.glyphIndex = 0u;
+          ellipsisLayout.glyphIndex = 0u;
+        }
 
-      for( GlyphIndex i = index; i < index + layout.numberOfGlyphs; ++i )
-      {
-        const GlyphInfo& glyph = *( layoutParameters.glyphsBuffer + i );
-        Vector2& position = *( glyphPositionsBuffer + i );
+        GetLineLayoutForBox( layoutParameters,
+                             ellipsisLayout,
+                             true );
+
+        lineRun.numberOfGlyphs = ellipsisLayout.numberOfGlyphs;
+        lineRun.characterRun.characterIndex = ellipsisLayout.characterIndex;
+        lineRun.characterRun.numberOfCharacters = ellipsisLayout.numberOfCharacters;
+        lineRun.width = layoutParameters.boundingBox.width;
+        lineRun.ascender = ellipsisLayout.ascender;
+        lineRun.descender = ellipsisLayout.descender;
+        lineRun.extraLength = ellipsisLayout.wsLengthEndOfLine > 0.f ? ellipsisLayout.wsLengthEndOfLine - ellipsisLayout.widthAdvanceDiff : 0.f;
+        lineRun.ellipsis = true;
 
-        position.x = penX + glyph.xBearing;
-        position.y = penY - glyph.yBearing;
+        actualSize.width = layoutParameters.boundingBox.width;
+        actualSize.height += ( lineRun.ascender + -lineRun.descender );
 
-        penX += glyph.advance;
+        SetGlyphPositions( layoutParameters.glyphsBuffer + lineRun.glyphIndex,
+                           ellipsisLayout.numberOfGlyphs,
+                           penY,
+                           glyphPositions.Begin() + lineRun.glyphIndex );
+
+        if( 0u != numberOfLines )
+        {
+          // Set the last line with the ellipsis layout.
+          *( lines.Begin() + ( numberOfLines - 1u ) ) = lineRun;
+        }
+        else
+        {
+          // Push the line.
+          lines.PushBack( lineRun );
+        }
+
+        break;
       }
+      else
+      {
+        LineRun lineRun;
+        lineRun.glyphIndex = index;
+        lineRun.numberOfGlyphs = layout.numberOfGlyphs;
+        lineRun.characterRun.characterIndex = layout.characterIndex;
+        lineRun.characterRun.numberOfCharacters = layout.numberOfCharacters;
+        lineRun.width = layout.length + layout.widthAdvanceDiff;
+        lineRun.ascender = layout.ascender;
+        lineRun.descender = layout.descender;
+        lineRun.extraLength = layout.wsLengthEndOfLine > 0.f ? layout.wsLengthEndOfLine - layout.widthAdvanceDiff : 0.f;
+        lineRun.direction = false;
+        lineRun.ellipsis = false;
+
+        lines.PushBack( lineRun );
+
+        // Update the actual size.
+        if( lineRun.width > actualSize.width )
+        {
+          actualSize.width = lineRun.width;
+        }
+
+        actualSize.height += ( lineRun.ascender + -lineRun.descender );
+
+        SetGlyphPositions( layoutParameters.glyphsBuffer + index,
+                           layout.numberOfGlyphs,
+                           penY,
+                           glyphPositions.Begin() + index );
 
-      penY += -layout.descender;
+        penY += -layout.descender;
 
-      // Increase the glyph index.
-      index += layout.numberOfGlyphs;
+        // Increase the glyph index.
+        index += layout.numberOfGlyphs;
+      }
     }
 
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--LayoutText\n\n" );
     return true;
   }
 
@@ -541,6 +672,8 @@ struct LayoutEngine::Impl
   LayoutEngine::VerticalAlignment mVerticalAlignment;
 
   TextAbstraction::FontClient mFontClient;
+
+  bool mEllipsisEnabled:1;
 };
 
 LayoutEngine::LayoutEngine()
@@ -564,6 +697,16 @@ unsigned int LayoutEngine::GetLayout() const
   return mImpl->mLayout;
 }
 
+void LayoutEngine::SetTextEllipsisEnabled( bool enabled )
+{
+  mImpl->mEllipsisEnabled = enabled;
+}
+
+bool LayoutEngine::GetTextEllipsisEnabled() const
+{
+  return mImpl->mEllipsisEnabled;
+}
+
 void LayoutEngine::SetHorizontalAlignment( HorizontalAlignment alignment )
 {
   mImpl->mHorizontalAlignment = alignment;
index 0c17d68..42ff1aa 100644 (file)
@@ -90,6 +90,18 @@ public:
   unsigned int GetLayout() const;
 
   /**
+   * @brief Enable or disable the text ellipsis.
+   *
+   * @param[in] enabled Whether to enable the text ellipsis.
+   */
+  void SetTextEllipsisEnabled( bool enabled );
+
+  /**
+   * @return Whether the text ellipsis is enabled.
+   */
+  bool GetTextEllipsisEnabled() const;
+
+  /**
    * @brief Choose the required text horizontal alignment.
    *
    * @param[in] alignment The required alignment.
index a71dc0f..5668669 100644 (file)
@@ -45,7 +45,8 @@ struct LineRun
   float              ascender;       ///< The line's ascender.
   float              descender;      ///< The line's descender.
   float              extraLength;    ///< The length of the white spaces at the end of the line.
-  CharacterDirection direction;      ///< Direction of the first character of the paragraph.
+  CharacterDirection direction : 1;  ///< Direction of the first character of the paragraph.
+  bool               ellipsis  : 1;  ///< Wheter ellipsis is added to the line.
 };
 
 } // namespace Text
index 5a43e35..2faca97 100644 (file)
@@ -502,7 +502,7 @@ void LogicalModel::SetVisualToLogicalMap( const BidirectionalLineInfoRun* const
       if( bidirectionalParagraph &&
           ( bidirectionalParagraph->characterRun.characterIndex == index ) )
       {
-        isRightToLeftParagraph = true;
+        isRightToLeftParagraph = *( modelCharacterDirections + index );
       }
 
       if( 0u == index )
index 6553c51..f4fdd18 100644 (file)
@@ -21,9 +21,9 @@
 // EXTERNAL INCLUDES
 #include <memory.h>
 #include <dali/integration-api/debug.h>
-#include <dali/public-api/adaptor-framework/singleton-service.h>
-#include <dali/public-api/text-abstraction/font-client.h>
-#include <dali/public-api/text-abstraction/script.h>
+#include <dali/devel-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/devel-api/text-abstraction/script.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/logical-model-impl.h>
@@ -454,6 +454,9 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
         if( NULL == validateFontsPerScript )
         {
           validateFontsPerScript = new ValidateFontsPerScript();
+
+          mValidFontsPerScriptCache.PushBack( validateFontsPerScript );
+          validFontsPerScriptCacheBuffer = mValidFontsPerScriptCache.Begin();
         }
 
         if( NULL != validateFontsPerScript )
index f7ff0be..0c6ab13 100644 (file)
@@ -19,7 +19,7 @@
 #include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/adaptor-framework/singleton-service.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/atlas-manager/atlas-manager-impl.h>
index e3b4827..9fefd6d 100644 (file)
 // EXTERNAL INCLUDES
 #include <dali/dali.h>
 #include <dali/integration-api/debug.h>
-//#include <dali/public-api/actors/renderer.h>
-#include <dali/public-api/text-abstraction/text-abstraction.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
+
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/atlas-manager/atlas-manager.h>
+#include <dali-toolkit/internal/text/line-run.h>
 #include <dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h>
 #include <dali-toolkit/internal/text/rendering/shaders/text-basic-shader.h>
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_ATLAS_RENDERER");
-#endif
+#include <dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.h>
+//#include <dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -38,6 +38,10 @@ using namespace Dali::Toolkit::Text;
 
 namespace
 {
+#if defined(DEBUG_ENABLED)
+  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_RENDERING");
+#endif
+
   const float ZERO( 0.0f );
   const float HALF( 0.5f );
   const float ONE( 1.0f );
@@ -188,9 +192,9 @@ struct AtlasRenderer::Impl : public ConnectionTracker
 
     CalculateBlocksSize( glyphs );
 
-    for ( uint32_t i = 0; i < glyphs.Size(); ++i )
+    for( uint32_t i = 0, glyphSize = glyphs.Size(); i < glyphSize; ++i )
     {
-      GlyphInfo glyph = glyphs[ i ];
+      const GlyphInfo& glyph = glyphs[ i ];
 
       // No operation for white space
       if ( glyph.width && glyph.height )
@@ -231,7 +235,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker
           }
         }
 
-        Vector2 position = positions[ i ];
+        const Vector2& position = positions[ i ];
         AtlasManager::Mesh2D newMesh;
         mGlyphManager.Cached( glyph.fontId, glyph.index, slot );
 
@@ -262,36 +266,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 )
+          if ( bitmap )
           {
-            setSize = true;
-            mBlockSizes[ currentBlockSize ].mNeededBlockWidth = bitmap.GetWidth();
-          }
-          if ( bitmap.GetHeight() > mBlockSizes[ currentBlockSize ].mNeededBlockHeight )
-          {
-            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, newMesh );
-            mImageIds.PushBack( slot.mImageId );
+            // Generate mesh data for this quad, plugging in our supplied position
+            if ( slot.mImageId )
+            {
+              mGlyphManager.GenerateMeshData( slot.mImageId, position, newMesh );
+              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)
@@ -339,7 +345,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker
     }
 #if defined(DEBUG_ENABLED)
     Toolkit::AtlasGlyphManager::Metrics metrics = mGlyphManager.GetMetrics();
-    DALI_LOG_INFO( gLogFilter, Debug::Concise, "TextAtlasRenderer::GlyphManager::GlyphCount: %i, AtlasCount: %i, TextureMemoryUse: %iK\n",
+    DALI_LOG_INFO( gLogFilter, Debug::General, "TextAtlasRenderer::GlyphManager::GlyphCount: %i, AtlasCount: %i, TextureMemoryUse: %iK\n",
                                                 metrics.mGlyphCount,
                                                 metrics.mAtlasMetrics.mAtlasCount,
                                                 metrics.mAtlasMetrics.mTextureMemoryUsed / 1024 );
@@ -741,26 +747,32 @@ struct AtlasRenderer::Impl : public ConnectionTracker
 
 Text::RendererPtr AtlasRenderer::New()
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Text::AtlasRenderer::New()\n" );
+
   return Text::RendererPtr( new AtlasRenderer() );
 }
 
 Actor AtlasRenderer::Render( Text::ViewInterface& view )
 {
-
   UnparentAndReset( mImpl->mActor );
 
-  Text::Length numberOfGlyphs = view.GetNumberOfGlyphs();
+  Length numberOfGlyphs = view.GetNumberOfGlyphs();
 
-  if( numberOfGlyphs > 0 )
+  if( numberOfGlyphs > 0u )
   {
     Vector<GlyphInfo> glyphs;
     glyphs.Resize( numberOfGlyphs );
 
-    view.GetGlyphs( &glyphs[0], 0, numberOfGlyphs );
-
     std::vector<Vector2> positions;
     positions.resize( numberOfGlyphs );
-    view.GetGlyphPositions( &positions[0], 0, numberOfGlyphs );
+
+    numberOfGlyphs = view.GetGlyphs( glyphs.Begin(),
+                                     &positions[0],
+                                     0u,
+                                     numberOfGlyphs );
+    glyphs.Resize( numberOfGlyphs );
+    positions.resize( numberOfGlyphs );
+
     mImpl->AddGlyphs( positions,
                       glyphs,
                       view.GetTextColor(),
@@ -770,6 +782,7 @@ Actor AtlasRenderer::Render( Text::ViewInterface& view )
                       view.GetUnderlineColor(),
                       view.GetUnderlineHeight() );
   }
+
   return mImpl->mActor;
 }
 
index d64a03b..8011823 100644 (file)
 // CLASS HEADER
 #include <dali-toolkit/internal/text/rendering/basic/text-basic-renderer.h>
 
-// INTERNAL INCLUDES
-#include <dali/public-api/text-abstraction/font-client.h>
+// EXTERNAL INCLUDES
+#include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/images/atlas.h>
+#include <dali/devel-api/images/atlas.h>
+#include <dali/integration-api/debug.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/text/line-run.h>
 #include <dali-toolkit/internal/text/rendering/shaders/text-basic-shader.h>
 #include <dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.h>
 
@@ -33,6 +37,10 @@ using namespace Dali::Toolkit::Text;
 namespace
 {
 
+#if defined(DEBUG_ENABLED)
+  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_RENDERING");
+#endif
+
 const std::size_t PADDING = 2; //< To avoid GL filtering artefacts
 
 struct TextureCoordinates
@@ -329,6 +337,8 @@ struct BasicRenderer::Impl
 
 Text::RendererPtr BasicRenderer::New()
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Text::BasicRenderer::New()\n" );
+
   return Text::RendererPtr( new BasicRenderer() );
 }
 
@@ -337,18 +347,23 @@ Actor BasicRenderer::Render( Text::ViewInterface& view )
   // Remove the previous text
   UnparentAndReset( mImpl->mActor );
 
-  Text::Length numberOfGlyphs = view.GetNumberOfGlyphs();
+  Length numberOfGlyphs = view.GetNumberOfGlyphs();
 
-  if( numberOfGlyphs > 0 )
+  if( numberOfGlyphs > 0u )
   {
     Vector<GlyphInfo> glyphs;
     glyphs.Resize( numberOfGlyphs );
 
-    view.GetGlyphs( &glyphs[0], 0, numberOfGlyphs );
-
     std::vector<Vector2> positions;
     positions.resize( numberOfGlyphs );
-    view.GetGlyphPositions( &positions[0], 0, numberOfGlyphs );
+
+    numberOfGlyphs = view.GetGlyphs( glyphs.Begin(),
+                                     &positions[0],
+                                     0u,
+                                     numberOfGlyphs );
+
+    glyphs.Resize( numberOfGlyphs );
+    positions.resize( numberOfGlyphs );
 
     mImpl->CreateAtlases( glyphs );
 
diff --git a/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp b/dali-toolkit/internal/text/rendering/shaders/text-basic-shadow-shader.cpp
new file mode 100644 (file)
index 0000000..89e7a8b
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics 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/rendering/text-renderer.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace Text
+{
+
+namespace BasicShadowShader
+{
+/*
+Dali::ShaderEffect New()
+{
+  std::string vertexShader = DALI_COMPOSE_SHADER(
+      void main()\n
+      {\n
+        gl_Position = vec4( aPosition.xy, 0.0, 1.0 );\n
+        vTexCoord = aTexCoord.xy;\n
+      }\n
+  );
+
+  std::string fragmentShader = DALI_COMPOSE_SHADER(
+      void main()\n
+      {\n
+        mediump vec4 color = texture2D( sTexture, vTexCoord );
+        gl_FragColor = vec4(uColor.rgb, uColor.a*color.r);
+      }\n
+  );
+
+  Dali::ShaderEffect shaderEffect = Dali::ShaderEffect::New( vertexShader, fragmentShader,
+                                                             Dali::GeometryType( Dali::GEOMETRY_TYPE_TEXTURED_MESH ),
+                                                             Dali::ShaderEffect::GeometryHints( Dali::ShaderEffect::HINT_NONE ) );
+  return shaderEffect;
+}
+*/
+} // namespace BasicShadowShader
+
+} // namespace Text
+
+} // namespace Toolkit
+
+} // namespace Dali
index 5653ebf..a438a3c 100644 (file)
@@ -19,7 +19,7 @@
 #include <dali-toolkit/internal/text/rendering/text-backend-impl.h>
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/adaptor-framework/singleton-service.h>
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
index efac834..3889793 100644 (file)
 #include <dali-toolkit/internal/text/segmentation.h>
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/text-abstraction/segmentation.h>
+#include <dali/devel-api/text-abstraction/segmentation.h>
+#ifdef DEBUG_ENABLED
+#include <string>
+#include <dali/integration-api/debug.h>
+#endif
+
+// INTERNAL INCLUDES
+#ifdef DEBUG_ENABLED
+#include <dali-toolkit/internal/text/character-set-conversion.h>
+#endif
+
+namespace
+{
+
+#if defined(DEBUG_ENABLED)
+  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_SEGMENTATION");
+#endif
+
+} // namespace
+
 
 namespace Dali
 {
@@ -46,6 +65,23 @@ void SetLineBreakInfo( const Vector<Character>& text,
   TextAbstraction::Segmentation::Get().GetLineBreakPositions( text.Begin(),
                                                               numberOfCharacters,
                                                               lineBreakInfo.Begin() );
+#ifdef DEBUG_ENABLED
+  if( gLogFilter->IsEnabledFor(Debug::Verbose) )
+  {
+    std::string utf8;
+    Utf32ToUtf8( text.Begin(), numberOfCharacters, utf8 );
+
+    std::string info;
+    info.reserve( numberOfCharacters );
+    for( unsigned int i=0; i<lineBreakInfo.Count(); ++i )
+    {
+      info.push_back( static_cast<char>('0' + lineBreakInfo[i]) );
+    }
+
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "SetLineBreakInfo Characters: %s\n", utf8.c_str() );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "SetLineBreakInfo Break info: %s\n", info.c_str() );
+  }
+#endif
 }
 
 void ReplaceLineBreakInfo( LogicalModel& model,
@@ -71,6 +107,23 @@ void SetWordBreakInfo( const Vector<Character>& text,
   TextAbstraction::Segmentation::Get().GetWordBreakPositions( text.Begin(),
                                                               numberOfCharacters,
                                                               wordBreakInfo.Begin() );
+#ifdef DEBUG_ENABLED
+  if( gLogFilter->IsEnabledFor(Debug::Verbose) )
+  {
+    std::string utf8;
+    Utf32ToUtf8( text.Begin(), numberOfCharacters, utf8 );
+
+    std::string info;
+    info.reserve( numberOfCharacters );
+    for( unsigned int i=0; i<wordBreakInfo.Count(); ++i )
+    {
+      info.push_back( static_cast<char>('0' + wordBreakInfo[i]) );
+    }
+
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "SetWordBreakInfo Characters: %s\n", utf8.c_str() );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "SetWordBreakInfo Break info: %s\n", info.c_str() );
+  }
+#endif
 }
 
 void ReplaceWordBreakInfo( LogicalModel& model,
index 8e2eed1..c236d28 100644 (file)
@@ -19,8 +19,8 @@
 #include <dali-toolkit/internal/text/shaper.h>
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/text-abstraction/script.h>
-#include <dali/public-api/text-abstraction/shaping.h>
+#include <dali/devel-api/text-abstraction/script.h>
+#include <dali/devel-api/text-abstraction/shaping.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/font-run.h>
index f39effe..f77714c 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/key.h>
+#include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/bidirectional-support.h>
 namespace
 {
 
+#if defined(DEBUG_ENABLED)
+  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_CONTROLS");
+#endif
+
 /**
  * @brief Some characters can be shaped in more than one glyph.
  * This struct is used to retrieve metrics from these group of glyphs.
@@ -138,14 +143,14 @@ EventData::~EventData()
 
 bool Controller::Impl::ProcessInputEvents()
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::ProcessInputEvents\n" );
   if( NULL == mEventData )
   {
     // Nothing to do if there is no text input.
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::ProcessInputEvents no event data\n" );
     return false;
   }
 
-  mEventData->mDecoratorUpdated = false;
-
   if( mEventData->mDecorator )
   {
     for( std::vector<Event>::iterator iter = mEventData->mEventQueue.begin();
@@ -154,16 +159,6 @@ bool Controller::Impl::ProcessInputEvents()
     {
       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 );
@@ -235,84 +230,11 @@ bool Controller::Impl::ProcessInputEvents()
 
   mEventData->mEventQueue.clear();
 
-  return mEventData->mDecoratorUpdated;
-}
-
-void Controller::Impl::ReplaceTextWithPlaceholder()
-{
-  DALI_ASSERT_DEBUG( mEventData && "No placeholder text available" );
-  if( !mEventData )
-  {
-    return;
-  }
-
-  // Disable handles when showing place-holder text
-  mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
-  mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
-  mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
-
-  const char* text( NULL );
-  size_t size( 0 );
-
-  if( EventData::INACTIVE != mEventData->mState &&
-      0u != mEventData->mPlaceholderTextActive.c_str() )
-  {
-    text = mEventData->mPlaceholderTextActive.c_str();
-    size = mEventData->mPlaceholderTextActive.size();
-  }
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::ProcessInputEvents\n" );
 
-  else
-  {
-    text = mEventData->mPlaceholderTextInactive.c_str();
-    size = mEventData->mPlaceholderTextInactive.size();
-  }
-
-  // Reset buffers.
-  mLogicalModel->mText.Clear();
-  mLogicalModel->mScriptRuns.Clear();
-  mLogicalModel->mFontRuns.Clear();
-  mLogicalModel->mLineBreakInfo.Clear();
-  mLogicalModel->mWordBreakInfo.Clear();
-  mLogicalModel->mBidirectionalParagraphInfo.Clear();
-  mLogicalModel->mCharacterDirections.Clear();
-  mLogicalModel->mBidirectionalLineInfo.Clear();
-  mLogicalModel->mLogicalToVisualMap.Clear();
-  mLogicalModel->mVisualToLogicalMap.Clear();
-  mVisualModel->mGlyphs.Clear();
-  mVisualModel->mGlyphsToCharacters.Clear();
-  mVisualModel->mCharactersToGlyph.Clear();
-  mVisualModel->mCharactersPerGlyph.Clear();
-  mVisualModel->mGlyphsPerCharacter.Clear();
-  mVisualModel->mGlyphPositions.Clear();
-  mVisualModel->mLines.Clear();
-  mVisualModel->ClearCaches();
-  mVisualModel->SetTextColor( mEventData->mPlaceholderTextColor );
-
-  //  Convert text into UTF-32
-  Vector<Character>& utf32Characters = mLogicalModel->mText;
-  utf32Characters.Resize( size );
-
-  // This is a bit horrible but std::string returns a (signed) char*
-  const uint8_t* utf8 = reinterpret_cast<const uint8_t*>( text );
-
-  // Transform a text array encoded in utf8 into an array encoded in utf32.
-  // It returns the actual number of characters.
-  Length characterCount = Utf8ToUtf32( utf8, size, utf32Characters.Begin() );
-  utf32Characters.Resize( characterCount );
-
-  // Reset the cursor position
-  mEventData->mPrimaryCursorPosition = 0;
-
-  // The natural size needs to be re-calculated.
-  mRecalculateNaturalSize = true;
-
-  // Apply modifications to the model
-  mOperationsPending = ALL_OPERATIONS;
-  UpdateModel( ALL_OPERATIONS );
-  mOperationsPending = static_cast<OperationsMask>( LAYOUT             |
-                                                    ALIGN              |
-                                                    UPDATE_ACTUAL_SIZE |
-                                                    REORDER );
+  bool decoratorUpdated = mEventData->mDecoratorUpdated;
+  mEventData->mDecoratorUpdated = false;
+  return decoratorUpdated;
 }
 
 void Controller::Impl::UpdateModel( OperationsMask operationsRequired )
@@ -322,7 +244,7 @@ void Controller::Impl::UpdateModel( OperationsMask operationsRequired )
 
   Vector<Character>& utf32Characters = mLogicalModel->mText;
 
-  const Length numberOfCharacters = mLogicalModel->GetNumberOfCharacters();
+  const Length numberOfCharacters = utf32Characters.Count();
 
   Vector<LineBreakInfo>& lineBreakInfo = mLogicalModel->mLineBreakInfo;
   if( GET_LINE_BREAKS & operations )
@@ -475,24 +397,6 @@ void Controller::Impl::GetDefaultFonts( Vector<FontRun>& fonts, Length numberOfC
   }
 }
 
-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 )
@@ -532,44 +436,33 @@ void Controller::Impl::OnCursorKeyEvent( const Event& event )
 
 void Controller::Impl::OnTapEvent( const Event& event )
 {
-  if( NULL == mEventData )
+  if( NULL != mEventData )
   {
-    // Nothing to do if there is no text input.
-    return;
-  }
+    const unsigned int tapCount = event.p1.mUint;
 
-  const unsigned int tapCount = event.p1.mUint;
-
-  if( 1u == tapCount )
-  {
-    // Grab handle is not shown until a tap is received whilst EDITING
-    if( EventData::EDITING == mEventData->mState &&
-        !IsShowingPlaceholderText() )
+    if( 1u == tapCount )
     {
-      if( mEventData->mGrabHandleEnabled )
+      if( ! IsShowingPlaceholderText() )
       {
-        mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
-      }
-      mEventData->mDecorator->SetPopupActive( false );
-    }
-
-    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 );
+        const float xPosition = event.p2.mFloat - mEventData->mScrollPosition.x - mAlignmentOffset.x;
+        const float yPosition = event.p3.mFloat - mEventData->mScrollPosition.y - mAlignmentOffset.y;
 
-    mEventData->mUpdateCursorPosition = true;
-    mEventData->mScrollAfterUpdateCursorPosition = true;
-  }
-  else if( mEventData->mSelectionEnabled &&
-           ( 2u == tapCount ) )
-  {
-    ChangeState( EventData::SELECTING );
+        mEventData->mPrimaryCursorPosition = GetClosestCursorIndex( xPosition,
+                                                                    yPosition );
+      }
+      else
+      {
+        mEventData->mPrimaryCursorPosition = 0u;
+      }
 
-    RepositionSelectionHandles( event.p2.mFloat, event.p3.mFloat );
+      mEventData->mUpdateCursorPosition = true;
+      mEventData->mScrollAfterUpdateCursorPosition = true;
+    }
+    else if( mEventData->mSelectionEnabled &&
+             ( 2u == tapCount ) )
+    {
+      RepositionSelectionHandles( event.p2.mFloat, event.p3.mFloat );
+    }
   }
 }
 
@@ -740,23 +633,8 @@ void Controller::Impl::ChangeState( EventData::State newState )
 
   if( mEventData->mState != newState )
   {
-    // Show different placeholder when switching between active & inactive
-    bool updatePlaceholder( false );
-    if( IsShowingPlaceholderText() &&
-        ( EventData::INACTIVE == newState ||
-          EventData::INACTIVE == mEventData->mState ) )
-    {
-      updatePlaceholder = true;
-    }
-
     mEventData->mState = newState;
 
-    if( updatePlaceholder )
-    {
-      ReplaceTextWithPlaceholder();
-      mEventData->mDecoratorUpdated = true;
-    }
-
     if( EventData::INACTIVE == mEventData->mState )
     {
       mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_NONE );
@@ -1155,9 +1033,11 @@ CharacterIndex Controller::Impl::CalculateNewCursorIndex( CharacterIndex index )
 
 void Controller::Impl::UpdateCursorPosition()
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::UpdateCursorPosition %p\n", this );
   if( NULL == mEventData )
   {
     // Nothing to do if there is no text input.
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::UpdateCursorPosition no event data\n" );
     return;
   }
 
@@ -1174,6 +1054,7 @@ void Controller::Impl::UpdateCursorPosition()
                                        cursorPosition.y,
                                        cursorInfo.primaryCursorHeight,
                                        cursorInfo.lineHeight );
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Primary cursor position: %f,%f\n", cursorPosition.x, cursorPosition.y );
 
   // Sets the grab handle position.
   mEventData->mDecorator->SetPosition( GRAB_HANDLE,
@@ -1189,11 +1070,13 @@ void Controller::Impl::UpdateCursorPosition()
                                          cursorInfo.secondaryPosition.y + offset.y,
                                          cursorInfo.secondaryCursorHeight,
                                          cursorInfo.lineHeight );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Secondary cursor position: %f,%f\n", cursorInfo.secondaryPosition.x + offset.x, cursorInfo.secondaryPosition.y + offset.y );
   }
   else
   {
     mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
   }
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::UpdateCursorPosition\n" );
 }
 
 void Controller::Impl::UpdateSelectionHandle( HandleType handleType )
index 9295d5f..3020e67 100644 (file)
@@ -19,8 +19,8 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/text-abstraction/font-client.h>
-#include <dali/public-api/adaptor-framework/imf-manager.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/devel-api/adaptor-framework/imf-manager.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/layouts/layout-engine.h>
@@ -42,8 +42,6 @@ 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,
@@ -154,9 +152,8 @@ struct ModifyEvent
 {
   enum Type
   {
-    PLACEHOLDER_TEXT, ///< Show the placeholder text if necessary
     TEXT_REPLACED,    ///< The entire text was replaced
-    TEXT_INSERTED,      ///< Insert characters at the current cursor position
+    TEXT_INSERTED,    ///< Insert characters at the current cursor position
     TEXT_DELETED      ///< Characters were deleted
   };
 
@@ -263,17 +260,6 @@ struct Controller::Impl
     return ( mEventData && mEventData->mIsShowingPlaceholderText );
   }
 
-  void ShowPlaceholderText()
-  {
-    if( IsPlaceholderAvailable() )
-    {
-      mEventData->mIsShowingPlaceholderText = true;
-
-      // Placeholder-text is dependent on focus state i.e. replace after event processing
-      QueueModifyEvent( ModifyEvent::PLACEHOLDER_TEXT );
-    }
-  }
-
   /**
    * @brief Called when placeholder-text is hidden
    */
@@ -288,7 +274,17 @@ struct Controller::Impl
     }
   }
 
-  void PreEditReset()
+  void ClearPreEditFlag()
+  {
+    if( mEventData )
+    {
+      mEventData->mPreEditFlag = false;
+      mEventData->mPreEditStartPosition = 0;
+      mEventData->mPreEditLength = 0;
+    }
+  }
+
+  void ResetImfManager()
   {
     // Reset incase we are in a pre-edit state.
     ImfManager imfManager = ImfManager::Get();
@@ -296,12 +292,9 @@ struct Controller::Impl
     {
       imfManager.Reset(); // Will trigger a commit message
     }
-  }
 
-  /**
-   * @brief Called when placeholder-text is shown
-   */
-  void ReplaceTextWithPlaceholder();
+    ClearPreEditFlag();
+  }
 
   void UpdateModel( OperationsMask operationsRequired );
 
@@ -313,8 +306,6 @@ struct Controller::Impl
    */
   void GetDefaultFonts( Dali::Vector<FontRun>& fonts, Length numberOfCharacters );
 
-  void OnKeyboardFocus( bool hasFocus );
-
   void OnCursorKeyEvent( const Event& event );
 
   void OnTapEvent( const Event& event );
index 95102d9..6400370 100644 (file)
@@ -22,6 +22,7 @@
 #include <limits>
 #include <iostream>
 #include <dali/public-api/adaptor-framework/key.h>
+#include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/text/bidirectional-support.h>
 namespace
 {
 
+#if defined(DEBUG_ENABLED)
+  Debug::Filter* gLogFilter = Debug::Filter::New(Debug::Concise, true, "LOG_TEXT_CONTROLS");
+#endif
+
 const float MAX_FLOAT = std::numeric_limits<float>::max();
 
 const std::string EMPTY_STRING("");
@@ -58,6 +63,14 @@ ControllerPtr Controller::New( ControlInterface& controlInterface )
   return ControllerPtr( new Controller( controlInterface ) );
 }
 
+void Controller::EnableTextInput( DecoratorPtr decorator )
+{
+  if( !mImpl->mEventData )
+  {
+    mImpl->mEventData = new EventData( decorator );
+  }
+}
+
 void Controller::SetText( const std::string& text )
 {
   // Cancel previously queued inserts etc.
@@ -80,6 +93,9 @@ void Controller::SetText( const std::string& text )
     Length characterCount = Utf8ToUtf32( utf8, text.size(), utf32Characters.Begin() );
     utf32Characters.Resize( characterCount );
 
+    DALI_ASSERT_DEBUG( text.size() >= characterCount && "Invalid UTF32 conversion length" );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SetText %p UTF8 size %d, UTF32 size %d\n", this, text.size(), mImpl->mLogicalModel->mText.Count() );
+
     // Reset the cursor position
     if( mImpl->mEventData )
     {
@@ -91,7 +107,7 @@ void Controller::SetText( const std::string& text )
   }
   else
   {
-    mImpl->ShowPlaceholderText();
+    ShowPlaceholderText();
   }
 
   if( mImpl->mEventData )
@@ -101,7 +117,7 @@ void Controller::SetText( const std::string& text )
   }
 
   // Reset keyboard as text changed
-  mImpl->PreEditReset();
+  mImpl->ResetImfManager();
 }
 
 void Controller::GetText( std::string& text ) const
@@ -112,14 +128,13 @@ void Controller::GetText( std::string& text ) const
 
     if( 0u != utf32Characters.Count() )
     {
-      uint32_t numberOfBytes = GetNumberOfUtf8Bytes( &utf32Characters[0], utf32Characters.Count() );
-
-      text.resize( numberOfBytes );
-
-      // This is a bit horrible but std::string returns a (signed) char*
-      Utf32ToUtf8( &utf32Characters[0], utf32Characters.Count(), reinterpret_cast<uint8_t*>(&text[0]) );
+      Utf32ToUtf8( &utf32Characters[0], utf32Characters.Count(), text );
     }
   }
+  else
+  {
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::GetText %p empty (but showing placeholder)\n", this );
+  }
 }
 
 unsigned int Controller::GetLogicalCursorPosition() const
@@ -145,7 +160,7 @@ void Controller::SetPlaceholderText( PlaceholderType type, const std::string& te
       mImpl->mEventData->mPlaceholderTextActive = text;
     }
 
-    mImpl->ShowPlaceholderText();
+    ShowPlaceholderText();
   }
 }
 
@@ -185,20 +200,12 @@ void Controller::SetDefaultFontFamily( const std::string& defaultFontFamily )
   }
 
   mImpl->mFontDefaults->mDefaultFontFamily = defaultFontFamily;
-  mImpl->mFontDefaults->mFontId = 0u; // Remove old font ID
-  mImpl->mOperationsPending = ALL_OPERATIONS;
-  mImpl->mRecalculateNaturalSize = true;
 
   // Clear the font-specific data
-  mImpl->mLogicalModel->mFontRuns.Clear();
-  mImpl->mVisualModel->mGlyphs.Clear();
-  mImpl->mVisualModel->mGlyphsToCharacters.Clear();
-  mImpl->mVisualModel->mCharactersToGlyph.Clear();
-  mImpl->mVisualModel->mCharactersPerGlyph.Clear();
-  mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
-  mImpl->mVisualModel->mGlyphPositions.Clear();
-  mImpl->mVisualModel->mLines.Clear();
-  mImpl->mVisualModel->ClearCaches();
+  ClearFontData();
+
+  mImpl->mOperationsPending = ALL_OPERATIONS;
+  mImpl->mRecalculateNaturalSize = true;
 
   mImpl->RequestRelayout();
 }
@@ -221,20 +228,12 @@ void Controller::SetDefaultFontStyle( const std::string& defaultFontStyle )
   }
 
   mImpl->mFontDefaults->mDefaultFontStyle = defaultFontStyle;
-  mImpl->mFontDefaults->mFontId = 0u; // Remove old font ID
-  mImpl->mOperationsPending = ALL_OPERATIONS;
-  mImpl->mRecalculateNaturalSize = true;
 
   // Clear the font-specific data
-  mImpl->mLogicalModel->mFontRuns.Clear();
-  mImpl->mVisualModel->mGlyphs.Clear();
-  mImpl->mVisualModel->mGlyphsToCharacters.Clear();
-  mImpl->mVisualModel->mCharactersToGlyph.Clear();
-  mImpl->mVisualModel->mCharactersPerGlyph.Clear();
-  mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
-  mImpl->mVisualModel->mGlyphPositions.Clear();
-  mImpl->mVisualModel->mLines.Clear();
-  mImpl->mVisualModel->ClearCaches();
+  ClearFontData();
+
+  mImpl->mOperationsPending = ALL_OPERATIONS;
+  mImpl->mRecalculateNaturalSize = true;
 
   mImpl->RequestRelayout();
 }
@@ -257,20 +256,12 @@ void Controller::SetDefaultPointSize( float pointSize )
   }
 
   mImpl->mFontDefaults->mDefaultPointSize = pointSize;
-  mImpl->mFontDefaults->mFontId = 0u; // Remove old font ID
-  mImpl->mOperationsPending = ALL_OPERATIONS;
-  mImpl->mRecalculateNaturalSize = true;
 
   // Clear the font-specific data
-  mImpl->mLogicalModel->mFontRuns.Clear();
-  mImpl->mVisualModel->mGlyphs.Clear();
-  mImpl->mVisualModel->mGlyphsToCharacters.Clear();
-  mImpl->mVisualModel->mCharactersToGlyph.Clear();
-  mImpl->mVisualModel->mCharactersPerGlyph.Clear();
-  mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
-  mImpl->mVisualModel->mGlyphPositions.Clear();
-  mImpl->mVisualModel->mLines.Clear();
-  mImpl->mVisualModel->ClearCaches();
+  ClearFontData();
+
+  mImpl->mOperationsPending = ALL_OPERATIONS;
+  mImpl->mRecalculateNaturalSize = true;
 
   mImpl->RequestRelayout();
 }
@@ -304,6 +295,9 @@ bool Controller::RemoveText( int cursorOffset, int numberOfChars )
 {
   bool removed( false );
 
+  DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p mText.Count() %d cursor %d cursorOffset %d numberOfChars %d\n",
+                 this, mImpl->mLogicalModel->mText.Count(), mImpl->mEventData->mPrimaryCursorPosition, cursorOffset, numberOfChars );
+
   if( ! mImpl->IsShowingPlaceholderText() )
   {
     // Delete at current cursor position
@@ -334,6 +328,7 @@ bool Controller::RemoveText( int cursorOffset, int numberOfChars )
       // Cursor position retreat
       oldCursorIndex = cursorIndex;
 
+      DALI_LOG_INFO( gLogFilter, Debug::General, "Controller::RemoveText %p removed %d\n", this, numberOfChars );
       removed = true;
     }
   }
@@ -414,14 +409,6 @@ float Controller::GetUnderlineHeight() const
   return mImpl->mVisualModel->GetUnderlineHeight();
 }
 
-void Controller::EnableTextInput( DecoratorPtr decorator )
-{
-  if( !mImpl->mEventData )
-  {
-    mImpl->mEventData = new EventData( decorator );
-  }
-}
-
 void Controller::SetEnableCursorBlink( bool enable )
 {
   DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "TextInput disabled" );
@@ -465,6 +452,7 @@ const Vector2& Controller::GetAlignmentOffset() const
 
 Vector3 Controller::GetNaturalSize()
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::GetNaturalSize\n" );
   Vector3 naturalSize;
 
   // Make sure the model is up-to-date before layouting
@@ -505,10 +493,14 @@ Vector3 Controller::GetNaturalSize()
     mImpl->mVisualModel->SetNaturalSize( naturalSize.GetVectorXY() );
 
     mImpl->mRecalculateNaturalSize = false;
+
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::GetNaturalSize calculated %f,%f,%f\n", naturalSize.x, naturalSize.y, naturalSize.z );
   }
   else
   {
     naturalSize = mImpl->mVisualModel->GetNaturalSize();
+
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::GetNaturalSize cached %f,%f,%f\n", naturalSize.x, naturalSize.y, naturalSize.z );
   }
 
   return naturalSize;
@@ -516,6 +508,7 @@ Vector3 Controller::GetNaturalSize()
 
 float Controller::GetHeightForWidth( float width )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::GetHeightForWidth %p width %f\n", this, width );
   // Make sure the model is up-to-date before layouting
   ProcessModifyEvents();
 
@@ -549,10 +542,12 @@ float Controller::GetHeightForWidth( float width )
 
     // Do the size related operations again.
     mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending | sizeOperations );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::GetHeightForWidth calculated %f\n", layoutSize.height );
   }
   else
   {
     layoutSize = mImpl->mVisualModel->GetActualSize();
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::GetHeightForWidth cached %f\n", layoutSize.height );
   }
 
   return layoutSize.height;
@@ -560,6 +555,8 @@ float Controller::GetHeightForWidth( float width )
 
 bool Controller::Relayout( const Size& size )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::Relayout %p size %f,%f\n", this, size.width, size.height );
+
   if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) )
   {
     bool glyphsRemoved( false );
@@ -569,11 +566,14 @@ bool Controller::Relayout( const Size& size )
       glyphsRemoved = true;
     }
     // Not worth to relayout if width or height is equal to zero.
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::Relayout (skipped)\n" );
     return glyphsRemoved;
   }
 
   if( size != mImpl->mControlSize )
   {
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "new size (previous size %f,%f)\n", mImpl->mControlSize.width, mImpl->mControlSize.height );
+
     // Operations that need to be done if the size changes.
     mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending |
                                                              LAYOUT                    |
@@ -605,6 +605,7 @@ bool Controller::Relayout( const Size& size )
     updated = mImpl->ProcessInputEvents() || updated;
   }
 
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::Relayout\n" );
   return updated;
 }
 
@@ -614,16 +615,7 @@ void Controller::ProcessModifyEvents()
 
   for( unsigned int i=0; i<events.size(); ++i )
   {
-    if( ModifyEvent::PLACEHOLDER_TEXT == events[0].type )
-    {
-      // Use placeholder if text is empty
-      if( 0u == mImpl->mLogicalModel->mText.Count() &&
-          mImpl->IsShowingPlaceholderText() )
-      {
-        mImpl->ReplaceTextWithPlaceholder();
-      }
-    }
-    else if( ModifyEvent::TEXT_REPLACED == events[0].type )
+    if( ModifyEvent::TEXT_REPLACED == events[0].type )
     {
       // A (single) replace event should come first, otherwise we wasted time processing NOOP events
       DALI_ASSERT_DEBUG( 0 == i && "Unexpected TEXT_REPLACED event" );
@@ -652,23 +644,7 @@ void Controller::ResetText()
 {
   // Reset buffers.
   mImpl->mLogicalModel->mText.Clear();
-  mImpl->mLogicalModel->mScriptRuns.Clear();
-  mImpl->mLogicalModel->mFontRuns.Clear();
-  mImpl->mLogicalModel->mLineBreakInfo.Clear();
-  mImpl->mLogicalModel->mWordBreakInfo.Clear();
-  mImpl->mLogicalModel->mBidirectionalParagraphInfo.Clear();
-  mImpl->mLogicalModel->mCharacterDirections.Clear();
-  mImpl->mLogicalModel->mBidirectionalLineInfo.Clear();
-  mImpl->mLogicalModel->mLogicalToVisualMap.Clear();
-  mImpl->mLogicalModel->mVisualToLogicalMap.Clear();
-  mImpl->mVisualModel->mGlyphs.Clear();
-  mImpl->mVisualModel->mGlyphsToCharacters.Clear();
-  mImpl->mVisualModel->mCharactersToGlyph.Clear();
-  mImpl->mVisualModel->mCharactersPerGlyph.Clear();
-  mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
-  mImpl->mVisualModel->mGlyphPositions.Clear();
-  mImpl->mVisualModel->mLines.Clear();
-  mImpl->mVisualModel->ClearCaches();
+  ClearModelData();
 
   // Reset the cursor position
   if( mImpl->mEventData )
@@ -689,23 +665,7 @@ void Controller::ResetText()
 void Controller::TextReplacedEvent()
 {
   // Reset buffers.
-  mImpl->mLogicalModel->mScriptRuns.Clear();
-  mImpl->mLogicalModel->mFontRuns.Clear();
-  mImpl->mLogicalModel->mLineBreakInfo.Clear();
-  mImpl->mLogicalModel->mWordBreakInfo.Clear();
-  mImpl->mLogicalModel->mBidirectionalParagraphInfo.Clear();
-  mImpl->mLogicalModel->mCharacterDirections.Clear();
-  mImpl->mLogicalModel->mBidirectionalLineInfo.Clear();
-  mImpl->mLogicalModel->mLogicalToVisualMap.Clear();
-  mImpl->mLogicalModel->mVisualToLogicalMap.Clear();
-  mImpl->mVisualModel->mGlyphs.Clear();
-  mImpl->mVisualModel->mGlyphsToCharacters.Clear();
-  mImpl->mVisualModel->mCharactersToGlyph.Clear();
-  mImpl->mVisualModel->mCharactersPerGlyph.Clear();
-  mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
-  mImpl->mVisualModel->mGlyphPositions.Clear();
-  mImpl->mVisualModel->mLines.Clear();
-  mImpl->mVisualModel->ClearCaches();
+  ClearModelData();
 
   // The natural size needs to be re-calculated.
   mImpl->mRecalculateNaturalSize = true;
@@ -724,23 +684,7 @@ void Controller::TextInsertedEvent()
   DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "Unexpected TextInsertedEvent" );
 
   // TODO - Optimize this
-  mImpl->mLogicalModel->mScriptRuns.Clear();
-  mImpl->mLogicalModel->mFontRuns.Clear();
-  mImpl->mLogicalModel->mLineBreakInfo.Clear();
-  mImpl->mLogicalModel->mWordBreakInfo.Clear();
-  mImpl->mLogicalModel->mBidirectionalParagraphInfo.Clear();
-  mImpl->mLogicalModel->mCharacterDirections.Clear();
-  mImpl->mLogicalModel->mBidirectionalLineInfo.Clear();
-  mImpl->mLogicalModel->mLogicalToVisualMap.Clear();
-  mImpl->mLogicalModel->mVisualToLogicalMap.Clear();
-  mImpl->mVisualModel->mGlyphs.Clear();
-  mImpl->mVisualModel->mGlyphsToCharacters.Clear();
-  mImpl->mVisualModel->mCharactersToGlyph.Clear();
-  mImpl->mVisualModel->mCharactersPerGlyph.Clear();
-  mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
-  mImpl->mVisualModel->mGlyphPositions.Clear();
-  mImpl->mVisualModel->mLines.Clear();
-  mImpl->mVisualModel->ClearCaches();
+  ClearModelData();
 
   // The natural size needs to be re-calculated.
   mImpl->mRecalculateNaturalSize = true;
@@ -763,23 +707,7 @@ void Controller::TextDeletedEvent()
   DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "Unexpected TextDeletedEvent" );
 
   // TODO - Optimize this
-  mImpl->mLogicalModel->mScriptRuns.Clear();
-  mImpl->mLogicalModel->mFontRuns.Clear();
-  mImpl->mLogicalModel->mLineBreakInfo.Clear();
-  mImpl->mLogicalModel->mWordBreakInfo.Clear();
-  mImpl->mLogicalModel->mBidirectionalParagraphInfo.Clear();
-  mImpl->mLogicalModel->mCharacterDirections.Clear();
-  mImpl->mLogicalModel->mBidirectionalLineInfo.Clear();
-  mImpl->mLogicalModel->mLogicalToVisualMap.Clear();
-  mImpl->mLogicalModel->mVisualToLogicalMap.Clear();
-  mImpl->mVisualModel->mGlyphs.Clear();
-  mImpl->mVisualModel->mGlyphsToCharacters.Clear();
-  mImpl->mVisualModel->mCharactersToGlyph.Clear();
-  mImpl->mVisualModel->mCharactersPerGlyph.Clear();
-  mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
-  mImpl->mVisualModel->mGlyphPositions.Clear();
-  mImpl->mVisualModel->mLines.Clear();
-  mImpl->mVisualModel->ClearCaches();
+  ClearModelData();
 
   // The natural size needs to be re-calculated.
   mImpl->mRecalculateNaturalSize = true;
@@ -801,6 +729,7 @@ bool Controller::DoRelayout( const Size& size,
                              OperationsMask operationsRequired,
                              Size& layoutSize )
 {
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::DoRelayout %p size %f,%f\n", this, size.width, size.height );
   bool viewUpdated( false );
 
   // Calculate the operations to be done.
@@ -817,6 +746,7 @@ bool Controller::DoRelayout( const Size& size,
     if( 0u == numberOfGlyphs )
     {
       // Nothing else to do if there is no glyphs.
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::DoRelayout no glyphs, view updated true\n" );
       return true;
     }
 
@@ -932,6 +862,7 @@ bool Controller::DoRelayout( const Size& size,
     layoutSize = mImpl->mVisualModel->GetActualSize();
   }
 
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::DoRelayout, view updated %s\n", ( viewUpdated ? "true" : "false" ) );
   return viewUpdated;
 }
 
@@ -1015,8 +946,13 @@ void Controller::KeyboardFocusGainEvent()
 
   if( mImpl->mEventData )
   {
-    Event event( Event::KEYBOARD_FOCUS_GAIN_EVENT );
-    mImpl->mEventData->mEventQueue.push_back( event );
+    mImpl->ChangeState( EventData::EDITING );
+
+    if( mImpl->IsShowingPlaceholderText() )
+    {
+      // Show alternative placeholder-text when editing
+      ShowPlaceholderText();
+    }
 
     mImpl->RequestRelayout();
   }
@@ -1028,8 +964,13 @@ void Controller::KeyboardFocusLostEvent()
 
   if( mImpl->mEventData )
   {
-    Event event( Event::KEYBOARD_FOCUS_LOST_EVENT );
-    mImpl->mEventData->mEventQueue.push_back( event );
+    mImpl->ChangeState( EventData::INACTIVE );
+
+    if( mImpl->IsShowingPlaceholderText() )
+    {
+      // Revert to regular placeholder-text when not editing
+      ShowPlaceholderText();
+    }
 
     mImpl->RequestRelayout();
   }
@@ -1062,6 +1003,11 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
     }
     else if( Dali::DALI_KEY_BACKSPACE == keyCode )
     {
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p DALI_KEY_BACKSPACE\n", this );
+
+      // IMF manager is no longer handling key-events
+      mImpl->ClearPreEditFlag();
+
       // Remove the character before the current cursor position
       bool removed = RemoveText( -1, 1 );
 
@@ -1069,7 +1015,8 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
       {
         if( 0u == mImpl->mLogicalModel->mText.Count() )
         {
-          mImpl->ShowPlaceholderText();
+          ShowPlaceholderText();
+          mImpl->mEventData->mUpdateCursorPosition = true;
         }
         else
         {
@@ -1079,6 +1026,11 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
     }
     else
     {
+      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::KeyEvent %p keyString %s\n", this, keyString.c_str() );
+
+      // IMF manager is no longer handling key-events
+      mImpl->ClearPreEditFlag();
+
       InsertText( keyString, COMMIT );
     }
 
@@ -1095,53 +1047,74 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ
   bool removedPreEdit( false );
   bool maxLengthReached( false );
 
+  DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "Unexpected InsertText" )
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::InsertText %p %s (%s) mPrimaryCursorPosition %d mPreEditFlag %d mPreEditStartPosition %d mPreEditLength %d\n",
+                 this, text.c_str(), (COMMIT == type ? "COMMIT" : "PRE_EDIT"),
+                 mImpl->mEventData->mPrimaryCursorPosition, mImpl->mEventData->mPreEditFlag, mImpl->mEventData->mPreEditStartPosition, mImpl->mEventData->mPreEditLength );
+
+  Vector<Character> utf32Characters;
+  Length characterCount( 0u );
+
   if( ! text.empty() )
   {
+    // The placeholder text is no longer needed
     if( mImpl->IsShowingPlaceholderText() )
     {
       ResetText();
     }
+
+    //  Convert text into UTF-32
+    utf32Characters.Resize( text.size() );
+
+    // This is a bit horrible but std::string returns a (signed) char*
+    const uint8_t* utf8 = reinterpret_cast<const uint8_t*>( text.c_str() );
+
+    // Transform a text array encoded in utf8 into an array encoded in utf32.
+    // It returns the actual number of characters.
+    characterCount = Utf8ToUtf32( utf8, text.size(), utf32Characters.Begin() );
+    utf32Characters.Resize( characterCount );
+
+    DALI_ASSERT_DEBUG( text.size() >= utf32Characters.Count() && "Invalid UTF32 conversion length" );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "UTF8 size %d, UTF32 size %d\n", text.size(), utf32Characters.Count() );
   }
 
-  if( mImpl->mEventData )
+  if( 0u != utf32Characters.Count() )
   {
-    if( COMMIT == type )
-    {
-      mImpl->mEventData->mPreEditFlag = false;
-    }
-    else // PRE_EDIT
+    // Handle the IMF (predicitive text) state changes
+    if( mImpl->mEventData )
     {
       if( mImpl->mEventData->mPreEditFlag &&
           0 != mImpl->mEventData->mPreEditLength )
       {
         // Remove previous pre-edit text
+        CharacterIndex offset = mImpl->mEventData->mPrimaryCursorPosition - mImpl->mEventData->mPreEditStartPosition;
+        removedPreEdit = RemoveText( -static_cast<int>(offset), mImpl->mEventData->mPreEditLength );
+
         mImpl->mEventData->mPrimaryCursorPosition = mImpl->mEventData->mPreEditStartPosition;
-        removedPreEdit = RemoveText( -1, mImpl->mEventData->mPreEditLength );
+        mImpl->mEventData->mPreEditLength = 0;
       }
-      else
+
+      if( COMMIT == type )
       {
-        // Record the start of the pre-edit text
-        mImpl->mEventData->mPreEditStartPosition = mImpl->mEventData->mPrimaryCursorPosition;
-        mImpl->mEventData->mPreEditLength = text.size();
+        // IMF manager is no longer handling key-events
+        mImpl->ClearPreEditFlag();
       }
+      else // PRE_EDIT
+      {
+        if( ! mImpl->mEventData->mPreEditFlag )
+        {
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Entered PreEdit state" );
 
-      mImpl->mEventData->mPreEditFlag = true;
-    }
-  }
-
-  if( ! text.empty() )
-  {
-    //  Convert text into UTF-32
-    Vector<Character> utf32Characters;
-    utf32Characters.Resize( text.size() );
+          // Record the start of the pre-edit text
+          mImpl->mEventData->mPreEditStartPosition = mImpl->mEventData->mPrimaryCursorPosition;
+        }
 
-    // This is a bit horrible but std::string returns a (signed) char*
-    const uint8_t* utf8 = reinterpret_cast<const uint8_t*>( text.c_str() );
+        mImpl->mEventData->mPreEditLength = utf32Characters.Count();
+        mImpl->mEventData->mPreEditFlag = true;
 
-    // Transform a text array encoded in utf8 into an array encoded in utf32.
-    // It returns the actual number of characters.
-    Length characterCount = Utf8ToUtf32( utf8, text.size(), utf32Characters.Begin() );
-    utf32Characters.Resize( characterCount );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "mPreEditStartPosition %d mPreEditLength %d\n", mImpl->mEventData->mPreEditStartPosition, mImpl->mEventData->mPreEditLength );
+      }
+    }
 
     const Length numberOfCharactersInModel = mImpl->mLogicalModel->GetNumberOfCharacters();
 
@@ -1164,9 +1137,12 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ
     }
 
     cursorIndex += maxSizeOfNewText;
+
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Inserted %d characters, new size %d new cursor %d\n", maxSizeOfNewText, mImpl->mLogicalModel->mText.Count(), mImpl->mEventData->mPrimaryCursorPosition );
   }
 
-  if( removedPreEdit || !text.empty() )
+  if( removedPreEdit ||
+      0 != utf32Characters.Count() )
   {
     // Queue an inserted event
     mImpl->QueueModifyEvent( ModifyEvent::TEXT_INSERTED );
@@ -1174,9 +1150,11 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ
 
   if( maxLengthReached )
   {
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "MaxLengthReached (%d)\n", mImpl->mLogicalModel->mText.Count() );
+
     mImpl->mControlInterface.MaxLengthReached();
 
-    mImpl->PreEditReset();
+    mImpl->ResetImfManager();
   }
 }
 
@@ -1184,6 +1162,33 @@ void Controller::TapEvent( unsigned int tapCount, float x, float y )
 {
   DALI_ASSERT_DEBUG( mImpl->mEventData && "Unexpected TapEvent" );
 
+  if( NULL != mImpl->mEventData )
+  {
+    if( 1u == tapCount )
+    {
+      bool tapDuringEditMode( EventData::EDITING == mImpl->mEventData->mState );
+
+      if( ! mImpl->IsShowingPlaceholderText() &&
+          EventData::EDITING == mImpl->mEventData->mState )
+      {
+        // Grab handle is not shown until a tap is received whilst EDITING
+        if( tapDuringEditMode )
+        {
+          mImpl->mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, true );
+        }
+        mImpl->mEventData->mDecorator->SetPopupActive( false );
+      }
+
+      mImpl->ChangeState( EventData::EDITING );
+    }
+    else if( mImpl->mEventData->mSelectionEnabled &&
+             ( 2u == tapCount ) )
+    {
+      mImpl->ChangeState( EventData::SELECTING );
+    }
+  }
+
+  // Handles & cursors must be repositioned after Relayout() i.e. after the Model has been updated
   if( mImpl->mEventData )
   {
     Event event( Event::TAP_EVENT );
@@ -1196,7 +1201,7 @@ void Controller::TapEvent( unsigned int tapCount, float x, float y )
   }
 
   // Reset keyboard as tap event has occurred.
-  mImpl->PreEditReset();
+  mImpl->ResetImfManager();
 }
 
 void Controller::PanEvent( Gesture::State state, const Vector2& displacement )
@@ -1268,6 +1273,103 @@ Controller::~Controller()
   delete mImpl;
 }
 
+void Controller::ShowPlaceholderText()
+{
+  if( mImpl->IsPlaceholderAvailable() )
+  {
+    DALI_ASSERT_DEBUG( mImpl->mEventData && "No placeholder text available" );
+
+    mImpl->mEventData->mIsShowingPlaceholderText = true;
+
+    // Cancel previously queued inserts etc.
+    mImpl->mModifyEvents.clear();
+
+    // Disable handles when showing place-holder text
+    mImpl->mEventData->mDecorator->SetHandleActive( GRAB_HANDLE, false );
+    mImpl->mEventData->mDecorator->SetHandleActive( LEFT_SELECTION_HANDLE, false );
+    mImpl->mEventData->mDecorator->SetHandleActive( RIGHT_SELECTION_HANDLE, false );
+
+    const char* text( NULL );
+    size_t size( 0 );
+
+    // TODO - Switch placeholder text styles when changing state
+    if( EventData::INACTIVE != mImpl->mEventData->mState &&
+        0u != mImpl->mEventData->mPlaceholderTextActive.c_str() )
+    {
+      text = mImpl->mEventData->mPlaceholderTextActive.c_str();
+      size = mImpl->mEventData->mPlaceholderTextActive.size();
+    }
+    else
+    {
+      text = mImpl->mEventData->mPlaceholderTextInactive.c_str();
+      size = mImpl->mEventData->mPlaceholderTextInactive.size();
+    }
+
+    // Reset model for showing placeholder.
+    mImpl->mLogicalModel->mText.Clear();
+    ClearModelData();
+    mImpl->mVisualModel->SetTextColor( mImpl->mEventData->mPlaceholderTextColor );
+
+    // Convert text into UTF-32
+    Vector<Character>& utf32Characters = mImpl->mLogicalModel->mText;
+    utf32Characters.Resize( size );
+
+    // This is a bit horrible but std::string returns a (signed) char*
+    const uint8_t* utf8 = reinterpret_cast<const uint8_t*>( text );
+
+    // Transform a text array encoded in utf8 into an array encoded in utf32.
+    // It returns the actual number of characters.
+    Length characterCount = Utf8ToUtf32( utf8, size, utf32Characters.Begin() );
+    utf32Characters.Resize( characterCount );
+
+    // Reset the cursor position
+    mImpl->mEventData->mPrimaryCursorPosition = 0;
+
+    // The natural size needs to be re-calculated.
+    mImpl->mRecalculateNaturalSize = true;
+
+    // Apply modifications to the model
+    mImpl->mOperationsPending = ALL_OPERATIONS;
+    mImpl->QueueModifyEvent( ModifyEvent::TEXT_REPLACED );
+  }
+}
+
+void Controller::ClearModelData()
+{
+  // n.b. This does not Clear the mText from mLogicalModel
+  mImpl->mLogicalModel->mScriptRuns.Clear();
+  mImpl->mLogicalModel->mFontRuns.Clear();
+  mImpl->mLogicalModel->mLineBreakInfo.Clear();
+  mImpl->mLogicalModel->mWordBreakInfo.Clear();
+  mImpl->mLogicalModel->mBidirectionalParagraphInfo.Clear();
+  mImpl->mLogicalModel->mCharacterDirections.Clear();
+  mImpl->mLogicalModel->mBidirectionalLineInfo.Clear();
+  mImpl->mLogicalModel->mLogicalToVisualMap.Clear();
+  mImpl->mLogicalModel->mVisualToLogicalMap.Clear();
+  mImpl->mVisualModel->mGlyphs.Clear();
+  mImpl->mVisualModel->mGlyphsToCharacters.Clear();
+  mImpl->mVisualModel->mCharactersToGlyph.Clear();
+  mImpl->mVisualModel->mCharactersPerGlyph.Clear();
+  mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
+  mImpl->mVisualModel->mGlyphPositions.Clear();
+  mImpl->mVisualModel->mLines.Clear();
+  mImpl->mVisualModel->ClearCaches();
+}
+
+void Controller::ClearFontData()
+{
+  mImpl->mFontDefaults->mFontId = 0u; // Remove old font ID
+  mImpl->mLogicalModel->mFontRuns.Clear();
+  mImpl->mVisualModel->mGlyphs.Clear();
+  mImpl->mVisualModel->mGlyphsToCharacters.Clear();
+  mImpl->mVisualModel->mCharactersToGlyph.Clear();
+  mImpl->mVisualModel->mCharactersPerGlyph.Clear();
+  mImpl->mVisualModel->mGlyphsPerCharacter.Clear();
+  mImpl->mVisualModel->mGlyphPositions.Clear();
+  mImpl->mVisualModel->mLines.Clear();
+  mImpl->mVisualModel->ClearCaches();
+}
+
 Controller::Controller( ControlInterface& controlInterface )
 : mImpl( NULL )
 {
index 4edd281..63ec1c3 100644 (file)
@@ -110,6 +110,14 @@ public:
   static ControllerPtr New( ControlInterface& controlInterface );
 
   /**
+   * @brief Called to enable text input.
+   *
+   * @note Selectable or editable controls should call this once after Controller::New().
+   * @param[in] decorator Used to create cursor, selection handle decorations etc.
+   */
+  void EnableTextInput( DecoratorPtr decorator );
+
+  /**
    * @brief Replaces any text previously set.
    *
    * @note This will be converted into UTF-32 when stored in the text model.
@@ -311,14 +319,6 @@ public:
   float GetUnderlineHeight() const;
 
   /**
-   * @brief Called to enable text input.
-   *
-   * @note Only selectable or editable controls should calls this.
-   * @param[in] decorator Used to create cursor, selection handle decorations etc.
-   */
-  void EnableTextInput( DecoratorPtr decorator );
-
-  /**
    * @brief Called to enable/disable cursor blink.
    *
    * @note Only editable controls should calls this.
@@ -484,6 +484,21 @@ protected:
 private:
 
   /**
+   * @brief Helper to clear font-specific data.
+   */
+  void ShowPlaceholderText();
+
+  /**
+   * @brief Helper to clear all the model data except for LogicalModel::mText.
+   */
+  void ClearModelData();
+
+  /**
+   * @brief Helper to clear font-specific data (only).
+   */
+  void ClearFontData();
+
+  /**
    * @brief Private constructor.
    */
   Controller( ControlInterface& controlInterface );
index 17bca2d..f93ffd7 100644 (file)
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/text-abstraction/text-abstraction-definitions.h>
-#include <dali/public-api/text-abstraction/font-metrics.h>
-#include <dali/public-api/text-abstraction/glyph-info.h>
-#include <dali/public-api/text-abstraction/script.h>
+#include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
+#include <dali/devel-api/text-abstraction/font-metrics.h>
+#include <dali/devel-api/text-abstraction/glyph-info.h>
+#include <dali/devel-api/text-abstraction/script.h>
 
 namespace Dali
 {
index 3bc1761..f4bd3f2 100644 (file)
@@ -20,8 +20,8 @@
 
 // EXTERNAL INCLUDES
 #include <iostream>
-#include <dali/public-api/text-abstraction/font-client.h>
-#include <dali/public-api/text-abstraction/script.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/devel-api/text-abstraction/script.h>
 
 namespace Dali
 {
index 68d5e97..d8e2ae6 100644 (file)
@@ -35,6 +35,8 @@ namespace Toolkit
 namespace Text
 {
 
+struct LineRun;
+
 /**
  * @brief Abstract interface to provide the information necessary displaying text.
  *
@@ -65,28 +67,22 @@ public:
   virtual Length GetNumberOfGlyphs() const = 0;
 
   /**
-   * @brief Retrieves glyphs in the given buffer.
+   * @brief Retrieves glyphs and positions in the given buffers.
+   *
+   * @note The size of the @p glyphs and @p glyphPositions buffers need to be big enough to copy the @p numberOfGlyphs glyphs and positions.
+   * @note The returned number of glyphs may be less than @p numberOfGlyphs if a line has ellipsis.
    *
-   * The size of the @p glyphs buffer needs to be big enough to copy the @p numberOfGlyphs.
    * @param[out] glyphs Pointer to a buffer where the glyphs are copied.
+   * @param[out] glyphPositions Pointer to a buffer where the glyph positions are copied.
    * @param[in] glyphIndex Index to the first glyph.
    * @param[in] numberOfGlyphs Number of glyphs to be copied.
-   */
-  virtual void GetGlyphs( GlyphInfo* glyphs,
-                          GlyphIndex glyphIndex,
-                          Length numberOfGlyphs ) const = 0;
-
-  /**
-   * @brief Retrieves the glyph positions.
    *
-   * @pre The size of the @p positions buffer needs to be big enough to copy the @p numberOfGlyphs positions.
-   * @param[out] glyphPositions Pointer to a buffer where the glyph positions are copied.
-   * @param[in] glyphIndex Index to the first glyph position.
-   * @param[in] numberOfGlyphs The number of positions to be copied.
+   * @return The number of glyphs.
    */
-  virtual void GetGlyphPositions( Vector2* glyphPositions,
-                                  GlyphIndex glyphIndex,
-                                  Length numberOfGlyphs ) const = 0;
+  virtual Length GetGlyphs( GlyphInfo* glyphs,
+                            Vector2* glyphPositions,
+                            GlyphIndex glyphIndex,
+                            Length numberOfGlyphs ) const = 0;
 
   /**
    * @brief Retrieves the text color
index 61073fe..976635a 100644 (file)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/math/vector2.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
 
 namespace Dali
 {
@@ -33,12 +34,15 @@ namespace Text
 struct View::Impl
 {
   VisualModelPtr mVisualModel;
+  TextAbstraction::FontClient mFontClient; ///< Handle to the font client.
 };
 
 View::View()
 : mImpl( NULL )
 {
   mImpl = new View::Impl();
+
+  mImpl->mFontClient = TextAbstraction::FontClient::Get();
 }
 
 View::~View()
@@ -51,6 +55,139 @@ void View::SetVisualModel( VisualModelPtr visualModel )
   mImpl->mVisualModel = visualModel;
 }
 
+Length View::GetGlyphs( GlyphInfo* glyphs,
+                        Vector2* glyphPositions,
+                        GlyphIndex glyphIndex,
+                        Length numberOfGlyphs ) const
+{
+  Length numberOfLaidOutGlyphs = 0u;
+
+  if( mImpl->mVisualModel )
+  {
+    // If ellipsis is enabled, the number of glyphs the layout engine has laid out may be less than 'numberOfGlyphs'.
+    // Check the last laid out line to know if the layout engine elided some text.
+
+    const Length numberOfLines = mImpl->mVisualModel->GetNumberOfLines();
+    if( numberOfLines > 0u )
+    {
+      const LineRun& lastLine = *( mImpl->mVisualModel->mLines.Begin() + ( numberOfLines - 1u ) );
+
+      // If ellipsis is enabled, calculate the number of laid out glyphs.
+      // Otherwise use the given number of glyphs.
+      if( lastLine.ellipsis )
+      {
+        numberOfLaidOutGlyphs = lastLine.glyphIndex + lastLine.numberOfGlyphs;
+      }
+      else
+      {
+        numberOfLaidOutGlyphs = numberOfGlyphs;
+      }
+
+      // Retrieve from the visual model the glyphs and positions.
+      mImpl->mVisualModel->GetGlyphs( glyphs,
+                                      glyphIndex,
+                                      numberOfLaidOutGlyphs );
+
+      mImpl->mVisualModel->GetGlyphPositions( glyphPositions,
+                                              glyphIndex,
+                                              numberOfLaidOutGlyphs );
+
+      if( 1u == numberOfLaidOutGlyphs )
+      {
+        // not a point try to do ellipsis with only one laid out character.
+        return numberOfLaidOutGlyphs;
+      }
+
+      if( lastLine.ellipsis )
+      {
+        // firstPenX, penY and firstPenSet are used to position the ellipsis glyph if needed.
+        float firstPenX = 0.f; // Used if rtl text is elided.
+        float penY = 0.f;
+        bool firstPenSet = false;
+
+        // Add the ellipsis glyph.
+        bool inserted = false;
+        float removedGlypsWidth = 0.f;
+        Length numberOfRemovedGlyphs = 0u;
+        GlyphIndex index = numberOfLaidOutGlyphs - 1u;
+
+        // The ellipsis glyph has to fit in the place where the last glyph(s) is(are) removed.
+        while( !inserted )
+        {
+          const GlyphInfo& glyphToRemove = *( glyphs + index );
+
+          // Need to reshape the glyph as the font may be different in size.
+          const GlyphInfo& ellipsisGlyph = mImpl->mFontClient.GetEllipsisGlyph( mImpl->mFontClient.GetPointSize( glyphToRemove.fontId ) );
+
+          if( !firstPenSet )
+          {
+            const Vector2& position = *( glyphPositions + index );
+
+            // Calculates the penY of the current line. It will be used to position the ellipsis glyph.
+            penY = position.y + glyphToRemove.yBearing;
+
+            // Calculates the first penX which will be used if rtl text is elided.
+            firstPenX = position.x - glyphToRemove.xBearing;
+            if( firstPenX < -ellipsisGlyph.xBearing )
+            {
+              // Avoids to exceed the bounding box when rtl text is elided.
+              firstPenX = -ellipsisGlyph.xBearing;
+            }
+
+            removedGlypsWidth = -ellipsisGlyph.xBearing;
+
+            firstPenSet = true;
+          }
+
+          removedGlypsWidth += std::min( glyphToRemove.advance, ( glyphToRemove.xBearing + glyphToRemove.width ) );
+
+          // Calculate the width of the ellipsis glyph and check if it fits.
+          const float ellipsisGlyphWidth = ellipsisGlyph.width + ellipsisGlyph.xBearing;
+          if( ellipsisGlyphWidth < removedGlypsWidth )
+          {
+            GlyphInfo& glyphInfo = *( glyphs + index );
+            Vector2& position = *( glyphPositions + index );
+            position.x -= glyphInfo.xBearing;
+
+            // Replace the glyph by the ellipsis glyph.
+            glyphInfo = ellipsisGlyph;
+
+            // Change the 'x' and 'y' position of the ellipsis glyph.
+
+            if( position.x > firstPenX )
+            {
+              position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+            }
+
+            position.x += ellipsisGlyph.xBearing;
+            position.y = penY - ellipsisGlyph.yBearing;
+
+            inserted = true;
+          }
+          else
+          {
+            if( index > 0u )
+            {
+              --index;
+            }
+            else
+            {
+              // No space for the ellipsis.
+              inserted = true;
+            }
+            ++numberOfRemovedGlyphs;
+          }
+        }
+
+        // 'Removes' all the glyphs after the ellipsis glyph.
+        numberOfLaidOutGlyphs -= numberOfRemovedGlyphs;
+      }
+    }
+  }
+
+  return numberOfLaidOutGlyphs;
+}
+
 const Vector4& View::GetTextColor() const
 {
   if ( mImpl->mVisualModel )
@@ -128,26 +265,6 @@ Length View::GetNumberOfGlyphs() const
   return 0;
 }
 
-void View::GetGlyphs( GlyphInfo* glyphs,
-                      GlyphIndex glyphIndex,
-                      Length numberOfGlyphs ) const
-{
-  if( mImpl->mVisualModel )
-  {
-    mImpl->mVisualModel->GetGlyphs( glyphs, glyphIndex, numberOfGlyphs );
-  }
-}
-
-void View::GetGlyphPositions( Vector2* glyphPositions,
-                              GlyphIndex glyphIndex,
-                              Length numberOfGlyphs ) const
-{
-  if( mImpl->mVisualModel )
-  {
-    mImpl->mVisualModel->GetGlyphPositions( glyphPositions, glyphIndex, numberOfGlyphs );
-  }
-}
-
 } // namespace Text
 
 } // namespace Toolkit
index e611c3c..43506a5 100644 (file)
@@ -65,16 +65,10 @@ public:
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetGlyphs()
    */
-  virtual void GetGlyphs( GlyphInfo* glyphs,
-                          GlyphIndex glyphIndex,
-                          Length numberOfGlyphs ) const;
-
-  /**
-   * @copydoc Dali::Toolkit::Text::ViewInterface::GetGlyphPositions()
-   */
-  virtual void GetGlyphPositions( Vector2* glyphPositions,
-                                  GlyphIndex glyphIndex,
-                                  Length numberOfGlyphs ) const;
+  virtual Length GetGlyphs( GlyphInfo* glyphs,
+                            Vector2* glyphPositions,
+                            GlyphIndex glyphIndex,
+                            Length numberOfGlyphs ) const;
 
   /**
    * @copydoc Dali::Toolkit::Text::ViewInterface::GetTextColor()
index b05107b..444a3fd 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/buffer-image.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
+#include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 namespace Dali
index 0fafab0..d1efb7d 100644 (file)
@@ -303,7 +303,7 @@ protected:
   unsigned int               mNumRows;
   unsigned int               mNumColumns;
   Size                       mViewAreaSize;
-  ActorContainer             mBoxes;
+  std::vector< Actor >       mBoxes;
   std::vector< ImageActor >  mTiles[2];
   int                        mRotateIndex;
   Size                       mTileSize;
index 3ab0ba8..f89b622 100644 (file)
@@ -149,6 +149,16 @@ Path Builder::GetPath( const std::string &name )
   return GetImpl(*this).GetPath( name );
 }
 
+PathConstrainer Builder::GetPathConstrainer( const std::string& pathConstrainerName )
+{
+  return GetImpl(*this).GetPathConstrainer( pathConstrainerName );
+}
+
+LinearConstrainer Builder::GetLinearConstrainer( const std::string& linearConstrainerName )
+{
+  return GetImpl(*this).GetLinearConstrainer( linearConstrainerName );
+}
+
 Builder::BuilderSignalType& Builder::QuitSignal()
 {
   return GetImpl( *this ).QuitSignal();
index a975014..703d54e 100644 (file)
@@ -21,6 +21,8 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/animation/animation.h>
+#include <dali/public-api/animation/linear-constrainer.h>
+#include <dali/devel-api/animation/path-constrainer.h>
 #include <dali/public-api/images/frame-buffer-image.h>
 #include <dali/public-api/shader-effects/shader-effect.h>
 
@@ -408,6 +410,30 @@ class DALI_IMPORT_API Builder : public BaseHandle
    */
   Path GetPath( const std::string &name );
 
+  /**
+   * Get or create a PathConstrainer from the set of known PathConstrainers
+   * e.g.
+   *   PathConstrainer a = builder.GetPathConstrainer( "my-path-constrainer");
+   *
+   * @pre The Builder has been initialized.
+   * @pre The pathConstrainerName exists in the Constrainers section of the data representation
+   * @param pathConstrainerName The name of the PathConstrainer
+   * @returns A handle to a PathConstrainer if found, otherwise empty
+   */
+  PathConstrainer GetPathConstrainer( const std::string& pathConstrainerName );
+
+  /**
+   * Get or create a LinearConstrainer from the set of known LinearConstrainers
+   * e.g.
+   *   LinearConstrainer a = builder.GetLinearConstrainer( "my-linear-constrainer");
+   *
+   * @pre The Builder has been initialized.
+   * @pre The linearConstrainerName exists in the Constrainers section of the data representation
+   * @param linearConstrainerName The name of the LinearConstrainer
+   * @returns A handle to a LinearConstrainer if found, otherwise empty
+   */
+  LinearConstrainer GetLinearConstrainer( const std::string& linearConstrainerName );
+
   // Signals
 
   /**
index 51c3ab1..0d37cea 100644 (file)
@@ -165,7 +165,6 @@ public:
    * @param [in] child The child.
    * @post The child will be referenced by its parent. This means that the child will be kept alive,
    * even if the handle passed into this method is reset or destroyed.
-   * @post This may invalidate ActorContainer iterators.
    */
   void Add(Actor child);
 
@@ -175,7 +174,6 @@ public:
    * @pre This Actor (the parent) has been initialized.
    * @pre The child actor is not the same as the parent actor.
    * @param [in] child The child.
-   * @post This may invalidate ActorContainer iterators.
    */
   void Remove(Actor child);
 
index 8355fc6..0e87de0 100644 (file)
@@ -26,8 +26,8 @@
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/type-registry.h>
-#include <dali/public-api/object/type-registry-helper.h>
-#include <dali/public-api/scripting/scripting.h>
+#include <dali/devel-api/object/type-registry-helper.h>
+#include <dali/devel-api/scripting/scripting.h>
 #include <dali/public-api/size-negotiation/relayout-container.h>
 #include <dali/integration-api/debug.h>
 
index 35e679f..1cbf04f 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/style-change.h>
-#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/events/long-press-gesture.h>
 #include <dali/public-api/events/pan-gesture.h>
 #include <dali/public-api/events/pinch-gesture.h>
index ed3f117..e6a32b8 100644 (file)
@@ -181,7 +181,6 @@ public:
    * @param [in] child The child.
    * @post The child will be referenced by its parent. This means that the child will be kept alive,
    * even if the handle passed into this method is reset or destroyed.
-   * @post This may invalidate ActorContainer iterators.
    */
   void Add(Actor child);
 
@@ -191,7 +190,6 @@ public:
    * @pre This Actor (the parent) has been initialized.
    * @pre The child actor is not the same as the parent actor.
    * @param [in] child The child.
-   * @post This may invalidate ActorContainer iterators.
    */
   void Remove(Actor child);
 
diff --git a/dali-toolkit/public-api/controls/navigation-frame/navigation-bar-style.h b/dali-toolkit/public-api/controls/navigation-frame/navigation-bar-style.h
deleted file mode 100644 (file)
index 52f1d07..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-#ifndef __DALI_TOOLKIT_NAVIGATION_BAR_STYLE_H__
-#define __DALI_TOOLKIT_NAVIGATION_BAR_STYLE_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.
- *
- */
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-  /**
-   * The basic information of a navigation bar style: background and size.
-   * All the style metrics for tool bar and title bar are in pixels referring to a bar width of 'referenceWidth'.
-   * To fit the bars into different window size, the NavigationControl scales the bar by the ratio of windowWidth and referenceWidth.
-   */
-  struct BasicNaviBarStyle
-  {
-    /**
-     * Constructor
-     */
-    BasicNaviBarStyle ( Actor background,
-                    int referenceWidth,
-                    int height )
-     : background( background ),
-       referenceWidth( referenceWidth ),
-       height( height )
-     {
-     }
-
-    Actor background;              ///< bar background
-    int   referenceWidth;          ///< the width of the bar, this value also used to calculate the scale to fit the bar into windows of different sizes
-    int   height;                  ///< the height of the bar
-  };
-
-  /**
-   * The tool bar locates in the bottom of the frame where other controls (such as PushButton ) could be placed.
-   * NaviToolBarStyle provides the tool bar layout style, which customize the position and size of the controls placed on it.
-   * Controls could be added into three groups: HorizontalLeft, HorizontalCenter or HorizontalRight.
-   * The left and right groups can only have one control maximum each, while the central group can have multiple controls.
-   * It is fine to have no control in every group.
-   *               +----------------------------------------+
-   *               | +-+        +-----+  +-----+        +-+ |
-   *               | +-+        +-----+  +-----+        +-+ |
-   *               +----------------------------------------+
-   */
-  struct NaviToolBarStyle : BasicNaviBarStyle
-  {
-    /**
-     * Constructor
-     */
-    NaviToolBarStyle ( Actor background,
-                       int referenceWidth,
-                       int height,
-                       int centralMaximum,
-                       int centralMinimum,
-                       int centralButtonHeight,
-                       int centralButtonGap,
-                       int sideButtonSize,
-                       int hotizontalMargin )
-    : BasicNaviBarStyle( background, referenceWidth, height),
-      centralMaximum( centralMaximum ), centralMinimum( centralMinimum ),
-      centralButtonHeight( centralButtonHeight ), centralButtonGap( centralButtonGap ),
-      sideButtonSize( sideButtonSize ), hotizontalMargin( hotizontalMargin )
-    {
-    }
-
-    int   centralMaximum;       ///< the maximum width of central button
-    int   centralMinimum;       ///< the minimum width of central button
-    int   centralButtonHeight;  ///< the height of the central button
-    int   centralButtonGap;     ///< the gap width between central buttons
-    int   sideButtonSize;       ///< the size of side buttons in the left and right groups: sideButtonSize*sideButtonSize
-    int   hotizontalMargin;     ///< the horizontal margin width
-  };
-
-  /**
-   * The title bar locates in the top of the frame where title, subtitle, title icon and other controls could be placed.
-   * NaviTitleBarStyle provides the title bar layout style,
-   * which customize the position and size of the components placed on it and the text style of the titles.
-   * The title bar contains two groups: the left group includes title icon, title and subtitle (subtitle and title icon are not must);
-   * while the right group can have multiple controls placed on, and it is also fine to have no control on it.
-   *               +----------------------------------------+
-   *               | +-+ Title                   +-+  +-+   |
-   *               | +-+ Subtitle                +-+  +-+   |
-   *               +----------------------------------------+
-   */
-  struct NaviTitleBarStyle : BasicNaviBarStyle
-  {
-    /**
-     * Constructor
-     */
-    NaviTitleBarStyle( Actor background,
-                       int referenceWidth,
-                       int height,
-                       int titleHeightWithoutSubtitle,
-                       int titleHeightWithSubtitle,
-                       int subtitleHeight,
-                       int titleLeftMargin,
-                       int titleBottomMargin,
-                       int titleIconSize,
-                       int buttonSize,
-                       int buttonRightMargin,
-                       int buttonBottomMargin,
-                       int gapBetweenButtons )
-    : BasicNaviBarStyle( background, referenceWidth, height),
-      titleHeightWithoutSubtitle( titleHeightWithoutSubtitle ),
-      titleHeightWithSubtitle( titleHeightWithSubtitle ), subtitleHeight( subtitleHeight ),
-      titleLeftMargin( titleLeftMargin ), titleBottomMargin( titleBottomMargin ),
-      titleIconSize( titleIconSize ), buttonSize( buttonSize ),
-      buttonRightMargin( buttonRightMargin ), buttonBottomMargin( buttonBottomMargin ),
-      gapBetweenButtons( gapBetweenButtons )
-    {
-    }
-
-    int   titleHeightWithoutSubtitle;       ///< the height of the title when no subtitle exists
-    int   titleHeightWithSubtitle;          ///< the height of the title when there is subtitle below
-    int   subtitleHeight;                   ///< the height of the subtitle
-    int   titleLeftMargin;                  ///< the Margin between title and the left edge of the bar
-    int   titleBottomMargin;                ///< the Margin between title and the bottom edge of the bar
-    int   titleIconSize;                    ///< the size of the title icon: titleIconSize*titleIconSize
-    int   buttonSize;                       ///< the size of the buttons in the right group: buttonSize*buttonSize
-    int   buttonRightMargin;                ///< the Margin between the button and the right edge of the bar
-    int   buttonBottomMargin;               ///< the Margin between the button and the bottom edge of the bar
-    int   gapBetweenButtons;                ///< the gap width between buttons
-  };
-
-} // namespace Toolkit
-} // namespace Dali
-
-
-#endif /* __DALI_TOOLKIT_NAVIGATION_BAR_STYLE_H__ */
diff --git a/dali-toolkit/public-api/controls/navigation-frame/navigation-control.cpp b/dali-toolkit/public-api/controls/navigation-frame/navigation-control.cpp
deleted file mode 100644 (file)
index 747847a..0000000
+++ /dev/null
@@ -1,138 +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 "navigation-control.h"
-
-// EXTERNAL INCLUDES
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/navigation-frame/navigation-control-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-NavigationControl::NavigationControl()
-{
-}
-
-NavigationControl::NavigationControl( const NavigationControl& handle )
-: Control(handle)
-{
-}
-
-NavigationControl& NavigationControl::operator=( const NavigationControl& handle)
-{
-  if( &handle != this )
-  {
-    Control::operator=( handle );
-  }
-  return *this;
-}
-
-NavigationControl::~NavigationControl()
-{
-}
-
-NavigationControl NavigationControl::New()
-{
-  return Internal::NavigationControl::New();
-}
-
-NavigationControl NavigationControl::DownCast( BaseHandle handle )
-{
-  return Control::DownCast<NavigationControl, Internal::NavigationControl>(handle);
-}
-
-NavigationControl::NavigationControl( Internal::NavigationControl& implementation )
-: Control( implementation )
-{
-}
-
-NavigationControl::NavigationControl( Dali::Internal::CustomActor* internal )
-: Control( internal)
-{
-  VerifyCustomActorPointer<Internal::NavigationControl>(internal);
-}
-
-
-void NavigationControl::PushItem( Page item )
-{
-  GetImpl( *this ).PushItem( item );
-}
-
-Page NavigationControl::PopItem()
-{
-  return GetImpl( *this ).PopItem();
-}
-
-size_t NavigationControl::GetItemCount() const
-{
-  return GetImpl( *this ).GetItemCount();
-}
-
-Page NavigationControl::GetItem(std::size_t index) const
-{
-  return GetImpl( *this ).GetItem( index );
-}
-
-Page NavigationControl::GetCurrentItem() const
-{
-  return GetImpl(*this ).GetCurrentItem();
-}
-
-void NavigationControl::SetBackground( Actor background)
-{
-  GetImpl( *this ).SetBackground( background );
-}
-
-void NavigationControl::CreateNavigationToolBar( NaviToolBarStyle toolBarStylePortrait, NaviToolBarStyle toolBarStyleLandscape )
-{
-  GetImpl( *this ).CreateNavigationToolBar( toolBarStylePortrait, toolBarStyleLandscape );
-}
-
-void NavigationControl::CreateNavigationTitleBar( NaviTitleBarStyle titleBarStylePortrait, NaviTitleBarStyle titleBarStyleLandscape )
-{
-  GetImpl( *this ).CreateNavigationTitleBar( titleBarStylePortrait, titleBarStyleLandscape );
-}
-
-void NavigationControl::OrientationChanged( int angle )
-{
-  GetImpl( *this ).OrientationChanged( angle );
-}
-
-void NavigationControl::SetOrientationRotateAnimation( float duration, AlphaFunction alphaFunc)
-{
-  GetImpl( *this ).SetOrientationRotateAnimation( duration, alphaFunc );
-}
-
-NavigationControl::ItemPushedSignalType& NavigationControl::ItemPushedSignal()
-{
-  return GetImpl( *this ).ItemPushedSignal();
-}
-
-NavigationControl::ItemPoppedSignalType& NavigationControl::ItemPoppedSignal()
-{
-  return GetImpl( *this ).ItemPoppedSignal();
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/navigation-frame/navigation-control.h b/dali-toolkit/public-api/controls/navigation-frame/navigation-control.h
deleted file mode 100644 (file)
index 00cab60..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-#ifndef __DALI_TOOLKIT_NAVIGATION_CONTROL_H__
-#define __DALI_TOOLKIT_NAVIGATION_CONTROL_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.
- *
- */
-
-// INTERNAL INCLUDES
-#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>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal DALI_INTERNAL
-{
-// Forward declarations
-class NavigationControl;
-}
-
-/**
- * NavigationControl implements a controller than manages the navigation of hierarchical contents.
- * NavigationControl holds views as its item which are organized in a stack.
- * New items get pushed on the top of the old. Only the topmost item is displayed in the view area at one time.
- * Its layout contains a title bar on the top, a tool bar in the bottom, and the content of top item in the middle.
- * The top item carries title/subtitle/buttons/icon information,
- * so with new item on the top, the NavigationControl will update the bars accordingly.
- * if no component is needed to place on the bar for the current item, the bar is hidden
- *                 +----------------------------------------+
- *                 |                                        |
- *                 | +-+ Title                   +-+  +-+   |  title bar
- *                 | +-+ Subtitle                +-+  +-+   |
- *                 +----------------------------------------+
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |              View Area                 |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 |                                        |
- *                 +----------------------------------------+
- *                 | +-+        +-----+  +-----+        +-+ |
- *                 | +-+        +-----+  +-----+        +-+ |  tool bar
- *                 +----------------------------------------+
- *
- * Actions
- * | %Action Name      | %NavigationControl method called |
- * |-------------------|----------------------------------|
- * | push              | %PushItem()                      |
- * | pop               | %PopItem()                       |
- */
-class DALI_IMPORT_API NavigationControl : public Control
-{
-
-public:
-
-  /**
-   * Create a NavigationControl handle; this can be initialize with NavigationControl::New().
-   * Calling member function with an uninitialized handle is not allowed.
-   */
-  NavigationControl();
-
-  /**
-   * Copy Constructor.
-   */
-  NavigationControl( const NavigationControl& handle );
-
- /**
-  * Assignment operator.
-  */
-  NavigationControl& operator=( const NavigationControl& handle );
-
-  /**
-   * @brief Destructor
-   *
-   * This is non-virtual since derived Handle types must not contain data or virtual methods.
-   */
-  ~NavigationControl();
-
-  /**
-   * Create an initialized NavigationControl.
-   * @return A handle to a newly allocated Dali resource.
-   */
-  static NavigationControl New();
-
-  /**
-   * Downcast an object handle to NavigationControl.
-   * If handle points to a NavigationControl, the downcast produces valid handle.
-   * If not, the returned handle is left uninitialized.
-   * @param[in] handle Handle to an object.
-   * @return handle to a NavigationControl of an uninitialized handle.
-   */
-  static NavigationControl DownCast( BaseHandle handle );
-
-  /**
-   * Push a new item to the top of the NavigationControl stack and show it.
-   * @param[in] item A Page object.
-   */
-  void PushItem( Page item );
-
-  /**
-   * Pop an item that is on the top of the NavigationControl stack and make it disappear.
-   * It doesnot pop out the last item in the stack.
-   * It returns an uninitialized item handle if there is no item or only one item in the stack.
-   * @return The Page popped out.
-   */
-  Page PopItem();
-
-  /**
-   * Query the number of items in the stack.
-   * @return the number of items in the stack.
-   */
-  std::size_t GetItemCount() const;
-
-  /**
-   * Retrieve the index-th item in the stack
-   * Here, the index is from zero to stack size minus one, the bottom-most item is with index zero
-   * @pre There are more items in the stack than the parameter index plus one
-   * @param[in] index The location index of the item in the stack
-   * @return The index-th item in the navigation stack
-   */
-  Page GetItem(std::size_t index) const;
-
-  /**
-   * Retrieve the current top item.
-   * @return the Page object which is on the top of the stack.
-   */
-  Page GetCurrentItem() const;
-
-  /**
-   * Sets a background image.
-   * @param[in] background Actor with the navigation control background.
-   */
-  void SetBackground( Actor background);
-
-  /**
-   *Create a tool bar at the bottom of the navigation control.
-   *@param[in] toolBarStylePortrait the given navigation tool bar style of Portrait orientation.
-   *@param[in] toolBarStyleLandscape the given navigation tool bar style of Landscape orientation.
-   */
-  void CreateNavigationToolBar( NaviToolBarStyle toolBarStylePortrait, NaviToolBarStyle toolBarStyleLandscape );
-
-  /**
-   * Create a title bar at the top of the navigation control.
-   * @param[in] titleBarStylePortrait the given navigation title bar style of Portrait orientation.
-   * @param[in] titleBarStyleLandscape the given navigation title bar style of Landscape orientation.
-   */
-  void CreateNavigationTitleBar( NaviTitleBarStyle titleBarStylePortrait, NaviTitleBarStyle titleBarStyleLandscape);
-
-  /**
-   * Rotate all the contents to the new given orientation. This rotation is animated.
-   * Also change the bar style from portrait to landscape style, or vice versa.
-   * The application should invoke this function in call back of the orientation change signal if different orientations are required.
-   * @param[in] angle The angle degree of the new orientation, this is one of four discrete values, in degrees clockwise: 0, 90, 180, & 270
-   */
-  void OrientationChanged( int angle );
-
-  /**
-   * Set the duration and the alpha function for the rotating animation in OrientationChanged function above.
-   * Without calling this function, the default values are 1.0 and EaseOut respectively.
-   * @param[in] duration The duration of the rotating animation when orientation changed.
-   * @param[in] alphaFunc The alpha function of the rotating animation when orientation changed.
-   */
-  void SetOrientationRotateAnimation( float duration, AlphaFunction alphaFunc);
-
-public: //Signal
-
-  typedef Signal< void( NavigationControl, Page ) > ItemPushedSignalType;
-  typedef Signal< void( NavigationControl, Page ) > ItemPoppedSignalType;
-
-  /**
-   * Signal emitted right after a new item is pushed into the navigation stack.
-   * A callback of the following type may be connected:
-   * @code
-   *   void YourCallBackName(NavigationControl controller, Page pushedItem);
-   * @endcode
-   * @return The signal to connect to.
-   */
-  ItemPushedSignalType& ItemPushedSignal();
-
-  /**
-   * Signal emitted right after an item is popped out from the navigation stack.
-   * A callback of the following type may be connected:
-   * @code
-   *   void YourCallBackName(NavigationControl controller, Page poppedItem);
-   * @endcode
-   * If attempt to pop the bottom-most item, the poppedItem in the callback will receive an uninitialized handle
-   * The app can use this signal and check the poppedItem to be uninitialized to know the app window should be lower
-   * @return The signal to connect to.
-   */
-  ItemPoppedSignalType& ItemPoppedSignal();
-
-
-
-public: // Not intended for application developers
-
-  /**
-   * Creates a handle using the Toolkit::Internal implementation.
-   * @param[in]  implementation  The Control implementation.
-   */
-  DALI_INTERNAL NavigationControl( Internal::NavigationControl& implementation );
-
-  /**
-   * Allows the creation of this Control from an Internal::CustomActor pointer.
-   * @param[in]  internal  A pointer to the internal CustomActor.
-   */
-  explicit DALI_INTERNAL NavigationControl( Dali::Internal::CustomActor* internal );
-
-}; // class NavigationControl
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif /* __DALI_TOOLKIT_NAVIGATION_CONTROL_H__ */
diff --git a/dali-toolkit/public-api/controls/navigation-frame/page.cpp b/dali-toolkit/public-api/controls/navigation-frame/page.cpp
deleted file mode 100644 (file)
index 46287a4..0000000
+++ /dev/null
@@ -1,133 +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 "page.h"
-
-// EXTERNAL INCLUDES
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/controls/navigation-frame/page-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-Page::Page()
-{
-}
-
-Page::Page( const Page& handle )
-: Control(handle)
-{
-}
-
-Page& Page::operator=( const Page& handle )
-{
-  if( &handle != this )
-  {
-    CustomActor::operator=( handle );
-  }
-  return *this;
-}
-
-Page Page::New()
-{
-  return Internal::Page::New();
-}
-
-Page Page::DownCast( BaseHandle handle )
-{
-  return Control::DownCast<Page, Internal::Page>(handle);
-}
-
-Page::Page(Internal::Page& impl)
-: Control(impl)
-{
-}
-
-Page::Page( Dali::Internal::CustomActor* internal )
-: Control( internal)
-{
-  VerifyCustomActorPointer<Internal::Page>(internal);
-}
-
-void Page::SetTitle(const std::string& title)
-{
-  GetImpl( *this ).SetTitle(title);
-}
-
-const std::string& Page::GetTitle() const
-{
-  return GetImpl( *this ).GetTitle();
-}
-
-void Page::SetSubTitle(const std::string& subtitle)
-{
-  GetImpl( *this ).SetSubTitle(subtitle);
-}
-
-const std::string& Page::GetSubTitle() const
-{
-  return GetImpl( *this ).GetSubTitle();
-}
-
-void Page::SetTitleIcon( Actor titleIcon)
-{
-  GetImpl( *this ).SetTitleIcon(titleIcon);
-}
-
-Actor Page::GetTitleIcon() const
-{
-  return GetImpl( *this ).GetTitleIcon();
-}
-
-bool Page::AddControlToToolBar(Actor control, Alignment::Type alignment)
-{
-  return GetImpl( *this ).AddControlToToolBar(control, alignment);
-}
-
-const Page::ControlOnBarContainer Page::GetControlsOnToolBar() const
-{
-  return GetImpl( *this ).GetControlsOnToolBar();
-}
-
-bool Page::AddControlToTitleBar(Actor control)
-{
-  return GetImpl( *this ).AddControlToTitleBar(control);
-}
-
-const ActorContainer Page::GetControlsOnTitleBar() const
-{
-  return GetImpl( *this ).GetControlsOnTitleBar();
-}
-
-void Page::SetPopupMenu( Toolkit::Popup popupMenu )
-{
-  GetImpl( *this ).SetPopupMenu( popupMenu );
-}
-
-Toolkit::Popup Page::GetPopupMenu() const
-{
-  return GetImpl( *this ).GetPopupMenu();
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/navigation-frame/page.h b/dali-toolkit/public-api/controls/navigation-frame/page.h
deleted file mode 100644 (file)
index e0cf616..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-#ifndef __DALI_TOOLKIT_PAGE_H__
-#define __DALI_TOOLKIT_PAGE_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/common/dali-vector.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control.h>
-#include <dali-toolkit/public-api/controls/alignment/alignment.h>
-#include <dali-toolkit/public-api/controls/popup/popup.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal DALI_INTERNAL
-{
-// Forward declarations
-class Page;
-}
-
-/**
- * A Page is a custom control which can be pushed into the stack of navigation control.
- * It serves as the root of a navigation view.
- * It also carries the title/subtitle/buttons/icons information which would be shown on the navigation bars when the item is on the top of the stack.
- */
-class DALI_IMPORT_API Page : public Control
-{
-
-public:
-
-  /**
-   * @brief The start and end property ranges for this control.
-   */
-  enum PropertyRange
-  {
-    PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
-    PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserve property indices
-  };
-
-  /**
-   * @brief An enumeration of properties belonging to the 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)
-   */
-  struct ControlOnBar
-  {
-    /**
-     * Constructor
-     */
-    ControlOnBar(Actor actor, Toolkit::Alignment::Type alignment)
-    : control( actor ),
-      alignment( alignment )
-    {
-    }
-
-    Actor control;                            ///< The control actor
-    Toolkit::Alignment::Type alignment;       ///< The alignment of the control actor
-  };
-
-  typedef std::vector< const ControlOnBar* > ControlOnBarContainer;
-
-public:
-
-  /**
-   * Create a Page handle; this can be initialized with Page::New().
-   * Calling member function with an uninitialized handle is not allowed.
-   */
-  Page();
-
-  /**
-   * Copy Constructor.
-   */
-  Page( const Page& handle );
-
-  /**
-   * Assignment operator.
-   * Change this handle to point to another real object.
-   */
-  Page& operator=( const Page& handle );
-
-  /**
-   * Create an initialized Page.
-   * @return A handle to a newly allocated Dali resource.
-   */
-  static Page New();
-
-  /**
-   * Downcast an object handle to Page.
-   * If handle points to a Page, the downcast produces valid handle.
-   * If not, the returned handle is left uninitialized.
-   * @param[in] handle Handle to an object.
-   * @return handle to a Page of an uninitialized handle.
-   */
-  static Page DownCast( BaseHandle handle );
-
-  /**
-   * Sets the Page's title.
-   * The title will be displayed on the navigation title bar when the item is on the top of the stack.
-   * @param[in] title The Page's title.
-   */
-  void SetTitle(const std::string& title);
-
-  /**
-   * Retrieve the title of the page.
-   * @return The Page's title or "" when the item does not have a title.
-   */
-  const std::string& GetTitle() const;
-
-  /**
-   * Sets the Page's subtitle.
-   * The subtitle will be displayed on the navigation title bar when the item is on the top of the stack.
-   * @param[in] subtitle The Page's subtitle.
-   */
-  void SetSubTitle(const std::string& subtitle);
-
-  /**
-   * Retrieve the subtitle of the page.
-   * @return The Page's subtitle or "" when the subtitle does not have a subtitle.
-   */
-  const std::string& GetSubTitle() const;
-
-  /**
-   * Sets the Page's title icon.
-   * The icon will be displayed in front of the title on the navigation item bar when the item is on the top.
-   * @param[in] titleIcon The Page's icon
-   */
-  void SetTitleIcon( Actor titleIcon);
-
-  /**
-   * Retrieve the title icon of the page.
-   * @return The Page's icon or an empty handle when the item does not have title icon.
-   */
-  Actor GetTitleIcon() const;
-
-  /**
-   * Set a control onto the navigation tool bar when the item is on the top.
-   * Only one control (the last set one) is valid for HorizontalLeft and HorizontalRight each.
-   * Can have multiple controls for HorizontalCenter.
-   * If the control is uninitialized or if the alignment has a value other from HorizontalLeft/HorizontalRight/HorizontalCenter, the control is not added.
-   * @param[in] control The control on the navigation tool bar.
-   * @param[in] alignment The position of the control, can be HorizontalLeft/HorizontalRight/HorizontalCenter.
-   * @return true if add control successfully, false if fail to add the control
-   */
-  bool AddControlToToolBar(Actor control, Alignment::Type alignment);
-
-  /**
-   * Retrieve the controls that would be displayed on the navigation tool bar when the item is on the top.
-   * @return the vector of tool bar controls associated with the current item.
-   */
-  const ControlOnBarContainer GetControlsOnToolBar() const;
-
-  /**
-   * Set a control onto the right part of the navigation title bar when the item is on the top.
-   * If the control is uninitialized or if the alignment has a value other from HorizontalLeft/HorizontalRight/HorizontalCenter, the control is not added.
-   * @param[in] control The control on the navigation title bar.
-   * @return true if add control successfully, false if fail to add the control
-   */
-  bool AddControlToTitleBar(Actor control);
-
-  /**
-   * Retrieve the controls that would be displayed on the navigation title bar when the item is on the top.
-   * @return the vector of title bar controls associate with the current item.
-   */
-  const ActorContainer GetControlsOnTitleBar() const;
-
-  /**
-   * Set the menu which would pop up when the KEY_MENU is pressed.
-   * @param[in] popupMenu the popup menu connected to the KEY_MENU event
-   */
-  void SetPopupMenu( Toolkit::Popup popupMenu );
-
-  /**
-   * Get the menu which would pop up when the KEY_MENU is pressed.
-   * @return The popup menu connected to the KEY_MENU event
-   */
-  Toolkit::Popup GetPopupMenu() const;
-
-public: // Not intended for application developers
-
-  /**
-   * Creates a handle using the Toolkit::Internal implementation.
-   * @param[in] impl The Page implementation.
-   */
-  DALI_INTERNAL Page(Internal::Page& impl);
-
-  /**
-   * Allows the creation of this Control from an Internal::CustomActor pointer.
-   * @param[in]  internal  A pointer to the internal CustomActor.
-   */
-  explicit DALI_INTERNAL Page( Dali::Internal::CustomActor* internal );
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif /* __DALI_TOOLKIT_PAGE_H__ */
index 0ca355d..b55f29c 100755 (executable)
@@ -32,18 +32,18 @@ ScrollBar::ScrollBar()
 }
 
 ScrollBar::ScrollBar(Internal::ScrollBar& implementation)
-: ScrollComponent( implementation )
+: Control( implementation )
 {
 }
 
 ScrollBar::ScrollBar( Dali::Internal::CustomActor* internal )
-: ScrollComponent( internal )
+: Control( internal )
 {
   VerifyCustomActorPointer<Internal::ScrollBar>(internal);
 }
 
-ScrollBar::ScrollBar( const ScrollBar& scrollBar )
-: ScrollComponent( scrollBar )
+ScrollBar::ScrollBar( const ScrollBar& handle )
+: Control( handle )
 {
 }
 
@@ -56,9 +56,9 @@ ScrollBar& ScrollBar::operator=( const ScrollBar& scrollBar )
   return *this;
 }
 
-ScrollBar ScrollBar::New()
+ScrollBar ScrollBar::New(ScrollBar::Direction direction)
 {
-  return Internal::ScrollBar::New();
+  return Internal::ScrollBar::New(direction);
 }
 
 ScrollBar ScrollBar::DownCast( BaseHandle handle )
@@ -70,9 +70,14 @@ ScrollBar::~ScrollBar()
 {
 }
 
-void ScrollBar::SetIndicatorImage( Image image )
+void ScrollBar::SetScrollPropertySource( Handle handle, Dali::Property::Index propertyScrollPosition, Dali::Property::Index propertyMinScrollPosition, Dali::Property::Index propertyMaxScrollPosition, Dali::Property::Index propertyScrollContentSize )
 {
-  GetImpl(*this).SetIndicatorImage(image);
+  GetImpl(*this).SetScrollPropertySource(handle, propertyScrollPosition, propertyMinScrollPosition, propertyMaxScrollPosition, propertyScrollContentSize);
+}
+
+void ScrollBar::SetScrollIndicator( Actor indicator )
+{
+  GetImpl(*this).SetScrollIndicator(indicator);
 }
 
 Actor ScrollBar::GetScrollIndicator()
@@ -80,9 +85,24 @@ Actor ScrollBar::GetScrollIndicator()
   return GetImpl(*this).GetScrollIndicator();
 }
 
-void ScrollBar::SetPositionNotifications( const std::vector<float>& positions )
+void ScrollBar::SetScrollPositionIntervals( const Dali::Vector<float>& positions )
+{
+  GetImpl(*this).SetScrollPositionIntervals(positions);
+}
+
+Dali::Vector<float> ScrollBar::GetScrollPositionIntervals() const
 {
-  GetImpl(*this).SetPositionNotifications(positions);
+  return GetImpl(*this).GetScrollPositionIntervals();
+}
+
+void ScrollBar::SetScrollDirection( ScrollBar::Direction direction )
+{
+  GetImpl(*this).SetScrollDirection(direction);
+}
+
+ScrollBar::Direction ScrollBar::GetScrollDirection() const
+{
+  return GetImpl(*this).GetScrollDirection();
 }
 
 void ScrollBar::SetIndicatorHeightPolicy( ScrollBar::IndicatorHeightPolicy policy )
@@ -90,7 +110,7 @@ void ScrollBar::SetIndicatorHeightPolicy( ScrollBar::IndicatorHeightPolicy polic
   GetImpl(*this).SetIndicatorHeightPolicy(policy);
 }
 
-ScrollBar::IndicatorHeightPolicy ScrollBar::GetIndicatorHeightPolicy()
+ScrollBar::IndicatorHeightPolicy ScrollBar::GetIndicatorHeightPolicy() const
 {
   return GetImpl(*this).GetIndicatorHeightPolicy();
 }
@@ -100,7 +120,7 @@ void ScrollBar::SetIndicatorFixedHeight( float height )
   GetImpl(*this).SetIndicatorFixedHeight(height);
 }
 
-float ScrollBar::GetIndicatorFixedHeight()
+float ScrollBar::GetIndicatorFixedHeight() const
 {
   return GetImpl(*this).GetIndicatorFixedHeight();
 }
@@ -110,7 +130,7 @@ void ScrollBar::SetIndicatorShowDuration( float durationSeconds )
   GetImpl(*this).SetIndicatorShowDuration(durationSeconds);
 }
 
-float ScrollBar::GetIndicatorShowDuration()
+float ScrollBar::GetIndicatorShowDuration() const
 {
   return GetImpl(*this).GetIndicatorShowDuration();
 }
@@ -120,24 +140,29 @@ void ScrollBar::SetIndicatorHideDuration( float durationSeconds )
   GetImpl(*this).SetIndicatorHideDuration(durationSeconds);
 }
 
-float ScrollBar::GetIndicatorHideDuration()
+float ScrollBar::GetIndicatorHideDuration() const
 {
   return GetImpl(*this).GetIndicatorHideDuration();
 }
 
-void ScrollBar::Show()
+void ScrollBar::ShowIndicator()
+{
+  GetImpl(*this).ShowIndicator();
+}
+
+void ScrollBar::HideIndicator()
 {
-  GetImpl(*this).Show();
+  GetImpl(*this).HideIndicator();
 }
 
-void ScrollBar::Hide()
+ScrollBar::PanFinishedSignalType& ScrollBar::PanFinishedSignal()
 {
-  GetImpl(*this).Hide();
+  return GetImpl(*this).PanFinishedSignal();
 }
 
-ScrollBar::ScrollPositionNotifiedSignalType& ScrollBar::ScrollPositionNotifiedSignal()
+ScrollBar::ScrollPositionIntervalReachedSignalType& ScrollBar::ScrollPositionIntervalReachedSignal()
 {
-  return GetImpl(*this).ScrollPositionNotifiedSignal();
+  return GetImpl(*this).ScrollPositionIntervalReachedSignal();
 }
 
 } // namespace Toolkit
index 6adfd17..d30f809 100755 (executable)
  *
  */
 
-// EXTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
-
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-component.h>
+#include <dali-toolkit/public-api/controls/control.h>
 
 namespace Dali
 {
@@ -30,9 +27,6 @@ namespace Dali
 namespace Toolkit
 {
 
-// Forward declarations
-class ScrollConnector;
-
 namespace Internal DALI_INTERNAL
 {
 // Forward declarations
@@ -41,18 +35,21 @@ class ScrollBar;
 }
 
 /**
- * ScrollBar is a UI component that can be added to the scrollable controls
- * indicating the current scroll position of the scrollable content.
+ * ScrollBar is a UI component that can be linked to the scrollable objects
+ * indicating the current scroll position of the scrollable object.
  *
  * Signals
- * | %Signal Name             | Method                              |
- * |--------------------------|-------------------------------------|
- * | scroll-position-notified | @ref ScrollPositionNotifiedSignal() |
+ * | %Signal Name                     | Method                                     |
+ * |----------------------------------|--------------------------------------------|
+ * | pan-finished                     | @ref PanFinishedSignal()                   |
+ * | scroll-position-interval-reached | @ref ScrollPositionIntervalReachedSignal() |
  */
-class DALI_IMPORT_API ScrollBar : public ScrollComponent
+class DALI_IMPORT_API ScrollBar : public Control
 {
 public:
 
+  // Properties
+
   /**
    * @brief The start and end property ranges for this control.
    */
@@ -69,19 +66,32 @@ public:
   {
     enum
     {
-      INDICATOR_HEIGHT_POLICY = PROPERTY_START_INDEX, ///< name "indicator-height-policy", @see SetIndicatorHeightPolicy(), type std::string
+      SCROLL_DIRECTION = PROPERTY_START_INDEX,        ///< name "scroll-direction",        @see SetScrollDirection(),       type std::string
+      INDICATOR_HEIGHT_POLICY,                        ///< name "indicator-height-policy", @see SetIndicatorHeightPolicy(), type std::string
       INDICATOR_FIXED_HEIGHT,                         ///< name "indicator-fixed-height",  @see SetIndicatorFixedHeight(),  type float
       INDICATOR_SHOW_DURATION,                        ///< name "indicator-show-duration", @see SetIndicatorShowDuration(), type float
       INDICATOR_HIDE_DURATION,                        ///< name "indicator-hide-duration", @see SetIndicatorHideDuration(), type float
+      SCROLL_POSITION_INTERVALS                       ///< name "scroll-position-intervals",                                type float
     };
   };
 
   // Signals
-  typedef Signal< void ( float ) > ScrollPositionNotifiedSignalType;
+
+  typedef Signal< void () > PanFinishedSignalType;
+  typedef Signal< void ( float ) > ScrollPositionIntervalReachedSignalType;
 
 public:
 
   /**
+   * @brief Direction.
+   */
+  enum Direction
+  {
+    Vertical = 0,   ///< Scroll in the vertical direction
+    Horizontal      ///< Scroll in the horizontal direction
+  };
+
+  /**
    * @brief Indicator height policy.
    */
   enum IndicatorHeightPolicy
@@ -93,7 +103,6 @@ public:
   /**
    * @brief Create an uninitialized ScrollBar; this can be initialized with ScrollBar::New()
    * Calling member functions with an uninitialized Dali::Object is not allowed.
-   * or horizontally (false)
    */
   ScrollBar();
 
@@ -116,9 +125,10 @@ public:
 
   /**
    * @brief Create an initialized ScrollBar
+   * @param[in] direction The direction of scroll bar (either vertically or horizontally).
    * @return A pointer to the created ScrollBar.
    */
-  static ScrollBar New();
+  static ScrollBar New(Direction direction = Vertical);
 
   /**
    * @brief Downcast an Object handle to ScrollBar. If handle points to a ScrollBar the
@@ -129,17 +139,26 @@ public:
   static ScrollBar DownCast( BaseHandle handle );
 
   /**
-   * @brief Sets the image for the indicator of scroll bar.
+   * @brief Set the source of the scroll position properties.
    *
-   * @pre The scroll bar actor has been initialised.
+   * * @pre The handle to the object owing the scroll properties has been initialised and the property index must be vaild.
    *
-   * The indicator image is resized (stretched according to scale settings),
-   * to reflect the size of the scroll indicator and minimum/maximum limits
-   * of the scroll position.
+   * @param[in] handle The handle of the object owing the scroll properties.
+   * @param[in] propertyScrollPosition The index of the scroll position property (The scroll position, type float).
+   * @param[in] propertyMinScrollPosition The index of the minimum scroll position property (The minimum scroll position, type float).
+   * @param[in] propertyMaxScrollPosition The index of the maximum scroll position property (The maximum scroll position, type float).
+   * @param[in] propertyScrollContentSize The index of the scroll content size property (The size of the scrollable content in actor coordinates, type float).
+   */
+  void SetScrollPropertySource( Handle handle, Dali::Property::Index propertyScrollPosition, Dali::Property::Index propertyMinScrollPosition, Dali::Property::Index propertyMaxScrollPosition, Dali::Property::Index propertyScrollContentSize );
+
+  /**
+   * @brief Sets the indicator of scroll bar.
    *
-   * @param[in] image The image of indicator that moves to indicate the current scroll position.
+   * @pre The scroll bar actor has been initialised.
+   *
+   * @param[in] indicator The indicator that moves to indicate the current scroll position.
    */
-  void SetIndicatorImage( Image image );
+  void SetScrollIndicator( Actor indicator );
 
   /**
    * @brief Gets the indicator of scroll bar.
@@ -151,14 +170,40 @@ public:
   Actor GetScrollIndicator();
 
   /**
-   * @brief Sets the values to get notification when the current scroll position of the scrollable
-   * content goes above or below any of these values.
+   * @brief Sets the list of values to get notification when the current scroll position of the scrollable
+   * object goes above or below any of these values.
    *
    * @pre The scroll bar actor has been initialised.
    *
    * @param[in] positions List of values to receive notifications for when the current scroll position crosses them
    */
-  void SetPositionNotifications( const std::vector<float>& positions );
+  void SetScrollPositionIntervals( const Dali::Vector<float>& positions );
+
+  /**
+   * @brief Gets the list of values to receive notifications when the current scroll position of the scrollable
+   * object goes above or below any of these values.
+   *
+   * @pre The scroll bar actor has been initialised.
+   *
+   * @return The list of values to receive notifications for when the current scroll position crosses them
+   */
+  Dali::Vector<float> GetScrollPositionIntervals() const;
+
+  /**
+   * @brief Sets the direction of scroll bar to scroll either vertically or horizontally.
+   *
+   * @pre The scroll bar actor has been initialised.
+   *
+   * @param[in] direction The direction of scroll bar (either vertically or horizontally).
+   */
+  void SetScrollDirection( Direction direction );
+
+  /**
+   * @brief Gets the direction of scroll bar.
+   *
+   * @return The direction of scroll bar.
+   */
+  Direction GetScrollDirection() const;
 
   /**
    * @brief Sets the height policy of scroll indicator to have either variable or fixed height.
@@ -174,7 +219,7 @@ public:
    *
    * @return The height policy of scroll indicator
    */
-  IndicatorHeightPolicy GetIndicatorHeightPolicy();
+  IndicatorHeightPolicy GetIndicatorHeightPolicy() const;
 
   /**
    * @brief Sets the fixed height of scroll indicator.
@@ -192,12 +237,12 @@ public:
    * @brief Gets the fix height of scroll indicator.
    * @return The fixed height of the scroll indicator
    */
-  float GetIndicatorFixedHeight();
+  float GetIndicatorFixedHeight() const;
 
   /**
    * @brief Sets the duration in second for the scroll indicator to become fully visible
    *
-   * @pre The scroll bar actor has been initialised.
+   * @pre The scroll bar actor has been initialised; durationSeconds must be zero or greater; zero means the indicator will be shown instantly.
    *
    * @param[in] durationSeconds The duration for the scroll indicator to become fully visible
    */
@@ -207,12 +252,12 @@ public:
    * @brief Gets the duration in second for the scroll indicator to become fully visible
    * @return The duration for the scroll indicator to become fully visible
    */
-  float GetIndicatorShowDuration();
+  float GetIndicatorShowDuration() const;
 
   /**
    * @brief Sets the duration in second for the scroll indicator to become fully invisible
    *
-   * @pre The scroll bar actor has been initialised.
+   * @pre The scroll bar actor has been initialised; durationSeconds must be zero or greater; zero means the indicator will be hidden instantly.
    *
    * @param[in] durationSeconds The duration for the scroll indicator to become fully invisible
    */
@@ -222,21 +267,37 @@ public:
    * @brief Gets the duration in second for the scroll indicator to become fully invisible
    * @return The duration for the scroll indicator to become fully invisible
    */
-  float GetIndicatorHideDuration();
+  float GetIndicatorHideDuration() const;
 
   /**
    * @brief Shows the scroll indicator
    */
-  void Show();
+  void ShowIndicator();
 
   /**
    * @brief Hides the scroll indicator
    */
-  void Hide();
+  void HideIndicator();
+
+public: // Signals
+
+  /**
+   * @brief Signal emitted when panning is finished on the scroll indicator.
+   * Signal only emitted when the source of the scroll position properties are set.
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName();
+   * @endcode
+   * @pre The Object has been initialized.
+   * @return The signal to connect to.
+   */
+  ScrollBar::PanFinishedSignalType& PanFinishedSignal();
 
   /**
-   * @brief Signal emitted when the current scroll position of the scrollable content goes above or below the values
-   * specified by SetPositionNotifications.
+   * @brief Signal emitted when the current scroll position of the scrollable content
+   * goes above or below the values specified by SCROLL_POSITION_INTERVALS property.
+   * Signal only emitted when the source of the scroll position properties are set.
    *
    * A callback of the following type may be connected:
    * @code
@@ -245,7 +306,7 @@ public:
    * @pre The Object has been initialized.
    * @return The signal to connect to.
    */
-  ScrollBar::ScrollPositionNotifiedSignalType& ScrollPositionNotifiedSignal();
+  ScrollBar::ScrollPositionIntervalReachedSignalType& ScrollPositionIntervalReachedSignal();
 
 public: // Not intended for application developers
 
diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.cpp
new file mode 100644 (file)
index 0000000..954e958
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics 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.
+ *
+ */
+
+// HEADER
+#include <dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/scrollable/item-view/depth-layout.h>
+#include <dali-toolkit/internal/controls/scrollable/item-view/grid-layout.h>
+#include <dali-toolkit/internal/controls/scrollable/item-view/spiral-layout.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DefaultItemLayout
+{
+
+ItemLayoutPtr New( Type type )
+{
+  ItemLayoutPtr itemLayout;
+
+  switch ( type )
+  {
+    case DEPTH:
+    {
+      itemLayout = Internal::DepthLayout::New();
+      break;
+    }
+
+    case GRID:
+    {
+      itemLayout = Internal::GridLayout::New();
+      break;
+    }
+
+    case LIST:
+    {
+      Internal::GridLayoutPtr layout = Internal::GridLayout::New();
+      layout->SetNumberOfColumns( 1 );
+      itemLayout = layout;
+      break;
+    }
+
+    case SPIRAL:
+    {
+      itemLayout = Internal::SpiralLayout::New();
+      break;
+    }
+  }
+
+  return itemLayout;
+}
+
+} // namespace DefaultItemLayout
+
+} // namespace Toolkit
+
+} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.h b/dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.h
new file mode 100644 (file)
index 0000000..6f4eb00
--- /dev/null
@@ -0,0 +1,56 @@
+#ifndef __DALI_TOOLKIT_DEFAULT_ITEM_LAYOUT_H__
+#define __DALI_TOOLKIT_DEFAULT_ITEM_LAYOUT_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace DefaultItemLayout
+{
+
+enum Type
+{
+  DEPTH,     ///< Items arranged in a grid, scrolling along the Z-Axis.
+  GRID,      ///< Items arranged in a grid, scrolling along the Y-Axis.
+  LIST,      ///< One item per line, scrolling along the Y-Axis.
+  SPIRAL     ///< Items arranged in a spiral, centered around the Y-Axis.
+};
+
+/**
+ * @brief Creates a built-in default item-layout
+ *
+ * @param[in]  type  The type of layout required.
+ *
+ * @return An ItemLayoutPtr to the newly created layout.
+ */
+DALI_IMPORT_API ItemLayoutPtr New( Type type );
+
+} // namespace DefaultItemLayout
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // __DALI_TOOLKIT_DEFAULT_ITEM_LAYOUT_H__
diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.cpp
deleted file mode 100644 (file)
index abd03b0..0000000
+++ /dev/null
@@ -1,764 +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 <dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.h>
-
-// EXTERNAL INCLUDES
-#include <algorithm>
-#include <dali/public-api/animation/animation.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace // unnamed namespace
-{
-
-const unsigned int DEFAULT_NUMBER_OF_COLUMNS    = 3;
-const float        DEFAULT_NUMBER_OF_ROWS       = 20.0f;
-const float        DEFAULT_ROW_SPACING          = 55.0f;
-const float        DEFAULT_BOTTOM_MARGIN_FACTOR = 0.1f;
-const Radian       DEFAULT_TILT_ANGLE           ( Math::PI*0.12f );
-const Radian       DEFAULT_ITEM_TILT_ANGLE      ( -Math::PI*0.025f );
-const float        DEFAULT_SCROLL_SPEED_FACTOR  = 0.02f;
-const float        DEFAULT_MAXIMUM_SWIPE_SPEED  = 50.0f;
-const float        DEFAULT_ITEM_FLICK_ANIMATION_DURATION = 0.03f;
-
-static Vector3 GetItemSizeDefaultFunction(unsigned int numberOfColumns, float layoutWidth)
-{
-  float width = layoutWidth / static_cast<float>(numberOfColumns + 1);
-
-  // 1x1 aspect ratio
-  return Vector3(width, width, width);
-}
-
-static float GetBottomMarginDefaultFunction(float layoutHeight)
-{
-  return layoutHeight * DEFAULT_BOTTOM_MARGIN_FACTOR;
-}
-
-struct GetColumnPositionDefaultFunction
-{
-  float operator()(unsigned int numberOfColumns,
-                   unsigned int columnNumber,
-                   const Vector3& itemSize,
-                   float layoutWidth)
-  {
-    // Share the available space between margins & column spacings
-    float availableSpace = std::max(0.0f, (layoutWidth - itemSize.width*numberOfColumns));
-
-    float leftMargin = availableSpace/numberOfColumns * 0.5f;
-
-    float columnPosition = leftMargin + itemSize.width*0.5f + columnNumber*(itemSize.width + availableSpace/numberOfColumns);
-
-    return columnPosition - layoutWidth*0.5f;
-  }
-};
-
-struct DepthPositionConstraint0
-{
-  DepthPositionConstraint0(unsigned int numberOfColumns,
-                           unsigned int columnNumber,
-                           DepthLayout::ItemSizeFunction itemSizeFunction,
-                           DepthLayout::BottomMarginFunction bottomMarginFunction,
-                           DepthLayout::ColumnPositionFunction columnPositionFunction,
-                           float heightScale,
-                           float depthScale)
-  : mNumberOfColumns(numberOfColumns),
-    mColumnNumber(columnNumber),
-    mItemSizeFunction(itemSizeFunction),
-    mBottomMarginFunction(bottomMarginFunction),
-    mColumnPositionFunction(columnPositionFunction),
-    mHeightScale(heightScale),
-    mDepthScale(depthScale)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(mNumberOfColumns, layoutSize.width);
-
-    float rowLayoutPositon = layoutPosition - static_cast<float>(mColumnNumber);
-
-    return Vector3(  mColumnPositionFunction(mNumberOfColumns, mColumnNumber, itemSize, layoutSize.width),
-                     rowLayoutPositon*mHeightScale + layoutSize.height*0.5f - mBottomMarginFunction(layoutSize.height) - itemSize.height * 0.5f,
-                    -rowLayoutPositon*mDepthScale );
-  }
-
-  unsigned int mNumberOfColumns;
-  unsigned int mColumnNumber;
-
-  DepthLayout::ItemSizeFunction       mItemSizeFunction;
-  DepthLayout::BottomMarginFunction   mBottomMarginFunction;
-  DepthLayout::ColumnPositionFunction mColumnPositionFunction;
-
-  float mHeightScale;
-  float mDepthScale;
-};
-
-struct DepthPositionConstraint90
-{
-  DepthPositionConstraint90(unsigned int numberOfColumns,
-                            unsigned int columnNumber,
-                            DepthLayout::ItemSizeFunction itemSizeFunction,
-                            DepthLayout::BottomMarginFunction bottomMarginFunction,
-                            DepthLayout::ColumnPositionFunction columnPositionFunction,
-                            float heightScale,
-                            float depthScale)
-  : mNumberOfColumns(numberOfColumns),
-    mColumnNumber(columnNumber),
-    mItemSizeFunction(itemSizeFunction),
-    mBottomMarginFunction(bottomMarginFunction),
-    mColumnPositionFunction(columnPositionFunction),
-    mHeightScale(heightScale),
-    mDepthScale(depthScale)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(mNumberOfColumns, layoutSize.height);
-
-    float rowLayoutPositon = layoutPosition - static_cast<float>(mColumnNumber) + mNumberOfColumns*0.5f;
-
-    return Vector3(  rowLayoutPositon*mHeightScale + layoutSize.width*0.5f - mBottomMarginFunction(layoutSize.width) - itemSize.height * 0.5f,
-                     -mColumnPositionFunction(mNumberOfColumns, mColumnNumber, itemSize, layoutSize.height),
-                    -rowLayoutPositon*mDepthScale );
-  }
-
-  unsigned int mNumberOfColumns;
-  unsigned int mColumnNumber;
-
-  DepthLayout::ItemSizeFunction       mItemSizeFunction;
-  DepthLayout::BottomMarginFunction   mBottomMarginFunction;
-  DepthLayout::ColumnPositionFunction mColumnPositionFunction;
-
-  float mHeightScale;
-  float mDepthScale;
-};
-
-struct DepthPositionConstraint180
-{
-  DepthPositionConstraint180(unsigned int numberOfColumns,
-                             unsigned int columnNumber,
-                             DepthLayout::ItemSizeFunction itemSizeFunction,
-                             DepthLayout::BottomMarginFunction bottomMarginFunction,
-                             DepthLayout::ColumnPositionFunction columnPositionFunction,
-                             float heightScale,
-                             float depthScale)
-  : mNumberOfColumns(numberOfColumns),
-    mColumnNumber(columnNumber),
-    mItemSizeFunction(itemSizeFunction),
-    mBottomMarginFunction(bottomMarginFunction),
-    mColumnPositionFunction(columnPositionFunction),
-    mHeightScale(heightScale),
-    mDepthScale(depthScale)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(mNumberOfColumns, layoutSize.width);
-
-    float rowLayoutPositon = layoutPosition - static_cast<float>(mColumnNumber);
-
-    return Vector3( -mColumnPositionFunction(mNumberOfColumns, mColumnNumber, itemSize, layoutSize.width),
-                    -(rowLayoutPositon*mHeightScale + layoutSize.height*0.5f - mBottomMarginFunction(layoutSize.height) - itemSize.height * 0.5f),
-                    -rowLayoutPositon*mDepthScale );
-  }
-
-  unsigned int mNumberOfColumns;
-  unsigned int mColumnNumber;
-
-  DepthLayout::ItemSizeFunction       mItemSizeFunction;
-  DepthLayout::BottomMarginFunction   mBottomMarginFunction;
-  DepthLayout::ColumnPositionFunction mColumnPositionFunction;
-
-  float mHeightScale;
-  float mDepthScale;
-};
-
-struct DepthPositionConstraint270
-{
-  DepthPositionConstraint270(unsigned int numberOfColumns,
-                             unsigned int columnNumber,
-                             DepthLayout::ItemSizeFunction itemSizeFunction,
-                             DepthLayout::BottomMarginFunction bottomMarginFunction,
-                             DepthLayout::ColumnPositionFunction columnPositionFunction,
-                             float heightScale,
-                             float depthScale)
-  : mNumberOfColumns(numberOfColumns),
-    mColumnNumber(columnNumber),
-    mItemSizeFunction(itemSizeFunction),
-    mBottomMarginFunction(bottomMarginFunction),
-    mColumnPositionFunction(columnPositionFunction),
-    mHeightScale(heightScale),
-    mDepthScale(depthScale)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(mNumberOfColumns, layoutSize.height);
-
-    float rowLayoutPositon = layoutPosition - static_cast<float>(mColumnNumber) + mNumberOfColumns*0.5f;
-
-    return Vector3( -(rowLayoutPositon*mHeightScale + layoutSize.width*0.5f - mBottomMarginFunction(layoutSize.width) - itemSize.height * 0.5f),
-                    mColumnPositionFunction(mNumberOfColumns, mColumnNumber, itemSize, layoutSize.height),
-                    -rowLayoutPositon*mDepthScale );
-  }
-
-  unsigned int mNumberOfColumns;
-  unsigned int mColumnNumber;
-
-  DepthLayout::ItemSizeFunction       mItemSizeFunction;
-  DepthLayout::BottomMarginFunction   mBottomMarginFunction;
-  DepthLayout::ColumnPositionFunction mColumnPositionFunction;
-
-  float mHeightScale;
-  float mDepthScale;
-};
-
-struct DepthRotationConstraint0
-{
-  DepthRotationConstraint0(Radian angleRadians)
-  : mTiltAngle(angleRadians)
-  {
-  }
-
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion( Radian( 0.0f ), Vector3::ZAXIS ) * Quaternion( mTiltAngle, Vector3::XAXIS );
-  }
-
-  Radian mTiltAngle;
-};
-
-struct DepthRotationConstraint90
-{
-  DepthRotationConstraint90(Radian angleRadians)
-  : mTiltAngle(angleRadians)
-  {
-  }
-
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS) * Quaternion( mTiltAngle, Vector3::XAXIS );
-  }
-
-  Radian mTiltAngle;
-};
-
-struct DepthRotationConstraint180
-{
-  DepthRotationConstraint180(Radian angleRadians)
-  : mTiltAngle(angleRadians)
-  {
-  }
-
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion( Radian( -Math::PI ), Vector3::ZAXIS) * Quaternion( mTiltAngle, Vector3::XAXIS );
-  }
-
-  Radian mTiltAngle;
-};
-
-struct DepthRotationConstraint270
-{
-  DepthRotationConstraint270(Radian angleRadians)
-  : mTiltAngle(angleRadians)
-  {
-  }
-
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS) * Quaternion( mTiltAngle, Vector3::XAXIS );
-  }
-
-  Radian mTiltAngle;
-};
-
-struct DepthColorConstraint
-{
-  DepthColorConstraint(unsigned int numberOfColumns, float numberOfRows, unsigned int columnNumber)
-  : mNumberOfColumns(numberOfColumns),
-    mNumberOfRows(numberOfRows),
-    mColumnNumber(columnNumber)
-  {
-  }
-
-  Vector4 operator()(const Vector4& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float row = (layoutPosition - static_cast<float>(mColumnNumber)) / mNumberOfColumns;
-
-    float darkness(1.0f);
-    float alpha(1.0f);
-
-    if (row < 0.0f)
-    {
-      darkness = alpha = std::max(0.0f, 1.0f + row);
-    }
-    else
-    {
-      if (row > mNumberOfRows)
-      {
-        darkness = 0.0f;
-      }
-      else
-      {
-        darkness = 1.0f - ( 1.0f * (row / mNumberOfRows) );
-      }
-
-      if (row > (mNumberOfRows-1.0f))
-      {
-        alpha = std::max(0.0f, 1.0f - (row-(mNumberOfRows-1.0f)));
-      }
-    }
-
-    return Vector4( darkness, darkness, darkness, current.a * alpha );
-  }
-
-  unsigned int mNumberOfColumns;
-  float mNumberOfRows;
-  unsigned int mColumnNumber;
-};
-
-struct DepthVisibilityConstraint
-{
-  DepthVisibilityConstraint(unsigned int numberOfColumns, float numberOfRows, unsigned int columnNumber)
-  : mNumberOfColumns(numberOfColumns),
-    mNumberOfRows(numberOfRows),
-    mColumnNumber(columnNumber)
-  {
-  }
-
-  bool operator()(const bool& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float row = (layoutPosition - static_cast<float>(mColumnNumber)) / mNumberOfColumns;
-    return (row > -1.0f) && (row < mNumberOfRows);
-  }
-
-  unsigned int mNumberOfColumns;
-  float mNumberOfRows;
-  unsigned int mColumnNumber;
-};
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-struct PositionConstraintSet
-{
-  ItemLayout::Vector3Function mOrientation0;
-  ItemLayout::Vector3Function mOrientation90;
-  ItemLayout::Vector3Function mOrientation180;
-  ItemLayout::Vector3Function mOrientation270;
-};
-
-struct DepthLayout::Impl
-{
-  Impl()
-  : mNumberOfColumns(DEFAULT_NUMBER_OF_COLUMNS),
-    mNumberOfRows(DEFAULT_NUMBER_OF_ROWS),
-    mRowSpacing(DEFAULT_ROW_SPACING),
-    mTiltAngle(DEFAULT_TILT_ANGLE),
-    mItemTiltAngle(DEFAULT_ITEM_TILT_ANGLE),
-    mScrollSpeedFactor(DEFAULT_SCROLL_SPEED_FACTOR),
-    mMaximumSwipeSpeed(DEFAULT_MAXIMUM_SWIPE_SPEED),
-    mItemFlickAnimationDuration(DEFAULT_ITEM_FLICK_ANIMATION_DURATION),
-    mItemSizeFunction(GetItemSizeDefaultFunction),
-    mBottomMarginFunction(GetBottomMarginDefaultFunction),
-    mColumnPositionFunction(GetColumnPositionDefaultFunction())
-  {
-  }
-
-  unsigned int mNumberOfColumns;
-  unsigned int mNumberOfRows;
-
-  float mRowSpacing;
-
-  Radian mTiltAngle;
-  Radian mItemTiltAngle;
-
-  float mScrollSpeedFactor;
-  float mMaximumSwipeSpeed;
-  float mItemFlickAnimationDuration;
-
-  ItemSizeFunction        mItemSizeFunction;
-  BottomMarginFunction    mBottomMarginFunction;
-  ColumnPositionFunction  mColumnPositionFunction;
-};
-
-DepthLayoutPtr DepthLayout::New()
-{
-  return DepthLayoutPtr(new DepthLayout());
-}
-
-DepthLayout::~DepthLayout()
-{
-  delete mImpl;
-}
-
-void DepthLayout::SetNumberOfColumns(unsigned int columns)
-{
-  mImpl->mNumberOfColumns = columns;
-}
-
-unsigned int DepthLayout::GetNumberOfColumns() const
-{
-  return mImpl->mNumberOfColumns;
-}
-
-void DepthLayout::SetNumberOfRows(unsigned int rows)
-{
-  mImpl->mNumberOfRows = rows;
-}
-
-unsigned int DepthLayout::GetNumberOfRows() const
-{
-  return mImpl->mNumberOfRows;
-}
-
-void DepthLayout::SetRowSpacing(float spacing)
-{
-  mImpl->mRowSpacing = spacing;
-}
-
-float DepthLayout::GetRowSpacing() const
-{
-  return mImpl->mRowSpacing;
-}
-
-void DepthLayout::SetTiltAngle(Degree angle)
-{
-  mImpl->mTiltAngle = Degree( Clamp( angle, -45.0f, 45.0f ) );
-}
-
-Degree DepthLayout::GetTiltAngle() const
-{
-  return Degree( mImpl->mTiltAngle );
-}
-
-void DepthLayout::SetItemSizeFunction(ItemSizeFunction function)
-{
-  mImpl->mItemSizeFunction = function;
-}
-
-DepthLayout::ItemSizeFunction DepthLayout::GetItemSizeFunction() const
-{
-  return mImpl->mItemSizeFunction;
-}
-
-void DepthLayout::SetBottomMarginFunction(BottomMarginFunction function)
-{
-  mImpl->mBottomMarginFunction = function;
-}
-
-DepthLayout::BottomMarginFunction DepthLayout::GetBottomMarginFunction() const
-{
-  return mImpl->mBottomMarginFunction;
-}
-
-void DepthLayout::SetItemTiltAngle(Degree angle)
-{
-  mImpl->mItemTiltAngle = angle;
-}
-
-Degree DepthLayout::GetItemTiltAngle() const
-{
-  return Degree( mImpl->mItemTiltAngle );
-}
-
-void DepthLayout::SetColumnPositionFunction(ColumnPositionFunction function)
-{
-  mImpl->mColumnPositionFunction = function;
-}
-
-DepthLayout::ColumnPositionFunction DepthLayout::GetColumnPositionFunction() const
-{
-  return mImpl->mColumnPositionFunction;
-}
-
-void DepthLayout::SetScrollSpeedFactor(float scrollSpeed)
-{
-  mImpl->mScrollSpeedFactor = scrollSpeed;
-}
-
-void DepthLayout::SetMaximumSwipeSpeed(float speed)
-{
-  mImpl->mMaximumSwipeSpeed = speed;
-}
-
-void DepthLayout::SetItemFlickAnimationDuration(float durationSeconds)
-{
-  mImpl->mItemFlickAnimationDuration = durationSeconds;
-}
-
-float DepthLayout::GetScrollSpeedFactor() const
-{
-  return mImpl->mScrollSpeedFactor;
-}
-
-float DepthLayout::GetMaximumSwipeSpeed() const
-{
-  return mImpl->mMaximumSwipeSpeed;
-}
-
-float DepthLayout::GetItemFlickAnimationDuration() const
-{
-  return mImpl->mItemFlickAnimationDuration;
-}
-
-float DepthLayout::GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
-{
-  return static_cast<float>(mImpl->mNumberOfColumns) - static_cast<float>(numberOfItems);
-}
-
-float DepthLayout::GetClosestAnchorPosition(float layoutPosition) const
-{
-  float rowIndex = static_cast<float>(round(layoutPosition / mImpl->mNumberOfColumns));
-  return rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
-}
-
-float DepthLayout::GetItemScrollToPosition(unsigned int itemId) const
-{
-  float rowIndex = static_cast<float>(itemId / mImpl->mNumberOfColumns);
-  return -rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
-}
-
-ItemRange DepthLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
-{
-  float firstRow = -(firstItemPosition/mImpl->mNumberOfColumns);
-  float lastRow = firstRow + mImpl->mNumberOfRows * 0.5f;
-
-  unsigned int firstItem = static_cast<unsigned int>(std::max(0.0f, firstRow * mImpl->mNumberOfColumns));
-  unsigned int lastItem  = static_cast<unsigned int>(std::max(0.0f, lastRow  * mImpl->mNumberOfColumns));
-
-  return ItemRange(firstItem, lastItem+1);
-}
-
-unsigned int DepthLayout::GetReserveItemCount(Vector3 layoutSize) const
-{
-  float itemsWithinLayout = (layoutSize.depth * mImpl->mNumberOfColumns) / (cosf(mImpl->mTiltAngle) * mImpl->mRowSpacing);
-
-  return static_cast<unsigned int>(itemsWithinLayout);
-}
-
-bool DepthLayout::GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const
-{
-  // Note: itemId is not checked, since every item has the same size
-
-  itemSize = mImpl->mItemSizeFunction( mImpl->mNumberOfColumns, (IsVertical(mOrientation) ? layoutSize.width : layoutSize.height) );
-  return true;
-}
-
-void DepthLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
-{
-  if(animation)
-  {
-    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size );
-  }
-}
-
-bool DepthLayout::GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const
-{
-  float heightScale = -sinf(mImpl->mTiltAngle) * mImpl->mRowSpacing;
-  float depthScale  =  cosf(mImpl->mTiltAngle) * mImpl->mRowSpacing;
-
-  if (mOrientation == ControlOrientation::Up)
-  {
-    constraint = DepthPositionConstraint0( mImpl->mNumberOfColumns,
-                                           itemId % mImpl->mNumberOfColumns,
-                                           mImpl->mItemSizeFunction,
-                                           mImpl->mBottomMarginFunction,
-                                           mImpl->mColumnPositionFunction,
-                                           heightScale,
-                                           depthScale );
-  }
-  else if (mOrientation == ControlOrientation::Left)
-  {
-    constraint = DepthPositionConstraint90( mImpl->mNumberOfColumns,
-                                            itemId % mImpl->mNumberOfColumns,
-                                            mImpl->mItemSizeFunction,
-                                            mImpl->mBottomMarginFunction,
-                                            mImpl->mColumnPositionFunction,
-                                            heightScale,
-                                            depthScale );
-  }
-  else if (mOrientation == ControlOrientation::Down)
-  {
-    constraint = DepthPositionConstraint180( mImpl->mNumberOfColumns,
-                                             itemId % mImpl->mNumberOfColumns,
-                                             mImpl->mItemSizeFunction,
-                                             mImpl->mBottomMarginFunction,
-                                             mImpl->mColumnPositionFunction,
-                                             heightScale,
-                                             depthScale );
-  }
-  else // mOrientation == ControlOrientation::Right
-  {
-    constraint = DepthPositionConstraint270( mImpl->mNumberOfColumns,
-                                             itemId % mImpl->mNumberOfColumns,
-                                             mImpl->mItemSizeFunction,
-                                             mImpl->mBottomMarginFunction,
-                                             mImpl->mColumnPositionFunction,
-                                             heightScale,
-                                             depthScale );
-  }
-
-  return true;
-}
-
-bool DepthLayout::GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const
-{
-  if (mOrientation == ControlOrientation::Up)
-  {
-    constraint = DepthRotationConstraint0(mImpl->mItemTiltAngle);
-  }
-  else if (mOrientation == ControlOrientation::Left)
-  {
-    constraint = DepthRotationConstraint90(mImpl->mItemTiltAngle);
-  }
-  else if (mOrientation == ControlOrientation::Down)
-  {
-    constraint = DepthRotationConstraint180(mImpl->mItemTiltAngle);
-  }
-  else // mOrientation == ControlOrientation::Right
-  {
-    constraint = DepthRotationConstraint270(mImpl->mItemTiltAngle);
-  }
-
-  return true;
-}
-
-bool DepthLayout::GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const
-{
-  return false; // No scaling
-}
-
-bool DepthLayout::GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const
-{
-  constraint = DepthColorConstraint(mImpl->mNumberOfColumns, mImpl->mNumberOfRows*0.5f, itemId % mImpl->mNumberOfColumns);
-  return true;
-}
-
-bool DepthLayout::GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const
-{
-  constraint = DepthVisibilityConstraint(mImpl->mNumberOfColumns, mImpl->mNumberOfRows*0.5f, itemId % mImpl->mNumberOfColumns);
-  return true;
-}
-
-Degree DepthLayout::GetScrollDirection() const
-{
-  Degree scrollDirection(0.0f);
-
-  if (mOrientation == ControlOrientation::Up)
-  {
-    scrollDirection = Degree( 180.0f );
-  }
-  else if (mOrientation == ControlOrientation::Left)
-  {
-    scrollDirection = Degree( 270.0f );
-  }
-  else if (mOrientation == ControlOrientation::Down)
-  {
-    scrollDirection = Degree( 0.0f );
-  }
-  else // mOrientation == ControlOrientation::Right
-  {
-    scrollDirection = Degree( 90.0f );
-  }
-
-  return scrollDirection;
-}
-
-DepthLayout::DepthLayout()
-: mImpl(NULL)
-{
-  mImpl = new Impl();
-}
-
-float DepthLayout::GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize)
-{
-  float scrollTo = currentLayoutPosition;
-  float row = (currentLayoutPosition + itemID - static_cast<float>(itemID % mImpl->mNumberOfColumns)) / mImpl->mNumberOfColumns;
-
-  // Check whether item is not within viewable area
-  if(row <= -1.0f)
-  {
-    scrollTo = GetItemScrollToPosition(itemID);
-  }
-  else if(row > mImpl->mNumberOfRows * 0.5f - 1.0f)
-  {
-    scrollTo = GetItemScrollToPosition(itemID) + (mImpl->mNumberOfRows - 1.0f) * 0.5f * mImpl->mNumberOfColumns;
-  }
-
-  return scrollTo;
-}
-
-int DepthLayout::GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled)
-{
-  switch( direction )
-  {
-    case Control::Left:
-    {
-      itemID--;
-      if( itemID < 0 )
-      {
-        itemID = loopEnabled ? maxItems - 1 : 0;
-      }
-      break;
-    }
-    case Control::Up:
-    {
-      itemID += mImpl->mNumberOfColumns;
-      if( itemID >= maxItems )
-      {
-        itemID = loopEnabled ? 0 : itemID - mImpl->mNumberOfColumns;
-      }
-      break;
-    }
-    case Control::Right:
-    {
-      itemID++;
-      if( itemID >= maxItems )
-      {
-        itemID = loopEnabled ? 0 : maxItems - 1;
-      }
-      break;
-    }
-    case Control::Down:
-    {
-      itemID -= mImpl->mNumberOfColumns;
-      if( itemID < 0 )
-      {
-        itemID = loopEnabled ? itemID + maxItems : itemID + mImpl->mNumberOfColumns;
-      }
-      break;
-    }
-  }
-  return itemID;
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.cpp
deleted file mode 100644 (file)
index d855167..0000000
+++ /dev/null
@@ -1,765 +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 <dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.h>
-
-// EXTERNAL INCLUDES
-#include <algorithm>
-#include <dali/public-api/animation/animation.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace // unnamed namespace
-{
-
-const unsigned int DEFAULT_NUMBER_OF_COLUMNS = 4;
-const float DEFAULT_TOP_MARGIN     =  95.0f;
-const float DEFAULT_BOTTOM_MARGIN  =  20.0f;
-const float DEFAULT_SIDE_MARGIN    =  20.0f;
-const float DEFAULT_COLUMN_SPACING =  20.0f;
-const float DEFAULT_ROW_SPACING    =  20.0f;
-const float DEFAULT_SCROLL_SPEED_FACTOR = 0.03f;
-const float DEFAULT_MAXIMUM_SWIPE_SPEED = 100.0f;
-const float DEFAULT_ITEM_FLICK_ANIMATION_DURATION = 0.015f;
-
-// 4 orientations are supported
-static const unsigned int ORIENTATION_COUNT = 4;
-
-static Vector3 GetItemSizeDefaultFunction(unsigned int numberOfColumns, float layoutWidth, float sideMargin, float columnSpacing)
-{
-  float width = (layoutWidth - sideMargin * 2.0f - columnSpacing * static_cast<float>(numberOfColumns - 1)) / static_cast<float>(numberOfColumns);
-
-  // 4x3 aspect ratio
-  return Vector3(width, width * 0.75f, width * 0.75f);
-}
-
-struct GridPositionConstraint0
-{
-  GridPositionConstraint0(const unsigned int columnIndex, const unsigned int numberOfColumns, const float rowSpacing, const float columnSpacing, const float topMargin, const float sideMargin, GridLayout::ItemSizeFunction itemSizeFunction, const float gap)
-  : mColumnIndex(columnIndex),
-    mNumberOfColumns(numberOfColumns),
-    mRowSpacing(rowSpacing),
-    mColumnSpacing(columnSpacing),
-    mTopMargin(topMargin),
-    mSideMargin(sideMargin),
-    mItemSizeFunction(itemSizeFunction),
-    mZGap(gap)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(mNumberOfColumns, layoutSize.width, mSideMargin, mColumnSpacing);
-
-    return Vector3(mSideMargin + (mColumnIndex * (itemSize.x + mColumnSpacing)) + itemSize.x * 0.5f - layoutSize.x * 0.5f,
-                   ((itemSize.y + mRowSpacing) * (layoutPosition - mColumnIndex)) / mNumberOfColumns - layoutSize.height * 0.5f + itemSize.y * 0.5f + mTopMargin,
-                   mColumnIndex * mZGap);
-  }
-
-public:
-
-  unsigned int mColumnIndex;
-  unsigned int mNumberOfColumns;
-  float mRowSpacing;
-  float mColumnSpacing;
-  float mTopMargin;
-  float mSideMargin;
-  GridLayout::ItemSizeFunction mItemSizeFunction;
-  float mZGap;
-};
-
-struct GridPositionConstraint90
-{
-  GridPositionConstraint90(const unsigned int columnIndex, const unsigned int numberOfColumns, const float rowSpacing, const float columnSpacing, const float topMargin, const float sideMargin, GridLayout::ItemSizeFunction itemSizeFunction, const float gap)
-  : mColumnIndex(columnIndex),
-    mNumberOfColumns(numberOfColumns),
-    mRowSpacing(rowSpacing),
-    mColumnSpacing(columnSpacing),
-    mTopMargin(topMargin),
-    mSideMargin(sideMargin),
-    mItemSizeFunction(itemSizeFunction),
-    mZGap(gap)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(mNumberOfColumns, layoutSize.height, mSideMargin, mColumnSpacing);
-
-    return Vector3(((itemSize.y + mRowSpacing) * (layoutPosition - mColumnIndex)) / mNumberOfColumns - layoutSize.width * 0.5f + itemSize.y * 0.5f + mTopMargin,
-                   -(mSideMargin + (mColumnIndex * (itemSize.x + mColumnSpacing)) + itemSize.x * 0.5f - layoutSize.y*0.5f),
-                   mColumnIndex * mZGap);
-  }
-
-public:
-
-  unsigned int mColumnIndex;
-  unsigned int mNumberOfColumns;
-  float mRowSpacing;
-  float mColumnSpacing;
-  float mTopMargin;
-  float mSideMargin;
-  GridLayout::ItemSizeFunction mItemSizeFunction;
-  float mZGap;
-};
-
-struct GridPositionConstraint180
-{
-  GridPositionConstraint180(const unsigned int columnIndex, const unsigned int numberOfColumns, const float rowSpacing, const float columnSpacing, const float topMargin, const float sideMargin, GridLayout::ItemSizeFunction itemSizeFunction, const float gap)
-  : mColumnIndex(columnIndex),
-    mNumberOfColumns(numberOfColumns),
-    mRowSpacing(rowSpacing),
-    mColumnSpacing(columnSpacing),
-    mTopMargin(topMargin),
-    mSideMargin(sideMargin),
-    mItemSizeFunction(itemSizeFunction),
-    mZGap(gap)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(mNumberOfColumns, layoutSize.width, mSideMargin, mColumnSpacing);
-
-    return Vector3(-(mSideMargin + (mColumnIndex * (itemSize.x + mColumnSpacing)) + itemSize.x * 0.5f - layoutSize.x * 0.5f),
-                   -(((itemSize.y + mRowSpacing) * (layoutPosition - mColumnIndex)) / mNumberOfColumns - layoutSize.height * 0.5f + itemSize.y * 0.5f + mTopMargin),
-                   mColumnIndex * mZGap);
-  }
-
-public:
-
-  unsigned int mColumnIndex;
-  unsigned int mNumberOfColumns;
-  float mRowSpacing;
-  float mColumnSpacing;
-  float mTopMargin;
-  float mSideMargin;
-  GridLayout::ItemSizeFunction mItemSizeFunction;
-  float mZGap;
-};
-
-struct GridPositionConstraint270
-{
-  GridPositionConstraint270(const unsigned int columnIndex, const unsigned int numberOfColumns, const float rowSpacing, const float columnSpacing, const float topMargin, const float sideMargin, GridLayout::ItemSizeFunction itemSizeFunction, const float gap)
-  : mColumnIndex(columnIndex),
-    mNumberOfColumns(numberOfColumns),
-    mRowSpacing(rowSpacing),
-    mColumnSpacing(columnSpacing),
-    mTopMargin(topMargin),
-    mSideMargin(sideMargin),
-    mItemSizeFunction(itemSizeFunction),
-    mZGap(gap)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(mNumberOfColumns, layoutSize.height, mSideMargin, mColumnSpacing);
-
-    return Vector3(-(((itemSize.y + mRowSpacing) * (layoutPosition - mColumnIndex)) / mNumberOfColumns - layoutSize.width * 0.5f + itemSize.y * 0.5f + mTopMargin),
-                   mSideMargin + (mColumnIndex * (itemSize.x + mColumnSpacing)) + itemSize.x * 0.5f - layoutSize.y * 0.5f,
-                   mColumnIndex * mZGap);
-  }
-
-public:
-
-  unsigned int mColumnIndex;
-  unsigned int mNumberOfColumns;
-  float mRowSpacing;
-  float mColumnSpacing;
-  float mTopMargin;
-  float mSideMargin;
-  GridLayout::ItemSizeFunction mItemSizeFunction;
-  float mZGap;
-};
-
-struct GridRotationConstraint0
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion( Radian( 0.0f ), Vector3::ZAXIS);
-  }
-};
-
-struct GridRotationConstraint90
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion( Radian( 1.5f * Math::PI ), Vector3::ZAXIS);
-  }
-};
-
-struct GridRotationConstraint180
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion( Radian( Math::PI ), Vector3::ZAXIS);
-  }
-};
-
-struct GridRotationConstraint270
-{
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Quaternion( Radian( 0.5f * Math::PI ), Vector3::ZAXIS);
-  }
-};
-
-struct GridColorConstraint
-{
-  Vector4 operator()(const Vector4& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    return Vector4( 1.0f, 1.0f, 1.0f, current.a );
-  }
-};
-
-struct GridVisibilityConstraintPortrait
-{
-  GridVisibilityConstraintPortrait(const unsigned int columnIndex, const unsigned int numberOfColumns, const float rowSpacing, const float columnSpacing, const float sideMargin, GridLayout::ItemSizeFunction itemSizeFunction)
-  : mColumnIndex(columnIndex),
-    mNumberOfColumns(numberOfColumns),
-    mRowSpacing(rowSpacing),
-    mColumnSpacing(columnSpacing),
-    mSideMargin(sideMargin),
-    mItemSizeFunction(itemSizeFunction)
-  {
-  }
-
-  bool operator()(const bool& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(mNumberOfColumns, layoutSize.width, mSideMargin, mColumnSpacing);
-
-    float row = (layoutPosition - static_cast<float>(mColumnIndex)) / mNumberOfColumns;
-    int rowsPerPage = ceil(layoutSize.height / (itemSize.y + mRowSpacing));
-
-    return (row > -2.0f) && (row < rowsPerPage);
-  }
-
-public:
-
-  unsigned int mColumnIndex;
-  unsigned int mNumberOfColumns;
-  float mRowSpacing;
-  float mColumnSpacing;
-  float mSideMargin;
-  GridLayout::ItemSizeFunction mItemSizeFunction;
-};
-
-struct GridVisibilityConstraintLandscape
-{
-  GridVisibilityConstraintLandscape(const unsigned int columnIndex, const unsigned int numberOfColumns, const float rowSpacing, const float columnSpacing, const float sideMargin, GridLayout::ItemSizeFunction itemSizeFunction)
-  : mColumnIndex(columnIndex),
-    mNumberOfColumns(numberOfColumns),
-    mRowSpacing(rowSpacing),
-    mColumnSpacing(columnSpacing),
-    mSideMargin(sideMargin),
-    mItemSizeFunction(itemSizeFunction)
-  {
-  }
-
-  bool operator()(const bool& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Vector3 itemSize = mItemSizeFunction(mNumberOfColumns, layoutSize.height, mSideMargin, mColumnSpacing);
-
-    float row = (layoutPosition - static_cast<float>(mColumnIndex)) / mNumberOfColumns;
-    int rowsPerPage = ceil(layoutSize.width / (itemSize.y + mRowSpacing));
-
-    return (row > -2.0f) && (row < rowsPerPage);
-  }
-
-public:
-
-  unsigned int mColumnIndex;
-  unsigned int mNumberOfColumns;
-  float mRowSpacing;
-  float mColumnSpacing;
-  float mSideMargin;
-  GridLayout::ItemSizeFunction mItemSizeFunction;
-};
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-struct GridLayout::Impl
-{
-  Impl()
-  : mNumberOfColumns(DEFAULT_NUMBER_OF_COLUMNS),
-    mRowSpacing(DEFAULT_ROW_SPACING),
-    mColumnSpacing(DEFAULT_COLUMN_SPACING),
-    mTopMargin(DEFAULT_TOP_MARGIN),
-    mBottomMargin(DEFAULT_BOTTOM_MARGIN),
-    mSideMargin(DEFAULT_SIDE_MARGIN),
-    mZGap(0.f),
-    mScrollSpeedFactor(DEFAULT_SCROLL_SPEED_FACTOR),
-    mMaximumSwipeSpeed(DEFAULT_MAXIMUM_SWIPE_SPEED),
-    mItemFlickAnimationDuration(DEFAULT_ITEM_FLICK_ANIMATION_DURATION),
-    mItemSizeFunction(GetItemSizeDefaultFunction)
-  {
-    mColorConstraint = GridColorConstraint();
-
-    mRotationConstraint[0] = GridRotationConstraint0();
-    mRotationConstraint[1] = GridRotationConstraint90();
-    mRotationConstraint[2] = GridRotationConstraint180();
-    mRotationConstraint[3] = GridRotationConstraint270();
-  }
-
-  unsigned int mNumberOfColumns;
-  float mRowSpacing;
-  float mColumnSpacing;
-  float mTopMargin;
-  float mBottomMargin;
-  float mSideMargin;
-  float mZGap;
-
-  float mScrollSpeedFactor;
-  float mMaximumSwipeSpeed;
-  float mItemFlickAnimationDuration;
-
-  ItemLayout::QuaternionFunction mRotationConstraint[ORIENTATION_COUNT];
-  ItemLayout::Vector4Function mColorConstraint;
-
-  ItemSizeFunction mItemSizeFunction;
-};
-
-GridLayoutPtr GridLayout::New()
-{
-  return GridLayoutPtr(new GridLayout());
-}
-
-GridLayout::~GridLayout()
-{
-  delete mImpl;
-}
-
-void GridLayout::SetNumberOfColumns(unsigned int columns)
-{
-  mImpl->mNumberOfColumns = columns;
-}
-
-unsigned int GridLayout::GetNumberOfColumns() const
-{
-  return mImpl->mNumberOfColumns;
-}
-
-void GridLayout::SetRowSpacing(float spacing)
-{
-  mImpl->mRowSpacing = spacing;
-}
-
-float GridLayout::GetRowSpacing() const
-{
-  return mImpl->mRowSpacing;
-}
-
-void GridLayout::SetColumnSpacing(float spacing)
-{
-  mImpl->mColumnSpacing = spacing;
-}
-
-float GridLayout::GetColumnSpacing() const
-{
-  return mImpl->mColumnSpacing;
-}
-
-void GridLayout::SetTopMargin(float margin)
-{
-  mImpl->mTopMargin = margin;
-}
-
-float GridLayout::GetTopMargin() const
-{
-  return mImpl->mTopMargin;
-}
-
-void GridLayout::SetBottomMargin(float margin)
-{
-  mImpl->mBottomMargin = margin;
-}
-
-float GridLayout::GetBottomMargin() const
-{
-  return mImpl->mBottomMargin;
-}
-
-void GridLayout::SetSideMargin(float margin)
-{
-  mImpl->mSideMargin = margin;
-}
-
-float GridLayout::GetSideMargin() const
-{
-  return mImpl->mSideMargin;
-}
-
-void GridLayout::SetZGap(float gap)
-{
-  mImpl->mZGap = gap;
-}
-
-float GridLayout::GetZGap() const
-{
-  return mImpl->mZGap;
-}
-
-void GridLayout::SetItemSizeFunction(ItemSizeFunction function)
-{
-  mImpl->mItemSizeFunction = function;
-}
-
-GridLayout::ItemSizeFunction GridLayout::GetItemSizeFunction() const
-{
-  return mImpl->mItemSizeFunction;
-}
-
-void GridLayout::SetScrollSpeedFactor(float scrollSpeed)
-{
-  mImpl->mScrollSpeedFactor = scrollSpeed;
-}
-
-void GridLayout::SetMaximumSwipeSpeed(float speed)
-{
-  mImpl->mMaximumSwipeSpeed = speed;
-}
-
-void GridLayout::SetItemFlickAnimationDuration(float durationSeconds)
-{
-  mImpl->mItemFlickAnimationDuration = durationSeconds;
-}
-
-float GridLayout::GetScrollSpeedFactor() const
-{
-  return mImpl->mScrollSpeedFactor;
-}
-
-float GridLayout::GetMaximumSwipeSpeed() const
-{
-  return mImpl->mMaximumSwipeSpeed;
-}
-
-float GridLayout::GetItemFlickAnimationDuration() const
-{
-  return mImpl->mItemFlickAnimationDuration;
-}
-
-float GridLayout::GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
-{
-  float layoutWidth = IsHorizontal(mOrientation) ? layoutSize.height : layoutSize.width;
-  float layoutHeight = IsHorizontal(mOrientation) ? layoutSize.width : layoutSize.height;
-
-  Vector3 itemSize = mImpl->mItemSizeFunction( mImpl->mNumberOfColumns, layoutWidth, mImpl->mSideMargin, mImpl->mColumnSpacing);
-
-  unsigned int itemsLastRow = numberOfItems % mImpl->mNumberOfColumns;
-  if (itemsLastRow == 0)
-  {
-    itemsLastRow = mImpl->mNumberOfColumns;
-  }
-
-  float rowsLastPage = (layoutHeight - mImpl->mBottomMargin - mImpl->mTopMargin + mImpl->mRowSpacing) / (itemSize.y + mImpl->mRowSpacing);
-  float itemsLastPage = (rowsLastPage - 1.0f) * static_cast<float>(mImpl->mNumberOfColumns) + static_cast<float>(itemsLastRow);
-
-  return itemsLastPage - static_cast<float>(numberOfItems);
-}
-
-float GridLayout::GetClosestAnchorPosition(float layoutPosition) const
-{
-  float rowIndex = static_cast<float>(round(layoutPosition / mImpl->mNumberOfColumns));
-  return rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
-}
-
-float GridLayout::GetItemScrollToPosition(unsigned int itemId) const
-{
-  float rowIndex = static_cast<float>(itemId / mImpl->mNumberOfColumns);
-  return -rowIndex * static_cast<float>(mImpl->mNumberOfColumns);
-}
-
-ItemRange GridLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
-{
-  float layoutWidth = IsHorizontal(mOrientation) ? layoutSize.height : layoutSize.width;
-  float layoutHeight = IsHorizontal(mOrientation) ? layoutSize.width : layoutSize.height;
-
-  Vector3 itemSize = mImpl->mItemSizeFunction( mImpl->mNumberOfColumns, layoutWidth, mImpl->mSideMargin, mImpl->mColumnSpacing);
-
-  int itemsPerPage = mImpl->mNumberOfColumns * ceil(layoutHeight / (itemSize.y + mImpl->mRowSpacing));
-  int firstVisibleItem = -(static_cast<int>(firstItemPosition / mImpl->mNumberOfColumns)) * mImpl->mNumberOfColumns;
-
-  int firstItemIndex = std::max(0, firstVisibleItem - static_cast<int>(mImpl->mNumberOfColumns));
-  int lastItemIndex  = std::max(0, firstVisibleItem + itemsPerPage);
-
-  return ItemRange(firstItemIndex, lastItemIndex);
-}
-
-float GridLayout::GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize)
-{
-  ItemLayout::Vector3Function positionConstraint;
-  Vector3 itemPosition = Vector3::ZERO;
-  if (GetPositionConstraint(itemID, positionConstraint))
-  {
-    itemPosition = positionConstraint(Vector3::ZERO, currentLayoutPosition + itemID, 0.0f, layoutSize);
-  }
-  Vector3 itemSize;
-  GetItemSize(itemID, layoutSize, itemSize);
-  Vector3 onScreenArea = (layoutSize - (IsVertical(mOrientation) ? itemSize : Vector3(itemSize.y, itemSize.x, itemSize.z))) * 0.5f;
-  if (itemPosition.x < -onScreenArea.x
-      || itemPosition.x > onScreenArea.x
-      || itemPosition.y < -onScreenArea.y
-      || itemPosition.y > onScreenArea.y)
-  {
-    // item not within viewable area
-    float rowHeight = itemSize.y + mImpl->mRowSpacing;
-    ItemLayout::Vector3Function firstItemPositionConstraint;
-    Vector3 firstItemPosition = Vector3::ZERO;
-    float offset = 0.0f;
-    if (GetPositionConstraint(0, firstItemPositionConstraint))
-    {
-      firstItemPosition = firstItemPositionConstraint(Vector3::ZERO, 0.0f, 0.0f, layoutSize);
-    }
-    switch( mOrientation )
-    {
-      case ControlOrientation::Up:
-      {
-        if(itemPosition.y > onScreenArea.y)
-        {
-          offset = ((layoutSize.y - rowHeight) * 0.5f) - firstItemPosition.y;
-        }
-        else
-        {
-          offset = ((-layoutSize.y + rowHeight) * 0.5f) - firstItemPosition.y;
-        }
-        break;
-      }
-      case ControlOrientation::Down:
-      {
-        if(itemPosition.y < -onScreenArea.y)
-        {
-          offset = ((layoutSize.y - rowHeight) * 0.5f) - firstItemPosition.y;
-        }
-        else
-        {
-          offset = ((-layoutSize.y + rowHeight) * 0.5f) - firstItemPosition.y;
-        }
-        break;
-      }
-      case ControlOrientation::Left:
-      {
-        if(itemPosition.x > onScreenArea.x)
-        {
-          offset = ((layoutSize.x - rowHeight) * 0.5f) - firstItemPosition.x;
-        }
-        else
-        {
-          offset = ((-layoutSize.x + rowHeight) * 0.5f) - firstItemPosition.x;
-        }
-        break;
-      }
-      case ControlOrientation::Right:
-      {
-        if(itemPosition.x < -onScreenArea.x)
-        {
-          offset = ((layoutSize.x - rowHeight) * 0.5f) - firstItemPosition.x;
-        }
-        else
-        {
-          offset = ((-layoutSize.x + rowHeight) * 0.5f) - firstItemPosition.x;
-        }
-        break;
-      }
-    }
-    // work out number of rows from first item position to an item aligned to bottom of screen
-    float rowDiff = offset / rowHeight;
-    float layoutPositionOffset = rowDiff * mImpl->mNumberOfColumns;
-    float scrollTo = GetItemScrollToPosition(itemID) + layoutPositionOffset;
-    return scrollTo;
-  }
-  return currentLayoutPosition;
-}
-
-unsigned int GridLayout::GetReserveItemCount(Vector3 layoutSize) const
-{
-  float layoutWidth = IsHorizontal(mOrientation) ? layoutSize.height : layoutSize.width;
-  float layoutHeight = IsHorizontal(mOrientation) ? layoutSize.width : layoutSize.height;
-
-  Vector3 itemSize = mImpl->mItemSizeFunction( mImpl->mNumberOfColumns, layoutWidth, mImpl->mSideMargin, mImpl->mColumnSpacing);
-  int itemsPerPage = mImpl->mNumberOfColumns * ceil(layoutHeight / (itemSize.y + mImpl->mRowSpacing));
-  return itemsPerPage;
-}
-
-bool GridLayout::GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const
-{
-  // Note: itemId is not checked, since every item has the same size
-
-  itemSize = mImpl->mItemSizeFunction( mImpl->mNumberOfColumns, (IsHorizontal(mOrientation) ? layoutSize.height : layoutSize.width), mImpl->mSideMargin, mImpl->mColumnSpacing);
-  return true;
-}
-
-void GridLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
-{
-  if(animation)
-  {
-    Vector3 currentSize( actor.GetCurrentSize() );
-    Vector3 shrink( currentSize );
-
-    shrink.width = std::min(size.width, currentSize.width);
-    shrink.height = std::min(size.height, currentSize.height);
-
-    // 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, AlphaFunction::EASE_OUT, TimePeriod( 0.0f, durationSeconds * 0.5f ) );
-    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size, AlphaFunction::EASE_IN, TimePeriod( 0.0f, durationSeconds ) );
-  }
-}
-
-bool GridLayout::GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const
-{
-  unsigned int columnIndex = itemId % mImpl->mNumberOfColumns;
-
-  if (mOrientation == ControlOrientation::Up)
-  {
-    constraint = GridPositionConstraint0(columnIndex, mImpl->mNumberOfColumns, mImpl->mRowSpacing, mImpl->mColumnSpacing, mImpl->mTopMargin, mImpl->mSideMargin, mImpl->mItemSizeFunction, mImpl->mZGap);
-  }
-  else if (mOrientation == ControlOrientation::Left)
-  {
-    constraint = GridPositionConstraint90(columnIndex, mImpl->mNumberOfColumns, mImpl->mRowSpacing, mImpl->mColumnSpacing, mImpl->mTopMargin, mImpl->mSideMargin, mImpl->mItemSizeFunction, mImpl->mZGap);
-  }
-  else if (mOrientation == ControlOrientation::Down)
-  {
-    constraint = GridPositionConstraint180(columnIndex, mImpl->mNumberOfColumns, mImpl->mRowSpacing, mImpl->mColumnSpacing, mImpl->mTopMargin, mImpl->mSideMargin, mImpl->mItemSizeFunction, mImpl->mZGap);
-  }
-  else // mOrientation == ControlOrientation::Right
-  {
-    constraint = GridPositionConstraint270(columnIndex, mImpl->mNumberOfColumns, mImpl->mRowSpacing, mImpl->mColumnSpacing, mImpl->mTopMargin, mImpl->mSideMargin, mImpl->mItemSizeFunction, mImpl->mZGap);
-  }
-
-  return true;
-}
-
-bool GridLayout::GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const
-{
-  constraint = mImpl->mRotationConstraint[mOrientation];
-  return true;
-}
-
-bool GridLayout::GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const
-{
-  return false; // No scaling
-}
-
-bool GridLayout::GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const
-{
-  constraint = mImpl->mColorConstraint;
-  return true;
-}
-
-bool GridLayout::GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const
-{
-  unsigned int columnIndex = itemId % mImpl->mNumberOfColumns;
-
-  if (IsVertical(mOrientation))
-  {
-    constraint = GridVisibilityConstraintPortrait(columnIndex, mImpl->mNumberOfColumns, mImpl->mRowSpacing, mImpl->mColumnSpacing, mImpl->mSideMargin, mImpl->mItemSizeFunction);
-  }
-  else // horizontal
-  {
-    constraint = GridVisibilityConstraintLandscape(columnIndex, mImpl->mNumberOfColumns, mImpl->mRowSpacing, mImpl->mColumnSpacing, mImpl->mSideMargin, mImpl->mItemSizeFunction);
-  }
-
-  return true;
-}
-
-Degree GridLayout::GetScrollDirection() const
-{
-  Degree scrollDirection(0.0f);
-
-  if (mOrientation == ControlOrientation::Up)
-  {
-    scrollDirection = Degree( 0.0f );
-  }
-  else if (mOrientation == ControlOrientation::Left)
-  {
-    scrollDirection = Degree( 90.0f );
-  }
-  else if (mOrientation == ControlOrientation::Down)
-  {
-    scrollDirection = Degree( 180.0f );
-  }
-  else // mOrientation == ControlOrientation::Right
-  {
-    scrollDirection = Degree( 270.0f );
-  }
-
-  return scrollDirection;
-}
-
-int GridLayout::GetNextFocusItemID(int itemID, int maxItems, Dali::Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled)
-{
-  switch( direction )
-  {
-    case Control::Left:
-    {
-      itemID--;
-      if( itemID < 0 )
-      {
-        itemID = loopEnabled ? maxItems - 1 : 0;
-      }
-      break;
-    }
-    case Control::Up:
-    {
-      itemID -= mImpl->mNumberOfColumns;
-      if( itemID < 0 )
-      {
-        itemID = loopEnabled ? itemID + maxItems : itemID + mImpl->mNumberOfColumns;
-      }
-      break;
-    }
-    case Control::Right:
-    {
-      itemID++;
-      if( itemID >= maxItems )
-      {
-        itemID = loopEnabled ? 0 : maxItems - 1;
-      }
-      break;
-    }
-    case Control::Down:
-    {
-      itemID += mImpl->mNumberOfColumns;
-      if( itemID >= maxItems )
-      {
-        itemID = loopEnabled ? 0 : itemID - mImpl->mNumberOfColumns;
-      }
-      break;
-    }
-  }
-  return itemID;
-}
-
-GridLayout::GridLayout()
-: mImpl(NULL)
-{
-  mImpl = new Impl();
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
index 7d6d17f..39e09a3 100644 (file)
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
 
-namespace
-{
-
-// Lerps between current and target using the progress
-template< typename Type >
-void Lerp( Type& current, const Type& target, float progress )
-{
-  current += ((target - current) * progress);
-}
-
-// Functors which wrap constraint functions with stored item IDs
-struct WrappedQuaternionConstraint
-{
-  WrappedQuaternionConstraint( Dali::Toolkit::ItemLayout::QuaternionFunction wrapMe, unsigned int itemId )
-  :mWrapMe(wrapMe),
-   mItemId(itemId)
-  {
-  }
-
-  void operator()( Dali::Quaternion& current, const Dali::PropertyInputContainer& inputs )
-  {
-    float offsetLayoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
-    float weight = inputs[3]->GetFloat();
-
-    current = Dali::Quaternion::Slerp( current, mWrapMe( current, offsetLayoutPosition, inputs[1]->GetFloat(), inputs[2]->GetVector3() ), weight );
-  }
-
-  Dali::Toolkit::ItemLayout::QuaternionFunction mWrapMe;
-  unsigned int mItemId;
-};
-
-struct WrappedVector3Constraint
+namespace Dali
 {
-  WrappedVector3Constraint( Dali::Toolkit::ItemLayout::Vector3Function wrapMe, unsigned int itemId )
-  : mWrapMe(wrapMe),
-    mItemId(itemId)
-  {
-  }
-
-  void operator()( Dali::Vector3& current, const Dali::PropertyInputContainer& inputs )
-  {
-    float offsetLayoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
-    float weight = inputs[3]->GetFloat();
 
-    Lerp( current, mWrapMe( current, offsetLayoutPosition, inputs[1]->GetFloat(), inputs[2]->GetVector3() ), weight );
-  }
-
-  Dali::Toolkit::ItemLayout::Vector3Function mWrapMe;
-  unsigned int mItemId;
-};
-
-struct WrappedVector4Constraint
+namespace Toolkit
 {
-  WrappedVector4Constraint( Dali::Toolkit::ItemLayout::Vector4Function wrapMe, unsigned int itemId )
-  : mWrapMe(wrapMe),
-    mItemId(itemId)
-  {
-  }
-
-  void operator()( Dali::Vector4& current, const Dali::PropertyInputContainer& inputs )
-  {
-    float offsetLayoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
-    float weight = inputs[3]->GetFloat();
-
-    Lerp( current, mWrapMe( current, offsetLayoutPosition, inputs[1]->GetFloat(), inputs[2]->GetVector3() ), weight );
-  }
-
-  Dali::Toolkit::ItemLayout::Vector4Function mWrapMe;
-  unsigned int mItemId;
-};
 
-struct WrappedBoolConstraint
+struct ItemLayout::Impl
 {
-  WrappedBoolConstraint( Dali::Toolkit::ItemLayout::BoolFunction wrapMe, unsigned int itemId )
-  : mWrapMe(wrapMe),
-    mItemId(itemId)
-  {
-  }
-
-  void operator()( bool& current, const Dali::PropertyInputContainer& inputs )
-  {
-    float weight = inputs[3]->GetFloat();
-
-    if ( weight >= 1.0f )
-    {
-      float offsetLayoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
-      current = mWrapMe( current, offsetLayoutPosition, inputs[1]->GetFloat(), inputs[2]->GetVector3() );
-    }
-  }
-
-  Dali::Toolkit::ItemLayout::BoolFunction mWrapMe;
-  unsigned int mItemId;
+  Vector3 mItemSize;                              ///< The size of an item in the layout
+  ControlOrientation::Type mOrientation;          ///< the orientation of the layout.
 };
 
-}  //Unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
 ItemLayout::ItemLayout()
-: mOrientation( ControlOrientation::Up ),
-  mAlphaFunction( AlphaFunction::LINEAR ),
-  mWeightObject()
+: mImpl( new Impl )
 {
+  mImpl->mOrientation = ControlOrientation::Up;
 }
 
 ItemLayout::~ItemLayout()
 {
+  delete mImpl;
 }
 
 void ItemLayout::SetOrientation(ControlOrientation::Type orientation)
 {
-  mOrientation = orientation;
+  mImpl->mOrientation = orientation;
 }
 
 ControlOrientation::Type ItemLayout::GetOrientation() const
 {
-  return mOrientation;
+  return mImpl->mOrientation;
+}
+
+void ItemLayout::GetItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const
+{
+  // If item-size has not been set then get the default size
+  if ( mImpl->mItemSize == Vector3::ZERO )
+  {
+    GetDefaultItemSize( itemId, layoutSize, itemSize );
+  }
+  else
+  {
+    itemSize = mImpl->mItemSize;
+  }
+}
+
+void ItemLayout::SetItemSize( const Vector3& itemSize )
+{
+  mImpl->mItemSize = itemSize;
 }
 
 float ItemLayout::GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize)
@@ -201,125 +129,6 @@ float ItemLayout::GetFlickSpeedFactor() const
   return GetScrollSpeedFactor();
 }
 
-void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float durationSeconds, Handle scrollPositionObject, const Actor& itemViewActor )
-{
-  // This just implements the default behaviour of constraint application.
-  // Custom layouts can override this function to apply their custom constraints.
-  Dali::Toolkit::ItemView itemView = Dali::Toolkit::ItemView::DownCast( itemViewActor );
-  if(itemView && scrollPositionObject)
-  {
-    Property::Index scrollSpeedProperty = itemView.GetPropertyIndex("item-view-scroll-speed");
-    Property::Index scrollPositionProperty = scrollPositionObject.GetPropertyIndex("scroll-position");
-
-    // We want to animate the layout in so use a weight object to do this
-    if ( !mWeightObject )
-    {
-      mWeightObject = WeightObject::New();
-    }
-
-    ItemLayout::Vector3Function positionConstraint;
-    if (GetPositionConstraint(itemId, positionConstraint))
-    {
-      WrappedVector3Constraint wrapped(positionConstraint, itemId);
-      Constraint constraint = Constraint::New<Vector3>( actor, Actor::Property::POSITION, wrapped );
-      constraint.AddSource( Source( scrollPositionObject, scrollPositionProperty ) );
-      constraint.AddSource( ParentSource( scrollSpeedProperty ) );
-      constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
-      constraint.AddSource( Source( mWeightObject, WeightObject::WEIGHT ) );
-      constraint.Apply();
-    }
-
-    ItemLayout::QuaternionFunction rotationConstraint;
-    if (GetRotationConstraint(itemId, rotationConstraint))
-    {
-      WrappedQuaternionConstraint wrapped(rotationConstraint, itemId);
-
-      Constraint constraint = Constraint::New<Quaternion>( actor, Actor::Property::ORIENTATION, wrapped );
-      constraint.AddSource( Source( scrollPositionObject, scrollPositionProperty ) );
-      constraint.AddSource( ParentSource( scrollSpeedProperty ) );
-      constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
-      constraint.AddSource( Source( mWeightObject, WeightObject::WEIGHT ) );
-      constraint.Apply();
-    }
-
-    ItemLayout::Vector3Function scaleConstraint;
-    if (GetScaleConstraint(itemId, scaleConstraint))
-    {
-      WrappedVector3Constraint wrapped(scaleConstraint, itemId);
-
-      Constraint constraint = Constraint::New<Vector3>( actor, Actor::Property::SCALE, wrapped );
-      constraint.AddSource( Source( scrollPositionObject, scrollPositionProperty ) );
-      constraint.AddSource( ParentSource( scrollSpeedProperty ) );
-      constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
-      constraint.AddSource( Source( mWeightObject, WeightObject::WEIGHT ) );
-      constraint.Apply();
-    }
-
-    ItemLayout::Vector4Function colorConstraint;
-    if (GetColorConstraint(itemId, colorConstraint))
-    {
-      WrappedVector4Constraint wrapped(colorConstraint, itemId);
-
-      Constraint constraint = Constraint::New<Vector4>( actor, Actor::Property::COLOR, wrapped );
-      constraint.AddSource( Source( scrollPositionObject, scrollPositionProperty ) );
-      constraint.AddSource( ParentSource( scrollSpeedProperty ) );
-      constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
-      constraint.AddSource( Source( mWeightObject, WeightObject::WEIGHT ) );
-      constraint.SetRemoveAction(Dali::Constraint::Discard);
-      constraint.Apply();
-    }
-
-    ItemLayout::BoolFunction visibilityConstraint;
-    if (GetVisibilityConstraint(itemId, visibilityConstraint))
-    {
-      WrappedBoolConstraint wrapped(visibilityConstraint, itemId);
-
-      Constraint constraint = Constraint::New<bool>( actor, Actor::Property::VISIBLE, wrapped );
-      constraint.AddSource( Source( scrollPositionObject, scrollPositionProperty ) );
-      constraint.AddSource( ParentSource( scrollSpeedProperty ) );
-      constraint.AddSource( ParentSource( Actor::Property::SIZE ) );
-      constraint.AddSource( Source( mWeightObject, WeightObject::WEIGHT ) );
-
-      // Release visibility constraints the same time as the color constraint
-      constraint.SetRemoveAction(Dali::Constraint::Discard);
-
-      constraint.Apply();
-    }
-
-    KeyFrames keyFrames = KeyFrames::New();
-    keyFrames.Add( 0.0f, 0.0f );
-    keyFrames.Add( 1.0f, 1.0f );
-
-    Animation applyAnimation = Dali::Animation::New( durationSeconds );
-    applyAnimation.AnimateBetween( Property( mWeightObject, WeightObject::WEIGHT ), keyFrames, mAlphaFunction, TimePeriod(durationSeconds) );
-    applyAnimation.Play();
-  }
-}
-
-Vector3 ItemLayout::GetItemPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) const
-{
-  Vector3 itemPosition = Vector3::ZERO;
-
-  ItemLayout::Vector3Function positionConstraint;
-  if (GetPositionConstraint(itemID, positionConstraint))
-  {
-    itemPosition = positionConstraint(Vector3::ZERO, currentLayoutPosition + itemID, 0.0f, layoutSize);
-  }
-
-  return itemPosition;
-}
-
-void ItemLayout::SetAlphaFunction(AlphaFunction func)
-{
-  mAlphaFunction = func;
-}
-
-AlphaFunction ItemLayout::GetAlphaFunction() const
-{
-  return mAlphaFunction;
-}
-
-
 } // namespace Toolkit
 
 } // namespace Dali
index 169ad2b..5eda5d4 100644 (file)
@@ -19,9 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <boost/function.hpp>
 #include <dali/public-api/animation/alpha-function.h>
-#include <dali/public-api/common/vector-wrapper.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/enums.h>
@@ -37,11 +35,6 @@ class ItemLayout;
 
 typedef IntrusivePtr<ItemLayout> ItemLayoutPtr; ///< Pointer to a Dali::Toolkit::ItemLayout object
 
-typedef std::vector<ItemLayoutPtr>          ItemLayoutContainer; ///< Container of Dali::Toolkit::ItemLayout objects
-typedef ItemLayoutContainer::iterator       ItemLayoutIter;      ///< Iterator for Dali::Toolkit::ItemLayoutContainer
-typedef ItemLayoutContainer::const_iterator ItemLayoutConstIter; ///< Const Iterator for Dali::Toolkit::ItemLayoutContainer
-
-
 /**
  * @brief A support class for managing ranges of items.
  */
@@ -133,17 +126,7 @@ class DALI_IMPORT_API ItemLayout : public RefObject
 {
 public:
 
-  /// @brief Function signature of a boolean constraint
-  typedef boost::function<bool       (const bool&       current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)> BoolFunction;
-
-  /// @brief Function signature of a Vector3 constraint
-  typedef boost::function<Vector3    (const Vector3&    current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)> Vector3Function;
-
-  /// @brief Function signature of a Vector4 constraint
-  typedef boost::function<Vector4    (const Vector4&    current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)> Vector4Function;
-
-  /// @brief Function signature of a Quaternion constraint
-  typedef boost::function<Quaternion (const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)> QuaternionFunction;
+  class Extension; ///< Forward declare future extension interface
 
   /**
    * @brief Virtual destructor.
@@ -165,6 +148,26 @@ public:
   DALI_IMPORT_API ControlOrientation::Type GetOrientation() const;
 
   /**
+   * @brief Retrieve the target size of an item in the layout.
+   *
+   * This will return the default size for the layout unless overridden by calling SetItemSize().
+   *
+   * @note layout-position is not provided as a parameter, since applying size constraints is not recommended.
+   * Animating to target-sizes is preferable, since this allows controls to perform layouting without constraints.
+   * @param[in] itemId The ID of an item in the layout.
+   * @param[in] layoutSize The layout size
+   * @param[out] itemSize The target size of an item.
+   */
+  DALI_IMPORT_API void GetItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const;
+
+  /**
+   * @brief Overrides the default size for the layout.
+   *
+   * @param[in] itemSize The size of each item.
+   */
+  DALI_IMPORT_API void SetItemSize( const Vector3& itemSize );
+
+  /**
    * @brief Query the minimum valid layout position; this is a negative value.
    *
    * When scrolling, the first item will move within the range 0 to GetMinimumLayoutPosition().
@@ -230,16 +233,15 @@ public:
   virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const = 0;
 
   /**
-   * @brief Retrieve the target size of an item in the layout.
+   * @brief Retrieve the default size of an item in the layout.
    *
    * @note layout-position is not provided as a parameter, since applying size constraints is not recommended.
    * Animating to target-sizes is preferable, since this allows controls to perform layouting without constraints.
    * @param[in] itemId The ID of an item in the layout.
    * @param[in] layoutSize The layout size
-   * @param[out] itemSize The target size of an item, or an uninitialized value.
-   * @return Whether the item size is available or not
+   * @param[out] itemSize The target size of an item.
    */
-  virtual bool GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const = 0;
+  virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const = 0;
 
   /**
    * @brief Retrieve the resize animation in the layout.
@@ -253,56 +255,6 @@ public:
   virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const = 0;
 
   /**
-   * @brief Retrieve the position constraint function of an item in the layout.
-   *
-   * The constraint will be applied when the item is created or the layout is activated.
-   * @param[in] itemId The ID of an item in the layout.
-   * @param[out] constraint The position constraint function of an item, or an uninitialized function pointer.
-   * @return Whether the position constraint function of an item is available or not
-   */
-  virtual bool GetPositionConstraint(unsigned int itemId, Vector3Function& constraint) const = 0;
-
-  /**
-   * @brief Retrieve the rotation constraint function of an item in the layout.
-   *
-   * The constraint will be applied when the item is created or the layout is activated.
-   * @param[in] itemId The ID of an item in the layout.
-   * @param[out] constraint The rotation constraint function of an item, or an uninitialized function pointer.
-   * @return Whether the rotation constraint function of an item is available or not
-   */
-  virtual bool GetRotationConstraint(unsigned int itemId, QuaternionFunction& constraint) const = 0;
-
-  /**
-   * @brief Retrieve the scale constraint function of an item in the layout.
-   *
-   * The constraint will be applied when the item is created or the layout is activated.
-   * @param[in] itemId The ID of an item in the layout.
-   * @param[out] constraint The scale constraint function of an item, or an uninitialized function pointer.
-   * @return Whether the scale constraint function of an item is available or not
-   */
-  virtual bool GetScaleConstraint(unsigned int itemId, Vector3Function& constraint) const = 0;
-
-  /**
-   * @brief Retrieve the color constraint function of an item in the layout.
-   *
-   * The constraint will be applied when the item is created or the layout is activated.
-   * @param[in] itemId The ID of an item in the layout.
-   * @param[out] constraint The color constraint function of an item, or an uninitialized function pointer.
-   * @return Whether the color constraint function of an item is available or not
-   */
-  virtual bool GetColorConstraint(unsigned int itemId, Vector4Function& constraint) const = 0;
-
-  /**
-   * @brief Retrieve the visibility constraint function of an item in the layout.
-   *
-   * The constraint will be applied when the item is created or the layout is activated.
-   * @param[in] itemId The ID of an item in the layout.
-   * @param[out] constraint The visibility constraint function of an item, or an uninitialized function pointer.
-   * @return Whether the visibility constraint function of an item is available or not
-   */
-  virtual bool GetVisibilityConstraint(unsigned int itemId, BoolFunction& constraint) const = 0;
-
-  /**
    * @brief Query the scroll direction of the layout.
    *
    * When an input gesture follows this direction, the layout-position of items will be increased.
@@ -373,11 +325,10 @@ public:
    *
    * @param[in] actor The actor to constrain.
    * @param[in] itemId The ID of the item represented by the actor.
-   * @param[in] durationSeconds The time taken to fully constrain the actors.
-   * @param[in] scrollPositionObject The object which provides the layout position property.
+   * @param[in] layoutSize the current size of the item view instance.
    * @param[in] itemViewActor The item view instance which requests the application of constraints.
    */
-  DALI_IMPORT_API virtual void ApplyConstraints( Actor& actor, const int itemId, const float durationSeconds, Handle scrollPositionObject, const Actor& itemViewActor );
+  DALI_IMPORT_API virtual void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor ) = 0;
 
   /**
    * @brief Gets the position of a given item
@@ -387,21 +338,17 @@ public:
    * @param[in] layoutSize the current size of the item view instance
    * @return The item position (x,y,z)
    */
-  DALI_IMPORT_API virtual Vector3 GetItemPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) const;
+  DALI_IMPORT_API virtual Vector3 GetItemPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) const = 0;
 
   /**
-   * @brief Set the alpha function used when applying constraints
+   * Retrieve the extension for this layout.
    *
-   * @param[in] func The alpha function to use.
+   * @return The extension if available, NULL otherwise
    */
-  DALI_IMPORT_API void SetAlphaFunction(AlphaFunction func);
-
-  /**
-   * @brief Retrieve the alpha function used when applying constraints
-   *
-   * @return The alpha function.
-   */
-  DALI_IMPORT_API AlphaFunction GetAlphaFunction() const;
+  virtual Extension* GetExtension()
+  {
+    return NULL;
+  }
 
 protected:
 
@@ -412,9 +359,8 @@ protected:
 
 protected:
 
-  ControlOrientation::Type mOrientation;   ///< the orientation of the layout.
-  AlphaFunction            mAlphaFunction; ///< Alpha function to be applied when removing/adding constraints
-  Handle                   mWeightObject;  ///< Weight object gets created to apply the constraints over a certain time
+  struct Impl;
+  Impl* mImpl;
 };
 
 } // namespace Toolkit
index 034bcbe..1ee9b3d 100644 (file)
@@ -64,11 +64,6 @@ ItemView ItemView::DownCast( BaseHandle handle )
   return Control::DownCast<ItemView, Internal::ItemView>(handle);
 }
 
-ScrollConnector ItemView::GetScrollConnector() const
-{
-  return GetImpl(*this).GetScrollConnector();
-}
-
 ItemView::~ItemView()
 {
 }
index d1f29a5..60a2312 100644 (file)
@@ -35,7 +35,6 @@ namespace Internal DALI_INTERNAL
 class ItemView;
 }
 
-class ScrollConnector;
 class ItemFactory;
 class ItemLayout;
 struct ItemRange;
@@ -52,6 +51,30 @@ class DALI_IMPORT_API ItemView : public Scrollable
 {
 public:
 
+  enum PropertyRange
+  {
+    ANIMATABLE_PROPERTY_START_INDEX = Toolkit::Scrollable::ANIMATABLE_PROPERTY_END_INDEX + 1,
+    ANIMATABLE_PROPERTY_END_INDEX   = ANIMATABLE_PROPERTY_START_INDEX + 1000                   ///< Reserve animatable property indices
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the ScrollView class.
+   */
+  struct Property
+  {
+    enum
+    {
+      LAYOUT_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "layout-position",       type float
+      SCROLL_SPEED,                                      ///< Property, name "scroll-speed",          type float
+      OVERSHOOT,                                         ///< Property, name "overshoot",             type float
+      SCROLL_DIRECTION,                                  ///< Property, name "scroll-direction",      type Vector2
+      LAYOUT_ORIENTATION,                                ///< Property, name "layout-orientation",    type integer
+      SCROLL_CONTENT_SIZE                                ///< Property, name "scroll-content-size",   type float
+    };
+  };
+
+public:
+
   /**
    * @brief Create an uninitialized ItemView; this can be initialized with ItemView::New().
    *
@@ -96,13 +119,6 @@ public:
   static ItemView DownCast( BaseHandle handle );
 
   /**
-   * @brief Retrieve a scroll-connector; this can be used to connect scroll components e.g. scroll bars.
-   *
-   * @return The connector.
-   */
-  ScrollConnector GetScrollConnector() const;
-
-  /**
    * @brief Query the number of layouts.
    *
    * @return The number of layouts.
diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.cpp
deleted file mode 100644 (file)
index 4d9cede..0000000
+++ /dev/null
@@ -1,601 +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 <dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.h>
-
-// EXTERNAL INCLUDES
-#include <algorithm>
-#include <dali/public-api/animation/animation.h>
-
-using namespace Dali;
-using namespace Dali::Toolkit;
-
-namespace // unnamed namespace
-{
-
-const float DEFAULT_ITEMS_PER_SPIRAL_TURN = 9.5f;
-const float DEFAULT_ITEM_SPACING_RADIANS = Math::PI*2.0f/DEFAULT_ITEMS_PER_SPIRAL_TURN;
-
-const float DEFAULT_REVOLUTION_DISTANCE = 190.0f;
-const float DEFAULT_ITEM_DESCENT = DEFAULT_REVOLUTION_DISTANCE / DEFAULT_ITEMS_PER_SPIRAL_TURN;
-
-const float DEFAULT_TOP_ITEM_ALIGNMENT = -0.125f;
-
-const float DEFAULT_SCROLL_SPEED_FACTOR = 0.01f;
-const float DEFAULT_MAXIMUM_SWIPE_SPEED = 30.0f;
-const float DEFAULT_ITEM_FLICK_ANIMATION_DURATION = 0.1f;
-
-struct DefaultItemSizeFunction
-{
-  Vector3 operator()(const Vector3& layoutSize)
-  {
-    float width = layoutSize.width * 0.25f;
-
-    // 4x3 aspect ratio
-    return Vector3(width, (width/4)*3, (width/4)*3);
-  }
-};
-
-struct DefaultSpiralRadiusFunction
-{
-  float operator()(const Vector3& layoutSize)
-  {
-    return layoutSize.width*0.4f;
-  }
-};
-
-struct SpiralPositionConstraintUp
-{
-  SpiralPositionConstraintUp(SpiralLayout::SpiralRadiusFunction spiralRadius, float itemSpacingRadians, float itemDescent, float topItemAlignment)
-  : mSpiralRadius(spiralRadius),
-    mItemSpacingRadians(itemSpacingRadians),
-    mItemDescent(itemDescent),
-    mTopItemAlignment(topItemAlignment)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float spiralRadius = mSpiralRadius(layoutSize);
-
-    float angle = -Math::PI*0.5f + mItemSpacingRadians * layoutPosition;
-
-    return Vector3( -spiralRadius * cosf(angle),
-                    (mItemDescent * layoutPosition) + layoutSize.height*mTopItemAlignment,
-                    -spiralRadius * sinf(angle) );
-  }
-
-  SpiralLayout::SpiralRadiusFunction mSpiralRadius;
-  float mItemSpacingRadians;
-  float mItemDescent;
-  float mTopItemAlignment;
-};
-
-struct SpiralPositionConstraintLeft
-{
-  SpiralPositionConstraintLeft(SpiralLayout::SpiralRadiusFunction spiralRadius, float itemSpacingRadians, float itemDescent, float topItemAlignment)
-  : mSpiralRadius(spiralRadius),
-    mItemSpacingRadians(itemSpacingRadians),
-    mItemDescent(itemDescent),
-    mTopItemAlignment(topItemAlignment)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float spiralRadius = mSpiralRadius(layoutSize);
-
-    float angle = Math::PI*0.5f + mItemSpacingRadians * layoutPosition;
-
-    return Vector3(  (mItemDescent * layoutPosition) + layoutSize.width*mTopItemAlignment,
-                     -spiralRadius * cosf(angle),
-                      spiralRadius * sinf(angle) );
-  }
-
-  SpiralLayout::SpiralRadiusFunction mSpiralRadius;
-  float mItemSpacingRadians;
-  float mItemDescent;
-  float mTopItemAlignment;
-};
-
-struct SpiralPositionConstraintDown
-{
-  SpiralPositionConstraintDown(SpiralLayout::SpiralRadiusFunction spiralRadius, float itemSpacingRadians, float itemDescent, float topItemAlignment)
-  : mSpiralRadius(spiralRadius),
-    mItemSpacingRadians(itemSpacingRadians),
-    mItemDescent(itemDescent),
-    mTopItemAlignment(topItemAlignment)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float spiralRadius = mSpiralRadius(layoutSize);
-
-    float angle = Math::PI*0.5f + mItemSpacingRadians * layoutPosition;
-
-    return Vector3(  -spiralRadius * cosf(angle),
-                    (-mItemDescent * layoutPosition) - layoutSize.height*mTopItemAlignment,
-                      spiralRadius * sinf(angle) );
-  }
-
-  SpiralLayout::SpiralRadiusFunction mSpiralRadius;
-  float mItemSpacingRadians;
-  float mItemDescent;
-  float mTopItemAlignment;
-};
-
-struct SpiralPositionConstraintRight
-{
-  SpiralPositionConstraintRight(SpiralLayout::SpiralRadiusFunction spiralRadius, float itemSpacingRadians, float itemDescent, float topItemAlignment)
-  : mSpiralRadius(spiralRadius),
-    mItemSpacingRadians(itemSpacingRadians),
-    mItemDescent(itemDescent),
-    mTopItemAlignment(topItemAlignment)
-  {
-  }
-
-  Vector3 operator()(const Vector3& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float spiralRadius = mSpiralRadius(layoutSize);
-
-    float angle = -Math::PI*0.5f + mItemSpacingRadians * layoutPosition;
-
-    return Vector3( (-mItemDescent * layoutPosition) - layoutSize.width*mTopItemAlignment,
-                     -spiralRadius * cosf(angle),
-                     -spiralRadius * sinf(angle) );
-  }
-
-  SpiralLayout::SpiralRadiusFunction mSpiralRadius;
-  float mItemSpacingRadians;
-  float mItemDescent;
-  float mTopItemAlignment;
-};
-
-struct SpiralRotationConstraintUp
-{
-  SpiralRotationConstraintUp(float itemSpacingRadians)
-  : mItemSpacingRadians(itemSpacingRadians)
-  {
-  }
-
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float angle = -mItemSpacingRadians * layoutPosition;
-
-    return Quaternion( Radian( angle ), Vector3::YAXIS);
-  }
-
-  float mItemSpacingRadians;
-};
-
-struct SpiralRotationConstraintLeft
-{
-  SpiralRotationConstraintLeft(float itemSpacingRadians)
-  : mItemSpacingRadians(itemSpacingRadians)
-  {
-  }
-
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float angle = -mItemSpacingRadians * layoutPosition;
-
-    return Quaternion( Radian( -Math::PI * 0.5f ), Vector3::ZAXIS ) * Quaternion( Radian( angle ), Vector3::YAXIS );
-  }
-
-  float mItemSpacingRadians;
-};
-
-struct SpiralRotationConstraintDown
-{
-  SpiralRotationConstraintDown(float itemSpacingRadians)
-  : mItemSpacingRadians(itemSpacingRadians)
-  {
-  }
-
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float angle = -mItemSpacingRadians * layoutPosition;
-
-    return Quaternion( Radian( -Math::PI ), Vector3::ZAXIS) * Quaternion( Radian( angle ), Vector3::YAXIS );
-  }
-
-  float mItemSpacingRadians;
-};
-
-struct SpiralRotationConstraintRight
-{
-  SpiralRotationConstraintRight(float itemSpacingRadians)
-  : mItemSpacingRadians(itemSpacingRadians)
-  {
-  }
-
-  Quaternion operator()(const Quaternion& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float angle = -mItemSpacingRadians * layoutPosition;
-
-    return Quaternion( Radian( -Math::PI * 1.5f ), Vector3::ZAXIS) * Quaternion( Radian( angle ), Vector3::YAXIS );
-  }
-
-  float mItemSpacingRadians;
-};
-
-struct SpiralColorConstraint
-{
-  SpiralColorConstraint(float itemSpacingRadians)
-  : mItemSpacingRadians(itemSpacingRadians)
-  {
-  }
-
-  Vector4 operator()(const Vector4& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    Radian angle( mItemSpacingRadians * fabsf(layoutPosition) / Dali::ANGLE_360 );
-
-    float progress = angle - floorf( angle ); // take fractional bit only to get between 0.0 - 1.0
-    progress = (progress > 0.5f) ? 2.0f*(1.0f - progress) : progress*2.0f;
-
-    float darkness(1.0f);
-    {
-      const float startMarker = 0.10f; // The progress at which darkening starts
-      const float endMarker   = 0.35f; // The progress at which darkening ends
-      const float minDarkness = 0.15f; // The darkness at end marker
-
-      if (progress > endMarker)
-      {
-        darkness = minDarkness;
-      }
-      else if (progress > startMarker)
-      {
-        darkness = 1.0f - ( (1.0f - minDarkness) * ((progress-startMarker) / (endMarker-startMarker)) );
-      }
-    }
-
-    return Vector4( darkness, darkness, darkness, current.a );
-  }
-
-  float mItemSpacingRadians;
-};
-
-struct SpiralVisibilityConstraintPortrait
-{
-  SpiralVisibilityConstraintPortrait(float itemSpacingRadians, float itemDescent, float topItemAlignment)
-  : mItemSpacingRadians(itemSpacingRadians),
-    mItemDescent(itemDescent),
-    mTopItemAlignment(topItemAlignment)
-  {
-  }
-
-  bool operator()(const bool& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float itemsCachedBeforeTopItem = layoutSize.height*(mTopItemAlignment+0.5f) / mItemDescent;
-    return (layoutPosition >= -itemsCachedBeforeTopItem - 1.0f && layoutPosition <= (layoutSize.height / mItemDescent) + 1.0f);
-  }
-
-  float mItemSpacingRadians;
-  float mItemDescent;
-  float mTopItemAlignment;
-};
-
-struct SpiralVisibilityConstraintLandscape
-{
-  SpiralVisibilityConstraintLandscape(float itemSpacingRadians, float itemDescent, float topItemAlignment)
-  : mItemSpacingRadians(itemSpacingRadians),
-    mItemDescent(itemDescent),
-    mTopItemAlignment(topItemAlignment)
-  {
-  }
-
-  bool operator()(const bool& current, const float& layoutPosition, const float& scrollSpeed, const Vector3& layoutSize)
-  {
-    float itemsCachedBeforeTopItem = layoutSize.width*(mTopItemAlignment+0.5f) / mItemDescent;
-    return (layoutPosition >= -itemsCachedBeforeTopItem - 1.0f && layoutPosition <= (layoutSize.width / mItemDescent) + 1.0f);
-  }
-
-  float mItemSpacingRadians;
-  float mItemDescent;
-  float mTopItemAlignment;
-};
-
-} // unnamed namespace
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-struct SpiralLayout::Impl
-{
-  Impl()
-  : mItemSizeFunction(DefaultItemSizeFunction()),
-    mSpiralRadiusFunction(DefaultSpiralRadiusFunction()),
-    mItemSpacingRadians(DEFAULT_ITEM_SPACING_RADIANS),
-    mRevolutionDistance(DEFAULT_REVOLUTION_DISTANCE),
-    mItemDescent(DEFAULT_ITEM_DESCENT),
-    mTopItemAlignment(DEFAULT_TOP_ITEM_ALIGNMENT),
-    mScrollSpeedFactor(DEFAULT_SCROLL_SPEED_FACTOR),
-    mMaximumSwipeSpeed(DEFAULT_MAXIMUM_SWIPE_SPEED),
-    mItemFlickAnimationDuration(DEFAULT_ITEM_FLICK_ANIMATION_DURATION)
-  {
-  }
-
-  ItemSizeFunction     mItemSizeFunction;
-  SpiralRadiusFunction mSpiralRadiusFunction;
-
-  float mItemSpacingRadians;
-  float mRevolutionDistance;
-  float mItemDescent;
-  float mTopItemAlignment;
-  float mScrollSpeedFactor;
-  float mMaximumSwipeSpeed;
-  float mItemFlickAnimationDuration;
-};
-
-SpiralLayoutPtr SpiralLayout::New()
-{
-  return SpiralLayoutPtr(new SpiralLayout());
-}
-
-SpiralLayout::~SpiralLayout()
-{
-  delete mImpl;
-}
-
-void SpiralLayout::SetItemSizeFunction(ItemSizeFunction function)
-{
-  mImpl->mItemSizeFunction = function;
-}
-
-SpiralLayout::ItemSizeFunction SpiralLayout::GetItemSizeFunction() const
-{
-  return mImpl->mItemSizeFunction;
-}
-
-void SpiralLayout::SetItemSpacing(Radian itemSpacing)
-{
-  mImpl->mItemSpacingRadians = itemSpacing;
-
-  float itemsPerSpiral = std::max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
-  mImpl->mItemDescent = mImpl->mRevolutionDistance / itemsPerSpiral;
-}
-
-Radian SpiralLayout::GetItemSpacing() const
-{
-  return Radian( mImpl->mItemSpacingRadians );
-}
-
-void SpiralLayout::SetRevolutionDistance(float distance)
-{
-  mImpl->mRevolutionDistance = distance;
-
-  float itemsPerSpiral = std::max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
-  mImpl->mItemDescent = mImpl->mRevolutionDistance / itemsPerSpiral;
-}
-
-float SpiralLayout::GetRevolutionDistance() const
-{
-  return mImpl->mRevolutionDistance;
-}
-
-void SpiralLayout::SetSpiralRadiusFunction(SpiralRadiusFunction function)
-{
-  mImpl->mSpiralRadiusFunction = function;
-}
-
-SpiralLayout::SpiralRadiusFunction SpiralLayout::GetSpiralRadiusFunction() const
-{
-  return mImpl->mSpiralRadiusFunction;
-}
-
-void SpiralLayout::SetTopItemAlignment(float alignment)
-{
-  mImpl->mTopItemAlignment = alignment;
-}
-
-float SpiralLayout::GetTopItemAlignment() const
-{
-  return mImpl->mTopItemAlignment;
-}
-
-void SpiralLayout::SetScrollSpeedFactor(float scrollSpeed)
-{
-  mImpl->mScrollSpeedFactor = scrollSpeed;
-}
-
-void SpiralLayout::SetMaximumSwipeSpeed(float speed)
-{
-  mImpl->mMaximumSwipeSpeed = speed;
-}
-
-void SpiralLayout::SetItemFlickAnimationDuration(float durationSeconds)
-{
-  mImpl->mItemFlickAnimationDuration = durationSeconds;
-}
-
-float SpiralLayout::GetScrollSpeedFactor() const
-{
-  return mImpl->mScrollSpeedFactor;
-}
-
-float SpiralLayout::GetMaximumSwipeSpeed() const
-{
-  return mImpl->mMaximumSwipeSpeed;
-}
-
-float SpiralLayout::GetItemFlickAnimationDuration() const
-{
-  return mImpl->mItemFlickAnimationDuration;
-}
-
-float SpiralLayout::GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
-{
-  return 1.0f - static_cast<float>(numberOfItems);
-}
-
-float SpiralLayout::GetClosestAnchorPosition(float layoutPosition) const
-{
-  return round(layoutPosition);
-}
-
-float SpiralLayout::GetItemScrollToPosition(unsigned int itemId) const
-{
-  return -(static_cast<float>(itemId));
-}
-
-ItemRange SpiralLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
-{
-  float layoutHeight = IsHorizontal(mOrientation) ? layoutSize.width : layoutSize.height;
-  float itemsPerSpiral = layoutHeight / mImpl->mItemDescent;
-  float itemsCachedBeforeTopItem = layoutHeight * (mImpl->mTopItemAlignment + 0.5f) / mImpl->mItemDescent;
-  float itemsViewable = std::min(itemsPerSpiral, itemsPerSpiral - itemsCachedBeforeTopItem - firstItemPosition + 1.0f);
-
-  unsigned int firstItem = static_cast<unsigned int>(std::max(0.0f, -firstItemPosition - itemsCachedBeforeTopItem - 1.0f));
-  unsigned int lastItem  = static_cast<unsigned int>(std::max(0.0f, firstItem + itemsViewable));
-
-  return ItemRange(firstItem, lastItem+1);
-}
-
-unsigned int SpiralLayout::GetReserveItemCount(Vector3 layoutSize) const
-{
-  float layoutHeight = IsHorizontal(mOrientation) ? layoutSize.width : layoutSize.height;
-  return static_cast<unsigned int>(layoutHeight / mImpl->mItemDescent);
-}
-
-bool SpiralLayout::GetItemSize(unsigned int itemId, Vector3 layoutSize, Vector3& itemSize) const
-{
-  // Note: itemId is not checked, since every item has the same size
-
-  itemSize = mImpl->mItemSizeFunction(layoutSize);
-  return true;
-}
-
-void SpiralLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
-{
-  if(animation)
-  {
-    animation.AnimateTo( Property( actor, Actor::Property::SIZE ), size );
-  }
-}
-
-bool SpiralLayout::GetPositionConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const
-{
-  if (mOrientation == ControlOrientation::Up)
-  {
-    constraint = SpiralPositionConstraintUp(mImpl->mSpiralRadiusFunction, mImpl->mItemSpacingRadians, mImpl->mItemDescent, mImpl->mTopItemAlignment);
-  }
-  else if (mOrientation == ControlOrientation::Left)
-  {
-    constraint = SpiralPositionConstraintLeft(mImpl->mSpiralRadiusFunction, mImpl->mItemSpacingRadians, mImpl->mItemDescent, mImpl->mTopItemAlignment);
-  }
-  else if (mOrientation == ControlOrientation::Down)
-  {
-    constraint = SpiralPositionConstraintDown(mImpl->mSpiralRadiusFunction, mImpl->mItemSpacingRadians, mImpl->mItemDescent, mImpl->mTopItemAlignment);
-  }
-  else // mOrientation == ControlOrientation::Right
-  {
-    constraint = SpiralPositionConstraintRight(mImpl->mSpiralRadiusFunction, mImpl->mItemSpacingRadians, mImpl->mItemDescent, mImpl->mTopItemAlignment);
-  }
-
-  return true;
-}
-
-bool SpiralLayout::GetRotationConstraint(unsigned int itemId, ItemLayout::QuaternionFunction& constraint) const
-{
-  if (mOrientation == ControlOrientation::Up)
-  {
-    constraint = SpiralRotationConstraintUp(mImpl->mItemSpacingRadians);
-  }
-  else if (mOrientation == ControlOrientation::Left)
-  {
-    constraint = SpiralRotationConstraintLeft(mImpl->mItemSpacingRadians);
-  }
-  else if (mOrientation == ControlOrientation::Down)
-  {
-    constraint = SpiralRotationConstraintDown(mImpl->mItemSpacingRadians);
-  }
-  else // mOrientation == ControlOrientation::Right
-  {
-    constraint = SpiralRotationConstraintRight(mImpl->mItemSpacingRadians);
-  }
-
-  return true;
-}
-
-bool SpiralLayout::GetScaleConstraint(unsigned int itemId, ItemLayout::Vector3Function& constraint) const
-{
-  return false; // No scaling
-}
-
-bool SpiralLayout::GetColorConstraint(unsigned int itemId, ItemLayout::Vector4Function& constraint) const
-{
-  constraint = SpiralColorConstraint(mImpl->mItemSpacingRadians);
-  return true;
-}
-
-bool SpiralLayout::GetVisibilityConstraint(unsigned int itemId, ItemLayout::BoolFunction& constraint) const
-{
-  if (IsVertical(mOrientation))
-  {
-    constraint = SpiralVisibilityConstraintPortrait(mImpl->mItemSpacingRadians, mImpl->mItemDescent, mImpl->mTopItemAlignment);
-  }
-  else // horizontal
-  {
-    constraint = SpiralVisibilityConstraintLandscape(mImpl->mItemSpacingRadians, mImpl->mItemDescent, mImpl->mTopItemAlignment);
-  }
-
-  return true;
-}
-
-Degree SpiralLayout::GetScrollDirection() const
-{
-  Degree scrollDirection(0);
-
-  if (mOrientation == ControlOrientation::Up)
-  {
-    scrollDirection = Degree( -45.0f ); // Allow swiping horizontally & vertically
-  }
-  else if (mOrientation == ControlOrientation::Left)
-  {
-    scrollDirection = Degree( 45.0f );
-  }
-  else if (mOrientation == ControlOrientation::Down)
-  {
-    scrollDirection = Degree( 180.0f - 45.0f );
-  }
-  else // mOrientation == ControlOrientation::Right
-  {
-    scrollDirection = Degree( 270.0f - 45.0f );
-  }
-
-  return scrollDirection;
-}
-
-SpiralLayout::SpiralLayout()
-: mImpl(NULL)
-{
-  mImpl = new Impl();
-}
-
-float SpiralLayout::GetClosestOnScreenLayoutPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize)
-{
-  return GetItemScrollToPosition(itemID);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-component-impl.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-component-impl.cpp
deleted file mode 100644 (file)
index 3b9bc31..0000000
+++ /dev/null
@@ -1,76 +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 <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/object/type-registry.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace // unnamed namespace
-{
-
-BaseHandle Create()
-{
-  // empty handle as we cannot create ScrollComponent
-  return BaseHandle();
-}
-
-TypeRegistration mType( typeid(Toolkit::ScrollComponent), typeid(Toolkit::Control), Create );
-
-} // unnamed namespace
-
-void ScrollComponentImpl::SetScrollConnector( Toolkit::ScrollConnector connector )
-{
-  if( mScrollConnector != connector )
-  {
-    Toolkit::ScrollConnector oldConnector = mScrollConnector;
-    mScrollConnector = connector;
-
-    // Notify derived classes
-    OnScrollConnectorSet( oldConnector );
-  }
-}
-
-Toolkit::ScrollConnector ScrollComponentImpl::GetScrollConnector() const
-{
-  return mScrollConnector;
-}
-
-ScrollComponentImpl::ScrollComponentImpl()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) )
-{
-}
-
-ScrollComponentImpl::~ScrollComponentImpl()
-{
-}
-
-void ScrollComponentImpl::OnScrollConnectorSet( Toolkit::ScrollConnector connector )
-{
-  // Do nothing (override in derived classes)
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h b/dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h
deleted file mode 100644 (file)
index 1543367..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#ifndef __DALI_TOOLKIT_SCROLL_COMPONENT_IMPL_H__
-#define __DALI_TOOLKIT_SCROLL_COMPONENT_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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-component.h>
-
-#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-class ScrollComponentImpl;
-typedef IntrusivePtr<ScrollComponentImpl> ScrollComponentPtr;
-
-/**
- * Base class for scroll component implementations.
- * Scroll-components such as scroll bars, indicators etc. are connected to scrollable containers via ScrollConnector.
- */
-class DALI_IMPORT_API ScrollComponentImpl : public Internal::Control
-{
-public:
-
-  /**
-   * @brief Sets the scroll connector.
-   *
-   * @param[in] connector The scroll-connector used to connect with a scrollable container.
-   */
-  void SetScrollConnector( Toolkit::ScrollConnector connector );
-
-  /**
-   * @brief Retrieve the scroll connector.
-   *
-   * @return The scroll-connector used to connect with a scrollable container.
-   */
-  Toolkit::ScrollConnector GetScrollConnector() const;
-
-  /**
-   * Called when the scroll component is disconnected from a scrollable container.
-   */
-  virtual void OnDisconnect() {}
-
-protected:
-
-  /**
-   * Construct a new ScrollComponentImpl.
-   */
-  ScrollComponentImpl();
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~ScrollComponentImpl();
-
-  /**
-   * @brief Called when a scroll component is connected to a scrollable UI control.
-   *
-   * @param[in] oldConnector The previous connector, or an empty handle.
-   */
-  virtual void OnScrollConnectorSet( Toolkit::ScrollConnector oldConnector );
-
-private:
-
-  // Undefined
-  DALI_INTERNAL ScrollComponentImpl(const ScrollComponentImpl&);
-
-  // Undefined
-  DALI_INTERNAL ScrollComponentImpl& operator=(const ScrollComponentImpl& rhs);
-
-protected:
-
-  Toolkit::ScrollConnector mScrollConnector;
-};
-
-// Helpers for public-api forwarding methods
-
-inline Toolkit::ScrollComponentImpl& GetImpl(Toolkit::ScrollComponent& scrollComponent)
-{
-  DALI_ASSERT_ALWAYS(scrollComponent);
-
-  Dali::RefObject& handle = scrollComponent.GetImplementation();
-
-  return static_cast<Toolkit::ScrollComponentImpl&>(handle);
-}
-
-inline const Toolkit::ScrollComponentImpl& GetImpl(const Toolkit::ScrollComponent& scrollComponent)
-{
-  DALI_ASSERT_ALWAYS(scrollComponent);
-
-  const Dali::RefObject& handle = scrollComponent.GetImplementation();
-
-  return static_cast<const Toolkit::ScrollComponentImpl&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_COMPONENT_IMPL_H__
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-component.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-component.cpp
deleted file mode 100644 (file)
index ebf8b63..0000000
+++ /dev/null
@@ -1,80 +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 <dali-toolkit/public-api/controls/scrollable/scroll-component.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-ScrollComponent::ScrollComponent()
-{
-}
-
-ScrollComponent::ScrollComponent( ScrollComponentImpl& implementation )
-: Control( implementation )
-{
-}
-
-ScrollComponent::ScrollComponent( Dali::Internal::CustomActor* actor )
-: Control( actor )
-{
-  VerifyCustomActorPointer<ScrollComponentImpl>( actor );
-}
-
-ScrollComponent::ScrollComponent( const ScrollComponent& scrollComponent )
-: Control( scrollComponent )
-{
-}
-
-ScrollComponent& ScrollComponent::operator=( const ScrollComponent& scrollComponent )
-{
-  if( &scrollComponent != this )
-  {
-    Control::operator=( scrollComponent );
-  }
-  return *this;
-}
-
-ScrollComponent ScrollComponent::DownCast( BaseHandle handle )
-{
-  return Control::DownCast<ScrollComponent, ScrollComponentImpl>(handle);
-}
-
-ScrollComponent::~ScrollComponent()
-{
-}
-
-void ScrollComponent::SetScrollConnector( ScrollConnector connector )
-{
-  GetImpl(*this).SetScrollConnector(connector);
-}
-
-ScrollConnector ScrollComponent::GetScrollConnector() const
-{
-  return GetImpl(*this).GetScrollConnector();
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-component.h b/dali-toolkit/public-api/controls/scrollable/scroll-component.h
deleted file mode 100644 (file)
index bdde4d8..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-#ifndef __DALI_TOOLKIT_SCROLL_COMPONENT_H__
-#define __DALI_TOOLKIT_SCROLL_COMPONENT_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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-class ScrollComponentImpl;
-class ScrollConnector;
-
-/**
- * Base class for scroll component handles.
- * Scroll-components such as scroll bars, indicators etc. are connected to scrollable containers via ScrollConnector.
- */
-class DALI_IMPORT_API ScrollComponent : public Control
-{
-
-public:
-  /**
-   * Create an uninitialized ScrollComponent; this can be initialized with ScrollComponent::New()
-   * Calling member functions with an uninitialized Dali::Object is not allowed.
-   */
-  ScrollComponent();
-
-  /**
-   * Copy constructor.
-   */
-  ScrollComponent( const ScrollComponent& scrollComponent );
-
-  /**
-   * Assignment operator.
-   */
-  ScrollComponent& operator=( const ScrollComponent& scrollComponent );
-
-  /**
-   * @brief Destructor
-   *
-   * This is non-virtual since derived Handle types must not contain data or virtual methods.
-   */
-  ~ScrollComponent();
-
-  /**
-   * Downcast an Object handle to ScrollComponent. If handle points to a ScrollComponent the
-   * downcast produces valid handle. If not the returned handle is left uninitialized.
-   * @param[in] handle Handle to an object
-   * @return handle to a ScrollComponent or an uninitialized handle
-   */
-  static ScrollComponent DownCast( BaseHandle handle );
-
-  /**
-   * @brief Sets the scroll connector.
-   *
-   * @param[in] connector The scroll-connector used to connect with scrollable container.
-   */
-  void SetScrollConnector( ScrollConnector connector );
-
-  /**
-   * @brief Retrieve the scroll connector.
-   *
-   * @return The scroll-connector used to connect with a scrollable container.
-   */
-  ScrollConnector GetScrollConnector() const;
-
-public: // Not intended for application developers
-
-  /**
-   * Creates a handle using the implementation.
-   * @param[in]  implementation The Control implementation.
-   */
-  DALI_INTERNAL ScrollComponent( ScrollComponentImpl& implementation );
-
-  /**
-   * Allows the creation of this Control from an Internal::CustomActor pointer.
-   * @param[in]  internal  A pointer to the internal CustomActor.
-   */
-  explicit DALI_INTERNAL ScrollComponent( Dali::Internal::CustomActor* internal );
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_COMPONENT_H__
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp
deleted file mode 100644 (file)
index ac15652..0000000
+++ /dev/null
@@ -1,110 +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.
- *
- */
-
-#include <dali-toolkit/public-api/controls/scrollable/scroll-connector.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-const char* const ScrollConnector::SCROLL_POSITION_PROPERTY_NAME = "scroll-position";
-const char* const ScrollConnector::OVERSHOOT_PROPERTY_NAME       = "overshoot";
-
-const Property::Index ScrollConnector::SCROLL_POSITION = Internal::ScrollConnector::SCROLL_POSITION;
-const Property::Index ScrollConnector::OVERSHOOT       = Internal::ScrollConnector::OVERSHOOT;
-
-ScrollConnector ScrollConnector::New()
-{
-  return ScrollConnector( Internal::ScrollConnector::New() );
-}
-
-ScrollConnector::ScrollConnector()
-{
-}
-
-ScrollConnector::ScrollConnector( const ScrollConnector& handle )
-: BaseHandle( handle )
-{
-}
-
-ScrollConnector::~ScrollConnector()
-{
-}
-
-ScrollConnector ScrollConnector::DownCast( BaseHandle handle )
-{
-  return ScrollConnector( dynamic_cast<Internal::ScrollConnector*>(handle.GetObjectPtr()) );
-}
-
-void ScrollConnector::SetScrollDomain( float min, float max, float length )
-{
-  GetImpl(*this).SetScrollDomain( min, max, length );
-}
-
-float ScrollConnector::GetMinLimit() const
-{
-  return GetImpl(*this).GetMinLimit();
-}
-
-float ScrollConnector::GetMaxLimit() const
-{
-  return GetImpl(*this).GetMaxLimit();
-}
-
-float ScrollConnector::GetContentLength() const
-{
-  return GetImpl(*this).GetContentLength();
-}
-
-Handle ScrollConnector::GetScrollPositionObject() const
-{
-  return GetImpl(*this).GetScrollPositionObject();
-}
-
-void ScrollConnector::SetScrollPosition( float position )
-{
-  GetImpl(*this).SetScrollPosition( position );
-}
-
-float ScrollConnector::GetScrollPosition() const
-{
-  return GetImpl(*this).GetScrollPosition();
-}
-
-ScrollConnector::ScrollPositionChangedSignalType& ScrollConnector::ScrollPositionChangedSignal()
-{
-  return GetImpl(*this).ScrollPositionChangedSignal();
-}
-
-ScrollConnector::DomainChangedSignalType& ScrollConnector::DomainChangedSignal()
-{
-  return GetImpl(*this).DomainChangedSignal();
-}
-
-ScrollConnector::ScrollConnector( Internal::ScrollConnector* impl )
-: BaseHandle( impl )
-{
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-connector.h b/dali-toolkit/public-api/controls/scrollable/scroll-connector.h
deleted file mode 100644 (file)
index e235de9..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-#ifndef __DALI_TOOLKIT_SCROLL_CONNECTOR_H__
-#define __DALI_TOOLKIT_SCROLL_CONNECTOR_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/object/handle.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal DALI_INTERNAL
-{
-class ScrollConnector;
-}
-
-/**
- * ScrollConnector is used to connect scrollable containers with components such as scroll bars, indicators etc.
- *
- * This basically consists of:
- *   - A "scroll-position" property which controls which part of the scrollable content is visible
- *   - The minimum/maximum limits of the scroll position, which corresponds to the start & end points of the scollable list etc.
- *   - An "overshoot" property which shows any attempts to exceed the start & end points.
- *   - The scrollable content size, which corresponds to the length of the scrollable content in the scrollable container in actor coordinates.
- *
- * The provider of the scrollable content is responsible for calling SetScrollDomain(). Scroll-bar components are then expected to
- * receive these values via the DOMAIN_CHANGED signal.
- *
- * The scroll-position property is accessible via GetScrollPositionObject(). This is intended to be shared by multiple controls
- * e.g. a list control may be scrolled by panning the list content, or indirectly by dragging a connected scroll-bar control.
- *
- * The overshoot property is intended for implementing 'end of list' style indicators. This property is expected to be in the range
- * -1 to 1, where -1 shows an attempt the scroll beyond the minimum limit, and 1 shows an attempt the scroll beyond the maximum limit.
- * Zero indicates normal scrolling i.e. when overshoot indicators should be hidden.
- *
- * Signals
- * | %Signal Name            | Method                             |
- * |-------------------------|------------------------------------|
- * | domain-changed          | @ref DomainChangedSignal()         |
- * | scroll-position-changed | @ref ScrollPositionChangedSignal() |
- */
-class DALI_IMPORT_API ScrollConnector : public BaseHandle
-{
-public:
-
-  static const char* const SCROLL_POSITION_PROPERTY_NAME; ///< This float "scroll-position" property is available via GetScrollPositionObject()
-  static const char* const OVERSHOOT_PROPERTY_NAME;       ///< This float "overshoot" property is available via GetScrollPositionObject()
-
-  static const Property::Index SCROLL_POSITION;           ///< The index of the "scroll-position" property
-  static const Property::Index OVERSHOOT;                 ///< The index of the "overshoot" property
-
-  // Signals
-  typedef Signal< void ( float min, float max, float size ) > DomainChangedSignalType;
-  typedef Signal< void ( float position ) > ScrollPositionChangedSignalType;
-
-  /**
-   * Create a ScrollConnector.
-   * @return A handle to a newly allocated ScrollConnector.
-   */
-  static ScrollConnector New();
-
-  /**
-   * Create an empty handle.
-   */
-  ScrollConnector();
-
-  /**
-   * Copy constructor.
-   * @param handle A handle to copy.
-   */
-  ScrollConnector( const ScrollConnector& handle );
-
-  /**
-   * @copydoc Dali::BaseHandle::operator=
-   */
-  using Dali::BaseHandle::operator=;
-
-  /**
-   * @brief Destructor
-   *
-   * This is non-virtual since derived Handle types must not contain data or virtual methods.
-   */
-  ~ScrollConnector();
-
-  /**
-   * @brief Downcast a BaseHandle to ScrollConnector handle.
-   * @return A handle to a ScrollConnector or an empty handle.
-   */
-  static ScrollConnector DownCast( BaseHandle handle );
-
-  /**
-   * @brief Set the scroll domain, corresponding to the start & end position, and size of the scrollable content in actor coordinates.
-   * @param[in] min The minimum scroll position limit.
-   * @param[in] max The maximum scroll position limit.
-   * @param[in] length The length of the scrollable content in actor coordinates.
-   */
-  void SetScrollDomain( float min, float max, float length );
-
-  /**
-   * @brief Retrieve the min limit.
-   * @return The minimum value.
-   */
-  float GetMinLimit() const;
-
-  /**
-   * @brief Retrieve the max limit.
-   * @return The maximum value.
-   */
-  float GetMaxLimit() const;
-
-  /**
-   * @brief Retrieve the length of the scrollable content in actor coordinates.
-   * @return The length of the scrollable content.
-   */
-  float GetContentLength() const;
-
-  /**
-   * @brief Set the scroll position.
-   *
-   * This will set the "scroll-position" property and emit the ScrollPositionChanged signal.
-   *
-   * @param[in] position The scroll position.
-   */
-  void SetScrollPosition( float position );
-
-  /**
-   * @brief Retrieve the scroll position.
-   * @return The scroll position.
-   */
-  float GetScrollPosition() const;
-
-  /**
-   * @brief Signal emitted after the SetScrollPosition() method has been called.
-   */
-  ScrollConnector::ScrollPositionChangedSignalType& ScrollPositionChangedSignal();
-
-  /**
-   * @brief Signal emitted after the SetScrollDomain() method has been called.
-   */
-  ScrollConnector::DomainChangedSignalType& DomainChangedSignal();
-
-  /**
-   * @brief Retrieve the object which provides the "scroll-position" property.
-   * @return The scroll-position object.
-   */
-  Handle GetScrollPositionObject() const;
-
-public: // Not intended for application developers
-
-  /**
-   * Creates a handle using the Toolkit::Internal implementation.
-   * @param[in] impl The Control implementation.
-   */
-  explicit DALI_INTERNAL ScrollConnector( Internal::ScrollConnector* impl );
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_CONNECTOR_H__
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.cpp
deleted file mode 100644 (file)
index a3edca4..0000000
+++ /dev/null
@@ -1,60 +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.
- *
- */
-
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-const std::string ScrollViewCarouselEffect::EFFECT_ACTIVATE( "ScrollViewCarouselEffect::EFFECT_ACTIVATE" );
-
-ScrollViewCarouselEffect ScrollViewCarouselEffect::New()
-{
-  return ScrollViewCarouselEffect(new Internal::ScrollViewCarouselEffect());
-}
-
-ScrollViewCarouselEffect::ScrollViewCarouselEffect()
-{
-
-}
-
-ScrollViewCarouselEffect::ScrollViewCarouselEffect(Internal::ScrollViewCarouselEffect *impl)
-: ScrollViewEffect(impl)
-{
-}
-
-ScrollViewCarouselEffect ScrollViewCarouselEffect::DownCast( BaseHandle handle )
-{
-  return ScrollViewCarouselEffect( dynamic_cast<Internal::ScrollViewCarouselEffect*>(handle.GetObjectPtr()) );
-}
-
-void ScrollViewCarouselEffect::ApplyToActor(Actor child, const Vector2& angleSwing)
-{
-  GetImpl(*this).ApplyToActor( child, angleSwing );
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-carousel-effect.h
deleted file mode 100644 (file)
index d7b47a1..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-#ifndef __DALI_TOOLKIT_SCROLL_VIEW_CAROUSEL_EFFECT_H__
-#define __DALI_TOOLKIT_SCROLL_VIEW_CAROUSEL_EFFECT_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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-
-namespace Dali
-{
-
-class Actor;
-
-namespace Toolkit
-{
-
-class ScrollViewEffect;
-
-namespace Internal DALI_INTERNAL
-{
-class ScrollViewCarouselEffect;
-}
-
-/**
- * ScrollView Carousel-Effect.
- *
- * This effect causes Actors to appear to move around around a carousel
- * It should be used on the following Actor hierarchy:
- *
- * ScrollView
- * |
- * Container
- * |
- * Child (1..n)
- *
- * You should ensure ScrollView's default constraints have been removed,
- * by calling ScrollView::RemoveConstraintsFromChildren() before applying
- * this effect to ScrollView.
- *
- * Manual operation:
- * upon adding children to container, the ApplyToActor(...) method should be called.
- *
- * Automatic operation:
- * not implemented.
- *
- * Notes:
- * * Assumes Actor's AnchorPoint = AnchorPoint::CENTER
- */
-class DALI_IMPORT_API ScrollViewCarouselEffect : public ScrollViewEffect
-{
-
-public:
-
-  static const std::string EFFECT_ACTIVATE;     ///< Activation property (a value between: 0.0 normal/no effect, 1.0 - full effect)
-
-public:
-
-  /**
-   * Create an initialized ScrollViewCarouselEffect.
-   * @return A handle to a newly allocated Dali resource.
-   */
-  static ScrollViewCarouselEffect New();
-
-  /**
-   * Create an uninitialized ScrollViewCarouselEffect; this can be initialized with ScrollViewCarouselEffect::New()
-   * Calling member functions with an uninitialized Toolkit::ScrollViewCarouselEffect is not allowed.
-   */
-  ScrollViewCarouselEffect();
-
-  /**
-   * Downcast an Object handle to ScrollViewCarouselEffect. If handle points to a ScrollViewCarouselEffect the
-   * downcast produces valid handle. If not the returned handle is left uninitialized.
-   * @param[in] handle Handle to an object
-   * @return handle to a ScrollViewCarouselEffect or an uninitialized handle
-   */
-  static ScrollViewCarouselEffect DownCast( BaseHandle handle );
-
-  /**
-   * Manually apply effect to an Actor.
-   * @param[in] child The child Actor to be affected by this effect.
-   * @param[in] angleSwing The maximum amount the child actor should
-   * rotate in radians for each axis (X and Y) as the page is scrolled.
-   */
-  void ApplyToActor(Actor child, const Vector2& angleSwing);
-
-protected:
-
-  /**
-   * This constructor is used by Dali New() methods.
-   * @param [in] impl A pointer to a newly allocated Dali resource
-   */
-  explicit DALI_INTERNAL ScrollViewCarouselEffect(Internal::ScrollViewCarouselEffect *impl);
-
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_VIEW_CAROUSEL_EFFECT_H__
index e7cec29..ac3b3ed 100644 (file)
@@ -32,7 +32,7 @@ namespace Toolkit
 
 void MoveActorConstraint( Vector3& current, const PropertyInputContainer& inputs )
 {
-  current += inputs[0]->GetVector3();
+  current += Vector3(inputs[0]->GetVector2());
 }
 
 void WrapActorConstraint( Vector3& position, const PropertyInputContainer& inputs )
@@ -41,8 +41,8 @@ void WrapActorConstraint( Vector3& position, const PropertyInputContainer& input
 
   if(wrap)
   {
-    const Vector3& min = inputs[3]->GetVector3();
-    const Vector3& max = inputs[4]->GetVector3();
+    const Vector2& min = inputs[3]->GetVector2();
+    const Vector2& max = inputs[4]->GetVector2();
 
     const Vector3& anchor = inputs[1]->GetVector3();
     const Vector3 scale = inputs[0]->GetVector3();
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.cpp
deleted file mode 100644 (file)
index 67eaa51..0000000
+++ /dev/null
@@ -1,70 +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.
- *
- */
-
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-ScrollViewCubeEffect ScrollViewCubeEffect::New()
-{
-  return ScrollViewCubeEffect(new Internal::ScrollViewCubeEffect());
-}
-
-ScrollViewCubeEffect::ScrollViewCubeEffect()
-{
-
-}
-
-ScrollViewCubeEffect::ScrollViewCubeEffect(Internal::ScrollViewCubeEffect *impl)
-: ScrollViewEffect(impl)
-{
-}
-
-ScrollViewCubeEffect ScrollViewCubeEffect::DownCast( BaseHandle handle )
-{
-  return ScrollViewCubeEffect( dynamic_cast<Internal::ScrollViewCubeEffect*>(handle.GetObjectPtr()) );
-}
-
-void ScrollViewCubeEffect::ApplyToActor(Actor child,
-                                        const Vector3& anchor,
-                                        const Vector2& angleSwing,
-                                        const Vector2& positionSwing)
-{
-  GetImpl(*this).ApplyToActor( child, anchor, angleSwing, positionSwing );
-}
-
-void ScrollViewCubeEffect::ApplyToActor(Actor child,
-                                        Actor parentPage,
-                                        const Vector3& anchor,
-                                        const Vector2& angleSwing,
-                                        const Vector2& positionSwing)
-{
-  GetImpl(*this).ApplyToActor( child, parentPage, anchor, angleSwing, positionSwing );
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-cube-effect.h
deleted file mode 100644 (file)
index c4fb603..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef __DALI_TOOLKIT_SCROLL_VIEW_CUBE_EFFECT_H__
-#define __DALI_TOOLKIT_SCROLL_VIEW_CUBE_EFFECT_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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-
-namespace Dali
-{
-
-class Actor;
-
-namespace Toolkit
-{
-
-class ScrollViewEffect;
-
-namespace Internal DALI_INTERNAL
-{
-class ScrollViewCubeEffect;
-}
-
-/**
- * @brief This effect causes Actors to appear to rotate around a 3D cube.
- *
- * It should be used on the following Actor hierarchy:
- *
- * ScrollView
- * |
- * Page (1..n)
- * |
- * Child (1..m)
- *
- * You should ensure ScrollView's default constraints have been removed,
- * by calling ScrollView::RemoveConstraintsFromChildren() before applying
- * this effect to ScrollView.
- *
- * Manual operation:
- * upon adding children to pages, the ApplyToActor(...) method should be called.
- *
- * Automatic operation:
- * not implemented.
- */
-class DALI_IMPORT_API ScrollViewCubeEffect : public ScrollViewEffect
-{
-
-public:
-
-  /**
-   * @brief Create an initialized ScrollViewCubeEffect.
-   *
-   * @return A handle to a newly allocated Dali resource.
-   */
-  static ScrollViewCubeEffect New();
-
-  /**
-   * @brief Create an uninitialized ScrollViewCubeEffect; this can be initialized with ScrollViewCubeEffect::New().
-   *
-   * Calling member functions with an uninitialized Toolkit::ScrollViewCubeEffect is not allowed.
-   */
-  ScrollViewCubeEffect();
-
-  /**
-   * @brief Downcast an Object handle to ScrollViewCubeEffect.
-   *
-   * If handle points to a ScrollViewCubeEffect the downcast produces
-   * valid handle. If not the returned handle is left uninitialized.
-   *
-   * @param[in] handle Handle to an object
-   * @return handle to a ScrollViewCubeEffect or an uninitialized handle
-   */
-  static ScrollViewCubeEffect DownCast( BaseHandle handle );
-
-  /**
-   * @brief Manually apply effect to an Actor.
-   *
-   * @param[in] child The child Actor to be affected by this effect.
-   * @param[in] anchor The anchor point that the child actor should
-   * rotate around when scrolling
-   * @param[in] angleSwing The maximum amount the child actor should
-   * rotate in radians for each axis (X and Y) as the page is scrolled.
-   * @param[in] positionSwing The maximum amount the child actor should
-   * move for each axis (X and Y) as the page is scrolled.
-   */
-  void ApplyToActor(Actor child,
-                    const Vector3& anchor,
-                    const Vector2& angleSwing,
-                    const Vector2& positionSwing);
-
-  /**
-   * @brief Manually apply effect to an Actor.
-   *
-   * @param[in] child The child Actor to be affected by this effect.
-   * @param[in] parentPage The parent page Actor to be used by this effect.
-   * @param[in] anchor The anchor point that the child actor should
-   * rotate around when scrolling
-   * @param[in] angleSwing The maximum amount the child actor should
-   * rotate in radians for each axis (X and Y) as the page is scrolled.
-   * @param[in] positionSwing The maximum amount the child actor should
-   * move for each axis (X and Y) as the page is scrolled.
-   */
-  void ApplyToActor(Actor child,
-                    Actor parentPage,
-                    const Vector3& anchor,
-                    const Vector2& angleSwing,
-                    const Vector2& positionSwing);
-
-protected:
-
-  /**
-   * @brief This constructor is used by Dali New() methods.
-   *
-   * @param [in] impl A pointer to a newly allocated Dali resource
-   */
-  explicit DALI_INTERNAL ScrollViewCubeEffect(Internal::ScrollViewCubeEffect *impl);
-
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_VIEW_CUBE_EFFECT_H__
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.cpp
deleted file mode 100644 (file)
index fa65001..0000000
+++ /dev/null
@@ -1,62 +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.
- *
- */
-
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-ScrollViewDepthEffect ScrollViewDepthEffect::New()
-{
-  return ScrollViewDepthEffect(new Internal::ScrollViewDepthEffect());
-}
-
-ScrollViewDepthEffect::ScrollViewDepthEffect()
-{
-
-}
-
-ScrollViewDepthEffect::ScrollViewDepthEffect(Internal::ScrollViewDepthEffect *impl)
-: ScrollViewEffect(impl)
-{
-}
-
-ScrollViewDepthEffect ScrollViewDepthEffect::DownCast( BaseHandle handle )
-{
-  return ScrollViewDepthEffect( dynamic_cast<Internal::ScrollViewDepthEffect*>(handle.GetObjectPtr()) );
-}
-
-void ScrollViewDepthEffect::ApplyToActor(Actor child,
-                                         const Vector2& positionExtent,
-                                         const Vector2& offsetExtent,
-                                         float positionScale,
-                                         float scaleExtent)
-{
-  GetImpl(*this).ApplyToActor( child, positionExtent, offsetExtent, positionScale, scaleExtent );
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-depth-effect.h
deleted file mode 100644 (file)
index 57bc1bc..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-#ifndef __DALI_TOOLKIT_SCROLL_VIEW_DEPTH_EFFECT_H__
-#define __DALI_TOOLKIT_SCROLL_VIEW_DEPTH_EFFECT_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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-
-namespace Dali
-{
-
-class Actor;
-
-namespace Toolkit
-{
-
-class ScrollViewEffect;
-
-namespace Internal DALI_INTERNAL
-{
-class ScrollViewDepthEffect;
-}
-
-/**
- * ScrollView Depth-Effect.
- *
- * This effect causes Actors to appear to scroll off the page
- * at different speeds.
- *
- * It should be used on the following Actor hierarchy:
- *
- * ScrollView
- * |
- * Page (1..n)
- * |
- * Child (1..m)
- *
- * You should ensure ScrollView's default constraints have been removed,
- * by calling ScrollView::RemoveConstraintsFromChildren() before applying
- * this effect to ScrollView.
- *
- * Manual operation:
- * upon adding children to pages, the ApplyToActor(...) method should be called.
- *
- * Automatic operation:
- * not implemented.
- */
-class DALI_IMPORT_API ScrollViewDepthEffect : public ScrollViewEffect
-{
-
-public:
-
-  /**
-   * Create an initialized ScrollViewDepthEffect.
-   * @return A handle to a newly allocated Dali resource.
-   */
-  static ScrollViewDepthEffect New();
-
-  /**
-   * Create an uninitialized ScrollViewDepthEffect; this can be initialized with ScrollViewDepthEffect::New()
-   * Calling member functions with an uninitialized Toolkit::ScrollViewDepthEffect is not allowed.
-   */
-  ScrollViewDepthEffect();
-
-  /**
-   * Downcast an Object handle to ScrollViewDepthEffect. If handle points to a ScrollViewDepthEffect the
-   * downcast produces valid handle. If not the returned handle is left uninitialized.
-   * @param[in] handle Handle to an object
-   * @return handle to a ScrollViewCubeEffect or an uninitialized handle
-   */
-  static ScrollViewDepthEffect DownCast( BaseHandle handle );
-
-  /**
-   * Manually apply effect to an Actor.
-   * @param[in] child The child Actor to be affected by this effect.
-   * @param[in] positionExtent Controls how much Actor's X and Y
-   * position affects their alpha function's exponent value
-   * @param[in] offsetExtent exponent offset for X and Y scrolling
-   * axes.
-   * @param[in] positionScale Changes the amount the page as a whole
-   * moves by.
-   * @param[in] scaleExtent Scale factor to reach when page is one whole
-   * page away from screen.
-   */
-  void ApplyToActor(Actor child,
-                    const Vector2& positionExtent,
-                    const Vector2& offsetExtent,
-                    float positionScale,
-                    float scaleExtent);
-
-protected:
-
-  /**
-   * This constructor is used by Dali New() methods.
-   * @param [in] impl A pointer to a newly allocated Dali resource
-   */
-  explicit DALI_INTERNAL ScrollViewDepthEffect(Internal::ScrollViewDepthEffect *impl);
-
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_VIEW_DEPTH_EFFECT_H__
index 3b2fb13..1295861 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/object/base-handle.h>
 
 namespace Dali
@@ -42,10 +41,6 @@ class ScrollViewWobbleEffect;
 class ScrollView;
 class ScrollViewEffect;
 
-typedef std::vector<ScrollViewEffect> ScrollViewEffectContainer; ///< Container of Dali::Toolkit::ScrollViewEffect%s
-typedef ScrollViewEffectContainer::iterator ScrollViewEffectIter; ///< Iterator for Dali::Toolkit::ScrollViewEffectContainer
-typedef ScrollViewEffectContainer::const_iterator ScrollViewEffectConstIter; ///< Const Iterator for Dali::Toolkit::ScrollViewEffectContainer
-
 /**
  * @brief ScrollView Effect base class, used to apply custom effects to a
  * ScrollView instance.
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.cpp
deleted file mode 100644 (file)
index 08ec102..0000000
+++ /dev/null
@@ -1,59 +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 <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h>
-
-// INTERNAL HEADERS
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-ScrollViewPageCarouselEffect ScrollViewPageCarouselEffect::New()
-{
-  return ScrollViewPageCarouselEffect(new Internal::ScrollViewPageCarouselEffect());
-}
-
-ScrollViewPageCarouselEffect::ScrollViewPageCarouselEffect()
-{
-
-}
-
-ScrollViewPageCarouselEffect::ScrollViewPageCarouselEffect(Internal::ScrollViewPageCarouselEffect *impl)
-: ScrollViewEffect(impl)
-{
-}
-
-ScrollViewPageCarouselEffect ScrollViewPageCarouselEffect::DownCast( BaseHandle handle )
-{
-  return ScrollViewPageCarouselEffect( dynamic_cast<Internal::ScrollViewPageCarouselEffect*>(handle.GetObjectPtr()) );
-}
-
-void ScrollViewPageCarouselEffect::ApplyToPage( Actor page, const Vector2& positionToPageSizeRatio )
-{
-  GetImpl(*this).ApplyToPage( page, positionToPageSizeRatio );
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h
deleted file mode 100644 (file)
index 357a5b4..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-#ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__
-#define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-
-namespace Dali
-{
-
-class Actor;
-
-namespace Toolkit
-{
-
-namespace Internal DALI_INTERNAL
-{
-class ScrollViewPageCarouselEffect;
-}
-
-/**
- * ScrollView Page Carousel Effect.
- *
- * This effect cause each page in a scroll-view to rotate round a 3D carousel.
- * It should be used on the following Actor hierarchy:
- *
- * ScrollView
- * |
- * Page (1..n)
- *
- * You should ensure ScrollView's default constraints have been removed,
- * by calling ScrollView::RemoveConstraintsFromChildren() before applying
- * this effect to ScrollView.
- *
- * Manual operation:
- * ApplyToPage(...) method should be called on every page.
- *
- * Automatic operation:
- * not implemented.
- */
-class DALI_IMPORT_API ScrollViewPageCarouselEffect : public ScrollViewEffect
-{
-
-public:
-
-  /**
-   * Create an initialized ScrollViewPageCarouselEffect.
-   * @return A handle to a newly allocated Dali resource.
-   */
-  static ScrollViewPageCarouselEffect New();
-
-  /**
-   * Create an uninitialized ScrollViewPageCarouselEffect; this can be initialized with ScrollViewPageCarouselEffect::New()
-   * Calling member functions with an uninitialized Toolkit::ScrollViewPageCarouselEffect is not allowed.
-   */
-  ScrollViewPageCarouselEffect();
-
-  /**
-   * Downcast an Object handle to ScrollViewPageCarouselEffect. If handle points to a ScrollViewPageCarouselEffect the
-   * downcast produces valid handle. If not the returned handle is left uninitialized.
-   * @param[in] handle Handle to an object
-   * @return handle to a ScrollViewPageCarouselEffect or an uninitialized handle
-   */
-  static ScrollViewPageCarouselEffect DownCast( BaseHandle handle );
-
-  /**
-   * Manually apply effect to a page in the scroll-view.
-   * @param[in] page The page to be affected by this effect.
-   * @param[in] positionToPageSizeRatio A ratio of the size of the page which determines the amount the page will move as it fades out.
-   *                                    Default is moving it by the page size.
-   */
-  void ApplyToPage( Actor page, const Vector2& positionToPageSizeRatio = Vector2::ONE );
-
-protected:
-
-  /**
-   * This constructor is used by Dali New() methods.
-   * @param [in] impl A pointer to a newly allocated Dali resource
-   */
-  explicit DALI_INTERNAL ScrollViewPageCarouselEffect( Internal::ScrollViewPageCarouselEffect *impl );
-
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CAROUSEL_EFFECT_H__
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-cube-effect.h>
+#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.h>
 
 // INTERNAL HEADERS
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.h>
+#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.h>
 
 using namespace Dali;
 
@@ -29,29 +29,28 @@ namespace Dali
 namespace Toolkit
 {
 
-ScrollViewPageCubeEffect ScrollViewPageCubeEffect::New()
+ScrollViewPagePathEffect ScrollViewPagePathEffect::New(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount)
 {
-  return ScrollViewPageCubeEffect(new Internal::ScrollViewPageCubeEffect());
+  return ScrollViewPagePathEffect(new Internal::ScrollViewPagePathEffect(path, forward, inputPropertyIndex, pageSize,pageCount));
 }
 
-ScrollViewPageCubeEffect::ScrollViewPageCubeEffect()
+ScrollViewPagePathEffect::ScrollViewPagePathEffect()
 {
-
 }
 
-ScrollViewPageCubeEffect::ScrollViewPageCubeEffect(Internal::ScrollViewPageCubeEffect *impl)
-: ScrollViewEffect(impl)
+ScrollViewPagePathEffect::ScrollViewPagePathEffect(Internal::ScrollViewPagePathEffect *impl)
+:ScrollViewEffect(impl)
 {
 }
 
-ScrollViewPageCubeEffect ScrollViewPageCubeEffect::DownCast( BaseHandle handle )
+ScrollViewPagePathEffect ScrollViewPagePathEffect::DownCast( BaseHandle handle )
 {
-  return ScrollViewPageCubeEffect( dynamic_cast<Internal::ScrollViewPageCubeEffect*>(handle.GetObjectPtr()) );
+  return ScrollViewPagePathEffect( dynamic_cast<Internal::ScrollViewPagePathEffect*>(handle.GetObjectPtr()) );
 }
 
-void ScrollViewPageCubeEffect::ApplyToPage(Actor page, const Vector2& angleSwing)
+void ScrollViewPagePathEffect::ApplyToPage( Actor page,  unsigned int pageOrder )
 {
-  GetImpl(*this).ApplyToPage( page, angleSwing );
+  GetImpl(*this).ApplyToPage( page, pageOrder );
 }
 
 } // namespace Toolkit
@@ -1,5 +1,5 @@
-#ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__
-#define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__
+#ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H__
+#define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H__
 
 /*
  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
@@ -25,20 +25,22 @@ namespace Dali
 {
 
 class Actor;
+class Path;
 
 namespace Toolkit
 {
 
 namespace Internal DALI_INTERNAL
 {
-class ScrollViewPageCubeEffect;
+class ScrollViewPagePathEffect;
 }
 
 /**
- * ScrollView Inner Cube-Effect.
+ * ScrollView Page Path Effect.
+ * This effect causes Actors to follow a given path. The opacity of the actor will be 0.0 at
+ * the beginning of the path and will go to 1.0 as it is approximating to half of the path to return
+ * to 0.0 at the end of the path
  *
- * This effect cause each page in a scroll-view to rotate round an inner 3D cube.
- * It should be used on the following Actor hierarchy:
  *
  * ScrollView
  * |
@@ -54,38 +56,42 @@ class ScrollViewPageCubeEffect;
  * Automatic operation:
  * not implemented.
  */
-class DALI_IMPORT_API ScrollViewPageCubeEffect : public ScrollViewEffect
+class DALI_IMPORT_API ScrollViewPagePathEffect : public ScrollViewEffect
 {
 
 public:
 
   /**
-   * Create an initialized ScrollViewPageCubeEffect.
+   * Create an initialized ScrollViewPagePathEffect.
+   * @param[in] path The path that will be used by the scroll effect
+   * @param[in] forward Vector in page object space which will be aligned with the tangent of the path
+   * @param[in] inputPropertyIndex Index of a property of the scroll-view which will be used as the input for the path.
+   * @param[in] pageSize Size of a page in the scrollview
+   * @param[in] pageCount Total number of pages in the scrollview
    * @return A handle to a newly allocated Dali resource.
    */
-  static ScrollViewPageCubeEffect New();
+  static ScrollViewPagePathEffect New(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount);
 
   /**
-   * Create an uninitialized ScrollViewPageCubeEffect; this can be initialized with ScrollViewPageCubeEffect::New()
-   * Calling member functions with an uninitialized Toolkit::ScrollViewPageCubeEffect is not allowed.
+   * Create an uninitialized ScrollViewPagePathEffect; this can be initialized with ScrollViewPagePathEffect::New()
+   * Calling member functions with an uninitialized Toolkit::ScrollViewPagePathEffect is not allowed.
    */
-  ScrollViewPageCubeEffect();
+  ScrollViewPagePathEffect();
 
   /**
-   * Downcast an Object handle to ScrollViewPageCubeEffect. If handle points to a ScrollViewPageCubeEffect the
+   * Downcast an Object handle to ScrollViewPagePathEffect. If handle points to a ScrollViewPagePathEffect the
    * downcast produces valid handle. If not the returned handle is left uninitialized.
    * @param[in] handle Handle to an object
-   * @return handle to a ScrollViewPageCubeEffect or an uninitialized handle
+   * @return handle to a ScrollViewPagePathEffect or an uninitialized handle
    */
-  static ScrollViewPageCubeEffect DownCast( BaseHandle handle );
+  static ScrollViewPagePathEffect DownCast( BaseHandle handle );
 
   /**
    * Manually apply effect to a page in the scroll-view.
    * @param[in] page The page to be affected by this effect.
-   * @param[in] angleSwing The maximum amount the child actor should
-   * rotate in radians for each axis (X and Y) as the page is scrolled.
+   * @param[in] pageOrder The order of the page in the scroll-view
    */
-  void ApplyToPage( Actor page, const Vector2& angleSwing );
+  void ApplyToPage( Actor page, unsigned int pageOrder );
 
 protected:
 
@@ -93,7 +99,7 @@ protected:
    * This constructor is used by Dali New() methods.
    * @param [in] impl A pointer to a newly allocated Dali resource
    */
-  explicit DALI_INTERNAL ScrollViewPageCubeEffect( Internal::ScrollViewPageCubeEffect *impl );
+  explicit DALI_INTERNAL ScrollViewPagePathEffect( Internal::ScrollViewPagePathEffect *impl );
 
 };
 
@@ -101,4 +107,4 @@ protected:
 
 } // namespace Dali
 
-#endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_CUBE_EFFECT_H__
+#endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_PATH_EFFECT_H__
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.cpp
deleted file mode 100644 (file)
index b76ed79..0000000
+++ /dev/null
@@ -1,59 +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 <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h>
-
-// INTERNAL HEADERS
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-spiral-effect-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-ScrollViewPageSpiralEffect ScrollViewPageSpiralEffect::New()
-{
-  return ScrollViewPageSpiralEffect(new Internal::ScrollViewPageSpiralEffect());
-}
-
-ScrollViewPageSpiralEffect::ScrollViewPageSpiralEffect()
-{
-
-}
-
-ScrollViewPageSpiralEffect::ScrollViewPageSpiralEffect(Internal::ScrollViewPageSpiralEffect *impl)
-: ScrollViewEffect(impl)
-{
-}
-
-ScrollViewPageSpiralEffect ScrollViewPageSpiralEffect::DownCast( BaseHandle handle )
-{
-  return ScrollViewPageSpiralEffect( dynamic_cast<Internal::ScrollViewPageSpiralEffect*>(handle.GetObjectPtr()) );
-}
-
-void ScrollViewPageSpiralEffect::ApplyToPage( Actor page, const Vector2& spiralAngle )
-{
-  GetImpl(*this).ApplyToPage( page, spiralAngle );
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h
deleted file mode 100644 (file)
index a31d6af..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-#ifndef __DALI_TOOLKIT_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__
-#define __DALI_TOOLKIT_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-
-namespace Dali
-{
-
-class Actor;
-
-namespace Toolkit
-{
-
-namespace Internal DALI_INTERNAL
-{
-class ScrollViewPageSpiralEffect;
-}
-
-/**
- * @brief This effect cause each page in a scroll-view to move along a spiral.
- *
- * It should be used on the following Actor hierarchy:
- *
- * ScrollView
- * |
- * Page (1..n)
- *
- * You should ensure ScrollView's default constraints have been removed,
- * by calling ScrollView::RemoveConstraintsFromChildren() before applying
- * this effect to ScrollView.
- *
- * Manual operation:
- * ApplyToPage(...) method should be called on every page.
- *
- * Automatic operation:
- * not implemented.
- */
-class DALI_IMPORT_API ScrollViewPageSpiralEffect : public ScrollViewEffect
-{
-
-public:
-
-  /**
-   * @brief Create an initialized ScrollViewPageSpiralEffect.
-   *
-   * @return A handle to a newly allocated Dali resource.
-   */
-  static ScrollViewPageSpiralEffect New();
-
-  /**
-   * @brief Create an uninitialized ScrollViewPageSpiralEffect; this can be initialized with ScrollViewPageSpiralEffect::New().
-   *
-   * Calling member functions with an uninitialized Toolkit::ScrollViewPageSpiralEffect is not allowed.
-   */
-  ScrollViewPageSpiralEffect();
-
-  /**
-   * @brief Downcast an Object handle to ScrollViewPageSpiralEffect.
-   *
-   * If handle points to a ScrollViewPageSpiralEffect the
-   * downcast produces valid handle. If not the returned handle is left uninitialized.
-   * @param[in] handle Handle to an object
-   * @return handle to a ScrollViewPageSpiralEffect or an uninitialized handle
-   */
-  static ScrollViewPageSpiralEffect DownCast( BaseHandle handle );
-
-  /**
-   * @brief Manually apply effect to a page in the scroll-view.
-   *
-   * @param[in] page The page to be affected by this effect.
-   * @param[in] spiralAngle The spirald angle (in radians).
-   *
-   * @note If the wrap mode of the scroll view is changed, then this needs to be called for every
-   * page again after removing the previous constraints.
-   */
-  void ApplyToPage( Actor page, const Vector2& spiralAngle );
-
-protected:
-
-  /**
-   * @brief This constructor is used by Dali New() methods.
-   *
-   * @param [in] impl A pointer to a newly allocated Dali resource
-   */
-  explicit DALI_INTERNAL ScrollViewPageSpiralEffect( Internal::ScrollViewPageSpiralEffect *impl );
-
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_VIEW_PAGE_SPIRAL_EFFECT_H__
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.cpp
deleted file mode 100644 (file)
index 6c9f882..0000000
+++ /dev/null
@@ -1,51 +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.
- *
- */
-
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-effect-impl.h>
-#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-wobble-effect-impl.h>
-
-using namespace Dali;
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-const std::string ScrollViewWobbleEffect::EFFECT_OVERSHOOT( "ScrollViewWobbleEffect::EFFECT_OVERSHOOT" );
-const std::string ScrollViewWobbleEffect::EFFECT_TIME( "ScrollViewWobbleEffect::EFFECT_TIME" );
-
-ScrollViewWobbleEffect ScrollViewWobbleEffect::New()
-{
-  return ScrollViewWobbleEffect(new Internal::ScrollViewWobbleEffect());
-}
-
-ScrollViewWobbleEffect::ScrollViewWobbleEffect()
-{
-
-}
-
-ScrollViewWobbleEffect::ScrollViewWobbleEffect(Internal::ScrollViewWobbleEffect *impl)
-: ScrollViewEffect(impl)
-{
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-wobble-effect.h
deleted file mode 100644 (file)
index 93a9b20..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef __DALI_TOOLKIT_SCROLL_VIEW_WOBBLE_EFFECT_H__
-#define __DALI_TOOLKIT_SCROLL_VIEW_WOBBLE_EFFECT_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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-class ScrollViewEffect;
-
-namespace Internal DALI_INTERNAL
-{
-class ScrollViewWobbleEffect;
-}
-
-/**
- * ScrollView Wobble-Effect.
- *
- * Using this effect, a %wobble% property is produced which swings
- * towards the origin in accordance to how the user pans the ScrollView.
- */
-class DALI_IMPORT_API ScrollViewWobbleEffect : public ScrollViewEffect
-{
-public:
-
-  static const std::string EFFECT_OVERSHOOT;
-  static const std::string EFFECT_TIME;
-
-public:
-
-  /**
-   * Create an initialized ScrollViewWobbleEffect.
-   * @return A handle to a newly allocated Dali resource.
-   */
-  static ScrollViewWobbleEffect New();
-
-  /**
-   * Create an uninitialized ScrollViewWobbleEffect; this can be initialized with ScrollViewWobbleEffect::New()
-   * Calling member functions with an uninitialized Toolkit::ScrollViewWobbleEffect is not allowed.
-   */
-  ScrollViewWobbleEffect();
-
-protected:
-
-  /**
-   * This constructor is used by Dali New() methods.
-   * @param [in] impl A pointer to a newly allocated Dali resource
-   */
-  explicit DALI_INTERNAL ScrollViewWobbleEffect(Internal::ScrollViewWobbleEffect *impl);
-
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_SCROLL_VIEW_WOBBLE_EFFECT_H__
index a61025e..158acfa 100644 (file)
@@ -283,16 +283,6 @@ unsigned int FixedRuler::GetTotalPages() const
 // ScrollView
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-const float ScrollView::DEFAULT_SLOW_SNAP_ANIMATION_DURATION(0.5f);
-const float ScrollView::DEFAULT_FAST_SNAP_ANIMATION_DURATION(0.25f);
-const float ScrollView::DEFAULT_SNAP_OVERSHOOT_DURATION(0.5f);
-const float ScrollView::DEFAULT_MAX_OVERSHOOT(100.0f);  // 100 pixels
-
-const float ScrollView::DEFAULT_AXIS_AUTO_LOCK_GRADIENT(0.36f);
-const float ScrollView::DEFAULT_FRICTION_COEFFICIENT(1.0f);
-const float ScrollView::DEFAULT_FLICK_SPEED_COEFFICIENT(1.0f);
-const float ScrollView::DEFAULT_MAX_FLICK_SPEED(3.0f);
-
 ScrollView::ScrollView()
 {
 }
@@ -506,12 +496,12 @@ void ScrollView::SetMouseWheelScrollDistanceStep(Vector2 step)
   GetImpl(*this).SetMouseWheelScrollDistanceStep(step);
 }
 
-Vector3 ScrollView::GetCurrentScrollPosition() const
+Vector2 ScrollView::GetCurrentScrollPosition() const
 {
   return GetImpl(*this).GetCurrentScrollPosition();
 }
 
-void ScrollView::SetScrollPosition(const Vector3& position)
+void ScrollView::SetScrollPosition(const Vector2& position)
 {
   GetImpl(*this).SetScrollPosition(position);
 }
@@ -521,28 +511,28 @@ unsigned int ScrollView::GetCurrentPage() const
   return GetImpl(*this).GetCurrentPage();
 }
 
-void ScrollView::ScrollTo(const Vector3 &position)
+void ScrollView::ScrollTo(const Vector2 &position)
 {
   GetImpl(*this).ScrollTo(position);
 }
 
-void ScrollView::ScrollTo(const Vector3 &position, float duration)
+void ScrollView::ScrollTo(const Vector2 &position, float duration)
 {
   GetImpl(*this).ScrollTo(position, duration);
 }
 
-void ScrollView::ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha)
+void ScrollView::ScrollTo(const Vector2 &position, float duration, AlphaFunction alpha)
 {
   GetImpl(*this).ScrollTo(position, duration, alpha);
 }
 
-void ScrollView::ScrollTo(const Vector3 &position, float duration,
+void ScrollView::ScrollTo(const Vector2 &position, float duration,
                           DirectionBias horizontalBias, DirectionBias verticalBias)
 {
   GetImpl(*this).ScrollTo(position, duration, horizontalBias, verticalBias);
 }
 
-void ScrollView::ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha,
+void ScrollView::ScrollTo(const Vector2 &position, float duration, AlphaFunction alpha,
                           DirectionBias horizontalBias, DirectionBias verticalBias)
 {
   GetImpl(*this).ScrollTo(position, duration, alpha, horizontalBias, verticalBias);
index e7b02f2..eebf4da 100644 (file)
@@ -46,13 +46,12 @@ enum ClampState
 };
 
 /**
- * @brief A 3 dimensional clamp
+ * @brief A 2 dimensional clamp
  */
-struct ClampState3D
+struct ClampState2D
 {
   ClampState x; ///< The clamp state of the x axis
   ClampState y; ///< The clamp state of the y axis
-  ClampState z; ///< The clamp state of the z axis
 };
 
 /**
@@ -132,6 +131,9 @@ public:
 
 };
 
+// Forward declare future extension interface
+class RulerExtension;
+
 /**
  * @brief Abstract class to define scroll axes.
  *
@@ -201,6 +203,13 @@ public:
    */
   virtual unsigned int GetTotalPages() const = 0;
 
+  /**
+   * @brief Gets the extension interface of the Ruler.
+   *
+   * @return The extension interface of the Ruler
+   */
+  virtual RulerExtension* GetExtension() { return NULL; }
+
 public:
 
   /**
@@ -407,19 +416,6 @@ class ScrollView;
  */
 class DALI_IMPORT_API ScrollView : public Scrollable
 {
-public:
-
-  // Default settings
-
-  static const float DEFAULT_SLOW_SNAP_ANIMATION_DURATION;              ///< Default Drag-Release animation time.
-  static const float DEFAULT_FAST_SNAP_ANIMATION_DURATION;              ///< Default Drag-Flick animation time.
-  static const float DEFAULT_SNAP_OVERSHOOT_DURATION;                   ///< Default Overshoot snapping animation time.
-  static const float DEFAULT_MAX_OVERSHOOT;                             ///< Default maximum allowed overshoot
-
-  static const float DEFAULT_AXIS_AUTO_LOCK_GRADIENT;                   ///< Default Axis-AutoLock gradient threshold. default is 0.36:1 (20 degrees)
-  static const float DEFAULT_FRICTION_COEFFICIENT;                      ///< Default Friction Co-efficient. (in stage diagonals per second)
-  static const float DEFAULT_FLICK_SPEED_COEFFICIENT;                   ///< Default Flick speed coefficient (multiples input touch velocity)
-  static const float DEFAULT_MAX_FLICK_SPEED;                           ///< Default Maximum flick speed. (in stage diagonals per second)
 
 public:
 
@@ -428,8 +424,8 @@ public:
    */
   struct ClampEvent
   {
-    ClampState3D scale;       ///< Clamp information for scale axes
-    ClampState3D position;    ///< Clamp information for position axes
+    ClampState2D scale;       ///< Clamp information for scale axes
+    ClampState2D position;    ///< Clamp information for position axes
     ClampState   rotation;    ///< Clamp information for rotation
   };
 
@@ -439,7 +435,7 @@ public:
   struct SnapEvent
   {
     SnapType type;    ///< Current snap commencing
-    Vector3 position; ///< Target snap position
+    Vector2 position; ///< Target snap position
     float duration;   ///< Duration of snap animation.
   };
 
@@ -459,27 +455,33 @@ public:
   {
     enum
     {
-      SCROLL_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scroll-position",       type Vector3
-      SCROLL_PRE_POSITION,                               ///< Property, name "scroll-pre-position",   type Vector3
-      OVERSHOOT_X,                                       ///< Property, name "overshoot-x",           type float
-      OVERSHOOT_Y,                                       ///< Property, name "overshoot-y",           type float
-      SCROLL_FINAL,                                      ///< Property, name "scroll-final",          type Vector3
-      WRAP,                                              ///< Property, name "wrap",                  type bool
-      PANNING,                                           ///< Property, name "panning",               type bool
-      SCROLLING,                                         ///< Property, name "scrolling",             type bool
-      SCROLL_DOMAIN_OFFSET,                              ///< Property, name "scroll-domain-offset"   type Vector3
-      SCROLL_POSITION_DELTA,                             ///< Property, name "scroll-position-delta"  type Vector3
-      START_PAGE_POSITION                                ///< Property, name "start-page-position"    type Vector3
+      SCROLL_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scroll-position",           type Vector2
+      SCROLL_PRE_POSITION,                               ///< Property, name "scroll-pre-position",       type Vector2
+      SCROLL_PRE_POSITION_X,                             ///< Property, name "scroll-pre-position-x",     type float
+      SCROLL_PRE_POSITION_Y,                             ///< Property, name "scroll-pre-position-y",     type float
+      SCROLL_PRE_POSITION_MAX,                           ///< Property, name "scroll-pre-position-max",   type Vector2
+      SCROLL_PRE_POSITION_MAX_X,                         ///< Property, name "scroll-pre-position-max-x", type float
+      SCROLL_PRE_POSITION_MAX_Y,                         ///< Property, name "scroll-pre-position-max-y", type float
+      OVERSHOOT_X,                                       ///< Property, name "overshoot-x",               type float
+      OVERSHOOT_Y,                                       ///< Property, name "overshoot-y",               type float
+      SCROLL_FINAL,                                      ///< Property, name "scroll-final",              type Vector2
+      SCROLL_FINAL_X,                                    ///< Property, name "scroll-final-x",            type float
+      SCROLL_FINAL_Y,                                    ///< Property, name "scroll-final-y",            type float
+      WRAP,                                              ///< Property, name "wrap",                      type bool
+      PANNING,                                           ///< Property, name "panning",                   type bool
+      SCROLLING,                                         ///< Property, name "scrolling",                 type bool
+      SCROLL_DOMAIN_SIZE,                                ///< Property, name "scroll-domain-size"         type Vector2
+      SCROLL_DOMAIN_SIZE_X,                              ///< Property, name "scroll-domain-size-x"       type float
+      SCROLL_DOMAIN_SIZE_Y,                              ///< Property, name "scroll-domain-size-y"       type float
+      SCROLL_DOMAIN_OFFSET,                              ///< Property, name "scroll-domain-offset"       type Vector2
+      SCROLL_POSITION_DELTA,                             ///< Property, name "scroll-position-delta"      type Vector2
+      START_PAGE_POSITION                                ///< Property, name "start-page-position"        type Vector3
     };
   };
 
-  typedef Signal< void ( const SnapEvent& ) > SnapStartedSignalType; ///< SnapStarted signal type
+  // Typedefs
 
-  /**
-   * @brief Signal emitted when the ScrollView has started to snap or flick (it tells the target
-   * position, scale, rotation for the snap or flick)
-   */
-  SnapStartedSignalType& SnapStartedSignal();
+  typedef Signal< void ( const SnapEvent& ) > SnapStartedSignalType; ///< SnapStarted signal type
 
 public:
 
@@ -862,7 +864,7 @@ public:
    *
    * @returns The current scroll position.
    */
-  Vector3 GetCurrentScrollPosition() const;
+  Vector2 GetCurrentScrollPosition() const;
 
   /**
    * @brief Sets the current scroll position, overriding current scroll animations. If panning is currently taking place
@@ -870,7 +872,7 @@ public:
    *
    * @param[in] position The new scroll position to set.
    */
-  void SetScrollPosition(const Vector3& position);
+  void SetScrollPosition(const Vector2& position);
 
   /**
    * @brief Retrieves current scroll page based on ScrollView
@@ -895,7 +897,7 @@ public:
    *
    * @param[in] position The position to scroll to.
    */
-  void ScrollTo(const Vector3 &position);
+  void ScrollTo(const Vector2& position);
 
   /**
    * @brief Scrolls View to position specified (contents will scroll to this position).
@@ -909,7 +911,7 @@ public:
    * @param[in] position The position to scroll to.
    * @param[in] duration The duration of the animation in seconds
    */
-  void ScrollTo(const Vector3 &position, float duration);
+  void ScrollTo(const Vector2& position, float duration);
 
   /**
    * @brief Scrolls View to position specified (contents will scroll to this position)
@@ -924,7 +926,7 @@ public:
    * @param[in] duration The duration of the animation in seconds
    * @param[in] alpha The alpha function to use
    */
-  void ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha);
+  void ScrollTo(const Vector2& position, float duration, AlphaFunction alpha);
 
   /**
    * @brief Scrolls View to position specified (contents will scroll to this position).
@@ -943,7 +945,7 @@ public:
    * @param[in] horizontalBias Whether to bias scrolling to left or right.
    * @param[in] verticalBias Whether to bias scrolling to top or bottom.
    */
-  void ScrollTo(const Vector3 &position, float duration,
+  void ScrollTo(const Vector2& position, float duration,
                 DirectionBias horizontalBias, DirectionBias verticalBias);
 
   /**
@@ -964,7 +966,7 @@ public:
    * @param[in] verticalBias Whether to bias scrolling to top or bottom.
    * @param[in] alpha Alpha function to use
    */
-  void ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha,
+  void ScrollTo(const Vector2& position, float duration, AlphaFunction alpha,
                 DirectionBias horizontalBias, DirectionBias verticalBias);
 
   /**
@@ -1110,6 +1112,21 @@ public:
    */
   void RemoveScrollingDirection( Radian direction );
 
+public: // Signals
+
+  /**
+   * @brief Signal emitted when the ScrollView has started to snap or flick (it tells the target
+   * position, scale, rotation for the snap or flick)
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName(const SnapEvent& event);
+   * @endcode
+   * @pre The Object has been initialized.
+   * @return The signal to connect to.
+   */
+  SnapStartedSignalType& SnapStartedSignal();
+
 public: // Not intended for application developers
 
   /**
index cbad738..9e1c66f 100644 (file)
@@ -79,19 +79,14 @@ Scrollable::ScrollCompletedSignalType& Scrollable::ScrollCompletedSignal()
   return GetImpl(*this).ScrollCompletedSignal();
 }
 
-bool Scrollable::IsScrollComponentEnabled(Scrollable::ScrollComponentType indicator) const
+bool Scrollable::IsOvershootEnabled() const
 {
-  return GetImpl(*this).IsScrollComponentEnabled(indicator);
+  return GetImpl(*this).IsOvershootEnabled();
 }
 
-void Scrollable::EnableScrollComponent(Scrollable::ScrollComponentType indicator)
+void Scrollable::SetOvershootEnabled(bool enable)
 {
-  GetImpl(*this).EnableScrollComponent(indicator);
-}
-
-void Scrollable::DisableScrollComponent(Scrollable::ScrollComponentType indicator)
-{
-  GetImpl(*this).DisableScrollComponent(indicator);
+  GetImpl(*this).SetOvershootEnabled(enable);
 }
 
 void Scrollable::SetOvershootEffectColor( const Vector4& color )
index a00aeff..b262212 100644 (file)
@@ -50,16 +50,6 @@ class DALI_IMPORT_API Scrollable : public Control
 public:
 
   /**
-   * @brief Scroll component types
-   */
-  enum ScrollComponentType
-  {
-    HorizontalScrollBar,
-    VerticalScrollBar,
-    OvershootIndicator,
-  };
-
-  /**
    * @brief The start and end property ranges for this control.
    */
   enum PropertyRange
@@ -83,35 +73,23 @@ public:
       OVERSHOOT_ANIMATION_SPEED,                     ///< Property, name "overshoot-animation-speed", @see SetOvershootAnimationSpeed(), type float
 
       // Animatable properties
-      SCROLL_RELATIVE_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scroll-relative-position", type Vector3
-      SCROLL_POSITION_MIN,                                        ///< Property, name "scroll-position-min",      type Vector3
-      SCROLL_POSITION_MAX,                                        ///< Property, name "scroll-position-max",      type Vector3
-      SCROLL_DIRECTION,                                           ///< Property, name "scroll-direction",         type Vector2
+      SCROLL_RELATIVE_POSITION = ANIMATABLE_PROPERTY_START_INDEX, ///< Property, name "scroll-relative-position", type Vector2
+      SCROLL_POSITION_MIN,                                        ///< Property, name "scroll-position-min",      type Vector2
+      SCROLL_POSITION_MIN_X,                                      ///< Property, name "scroll-position-min-x",    type float
+      SCROLL_POSITION_MIN_Y,                                      ///< Property, name "scroll-position-min-y",    type float
+      SCROLL_POSITION_MAX,                                        ///< Property, name "scroll-position-max",      type Vector2
+      SCROLL_POSITION_MAX_X,                                      ///< Property, name "scroll-position-max-x",    type float
+      SCROLL_POSITION_MAX_Y,                                      ///< Property, name "scroll-position-max-y",    type float
       CAN_SCROLL_VERTICAL,                                        ///< Property, name "can-scroll-vertical",      type bool
       CAN_SCROLL_HORIZONTAL                                       ///< Property, name "can-scroll-horizontal",    type bool
     };
   };
 
-public:
-
-  typedef Signal< void ( const Vector3& ) > ScrollStartedSignalType;   ///< ScrollStarted signal type
-  typedef Signal< void ( const Vector3& ) > ScrollCompletedSignalType; ///< ScrollCompleted signal type
-  typedef Signal< void ( const Vector3& ) > ScrollUpdatedSignalType;   ///< Scroll updated signal type
-
-  /**
-   * @brief Signal emitted when the Scrollable has moved (whether by touch or animation).
-   */
-  ScrollStartedSignalType& ScrollStartedSignal();
-
-  /**
-   * @brief Signal emitted when the Scrollable has moved (whether by touch or animation).
-   */
-  ScrollUpdatedSignalType& ScrollUpdatedSignal();
+  // Typedefs
 
-  /**
-   * @brief Signal emitted when the Scrollable has completed movement (whether by touch or animation).
-   */
-  ScrollCompletedSignalType& ScrollCompletedSignal();
+  typedef Signal< void ( const Vector2& ) > ScrollStartedSignalType;   ///< ScrollStarted signal type
+  typedef Signal< void ( const Vector2& ) > ScrollCompletedSignalType; ///< ScrollCompleted signal type
+  typedef Signal< void ( const Vector2& ) > ScrollUpdatedSignalType;   ///< Scroll updated signal type
 
 public:
 
@@ -157,26 +135,18 @@ public:
   static Scrollable DownCast( BaseHandle handle );
 
   /**
-   * @brief Checks if a ScrollComponent has been enabled or not.
-   *
-   * @param[in] type The Scroll Component Type to check
-   * @return True (if Enabled)
-   */
-  bool IsScrollComponentEnabled(Scrollable::ScrollComponentType type) const;
-
-  /**
-   * @brief Enables a ScrollComponent.
+   * @brief Checks if scroll overshoot has been enabled or not.
    *
-   * @param[in] type The Scroll Component Type to enable
+   * @return Whether the scroll obvershoot is enabled
    */
-  void EnableScrollComponent(Scrollable::ScrollComponentType type);
+  bool IsOvershootEnabled() const;
 
   /**
-   * @brief Disables a ScrollComponent.
+   * @brief Sets whether to enables or disable scroll overshoot.
    *
-   * @param[in] type The Scroll Component Type to disable
+   * @param[in] enable Whether to enable the scroll obvershoot or not
    */
-  void DisableScrollComponent(Scrollable::ScrollComponentType type);
+  void SetOvershootEnabled(bool enable);
 
   /**
    * @brief Set the color of the overshoot effect.
@@ -204,6 +174,44 @@ public:
    */
   float GetOvershootAnimationSpeed() const;
 
+public: // Signals
+
+  /**
+   * @brief Signal emitted when the Scrollable has moved (whether by touch or animation).
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName(const Vector2& currentScrollPosition);
+   * @endcode
+   * @pre The Object has been initialized.
+   * @return The signal to connect to.
+   */
+  ScrollStartedSignalType& ScrollStartedSignal();
+
+  /**
+   * @brief Signal emitted when the Scrollable has moved (whether by touch or animation).
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName(const Vector2& currentScrollPosition);
+   * @endcode
+   * @pre The Object has been initialized.
+   * @return The signal to connect to.
+   */
+  ScrollUpdatedSignalType& ScrollUpdatedSignal();
+
+  /**
+   * @brief Signal emitted when the Scrollable has completed movement (whether by touch or animation).
+   *
+   * A callback of the following type may be connected:
+   * @code
+   *   void YourCallbackName(const Vector2& currentScrollPosition);
+   * @endcode
+   * @pre The Object has been initialized.
+   * @return The signal to connect to.
+   */
+  ScrollCompletedSignalType& ScrollCompletedSignal();
+
 public: // Not intended for application developers
 
   /**
index f9142fe..63bb089 100644 (file)
@@ -165,7 +165,6 @@ public:
    * @param [in] child The child.
    * @post The child will be referenced by its parent. This means that the child will be kept alive,
    * even if the handle passed into this method is reset or destroyed.
-   * @post This may invalidate ActorContainer iterators.
    */
   void Add(Actor child);
 
@@ -175,7 +174,6 @@ public:
    * @pre This Actor (the parent) has been initialized.
    * @pre The child actor is not the same as the parent actor.
    * @param [in] child The child.
-   * @post This may invalidate ActorContainer iterators.
    */
   void Remove(Actor child);
 
index 3222c87..d1c1763 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 40;
+const unsigned int TOOLKIT_MICRO_VERSION = 41;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 0cf1e1f..9493cef 100755 (executable)
@@ -14,8 +14,6 @@ public_api_src_files = \
   $(public_api_src_dir)/controls/default-controls/check-button-factory.cpp \
   $(public_api_src_dir)/controls/default-controls/push-button-factory.cpp \
   $(public_api_src_dir)/controls/default-controls/solid-color-actor.cpp \
-  $(public_api_src_dir)/controls/navigation-frame/navigation-control.cpp \
-  $(public_api_src_dir)/controls/navigation-frame/page.cpp \
   $(public_api_src_dir)/controls/magnifier/magnifier.cpp \
   $(public_api_src_dir)/controls/page-turn-view/page-factory.cpp \
   $(public_api_src_dir)/controls/page-turn-view/page-turn-landscape-view.cpp \
@@ -23,25 +21,14 @@ public_api_src_files = \
   $(public_api_src_dir)/controls/page-turn-view/page-turn-view.cpp \
   $(public_api_src_dir)/controls/popup/popup.cpp \
   $(public_api_src_dir)/controls/scroll-bar/scroll-bar.cpp \
-  $(public_api_src_dir)/controls/scrollable/item-view/depth-layout.cpp \
-  $(public_api_src_dir)/controls/scrollable/item-view/grid-layout.cpp \
+  $(public_api_src_dir)/controls/scrollable/item-view/default-item-layout.cpp \
   $(public_api_src_dir)/controls/scrollable/item-view/item-factory.cpp \
   $(public_api_src_dir)/controls/scrollable/item-view/item-layout.cpp \
   $(public_api_src_dir)/controls/scrollable/item-view/item-view.cpp \
-  $(public_api_src_dir)/controls/scrollable/item-view/spiral-layout.cpp \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-carousel-effect.cpp \
   $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-constraints.cpp \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-cube-effect.cpp \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-depth-effect.cpp \
   $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-effect.cpp \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.cpp \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-cube-effect.cpp \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.cpp \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-wobble-effect.cpp \
+  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-path-effect.cpp \
   $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view.cpp \
-  $(public_api_src_dir)/controls/scrollable/scroll-connector.cpp \
-  $(public_api_src_dir)/controls/scrollable/scroll-component-impl.cpp \
-  $(public_api_src_dir)/controls/scrollable/scroll-component.cpp \
   $(public_api_src_dir)/controls/scrollable/scrollable.cpp \
   $(public_api_src_dir)/controls/shadow-view/shadow-view.cpp \
   $(public_api_src_dir)/controls/slider/slider.cpp \
@@ -142,13 +129,11 @@ public_api_image_view_header_files = \
   $(public_api_src_dir)/controls/image-view/masked-image-view.h
 
 public_api_item_view_header_files = \
-  $(public_api_src_dir)/controls/scrollable/item-view/depth-layout.h \
-  $(public_api_src_dir)/controls/scrollable/item-view/grid-layout.h \
+  $(public_api_src_dir)/controls/scrollable/item-view/default-item-layout.h \
   $(public_api_src_dir)/controls/scrollable/item-view/item-factory.h \
   $(public_api_src_dir)/controls/scrollable/item-view/item-layout.h \
   $(public_api_src_dir)/controls/scrollable/item-view/item-view-declarations.h \
-  $(public_api_src_dir)/controls/scrollable/item-view/item-view.h \
-  $(public_api_src_dir)/controls/scrollable/item-view/spiral-layout.h
+  $(public_api_src_dir)/controls/scrollable/item-view/item-view.h
 
 public_api_magnifier_header_files = \
   $(public_api_src_dir)/controls/magnifier/magnifier.h
@@ -163,24 +148,15 @@ public_api_popup_header_files = \
   $(public_api_src_dir)/controls/popup/popup.h
 
 public_api_scrollable_header_files = \
-  $(public_api_src_dir)/controls/scrollable/scroll-component-impl.h \
-  $(public_api_src_dir)/controls/scrollable/scroll-component.h \
-  $(public_api_src_dir)/controls/scrollable/scroll-connector.h \
   $(public_api_src_dir)/controls/scrollable/scrollable.h
 
 public_api_scroll_bar_header_files = \
   $(public_api_src_dir)/controls/scroll-bar/scroll-bar.h
 
 public_api_scroll_view_header_files = \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-carousel-effect.h \
   $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-constraints.h \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-cube-effect.h \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-depth-effect.h \
   $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-effect.h \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-carousel-effect.h \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-cube-effect.h \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-spiral-effect.h \
-  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-wobble-effect.h \
+  $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view-page-path-effect.h \
   $(public_api_src_dir)/controls/scrollable/scroll-view/scroll-view.h
 
 public_api_slider_header_files = \
@@ -203,11 +179,6 @@ public_api_text_controls_header_files = \
 public_api_tool_bar_header_files = \
   $(public_api_src_dir)/controls/tool-bar/tool-bar.h
 
-public_api_navigation_frame_header_files = \
-  $(public_api_src_dir)/controls/navigation-frame/navigation-bar-style.h \
-  $(public_api_src_dir)/controls/navigation-frame/navigation-control.h \
-  $(public_api_src_dir)/controls/navigation-frame/page.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 b2dc756..c24c93e 100644 (file)
@@ -19,7 +19,7 @@
 #include <dali-toolkit/public-api/focus-manager/focus-manager.h>
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/adaptor-framework/singleton-service.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/focus-manager/focus-manager-impl.h>
index c3df2f0..f851a12 100644 (file)
@@ -19,7 +19,7 @@
 #include "keyinput-focus-manager.h"
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/singleton-service.h>
+#include <dali/devel-api/adaptor-framework/singleton-service.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/focus-manager/keyinput-focus-manager-impl.h>
diff --git a/docs/content/images/example-documentation/example-code.png b/docs/content/images/example-documentation/example-code.png
new file mode 100644 (file)
index 0000000..7d9cab6
Binary files /dev/null and b/docs/content/images/example-documentation/example-code.png differ
diff --git a/docs/content/images/javascript-wrapping-guide/adding-function.png b/docs/content/images/javascript-wrapping-guide/adding-function.png
new file mode 100644 (file)
index 0000000..9d1c311
Binary files /dev/null and b/docs/content/images/javascript-wrapping-guide/adding-function.png differ
diff --git a/docs/content/images/javascript-wrapping-guide/base-wrapped-types.png b/docs/content/images/javascript-wrapping-guide/base-wrapped-types.png
new file mode 100644 (file)
index 0000000..6fd2707
Binary files /dev/null and b/docs/content/images/javascript-wrapping-guide/base-wrapped-types.png differ
diff --git a/docs/content/images/javascript-wrapping-guide/constructors.png b/docs/content/images/javascript-wrapping-guide/constructors.png
new file mode 100644 (file)
index 0000000..07c4111
Binary files /dev/null and b/docs/content/images/javascript-wrapping-guide/constructors.png differ
diff --git a/docs/content/images/javascript-wrapping-guide/folder-view.png b/docs/content/images/javascript-wrapping-guide/folder-view.png
new file mode 100644 (file)
index 0000000..2e12028
Binary files /dev/null and b/docs/content/images/javascript-wrapping-guide/folder-view.png differ
diff --git a/docs/content/images/javascript-wrapping-guide/high-level-design.png b/docs/content/images/javascript-wrapping-guide/high-level-design.png
new file mode 100644 (file)
index 0000000..e1acc8f
Binary files /dev/null and b/docs/content/images/javascript-wrapping-guide/high-level-design.png differ
diff --git a/docs/content/images/javascript-wrapping-guide/plugin-creation.png b/docs/content/images/javascript-wrapping-guide/plugin-creation.png
new file mode 100644 (file)
index 0000000..e9f26be
Binary files /dev/null and b/docs/content/images/javascript-wrapping-guide/plugin-creation.png differ
diff --git a/docs/content/images/javascript-wrapping-guide/plugin-execution.png b/docs/content/images/javascript-wrapping-guide/plugin-execution.png
new file mode 100644 (file)
index 0000000..8f3006c
Binary files /dev/null and b/docs/content/images/javascript-wrapping-guide/plugin-execution.png differ
diff --git a/docs/content/images/javascript-wrapping-guide/scripting-overview.png b/docs/content/images/javascript-wrapping-guide/scripting-overview.png
new file mode 100644 (file)
index 0000000..0dea37b
Binary files /dev/null and b/docs/content/images/javascript-wrapping-guide/scripting-overview.png differ
diff --git a/docs/content/images/performance/update-render.png b/docs/content/images/performance/update-render.png
new file mode 100644 (file)
index 0000000..018f6a8
Binary files /dev/null and b/docs/content/images/performance/update-render.png differ
diff --git a/docs/content/images/screen-shot.png b/docs/content/images/screen-shot.png
new file mode 100644 (file)
index 0000000..25659d9
Binary files /dev/null and b/docs/content/images/screen-shot.png differ
diff --git a/docs/content/images/screenshot.png b/docs/content/images/screenshot.png
deleted file mode 100644 (file)
index 913d9f0..0000000
Binary files a/docs/content/images/screenshot.png and /dev/null differ
diff --git a/docs/content/images/texture-atlas/example-javascript-code.jpg b/docs/content/images/texture-atlas/example-javascript-code.jpg
new file mode 100644 (file)
index 0000000..a4f0805
Binary files /dev/null and b/docs/content/images/texture-atlas/example-javascript-code.jpg differ
diff --git a/docs/content/main-page.h b/docs/content/main-page.h
deleted file mode 100644 (file)
index f74e830..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*! \mainpage
- *
- * \section mainintro_sec Introduction
- *
- * It is a quick and easy way of allowing developers to create Rich UI Applications like Home
- * screen, Gallery, Music player, Games, Maps...
- *
- * DALI is based on OpenGL ES 2.0, however it hides the complexity of
- * the OpenGL API from developers and provides a clean cross-platform C++ framework.
- *
- * \section Introduction Introduction
- * - \link fundamentals Dali Fundamentals \endlink
- * - \link dali-application Dali Application and Adaptor \endlink
- * - \link hello-world Hello World - explained \endlink
- *
- * \section Actors Actors
- * - \link image-mesh-actor Image and Mesh actors \endlink
- * - \link event-system Event Handling \endlink
- * - \link custom-actor Custom Actor \endlink
- *
- * \section ShaderEffects Shader Effects
- * - \link shader-intro Shader Effects\endlink
- *
- * \section Animation Animation
- * - \link animation-example Example and Usage\endlink
- * - \link animation-rotation Rotation with quaternions \endlink
- * - \link animation-shader Shader Animation \endlink
- * - \link animation-multi-threading-notes Multi-threading Notes \endlink
- *
- * \section Constraints
- * - \link constraints Constraints \endlink
- *
- * \section SizeNegotiation Size Negotiation
- * - \link size-negotiation Size Negotiation \endlink
- *
- * \section UIControls UI Controls
- * - \link text-label Text Label \endlink
- * - \link item-view Item View \endlink
- * - \link scroll-view Scroll View \endlink
- * - \link size-negotiation-controls Size Negotiation for Controls \endlink
- * - \link type-registration Type Registration \endlink
- * - \link properties Properties \endlink
- * - \link background Background \endlink
- *
- * \section Dynamics Dynamics
- * - \link dynamics-intro Introduction to Dynamics\endlink
- * - \link dynamics-initialization Initializing the Simulation\endlink
- * - \link dynamics-bodies Bodies - adding and controlling dynamic objects \endlink
- * - \link dynamics-joints Joints - linking objects\endlink
- * - \link dynamics-collisions Collision Detection and Filtering\endlink
- *
- * \section Scripting
- * - \link script-overview Overview \endlink
- * - \link script-hello Hello World in script \endlink
- * - \link handle-body-idiom Handle – body idiom \endlink
- *
- * \section Rendering
- * - \link viewing-modes Viewing modes \endlink
- *
- * \section Profiling
- * - \link resource-tracking Resource Tracking \endlink
- * - \link performance-profiling Performance Profiling \endlink
- *
- * \section Performance
- * - \link performance-tips Performance Tips \endlink
- * - \link texture-atlases Texture Atlases  \endlink
- * - \link Texture_Compression Compressing Textures \endlink
- *
- * \section Testing
- * See [Automated Tests](@ref auto_testing) for instructions.
- */
-
-/*! \page scene-graph
- *
- * \section scene_intro What is a scene graph?
- * From wikipedia...
- * A scene graph is a collection of nodes in a graph or tree structure.
- * A node may have many children but often only a single parent,
- * with the effect of a parent applied to all its child nodes;
- * an operation performed on a group automatically propagates
- * its effect to all of its members. In many programs, associating
- * a geometrical transformation matrix (see also transformation and matrix)
- * at each group level and concatenating such matrices together is an
- * efficient and natural way to process such operations. A common feature,
- * for instance, is the ability to group related shapes/objects into a
- * compound object that can then be moved, transformed, selected,
- * etc. as easily as a single object.
- *
- * \section scene_dali How does this relate to the Dali public API?
- *
- * Actors are effectively nodes that receive input (touch events) and act as a
- * container for draw-able elements (which are also nodes) and other actors.
- *
- * For example a Button actor will be an actor with several elements such as button background,
- * text label and button face. When the actor is moved around, it's child elements will move with it.
- * When the button is pressed, the actor will receive an event and adjust the color of its button face
- * element.
- *
- * \section scene_internal Why does Dali internally have a second scene graph?
- * Actors and elements are contained in a scene graph which deals with input, layout and some animation
- * it doesn't perform any drawing.
- *
- * All the drawing is done via the Render Manager which has it's own render scene graph, where it's nodes
- * are just for drawing things like image/text and moving them around. So when you create an Image element
- * it will ask the RenderManager to create an Image node. The separation allows the RenderManager to
- * run in a separate thread to maintain a high frame rate, without being slowed down by any logic
- * performed on the actor/element side.
- *
- */
diff --git a/docs/content/main.md b/docs/content/main.md
new file mode 100644 (file)
index 0000000..e76d89e
--- /dev/null
@@ -0,0 +1,94 @@
+# DALi introduction
+
+## DALi 3D ( Dynamic Animation Library )
+
+DALi is a quick and easy way of allowing developers to create Rich UI Applications like:
+
+ + Image & Video galleries
+ + Music players
+ + Games
+ + Maps
+ + Homescreens / launch pads
+ + Advanced watch faces for wearable devices
+
+DALi is based on OpenGL ES 2.0 & 3.0, however it hides the complexity of
+the OpenGL API from developers and provides a clean cross-platform C++ & JavaScript framework.
+
++ Create Images, Text and Meshes
++ Create shaders using GLSL
++ Provide multiple cameras and render targets
++ Provides Layers to aid in 2D UI layout
++ Easy to use Animation framework
++ Automatic background loading of resources ( images / text / meshes )
++ Runs all animations in a seperate thread. This helps maintain 60 FPS even if JavaScript is performing a long operation ( e.g. Garbage Collection ).
++ Provides keyboard / touch / mouse handling
+
+![ ](screen-shot.png)
+
+## Introduction
+- \link fundamentals Dali Fundamentals \endlink
+- \link dali-application Dali Application and Adaptor \endlink
+- \link hello-world Hello World - explained \endlink
+- \link handle-body-idiom Handle – body idiom \endlink
+
+## Actors
+ - \link image-mesh-actor Image and Mesh actors \endlink
+ - \link event-system Event Handling \endlink
+ - \link custom-actor Custom Actor \endlink
+
+ ## ShaderEffects
+ - \link shader-intro Shader Effects\endlink
+
+ ## Animation
+ - \link animation-example Example and Usage\endlink
+ - \link animation-rotation Rotation with quaternions \endlink
+ - \link animation-shader Shader Animation \endlink
+ - \link animation-multi-threading-notes Multi-threading Notes \endlink
+
+ ## Constraints
+ - \link constraints Introduction to Constraints \endlink
+
+## Size Negotation
+ - \link size-negotiation Size Negotiation \endlink
+
+ ## UI Controls
+ - \link text-label Text Label\endlink
+ - \link scroll-view Scroll View \endlink
+ - \link size-negotiation-controls Size Negotiation for Controls \endlink
+ - \link type-registration Type Registration \endlink
+ - \link properties Properties \endlink
+ - \link background Background \endlink
+
+ ## Dynamics
+ - \link dynamics-intro Introduction to Dynamics\endlink
+ - \link dynamics-initialization Initializing the Simulation\endlink
+ - \link dynamics-bodies Bodies - adding and controlling dynamic objects \endlink
+ - \link dynamics-joints Joints - linking objects\endlink
+ - \link dynamics-collisions Collision Detection and Filtering\endlink
+
+ ## Scripting
+ - \link scriptoverview JSON and JavaScript Overview \endlink
+ - \link script-json-specification JSON Specification\endlink
+ - \link script-hello Hello World in script \endlink
+ - \link javascriptwrapping JavaScript Wrapping Guide for DALi developers\endlink
+
+ ## Rendering
+ - \link viewing-modes Viewing modes \endlink
+
+ ## Profiling
+ - \link performanceprofiling Performance Profiling \endlink
+ - \link resourcetracking Resource Tracking \endlink
+
+ ## Performance
+ - \link performancetips Performance Tips \endlink
+ - \link textureatlases Texture Atlases  \endlink
+ - \link texturecompression Compressing Textures \endlink
+
+## Testing
+ See [Automated Tests](@ref auto_testing) for instructions.
+
+
+## Modifying this documentation
+- \link documentationguide Modifying this documentation \endlink
+
+
index c17b910..07cc934 100644 (file)
@@ -149,7 +149,7 @@ void OrientationChanged(const Orientation& orientation)
 int main(int argc, char **argv)
 {
   Application app = Application::New(&argc, &argv);
-  app.GetOrientation().SignalChanged().Connect(&OrientationChanged);
+  app.GetWindow().GetOrientation().SignalChanged().Connect(&OrientationChanged);
 }
 @endcode
 
diff --git a/docs/content/programming-guide/performance-profiling.h b/docs/content/programming-guide/performance-profiling.h
deleted file mode 100644 (file)
index 8e70c5d..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*! \page performance-profiling Performance Profiling
- *
- * <h2 class="pg">Enable Logging</h2>
- *
- * Setting DALI_LOG_PERFORMANCE environment variable will enable performance profiling <br>
- * It uses a bit mask to decide what to log. <br>
- * The log options are:<br>
- * \code
- * Bit 0 = Log update and render threads  (e.g.  DALI_LOG_PERFORMANCE=1 dali-demo)
- * Bit 1 = Log event process time         (e.g.  DALI_LOG_PERFORMANCE=2 dali-demo)
- * Bit 2 = Log Dali markers to trace file (e.g.  DALI_LOG_PERFORMANCE=4 dali-demo)
- *
- * To log both update, render and event times, then combine bits 0 and 1.<br>
- * DALI_LOG_PERFORMANCE=3 dali-demo
- * \endcode
- *
- *
- * <h2 class="pg">Background</h2>
- * The Dali rendering pipeline has 2 stages.
- * Each stage is typically run once per frame.
- * <h3> 1. Update </h3>
- * <ul>
- * <li> Run animations</li>
- * <li> Run constraints</li>
- * <li> Run physics</li>
- * <li> Update the scene-graph</li>
- * </ul>
- * <h3> 2. Render </h3>
- * <ul>
- * <li> Upload 3D data using OpenGL ( textures, vertex buffers etc).</li>
- * <li> Draw the scene using OpenGL</li>
- * </ul>
- *
- *
- * To run at 60 FPS (16 milliseconds per frame), it is recommended to stay below the following times:
- * <ul>
- * <li> Update: 4 milliseconds</li>
- * <li> Render: 4 milliseconds</li>
- * </ul>
- *
- * This will leave enough time for the output to be composited (if the system uses a compositor) and to avoid using
- * too much CPU power.
- * The main Dali application thread which deals with event processing is independent of the update / render threads. <br>
- * This means animations won't stop if the main thread decides to do a long operation like downloading a file from the internet.
- *
- * Performance logging uses Dali log output which on Tizen is dlog, but this can also be used on desktop by redirecting stderr to a file.<br>
- *
- * Example:
- * \code
- * $ export DALI_LOG_PERFORMANCE=1
- * $ dali-demo
- * $
- * $ ...
- * $ I/DALI ( 5692): tizen-logging.cpp: LogMessage(40) > Update , min 0.59 ms, max 6.43 ms, total (3.4 secs), avg 1.26 ms
- * $ I/DALI ( 5692): tizen-logging.cpp: LogMessage(40) > Render , min 1.67 ms, max 5.01 ms, total (4.5 secs), avg 3.71 ms
- * \endcode
- *
- * If nothing is animating Dali will enter a paused state to save power. At this
- * point nothing will be logged.
- *
- *
- *  <h2 class="pg">Application profiling</h2>
- *
- *  The main application thread in Dali is used to process and respond to events such as touch, key, mouse, gestures and timers. <br>
- *  The time taken to process events can be measured by setting DALI_LOG_PERFORMANCE environment variable to 2 <br>
- *
- * Example:
- * \code
- * $ export DALI_LOG_PERFORMANCE=2
- * $ dali-demo
- * $
- * $ ...
- * $ INFO: DALI: Event , min 0.01 ms, max 14.99 ms, total (2.4 secs), avg 1.83 ms
- * \endcode
- *
- * Inside the event processing, the application may be listening for certain events. <br>
- * For example when an actor is touched, some application code may be run in an OnTouchEvent callback. <br>
- * By checking the max times you can check for any spikes that occur when interacting with the application.
- *
- * Example:
- * \code
- * $ INFO: DALI: Event , min 0.10 ms, max 500.01 ms, total (6.4 secs), avg 20.83 ms
- *
- * - Something has taken 500 ms = 1/2 second during event processing.
- * - Need to investigate what the application is doing for 1/2 a second.
- * \endcode
- *
- *
- * <h2 class="pg">Logging performance markers to Kernel trace file</h2>
- *
- * Ftrace is a kernel tracer designed to help developers find out what is going on inside the kernel.<br>
- * It can be used for analysing how long Dali takes to perform different tasks and <br>
- * what Dali is doing in relation to other system processes / interrupts.
- *
- * On Tizen if the kernel has been built with ftrace enabled, then Dali can log out to ftrace.<br>
- * This gives exact time stamps of the main events in Dali.
- * Current markers that are logged:
- * <ul>
- * <li> DALI_V_SYNC. The heart beat which represents Dali should start creating a new frame if anything has changed.<br>
- * Typically runs 60 Frames per second, depending on display refresh rate.
- * <li> DALI_UPDATE_START. Dali update task has started.
- * <li> DALI_UPDATE_START. Dali update task has finished
- * <li> DALI_RENDER_START. Dali render task has started
- * <li> DALI_RENDER_END. Dali render task has finished
- * </ul>
- *
- * <h3> Checking ftrace is working on Linux</h3>
- *
- * Documentation for ftrace:
- * Follow these instructions to ensure the debugfs has been mounted, and the kernel you are using
- * has been built with ftrace enabled. <br>
- * https://www.kernel.org/doc/Documentation/trace/ftrace.txt
- *
- * To check ftrace is working:
- * \code
- * $ cd /sys/kernel/debug/tracing
- * $ echo 1 > tracing_enabled    (enabled tracing)
- * $ echo "test" > trace_marker
- * $ echo 0 > tracing_enabled    (disable tracing)
- * $ cat trace
- * #
- * #          TASK-PID    CPU#    TIMESTAMP  FUNCTION
- * #             | |       |          |         |
- *          <...>-2539  [001] 267964.345607: tracing_mark_write: test
- *
- *
- * If the message did not get added to the trace, then check the write permissions on trace_marker file. E.g.
- * $ chmod ugoa+w trace_marker
- * \endcode
- *
- * To view Dali markers in trace file<br>
- *
- * \code
- * $ export DALI_LOG_PERFORMANCE=4
- * $ dali-demo
- * $
- * $ cat /sys/kernel/debug/tracing/trace
- *
- *   <...>-3330  [000] 785155.216611: tracing_mark_write: SPI_EV_DALI_V_SYNC
- *   <...>-3328  [003] 785155.216644: tracing_mark_write: SPI_EV_DALI_UPDATE_START
- *   <...>-3328  [003] 785155.217045: tracing_mark_write: SPI_EV_DALI_UPDATE_END
- *   <...>-3329  [001] 785155.227418: tracing_mark_write: SPI_EV_DALI_RENDER_START
- *   <...>-3329  [001] 785155.227807: tracing_mark_write: SPI_EV_DALI_RENDER_END
- *   <...>-3330  [000] 785155.233336: tracing_mark_write: SPI_EV_DALI_V_SYNC
- *   <...>-3328  [002] 785155.233374: tracing_mark_write: SPI_EV_DALI_UPDATE_START
- *   <...>-3328  [002] 785155.233672: tracing_mark_write: SPI_EV_DALI_UPDATE_END
- *   <...>-3329  [001] 785155.235161: tracing_mark_write: SPI_EV_DALI_RENDER_START
- *   <...>-3329  [001] 785155.235475: tracing_mark_write: SPI_EV_DALI_RENDER_END
- *   <...>-3330  [000] 785155.250029: tracing_mark_write: SPI_EV_DALI_V_SYNC
- *   <...>-3328  [003] 785155.250065: tracing_mark_write: SPI_EV_DALI_UPDATE_START
- *   <...>-3328  [003] 785155.250330: tracing_mark_write: SPI_EV_DALI_UPDATE_END
- *   <...>-3329  [001] 785155.252860: tracing_mark_write: SPI_EV_DALI_RENDER_START
- *   <...>-3329  [001] 785155.253178: tracing_mark_write: SPI_EV_DALI_RENDER_END
- *   <...>-3329  [001] 785155.264508: tracing_mark_write: SPI_EV_DALI_RENDER_START
- *   <...>-3329  [001] 785155.265006: tracing_mark_write: SPI_EV_DALI_RENDER_END
- * \endcode
- */
diff --git a/docs/content/programming-guide/performance-tips.h b/docs/content/programming-guide/performance-tips.h
deleted file mode 100644 (file)
index 969054a..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*! \page performance-tips Performance Tips
-
-
-<table>
-  <tr>
-    <th>High CPU occupancy <br></th>
-  </tr>
-  <tr>
-  <td>
-       - Try to reduce actor count ( less actors == less processing) <br>
-       - Delete any actors that are not visible, or move them off stage <br>
-       - Use TextureAtlases ( greatly reduces OpenGL driver calls to glBindTexture <br>
-       - Optimise / reduce any constraints used
-       </td>
-       </tr>
-</table>
-<br><br>
-<table>
-  <tr>
-    <th>High GPU occupancy <br></th>
-  </tr>
-  <tr>
-  <td>
-       - Reduce visible actor count ( == less draw calls) <br>
-       - For 2D UI graphics which require no z sorting use @code Actor::SetDrawMode( DrawMode::OVERLAY );
-// In this mode depth testing is turned off and order is determined by the hierachy (depth-first search order).
-        @endcode
-       - Use TextureAtlases ( reduces state changes in the GPU) <br>
-       - Use compressed textures
-       - Use lower quality textures, e.g. smaller, lower number of bits per pixel
-       - Use Dali::NinePatchImage  where possible.
-       - Avoid using too many textures which contain alpha and require blending
-       - Avoid using too many Dali::Layer with depth testing enabled. Otherwise the layer has to clear the depth buffer.
-       - Optimise any shaders used. Pixel shaders should be kept as lean as possible.
-       </td>
-       </tr>
-</table>
-
- */
diff --git a/docs/content/programming-guide/resource-tracking.h b/docs/content/programming-guide/resource-tracking.h
deleted file mode 100644 (file)
index 5782eff..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*! \page resource-tracking Resource Tracking
- *
- *
- * <h2 class="pg">Enable Logging</h2>
- * Setting DALI_ENABLE_LOG environment variable to RESOURCE_LOG will enable resource usage logging in Dali applications.<br>
- *
- * On target resource logging utilizes dlog, but this can also be used on desktop by redirecting stderr to a file.<br>
- *
- * The generated information includes any image files that are loaded with their dimensions,<br>
- *  GPU memory consumption, CPU RAM used and details of texture atlases created.
- *
- * <h2 class="pg">Viewing Resource Logs</h2>
- * dalireslog.sh is installed as part of the dali-adaptor package and can be found in the adaptors/tizen/scripts folder.<br>
- * The script shows a summary of memory used by resources.
- *
- * USAGE:
- * ./dalireslog.sh [FILE]<br>
- * if FILE isn't specified, the script will try to use dlogutil.
- *
- * Example:
- *
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sh-4.1$ ./dalireslog.sh<br>
- *
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>On a separate terminal:</i><br>
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sh-4.1$ DALI_ENABLE_LOG=RESOURCE_LOG /opt/apps/com.samsung.dali-demo/bin/album.example
- *
- * Example on desktop:<br><br>
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;jon-doe\@ws-1234$ DALI_ENABLE_LOG=RESOURCE_LOG blind-effect.example 2>/home/SERILOCAL/john.doe/log.txt<br>
- *
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<i>On a separate terminal:</i><br>
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dalireslog.sh ~/log.txt
- *
- * Displayed information:<br>
- *
- * <ul>
- * <li>3D - amount of GPU memory used by application.<br>
- * <li>MEM Atlas - amount of GPU memory used by texture atlases (usually this refers to font atlases). <br>
- * <li>Number of atlases - how many texture atlases are present in memory.<br>
- * </ul>
- * A list of files is displayed in the main view, with different color codes representing different states:<br>
- *
- * <ul>
- * <li>CPU - resource is in memory, but hasn't been uploaded to a GL texture.<br>
- * <li>GPU - resource has been uploaded to a GL texture, bitmap buffer discarded.<br>
- * <li>CPUGPU - resource has been uploaded to a GL texture, but still present in CPU memory as well.<br>
- * <li>DISCARDED - resource has been discarded, memory freed up.
- * </ul>
- */
diff --git a/docs/content/programming-guide/script-hello.h b/docs/content/programming-guide/script-hello.h
deleted file mode 100644 (file)
index 3bb5ece..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*! \page script-hello Scripting Hello World
- *
- * <h2 class="pg">Hello World - JSON layout</h2>
- *
- * The following JSON code is the minimum required to put the sentence "Hello World" on the screen.
- *
- * @code
- * {
- *  // a tree of actors
- *  "stage": [{
- *    "name": "text-label",
- *    "type": "TextLabel",
- *    "text": "Hello World",
- *    "parent-origin": "CENTER"
- *  }]
- * }
- * @endcode
- *
- * The following c++ code loads the JSON file
- *
- * @code
- * Builder builder = Builder::New();
- *
- * std::string json_data(ReadFile("layout.json"));
- *
- * builder.LoadFromString(json_data);
- *
- * Actor actor = builder.GetActor("text-label");
- *
- * Stage::GetCurrent().Add(actor);
- * @endcode
- *
- * <h2 class="pg">Hello World - Javascript</h2>
- *
- * Hello world can also be executed via Javascript.
- *
- * The Dali script application is needed to run the Javascript which provides a Javascript runtime and an interface to Dali.
- *
- * @code
- * daliscript hello-world.js
- * @endcode
- *
- * The TextLabel control to display Hello World can be constructed using Javascript dot notation accessing Dali Actor Properties.
- *
- * @code
- * var textLabel = Dali.TextLabel();
- *
- * textLabel.text          = "Hello World";
- * textLabel.font-family   = "FreeSans";
- * textLabel.font-style    = "Regular";
- * textLabel.parent-origin = "CENTER";
- *
- * Dali.Run();
- * @endcode
- *
- */
-
-
diff --git a/docs/content/programming-guide/script-overview.h b/docs/content/programming-guide/script-overview.h
deleted file mode 100644 (file)
index 6224f60..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*! \page script-overview Scripting Overview
- *
- * Dali has scripting support to
- *
- * <ul>
- *   <li>Provide a mechanism to allow custom controls in scripting.
- *   <li>Support layouts using JSON.
- *   <li>Support a dynamic Javascript runtime.
- * </ul>
- *
- * This is accessed via the Dali script external application which wraps Dali with a scripting engine. For example
- *
- * @code
- * daliscript hello-world.js
- * @endcode
- *
- * <h1 class="pg">A Mechanism To Allow Custom Controls in Scripting</h1>
- *
- * <h2 class="pg">The TypeRegistry</h2>
- *
- * The TypeRegistry allows class 'types' to register themselves as creatable from a scripting environment.
- *
- * Custom controls can register a creation function using class run time type information (RTTI).
- *
- * The RTTI typeid provides Dali with a unique name to register the type. In this registration the creation function is responsible for creating new instances of the custom class.
- *
- * Signals can be added to this type registration with a signal connection function.
- *
- * Actions can be similarly added with an action function.
- *
- *
- * <h2 class="pg">Non Animatable Properies</h2>
- *
- * The property system has non animatable properties that can be used by the scripting runtime to set actor attributes.
- *
- * Custom controls can register properties for scripting access.
- *
- *
- * <h2 class="pg">A Javascript example</h2>
- *
- * A Javascript runtime wrapping Dali and the V8 Javacript engine is being developed to allow the creation of pure Javascript applications.
- *
- * ie 'daliscript helloworld.js'.
- *
- * This example shows how a Javacript file relates to the TypeRegistry and Property system.
- *
- * @code
- * // Creation
- * // This line looks for a type registered as "MyActor" and calls its creation function
- * var custom = new MyActor();
- *
- * // Property access
- * // This line finds a property called "alpha" and Sets with SetProperty(index, Property::Value(2.0))
- * custom.alpha = 2.0;
- *
- * // NB: non animatable properties can be strings
- * custom.text = "a label";
- *
- * // Actions
- * // This line finds the action function registered as "SelectPage" and calls its with a list of arguments
- * // (NB: arguments are currently limited to non aggregate types ie no list, maps or objects)
- * custom.SelectPage("one");
- *
- * // Signals
- * // This line finds the signal registered as "touched" and sets the "OnTouch" callback function
- * custom.signals.touched = OnTouch;
- *
- * // OnTouch could have been previously defined as
- * function OnTouch(name)
- * {
- *   custom.text = name
- * }
- * @endcode
- *
- * <h1 class="pg">Supporting Layouts Using JSON</h1>
- *
- * The builder in Dali Toolkit provides a means to define layouts using the JSON file format.
- *
- * This format defines a text representation for key value pairs and lists of data. Lists and Maps can hold the fundamental Javascript data types of string, number(float/int), true, false, nil.
- *
- * *** Current Status
- *
- * Currently the builder supports internal Toolkit and Dali controls.
- *
- * *** Next Iteration
- *
- * The builder will be improved to make use of the TypeRegistry and non animatable properties and allow Custom Controls to be added into Scripting.
- *
- * This means the current JSON format will alter slightly (for example; properties will not be defined as a tree but as one level below the actor definition)
- *
- * An actor tree defined in JSON will be retrievable as a "Buildable" class instance.
- *
- * This buildable class allows the creation of the actor tree. It will also aid resource managment as a buildable can store the layout representation and unload resources when off stage (reconstructing the object when its added back onto the stage).
- *
- * <h1 class="pg">Supporting A Javascript Runtime</h1>
- *
- * As a separate project an application will be available that can execute Javascript.
- *
- * This application will provide a wrapping layer between V8 and Dali and allow a natural interface to the Javascript developer.
- *
- *
- *
- *
- *
- *
- *
- *
- */
diff --git a/docs/content/programming-guide/texture-atlases.h b/docs/content/programming-guide/texture-atlases.h
deleted file mode 100644 (file)
index b664d3e..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-/*! \page texture-atlases Texture Atlases
- *
- * <h2 class="pg">Using Texture Atlases in DALi </h2>
- *
- *
- * <h3> Example demo application </h3>
-
-  \image html image-wall.jpg
-
-
-<h3> Application above is running slow as there are many small individual images displayed (50)</h3>
-
-<table>
-  <tr>
-    <td> Launch Time </td>
-    <td> Slow </td>
-    <td> Has to perform: <br>- 50 file open requests and multiple reads for each image</td>
-  </tr>
-  <tr>
-    <td> Memory Usage </td>
-    <td> High </td>
-    <td> Has to create:
-      <br>- 50 Dali::Image objects
-      <br>- 50 OpenGL Textures
-    </td>
-  </tr>
-  <tr>
-    <td>Rendering Performance </td>
-    <td> Slow </td>
-    <td> Has to perform:
-      <br>- 50 glBindTexture calls per frame ( each OpenGL calls takes time)
-      <br>- 50 a frame = 3000 calls per second @60 FPS.
-      <br>- Texture switching is a major state change in the GPU
-    </td>
-  </tr>
-</table>
-<br><br>
-
-
-* <h3> Solutions to problem: Use a Texture Atlas</h3>
-
-A texture atlas is simply one larger image that contains smaller images. A texture atlas is sometimes called a
-sprite sheet, bitmap sheet or texture pack.
-
- \image html atlas.jpg
-
-<br>
-Dali::ImageActor has the ability to display a portion of an image using ImageActor::PixelArea setting.
-For example to display the first 3 image in the atlas
-
-  \image html example-code.jpg
-
-<h3> Result of using an Atlas</h3>
-<table>
-  <tr>
-    <td> Launch Time </td>
-    <td> Fast </td>
-    <td> Has to perform: <br>- 1 file open request </td>
-  </tr>
-  <tr>
-    <td> Memory Usage </td>
-    <td> Better </td>
-    <td> Has to create:
-      <br>- 1 Dali::Image objects
-      <br>- 1 OpenGL Textures
-    </td>
-  </tr>
-  <tr>
-    <td>Rendering Performance </td>
-    <td> Fast </td>
-    <td> Has to perform:
-      <br>- 1 glBindTexture calls per frame ( each OpenGL calls takes time)
-      <br>- 1 a frame = 6- calls per second @60 FPS.
-    </td>
-  </tr>
-</table>
-<br>
-<h2> Atlas creation guide </h2>
-
-Many tools exist for creating texture atlases.<br>
-In the following example we are using a tool called TexturePacker as DALi has an exporter script for it.
-The exporter automatically generates a source file that has the ImageActor::PixelArea pre-defined.
-<br>
-<ul>
-  <li> Download http://www.codeandweb.com/texturepacker </li>
-  <li> Launch TexturePacker </li>
-  <li> Go to the menu File -> Preferences</li>
-  <li> Set the "Exporter directory" to be the location of dali-toolkit/texture-atlas-exporter  <br></li>
-  \image html texture-packer-preferences.jpg
-  <br>
-  <li> <b> Restart the application! </b></li>
-  <li> Select DALi 3D framework for new project</li>
-  <br>
-  \image html texture-packer-startup.jpg
-  <br>
-  <li><h3> Create the atlas </h3> <br></li>
-  \image html texture-packer-add-sprites.jpg <br><br>
-  <li><h3> Click publish to produce the files </h3></li><br><br>
-  \image html texture-packer-publish.jpg  <br><br>
-</ul>
-<h2> Using the generated cpp file </h2>
-
-The generated cpp file contains 3 different ways of describing the atlas. <br>
-Copy and paste the section that best suits your application.
-<ul><li> Lookup table. Includes code for storing the table in a std::map for fast lookup.</li>
-<li> constants.  </li>
-<li> JavaScript property map ( see the Dali JavaScript programming guide on how to use it).
-</ul>
-<h3> Using the lookup table </h3>
-
-Cut and paste the lookup table code into your application.
-
-\code
-
-\\ The following code is automatically generated.
-\\
-const char* ATLAS_FILE_NAME( "my_first_atlas.png" );  ///< Atlas image filename
-
-/**
- * Structure to hold image name and position within the atlas.
- *
- */
-struct ImageInfo
-{
-  const char* name;
-  unsigned int x,y,w,h;
-  Dali::BlendingMode::Type blendMode;  // only enable blending if image has alpha
-};
-
-/**
- * lookup table
- */
-const ImageInfo ImageAtlas[]=
-{
- { "blocks-ball", 2, 198, 51, 51, BlendingMode::ON },
- { "bubble-ball", 288, 74, 32, 32, BlendingMode::ON },
- { "gallery-small-52", 2, 2, 128, 128, BlendingMode::OFF },
- { "icon-change", 219, 2, 37, 34, BlendingMode::ON },
- { "icon-cluster-carousel", 180, 2, 37, 34, BlendingMode::ON }
-};
-
-const ImageInfo* GetImageInfo(const char* name)
-{
-  typedef std::map< const char*, const ImageInfo* > LookupMap;
-  static LookupMap lookup;
-  if( lookup.empty() )
-  {
-    for( unsigned int i = 0; i < ATLAS_IMAGE_COUNT; ++i)
-    {
-      lookup[ ImageAtlas[i].name ] =  &ImageAtlas[i];
-    }
-  }
-  LookupMap::const_iterator iter = lookup.find(name);
-  if( iter != lookup.end() )
-  {
-   return (*iter).second;
-  }
-  DALI_ASSERT_ALWAYS(0 && "image name not found in atlas");
-  return NULL;
-}
-
-\endcode
-
-To use the lookup table you can do something like this:
-\code
-
-// Example function on how to get an image info from the table
-
-std::string fileName = std::string( DALI_IMAGE_DIR ) + ATLAS_FILE_NAME;
-Image imageImage = Image::New( fileName );
-
-const ImageInfo* info(NULL);
-
-info = GetImageInfo("blocks-ball");
-if( info)
-{
-  ImageActor ballActor = ImageActor::New( imageAtlas, ImageActor::PixelArea( info->x, info->y, info->w, info->h) );
-  ballActor->SetBlendMode( info->blendMode );
-}
-info = GetImageInfo("bubble-ball");
-if( info)
-{
-  ImageActor bubbleActor = ImageActor::New( imageAtlas, ImageActor::PixelArea( info->x, info->y, info->w, info->h) );
-  bubbleActor->SetBlendMode( info->blendMode );
-}
-
-\endcode
-<h3> Using the constant definitions </h3>
-
-1. Cut and paste the constant definition code into your application.
-
-You'll notice the code below won't compile because C++ variables can't have a dash character.<br>
-E.g. BLOCKS-BALL, BUBBLE-BALL will cause errors. Do a search and replace for - and replace with underscores.
-This is one reason why using lookup table which holds the filename as a string maybe easier to use.
-
-\code
-\\ The following code is automatically generated.
-\\
-const char* ATLAS_FILE_NAME( "my_first_atlas.png" );
-
-/**
- * Structure to hold position / blend mode within the atlas.
- *
- */
-struct ImageInfo
-{
-  ImageInfo(unsigned int x,unsigned int y,unsigned int w,unsigned int h,  Dali::BlendingMode::Type mode)
-  :pixelArea(x,y,w,h),blendMode(mode)
-  {}
-  ImageActor::PixelArea pixelArea;
-  Dali::BlendingMode::Type blendMode;  // only enable blending if image has alpha
-};
-
-
-const ImageInfo BLOCKS-BALL( 2, 198, 51, 51 ,BlendingMode::ON );
-const ImageInfo BUBBLE-BALL( 288, 74, 32, 32 ,BlendingMode::ON );
-const ImageInfo GALLERY-SMALL-52( 2, 2, 128, 128 ,BlendingMode::OFF );
-\endcode
-
-2. To use it, you can copy example code from the generated cpp file which looks
-like this
-\code
-void LoadAtlasImages()
-{
-  std::string fileName = std::string(DALI_IMAGE_DIR) + ATLAS_FILE_NAME;
-  Image atlasImage = Image::New( fileName );
-  ImageActor Blocksball = ImageActor::New( atlasImage,  BLOCKS_BALL.pixelArea);
-  Blocksball.SetBlendMode( BLOCKS_BALL.blendMode );
-
-  ImageActor Bubbleball = ImageActor::New( atlasImage,  BUBBLE_BALL.pixelArea);
-  Bubbleball.SetBlendMode( BUBBLE_BALL.blendMode );
-  ...
- \endcode
-
-
-
-<br><br>
-<h2> Atlas creation tips </h2>
-
-<ul>
-  <li> Compress the atlas  - \link Texture_Compression Compressing Textures \endlink <br></li>
-  <li> Avoid adding large images to the Atlas.<br>
-    E.g. don't add background images to it. Medium to large images should
-    be kept seperate. <br><br>
-    \image html atlas-size.jpg
-    <br><br>
-  </li>
-  <li> Try to ensure the atlas contains only images that are frequently used. <br>
-    There's no point in having images taking up GPU texture memory if they're not displayed.<br>
-  </li>
-  <li> Avoid very large atlases <br>
-    Try to create multiple atlases based on how they are used within your application.<br>
-    <br>
-    Alternatively Texture packer has the option to split atlases ( search help for Multipack)
-  </li>
-</ul>
-
-
-
- */
-
diff --git a/docs/content/programming-guide/texture-compression.h b/docs/content/programming-guide/texture-compression.h
deleted file mode 100644 (file)
index 62f4577..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-
-/*! \page Texture_Compression Texture Compression
-
-
-Using compressing the textures will:
-<ul>
-<li> Speed up rendering in time the GPU == less power used due to less texture data being transferred.
-<li> Reduce texture memory usage.
-<li> Speed up load times. Smaller files mean quicker load times.
-</ul>
-<br><br>
-DALi supports the KTX file format.
-You just load the compressed texture like you would any other image.
-\code
-Image::New("my_compressed_file.ktx");
-\endcode
-<br>
-ARMS texture compression tool<br>
-http://malideveloper.arm.com/develop-for-mali/tools/asset-creation/mali-gpu-texture-compression-tool/  <br>
-
-Here is an example of using the ARM compression tool.
-\image html compression-options.jpg
-
-<br><br>
-
-\image html compression-example.jpg
-<br>
-<br>
-As shown above the ETC-1 compression format does not support alpha.<br> As a work around the tool will export
-the alpha as a seperate compressed image.<br>
-In order to combine both the images you need to use a custom shader.<br>
-Here is an example shader:<br>
-\code
-  const char* const COMPRESSED_RGB_PLUS_SEPARATE_ALPHA_FRAGMENT_SOURCE =
-    "\n"
-    "void main()\n"
-    "{\n"
-    "    vec4 v4Color  = (texture2D(sTexture, vTexCoord) * uColor);\n"
-    "    v4Color.a =  texture2D(sEffect, vTexCoord ).r;\n"
-    "   gl_FragColor = v4Color;"
-    "}\n";
-
-
-  mShaderEffect = ShaderEffect::New( "", COMPRESSED_RGB_PLUS_SEPARATE_ALPHA_FRAGMENT_SOURCE);
-
-  mAtlasImageRGB = Image::New( ATLAS_RGB_FILENAME.KTX);
-
-  mAtlasImageAlpha = Image::New( ATLAS_ALPHA_FILENAME.KTX );
-
-  mShaderEffect.SetEffectImage( mAtlasImageAlpha );
-
-
-
-  // to create Image Actor
-  ImageActor  imageActor = ImageActor::New( mAtlasImageRGB, GetImagePosition( info) );
-
-  imageActor.SetShaderEffect( mShaderEffect );
-
-  imageActor.SetBlendMode(BlendingMode::ON);
-
-\endcode
-
-
- */
index 3be5549..a1200e6 100644 (file)
@@ -1,18 +1,44 @@
 /**
  *
-## Writing documentation for the DALi programing guide
+
+# Writing documentation for the DALi programing guide  {#documentationguide}
 
 To allow documentation to be shared between C++ and JavaScript, please follow these guidelines:
 
  - Create a mark down file (.md) using GitHub Flavoured Markdown https://help.github.com/articles/github-flavored-markdown/
- - Put it into the shared C++ / JavaScript documentation: ~dali-toolkit/docs/content/shared-javascript-and-cpp-documentation/~
+ - Put it into the shared C++ / JavaScript documentation: dali-toolkit/docs/content/shared-javascript-and-cpp-documentation/~
  - Include code samples for both C++ and JavaScript in the mark down.
- - See multi-touch-guide.md in toolkit for an example
+ - See script-overview.md overview in dali-toolkit/docs/content/shared-javascript-and-cpp-documentation for an example
+ - For YUIDOC to parse the file it needs:
+   - Enclosed in code comment block
+   - Have a class tag with a description of the file
+ - For DOXYGEN to link to the mark down it currently needs a reference {hash myfile}
+  
+
+#### Images
+ Images are shared between both Doxygen and YUIDOC tools using a symbolic link.
+ You need to link to the image twice in shared documentation.
+ This is because YUIDOC stores images in a folder called assets/img/  which is relative to the HTML pages.
+ Where as Doxygen copies all images in to the same folder as the HTML generated pages.
+
+ ~~~
+![ ](../assets/img/screen-shot.png)    // required for YUIDOC
+![ ](screen-shot.png)                  // required for Doxygen
+
+The space between the brackets is the alternative text. This means you will never see a broken image symbol.
+~~~
   
-Why use GitHub flavoured markdown?
+## Example
+![ ](../assets/img/example-documentation/example-code.png)
+![ ](example-code.png)
+
+
+
+#### Why use GitHub flavoured markdown?
  - Table support is good and language specific code blocks are easier to define ( javascript/C++).
  - Doxygen and YUIDOC both support it.
 
 
-@class Writing_DALi_Programming_Guide_Documentation
+@class _Guide_Writing_DALi_Programming_Guide_Documentation
+
 */
@@ -1,44 +1,54 @@
-/*! \page fundamentals Dali Fundamentals
+/**
  *
-<h2 class="pg">Actors and the Stage</h2>
+# Dali Fundamentals  {#fundamentals}
 
-A Dali application uses a hierachy of Dali::Actor objects to position visible content.  An actor inherits a position relative to its parent, and can be moved relative to this point.  UI controls can be built by combining multiple actors.
+## Actors and the Stage
 
+A Dali application uses a hierachy of Dali::Actor objects to position visible content.  An actor inherits a position relative to its parent, and can be moved relative to this point.  UI controls can be built by combining multiple actors.
+  
 To display the contents of an actor, it must be connected to the Dali::Stage.  This provides an invisible root (top-level) actor, to which all other actors are added.  A direct or indirect child of the root actor is considered "on-stage".  Multi-touch events are received through signals emitted by on-stage actors.
-
+  
 The following example shows how to connect a new actor to the stage:
 
-@code
+~~~{.cpp}
 Actor actor = Actor::New();
 Stage::GetCurrent().Add(actor);
-@endcode
+~~~
 
-<h2 class="pg">The Coordinate System</h2>
+~~~{.js}
+var actor = new dali.Actor();
+dali.stage.add( actor );
+~~~
+
+## The Coordinate System
 
 The Stage has a 2D size, which matches the size of the application window.  The default coordinate system in Dali has the origin at the top-left corner, with positive X to right, and position Y going
 downwards.  This is intended to be convenient when laying-out 2D views.
 
-\image html coordinate-system-and-stage.png
+![ ](../assets/img/coordinate-system-and-stage.png)
+![ ](coordinate-system-and-stage.png)
 
-<h2 class="pg">Positioning Actors</h2>
+## Positioning Actors
 
 An actor inherits its parent's position.  The relative position between the actor & parent is determined by 3 properties:
-
 1) ParentOrigin.  This Vector3 property defines a point within the parent actor's area.
 
-\image html parent-origin.png
+![ ](../assets/img/parent-origin.png)
+![ ](parent-origin.png)
 
 The default is "top-left", which can be visualized in 2D as (0, 0), but is actually Vector3(0, 0, 0.5) in the 3D Dali world.  The actor's position is relative to this point.
 
 2) AnchorPoint.  This Vector3 property defines a point within the child actor's area.
 
-\image html anchor-point.png
+![ ](../assets/img/anchor-point.png)
+![ ](anchor-point.png)
 
 The default is "center", which can be visualized in 2D as (0.5, 0.5), but is actually Vector3(0.5, 0.5, 0.5) in the 3D Dali world.  The actor's position is also relative to this point.
 
 3) Position.  This is the position vector between the parent-origin and anchor-point.
 
-\image html actor-position.png
+![ ](../assets/img/actor-position.png)
+![ ](actor-position.png)
 
 Therefore by default, an actors position is the distance between its center and the top-left corner of its parent.
 
@@ -46,5 +56,6 @@ An actor added directly to the stage with position (X = stageWidth*0.5, Y = stag
 
 Note that since Dali is a 3D toolkit, this behaviour is the result of a default perspective camera setup.
 
-*
+@class _Guide_DALi_Fundamentals
+
 */
diff --git a/docs/content/shared-javascript-and-cpp-documentation/javascript-wrapping-guide.md b/docs/content/shared-javascript-and-cpp-documentation/javascript-wrapping-guide.md
new file mode 100644 (file)
index 0000000..287c8cf
--- /dev/null
@@ -0,0 +1,113 @@
+/**
+ *
+# JavaScript wrapping guide  {#javascriptwrapping}
+
+This guide outlines what files to modify when the DALi C++ public API changes.
+
+## Background
+
+We use Google's V8 to run JavaScript code.
+https://developers.google.com/v8/get_started
+
+#### Folder structure
+
+There is a folder for each type of wrapped object.
+  
+
+The filename for a wrapped type are always object-wrapper.xxx
+The filename for the static functions that forward calls to DALi are always object-api.xxx
+  
+The current file / folder structure is as follows:
+  
+![ ](../assets/img/javascript-wrapping-guide/folder-view.png)
+![ ](folder-view.png)
+
+
+## What to do when the DALi public API changes:
+
+### New property has been added
+- No code change required.
+- It will be automatically avalable using the dot notation. E.g. actor.my_new_property = true;
+
+### New property type has been added
+- modify property-value-wrapper.h / .cpp to support the new type
+
+### New function added to an object
+- Add the function name to function table in my-object-wrapper.cpp
+- Add the forwarding function to my-object-api.cpp/.h
+- Ensure you have created YUIDOC documention above the function
+  
+![ ](../assets/img/javascript-wrapping-guide/adding-function.png)
+![ ](adding-function.png)
+
+### New object added
+
+This is an example of wrapping a new DALi C++ object called Light.
+
+- in dali-wrapper.cpp in ConstructorFunctionTable insert the constructor in the table.
+  
+![ ](../assets/img/javascript-wrapping-guide/constructors.png)
+![ ](constructors.png)
+  
+
+Objects registered in this table can be created in JavaScript as follows:
+
+~~~{.js}
+var light = new dali.Light();
+~~~
+
+- Add the Light to the Type enum in BaseWrappedObject class.
+  
+![ ](../assets/img/javascript-wrapping-guide/base-wrapped-types.png)
+![ ](base-wrapped-types.png)
+  
+
+-  Create the light-wrapper / light-api files
+  
+If Light inherits from Handle then use path-wrapper and path-api as a template to create light-wrapper and light-api
+( inherits from HandleWrapper)
+  
+Otherwise use animation-wrapper and animation-api as a template ( inherts from BaseWrappedObject)
+
+
+
+## Design
+![ ](../assets/img/javascript-wrapping-guide/high-level-design.png)
+![ ](high-level-design.png)
+
+
+![ ](../assets/img/javascript-wrapping-guide/plugin-creation.png)
+![ ](plugin-creation.png)
+
+
+![ ](../assets/img/javascript-wrapping-guide/plugin-execution.png)
+![ ](plugin-execution.png)
+
+### Internals
+In order to wrap DALi C++ objects in JavaScript, we use
+hidden fields inside the JavaScript object.
+
+
+  
+| JavaScript Object                     |   _   |  C++ WrappedObject  (e.g. ImageWrapper)|
+|---------------------------------------|-------|----------------------------------------|
+| Hidden internal fields                |       |                                        |
+| *Pointer to a     WrappedObject       | ----> |      Handle to a Dali::Image object    |
+| Type of wrapped object (e.g. Image)   |       |                                        |
+  
+
+So if you call
+~~~{.js}
+var name = myActor.getId();
+~~~
+v8 will detect myActor is a wrapped object, and call getId() on that wrapped object.
+The wrapped object, then forwards the command to the real DALi object.
+  
+Whenever we want to access functions / properties of that wrapped object, we unwrap it
+to get access to the Dali object.
+  
+Each wrapped object registers with Dali garbage collector so they can be deleted
+when Dali shuts down
+
+@class _Guide_JavaScript_Wrapping
+*/
\ No newline at end of file
diff --git a/docs/content/shared-javascript-and-cpp-documentation/performance-profiling.md b/docs/content/shared-javascript-and-cpp-documentation/performance-profiling.md
new file mode 100644 (file)
index 0000000..1fb8f06
--- /dev/null
@@ -0,0 +1,258 @@
+/**
+ *
+
+# Performance Profiling  {#performanceprofiling}
+
+
+DALi has many mechanisms for analysing performance including kernel, system and network logging.
+
+
+## Background
+The Dali rendering pipeline has 2 stages.
+
+Each stage is typically run once per frame.
+
+- Update
+  - Run animations
+  - Run constraints
+  - Run physics
+  - Update the scene-graph
+- Render
+  - Upload 3D data using OpenGL ( textures, vertex buffers etc).
+  - Draw the scene using OpenGL
+  
+
+Update produces data - **Writes** final object positions to a buffer
+  
+Render consumes data - **Reads** object positions from a buffer and draws with OpenGL
+
+![ ](../assets/img/performance/update-render.png)
+![ ](update-render.png)
+
+  
+One reason for having 2 buffers is to allow both tasks to overlap and run in parallel in certain situations.
+E.g. if rendering is taking a long time (due to a texture upload), the Update thread can start work producing
+data for the next frame. The aim being to take advantage of multi-core CPU's.
+  
+To run at a solid 60 FPS (16 milliseconds per frame), it is recommended to stay below the following times:
+  
+ - Update: 4 milliseconds
+ - Render: 4 milliseconds
+  
+This will leave enough time for the output to be composited (if the system uses a compositor) and to avoid using
+too much CPU power.
+  
+The main Dali application thread which deals with event processing is independent of the update / render threads.
+This means animations won't stop if the main thread decides to do a long operation like downloading a file from the internet.
+  
+
+## Time Stamp Logging
+
+This type of logging is used for recording individual time stamped events.
+  
+Setting DALI_PERFORMANCE_TIMESTAMP_OUTPUT environment variable will enable time stamps.
+
+Tools such as Tizen dynamic analyser and StageHand can be used to provide a GUI display of
+the output.
+
+
+The log options are:
+
+|  Bit |  Function                | Example      |
+|------|--------------------------|--------------|
+|   0  |  log markers to DALi log (dlog on Tizen) | DALI_PERFORMANCE_TIMESTAMP_OUTPUT=1 dali-demo |
+|   1  |  log markers to kernel trace ( logs to ftrace )| DALI_PERFORMANCE_TIMESTAMP_OUTPUT=2 dali-demo |
+|   2  |  log markers to system trace ( ttrace on Tizen for Tizen analyser) | DALI_PERFORMANCE_TIMESTAMP_OUTPUT=4 dali-demo |
+|   3  |  log markers to network client (tcp port 3001+) | DALI_PERFORMANCE_TIMESTAMP_OUTPUT=8 dali-demo |
+
+  
+
+~~~
+DALI_PERFORMANCE_TIMESTAMP_OUTPUT=1 dali-demo
+INFO: DALI: 1134155.500142 (seconds), V_SYNC
+INFO: DALI: 1134155.500167 (seconds), UPDATE_START
+INFO: DALI: 1134155.500214 (seconds), PROCESS_EVENT_END
+INFO: DALI: 1134155.500659 (seconds), UPDATE_END
+INFO: DALI: 1134155.508039 (seconds), PROCESS_EVENT_START
+INFO: DALI: 1134155.508295 (seconds), PROCESS_EVENT_END
+INFO: DALI: 1134155.511109 (seconds), RENDER_START
+INFO: DALI: 1134155.511548 (seconds), RENDER_END
+INFO: DALI: 1134155.516899 (seconds), V_SYNC
+INFO: DALI: 1134155.516945 (seconds), UPDATE_START
+INFO: DALI: 1134155.517462 (seconds), UPDATE_END
+INFO: DALI: 1134155.527884 (seconds), RENDER_START
+INFO: DALI: 1134155.528108 (seconds), PROCESS_EVENT_START
+INFO: DALI: 1134155.528327 (seconds), RENDER_END
+INFO: DALI: 1134155.528358 (seconds), PROCESS_EVENT_END
+INFO: DALI: 1134155.528388 (seconds), PROCESS_EVENT_START
+INFO: DALI: 1134155.528749 (seconds), PROCESS_EVENT_END
+INFO: DALI: 1134155.533672 (seconds), V_SYNC
+~~~
+
+### Markers that are logged
+
+| Marker | Description
+|--------|-------------
+| V_SYNC.| The heart beat which represents Dali should start creating a new frame if anything has changed. Runs at display refresh rate, typically 60Hz |
+| UPDATE_START | Dali update task has started |
+| UPDATE_START | Dali update task has finished |
+| RENDER_START | Dali render task has started |
+| RENDER_END | Dali render task has finished |
+| PROCESS_EVENT_START | Dali main thread processing events (e.g. in response to a touch event or a timer) |
+| PROCESS_EVENT_START | Dali main thread processing events finished |
+| SWAP_START | glSwapBuffers started (todo) |
+| SWAP_END | glSwapBuffers end  (todo) |
+| PAUSE  | Application paused |
+| RESUME | Application resumed |
+
+### Custom time stamps for application developers
+
+A developer can output custom markers using the PerformanceLogger API (C++ only currently)
+
+~~~
+PerformanceLogger logger = PerformanceLogger::New("MyMarker");
+logger.AddMarker(PerformanceLogger::START_EVENT);
+
+// do stuff
+
+logger.AddMarker(PerformanceLogger::END_EVENT);
+~~~
+
+## Statistics logging
+
+Statistics logging uses Dali log output which on Tizen is dlog, but this can also be used on desktop by redirecting stderr to a file.
+
+Setting DALI_LOG_PERFORMANCE_STATS environment variable will enable time stamps.
+
+The log options are:
+
+|  Bit |  Function                | Example      |
+|------|--------------------------|--------------|
+|   0  |  log all statistics to the DALi log | DALI_LOG_PERFORMANCE_STATS=1 dali-demo |
+|   1  |  log update and render statistics to the DALi log| DALI_LOG_PERFORMANCE_STATS=2 dali-demo |
+|   2  |  log event (main) task statistics to the DALi log| DALI_LOG_PERFORMANCE_STATS=4 dali-demo |
+|   3  |  log custom marker statistics to the DALi log | DALI_LOG_PERFORMANCE_STATS=8 dali-demo |
+
+Example output
+~~~
+$ export DALI_LOG_PERFORMANCE_STATS=1
+$ dali-demo
+
+ Event, min 0.04 ms, max 5.27 ms, total (0.1 secs), avg 0.28 ms, std dev 0.73 ms
+ Update, min 0.29 ms, max 0.91 ms, total (0.5 secs), avg 0.68 ms, std dev 0.15 ms
+ Render, min 0.33 ms, max 0.97 ms, total (0.6 secs), avg 0.73 ms, std dev 0.17 ms
+ TableViewInit, min 76.55 ms, max 76.55 ms, total (0.1 secs), avg 76.55 ms, std dev 0.00 ms
+~~~
+
+If nothing is animating Dali will enter a paused state to save power. At this
+point nothing will be logged.
+
+### Custom statistics for application developers
+
+This is identical to the custom timestamp example.
+~~~
+PerformanceLogger logger = PerformanceLogger::New("MyMarker");
+logger.AddMarker(PerformanceLogger::START_EVENT);
+
+// do stuff
+
+logger.AddMarker(PerformanceLogger::END_EVENT);
+~~~
+
+
+## Application profiling
+
+ The main application thread in Dali is used to process and respond to events such as touch, key, mouse, gestures and timers.
+
+Example:
+~~~
+$ export DALI_LOG_PERFORMANCE_STATS=4
+$ dali-demo
+$
+$ ...
+$ INFO: DALI:  Event, min 0.04 ms, max 5.27 ms, total (0.1 secs), avg 0.28 ms, std dev 0.73 ms
+~~~
+
+Inside the event processing, the application may be listening for certain events.
+For example when an actor is touched, some application code may be run in an OnTouchEvent callback.
+By checking the max times you can check for any spikes that occur when interacting with the application.
+
+Example:
+~~~
+$ INFO: DALI: Event , min 0.10 ms, max 500.01 ms, total (6.4 secs), avg 20.83 ms
+
+- Something has taken 500 ms = 1/2 second during event processing.
+- Need to investigate what the application is doing for 1/2 a second.
+~~~
+
+
+## Using ftrace for timestamp logging
+
+~~~
+DALI_PERFORMANCE_TIMESTAMP_OUTPUT=2 dali-demo
+~~~
+
+Ftrace is a kernel tracer designed to help developers find out what is going on inside the kernel.
+It can be used for analysing how long Dali takes to perform different tasks and
+what Dali is doing in relation to other system processes / interrupts.
+  
+On Tizen if the kernel has been built with ftrace enabled, then Dali can log out to ftrace.
+This gives exact time stamps of the main events in Dali.
+Current markers that are logged:
+
+
+
+### Checking ftrace is working on Linux
+
+Documentation for ftrace:
+Follow these instructions to ensure the debugfs has been mounted, and the kernel you are using
+has been built with ftrace enabled.
+
+https://www.kernel.org/doc/Documentation/trace/ftrace.txt
+
+To check ftrace is working:
+~~~
+$ cd /sys/kernel/debug/tracing
+$ echo 1 > tracing_enabled    (enabled tracing)
+$ echo "test" > trace_marker
+$ echo 0 > tracing_enabled    (disable tracing)
+$ cat trace
+#
+#          TASK-PID    CPU#    TIMESTAMP  FUNCTION
+#             | |       |          |         |
+         <...>-2539  [001] 267964.345607: tracing_mark_write: test
+
+
+If the message did not get added to the trace, then check the write permissions on trace_marker file. E.g.
+$ chmod ugoa+w trace_marker
+~~~
+To view Dali markers in trace file
+
+~~~
+$ export DALI_LOG_PERFORMANCE=2
+$ dali-demo
+$
+$ cat /sys/kernel/debug/tracing/trace
+
+  <...>-3330  [000] 785155.216611: tracing_mark_write: SPI_EV_DALI_V_SYNC
+  <...>-3328  [003] 785155.216644: tracing_mark_write: SPI_EV_DALI_UPDATE_START
+  <...>-3328  [003] 785155.217045: tracing_mark_write: SPI_EV_DALI_UPDATE_END
+  <...>-3329  [001] 785155.227418: tracing_mark_write: SPI_EV_DALI_RENDER_START
+  <...>-3329  [001] 785155.227807: tracing_mark_write: SPI_EV_DALI_RENDER_END
+  <...>-3330  [000] 785155.233336: tracing_mark_write: SPI_EV_DALI_V_SYNC
+  <...>-3328  [002] 785155.233374: tracing_mark_write: SPI_EV_DALI_UPDATE_START
+  <...>-3328  [002] 785155.233672: tracing_mark_write: SPI_EV_DALI_UPDATE_END
+  <...>-3329  [001] 785155.235161: tracing_mark_write: SPI_EV_DALI_RENDER_START
+  <...>-3329  [001] 785155.235475: tracing_mark_write: SPI_EV_DALI_RENDER_END
+  <...>-3330  [000] 785155.250029: tracing_mark_write: SPI_EV_DALI_V_SYNC
+  <...>-3328  [003] 785155.250065: tracing_mark_write: SPI_EV_DALI_UPDATE_START
+  <...>-3328  [003] 785155.250330: tracing_mark_write: SPI_EV_DALI_UPDATE_END
+  <...>-3329  [001] 785155.252860: tracing_mark_write: SPI_EV_DALI_RENDER_START
+  <...>-3329  [001] 785155.253178: tracing_mark_write: SPI_EV_DALI_RENDER_END
+  <...>-3329  [001] 785155.264508: tracing_mark_write: SPI_EV_DALI_RENDER_START
+  <...>-3329  [001] 785155.265006: tracing_mark_write: SPI_EV_DALI_RENDER_END
+~~~
+@class _Guide_Performance_Profiling
+*/
+
+
diff --git a/docs/content/shared-javascript-and-cpp-documentation/performance-tips.md b/docs/content/shared-javascript-and-cpp-documentation/performance-tips.md
new file mode 100644 (file)
index 0000000..c8662aa
--- /dev/null
@@ -0,0 +1,46 @@
+/**
+ *
+
+# Performance Tips {#performancetips}
+
+## High CPU occupancy
+
+  - Try to reduce actor count ( less actors == less processing)
+  - Delete any actors that are not visible, or move them off stage
+  - Use TextureAtlases ( reduces OpenGL driver calls to glBindTexture
+  - Optimise / reduce any constraints used
+
+## High GPU occupancy
+
+  - Reduce visible actor count ( == less draw calls)
+  - For 2D UI graphics which require no z sorting you can use
+
+~~~{.cpp}
+// C++
+// In this mode depth testing is turned off and order is determined by the hierachy (depth-first search order).
+// Not always recommended if there is going to be a lot of overdraw ( if lots of actors are on top of each other)
+
+Actor::SetDrawMode( DrawMode::OVERLAY ); // C++
+~~~
+
+~~~{.js}
+// JavaScript
+// In this mode depth testing is turned off and order is determined by the hierachy (depth-first search order).
+// Not always recommended if there is going to be a lot of overdraw ( if lots of actors are on top of each other)
+
+actor.drawMode = dali.DRAW_MODE_OVERLAY;
+~~~
+  - Use TextureAtlases ( reduces state changes in the GPU)
+  - Use compressed textures
+  - Use lower quality textures, e.g. smaller, lower number of bits per pixel
+  - Use Dali::NinePatchImage  where possible.
+  - Avoid using too many textures which contain alpha and require blending
+  - Avoid using too many Dali::Layer with depth testing enabled. Otherwise the layer has to clear the depth buffer.
+  - Optimise any shaders used. Pixel shaders should be kept as lean as possible.
+
+
+@class _Guide_Performance_Tips
+
+*/
+
+
diff --git a/docs/content/shared-javascript-and-cpp-documentation/resource-tracking.md b/docs/content/shared-javascript-and-cpp-documentation/resource-tracking.md
new file mode 100644 (file)
index 0000000..92c1850
--- /dev/null
@@ -0,0 +1,56 @@
+/**
+ *
+# Resource Tracking {#resourcetracking}
+
+## Enable Logging
+
+Setting DALI_ENABLE_LOG environment variable to RESOURCE_LOG will enable resource usage logging in Dali applications.
+On target resource logging utilizes dlog, but this can also be used on desktop by redirecting stderr to a file.
+The generated information includes any image files that are loaded with their dimensions,
+GPU memory consumption, CPU RAM used and details of texture atlases created.
+
+## Viewing Resource Logs
+
+dalireslog.sh is installed as part of the dali-adaptor package and can be found in the adaptors/tizen/scripts folder.
+The script shows a summary of memory used by resources.
+USAGE:
+./dalireslog.sh [FILE]
+if FILE isn't specified, the script will try to use dlogutil.
+
+### Example:
+~~~{.bash}
+sh-4.1$ ./dalireslog.sh
+
+**On a separate terminal:**
+
+sh-4.1$ DALI_ENABLE_LOG=RESOURCE_LOG /opt/apps/com.samsung.dali-demo/bin/album.example
+~~~
+Example on desktop:
+~~~{.bash}
+jon-doe\@ws-1234$ DALI_ENABLE_LOG=RESOURCE_LOG blind-effect.example 2>/home/SERILOCAL/john.doe/log.txt
+
+**On a separate terminal:**
+
+dalireslog.sh ~/log.txt
+
+~~~
+
+### Displayed information:
+
+|  | |
+|--|-|
+| 3D | amount of GPU memory used by application |
+| MEM Atlas | amount of GPU memory used by texture atlases (usually this refers to font atlases)
+| Number of atlases | how many texture atlases are present in memory.|
+
+A list of files is displayed in the main view, with different color codes representing different states:
+
+| | |
+|-|-|
+|CPU | resource is in memory, but hasn't been uploaded to a GL texture.|
+|GPU | resource has been uploaded to a GL texture, bitmap buffer discarded.|
+|CPUGPU | resource has been uploaded to a GL texture, but still present in CPU memory as well.|
+|DISCARDED | resource has been discarded, memory freed up |
+
+@class _Guide_ResourceTracking
+ */
diff --git a/docs/content/shared-javascript-and-cpp-documentation/scene-graph.md b/docs/content/shared-javascript-and-cpp-documentation/scene-graph.md
new file mode 100644 (file)
index 0000000..3092fa2
--- /dev/null
@@ -0,0 +1,20 @@
+# Scene Graph
+## What is a scene graph?
+From wikipedia...
+  
+A scene graph is a collection of nodes in a graph or tree structure.
+A node may have many children but often only a single parent,
+with the effect of a parent applied to all its child nodes;
+an operation performed on a group automatically propagates
+its effect to all of its members. In many programs, associating
+a geometrical transformation matrix (see also transformation and matrix)
+at each group level and concatenating such matrices together is an
+efficient and natural way to process such operations. A common feature,
+for instance, is the ability to group related shapes/objects into a
+compound object that can then be moved, transformed, selected,
+etc. as easily as a single object.
+
+ ### How does this relate to the Dali public API?
+
+ Actors are effectively nodes that receive input (touch events) and act as a
+ container for draw-able elements (which are also nodes) and other actors.
\ No newline at end of file
diff --git a/docs/content/shared-javascript-and-cpp-documentation/script-hello.md b/docs/content/shared-javascript-and-cpp-documentation/script-hello.md
new file mode 100644 (file)
index 0000000..488cb8b
--- /dev/null
@@ -0,0 +1,67 @@
+/**
+ *
+ # Hello World - JSON layout{#script-hello}
+
+ The following JSON code is the minimum required to put the sentence "Hello World" on the screen.
+
+~~~{.json}
+{
+ // a tree of actors
+ "stage": [{
+   "name": "text-label",
+   "type": "TextLabel",
+   "text": "Hello World",
+   "parent-origin": "CENTER"
+ }]
+}
+~~~
+
+ The following code loads the JSON file
+
+~~~{.cpp}
+ // C++
+ Builder builder = Builder::New();
+
+ std::string json_data(ReadFile("layout.json"));
+
+ builder.LoadFromString(json_data);
+
+ builder.AddActors( Stage::GetCurrent().GetRootLayer() );
+
+ ~~~
+
+ ~~~{.js}
+ // JavaScript
+
+ var builder = new dali.Builder();
+
+ builder.loadFromFile("layout.json");
+
+ builder.addActors( dali.stage.getRootLayer )
+
+~~~
+ ## Hello World - Javascript
+
+ The Dali script application is needed to run the Javascript which provides a Javascript runtime and an interface to Dali.
+
+~~~
+ scripting.example hello-world.js
+~~~
+
+ The TextLabel control to display Hello World can be constructed using Javascript dot notation accessing Dali Actor Properties.
+
+~~~{.js}
+// JavaScript
+
+ var textLabel = new dali.TextLabel();
+
+ textLabel.text         = "Hello World";
+ textLabel.fontFamily   = "FreeSans";
+ textLabel.fontStyle    = "Regular";
+ textLabel.parentOrigin = dali.CENTER;
+
+ dali.stage.add( textLabel );
+~~~
+
+@class _Guide_Script_Hello_World
+ */
\ No newline at end of file
diff --git a/docs/content/shared-javascript-and-cpp-documentation/script-json-specification.md b/docs/content/shared-javascript-and-cpp-documentation/script-json-specification.md
new file mode 100644 (file)
index 0000000..002eac7
--- /dev/null
@@ -0,0 +1,516 @@
+/**
+ *
+[TOC]
+
+# DALi JSON Specification  {#script-json-specification}
+
+## Overview {#overview}
+
+This document describes the Dali JSON specification.
+The format is not yet formally versioned within the JSON.
+
+# General format {#format}
+
+The JSON format supports
+
+- Named templates for on demand creation of
+ - Actors/ Controls
+ - Animations
+- Style sets
+ - Dynamically change the style of Actor hierarchies
+ - Animate to a style set
+- Includes
+ - Build style sets up by merging JSON
+- Creating Scene content on load
+ - Controls created without any code
+
+
+Concrete Actors and Controls can be created from types registered in the
+Dali Type Registry.
+
+Template, style and scene sections all configure Actors and Controls via
+the Dali property system.
+
+The JSON format deviates from the formal JSON specification and allows C style comments.
+
+~~~
+    {                                        //
+      "version": 0,                          // Version Number
+      "includes":                            // Include section
+      [                                      //
+       "base-theme.json"                     // Include file to merge into the
+                                             // JSON
+      ]                                      //
+      "constants":                           // Constant replacement section
+      {                                      //
+        ...                                  //
+      },                                     //
+      "templates":                           // Template library section
+      {                                      //
+        "basic-text":                        // A named template
+        {                                    // } key value properties
+         ...                                 //
+         "actors":                           // A tree of sub actors
+         [                                   //
+         ...                                 //
+         ]                                   //
+        }                                    //
+        },                                   //
+        "styles":                            // Named Style set section
+        {                                    //
+        "light-theme":                       // Style set name
+        {                                    //
+         ...                                 //
+        },                                   //
+        dark-theme":                         //
+        {                                    //
+         ...                                 //
+        },                                   //
+      }                                      //
+      "stage":                               // Stage section
+      [                                      //
+       {                                     // Actors|Controls to create on JSON file load
+       "type": "basic-text",                 // A Dali Control or a template name
+       "styles":["base-theme","light-theme"] // Style list to apply to this instance
+       }                                     //
+      ]                                      //
+    }                                        //
+~~~
+
+# Top level sections {#sections}
+
+## Includes {#includes}
+
+The "includes" section is an array of filenames to be merged in order to
+create a final in memory JSON tree.
+
+The merge process will walk key, value attributes from the root JSON
+node and overwrite previous values with the newer values.
+
+- If the key does not exist then it will be created.
+- If the newer value is a different type then the newer type will persist.
+- Where both values are objects the merge will descend into the object.
+- Where both values are arrays the merge will replace the old array entirely.
+
+The merge is relatively simple and is expected to be used to build up
+from base themes to custom themes where there are few conflicts and
+simple direct replacements are desired.
+
+### Constants {#constants}
+
+The merge behaviour when a file has constants and includes is
+
+1. Constants are loaded first
+2. Includes file list is merged in order
+3. All other (non constant) data is merged
+
+The include merge is recursive, so step (2) above will cause the
+constants in the first included file to be merged first.
+
+## Constants {#constantdetail}
+
+The constants section supports sub-string and full property replacement.
+
+~~~
+    {
+    "constants":                        // Constant replacement section
+    {                                   //
+      "IMAGES": "/usr/share/images/",   // Constants can be set here or in code.
+      "SIZE": [100,100,1]               //
+    },                                  //
+    ...                                 //
+    {                                   //
+      "type":"ImageActor"               // An Dali type or a template name
+      "image":                          //
+      {                                 //
+        "filename":"{IMAGES}b.jpg"      // Image filename substring replacement
+      },                                //
+      "size": "{SIZE}"                  //
+    }                                   //  Property replacement
+    }                                   //
+~~~
+
+The type of the constant should match the expected type of the property.
+
+A property constant cannot be used for sub string replacement; a string
+constant should be used.
+
+With a property replacement, the replace site must contain a string
+where the first and last positions are braces.
+
+## Templates {#templates}
+
+The template section supports the creation of actor instances. The
+template name can be used in code to create an actor tree.
+
+~~~{.js}
+// JavaScript
+
+var builder = new dali.Builder();
+builder.loadFromFile( "my-app.json");
+var userActorTree = builder.create( { template:"basic-text"} );
+~~~
+
+~~~{.cpp}
+// C++
+
+Builder builder = Builder::New();
+std::string jsonData = loadFile("my-app.json");
+builder.LoadFromString( jsonData );
+
+actorTree = builder.Create("basic-text");
+~~~
+
+Templates consist of a name, multiple property-value configurations and
+an optional actor sub hierarchy.
+
+~~~{.json}
+   {                                    //
+   "templates":                         //  Template library section
+   {                                    //
+   "basic-text":                        //  The template name
+   {                                    //
+     "type":"ImageActor",               //  Concrete Dali Type/Class to create
+     "styles":["base-style"],           //  Style list to apply
+     "name":"image",                    //  }
+     "image":                           //  } property name : value
+     {                                  //  }
+     "filename":"{IMAGES}/b.jpg"        //
+     },                                 //
+     "parent-origin": "CENTER"          //
+     ...                                //
+     "actors":                          //  A tree of sub actors
+     [                                  //
+     {                                  //
+     "type":"TextView"                  //
+     "name":"text",                     //
+     "text":"Hello World",              //
+     "parent-origin": "CENTER",         //
+     }                                  //
+     ]                                  //
+   }                                    //
+   }                                    //
+~~~
+
+A template has a special 'type' property which must contain a concrete
+Dali Actor or Control type name.
+
+A template has a special 'styles' property which contains a list of
+styles to apply when creating using the template.
+
+## Styles {#styles}
+
+The styles section supports a named set of properties that can be
+applied to an actor or actor tree.
+
+~~~{.cpp}
+// C++
+
+Builder.ApplyStyle("light-theme", myActor);
+~~~
+
+~~~{.js}
+// JavaScript
+
+builder.applyStyle("light-theme", myActor);
+~~~
+
+
+The styles can also be applied as an animation.
+
+~~~{.cpp}
+Builder.AnimateTo("light-theme", myActor, TimePeriod(0, 10));
+~~~
+
+
+
+~~~
+   {                                   //
+   "styles":                           // Style set section
+   {                                   //
+   "light-theme":                      // Style-set name
+   {                                   //
+     "color":[1,1,1,1]                 // }
+     "position":[0,-120,0],            // } properties to set on the given actor
+     "rotation":[0,0,30],              // }
+     "actors":                         //
+     {                                 // Sub Actors are referenced by name
+       "title-text":                   // Actor name to search for under given actor
+       {                               //
+         "color":[1,1,1,1]             // }
+         "position":[0,-120,0],        // } properties to set if 'title-text' is found
+         "rotation":[0,0,30],          // }
+       }
+     },                                //
+     "icon":                           //
+     {                                 //
+       "color":[1,1,1,1]               //
+     }                                 //
+    },                                 //
+    "dark-theme":                      //
+    {                                  //
+    }                                  //
+   }                                   //
+~~~
+
+When applied to an actor tree the actors are referenced by name. Names
+are not unique in Dali.
+
+When a style is applied in code Dali will perform a depth first search
+stopping with the first matching name.
+
+Typically an application developer will apply the style to the template
+root actor and not the stage root actor. Therefore in most uses cases
+name conflicts are not expected.
+
+## Animations {#animations}
+
+The animation section defines a library of animation definitions.
+
+The animations can be created by name from code.
+
+They can also be created automatically from JSON in an actor signal.
+
+~~~
+    {                                    //
+    "animations":                        // Animation library
+    {                                    //
+     "rotate":                           // An Animation named rotate
+     {                                   //
+     "duration": 10,                     // Duration in seconds
+     "loop": false,                      // Whether to loop.
+     "end-action": "Bake",               // Whether to set final value(bake) or
+                                         // reset
+     "disconnect-aciton": "Discard",     // Whether 'Bake' or 'Discard' when disconnected
+     "properties":
+     [
+                                         // Properties changed in this animation
+     {
+     "actor":"image",                    // Actor found by name from the stage
+     "property":"rotation",              // Property to change
+     "value":[0, 0.1, 0, 0],             // Value to set
+     "alpha-function": "EASE\_IN\_OUT",  // Interpolation function
+                                         //
+     "time-period":                      // Time period for change
+     {"delay": 0,
+      "duration": 3
+      }
+     },
+     ...                                 // 1 or more property changes per animation
+     },                                  //
+     ...                                 //
+    },                                   //
+~~~
+
+### Splines {#splines}
+
+An animation property can be defined with a path and forward direction
+instead of a single final value.
+
+Paths are defined in a top level path section and referenced by the
+animation property.
+
+~~~
+    {                                    //
+    "paths":                             // Path library
+     {                                   //
+     "path0":                            // Path definition by name
+     {                                   //
+     "points":[                          // points
+       [-150, -50, 0],
+       [0.0,70.0,0.0],
+       [190.0,-150.0,0.0]
+      ],
+                                         // curvature automatically creates
+     "curvature":0.35,                   // control-points
+                                         //
+     "control-points": [...]             // Otherwise control-points can be
+                                         // directly specified.
+     }                                   //
+     },                                  //
+    "animations":                        //
+    {                                    //
+     "path-animation":
+     {
+     "duration": 3.0,
+     "properties":
+     [
+     {
+     "actor": "greeting2",
+                                         // Path is mandatory for spline
+     "path":"path0",                     // animation.
+     "forward":[1,0,0],                  // Forward vector specifies orientation
+                                         // whilst travelling along the path
+     "alpha-function": "EASE\_IN\_OUT",  // (optional)
+     "time-period":
+     {
+     "delay": 0,
+     "duration": 3
+     }
+     },
+     ...
+                                         // Other properties changes can use
+     ]                                   // paths or values in the same
+                                         // animation.
+    },                                   //
+    }                                    //
+~~~
+
+## Shaders {#shaders}
+
+The shader section of the JSON file defines a library of shader effect
+instances that are created on demand.
+
+The shaders are referred to by name from the template, style, stage or
+animation sections.
+
+Multiple actors can set the same shader as the name refers to a single
+instance.
+
+Similarly one named shader instance can be set to several actors and can
+be animated by one animation.
+
+~~~
+    {                                             //
+    "shader-effects":                             // Shader Effect section
+    {                                             //
+      "myshader1":                                // Shader  instance  name
+      {                                           //
+       "program":                                 //
+       {                                          // Prefixs are placed before DALi uniforms.
+         "vertexPrefix": "",                      // (Useful for \#defines.)
+         "vertex":"",                             // Glsl vertex program
+         "fragmentPrefix": "",
+         "fragment": "",                          // Glsl fragment program.
+         "geometry-type": "GEOMETRY_TYPE_IMAGE",  // Geometry type(see DALi documentation)
+       },
+       "geometry-hints": "HINT_NONE":             // Geometry hints (see DALi documentation)
+       "grid-density": 0,                         // Grid density(see DALi documentation)
+       "image":
+       {
+         "filename": ""                           // Effect image available as a second texture unit.
+       }
+     },
+     ...
+    },
+    "stage":
+    [{
+     "type": "ImageActor",
+     "effect": "myshader1",
+     ...
+    }]
+    }
+~~~
+
+At least one of the vertex or fragment fields is mandatory. All
+other fields are optional will use internal defaults.
+
+Actors have an "effect" field that refers to the shader effect
+instance to use with that actor.
+
+### Animating shaders {#animatingshaders}
+
+Shader uniforms can be animated as if they are properties of the actor.
+
+When the animation is created from code (or from a signal) the property
+name search begins on the actor, if it isn't found the search continues
+on the attached shader object.
+
+The actor property names and shader uniform names must not clash for the
+uniform to animate correctly. The convention in DALi is to prepend
+uniforms with 'u'.
+
+~~~
+    {                                    \\
+    "animations":                        \\ Animation library
+    {                                    \\
+     "rotate":                           \\ An Animation named rotate
+     {                                   \\
+     "duration": 10,                     \\
+     "properties":                       \\ Properties changed in this animation
+     [                                   \\
+     {
+     "actor":"image",                    \\ Actor found by name from the stage
+     "property":"uTranslate",            \\ Uniform name specified as if it is a
+                                         \\ property of the object.
+     "value":[10, 20],
+     ...
+     },
+     ...
+     ]
+     },
+     "shader-effects":
+     {
+     "myshader1":
+     {
+                                        \\ Shader program with uniform
+     "program": {...}                   \\ "uTranslate"
+     }
+     },
+     "actors":
+     [
+     {
+     "name": "image",
+     "effect": "myshader1"              \\ Actor using shader effect instance
+                                        \\ "myshader1"
+     }
+     ]
+    },
+~~~
+
+## Stage {#stage}
+
+The stage section supports the immediate creation of actors at the time
+the JSON is loaded.
+
+The stage is a tree of actors that can be added to Dali's stage object.
+
+~~~
+// C++
+builder = Dali.Builder();
+json_text = load("layout.json");
+builder.Load(json\_text);
+stage = Dali.Stage.GetCurrent();
+builder.AddActors( stage.GetRootLayer()); // Add actors to the stage root layer
+~~~
+
+~~~{.js}
+// JavaScript
+
+builder.addActors( dali.stage.getRootLayer() );
+~~~
+
+~~~
+    {                                    \\
+    "stage":                             \\  Stage Section Number
+    [                                    \\  An array of actors
+     {
+     "type": "ImageActor",
+     ...
+     "actors":                           \\  Each actor can have children
+                                         \\ creating a tree
+     [
+     {
+     "type": "TextView",
+                                         \\  The Type to create; this can be a
+     ...                                 \\ concrete Dali type (actor/control)
+                                         \\ or a template name.
+     "styles": ["base-style"]
+                                         \\  A list of styles to apply to the
+     }                                   \\ created type.
+     ]
+     }
+    ]
+    }
+~~~
+
+# Actor and Control Properties {#actorprop}
+
+Each control has a set of supported properties documented in the "Dali
+UI Control Specification".
+
+Please refer to the above document for further information about specific
+controls.
+
+@class _Guide_JSON_Specification
+*/
diff --git a/docs/content/shared-javascript-and-cpp-documentation/script-overview.md b/docs/content/shared-javascript-and-cpp-documentation/script-overview.md
new file mode 100644 (file)
index 0000000..311ad9f
--- /dev/null
@@ -0,0 +1,264 @@
+/**
+ *
+# Scripting Overview  {#scriptoverview}
+
+Dali has:
+- JSON to support:
+ - layouting
+ - theme / styling
+ - templated actor/control creation
+ - basic actions
+ - DALi GUI builder generates JSON files. Allows UI designers to create / modify the application look and feel.
+
+- JavaScript to support:
+ - Rapid Application Development
+ - Hybrid C++/JavaScript applications
+ - Leaverage third party JavaScript modules (backbone.js etc)
+
+JSON support is built in to DALi.
+
+JavaScript support is via a plugin held in dali-toolkit, which builds automatically if Google's V8 engine is installed. 
+The V8 version required by DALi can be built and installed using dali-core/scripts/dali_env script.
+
+Files can be loaded inside any DALi application, or from command line using the launcher ( part of dali-demo).
+
+~~~{.cpp}
+scripting.example hello-world.json hello-world.js
+~~~
+
+We currently have JSON and JavaScript example files held in dali-demo/resources/scripts
+  
+![ ](../assets/img/javascript-wrapping-guide/scripting-overview.png)
+![ ](scripting-overview.png)
+
+# JSON
+
+JSON file contains different sections:
+- **Templates** actor & control tree creation
+- **Styles** used to style actor & control trees
+- **Animations**
+- **Instances** of objects for path, shader-effects, render-tasks, frame-buffers
+- **Stage**. A list of actors / controls that can be added to the stage
+- **Constants**  (e.g. positions / colors, that can be references by other parts of the JSON file);
+- **Actions**
+  
+## Examples
+
+### JSON templates section
+  
+~~~{.json}
+
+    “templates”:
+    {
+      "name":"users",
+      "type":"Actor",
+      "parent-origin":"TOP_CENTER",
+      "anchor-point":"TOP_CENTER",
+      "size":"{DEFAULT_MENU_USER_SIZE}",
+      "color-mode":"USE_OWN_COLOR",
+      "actors":
+      [
+        {
+          "name":"usersBackground",
+          "type":"ImageActor",
+          "parent-origin":"CENTER",
+          "anchor-point":"CENTER",
+          "size":"{DEFAULT_MENU_USER_SIZE}",
+          "color-mode":"USE_OWN_COLOR",
+          "image":{ "filename":"{IMAGE_PATH}white-pixel.png" },
+          "color":"{DEFAULT_MENU_BACKGROUND_COLOR}"
+        },
+        {
+          "name":"icon",
+          "type":"ImageActor",
+          "parent-origin":"TOP_CENTER",
+          "anchor-point":"TOP_CENTER",
+          "position":[0,41,1],
+          "image":{ "filename":"{IMAGE_PATH}ico_man_nor.png" }
+        },
+      ]
+    },
+
+
+~~~
+
+#### JavaScript example
+
+~~~{.js}
+
+var builder = new dali.Builder();
+
+builder.loadFromFile( "my-app.json");
+
+var userActorTree = builder.create( { template:"users"} );
+
+~~~
+
+#### C++ example
+
+~~~{.cpp}
+Builder builder = Builder::New();
+
+std::string jsonData = loadFile("my-app.json");
+
+builder.LoadFromString( jsonData );
+
+Actor userActorTree = builder.Create("users");
+~~~
+
+
+### JSON styles section
+
+~~~{.json}
+“styles”:
+  {
+    “live-tv-focus":
+    {
+      "actors":
+      {
+        "background":
+        {
+          "image":{ "filename":"{IMAGE_PATH}live_tv_background.png" },
+          "color":"{DEFAULT_MENU_ITEM_COLOR_1}"
+        },
+        "icon":
+        {
+          "image":{ "filename":"{IMAGE_PATH}icn_live_tv_foc.png" }
+        },
+        "label":
+        {
+          "color-alpha":1,
+          "text":"<font size='20' weight='bold'><b>LIVE</b></font>"
+        }
+      }
+    },
+  }
+~~~
+
+#### JavaScript example
+
+~~~{.js}
+builder.applyStyle( "live-tv-focus", tvIcon );
+~~~
+
+#### C++ example
+
+~~~{.cpp}
+builder.ApplyStyle( "live-tv-focus", tvIcon );
+~~~
+
+### JSON animations section
+
+~~~{.json}
+"animations":
+  {
+    "animate-show":
+    {
+      "duration":0.5,
+      "properties":
+      [
+        {
+          "actor":"background",
+          "property":"position-x",
+          "value":30,
+          "alpha-function":"EASE_IN_OUT"
+        },
+        {
+          "actor":"itemsBackground",
+          "property":"color-alpha",
+          "value":0.85,
+          "time-period": {"delay": 0.25, "duration": 0.25 },
+          "alpha-function":"EASE_IN_OUT"
+        },
+        {
+          "actor":"usersBackground",
+          "property":"color-alpha",
+          "value":0.85,
+          "time-period": {"delay": 0.25, "duration": 0.25 },
+          "alpha-function":"EASE_IN_OUT"
+        }
+      ]
+    },
+~~~
+
+#### JavaScript example
+
+~~~{.js}
+// JavaScript
+
+var anim = builder.createAnimation( { animation:"animate-show", actor: myActor } );
+~~~
+
+~~~{.cpp}
+// C+++
+
+Animation anim = builder.createAnimation( "animate-show", propertyMap );
+~~~
+
+### JSON stage section
+
+~~~{.json}
+
+“stage": [{
+      "name":"simple-table",
+      "type":"TableView",
+      "background-color": [0.5,0.5,0,1],
+      "parent-origin": "CENTER",
+      "size":[400,500,1],
+      "rows": 4,
+      "columns":4,
+      "cell-padding": [10, 5],
+      "layout-animation-duration": 0.5,
+      "layout-rows": {  // set the height of the rows
+        "0": { "policy": "fixed", "value": 40 },
+        "1": { "policy": "relative", "value": 0.33 },
+        "2": { "policy": "fixed", "value": 120 }
+      },
+      "layout-columns": { // set the widths of the columns
+        "1": { "policy": "fixed", "value": 150 },
+        "2": { "policy": "relative", "value": 0.35 },
+        "3": { "policy": "relative", "value": 0.15 }
+      },
+      "actors": [{
+          "name":"gallery-1",
+          "type":"ImageActor",
+          "image": {
+            "filename": "{DALI_IMAGE_DIR}gallery-large-1.jpg"
+          },
+          "custom-properties": { // properties registered dynamically
+            "cell-indices": [0,0],// property to specify the top-left cell this child occupies
+            "row-span":4, // property to specify how many rows this child occupies, if not set, default value is 1
+            "column-spam":1 // property to specify how many columns this child occupies
+            ....
+~~~
+
+#### JavaScript example
+
+~~~{.js}
+// add all actors under stage section to the root layer
+builder.addActors( dali.stage.getRootLayer() );
+~~~
+
+#### C++ example
+
+~~~{.cpp}
+// add all actors under stage section to the root layer
+builder.AddActors( Stage::GetCurrent().GetRootLayer() );
+~~~
+
+# JavaScript
+
+For the JavaScript API please build dali-toolkit with YUIDOC installed. This will generate the documentation.
+See dali-toolkit/plugins/dali-script-v8/docs/README.txt
+
+To execute JavaScript from C++
+
+~~~{.cpp}
+script = Toolkit::Script::New();
+
+script.ExecuteFile( scriptFileName );
+~~~
+
+@class _Guide_JSON_and_JavaScript_overview
+
+*/
\ No newline at end of file
@@ -1,63 +1,84 @@
-/*! \page text-label Text Label
+/**
  *
-\section overview Overview
-The Dali::Toolkit::TextLabel is a Dali::Toolkit::Control which renders a short text string.\n
+
+# Text Label {#text-label}
+
+## Overview
+
+The Dali::Toolkit::TextLabel is a Dali::Toolkit::Control which renders a short text string.  
 Text labels are lightweight, non-editable and do not respond to user input.
 
-\subsection basictextlabelusage Basic usage
+### Basic usage
 
 To display a TextLabel the TEXT property must be set using a UTF-8 string.
 
-\code
+~~~{.cpp}
+// C++
+
 TextLabel label = TextLabel::New();
 label.SetProperty( TextLabel::Property::TEXT, "Hello World" );
 label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
 Stage::GetCurrent().Add( label );
-\endcode
-
-The label must also be added to the stage, or to an actor which is on the stage.\n
-The position of the label on-screen is dependent on the parent-origin and anchor-point properties.\n
-
-<table border=0 cellpadding=10>
-<tr>
-  <td>
-  \image html TextLabelTopLeft.png
-  </td>
-</tr>
-<tr>
-  <td>
-  (ParentOrigin::TOP_LEFT, AnchorPoint::TOP_LEFT)
-  </td>
-</tr>
-</table>
-
-\subsection fontSelection Font Selection
-
-By default TextLabel will automatically select a suitable font from the platform.\n
-Typically fonts do not support all scripts, for example Latin fonts often do not provide Arabic glyphs.\n
+~~~
+
+~~~{.js}
+// JavaScript
+
+var label = new dali.TextLabel();
+
+label.text = "Hello World";
+label.anchorPoint = dali.TOP_LEFT;
+
+dali.stage.add( label );
+~~~
+
+The label must also be added to the stage, or to an actor which is on the stage.  
+The position of the label on-screen is dependent on the parent-origin and anchor-point properties.  
+
+|  |  |
+|--|--|
+| (ParentOrigin::TOP_LEFT, AnchorPoint::TOP_LEFT) | ![ ](../assets/img/text-controls/TextLabelTopLeft.png) ![ ](TextLabelTopLeft.png)   |
+
+### Font Selection
+
+By default TextLabel will automatically select a suitable font from the platform.  
+Typically fonts do not support all scripts, for example Latin fonts often do not provide Arabic glyphs.  
 Therefore you should expect TextLabel to select different fonts for each script.
 
 Alternatively a font may be requested using either or all of FONT_FAMILY, FONT_STYLE, and POINT_SIZE properties:
-\code
+
+~~~{.cpp}
+// C++
+
 label.SetProperty( TextLabel::Property::FONT_FAMILY, "HelveticaNue" );
 label.SetProperty( TextLabel::Property::FONT_STYLE,  "Regular" );
 label.SetProperty( TextLabel::Property::POINT_SIZE,  12.0f );
-\endcode
+~~~
+
+~~~{.js}
+// JavaScript
+
+label.fontFamily = "HelveticaNue";
+label.fontStyle = "Regular";
+label.pointSize = 12;
+~~~
+
 However the TextLabel will fall-back to using the default font, if the requested font does not support the required scripts.
 
-\subsection fontStyles Font Styles
+### Font Styles
 
-Setting a font size programmatically is not ideal for applications which support multiple screen resolutions etc.\n
-A more flexible approach is to prepare various JSON stylesheets, and request a different style for each platform:\n
+Setting a font size programmatically is not ideal for applications which support multiple screen resolutions etc.  
+A more flexible approach is to prepare various JSON stylesheets, and request a different style for each platform:  
 
-\code
+~~~{.cpp}
+// C++
 StyleManager styleManager = StyleManager::Get();
 styleManager.RequestThemeChange( "example-path/example.json" );
-\endcode
+~~~
 
 To change the font for standard text labels, this JSON syntax can be used:
 
-\code
+~~~{.json}
 {
   "styles":
   {
@@ -69,16 +90,23 @@ To change the font for standard text labels, this JSON syntax can be used:
     }
   }
 }
-\endcode
+~~~
 
-However the same point-size is unlikely to be suitable for all labels in an application.\n
+However the same point-size is unlikely to be suitable for all labels in an application.  
 To set custom sizes simply set a "style name" for each case, and then provide a style override in JSON:
 
-\code
+~~~{.cpp}
+  // C++
+
   label.SetProperty( Control::Property::STYLE_NAME, "custom" );
-\endcode
+~~~
+~~~{.js}
+  // JavaScript
+
+  label.styleName = "custom"';
+~~~
 
-\code
+~~~{.json}
 {
   "styles":
   {
@@ -95,101 +123,104 @@ To set custom sizes simply set a "style name" for each case, and then provide a
     }
   }
 }
-\endcode
+~~~
 
-In the example above, standard text labels will have point-size 8, and "custom" labels will have point-size 10.\n
+In the example above, standard text labels will have point-size 8, and "custom" labels will have point-size 10.  
 
-\subsection textAlignment Text Alignment
+### Text Alignment
+
+Wrapping can be enabled using the MULTI_LINE property:
+
+~~~{.cpp}
+// C++
 
-Wrapping can be enabled using the MULTI_LINE property:\n
-\code
 label.SetProperty( TextLabel::Property::MULTI_LINE, true );
-\endcode
+~~~
+
+~~~{.js}
+// JavaScript
+
+label.mutliLine = true;
+~~~
 
 The text can be either aligned horizontally to the beginning, end, or center of the available area:
-\code
+
+~~~{.cpp}
+// C++
+
 label.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "BEGIN" ); // "CENTER" or "END"
-\endcode
-
-<table border=0 cellpadding=10>
-<tr>
-  <td>
-  Here is the "BEGIN" alignment shown for left-to-right (Latin) and right-to-left (Arabic) scripts:
-  </td>
-</tr>
-<tr>
-  <td>
-  \image html LatinBegin.png
-  </td>
-  <td>
-  \image html ArabicBegin.png
-  </td>
-</tr>
-<tr>
-  <td>
-  Here is the "CENTER" alignment shown for left-to-right (Latin) and right-to-left (Arabic) scripts:
-  </td>
-</tr>
-<tr>
-  <td>
-  \image html LatinCenter.png
-  </td>
-  <td>
-  \image html ArabicCenter.png
-  </td>
-</tr>
-<tr>
-  <td>
-  Here is the "END" alignment shown for left-to-right (Latin) and right-to-left (Arabic) scripts:
-  </td>
-</tr>
-<tr>
-  <td>
-  \image html LatinEnd.png
-  </td>
-  <td>
-  \image html ArabicEnd.png
-  </td>
-</tr>
-</table>
-
-The examples above assume that the TextLabel size greater than the minimum required.\n
+~~~
+
+~~~{.js}
+// JavaScript
+
+label.HorizontalAlignment = "BEGIN"; // "CENTER" or "END"
+~~~
+
+|  |  |
+|--|--|
+| Here is the "BEGIN" alignment shown for left-to-right (Latin)   |  right-to-left (Arabic) scripts |
+| ![ ](../assets/img/text-controls/LatinBegin.png) ![ ](LatinBegin.png) | ![ ](../assets/img/text-controls/ArabicBegin.png) ![ ](ArabicBegin.png) |
+| Here is the "CENTER" alignment shown for left-to-right (Latin)  | right-to-left (Arabic) scripts:|
+| ![ ](../assets/img/text-controls/LatinCenter.png) ![ ](LatinCenter.png) | ![ ](../assets/img/text-controls/ArabicCenter.png) ![ ](ArabicCenter.png) |
+| Here is the "END" alignment shown for left-to-right (Latin)  | right-to-left (Arabic) scripts:|
+| ![ ](../assets/img/text-controls/LatinEnd.png) ![ ](LatinEnd.png) | ![ ](../assets/img/text-controls/ArabicEnd.png) ![ ](ArabicEnd.png) |
+
+
+The examples above assume that the TextLabel size greater than the minimum required.  
 The next section provides details about the other size related options.
 
-\subsection negotiatingSize Negotiating size
+## Negotiating size
+
+\link size-negotiation Size negotiation \endlink is a layouting feature supported by UI controls such as TextLabel.
+  
+There are several resize policies which are commonly used with TextLabels.
+  
+The following examples show TextLabels actual size by setting a colored background, whilst the black area represents the size of the parent control:  
 
-\link size-negotiation Size negotiation \endlink is a layouting feature supported by UI controls such as TextLabel.\n
-There are several resize policies which are commonly used with TextLabels.\n
-The following examples show TextLabels actual size by setting a colored background, whilst the black area represents the size of the parent control:\n
+### Using natural size
 
-<h3>Using natural size</h3>
+With a "natural" size TextLabel will be large enough to display the text without wrapping, and will not have extra space to align the text within.  
+Therefore in this example the same result would be displayed, regardless of the alignment or multi-line properties.  
 
-With a "natural" size TextLabel will be large enough to display the text without wrapping, and will not have extra space to align the text within.\n
-Therefore in this example the same result would be displayed, regardless of the alignment or multi-line properties.\n
+~~~{.cpp}
+// C++
 
-\code
 TextLabel label = TextLabel::New( "Hello World" );
 label.SetAnchorPoint( AnchorPoint::TOP_LEFT );
 label.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
 label.SetBackgroundColor( Color::BLUE );
 Stage::GetCurrent().Add( label );
-\endcode
+~~~
+
+~~~{.js}
+// JavaScript
+
+var label = new dali.Textlabel;
+label.text = "Hello World";
+label.anchorPoint = dali.TOP_LEFT;
+
+label.widthResizePolicy = "USE_NATURAL_SIZE";
+label.heightResizePolicy = "USE_NATURAL_SIZE";
+
+label.textColor = dali.COLOR_WHITE;
+// background color not available as it's currently not a property of control
+dali.stage.add( label );
+~~~
+
+
+ ![ ](../assets/img/text-controls/HelloWorld-NaturalSize.png)
+ ![ ](HelloWorld-NaturalSize.png)
 
-<table border=0 cellpadding=10>
-<tr>
-  <td>
-  \image html HelloWorld-NaturalSize.png
-  </td>
-</tr>
-</table>
 
-<h3>Height-for-width negotiation</h3>
+### Height-for-width negotiation
 
-To layout text labels vertically, a fixed (maximum) width should be provided by the parent control.\n
-Each TextLabel will then report a desired height for the given width.\n
+To layout text labels vertically, a fixed (maximum) width should be provided by the parent control.  
+Each TextLabel will then report a desired height for the given width.  
 Here is an example of this behavior using TableView as the parent:
 
-\code
+~~~{.cpp}
+// C++
 TableView parent = TableView::New( 3, 1 );
 parent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 parent.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
@@ -221,123 +252,169 @@ label.SetBackgroundColor( Color::BLUE );
 label.SetProperty( TextLabel::Property::MULTI_LINE, true );
 parent.AddChild( label, TableView::CellPosition( 2, 0 ) );
 parent.SetFitHeight( 2 );
-\endcode
+~~~
+
+ ![ ](../assets/img/text-controls/HelloWorld-HeightForWidth.png)
+ ![ ](HelloWorld-HeightForWidth.png)
 
-<table border=0 cellpadding=10>
-<tr>
-  <td>
-  \image html HelloWorld-HeightForWidth.png
-  </td>
-</tr>
-</table>
 
 Note that the "Hello World" text label (above) has been given the full width, not the natural width.
 
-\subsection textLabelDecorations TextLabel Decorations
+### TextLabel Decorations
 
-<h3>Color</h3>
+#### Color
 
-To change the color of the text, the recommended way is to use the TEXT_COLOR property.\n
-Note that unlike the Actor::COLOR property, this will not affect child Actors added to the TextLabel.\n
+To change the color of the text, the recommended way is to use the TEXT_COLOR property.  
+Note that unlike the Actor::COLOR property, this will not affect child Actors added to the TextLabel.  
 
-\code
+~~~{.cpp}
+// C++
 label.SetProperty( TextLabel::Property::TEXT, "Red Text" );
 label.SetProperty( TextLabel::Property::TEXT_COLOR, Color::RED );
-\endcode
+~~~
+
+~~~{.js}
+// JavaScript
+
+label.text = "Red Text";
+label.textColor = dali.COLOR_RED;
+~~~
 
-<table border=0 cellpadding=10>
-<tr>
-  <td>
-  \image html RedText.png
-  </td>
-</tr>
-</table>
+ ![ ](../assets/img/text-controls/RedText.png)
+ ![ ](RedText.png)
 
-<h3>Drop Shadow</h3>
+#### Drop Shadow
 
-To add a drop-shadow to the text, simply set the SHADOW_OFFSET property with non-zero values.\n
-The color can also be selected using the SHADOW_COLOR property.\n
+To add a drop-shadow to the text, simply set the SHADOW_OFFSET property with non-zero values.  
+The color can also be selected using the SHADOW_COLOR property.  
+
+~~~{.cpp}
+ // C++
 
-\code
 stage.SetBackgroundColor( Color::BLUE );
 
 label1.SetProperty( TextLabel::Property::TEXT, "Plain Text" );
 
 label2.SetProperty( TextLabel::Property::TEXT, "Text with Shadow" );
 label2.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 1.0f, 1.0f ) );
-label4.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK );
+label2.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK );
 
 label3.SetProperty( TextLabel::Property::TEXT, "Text with Bigger Shadow" );
 label3.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 2.0f, 2.0f ) );
-label4.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK );
+label3.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::BLACK );
 
 label4.SetProperty( TextLabel::Property::TEXT, "Text with Color Shadow" );
 label4.SetProperty( TextLabel::Property::SHADOW_OFFSET, Vector2( 1.0f, 1.0f ) );
 label4.SetProperty( TextLabel::Property::SHADOW_COLOR, Color::RED );
-\endcode
-
-<table border=0 cellpadding=10>
-<tr>
-  <td>
-  \image html PlainText.png
-  </td>
-</tr>
-<tr>
-  <td>
-  \image html TextWithShadow.png
-  </td>
-</tr>
-<tr>
-  <td>
-  \image html TextWithBiggerShadow.png
-  </td>
-</tr>
-<tr>
-  <td>
-  \image html TextWithColorShadow.png
-  </td>
-</tr>
-</table>
-
-<h3>Underline</h3>
-
-The text can be underlined by setting UNDERLINE_ENABLED.\n
-The color can also be selected using the UNDERLINE_COLOR property.\n
-
-\code
+~~~
+
+~~~{.js}
+// JavaScript
+
+dali.stage.setBackgroundColor( dali.COLOR_BLUE );
+
+label1.text = "Plain Text";
+
+
+label2.text = "Text with Shadow";
+label2.shadowOffset = [1, 1];
+label2.shadowColor = dali.COLOR_BLACK;
+
+label3.text = "Text with Bigger Shadow";
+label3.shadowOffset = [2, 2];
+label3.shadowColor = dali.COLOR_BLACK;
+
+label4.SetProperty( TextLabel::Property::TEXT, "Text with Color Shadow" );
+label3.shadowOffset = [1, 1];
+label3.shadowColor = dali.COLOR_RED;
+~~~
+
+
+![ ](../assets/img/text-controls/PlainText.png)
+![ ](PlainText.png)
+
+
+![ ](../assets/img/text-controls/TextWithShadow.png)
+![ ](TextWithShadow.png)
+
+![ ](../assets/img/text-controls/TextWithBiggerShadow.png)
+![ ](TextWithBiggerShadow.png)
+
+
+![ ](../assets/img/text-controls/TextWithColorShadow.png)
+![ ](TextWithColorShadow.png)
+
+
+#### Underline
+
+The text can be underlined by setting UNDERLINE_ENABLED.  
+The color can also be selected using the UNDERLINE_COLOR property.  
+
+~~~{.cpp}
+// C++
 label1.SetProperty( TextLabel::Property::TEXT, "Text with Underline" );
 label1.SetProperty( TextLabel::Property::UNDERLINE_ENABLED, true );
 
 label2.SetProperty( TextLabel::Property::TEXT, "Text with Color Underline" );
 label2.SetProperty( TextLabel::Property::UNDERLINE_ENABLED, true );
 label2.SetProperty( TextLabel::Property::UNDERLINE_COLOR, Color::GREEN );
-\endcode
-
-<table border=0 cellpadding=10>
-<tr>
-  <td>
-  \image html TextWithUnderline.png
-  </td>
-</tr>
-<tr>
-  <td>
-  \image html TextWithColorUnderline.png
-  </td>
-</tr>
-</table>
+~~~
+~~~{.js}
+// JavaScript
+label1.Text = "Text with Underline";
+label1.underlineEnabled = true;
+
+label2.Text = "Text with Color Underline";
+label2.underlineEnabled = true;
+label2.underlineColor = dali.COLOR_GREEN;
+~~~
+
+
+![ ](../assets/img/text-controls/TextWithUnderline.png)
+![ ](TextWithUnderline.png)
+
+
+![ ](../assets/img/text-controls/TextWithColorUnderline.png)
+![ ](TextWithColorUnderline.png)
 
 By default the underline height will be taken from the font metrics, however this can be overridden using the UNDERLINE_HEIGHT property:
 
-\code
+~~~{.cpp}
+// C++
+
 label1.SetProperty( TextLabel::Property::UNDERLINE_HEIGHT, 1.0f );
-\endcode
-
-<table border=0 cellpadding=10>
-<tr>
-  <td>
-  \image html TextWith1pxUnderline.png
-  </td>
-</tr>
-</table>
+~~~
+
+~~~{.js}
+// JavaScript
+
+label1.underlineHeight = 1;
+~~~
+
+![ ](../assets/img/text-controls/TextWith1pxUnderline.png)
+![ ](TextWith1pxUnderline.png)
+
+### Text Label Properties
+
+ Name (JavaScript)   |  Name (C++)         |  Type        | Writable     | Animatable
+---------------------|---------------------|--------------|--------------|-----------
+ renderingBackend    | RENDERING_BACKEND   |  INTEGER     | &#10004;     | &#10008;
+ text                | TEXT                |  STRING      | &#10004;     | &#10008;
+ fontFamily          | FONT_FAMILY         |  STRING      | &#10004;     | &#10008;
+ fontStyle           | FONT_STYLE          |  STRING      | &#10004;     | &#10008;
+ pointSize           | POINT_SIZE          |  FLOAT       | &#10004;     | &#10008;
+ multiLine           | MULTI_LINE          |  BOOLEAN     | &#10004;     | &#10008;
+ horizontalAlignment | HORIZONTAL_ALIGNMENT|  STRING      | &#10004;     | &#10008;
+ verticalAlignment   | VERTICAL_ALIGNMENT  |  STRING      | &#10004;     | &#10008;
+ textColor           | TEXT_COLOR          |  VECTOR4     | &#10004;     | &#10008;
+ shadowOffset        | SHADOW_OFFSET       |  VECTOR2     | &#10004;     | &#10008;
+ shadowColor         | SHADOW_COLOR        |  VECTOR4     | &#10004;     | &#10008;
+ underlineEnabled    | UNDERLINE_ENABLED   |  BOOLEAN     | &#10004;     | &#10008;
+ underlineColor      | UNDERLINE_COLOR     |  VECTOR4     | &#10004;     | &#10008;
+ underlineHeight     | UNDERLINE_HEIGHT    |  FLOAT       | &#10004;     | &#10008;
+
+
+
+@class TextLabel
 
 */
diff --git a/docs/content/shared-javascript-and-cpp-documentation/texture-atlas.md b/docs/content/shared-javascript-and-cpp-documentation/texture-atlas.md
new file mode 100644 (file)
index 0000000..94c0141
--- /dev/null
@@ -0,0 +1,249 @@
+/**
+ *
+# Texture Atlases {#textureatlases}
+
+## Example demo application
+
+![ ](../assets/img/texture-atlas/image-wall.jpg)
+![ ](image-wall.jpg)
+  
+
+Application above is running slow as there are many small individual images displayed (50)
+  
+| Metric | Result | Explanation |
+|--------|--------|-------------|
+| Launch time | Slow | Has to perform: 50 file open requests and multiple reads for each image |
+| Memory consumption|  High | Has to create:50 Dali::Image objects,50 OpenGL Textures|
+| Rendering | Slow | Has to perform: 50 glBindTexture calls per frame ( each OpenGL calls takes time) 50 a frame = 3000 calls per second @60 FPS.Texture switching is a major state change in the GPU|
+  
+
+
+## Solutions to problem: Use a Texture Atlas
+
+A texture atlas is simply one larger image that contains smaller images. A texture atlas is sometimes called a
+sprite sheet, bitmap sheet or texture pack.
+
+![ ](../assets/img/texture-atlas/atlas.jpg)
+![ ](atlas.jpg)
+  
+Dali::ImageActor has the ability to display a portion of an image using ImageActor::PixelArea setting.
+For example to display the first 3 image in the atlas
+  
+![ ](../assets/img/texture-atlas/example-javascript-code.jpg)
+![ ](example-code.jpg)
+
+### Result of using an Atlas
+
+| Metric | Result | Explanation |
+|--------|--------|-------------|
+| Launch time | Fast | Has to perform: - 1 file open request  |
+| Memory consumption|  Low | Has to create: 1 Dali::Image objects 1 OpenGL Textures|
+| Rendering | Fast | HHas to perform: 1 glBindTexture calls per frame ( each OpenGL calls takes time) 1 a frame = 6- calls per second @60 FPS.|
+
+  
+## Atlas creation guide
+
+Many tools exist for creating texture atlases.
+In the following example we are using a tool called TexturePacker as DALi has an exporter script for it.
+The exporter automatically generates a source file that has the ImageActor::PixelArea pre-defined.
+  
+- Download http://www.codeandweb.com/texturepacker
+- Launch TexturePacker
+- Go to the menu File -> Preferences
+- Set the "Exporter directory" to be the location of dali-toolkit/texture-atlas-exporter
+  
+![ ](../assets/img/texture-atlas/texture-packer-preferences.jpg)
+![ ](texture-packer-preferences.jpg)
+  
+- Restart the application!
+- Select DALi 3D framework for new project
+  
+![ ](../assets/img/texture-atlas/texture-packer-startup.jpg)
+![ ](texture-packer-startup.jpg)
+  
+- Create the atlas
+![ ](../assets/img/texture-atlas/texture-packer-add-sprites.jpg)
+![ ](texture-packer-add-sprites.jpg)
+- Click publish to produce the files
+![ ](../assets/img/texture-atlas/texture-packer-publish.jpg)
+![ ](texture-packer-publish.jpg)
+
+
+
+## Using the generated cpp ( contains JavaScript code as well)
+
+The generated cpp file contains 3 different ways of describing the atlas.
+Copy and paste the section that best suits your application.
+-  Lookup table. Includes code for storing the table in a std::map for fast lookup.
+- constants.
+- JavaScript property map
+
+### Using the JavaScript generated property map
+
+The property map should be cut and paste in to your application. It just looks like
+  
+~~~{.js}
+var ATLAS_IMAGE_LIST : [
+    { name: "add_user_usericon_bg", x: 2, y:109, w:105, h:105,  blendMode:dali.BLENDING_ON  },
+    { name: "app_background", x: 180, y:183, w:1, h:1,  blendMode:dali.BLENDING_OFF  },
+    { name: "btn_arrow_left", x: 141, y:183, w:11, h:20,  blendMode:dali.BLENDING_ON  },
+    { name: "btn_arrow_right", x: 154, y:183, w:11, h:20,  blendMode:dali.BLENDING_ON  },
+    { name: "icn_app_foc", x: 194, y:2, w:72, h:72,  blendMode:dali.BLENDING_ON  },
+    { name: "icn_app_nor", x: 109, y:109, w:72, h:72, blendMode:dali.BLENDING_ON  }
+    ]
+var atlas = new dali.ResourceImage( { url: "atlas_filename.png" });
+
+// display the user icon using the size / position data in the ATLAS_IMAGE_LIST
+var userIconData = ATLAS_IMAGE_LIST[0];
+var userIconRect = [ userIconData.x, userIconData.y,userIconData.w,userIconData.h];
+
+var btnArrowLeft = new dali.ImageActor( atlas, userIconRect );
+btnArrowLeft.setBlendMode(userIconData.blendMode);
+
+~~~
+
+![ ](example-javascript-code.jpg)
+
+
+### Using the lookup table in C++
+
+Cut and paste the lookup table code into your application.
+
+~~~{.cpp}
+
+// The following code is automatically generated when TexturePacker publishes to a cpp file.
+const char* ATLAS_FILE_NAME( "my_first_atlas.png" );  ///< Atlas image filename
+
+// Structure to hold image name and position within the atlas.
+struct ImageInfo
+{
+  const char* name;
+  unsigned int x,y,w,h;
+  Dali::BlendingMode::Type blendMode;  // only enable blending if image has alpha
+};
+
+
+// lookup table
+const ImageInfo ImageAtlas[]=
+{
+ { "blocks-ball", 2, 198, 51, 51, BlendingMode::ON },
+ { "bubble-ball", 288, 74, 32, 32, BlendingMode::ON },
+ { "gallery-small-52", 2, 2, 128, 128, BlendingMode::OFF },
+ { "icon-change", 219, 2, 37, 34, BlendingMode::ON },
+ { "icon-cluster-carousel", 180, 2, 37, 34, BlendingMode::ON }
+};
+
+const ImageInfo* GetImageInfo(const char* name)
+{
+  typedef std::map< const char*, const ImageInfo* > LookupMap;
+  static LookupMap lookup;
+  if( lookup.empty() )
+  {
+    for( unsigned int i = 0; i < ATLAS_IMAGE_COUNT; ++i)
+    {
+      lookup[ ImageAtlas[i].name ] =  &ImageAtlas[i];
+    }
+  }
+  LookupMap::const_iterator iter = lookup.find(name);
+  if( iter != lookup.end() )
+  {
+   return (*iter).second;
+  }
+  DALI_ASSERT_ALWAYS(0 && "image name not found in atlas");
+  return NULL;
+}
+
+~~~
+
+To use the lookup table you can do something like this:
+
+~~~{.cpp}
+// Example function on how to get an image info from the table
+
+std::string fileName = std::string( DALI_IMAGE_DIR ) + ATLAS_FILE_NAME;
+Image imageImage = Image::New( fileName );
+
+const ImageInfo* info(NULL);
+
+info = GetImageInfo("blocks-ball");
+if( info)
+{
+  ImageActor ballActor = ImageActor::New( imageAtlas, ImageActor::PixelArea( info->x, info->y, info->w, info->h) );
+  ballActor->SetBlendMode( info->blendMode );
+}
+info = GetImageInfo("bubble-ball");
+if( info)
+{
+  ImageActor bubbleActor = ImageActor::New( imageAtlas, ImageActor::PixelArea( info->x, info->y, info->w, info->h) );
+  bubbleActor->SetBlendMode( info->blendMode );
+}
+
+~~~
+
+### Using the constant definitions (C++)
+
+1. Cut and paste the constant definition code into your application.
+
+You'll notice the code below won't compile because C++ variables can't have a dash character.
+E.g. BLOCKS-BALL, BUBBLE-BALL will cause errors. Do a search and replace for - and replace with underscores.
+This is one reason why using lookup table which holds the filename as a string maybe easier to use.
+  
+~~~{.cpp}
+
+// The following code is automatically generated when TexturePacker publishes to a cpp file.
+const char* ATLAS_FILE_NAME( "my_first_atlas.png" );
+
+
+// Structure to hold position / blend mode within the atlas.
+struct ImageInfo
+{
+  ImageInfo(unsigned int x,unsigned int y,unsigned int w,unsigned int h,  Dali::BlendingMode::Type mode)
+  :pixelArea(x,y,w,h),blendMode(mode)
+  {}
+  ImageActor::PixelArea pixelArea;
+  Dali::BlendingMode::Type blendMode;  // only enable blending if image has alpha
+};
+
+
+const ImageInfo BLOCKS-BALL( 2, 198, 51, 51 ,BlendingMode::ON );
+const ImageInfo BUBBLE-BALL( 288, 74, 32, 32 ,BlendingMode::ON );
+const ImageInfo GALLERY-SMALL-52( 2, 2, 128, 128 ,BlendingMode::OFF );
+~~~
+  
+  2. To use it, you can copy example code from the generated cpp file which looks
+like this
+
+~~~{.cpp}
+void LoadAtlasImages()
+{
+  std::string fileName = std::string(DALI_IMAGE_DIR) + ATLAS_FILE_NAME;
+  Image atlasImage = Image::New( fileName );
+  ImageActor Blocksball = ImageActor::New( atlasImage,  BLOCKS_BALL.pixelArea);
+  Blocksball.SetBlendMode( BLOCKS_BALL.blendMode );
+
+  ImageActor Bubbleball = ImageActor::New( atlasImage,  BUBBLE_BALL.pixelArea);
+  Bubbleball.SetBlendMode( BUBBLE_BALL.blendMode );
+  ...
+~~~
+
+
+## Atlas creation tips
+
+- Compress the atlas  - \link texturecompression Compressing Textures \endlink
+- Avoid adding large images to the Atlas.
+- E.g. don't add background images to it. Medium to large images should be kept seperate.
+  
+![ ](../assets/img/texture-atlas/atlas-size.jpg)
+![ ](atlas-size.jpg)
+  
+
+- Try to ensure the atlas contains only images that are frequently used.  There's no point in having images taking up GPU texture memory if they're not displayed.
+- Avoid very large atlases.   Try to create multiple atlases based on how they are used within your application.
+Alternatively Texture packer has the option to split atlases ( search help for Multipack)
+
+
+
+@class _Guide_TextureAtlases
+
+*
+*/
\ No newline at end of file
@@ -1,8 +1,8 @@
-
 /**
  *
 
-## Texture Compression
+# Texture Compression {#texturecompression}
+
 
 Using compressing the textures will:
 
@@ -11,24 +11,71 @@ Using compressing the textures will:
 - Speed up load times. Smaller files mean quicker load times.
   
 DALi supports the KTX file format.
+  
 You just load the compressed texture like you would any other image.
 
-    var image = new dali.ResourceImage({url:"my_compressed_file.ktx"});
+~~~{.cpp}
+// C++
+ResourceImage image = ResourceImage::New("my_compressed_file.ktx");
+~~~
+~~~{.js}
+// JavaScript
+var image = new dali.ResourceImage( { url:"my_compressed_file.ktx"});
 
-ARMS texture compression tool<br>
-http://malideveloper.arm.com/develop-for-mali/tools/asset-creation/mali-gpu-texture-compression-tool/  <br>
+~~~
+  
+### ARMS texture compression tool
 
+http://malideveloper.arm.com/develop-for-mali/tools/asset-creation/mali-gpu-texture-compression-tool/
+  
 Here is an example of using the ARM compression tool.
+  
+![ ](../assets/img/texture-atlas/compression-options.jpg)
+![ ](compression-options.jpg)
+  
+![ ](../assets/img/texture-atlas/compression-example.jpg)
+![ ](compression-example.jpg)
 
-<img src="../assets/img/shared/texture-atlas/compression-options.jpg">
-
-<img src="../assets/img/shared/texture-atlas/compression-example.jpg">
+  
+As shown above the ETC-1 compression format does not support alpha.
+  
+As a work around the tool will export the alpha as a seperate compressed image.
 
-As shown above the ETC-1 compression format does not support alpha.<br> As a work around the tool will export
-the alpha as a seperate compressed image.
 In order to combine both the images you need to use a custom shader.
 Here is an example shader:
-```
+  
+~~~{.cpp}
+// C++ Code
+  const char* const COMPRESSED_RGB_PLUS_SEPARATE_ALPHA_FRAGMENT_SOURCE =
+    "\n"
+    "void main()\n"
+    "{\n"
+    "    vec4 v4Color  = (texture2D(sTexture, vTexCoord) * uColor);\n"
+    "    v4Color.a =  texture2D(sEffect, vTexCoord ).r;\n"
+    "   gl_FragColor = v4Color;"
+    "}\n";
+
+
+  mShaderEffect = ShaderEffect::New( "", COMPRESSED_RGB_PLUS_SEPARATE_ALPHA_FRAGMENT_SOURCE);
+
+  mAtlasImageRGB = ResourceImage::New( ATLAS_RGB_FILENAME.KTX);
+
+  mAtlasImageAlpha = ResourceImage::New( ATLAS_ALPHA_FILENAME.KTX );
+
+  mShaderEffect.SetEffectImage( mAtlasImageAlpha );
+
+
+
+  // to create Image Actor
+  ImageActor  imageActor = ImageActor::New( mAtlasImageRGB, GetImagePosition( info) );
+
+  imageActor.SetShaderEffect( mShaderEffect );
+
+  imageActor.SetBlendMode(BlendingMode::ON);
+~~~
+  
+~~~{.js}
+// JavaScript code
 var fragSource = "  \
 void main()                                                   \
 {                                                             \
@@ -51,8 +98,11 @@ ImageActor  imageActor = ImageActor::New( mAtlasImageRGB, GetImagePosition( info
 imageActor.setShaderEffect( shaderEffect );
   
 imageActor.setBlendMode( dali.BLENDING_ON );
-```
- @class TextureCompression
+~~~
+
+@class _Guide_Texture_compression
+
+
+*/
 
 
- */
index c682461..addf616 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.0.40
+Version:    1.0.41
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index b2ea595..e4d433b 100644 (file)
@@ -16,7 +16,7 @@ var camera = new dali.CameraActor();
 var layer = new dali.Layer();
 ```
 
-### Hello world example </h3>
+### Hello world example
 ```
 var myActor = new dali.TextActor("hello-world");
 
@@ -40,7 +40,8 @@ An actor inherits its parent's position.  The relative position between the acto
 
 1) ParentOrigin.  This Vector3 property defines a point within the parent actor's area.
 
-<img src="../assets/img/shared/parent-origin.png">
+![ ](../assets/img/parent-origin.png)
+
 
 The default is "top-left", which can be visualized in 2D as (0, 0), but is actually Vector3(0, 0, 0.5) in the 3D DALi world.  The actor's position is relative to this point.
 ```
@@ -50,7 +51,7 @@ myActor.parentOrigin = [0.5, 0.5, 0.5];
 
 2) AnchorPoint.  This Vector3 property defines a point within the child actor's area.
 
-<img src="../assets/img/shared/anchor-point.png">
+![ ](../assets/img/anchor-point.png)
 
 The default is "center", which can be visualized in 2D as (0.5, 0.5), but is actually Vector3(0.5, 0.5, 0.5) in the 3D DALi world.  The actor's position is also relative to this point.
 ```
@@ -60,7 +61,7 @@ myActor.anchorPoint = [0.5, 0.5, 0.5];
 
 3) Position.  This is the position vector between the parent-origin and anchor-point.
 
-<img src="../assets/img/shared/actor-position.png">
+![ ](../assets/img/actor-position.png)
 
 Therefore by default, an actors position is the distance between its center and the top-left corner of its parent.
 
@@ -119,7 +120,7 @@ function OnPressed( actor, touchEvent )
   
   var anim = new dali.Animation( 4 );
   var rotation = new dali.Rotation( 90, 0, 0 ); // pitch, yaw, roll
-  anim.animateBy( actor, "orientation", rotation );
+  anim.animateBy( actor, "rotation", rotation );
   anim.play();
   return true;
 }
@@ -196,8 +197,8 @@ See
  worldPositionX         |FLOAT       | &#10008;     | &#10008;
  worldPositionY         |FLOAT       | &#10008;     | &#10008;
  worldPositionZ         |FLOAT       | &#10008;     | &#10008;
orientation            |ROTATION    | &#10004;     | &#10004;
- worldOrientation       |ROTATION    | &#10008;     | &#10008;
rotation               |ROTATION    | &#10004;     | &#10004;
+ worldRotation          |ROTATION    | &#10008;     | &#10008;
  scale                  |VECTOR3     | &#10004;     | &#10004;
  scaleX                 |FLOAT       | &#10004;     | &#10004;
  scaleY                 |FLOAT       | &#10004;     | &#10004;
@@ -214,7 +215,7 @@ See
  name                   |STRING      | &#10004;     | &#10008;
  sensitive              |BOOLEAN     | &#10004;     | &#10008;
  leaveRequired          |BOOLEAN     | &#10004;     | &#10008;
- inheritOrientation     |BOOLEAN     | &#10004;     | &#10008;
+ inheritRotation        |BOOLEAN     | &#10004;     | &#10008;
  inheritScale           |BOOLEAN     | &#10004;     | &#10008;
  colorMode              |NUMBER      | &#10004;     | &#10008;
  positionInheritance    |NUMBER      | &#10004;     | &#10008;
@@ -381,19 +382,19 @@ WORLD_POSITION_Z
 
 
 /**
- * Actors orientation
- * @property orientation
- * @type dali orientation object
+ * Actors rotation
+ * @property rotation
+ * @type dali Rotation object
  */
-ORIENTATION
+ROTATION
 
 
 /**
- * Actors world-orientation
- * @property worldOrientation
- * @type dali Orientation object ( read only)
+ * Actors world-rotation
+ * @property worldRotation
+ * @type dali Rotation object ( read only)
  */
-WORLD_ORIENTATION
+WORLD_ROTATION
 
 /**
  * Actors scale
@@ -521,10 +522,10 @@ LEAVE_REQUIRED
 /**
  * Set whether a child actor inherits it's parent's orientation.
  * @type Boolean
- * @property inheritOrientation
+ * @property inheritRotation
  * @default true
  */
-INHERIT_ORIENTATION,
+INHERIT_ROTATION,
 
 
 /**
@@ -644,4 +645,4 @@ POSTITION_INHERITANCE
  * @type Vector3
  * @property sizeModeFactor
  */
-SIZE_MODE_FACTOR
+SIZE_MODE_FACTOR
\ No newline at end of file
index 33c64f8..727c139 100644 (file)
@@ -118,7 +118,8 @@ The example below does the following with a single animation object:
  - rotates the image actor
  - magnifies and color shifts the image using a fragment shader
   
-<img src="../assets/img/shader-animation.png">
+![ ](../assets/img/shaders/shader-animation.png)
+
   
 
 ```
index d70d538..51c869a 100644 (file)
@@ -1,6 +1,6 @@
 /**
  *
-<h3> Dali Constants </h3>
+### Dali Constants
 
 Constants accessible under the dali global object.
   
@@ -87,11 +87,6 @@ Constants accessible under the dali global object.
 |BLENDING_AUTO                             | integer value |
 |BLENDING_ON                               | integer value |
 
-|**actor.SetBlendEquation()  ** | |
-|BLEND_EQUATION_ADD                         | integer value  |
-|BLEND_EQUATION_SUBTRACT                    | integer value  |
-|BLEND_EQUATION_REVERSE_SUBTRACT            | integer value  |
-
 |**actor.SetCullFace()** | |
 |CULL_FACE_DISABLE          | integer value  |
 |CULL_FRONT_FACE           | integer value  |
@@ -148,7 +143,6 @@ Constants accessible under the dali global object.
 | PIXEL_FORMAT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC            | integer value  |
 | PIXEL_FORMAT_COMPRESSED_RGB8_ETC1                        | integer value  |
 | PIXEL_FORMAT_COMPRESSED_RGB_PVRTC_4BPPV1                 | integer value  |
-</table>
 
  * @class Constants
  */
index 578f6ae..611d004 100644 (file)
@@ -25,8 +25,7 @@ the OpenGL API from developers and provides a clean cross-platform JavaScript fr
 + Runs all animations in a seperate thread. This helps maintain 60 FPS even if JavaScript is performing a long operation ( e.g. Garbage Collection ).
 + Provides keyboard / touch / mouse handling
   
-  
-<img src="../assets/img/shared/screenshot.png">
+![Screen shots](../assets/img/screen-shot.png)
 
 ## Running JavaScript from DALi C++ API
 ```
@@ -52,7 +51,7 @@ The following example shows how to connect a new actor to the stage:
 The Stage has a 2D size, which matches the size of the application window.  The default coordinate system in DALi has the origin at the top-left corner, with positive X to right, and position Y going
 downwards.  This is intended to be convenient when laying-out 2D views.
 
-<img src="../assets/img/shared/coordinate-system-and-stage.png">
+![Screen shots](../assets/img/coordinate-system-and-stage.png)
 
 
  * @module DALi
index aebe46f..40a6d5f 100644 (file)
@@ -45,7 +45,8 @@ dali.stage.add( imageActor );
 ```
 var imageAtlas = new dali.ResourceImage( {url:"atlas.png"} )
 ```
-<img src="../assets/img/example-javascript-code.png">
+![ ](../assets/img/texture-atlas/example-javascript-code.jpg)
+
 
 ### Image Actor Specific Properties
 
index 5d06d3e..f9ef313 100644 (file)
@@ -58,17 +58,17 @@ var borderNinePatch = new dali.ResourceImage( {url:"border.9.png"} );
 var image = new dali.NinePatchImage( {url:"my_image.png"})
 ```
 The nine patch image will scale automatically with the size of the actor.
-
+  
 Tool for making 9 patches
-
+  
   http://romannurik.github.io/AndroidAssetStudio/nine-patches.html
-
+  
 More information on them:
-
+  
   http://radleymarx.com/blog/simple-guide-to-9-patch/
-
+  
   http://developer.android.com/tools/help/draw9patch.html
-
+  
 
 
  @class Image
index 465e249..2bcae22 100644 (file)
@@ -11,7 +11,7 @@ It also allows you to set an actor that is used to high light the focused actor.
 
 The application is required to help the manager when moving focus.
 
-<img src="../assets/img/focus-manager.png">
+![ Focus Manager ](../assets/img/focus-manager/focus-manager.png)
 
 ### keyboard-pre-focus-change
 
index 36d7986..81aece0 100644 (file)
@@ -4,7 +4,7 @@
 
 Paths can be used to animate position and orientation of actors.
 
-<img src="../assets/img/path.png"/>
+![ ](../assets/img/path/path.png)
   
 Example
 
index add11aa..b2509bf 100644 (file)
@@ -1,15 +1,17 @@
 /**
  *
- * <h2> Renderable Actor ( Extends Actor API )</h2>
- * Renderable actors are actors that can be drawn.
- * These currently are:
- * - {{#crossLink "ImageActor"}}{{/crossLink}}
- * - {{#crossLink "TextActor"}}{{/crossLink}}
- * - {{#crossLink "MeshActor"}}{{/crossLink}}
- *
- * @class RenderableActor
- * @extends Actor
- */
+# Renderable Actor ( Extends Actor API )
+
+Renderable actors are actors that can be drawn.
+These currently are:
+
+- {{#crossLink "ImageActor"}}{{/crossLink}}
+- {{#crossLink "TextActor"}}{{/crossLink}}
+- {{#crossLink "MeshActor"}}{{/crossLink}}
+
+ @class RenderableActor
+ @extends Actor
+*/
 
 
 
index 98e9c17..8c35f3d 100644 (file)
@@ -58,8 +58,9 @@ The API supports functionality such as:
 + {{#crossLink "ShaderEffect/setUniform:method"}}{{/crossLink}}
 
 ### Example of using a custom uniform to brighten an Image (Fragment Shader)
-
-<img src="../assets/img/fragment-shader-color.png">
+  
+![ ](../assets/img/shaders/fragment-shader-color.png)
+  
 ```
 createColorEffect = function()
 {
@@ -118,8 +119,9 @@ Like all animatable properties we can also use keyframes to animate the value.
 ### Example of animating a custom uniform to perform a mask operation (Fragment Shader)
 
 In this example we are using the OpenGL discard function to draw an image with a circular mask.
-
-<img src="../assets/img/fragment-shader-reveal.png">
+  
+![ ](../assets/img/shaders/fragment-shader-reveal.png)
+  
 ```
 createRevealEffect = function()
 {
@@ -177,8 +179,9 @@ shaderAnim.play();
 ```
 * * *
 ### Example of paper twisting in the wind with color (Vertex + Fragment Shader)
-
-<img src="../assets/img/vertex-shader.png"><br>
+  
+![ ](../assets/img/shaders/vertex-shader.png)
+  
 
 The example does the following:
 
@@ -188,9 +191,9 @@ The example does the following:
 
 An ImageActor normally only has 4 vertices ( quad ). To allow the image to twist and bend we need it to have more
 vertices. To do this we can break the image into a grid using the gridX and gridY geometry hints.
-
-<img src="../assets/img/shader-grid-hint.png">
-
+  
+![ ](../assets/img/shaders/shader-grid-hint.png)
+  
 ```
 createTwistEffect = function()
 {
index dcacca6..cfcdb76 100644 (file)
@@ -22,7 +22,8 @@ dali.stage.add( imageActor );
 dali.stage.remove( imageActor );
 ```
 
-<img src="../assets/img/stage.png"/>
+![ ](../assets/img/stage.png)
+
 
 ### Key Events
 
diff --git a/plugins/dali-script-v8/docs/content/text-actor.js b/plugins/dali-script-v8/docs/content/text-actor.js
deleted file mode 100644 (file)
index 7aa2b04..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
-## Text Actor API
-TextActor is a basic actor for displaying a text label
-
-By default the text actor always uses the natural size of the text, when the text property is set,
-unless SetSize is called to override the size or size is animated to some other size.
-
-Natural size for TextActor is the same as the size returned by dali.font.MeasureText( string )
-using the font that the TextActor is using.
-
-By default {{#crossLink "RenderableActor/setCullFace:method"}}CullFaceMode{{/crossLink}} is set to CullNone to enable the TextActor to be viewed from all angles.
-
-### Simple example
-```
-var textActor = new dali.TextActor( "Hello world" );
-  
-// by default an actor is anchored to the top-left of it's parent actor
-// change it to the middle
-textActor.parentOrigin = [0.5,0.5,0.5];
-  
-// scale it up by 4 times  in x,y
-textActor.scale = [ 4, 4, 1  ];
-  
-// add to the stage
-dali.stage.add( textActor );
-```
-
-### Example using a font and text options ###
-```
-var fontInfo =
-{
-  family : "Arial",
-  style :"Bold",
-  pointSize:20
-}
-  
-var arialFont = new dali.Font( fontInfo );
-var textOptions =
-{
-  font: arialFont,
-  isRightToLeft: true,
-  fontDetection: true       // default is true
-}
-  
-var textActor1 = new dali.TextActor( "Hello-world" , textOptions );
-  
-// this will automatically chose a different font that can display the text
-var textActor2 = new dali.TextActor( "繁體中文" , textOptions );
-```
-
-| Name                   |    Type    | Writable     | Animatable|
-|------------------------|------------|--------------|-----------|
-| text                   |  STRING    | &#10004;     |&#10008;   |
-| font                   |  STRING    | &#10004;     |&#10008;   |
-| font-style             |  STRING    | &#10004;     |&#10008;   |
-| outline-enable         |  BOOLEAN   | &#10004;     |&#10008;   |
-| outline-color          |  VECTOR4   | &#10004;     |&#10008;   |
-| outline-thickness-width| VECTOR2    | &#10004;     |&#10008;   |
-| smooth-edge            | FLOAT      | &#10004;     |&#10008;   |
-| glow-enable            | BOOLEAN    | &#10004;     |&#10008;   |
-| glow-color             | VECTOR4    | &#10004;     |&#10008;   |
-| glow-intensity         | FLOAT      | &#10004;     |&#10008;   |
-| shadow-enable          | BOOLEAN    | &#10004;     |&#10008;   |
-| shadow-color           | VECTOR4    | &#10004;     |&#10008;   |
-| shadow-offset          | VECTOR2    | &#10004;     |&#10008;   |
-| italics-angle          | FLOAT      | &#10004;     |&#10008;   |
-| underline              | BOOLEAN    | &#10004;     |&#10008;   |
-| weight                 | INTEGER    | &#10004;     |&#10008;   |
-| font-detection-automati| BOOLEAN    | &#10004;     |&#10008;   |
-| gradient-color         | VECTOR4    | &#10004;     |&#10008;   |
-| gradient-start-point   | VECTOR2    | &#10004;     |&#10008;   |
-| gradient-end-point     | VECTOR2    | &#10004;     |&#10008;   |
-| shadow-size            |  FLOAT     | &#10004;     |&#10008;   |
-| text-color             |  VECTOR4   | &#10004;     |&#10008;   |
-
-@class TextActor
-@extends RenderableActor
- */
-
diff --git a/plugins/dali-script-v8/docs/content/texture-atlases.js b/plugins/dali-script-v8/docs/content/texture-atlases.js
deleted file mode 100644 (file)
index 7005fca..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-/**
- *
-
-## Using Texture Atlases in DALi
-
-
-### Example demo application
-
-<img src="../assets/img/shared/texture-atlas/image-wall.jpg">
-
-
-### Application above is running slow as there are many small individual images displayed (50)
-
-
-<table>
-  <tr>
-    <td> Launch Time </td>
-    <td> Slow </td>
-    <td> Has to perform: <br>- 50 file open requests and multiple reads for each image</td>
-  </tr>
-  <tr>
-    <td> Memory Usage </td>
-    <td> High </td>
-    <td> Has to create:
-      <br>- 50 Dali::Image objects
-      <br>- 50 OpenGL Textures
-    </td>
-  </tr>
-  <tr>
-    <td>Rendering Performance </td>
-    <td> Slow </td>
-    <td> Has to perform:
-      <br>- 50 glBindTexture calls per frame ( each OpenGL calls takes time)
-      <br>- 50 a frame = 3000 calls per second @60 FPS.
-      <br>- Texture switching is a major state change in the GPU
-    </td>
-  </tr>
-</table>
-<br><br>
-
-
-### Solutions to problem: Use a Texture Atlas
-
-A texture atlas is simply one larger image that contains smaller images.<br>
-A texture atlas is sometimes called a sprite sheet, bitmap sheet or texture pack.
-<br><br>
-<img src="../assets/img/shared/texture-atlas/atlas.jpg">
-<br><br>
-Dali::ImageActor has the ability to display a portion of an image using ImageActor::PixelArea setting.
-For example to display the first 3 image in the atlas
-<br><br>
-```
-var imageAtlas = new dali.ResourceImage( {url:"atlas.png"} )
-```
-<img src="../assets/img/example-javascript-code.png">
-<br>
-### Result of using an Atlas
-<table>
-  <tr>
-    <td> Launch Time </td>
-    <td> Fast </td>
-    <td> Has to perform: <br>- 1 file open request </td>
-  </tr>
-  <tr>
-    <td> Memory Usage </td>
-    <td> Better </td>
-    <td> Has to create:
-      <br>- 1 Dali::Image objects
-      <br>- 1 OpenGL Textures
-    </td>
-  </tr>
-  <tr>
-    <td>Rendering Performance </td>
-    <td> Fast </td>
-    <td> Has to perform:
-      <br>- 1 glBindTexture calls per frame ( each OpenGL calls takes time)
-      <br>- 1 a frame = 6- calls per second @60 FPS.
-    </td>
-  </tr>
-</table>
-<br>
-## Atlas creation guide
-
-Many tools exist for creating texture atlases.<br>
-In the following example we are using a tool called TexturePacker as DALi has an exporter script for it.
-The exporter automatically generates a source file that has the ImageActor::PixelArea pre-defined.
-<br>
-
-+ Download http://www.codeandweb.com/texturepacker
-+ Launch TexturePacker
-+ Go to the menu File -> Preferences
-+ Set the "Exporter directory" to be the location of <b>dali-toolkit/texture-atlas-exporter</b>  <br>
-  
- <img src="../assets/img/shared/texture-atlas/texture-packer-preferences.jpg"> <br>
-+ <b> Restart the application! </b>
-+ Select DALi 3D framework for new project
-  
- <img src="../assets/img/shared/texture-atlas/texture-packer-startup.jpg"><br>
-+ <h3> Create the atlas </h3>
-   <img src="../assets/img/shared/texture-atlas/texture-packer-add-sprites.jpg">
-+ <h3> Click publish to produce the files </h3><br><br>
-   <img src="../assets/img/shared/texture-atlas/texture-packer-publish.jpg">
-  
-## Using the generated cpp file
-
-The generated cpp file contains 3 different ways of describing the atlas.
-2 ways are designed for the DALi C++ API, the 3rd way is for JavaScript.
-Example exported property map from TexturePacker:
-```
-var ATLAS_IMAGE_LIST : [
-    { name: "add_user_usericon_bg", x: 2, y:109, w:105, h:105, dali.BLENDING_ON  },
-    { name: "app_background", x: 180, y:183, w:1, h:1, dali.BLENDING_OFF  },
-    { name: "btn_arrow_left", x: 141, y:183, w:11, h:20, dali.BLENDING_ON  },
-    { name: "btn_arrow_right", x: 154, y:183, w:11, h:20, dali.BLENDING_ON  },
-    { name: "icn_app_foc", x: 194, y:2, w:72, h:72, dali.BLENDING_ON  },
-    { name: "icn_app_nor", x: 109, y:109, w:72, h:72, dali.BLENDING_ON  }
-    ]
-var atlas = new dali.ResourceImage( { url: "atlas_filename.png" });
-
-// display the user icon using the size / position data in the ATLAS_IMAGE_LIST
-var userIconData = ATLAS_IMAGE_LIST[0];
-var userIconRect = [ userIconData.x, userIconData.y,userIconData.w,userIconData.h];
-
-var btnArrowLeft = new dali.ImageActor( atlas, userIconRect );
-```
-
-## Atlas creation tips
-
-
- - Compress the atlas
- - Avoid adding large images to the Atlas.
-    E.g. don't add background images to it. Medium to large images should
-    be kept seperate. <br><br>
-   <img src="../assets/img/shared/texture-atlas/atlas-size.jpg">
-
- - Try to ensure the atlas contains only images that are frequently used. <br>
-    There's no point in having images taking up GPU texture memory if they're not displayed.<br>
-
- - Avoid very large atlases <br>
-    Try to create multiple atlases based on how they are used within your application.<br>
-    <br>
-    Alternatively Texture packer has the option to split atlases ( search help for Multipack)
- -
-
-
-
-  @class TextureAtlases
- */
-
diff --git a/plugins/dali-script-v8/docs/dali-theme/assets/img b/plugins/dali-script-v8/docs/dali-theme/assets/img
new file mode 120000 (symlink)
index 0000000..e8c2249
--- /dev/null
@@ -0,0 +1 @@
+../../../../../docs/content/images/
\ No newline at end of file
diff --git a/plugins/dali-script-v8/docs/dali-theme/assets/img/example-javascript-code.png b/plugins/dali-script-v8/docs/dali-theme/assets/img/example-javascript-code.png
deleted file mode 100644 (file)
index 3888761..0000000
Binary files a/plugins/dali-script-v8/docs/dali-theme/assets/img/example-javascript-code.png and /dev/null differ
diff --git a/plugins/dali-script-v8/docs/dali-theme/assets/img/shared b/plugins/dali-script-v8/docs/dali-theme/assets/img/shared
deleted file mode 120000 (symlink)
index 6eab915..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../docs/content/images/
\ No newline at end of file
index 9dc4293..9914d3a 100644 (file)
@@ -19,8 +19,10 @@ script_v8_plugin_src_files = \
    $(v8_plugin_dir)/constants/constants-wrapper.cpp \
    $(v8_plugin_dir)/animation/animation-api.cpp \
    $(v8_plugin_dir)/animation/animation-wrapper.cpp \
+   $(v8_plugin_dir)/animation/constrainer-api.cpp \
+   $(v8_plugin_dir)/animation/linear-constrainer-wrapper.cpp \
    $(v8_plugin_dir)/animation/path-api.cpp \
-   $(v8_plugin_dir)/animation/path-constraint-wrapper.cpp \
+   $(v8_plugin_dir)/animation/path-constrainer-wrapper.cpp \
    $(v8_plugin_dir)/animation/path-wrapper.cpp \
    $(v8_plugin_dir)/stage/stage-wrapper.cpp \
    $(v8_plugin_dir)/events/event-object-generator.cpp \
index 926c5cd..b36f68a 100644 (file)
@@ -24,7 +24,7 @@
 // INTERNAL INCLUDES
 #include <v8-utils.h>
 #include <actors/actor-wrapper.h>
-#include <animation/path-constraint-wrapper.h>
+#include <animation/path-constrainer-wrapper.h>
 
 namespace Dali
 {
@@ -610,111 +610,6 @@ void ActorApi::ScaleBy( const v8::FunctionCallbackInfo<v8::Value>& args )
   actor.ScaleBy( vector );
 }
 
-void ActorApi::ApplyPathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  //Get target actor
-  Actor targetActor = GetActor( isolate, args );
-
-  //Get PathConstraint
-  bool found(false);
-  Handle pathConstraintHandle =  V8Utils::GetHandleParameter(PARAMETER_0, found, isolate, args );
-  if( !found )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 0 (PathConstraint)" );
-    return;
-  }
-  PathConstraint pathConstraint = PathConstraint::DownCast(pathConstraintHandle);
-
-  //Get target property
-  std::string propertyName = V8Utils::GetStringParameter( PARAMETER_1, found, isolate, args );
-  if(!found)
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 1 (Property name)" );
-    return;
-  }
-
-  // try both properties with dashes and without
-  Property::Index targetPropertyIndex = targetActor.GetPropertyIndex( propertyName );
-  if( targetPropertyIndex == Property::INVALID_INDEX )
-  {
-    std::string convertedName = V8Utils::JavaScriptNameToPropertyName( propertyName );
-    targetPropertyIndex = targetActor.GetPropertyIndex( convertedName );
-
-    if( targetPropertyIndex == Property::INVALID_INDEX )
-    {
-      DALI_SCRIPT_EXCEPTION( isolate, "Property not found" );
-    }
-  }
-
-  //Get source actor
-  Actor sourceActor = V8Utils::GetActorParameter( PARAMETER_2, found, isolate, args );
-  if( !found )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 2 (Actor)" );
-  }
-
-  // try both properties with dashes and without
-  propertyName = V8Utils::GetStringParameter( PARAMETER_3, found, isolate, args );
-  if(!found)
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 3 (Property name)" );
-    return;
-  }
-
-  Property::Index sourcePropertyIndex = sourceActor.GetPropertyIndex( propertyName );
-  if( sourcePropertyIndex == Property::INVALID_INDEX )
-  {
-    std::string convertedName = V8Utils::JavaScriptNameToPropertyName( propertyName );
-    sourcePropertyIndex = sourceActor.GetPropertyIndex( convertedName );
-
-    if( sourcePropertyIndex == Property::INVALID_INDEX )
-    {
-      DALI_SCRIPT_EXCEPTION( isolate, "Property not found" );
-      return;
-    }
-  }
-
-  //Check if forward vector is specified
-  Vector3 forward( 0.0f,0.0f,0.0f);
-  if( args.Length() > 4 )
-  {
-    forward =  V8Utils::GetVector3Parameter( PARAMETER_4, found, isolate, args );
-    if( !found )
-    {
-      DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 4 (Vector3)" );
-      return;
-    }
-  }
-
-  pathConstraint.Apply( Dali::Property(sourceActor,sourcePropertyIndex),
-                        Dali::Property(targetActor,targetPropertyIndex),
-                        forward );
-
-}
-
-void ActorApi::RemovePathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  //Get target actor
-  Actor actor = GetActor( isolate, args );
-
-  //Get PathConstraint
-  bool found(false);
-  Handle pathConstraintHandle =  V8Utils::GetHandleParameter(PARAMETER_0, found, isolate, args );
-  if( !found )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 0 (PathConstraint)" );
-    return;
-  }
-  PathConstraint pathConstraint = PathConstraint::DownCast(pathConstraintHandle);
-  pathConstraint.Remove(actor);
-}
-
 } // namespace V8Plugin
 
 } // namespace Dali
index 509c976..8543f11 100644 (file)
@@ -68,12 +68,6 @@ namespace ActorApi
   void RotateBy( const v8::FunctionCallbackInfo< v8::Value >& args );
   void ScaleBy( const v8::FunctionCallbackInfo< v8::Value >& args );
 
-  // new function just for JavaScript API, to apply a PathConstraint to an actor
-  void ApplyPathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args );
-
-  // new function just for JavaScript API, to remove a PathConstraint from an actor
-  void RemovePathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args );
-
   // new function just for JavaScript API, to help developers know what type of actor
   // they're dealing with, returns actor name as a string
   void GetActorType( const v8::FunctionCallbackInfo< v8::Value >& args );
index 4df5d5c..1686958 100644 (file)
@@ -197,8 +197,6 @@ const ActorFunctions ActorFunctionTable[]=
     { "FindChildById",     ActorApi::FindChildById,    ACTOR_API },
     { "GetParent" ,        ActorApi::GetParent,        ACTOR_API },
     { "GetActorType" ,     ActorApi::GetActorType,     ACTOR_API }, // custom for javascript
-    { "ApplyPathConstraint",  ActorApi::ApplyPathConstraint,  ACTOR_API }, // custom for javascript
-    { "RemovePathConstraint", ActorApi::RemovePathConstraint, ACTOR_API }, // custom for javascript
 
     // ignore. SetParentOrigin() use Actor.parentOrigin
     // ignore. GetCurrentParentOrigin()  use Actor.parentOrigin
@@ -258,10 +256,6 @@ const ActorFunctions ActorFunctionTable[]=
     { "GetBlendMode",       RenderableActorApi::GetBlendMode,      RENDERABLE_ACTOR_API  },
     { "SetBlendFunc",       RenderableActorApi::SetBlendFunc,      RENDERABLE_ACTOR_API  },
     { "GetBlendFunc",       RenderableActorApi::GetBlendFunc,      RENDERABLE_ACTOR_API  },
-    { "SetBlendEquation",   RenderableActorApi::SetBlendEquation,  RENDERABLE_ACTOR_API  },
-    { "GetBlendEquation",   RenderableActorApi::GetBlendEquation,  RENDERABLE_ACTOR_API  },
-    { "SetBlendColor",      RenderableActorApi::SetBlendColor,     RENDERABLE_ACTOR_API  },
-    { "GetBlendColor",      RenderableActorApi::GetBlendColor,     RENDERABLE_ACTOR_API  },
     { "SetShaderEffect",    RenderableActorApi::SetShaderEffect,   RENDERABLE_ACTOR_API  },
     { "GetShaderEffect",    RenderableActorApi::GetShaderEffect,   RENDERABLE_ACTOR_API  },
     { "RemoveShaderEffect", RenderableActorApi::RemoveShaderEffect,RENDERABLE_ACTOR_API  },
@@ -296,8 +290,6 @@ const ActorFunctions ActorFunctionTable[]=
     { "GetImage",           ImageActorApi::GetImage,              IMAGE_ACTOR_API },
     // ignore SetPixelArea, use imageActor.pixelArea
     // ignore GetPixelArea, use imageActor.pixelArea
-    { "IsPixelAreaSet",     ImageActorApi::IsPixelAreaSet,        IMAGE_ACTOR_API },
-    { "ClearPixelArea",     ImageActorApi::ClearPixelArea,        IMAGE_ACTOR_API },
     // ignore SetStyle, use imageActor.style
     // ignore GetStyle, use imageActor.style
     // ignore SetNinePatchBorder use imageActor.border
index 9a30b21..d8644a5 100644 (file)
@@ -150,40 +150,6 @@ void ImageActorApi::GetImage( const v8::FunctionCallbackInfo<v8::Value>& args )
   args.GetReturnValue().Set( localObject );
 }
 
-/**
- * Query whether a pixel area has been set.
- * @for ImageActor
- * @method isPixelAreaSet
- * @return {Boolean} True if a pixel area has been set.
- */
-void ImageActorApi::IsPixelAreaSet( const v8::FunctionCallbackInfo<v8::Value>& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageActor imageActor = GetImageActor( isolate, args );
-
-  args.GetReturnValue().Set( v8::Boolean::New( isolate, imageActor.IsPixelAreaSet() ) );
-}
-
-/**
- * Remove any pixel areas specified with SetPixelArea; the entire image will be displayed.
- *
- * The actor size will change to that of the Image unless a custom size was set, e.g. via
- * actor.size
- * @for ImageActor
- * @method clearPixelArea
- */
-void ImageActorApi::ClearPixelArea( const v8::FunctionCallbackInfo<v8::Value>& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  ImageActor imageActor = GetImageActor( isolate, args );
-
-  imageActor.ClearPixelArea();
-}
-
-
-
 } // namespace V8Plugin
 
 } // namespace Dali
index d6b9f3a..4bdbe76 100644 (file)
@@ -42,8 +42,6 @@ namespace ImageActorApi
    */
   void SetImage( const v8::FunctionCallbackInfo< v8::Value >& args );
   void GetImage( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void IsPixelAreaSet( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void ClearPixelArea( const v8::FunctionCallbackInfo< v8::Value >& args );
 }; // namespace ImageActorApi
 
 } // namespace V8Plugin
index a2b1055..5058039 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali/public-api/actors/mesh-actor.h>
+#include <dali/devel-api/actors/mesh-actor.h>
 
 namespace Dali
 {
index 89b3569..14b2baf 100644 (file)
@@ -190,34 +190,6 @@ void RenderableActorApi::GetBlendMode( const v8::FunctionCallbackInfo<v8::Value>
 
 }
 
-// 2 function definitions, as Dali uses 2 functions.
-// JavaScript can't overload but we can document it twice with different params
-/**
- * @for RenderableActor
- * @method setBlendFunc
- * @param {Number} SourceBlending RGBA
- * @param {Number} DestinationBlending RGBA
- * @example
- *      blending constants
-      dali.BLEND_FACTOR_ZERO
-      dali.BLEND_FACTOR_ONE
-      dali.BLEND_FACTOR_SRC_COLOR
-      dali.BLEND_FACTOR_ONE_MINUS_SRC_COLOR
-      dali.BLEND_FACTOR_SRC_ALPHA
-      dali.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA
-      dali.BLEND_FACTOR_DST_ALPHA
-      dali.BLEND_FACTOR_ONE_MINUS_DST_ALPHA
-      dali.BLEND_FACTOR_DST_COLOR
-      dali.BLEND_FACTOR_ONE_MINUS_DST_COLOR
-      dali.BLEND_FACTOR_SRC_ALPHA_SATURATE
-      dali.BLEND_FACTOR_CONSTANT_COLOR
-      dali.BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR
-      dali.BLEND_FACTOR_CONSTANT_ALPHA
-      dali.BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA
-
-      actor.setBlendFunc( dali.BLEND_FACTOR_ONE_MINUS_SRC_COLOR, dali.BLEND_FACTOR_ONE_MINUS_DST_COLOR);
- */
-
 /**
  * @for RenderableActor
  * @method setBlendFunc
@@ -255,39 +227,20 @@ void RenderableActorApi::SetBlendFunc( const v8::FunctionCallbackInfo< v8::Value
   RenderableActor actor =  GetRenderableActor( isolate, args );
 
   int params[4];
-  if( args.Length() == 2 )
+  bool foundAllParams(false);
+  V8Utils::ReadIntegerArguments( foundAllParams, &params[0], 4, args,0 );
+  if( foundAllParams )
   {
-    bool foundAllParams(false);
-    V8Utils::ReadIntegerArguments( foundAllParams, &params[0], 2, args,0 );
-    if( foundAllParams )
-    {
-      actor.SetBlendFunc(  static_cast< Dali::BlendingFactor::Type>(params[0]),
-                           static_cast< Dali::BlendingFactor::Type>(params[1]) );
-    }
-    else
-    {
-      DALI_SCRIPT_EXCEPTION( isolate, "invalid BlendMode parameter");
-      return;
-    }
+    actor.SetBlendFunc(  static_cast< Dali::BlendingFactor::Type>(params[0]),
+                         static_cast< Dali::BlendingFactor::Type>(params[1]),
+                         static_cast< Dali::BlendingFactor::Type>(params[2]),
+                         static_cast< Dali::BlendingFactor::Type>(params[3]));
   }
-  else if ( args.Length() == 4)
+  else
   {
-    bool foundAllParams(false);
-    V8Utils::ReadIntegerArguments( foundAllParams, &params[0], 4, args,0 );
-    if( foundAllParams )
-    {
-      actor.SetBlendFunc(  static_cast< Dali::BlendingFactor::Type>(params[0]),
-                           static_cast< Dali::BlendingFactor::Type>(params[1]),
-                           static_cast< Dali::BlendingFactor::Type>(params[2]),
-                           static_cast< Dali::BlendingFactor::Type>(params[3]));
-    }
-    else
-    {
-      DALI_SCRIPT_EXCEPTION( isolate, "invalid BlendMode parameter");
-      return;
-    }
+    DALI_SCRIPT_EXCEPTION( isolate, "invalid BlendMode parameter");
+    return;
   }
-
 }
 
 /**
@@ -323,148 +276,6 @@ void RenderableActorApi::GetBlendFunc( const v8::FunctionCallbackInfo< v8::Value
   args.GetReturnValue().Set( blendInfo );
 
 }
-// 2 function definitions, as Dali uses 2 functions.
-// JavaScript can't overload but we can document it twice with different params
-/**
- * @for RenderableActor
- * @method setBlendEquation
- * @param {Number } BlendEquation for RGBA
- * @example
- *
- *      //blending equation constants
-      dali.BLEND_EQUATION_ADD
-      dali.BLEND_EQUATION_SUBTRACT
-      dali.BLEND_EQUATION_REVERSE_SUBTRACT
-      actor.setBlendEquation( dali.BLEND_EQUATION_ADD );
-
- */
-
-/**
- * @for RenderableActor
- * @method setBlendEquation
- * @param {Number } BlendEquation for RGB
- * @param {Number } BlendEquation for Alpha
- * @example
- *
- *      //blending equation constants
-      dali.BLEND_EQUATION_ADD
-      dali.BLEND_EQUATION_SUBTRACT
-      dali.BLEND_EQUATION_REVERSE_SUBTRACT
-      actor.setBlendEquationSeparate( dali.BLEND_EQUATION_ADD, dali.BLEND_EQUATION_SUBTRACT  );
-
- */
-void RenderableActorApi::SetBlendEquation( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  RenderableActor actor = GetRenderableActor( isolate, args );
-
-  int params[2];
-  if( args.Length() == 1 )
-  {
-    bool foundAllParams( false );
-    V8Utils::ReadIntegerArguments( foundAllParams, &params[0], 1, args, 0 );
-    if( foundAllParams )
-    {
-      actor.SetBlendEquation( static_cast<Dali::BlendingEquation::Type>( params[0] ) );
-    }
-    else
-    {
-      DALI_SCRIPT_EXCEPTION( isolate, "invalid BlendEquation parameter" );
-      return;
-    }
-  }
-  else if( args.Length() == 2 )
-  {
-    bool foundAllParams( false );
-    V8Utils::ReadIntegerArguments( foundAllParams, &params[0], 2, args, 0 );
-    if( foundAllParams )
-    {
-      actor.SetBlendEquation( static_cast<Dali::BlendingEquation::Type>( params[0] ), static_cast<Dali::BlendingEquation::Type>( params[1] ) );
-    }
-    else
-    {
-      DALI_SCRIPT_EXCEPTION( isolate, "invalid BlendEquation parameter" );
-      return;
-    }
-  }
-}
-
-/**
- * @for RenderableActor
- * @method getBlendEquation
- * @return {Object} equationProperties
- * @example equation properties object has 2 fields
- *
- *      equationProperties.equationRgb    // rbg blend equation
- *      equationProperties.equationAlpha  // alpha blend equation
- */
-void RenderableActorApi::GetBlendEquation( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  RenderableActor actor = GetRenderableActor( isolate, args );
-
-  BlendingEquation::Type equationRgb, equationAlpha;
-  actor.GetBlendEquation( equationRgb, equationAlpha );
-
-  v8::Local<v8::Object> object = v8::Object::New( isolate );
-
-  object->Set( v8::String::NewFromUtf8( isolate, "equationRgb" ),   v8::Integer::New( isolate, equationRgb) );
-  object->Set( v8::String::NewFromUtf8( isolate, "equationAlpha" ), v8::Integer::New( isolate, equationAlpha ) );
-
-  args.GetReturnValue().Set( object );
-}
-
-/**
- * @for RenderableActor
- * @method setBlendColor
- * @param {Vector4} Color
- * @example
- *
- *        actor.SetBlendColor( dali.COLOR_RED );
- */
-void RenderableActorApi::SetBlendColor( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  RenderableActor actor = GetRenderableActor( isolate, args );
-
-  Dali::Vector4 color;
-
-  bool foundAllArguments( false );
-
-  V8Utils::ReadFloatArguments( foundAllArguments, color.AsFloat(), 4, args, 1.f ); // read the parameters
-  if( !foundAllArguments )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "invalid color parameter, should red,green,blue,alpha" );
-    return;
-  }
-  actor.SetBlendColor( color );
-
-}
-
-/**
- * @for RenderableActor
- * @method getBlendColor
- * @return {Object} Dali vector 4 object
- */
-void RenderableActorApi::GetBlendColor( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-  RenderableActor actor = GetRenderableActor( isolate, args );
-
-  Dali::Vector4 color = actor.GetBlendColor();
-
-  Dali::Property::Value value( color );
-
-  v8::Local<v8::Object> object = PropertyValueWrapper::WrapDaliProperty( isolate, value );
-
-  args.GetReturnValue().Set( object );
-
-}
-
 
 /**
  * @for RenderableActor
index 463b295..79716a1 100644 (file)
@@ -44,10 +44,6 @@ namespace RenderableActorApi
   void GetBlendMode( const v8::FunctionCallbackInfo< v8::Value >& args );
   void SetBlendFunc( const v8::FunctionCallbackInfo< v8::Value >& args );
   void GetBlendFunc( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void SetBlendEquation( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void GetBlendEquation( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void SetBlendColor( const v8::FunctionCallbackInfo< v8::Value >& args );
-  void GetBlendColor( const v8::FunctionCallbackInfo< v8::Value >& args );
   void GetShaderEffect( const v8::FunctionCallbackInfo< v8::Value >& args );
   void SetShaderEffect( const v8::FunctionCallbackInfo< v8::Value >& args );
   void RemoveShaderEffect( const v8::FunctionCallbackInfo< v8::Value >& args );
index 9378742..653f1d3 100644 (file)
@@ -1030,7 +1030,7 @@ void AnimationApi::AnimateTo( const v8::FunctionCallbackInfo< v8::Value >& args
  *
  *  create some keyframes to move an actor around a square, and return to the start
  * </br >
- *  <img src="../assets/img/keyframe-animation.png">
+ *  <img src="../assets/img/animation/keyframe-animation.png">
  *
  *
  *     var keyframes = [
diff --git a/plugins/dali-script-v8/src/animation/constrainer-api.cpp b/plugins/dali-script-v8/src/animation/constrainer-api.cpp
new file mode 100644 (file)
index 0000000..701f4d4
--- /dev/null
@@ -0,0 +1,292 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics 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 "constrainer-api.h"
+
+//EXTERNAL INCLUDES
+#include <cfloat> //For FLT_MAX
+
+// INTERNAL INCLUDES
+#include <animation/linear-constrainer-wrapper.h>
+#include <animation/path-constrainer-wrapper.h>
+#include <object/property-value-wrapper.h>
+#include <v8-utils.h>
+
+namespace Dali
+{
+
+namespace V8Plugin
+{
+
+namespace // un named namespace
+{
+
+PathConstrainer GetPathConstrainer( v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args )
+{
+  v8::HandleScope handleScope( isolate );
+
+  v8::Local<v8::Object> object = args.This();
+  v8::Local<v8::External> field = v8::Local<v8::External>::Cast( object->GetInternalField( 0 ) );
+  void* ptr = field->Value();
+
+  PathConstrainerWrapper* wrapper = static_cast<PathConstrainerWrapper *>( ptr );
+  return wrapper->GetPathConstrainer();
+}
+
+LinearConstrainer GetLinearConstrainer( v8::Isolate* isolate, const v8::FunctionCallbackInfo< v8::Value >& args )
+{
+  v8::HandleScope handleScope( isolate );
+
+  v8::Local<v8::Object> object = args.This();
+  v8::Local<v8::External> field = v8::Local<v8::External>::Cast( object->GetInternalField( 0 ) );
+  void* ptr = field->Value();
+
+  LinearConstrainerWrapper* wrapper = static_cast<LinearConstrainerWrapper *>( ptr );
+  return wrapper->GetLinearConstrainer();
+}
+
+bool GetApplyParameters( const v8::FunctionCallbackInfo< v8::Value >& args, Actor& targetActor, Property::Index& targetPropertyIndex,
+                         Actor& sourceActor, Property::Index& sourcePropertyIndex, Vector2& range, Vector2& wrap )
+{
+  v8::Isolate* isolate = args.GetIsolate();
+  v8::HandleScope handleScope( isolate );
+
+  if( args[0]->IsObject() )
+  {
+    bool found(false);
+
+    v8::Local<v8::Object> obj = args[0]->ToObject();
+    v8::Local<v8::Value> member = obj->Get( v8::String::NewFromUtf8( isolate, "target" ) );
+
+    //Get target actor
+    if( member->IsObject() )
+    {
+      v8::Local<v8::Object> targetActorObject = member->ToObject();
+      targetActor = V8Utils::GetActorFromObject( isolate, found, targetActorObject );
+      if( !targetActor )
+      {
+        DALI_SCRIPT_EXCEPTION( isolate, "Target actor not found" );
+        return false;
+      }
+    }
+    else
+    {
+      DALI_SCRIPT_EXCEPTION( isolate, "Target actor not specified" );
+      return false;
+    }
+
+    //Get source actor
+    member = obj->Get( v8::String::NewFromUtf8( isolate, "source" ) );
+    if( member->IsObject() )
+    {
+      v8::Local<v8::Object> sourceActorObject = member->ToObject();
+      sourceActor = V8Utils::GetActorFromObject( isolate, found, sourceActorObject );
+      if( !sourceActor )
+      {
+        DALI_SCRIPT_EXCEPTION( isolate, "Source actor not found" );
+        return false;
+      }
+    }
+    else
+    {
+      DALI_SCRIPT_EXCEPTION( isolate, "Source actor not specified" );
+      return false;
+    }
+
+    //Get target property
+    member = obj->Get( v8::String::NewFromUtf8( isolate, "targetProperty" ) );
+    if( member->IsString() )
+    {
+      std::string propertyName = V8Utils::v8StringToStdString( member );
+      targetPropertyIndex = targetActor.GetPropertyIndex( propertyName );
+      if( targetPropertyIndex == Property::INVALID_INDEX )
+      {
+        std::string convertedName = V8Utils::JavaScriptNameToPropertyName( propertyName );
+        targetPropertyIndex = targetActor.GetPropertyIndex( convertedName );
+
+        if( targetPropertyIndex == Property::INVALID_INDEX )
+        {
+          DALI_SCRIPT_EXCEPTION( isolate, "Target property not found" );
+          return false;
+        }
+      }
+    }
+    else
+    {
+      DALI_SCRIPT_EXCEPTION( isolate, "Target property not specified" );
+      return false;
+    }
+
+    //Get source property
+    member = obj->Get( v8::String::NewFromUtf8( isolate, "sourceProperty" ) );
+    if( member->IsString() )
+    {
+      std::string propertyName = V8Utils::v8StringToStdString( member );
+      sourcePropertyIndex = targetActor.GetPropertyIndex( propertyName );
+      if( sourcePropertyIndex == Property::INVALID_INDEX )
+      {
+        std::string convertedName = V8Utils::JavaScriptNameToPropertyName( propertyName );
+        sourcePropertyIndex = targetActor.GetPropertyIndex( convertedName );
+
+        if( sourcePropertyIndex == Property::INVALID_INDEX )
+        {
+          DALI_SCRIPT_EXCEPTION( isolate, "Source property not found" );
+          return false;
+        }
+      }
+    }
+    else
+    {
+      DALI_SCRIPT_EXCEPTION( isolate, "Source property not specified" );
+      return false;
+    }
+
+    //Get range
+    member = obj->Get( v8::String::NewFromUtf8( isolate, "range" ) );
+    if( member->IsObject() )
+    {
+      v8::Local<v8::Object> rangeObject = member->ToObject();
+      Property::Value value = V8Utils::GetPropertyValueFromObject( found, isolate, rangeObject );
+      value.Get( range );
+    }
+    else
+    {
+      DALI_SCRIPT_EXCEPTION( isolate, "Range not specified" );
+      return false;
+    }
+
+    //Get wrap range
+    member = obj->Get( v8::String::NewFromUtf8( isolate, "wrap" ) );
+    if( member->IsObject() )
+    {
+      v8::Local<v8::Object> wrapObject = member->ToObject();
+      Property::Value value = V8Utils::GetPropertyValueFromObject( found, isolate, wrapObject );
+      value.Get( wrap );
+    }
+    else
+    {
+      wrap =  Vector2(-FLT_MAX, FLT_MAX);
+    }
+
+    return true;
+  }
+  else
+  {
+    DALI_SCRIPT_EXCEPTION( isolate, "Bad parameter (Object)" );
+    return false;
+  }
+}
+
+} // un-named namespace
+
+/**
+ * Apply the constraint
+ * @method applyConstraint
+ * @for PathConstrainer and LinearConstrainer
+ * @param {Object}  Constraint
+ * @param {Object}  Constraint.targetActor
+ * @param {String}  Constraint.targetProperty
+ * @param {String}  Constraint.sourceProperty
+ * @param {Vector2} Constraint.range
+ * @param {Vector2} Constraint.wrap
+ *
+ * @example
+ *
+ *        var constraintPosition = {  "target":targetActor,
+ *                                    "targetProperty":"position",
+ *                                    "source":sourceActor,
+ *                                    "sourceProperty":"color-alpha",
+ *                                    "range":range
+ *                                    "wrap":wrap
+ *                                 };
+ *        pathConstrainer.applyConstraint( constraintPosition );
+ */
+void ConstrainerApi::Apply( const v8::FunctionCallbackInfo< v8::Value >& args )
+{
+  v8::Isolate* isolate = args.GetIsolate();
+  v8::HandleScope handleScope( isolate );
+
+  Actor target, source;
+  Property::Index targetPropertyIndex = Property::INVALID_INDEX;
+  Property::Index sourcePropertyIndex = Property::INVALID_INDEX;
+
+  Vector2 range, wrap;
+  if( GetApplyParameters(args, target, targetPropertyIndex, source,  sourcePropertyIndex, range, wrap ) )
+  {
+
+    PathConstrainer pathConstrainer = GetPathConstrainer( isolate, args );
+    if( pathConstrainer )
+    {
+      pathConstrainer.Apply( Property(target, targetPropertyIndex),
+                             Property(source, sourcePropertyIndex),
+                             range, wrap );
+    }
+    else
+    {
+      LinearConstrainer linearConstrainer = GetLinearConstrainer( isolate, args );
+      if( linearConstrainer )
+      {
+        linearConstrainer.Apply( Property(target, targetPropertyIndex),
+                                 Property(source, sourcePropertyIndex),
+                                 range, wrap );
+      }
+    }
+  }
+}
+
+/**
+ * Remove the constraint
+ * @method remove
+ * @for PathConstrainer
+ * @param {Object} Actor
+ * @example
+ *        pathConstrainer.remove( targetActor );
+ */
+void ConstrainerApi::Remove( const v8::FunctionCallbackInfo< v8::Value >& args )
+{
+  v8::Isolate* isolate = args.GetIsolate();
+  v8::HandleScope handleScope( isolate );
+
+  //Get target actor
+  bool found( false );
+  Actor targetActor = V8Utils::GetActorParameter( PARAMETER_0, found, isolate, args );
+  if( !found )
+  {
+    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 0 (Actor)" );
+    return;
+  }
+
+
+  PathConstrainer pathConstrainer = GetPathConstrainer( isolate, args );
+  if( pathConstrainer )
+  {
+    pathConstrainer.Remove(targetActor);
+  }
+  else
+  {
+    LinearConstrainer linearConstrainer = GetLinearConstrainer( isolate, args );
+    if( linearConstrainer )
+    {
+      linearConstrainer.Remove(targetActor);
+    }
+  }
+}
+
+} // namespace V8Plugin
+
+} // namespace Dali
diff --git a/plugins/dali-script-v8/src/animation/constrainer-api.h b/plugins/dali-script-v8/src/animation/constrainer-api.h
new file mode 100644 (file)
index 0000000..15d49ea
--- /dev/null
@@ -0,0 +1,46 @@
+#ifndef __DALI_V8PLUGIN_CONSTRAINER_API_H__
+#define __DALI_V8PLUGIN_CONSTRAINER_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>
+
+
+namespace Dali
+{
+
+namespace V8Plugin
+{
+
+namespace ConstrainerApi
+{
+  /**
+   * Constrainer API see constrainer.h for a description
+   */
+  void Apply( const v8::FunctionCallbackInfo< v8::Value >& args );
+  void Remove( const v8::FunctionCallbackInfo< v8::Value >& args );
+
+}; // namespace ConstrainerApi
+
+} // namespace V8Plugin
+
+} // namespace Dali
+
+#endif // header __DALI_V8PLUGIN_PATH_CONSTRAINER_API_H__
diff --git a/plugins/dali-script-v8/src/animation/linear-constrainer-wrapper.cpp b/plugins/dali-script-v8/src/animation/linear-constrainer-wrapper.cpp
new file mode 100644 (file)
index 0000000..02d009c
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics 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 "linear-constrainer-wrapper.h"
+
+// INTERNAL INCLUDES
+#include <animation/constrainer-api.h>
+#include <dali-wrapper.h>
+#include <shared/object-template-helper.h>
+#include <v8-utils.h>
+
+namespace Dali
+{
+
+namespace V8Plugin
+{
+
+namespace
+{
+
+const ApiFunction ConstrainerFunctions[]=
+{
+ { "ApplyConstraint",  ConstrainerApi::Apply },
+ { "RemoveConstraint", ConstrainerApi::Remove }
+};
+const unsigned int ConstrainerFunctionTableCount = sizeof(ConstrainerFunctions)/sizeof(ConstrainerFunctions[0]);
+
+} //un-named space
+
+LinearConstrainerWrapper::LinearConstrainerWrapper( LinearConstrainer linearConstrainer, GarbageCollectorInterface& gc )
+:HandleWrapper( BaseWrappedObject::LINEAR_CONSTRAINER, linearConstrainer, gc ),
+ mLinearConstrainer( linearConstrainer )
+{
+}
+
+v8::Handle<v8::ObjectTemplate> LinearConstrainerWrapper::MakeLinearConstrainerTemplate( 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, ConstrainerFunctions, ConstrainerFunctionTableCount );
+
+  // property handle intercepts property getters and setters and signals
+  HandleWrapper::AddInterceptsToTemplate( isolate, objTemplate );
+
+  return handleScope.Escape( objTemplate );
+}
+
+v8::Handle<v8::Object> LinearConstrainerWrapper::WrapLinearConstrainer( v8::Isolate* isolate, LinearConstrainer linearConstrainer )
+{
+  v8::EscapableHandleScope handleScope( isolate );
+  v8::Local<v8::ObjectTemplate> objectTemplate;
+
+  objectTemplate = MakeLinearConstrainerTemplate( isolate );
+
+  // create an instance of the template
+  v8::Local<v8::Object> localObject = objectTemplate->NewInstance();
+
+  // create the pathconstrainer object
+  LinearConstrainerWrapper* pointer = new LinearConstrainerWrapper( linearConstrainer, Dali::V8Plugin::DaliWrapper::Get().GetDaliGarbageCollector() );
+
+  // assign the JavaScript object to the wrapper.
+  // This also stores Dali object, in an internal field inside the JavaScript object.
+  pointer->SetJavascriptObject( isolate, localObject );
+
+  return handleScope.Escape( localObject );
+}
+
+LinearConstrainer LinearConstrainerWrapper::GetLinearConstrainer()
+{
+  return mLinearConstrainer;
+}
+
+/**
+ * Create an initialized PathConstrainer handle.
+ * @constructor
+ * @for PathConstrainer
+ * @method PathConstrainer
+ */
+void LinearConstrainerWrapper::NewLinearConstrainer( const v8::FunctionCallbackInfo< v8::Value >& args)
+{
+  v8::Isolate* isolate = args.GetIsolate();
+  v8::HandleScope handleScope( isolate );
+
+  if( !args.IsConstructCall() )
+  {
+    DALI_SCRIPT_EXCEPTION( isolate, "constructor called without 'new" );
+    return;
+  }
+
+  LinearConstrainer linearConstrainer = LinearConstrainer::New();
+  v8::Local<v8::Object> localObject = WrapLinearConstrainer( isolate, linearConstrainer );
+  args.GetReturnValue().Set( localObject );
+}
+
+
+} // namespace V8Plugin
+
+} // namespace Dali
diff --git a/plugins/dali-script-v8/src/animation/linear-constrainer-wrapper.h b/plugins/dali-script-v8/src/animation/linear-constrainer-wrapper.h
new file mode 100644 (file)
index 0000000..610ab62
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef __DALI_V8PLUGIN_LINEAR_CONSTRAINER_WRAPPER_H__
+#define __DALI_V8PLUGIN_LINEAR_CONSTRAINER_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 <dali/public-api/animation/linear-constrainer.h>
+#include <v8.h>
+
+// INTERNAL INCLUDES
+#include <object/handle-wrapper.h>
+
+
+namespace Dali
+{
+
+namespace V8Plugin
+{
+
+/**
+ * Wraps a LinearConstrainer.
+ */
+class LinearConstrainerWrapper : public HandleWrapper
+{
+
+public:
+
+  /**
+   * Constructor
+   */
+  LinearConstrainerWrapper( LinearConstrainer linearConstrainer, GarbageCollectorInterface& gc );
+
+  /**
+   * Virtual destructor
+   */
+  virtual ~LinearConstrainerWrapper(){};
+
+  /**
+   * Creates a new PathConstrainer wrapped inside a Javascript Object.
+   * @param[in] args v8 function call arguments interpreted
+   */
+  static void NewLinearConstrainer( const v8::FunctionCallbackInfo< v8::Value >& args);
+
+  /**
+   * Wraps a PathConstrainer inside a Javascript object
+   */
+  static v8::Handle<v8::Object> WrapLinearConstrainer(v8::Isolate* isolate, LinearConstrainer pathConstrainer );
+
+  /*
+   * Get the wrapped PathConstrainer
+   */
+  LinearConstrainer GetLinearConstrainer();
+
+private:
+
+  /**
+   * Create a v8 object template for the PathConstrainer
+   */
+  static v8::Handle<v8::ObjectTemplate> MakeLinearConstrainerTemplate( v8::Isolate* isolate );
+
+  Dali::LinearConstrainer mLinearConstrainer;
+};
+
+} // namespace V8Plugin
+
+} // namespace Dali
+
+#endif // header
  */
 
 // CLASS HEADER
-#include "path-constraint-wrapper.h"
+#include "path-constrainer-wrapper.h"
 
 // INTERNAL INCLUDES
-#include <v8-utils.h>
+#include <animation/constrainer-api.h>
 #include <dali-wrapper.h>
 #include <shared/object-template-helper.h>
+#include <v8-utils.h>
 
 namespace Dali
 {
@@ -29,37 +30,52 @@ namespace Dali
 namespace V8Plugin
 {
 
-PathConstraintWrapper::PathConstraintWrapper( PathConstraint pathConstraint, GarbageCollectorInterface& gc )
-:HandleWrapper( BaseWrappedObject::PATH_CONSTRAINT, pathConstraint, gc ),
- mPathConstraint( pathConstraint )
+namespace
+{
+
+const ApiFunction ConstrainerFunctions[]=
+{
+ { "ApplyConstraint",  ConstrainerApi::Apply },
+ { "RemoveConstraint", ConstrainerApi::Remove }
+};
+const unsigned int ConstrainerFunctionTableCount = sizeof(ConstrainerFunctions)/sizeof(ConstrainerFunctions[0]);
+
+} //un-named space
+
+PathConstrainerWrapper::PathConstrainerWrapper( PathConstrainer pathConstrainer, GarbageCollectorInterface& gc )
+:HandleWrapper( BaseWrappedObject::PATH_CONSTRAINER, pathConstrainer, gc ),
+ mPathConstrainer( pathConstrainer )
 {
 }
 
-v8::Handle<v8::ObjectTemplate> PathConstraintWrapper::MakePathConstraintTemplate( v8::Isolate* isolate )
+v8::Handle<v8::ObjectTemplate> PathConstrainerWrapper::MakePathConstrainerTemplate( 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, ConstrainerFunctions, ConstrainerFunctionTableCount );
+
   // property handle intercepts property getters and setters and signals
   HandleWrapper::AddInterceptsToTemplate( isolate, objTemplate );
 
   return handleScope.Escape( objTemplate );
 }
 
-v8::Handle<v8::Object> PathConstraintWrapper::WrapPathConstraint( v8::Isolate* isolate, PathConstraint pathConstraint )
+v8::Handle<v8::Object> PathConstrainerWrapper::WrapPathConstrainer( v8::Isolate* isolate, PathConstrainer pathConstrainer )
 {
   v8::EscapableHandleScope handleScope( isolate );
   v8::Local<v8::ObjectTemplate> objectTemplate;
 
-  objectTemplate = MakePathConstraintTemplate( isolate );
+  objectTemplate = MakePathConstrainerTemplate( isolate );
 
   // create an instance of the template
   v8::Local<v8::Object> localObject = objectTemplate->NewInstance();
 
-  // create the pathconstraint object
-  PathConstraintWrapper* pointer = new PathConstraintWrapper( pathConstraint, Dali::V8Plugin::DaliWrapper::Get().GetDaliGarbageCollector() );
+  // create the pathconstrainer object
+  PathConstrainerWrapper* pointer = new PathConstrainerWrapper( pathConstrainer, Dali::V8Plugin::DaliWrapper::Get().GetDaliGarbageCollector() );
 
   // assign the JavaScript object to the wrapper.
   // This also stores Dali object, in an internal field inside the JavaScript object.
@@ -68,18 +84,18 @@ v8::Handle<v8::Object> PathConstraintWrapper::WrapPathConstraint( v8::Isolate* i
   return handleScope.Escape( localObject );
 }
 
-PathConstraint PathConstraintWrapper::GetPathConstraint()
+PathConstrainer PathConstrainerWrapper::GetPathConstrainer()
 {
-  return mPathConstraint;
+  return mPathConstrainer;
 }
 
 /**
- * Create an initialized PathConstraint handle.
+ * Create an initialized PathConstrainer handle.
  * @constructor
- * @for Path
- * @method Path
+ * @for PathConstrainer
+ * @method PathConstrainer
  */
-void PathConstraintWrapper::NewPathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args)
+void PathConstrainerWrapper::NewPathConstrainer( const v8::FunctionCallbackInfo< v8::Value >& args)
 {
   v8::Isolate* isolate = args.GetIsolate();
   v8::HandleScope handleScope( isolate );
@@ -90,30 +106,11 @@ void PathConstraintWrapper::NewPathConstraint( const v8::FunctionCallbackInfo< v
     return;
   }
 
-  //Extract Path Handle
-  bool parameterFound;
-  Handle pathHandle = V8Utils::GetHandleParameter( PARAMETER_0, parameterFound, isolate, args );
-  if( !parameterFound )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 0 (Path)" );
-    return;
-  }
-  Dali::Path path = Path::DownCast(pathHandle);
-
-  //Extract range
-  Vector2 range = V8Utils::GetVector2Parameter( PARAMETER_1, parameterFound, isolate, args );
-  if( !parameterFound )
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "bad parameter 1 (Range)" );
-    return;
-  }
-
-  PathConstraint pathConstraint = PathConstraint::New(path, range );
-  v8::Local<v8::Object> localObject = WrapPathConstraint( isolate, pathConstraint );
+  PathConstrainer pathConstrainer = PathConstrainer::New();
+  v8::Local<v8::Object> localObject = WrapPathConstrainer( isolate, pathConstrainer );
   args.GetReturnValue().Set( localObject );
 }
 
-
 } // namespace V8Plugin
 
 } // namespace Dali
@@ -1,5 +1,5 @@
-#ifndef __DALI_V8PLUGIN_PATH_CONSTRAINT_WRAPPER_H__
-#define __DALI_V8PLUGIN_PATH_CONSTRAINT_WRAPPER_H__
+#ifndef __DALI_V8PLUGIN_PATH_CONSTRAINER_WRAPPER_H__
+#define __DALI_V8PLUGIN_PATH_CONSTRAINER_WRAPPER_H__
 
 /*
  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
@@ -19,8 +19,8 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/devel-api/animation/path-constrainer.h>
 #include <v8.h>
-#include <dali/public-api/animation/path-constraint.h>
 
 // INTERNAL INCLUDES
 #include <object/handle-wrapper.h>
@@ -33,9 +33,9 @@ namespace V8Plugin
 {
 
 /**
- * Wraps a Path.
+ * Wraps a PathConstrainer.
  */
-class PathConstraintWrapper : public HandleWrapper
+class PathConstrainerWrapper : public HandleWrapper
 {
 
 public:
@@ -43,37 +43,37 @@ public:
   /**
    * Constructor
    */
-  PathConstraintWrapper( PathConstraint pathConstraint, GarbageCollectorInterface& gc );
+  PathConstrainerWrapper( PathConstrainer pathConstrainer, GarbageCollectorInterface& gc );
 
   /**
    * Virtual destructor
    */
-  virtual ~PathConstraintWrapper(){};
+  virtual ~PathConstrainerWrapper(){};
 
   /**
-   * Creates a new PathConstraint wrapped inside a Javascript Object.
+   * Creates a new PathConstrainer wrapped inside a Javascript Object.
    * @param[in] args v8 function call arguments interpreted
    */
-  static void NewPathConstraint( const v8::FunctionCallbackInfo< v8::Value >& args);
+  static void NewPathConstrainer( const v8::FunctionCallbackInfo< v8::Value >& args);
 
   /**
-   * Wraps a PathConstraint inside a Javascript object
+   * Wraps a PathConstrainer inside a Javascript object
    */
-  static v8::Handle<v8::Object> WrapPathConstraint(v8::Isolate* isolate, PathConstraint pathConstraint );
+  static v8::Handle<v8::Object> WrapPathConstrainer(v8::Isolate* isolate, PathConstrainer pathConstrainer );
 
   /*
-   * Get the wrapped PathConstraint
+   * Get the wrapped PathConstrainer
    */
-  PathConstraint GetPathConstraint();
+  PathConstrainer GetPathConstrainer();
 
 private:
 
   /**
-   * Create a v8 object template for the PathConstraint
+   * Create a v8 object template for the PathConstrainer
    */
-  static v8::Handle<v8::ObjectTemplate> MakePathConstraintTemplate( v8::Isolate* isolate );
+  static v8::Handle<v8::ObjectTemplate> MakePathConstrainerTemplate( v8::Isolate* isolate );
 
-  PathConstraint mPathConstraint;
+  Dali::PathConstrainer mPathConstrainer;
 };
 
 } // namespace V8Plugin
index 38231b8..09205d7 100644 (file)
@@ -25,8 +25,9 @@
 #include <actors/actor-wrapper.h>
 #include <stage/stage-wrapper.h>
 #include <image/image-wrapper.h>
+#include <animation/linear-constrainer-wrapper.h>
+#include <animation/path-constrainer-wrapper.h>
 #include <animation/path-wrapper.h>
-#include <animation/path-constraint-wrapper.h>
 #include <animation/animation-wrapper.h>
 #include <events/pan-gesture-detector-wrapper.h>
 #include <shader-effects/shader-effect-wrapper.h>
@@ -59,7 +60,8 @@ const ApiFunction ConstructorFunctionTable[]=
     { "Rotation",           PropertyValueWrapper::NewRotation},
     { "Matrix",             PropertyValueWrapper::NewMatrix},
     { "Path",               PathWrapper::NewPath },
-    { "PathConstraint",     PathConstraintWrapper::NewPathConstraint },
+    { "PathConstrainer",    PathConstrainerWrapper::NewPathConstrainer},
+    { "LinearConstrainer",  LinearConstrainerWrapper::NewLinearConstrainer},
     { "Actor",              ActorWrapper::NewActor },
     { "TextActor",          ActorWrapper::NewActor },
     { "ImageActor",         ActorWrapper::NewActor },
index c97ee40..24cf638 100644 (file)
@@ -21,7 +21,7 @@
 
 // INTERNAL INCLUDES
 #include <interfaces/garbage-collector-interface.h>
-#include <dali/public-api/common/set-wrapper.h>
+#include <dali/devel-api/common/set-wrapper.h>
 
 
 namespace Dali
index 8e7df33..b30b948 100644 (file)
@@ -19,7 +19,7 @@
 #include "resource-image-api.h"
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/images/image-operations.h>
+#include <dali/devel-api/images/image-operations.h>
 
 // INTERNAL INCLUDES
 #include <v8-utils.h>
index 29bfb01..b5595f8 100644 (file)
@@ -19,6 +19,7 @@
 
 // EXTERNAL INCLUDES
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/object/property-array.h>
 
 // INTERNAL INCLUDES
 #include <v8-utils.h>
@@ -89,7 +90,7 @@ void SetY( Dali::Property::Value &value, S& v)
 {
   T tmp = value.Get<T>();
   tmp.y = v;
-  value = tmp ;
+  value = tmp;
 }
 
 template <typename T, typename S>
@@ -97,7 +98,7 @@ void SetZ( Dali::Property::Value &value, S& v)
 {
   T tmp = value.Get<T>();
   tmp.z = v;
-  value = tmp ;
+  value = tmp;
 }
 
 template <typename T, typename S>
@@ -105,14 +106,14 @@ void SetW( Dali::Property::Value &value, S& v)
 {
   T tmp = value.Get<T>();
   tmp.w = v;
-  value = tmp ;
+  value = tmp;
 }
 template <typename T, typename S>
 void SetWidth( Dali::Property::Value &value, S& v)
 {
   T tmp = value.Get<T>();
   tmp.width = v;
-  value = tmp ;
+  value = tmp;
 }
 
 template <typename T, typename S>
@@ -120,7 +121,7 @@ void SetHeight( Dali::Property::Value &value, S& v)
 {
   T tmp = value.Get<T>();
   tmp.height = v;
-  value = tmp ;
+  value = tmp;
 }
 
 v8::Handle< v8::Value > GetV8ValueFrom( v8::Isolate* isolate,
@@ -142,13 +143,13 @@ v8::Handle< v8::Value > GetV8ValueFrom( v8::Isolate* isolate,
 
       if( field == "x" || field == "width" )
       {
-        Dali::Vector2 v2 = value.Get<Dali::Vector2>() ;
-        ret = v8::Number::New( isolate, v2.x) ;
+        Dali::Vector2 v2 = value.Get<Dali::Vector2>();
+        ret = v8::Number::New( isolate, v2.x);
       }
       else if(field == "y" || field == "height")
       {
-        Dali::Vector2 v2 = value.Get<Dali::Vector2>() ;
-        ret = v8::Number::New( isolate, v2.y) ;
+        Dali::Vector2 v2 = value.Get<Dali::Vector2>();
+        ret = v8::Number::New( isolate, v2.y);
       }
 
       break;
@@ -159,18 +160,18 @@ v8::Handle< v8::Value > GetV8ValueFrom( v8::Isolate* isolate,
 
       if(field == "x" || field == "width" || field == "r")
       {
-        Dali::Vector3 v3 = value.Get<Dali::Vector3>() ;
-        ret = v8::Number::New( isolate, v3.x) ;
+        Dali::Vector3 v3 = value.Get<Dali::Vector3>();
+        ret = v8::Number::New( isolate, v3.x);
       }
       else if(field == "y" || field == "height" || field == "g")
       {
-        Dali::Vector3 v3 = value.Get<Dali::Vector3>() ;
-        ret = v8::Number::New( isolate, v3.y) ;
+        Dali::Vector3 v3 = value.Get<Dali::Vector3>();
+        ret = v8::Number::New( isolate, v3.y);
       }
       else if(field == "z" || field == "depth" || field == "b")
       {
-        Dali::Vector3 v3 = value.Get<Dali::Vector3>() ;
-        ret = v8::Number::New( isolate, v3.z) ;
+        Dali::Vector3 v3 = value.Get<Dali::Vector3>();
+        ret = v8::Number::New( isolate, v3.z);
       }
       break;
     }
@@ -180,23 +181,23 @@ v8::Handle< v8::Value > GetV8ValueFrom( v8::Isolate* isolate,
 
       if(field == "x" || field == "s" || field == "r")
       {
-        Dali::Vector4 v4 = value.Get<Dali::Vector4>() ;
-        ret = v8::Number::New( isolate, v4.x) ;
+        Dali::Vector4 v4 = value.Get<Dali::Vector4>();
+        ret = v8::Number::New( isolate, v4.x);
       }
       else if(field == "y" || field == "g" || field == "t")
       {
-        Dali::Vector4 v4 = value.Get<Dali::Vector4>() ;
-        ret = v8::Number::New( isolate, v4.y) ;
+        Dali::Vector4 v4 = value.Get<Dali::Vector4>();
+        ret = v8::Number::New( isolate, v4.y);
       }
       else if(field == "z" || field == "r" || field == "b")
       {
-        Dali::Vector4 v4 = value.Get<Dali::Vector4>() ;
-        ret = v8::Number::New( isolate, v4.z) ;
+        Dali::Vector4 v4 = value.Get<Dali::Vector4>();
+        ret = v8::Number::New( isolate, v4.z);
       }
       else if(field == "w" || field == "a" || field == "q")
       {
-        Dali::Vector4 v4 = value.Get<Dali::Vector4>() ;
-        ret = v8::Number::New( isolate, v4.w) ;
+        Dali::Vector4 v4 = value.Get<Dali::Vector4>();
+        ret = v8::Number::New( isolate, v4.w);
       }
 
       break;
@@ -208,17 +209,17 @@ v8::Handle< v8::Value > GetV8ValueFrom( v8::Isolate* isolate,
       if(field == "roll")
       {
         Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
-        ret = v8::Number::New( isolate, v4.z) ;
+        ret = v8::Number::New( isolate, v4.z);
       }
       else if(field == "pitch")
       {
         Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
-        ret = v8::Number::New( isolate, v4.x) ;
+        ret = v8::Number::New( isolate, v4.x);
       }
       else if(field == "yaw")
       {
         Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
-        ret = v8::Number::New( isolate, v4.y) ;
+        ret = v8::Number::New( isolate, v4.y);
       }
 
        else if(field == "axis")
@@ -243,23 +244,23 @@ v8::Handle< v8::Value > GetV8ValueFrom( v8::Isolate* isolate,
 
       if(field == "x")
       {
-        Dali::Rect<int> r = value.Get<Dali::Rect<int> >() ;
-        ret = v8::Number::New( isolate, r.x) ;
+        Dali::Rect<int> r = value.Get<Dali::Rect<int> >();
+        ret = v8::Number::New( isolate, r.x);
       }
       else if(field == "y")
       {
-        Dali::Rect<int> r = value.Get<Dali::Rect<int> >() ;
-        ret = v8::Number::New( isolate, r.y) ;
+        Dali::Rect<int> r = value.Get<Dali::Rect<int> >();
+        ret = v8::Number::New( isolate, r.y);
       }
       else if(field == "width")
       {
-        Dali::Rect<int> r = value.Get<Dali::Rect<int> >() ;
-        ret = v8::Number::New( isolate, r.width) ;
+        Dali::Rect<int> r = value.Get<Dali::Rect<int> >();
+        ret = v8::Number::New( isolate, r.width);
       }
       else if(field == "height")
       {
-        Dali::Rect<int> r = value.Get<Dali::Rect<int> >() ;
-        ret = v8::Number::New( isolate, r.height) ;
+        Dali::Rect<int> r = value.Get<Dali::Rect<int> >();
+        ret = v8::Number::New( isolate, r.height);
       }
       break;
     }
@@ -319,11 +320,11 @@ void SetFromV8Value(v8::Isolate* isolate,
     {
       if(field == "x" || field == "width")
       {
-        SetX<Dali::Vector2>(value, asFloat) ;
+        SetX<Dali::Vector2>(value, asFloat);
       }
       else if(field == "y" || field == "height")
       {
-        SetY<Dali::Vector2>(value, asFloat) ;
+        SetY<Dali::Vector2>(value, asFloat);
       }
       else
       {
@@ -336,15 +337,15 @@ void SetFromV8Value(v8::Isolate* isolate,
     {
       if(field == "x" || field == "width" || field == "r")
       {
-        SetX<Dali::Vector3>(value, asFloat) ;
+        SetX<Dali::Vector3>(value, asFloat);
       }
       else if(field == "y" || field == "height" || field == "g")
       {
-        SetY<Dali::Vector3>(value, asFloat) ;
+        SetY<Dali::Vector3>(value, asFloat);
       }
       else if(field == "z" || field == "depth" || field == "b")
       {
-        SetZ<Dali::Vector3>(value, asFloat) ;
+        SetZ<Dali::Vector3>(value, asFloat);
       }
       else
       {
@@ -357,19 +358,19 @@ void SetFromV8Value(v8::Isolate* isolate,
     {
       if(field == "x" || field == "s" || field == "r")
       {
-        SetX<Dali::Vector4>(value, asFloat) ;
+        SetX<Dali::Vector4>(value, asFloat);
       }
       else if(field == "y" || field == "g" || field == "t")
       {
-        SetY<Dali::Vector4>(value, asFloat) ;
+        SetY<Dali::Vector4>(value, asFloat);
       }
       else if(field == "z" || field == "r" || field == "b")
       {
-        SetZ<Dali::Vector4>(value, asFloat) ;
+        SetZ<Dali::Vector4>(value, asFloat);
       }
       else if(field == "w" || field == "a" || field == "q")
       {
-        SetW<Dali::Vector4>(value, asFloat) ;
+        SetW<Dali::Vector4>(value, asFloat);
       }
       else
       {
@@ -441,15 +442,15 @@ void SetFromV8Value(v8::Isolate* isolate,
     {
       if(field == "x")
       {
-        SetX<Dali::Rect<int> >(value, asInt) ;
+        SetX<Dali::Rect<int> >(value, asInt);
       }
       else if(field == "y")
       {
-        SetY<Dali::Rect<int> >(value, asInt) ;
+        SetY<Dali::Rect<int> >(value, asInt);
       }
       else if(field == "width")
       {
-        SetWidth<Dali::Rect<int> >(value, asInt) ;
+        SetWidth<Dali::Rect<int> >(value, asInt);
       }
       else if(field == "height")
       {
@@ -496,7 +497,7 @@ v8::Local<v8::Object> CreateJavaScriptPrimitive( v8::Isolate* isolate, const Dal
 {
   v8::EscapableHandleScope handleScope( isolate );
 
-  v8::Local<v8::Value> v8Value ;
+  v8::Local<v8::Value> v8Value;
 
   switch( value.GetType() )
    {
@@ -605,12 +606,13 @@ Dali::Property::Value PropertyValueWrapper::ArrayFromV8Array( v8::Isolate* isola
   //Cast v8::Value to v8::Array
   v8::Local<v8::Array> v8Array = v8::Local<v8::Array>::Cast( v8Value );
   uint32_t elementCount = v8Array->Length();
-  Dali::Property::Array data( elementCount );
+  Dali::Property::Array data;
+  data.Reserve( elementCount );
   bool bFound(false);
   for( uint32_t i(0); i<elementCount; ++i )
   {
     //Get Property::Value for each element in the array
-    data[i] = V8Utils::GetPropertyValueFromObject( bFound, isolate, v8Array->Get(i) );
+    data.PushBack( V8Utils::GetPropertyValueFromObject( bFound, isolate, v8Array->Get(i) ) );
   }
 
   //return the Property::Value
@@ -724,6 +726,15 @@ Dali::Property::Value PropertyValueWrapper::ExtractPropertyValue( v8::Isolate* i
       }
       break;
     }
+    case Dali::Property::RECTANGLE:
+    {
+      if( array.GetType() == Dali::Property::VECTOR4)
+      {
+        Vector4 vec4( array.Get<Vector4>());
+        daliPropertyValue = Property::Value(Rect<int>( vec4.x,vec4.y, vec4.z, vec4.w ));
+      }
+      break;
+    }
     case Dali::Property::ROTATION:
     {
       if( array.GetType() == Dali::Property::VECTOR4)
@@ -780,7 +791,7 @@ void PropertyValueWrapper::NewRotation( const v8::FunctionCallbackInfo< v8::Valu
   }
   v8::Local<v8::Object > object;
 
-  float v[4] = {0.f,0.f,0.f,0.f} ;
+  float v[4] = {0.f,0.f,0.f,0.f};
 
   bool foundAllArguments(false);
   V8Utils::ReadFloatArguments( foundAllArguments, v, 4, args, 0.f );
index fee9d8c..b9f2cb8 100644 (file)
@@ -71,7 +71,8 @@ public:
       CONNECTION,
       ANIMATION,
       PATH,
-      PATH_CONSTRAINT,
+      PATH_CONSTRAINER,
+      LINEAR_CONSTRAINER,
       BUILDER,
       STAGE,
       FONT,
index ac505ef..38aa8e8 100755 (executable)
@@ -126,6 +126,6 @@ void LoadAtlasImages()
 //
 
 ATLAS_IMAGE_LIST : [
-{% for sprite in allSprites %} { name: "{{sprite.trimmedName}}", x: {{sprite.frameRect.x}}, y:{{sprite.frameRect.y}}, w:{{sprite.frameRect.width}}, h:{{sprite.frameRect.height}}, {%if sprite.isSolid %}dali.BLENDING_OFF{% else%}dali.BLENDING_ON{% endif %}  }{% if not forloop.last %},{% endif %}
+{% for sprite in allSprites %} { name: "{{sprite.trimmedName}}", x: {{sprite.frameRect.x}}, y:{{sprite.frameRect.y}}, w:{{sprite.frameRect.width}}, h:{{sprite.frameRect.height}}, blendMode:{%if sprite.isSolid %}dali.BLENDING_OFF{% else%}dali.BLENDING_ON{% endif %}  }{% if not forloop.last %},{% endif %}
 {% endfor %}
-]
\ No newline at end of file
+]