[dali_1.0.42] Merge branch 'tizen' 11/40111/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 29 May 2015 08:01:50 +0000 (09:01 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 29 May 2015 08:01:50 +0000 (09:01 +0100)
Change-Id: I81fb21b7b5b152145b7baadb85f32249b4eaaf72

454 files changed:
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-internal/utc-Dali-PushButton.cpp
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dummy-control.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-harness.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-platform-abstraction.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.h
automated-tests/src/dali-toolkit/utc-Dali-Alignment.cpp
automated-tests/src/dali-toolkit/utc-Dali-BendyEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-BlindEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-BloomView.cpp
automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp
automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp
automated-tests/src/dali-toolkit/utc-Dali-Button.cpp
automated-tests/src/dali-toolkit/utc-Dali-CarouselEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-Control.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlImpl.cpp
automated-tests/src/dali-toolkit/utc-Dali-CubeTransitionEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-DefaultControls.cpp
automated-tests/src/dali-toolkit/utc-Dali-DepthLayout.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-DisplacementEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-DissolveEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-DistanceFieldEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-FocusManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-GridLayout.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-IrisEffect.cpp
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-JsonParser.cpp
automated-tests/src/dali-toolkit/utc-Dali-KeyboardFocusManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-MaskEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-NavigationControl.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-NinePatchMaskEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-OverlayEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-Page.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-PageTurnEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp
automated-tests/src/dali-toolkit/utc-Dali-Popup.cpp
automated-tests/src/dali-toolkit/utc-Dali-PushButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-RadioButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-Ripple2DEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-RippleEffect.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-ShadowView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ShearEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-Slider.cpp
automated-tests/src/dali-toolkit/utc-Dali-SoftButtonEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-SpiralLayout.cpp [deleted file]
automated-tests/src/dali-toolkit/utc-Dali-SpotEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-SquareDissolveEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-StyleManager.cpp
automated-tests/src/dali-toolkit/utc-Dali-SuperBlurView.cpp
automated-tests/src/dali-toolkit/utc-Dali-SwirlEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-TableView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit/utc-Dali-ToolBar.cpp
automated-tests/src/dali-toolkit/utc-Dali-WaterEffect.cpp
build/tizen/dali-toolkit/Makefile.am
build/tizen/docs/dali.doxy.in
build/tizen/docs/dali_doxygen.css [new file with mode: 0644]
build/tizen/plugins/Makefile.am
dali-toolkit/dali-toolkit.h
dali-toolkit/devel-api/builder/builder.cpp [moved from dali-toolkit/public-api/builder/builder.cpp with 91% similarity]
dali-toolkit/devel-api/builder/builder.h [moved from dali-toolkit/public-api/builder/builder.h with 92% similarity]
dali-toolkit/devel-api/builder/json-parser.cpp [moved from dali-toolkit/public-api/builder/json-parser.cpp with 97% similarity]
dali-toolkit/devel-api/builder/json-parser.h [moved from dali-toolkit/public-api/builder/json-parser.h with 98% similarity]
dali-toolkit/devel-api/builder/tree-node.cpp [moved from dali-toolkit/public-api/builder/tree-node.cpp with 98% similarity]
dali-toolkit/devel-api/builder/tree-node.h [moved from dali-toolkit/public-api/builder/tree-node.h with 100% similarity]
dali-toolkit/devel-api/controls/bloom-view/bloom-view.cpp [moved from dali-toolkit/public-api/controls/bloom-view/bloom-view.cpp with 97% similarity]
dali-toolkit/devel-api/controls/bloom-view/bloom-view.h [moved from dali-toolkit/public-api/controls/bloom-view/bloom-view.h with 98% similarity]
dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.cpp [moved from dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.cpp with 97% similarity]
dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h [moved from dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.h with 100% similarity]
dali-toolkit/devel-api/controls/effects-view/effects-view.cpp [moved from dali-toolkit/public-api/controls/effects-view/effects-view.cpp with 97% similarity]
dali-toolkit/devel-api/controls/effects-view/effects-view.h [moved from dali-toolkit/public-api/controls/effects-view/effects-view.h with 100% similarity]
dali-toolkit/devel-api/controls/magnifier/magnifier.cpp [moved from dali-toolkit/public-api/controls/magnifier/magnifier.cpp with 92% similarity]
dali-toolkit/devel-api/controls/magnifier/magnifier.h [moved from dali-toolkit/public-api/controls/magnifier/magnifier.h with 100% similarity]
dali-toolkit/devel-api/controls/page-turn-view/page-factory.cpp [moved from dali-toolkit/public-api/controls/page-turn-view/page-factory.cpp with 96% similarity]
dali-toolkit/devel-api/controls/page-turn-view/page-factory.h [moved from dali-toolkit/public-api/controls/page-turn-view/page-factory.h with 100% similarity]
dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.cpp [moved from dali-toolkit/public-api/controls/page-turn-view/page-turn-landscape-view.cpp with 95% similarity]
dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h [moved from dali-toolkit/public-api/controls/page-turn-view/page-turn-landscape-view.h with 97% similarity]
dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.cpp [moved from dali-toolkit/public-api/controls/page-turn-view/page-turn-portrait-view.cpp with 95% similarity]
dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h [moved from dali-toolkit/public-api/controls/page-turn-view/page-turn-portrait-view.h with 97% similarity]
dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.cpp [moved from dali-toolkit/public-api/controls/page-turn-view/page-turn-view.cpp with 97% similarity]
dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h [moved from dali-toolkit/public-api/controls/page-turn-view/page-turn-view.h with 100% similarity]
dali-toolkit/devel-api/controls/popup/popup.cpp [moved from dali-toolkit/public-api/controls/popup/popup.cpp with 97% similarity]
dali-toolkit/devel-api/controls/popup/popup.h [moved from dali-toolkit/public-api/controls/popup/popup.h with 100% similarity]
dali-toolkit/devel-api/controls/shadow-view/shadow-view.cpp [moved from dali-toolkit/public-api/controls/shadow-view/shadow-view.cpp with 97% similarity]
dali-toolkit/devel-api/controls/shadow-view/shadow-view.h [moved from dali-toolkit/public-api/controls/shadow-view/shadow-view.h with 98% similarity]
dali-toolkit/devel-api/controls/slider/slider.cpp [moved from dali-toolkit/public-api/controls/slider/slider.cpp with 97% similarity]
dali-toolkit/devel-api/controls/slider/slider.h [moved from dali-toolkit/public-api/controls/slider/slider.h with 100% similarity]
dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.cpp [moved from dali-toolkit/public-api/controls/super-blur-view/super-blur-view.cpp with 96% similarity]
dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h [moved from dali-toolkit/public-api/controls/super-blur-view/super-blur-view.h with 100% similarity]
dali-toolkit/devel-api/controls/text-controls/text-selection-popup.cpp [moved from dali-toolkit/public-api/controls/text-controls/text-selection-popup.cpp with 95% similarity]
dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h [moved from dali-toolkit/public-api/controls/text-controls/text-selection-popup.h with 100% similarity]
dali-toolkit/devel-api/controls/tool-bar/tool-bar.cpp [moved from dali-toolkit/public-api/controls/tool-bar/tool-bar.cpp with 95% similarity]
dali-toolkit/devel-api/controls/tool-bar/tool-bar.h [moved from dali-toolkit/public-api/controls/tool-bar/tool-bar.h with 96% similarity]
dali-toolkit/devel-api/file.list [new file with mode: 0755]
dali-toolkit/devel-api/scripting/script-plugin.h [moved from dali-toolkit/public-api/scripting/script-plugin.h with 100% similarity]
dali-toolkit/devel-api/scripting/script.cpp [moved from dali-toolkit/public-api/scripting/script.cpp with 100% similarity]
dali-toolkit/devel-api/scripting/script.h [moved from dali-toolkit/public-api/scripting/script.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/alpha-discard-effect.cpp [moved from dali-toolkit/public-api/shader-effects/alpha-discard-effect.cpp with 96% similarity]
dali-toolkit/devel-api/shader-effects/alpha-discard-effect.h [moved from dali-toolkit/public-api/shader-effects/alpha-discard-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/bendy-effect.cpp [moved from dali-toolkit/public-api/shader-effects/bendy-effect.cpp with 98% similarity]
dali-toolkit/devel-api/shader-effects/bendy-effect.h [moved from dali-toolkit/public-api/shader-effects/bendy-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/blind-effect.cpp [moved from dali-toolkit/public-api/shader-effects/blind-effect.cpp with 98% similarity]
dali-toolkit/devel-api/shader-effects/blind-effect.h [moved from dali-toolkit/public-api/shader-effects/blind-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/bouncing-effect.cpp [moved from dali-toolkit/public-api/shader-effects/bouncing-effect.cpp with 97% similarity]
dali-toolkit/devel-api/shader-effects/bouncing-effect.h [moved from dali-toolkit/public-api/shader-effects/bouncing-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/bubble-effect/bubble-effect.cpp [moved from dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.cpp with 100% similarity]
dali-toolkit/devel-api/shader-effects/bubble-effect/bubble-effect.h [moved from dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/bubble-effect/color-adjuster.cpp [moved from dali-toolkit/public-api/shader-effects/bubble-effect/color-adjuster.cpp with 100% similarity]
dali-toolkit/devel-api/shader-effects/bubble-effect/color-adjuster.h [moved from dali-toolkit/public-api/shader-effects/bubble-effect/color-adjuster.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/carousel-effect.cpp [moved from dali-toolkit/public-api/shader-effects/carousel-effect.cpp with 97% similarity]
dali-toolkit/devel-api/shader-effects/carousel-effect.h [moved from dali-toolkit/public-api/shader-effects/carousel-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/displacement-effect.cpp [moved from dali-toolkit/public-api/shader-effects/displacement-effect.cpp with 99% similarity]
dali-toolkit/devel-api/shader-effects/displacement-effect.h [moved from dali-toolkit/public-api/shader-effects/displacement-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/dissolve-effect.cpp [moved from dali-toolkit/public-api/shader-effects/dissolve-effect.cpp with 99% similarity]
dali-toolkit/devel-api/shader-effects/dissolve-effect.h [moved from dali-toolkit/public-api/shader-effects/dissolve-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/dissolve-local-effect.cpp [moved from dali-toolkit/public-api/shader-effects/dissolve-local-effect.cpp with 97% similarity]
dali-toolkit/devel-api/shader-effects/dissolve-local-effect.h [moved from dali-toolkit/public-api/shader-effects/dissolve-local-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/distance-field-effect.cpp [moved from dali-toolkit/public-api/shader-effects/distance-field-effect.cpp with 99% similarity]
dali-toolkit/devel-api/shader-effects/distance-field-effect.h [moved from dali-toolkit/public-api/shader-effects/distance-field-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/image-region-effect.cpp [moved from dali-toolkit/public-api/shader-effects/image-region-effect.cpp with 97% similarity]
dali-toolkit/devel-api/shader-effects/image-region-effect.h [moved from dali-toolkit/public-api/shader-effects/image-region-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/iris-effect.cpp [moved from dali-toolkit/public-api/shader-effects/iris-effect.cpp with 98% similarity]
dali-toolkit/devel-api/shader-effects/iris-effect.h [moved from dali-toolkit/public-api/shader-effects/iris-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/mask-effect.cpp [moved from dali-toolkit/public-api/shader-effects/mask-effect.cpp with 96% similarity]
dali-toolkit/devel-api/shader-effects/mask-effect.h [moved from dali-toolkit/public-api/shader-effects/mask-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/mirror-effect.cpp [moved from dali-toolkit/public-api/shader-effects/mirror-effect.cpp with 98% similarity]
dali-toolkit/devel-api/shader-effects/mirror-effect.h [moved from dali-toolkit/public-api/shader-effects/mirror-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/motion-blur-effect.cpp [moved from dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp with 99% similarity]
dali-toolkit/devel-api/shader-effects/motion-blur-effect.h [moved from dali-toolkit/public-api/shader-effects/motion-blur-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/motion-stretch-effect.cpp [moved from dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp with 99% similarity]
dali-toolkit/devel-api/shader-effects/motion-stretch-effect.h [moved from dali-toolkit/public-api/shader-effects/motion-stretch-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/nine-patch-mask-effect.cpp [moved from dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp with 98% similarity]
dali-toolkit/devel-api/shader-effects/nine-patch-mask-effect.h [moved from dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/overlay-effect.cpp [moved from dali-toolkit/public-api/shader-effects/overlay-effect.cpp with 96% similarity]
dali-toolkit/devel-api/shader-effects/overlay-effect.h [moved from dali-toolkit/public-api/shader-effects/overlay-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/page-turn-book-spine-effect.cpp [moved from dali-toolkit/public-api/shader-effects/page-turn-book-spine-effect.cpp with 98% similarity]
dali-toolkit/devel-api/shader-effects/page-turn-book-spine-effect.h [moved from dali-toolkit/public-api/shader-effects/page-turn-book-spine-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/page-turn-effect.cpp [moved from dali-toolkit/public-api/shader-effects/page-turn-effect.cpp with 97% similarity]
dali-toolkit/devel-api/shader-effects/page-turn-effect.h [moved from dali-toolkit/public-api/shader-effects/page-turn-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/quadratic-bezier.cpp [moved from dali-toolkit/public-api/shader-effects/quadratic-bezier.cpp with 98% similarity]
dali-toolkit/devel-api/shader-effects/quadratic-bezier.h [moved from dali-toolkit/public-api/shader-effects/quadratic-bezier.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/ripple-effect.cpp [moved from dali-toolkit/public-api/shader-effects/ripple-effect.cpp with 98% similarity]
dali-toolkit/devel-api/shader-effects/ripple-effect.h [moved from dali-toolkit/public-api/shader-effects/ripple-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/ripple2d-effect.cpp [moved from dali-toolkit/public-api/shader-effects/ripple2d-effect.cpp with 97% similarity]
dali-toolkit/devel-api/shader-effects/ripple2d-effect.h [moved from dali-toolkit/public-api/shader-effects/ripple2d-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/shear-effect.cpp [moved from dali-toolkit/public-api/shader-effects/shear-effect.cpp with 98% similarity]
dali-toolkit/devel-api/shader-effects/shear-effect.h [moved from dali-toolkit/public-api/shader-effects/shear-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/soft-button-effect.cpp [moved from dali-toolkit/public-api/shader-effects/soft-button-effect.cpp with 99% similarity]
dali-toolkit/devel-api/shader-effects/soft-button-effect.h [moved from dali-toolkit/public-api/shader-effects/soft-button-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/spot-effect.cpp [moved from dali-toolkit/public-api/shader-effects/spot-effect.cpp with 97% similarity]
dali-toolkit/devel-api/shader-effects/spot-effect.h [moved from dali-toolkit/public-api/shader-effects/spot-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/square-dissolve-effect.cpp [moved from dali-toolkit/public-api/shader-effects/square-dissolve-effect.cpp with 98% similarity]
dali-toolkit/devel-api/shader-effects/square-dissolve-effect.h [moved from dali-toolkit/public-api/shader-effects/square-dissolve-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/swirl-effect.cpp [moved from dali-toolkit/public-api/shader-effects/swirl-effect.cpp with 98% similarity]
dali-toolkit/devel-api/shader-effects/swirl-effect.h [moved from dali-toolkit/public-api/shader-effects/swirl-effect.h with 100% similarity]
dali-toolkit/devel-api/shader-effects/water-effect.cpp [moved from dali-toolkit/public-api/shader-effects/water-effect.cpp with 97% similarity]
dali-toolkit/devel-api/shader-effects/water-effect.h [moved from dali-toolkit/public-api/shader-effects/water-effect.h with 100% similarity]
dali-toolkit/devel-api/styling/style-manager.cpp [moved from dali-toolkit/public-api/styling/style-manager.cpp with 97% similarity]
dali-toolkit/devel-api/styling/style-manager.h [moved from dali-toolkit/public-api/styling/style-manager.h with 96% similarity]
dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.cpp [moved from dali-toolkit/public-api/transition-effects/cube-transition-cross-effect.cpp with 100% similarity]
dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h [moved from dali-toolkit/public-api/transition-effects/cube-transition-cross-effect.h with 96% similarity]
dali-toolkit/devel-api/transition-effects/cube-transition-effect.cpp [moved from dali-toolkit/public-api/transition-effects/cube-transition-effect.cpp with 100% similarity]
dali-toolkit/devel-api/transition-effects/cube-transition-effect.h [moved from dali-toolkit/public-api/transition-effects/cube-transition-effect.h with 100% similarity]
dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.cpp [moved from dali-toolkit/public-api/transition-effects/cube-transition-fold-effect.cpp with 100% similarity]
dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h [moved from dali-toolkit/public-api/transition-effects/cube-transition-fold-effect.h with 96% similarity]
dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.cpp [moved from dali-toolkit/public-api/transition-effects/cube-transition-wave-effect.cpp with 100% similarity]
dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h [moved from dali-toolkit/public-api/transition-effects/cube-transition-wave-effect.h with 96% similarity]
dali-toolkit/internal/atlas-manager/atlas-manager.h
dali-toolkit/internal/builder/builder-actor.cpp
dali-toolkit/internal/builder/builder-declarations.h
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/json-parser-impl.h
dali-toolkit/internal/builder/json-parser-state.h
dali-toolkit/internal/builder/replacement.h
dali-toolkit/internal/builder/tree-node-manipulator.cpp
dali-toolkit/internal/builder/tree-node-manipulator.h
dali-toolkit/internal/controls/alignment/alignment-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.h
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/check-box-button-impl.h
dali-toolkit/internal/controls/buttons/push-button-impl.cpp
dali-toolkit/internal/controls/buttons/push-button-impl.h
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/effects-view/effects-view-impl.h
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.h
dali-toolkit/internal/controls/image-view/masked-image-view-impl.cpp [deleted file]
dali-toolkit/internal/controls/image-view/masked-image-view-impl.h [deleted file]
dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/magnifier/magnifier-impl.h
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-landscape-view-impl.h
dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.h
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/shadow-view/shadow-view-impl.h
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/controls/slider/slider-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h
dali-toolkit/internal/controls/table-view/table-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.h
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h
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/filters/image-filter.h
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/focus-manager/keyinput-focus-manager-impl.cpp
dali-toolkit/internal/scripting/script-impl.h
dali-toolkit/internal/scripting/script-plugin-proxy.h
dali-toolkit/internal/shader-effects/page-turn-effect-impl.h
dali-toolkit/internal/shader-effects/water-effect-impl.cpp
dali-toolkit/internal/shader-effects/water-effect-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/decorator/text-decorator.cpp
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/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-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-cross-effect-impl.h
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.cpp
dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h
dali-toolkit/internal/transition-effects/cube-transition-fold-effect-impl.h
dali-toolkit/internal/transition-effects/cube-transition-wave-effect-impl.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/control-impl.h
dali-toolkit/public-api/controls/control.cpp
dali-toolkit/public-api/controls/control.h
dali-toolkit/public-api/controls/default-controls/check-button-factory.cpp [deleted file]
dali-toolkit/public-api/controls/default-controls/check-button-factory.h [deleted file]
dali-toolkit/public-api/controls/default-controls/push-button-factory.cpp [deleted file]
dali-toolkit/public-api/controls/default-controls/push-button-factory.h [deleted file]
dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h
dali-toolkit/public-api/controls/image-view/masked-image-view.cpp [deleted file]
dali-toolkit/public-api/controls/image-view/masked-image-view.h [deleted file]
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-factory.h
dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp
dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h
dali-toolkit/public-api/controls/scrollable/item-view/item-view.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/text-controls/text-field.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
dali-toolkit/styles/dali-toolkit-default-theme.json [moved from dali-toolkit/styles/tizen-dark-theme.json with 100% similarity]
dali-toolkit/styles/mobile/dali-toolkit-default-theme.json [moved from dali-toolkit/styles/mobile/tizen-dark-theme.json with 100% similarity]
dali-toolkit/styles/mobile/tizen-default-theme.json [deleted symlink]
dali-toolkit/styles/tizen-default-theme.json [deleted symlink]
docs/api_footer.html
docs/content/images/architecture.png [new file with mode: 0644]
docs/content/images/dali-threads.png [new file with mode: 0644]
docs/content/images/example-documentation/example-code.png
docs/content/images/screen-shot.png
docs/content/images/stage-hand/blocks.png [new file with mode: 0644]
docs/content/images/stage-hand/inner-workings.png [new file with mode: 0644]
docs/content/images/stage-hand/netstat.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-logo.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-mainscreen.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-modify.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-netcat.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-performance.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-refesh.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-save.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-screenshot.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-settings.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-tizen-connection.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-ubuntu-connection.png [new file with mode: 0644]
docs/content/images/stage-hand/stagehand-zoom.png [new file with mode: 0644]
docs/content/main.md
docs/content/programming-guide/custom-actor.h [deleted file]
docs/content/programming-guide/dali-application.h
docs/content/programming-guide/dynamics-bodies.h [deleted file]
docs/content/programming-guide/dynamics-collisions.h [deleted file]
docs/content/programming-guide/dynamics-initialization.h [deleted file]
docs/content/programming-guide/dynamics-intro.h [deleted file]
docs/content/programming-guide/dynamics-joints.h [deleted file]
docs/content/programming-guide/image-actor.h [moved from docs/content/programming-guide/image-mesh-actor.h with 73% similarity]
docs/content/programming-guide/script-hello.h [deleted file]
docs/content/programming-guide/shader-intro.h
docs/content/programming-guide/size-negotiation-controls.h
docs/content/programming-guide/texture-compression.h [deleted file]
docs/content/shared-javascript-and-cpp-documentation/dali-introduction.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/fundamentals.md [moved from docs/content/programming-guide/fundamentals.h with 85% similarity]
docs/content/shared-javascript-and-cpp-documentation/high-level-design.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/javascript-wrapping-guide.md
docs/content/shared-javascript-and-cpp-documentation/performance-tips.md
docs/content/shared-javascript-and-cpp-documentation/programming-languages.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 [moved from docs/content/programming-guide/script-json-specification.md with 97% similarity]
docs/content/shared-javascript-and-cpp-documentation/script-overview.md
docs/content/shared-javascript-and-cpp-documentation/stage-hand.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/text-field.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 52% similarity]
docs/content/shared-javascript-and-cpp-documentation/texture-atlas.md
packaging/dali-toolkit.spec
plugins/dali-script-v8/docs/content/constants.js
plugins/dali-script-v8/docs/content/text-actor.js [deleted file]
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/constrainer-api.cpp [new file with mode: 0644]
plugins/dali-script-v8/src/animation/constrainer-api.h [moved from dali-toolkit/public-api/controls/scrollable/item-view/item-factory.cpp with 57% similarity]
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-script-v8.h
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
plugins/dali-script-v8/src/toolkit/builder/builder-api.h
plugins/dali-script-v8/src/toolkit/builder/builder-wrapper.h

index e7dc7cb..8011f6a 100644 (file)
@@ -48,9 +48,9 @@ FOREACH(directory ${${CAPI_LIB}_LIBRARY_DIRS})
 ENDFOREACH(directory ${CAPI_LIB_LIBRARY_DIRS})
 
 INCLUDE_DIRECTORIES(
+    ../../../
     ${${CAPI_LIB}_INCLUDE_DIRS}
     ../dali-toolkit/dali-toolkit-test-utils
-    ../../../
 )
 
 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
index 8d2734b..7d1ef18 100644 (file)
@@ -313,6 +313,22 @@ static bool TestCallback(Actor actor, const TouchEvent& event)
 
 //////////////////////////////////////////////////////////
 
+int UtcDaliPushButtonDownCast(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonDownCast");
+
+  TETButton tetButton= Toolkit::TETButton::New();
+
+  BaseHandle object(tetButton);
+
+  TETButton tetButton2 = TETButton::DownCast( object );
+  DALI_TEST_CHECK(tetButton2);
+
+  TETButton tetButton3 = DownCast< TETButton >(object);
+  DALI_TEST_CHECK(tetButton3);
+  END_TEST;
+}
 
 int UtcDaliPushButtonInterruptEventWhenInsensitive(void)
 {
index e522f31..72c0782 100644 (file)
@@ -16,28 +16,26 @@ 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
    utc-Dali-TextField.cpp
    utc-Dali-TextLabel.cpp
+   utc-Dali-TextSelectionPopup.cpp
    utc-Dali-ToolBar.cpp
    utc-Dali-WaterEffect.cpp
    utc-Dali-Button.cpp
@@ -46,7 +44,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
@@ -101,6 +98,7 @@ FOREACH(directory ${${CAPI_LIB}_LIBRARY_DIRS})
 ENDFOREACH(directory ${CAPI_LIB_LIBRARY_DIRS})
 
 INCLUDE_DIRECTORIES(
+    ../../../
     ${${CAPI_LIB}_INCLUDE_DIRS}
     dali-toolkit-test-utils
 )
index 3557c0d..e6f1b50 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "dummy-control.h"
 
-#include <dali-toolkit/public-api/styling/style-manager.h>
+#include <dali-toolkit/devel-api/styling/style-manager.h>
 
 namespace Dali
 {
@@ -64,7 +64,7 @@ DummyControl DummyControlImpl::New()
 }
 
 DummyControlImpl::DummyControlImpl()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_HOVER_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
   mCustomSlot1Called(false)
 {
 }
@@ -86,6 +86,7 @@ DummyControl DummyControlImplOverride::New()
 DummyControlImplOverride::DummyControlImplOverride()
 : DummyControlImpl(),
   initializeCalled(false),
+  activatedCalled(false),
   themeChangeCalled( false ),
   fontChangeCalled( false ),
   pinchCalled(false),
@@ -99,6 +100,7 @@ DummyControlImplOverride::DummyControlImplOverride()
   sizeSetCalled(false),
   sizeAnimationCalled(false),
   touchEventCalled(false),
+  hoverEventCalled(false),
   mouseWheelEventCalled(false),
   keyEventCalled(false),
   keyInputFocusGained(false),
@@ -110,7 +112,12 @@ DummyControlImplOverride::~DummyControlImplOverride() { }
 
 
 void DummyControlImplOverride::OnInitialize() { initializeCalled = true; }
-void DummyControlImplOverride::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange change ) { themeChangeCalled = change.themeChange; fontChangeCalled = change.defaultFontSizeChange; }
+void DummyControlImplOverride::OnActivated() { activatedCalled = true; }
+void DummyControlImplOverride::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
+{
+  themeChangeCalled = change == StyleChange::THEME_CHANGE;
+  fontChangeCalled = change == StyleChange::DEFAULT_FONT_SIZE_CHANGE;
+}
 void DummyControlImplOverride::OnPinch(const PinchGesture& pinch) { pinchCalled = true; }
 void DummyControlImplOverride::OnPan(const PanGesture& pan) { panCalled = true; }
 void DummyControlImplOverride::OnTap(const TapGesture& tap) { tapCalled = true; }
@@ -122,6 +129,7 @@ void DummyControlImplOverride::OnChildRemove(Actor& child) { childRemoveCalled =
 void DummyControlImplOverride::OnSizeSet(const Vector3& targetSize) { sizeSetCalled = true; }
 void DummyControlImplOverride::OnSizeAnimation(Animation& animation, const Vector3& targetSize) { sizeAnimationCalled = true; }
 bool DummyControlImplOverride::OnTouchEvent(const TouchEvent& event) { touchEventCalled = true; return false; }
+bool DummyControlImplOverride::OnHoverEvent(const HoverEvent& event) { hoverEventCalled = true; return false; }
 bool DummyControlImplOverride::OnMouseWheelEvent(const MouseWheelEvent& event) { mouseWheelEventCalled = true; return false; }
 bool DummyControlImplOverride::OnKeyEvent(const KeyEvent& event) { keyEventCalled = true; return false;}
 void DummyControlImplOverride::OnKeyInputFocusGained() { keyInputFocusGained = true; }
index 473a01d..7791006 100644 (file)
@@ -102,7 +102,8 @@ private:
 private: // From Internal::Control
 
   virtual void OnInitialize();
-  virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange change );
+  virtual void OnActivated();
+  virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
   virtual void OnPinch(const PinchGesture& pinch);
   virtual void OnPan(const PanGesture& pan);
   virtual void OnTap(const TapGesture& tap);
@@ -117,6 +118,7 @@ private: // From CustomActorImpl
   virtual void OnSizeSet(const Vector3& targetSize);
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
   virtual bool OnTouchEvent(const TouchEvent& event);
+  virtual bool OnHoverEvent(const HoverEvent& event);
   virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
   virtual bool OnKeyEvent(const KeyEvent& event);
   virtual void OnKeyInputFocusGained();
@@ -125,6 +127,7 @@ private: // From CustomActorImpl
 public:
 
   bool initializeCalled;
+  bool activatedCalled;
   bool themeChangeCalled;
   bool fontChangeCalled;
   bool pinchCalled;
@@ -138,6 +141,7 @@ public:
   bool sizeSetCalled;
   bool sizeAnimationCalled;
   bool touchEventCalled;
+  bool hoverEventCalled;
   bool mouseWheelEventCalled;
   bool keyEventCalled;
   bool keyInputFocusGained;
index 3fed0a2..24e3209 100644 (file)
@@ -42,22 +42,17 @@ int RunTestCase( struct ::testcase_s& testCase )
 {
   int result = EXIT_STATUS_TESTCASE_FAILED;
 
-  try
+// dont want to catch exception as we want to be able to get
+// gdb stack trace from the first error
+// by default tests should all always pass with no exceptions
+  if( testCase.startup )
   {
-    if( testCase.startup )
-    {
-      testCase.startup();
-    }
-    result = testCase.function();
-    if( testCase.cleanup )
-    {
-      testCase.cleanup();
-    }
+    testCase.startup();
   }
-  catch (...)
+  result = testCase.function();
+  if( testCase.cleanup )
   {
-    printf("Caught exception in test case.\n");
-    result = EXIT_STATUS_TESTCASE_ABORTED;
+    testCase.cleanup();
   }
 
   return result;
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 0532266..97c0df1 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/signals/dali-signal.h>
-#include <dali/public-api/adaptor-framework/orientation.h>
+#include <dali/devel-api/adaptor-framework/orientation.h>
 
 namespace Dali
 {
index d62941b..007f70f 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <string>
-#include <dali/public-api/adaptor-framework/orientation.h>
+#include <dali/devel-api/adaptor-framework/orientation.h>
 
 namespace Dali
 {
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 dc2d39f..65750c1 100644 (file)
@@ -48,7 +48,7 @@ public: // Style Information
 public: // Signals
   Dali::StyleMonitor::StyleChangeSignalType& StyleChangeSignal();
 
-  void EmitStyleChangeSignal(StyleChange styleChange)
+  void EmitStyleChangeSignal(StyleChange::Type styleChange)
   {
     mStyleChangeSignal.Emit(Dali::StyleMonitor(this), styleChange);
   }
@@ -96,11 +96,8 @@ const std::string& StyleMonitor::GetTheme() const
 
 void StyleMonitor::SetTheme(std::string path)
 {
-  StyleChange styleChange;
-  styleChange.themeChange = true;
-  styleChange.themeFilePath = path;
   mTheme = path;
-  EmitStyleChangeSignal(styleChange);
+  EmitStyleChangeSignal( StyleChange::THEME_CHANGE );
 }
 
 Dali::StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal()
@@ -170,7 +167,7 @@ StyleMonitor::StyleChangeSignalType& StyleMonitor::StyleChangeSignal()
   return GetImplementation(*this).StyleChangeSignal();
 }
 
-void StyleMonitor::EmitStyleChangeSignal(StyleChange styleChange)
+void StyleMonitor::EmitStyleChangeSignal(StyleChange::Type styleChange)
 {
   GetImplementation(*this).EmitStyleChangeSignal(styleChange);
 }
index fc8b8f2..8aa55e5 100644 (file)
@@ -41,7 +41,7 @@ class StyleMonitor;
 class StyleMonitor : public BaseHandle
 {
 public: // Typedefs
-  typedef Signal< void (StyleMonitor, StyleChange) > StyleChangeSignalType;
+  typedef Signal< void (StyleMonitor, StyleChange::Type) > StyleChangeSignalType;
   static const std::string DEFAULT_FONT_FAMILY;
   static const float       DEFAULT_FONT_SIZE;
 
@@ -60,7 +60,7 @@ public: // Style Information
 
 public: // Signals
   StyleChangeSignalType& StyleChangeSignal();
-  void EmitStyleChangeSignal(StyleChange handle);
+  void EmitStyleChangeSignal(StyleChange::Type handle);
 
 public: // Operators
   StyleMonitor& operator=(const StyleMonitor& monitor);
index 0f62a2a..2d9d8cc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -924,7 +924,7 @@ int UtcDaliAlignmentChildAddAndRemove(void)
   END_TEST;
 }
 
-int UtcDaliAlignmentOnSizeSet(void)
+int UtcDaliAlignmentSizeSetP(void)
 {
   ToolkitTestApplication application;
 
@@ -942,7 +942,7 @@ int UtcDaliAlignmentOnSizeSet(void)
   application.Render();
   application.SendNotification();
 
-  DALI_TEST_EQUALS(size, alignment.GetImplementation().GetControlSize().GetVectorXY(), TEST_LOCATION);
+  DALI_TEST_EQUALS(size, alignment.GetTargetSize().GetVectorXY(), TEST_LOCATION);
 
   Stage::GetCurrent().Remove(alignment);
   END_TEST;
index 426afda..6d58693 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/bendy-effect.h>
 
 
 using namespace Dali;
index d9d5be4..d6756de 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/blind-effect.h>
 
 
 using namespace Dali;
index c6305e8..c35269a 100644 (file)
@@ -19,6 +19,8 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/bloom-view/bloom-view.h>
+
 
 using namespace Dali;
 using namespace Dali::Toolkit;
index b15d1e6..e25d8d5 100644 (file)
@@ -24,6 +24,9 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali/devel-api/actors/mesh-actor.h>
+#include <dali/devel-api/modeling/material.h>
+#include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
index cc03bb1..5fa3d17 100644 (file)
@@ -18,7 +18,7 @@
 #include <iostream>
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
-#include <dali-toolkit/public-api/builder/builder.h>
+#include <dali-toolkit/devel-api/builder/builder.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 
 using namespace Dali;
index 12e85b6..5127cfb 100644 (file)
@@ -42,11 +42,11 @@ void utc_dali_toolkit_button_cleanup(void)
 
 namespace
 {
-static bool gButtonClicked = false;
+static bool gIsCalledButtonCallback = false;
 
-static bool ButtonClicked( Button button )
+static bool ButtonCallback( Button button )
 {
-  gButtonClicked = true;
+  gIsCalledButtonCallback = true;
   return false;
 }
 
@@ -60,159 +60,318 @@ const Dali::TouchPoint pointUpOutside( 0, TouchPoint::Up, 10, 10 );
 static float ANIMATION_TIME( 0.5f );
 } // namespace
 
+int UtcDaliButtonConstructorP(void)
+{
+  TestApplication application;
+
+  Button button;
+
+  DALI_TEST_CHECK( !button );
+  END_TEST;
+}
+
+int UtcDaliButtonCopyConstructorP(void)
+{
+  TestApplication application;
+
+  // Initialize an object, ref count == 1
+  Button button = PushButton::New();
+
+  Button copy( button );
+  DALI_TEST_CHECK( copy );
+  END_TEST;
+}
+
+int UtcDaliButtonAssignmentOperatorP(void)
+{
+  TestApplication application;
+
+  Button button = PushButton::New();
+
+  Button copy( button );
+  DALI_TEST_CHECK( copy );
+
+  DALI_TEST_CHECK( button == copy );
+  END_TEST;
+}
+
+int UtcDaliButtonDownCastP(void)
+{
+  TestApplication application;
+
+  Button button = PushButton::New();
+
+  BaseHandle object(button);
+
+  Button button2 = Button::DownCast( object );
+  DALI_TEST_CHECK(button2);
+
+  Button button3 = DownCast< Button >(object);
+  DALI_TEST_CHECK(button3);
+  END_TEST;
+}
+
+int UtcDaliButtonDownCastN(void)
+{
+  TestApplication application;
+
+  BaseHandle unInitializedObject;
 
+  Button button1 = Button::DownCast( unInitializedObject );
+  DALI_TEST_CHECK( !button1 );
 
-// Positive test case for a method
-int UtcDaliButtonNew(void)
+  Button button2 = DownCast< Button >( unInitializedObject );
+  DALI_TEST_CHECK( !button2 );
+  END_TEST;
+}
+
+int UtcDaliButtonSetDisabledP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonNew");
 
-  PushButton pushButton = PushButton::New();
+  Button button = PushButton::New();
 
-  DALI_TEST_CHECK( pushButton );
+  button.SetDisabled( true );
 
-  PushButton pushButton2( pushButton );
+  DALI_TEST_CHECK( button.IsDisabled() );
 
-  DALI_TEST_CHECK( pushButton2 );
+  button.SetDisabled( false );
 
-  pushButton2.Reset();
+  DALI_TEST_CHECK( !button.IsDisabled() );
 
-  // Test down cast
-  Handle handleButton;
-  handleButton = pushButton;
-  Button downCastPushButton = Button::DownCast( handleButton );
-  DALI_TEST_CHECK( downCastPushButton );
-  PushButton downCastPushButton2 = PushButton::DownCast( handleButton );
-  DALI_TEST_CHECK( downCastPushButton2 );
+  button.SetDisabled( true );
 
+  DALI_TEST_CHECK( button.IsDisabled() );
+
+  button.SetDisabled( false );
+
+  DALI_TEST_CHECK( !button.IsDisabled() );
   END_TEST;
 }
 
-int UtcDaliButtonSetProperty(void)
+int UtcDaliButtonIsDisabledP(void)
 {
-  tet_infoline("UtcDaliButtonSetProperty: ");
   ToolkitTestApplication application;
 
-  PushButton pushButton = PushButton::New();
+  Button button = PushButton::New();
 
-  pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), false);
-  DALI_TEST_CHECK( false == pushButton.IsDisabled() );
-  pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), true);
-  DALI_TEST_CHECK( true == pushButton.IsDisabled() );
+  button.SetDisabled( true );
+
+  DALI_TEST_CHECK( button.IsDisabled() );
+
+  button.SetDisabled( false );
+
+  DALI_TEST_CHECK( !button.IsDisabled() );
   END_TEST;
 }
 
-int UtcDaliButtonSetGetDimmed(void)
+int UtcDaliButtonSetAutoRepeatingP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSetGetDimmed");
 
-  PushButton pushButton = PushButton::New();
+  Button button = PushButton::New();
 
-  pushButton.SetDisabled( true );
+  button.SetAutoRepeating( true );
 
-  DALI_TEST_CHECK( pushButton.IsDisabled() );
+  DALI_TEST_CHECK( button.IsAutoRepeating() );
 
-  pushButton.SetDisabled( false );
+  button.SetAutoRepeating( false );
 
-  DALI_TEST_CHECK( !pushButton.IsDisabled() );
+  DALI_TEST_CHECK( !button.IsAutoRepeating() );
 
-  pushButton.SetDisabled( true );
+  button.SetAutoRepeating( true );
 
-  DALI_TEST_CHECK( pushButton.IsDisabled() );
+  DALI_TEST_CHECK( button.IsAutoRepeating() );
 
-  pushButton.SetDisabled( false );
+  button.SetAutoRepeating( false );
 
-  DALI_TEST_CHECK( !pushButton.IsDisabled() );
+  DALI_TEST_CHECK( !button.IsAutoRepeating() );
   END_TEST;
 }
 
-int UtcDaliButtonSize(void)
+int UtcDaliButtonIsAutoRepeatingP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSize");
 
-  ImageActor image01 = ImageActor::New(CreateBufferImage());
-  image01.SetSize( 100, 50 );
+  Button button = PushButton::New();
 
-  PushButton pushButton;
+  button.SetAutoRepeating( true );
 
-  Vector3 size;
+  DALI_TEST_CHECK( button.IsAutoRepeating() );
 
-  // Test1 Size is set through Actor API
+  button.SetAutoRepeating( false );
 
-  // First an image is set, then SetSize is called.
-  pushButton = PushButton::New();
-  Stage::GetCurrent().Add( pushButton );
+  DALI_TEST_CHECK( !button.IsAutoRepeating() );
+  END_TEST;
+}
 
-  pushButton.SetBackgroundImage( image01 );
-  pushButton.SetSize( 10.f, 10.f );
+int UtcDaliButtonSetInitialAutoRepeatingDelayP(void)
+{
+  ToolkitTestApplication application;
 
-  application.SendNotification();
-  application.Render();
+  Button button = PushButton::New();
 
-  size = pushButton.GetCurrentSize();
+  button.SetInitialAutoRepeatingDelay( 0.5f );
 
-  DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
+  DALI_TEST_EQUALS( button.GetInitialAutoRepeatingDelay(), 0.5f, TEST_LOCATION );
+
+  button.SetInitialAutoRepeatingDelay( 0.2f );
+
+  DALI_TEST_EQUALS( button.GetInitialAutoRepeatingDelay(), 0.2f, TEST_LOCATION );
   END_TEST;
 }
 
-int UtcDaliButtonClicked(void)
+int UtcDaliButtonSetNextAutoRepeatingDelayP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonClicked");
 
-  PushButton pushButton = PushButton::New();
-  pushButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  pushButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  pushButton.SetPosition( 240, 400 );
-  pushButton.SetSize( 100, 100 );
+  Button button = PushButton::New();
 
-  Stage::GetCurrent().Add( pushButton );
+  button.SetNextAutoRepeatingDelay( 0.5f );
+
+  DALI_TEST_EQUALS( button.GetNextAutoRepeatingDelay(), 0.5f, TEST_LOCATION );
+
+  button.SetNextAutoRepeatingDelay( 0.2f );
+
+  DALI_TEST_EQUALS( button.GetNextAutoRepeatingDelay(), 0.2f, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliButtonSetTogglableButtonP(void)
+{
+  ToolkitTestApplication application;
+
+  Button button = PushButton::New();
+
+  button.SetTogglableButton( true );
+
+  DALI_TEST_CHECK( button.IsTogglableButton() );
+
+  button.SetTogglableButton( false );
+
+  DALI_TEST_CHECK( !button.IsTogglableButton() );
+  END_TEST;
+}
+
+int UtcDaliButtonSetSelectedP(void)
+{
+  ToolkitTestApplication application;
+
+  Button button = PushButton::New();
+  button.SetTogglableButton( true );
+
+  button.SetSelected( true );
+
+  DALI_TEST_CHECK( button.IsSelected() );
+
+  button.SetSelected( false );
+
+  DALI_TEST_CHECK( !button.IsSelected() );
+  END_TEST;
+}
+
+int UtcDaliButtonSetAnimationTimeP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliButtonSetAnimationTimeP");
+
+  Button button = PushButton::New();
+
+  button.SetAnimationTime( ANIMATION_TIME );
+
+  DALI_TEST_EQUALS( button.GetAnimationTime(), ANIMATION_TIME, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliButtonSetLabelStringP(void)
+{
+  ToolkitTestApplication application;
+
+  Button button = PushButton::New();
+
+  button.SetLabel( "Button Label" );
+
+  DALI_TEST_CHECK( button.GetLabel() );
+  END_TEST;
+}
+
+int UtcDaliButtonSetLabelActorP(void)
+{
+  ToolkitTestApplication application;
+
+  Button button = PushButton::New();
+
+  TextLabel textLabel = TextLabel::New( "Button Label" );
+  button.SetLabel( textLabel );
+
+  DALI_TEST_CHECK( button.GetLabel() );
+  END_TEST;
+}
+
+int UtcDaliButtonPressedSignalP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliButtonPressedSignalP");
+
+  Button button = PushButton::New();
+  button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  button.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  button.SetPosition( 240, 400 );
+  button.SetSize( 100, 100 );
+
+  Stage::GetCurrent().Add( button );
 
   application.SendNotification();
   application.Render();
 
   // connect to its touch signal
-  pushButton.ClickedSignal().Connect( &ButtonClicked );
+  button.PressedSignal().Connect( &ButtonCallback );
+  button.ReleasedSignal().Connect( &ButtonCallback );
 
   Dali::Integration::TouchEvent event;
 
   // Test1. Touch point down and up inside the button.
 
-  gButtonClicked = false;
+  gIsCalledButtonCallback = false;
   event = Dali::Integration::TouchEvent();
   event.AddPoint( pointDownInside );
   application.ProcessEvent( event );
 
+  DALI_TEST_CHECK( gIsCalledButtonCallback );
+
+  gIsCalledButtonCallback = false;
   event = Dali::Integration::TouchEvent();
   event.AddPoint( pointUpInside );
   application.ProcessEvent( event );
 
-  DALI_TEST_CHECK( gButtonClicked );
+  DALI_TEST_CHECK( gIsCalledButtonCallback );
 
   // Test2. Touch point down and up outside the button.
 
-  gButtonClicked = false;
+  gIsCalledButtonCallback = false;
   event = Dali::Integration::TouchEvent();
   event.AddPoint( pointDownOutside );
   application.ProcessEvent( event );
 
+  DALI_TEST_CHECK( !gIsCalledButtonCallback );
+
+  gIsCalledButtonCallback = false;
   event = Dali::Integration::TouchEvent();
   event.AddPoint( pointUpOutside );
   application.ProcessEvent( event );
 
-  DALI_TEST_CHECK( !gButtonClicked );
+  DALI_TEST_CHECK( !gIsCalledButtonCallback );
 
   // Test3. Touch point down inside and up outside the button.
 
-  gButtonClicked = false;
+  gIsCalledButtonCallback = false;
   event = Dali::Integration::TouchEvent();
   event.AddPoint( pointDownInside );
   application.ProcessEvent( event );
 
+  DALI_TEST_CHECK( gIsCalledButtonCallback );
+
+  gIsCalledButtonCallback = false;
   event = Dali::Integration::TouchEvent();
   event.AddPoint( pointLeave );
   application.ProcessEvent( event );
@@ -221,15 +380,18 @@ int UtcDaliButtonClicked(void)
   event.AddPoint( pointUpOutside );
   application.ProcessEvent( event );
 
-  DALI_TEST_CHECK( !gButtonClicked );
+  DALI_TEST_CHECK( gIsCalledButtonCallback );
 
   // Test4. Touch point down outside and up inside the button.
 
-  gButtonClicked = false;
+  gIsCalledButtonCallback = false;
   event = Dali::Integration::TouchEvent();
   event.AddPoint( pointDownOutside );
   application.ProcessEvent( event );
 
+  DALI_TEST_CHECK( !gIsCalledButtonCallback );
+
+  gIsCalledButtonCallback = false;
   event = Dali::Integration::TouchEvent();
   event.AddPoint( pointEnter );
   application.ProcessEvent( event );
@@ -238,48 +400,34 @@ int UtcDaliButtonClicked(void)
   event.AddPoint( pointUpInside );
   application.ProcessEvent( event );
 
-  DALI_TEST_CHECK( !gButtonClicked );
+  DALI_TEST_CHECK( !gIsCalledButtonCallback );
   END_TEST;
 }
 
-namespace
-{
-
-static bool gClickedCallBackCalled;
-
-static bool TestClickedCallback(Button button)
-{
-  gClickedCallBackCalled = true;
-  return true;
-}
-
-} // namespace
-
-int UtcDaliButtonConnectSignal(void)
+int UtcDaliButtonClickedSignalP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline("UtcDaliButtonConnectSignal()");
-
-  gClickedCallBackCalled = false;
+  tet_infoline(" UtcDaliButtonClickedSignalP");
 
-  PushButton pushButton = PushButton::New();
-  pushButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
-  pushButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
-  pushButton.SetPosition( 240, 400 );
-  pushButton.SetSize( 100, 100 );
+  Button button = PushButton::New();
+  button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+  button.SetParentOrigin( ParentOrigin::TOP_LEFT );
+  button.SetPosition( 240, 400 );
+  button.SetSize( 100, 100 );
 
-  Stage::GetCurrent().Add( pushButton );
+  Stage::GetCurrent().Add( button );
 
   application.SendNotification();
   application.Render();
 
-  // connect to its clicked signal
-  pushButton.ClickedSignal().Connect(TestClickedCallback);
+  // connect to its touch signal
+  button.ClickedSignal().Connect( &ButtonCallback );
 
   Dali::Integration::TouchEvent event;
 
-  // Touch point down and up inside the button.
+  // Test1. Touch point down and up inside the button.
 
+  gIsCalledButtonCallback = false;
   event = Dali::Integration::TouchEvent();
   event.AddPoint( pointDownInside );
   application.ProcessEvent( event );
@@ -288,28 +436,126 @@ int UtcDaliButtonConnectSignal(void)
   event.AddPoint( pointUpInside );
   application.ProcessEvent( event );
 
-  DALI_TEST_CHECK( gClickedCallBackCalled == true );
+  DALI_TEST_CHECK( gIsCalledButtonCallback );
+
+  // Test2. Touch point down and up outside the button.
+
+  gIsCalledButtonCallback = false;
+  event = Dali::Integration::TouchEvent();
+  event.AddPoint( pointDownOutside );
+  application.ProcessEvent( event );
+
+  event = Dali::Integration::TouchEvent();
+  event.AddPoint( pointUpOutside );
+  application.ProcessEvent( event );
+
+  DALI_TEST_CHECK( !gIsCalledButtonCallback );
 
-  gClickedCallBackCalled = false;
-  pushButton.ClickedSignal().Disconnect(TestClickedCallback);
+  // Test3. Touch point down inside and up outside the button.
 
-  // simulate another touch event
+  gIsCalledButtonCallback = false;
+  event = Dali::Integration::TouchEvent();
+  event.AddPoint( pointDownInside );
   application.ProcessEvent( event );
 
-  DALI_TEST_CHECK( gClickedCallBackCalled == false );
+  event = Dali::Integration::TouchEvent();
+  event.AddPoint( pointLeave );
+  application.ProcessEvent( event );
+
+  event = Dali::Integration::TouchEvent();
+  event.AddPoint( pointUpOutside );
+  application.ProcessEvent( event );
+
+  DALI_TEST_CHECK( !gIsCalledButtonCallback );
+
+  // Test4. Touch point down outside and up inside the button.
+
+  gIsCalledButtonCallback = false;
+  event = Dali::Integration::TouchEvent();
+  event.AddPoint( pointDownOutside );
+  application.ProcessEvent( event );
+
+  event = Dali::Integration::TouchEvent();
+  event.AddPoint( pointEnter );
+  application.ProcessEvent( event );
+
+  event = Dali::Integration::TouchEvent();
+  event.AddPoint( pointUpInside );
+  application.ProcessEvent( event );
+
+  DALI_TEST_CHECK( !gIsCalledButtonCallback );
   END_TEST;
 }
 
-int UtcDaliButtonSetGetAnimationTime(void)
+int UtcDaliButtonStateChangedSignalP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliButtonSetGetAnimationTime");
+  tet_infoline(" UtcDaliButtonStateChangedSignalP");
+
+  Button button = PushButton::New();
+  button.SetTogglableButton( true );
+
+  Stage::GetCurrent().Add( button );
+
+  application.SendNotification();
+  application.Render();
+
+  // connect to its signal
+  button.StateChangedSignal().Connect( &ButtonCallback );
+
+  gIsCalledButtonCallback = false;
+  button.SetSelected( true );
+
+  DALI_TEST_CHECK( gIsCalledButtonCallback );
+
+  gIsCalledButtonCallback = false;
+  button.SetSelected( false );
+
+  DALI_TEST_CHECK( gIsCalledButtonCallback );
+  END_TEST;
+}
+
+int UtcDaliButtonSetProperty(void)
+{
+  tet_infoline("UtcDaliButtonSetProperty: ");
+  ToolkitTestApplication application;
 
   PushButton pushButton = PushButton::New();
 
-  pushButton.SetAnimationTime( ANIMATION_TIME );
+  pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), false);
+  DALI_TEST_CHECK( false == pushButton.IsDisabled() );
+  pushButton.SetProperty(pushButton.GetPropertyIndex("disabled"), true);
+  DALI_TEST_CHECK( true == pushButton.IsDisabled() );
+  END_TEST;
+}
+
+int UtcDaliButtonSize(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliButtonSize");
+
+  ImageActor image01 = ImageActor::New(CreateBufferImage());
+  image01.SetSize( 100, 50 );
+
+  PushButton pushButton;
+
+  Vector3 size;
+
+  // Test1 Size is set through Actor API
+
+  // First an image is set, then SetSize is called.
+  pushButton = PushButton::New();
+  Stage::GetCurrent().Add( pushButton );
+
+  pushButton.SetBackgroundImage( image01 );
+  pushButton.SetSize( 10.f, 10.f );
 
-  DALI_TEST_EQUALS( pushButton.GetAnimationTime(), ANIMATION_TIME, TEST_LOCATION );
+  application.SendNotification();
+  application.Render();
 
+  size = pushButton.GetCurrentSize();
+
+  DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION );
+  DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
   END_TEST;
 }
index 8d6367a..cc11a4f 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/carousel-effect.h>
 
 using namespace Dali;
 
index d6dc8d4..f5a2a7c 100644 (file)
@@ -33,8 +33,6 @@ bool CheckBoxButtonClicked( Button button )
   return true;
 }
 
-
-
 Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height )
 {
   BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 );
@@ -58,7 +56,6 @@ Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned
 
 } // namespace
 
-
 void checkbox_button_startup(void)
 {
   test_return_value = TET_UNDEF;
@@ -69,6 +66,169 @@ void checkbox_button_cleanup(void)
   test_return_value = TET_PASS;
 }
 
+int UtcDaliCheckBoxButtonConstructorP(void)
+{
+  TestApplication application;
+
+  CheckBoxButton checkBox;
+
+  DALI_TEST_CHECK( !checkBox );
+  END_TEST;
+}
+
+int UtcDaliCheckBoxButtonCopyConstructorP(void)
+{
+  TestApplication application;
+
+  // Initialize an object, ref count == 1
+  CheckBoxButton checkBox = CheckBoxButton::New();
+
+  CheckBoxButton copy( checkBox );
+  DALI_TEST_CHECK( copy );
+  END_TEST;
+}
+
+int UtcDaliCheckBoxButtonAssignmentOperatorP(void)
+{
+  TestApplication application;
+
+  CheckBoxButton checkBox = CheckBoxButton::New();
+
+  CheckBoxButton copy( checkBox );
+  DALI_TEST_CHECK( copy );
+
+  DALI_TEST_CHECK( checkBox == copy );
+  END_TEST;
+}
+
+int UtcDaliCheckBoxButtonNewP(void)
+{
+  TestApplication application;
+
+  CheckBoxButton checkBox = CheckBoxButton::New();
+
+  DALI_TEST_CHECK( checkBox );
+  END_TEST;
+}
+
+int UtcDaliCheckBoxButtonDownCastP(void)
+{
+  TestApplication application;
+
+  CheckBoxButton checkBox = CheckBoxButton::New();
+
+  BaseHandle object(checkBox);
+
+  CheckBoxButton checkBox2 = CheckBoxButton::DownCast( object );
+  DALI_TEST_CHECK(checkBox2);
+
+  CheckBoxButton checkBox3 = DownCast< CheckBoxButton >(object);
+  DALI_TEST_CHECK(checkBox3);
+  END_TEST;
+}
+
+int UtcDaliCheckBoxButtonDownCastN(void)
+{
+  TestApplication application;
+
+  BaseHandle unInitializedObject;
+
+  CheckBoxButton checkBox1 = CheckBoxButton::DownCast( unInitializedObject );
+  DALI_TEST_CHECK( !checkBox1 );
+
+  CheckBoxButton checkBox2 = DownCast< CheckBoxButton >( unInitializedObject );
+  DALI_TEST_CHECK( !checkBox2 );
+  END_TEST;
+}
+
+int UtcDaliCheckBoxButtonSetBackgroundImageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliCheckBoxButtonSetBackgroundImageP");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+  ImageActor imageActor = CreateSolidColorActor( Color::RED );
+  imageActor.SetSize( 20, 20 );
+
+  CheckBoxButton checkBoxButton = CheckBoxButton::New();
+
+  checkBoxButton.SetBackgroundImage( image );
+
+  DALI_TEST_CHECK( checkBoxButton.GetBackgroundImage() );
+
+  checkBoxButton.SetBackgroundImage( imageActor );
+
+  DALI_TEST_CHECK( checkBoxButton.GetBackgroundImage() );
+
+  END_TEST;
+}
+
+int UtcDaliCheckBoxButtonSetSelectedImageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliCheckBoxButtonSetSelectedImageP");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+  ImageActor imageActor = CreateSolidColorActor( Color::RED );
+  imageActor.SetSize( 20, 20 );
+
+  CheckBoxButton checkBoxButton = CheckBoxButton::New();
+
+  checkBoxButton.SetSelectedImage( image );
+
+  DALI_TEST_CHECK( checkBoxButton.GetSelectedImage() );
+
+  checkBoxButton.SetSelectedImage( imageActor );
+
+  DALI_TEST_CHECK( checkBoxButton.GetSelectedImage() );
+
+  END_TEST;
+}
+
+int UtcDaliCheckBoxButtonSetDisabledBackgroundImageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliCheckBoxButtonSetDisabledBackgroundImageP");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+  ImageActor imageActor = CreateSolidColorActor( Color::RED );
+  imageActor.SetSize( 20, 20 );
+
+  CheckBoxButton checkBoxButton = CheckBoxButton::New();
+
+  checkBoxButton.SetDisabledBackgroundImage( image );
+
+  DALI_TEST_CHECK( checkBoxButton.GetDisabledBackgroundImage() );
+
+  checkBoxButton.SetDisabledBackgroundImage( imageActor );
+
+  DALI_TEST_CHECK( checkBoxButton.GetDisabledBackgroundImage() );
+
+  END_TEST;
+}
+
+int UtcDaliCheckBoxButtonSetDisabledSelectedImageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliCheckBoxButtonSetDisabledSelectedImageP");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+  ImageActor imageActor = CreateSolidColorActor( Color::RED );
+  imageActor.SetSize( 20, 20 );
+
+  CheckBoxButton checkBoxButton = CheckBoxButton::New();
+
+  checkBoxButton.SetDisabledSelectedImage( image );
+
+  DALI_TEST_CHECK( checkBoxButton.GetDisabledSelectedImage() );
+
+  checkBoxButton.SetDisabledSelectedImage( imageActor );
+
+  DALI_TEST_CHECK( checkBoxButton.GetDisabledSelectedImage() );
+
+  END_TEST;
+}
+
 int UtcDaliCheckBoxButtonSetGetSelected(void)
 {
   ToolkitTestApplication application;
index 17e8456..3223daa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -204,17 +204,16 @@ int UtcDaliControlKeyInputFocus(void)
   END_TEST;
 }
 
-int UtcDaliControlGetImplementation(void)
+int UtcDaliControlGetImplementationN(void)
 {
   ToolkitTestApplication application;
-
   DummyControl control;
 
   // Get Empty
   {
     try
     {
-      Toolkit::Internal::Control& controlImpl = control.GetImplementation();
+      Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( control );
       (void)controlImpl; // Avoid unused warning
       tet_result(TET_FAIL);
     }
@@ -223,13 +222,20 @@ int UtcDaliControlGetImplementation(void)
       tet_result(TET_PASS);
     }
   }
+  END_TEST;
+}
+
+int UtcDaliControlGetImplementationConstN(void)
+{
+  ToolkitTestApplication application;
+  DummyControl control;
 
   // Get Const Empty
   {
     try
     {
       const DummyControl constControl(control);
-      const Toolkit::Internal::Control& controlImpl = constControl.GetImplementation();
+      const Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( constControl );
       (void)controlImpl; // Avoid unused warning
       tet_result(TET_FAIL);
     }
@@ -238,14 +244,19 @@ int UtcDaliControlGetImplementation(void)
       tet_result(TET_PASS);
     }
   }
+  END_TEST;
+}
 
-  control = DummyControl::New();
+int UtcDaliControlGetImplementationP(void)
+{
+  ToolkitTestApplication application;
+  DummyControl control = DummyControl::New();
 
   // Get
   {
     try
     {
-      Toolkit::Internal::Control& controlImpl = control.GetImplementation();
+      Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( control );
       (void)controlImpl; // Avoid unused warning
       tet_result(TET_PASS);
     }
@@ -254,13 +265,19 @@ int UtcDaliControlGetImplementation(void)
       tet_result(TET_FAIL);
     }
   }
+  END_TEST;
+}
 
+int UtcDaliControlGetImplementationConstP(void)
+{
+  ToolkitTestApplication application;
+  DummyControl control = DummyControl::New();
   // Get Const
   {
     try
     {
       const DummyControl constControl(control);
-      const Toolkit::Internal::Control& controlImpl = constControl.GetImplementation();
+      const Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( constControl );
       (void)controlImpl; // Avoid unused warning
       tet_result(TET_PASS);
     }
@@ -281,7 +298,7 @@ int UtcDaliControlSignalConnectDisconnect(void)
 
     Actor actor = Actor::New();
     DALI_TEST_EQUALS( actor.OnStageSignal().GetConnectionCount(), 0u, TEST_LOCATION );
-    Toolkit::Internal::Control& control = dummy.GetImplementation();
+    Toolkit::Internal::Control& control = Toolkit::Internal::GetImplementation( dummy );
     DummyControlImpl* dummyImpl = dynamic_cast<DummyControlImpl*>(&control);
     DALI_TEST_CHECK( dummyImpl );
 
@@ -310,7 +327,7 @@ int UtcDaliControlSignalAutomaticDisconnect(void)
 
   {
     DummyControl dummy = DummyControlImpl::New();
-    Toolkit::Internal::Control& control = dummy.GetImplementation();
+    Toolkit::Internal::Control& control = Toolkit::Internal::GetImplementation( dummy );
     DummyControlImpl* dummyImpl = dynamic_cast<DummyControlImpl*>(&control);
     DALI_TEST_CHECK( dummyImpl );
 
@@ -345,7 +362,8 @@ int UtcDaliControlTestParameters(void)
 
   float width = 640.0f;
   float height = test.GetHeightForWidth( width );
-  DALI_TEST_CHECK( test.GetWidthForHeight( height ) == width );
+  DALI_TEST_EQUALS( 640.0f, height, TEST_LOCATION );
+  DALI_TEST_EQUALS( 640.0f, test.GetWidthForHeight( height ), TEST_LOCATION );
 
   test.KeyEventSignal();
 
@@ -361,11 +379,9 @@ int UtcDaliControlBackgroundColor(void)
   ToolkitTestApplication application;
   Control control = Control::New();
 
-  DALI_TEST_CHECK( !control.GetBackgroundActor() );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
 
   control.SetBackgroundColor( Color::RED );
-  DALI_TEST_CHECK( control.GetBackgroundActor() );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::RED, TEST_LOCATION );
 
   END_TEST;
@@ -376,24 +392,20 @@ int UtcDaliControlBackgroundImage(void)
   ToolkitTestApplication application;
   Control control = Control::New();
 
-  DALI_TEST_CHECK( !control.GetBackgroundActor() );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
 
   Image image = ResourceImage::New("TestImage");
   control.SetBackgroundImage( image );
-  DALI_TEST_CHECK( control.GetBackgroundActor() );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::WHITE, TEST_LOCATION );
 
   control.SetBackgroundColor( Color::GREEN );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::GREEN, TEST_LOCATION );
 
   control.ClearBackground();
-  DALI_TEST_CHECK( !control.GetBackgroundActor() );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
 
   control.SetBackgroundColor( Color::YELLOW );
   control.SetBackgroundImage( image );
-  DALI_TEST_CHECK( control.GetBackgroundActor() );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::YELLOW, TEST_LOCATION );
 
   END_TEST;
@@ -404,13 +416,13 @@ int UtcDaliControlBackgroundProperties(void)
   ToolkitTestApplication application;
   Control control = Control::New();
 
-  DALI_TEST_CHECK( !control.GetBackgroundActor() );
+  DALI_TEST_CHECK( control.GetChildCount() == 0 );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
   DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
   DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND_IMAGE ).Get< Property::Map >().Empty() );
 
   control.SetProperty( Control::Property::BACKGROUND_COLOR, Color::RED );
-  DALI_TEST_CHECK( control.GetBackgroundActor() );
+  DALI_TEST_CHECK( control.GetChildCount() > 0 );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::RED, TEST_LOCATION );
   DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::RED, TEST_LOCATION );
 
@@ -419,7 +431,7 @@ int UtcDaliControlBackgroundProperties(void)
   Property::Map map;
   map[ "image" ] = imageMap;
   control.SetProperty( Control::Property::BACKGROUND_IMAGE, map );
-  DALI_TEST_CHECK( control.GetBackgroundActor() );
+  DALI_TEST_CHECK( control.GetChildCount() > 0 );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::RED, TEST_LOCATION );
   DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::RED, TEST_LOCATION );
 
@@ -430,7 +442,7 @@ int UtcDaliControlBackgroundProperties(void)
 
   Property::Map emptyMap;
   control.SetProperty( Control::Property::BACKGROUND_IMAGE, emptyMap );
-  DALI_TEST_CHECK( !control.GetBackgroundActor() );
+  DALI_TEST_CHECK( control.GetChildCount() == 0 );
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
   DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
   DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND_IMAGE ).Get< Property::Map >().Empty() );
@@ -530,3 +542,15 @@ int UtcDaliControlImplKeyInputFocusLostSignal(void)
 
   END_TEST;
 }
+
+int UtcDaliControlImplGetControlExtensionP(void)
+{
+  ToolkitTestApplication application;
+  Control control = Control::New();
+
+  Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( control );
+
+  DALI_TEST_CHECK( NULL == controlImpl.GetControlExtension() );
+
+  END_TEST;
+}
index 8f363af..92b7ff4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,6 +32,9 @@
 #include <dali/integration-api/events/pan-gesture-event.h>
 #include <dali/integration-api/events/tap-gesture-event.h>
 #include <dali/integration-api/events/touch-event-integ.h>
+#include <dali/integration-api/events/hover-event-integ.h>
+
+#include <dali-toolkit/devel-api/styling/style-manager.h>
 
 #include "dummy-control.h"
 
@@ -437,7 +440,7 @@ int UtcDaliControlImplStageConnection(void)
   END_TEST;
 }
 
-int UtcDaliControlImplSizeSet(void)
+int UtcDaliControlImplSizeSetP(void)
 {
   ToolkitTestApplication application;
 
@@ -449,22 +452,28 @@ int UtcDaliControlImplSizeSet(void)
     application.Render();
     application.SendNotification();
 
-    DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, true, TEST_LOCATION ); // Called from size negotiation
+    DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION ); // Size not set, no onSizeSet called
     Vector2 size(100.0f, 200.0f);
-    dummy.SetSize(size);
+    dummy.SetSize( size );
+
+    DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, false, TEST_LOCATION ); // Size is going to get negotiated, no onSizeSet called
 
-    application.Render();
     application.SendNotification();
     application.Render();
-    application.SendNotification();
 
-    DALI_TEST_EQUALS(size, dummy.GetCurrentSize().GetVectorXY(), TEST_LOCATION);
+    DALI_TEST_EQUALS( size, dummy.GetCurrentSize().GetVectorXY(), TEST_LOCATION );
     DALI_TEST_EQUALS( dummyImpl.sizeSetCalled, true, TEST_LOCATION );
 
     Stage::GetCurrent().Remove(dummy);
   }
 
-  // Ensure full code coverage
+  END_TEST;
+}
+
+int UtcDaliControlImplSizeSet2P(void)
+{
+  ToolkitTestApplication application;
+
   {
     DummyControl dummy = DummyControl::New();
     Stage::GetCurrent().Add(dummy);
@@ -472,15 +481,13 @@ int UtcDaliControlImplSizeSet(void)
     Vector2 size(100.0f, 200.0f);
     DALI_TEST_CHECK( size != dummy.GetCurrentSize().GetVectorXY() );
 
-    application.Render();
     application.SendNotification();
+    application.Render();
 
     dummy.SetSize(size);
 
-    application.Render();
     application.SendNotification();
     application.Render();
-    application.SendNotification();
 
     DALI_TEST_EQUALS(size, dummy.GetCurrentSize().GetVectorXY(), TEST_LOCATION);
 
@@ -489,6 +496,7 @@ int UtcDaliControlImplSizeSet(void)
   END_TEST;
 }
 
+
 int UtcDaliControlImplSizeAnimation(void)
 {
   ToolkitTestApplication application;
@@ -586,6 +594,56 @@ int UtcDaliControlImplTouchEvent(void)
   END_TEST;
 }
 
+int UtcDaliControlImplHoverEvent(void)
+{
+  ToolkitTestApplication application;
+
+  {
+    DummyControl dummy = DummyControl::New( true );
+    DummyControlImplOverride& dummyImpl = static_cast<DummyControlImplOverride&>(dummy.GetImplementation());
+
+    dummy.SetSize( Vector2( 100.0f, 100.0f ) );
+    dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+    Stage::GetCurrent().Add(dummy);
+
+    application.Render();
+    application.SendNotification();
+    application.Render();
+    application.SendNotification();
+
+    DALI_TEST_EQUALS( dummyImpl.hoverEventCalled, false, TEST_LOCATION );
+    Integration::HoverEvent event(1);
+    TouchPoint point( 1, TouchPoint::Motion, 20.0f, 20.0f );
+    event.AddPoint( point );
+    application.ProcessEvent( event );
+    DALI_TEST_EQUALS( dummyImpl.hoverEventCalled, true, TEST_LOCATION );
+
+    Stage::GetCurrent().Remove(dummy);
+  }
+
+  // Ensure full code coverage
+  {
+    DummyControl dummy = DummyControl::New();
+
+    dummy.SetSize( Vector2( 100.0f, 100.0f ) );
+    dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+    Stage::GetCurrent().Add(dummy);
+
+    application.Render();
+    application.SendNotification();
+    application.Render();
+    application.SendNotification();
+
+    Integration::HoverEvent event(1);
+    TouchPoint point( 1, TouchPoint::Motion, 20.0f, 20.0f );
+    event.AddPoint( point );
+    application.ProcessEvent( event );
+
+    Stage::GetCurrent().Remove(dummy);
+  }
+  END_TEST;
+}
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 
@@ -782,3 +840,107 @@ int UtcDaliControlImplMouseWheelEvent(void)
   }
   END_TEST;
 }
+
+int UtcDaliControlImplSetStyleName(void)
+{
+  ToolkitTestApplication application;
+
+  {
+    DummyControl dummy = DummyControl::New( true );
+
+    dummy.SetSize( Vector2( 100.0f, 100.0f ) );
+    dummy.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+    Stage::GetCurrent().Add(dummy);
+
+    dummy.SetStyleName("TestStyle");
+
+    DALI_TEST_CHECK( dummy.GetStyleName() == "TestStyle" );
+
+    Stage::GetCurrent().Remove(dummy);
+  }
+  END_TEST;
+}
+
+int UtcDaliControlImplOnStyleChangeN(void)
+{
+  ToolkitTestApplication application;
+  Control dummy = Control::New();
+  Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
+
+  // test that style manager is being used, passing an empty handle throws exception
+  try
+  {
+    Dali::Toolkit::StyleManager styleManager;
+    controlImpl.OnStyleChange( styleManager, StyleChange::THEME_CHANGE );
+    tet_result(TET_FAIL);
+  }
+  catch (DaliException &exception)
+  {
+    tet_result(TET_PASS);
+  }
+
+  END_TEST;
+}
+
+
+int UtcDaliControlImplOnAccessibilityPanP(void)
+{
+  ToolkitTestApplication application;
+  Control dummy = Control::New();
+  Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
+
+  PanGesture pan;
+  DALI_TEST_EQUALS( false, controlImpl.OnAccessibilityPan( pan ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliControlImplOnAccessibilityTouchP(void)
+{
+  ToolkitTestApplication application;
+  Control dummy = Control::New();
+  Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
+  TouchEvent touch;
+  DALI_TEST_EQUALS( false, controlImpl.OnAccessibilityTouch( touch ), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliControlImplOnAccessibilityActivatedP(void)
+{
+  ToolkitTestApplication application;
+
+  Control dummy = Control::New();
+  Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
+  DALI_TEST_EQUALS( false, controlImpl.OnAccessibilityActivated(), TEST_LOCATION );
+
+  // Invoke the control's activate action
+  TypeInfo type = TypeRegistry::Get().GetTypeInfo( "Control" );
+  DALI_TEST_CHECK( type );
+
+  BaseHandle handle = type.CreateInstance();
+  DALI_TEST_CHECK( handle );
+
+  std::vector<Property::Value> attributes;
+  DALI_TEST_EQUALS( false, handle.DoAction("control-activated", attributes), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliControlImplGetNextKeyboardFocusableActorP(void)
+{
+  ToolkitTestApplication application;
+  Control dummy = Control::New();
+  Toolkit::Internal::Control& controlImpl = Toolkit::Internal::GetImplementation( dummy );
+
+  Actor currentFocusedActor;
+  Actor result = controlImpl.GetNextKeyboardFocusableActor( currentFocusedActor, Control::Left, false );
+
+  DALI_TEST_EQUALS( result, currentFocusedActor, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+
+
index 055b122..6e99611 100644 (file)
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h>
+
+
 
 using namespace Dali;
 using namespace Dali::Toolkit;
index 7b1421d..b65fc34 100644 (file)
@@ -53,183 +53,3 @@ int UtcDaliDefaultControlsCreateSolidColorActor(void)
   DALI_TEST_CHECK(!image3);
   END_TEST;
 }
-
-int UtcDaliDefaultControlsCreatePushButton(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline(" UtcDaliDefaultControlsCreatePushButton");
-
-  const std::string imagePath( "Facke image path" );
-  const std::string voidImagePath( "" );
-
-  ImageActor image = CreateSolidColorActor( Color::RED );
-  ImageActor voidImage;
-
-  PushButton button0, button1, button2, button3, button4, button5, button6;
-
-  try
-  {
-    button0 = CreatePushButton( voidImagePath, voidImagePath, voidImagePath, voidImagePath, voidImagePath );
-    button1 = CreatePushButton( imagePath, voidImagePath, voidImagePath, voidImagePath, voidImagePath );
-    button2 = CreatePushButton( voidImagePath, imagePath, voidImagePath, voidImagePath, voidImagePath );
-    button3 = CreatePushButton( voidImagePath, voidImagePath, imagePath, voidImagePath, voidImagePath );
-    button4 = CreatePushButton( voidImagePath, voidImagePath, voidImagePath, imagePath, voidImagePath );
-    button5 = CreatePushButton( voidImagePath, voidImagePath, voidImagePath, voidImagePath, imagePath );
-    button6 = CreatePushButton( imagePath, imagePath, imagePath, imagePath, imagePath );
-  }
-  catch( ... )
-  {
-    tet_result( TET_FAIL );
-  }
-
-  DALI_TEST_CHECK( button0 );
-  DALI_TEST_CHECK( button1 );
-  DALI_TEST_CHECK( button2 );
-  DALI_TEST_CHECK( button3 );
-  DALI_TEST_CHECK( button4 );
-  DALI_TEST_CHECK( button5 );
-  DALI_TEST_CHECK( button6 );
-
-  try
-  {
-    button0 = CreatePushButton( voidImage, voidImage, voidImage, voidImage, voidImage );
-    button1 = CreatePushButton( image, voidImage, voidImage, voidImage, voidImage );
-    button2 = CreatePushButton( voidImage, image, voidImage, voidImage, voidImage );
-    button3 = CreatePushButton( voidImage, voidImage, image, voidImage, voidImage );
-    button4 = CreatePushButton( voidImage, voidImage, voidImage, image, voidImage );
-    button5 = CreatePushButton( voidImage, voidImage, voidImage, voidImage, image );
-    button6 = CreatePushButton( image, image, image, image, image );
-  }
-  catch( ... )
-  {
-    tet_result( TET_FAIL );
-  }
-
-  DALI_TEST_CHECK( button0 );
-  DALI_TEST_CHECK( button1 );
-  DALI_TEST_CHECK( button2 );
-  DALI_TEST_CHECK( button3 );
-  DALI_TEST_CHECK( button4 );
-  DALI_TEST_CHECK( button5 );
-  DALI_TEST_CHECK( button6 );
-
-  try
-  {
-    button0 = CreatePushButton( voidImagePath );
-    button1 = CreatePushButton( imagePath );
-  }
-  catch( ... )
-  {
-    tet_result( TET_FAIL );
-  }
-
-  DALI_TEST_CHECK( button0 );
-  DALI_TEST_CHECK( button1 );
-
-  try
-  {
-    button0 = CreatePushButton( voidImage );
-    button1 = CreatePushButton( image );
-  }
-  catch( ... )
-  {
-    tet_result( TET_FAIL );
-  }
-
-  DALI_TEST_CHECK( button0 );
-  DALI_TEST_CHECK( button1 );
-  END_TEST;
-}
-
-int UtcDaliDefaultControlsCreateCheckBoxButton(void)
-{
-  ToolkitTestApplication application;
-
-  tet_infoline(" UtcDaliDefaultControlsCreateCheckBoxButton");
-
-  const std::string imagePath( "Facke image path" );
-  const std::string voidImagePath( "" );
-
-  ImageActor image = CreateSolidColorActor( Color::RED );
-  ImageActor voidImage;
-
-  CheckBoxButton button0, button1, button2, button3, button4, button5;
-
-  try
-  {
-    button0 = CreateCheckBoxButton( voidImagePath, voidImagePath, voidImagePath, voidImagePath );
-    button1 = CreateCheckBoxButton( imagePath, voidImagePath, voidImagePath, voidImagePath );
-    button2 = CreateCheckBoxButton( voidImagePath, imagePath, voidImagePath, voidImagePath );
-    button3 = CreateCheckBoxButton( voidImagePath, voidImagePath, imagePath, voidImagePath );
-    button4 = CreateCheckBoxButton( voidImagePath, voidImagePath, voidImagePath, imagePath );
-    button5 = CreateCheckBoxButton( imagePath, imagePath, imagePath, imagePath );
-  }
-  catch( ... )
-  {
-    tet_result( TET_FAIL );
-  }
-
-  DALI_TEST_CHECK( button0 );
-  DALI_TEST_CHECK( button1 );
-  DALI_TEST_CHECK( button2 );
-  DALI_TEST_CHECK( button3 );
-  DALI_TEST_CHECK( button4 );
-  DALI_TEST_CHECK( button5 );
-
-  try
-  {
-    button0 = CreateCheckBoxButton( voidImage, voidImage, voidImage, voidImage );
-    button1 = CreateCheckBoxButton( image, voidImage, voidImage, voidImage );
-    button2 = CreateCheckBoxButton( voidImage, image, voidImage, voidImage );
-    button3 = CreateCheckBoxButton( voidImage, voidImage, image, voidImage );
-    button4 = CreateCheckBoxButton( voidImage, voidImage, voidImage, image );
-    button5 = CreateCheckBoxButton( image, image, image, image );
-  }
-  catch( ... )
-  {
-    tet_result( TET_FAIL );
-  }
-
-  DALI_TEST_CHECK( button0 );
-  DALI_TEST_CHECK( button1 );
-  DALI_TEST_CHECK( button2 );
-  DALI_TEST_CHECK( button3 );
-  DALI_TEST_CHECK( button4 );
-  DALI_TEST_CHECK( button5 );
-
-  try
-  {
-    button0 = CreateCheckBoxButton( voidImagePath, voidImagePath );
-    button1 = CreateCheckBoxButton( voidImagePath, imagePath );
-    button2 = CreateCheckBoxButton( imagePath, voidImagePath );
-    button3 = CreateCheckBoxButton( imagePath, imagePath );
-  }
-  catch( ... )
-  {
-    tet_result( TET_FAIL );
-  }
-
-  DALI_TEST_CHECK( button0 );
-  DALI_TEST_CHECK( button1 );
-  DALI_TEST_CHECK( button2 );
-  DALI_TEST_CHECK( button3 );
-
-  try
-  {
-    button0 = CreateCheckBoxButton( voidImage, voidImage );
-    button2 = CreateCheckBoxButton( voidImage, image );
-    button3 = CreateCheckBoxButton( voidImage, image );
-    button4 = CreateCheckBoxButton( image, image );
-  }
-  catch( ... )
-  {
-    tet_result( TET_FAIL );
-  }
-
-  DALI_TEST_CHECK( button0 );
-  DALI_TEST_CHECK( button1 );
-  DALI_TEST_CHECK( button2 );
-  DALI_TEST_CHECK( button3 );
-  END_TEST;
-}
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;
-}
index 522a6fe..773cb14 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/displacement-effect.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
index 66a3664..eebbbf2 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/dissolve-effect.h>
 
 
 using namespace Dali;
index 570793c..b56034a 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/distance-field-effect.h>
 
 using namespace Dali;
 
index ae74364..b26edb0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -114,6 +114,20 @@ public:
   Toolkit::FocusManager::FocusOvershotDirection mFocusOvershotDirection;
 };
 
+// Functor to test whether focused actor activated signal is emitted.
+class FocusedActorActivatedCallback : public Dali::ConnectionTracker
+{
+public:
+  FocusedActorActivatedCallback()
+  {
+  }
+
+  void Callback(Actor activatedActor)
+  {
+    tet_infoline("Verifying FocusedActorActivatedCallback()");
+  }
+};
+
 } // namespace
 
 
@@ -1051,3 +1065,19 @@ int UtcDaliFocusManagerSignalFocusOvershot(void)
   DALI_TEST_CHECK(signalVerified);
   END_TEST;
 }
+
+int UtcDaliFocusManagerSignalFocusedActorActivated(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline(" UtcDaliFocusManagerSignalFocusedActorActivated");
+
+  FocusManager manager = FocusManager::Get();
+  DALI_TEST_CHECK(manager);
+
+  FocusedActorActivatedCallback callback;
+  manager.FocusedActorActivatedSignal().Connect(&callback, &FocusedActorActivatedCallback::Callback);
+  DALI_TEST_CHECK(true);
+
+  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 002601d..9fad2c8 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/iris-effect.h>
 
 using namespace Dali;
 
index dea4d52..8dd9e24 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -47,6 +47,13 @@ public:
   {
   }
 
+  /**
+   * Virtual destructor.
+   */
+  virtual ~TestItemFactory()
+  {
+  }
+
 public: // From ItemFactory
 
   /**
@@ -72,6 +79,186 @@ public: // From ItemFactory
     return actor;
   }
 };
+
+class TestItemLayout;
+
+typedef IntrusivePtr<TestItemLayout> TestItemLayoutPtr;
+
+// Implementation of ItemLayout
+class TestItemLayout : public ItemLayout
+{
+public:
+
+  /**
+   * Constructor
+   */
+  TestItemLayout()
+  {
+  }
+
+  /**
+   * Virtual destructor.
+   */
+  virtual ~TestItemLayout()
+  {
+  }
+
+  /**
+   * Create a new grid layout.
+   */
+  static TestItemLayoutPtr New()
+  {
+    return TestItemLayoutPtr(new TestItemLayout());
+  }
+
+public: // From ItemLayout
+
+  /**
+   * Query the minimum valid layout position; this is a negative value.
+   *
+   * When scrolling, the first item will move within the range 0 to GetMinimumLayoutPosition().
+   * @param[in] numberOfItems The current number of items in the layout.
+   * @param[in] layoutSize The size of the layout area.
+   * @return The minimum layout position.
+   */
+  virtual float GetMinimumLayoutPosition(unsigned int numberOfItems, Vector3 layoutSize) const
+  {
+    return 0.0f;
+  }
+
+  /**
+   * Query the closest anchor position for the given layout position.
+   *
+   * This anchor position is the position where all the items in the layout are aligned to
+   * their rounded layout positions in integer.
+   * @param[in] layoutPosition The layout position.
+   * @return The closest anchor position for the given layout position.
+   */
+  virtual float GetClosestAnchorPosition(float layoutPosition) const
+  {
+    return 0.0f;
+  }
+
+  /**
+   * Query the layout position for the first item in the layout to move to when the layout
+   * needs to scroll to a particular item.
+   *
+   * @param[in] itemId The ID of an item in the layout.
+   * @return The layout position for the first item in the layout to move to.
+   */
+  virtual float GetItemScrollToPosition(unsigned int itemId) const
+  {
+    return 0.0f;
+  }
+
+  /**
+   * Query the items within a given layout-area.
+   *
+   * @param[in] firstItemPosition The layout-position of the first item in the layout.
+   * @param[in] layoutSize The size of the layout area.
+   * @return The ID of the first & last visible item.
+   */
+  virtual ItemRange GetItemsWithinArea(float firstItemPosition, Vector3 layoutSize) const
+  {
+    return ItemRange(0, 10);
+  }
+
+  /**
+   * Query the number of items that should be reserved, for scrolling purposes.
+   *
+   * @param[in] layoutSize The size of the layout area.
+   * @return The number of extra items.
+   */
+  virtual unsigned int GetReserveItemCount(Vector3 layoutSize) const
+  {
+    return 0;
+  }
+
+  /**
+   * Retrieve the default size of an item in the layout.
+   *
+   * @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.
+   */
+  virtual void GetDefaultItemSize( unsigned int itemId, const Vector3& layoutSize, Vector3& itemSize ) const
+  {
+  }
+
+  /**
+   * Retrieve the resize animation in the layout.
+   *
+   * @param[in] animation The resize animation, not owned by the layout
+   * @param[in] actor The actor to animate
+   * @param [in] size The target size.
+   * @param [in] durationSeconds The duration of the resizing.
+   */
+  virtual void GetResizeAnimation(Animation& animation, Actor actor, Vector3 size, float durationSeconds) const
+  {
+  }
+
+  /**
+   * @brief Query the scroll direction of the layout.
+   * @return The scroll direction in degrees.
+   */
+  virtual Degree GetScrollDirection() const
+  {
+    return Degree( 0.0f );
+  }
+
+  /**
+   * @brief Query the scroll speed factor of the layout while dragging.
+   * @return The scroll speed factor of the layout.
+   */
+  virtual float GetScrollSpeedFactor() const
+  {
+    return 0;
+  }
+
+  /**
+   * @brief Query the maximum swipe speed in pixels per second.
+   * @return speed The maximum swipe speed.
+   */
+  virtual float GetMaximumSwipeSpeed() const
+  {
+    return 0;
+  }
+
+  /**
+   * @brief Get the duration of the flick animation in second.
+   * @return The duration of the flick animation.
+   */
+  virtual float GetItemFlickAnimationDuration() const
+  {
+    return 0;
+  }
+
+  /*
+   * @brief Applies constraints defined by the layout to an actor.
+   *
+   * @param[in] actor The actor to constrain.
+   * @param[in] itemId The ID of the item represented by the actor.
+   * @param[in] layoutSize the current size of the item view instance.
+   * @param[in] itemViewActor The item view instance which requests the application of constraints.
+   */
+  virtual void ApplyConstraints( Actor& actor, const int itemId, const Vector3& layoutSize, const Actor& itemViewActor )
+  {
+  }
+
+  /**
+   * @brief Gets the position of a given item
+   *
+   * @param[in] itemID id of the item we want to get its position
+   * @param[in] currentLayoutPosition the current layout position of the item view instance
+   * @param[in] layoutSize the current size of the item view instance
+   * @return The item position (x,y,z)
+   */
+  virtual Vector3 GetItemPosition(int itemID, float currentLayoutPosition, const Vector3& layoutSize) const
+  {
+    return Vector3::ZERO;
+  }
+};
+
 } // namespace
 
 int UtcDaliItemLayoutSetAndGetOrientation(void)
@@ -83,14 +270,91 @@ 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
   ItemLayoutPtr layout = view.GetLayout(0);
+
+  DALI_TEST_CHECK(gridLayout == layout);
+
   layout->SetOrientation(ControlOrientation::Left);
 
   // Check the orientation of the layout is horizontal from left to right
   DALI_TEST_CHECK(layout->GetOrientation() == ControlOrientation::Left);
+
+  Vector3 itemSize(100.0f, 100.0f, 100.0f);
+  layout->SetItemSize(itemSize);
+
+  Vector3 itemSize1;
+  layout->GetItemSize(0u, Vector3(Stage::GetCurrent().GetSize()), itemSize1);
+
+  DALI_TEST_CHECK(itemSize == itemSize1);
+
+  float position = layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3(Stage::GetCurrent().GetSize()));
+
+  DALI_TEST_EQUALS(position, 0.0f, TEST_LOCATION);
+
+  int focusItem = layout->GetNextFocusItemID(0, TOTAL_ITEM_NUMBER, Control::Left, true);
+
+  DALI_TEST_CHECK(focusItem != 0);
+
+  float flickSpeedFactor = layout->GetFlickSpeedFactor();
+
+  DALI_TEST_CHECK(flickSpeedFactor != 0.0f);
+
+  ItemLayoutPtr depthLayout = DefaultItemLayout::New( DefaultItemLayout::DEPTH );
+  view.AddLayout(*depthLayout);
+
+  layout = view.GetLayout(1);
+  DALI_TEST_CHECK(depthLayout == layout);
+
+  ItemLayoutPtr listLayout = DefaultItemLayout::New( DefaultItemLayout::LIST );
+  view.AddLayout(*listLayout);
+
+  layout = view.GetLayout(2);
+  DALI_TEST_CHECK(listLayout == layout);
+
+  ItemLayoutPtr spiralLayout = DefaultItemLayout::New( DefaultItemLayout::SPIRAL );
+  view.AddLayout(*spiralLayout);
+
+  layout = view.GetLayout(3);
+  DALI_TEST_CHECK(spiralLayout == layout);
   END_TEST;
 }
+
+int UtcDaliItemLayoutGetExtension(void)
+{
+  ToolkitTestApplication application;
+
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  DALI_TEST_CHECK( gridLayout );
+  DALI_TEST_CHECK( !gridLayout->GetExtension() );
+
+  END_TEST;
+}
+
+int UtcDaliItemLayoutGetClosestOnScreenLayoutPosition(void)
+{
+  ToolkitTestApplication application;
+
+  TestItemLayoutPtr layout = TestItemLayout::New();
+  DALI_TEST_CHECK( layout );
+  DALI_TEST_EQUALS(layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3::ZERO), 0.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS(layout->GetClosestOnScreenLayoutPosition(0, 0.0f, Vector3(-800.0f, -1200.0f, 0.0f)), 0.0f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliItemLayoutGetNextFocusItemID(void)
+{
+  ToolkitTestApplication application;
+
+  TestItemLayoutPtr layout = TestItemLayout::New();
+  DALI_TEST_CHECK( layout );
+  DALI_TEST_EQUALS(layout->GetNextFocusItemID(0, 100, Control::Left, true), 99, TEST_LOCATION );
+  DALI_TEST_EQUALS(layout->GetNextFocusItemID(110, 100, Control::Right, true), 0, TEST_LOCATION );
+
+  END_TEST;
+}
+
index c66a650..3dcc6e8 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
@@ -443,6 +443,8 @@ int UtcDaliItemViewSetAndGetRefreshInterval(void)
   // Set the interval between refreshes to be 20
   view.SetRefreshInterval(20);
 
+  view.Refresh();
+
   // Check the interval between refreshes is 20
   DALI_TEST_CHECK(view.GetRefreshInterval() == 20);
   END_TEST;
@@ -456,7 +458,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);
@@ -538,3 +540,234 @@ int UtcDaliItemViewSetAndGetMouseWheelScrollDistanceStep(void)
   DALI_TEST_EQUALS(view.GetMouseWheelScrollDistanceStep(), 100.0f, TEST_LOCATION );
   END_TEST;
 }
+
+int UtcDaliItemViewInsertItemP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create the ItemView actor
+  TestItemFactory factory;
+  ItemView view = ItemView::New(factory);
+
+  // Create a grid layout and add it to ItemView
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  view.AddLayout(*gridLayout);
+
+  // Activate the grid layout so that the items will be created and added to ItemView
+  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  view.ActivateLayout(0, stageSize, 0.5f);
+
+  // Get the item given the item ID
+  Actor itemActor = view.GetItem(2);
+
+  ItemId id = view.GetItemId( itemActor );
+
+  // Check we are getting the correct Item ID given the specified actor
+  DALI_TEST_CHECK(view.GetItemId(itemActor) == 2);
+
+  Actor newActor = Actor::New();
+
+  view.InsertItem(Item(id, newActor), 0.5f);
+
+  DALI_TEST_CHECK(view.GetItem(2) == newActor);
+  END_TEST;
+}
+
+int UtcDaliItemViewInsertItemsP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create the ItemView actor
+  TestItemFactory factory;
+  ItemView view = ItemView::New(factory);
+
+  // Create a grid layout and add it to ItemView
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  view.AddLayout(*gridLayout);
+
+  // Activate the grid layout so that the items will be created and added to ItemView
+  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  view.ActivateLayout(0, stageSize, 0.5f);
+
+  unsigned int itemCount = view.GetChildCount();
+
+  ItemContainer insertList;
+
+  for( unsigned int i = 0u; i < 10; ++i )
+  {
+    Actor child = view.GetChildAt( i );
+    Actor newActor = Actor::New();
+    newActor.SetName("Inserted");
+    insertList.push_back( Item( view.GetItemId(child), newActor ) );
+  }
+
+  if( !insertList.empty() )
+  {
+    view.InsertItems( insertList, 0.5f );
+  }
+
+  DALI_TEST_CHECK(view.GetChildCount() == itemCount + 10);
+
+  ItemIdContainer removeList;
+
+  for( unsigned int i = 0u; i < view.GetChildCount(); ++i )
+  {
+    Actor child = view.GetChildAt( i );
+
+    if( child.GetName() == "Inserted" )
+    {
+      removeList.push_back( view.GetItemId(child) );
+    }
+  }
+
+  if( ! removeList.empty() )
+  {
+    view.RemoveItems( removeList, 0.5f );
+  }
+
+  DALI_TEST_CHECK(view.GetChildCount() == itemCount);
+  END_TEST;
+}
+
+int UtcDaliItemViewReplaceItemP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create the ItemView actor
+  TestItemFactory factory;
+  ItemView view = ItemView::New(factory);
+
+  // Create a grid layout and add it to ItemView
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  view.AddLayout(*gridLayout);
+
+  // Activate the grid layout so that the items will be created and added to ItemView
+  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  view.ActivateLayout(0, stageSize, 0.5f);
+
+  Actor newActor = Actor::New();
+
+  view.ReplaceItem( Item( 0, newActor ), 0.5f );
+
+  DALI_TEST_CHECK(view.GetItem(0) == newActor);
+  END_TEST;
+}
+
+int UtcDaliItemViewReplaceItemsP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create the ItemView actor
+  TestItemFactory factory;
+  ItemView view = ItemView::New(factory);
+
+  // Create a grid layout and add it to ItemView
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  view.AddLayout(*gridLayout);
+
+  // Activate the grid layout so that the items will be created and added to ItemView
+  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  view.ActivateLayout(0, stageSize, 0.5f);
+
+  ItemContainer replaceList;
+
+  for( unsigned int i = 0u; i < 10; ++i )
+  {
+    Actor child = view.GetChildAt( i );
+    Actor newActor = Actor::New();
+    newActor.SetName("Replaced");
+
+    replaceList.push_back( Item( view.GetItemId(child), newActor ) );
+  }
+
+  if( !replaceList.empty() )
+  {
+    view.ReplaceItems( replaceList, 0.5f );
+  }
+
+  DALI_TEST_CHECK(view.GetItem(0).GetName() == "Replaced");
+  DALI_TEST_CHECK(view.GetItem(8).GetName() == "Replaced");
+  END_TEST;
+}
+
+int UtcDaliItemViewGetItemsRangeP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create the ItemView actor
+  TestItemFactory factory;
+  ItemView view = ItemView::New(factory);
+
+  // Create a grid layout and add it to ItemView
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  view.AddLayout(*gridLayout);
+
+  // Activate the grid layout so that the items will be created and added to ItemView
+  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  view.ActivateLayout(0, stageSize, 0.5f);
+
+  ItemRange itemRange(0, 0);
+
+  view.GetItemsRange(itemRange);
+
+  DALI_TEST_CHECK(itemRange.Within(0));
+  END_TEST;
+}
+
+int UtcDaliItemViewSetItemsAnchorPointP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create the ItemView actor
+  TestItemFactory factory;
+  ItemView view = ItemView::New(factory);
+
+  // Create a grid layout and add it to ItemView
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  view.AddLayout(*gridLayout);
+
+  // Activate the grid layout so that the items will be created and added to ItemView
+  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  view.ActivateLayout(0, stageSize, 0.5f);
+
+  Vector3 anchorPoint(10.0f, 10.0f, 0.0f);
+
+  view.SetItemsAnchorPoint(anchorPoint);
+
+  DALI_TEST_CHECK(view.GetItemsAnchorPoint() == anchorPoint);
+  DALI_TEST_CHECK(view.GetItem(0).GetCurrentAnchorPoint() == anchorPoint);
+  END_TEST;
+}
+
+int UtcDaliItemViewSetItemsParentOriginP(void)
+{
+  ToolkitTestApplication application;
+
+  // Create the ItemView actor
+  TestItemFactory factory;
+  ItemView view = ItemView::New(factory);
+
+  // Create a grid layout and add it to ItemView
+  ItemLayoutPtr gridLayout = DefaultItemLayout::New( DefaultItemLayout::GRID );
+  view.AddLayout(*gridLayout);
+
+  // Activate the grid layout so that the items will be created and added to ItemView
+  Vector3 stageSize(Dali::Stage::GetCurrent().GetSize());
+  view.ActivateLayout(0, stageSize, 0.5f);
+
+  Vector3 parentOrigin(10.0f, 10.0f, 0.0f);
+
+  view.SetItemsParentOrigin(parentOrigin);
+
+  DALI_TEST_CHECK(view.GetItemsParentOrigin() == parentOrigin);
+  DALI_TEST_CHECK(view.GetItem(0).GetCurrentParentOrigin() == parentOrigin);
+  END_TEST;
+}
+
+int UtcDaliItemFactoryGetExtention(void)
+{
+  ToolkitTestApplication application;
+  TestItemFactory factory;
+  DALI_TEST_CHECK( factory.GetExtension() == NULL );
+  END_TEST;
+}
index a1ebacd..f42e16c 100644 (file)
@@ -19,7 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/public-api/builder/json-parser.h>
+#include <dali-toolkit/devel-api/builder/json-parser.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
index 2c866dc..05f0e26 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/integration-api/events/key-event-integ.h>
 
+
 using namespace Dali;
 using namespace Dali::Toolkit;
 
index 49c346e..ef92868 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/mask-effect.h>
 
 using namespace Dali;
 
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;
-}
index dccba07..7d76ab3 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/nine-patch-mask-effect.h>
 
 using namespace Dali;
 
index b5511ed..744af83 100644 (file)
@@ -19,6 +19,8 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/overlay-effect.h>
+
 
 
 using namespace Dali;
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 b1d5961..e1924c6 100644 (file)
@@ -19,7 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
-
+#include <dali-toolkit/devel-api/shader-effects/page-turn-effect.h>
 
 using namespace Dali;
 
index 443de6f..0edd638 100644 (file)
 #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>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-factory.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h>
+
+
 
 using namespace Dali;
 using namespace Dali::Toolkit;
index 0aaf295..294bec2 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/popup/popup.h>
 
 using namespace Dali;
 using namespace Toolkit;
index 4b62045..ecf4907 100644 (file)
@@ -96,6 +96,224 @@ Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned
 
 } //namespace
 
+int UtcDaliPushButtonConstructorP(void)
+{
+  TestApplication application;
+
+  PushButton button;
+
+  DALI_TEST_CHECK( !button );
+  END_TEST;
+}
+
+int UtcDaliPushButtonCopyConstructorP(void)
+{
+  TestApplication application;
+
+  // Initialize an object, ref count == 1
+  PushButton button = PushButton::New();
+
+  PushButton copy( button );
+  DALI_TEST_CHECK( copy );
+  END_TEST;
+}
+
+int UtcDaliPushButtonAssignmentOperatorP(void)
+{
+  TestApplication application;
+
+  PushButton button = PushButton::New();
+
+  PushButton copy( button );
+  DALI_TEST_CHECK( copy );
+
+  DALI_TEST_CHECK( button == copy );
+  END_TEST;
+}
+
+int UtcDaliPushButtonNewP(void)
+{
+  TestApplication application;
+
+  PushButton button = PushButton::New();
+
+  DALI_TEST_CHECK( button );
+  END_TEST;
+}
+
+int UtcDaliPushButtonDownCastP(void)
+{
+  TestApplication application;
+
+  PushButton button = PushButton::New();
+
+  BaseHandle object(button);
+
+  PushButton button2 = PushButton::DownCast( object );
+  DALI_TEST_CHECK(button2);
+
+  PushButton button3 = DownCast< PushButton >(object);
+  DALI_TEST_CHECK(button3);
+  END_TEST;
+}
+
+int UtcDaliPushButtonDownCastN(void)
+{
+  TestApplication application;
+
+  BaseHandle unInitializedObject;
+
+  PushButton button1 = PushButton::DownCast( unInitializedObject );
+  DALI_TEST_CHECK( !button1 );
+
+  PushButton button2 = DownCast< PushButton >( unInitializedObject );
+  DALI_TEST_CHECK( !button2 );
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetButtonImage(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetButtonImage");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+  ImageActor imageActor = CreateSolidColorActor( Color::RED );
+  imageActor.SetSize( 20, 20 );
+
+  PushButton pushButton = PushButton::New();
+  Stage::GetCurrent().Add( pushButton );
+
+  application.SendNotification();
+  application.Render();
+
+  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
+  pushButton.SetButtonImage( image );
+
+  DALI_TEST_CHECK( pushButton.GetButtonImage() );
+
+  application.SendNotification();
+  application.Render();
+
+  Vector3 size = pushButton.GetCurrentSize();
+
+  DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
+  DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
+
+  pushButton.SetButtonImage( imageActor );
+
+  DALI_TEST_CHECK( pushButton.GetButtonImage() );
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetBackgroundImageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetBackgroundImageP");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+  ImageActor imageActor = CreateSolidColorActor( Color::RED );
+  imageActor.SetSize( 20, 20 );
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetBackgroundImage( image );
+
+  DALI_TEST_CHECK( pushButton.GetBackgroundImage() );
+
+  pushButton.SetBackgroundImage( imageActor );
+
+  DALI_TEST_CHECK( pushButton.GetBackgroundImage() );
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetSelectedImageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetSelectedImageP");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+  ImageActor imageActor = CreateSolidColorActor( Color::RED );
+  imageActor.SetSize( 20, 20 );
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetSelectedImage( image );
+
+  DALI_TEST_CHECK( pushButton.GetSelectedImage() );
+
+  pushButton.SetSelectedImage( imageActor );
+
+  DALI_TEST_CHECK( pushButton.GetSelectedImage() );
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetSelectedBackgroundImageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetSelectedBackgroundImageP");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+  ImageActor imageActor = CreateSolidColorActor( Color::RED );
+  imageActor.SetSize( 20, 20 );
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetSelectedBackgroundImage( image );
+
+  DALI_TEST_CHECK( pushButton.GetSelectedBackgroundImage() );
+
+  pushButton.SetSelectedBackgroundImage( imageActor );
+
+  DALI_TEST_CHECK( pushButton.GetSelectedBackgroundImage() );
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledBackgroundImageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetDisabledBackgroundImageP");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+  ImageActor imageActor = CreateSolidColorActor( Color::RED );
+  imageActor.SetSize( 20, 20 );
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetDisabledBackgroundImage( image );
+
+  DALI_TEST_CHECK( pushButton.GetDisabledBackgroundImage() );
+
+  pushButton.SetDisabledBackgroundImage( imageActor );
+
+  DALI_TEST_CHECK( pushButton.GetDisabledBackgroundImage() );
+
+  END_TEST;
+}
+
+int UtcDaliPushButtonSetDisabledImageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliPushButtonSetDisabledImageP");
+
+  Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+  ImageActor imageActor = CreateSolidColorActor( Color::RED );
+  imageActor.SetSize( 20, 20 );
+
+  PushButton pushButton = PushButton::New();
+
+  pushButton.SetDisabledImage( image );
+
+  DALI_TEST_CHECK( pushButton.GetDisabledImage() );
+
+  pushButton.SetDisabledImage( imageActor );
+
+  DALI_TEST_CHECK( pushButton.GetDisabledImage() );
+
+  END_TEST;
+}
 
 int UtcDaliPushButtonSetGetAutoRepeating(void)
 {
@@ -271,36 +489,6 @@ int UtcDaliPushButtonSetGetAutorepeatingDelayValues02(void)
   END_TEST;
 }
 
-int UtcDaliPushButtonSetImages(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliPushButtonSetImages");
-
-  Actor imageActor;
-
-  Image image01 = CreateSolidColorImage( Color::RED, 10, 10 );
-
-  Vector3 size;
-  PushButton pushButton = PushButton::New();
-  Stage::GetCurrent().Add( pushButton );
-
-  application.SendNotification();
-  application.Render();
-
-  pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
-  pushButton.SetButtonImage( image01 );
-
-  application.SendNotification();
-  application.Render();
-
-  size = pushButton.GetCurrentSize();
-
-  DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
-  DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
-
-  END_TEST;
-}
-
 int UtcDaliPushButtonSetLabelText(void)
 {
   ToolkitTestApplication application;
index c20a167..521d6ca 100644 (file)
@@ -47,10 +47,45 @@ static void TestCallback(BaseHandle handle)
 
 }
 
-int UtcDaliRadioButtonNew(void)
+int UtcDaliRadioButtonConstructorP(void)
+{
+  TestApplication application;
+
+  RadioButton button;
+
+  DALI_TEST_CHECK( !button );
+  END_TEST;
+}
+
+int UtcDaliRadioButtonCopyConstructorP(void)
+{
+  TestApplication application;
+
+  // Initialize an object, ref count == 1
+  RadioButton button = RadioButton::New();
+
+  RadioButton copy( button );
+  DALI_TEST_CHECK( copy );
+  END_TEST;
+}
+
+int UtcDaliRadioButtonAssignmentOperatorP(void)
+{
+  TestApplication application;
+
+  RadioButton button = RadioButton::New();
+
+  RadioButton copy( button );
+  DALI_TEST_CHECK( copy );
+
+  DALI_TEST_CHECK( button == copy );
+  END_TEST;
+}
+
+int UtcDaliRadioButtonNewP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliRadioButtonNew");
+  tet_infoline(" UtcDaliRadioButtonNewP");
 
   // Create the Slider actor
   RadioButton radioButton;
@@ -78,7 +113,7 @@ int UtcDaliRadioButtonNew(void)
   END_TEST;
 }
 
-int UtcDaliRadioButtonDestructor(void)
+int UtcDaliRadioButtonDestructorP(void)
 {
   ToolkitTestApplication application;
 
index 1fac593..263a5d1 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/ripple2d-effect.h>
 
 using namespace Dali;
 
index 71db67d..0ba33d7 100644 (file)
@@ -24,6 +24,8 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/ripple-effect.h>
+
 
 using namespace Dali;
 
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..6d38d5e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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;
   }
 
@@ -262,10 +265,56 @@ float TestAlphaFunction(float progress)
 } // unnamed namespace
 
 
-int UtcDaliScrollViewNew(void)
+int UtcDaliToolkitScrollViewConstructorP(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollView scrollView;
+  DALI_TEST_CHECK( !scrollView );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewCopyConstructorP(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollView scrollView = ScrollView::New();
+  scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
+
+  ScrollView copy( scrollView );
+  DALI_TEST_CHECK( copy );
+  DALI_TEST_CHECK( copy.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) == scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewAssignmentOperatorP(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollView scrollView = ScrollView::New();
+  scrollView.SetProperty( ScrollView::Property::SCROLL_POSITION, Vector2(10.0f, 10.0f) );
+
+  ScrollView copy = scrollView;
+  DALI_TEST_CHECK( copy );
+  DALI_TEST_CHECK( copy.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) == scrollView.GetProperty<Vector2>( ScrollView::Property::SCROLL_POSITION ) );
+  END_TEST;
+}
+
+int UtcDaliScrollViewDestructorP(void)
+{
+  ToolkitTestApplication application;
+
+  ScrollView* scrollView = new ScrollView();
+  delete scrollView;
+
+  DALI_TEST_CHECK( true );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewNewP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewNew");
+  tet_infoline(" UtcDaliToolkitScrollViewNewP");
 
   ScrollView scrollView;
 
@@ -292,10 +341,10 @@ int UtcDaliScrollViewNew(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewDownCast(void)
+int UtcDaliToolkitScrollViewDownCastP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewDownCast");
+  tet_infoline(" UtcDaliToolkitScrollViewDownCastP");
 
   ScrollView scrollView = ScrollView::New();
   BaseHandle handle(scrollView);
@@ -306,17 +355,17 @@ int UtcDaliScrollViewDownCast(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewScrollToPosition(void)
+int UtcDaliToolkitScrollViewScrollToPositionP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewScrollToPosition");
+  tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionP");
 
   // Create the ScrollView actor
   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);
@@ -325,14 +374,130 @@ int UtcDaliScrollViewScrollToPosition(void)
   Wait(application, RENDER_DELAY_SCROLL);
   DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
 
-  Wait(application);
   END_TEST;
 }
 
-int UtcDaliScrollViewScrollToPage(void)
+int UtcDaliToolkitScrollViewScrollToPositionWithDirectionBiasP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionWithDirectionBiasP");
+
+  ScrollView scrollView = ScrollView::New();
+  Stage::GetCurrent().Add( scrollView );
+  RulerPtr rulerX = new FixedRuler( 100.0f );
+  rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
+  RulerPtr rulerY = new FixedRuler( 100.0f );
+  rulerY->SetDomain( RulerDomain(0.0f, 200.0f, true) );
+
+  scrollView.SetRulerX( rulerX );
+  scrollView.SetRulerY( rulerY );
+
+  scrollView.SetWrapMode(true);
+
+  const Vector2 target = Vector2(50.0f, 50.0f);
+  const Vector2 target2 = Vector2(150.0f, 150.0f);
+
+  scrollView.ScrollTo( target, 0.0f );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+
+  scrollView.ScrollTo( target2, 0.25f, Dali::Toolkit::DirectionBiasLeft, Dali::Toolkit::DirectionBiasLeft );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2::ZERO, TEST_LOCATION );
+
+  scrollView.ScrollTo( target, 0.0f );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+
+  scrollView.ScrollTo( target2, 0.25f, Dali::Toolkit::DirectionBiasRight, Dali::Toolkit::DirectionBiasRight );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionP");
+
+  // Create the ScrollView actor
+  ScrollView scrollView = ScrollView::New();
+  Stage::GetCurrent().Add( scrollView );
+
+  const Vector2 target = Vector2(100.0f, 200.0f);
+  const Vector2 target2 = Vector2(300.0f, 100.0f);
+
+  scrollView.ScrollTo( target, 0.5f, TestAlphaFunction );
+  Wait(application, 250);
+  // Check that the scroll animation should finish within just half of the specified duration with the above alpha function
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+
+  scrollView.ScrollTo( target2, 0.5f, AlphaFunction::LINEAR );
+  Wait(application, 250);
+  // Check that the scroll animation has not finished within half of the specified duration with the linear alpha function
+  DALI_TEST_CHECK( scrollView.GetCurrentScrollPosition() != target2 );
+
+  // Wait till the end of the specified duration
+  Wait(application, 250);
+  // Check that the scroll animation has finished
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionAndDirectionBiasP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewScrollToPositionWithAlphaFunctionAndDirectionBiasP");
+
+  ScrollView scrollView = ScrollView::New();
+  Stage::GetCurrent().Add( scrollView );
+  RulerPtr rulerX = new FixedRuler( 100.0f );
+  rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
+  RulerPtr rulerY = new FixedRuler( 100.0f );
+  rulerY->SetDomain( RulerDomain(0.0f, 200.0f, true) );
+
+  scrollView.SetRulerX( rulerX );
+  scrollView.SetRulerY( rulerY );
+
+  scrollView.SetWrapMode(true);
+
+  const Vector2 target = Vector2(50.0f, 50.0f);
+  const Vector2 target2 = Vector2(150.0f, 150.0f);
+
+  scrollView.ScrollTo( target, 0.0f );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+
+  scrollView.ScrollTo( target2, 0.25f, AlphaFunction::LINEAR, Dali::Toolkit::DirectionBiasLeft, Dali::Toolkit::DirectionBiasLeft );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2::ZERO, TEST_LOCATION );
+
+  scrollView.ScrollTo( target, 0.0f );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+
+  scrollView.ScrollTo( target2, 0.25f, AlphaFunction::LINEAR, Dali::Toolkit::DirectionBiasRight, Dali::Toolkit::DirectionBiasRight );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+
+  scrollView.ScrollTo( target, 0.0f );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target, TEST_LOCATION );
+
+  scrollView.ScrollTo( target2, 0.25f, TestAlphaFunction, Dali::Toolkit::DirectionBiasRight, Dali::Toolkit::DirectionBiasRight );
+  Wait(application, 125);
+  // Check that the scroll animation should finish within just half of the specified duration with the above alpha function
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), target2, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewScrollToPageP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewScrollToPage");
+  tet_infoline(" UtcDaliToolkitScrollViewScrollToPageP");
 
   ScrollView scrollView = ScrollView::New();
   Stage::GetCurrent().Add( scrollView );
@@ -346,29 +511,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,17 +548,58 @@ 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);
   END_TEST;
 }
 
-int UtcDaliScrollViewScrollToActor(void)
+int UtcDaliToolkitScrollViewScrollToPageWithDirectionBiasP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewScrollToPageWithDirectionBiasP");
+
+  ScrollView scrollView = ScrollView::New();
+  Stage::GetCurrent().Add( scrollView );
+  RulerPtr rulerX = new FixedRuler( 100.0f );
+  rulerX->SetDomain( RulerDomain(0.0f, 200.0f, true) );
+  RulerPtr rulerY = new FixedRuler( 100.0f );
+  rulerY->SetDomain( RulerDomain(0.0f, 200.0f, true) );
+
+  scrollView.SetRulerX( rulerX );
+  scrollView.SetRulerY( rulerY );
+
+  scrollView.SetWrapMode(true);
+
+  scrollView.ScrollTo( 0, 0.25, Dali::Toolkit::DirectionBiasLeft );
+
+  Wait(application, RENDER_FRAME_INTERVAL); // Wait for one frame
+  // Check that the scroll position remains the same
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION );
+
+  Wait(application, RENDER_DELAY_SCROLL); // Wait for one second
+  // Check that it stays at the same page (i.e. the same scroll position)
+  DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION );
+
+  scrollView.ScrollTo( 0, 0.25, Dali::Toolkit::DirectionBiasRight );
+
+  Wait(application, RENDER_FRAME_INTERVAL); // Wait for one frame
+  // Check that it scrolls towards the right
+  DALI_TEST_CHECK( scrollView.GetCurrentScrollPosition().x > 0.0f );
+
+  Wait(application, RENDER_DELAY_SCROLL); // Wait for one second
+  // Check that it scrolls back to the same page (i.e. the same scroll position)
+  DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 0.0f), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewScrollToActorP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewScrollToActor");
+  tet_infoline(" UtcDaliToolkitScrollViewScrollToActorP");
 
   ScrollView scrollView = ScrollView::New();
   Stage::GetCurrent().Add( scrollView );
@@ -412,27 +618,27 @@ 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;
 }
 
-int UtcDaliScrollViewScrollToSnapPoint(void)
+int UtcDaliToolkitScrollViewScrollToSnapPointP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewScrollToSnapPoint");
+  tet_infoline(" UtcDaliToolkitScrollViewScrollToSnapPointP");
 
   ScrollView scrollView = ScrollView::New();
   Stage::GetCurrent().Add( scrollView );
@@ -444,21 +650,21 @@ 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;
 }
 
-int UtcDaliScrollViewSetScrollUpdateDistance(void)
+int UtcDaliToolkitScrollViewSetScrollUpdateDistanceP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewRefreshInterval");
+  tet_infoline(" UtcDaliToolkitScrollViewSetScrollUpdateDistanceP");
 
   ScrollView scrollView = ScrollView::New();
 
@@ -471,14 +677,17 @@ int UtcDaliScrollViewSetScrollUpdateDistance(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewWrapMode(void)
+int UtcDaliToolkitScrollViewSetWrapModeP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewWrapMode");
+  tet_infoline(" UtcDaliToolkitScrollViewSetWrapModeP");
 
   ScrollView scrollView = ScrollView::New();
   Stage::GetCurrent().Add( scrollView );
 
+  Actor actor = Actor::New();
+  scrollView.Add( actor );
+
   // Position rulers. 4x4 grid.
   RulerPtr rulerX = new FixedRuler(50.0f);
   RulerPtr rulerY = new FixedRuler(50.0f);
@@ -488,18 +697,21 @@ 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);
+  scrollView.ScrollTo(Vector2(230.0f, 130.0f), 0.0f); // 5th (1st) page across, and 3rd (3rd) page down. (wrapped)
+  Wait(application);
   DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 13, TEST_LOCATION );
   END_TEST;
 }
 
-int UtcDaliScrollViewActorAutoSnap(void)
+int UtcDaliToolkitScrollViewActorAutoSnap(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewActorAutoSnap");
+  tet_infoline(" UtcDaliToolkitScrollViewActorAutoSnap");
 
   ScrollView scrollView = ScrollView::New();
   Stage::GetCurrent().Add( scrollView );
@@ -523,7 +735,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,20 +746,20 @@ 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;
 }
 
-int UtcDaliScrollViewSignalsStartComplete(void)
+int UtcDaliToolkitScrollViewSignalsStartComplete(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewSignalsStartComplete");
+  tet_infoline(" UtcDaliToolkitScrollViewSignalsStartComplete");
 
   gOnScrollStartCalled = false;
   gOnScrollCompleteCalled = false;
@@ -565,7 +777,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);
@@ -573,10 +785,10 @@ int UtcDaliScrollViewSignalsStartComplete(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewSignalsUpdate(void)
+int UtcDaliToolkitScrollViewSignalsUpdate(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewSignalsUpdate");
+  tet_infoline(" UtcDaliToolkitScrollViewSignalsUpdate");
 
   gOnScrollStartCalled = false;
   gOnScrollUpdateCalled = false;
@@ -663,10 +875,10 @@ static Vector2 PerformGestureDiagonalSwipe(ToolkitTestApplication& application,
   return pos;
 }
 
-int UtcDaliScrollViewScrollSensitive(void)
+int UtcDaliToolkitScrollViewScrollSensitive(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewScrollSensitive");
+  tet_infoline(" UtcDaliToolkitScrollViewScrollSensitive");
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
@@ -709,10 +921,10 @@ int UtcDaliScrollViewScrollSensitive(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewAxisAutoLock(void)
+int UtcDaliToolkitScrollViewAxisAutoLock(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewAxisAutoLock");
+  tet_infoline(" UtcDaliToolkitScrollViewAxisAutoLock");
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
@@ -734,20 +946,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);
@@ -761,10 +973,10 @@ int UtcDaliScrollViewAxisAutoLock(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewAxisAutoLockGradient(void)
+int UtcDaliToolkitScrollViewAxisAutoLockGradient(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewAxisAutoLockGradient");
+  tet_infoline(" UtcDaliToolkitScrollViewAxisAutoLockGradient");
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
@@ -775,10 +987,10 @@ int UtcDaliScrollViewAxisAutoLockGradient(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewConstraints(void)
+int UtcDaliToolkitScrollViewConstraints(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewConstraints");
+  tet_infoline(" UtcDaliToolkitScrollViewConstraints");
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
@@ -820,10 +1032,10 @@ int UtcDaliScrollViewConstraints(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewBind(void)
+int UtcDaliToolkitScrollViewBind(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewBind");
+  tet_infoline(" UtcDaliToolkitScrollViewBind");
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
@@ -874,122 +1086,10 @@ int UtcDaliScrollViewBind(void)
   END_TEST;
 }
 
-int UtcDaliRulerEnableDisable(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliRulerEnableDisable");
-
-  RulerPtr ruler = new DefaultRuler();
-
-  DALI_TEST_CHECK( ruler->IsEnabled() );
-  ruler->Disable();
-  DALI_TEST_CHECK( !ruler->IsEnabled() );
-  ruler->Enable();
-  DALI_TEST_CHECK( ruler->IsEnabled() );
-  END_TEST;
-}
-
-int UtcDaliRulerDomainEnableDisable(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliRulerDomainEnableDisable");
-
-  RulerPtr ruler = new DefaultRuler();
-  DALI_TEST_EQUALS( ruler->GetDomain().GetSize(), 1.0f, TEST_LOCATION );
-
-
-  ruler->SetDomain( RulerDomain(0.0f, 100.0f, true) );
-  DALI_TEST_EQUALS( ruler->GetDomain().GetSize(), 100.0f, TEST_LOCATION );
-  DALI_TEST_EQUALS( ruler->Clamp(-200.0f), 0.0f, TEST_LOCATION );
-  DALI_TEST_EQUALS( ruler->Clamp(200.0f), 100.0f, TEST_LOCATION );
-
-  ruler->DisableDomain();
-  DALI_TEST_EQUALS( ruler->GetDomain().GetSize(), 1.0f, TEST_LOCATION );
-  DALI_TEST_EQUALS( ruler->Clamp(-200.0f), -200.0f, TEST_LOCATION );
-  DALI_TEST_EQUALS( ruler->Clamp(200.0f), 200.0f, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliRulerSnapAndClamp(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliRulerSnapAndClamp");
-
-  RulerPtr ruler = new FixedRuler( 50.0f );
-  ruler->SetDomain( RulerDomain(0.0f, 400.0f, true) );
-
-  // default testing. (snap and clamp)
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(50.0f), 50.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(30.0f), 50.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(10.0f), 0.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(-40.0f), 0.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(390.0f), 400.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(430.0f), 400.0f, TEST_LOCATION);
-
-  // bias testing.
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(40.0f, 0.0f), 0.0f, TEST_LOCATION); // Flick Left
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(40.0f, 0.5f), 50.0f, TEST_LOCATION); // No Flick
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(40.0f, 1.0f), 50.0f, TEST_LOCATION); // Flick Right
-
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(20.0f, 0.0f), 0.0f, TEST_LOCATION); // Flick Left
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(20.0f, 0.5f), 0.0f, TEST_LOCATION); // No Flick
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(20.0f, 1.0f), 50.0f, TEST_LOCATION); // Flick Right
-
-  // length testing.
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(-10.0f, 0.5f, 10.0f), 0.0f, TEST_LOCATION); // 10 units long (over left boundary)
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(-5.0f, 0.5f, 10.0f), 0.0f, TEST_LOCATION); // 10 units long (slightly ovr left boundary)
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(300.0f, 0.5f, 10.0f), 300.0f, TEST_LOCATION); // 10 units long (not over a boundary)
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(395.0f, 0.5f, 10.0f), 390.0f, TEST_LOCATION); // 10 units long (slightly over right boundary)
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(500.0f, 0.5f, 10.0f), 390.0f, TEST_LOCATION); // 10 units long (over right boundary)
-
-  // scale testing.
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(-100.0f, 0.5f, 0.0f, 2.0f), 0.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(50.0f, 0.5f, 0.0f, 2.0f), 50.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(700.0f, 0.5f, 0.0f, 2.0f), 700.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(850.0f, 0.5f, 0.0f, 2.0f), 800.0f, TEST_LOCATION);
-
-  // clamp state testing.
-  ClampState clamped;
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(50.0f, 0.5f, 0.0f, 1.0f, clamped), 50.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(30.0f, 0.5f, 0.0f, 1.0f, clamped), 50.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(10.0f, 0.5f, 0.0f, 1.0f, clamped), 0.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(-40.0f, 0.5f, 0.0f, 1.0f, clamped), 0.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( clamped, ClampedToMin, TEST_LOCATION );
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(390.0f, 0.5f, 0.0f, 1.0f, clamped), 400.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
-  DALI_TEST_EQUALS( ruler->SnapAndClamp(430.0f, 0.5f, 0.0f, 1.0f, clamped), 400.0f, TEST_LOCATION);
-  DALI_TEST_EQUALS( clamped, ClampedToMax, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliRulerFixedRulerSpacing(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliRulerFixedRulerSpacing");
-
-  RulerPtr rulerNormal = new FixedRuler( 25.0f );
-  rulerNormal->SetDomain( RulerDomain(10.0f, 90.0f, true) );
-
-  unsigned int volume;
-  float position;
-
-  position = rulerNormal->GetPositionFromPage(1, volume, true);
-  DALI_TEST_EQUALS( position, 35.0f, TEST_LOCATION );
-  DALI_TEST_EQUALS( volume, 0u, TEST_LOCATION );
-
-  position = rulerNormal->GetPositionFromPage(2, volume, true);
-  DALI_TEST_EQUALS( position, 60.0f, TEST_LOCATION );
-  DALI_TEST_EQUALS( volume, 0u, TEST_LOCATION );
-  END_TEST;
-}
-
-int UtcDaliScrollViewOvershoot(void)
+int UtcDaliToolkitScrollViewOvershoot(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewOvershoot");
+  tet_infoline(" UtcDaliToolkitScrollViewOvershoot");
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
@@ -1018,10 +1118,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 +1129,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 +1143,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 +1157,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,18 +1172,18 @@ 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) );
   END_TEST;
 }
 
-int UtcDaliScrollViewSnapAlphaFunction(void)
+int UtcDaliToolkitScrollViewSnapAlphaFunction(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewSnapAlphaFunction");
+  tet_infoline(" UtcDaliToolkitScrollViewSnapAlphaFunction");
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
@@ -1098,10 +1198,10 @@ int UtcDaliScrollViewSnapAlphaFunction(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewSnapDuration(void)
+int UtcDaliToolkitScrollViewSnapDuration(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewSnapDuration");
+  tet_infoline(" UtcDaliToolkitScrollViewSnapDuration");
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
@@ -1117,10 +1217,10 @@ int UtcDaliScrollViewSnapDuration(void)
   END_TEST;
 }
 
-int UtcDaliScrollViewSignalsSnapStart(void)
+int UtcDaliToolkitScrollViewSnapStartedSignalP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewSignalsSnapStart");
+  tet_infoline(" UtcDaliToolkitScrollViewSnapStartedSignalP");
 
   // Set up a scrollView...
   ScrollView scrollView = ScrollView::New();
@@ -1156,27 +1256,493 @@ int UtcDaliScrollViewSignalsSnapStart(void)
   END_TEST;
 }
 
-
-int UtcDaliScrollViewSetMouseWheelScrollDistanceStep(void)
+int UtcDaliToolkitScrollViewGetCurrentPageP(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewSetMouseWheelScrollDistanceStep");
+  tet_infoline(" UtcDaliToolkitScrollViewGetCurrentPageP");
 
   ScrollView scrollView = ScrollView::New();
-  // Disable Refresh signal (TET environment cannot use adaptor's Timer)
-  scrollView.SetMouseWheelScrollDistanceStep(Vector2(30.0f, 15.0f));
-  DALI_TEST_EQUALS( scrollView.GetMouseWheelScrollDistanceStep(), Vector2(30.0f, 15.0f), TEST_LOCATION );
-  scrollView.SetMouseWheelScrollDistanceStep(Vector2(60.0f, 30.0f));
-  DALI_TEST_EQUALS( scrollView.GetMouseWheelScrollDistanceStep(), Vector2(60.0f, 30.0f), TEST_LOCATION);
-  END_TEST;
-}
-
-int UtcDaliScrollViewGetSet(void)
+  Stage::GetCurrent().Add( scrollView );
+  RulerPtr rulerX = new FixedRuler( 100.0f );
+  rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
+  RulerPtr rulerY = new FixedRuler( 100.0f );
+  rulerY->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+
+  scrollView.SetRulerX( rulerX );
+  scrollView.SetRulerY( rulerY );
+
+  scrollView.ScrollTo( 15 );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 15, TEST_LOCATION );
+
+  scrollView.ScrollTo( 3 );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 3, TEST_LOCATION );
+
+  scrollView.ScrollTo( 9 );
+  Wait(application, RENDER_DELAY_SCROLL);
+  DALI_TEST_EQUALS( static_cast<int>(scrollView.GetCurrentPage()), 9, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewSetMaxOvershootP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewSetMaxOvershootP");
+
+  // Set up a scrollView...
+  ScrollView scrollView = ScrollView::New();
+  Stage::GetCurrent().Add( scrollView );
+  Vector2 stageSize = Stage::GetCurrent().GetSize();
+  scrollView.SetSize(stageSize);
+  scrollView.SetParentOrigin(ParentOrigin::TOP_LEFT);
+  scrollView.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+
+  // Position rulers.
+  RulerPtr rulerX = new DefaultRuler();
+  RulerPtr rulerY = new DefaultRuler();
+  rulerX->SetDomain( RulerDomain(0.0f, stageSize.width + CLAMP_EXCESS_WIDTH, true) );
+  rulerY->SetDomain( RulerDomain(0.0f, stageSize.height + CLAMP_EXCESS_HEIGHT, true) );
+  scrollView.SetRulerX(rulerX);
+  scrollView.SetRulerY(rulerY);
+
+  // Set the max overshoot to be 50 pixels in both X axis and Y axis
+  scrollView.SetMaxOvershoot(50.0f, 50.0f);
+
+  scrollView.ScrollTo(OVERSHOOT_START_SCROLL_POSITION, 0.0f); // move in a little.
+  Wait(application);
+
+  // Scroll page in NW (-20,-20 pixels), then check that overshoot should be 0. (don't release touch)
+  Vector2 currentPos = PerformGestureDiagonalSwipe(application, OVERSHOOT_START_SCROLL_POSITION, Vector2(1.0f, 1.0f), 20, false);
+  float overshootXValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_X);
+  float overshootYValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_Y);
+  DALI_TEST_EQUALS(overshootXValue, 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS(overshootYValue, 0.0f, TEST_LOCATION);
+
+  // Scroll page further in NW (-105,-105 pixels), then check that overshoot should be around 0.5. (don't release touch)
+  currentPos = PerformGestureDiagonalSwipe(application, OVERSHOOT_START_SCROLL_POSITION, Vector2(1.0f, 1.0f), 105, false);
+  overshootXValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_X);
+  overshootYValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_Y);
+  DALI_TEST_CHECK(overshootXValue > 0.49f && overshootXValue < 0.51f);
+  DALI_TEST_CHECK(overshootYValue > 0.49f && overshootYValue < 0.51f);
+
+  // Scroll page further in NW (-30,-30 pixels), then check that overshoot should be now 1.0. (don't release touch)
+  currentPos = PerformGestureDiagonalSwipe(application, OVERSHOOT_START_SCROLL_POSITION, Vector2(1.0f, 1.0f), 30, false);
+  overshootXValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_X);
+  overshootYValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_Y);
+  DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION);
+
+  // Change the max overshoot to be 100 pixels in both X axis and Y axis
+  scrollView.SetMaxOvershoot(100.0f, 100.0f);
+  Wait(application);
+
+  // Check that overshoot should be now around 0.8.
+  overshootXValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_X);
+  overshootYValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_Y);
+  DALI_TEST_CHECK(overshootXValue > 0.79f && overshootXValue < 0.81f);
+  DALI_TEST_CHECK(overshootYValue > 0.79f && overshootYValue < 0.81f);
+
+  // Scroll page further in NW (-30,-30 pixels), then check that overshoot should be now 1.0. (don't release touch)
+  currentPos = PerformGestureDiagonalSwipe(application, OVERSHOOT_START_SCROLL_POSITION, Vector2(1.0f, 1.0f), 30, false);
+  overshootXValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_X);
+  overshootYValue = scrollView.GetProperty<float>(ScrollView::Property::OVERSHOOT_Y);
+  DALI_TEST_EQUALS(overshootXValue, 1.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS(overshootYValue, 1.0f, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewSetScrollingDirectionP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewSetScrollingDirectionP");
+
+  // Set up a scrollView...
+  ScrollView scrollView = ScrollView::New();
+  Stage::GetCurrent().Add( scrollView );
+  Vector2 stageSize = Stage::GetCurrent().GetSize();
+  scrollView.SetSize(stageSize);
+  scrollView.SetParentOrigin(ParentOrigin::TOP_LEFT);
+  scrollView.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+
+  Vector2 START_POSITION = Vector2(10.0f, 10.0f);
+
+  scrollView.ScrollTo(START_POSITION, 0.0f);
+  Wait(application);
+  // Try a vertical swipe.
+  PerformGestureDiagonalSwipe(application, START_POSITION, Vector2(0.0f, 1.0f), 60, true);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(10.0f, -50.0f), TEST_LOCATION );
+
+  scrollView.SetScrollingDirection(Dali::PanGestureDetector::DIRECTION_VERTICAL);
+
+  scrollView.ScrollTo(START_POSITION, 0.0f);
+  Wait(application);
+  // Try a vertical swipe.
+  PerformGestureDiagonalSwipe(application, START_POSITION, Vector2(0.0f, 1.0f), 60, true);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), START_POSITION, TEST_LOCATION );
+
+  scrollView.RemoveScrollingDirection(Dali::PanGestureDetector::DIRECTION_VERTICAL);
+
+  scrollView.ScrollTo(Vector2(10.0f, 10.0f), 0.0f);
+  Wait(application);
+  // Try a vertical swipe.
+  PerformGestureDiagonalSwipe(application, START_POSITION, Vector2(0.0f, 1.0f), 60, true);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(10.0f, -50.0f), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRemoveScrollingDirectionP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewRemoveScrollingDirectionP");
+
+  // Set up a scrollView...
+  ScrollView scrollView = ScrollView::New();
+  Stage::GetCurrent().Add( scrollView );
+  Vector2 stageSize = Stage::GetCurrent().GetSize();
+  scrollView.SetSize(stageSize);
+  scrollView.SetParentOrigin(ParentOrigin::TOP_LEFT);
+  scrollView.SetAnchorPoint(AnchorPoint::TOP_LEFT);
+
+  Vector2 START_POSITION = Vector2(10.0f, 10.0f);
+
+  scrollView.SetScrollingDirection(Dali::PanGestureDetector::DIRECTION_VERTICAL);
+
+  scrollView.ScrollTo(START_POSITION, 0.0f);
+  Wait(application);
+  // Try a vertical swipe.
+  PerformGestureDiagonalSwipe(application, START_POSITION, Vector2(0.0f, 1.0f), 60, true);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), START_POSITION, TEST_LOCATION );
+
+  scrollView.RemoveScrollingDirection(Dali::PanGestureDetector::DIRECTION_VERTICAL);
+
+  scrollView.ScrollTo(Vector2(10.0f, 10.0f), 0.0f);
+  Wait(application);
+  // Try a vertical swipe.
+  PerformGestureDiagonalSwipe(application, START_POSITION, Vector2(0.0f, 1.0f), 60, true);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(10.0f, -50.0f), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewSetRulerXP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewSetRulerXP");
+
+  ScrollView scrollView = ScrollView::New();
+  Stage::GetCurrent().Add( scrollView );
+  RulerPtr rulerX = new FixedRuler( 100.0f );
+  rulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
+
+  scrollView.SetRulerX( rulerX );
+
+  scrollView.ScrollTo( 1, 0.0f );
+  Wait(application);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(100.0f, 0.0f), TEST_LOCATION );
+
+  RulerPtr newRulerX = new FixedRuler( 200.0f );
+  newRulerX->SetDomain( RulerDomain(0.0f, 800.0f, true) );
+
+  scrollView.SetRulerX( newRulerX );
+
+  scrollView.ScrollTo( 1, 0.0f );
+  Wait(application);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(200.0f, 0.0f), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewSetRulerYP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewSetRulerYP");
+
+  ScrollView scrollView = ScrollView::New();
+  Stage::GetCurrent().Add( scrollView );
+
+  RulerPtr rulerY = new FixedRuler( 200.0f );
+  rulerY->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+
+  scrollView.SetRulerY( rulerY );
+
+  scrollView.ScrollTo( Vector2(0.0f, 350.0f), 0.0f );
+  Wait(application);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 350.0f), TEST_LOCATION );
+
+  RulerPtr newRulerY = new FixedRuler( 100.0f );
+  newRulerY->SetDomain( RulerDomain(0.0f, 200.0f, true) );
+  scrollView.SetRulerY( newRulerY );
+
+  scrollView.ScrollTo( Vector2(0.0f, 350.0f), 0.0f );
+  Wait(application);
+  DALI_TEST_EQUALS( scrollView.GetCurrentScrollPosition(), Vector2(0.0f, 200.0f), TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewSetMinimumSpeedForFlickP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewSetMinimumSpeedForFlickP");
+
+  ScrollView scrollView = ScrollView::New();
+  scrollView.SetMinimumSpeedForFlick(25.0f);
+  DALI_TEST_EQUALS( scrollView.GetMinimumSpeedForFlick(), 25.0f, TEST_LOCATION );
+  scrollView.SetMinimumSpeedForFlick(60.0f);
+  DALI_TEST_EQUALS( scrollView.GetMinimumSpeedForFlick(), 60.0f, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewSetMinimumDistanceForFlickP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewSetMinimumDistanceForFlick");
+
+  ScrollView scrollView = ScrollView::New();
+
+  scrollView.SetMinimumDistanceForFlick(Vector2(30.0f, 15.0f));
+  DALI_TEST_EQUALS( scrollView.GetMinimumDistanceForFlick(), Vector2(30.0f, 15.0f), TEST_LOCATION );
+  scrollView.SetMinimumDistanceForFlick(Vector2(60.0f, 30.0f));
+  DALI_TEST_EQUALS( scrollView.GetMinimumDistanceForFlick(), Vector2(60.0f, 30.0f), TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewSetMouseWheelScrollDistanceStepP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewSetMouseWheelScrollDistanceStepP");
+
+  ScrollView scrollView = ScrollView::New();
+  // Disable Refresh signal (TET environment cannot use adaptor's Timer)
+  scrollView.SetMouseWheelScrollDistanceStep(Vector2(30.0f, 15.0f));
+  DALI_TEST_EQUALS( scrollView.GetMouseWheelScrollDistanceStep(), Vector2(30.0f, 15.0f), TEST_LOCATION );
+  scrollView.SetMouseWheelScrollDistanceStep(Vector2(60.0f, 30.0f));
+  DALI_TEST_EQUALS( scrollView.GetMouseWheelScrollDistanceStep(), Vector2(60.0f, 30.0f), TEST_LOCATION);
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewApplyEffectP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewApplyEffectP");
+
+  // Create a ScrollView
+  ScrollView scrollView = ScrollView::New();
+
+  // Create two scroll view effects
+  Dali::Path path = Dali::Path::New();
+  ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
+  ScrollViewEffect newEffect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 1.0f, 1.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(200.0f, 150.0f, 0.0f), 5);
+
+  // Apply both effects
+  scrollView.ApplyEffect(effect);
+  scrollView.ApplyEffect(newEffect);
+
+  DALI_TEST_CHECK( true );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewApplyEffectN(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewApplyEffectN");
+
+  // Create a ScrollView
+  ScrollView scrollView = ScrollView::New();
+
+  // Create two scroll view effects
+  Dali::Path path = Dali::Path::New();
+  ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
+  ScrollViewEffect newEffect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 1.0f, 1.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(200.0f, 150.0f, 0.0f), 5);
+
+  // Apply both effects
+  scrollView.ApplyEffect(effect);
+  scrollView.ApplyEffect(newEffect);
+
+  // Attempt to apply the same effect again
+  try
+  {
+    scrollView.ApplyEffect(newEffect);
+    tet_result( TET_FAIL );
+  }
+  catch ( DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "!effectAlreadyExistsInScrollView", TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRemoveEffectP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewRemoveEffectP");
+
+  // Create a ScrollView
+  ScrollView scrollView = ScrollView::New();
+
+  // Create two scroll view effects
+  Dali::Path path = Dali::Path::New();
+  ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
+  ScrollViewEffect newEffect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 1.0f, 1.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(200.0f, 150.0f, 0.0f), 5);
+
+  // Apply both effects
+  scrollView.ApplyEffect(effect);
+  scrollView.ApplyEffect(newEffect);
+
+  // Remove both effects
+  scrollView.RemoveEffect(effect);
+  scrollView.RemoveEffect(newEffect);
+
+  DALI_TEST_CHECK( true );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRemoveEffectN(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewRemoveEffectN");
+
+  // Create a ScrollView
+  ScrollView scrollView = ScrollView::New();
+
+  // Create two scroll view effects
+  Dali::Path path = Dali::Path::New();
+  ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
+  ScrollViewEffect newEffect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 1.0f, 1.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(200.0f, 150.0f, 0.0f), 5);
+
+  // Apply the first effect
+  scrollView.ApplyEffect(effect);
+
+  // Attempt to remove the second effect which has not been applied to scroll view
+  try
+  {
+    scrollView.RemoveEffect(newEffect);
+    tet_result( TET_FAIL );
+  }
+  catch ( DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "effectExistedInScrollView", TEST_LOCATION );
+  }
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRemoveAllEffectsP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewRemoveAllEffectsP");
+
+  // Create a ScrollView
+  ScrollView scrollView = ScrollView::New();
+
+  // Create two scroll view effects
+  Dali::Path path = Dali::Path::New();
+  ScrollViewEffect effect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 0.0f, 0.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(100.0f, 100.0f, 0.0f), 2);
+  ScrollViewEffect newEffect = ScrollViewPagePathEffect::New(path, Vector3(-1.0f, 1.0f, 1.0f), Toolkit::ScrollView::Property::SCROLL_FINAL_X, Vector3(200.0f, 150.0f, 0.0f), 5);
+
+  // Apply both effects
+  scrollView.ApplyEffect(effect);
+  scrollView.ApplyEffect(newEffect);
+
+  // Attempt to apply the same first effect again
+  try
+  {
+    scrollView.ApplyEffect(effect);
+    tet_result( TET_FAIL );
+  }
+  catch ( DaliException& e )
+  {
+    DALI_TEST_ASSERT( e, "!effectAlreadyExistsInScrollView", TEST_LOCATION );
+  }
+
+  // Remove both effects
+  scrollView.RemoveAllEffects();
+
+  // Apply both effects again
+  scrollView.ApplyEffect(effect);
+  scrollView.ApplyEffect(newEffect);
+
+  DALI_TEST_CHECK( true );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRemoveAllEffectsN(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewRemoveAllEffectsN");
+
+  // Create a ScrollView
+  ScrollView scrollView = ScrollView::New();
+
+  // Remove effects when there is no effect applied previously
+  scrollView.RemoveAllEffects();
+
+  DALI_TEST_CHECK( true );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewSetOvershootEnabledP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewSetOvershootEnabledP");
+
+  ScrollView scrollView = ScrollView::New();
+
+  scrollView.SetOvershootEnabled(true);
+  DALI_TEST_CHECK(scrollView.IsOvershootEnabled());
+
+  scrollView.SetOvershootEnabled(false);
+  DALI_TEST_CHECK(!scrollView.IsOvershootEnabled());
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewSetOvershootEffectColorP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewSetOvershootEffectColorP");
+
+  ScrollView scrollView = ScrollView::New();
+
+  scrollView.SetOvershootEffectColor(Dali::Color::RED);
+  DALI_TEST_EQUALS(scrollView.GetOvershootEffectColor(), Dali::Color::RED, TEST_LOCATION);
+
+  scrollView.SetOvershootEffectColor(Dali::Color::YELLOW);
+  DALI_TEST_EQUALS(scrollView.GetOvershootEffectColor(), Dali::Color::YELLOW, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewSetOvershootAnimationSpeedP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewSetOvershootAnimationSpeedP");
+
+  ScrollView scrollView = ScrollView::New();
+
+  scrollView.SetOvershootAnimationSpeed(55.0f);
+  DALI_TEST_EQUALS(scrollView.GetOvershootAnimationSpeed(), 55.0f, TEST_LOCATION);
+
+  scrollView.SetOvershootAnimationSpeed(120.0f);
+  DALI_TEST_EQUALS(scrollView.GetOvershootAnimationSpeed(), 120.0f, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewGetSet(void)
 {
   ToolkitTestApplication application;
-  tet_infoline(" UtcDaliScrollViewGetSet");
+  tet_infoline(" UtcDaliToolkitScrollViewGetSet");
   ScrollView scrollView = ScrollView::New();
-  scrollView.SetMaxOvershoot(50.0f, 50.0f);
   scrollView.SetMaxFlickSpeed(0.5f);
   DALI_TEST_EQUALS(scrollView.GetMaxFlickSpeed(), 0.5f, Math::MACHINE_EPSILON_0, TEST_LOCATION);
   scrollView.SetFrictionCoefficient(0.6f);
@@ -1185,3 +1751,441 @@ int UtcDaliScrollViewGetSet(void)
   DALI_TEST_EQUALS(scrollView.GetFlickSpeedCoefficient(), 0.7f, Math::MACHINE_EPSILON_0, TEST_LOCATION);
   END_TEST;
 }
+
+int UtcDaliToolkitScrollViewRulerDomainConstructorP(void)
+{
+  ToolkitTestApplication application;
+
+  RulerDomain domainX = RulerDomain(0.0f, 200.0f, true);
+  DALI_TEST_EQUALS( domainX.min, 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( domainX.max, 200.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( domainX.enabled, true, TEST_LOCATION);
+
+  RulerDomain domainY = RulerDomain(100.0f, 500.0f, false);
+  DALI_TEST_EQUALS( domainY.min, 100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( domainY.max, 500.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( domainY.enabled, false, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRulerDomainGetSizeP(void)
+{
+  ToolkitTestApplication application;
+
+  RulerDomain domainX = RulerDomain(0.0f, 200.0f, true);
+  DALI_TEST_EQUALS( domainX.GetSize(), 200.0f, TEST_LOCATION);
+
+  RulerDomain domainY = RulerDomain(100.0f, 500.0f, false);
+  DALI_TEST_EQUALS( domainY.GetSize(), 400.0f, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRulerDomainClampP(void)
+{
+  ToolkitTestApplication application;
+
+  RulerDomain domainX = RulerDomain(0.0f, 200.0f, true);
+
+  float value = domainX.Clamp(50.0f, 100.0f, 1.0f);
+  DALI_TEST_EQUALS( value, 50.0f, TEST_LOCATION);
+
+  value = domainX.Clamp(300.0f, 20.0f, 1.0f);
+  DALI_TEST_EQUALS( value, 180.0f, TEST_LOCATION);
+
+  value = domainX.Clamp(300.0f, 20.0f, 0.5f);
+  DALI_TEST_EQUALS( value, 80.0f, TEST_LOCATION);
+
+  value = domainX.Clamp(250.0f, 200.0f, 2.0f);
+  DALI_TEST_EQUALS( value, 200.0f, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRulerDomainClampWithStateP(void)
+{
+  ToolkitTestApplication application;
+
+  RulerDomain domainX = RulerDomain(0.0f, 200.0f, true);
+
+  ClampState clamped;
+  float value = domainX.Clamp(50.0f, 100.0f, 1.0f, clamped);
+  DALI_TEST_EQUALS( value, 50.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( clamped, Dali::Toolkit::NotClamped, TEST_LOCATION);
+
+  value = domainX.Clamp(-100.0f, 200.0f, 1.0f, clamped);
+  DALI_TEST_EQUALS( value, 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( clamped, Dali::Toolkit::ClampedToMin, TEST_LOCATION);
+
+  value = domainX.Clamp(300.0f, 20.0f, 1.0f, clamped);
+  DALI_TEST_EQUALS( value, 180.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( clamped, Dali::Toolkit::ClampedToMax, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewDefaultRulerConstructorP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewDefaultRulerConstructorP");
+
+  RulerPtr defaultRuler = new DefaultRuler();
+  DALI_TEST_CHECK( defaultRuler );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewDefaultRulerDestructorP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewDefaultRulerDestructorP");
+
+  RulerPtr defaultRuler = new DefaultRuler();
+
+  DALI_TEST_CHECK( true );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewFixedRulerConstructorP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewFixedRulerConstructorP");
+
+  RulerPtr fixedRuler = new FixedRuler( 100.0f );
+  DALI_TEST_CHECK( fixedRuler );
+
+  fixedRuler = new FixedRuler( 0.0f );
+  DALI_TEST_CHECK( fixedRuler );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewFixedRulerDestructorP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewFixedRulerDestructorP");
+
+  RulerPtr fixedRuler = new FixedRuler( 100.0f );
+
+  DALI_TEST_CHECK( true );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRulerGetTypeP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewRulerGetTypeP");
+
+  RulerPtr defaultRuler = new DefaultRuler();
+  DALI_TEST_CHECK( defaultRuler );
+  DALI_TEST_EQUALS( defaultRuler->GetType(), Dali::Toolkit::Ruler::Free, TEST_LOCATION);
+
+  RulerPtr fixedRuler = new FixedRuler( 100.0f );
+  DALI_TEST_CHECK( fixedRuler );
+  DALI_TEST_EQUALS( fixedRuler->GetType(), Dali::Toolkit::Ruler::Fixed, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRulerGetExtensionP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewRulerGetExtensionP");
+
+  RulerPtr defaultRuler = new DefaultRuler();
+  DALI_TEST_CHECK( defaultRuler );
+  DALI_TEST_CHECK( !defaultRuler->GetExtension() );
+
+  RulerPtr fixedRuler = new FixedRuler( 100.0f );
+  DALI_TEST_CHECK( fixedRuler );
+  DALI_TEST_CHECK( !fixedRuler->GetExtension() );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRulerEnableDisable(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewRulerEnableDisable");
+
+  RulerPtr ruler = new DefaultRuler();
+
+  DALI_TEST_CHECK( ruler->IsEnabled() );
+  ruler->Disable();
+  DALI_TEST_CHECK( !ruler->IsEnabled() );
+  ruler->Enable();
+  DALI_TEST_CHECK( ruler->IsEnabled() );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRulerDomainEnableDisable(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewRulerDomainEnableDisable");
+
+  RulerPtr ruler = new DefaultRuler();
+  DALI_TEST_EQUALS( ruler->GetDomain().GetSize(), 1.0f, TEST_LOCATION );
+
+  ruler->SetDomain( RulerDomain(0.0f, 100.0f, true) );
+  DALI_TEST_EQUALS( ruler->GetDomain().GetSize(), 100.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( ruler->Clamp(-200.0f), 0.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( ruler->Clamp(200.0f), 100.0f, TEST_LOCATION );
+
+  ruler->DisableDomain();
+  DALI_TEST_EQUALS( ruler->GetDomain().GetSize(), 1.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( ruler->Clamp(-200.0f), -200.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( ruler->Clamp(200.0f), 200.0f, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewRulerSnapAndClamp(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewRulerSnapAndClamp");
+
+  RulerPtr ruler = new FixedRuler( 50.0f );
+  ruler->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+
+  // default testing. (snap and clamp)
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(50.0f), 50.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(30.0f), 50.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(10.0f), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(-40.0f), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(390.0f), 400.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(430.0f), 400.0f, TEST_LOCATION);
+
+  // bias testing.
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(40.0f, 0.0f), 0.0f, TEST_LOCATION); // Flick Left
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(40.0f, 0.5f), 50.0f, TEST_LOCATION); // No Flick
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(40.0f, 1.0f), 50.0f, TEST_LOCATION); // Flick Right
+
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(20.0f, 0.0f), 0.0f, TEST_LOCATION); // Flick Left
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(20.0f, 0.5f), 0.0f, TEST_LOCATION); // No Flick
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(20.0f, 1.0f), 50.0f, TEST_LOCATION); // Flick Right
+
+  // length testing.
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(-10.0f, 0.5f, 10.0f), 0.0f, TEST_LOCATION); // 10 units long (over left boundary)
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(-5.0f, 0.5f, 10.0f), 0.0f, TEST_LOCATION); // 10 units long (slightly ovr left boundary)
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(300.0f, 0.5f, 10.0f), 300.0f, TEST_LOCATION); // 10 units long (not over a boundary)
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(395.0f, 0.5f, 10.0f), 390.0f, TEST_LOCATION); // 10 units long (slightly over right boundary)
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(500.0f, 0.5f, 10.0f), 390.0f, TEST_LOCATION); // 10 units long (over right boundary)
+
+  // scale testing.
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(-100.0f, 0.5f, 0.0f, 2.0f), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(50.0f, 0.5f, 0.0f, 2.0f), 50.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(700.0f, 0.5f, 0.0f, 2.0f), 700.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(850.0f, 0.5f, 0.0f, 2.0f), 800.0f, TEST_LOCATION);
+
+  // clamp state testing.
+  ClampState clamped;
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(50.0f, 0.5f, 0.0f, 1.0f, clamped), 50.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(30.0f, 0.5f, 0.0f, 1.0f, clamped), 50.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(10.0f, 0.5f, 0.0f, 1.0f, clamped), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(-40.0f, 0.5f, 0.0f, 1.0f, clamped), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( clamped, ClampedToMin, TEST_LOCATION );
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(390.0f, 0.5f, 0.0f, 1.0f, clamped), 400.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( clamped, NotClamped, TEST_LOCATION );
+  DALI_TEST_EQUALS( ruler->SnapAndClamp(430.0f, 0.5f, 0.0f, 1.0f, clamped), 400.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( clamped, ClampedToMax, TEST_LOCATION );
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewFixedRulerGetPositionFromPageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewFixedRulerGetPositionFromPageP");
+
+  RulerPtr rulerNormal = new FixedRuler( 25.0f );
+  rulerNormal->SetDomain( RulerDomain(10.0f, 90.0f, true) );
+
+  unsigned int volume;
+  float position;
+
+  position = rulerNormal->GetPositionFromPage(1, volume, true);
+  DALI_TEST_EQUALS( position, 35.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( volume, 0u, TEST_LOCATION );
+
+  position = rulerNormal->GetPositionFromPage(2, volume, true);
+  DALI_TEST_EQUALS( position, 60.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( volume, 0u, TEST_LOCATION );
+
+  // Disable the ruler
+  rulerNormal->Disable();
+
+  position = rulerNormal->GetPositionFromPage(1, volume, true);
+  DALI_TEST_EQUALS( position, 10.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( volume, 1u, TEST_LOCATION );
+
+  position = rulerNormal->GetPositionFromPage(2, volume, true);
+  DALI_TEST_EQUALS( position, 10.0f, TEST_LOCATION );
+  DALI_TEST_EQUALS( volume, 2u, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewDefaultRulerGetTotalPagesP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewDefaultRulerGetTotalPagesP");
+
+  RulerPtr defaultRuler = new DefaultRuler();
+  DALI_TEST_CHECK( defaultRuler );
+  DALI_TEST_EQUALS( defaultRuler->GetTotalPages(), 1u, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewDefaultRulerGetPageFromPositionP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewDefaultRulerGetPageFromPositionP");
+
+  RulerPtr defaultRuler = new DefaultRuler();
+  DALI_TEST_CHECK( defaultRuler );
+  DALI_TEST_EQUALS( defaultRuler->GetPageFromPosition(100.0f, true), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS( defaultRuler->GetPageFromPosition(-300.0f, false), 0u, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewDefaultRulerGetPositionFromPageP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewDefaultRulerGetPositionFromPageP");
+
+  RulerPtr defaultRuler = new DefaultRuler();
+  DALI_TEST_CHECK( defaultRuler );
+
+  unsigned int volume;
+  DALI_TEST_EQUALS( defaultRuler->GetPositionFromPage(0, volume, true), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( volume, 0u, TEST_LOCATION);
+
+  DALI_TEST_EQUALS( defaultRuler->GetPositionFromPage(3, volume, false), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( volume, 0u, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewDefaultRulerSnapP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewDefaultRulerSnapP");
+
+  RulerPtr defaultRuler = new DefaultRuler();
+  DALI_TEST_CHECK( defaultRuler );
+
+  DALI_TEST_EQUALS( defaultRuler->Snap(50.0f, 0.5f), 50.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( defaultRuler->Snap(-120.0f, 1.0f), -120.0f, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewFixedRulerGetTotalPagesP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewFixedRulerGetTotalPagesP");
+
+  RulerPtr fixedRuler = new FixedRuler( 100.0f );
+  fixedRuler->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+
+  fixedRuler->Enable();
+  DALI_TEST_EQUALS( fixedRuler->GetTotalPages(), 4u, TEST_LOCATION);
+
+  fixedRuler->Disable();
+  DALI_TEST_EQUALS( fixedRuler->GetTotalPages(), 1u, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewFixedRulerGetPageFromPositionP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewFixedRulerGetPageFromPositionP");
+
+  RulerPtr fixedRuler = new FixedRuler( 100.0f );
+  fixedRuler->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+
+  fixedRuler->Enable();
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, true), 3u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, false), 3u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, true), 1u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
+
+  fixedRuler->Disable();
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, true), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, false), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
+
+  // Set domain size to be smaller than the ruler space
+  fixedRuler->SetDomain( RulerDomain(0.0f, 50.0f, true) );
+
+  fixedRuler->Enable();
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, true), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, false), 3u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
+
+  fixedRuler->Disable();
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, true), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(250.0f, false), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, true), 0u, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->GetPageFromPosition(-350.0f, false), 0u, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliToolkitScrollViewFixedRulerSnapP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliToolkitScrollViewFixedRulerSnapP");
+
+  RulerPtr fixedRuler = new FixedRuler( 100.0f );
+  fixedRuler->SetDomain( RulerDomain(0.0f, 400.0f, true) );
+
+  DALI_TEST_EQUALS( fixedRuler->Snap(-30.0f, 0.0f), -100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(-70.0f, 0.0f), -100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(-120.0f, 0.0f), -200.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(-480.0f, 0.0f), -500.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(20.0f, 0.0f), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(50.0f, 0.0f), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(80.0f, 0.0f), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(100.0f, 0.0f), 100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(120.0f, 0.0f), 100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(250.0f, 0.0f), 200.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(620.0f, 0.0f), 600.0f, TEST_LOCATION);
+
+  DALI_TEST_EQUALS( fixedRuler->Snap(-30.0f, 0.5f), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(-70.0f, 0.5f), -100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(-120.0f, 0.5f), -100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(-480.0f, 0.5f), -500.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(20.0f, 0.5f), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(50.0f, 0.5f), 100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(80.0f, 0.5f), 100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(100.0f, 0.5f), 100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(120.0f, 0.5f), 100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(250.0f, 0.5f), 300.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(620.0f, 0.5f), 600.0f, TEST_LOCATION);
+
+  DALI_TEST_EQUALS( fixedRuler->Snap(-30.0f, 1.0f), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(-70.0f, 1.0f), 0.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(-120.0f, 1.0f), -100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(-480.0f, 1.0f), -400.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(20.0f, 1.0f), 100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(50.0f, 1.0f), 100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(80.0f, 1.0f), 100.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(100.0f, 1.0f), 200.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(120.0f, 1.0f), 200.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(250.0f, 1.0f), 300.0f, TEST_LOCATION);
+  DALI_TEST_EQUALS( fixedRuler->Snap(620.0f, 1.0f), 700.0f, TEST_LOCATION);
+
+  END_TEST;
+}
+
+
+
+
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 edc71f3..78ff25f 100644 (file)
@@ -19,6 +19,8 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h>
+
 
 using namespace Dali;
 using namespace Dali::Toolkit;
index fc2d922..b79af6f 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/shear-effect.h>
 
 using namespace Dali;
 
index 89090da..4025514 100644 (file)
@@ -20,7 +20,7 @@
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/integration-api/events/touch-event-integ.h>
-
+#include <dali-toolkit/devel-api/controls/slider/slider.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -134,7 +134,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 );
index ec39782..e2bcc25 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/soft-button-effect.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
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 99a2edb..a6aee80 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/spot-effect.h>
 
 
 using namespace Dali;
index 9b8e194..625ffe8 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/square-dissolve-effect.h>
 
 
 using namespace Dali;
index 97ffeed..98a4d0b 100644 (file)
@@ -19,7 +19,7 @@
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/integration-api/events/touch-event-integ.h>
-#include <dali-toolkit/public-api/styling/style-manager.h>
+#include <dali-toolkit/devel-api/styling/style-manager.h>
 
 
 using namespace Dali;
index ed651ad..de9a7d5 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -207,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 debe183..f9b6487 100644 (file)
@@ -24,6 +24,8 @@
 
 #include <dali.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/swirl-effect.h>
+
 
 using namespace Dali;
 
index 45dd92c..8e6bffa 100644 (file)
@@ -41,6 +41,7 @@ const char* const PROPERTY_NAME_COLUMNS = "columns";
 const char* const PROPERTY_NAME_CELL_PADDING = "cell-padding";
 const char* const PROPERTY_NAME_LAYOUT_ROWS = "layout-rows";
 const char* const PROPERTY_NAME_LAYOUT_COLUMNS = "layout-columns";
+const Vector2 CELL_SIZE( 10, 10 );
 
 static bool gObjectCreatedCallBackCalled;
 
@@ -77,9 +78,9 @@ static void SetupTableViewAndActors(TableView& tableView, Actor& actor1, Actor&
   actor2 = Actor::New();
   actor3 = Actor::New();
 
-  actor1.SetSize( Dali::Vector2( 10, 10 ) );
-  actor2.SetSize( Dali::Vector2( 10, 10 ) );
-  actor3.SetSize( Dali::Vector2( 10, 10 ) );
+  actor1.SetSize( CELL_SIZE );
+  actor2.SetSize( CELL_SIZE );
+  actor3.SetSize( CELL_SIZE );
 
   tableView.AddChild( actor1, TableView::CellPosition( 0, 0 ) );
   tableView.AddChild( actor2, TableView::CellPosition( 0, 1 ) );
@@ -88,6 +89,17 @@ static void SetupTableViewAndActors(TableView& tableView, Actor& actor1, Actor&
 
 } // namespace
 
+int UtcDaliTableViewCtorCopyP(void)
+{
+  TestApplication application;
+
+  TableView actor1 = TableView::New(10,10);
+  TableView actor2( actor1 );
+
+  DALI_TEST_EQUALS( actor1, actor2, TEST_LOCATION );
+  END_TEST;
+}
+
 int UtcDaliTableViewNew(void)
 {
   ToolkitTestApplication application;
@@ -143,6 +155,42 @@ int UtcDaliTableViewMetricsPadding(void)
 }
 
 // Test adjusting the metric values for the cell.
+int UtcDaliTableViewMetricsFit(void)
+{
+  ToolkitTestApplication application;
+
+  tet_infoline("UtcDaliTableViewMetricsFit");
+
+  TableView tableView;
+  Actor actor1;
+  Actor actor2;
+  Actor actor3;
+
+  SetupTableViewAndActors(tableView, actor1, actor2, actor3);
+  application.SendNotification();
+  application.Render();
+
+  // 1. check that with no fixed width/heights, actors are in default position.
+  DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
+
+  // 2. check that with a fixed width & height, actors to the right and below are offsetted.
+  tableView.SetFitHeight(0);
+  tableView.SetFitWidth(0);
+  DALI_TEST_EQUALS( tableView.IsFitHeight(0), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( tableView.IsFitWidth(0), true, TEST_LOCATION );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( actor1.GetCurrentPosition(), Vector3(0.0f, 0.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor2.GetCurrentPosition(), Vector3(10.0f, 0.0f, 0.0f), TEST_LOCATION );
+  DALI_TEST_EQUALS( actor3.GetCurrentPosition(), Vector3(0.0f, 10.0f, 0.0f), TEST_LOCATION );
+  END_TEST;
+}
+
+// Test adjusting the metric values for the cell.
 int UtcDaliTableViewMetricsFixed(void)
 {
   ToolkitTestApplication application;
@@ -390,6 +438,10 @@ int UtcDaliTableViewCells(void)
   tableView.AddChild(actor1, TableView::CellPosition(110, 110, 5, 5));
   DALI_TEST_CHECK( tableView.GetRows() == 115 && tableView.GetColumns() == 115 );
 
+  // Set the alignment of the cell
+  tableView.SetCellAlignment( TableView::CellPosition(100, 100, 1, 1), HorizontalAlignment::CENTER, VerticalAlignment::CENTER );
+  tableView.SetCellAlignment( TableView::CellPosition(110, 110, 5, 5), HorizontalAlignment::LEFT, VerticalAlignment::TOP );
+
   DALI_TEST_CHECK( true );
   END_TEST;
 }
index bf3111d..a8be49e 100644 (file)
 
 #include <iostream>
 #include <stdlib.h>
+#include <dali/integration-api/events/key-event-integ.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/styling/style-manager.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -53,6 +55,15 @@ const char* const PROPERTY_NAME_DECORATION_BOUNDING_BOX = "decoration-bounding-b
 const char* const PROPERTY_NAME_HORIZONTAL_ALIGNMENT    = "horizontal-alignment";
 const char* const PROPERTY_NAME_VERTICAL_ALIGNMENT      = "vertical-alignment";
 
+static bool gMaxCharactersCallBackCalled;
+
+static void TestMaxLengthReachedCallback( TextField control )
+{
+  tet_infoline(" TestMaxLengthReachedCallbackCallback");
+
+  gMaxCharactersCallBackCalled = true;
+}
+
 } // namespace
 
 int UtcDaliToolkitTextFieldConstructorP(void)
@@ -321,3 +332,71 @@ int utcDaliTextFieldAtlasRenderP(void)
   END_TEST;
 }
 
+// Positive test for Max Characters reached signal.
+int utcDaliTextFieldMaxCharactersReachedP(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldMaxCharactersReachedP");
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+
+  Stage::GetCurrent().Add(field);
+
+  const int maxNumberOfCharacters = 1;
+  field.SetProperty( TextField::Property::MAX_LENGTH, maxNumberOfCharacters );
+
+  field.SetKeyInputFocus();
+
+  gMaxCharactersCallBackCalled = false;
+  field.MaxLengthReachedSignal().Connect(&TestMaxLengthReachedCallback);
+
+  Dali::Integration::KeyEvent keyevent;
+  keyevent.keyName = "a";
+  keyevent.keyString = "a";
+  keyevent.keyCode = 0;
+  keyevent.keyModifier = 0;
+  keyevent.time = 0;
+  keyevent.state = Integration::KeyEvent::Down;
+
+  application.ProcessEvent( keyevent );
+
+  application.ProcessEvent( keyevent );
+
+  DALI_TEST_CHECK( gMaxCharactersCallBackCalled );
+
+  END_TEST;
+}
+
+// Negative test for Max Characters reached signal.
+int utcDaliTextFieldMaxCharactersReachedN(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldMaxCharactersReachedN");
+  TextField field = TextField::New();
+  DALI_TEST_CHECK( field );
+
+  Stage::GetCurrent().Add(field);
+
+  const int maxNumberOfCharacters = 3;
+  field.SetProperty( TextField::Property::MAX_LENGTH, maxNumberOfCharacters );
+
+  field.SetKeyInputFocus();
+
+  gMaxCharactersCallBackCalled = false;
+  field.MaxLengthReachedSignal().Connect(&TestMaxLengthReachedCallback);
+
+  Dali::Integration::KeyEvent keyevent;
+  keyevent.keyName = "a";
+  keyevent.keyString = "a";
+  keyevent.keyCode = 0;
+  keyevent.keyModifier = 0;
+  keyevent.time = 0;
+  keyevent.state = Integration::KeyEvent::Down;
+
+  application.ProcessEvent( keyevent );
+  application.ProcessEvent( keyevent );
+
+  DALI_TEST_CHECK( !gMaxCharactersCallBackCalled );
+
+  END_TEST;
+}
diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextSelectionPopup.cpp
new file mode 100644 (file)
index 0000000..b248e01
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * 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>
+#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
+
+using namespace Dali;
+using namespace Toolkit;
+
+void dali_textselectionpopup_startup(void)
+{
+  test_return_value = TET_UNDEF;
+}
+
+void dali_textselectionpopup_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
+int UtcDaliToolkitTextSelectionPopupNewP(void)
+{
+  ToolkitTestApplication application;
+  TextSelectionPopup textSelectionPopup;
+
+  DALI_TEST_CHECK( !textSelectionPopup );
+
+  textSelectionPopup = TextSelectionPopup::New();
+
+  DALI_TEST_CHECK( textSelectionPopup );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextSelectionPopupConstructorP(void)
+{
+  TextSelectionPopup textSelectionPopup;
+
+  DALI_TEST_CHECK( !textSelectionPopup );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitTextSelectionPopupCopyConstructorP(void)
+{
+  ToolkitTestApplication application;
+  TextSelectionPopup textSelectionPopup;
+
+  textSelectionPopup = TextSelectionPopup::New();
+  TextSelectionPopup copy( textSelectionPopup );
+
+  DALI_TEST_CHECK( copy == textSelectionPopup );
+
+  END_TEST;
+}
+
+
+int UtcDaliToolkitTextSelectionPopupDestructorP(void)
+{
+  ToolkitTestApplication application;
+  TextSelectionPopup* textSelectionPopup = new TextSelectionPopup;
+  delete textSelectionPopup;
+
+  DALI_TEST_CHECK( true );
+
+  END_TEST;
+}
+
+int UtcDaliToolkitTextSelectionPopupAssignmentOperatorP(void)
+{
+  ToolkitTestApplication application;
+  TextSelectionPopup textSelectionPopup;
+  textSelectionPopup = TextSelectionPopup::New();
+  TextSelectionPopup copy;
+  copy = textSelectionPopup;
+
+  DALI_TEST_CHECK( copy == textSelectionPopup );
+  END_TEST;
+}
+
+int UtcDaliToolkitTextSelectionPopupDownCastP(void)
+{
+  ToolkitTestApplication application;
+  TextSelectionPopup textSelectionPopup;
+  textSelectionPopup = TextSelectionPopup::New();
+
+  TextSelectionPopup cast = TextSelectionPopup::DownCast( textSelectionPopup );
+
+  DALI_TEST_CHECK( cast );
+
+  END_TEST;
+}
index d359334..36e8f8c 100644 (file)
@@ -20,6 +20,7 @@
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/integration-api/events/touch-event-integ.h>
+#include <dali-toolkit/devel-api/controls/tool-bar/tool-bar.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -80,32 +81,6 @@ int UtcDaliToolBarNew(void)
   END_TEST;
 }
 
-int UtcDaliToolBarSetBackground(void)
-{
-  ToolkitTestApplication application;
-  tet_infoline(" UtcDaliToolBarSetBackground");
-
-  try
-  {
-    ImageActor toolBarBackground = CreateSolidColorActor( Color::RED );
-
-    ToolBar toolbar = ToolBar::New();
-    toolbar.SetBackground( toolBarBackground );
-
-    Stage::GetCurrent().Add( toolbar );
-  }
-  catch( ... )
-  {
-    tet_result(TET_FAIL);
-  }
-
-  tet_result(TET_PASS);
-
-  application.SendNotification(); // VCC To be removed!!
-  application.Render();     // VCC To be removed!!
-  END_TEST;
-}
-
 int UtcDaliToolBarAddControl01(void)
 {
   ToolkitTestApplication application;
index 8f12fb6..ca77428 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdlib.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/shader-effects/water-effect.h>
 
 using namespace Dali;
 
index 18ed54d..0614d96 100644 (file)
@@ -20,6 +20,7 @@ toolkit_images_dir = ../../../dali-toolkit/images
 toolkit_sounds_dir = ../../../dali-toolkit/sounds
 toolkit_src_dir    = ../../../dali-toolkit/internal
 public_api_src_dir = ../../../dali-toolkit/public-api
+devel_api_src_dir  = ../../../dali-toolkit/devel-api
 
 if MOBILE_PROFILE
 toolkit_styles_dir = ../../../dali-toolkit/styles/mobile
@@ -32,6 +33,7 @@ include ../../../dali-toolkit/sounds/file.list
 include ../../../dali-toolkit/styles/file.list
 include ../../../dali-toolkit/internal/file.list
 include ../../../dali-toolkit/public-api/file.list
+include ../../../dali-toolkit/devel-api/file.list
 
 resources_dir = ../../../resources
 daliimagedir = ${dataReadOnlyDir}/toolkit/images/
@@ -45,7 +47,8 @@ lib_LTLIBRARIES = libdali-toolkit.la
 
 libdali_toolkit_la_SOURCES = \
                      $(toolkit_src_files) \
-                     $(public_api_src_files)
+                     $(public_api_src_files) \
+                     $(devel_api_src_files)
 
 dalistyledir = ${dataReadOnlyDir}/toolkit/styles/
 dalistyle_DATA = ${dali_toolkit_style_files}
@@ -78,79 +81,73 @@ libdali_toolkit_la_LIBADD = \
 topleveldir = $(devincludepath)/dali-toolkit
 toplevel_HEADERS = ../../../dali-toolkit/dali-toolkit.h
 
-publicapidir = $(topleveldir)/public-api
-
-publicapicontrolsdir = $(publicapidir)/controls
-publicapialignmentdir = $(publicapicontrolsdir)/alignment
-publicapibloomviewdir = $(publicapicontrolsdir)/bloom-view
-publicapibubbleemitterdir = $(publicapicontrolsdir)/bubble-effect
-publicapibuttonsdir = $(publicapicontrolsdir)/buttons
-publicapiclusterdir = $(publicapicontrolsdir)/cluster
-publicapidefaultcontrolsdir = $(publicapicontrolsdir)/default-controls
-publicapieffectsviewdir = $(publicapicontrolsdir)/effects-view
-publicapigaussianblurviewdir = $(publicapicontrolsdir)/gaussian-blur-view
-publicapiimageviewdir = $(publicapicontrolsdir)/image-view
-publicapiitemviewdir = $(publicapicontrolsdir)/scrollable/item-view
-publicapimagnifierdir = $(publicapicontrolsdir)/magnifier
-publicapinavigationframedir = $(publicapicontrolsdir)/navigation-frame
-publicapipageturnviewdir = $(publicapicontrolsdir)/page-turn-view
-publicapipopupdir = $(publicapicontrolsdir)/popup
-publicapiscrollbardir = $(publicapicontrolsdir)/scroll-bar
-publicapiscrollcomponentdir = $(publicapicontrolsdir)/scroll-component
-publicapiscrollabledir = $(publicapicontrolsdir)/scrollable
-publicapiscrollviewdir = $(publicapicontrolsdir)/scrollable/scroll-view
-publicapiselectorsdir = $(publicapicontrolsdir)/selectors
-publicapishadowviewdir = $(publicapicontrolsdir)/shadow-view
-publicapisliderdir = $(publicapicontrolsdir)/slider
-publicapisuperblurviewdir = $(publicapicontrolsdir)/super-blur-view
-publicapitableviewdir = $(publicapicontrolsdir)/table-view
-publicapitextcontrolsdir = $(publicapidir)/controls/text-controls
-publicapitoolbardir = $(publicapicontrolsdir)/tool-bar
-publicapiviewdir = $(publicapicontrolsdir)/view
-publicapibuilderdir = $(publicapidir)/builder
-publicapifocusmanagerdir = $(publicapidir)/focus-manager
-publicapishadereffectsdir = $(publicapidir)/shader-effects
-publicapibubbleeffectdir = $(publicapidir)/shader-effects/bubble-effect
-publicapistylingdir = $(publicapidir)/styling
-publicapitransitioneffectsdir = $(publicapidir)/transition-effects
-publicapiscriptingdir = $(publicapidir)/scripting
-publicapirenderingbackenddir = $(publicapidir)/text
-
-publicapi_HEADERS = $(public_api_header_files)
-publicapicontrols_HEADERS = $(public_api_controls_header_files)
-publicapialignment_HEADERS = $(public_api_alignment_header_files)
-publicapibloomview_HEADERS = $(public_api_bloom_view_header_files)
-publicapibubbleemitter_HEADERS = $(public_api_bubble_emitter_header_files)
-publicapibuttons_HEADERS = $(public_api_buttons_header_files)
-publicapicluster_HEADERS = $(public_api_cluster_header_files)
-publicapidefaultcontrols_HEADERS = $(public_api_default_controls_header_files)
-publicapieffectsview_HEADERS = $(public_api_effects_view_header_files)
+# devel api
+develapidir =                   $(topleveldir)/devel-api
+develapibuilderdir =            $(develapidir)/builder
+develapicontrolsdir =           $(develapidir)/controls
+develapibloomviewdir =          $(develapicontrolsdir)/bloom-view
+develapibubbleemitterdir =      $(develapicontrolsdir)/bubble-effect
+develapieffectsviewdir =        $(develapicontrolsdir)/effects-view
+develapimagnifierdir =          $(develapicontrolsdir)/magnifier
+develapipopupdir =              $(develapicontrolsdir)/popup
+develapipageturnviewdir =       $(develapicontrolsdir)/page-turn-view
+develapisliderdir =             $(develapicontrolsdir)/slider
+develapishadowviewdir =         $(develapicontrolsdir)/shadow-view
+develapisuperblurviewdir =      $(develapicontrolsdir)/super-blur-view
+develapiscriptingdir =          $(develapidir)/scripting
+develapibubbleeffectdir =       $(develapidir)/shader-effects/bubble-effect
+develapishadereffectsdir =      $(develapidir)/shader-effects
+develapitransitioneffectsdir =  $(develapidir)/transition-effects
+develapistylingdir =            $(develapidir)/styling
+develapitoolbardir =            $(develapicontrolsdir)/tool-bar
+
+# devel headers
+develapibloomview_HEADERS =         $(devel_api_bloom_view_header_files)
+develapibubbleemitter_HEADERS =     $(devel_api_bubble_emitter_header_files)
+develapibubbleeffect_HEADERS =      $(devel_api_bubble_effect_header_files)
+develapibuilder_HEADERS =           $(devel_api_builder_header_files)
+develapieffectsview_HEADERS =       $(devel_api_effects_view_header_files)
+develapimagnifier_HEADERS =         $(devel_api_magnifier_header_files)
+develapipageturnview_HEADERS =      $(devel_api_page_turn_view_header_files)
+develapipopup_HEADERS =             $(devel_api_popup_header_files)
+develapiscripting_HEADERS =         $(devel_api_scripting_header_files)
+develapishadowview_HEADERS =        $(devel_api_shadow_view_header_files)
+develapishadereffects_HEADERS =     $(devel_api_shader_effects_header_files)
+develapislider_HEADERS =            $(devel_api_slider_header_files)
+develapistyling_HEADERS =           $(devel_api_styling_header_files)
+develapisuperblurview_HEADERS =     $(devel_api_super_blur_view_header_files)
+develapitoolbar_HEADERS =           $(devel_api_tool_bar_header_files)
+develapitransitioneffects_HEADERS = $(devel_api_transition_effects_header_files)
+
+# public api source
+publicapidir =                  $(topleveldir)/public-api
+publicapicontrolsdir =          $(publicapidir)/controls
+publicapialignmentdir =         $(publicapicontrolsdir)/alignment
+publicapibuttonsdir =           $(publicapicontrolsdir)/buttons
+publicapidefaultcontrolsdir =   $(publicapicontrolsdir)/default-controls
+publicapigaussianblurviewdir =  $(publicapicontrolsdir)/gaussian-blur-view
+publicapiscrollbardir =         $(publicapicontrolsdir)/scroll-bar
+publicapiscrollabledir =        $(publicapicontrolsdir)/scrollable
+publicapiscrollviewdir =        $(publicapicontrolsdir)/scrollable/scroll-view
+publicapiitemviewdir =          $(publicapicontrolsdir)/scrollable/item-view
+publicapitableviewdir =         $(publicapicontrolsdir)/table-view
+publicapitextcontrolsdir =      $(publicapicontrolsdir)/text-controls
+publicapifocusmanagerdir =      $(publicapidir)/focus-manager
+publicapirenderingbackenddir =  $(publicapidir)/text
+
+# public api headers
+publicapi_HEADERS =                 $(public_api_header_files)
+publicapicontrols_HEADERS =         $(public_api_controls_header_files)
+publicapialignment_HEADERS =        $(public_api_alignment_header_files)
+publicapibuttons_HEADERS =          $(public_api_buttons_header_files)
+publicapidefaultcontrols_HEADERS =  $(public_api_default_controls_header_files)
 publicapigaussianblurview_HEADERS = $(public_api_gaussian_blur_view_header_files)
-publicapiimageview_HEADERS = $(public_api_image_view_header_files)
-publicapiitemview_HEADERS = $(public_api_item_view_header_files)
-publicapimagnifier_HEADERS = $(public_api_magnifier_header_files)
-publicapinavigationframe_HEADERS = $(public_api_navigation_frame_header_files)
-publicapipageturnview_HEADERS = $(public_api_page_turn_view_header_files)
-publicapipopup_HEADERS = $(public_api_popup_header_files)
-publicapiscrollbar_HEADERS = $(public_api_scroll_bar_header_files)
-
-publicapiscrollcomponent_HEADERS = $(public_api_scroll_component_header_files)
-publicapiscrollable_HEADERS = $(public_api_scrollable_header_files)
-publicapiscrollview_HEADERS = $(public_api_scroll_view_header_files)
-publicapiselectors_HEADERS = $(public_api_selectors_header_files)
-publicapishadowview_HEADERS = $(public_api_shadow_view_header_files)
-publicapislider_HEADERS = $(public_api_slider_header_files)
-publicapisuperblurview_HEADERS = $(public_api_super_blur_view_header_files)
-publicapitableview_HEADERS = $(public_api_table_view_header_files)
-publicapitextcontrols_HEADERS = $(public_api_text_controls_header_files)
-publicapitoolbar_HEADERS = $(public_api_tool_bar_header_files)
-publicapiview_HEADERS = $(public_api_view_header_files)
-publicapibuilder_HEADERS = $(public_api_builder_header_files)
-publicapifocusmanager_HEADERS = $(public_api_focus_manager_header_files)
-publicapishadereffects_HEADERS = $(public_api_shader_effects_header_files)
-publicapibubbleeffect_HEADERS = $(public_api_bubble_effect_header_files)
-publicapistyling_HEADERS = $(public_api_styling_header_files)
-publicapitransitioneffects_HEADERS = $(public_api_transition_effects_header_files)
-publicapiscripting_HEADERS = $(public_api_scripting_header_files)
+publicapiitemview_HEADERS =         $(public_api_item_view_header_files)
+publicapiscrollbar_HEADERS =        $(public_api_scroll_bar_header_files)
+publicapiscrollable_HEADERS =       $(public_api_scrollable_header_files)
+publicapiscrollview_HEADERS =       $(public_api_scroll_view_header_files)
+publicapitableview_HEADERS =        $(public_api_table_view_header_files)
+publicapitextcontrols_HEADERS =     $(public_api_text_controls_header_files)
+publicapifocusmanager_HEADERS =     $(public_api_focus_manager_header_files)
 publicapirenderingbackend_HEADERS = $(public_api_rendering_backend_header_files)
 
index bbb08c2..d7c78f9 100644 (file)
@@ -1120,7 +1120,7 @@ HTML_STYLESHEET        =
 # see the documentation.
 # This tag requires that the tag GENERATE_HTML is set to YES.
 
-HTML_EXTRA_STYLESHEET  =
+HTML_EXTRA_STYLESHEET  = dali_doxygen.css
 
 # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
 # other source files which should be copied to the HTML output directory. Note
diff --git a/build/tizen/docs/dali_doxygen.css b/build/tizen/docs/dali_doxygen.css
new file mode 100644 (file)
index 0000000..9bc0ef4
--- /dev/null
@@ -0,0 +1,5 @@
+.image
+{
+   text-align: left;
+   margin-left: 50px;
+}
index 557c8c2..9d0b25b 100644 (file)
@@ -39,6 +39,7 @@ libdali_script_plugin_v8_la_SOURCES = \
 libdali_script_plugin_v8_la_DEPENDENCIES =
 
 libdali_script_plugin_v8_la_CXXFLAGS = -DDALI_COMPILATION \
+                            -I../../../ \
                             $(V8_CFLAGS) \
                             $(DALI_TOOLKIT_CFLAGS) \
                             $(DALICORE_CFLAGS) \
index f9bdac1..5fc233b 100644 (file)
 #include <dali/dali.h>
 
 // Toolkit
-#include <dali-toolkit/public-api/builder/builder.h>
-#include <dali-toolkit/public-api/builder/tree-node.h>
 #include <dali-toolkit/public-api/controls/alignment/alignment.h>
-#include <dali-toolkit/public-api/controls/bloom-view/bloom-view.h>
-#include <dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.h>
 #include <dali-toolkit/public-api/controls/buttons/button.h>
 #include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
 #include <dali-toolkit/public-api/controls/buttons/radio-button.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/control.h>
-#include <dali-toolkit/public-api/controls/default-controls/check-button-factory.h>
-#include <dali-toolkit/public-api/controls/default-controls/push-button-factory.h>
 #include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
-#include <dali-toolkit/public-api/controls/effects-view/effects-view.h>
 #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>
-#include <dali-toolkit/public-api/controls/slider/slider.h>
-#include <dali-toolkit/public-api/controls/super-blur-view/super-blur-view.h>
 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-field.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
-#include <dali-toolkit/public-api/controls/tool-bar/tool-bar.h>
-
 #include <dali-toolkit/public-api/focus-manager/focus-manager.h>
 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
 #include <dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h>
-
-#include <dali-toolkit/public-api/scripting/script.h>
-#include <dali-toolkit/public-api/scripting/script-plugin.h>
-
 #include <dali-toolkit/public-api/text/rendering-backend.h>
-
-#include <dali-toolkit/public-api/shader-effects/alpha-discard-effect.h>
-#include <dali-toolkit/public-api/shader-effects/bendy-effect.h>
-#include <dali-toolkit/public-api/shader-effects/blind-effect.h>
-#include <dali-toolkit/public-api/shader-effects/bouncing-effect.h>
-#include <dali-toolkit/public-api/shader-effects/carousel-effect.h>
-#include <dali-toolkit/public-api/shader-effects/displacement-effect.h>
-#include <dali-toolkit/public-api/shader-effects/dissolve-local-effect.h>
-#include <dali-toolkit/public-api/shader-effects/distance-field-effect.h>
-#include <dali-toolkit/public-api/shader-effects/mirror-effect.h>
-#include <dali-toolkit/public-api/shader-effects/motion-blur-effect.h>
-#include <dali-toolkit/public-api/shader-effects/motion-stretch-effect.h>
-#include <dali-toolkit/public-api/shader-effects/overlay-effect.h>
-#include <dali-toolkit/public-api/shader-effects/shear-effect.h>
-#include <dali-toolkit/public-api/shader-effects/soft-button-effect.h>
-#include <dali-toolkit/public-api/shader-effects/spot-effect.h>
-#include <dali-toolkit/public-api/shader-effects/square-dissolve-effect.h>
-#include <dali-toolkit/public-api/shader-effects/water-effect.h>
-#include <dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.h>
-#include <dali-toolkit/public-api/shader-effects/bubble-effect/color-adjuster.h>
-#include <dali-toolkit/public-api/shader-effects/dissolve-effect.h>
-#include <dali-toolkit/public-api/shader-effects/image-region-effect.h>
-#include <dali-toolkit/public-api/shader-effects/iris-effect.h>
-#include <dali-toolkit/public-api/shader-effects/mask-effect.h>
-#include <dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.h>
-#include <dali-toolkit/public-api/shader-effects/page-turn-book-spine-effect.h>
-#include <dali-toolkit/public-api/shader-effects/page-turn-effect.h>
-#include <dali-toolkit/public-api/shader-effects/quadratic-bezier.h>
-#include <dali-toolkit/public-api/shader-effects/ripple-effect.h>
-#include <dali-toolkit/public-api/shader-effects/ripple2d-effect.h>
-#include <dali-toolkit/public-api/shader-effects/swirl-effect.h>
-
-#include <dali-toolkit/public-api/styling/style-manager.h>
-
-#include <dali-toolkit/public-api/transition-effects/cube-transition-effect.h>
-#include <dali-toolkit/public-api/transition-effects/cube-transition-wave-effect.h>
-#include <dali-toolkit/public-api/transition-effects/cube-transition-cross-effect.h>
-#include <dali-toolkit/public-api/transition-effects/cube-transition-fold-effect.h>
-
 #include <dali-toolkit/public-api/dali-toolkit-version.h>
 #include <dali-toolkit/public-api/enums.h>
 
similarity index 91%
rename from dali-toolkit/public-api/builder/builder.cpp
rename to dali-toolkit/devel-api/builder/builder.cpp
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();
similarity index 92%
rename from dali-toolkit/public-api/builder/builder.h
rename to dali-toolkit/devel-api/builder/builder.h
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
 
   /**
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/builder/json-parser.h>
+#include <dali-toolkit/devel-api/builder/json-parser.h>
 
 // EXTERNAL INCLUDES
 #include <memory.h>
similarity index 98%
rename from dali-toolkit/public-api/builder/json-parser.h
rename to dali-toolkit/devel-api/builder/json-parser.h
index 0b5c515..b871948 100644 (file)
@@ -25,7 +25,7 @@
 #include <dali/public-api/object/base-handle.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/builder/tree-node.h>
+#include <dali-toolkit/devel-api/builder/tree-node.h>
 
 namespace Dali
 {
similarity index 98%
rename from dali-toolkit/public-api/builder/tree-node.cpp
rename to dali-toolkit/devel-api/builder/tree-node.cpp
index cf6dacb..3ecb1d5 100644 (file)
@@ -19,7 +19,7 @@
 #include <cstring>
 
 // INTERNAL INCLUDES
-#include "dali-toolkit/public-api/builder/tree-node.h"
+#include "dali-toolkit/devel-api/builder/tree-node.h"
 #include "dali-toolkit/internal/builder/tree-node-manipulator.h"
 
 namespace Dali
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/bloom-view/bloom-view.h>
+#include <dali-toolkit/devel-api/controls/bloom-view/bloom-view.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/bloom-view/bloom-view-impl.h>
@@ -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);
 
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.h>
+#include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h>
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/effects-view/effects-view.h>
+#include <dali-toolkit/devel-api/controls/effects-view/effects-view.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/effects-view/effects-view-impl.h>
@@ -16,7 +16,7 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/magnifier/magnifier.h>
+#include <dali-toolkit/devel-api/controls/magnifier/magnifier.h>
 #include <dali-toolkit/internal/controls/magnifier/magnifier-impl.h>
 
 using namespace Dali;
@@ -76,6 +76,11 @@ Magnifier::~Magnifier()
 {
 }
 
+Magnifier Magnifier::DownCast( BaseHandle handle )
+{
+  return Control::DownCast<Magnifier, Internal::Magnifier>(handle);
+}
+
 void Magnifier::SetSourceActor(Actor actor)
 {
   GetImpl(*this).SetSourceActor( actor );
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/page-turn-view/page-factory.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-factory.h>
 
 namespace Dali
 {
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-landscape-view.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.h>
@@ -19,7 +19,7 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-view.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h>
 
 namespace Dali
 {
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-portrait-view.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.h>
@@ -19,7 +19,7 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-view.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h>
 
 namespace Dali
 {
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-view.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h>
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/popup/popup.h>
+#include <dali-toolkit/devel-api/controls/popup/popup.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/popup/popup-impl.h>
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/shadow-view/shadow-view.h>
+#include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/shadow-view/shadow-view-impl.h>
@@ -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);
 
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/controls/slider/slider.h>
+#include <dali-toolkit/devel-api/controls/slider/slider.h>
 #include <dali-toolkit/internal/controls/slider/slider-impl.h>
 
 using namespace Dali;
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/super-blur-view/super-blur-view.h>
+#include <dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.h>
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/controls/text-controls/text-selection-popup.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h>
@@ -66,11 +66,6 @@ ToolBar ToolBar::DownCast( BaseHandle handle )
   return Control::DownCast<ToolBar, Internal::ToolBar>(handle);
 }
 
-void ToolBar::SetBackground( Actor background )
-{
-  GetImpl( *this ).SetBackground( background );
-}
-
 void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding )
 {
   GetImpl( *this ).AddControl( control, relativeSize, alignment, padding );
@@ -88,12 +88,6 @@ public:
   static ToolBar DownCast( BaseHandle handle );
 
   /**
-   * Sets a background image.
-   * @param background Actor with the tool bar background.
-   */
-  void SetBackground( Actor background );
-
-  /**
    * Adds an additional control to the tool bar.
    * @pre The tool bar needs to be initialized.
    * @pre The alignment needs to be horizontal.
diff --git a/dali-toolkit/devel-api/file.list b/dali-toolkit/devel-api/file.list
new file mode 100755 (executable)
index 0000000..7a940c1
--- /dev/null
@@ -0,0 +1,147 @@
+# Add local source files here
+
+devel_api_src_files = \
+  $(devel_api_src_dir)/builder/builder.cpp \
+  $(devel_api_src_dir)/builder/json-parser.cpp \
+  $(devel_api_src_dir)/builder/tree-node.cpp \
+  $(devel_api_src_dir)/controls/bloom-view/bloom-view.cpp \
+  $(devel_api_src_dir)/controls/bubble-effect/bubble-emitter.cpp \
+  $(devel_api_src_dir)/controls/effects-view/effects-view.cpp \
+  $(devel_api_src_dir)/controls/magnifier/magnifier.cpp \
+  $(devel_api_src_dir)/controls/page-turn-view/page-factory.cpp \
+  $(devel_api_src_dir)/controls/page-turn-view/page-turn-landscape-view.cpp \
+  $(devel_api_src_dir)/controls/page-turn-view/page-turn-portrait-view.cpp \
+  $(devel_api_src_dir)/controls/page-turn-view/page-turn-view.cpp \
+  $(devel_api_src_dir)/controls/popup/popup.cpp \
+  $(devel_api_src_dir)/controls/shadow-view/shadow-view.cpp \
+  $(devel_api_src_dir)/controls/slider/slider.cpp \
+  $(devel_api_src_dir)/controls/super-blur-view/super-blur-view.cpp \
+  $(devel_api_src_dir)/controls/text-controls/text-selection-popup.cpp \
+  $(devel_api_src_dir)/controls/tool-bar/tool-bar.cpp \
+  $(devel_api_src_dir)/styling/style-manager.cpp \
+  $(devel_api_src_dir)/scripting/script.cpp \
+  $(devel_api_src_dir)/shader-effects/bubble-effect/bubble-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/bubble-effect/color-adjuster.cpp \
+  $(devel_api_src_dir)/shader-effects/alpha-discard-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/bendy-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/blind-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/bouncing-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/carousel-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/displacement-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/dissolve-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/dissolve-local-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/distance-field-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/image-region-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/iris-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/mask-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/mirror-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/motion-blur-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/motion-stretch-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/nine-patch-mask-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/overlay-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/page-turn-book-spine-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/page-turn-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/quadratic-bezier.cpp \
+  $(devel_api_src_dir)/shader-effects/ripple-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/ripple2d-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/shear-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/soft-button-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/spot-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/square-dissolve-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/swirl-effect.cpp \
+  $(devel_api_src_dir)/shader-effects/water-effect.cpp \
+  $(devel_api_src_dir)/transition-effects/cube-transition-cross-effect.cpp \
+  $(devel_api_src_dir)/transition-effects/cube-transition-effect.cpp \
+  $(devel_api_src_dir)/transition-effects/cube-transition-fold-effect.cpp \
+  $(devel_api_src_dir)/transition-effects/cube-transition-wave-effect.cpp
+
+# Add devel header files here
+
+devel_api_bloom_view_header_files = \
+  $(devel_api_src_dir)/controls/bloom-view/bloom-view.h
+
+devel_api_bubble_effect_header_files =  \
+  $(devel_api_src_dir)/shader-effects/bubble-effect/bubble-effect.h \
+  $(devel_api_src_dir)/shader-effects/bubble-effect/color-adjuster.h
+
+devel_api_bubble_emitter_header_files = \
+  $(devel_api_src_dir)/controls/bubble-effect/bubble-emitter.h
+
+devel_api_builder_header_files = \
+  $(devel_api_src_dir)/builder/builder.h \
+  $(devel_api_src_dir)/builder/json-parser.h \
+  $(devel_api_src_dir)/builder/tree-node.h
+
+devel_api_effects_view_header_files = \
+  $(devel_api_src_dir)/controls/effects-view/effects-view.h
+
+devel_api_magnifier_header_files = \
+  $(devel_api_src_dir)/controls/magnifier/magnifier.h
+
+devel_api_page_turn_view_header_files = \
+  $(devel_api_src_dir)/controls/page-turn-view/page-factory.h \
+  $(devel_api_src_dir)/controls/page-turn-view/page-turn-landscape-view.h \
+  $(devel_api_src_dir)/controls/page-turn-view/page-turn-portrait-view.h \
+  $(devel_api_src_dir)/controls/page-turn-view/page-turn-view.h
+
+devel_api_popup_header_files = \
+  $(devel_api_src_dir)/controls/popup/popup.h
+
+devel_api_shadow_view_header_files = \
+  $(devel_api_src_dir)/controls/shadow-view/shadow-view.h
+
+devel_api_slider_header_files = \
+  $(devel_api_src_dir)/controls/slider/slider.h
+
+devel_api_styling_header_files = \
+  $(devel_api_src_dir)/styling/style-manager.h
+
+devel_api_scripting_header_files = \
+  $(devel_api_src_dir)/scripting/script.h \
+  $(devel_api_src_dir)/scripting/script-plugin.h
+
+devel_api_shader_effects_header_files = \
+  $(devel_api_src_dir)/shader-effects/alpha-discard-effect.h \
+  $(devel_api_src_dir)/shader-effects/bendy-effect.h \
+  $(devel_api_src_dir)/shader-effects/blind-effect.h \
+  $(devel_api_src_dir)/shader-effects/bouncing-effect.h \
+  $(devel_api_src_dir)/shader-effects/carousel-effect.h \
+  $(devel_api_src_dir)/shader-effects/displacement-effect.h \
+  $(devel_api_src_dir)/shader-effects/dissolve-effect.h \
+  $(devel_api_src_dir)/shader-effects/dissolve-local-effect.h \
+  $(devel_api_src_dir)/shader-effects/distance-field-effect.h \
+  $(devel_api_src_dir)/shader-effects/image-region-effect.h \
+  $(devel_api_src_dir)/shader-effects/iris-effect.h \
+  $(devel_api_src_dir)/shader-effects/mask-effect.h \
+  $(devel_api_src_dir)/shader-effects/mirror-effect.h \
+  $(devel_api_src_dir)/shader-effects/motion-blur-effect.h \
+  $(devel_api_src_dir)/shader-effects/motion-stretch-effect.h \
+  $(devel_api_src_dir)/shader-effects/nine-patch-mask-effect.h \
+  $(devel_api_src_dir)/shader-effects/overlay-effect.h \
+  $(devel_api_src_dir)/shader-effects/page-turn-book-spine-effect.h \
+  $(devel_api_src_dir)/shader-effects/page-turn-effect.h \
+  $(devel_api_src_dir)/shader-effects/quadratic-bezier.h \
+  $(devel_api_src_dir)/shader-effects/ripple-effect.h \
+  $(devel_api_src_dir)/shader-effects/ripple2d-effect.h \
+  $(devel_api_src_dir)/shader-effects/shear-effect.h \
+  $(devel_api_src_dir)/shader-effects/soft-button-effect.h \
+  $(devel_api_src_dir)/shader-effects/spot-effect.h \
+  $(devel_api_src_dir)/shader-effects/square-dissolve-effect.h \
+  $(devel_api_src_dir)/shader-effects/swirl-effect.h \
+  $(devel_api_src_dir)/shader-effects/water-effect.h
+
+devel_api_super_blur_view_header_files = \
+  $(devel_api_src_dir)/controls/super-blur-view/super-blur-view.h
+
+devel_api_text_selection_popup_header_files = \
+  $(devel_api_src_dir)/controls/text-controls/text-selection-popup.h
+
+devel_api_tool_bar_header_files = \
+  $(devel_api_src_dir)/controls/tool-bar/tool-bar.h
+
+devel_api_transition_effects_header_files = \
+  $(devel_api_src_dir)/transition-effects/cube-transition-effect.h \
+  $(devel_api_src_dir)/transition-effects/cube-transition-cross-effect.h \
+  $(devel_api_src_dir)/transition-effects/cube-transition-fold-effect.h \
+  $(devel_api_src_dir)/transition-effects/cube-transition-wave-effect.h
+
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/shader-effects/alpha-discard-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/alpha-discard-effect.h>
 
 namespace Dali
 {
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/bendy-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/bendy-effect.h>
 
 namespace Dali
 {
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/blind-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/blind-effect.h>
 
 namespace Dali
 {
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/bouncing-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/bouncing-effect.h>
 
 namespace Dali
 {
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/carousel-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/carousel-effect.h>
 
 namespace Dali
 {
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/displacement-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/displacement-effect.h>
 namespace Dali
 {
 
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/dissolve-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/dissolve-effect.h>
 
 namespace Dali
 {
@@ -17,9 +17,9 @@
 
 #include <sstream>
 
-#include <dali-toolkit/public-api/shader-effects/dissolve-local-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/dissolve-local-effect.h>
 
-#include <dali-toolkit/public-api/shader-effects/dissolve-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/dissolve-effect.h>
 
 namespace Dali
 {
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/distance-field-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/distance-field-effect.h>
 
 #define STRINGIFY(...) #__VA_ARGS__
 
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/image-region-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/image-region-effect.h>
 
 namespace Dali
 {
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/iris-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/iris-effect.h>
 namespace Dali
 {
 
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/shader-effects/mask-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/mask-effect.h>
 
 namespace Dali
 {
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/mirror-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/mirror-effect.h>
 
 namespace Dali
 {
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/shader-effects/motion-blur-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/motion-blur-effect.h>
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/constraint.h>
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/shader-effects/motion-stretch-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/motion-stretch-effect.h>
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/constraint.h>
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/nine-patch-mask-effect.h>
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/constraint.h>
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/shader-effects/overlay-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/overlay-effect.h>
 
 namespace Dali
 {
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/shader-effects/page-turn-book-spine-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/page-turn-book-spine-effect.h>
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/stage.h>
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/shader-effects/page-turn-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/page-turn-effect.h>
 
 // INTERNAL HEADERS
 #include <dali-toolkit/internal/shader-effects/page-turn-effect-impl.h>
@@ -16,7 +16,7 @@
  */
 
 //CLASS HEADER
-#include <dali-toolkit/public-api/shader-effects/quadratic-bezier.h>
+#include <dali-toolkit/devel-api/shader-effects/quadratic-bezier.h>
 
 //EXTERNAL HEADERS
 #include <sstream>
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/ripple-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/ripple-effect.h>
 
 
 namespace Dali
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/ripple2d-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/ripple2d-effect.h>
 
 
 namespace Dali
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/shear-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/shear-effect.h>
 
 namespace Dali
 {
@@ -20,7 +20,7 @@
 #include <dali/public-api/object/property-input.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/shader-effects/soft-button-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/soft-button-effect.h>
 
 namespace Dali
 {
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/spot-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/spot-effect.h>
 
 namespace Dali
 {
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/square-dissolve-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/square-dissolve-effect.h>
 
 namespace Dali
 {
@@ -15,7 +15,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/shader-effects/swirl-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/swirl-effect.h>
 
 namespace Dali
 {
@@ -16,7 +16,7 @@
  */
 
 // CLASS HEADER
-#include <dali-toolkit/public-api/shader-effects/water-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/water-effect.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/shader-effects/water-effect-impl.h>
@@ -16,7 +16,7 @@
 
 // CLASS HEADER
 
-#include <dali-toolkit/public-api/styling/style-manager.h>
+#include <dali-toolkit/devel-api/styling/style-manager.h>
 
 // EXTERNAL INCLUDES
 
@@ -18,7 +18,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/orientation.h>
+#include <dali/devel-api/adaptor-framework/orientation.h>
 #include <dali/public-api/adaptor-framework/style-change.h>
 
 // INTERNAL INCLUDES
@@ -51,7 +51,7 @@ class StyleManager;
  *   void OnInit(Application& app)
  *   {
  *      Toolkit::StyleManager::Get().RequestThemeChange( CUSTOM_THEME );
- *      Toolkit::StyleManager::Get().SetOrientation( app.GetWindow().GetOrientation() );
+ *      Toolkit::StyleManager::Get().SetOrientation( ... );
  *      ...
  *   }
  * @endcode
@@ -64,7 +64,7 @@ class DALI_IMPORT_API StyleManager : public BaseHandle
 public:
 
   // Signals
-  typedef Signal< void ( StyleManager, StyleChange ) >  StyleChangeSignalType;
+  typedef Signal< void ( StyleManager, StyleChange::Type ) >  StyleChangeSignalType;
 
   /**
    * @brief Create a StyleManager handle; this can be initialised with StyleManager::Get()
@@ -18,7 +18,7 @@
  *
  */
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/transition-effects/cube-transition-effect.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
 
 namespace Dali
 {
@@ -18,7 +18,7 @@
  *
  */
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/transition-effects/cube-transition-effect.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
 
 namespace Dali
 {
@@ -18,7 +18,7 @@
  *
  */
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/transition-effects/cube-transition-effect.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
 
 namespace Dali
 {
index 5fc10d0..2bf79f0 100644 (file)
@@ -20,8 +20,8 @@
 // EXTERNAL INCLUDES
 #include <stdint.h>
 #include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/geometry/mesh-data.h>
-#include <dali/public-api/images/atlas.h>
+#include <dali/devel-api/geometry/mesh-data.h>
+#include <dali/devel-api/images/atlas.h>
 #include <dali/public-api/images/buffer-image.h>
 
 namespace Dali
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 21c49a1..03627ba 100644 (file)
@@ -27,7 +27,7 @@
 #include <dali/public-api/math/matrix3.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/builder/tree-node.h>
+#include <dali-toolkit/devel-api/builder/tree-node.h>
 #include <dali-toolkit/internal/builder/optional-value.h>
 
 typedef Dali::Toolkit::TreeNode TreeNode;
index be1993c..3bf70f2 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
 #include <dali-toolkit/public-api/controls/control.h>
-#include <dali-toolkit/public-api/builder/json-parser.h>
+#include <dali-toolkit/devel-api/builder/json-parser.h>
 
 #include <dali-toolkit/internal/builder/builder-get-is.inl.h>
 #include <dali-toolkit/internal/builder/builder-filesystem.h>
@@ -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..f046504 100644 (file)
@@ -30,8 +30,8 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/builder/json-parser.h>
-#include <dali-toolkit/public-api/builder/builder.h>
+#include <dali-toolkit/devel-api/builder/json-parser.h>
+#include <dali-toolkit/devel-api/builder/builder.h>
 #include <dali-toolkit/internal/builder/builder-declarations.h>
 
 // Warning messages usually displayed
@@ -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 30945d7..9936974 100644 (file)
@@ -25,8 +25,8 @@
 #include <dali/public-api/object/base-object.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/builder/json-parser.h>
-#include <dali-toolkit/public-api/builder/tree-node.h>
+#include <dali-toolkit/devel-api/builder/json-parser.h>
+#include <dali-toolkit/devel-api/builder/tree-node.h>
 
 #include <dali-toolkit/internal/builder/builder-get-is.inl.h>
 
index 17ee739..76b1ecd 100644 (file)
@@ -22,7 +22,7 @@
 #include <dali/public-api/common/dali-common.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/builder/tree-node.h>
+#include <dali-toolkit/devel-api/builder/tree-node.h>
 
 #include <dali-toolkit/internal/builder/tree-node-manipulator.h>
 
index 7edd9d0..358c21c 100644 (file)
@@ -22,7 +22,7 @@
 #include <dali/public-api/object/property-value.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/builder/builder.h>
+#include <dali-toolkit/devel-api/builder/builder.h>
 #include <dali-toolkit/internal/builder/builder-get-is.inl.h>
 
 namespace Dali
index 06d54cc..3e10edd 100644 (file)
@@ -22,7 +22,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/builder/tree-node-manipulator.h>
 
-#include <dali-toolkit/public-api/builder/tree-node.h>
+#include <dali-toolkit/devel-api/builder/tree-node.h>
 
 namespace Dali
 {
index cd5a7ad..838c2cb 100644 (file)
@@ -27,7 +27,7 @@
 #include <dali/public-api/common/vector-wrapper.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/builder/tree-node.h>
+#include <dali-toolkit/devel-api/builder/tree-node.h>
 
 namespace Dali
 {
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..eab906c 100644 (file)
 #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
 #include <dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h>
-#include <dali-toolkit/public-api/controls/bloom-view/bloom-view.h>
+#include <dali-toolkit/devel-api/controls/bloom-view/bloom-view.h>
 #include "../gaussian-blur-view/gaussian-blur-view-impl.h"
 
 namespace Dali
@@ -289,7 +289,7 @@ void BloomView::OnInitialize()
   SetupProperties();
 }
 
-void BloomView::OnControlSizeSet(const Vector3& targetSize)
+void BloomView::OnSizeSet(const Vector3& targetSize)
 {
   mTargetSize = Vector2(targetSize);
   mChildrenRoot.SetSize(targetSize);
@@ -429,20 +429,6 @@ void BloomView::RemoveRenderTasks()
   taskList.RemoveTask(mCompositeTask);
 }
 
-void BloomView::OnStageDisconnection()
-{
-  // TODO: can't call this here, since SetImage() calls fails similarly to above
-  // Need to fix the stage connection so this callback can be used arbitrarily. At that point we  can simplify the API by removing the need for Activate() / Deactivate()
-  //Deactivate();
-}
-
-void BloomView::OnControlStageConnection()
-{
-  // TODO: can't call this here, since SetImage() calls fail to connect images to stage, since parent chain not fully on stage yet
-  // Need to fix the stage connection so this callback can be used arbitrarily. At that point we  can simplify the API by removing the need for Activate() / Deactivate()
-  //Activate();
-}
-
 void BloomView::Activate()
 {
   // make sure resources are allocated and start the render tasks processing
index 8cdd72c..2da9293 100644 (file)
@@ -29,7 +29,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h>
-#include <dali-toolkit/public-api/controls/bloom-view/bloom-view.h>
+#include <dali-toolkit/devel-api/controls/bloom-view/bloom-view.h>
 
 namespace Dali
 {
@@ -87,10 +87,7 @@ public:
 private:
 
   virtual void OnInitialize();
-  virtual void OnControlSizeSet(const Vector3& targetSize);
-  virtual void OnStageDisconnection();
-
-  virtual void OnControlStageConnection();
+  virtual void OnSizeSet(const Vector3& targetSize);
 
   void AllocateResources();
   void CreateRenderTasks();
index ae17a0d..d19daa4 100644 (file)
@@ -25,7 +25,7 @@
 #include <dali/public-api/images/resource-image.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/shader-effects/bubble-effect/color-adjuster.h>
+#include <dali-toolkit/devel-api/shader-effects/bubble-effect/color-adjuster.h>
 
 namespace Dali
 {
index 3ae36a1..8623880 100644 (file)
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/camera-actor.h>
 #include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/actors/mesh-actor.h>
+#include <dali/devel-api/actors/mesh-actor.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/frame-buffer-image.h>
-#include <dali/public-api/geometry/mesh.h>
+#include <dali/devel-api/geometry/mesh.h>
 #include <dali/public-api/render-tasks/render-task.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/bubble-effect/bubble-emitter.h>
-#include <dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.h>
+#include <dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h>
+#include <dali-toolkit/devel-api/shader-effects/bubble-effect/bubble-effect.h>
 
 namespace Dali
 {
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 7f55610..06bb1c6 100644 (file)
@@ -24,7 +24,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
-#include <dali-toolkit/public-api/shader-effects/image-region-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/image-region-effect.h>
 
 #include "button-impl.h"
 
index 43ff434..a63b861 100644 (file)
@@ -538,7 +538,7 @@ void PushButton::StopAllAnimations()
   StopTransitionAnimation();
 }
 
-void PushButton::OnControlSizeSet( const Vector3& targetSize )
+void PushButton::OnSizeSet( const Vector3& targetSize )
 {
   if( targetSize != mSize )
   {
@@ -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() );
@@ -679,7 +679,7 @@ void PushButton::ConfigureSizeNegotiation()
   }
 }
 
-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;
@@ -714,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..da49f13 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
@@ -132,14 +132,14 @@ private: // From Button
 private: // From Control
 
   /**
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
+   * @copydoc CustomActorImpl::OnSizeSet( const Vector3& targetSize )
    */
-  virtual void OnControlSizeSet( const Vector3& targetSize );
+  virtual void OnSizeSet( const Vector3& targetSize );
 
   /**
    * @copydoc Toolkit::Control::GetNaturalSize
    */
-  Vector3 GetNaturalSize();
+  virtual Vector3 GetNaturalSize();
 
   /**
    * @copydoc Toolkit::Control::OnSetResizePolicy
@@ -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..0999db5 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
@@ -315,7 +315,7 @@ void EffectsView::OnInitialize()
   SetupProperties();
 }
 
-void EffectsView::OnControlSizeSet(const Vector3& targetSize)
+void EffectsView::OnSizeSet(const Vector3& targetSize)
 {
   mTargetSize = Vector2(targetSize);
 
index 497cdbe..a39a1f7 100644 (file)
@@ -27,7 +27,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/effects-view/effects-view.h>
+#include <dali-toolkit/devel-api/controls/effects-view/effects-view.h>
 #include <dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h>
 
 namespace Dali
@@ -133,9 +133,9 @@ private: // From Control
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
+   * @copydoc CustomActorImpl::OnSizeSet( const Vector3& targetSize )
    */
-  virtual void OnControlSizeSet( const Vector3& targetSize );
+  virtual void OnSizeSet( const Vector3& targetSize );
 
 private:
 
index f233cf4..5da6110 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>
 
@@ -352,7 +352,7 @@ struct ZrelativeToYconstraint
   float mScale;
 };
 
-void GaussianBlurView::OnControlSizeSet(const Vector3& targetSize)
+void GaussianBlurView::OnSizeSet(const Vector3& targetSize)
 {
   mTargetSize = Vector2(targetSize);
 
@@ -522,20 +522,6 @@ void GaussianBlurView::RemoveRenderTasks()
   taskList.RemoveTask(mCompositeTask);
 }
 
-void GaussianBlurView::OnStageDisconnection()
-{
-  // TODO: can't call this here, since SetImage() calls fails similarly to above
-  // Need to fix the stage connection so this callback can be used arbitrarily. At that point we  can simplify the API by removing the need for Activate() / Deactivate()
-  //Deactivate();
-}
-
-void GaussianBlurView::OnControlStageConnection()
-{
-  // TODO: can't call this here, since SetImage() calls fail to connect images to stage, since parent chain not fully on stage yet
-  // Need to fix the stage connection so this callback can be used arbitrarily. At that point we  can simplify the API by removing the need for Activate() / Deactivate()
-  //Activate();
-}
-
 void GaussianBlurView::Activate()
 {
   // make sure resources are allocated and start the render tasks processing
index 9420d24..0afa61c 100644 (file)
@@ -95,10 +95,7 @@ public:
 private:
 
   virtual void OnInitialize();
-  virtual void OnControlSizeSet(const Vector3& targetSize);
-  virtual void OnStageDisconnection();
-
-  virtual void OnControlStageConnection();
+  virtual void OnSizeSet(const Vector3& targetSize);
 
   void SetBlurBellCurveWidth(float blurBellCurveWidth);
   float CalcGaussianWeight(float x);
diff --git a/dali-toolkit/internal/controls/image-view/masked-image-view-impl.cpp b/dali-toolkit/internal/controls/image-view/masked-image-view-impl.cpp
deleted file mode 100644 (file)
index 97c4053..0000000
+++ /dev/null
@@ -1,651 +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/image-view/masked-image-view-impl.h>
-
-// EXTERNAL INCLUDES
-#include <sstream>
-#include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/common/stage.h>
-#include <dali/public-api/render-tasks/render-task-list.h>
-#include <dali/public-api/shader-effects/shader-effect.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace // unnamed namespace
-{
-
-const char* CUSTOM_PROPERTY_NAMES[ Dali::Toolkit::MaskedImageView::CUSTOM_PROPERTY_COUNT ] =
-{
-  "background-color",
-  "source-size",
-  "source-offset",
-  "mask-size",
-  "mask-offset"
-};
-
-const char* const MASKED_IMAGE_VIEW_VERTEX_SOURCE =
-  "precision mediump float;                                                                                      \n"
-  "uniform vec2 uTargetSize;                                                                                     \n"
-  "uniform vec2 uSourceSize;                                                                                     \n"
-  "uniform vec2 uSourceOffset;                                                                                   \n"
-  "uniform vec2 uMaskSize;                                                                                       \n"
-  "uniform vec2 uMaskOffset;                                                                                     \n"
-  "varying vec2 vMaskTexCoord;                                                                                   \n"
-  "void main()                                                                                                   \n"
-  "{                                                                                                             \n"
-  "  float x = uSourceSize.x*aPosition.x + uSourceOffset.x;                                                      \n"
-  "  float y = uSourceSize.y*aPosition.y + uSourceOffset.y;                                                      \n"
-  "                                                                                                              \n"
-  "  gl_Position = vec4( x/(uTargetSize.x*0.5), y/(uTargetSize.y*0.5), 0.0, 1.0 );                               \n"
-  "                                                                                                              \n"
-  "  vMaskTexCoord.x = (uMaskSize.x*0.5 + x - uMaskOffset.x) / uMaskSize.x;                                      \n"
-  "  vMaskTexCoord.y = (uMaskSize.y*0.5 + y - uMaskOffset.y) / uMaskSize.y;                                      \n";
-
-const char* const MASKED_IMAGE_VIEW_VERTEX_SOURCE_ROTATE0 =
-  "                                                                                                              \n"
-  "  vTexCoord = aTexCoord;                                                                                      \n"
-  "}";
-
-const char* const MASKED_IMAGE_VIEW_VERTEX_SOURCE_ROTATE90 =
-  "                                                                                                              \n"
-  "  vTexCoord.x = aTexCoord.y;                                                                                  \n"
-  "  vTexCoord.y = 1.0 - aTexCoord.x;                                                                            \n"
-  "}";
-
-const char* const MASKED_IMAGE_VIEW_VERTEX_SOURCE_ROTATE180 =
-  "                                                                                                              \n"
-  "  vTexCoord.x = 1.0 - aTexCoord.x;                                                                            \n"
-  "  vTexCoord.y = 1.0 - aTexCoord.y;                                                                            \n"
-  "}";
-
-const char* const MASKED_IMAGE_VIEW_VERTEX_SOURCE_ROTATE270 =
-  "                                                                                                              \n"
-  "  vTexCoord.x = 1.0 - aTexCoord.y;                                                                            \n"
-  "  vTexCoord.y = aTexCoord.x;                                                                                  \n"
-  "}";
-
-const char* const MASKED_IMAGE_VIEW_FRAGMENT_SOURCE =
-  "precision mediump float;                                                                                      \n"
-  "varying vec2 vMaskTexCoord;                                                                                   \n"
-  "void main()                                                                                                   \n"
-  "{                                                                                                             \n"
-  "  highp vec4 mask = texture2D(sEffect, vMaskTexCoord);                                                        \n"
-  "  gl_FragColor = texture2D(sTexture, vTexCoord) * vec4(1,1,1,mask.a);                                         \n"
-  "}";
-
-Vector2 GetSizeForAspectRatio( const Vector2& targetSize, float aspectRatio )
-{
-  Vector2 sizeToKeepAspectRatio( targetSize );
-
-  float targetAspectRatio( targetSize.width / targetSize.height );
-
-  if( aspectRatio > targetAspectRatio )
-  {
-    sizeToKeepAspectRatio.width = sizeToKeepAspectRatio.height * aspectRatio;
-  }
-  else if ( aspectRatio < targetAspectRatio )
-  {
-    sizeToKeepAspectRatio.height = sizeToKeepAspectRatio.width / aspectRatio;
-  }
-
-  return sizeToKeepAspectRatio;
-}
-
-Vector2 ClampSourceSize( const Vector2& sourceSize, const Vector2& targetSize, float widthOverHeight, float maxSourceScale )
-{
-  Vector2 clampedSize( sourceSize );
-
-  Vector2 minSize( targetSize );
-  if ( widthOverHeight > 0.0f )
-  {
-    minSize = GetSizeForAspectRatio( targetSize, widthOverHeight );
-  }
-
-  if ( clampedSize.width  < minSize.width ||
-       clampedSize.height < minSize.height )
-  {
-    clampedSize = minSize;
-  }
-  else if ( clampedSize.width  > minSize.width *maxSourceScale ||
-            clampedSize.height > minSize.height*maxSourceScale )
-  {
-    clampedSize = minSize * maxSourceScale;
-  }
-
-  return clampedSize;
-}
-
-Vector2 ClampSourceOffset( const Vector2& sourceOffset, const Vector2& targetSize, const Vector2& sourceSize )
-{
-  Vector2 min, max;
-
-  if ( sourceSize.width > targetSize.width )
-  {
-    float offset = (sourceSize.width - targetSize.width) * 0.5f;
-    min.x = -offset;
-    max.x =  offset;
-  }
-
-  if ( sourceSize.height > targetSize.height )
-  {
-    float offset = (sourceSize.height - targetSize.height) * 0.5f;
-    min.y = -offset;
-    max.y =  offset;
-  }
-
-  return Vector2( Clamp(sourceOffset.x, min.x, max.x), Clamp(sourceOffset.y, min.y, max.y) );
-}
-
-} // unnamed namespace
-
-Dali::Toolkit::MaskedImageView MaskedImageView::New( unsigned int targetWidth,
-                                                     unsigned int targetHeight,
-                                                     Image sourceImage,
-                                                     Image maskImage )
-{
-  // Create the implementation
-  MaskedImageView* maskedImageView = new MaskedImageView();
-
-  // Pass ownership to CustomActor via derived handle
-  Dali::Toolkit::MaskedImageView handle(*maskedImageView);
-
-  // Second-phase init of the implementation
-  // This can only be done after the CustomActor connection has been made...
-  maskedImageView->Initialize( targetWidth, targetHeight, sourceImage, maskImage );
-
-  return handle;
-}
-
-void MaskedImageView::SetSourceImage( Image sourceImage )
-{
-  mSourceImageActor.SetImage( sourceImage );
-}
-
-Image MaskedImageView::GetSourceImage()
-{
-  return mSourceImageActor.GetImage();
-}
-
-void MaskedImageView::SetMaskImage( Image maskImage )
-{
-  mMaskImage = maskImage;
-  mSourceImageActor.GetShaderEffect().SetEffectImage( maskImage );
-}
-
-Image MaskedImageView::GetMaskImage()
-{
-  return mMaskImage;
-}
-
-Property::Index MaskedImageView::GetPropertyIndex( Dali::Toolkit::MaskedImageView::CustomProperty customProperty ) const
-{
-  Property::Index index = Property::INVALID_INDEX;
-
-  switch ( customProperty )
-  {
-    case Dali::Toolkit::MaskedImageView::BACKGROUND_COLOR:
-    {
-      index = mCustomProperties[ Dali::Toolkit::MaskedImageView::BACKGROUND_COLOR ];
-      break;
-    }
-
-    case Dali::Toolkit::MaskedImageView::SOURCE_SIZE:
-    {
-      index = mCustomProperties[ Dali::Toolkit::MaskedImageView::SOURCE_SIZE ];
-      break;
-    }
-
-    case Dali::Toolkit::MaskedImageView::SOURCE_OFFSET:
-    {
-      index = mCustomProperties[ Dali::Toolkit::MaskedImageView::SOURCE_OFFSET ];
-      break;
-    }
-
-    case Dali::Toolkit::MaskedImageView::MASK_SIZE:
-    {
-      index = mCustomProperties[ Dali::Toolkit::MaskedImageView::MASK_SIZE ];
-      break;
-    }
-
-    case Dali::Toolkit::MaskedImageView::MASK_OFFSET:
-    {
-      index = mCustomProperties[ Dali::Toolkit::MaskedImageView::MASK_OFFSET ];
-      break;
-    }
-
-    default:
-      break;
-  }
-
-  return index;
-}
-
-void MaskedImageView::Pause()
-{
-  if ( mRenderTask )
-  {
-    mRenderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
-  }
-}
-
-void MaskedImageView::Resume()
-{
-  if ( mRenderTask )
-  {
-    mRenderTask.SetRefreshRate( RenderTask::REFRESH_ALWAYS );
-  }
-}
-
-bool MaskedImageView::IsPaused() const
-{
-  if( mRenderTask.GetRefreshRate() ) // REFRESH_ALWAYS
-  {
-    return false;
-  }
-  else // REFRESH_ONCE
-  {
-    return true;
-  }
-}
-
-void MaskedImageView::SetEditMode( Dali::Toolkit::MaskedImageView::EditMode editMode )
-{
-  Actor self = Self();
-
-  mEditMode = editMode;
-
-  if ( Dali::Toolkit::MaskedImageView::EDIT_DISABLED == editMode )
-  {
-    if ( mPanGestureDetector )
-    {
-      mPanGestureDetector.DetachAll();
-      mPanGestureDetector.Reset();
-    }
-
-    if ( mPinchDetector )
-    {
-      mPinchDetector.DetachAll();
-      mPinchDetector.Reset();
-    }
-  }
-  else
-  {
-    if ( !mPanGestureDetector )
-    {
-      mPanGestureDetector = PanGestureDetector::New();
-      mPanGestureDetector.Attach( self );
-      mPanGestureDetector.DetectedSignal().Connect(this, &MaskedImageView::OnPan);
-    }
-
-    if ( !mPinchDetector )
-    {
-      mPinchDetector = PinchGestureDetector::New();
-      mPinchDetector.Attach( self );
-      mPinchDetector.DetectedSignal().Connect(this, &MaskedImageView::OnPinch);
-    }
-
-    if( Dali::Toolkit::MaskedImageView::EDIT_SOURCE == editMode )
-    {
-      // Re-clamp values to preserve image aspect-ratio etc.
-      ClampSourceSizeAndOffset();
-    }
-  }
-}
-
-Dali::Toolkit::MaskedImageView::EditMode MaskedImageView::GetEditMode() const
-{
-  return mEditMode;
-}
-
-void MaskedImageView::OnPropertySet( Property::Index index, Property::Value propertyValue )
-{
-  // Ignore OnPropertySet if MaskedImageView is setting the properties
-  if( !mSelfPropertySetting )
-  {
-    // Synchronize with user-supplied property values...
-    if( mCustomProperties[ Dali::Toolkit::MaskedImageView::SOURCE_SIZE ] == index )
-    {
-      // Note that clamping will take effect when edit-mode is used later
-      mSourcePosition.mStartPinchSize   = propertyValue.Get<Vector2>();
-      mSourcePosition.mCurrentPinchSize = propertyValue.Get<Vector2>();
-    }
-    else if( mCustomProperties[ Dali::Toolkit::MaskedImageView::SOURCE_OFFSET ] == index )
-    {
-      // Note that clamping will take effect when edit-mode is used later
-      mSourcePosition.mPanOffset = propertyValue.Get<Vector2>();
-    }
-    else if( mCustomProperties[ Dali::Toolkit::MaskedImageView::MASK_SIZE ] == index )
-    {
-      mMaskPosition.mStartPinchSize   = propertyValue.Get<Vector2>();
-      mMaskPosition.mCurrentPinchSize = propertyValue.Get<Vector2>();
-    }
-    else if( mCustomProperties[ Dali::Toolkit::MaskedImageView::MASK_OFFSET ] == index )
-    {
-      mMaskPosition.mPanOffset = propertyValue.Get<Vector2>();
-    }
-    // else it's fine to do nothing here
-  }
-}
-
-void MaskedImageView::OnPan(Actor source, const PanGesture& gesture)
-{
-  // Used to flag whether edit mode is setting properties
-  mSelfPropertySetting = true;
-
-  Actor self = Self();
-
-  if ( Dali::Toolkit::MaskedImageView::EDIT_SOURCE == mEditMode )
-  {
-    mSourcePosition.mPanOffset += gesture.displacement;
-    mSourcePosition.mPanOffset = ClampSourceOffset( mSourcePosition.mPanOffset, mTargetSize, mSourcePosition.mCurrentPinchSize );
-
-    self.SetProperty( GetPropertyIndex( Dali::Toolkit::MaskedImageView::SOURCE_OFFSET ), mSourcePosition.mPanOffset );
-  }
-  else // Edit mask
-  {
-    mMaskPosition.mPanOffset += gesture.displacement;
-
-    self.SetProperty( GetPropertyIndex( Dali::Toolkit::MaskedImageView::MASK_OFFSET ), mMaskPosition.mPanOffset );
-  }
-
-  // Used to flag whether edit mode is setting properties
-  mSelfPropertySetting = false;
-}
-
-void MaskedImageView::OnPinch(Actor actor, const PinchGesture& pinch)
-{
-  // Used to flag whether edit mode is setting properties
-  mSelfPropertySetting = true;
-
-  Actor self = Self();
-
-  if ( Dali::Toolkit::MaskedImageView::EDIT_SOURCE == mEditMode )
-  {
-    if ( pinch.state == Gesture::Started )
-    {
-      mSourcePosition.mStartPinchSize = mSourcePosition.mCurrentPinchSize;
-    }
-
-    mSourcePosition.mCurrentPinchSize = mSourcePosition.mStartPinchSize * pinch.scale;
-
-    ClampSourceSizeAndOffset();
-  }
-  else // Edit mask
-  {
-    if ( pinch.state == Gesture::Started )
-    {
-      mMaskPosition.mStartPinchSize = mMaskPosition.mCurrentPinchSize;
-    }
-
-    mMaskPosition.mCurrentPinchSize = mMaskPosition.mStartPinchSize * pinch.scale;
-
-    self.SetProperty( GetPropertyIndex( Dali::Toolkit::MaskedImageView::MASK_SIZE ), mMaskPosition.mCurrentPinchSize );
-  }
-
-  // Used to flag whether edit mode is setting properties
-  mSelfPropertySetting = false;
-}
-
-void MaskedImageView::SetSourceAspectRatio( float widthOverHeight )
-{
-  Actor self = Self();
-
-  if ( widthOverHeight > 0.0f )
-  {
-    mWidthOverHeight = widthOverHeight;
-
-    ClampSourceSizeAndOffset();
-  }
-  else
-  {
-    mWidthOverHeight = 0.0f; // ignore aspect-ratio
-  }
-}
-
-float MaskedImageView::GetSourceAspectRatio() const
-{
-  return mWidthOverHeight;
-}
-
-void MaskedImageView::SetMaximumSourceScale( float scale )
-{
-  mMaximumSourceScale = scale;
-}
-
-float MaskedImageView::GetMaximumSourceScale() const
-{
-  return mMaximumSourceScale;
-}
-
-void MaskedImageView::SetSourceRotation( MaskedImageView::ImageRotation newRotation )
-{
-  if( mSourceRotation != newRotation )
-  {
-    bool oldLandscape( Dali::Toolkit::MaskedImageView::ROTATE_90 == mSourceRotation || Dali::Toolkit::MaskedImageView::ROTATE_270 == mSourceRotation );
-    bool newLandscape( Dali::Toolkit::MaskedImageView::ROTATE_90 == newRotation     || Dali::Toolkit::MaskedImageView::ROTATE_270 == newRotation     );
-
-    if ( oldLandscape != newLandscape )
-    {
-      // Changing between landscape & portraint, swap width & height
-      float temp = mSourcePosition.mCurrentPinchSize.width;
-      mSourcePosition.mCurrentPinchSize.width  = mSourcePosition.mCurrentPinchSize.height;
-      mSourcePosition.mCurrentPinchSize.height = temp;
-    }
-
-    mSourceRotation = newRotation;
-
-    ApplyMaskedImageShader( newRotation );
-
-    ClampSourceSizeAndOffset();
-  }
-}
-
-MaskedImageView::ImageRotation MaskedImageView::GetSourceRotation() const
-{
-  return mSourceRotation;
-}
-
-Dali::Toolkit::MaskedImageView::MaskedImageViewSignal& MaskedImageView::MaskFinishedSignal()
-{
-  return mMaskFinishedSignal;
-}
-
-MaskedImageView::MaskedImageView()
-: Control( ControlBehaviour( REQUIRES_TOUCH_EVENTS | REQUIRES_STYLE_CHANGE_SIGNALS ) ),
-  mEditMode( Dali::Toolkit::MaskedImageView::EDIT_DISABLED ),
-  mSelfPropertySetting( false ),
-  mSourceRotation( Dali::Toolkit::MaskedImageView::ROTATE_0 ),
-  mWidthOverHeight( 0.0f ),
-  mMaximumSourceScale( Dali::Toolkit::MaskedImageView::DEFAULT_MAXIMUM_SOURCE_SCALE )
-{
-}
-
-void MaskedImageView::Initialize( unsigned int targetWidth,
-                                  unsigned int targetHeight,
-                                  Image sourceImage,
-                                  Image maskImage )
-{
-  Actor self = Self();
-
-  // Register custom properties
-
-  mTargetSize = Vector2( static_cast<float>(targetWidth), static_cast<float>(targetHeight) );
-
-  mCustomProperties[ Dali::Toolkit::MaskedImageView::BACKGROUND_COLOR ]
-    = self.RegisterProperty( CUSTOM_PROPERTY_NAMES[ Dali::Toolkit::MaskedImageView::BACKGROUND_COLOR ], Color::BLACK  );
-
-  mCustomProperties[ Dali::Toolkit::MaskedImageView::SOURCE_SIZE ]
-    = self.RegisterProperty( CUSTOM_PROPERTY_NAMES[ Dali::Toolkit::MaskedImageView::SOURCE_SIZE ], mTargetSize );
-
-  mCustomProperties[ Dali::Toolkit::MaskedImageView::SOURCE_OFFSET ]
-    = self.RegisterProperty( CUSTOM_PROPERTY_NAMES[ Dali::Toolkit::MaskedImageView::SOURCE_OFFSET ], Vector2::ZERO );
-
-  mCustomProperties[ Dali::Toolkit::MaskedImageView::MASK_SIZE ]
-    = self.RegisterProperty( CUSTOM_PROPERTY_NAMES[ Dali::Toolkit::MaskedImageView::MASK_SIZE ], mTargetSize );
-
-  mCustomProperties[ Dali::Toolkit::MaskedImageView::MASK_OFFSET ]
-    = self.RegisterProperty( CUSTOM_PROPERTY_NAMES[ Dali::Toolkit::MaskedImageView::MASK_OFFSET ], Vector2::ZERO );
-
-  // Create destination image (FBO)
-  mDestinationImage = FrameBufferImage::New( targetWidth, targetHeight, Pixel::RGBA8888 );
-
-  // Create source actor for off-screen image processing
-  mSourceImageActor = ImageActor::New( sourceImage );
-  self.Add( mSourceImageActor );
-  mSourceImageActor.SetParentOrigin( ParentOrigin::CENTER );
-  mSourceImageActor.SetPositionInheritanceMode( DONT_INHERIT_POSITION );
-  mSourceImageActor.SetInheritOrientation( false );
-  mSourceImageActor.SetInheritScale( false );
-  mSourceImageActor.SetColorMode( USE_OWN_COLOR );
-  mSourceImageActor.SetSize( Vector3::ONE );
-
-  // Apply masking effect to source actor
-  mMaskImage = maskImage;
-  ApplyMaskedImageShader( Dali::Toolkit::MaskedImageView::ROTATE_0 );
-
-  // Create actor to display result of off-screen rendering
-  mDestinationImageActor = ImageActor::New( mDestinationImage );
-  self.Add( mDestinationImageActor );
-  mDestinationImageActor.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION );
-
-  // Start the masking operation
-  mRenderTask = Stage::GetCurrent().GetRenderTaskList().CreateTask();
-  mRenderTask.SetSourceActor( mSourceImageActor );
-  mRenderTask.SetTargetFrameBuffer( mDestinationImage );
-  mRenderTask.SetInputEnabled( false );
-  mRenderTask.SetExclusive( true );
-  mRenderTask.SetClearEnabled( true );
-
-  Constraint clearColorConstraint = Constraint::New<Vector4>( mRenderTask, RenderTask::Property::CLEAR_COLOR, EqualToConstraint() );
-  clearColorConstraint.AddSource( Source( self, mCustomProperties[ Dali::Toolkit::MaskedImageView::BACKGROUND_COLOR ] ) );
-  clearColorConstraint.Apply();
-  mRenderTask.FinishedSignal().Connect( this, &MaskedImageView::OnRenderTaskFinished );
-
-  // Edit mode initialization
-  mSourcePosition.mCurrentPinchSize = Vector2( targetWidth, targetHeight );
-  mMaskPosition.mCurrentPinchSize   = mSourcePosition.mCurrentPinchSize;
-}
-
-void MaskedImageView::ApplyMaskedImageShader( ImageRotation rotation )
-{
-  Actor self = Self();
-
-  // Vertex shader has different postfix for each rotation
-  std::stringstream vertexSource;
-  vertexSource << MASKED_IMAGE_VIEW_VERTEX_SOURCE;
-  if( Dali::Toolkit::MaskedImageView::ROTATE_90 == rotation )
-  {
-    vertexSource << MASKED_IMAGE_VIEW_VERTEX_SOURCE_ROTATE90;
-  }
-  else if( Dali::Toolkit::MaskedImageView::ROTATE_180 == rotation )
-  {
-    vertexSource << MASKED_IMAGE_VIEW_VERTEX_SOURCE_ROTATE180;
-  }
-  else if( Dali::Toolkit::MaskedImageView::ROTATE_270 == rotation )
-  {
-    vertexSource << MASKED_IMAGE_VIEW_VERTEX_SOURCE_ROTATE270;
-  }
-  else // Default to Dali::Toolkit::MaskedImageView::ROTATE_0
-  {
-    vertexSource << MASKED_IMAGE_VIEW_VERTEX_SOURCE_ROTATE0;
-  }
-
-  ShaderEffect shader = ShaderEffect::New( vertexSource.str(),
-                                           MASKED_IMAGE_VIEW_FRAGMENT_SOURCE,
-                                           GeometryType( GEOMETRY_TYPE_IMAGE ),
-                                           ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ) );
-
-  shader.SetUniform( "uTargetSize", mTargetSize );
-
-  shader.SetUniform( "uSourceSize", mTargetSize );
-  Constraint sourceSizeConstraint = Constraint::New<Vector2>( shader, shader.GetPropertyIndex( "uSourceSize" ), EqualToConstraint() );
-  sourceSizeConstraint.AddSource( Source( self, mCustomProperties[ Dali::Toolkit::MaskedImageView::SOURCE_SIZE ] ) );
-  sourceSizeConstraint.Apply();
-
-  shader.SetUniform( "uSourceOffset", Vector2::ZERO );
-  Constraint sourceOffsetConstraint = Constraint::New<Vector2>( shader, shader.GetPropertyIndex( "uSourceOffset" ), EqualToConstraint() );
-  sourceOffsetConstraint.AddSource( Source( self, mCustomProperties[ Dali::Toolkit::MaskedImageView::SOURCE_OFFSET ] ) );
-  sourceOffsetConstraint.Apply();
-
-  shader.SetUniform( "uMaskSize", mTargetSize );
-  Constraint maskSizeConstraint = Constraint::New<Vector2>( shader, shader.GetPropertyIndex( "uMaskSize" ), EqualToConstraint() );
-  maskSizeConstraint.AddSource( Source( self, mCustomProperties[ Dali::Toolkit::MaskedImageView::MASK_SIZE ] ) );
-  maskSizeConstraint.Apply();
-
-  shader.SetUniform( "uMaskOffset", mTargetSize );
-  Constraint maskOffsetConstraint = Constraint::New<Vector2>( shader, shader.GetPropertyIndex( "uMaskOffset" ), EqualToConstraint() );
-  maskOffsetConstraint.AddSource( Source( self, mCustomProperties[ Dali::Toolkit::MaskedImageView::MASK_OFFSET ] ) );
-  maskOffsetConstraint.Apply();
-
-  shader.SetEffectImage( mMaskImage );
-  mSourceImageActor.SetShaderEffect( shader );
-}
-
-void MaskedImageView::ClampSourceSizeAndOffset()
-{
-  float rotatedAspectRatio( mWidthOverHeight );
-  if( mWidthOverHeight > 0.0f &&
-      ( Dali::Toolkit::MaskedImageView::ROTATE_90  == mSourceRotation ||
-        Dali::Toolkit::MaskedImageView::ROTATE_270 == mSourceRotation ) )
-  {
-    rotatedAspectRatio = 1.0f / mWidthOverHeight;
-  }
-
-  Actor self = Self();
-
-  mSourcePosition.mCurrentPinchSize = ClampSourceSize( mSourcePosition.mCurrentPinchSize, mTargetSize, rotatedAspectRatio, mMaximumSourceScale );
-  self.SetProperty( GetPropertyIndex( Dali::Toolkit::MaskedImageView::SOURCE_SIZE ), mSourcePosition.mCurrentPinchSize );
-
-  mSourcePosition.mPanOffset = ClampSourceOffset( mSourcePosition.mPanOffset, mTargetSize, mSourcePosition.mCurrentPinchSize );
-  self.SetProperty( GetPropertyIndex( Dali::Toolkit::MaskedImageView::SOURCE_OFFSET ), mSourcePosition.mPanOffset );
-}
-
-MaskedImageView::~MaskedImageView()
-{
-  // Guard to allow handle destruction after Core has been destroyed
-  if( Stage::IsInstalled() )
-  {
-    Stage::GetCurrent().GetRenderTaskList().RemoveTask( mRenderTask );
-  }
-}
-
-void MaskedImageView::OnControlSizeSet( const Vector3& targetSize )
-{
-  mDestinationImageActor.SetSize(targetSize);
-}
-
-void MaskedImageView::OnRenderTaskFinished( Dali::RenderTask& renderTask )
-{
-  Toolkit::MaskedImageView handle( GetOwner() );
-  mMaskFinishedSignal.Emit( handle );
-}
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/internal/controls/image-view/masked-image-view-impl.h b/dali-toolkit/internal/controls/image-view/masked-image-view-impl.h
deleted file mode 100644 (file)
index a1c8285..0000000
+++ /dev/null
@@ -1,275 +0,0 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_MASKED_IMAGE_VIEW_H__
-#define __DALI_TOOLKIT_INTERNAL_MASKED_IMAGE_VIEW_H__
-
-/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/render-tasks/render-task.h>
-#include <dali/public-api/images/frame-buffer-image.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/image-view/masked-image-view.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-/**
- * @copydoc Dali::Toolkit::MaskedImageView
- */
-class MaskedImageView : public Control
-{
-public:
-
-  typedef Dali::Toolkit::MaskedImageView::ImageRotation ImageRotation;
-
-  /**
-   * Create a new MaskedImageView.
-   * @return A public handle to the newly allocated MaskedImageView.
-   */
-  static Dali::Toolkit::MaskedImageView New( unsigned int targetWidth,
-                                             unsigned int targetHeight,
-                                             Image sourceImage,
-                                             Image maskImage );
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::SetSourceImage()
-   */
-  void SetSourceImage( Image sourceImage );
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::GetSourceImage()
-   */
-  Image GetSourceImage();
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::SetMaskImage()
-   */
-  void SetMaskImage( Image maskImage );
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::GetMaskImage()
-   */
-  Image GetMaskImage();
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::GetPropertyIndex()
-   */
-  Property::Index GetPropertyIndex( Dali::Toolkit::MaskedImageView::CustomProperty customProperty ) const;
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::Pause()
-   */
-  void Pause();
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::Resume()
-   */
-  void Resume();
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::IsPaused()
-   */
-  bool IsPaused() const;
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::SetEditMode()
-   */
-  void SetEditMode( Dali::Toolkit::MaskedImageView::EditMode editMode );
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::GetEditMode()
-   */
-  Dali::Toolkit::MaskedImageView::EditMode GetEditMode() const;
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::SetSourceAspectRatio()
-   */
-  void SetSourceAspectRatio( float widthOverHeight );
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::GetSourceAspectRatio()
-   */
-  float GetSourceAspectRatio() const;
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::SetMaximumSourceScale()
-   */
-  void SetMaximumSourceScale( float scale );
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::GetMaximumSourceScale()
-   */
-  float GetMaximumSourceScale() const;
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::SetSourceRotation()
-   */
-  void SetSourceRotation( ImageRotation rotation );
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::GetSourceRotation()
-   */
-  ImageRotation GetSourceRotation() const;
-
-  /**
-   * @copydoc Dali::Toolkit::MaskedImageView::MaskFinishedSignal
-   */
-  Dali::Toolkit::MaskedImageView::MaskedImageViewSignal& MaskFinishedSignal();
-
-protected:
-
-  /**
-   * @copydoc Dali::CustomActorImpl::OnPropertySet()
-   */
-  void OnPropertySet( Property::Index index, Property::Value propertyValue );
-
-  /**
-   * Helper for edit mode.
-   */
-  void OnPan( Actor source, const PanGesture& gesture );
-
-  /**
-   * Helper for edit mode.
-   */
-  void OnPinch( Actor actor, const PinchGesture& pinch );
-
-  /**
-   * Construct a new MaskedImageView.
-   */
-  MaskedImageView();
-
-  /**
-   * 2nd-phase initialization.
-   */
-  void Initialize( unsigned int targetWidth,
-                   unsigned int targetHeight,
-                   Image sourceImage,
-                   Image maskImage );
-
-  /**
-   * Helper to apply the desired shader-effect for a given rotation.
-   * @param[in] rotation The rotation to apply to the source image.
-   */
-  void ApplyMaskedImageShader( ImageRotation rotation );
-
-  /**
-   * Helper to clamp the source image properties (only in edit mode).
-   */
-  void ClampSourceSizeAndOffset();
-
-  /**
-   * A reference counted object may only be deleted by calling Unreference()
-   */
-  virtual ~MaskedImageView();
-
-  /**
-   *
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
-   */
-  virtual void OnControlSizeSet( const Vector3& targetSize );
-
-private:
-
-  // Undefined
-  MaskedImageView(const MaskedImageView&);
-
-  // Undefined
-  MaskedImageView& operator=(const MaskedImageView& rhs);
-
-  /**
-   * Emit MaskFinishedSignal when the render task finished rendering
-   * @param[in] renderTask the off-screen render task
-   */
-  void OnRenderTaskFinished( Dali::RenderTask& renderTask );
-
-private:
-
-  Vector2 mTargetSize;
-
-  Property::Index mCustomProperties[ Dali::Toolkit::MaskedImageView::CUSTOM_PROPERTY_COUNT ];
-
-  // Used for off-screen rendering
-  RenderTask mRenderTask;
-  ImageActor mSourceImageActor;
-  FrameBufferImage mDestinationImage;
-
-  // Create actor to display result of off-screen rendering
-  ImageActor mDestinationImageActor;
-
-  // Because ShaderEffect doesn't have a GetEffectImage()
-  Image mMaskImage;
-
-  // For edit mode
-  Dali::Toolkit::MaskedImageView::EditMode mEditMode;
-  PanGestureDetector mPanGestureDetector;
-  PinchGestureDetector mPinchDetector;
-  bool mSelfPropertySetting;
-
-  struct ImagePosition
-  {
-    Vector2 mPanOffset;
-    Vector2 mStartPinchSize;
-    Vector2 mCurrentPinchSize;
-  };
-  ImagePosition mSourcePosition;
-  ImagePosition mMaskPosition;
-
-  ImageRotation mSourceRotation;
-
-  // Limits for edit mode
-  float mWidthOverHeight;
-  float mMaximumSourceScale;
-
-  Dali::Toolkit::MaskedImageView::MaskedImageViewSignal mMaskFinishedSignal;
-};
-
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Toolkit::Internal::MaskedImageView& GetImpl(Toolkit::MaskedImageView& pub)
-{
-  DALI_ASSERT_ALWAYS(pub);
-
-  Dali::RefObject& handle = pub.GetImplementation();
-
-  return static_cast<Toolkit::Internal::MaskedImageView&>(handle);
-}
-
-inline const Toolkit::Internal::MaskedImageView& GetImpl(const Toolkit::MaskedImageView& pub)
-{
-  DALI_ASSERT_ALWAYS(pub);
-
-  const Dali::RefObject& handle = pub.GetImplementation();
-
-  return static_cast<const Toolkit::Internal::MaskedImageView&>(handle);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_MASKED_IMAGE_VIEW_H__
index 29e5bec..15de6ea 100644 (file)
@@ -268,7 +268,7 @@ void Magnifier::SetFrameVisibility(bool visible)
   }
 }
 
-void Magnifier::OnControlSizeSet(const Vector3& targetSize)
+void Magnifier::OnSizeSet(const Vector3& targetSize)
 {
   // TODO: Once Camera/CameraActor properties function as proper animatable properties
   // this code can disappear.
index 4def324..d4fea4e 100644 (file)
@@ -26,7 +26,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/magnifier/magnifier.h>
+#include <dali-toolkit/devel-api/controls/magnifier/magnifier.h>
 
 namespace Dali
 {
@@ -117,7 +117,7 @@ private:
 
 private:
 
-  virtual void OnControlSizeSet(const Vector3& targetSize);
+  virtual void OnSizeSet(const Vector3& targetSize);
 
 private:
 
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 0e9c635..eae7640 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-landscape-view.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h>
 #include <dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.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 cc2e5ec..f64e351 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-portrait-view.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h>
 #include <dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h>
 
 namespace Dali
index 6ede563..d70065f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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
@@ -423,13 +423,13 @@ void PageTurnView::SetupShadowView()
   mShadowView.Activate();
 }
 
-void PageTurnView::OnControlStageConnection()
+void PageTurnView::OnStageConnection()
 {
   SetupShadowView();
   mTurningPageLayer.RaiseToTop();
 }
 
-void PageTurnView::OnControlStageDisconnection()
+void PageTurnView::OnStageDisconnection()
 {
   if(mShadowView)
   {
@@ -453,12 +453,6 @@ void PageTurnView::OnControlStageDisconnection()
   }
 }
 
-void PageTurnView::OnControlSizeSet( const Vector3& size )
-{
-  // disable the SetSize of the control from the application
-  Self().SetSize( mControlSize );
-}
-
 void PageTurnView::SetSpineShadowParameter( const Vector2& spineShadowParameter )
 {
   mSpineShadowParameter = spineShadowParameter;
index d36ab2f..c09250f 100644 (file)
  */
 
 // 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>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-view.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h>
 #include <dali-toolkit/internal/shader-effects/page-turn-effect-impl.h>
-#include <dali-toolkit/public-api/shader-effects/page-turn-effect.h>
-#include <dali-toolkit/public-api/shader-effects/page-turn-book-spine-effect.h>
-#include <dali-toolkit/public-api/controls/page-turn-view/page-factory.h>
-#include <dali-toolkit/public-api/controls/shadow-view/shadow-view.h>
+#include <dali-toolkit/devel-api/shader-effects/page-turn-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/page-turn-book-spine-effect.h>
+#include <dali-toolkit/devel-api/controls/page-turn-view/page-factory.h>
+#include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h>
 
 namespace Dali
 {
@@ -199,19 +199,14 @@ private: // from Control
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnControlStageConncection
+   * @copydoc CustomActorImpl::OnStageConnection()
    */
-  virtual void OnControlStageConnection();
+  virtual void OnStageConnection();
 
   /**
-   * @copydoc Toolkit::Control::OnControlStageDisConnection
+   * @copydoc CustomActorImpl::OnStageDisconnection()
    */
-  virtual void OnControlStageDisconnection();
-
-  /**
-   * @copydoc Toolkit::Control::OnControlSizeSet
-   */
-  virtual void OnControlSizeSet( const Vector3& size );
+  virtual void OnStageDisconnection();
 
 private: // implemented differently by PageTurnLandscapeView and PageTurnPortraitView
 
index 4ba3a03..0a58b7c 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>
 
@@ -38,6 +38,7 @@
 #include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 #include <dali-toolkit/public-api/focus-manager/focus-manager.h>
 #include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
+#include <dali-toolkit/internal/controls/buttons/button-impl.h>
 
 using namespace Dali;
 
@@ -646,7 +647,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 +655,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 )
     {
@@ -675,8 +676,8 @@ void Popup::OnRelayout( const Vector2& size, RelayoutContainer& container )
 
       button.SetPosition( buttonPosition );
 
-      button.PropagateRelayoutFlags();    // Reset relayout flags for relayout
-      container.Add( button, buttonSize );
+     //Todo: Use the size negotiation pass instead of SetSize directly
+     button.SetSize( buttonSize );
     }
   }
 }
@@ -832,7 +833,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 +847,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..ccf7ebb 100755 (executable)
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/popup/popup.h>
-#include <dali-toolkit/internal/controls/popup/popup-style-impl.h>
 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
+#include <dali-toolkit/devel-api/controls/popup/popup.h>
+#include <dali-toolkit/internal/controls/popup/popup-style-impl.h>
 
 namespace Dali
 {
@@ -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..f65e77e 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 )
+void ScrollBar::OnSizeSet( const Vector3& size )
 {
-  if(mIndicatorHeightPolicy != Toolkit::ScrollBar::Fixed && mScrollConnector)
+  if(mIndicatorHeightPolicy == Toolkit::ScrollBar::Fixed)
   {
-    mIndicator.SetSize( IndicatorSize( size, mScrollConnector.GetContentLength() ) );
+    mIndicator.SetSize(size.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..f5321a4 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()
+   */
+  void SetScrollIndicator( Actor indicator );
+
+  /**
+   * @copydoc Toolkit::ScrollBar::GetScrollIndicator()
    */
-  static Toolkit::ScrollBar New();
+  Actor GetScrollIndicator();
 
   /**
-   * @copydoc Toolkit::ScrollComponentImpl::OnScrollConnectorSet()
+   * @copydoc Toolkit::ScrollBar::SetScrollPositionIntervals()
    */
-  void OnScrollConnectorSet( Toolkit::ScrollConnector connector );
+  void SetScrollPositionIntervals( const Dali::Vector<float>& positions );
 
   /**
-   * @copydoc Toolkit::ScrollBar::SetIndicatorImage()
+   * @copydoc Toolkit::ScrollBar::GetScrollPositionIntervals()
    */
-  void SetIndicatorImage( Image image );
+  Dali::Vector<float> GetScrollPositionIntervals() const;
 
   /**
-   * @copydoc Toolkit::ScrollBar::GetScrollIndicator()
+   * @copydoc Toolkit::ScrollBar::SetScrollDirection()
    */
-  Actor GetScrollIndicator();
+  void SetScrollDirection( Toolkit::ScrollBar::Direction direction );
 
   /**
-   * @copydoc Toolkit::ScrollBar::SetPositionNotifications()
+   * @copydoc Toolkit::ScrollBar::GetScrollDirection()
    */
-  void SetPositionNotifications( const std::vector<float>& positions );
+  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,16 +201,16 @@ private: // from Control
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnPan
+   * @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
    */
-  virtual void OnPan( PanGesture gesture );
+  virtual void OnSizeSet( const Vector3& size );
+
+private:
 
   /**
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& size )
+   * Create the default indicator actor.
    */
-  virtual void OnControlSizeSet( const Vector3& size );
-
-private:
+  void CreateDefaultIndicatorActor();
 
   /**
    * Apply constraints for background and indicator.
@@ -205,19 +219,11 @@ private:
   void ApplyConstraints();
 
   /**
-   * 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.
-   */
-  void OnScrollDomainChanged(float minPosition, float maxPosition, float contentSize);
-
-  /**
    * 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();
+
+private:
 
-  ImageActor mIndicator;                                             ///< Image of scroll indicator.
+  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 5ea5753..7f38bd4 100644 (file)
@@ -20,9 +20,9 @@
 
 // EXTERNAL INCLUDES
 #include <math.h>
-#include <dali/public-api/actors/mesh-actor.h>
+#include <dali/devel-api/actors/mesh-actor.h>
 #include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/geometry/animatable-mesh.h>
+#include <dali/devel-api/geometry/animatable-mesh.h>
 #include <dali/public-api/shader-effects/shader-effect.h>
 #include <dali/public-api/math/vector3.h>
 
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 a9f342c..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,7 +1457,7 @@ void ItemView::SetOvershootEffectColor( const Vector4& color )
   }
 }
 
-void ItemView::SetOvershootEnabled( bool enable )
+void ItemView::EnableScrollOvershoot( bool enable )
 {
   Actor self = Self();
   if( enable )
@@ -1518,21 +1471,24 @@ void ItemView::SetOvershootEnabled( bool enable )
     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
@@ -1565,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;
   }
@@ -1586,9 +1542,11 @@ 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)
@@ -1599,14 +1557,14 @@ void ItemView::AnimateScrollOvershoot(float overshootAmount, bool animateBack)
     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..57e7e75 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #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,17 +649,16 @@ 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);
 
-  Vector3 size = GetControlSize();
-  UpdatePropertyDomain(size);
+  UpdatePropertyDomain();
   SetInternalConstraints();
 }
 
-void ScrollView::OnControlStageConnection()
+void ScrollView::OnStageConnection()
 {
   DALI_LOG_SCROLL_STATE("[0x%X]", this);
 
@@ -624,14 +667,14 @@ 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);
   }
 }
 
-void ScrollView::OnControlStageDisconnection()
+void ScrollView::OnStageDisconnection()
 {
   DALI_LOG_SCROLL_STATE("[0x%X]", this);
 
@@ -769,8 +812,7 @@ void ScrollView::SetRulerX(RulerPtr ruler)
 {
   mRulerX = ruler;
 
-  Vector3 size = GetControlSize();
-  UpdatePropertyDomain(size);
+  UpdatePropertyDomain();
   UpdateMainInternalConstraint();
 }
 
@@ -778,16 +820,16 @@ void ScrollView::SetRulerY(RulerPtr ruler)
 {
   mRulerY = ruler;
 
-  Vector3 size = GetControlSize();
-  UpdatePropertyDomain(size);
+  UpdatePropertyDomain();
   UpdateMainInternalConstraint();
 }
 
-void ScrollView::UpdatePropertyDomain(const Vector3& size)
+void ScrollView::UpdatePropertyDomain()
 {
   Actor self = Self();
-  Vector3 min = mMinScroll;
-  Vector3 max = mMaxScroll;
+  Vector3 size = self.GetTargetSize();
+  Vector2 min = mMinScroll;
+  Vector2 max = mMaxScroll;
   bool scrollPositionChanged = false;
   bool domainChanged = false;
 
@@ -1054,7 +1096,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 +1111,31 @@ 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)
-{
-  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 +1150,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 +1180,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 +1195,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 +1207,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 +1242,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 +1270,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 +1394,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 +1406,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 +1463,7 @@ bool ScrollView::SnapWithVelocity(Vector2 velocity)
 
   if(isFlick || isFreeFlick)
   {
-    positionDuration = Vector3::ONE * mFlickDuration;
+    positionDuration = Vector2::ONE * mFlickDuration;
     alphaFunction = mFlickAlphaFunction;
   }
 
@@ -1443,7 +1483,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 +1499,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 +1549,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 +1583,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 +1616,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 +1680,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 +1697,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 +1759,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 +1786,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 +1838,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 );
 }
 
@@ -1825,24 +1865,24 @@ bool ScrollView::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface
 void ScrollView::OnSizeAnimation(Animation& animation, const Vector3& targetSize)
 {
   // need to update domain properties for new size
-  UpdatePropertyDomain(targetSize);
+  UpdatePropertyDomain();
 }
 
-void ScrollView::OnControlSizeSet( const Vector3& size )
+void ScrollView::OnSizeSet( const Vector3& size )
 {
   // need to update domain properties for new size
   if( mDefaultMaxOvershoot )
   {
     mUserMaxOvershoot.x = size.x * 0.5f;
     mUserMaxOvershoot.y = size.y * 0.5f;
-    if( !IsScrollComponentEnabled(Toolkit::Scrollable::OvershootIndicator) )
+    if( !IsOvershootEnabled() )
     {
       mMaxOvershoot = mUserMaxOvershoot;
     }
   }
-  UpdatePropertyDomain(size);
+  UpdatePropertyDomain();
   UpdateMainInternalConstraint();
-  if( IsScrollComponentEnabled(Toolkit::Scrollable::OvershootIndicator) )
+  if( IsOvershootEnabled() )
   {
     mOvershootIndicator->Reset();
   }
@@ -1850,7 +1890,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 +1960,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 +2050,7 @@ bool ScrollView::OnMouseWheelEvent(const MouseWheelEvent& event)
     return false;
   }
 
-  Vector3 targetScrollPosition = GetPropertyPosition();
+  Vector2 targetScrollPosition = GetPropertyPosition();
 
   if(mRulerX->IsEnabled() && !mRulerY->IsEnabled())
   {
@@ -2052,7 +2113,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 +2147,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 +2168,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 +2195,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 +2215,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 +2326,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 +2369,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 +2471,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 +2528,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 +2583,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 +2629,8 @@ void ScrollView::UpdateMainInternalConstraint()
     mScrollMainInternalDeltaConstraint.Remove();
     mScrollMainInternalFinalConstraint.Remove();
     mScrollMainInternalRelativeConstraint.Remove();
+    mScrollMainInternalDomainConstraint.Remove();
+    mScrollMainInternalPrePositionMaxConstraint.Remove();
   }
   if( mScrollMainInternalPrePositionConstraint )
   {
@@ -2593,7 +2654,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 +2670,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 +2681,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..be978a7 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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,50 @@ public:
   /**
    * @copydoc Toolkit::ScrollView::GetCurrentScrollPosition
    */
-  Vector3 GetCurrentScrollPosition() const;
-
-  /**
-   * @copydoc Toolkit::ScrollView::SetScrollPosition
-   */
-  void SetScrollPosition(const Vector3& position);
+  Vector2 GetCurrentScrollPosition() const;
 
   /**
    * @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 +462,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);
@@ -508,9 +508,9 @@ private: // private overriden functions from CustomActorImpl and Controls
   virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
 
   /**
-   * @copydoc Dali::Control::OnControlSizeSet(const Vector3&)
+   * @copydoc CustomActorImpl::OnSizeSet(const Vector3&)
    */
-  virtual void OnControlSizeSet( const Vector3& size );
+  virtual void OnSizeSet( const Vector3& size );
 
   /**
    * From CustomActorImpl; called after a child has been added to the owning actor.
@@ -547,14 +547,14 @@ private: // private overriden functions from CustomActorImpl and Controls
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnControlStageConnection()
+   * @copydoc CustomActorImpl::OnStageConnection()
    */
-  virtual void OnControlStageConnection();
+  virtual void OnStageConnection();
 
   /**
-   * @copydoc Toolkit::Control::OnControlStageConnection()
+   * @copydoc CustomActorImpl::OnStageDisconnection()
    */
-  virtual void OnControlStageDisconnection();
+  virtual void OnStageDisconnection();
 
   /**
    * @copydoc Toolkit::Control::OnAccessibilityPan()
@@ -562,9 +562,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:
 
@@ -655,10 +655,8 @@ private:
    * This is called internally whenever the Scroll Rulers are
    * modified. This will update the properties: 'scroll-position-min'
    * and 'scroll-position-max' to reflect the changes.
-   *
-   * @param[in] size size of the visible scroll area (ScrollView control size)
    */
-  void UpdatePropertyDomain(const Vector3& size);
+  void UpdatePropertyDomain();
 
   /**
    * Called when the gesture starts.
@@ -712,14 +710,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 +725,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 +735,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 +784,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 +831,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 +867,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 +893,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 e2afd04..cbac96e 100644 (file)
@@ -27,7 +27,7 @@
 #include <dali/public-api/shader-effects/shader-effect.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/shadow-view/shadow-view.h>
+#include <dali-toolkit/devel-api/controls/shadow-view/shadow-view.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/internal/filters/blur-two-pass-filter.h>
 
index 94d4bbe..8ff89c3 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
@@ -209,7 +209,7 @@ void Slider::OnInitialize()
   self.SetSize( DEFAULT_HIT_REGION.x, DEFAULT_HIT_REGION.y );
 }
 
-void Slider::OnControlSizeSet( const Vector3& size )
+void Slider::OnSizeSet( const Vector3& size )
 {
   // Factor in handle overshoot into size of backing
   SetHitRegion( Vector2( size.x, GetHitRegion().y ) );
@@ -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..ea652fd 100755 (executable)
 // 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>
-#include <dali-toolkit/public-api/controls/slider/slider.h>
+#include <dali-toolkit/devel-api/controls/slider/slider.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
 
 namespace Dali
@@ -287,9 +288,9 @@ protected:
   virtual ~Slider();
 
   /**
-   * @copydoc Control::OnControlSizeSet( const Vector3& size )
+   * @copydoc CustomActorImpl::OnSizeSet( const Vector3& size )
    */
-  virtual void OnControlSizeSet( const Vector3& size );
+  virtual void OnSizeSet( const Vector3& size );
 
 private:
 
index 008a0e5..2c93d41 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
@@ -252,7 +252,7 @@ void SuperBlurView::ClearBlurResource()
   }
 }
 
-void SuperBlurView::OnControlSizeSet( const Vector3& targetSize )
+void SuperBlurView::OnSizeSet( const Vector3& targetSize )
 {
   if( mTargetSize != Vector2(targetSize) )
   {
index cecc4c3..3488c2c 100644 (file)
@@ -20,7 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/super-blur-view/super-blur-view.h>
+#include <dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h>
 #include <dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h>
 
 namespace Dali
@@ -115,9 +115,9 @@ private: // from Control
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnControlSizeSet
+   * @copydoc CustomActorImpl::OnSizeSet()
    */
-  virtual void OnControlSizeSet(const Vector3& targetSize);
+  virtual void OnSizeSet(const Vector3& targetSize);
 
 private:
 
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 ec6f12d..da4a593 100644 (file)
@@ -26,9 +26,9 @@
 #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/public-api/adaptor-framework/virtual-keyboard.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>
 
 // INTERNAL INCLUDES
@@ -117,6 +117,7 @@ DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-handle-pressed-image-right", STRING,    SELECTION_HANDLE_PRESSED_IMAGE_RIGHT )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "selection-highlight-color",            STRING,    SELECTION_HIGHLIGHT_COLOR            )
 DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "decoration-bounding-box",              RECTANGLE, DECORATION_BOUNDING_BOX              )
+DALI_PROPERTY_REGISTRATION( Toolkit, TextField, "input-method-settings",                MAP,       INPUT_METHOD_SETTINGS                )
 
 DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "max-length-reached", SIGNAL_MAX_LENGTH_REACHED )
 
@@ -520,6 +521,13 @@ void TextField::SetProperty( BaseObject* object, Property::Index index, const Pr
         }
         break;
       }
+      case Toolkit::TextField::Property::INPUT_METHOD_SETTINGS:
+      {
+        // Empty implementation for now.
+        Property::Map map = value.Get<Property::Map>();
+        VirtualKeyboard::ApplySettings( map );
+        break;
+      }
     } // switch
   } // textfield
 }
@@ -778,6 +786,10 @@ Property::Value TextField::GetProperty( BaseObject* object, Property::Index inde
         }
         break;
       }
+      case Toolkit::TextField::Property::INPUT_METHOD_SETTINGS:
+      {
+        break;
+      }
     } //switch
   }
 
@@ -838,7 +850,7 @@ void TextField::OnInitialize()
   self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
 }
 
-void TextField::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange change )
+void TextField::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
 {
   GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
 }
index 63ded84..6e9525d 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>
@@ -97,7 +97,7 @@ private: // From Control
   /**
    * @copydoc Control::OnStyleChange()
    */
-  virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange change );
+  virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
 
   /**
    * @copydoc Control::GetNaturalSize()
index 3f0cf0d..423a8ae 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,9 +426,13 @@ 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 )
+void TextLabel::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
 {
   GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
 }
index 54c2554..3e0fd35 100644 (file)
@@ -75,7 +75,7 @@ private: // From Control
   /**
    * @copydoc Control::OnStyleChange()
    */
-  virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange change );
+  virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
 
   /**
    * @copydoc Control::OnRelayout()
index 0753579..892c563 100644 (file)
@@ -21,7 +21,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
-#include <dali-toolkit/public-api/controls/text-controls/text-selection-popup.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/image-actor.h>
index a04ff9a..381cac6 100644 (file)
 #include <dali/public-api/actors/renderable-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>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
 
 namespace Dali
 {
@@ -67,25 +66,6 @@ Toolkit::ToolBar ToolBar::New()
   return toolBar;
 }
 
-void ToolBar::SetBackground( Actor background )
-{
-  Lock lock( mInitializing );
-
-  // ToolBar image
-  background.SetParentOrigin( Dali::ParentOrigin::TOP_CENTER );
-  background.SetAnchorPoint( Dali::AnchorPoint::TOP_CENTER );
-  background.SetSize( Vector2( mToolBarSize.width, mToolBarSize.height ) );
-
-  RenderableActor renderableActor = RenderableActor::DownCast( background );
-  if ( renderableActor )
-  {
-    renderableActor.SetSortModifier( 1.f );
-  }
-
-  Self().Add( background );
-  mBackground = background;
-}
-
 void ToolBar::AddControl( Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding )
 {
   // Work out index and update bases and offsets for further insertions.
@@ -356,12 +336,6 @@ void ToolBar::OnControlChildAdd(Actor& child)
   // actor is in mLayout not in Self().
 }
 
-void ToolBar::OnControlSizeSet( const Vector3& targetSize )
-{
-  mToolBarSize = targetSize;
-  mBackground.SetSize( Vector2( mToolBarSize.width, mToolBarSize.height ) );
-}
-
 } // namespace Internal
 
 } // namespace Toolkit
index ebf0fcd..7caaed5 100644 (file)
  */
 
 // 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>
-#include <dali-toolkit/public-api/controls/tool-bar/tool-bar.h>
 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/controls/tool-bar/tool-bar.h>
 
 namespace Dali
 {
@@ -52,11 +52,6 @@ public:
   static Toolkit::ToolBar New();
 
   /**
-   * @copydoc Dali::Toolkit::ToolBar::SetBackground()
-   */
-  void SetBackground( Actor background );
-
-  /**
    * @copydoc Dali::Toolkit::ToolBar::AddControl()
    */
   void AddControl( Dali::Actor control, float relativeSize, Toolkit::Alignment::Type alignment, const Toolkit::Alignment::Padding& padding );
@@ -81,12 +76,6 @@ private: // From Control
    */
   virtual void OnControlChildAdd(Actor& child);
 
-  /**
-   *
-   * @copydoc Toolkit::Control::OnControlSizeSet( const Vector3& targetSize )
-   */
-  virtual void OnControlSizeSet( const Vector3& targetSize );
-
 private:
   /**
    */
@@ -135,8 +124,6 @@ private:
   float              mRightRelativeSpace;       ///< Relative space between center and right groups of controls.
   float              mAccumulatedRelativeSpace; ///< Stores the total percentage space used by controls.
   bool               mInitializing;             ///< Allows the use of Actor's API to add controls.
-  Vector3            mToolBarSize;              ///< The size of tool bar
-  Actor              mBackground;               ///< The background of the tool bar
 
   std::map<Actor/*control*/,Toolkit::Alignment> mControls; ///< Stores a relationship between controls and their alignments used to place them inside the table view.
 };
index a6b0fb1..c748177 100644 (file)
@@ -21,37 +21,24 @@ toolkit_src_files = \
    $(toolkit_src_dir)/controls/buttons/radio-button-impl.cpp \
    $(toolkit_src_dir)/controls/effects-view/effects-view-impl.cpp \
    $(toolkit_src_dir)/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp \
-   $(toolkit_src_dir)/controls/image-view/masked-image-view-impl.cpp \
    $(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 \
index 5a07ded..bc4b164 100644 (file)
@@ -22,7 +22,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/effects-view/effects-view.h>
+#include <dali-toolkit/devel-api/controls/effects-view/effects-view.h>
 
 namespace Dali
 {
index b1f3c14..a96cf79 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>
 
@@ -467,7 +467,7 @@ void FocusManager::DoActivate(Actor actor)
     if(control)
     {
       // Notify the control that it is activated
-      control.GetImplementation().Activate();
+      GetImplementation( control ).AccessibilityActivate();
     }
 
     // Send notification for the activation of focused actor
@@ -815,7 +815,7 @@ bool FocusManager::AccessibilityActionUp()
       if(control)
       {
         // Notify the control that it is activated
-        ret = control.GetImplementation().OnAccessibilityValueChange(true);
+        ret = GetImplementation( control ).OnAccessibilityValueChange(true);
       }
     }
   }
@@ -836,7 +836,7 @@ bool FocusManager::AccessibilityActionDown()
       if(control)
       {
         // Notify the control that it is activated
-        ret = control.GetImplementation().OnAccessibilityValueChange(false);
+        ret = GetImplementation( control ).OnAccessibilityValueChange(false);
       }
     }
   }
@@ -873,7 +873,7 @@ bool FocusManager::AccessibilityActionTouch(const TouchEvent& touchEvent)
   Dali::Toolkit::Control control = Dali::Toolkit::Control::DownCast(GetCurrentFocusActor());
   if(control)
   {
-    handled = control.GetImplementation().OnAccessibilityTouch(touchEvent);
+    handled = GetImplementation( control ).OnAccessibilityTouch(touchEvent);
   }
 
   return handled;
@@ -933,7 +933,7 @@ bool FocusManager::HandlePanGesture(const Integration::PanGestureEvent& panEvent
       pan.velocity.x = pan.displacement.x / panEvent.timeDelta;
       pan.velocity.y = pan.displacement.y / panEvent.timeDelta;
 
-      handled = control.GetImplementation().OnAccessibilityPan(pan);
+      handled = GetImplementation( control ).OnAccessibilityPan(pan);
     }
 
     // If the gesture is not handled by the control, check its parent
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..4f4bf57 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>
 
@@ -195,7 +195,7 @@ Actor KeyboardFocusManager::GetCurrentFocusGroup()
 bool KeyboardFocusManager::IsLayoutControl(Actor actor) const
 {
   Toolkit::Control control = Toolkit::Control::DownCast(actor);
-  return control && control.GetImplementation().IsKeyboardNavigationSupported();
+  return control && GetImplementation( control ).IsKeyboardNavigationSupported();
 }
 
 Toolkit::Control KeyboardFocusManager::GetParentLayoutControl(Actor actor) const
@@ -260,7 +260,7 @@ bool KeyboardFocusManager::MoveFocus(Toolkit::Control::KeyboardFocusNavigationDi
 bool KeyboardFocusManager::DoMoveFocusWithinLayoutControl(Toolkit::Control control, Actor actor, Toolkit::Control::KeyboardFocusNavigationDirection direction)
 {
   // Ask the control for the next actor to focus
-  Actor nextFocusableActor = control.GetImplementation().GetNextKeyboardFocusableActor(actor, direction, mFocusGroupLoopEnabled);
+  Actor nextFocusableActor = GetImplementation( control ).GetNextKeyboardFocusableActor(actor, direction, mFocusGroupLoopEnabled);
   if(nextFocusableActor)
   {
     if(!nextFocusableActor.IsKeyboardFocusable())
@@ -299,7 +299,7 @@ bool KeyboardFocusManager::DoMoveFocusWithinLayoutControl(Toolkit::Control contr
             // If the application hasn't changed our proposed actor, we informs the layout control we will
             // move the focus to what the control returns. The control might wish to perform some actions
             // before the focus is actually moved.
-            control.GetImplementation().OnKeyboardFocusChangeCommitted(committedFocusActor);
+            GetImplementation( control ).OnKeyboardFocusChangeCommitted( committedFocusActor );
           }
 
           return SetCurrentFocusActor(committedFocusActor);
@@ -351,7 +351,7 @@ void KeyboardFocusManager::DoActivate(Actor actor)
     if(control)
     {
       // Notify the control that it is activated
-      control.GetImplementation().Activate();
+      GetImplementation( control ).AccessibilityActivate();
     }
 
     // Send notification for the activation of focused actor
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 9fee428..48f0ebf 100644 (file)
@@ -88,13 +88,13 @@ void KeyInputFocusManager::SetFocus( Toolkit::Control control )
   if( previousFocusControl )
   {
     // Notify the control that it has lost key input focus
-    previousFocusControl.GetImplementation().OnKeyInputFocusLost();
+    GetImplementation( previousFocusControl ).OnKeyInputFocusLost();
   }
 
   mFocusStack.PushBack( &control.GetBaseObject() );
 
   // Tell the new actor that it has gained focus.
-  control.GetImplementation().OnKeyInputFocusGained();
+  GetImplementation( control ).OnKeyInputFocusGained();
 
   // Emit the signal to inform focus change to the application.
   if ( !mKeyInputFocusChangedSignal.Empty() )
@@ -113,7 +113,7 @@ void KeyInputFocusManager::RemoveFocus( Toolkit::Control control )
       control.OffStageSignal().Disconnect( mSlotDelegate, &KeyInputFocusManager::OnFocusControlStageDisconnection );
 
       // Notify the control that it has lost key input focus
-      control.GetImplementation().OnKeyInputFocusLost();
+      GetImplementation( control ).OnKeyInputFocusLost();
 
       // If this is the top-most actor, pop it and change focus to the previous control
       if( pos == mFocusStack.End() - 1 )
@@ -124,7 +124,7 @@ void KeyInputFocusManager::RemoveFocus( Toolkit::Control control )
         if( previouslyFocusedControl )
         {
           // Tell the control that it has gained focus.
-          previouslyFocusedControl.GetImplementation().OnKeyInputFocusGained();
+          GetImplementation( previouslyFocusedControl ).OnKeyInputFocusGained();
         }
       }
       else
@@ -194,7 +194,7 @@ void KeyInputFocusManager::OnKeyEvent( const KeyEvent& event )
       if( control )
       {
         // Notify the control about the key event
-        consumed = control.GetImplementation().EmitKeyEventSignal( event );
+        consumed = GetImplementation( control ).EmitKeyEventSignal( event );
       }
     }
   }
index bda3721..c8d9c6d 100644 (file)
@@ -21,8 +21,8 @@
 #include <dali/public-api/object/base-object.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/scripting/script.h>
-#include <dali-toolkit/public-api/scripting/script-plugin.h>
+#include <dali-toolkit/devel-api/scripting/script.h>
+#include <dali-toolkit/devel-api/scripting/script-plugin.h>
 
 
 namespace Dali
index 72f5e15..05da08f 100644 (file)
@@ -18,7 +18,7 @@
  *
  */
 
-#include <dali-toolkit/public-api/scripting/script-plugin.h>
+#include <dali-toolkit/devel-api/scripting/script-plugin.h>
 
 namespace Dali
 {
index b75af2e..83f6fc0 100644 (file)
@@ -22,7 +22,7 @@
 #include <dali/public-api/animation/constraint.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/shader-effects/page-turn-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/page-turn-effect.h>
 
 namespace Dali
 {
index 8ecaf61..9c78f32 100644 (file)
@@ -23,7 +23,7 @@
 #include <iomanip>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/shader-effects/water-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/water-effect.h>
 
 namespace Dali
 {
index 9aa6007..2f1e5b9 100644 (file)
@@ -24,7 +24,7 @@
 #include <dali/public-api/shader-effects/shader-effect.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/shader-effects/water-effect.h>
+#include <dali-toolkit/devel-api/shader-effects/water-effect.h>
 
 namespace Dali
 {
index 4378e84..814421e 100644 (file)
 #include "style-manager-impl.h"
 
 // EXTERNAL INCLUDES
-#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
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/styling/style-manager.h>
+#include <dali-toolkit/devel-api/styling/style-manager.h>
 
 namespace
 {
@@ -38,7 +35,7 @@ const char* LANDSCAPE_QUALIFIER = "landscape";
 const char* PORTRAIT_QUALIFIER  = "portrait";
 const char* FONT_SIZE_QUALIFIER = "font-size-";
 
-const char* DEFAULT_THEME = DALI_STYLE_DIR "tizen-default-theme.json";
+const char* DEFAULT_THEME = DALI_STYLE_DIR "dali-toolkit-default-theme.json";
 
 const char* PACKAGE_PATH_KEY = "PACKAGE_PATH";
 const char* DEFAULT_PACKAGE_PATH = DALI_DATA_READ_ONLY_DIR "/toolkit/";
@@ -101,19 +98,18 @@ Toolkit::StyleManager StyleManager::Get()
 
 StyleManager::StyleManager()
 : mOrientationDegrees( 0 ),  // Portrait
-  mDefaultFontSize( -1 )
+  mDefaultFontSize( -1 ),
+  mThemeFile( DEFAULT_THEME )
 {
   // Add theme builder constants
   mThemeBuilderConstants[ PACKAGE_PATH_KEY ] = DEFAULT_PACKAGE_PATH;
 
-  RequestDefaultTheme();
-
-  StyleMonitor styleMonitor( StyleMonitor::Get() );
-  if( styleMonitor )
+  mStyleMonitor = StyleMonitor::Get();
+  if( mStyleMonitor )
   {
-    styleMonitor.StyleChangeSignal().Connect( this, &StyleManager::StyleMonitorChange );
+    mStyleMonitor.StyleChangeSignal().Connect( this, &StyleManager::StyleMonitorChange );
 
-    mDefaultFontSize = styleMonitor.GetDefaultFontSize();
+    mDefaultFontSize = mStyleMonitor.GetDefaultFontSize();
   }
 }
 
@@ -329,17 +325,11 @@ bool StyleManager::LoadFile( const std::string& filename, std::string& stringOut
 {
   DALI_ASSERT_DEBUG( 0 != filename.length());
 
-  std::ifstream in( filename.c_str(), std::ios::in );
-  if( in )
+  // as toolkit is platform agnostic, it cannot load files from filesystem
+  // ask style monitor to load the style sheet
+  if( mStyleMonitor )
   {
-    std::stringstream buffer;
-    buffer << in.rdbuf();
-
-    stringOut = buffer.str();
-
-    in.close();
-
-    return true;
+    return mStyleMonitor.LoadThemeFile( filename, stringOut );
   }
 
   return false;
@@ -368,9 +358,7 @@ void StyleManager::SetTheme()
   mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
   if ( LoadJSON( mThemeBuilder, mThemeFile ) )
   {
-    StyleChange change;
-    change.themeChange = true;
-    mStyleChangeSignal.Emit( Toolkit::StyleManager::Get(), change );
+    mStyleChangeSignal.Emit( Toolkit::StyleManager::Get(), StyleChange::THEME_CHANGE );
   }
   else
   {
@@ -394,11 +382,36 @@ void StyleManager::CacheBuilder( Toolkit::Builder builder, const std::string& ke
   mBuilderCache[ key ] = builder;
 }
 
-void StyleManager::StyleMonitorChange( StyleMonitor styleMonitor, StyleChange styleChange )
+void StyleManager::StyleMonitorChange( StyleMonitor styleMonitor, StyleChange::Type styleChange )
 {
-  if( styleChange.defaultFontSizeChange )
+  switch ( styleChange )
   {
-    mDefaultFontSize = styleMonitor.GetDefaultFontSize();
+    case StyleChange::DEFAULT_FONT_CHANGE:
+    {
+      break;
+    }
+
+    case StyleChange::DEFAULT_FONT_SIZE_CHANGE:
+    {
+      mDefaultFontSize = styleMonitor.GetDefaultFontSize();
+      break;
+    }
+
+    case StyleChange::THEME_CHANGE:
+    {
+      const std::string& newTheme = styleMonitor.GetTheme();
+      if( ! newTheme.empty() )
+      {
+        mThemeFile = newTheme;
+      }
+      else
+      {
+        mThemeFile = DEFAULT_THEME;
+      }
+
+      SetTheme();
+      break;
+    }
   }
 
   mStyleChangeSignal.Emit( Toolkit::StyleManager::Get(), styleChange );
index 09d0c13..c612f7d 100644 (file)
 
 // 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/public-api/common/vector-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>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/styling/style-manager.h>
-#include <dali-toolkit/public-api/builder/builder.h>
+#include <dali-toolkit/devel-api/styling/style-manager.h>
+#include <dali-toolkit/devel-api/builder/builder.h>
 
 namespace Dali
 {
@@ -140,7 +140,7 @@ public:
 
 private:
 
-  typedef std::list<std::string> StringList;
+  typedef std::vector<std::string> StringList;
 
   /**
    * @brief Internal helper method to read a file from file system.
@@ -222,9 +222,9 @@ private:
    * Callback for when style monitor raises a signal
    *
    * @param[in] styleMonitor The style monitor object
-   * @param[in] styleChange The style change data
+   * @param[in] styleChange The style change type
    */
-  void StyleMonitorChange( StyleMonitor styleMonitor, StyleChange styleChange );
+  void StyleMonitorChange( StyleMonitor styleMonitor, StyleChange::Type styleChange );
 
   // Undefined
   StyleManager(const StyleManager&);
@@ -237,6 +237,7 @@ private:
   typedef std::map< std::string, Toolkit::Builder > BuilderMap;
 
   Toolkit::Builder mThemeBuilder;     ///< Builder for all default theme properties
+  StyleMonitor mStyleMonitor;         ///< Style monitor handle
 
   Orientation mOrientation;           ///< Handle to application orientation object
   int mOrientationDegrees;            ///< Directly set value of orientation
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 6f1cc1a..e92866b 100644 (file)
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/actors/layer.h>
-#include <dali/public-api/actors/mesh-actor.h>
+#include <dali/devel-api/actors/mesh-actor.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/constants.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/events/tap-gesture.h>
 #include <dali/public-api/events/tap-gesture-detector.h>
+#include <dali/public-api/events/touch-event.h>
 #include <dali/public-api/events/pan-gesture.h>
 #include <dali/public-api/events/pan-gesture-detector.h>
-#include <dali/public-api/geometry/mesh.h>
-#include <dali/public-api/geometry/mesh-data.h>
+#include <dali/devel-api/geometry/mesh.h>
+#include <dali/devel-api/geometry/mesh-data.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/math/vector2.h>
@@ -47,7 +48,7 @@
 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
 #include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
-#include <dali-toolkit/public-api/controls/text-controls/text-selection-popup.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
 
 #ifdef DEBUG_ENABLED
 #define DECORATOR_DEBUG
@@ -530,6 +531,7 @@ struct Decorator::Impl : public ConnectionTracker
       grabHandle.grabArea.SetSizeModeFactor( DEFAULT_GRAB_HANDLE_RELATIVE_SIZE );
       grabHandle.actor.Add( grabHandle.grabArea );
 
+      grabHandle.grabArea.TouchedSignal().Connect( this, &Decorator::Impl::OnGrabHandleTouched );
       mTapDetector.Attach( grabHandle.grabArea );
       mPanGestureDetector.Attach( grabHandle.grabArea );
 
@@ -733,10 +735,6 @@ struct Decorator::Impl : public ConnectionTracker
     if( Gesture::Started == gesture.state )
     {
       handle.grabDisplacementX = handle.grabDisplacementY = 0;
-      if( mHandleImages[type][HANDLE_IMAGE_PRESSED] )
-      {
-        handle.actor.SetImage( mHandleImages[type][HANDLE_IMAGE_PRESSED] );
-      }
     }
 
     handle.grabDisplacementX += gesture.displacement.x;
@@ -754,7 +752,7 @@ struct Decorator::Impl : public ConnectionTracker
         mHandleScrolling = type;
         StartScrollTimer();
       }
-      else if( x > mTextControlParent.GetControlSize().width - mScrollThreshold )
+      else if( x > mTextControlParent.Self().GetTargetSize().width - mScrollThreshold )
       {
         mScrollDirection = SCROLL_LEFT;
         mHandleScrolling = type;
@@ -804,16 +802,42 @@ struct Decorator::Impl : public ConnectionTracker
     }
   }
 
+  bool OnGrabHandleTouched( Actor actor, const TouchEvent& event )
+  {
+    // Switch between pressed/release grab-handle images
+    if( event.GetPointCount() > 0 &&
+        mHandle[GRAB_HANDLE].actor )
+    {
+      const TouchPoint& point = event.GetPoint(0);
+
+      if( TouchPoint::Down == point.state &&
+          mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_PRESSED] )
+      {
+        mHandle[GRAB_HANDLE].actor.SetImage( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_PRESSED] );
+      }
+      else if( TouchPoint::Up == point.state &&
+               mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] )
+      {
+        mHandle[GRAB_HANDLE].actor.SetImage( mHandleImages[GRAB_HANDLE][HANDLE_IMAGE_RELEASED] );
+      }
+    }
+
+    // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
+    return true;
+  }
+
   bool OnHandleOneTouched( Actor actor, const TouchEvent& touch )
   {
     // TODO
-    return false;
+    // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
+    return true;
   }
 
   bool OnHandleTwoTouched( Actor actor, const TouchEvent& touch )
   {
     // TODO
-    return false;
+    // Consume to avoid pop-ups accidentally closing, when handle is outside of pop-up area
+    return true;
   }
 
   // Popup
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 c596045..47db1e2 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>
@@ -455,8 +455,7 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
         {
           validateFontsPerScript = new ValidateFontsPerScript();
 
-          mValidFontsPerScriptCache.PushBack( validateFontsPerScript );
-          validFontsPerScriptCacheBuffer = mValidFontsPerScriptCache.Begin();
+          *( validFontsPerScriptCacheBuffer + script ) = validateFontsPerScript;
         }
 
         if( NULL != validateFontsPerScript )
index ccb0efc..37f7ee1 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 9e8a3fa..58f7fc1 100644 (file)
 // EXTERNAL INCLUDES
 #include <dali/dali.h>
 #include <dali/integration-api/debug.h>
-#include <dali/public-api/text-abstraction/text-abstraction.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/devel-api/actors/mesh-actor.h>
+#include <dali/devel-api/geometry/mesh.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>
 #include <dali-toolkit/internal/text/rendering/shaders/text-bgra-shader.h>
@@ -134,9 +138,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 )
@@ -177,7 +181,7 @@ struct AtlasRenderer::Impl : public ConnectionTracker
           }
         }
 
-        Vector2 position = positions[ i ];
+        const Vector2& position = positions[ i ];
         MeshData newMeshData;
         mGlyphManager.Cached( glyph.fontId, glyph.index, slot );
 
@@ -692,21 +696,25 @@ Text::RendererPtr AtlasRenderer::New()
 
 RenderableActor 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(),
@@ -716,6 +724,7 @@ RenderableActor AtlasRenderer::Render( Text::ViewInterface& view )
                       view.GetUnderlineColor(),
                       view.GetUnderlineHeight() );
   }
+
   return mImpl->mActor;
 }
 
index 68ba70c..5937c91 100644 (file)
 #include <dali-toolkit/internal/text/rendering/basic/text-basic-renderer.h>
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/text-abstraction/font-client.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/actors/mesh-actor.h>
-#include <dali/public-api/images/atlas.h>
-#include <dali/public-api/geometry/mesh.h>
+#include <dali/devel-api/actors/mesh-actor.h>
+#include <dali/devel-api/images/atlas.h>
+#include <dali/devel-api/geometry/mesh.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>
 
@@ -347,18 +348,23 @@ RenderableActor 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 );
 
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 d89a935..3889793 100644 (file)
@@ -19,7 +19,7 @@
 #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>
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 f77714c..35c43b0 100644 (file)
@@ -1041,40 +1041,116 @@ void Controller::Impl::UpdateCursorPosition()
     return;
   }
 
-  CursorInfo cursorInfo;
-  GetCursorPosition( mEventData->mPrimaryCursorPosition,
-                     cursorInfo );
+  if( IsShowingPlaceholderText() )
+  {
+    // Do not want to use the place-holder text to set the cursor position.
 
-  const Vector2 offset = mEventData->mScrollPosition + mAlignmentOffset;
-  const Vector2 cursorPosition = cursorInfo.primaryPosition + offset;
+    // Use the line's height of the font's family set to set the cursor's size.
+    // If there is no font's family set, use the default font.
+    // Use the current alignment to place the cursor at the beginning, center or end of the box.
 
-  // Sets the cursor position.
-  mEventData->mDecorator->SetPosition( PRIMARY_CURSOR,
-                                       cursorPosition.x,
-                                       cursorPosition.y,
-                                       cursorInfo.primaryCursorHeight,
-                                       cursorInfo.lineHeight );
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Primary cursor position: %f,%f\n", cursorPosition.x, cursorPosition.y );
+    float lineHeight = 0.f;
 
-  // Sets the grab handle position.
-  mEventData->mDecorator->SetPosition( GRAB_HANDLE,
-                                       cursorPosition.x,
-                                       cursorPosition.y,
-                                       cursorInfo.lineHeight );
+    FontId defaultFontId = 0u;
+    if( NULL == mFontDefaults )
+    {
+      defaultFontId = mFontClient.GetFontId( EMPTY_STRING,
+                                             EMPTY_STRING );
+    }
+    else
+    {
+      defaultFontId = mFontDefaults->GetFontId( mFontClient );
+    }
 
-  if( cursorInfo.isSecondaryCursor )
-  {
-    mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_BOTH );
-    mEventData->mDecorator->SetPosition( SECONDARY_CURSOR,
-                                         cursorInfo.secondaryPosition.x + offset.x,
-                                         cursorInfo.secondaryPosition.y + offset.y,
-                                         cursorInfo.secondaryCursorHeight,
-                                         cursorInfo.lineHeight );
-    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Secondary cursor position: %f,%f\n", cursorInfo.secondaryPosition.x + offset.x, cursorInfo.secondaryPosition.y + offset.y );
+    Text::FontMetrics fontMetrics;
+    mFontClient.GetFontMetrics( defaultFontId, fontMetrics );
+
+    lineHeight = fontMetrics.ascender - fontMetrics.descender;
+
+
+    Vector2 cursorPosition;
+
+    switch( mLayoutEngine.GetHorizontalAlignment() )
+    {
+      case LayoutEngine::HORIZONTAL_ALIGN_BEGIN:
+      {
+        cursorPosition.x = 1.f;
+        break;
+      }
+      case LayoutEngine::HORIZONTAL_ALIGN_CENTER:
+      {
+        cursorPosition.x = floor( 0.5f * mControlSize.width );
+        break;
+      }
+      case LayoutEngine::HORIZONTAL_ALIGN_END:
+      {
+        cursorPosition.x = mControlSize.width;
+        break;
+      }
+    }
+
+    switch( mLayoutEngine.GetVerticalAlignment() )
+    {
+      case LayoutEngine::VERTICAL_ALIGN_TOP:
+      {
+        cursorPosition.y = 0.f;
+        break;
+      }
+      case LayoutEngine::VERTICAL_ALIGN_CENTER:
+      {
+        cursorPosition.y = floorf( 0.5f * ( mControlSize.height - lineHeight ) );
+        break;
+      }
+      case LayoutEngine::VERTICAL_ALIGN_BOTTOM:
+      {
+        cursorPosition.y = mControlSize.height - lineHeight;
+        break;
+      }
+    }
+
+    mEventData->mDecorator->SetPosition( PRIMARY_CURSOR,
+                                         cursorPosition.x,
+                                         cursorPosition.y,
+                                         lineHeight,
+                                         lineHeight );
   }
   else
   {
-    mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_PRIMARY );
+    CursorInfo cursorInfo;
+    GetCursorPosition( mEventData->mPrimaryCursorPosition,
+                       cursorInfo );
+
+    const Vector2 offset = mEventData->mScrollPosition + mAlignmentOffset;
+    const Vector2 cursorPosition = cursorInfo.primaryPosition + offset;
+
+    // Sets the cursor position.
+    mEventData->mDecorator->SetPosition( PRIMARY_CURSOR,
+                                         cursorPosition.x,
+                                         cursorPosition.y,
+                                         cursorInfo.primaryCursorHeight,
+                                         cursorInfo.lineHeight );
+    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,
+                                         cursorPosition.x,
+                                         cursorPosition.y,
+                                         cursorInfo.lineHeight );
+
+    if( cursorInfo.isSecondaryCursor )
+    {
+      mEventData->mDecorator->SetActiveCursor( ACTIVE_CURSOR_BOTH );
+      mEventData->mDecorator->SetPosition( SECONDARY_CURSOR,
+                                           cursorInfo.secondaryPosition.x + offset.x,
+                                           cursorInfo.secondaryPosition.y + offset.y,
+                                           cursorInfo.secondaryCursorHeight,
+                                           cursorInfo.lineHeight );
+      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" );
 }
index 79792c9..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>
@@ -274,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();
@@ -282,6 +292,8 @@ struct Controller::Impl
     {
       imfManager.Reset(); // Will trigger a commit message
     }
+
+    ClearPreEditFlag();
   }
 
   void UpdateModel( OperationsMask operationsRequired );
index 5e7a45b..adf4e75 100644 (file)
@@ -117,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
@@ -160,7 +160,12 @@ void Controller::SetPlaceholderText( PlaceholderType type, const std::string& te
       mImpl->mEventData->mPlaceholderTextActive = text;
     }
 
-    ShowPlaceholderText();
+    // Update placeholder if there is no text
+    if( mImpl->IsShowingPlaceholderText() ||
+        0u == mImpl->mLogicalModel->mText.Count() )
+    {
+      ShowPlaceholderText();
+    }
   }
 }
 
@@ -862,7 +867,7 @@ bool Controller::DoRelayout( const Size& size,
     layoutSize = mImpl->mVisualModel->GetActualSize();
   }
 
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::DoRelayout no glyphs, view updated %s\n", ( viewUpdated ? "true" : "false" ) );
+  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "<--Controller::DoRelayout, view updated %s\n", ( viewUpdated ? "true" : "false" ) );
   return viewUpdated;
 }
 
@@ -1003,6 +1008,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 );
 
@@ -1021,6 +1031,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 );
     }
 
@@ -1038,61 +1053,73 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ
   bool maxLengthReached( false );
 
   DALI_ASSERT_DEBUG( NULL != mImpl->mEventData && "Unexpected InsertText" )
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::InsertText %p %s (%s) mPreEditFlag %d cursor %d\n",
-                 this, text.c_str(), (COMMIT == type ? "COMMIT" : "PRE_EDIT"), mImpl->mEventData->mPreEditFlag, mImpl->mEventData->mPrimaryCursorPosition );
+  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
-      {
-        // Record the start of the pre-edit text
-        mImpl->mEventData->mPreEditStartPosition = mImpl->mEventData->mPrimaryCursorPosition;
-        mImpl->mEventData->mPreEditLength = text.size();
 
-        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "mPreEditStartPosition %d mPreEditLength %d\n", mImpl->mEventData->mPreEditStartPosition, mImpl->mEventData->mPreEditLength );
+      if( COMMIT == type )
+      {
+        // 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() );
-
-    // This is a bit horrible but std::string returns a (signed) char*
-    const uint8_t* utf8 = reinterpret_cast<const uint8_t*>( text.c_str() );
+          // Record the start of the pre-edit text
+          mImpl->mEventData->mPreEditStartPosition = mImpl->mEventData->mPrimaryCursorPosition;
+        }
 
-    // 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 );
+        mImpl->mEventData->mPreEditLength = utf32Characters.Count();
+        mImpl->mEventData->mPreEditFlag = true;
 
-    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() );
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "mPreEditStartPosition %d mPreEditLength %d\n", mImpl->mEventData->mPreEditStartPosition, mImpl->mEventData->mPreEditLength );
+      }
+    }
 
     const Length numberOfCharactersInModel = mImpl->mLogicalModel->GetNumberOfCharacters();
 
@@ -1119,7 +1146,8 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ
     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 );
@@ -1131,7 +1159,7 @@ void Controller::InsertText( const std::string& text, Controller::InsertType typ
 
     mImpl->mControlInterface.MaxLengthReached();
 
-    mImpl->PreEditReset();
+    mImpl->ResetImfManager();
   }
 }
 
@@ -1178,7 +1206,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 )
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 20610c3..d1416e4 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/transition-effects/cube-transition-cross-effect.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-cross-effect.h>
 #include <dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h>
 
 namespace Dali
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..5642749 100644 (file)
@@ -28,7 +28,7 @@
 #include <dali/public-api/images/resource-image.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/transition-effects/cube-transition-effect.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
 
 namespace Dali
 {
@@ -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 564738c..0afee71 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/transition-effects/cube-transition-fold-effect.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-fold-effect.h>
 #include <dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h>
 
 namespace Dali
index a99f075..baa0a14 100644 (file)
@@ -21,7 +21,7 @@
 // EXTERNAL INCLUDES
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/transition-effects/cube-transition-wave-effect.h>
+#include <dali-toolkit/devel-api/transition-effects/cube-transition-wave-effect.h>
 #include <dali-toolkit/internal/transition-effects/cube-transition-effect-impl.h>
 
 namespace Dali
index e825767..7393a3a 100644 (file)
 #include <limits>
 #include <stack>
 #include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/actors/mesh-actor.h>
+#include <dali/devel-api/actors/mesh-actor.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
-#include <dali/public-api/geometry/mesh.h>
+#include <dali/devel-api/geometry/mesh.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>
 
@@ -37,7 +37,7 @@
 #include <dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h>
 #include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
 #include <dali-toolkit/public-api/controls/control.h>
-#include <dali-toolkit/public-api/styling/style-manager.h>
+#include <dali-toolkit/devel-api/styling/style-manager.h>
 #include <dali-toolkit/internal/styling/style-manager-impl.h>
 
 namespace Dali
@@ -49,33 +49,118 @@ namespace Toolkit
 namespace
 {
 
-#if defined(DEBUG_ENABLED)
-Integration::Log::Filter* gLogFilter  = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_CONTROL");
-#endif
-
-const float MAX_FLOAT_VALUE( std::numeric_limits<float>::max() );
-const Vector3 MAX_SIZE( MAX_FLOAT_VALUE, MAX_FLOAT_VALUE, MAX_FLOAT_VALUE );
 const float BACKGROUND_ACTOR_Z_POSITION( -0.1f );
 
+/**
+ * Creates control through type registry
+ */
 BaseHandle Create()
 {
   return Internal::Control::New();
 }
 
+/**
+ * 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
+ */
+const char* ACTION_CONTROL_ACTIVATED = "control-activated";
+static bool DoAction( BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes )
+{
+  bool ret = false;
+
+  if( object && ( 0 == strcmp( actionName.c_str(), ACTION_CONTROL_ACTIVATED ) ) )
+  {
+    Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
+    if( control )
+    {
+      // if cast succeeds there is an implementation so no need to check
+      ret = Internal::GetImplementation( control ).OnAccessibilityActivated();
+    }
+  }
+
+  return ret;
+}
+
+/**
+ * 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.
+ */
+const char* SIGNAL_KEY_EVENT = "key-event";
+const char* SIGNAL_KEY_INPUT_FOCUS_GAINED = "key-input-focus-gained";
+const char* SIGNAL_KEY_INPUT_FOCUS_LOST = "key-input-focus-lost";
+const char* SIGNAL_TAPPED = "tapped";
+const char* SIGNAL_PANNED = "panned";
+const char* SIGNAL_PINCHED = "pinched";
+const char* SIGNAL_LONG_PRESSED = "long-pressed";
+static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
+{
+  Dali::BaseHandle handle( object );
+
+  bool connected( false );
+  Toolkit::Control control = Toolkit::Control::DownCast( handle );
+  if ( control )
+  {
+    Internal::Control& controlImpl( Internal::GetImplementation( control ) );
+    connected = true;
+
+    if ( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT ) )
+    {
+      controlImpl.KeyEventSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_GAINED ) )
+    {
+      controlImpl.KeyInputFocusGainedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_LOST ) )
+    {
+      controlImpl.KeyInputFocusLostSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_TAPPED ) )
+    {
+      controlImpl.EnableGestureDetection( Gesture::Tap );
+      controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_PANNED ) )
+    {
+      controlImpl.EnableGestureDetection( Gesture::Pan );
+      controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_PINCHED ) )
+    {
+      controlImpl.EnableGestureDetection( Gesture::Pinch );
+      controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
+    }
+    else if( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESSED ) )
+    {
+      controlImpl.EnableGestureDetection( Gesture::LongPress );
+      controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
+    }
+  }
+  return connected;
+}
+
 // Setup signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Control, CustomActor, Create );
 
 // Note: Properties are registered separately below.
 
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "key-event",              SIGNAL_KEY_EVENT              )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "key-input-focus-gained", SIGNAL_KEY_INPUT_FOCUS_GAINED )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "key-input-focus-lost",   SIGNAL_KEY_INPUT_FOCUS_LOST   )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "tapped",                 SIGNAL_TAPPED                 )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "panned",                 SIGNAL_PANNED                 )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "pinched",                SIGNAL_PINCHED                )
-DALI_SIGNAL_REGISTRATION( Toolkit, Control, "long-pressed",           SIGNAL_LONG_PRESSED           )
+SignalConnectorType registerSignal1( typeRegistration, SIGNAL_KEY_EVENT, &DoConnectSignal );
+SignalConnectorType registerSignal2( typeRegistration, SIGNAL_KEY_INPUT_FOCUS_GAINED, &DoConnectSignal );
+SignalConnectorType registerSignal3( typeRegistration, SIGNAL_KEY_INPUT_FOCUS_LOST, &DoConnectSignal );
+SignalConnectorType registerSignal4( typeRegistration, SIGNAL_TAPPED, &DoConnectSignal );
+SignalConnectorType registerSignal5( typeRegistration, SIGNAL_PANNED, &DoConnectSignal );
+SignalConnectorType registerSignal6( typeRegistration, SIGNAL_PINCHED, &DoConnectSignal );
+SignalConnectorType registerSignal7( typeRegistration, SIGNAL_LONG_PRESSED, &DoConnectSignal );
 
-DALI_ACTION_REGISTRATION( Toolkit, Control, "control-activated",      ACTION_CONTROL_ACTIVATED      )
+TypeAction registerAction( typeRegistration, ACTION_CONTROL_ACTIVATED, &DoAction );
 
 DALI_TYPE_REGISTRATION_END()
 
@@ -173,16 +258,6 @@ class Control::Impl : public ConnectionTracker
 {
 public:
 
-  /**
-   * Size indices for mMinMaxSize array
-   */
-  enum
-  {
-    MIN_SIZE_INDEX = 0,
-    MAX_SIZE_INDEX = 1
-  };
-
-public:
   // Construction & Destruction
   Impl(Control& controlImpl)
   : mControlImpl( controlImpl ),
@@ -194,12 +269,9 @@ public:
     mPanGestureDetector(),
     mTapGestureDetector(),
     mLongPressGestureDetector(),
-    mCurrentSize(),
-    mNaturalSize(),
     mFlags( Control::ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
     mIsKeyboardNavigationSupported( false ),
-    mIsKeyboardFocusGroup( false ),
-    mInitialized( false )
+    mIsKeyboardFocusGroup( false )
   {
   }
 
@@ -261,7 +333,7 @@ public:
 
     if ( control )
     {
-      Control& controlImpl( control.GetImplementation() );
+      Control& controlImpl( GetImplementation( control ) );
 
       switch ( index )
       {
@@ -327,7 +399,7 @@ public:
 
     if ( control )
     {
-      Control& controlImpl( control.GetImplementation() );
+      Control& controlImpl( GetImplementation( control ) );
 
       switch ( index )
       {
@@ -347,10 +419,10 @@ public:
         {
           Property::Map map;
 
-          Actor actor = controlImpl.GetBackgroundActor();
-          if ( actor )
+          Background* back = controlImpl.mImpl->mBackground;
+          if( back )
           {
-            ImageActor imageActor = ImageActor::DownCast( actor );
+            ImageActor imageActor = ImageActor::DownCast( back->actor );
             if ( imageActor )
             {
               Image image = imageActor.GetImage();
@@ -390,14 +462,10 @@ public:
   PanGestureDetector mPanGestureDetector;
   TapGestureDetector mTapGestureDetector;
   LongPressGestureDetector mLongPressGestureDetector;
-  // @todo change all these to Vector2 when we have a chance to sanitize the public API as well
-  Vector3 mCurrentSize; ///< Stores the current control's size, this is the negotiated size
-  Vector3 mNaturalSize; ///< Stores the size set through the Actor's API. This is size the actor wants to be. Useful when reset to the initial size is needed.
 
   ControlBehaviour mFlags :CONTROL_BEHAVIOUR_FLAG_COUNT;    ///< Flags passed in from constructor.
   bool mIsKeyboardNavigationSupported :1;  ///< Stores whether keyboard navigation is supported by the control.
   bool mIsKeyboardFocusGroup :1;           ///< Stores whether the control is a focus group.
-  bool mInitialized :1;
 
   // Properties - these need to be members of Internal::Control::Impl as they need to function within this class.
   static PropertyRegistration PROPERTY_1;
@@ -432,101 +500,6 @@ Control::~Control()
   delete mImpl;
 }
 
-Vector3 Control::GetNaturalSize()
-{
-  // could be overridden in derived classes.
-  return mImpl->mNaturalSize;
-}
-
-float Control::CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension )
-{
-  // Could be overridden in derived classes.
-  return CalculateChildSizeBase( child, dimension );
-}
-
-bool Control::RelayoutDependentOnChildren( Dimension::Type dimension )
-{
-  return RelayoutDependentOnChildrenBase( dimension );
-}
-
-float Control::GetHeightForWidth( float width )
-{
-  // could be overridden in derived classes.
-  float height( 0.0f );
-  if ( mImpl->mNaturalSize.width > 0.0f )
-  {
-    height = mImpl->mNaturalSize.height * width / mImpl->mNaturalSize.width;
-  }
-  return height;
-}
-
-float Control::GetWidthForHeight( float height )
-{
-  // could be overridden in derived classes.
-  float width( 0.0f );
-  if ( mImpl->mNaturalSize.height > 0.0f )
-  {
-    width = mImpl->mNaturalSize.width * height / mImpl->mNaturalSize.height;
-  }
-  return width;
-}
-
-const Vector3& Control::GetControlSize() const
-{
-  return mImpl->mCurrentSize;
-}
-
-const Vector3& Control::GetSizeSet() const
-{
-  return mImpl->mNaturalSize;
-}
-
-void Control::SetKeyInputFocus()
-{
-  if( Self().OnStage() )
-  {
-    Toolkit::KeyInputFocusManager::Get().SetFocus(Toolkit::Control::DownCast(Self()));
-  }
-}
-
-bool Control::HasKeyInputFocus()
-{
-  bool result = false;
-  if( Self().OnStage() )
-  {
-    result = Toolkit::KeyInputFocusManager::Get().IsKeyboardListener(Toolkit::Control::DownCast(Self()));
-  }
-  return result;
-}
-
-void Control::ClearKeyInputFocus()
-{
-  if( Self().OnStage() )
-  {
-    Toolkit::KeyInputFocusManager::Get().RemoveFocus(Toolkit::Control::DownCast(Self()));
-  }
-}
-
-PinchGestureDetector Control::GetPinchGestureDetector() const
-{
-  return mImpl->mPinchGestureDetector;
-}
-
-PanGestureDetector Control::GetPanGestureDetector() const
-{
-  return mImpl->mPanGestureDetector;
-}
-
-TapGestureDetector Control::GetTapGestureDetector() const
-{
-  return mImpl->mTapGestureDetector;
-}
-
-LongPressGestureDetector Control::GetLongPressGestureDetector() const
-{
-  return mImpl->mLongPressGestureDetector;
-}
-
 void Control::SetStyleName( const std::string& styleName )
 {
   if( styleName != mImpl->mStyleName )
@@ -608,14 +581,82 @@ void Control::ClearBackground()
   }
 }
 
-Actor Control::GetBackgroundActor() const
+void Control::EnableGestureDetection(Gesture::Type type)
 {
-  if ( mImpl->mBackground )
+  if ( (type & Gesture::Pinch) && !mImpl->mPinchGestureDetector )
   {
-    return mImpl->mBackground->actor;
+    mImpl->mPinchGestureDetector = PinchGestureDetector::New();
+    mImpl->mPinchGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PinchDetected);
+    mImpl->mPinchGestureDetector.Attach(Self());
   }
 
-  return Actor();
+  if ( (type & Gesture::Pan) && !mImpl->mPanGestureDetector )
+  {
+    mImpl->mPanGestureDetector = PanGestureDetector::New();
+    mImpl->mPanGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PanDetected);
+    mImpl->mPanGestureDetector.Attach(Self());
+  }
+
+  if ( (type & Gesture::Tap) && !mImpl->mTapGestureDetector )
+  {
+    mImpl->mTapGestureDetector = TapGestureDetector::New();
+    mImpl->mTapGestureDetector.DetectedSignal().Connect(mImpl, &Impl::TapDetected);
+    mImpl->mTapGestureDetector.Attach(Self());
+  }
+
+  if ( (type & Gesture::LongPress) && !mImpl->mLongPressGestureDetector )
+  {
+    mImpl->mLongPressGestureDetector = LongPressGestureDetector::New();
+    mImpl->mLongPressGestureDetector.DetectedSignal().Connect(mImpl, &Impl::LongPressDetected);
+    mImpl->mLongPressGestureDetector.Attach(Self());
+  }
+}
+
+void Control::DisableGestureDetection(Gesture::Type type)
+{
+  if ( (type & Gesture::Pinch) && mImpl->mPinchGestureDetector )
+  {
+    mImpl->mPinchGestureDetector.Detach(Self());
+    mImpl->mPinchGestureDetector.Reset();
+  }
+
+  if ( (type & Gesture::Pan) && mImpl->mPanGestureDetector )
+  {
+    mImpl->mPanGestureDetector.Detach(Self());
+    mImpl->mPanGestureDetector.Reset();
+  }
+
+  if ( (type & Gesture::Tap) && mImpl->mTapGestureDetector )
+  {
+    mImpl->mTapGestureDetector.Detach(Self());
+    mImpl->mTapGestureDetector.Reset();
+  }
+
+  if ( (type & Gesture::LongPress) && mImpl->mLongPressGestureDetector)
+  {
+    mImpl->mLongPressGestureDetector.Detach(Self());
+    mImpl->mLongPressGestureDetector.Reset();
+  }
+}
+
+PinchGestureDetector Control::GetPinchGestureDetector() const
+{
+  return mImpl->mPinchGestureDetector;
+}
+
+PanGestureDetector Control::GetPanGestureDetector() const
+{
+  return mImpl->mPanGestureDetector;
+}
+
+TapGestureDetector Control::GetTapGestureDetector() const
+{
+  return mImpl->mTapGestureDetector;
+}
+
+LongPressGestureDetector Control::GetLongPressGestureDetector() const
+{
+  return mImpl->mLongPressGestureDetector;
 }
 
 void Control::SetKeyboardNavigationSupport(bool isSupported)
@@ -628,25 +669,30 @@ bool Control::IsKeyboardNavigationSupported()
   return mImpl->mIsKeyboardNavigationSupported;
 }
 
-void Control::Activate()
-{
-  // Inform deriving classes
-  OnActivated();
-}
-
-bool Control::OnAccessibilityPan(PanGesture gesture)
+void Control::SetKeyInputFocus()
 {
-  return false; // Accessibility pan gesture is not handled by default
+  if( Self().OnStage() )
+  {
+    Toolkit::KeyInputFocusManager::Get().SetFocus(Toolkit::Control::DownCast(Self()));
+  }
 }
 
-bool Control::OnAccessibilityTouch(const TouchEvent& touchEvent)
+bool Control::HasKeyInputFocus()
 {
-  return false; // Accessibility touch event is not handled by default
+  bool result = false;
+  if( Self().OnStage() )
+  {
+    result = Toolkit::KeyInputFocusManager::Get().IsKeyboardListener(Toolkit::Control::DownCast(Self()));
+  }
+  return result;
 }
 
-bool Control::OnAccessibilityValueChange(bool isIncrease)
+void Control::ClearKeyInputFocus()
 {
-  return false; // Accessibility value change action is not handled by default
+  if( Self().OnStage() )
+  {
+    Toolkit::KeyInputFocusManager::Get().RemoveFocus(Toolkit::Control::DownCast(Self()));
+  }
 }
 
 void Control::SetAsKeyboardFocusGroup(bool isFocusGroup)
@@ -662,82 +708,39 @@ bool Control::IsKeyboardFocusGroup()
   return Toolkit::KeyboardFocusManager::Get().IsFocusGroup(Self());
 }
 
-Actor Control::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled)
+void Control::AccessibilityActivate()
 {
-  return Actor();
+  // Inform deriving classes
+  OnAccessibilityActivated();
 }
 
-void Control::OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor)
+bool Control::OnAccessibilityActivated()
 {
+  return false; // Accessibility activation is not handled by default
 }
 
-bool Control::DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes)
+bool Control::OnAccessibilityPan(PanGesture gesture)
 {
-  bool ret = false;
-
-  if( object && ( 0 == strcmp( actionName.c_str(), ACTION_CONTROL_ACTIVATED ) ) )
-  {
-    Toolkit::Control control = Toolkit::Control::DownCast( BaseHandle( object ) );
-    if( control )
-    {
-      // if cast succeeds there is an implementation so no need to check
-      control.GetImplementation().OnActivated();
-    }
-  }
+  return false; // Accessibility pan gesture is not handled by default
+}
 
-  return ret;
+bool Control::OnAccessibilityTouch(const TouchEvent& touchEvent)
+{
+  return false; // Accessibility touch event is not handled by default
 }
 
-bool Control::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
+bool Control::OnAccessibilityValueChange(bool isIncrease)
 {
-  Dali::BaseHandle handle( object );
+  return false; // Accessibility value change action is not handled by default
+}
 
-  bool connected( false );
-  Toolkit::Control control = Toolkit::Control::DownCast( handle );
-  if ( control )
-  {
-    Control& controlImpl( control.GetImplementation() );
-    connected = true;
+Actor Control::GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled)
+{
+  return Actor();
+}
 
-    if ( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_EVENT ) )
-    {
-      controlImpl.KeyEventSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_GAINED ) )
-    {
-      controlImpl.KeyInputFocusGainedSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_KEY_INPUT_FOCUS_LOST ) )
-    {
-      controlImpl.KeyInputFocusLostSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_TAPPED ) )
-    {
-      controlImpl.EnableGestureDetection( Gesture::Tap );
-      controlImpl.GetTapGestureDetector().DetectedSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_PANNED ) )
-    {
-      controlImpl.EnableGestureDetection( Gesture::Pan );
-      controlImpl.GetPanGestureDetector().DetectedSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_PINCHED ) )
-    {
-      controlImpl.EnableGestureDetection( Gesture::Pinch );
-      controlImpl.GetPinchGestureDetector().DetectedSignal().Connect( tracker, functor );
-    }
-    else if( 0 == strcmp( signalName.c_str(), SIGNAL_LONG_PRESSED ) )
-    {
-      controlImpl.EnableGestureDetection( Gesture::LongPress );
-      controlImpl.GetLongPressGestureDetector().DetectedSignal().Connect( tracker, functor );
-    }
-    else
-    {
-      // signalName does not match any signal
-      connected = false;
-    }
-  }
-  return connected;
+void Control::OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor)
+{
 }
 
 Toolkit::Control::KeyEventSignalType& Control::KeyEventSignal()
@@ -786,9 +789,6 @@ Control::Control( ControlBehaviour behaviourFlags )
 
 void Control::Initialize()
 {
-  // Calling deriving classes
-  OnInitialize();
-
   if( mImpl->mFlags & REQUIRES_STYLE_CHANGE_SIGNALS )
   {
     Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
@@ -805,79 +805,26 @@ void Control::Initialize()
     SetKeyboardNavigationSupport( true );
   }
 
-  mImpl->mInitialized = true;
-}
-
-void Control::EnableGestureDetection(Gesture::Type type)
-{
-  if ( (type & Gesture::Pinch) && !mImpl->mPinchGestureDetector )
-  {
-    mImpl->mPinchGestureDetector = PinchGestureDetector::New();
-    mImpl->mPinchGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PinchDetected);
-    mImpl->mPinchGestureDetector.Attach(Self());
-  }
-
-  if ( (type & Gesture::Pan) && !mImpl->mPanGestureDetector )
-  {
-    mImpl->mPanGestureDetector = PanGestureDetector::New();
-    mImpl->mPanGestureDetector.DetectedSignal().Connect(mImpl, &Impl::PanDetected);
-    mImpl->mPanGestureDetector.Attach(Self());
-  }
-
-  if ( (type & Gesture::Tap) && !mImpl->mTapGestureDetector )
-  {
-    mImpl->mTapGestureDetector = TapGestureDetector::New();
-    mImpl->mTapGestureDetector.DetectedSignal().Connect(mImpl, &Impl::TapDetected);
-    mImpl->mTapGestureDetector.Attach(Self());
-  }
-
-  if ( (type & Gesture::LongPress) && !mImpl->mLongPressGestureDetector )
-  {
-    mImpl->mLongPressGestureDetector = LongPressGestureDetector::New();
-    mImpl->mLongPressGestureDetector.DetectedSignal().Connect(mImpl, &Impl::LongPressDetected);
-    mImpl->mLongPressGestureDetector.Attach(Self());
-  }
+  // Calling deriving classes
+  OnInitialize();
 }
 
-void Control::DisableGestureDetection(Gesture::Type type)
+void Control::OnInitialize()
 {
-  if ( (type & Gesture::Pinch) && mImpl->mPinchGestureDetector )
-  {
-    mImpl->mPinchGestureDetector.Detach(Self());
-    mImpl->mPinchGestureDetector.Reset();
-  }
-
-  if ( (type & Gesture::Pan) && mImpl->mPanGestureDetector )
-  {
-    mImpl->mPanGestureDetector.Detach(Self());
-    mImpl->mPanGestureDetector.Reset();
-  }
-
-  if ( (type & Gesture::Tap) && mImpl->mTapGestureDetector )
-  {
-    mImpl->mTapGestureDetector.Detach(Self());
-    mImpl->mTapGestureDetector.Reset();
-  }
-
-  if ( (type & Gesture::LongPress) && mImpl->mLongPressGestureDetector)
-  {
-    mImpl->mLongPressGestureDetector.Detach(Self());
-    mImpl->mLongPressGestureDetector.Reset();
-  }
 }
 
-void Control::OnInitialize()
+void Control::OnControlChildAdd( Actor& child )
 {
 }
 
-void Control::OnActivated()
+void Control::OnControlChildRemove( Actor& child )
 {
 }
 
-void Control::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange change )
+void Control::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
 {
   // By default the control is only interested in theme (not font) changes
-  if( change.themeChange )
+  if( change == StyleChange::THEME_CHANGE )
   {
     GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) );
   }
@@ -911,46 +858,6 @@ void Control::OnLongPress( const LongPressGesture& longPress )
 {
 }
 
-void Control::OnControlStageConnection()
-{
-}
-
-void Control::OnControlStageDisconnection()
-{
-}
-
-void Control::OnControlChildAdd( Actor& child )
-{
-}
-
-void Control::OnControlChildRemove( Actor& child )
-{
-}
-
-void Control::OnControlSizeSet( const Vector3& size )
-{
-}
-
-void Control::OnCalculateRelayoutSize( Dimension::Type dimension )
-{
-}
-
-void Control::OnLayoutNegotiated( float size, Dimension::Type dimension )
-{
-}
-
-void Control::OnRelayout( const Vector2& size, RelayoutContainer& container )
-{
-  for( unsigned int i = 0, numChildren = Self().GetChildCount(); i < numChildren; ++i )
-  {
-    container.Add( Self().GetChildAt( i ), size );
-  }
-}
-
-void Control::OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension )
-{
-}
-
 void Control::EmitKeyInputFocusSignal( bool focusGained )
 {
   Dali::Toolkit::Control handle( GetOwner() );
@@ -973,6 +880,14 @@ void Control::EmitKeyInputFocusSignal( bool focusGained )
   }
 }
 
+void Control::OnStageConnection()
+{
+}
+
+void Control::OnStageDisconnection()
+{
+}
+
 void Control::OnKeyInputFocusGained()
 {
   EmitKeyInputFocusSignal( true );
@@ -983,9 +898,38 @@ void Control::OnKeyInputFocusLost()
   EmitKeyInputFocusSignal( false );
 }
 
+void Control::OnChildAdd(Actor& child)
+{
+  // If this is the background actor, then we do not want to relayout or inform deriving classes
+  if ( mImpl->mBackground && ( child == mImpl->mBackground->actor ) )
+  {
+    return;
+  }
+
+  // Notify derived classes.
+  OnControlChildAdd( child );
+}
+
+void Control::OnChildRemove(Actor& child)
+{
+  // If this is the background actor, then we do not want to relayout or inform deriving classes
+  if ( mImpl->mBackground && ( child == mImpl->mBackground->actor ) )
+  {
+    return;
+  }
+
+  // Notify derived classes.
+  OnControlChildRemove( child );
+}
+
+void Control::OnSizeSet(const Vector3& targetSize)
+{
+  // Background is resized through size negotiation
+}
+
 void Control::OnSizeAnimation(Animation& animation, const Vector3& targetSize)
 {
-  // @todo consider animating negotiated child sizes to target size
+  // @todo size negotiate background to new size, animate as well?
 }
 
 bool Control::OnTouchEvent(const TouchEvent& event)
@@ -1008,58 +952,73 @@ bool Control::OnMouseWheelEvent(const MouseWheelEvent& event)
   return false; // Do not consume
 }
 
-void Control::OnStageConnection()
+void Control::OnRelayout( const Vector2& size, RelayoutContainer& container )
 {
-  // Notify derived classes.
-  OnControlStageConnection();
+  for( unsigned int i = 0, numChildren = Self().GetChildCount(); i < numChildren; ++i )
+  {
+    container.Add( Self().GetChildAt( i ), size );
+  }
 }
 
-void Control::OnStageDisconnection()
+void Control::OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension )
 {
-  // Notify derived classes
-  OnControlStageDisconnection();
 }
 
-void Control::OnChildAdd(Actor& child)
+Vector3 Control::GetNaturalSize()
 {
-  // If this is the background actor, then we do not want to relayout or inform deriving classes
-  if ( mImpl->mBackground && ( child == mImpl->mBackground->actor ) )
+  if( mImpl->mBackground )
   {
-    return;
+    Actor actor = mImpl->mBackground->actor;
+    if( actor )
+    {
+      return actor.GetNaturalSize();
+    }
   }
+  return Vector3();
+}
 
-  // Notify derived classes.
-  OnControlChildAdd( child );
+float Control::CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension )
+{
+  return CalculateChildSizeBase( child, dimension );
 }
 
-void Control::OnChildRemove(Actor& child)
+float Control::GetHeightForWidth( float width )
 {
-  // If this is the background actor, then we do not want to relayout or inform deriving classes
-  if ( mImpl->mBackground && ( child == mImpl->mBackground->actor ) )
+  if( mImpl->mBackground )
   {
-    return;
+    Actor actor = mImpl->mBackground->actor;
+    if( actor )
+    {
+      return actor.GetHeightForWidth( width );
+    }
   }
-
-  // Notify derived classes.
-  OnControlChildRemove( child );
+  return GetHeightForWidthBase( width );
 }
 
-void Control::OnSizeSet(const Vector3& targetSize)
+float Control::GetWidthForHeight( float height )
 {
-  if( targetSize != mImpl->mNaturalSize )
+  if( mImpl->mBackground )
   {
-    // Only updates size if set through Actor's API
-    mImpl->mNaturalSize = targetSize;
+    Actor actor = mImpl->mBackground->actor;
+    if( actor )
+    {
+      return actor.GetWidthForHeight( height );
+    }
   }
+  return GetWidthForHeightBase( height );
+}
 
-  if( targetSize != mImpl->mCurrentSize )
-  {
-    // Update control size.
-    mImpl->mCurrentSize = targetSize;
+bool Control::RelayoutDependentOnChildren( Dimension::Type dimension )
+{
+  return RelayoutDependentOnChildrenBase( dimension );
+}
 
-    // Notify derived classes.
-    OnControlSizeSet( targetSize );
-  }
+void Control::OnCalculateRelayoutSize( Dimension::Type dimension )
+{
+}
+
+void Control::OnLayoutNegotiated( float size, Dimension::Type dimension )
+{
 }
 
 void Control::SignalConnected( SlotObserver* slotObserver, CallbackBase* callback )
@@ -1072,6 +1031,22 @@ void Control::SignalDisconnected( SlotObserver* slotObserver, CallbackBase* call
   mImpl->SignalDisconnected( slotObserver, callback );
 }
 
+Control& GetImplementation( Dali::Toolkit::Control& handle )
+{
+  CustomActorImpl& customInterface = handle.GetImplementation();
+  // downcast to control
+  Control& impl = dynamic_cast< Internal::Control& >( customInterface );
+  return impl;
+}
+
+const Control& GetImplementation( const Dali::Toolkit::Control& handle )
+{
+  const CustomActorImpl& customInterface = handle.GetImplementation();
+  // downcast to control
+  const Control& impl = dynamic_cast< const Internal::Control& >( customInterface );
+  return impl;
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index 35e679f..8ffcbda 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>
@@ -36,16 +35,13 @@ namespace Dali
 
 namespace Toolkit
 {
-
 class StyleManager;
 
-namespace Internal DALI_INTERNAL
-{
-class KeyInputFocusManager;
-}
-
 namespace Internal
 {
+class FocusManager;
+class KeyboardFocusManager;
+class KeyInputFocusManager;
 
 /**
  * @brief This is the internal base class for all controls.
@@ -58,6 +54,8 @@ class DALI_IMPORT_API Control : public CustomActorImpl, public ConnectionTracker
 {
 public:
 
+  class Extension; ///< Forward declare future extension interface
+
   // Creation & Destruction
 
   /**
@@ -73,55 +71,61 @@ public:
    */
   virtual ~Control();
 
-  // Size negotiation
+  // Styling
 
   /**
-   * @copydoc Dali::CustomActorImpl::GetHeightForWidth()
+   * @copydoc Dali::Toolkit::Control::SetStyleName
    */
-  virtual float GetHeightForWidth( float width );
+  void SetStyleName( const std::string& styleName );
 
   /**
-   * @copydoc Dali::CustomActorImpl::GetWidthForHeight()
+   * @copydoc Dali::Toolkit::Control::GetStyleName
    */
-  virtual float GetWidthForHeight( float height );
+  const std::string& GetStyleName() const;
+
+  // Background
 
   /**
-   * @copydoc Toolkit::Control::GetNaturalSize()
+   * @copydoc Dali::Toolkit::Control::SetBackgroundColor
    */
-  virtual Vector3 GetNaturalSize();
+  void SetBackgroundColor( const Vector4& color );
 
   /**
-   * @brief Retrieves the current Control's size.
-   *
-   * @return The control's size.
+   * @copydoc Dali::Toolkit::Control::GetBackgroundColor
    */
-  const Vector3& GetControlSize() const;
+  Vector4 GetBackgroundColor() const;
 
   /**
-   * @brief Retrieves the Control's size set by the Application / Control.
-   *
-   * @return The control's size.
+   * @copydoc Dali::Toolkit::Control::SetBackgroundImage
    */
-  const Vector3& GetSizeSet() const;
-
-  // Key Input
+  void SetBackgroundImage( Image image );
 
   /**
-   * @copydoc Toolkit::Control::SetKeyInputFocus()
+   * @copydoc Dali::Toolkit::Control::ClearBackground
    */
-  void SetKeyInputFocus();
+  void ClearBackground();
+
+  // Gesture Detection
 
   /**
-   * @copydoc Toolkit::Control::HasKeyInputFocus()
+   * @brief Allows deriving classes to enable any of the gesture detectors that are available.
+   *
+   * Gesture detection can be enabled one at a time or in bitwise format as shown:
+   * @code
+   * EnableGestureDetection(Gesture::Type(Gesture::Pinch | Gesture::Tap | Gesture::Pan));
+   * @endcode
+   * @param[in]  type  The gesture type(s) to enable.
    */
-  bool HasKeyInputFocus();
+  void EnableGestureDetection( Gesture::Type type );
 
   /**
-   * @copydoc Toolkit::Control::ClearKeyInputFocus()
+   * @brief Allows deriving classes to disable any of the gesture detectors.
+   *
+   * Like EnableGestureDetection, this can also be called using bitwise or.
+   * @param[in]  type  The gesture type(s) to disable.
+   * @see EnableGetureDetection
    */
-  void ClearKeyInputFocus();
-
-  // Gesture Detection
+  void DisableGestureDetection( Gesture::Type type );
 
   /**
    * @brief If deriving classes wish to fine tune pinch gesture
@@ -167,43 +171,6 @@ public:
    */
   LongPressGestureDetector GetLongPressGestureDetector() const;
 
-  // Background
-
-  /**
-   * @copydoc Dali::Toolkit::Control::SetStyleName
-   */
-  void SetStyleName( const std::string& styleName );
-
-  /**
-   * @copydoc Dali::Toolkit::Control::GetStyleName
-   */
-  const std::string& GetStyleName() const;
-
-  /**
-   * @copydoc Dali::Toolkit::Control::SetBackgroundColor
-   */
-  void SetBackgroundColor( const Vector4& color );
-
-  /**
-   * @copydoc Dali::Toolkit::Control::GetBackgroundColor
-   */
-  Vector4 GetBackgroundColor() const;
-
-  /**
-   * @copydoc Dali::Toolkit::Control::SetBackgroundImage
-   */
-  void SetBackgroundImage( Image image );
-
-  /**
-   * @copydoc Dali::Toolkit::Control::ClearBackground
-   */
-  void ClearBackground();
-
-  /**
-   * @copydoc Dali::Toolkit::Control::GetBackgroundActor
-   */
-  Actor GetBackgroundActor() const;
-
   // Keyboard Navigation
 
   /**
@@ -214,7 +181,7 @@ public:
    * The control doesn't support it by default.
    * @param[in] isSupported Whether this control supports two dimensional keyboard navigation.
    */
-  void SetKeyboardNavigationSupport(bool isSupported);
+  void SetKeyboardNavigationSupport( bool isSupported );
 
   /**
    * @brief Gets whether this control supports two dimensional keyboard navigation.
@@ -223,39 +190,22 @@ public:
    */
   bool IsKeyboardNavigationSupported();
 
-  // Called by Focus Managers
-
-  /**
-   * @brief Called by the focus manager and keyboard focus manager to Activate the Control
-   */
-  DALI_INTERNAL void Activate();
+  // Key Input
 
   /**
-   * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
-   * pan gesture.
-   *
-   * @param[in] gesture The pan gesture.
-   * @return true if the pan gesture has been consumed by this control
+   * @copydoc Toolkit::Control::SetKeyInputFocus()
    */
-  virtual bool OnAccessibilityPan(PanGesture gesture);
+  void SetKeyInputFocus();
 
   /**
-   * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
-   * touch event.
-   *
-   * @param[in] touchEvent The touch event.
-   * @return true if the touch event has been consumed by this control
+   * @copydoc Toolkit::Control::HasKeyInputFocus()
    */
-  virtual bool OnAccessibilityTouch(const TouchEvent& touchEvent);
+  bool HasKeyInputFocus();
 
   /**
-   * @brief This method should be overridden by deriving classes when they wish to respond
-   * the accessibility up and down action (i.e. value change of slider control).
-   *
-   * @param[in] isIncrease Whether the value should be increased or decreased
-   * @return true if the value changed action has been consumed by this control
+   * @copydoc Toolkit::Control::ClearKeyInputFocus()
    */
-  virtual bool OnAccessibilityValueChange(bool isIncrease);
+  void ClearKeyInputFocus();
 
   // Keyboard Focus
 
@@ -266,7 +216,7 @@ public:
    * can be limitied to its child actors). The control is not a focus group by default.
    * @param[in] isFocusGroup Whether this control is set as a focus group for keyboard navigation.
    */
-  void SetAsKeyboardFocusGroup(bool isFocusGroup);
+  void SetAsKeyboardFocusGroup( bool isFocusGroup );
 
   /**
    * @brief Gets whether this control is a focus group for keyboard navigation.
@@ -275,26 +225,39 @@ public:
    */
   bool IsKeyboardFocusGroup();
 
+  // Called by Focus Manager
+
   /**
-   * @brief Gets the next keyboard focusable actor in this control towards the given direction.
-   *
-   * A control needs to override this function in order to support two dimensional keyboard navigation.
-   * @param[in] currentFocusedActor The current focused actor.
-   * @param[in] direction The direction to move the focus towards.
-   * @param[in] loopEnabled Whether the focus movement should be looped within the control.
-   * @return the next keyboard focusable actor in this control or an empty handle if no actor can be focused.
+   * @brief Called by the focus manager and keyboard focus manager to Activate the Control
    */
-  virtual Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled);
+  DALI_INTERNAL void AccessibilityActivate();
+
+  // Signals
 
   /**
-   * @brief Informs this control that its chosen focusable actor will be focused.
-   *
-   * This allows the application to preform any actions if wishes
-   * before the focus is actually moved to the chosen actor.
+   * @copydoc Dali::Toolkit::Control::KeyEventSignal()
+   */
+  Toolkit::Control::KeyEventSignalType& KeyEventSignal();
+
+  /**
+   * @copydoc Dali::Toolkit::Control::KeyInputFocusGainedSignal()
+   */
+  Toolkit::Control::KeyInputFocusSignalType& KeyInputFocusGainedSignal();
+
+  /**
+   * @copydoc Dali::Toolkit::Control::KeyInputFocusLostSignal()
+   */
+  Toolkit::Control::KeyInputFocusSignalType& KeyInputFocusLostSignal();
+
+  /**
+   * @brief Called by the KeyInputFocusManager to emit key event signals.
    *
-   * @param[in] commitedFocusableActor The commited focusable actor.
+   * @param[in] event The key event.
+   * @return True if the event was consumed.
    */
-  virtual void OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor);
+  DALI_INTERNAL bool EmitKeyEventSignal( const KeyEvent& event );
+
+protected: // For derived classes to call
 
   /**
    * @brief Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal
@@ -305,198 +268,140 @@ public:
    */
   void EmitKeyInputFocusSignal( bool focusGained );
 
-  // Actions & Signals
+protected: // From CustomActorImpl, not to be used by application developers
 
   /**
-   * @brief 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
+   * @copydoc CustomActorImpl::OnStageConnection()
    */
-  static bool DoAction(BaseObject* object, const std::string& actionName, const PropertyValueContainer& attributes);
+  virtual void OnStageConnection();
 
   /**
-   * 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.
+   * @copydoc CustomActorImpl::OnStageDisconnection()
    */
-  static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+  virtual void OnStageDisconnection();
 
   /**
-   * @copydoc Dali::Toolkit::Control::KeyEventSignal()
+   * @copydoc CustomActorImpl::OnChildAdd()
    */
-  Toolkit::Control::KeyEventSignalType& KeyEventSignal();
+  virtual void OnChildAdd( Actor& child );
 
   /**
-   * @copydoc Dali::Toolkit::Control::KeyInputFocusGainedSignal()
+   * @copydoc CustomActorImpl::OnChildRemove()
    */
-  Toolkit::Control::KeyInputFocusSignalType& KeyInputFocusGainedSignal();
+  virtual void OnChildRemove( Actor& child );
 
   /**
-   * @copydoc Dali::Toolkit::Control::KeyInputFocusLostSignal()
+   * @copydoc CustomActorImpl::OnSizeSet()
    */
-  Toolkit::Control::KeyInputFocusSignalType& KeyInputFocusLostSignal();
+  virtual void OnSizeSet( const Vector3& targetSize );
 
   /**
-   * @brief Called by the KeyInputFocusManager to emit key event signals.
-   *
-   * @param[in] event The key event.
-   * @return True if the event was consumed.
+   * @copydoc CustomActorImpl::OnSizeAnimation()
    */
-  DALI_INTERNAL bool EmitKeyEventSignal(const KeyEvent& event);
-
-protected:
-
-  // Construction
-
-  // Flags for the constructor
-  enum ControlBehaviour
-  {
-    REQUIRES_STYLE_CHANGE_SIGNALS        = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 0 ),     ///< True if needs to monitor style change signals such as theme/font change
-    REQUIRES_KEYBOARD_NAVIGATION_SUPPORT = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 1 ),     ///< True if needs to support keyboard navigation
-
-    LAST_CONTROL_BEHAVIOUR_FLAG
-  };
-
-  static const int CONTROL_BEHAVIOUR_FLAG_COUNT = Log< LAST_CONTROL_BEHAVIOUR_FLAG - 1 >::value + 1;      ///< Total count of flags
+  virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize );
 
   /**
-   * @brief Create a Control.
-   *
-   * @param[in] behaviourFlags Behavioural flags from ControlBehaviour enum
+   * @copydoc CustomActorImpl::OnTouchEvent()
    */
-  Control(ControlBehaviour behaviourFlags);
+  virtual bool OnTouchEvent( const TouchEvent& event );
 
   /**
-   * @brief Second phase initialization.
+   * @copydoc CustomActorImpl::OnHoverEvent()
    */
-  void Initialize();
-
-  // Gesture Detection
+  virtual bool OnHoverEvent( const HoverEvent& event );
 
   /**
-   * @brief Allows deriving classes to enable any of the gesture detectors that are available.
-   *
-   * Gesture detection can be enabled one at a time or in bitwise format as shown:
-   * @code
-   * EnableGestureDetection(Gesture::Type(Gesture::Pinch | Gesture::Tap | Gesture::Pan));
-   * @endcode
-   * @param[in]  type  The gesture type(s) to enable.
+   * @copydoc CustomActorImpl::OnKeyEvent()
    */
-  void EnableGestureDetection(Gesture::Type type);
+  virtual bool OnKeyEvent( const KeyEvent& event );
 
   /**
-   * @brief Allows deriving classes to disable any of the gesture detectors.
-   *
-   * Like EnableGestureDetection, this can also be called using bitwise or.
-   * @param[in]  type  The gesture type(s) to disable.
-   * @see EnableGetureDetection
+   * @copydoc CustomActorImpl::OnMouseWheelEvent()
    */
-  void DisableGestureDetection(Gesture::Type type);
+  virtual bool OnMouseWheelEvent( const MouseWheelEvent& event );
 
   /**
-   * @copydoc Dali::CustomActorImpl::RelayoutDependentOnChildren()
+   * @copydoc CustomActorImpl::OnRelayout()
    */
-  virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
+  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
 
-private:
+  /**
+   * @copydoc CustomActorImpl::OnSetResizePolicy()
+   */
+  virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension );
 
-  // For derived classes to override
+  /**
+   * @copydoc CustomActorImpl::GetNaturalSize()
+   */
+  virtual Vector3 GetNaturalSize();
 
   /**
-   * @brief This method is called after the Control has been initialized.
-   *
-   * Derived classes should do any second phase initialization by overriding this method.
+   * @copydoc CustomActorImpl::CalculateChildSize()
    */
-  virtual void OnInitialize();
+  virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension );
 
   /**
-   * @brief This method is called when the control is activated.
-   *
-   * Derived classes should override this if they wish to be notified when they are activated.
+   * @copydoc CustomActorImpl::GetHeightForWidth()
    */
-  virtual void OnActivated();
+  virtual float GetHeightForWidth( float width );
 
   /**
-   * @brief This method should be overridden by deriving classes requiring notifications when the style changes.
-   *
-   * @param[in] styleManager  The StyleManager object.
-   * @param[in] change  Information denoting what has changed.
+   * @copydoc CustomActorImpl::GetWidthForHeight()
    */
-  virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange change );
+  virtual float GetWidthForHeight( float height );
 
   /**
-   * @brief Called whenever a pinch gesture is detected on this control.
-   *
-   * This can be overridden by deriving classes when pinch detection
-   * is enabled.  The default behaviour is to scale the control by the
-   * pinch scale.
-   *
-   * @note If overridden, then the default behaviour will not occur.
-   * @note Pinch detection should be enabled via EnableGestureDetection().
-   * @param[in]  pinch  The pinch gesture.
-   * @see EnableGestureDetection
+   * @copydoc CustomActorImpl::RelayoutDependentOnChildren()
    */
-  virtual void OnPinch(const PinchGesture& pinch);
+  virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS );
 
   /**
-   * @brief Called whenever a pan gesture is detected on this control.
-   *
-   * This should be overridden by deriving classes when pan detection
-   * is enabled.
-   *
-   * @note There is no default behaviour with panning.
-   * @note Pan detection should be enabled via EnableGestureDetection().
-   * @param[in]  pan  The pan gesture.
-   * @see EnableGestureDetection
+   * @copydoc CustomActorImpl::OnCalculateRelayoutSize()
    */
-  virtual void OnPan( const PanGesture& pan );
+  virtual void OnCalculateRelayoutSize( Dimension::Type dimension );
 
   /**
-   * @brief Called whenever a tap gesture is detected on this control.
-   *
-   * This should be overridden by deriving classes when tap detection
-   * is enabled.
-   *
-   * @note There is no default behaviour with a tap.
-   * @note Tap detection should be enabled via EnableGestureDetection().
-   * @param[in]  tap  The tap gesture.
-   * @see EnableGestureDetection
+   * @copydoc CustomActorImpl::OnLayoutNegotiated()
    */
-  virtual void OnTap( const TapGesture& tap );
+  virtual void OnLayoutNegotiated( float size, Dimension::Type dimension );
+
+protected: // Helpers for deriving classes
+
+  // Construction
+
+  // Flags for the constructor
+  enum ControlBehaviour
+  {
+    REQUIRES_STYLE_CHANGE_SIGNALS        = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 0 ),     ///< True if needs to monitor style change signals such as theme/font change
+    REQUIRES_KEYBOARD_NAVIGATION_SUPPORT = 1 << ( CustomActorImpl::ACTOR_FLAG_COUNT + 1 ),     ///< True if needs to support keyboard navigation
+
+    LAST_CONTROL_BEHAVIOUR_FLAG
+  };
+
+  static const int CONTROL_BEHAVIOUR_FLAG_COUNT = Log< LAST_CONTROL_BEHAVIOUR_FLAG - 1 >::value + 1;      ///< Total count of flags
 
   /**
-   * @brief Called whenever a long press gesture is detected on this control.
+   * @brief Control constructor
    *
-   * This should be overridden by deriving classes when long press
-   * detection is enabled.
-   *
-   * @note There is no default behaviour associated with a long press.
-   * @note Long press detection should be enabled via EnableGestureDetection().
-   * @param[in]  longPress  The long press gesture.
-   * @see EnableGestureDetection
+   * @param[in] behaviourFlags Behavioural flags from ControlBehaviour enum
    */
-  virtual void OnLongPress( const LongPressGesture& longPress );
+  Control( ControlBehaviour behaviourFlags );
 
   /**
-   * @brief Called whenever the control is added to the stage.
-   *
-   * Could be overridden by derived classes.
+   * @brief Second phase initialization.
    */
-  virtual void OnControlStageConnection();
+  void Initialize();
+
+public: // API for derived classes to override
+
+  // Lifecycle
 
   /**
-   * @brief Called whenever the control is removed from the stage.
+   * @brief This method is called after the Control has been initialized.
    *
-   * Could be overridden by derived classes.
+   * Derived classes should do any second phase initialization by overriding this method.
    */
-  virtual void OnControlStageDisconnection();
+  virtual void OnInitialize();
 
   /**
    * @brief Called whenever an Actor is added to the control.
@@ -516,143 +421,144 @@ private:
    */
   virtual void OnControlChildRemove( Actor& child );
 
-  /**
-   * @brief Called whenever the Control's size is set.
-   *
-   * Could be overridden by derived classes.
-   *
-   * @param[in] size The new size.
-   */
-  virtual void OnControlSizeSet( const Vector3& size );
-
-  /**
-   * @brief Called when the control gains key input focus.
-   *
-   * Should be overridden by derived classes if they need to customize what happens when focus is gained.
-   */
-  virtual void OnKeyInputFocusGained();
+  // Styling
 
   /**
-   * @brief Called when the control loses key input focus.
+   * @brief This method should be overridden by deriving classes requiring notifications when the style changes.
    *
-   * Should be overridden by derived classes if they need to customize what happens when focus is lost.
-   */
-  virtual void OnKeyInputFocusLost();
-
-  // From CustomActorImpl, derived classes can override these.
-
-  /**
-   * @copydoc Dali::CustomActorImpl::OnSizeAnimation(Animation&, const Vector3&)
+   * @param[in] styleManager  The StyleManager object.
+   * @param[in] change  Information denoting what has changed.
    */
-  virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize);
+  virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
 
-  /**
-   * @copydoc Dali::CustomActorImpl::OnTouchEvent(const TouchEvent&)
-   */
-  virtual bool OnTouchEvent(const TouchEvent& event);
+  // Accessibility
 
   /**
-   * @copydoc Dali::CustomActorImpl::OnHoverEvent(const HoverEvent&)
+   * @brief This method is called when the control is accessibility activated.
+   *
+   * Derived classes should override this to perform custom accessibility activation.
+   * @return true if this control can perform accessibility activation.
    */
-  virtual bool OnHoverEvent(const HoverEvent& event);
+  virtual bool OnAccessibilityActivated();
 
   /**
-   * @copydoc Dali::CustomActorImpl::OnKeyEvent(const KeyEvent&)
+   * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
+   * pan gesture.
+   *
+   * @param[in] gesture The pan gesture.
+   * @return true if the pan gesture has been consumed by this control
    */
-  virtual bool OnKeyEvent(const KeyEvent& event);
+  virtual bool OnAccessibilityPan( PanGesture gesture );
 
   /**
-   * @copydoc Dali::CustomActorImpl::OnMouseWheelEvent(const MouseWheelEvent&)
+   * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
+   * touch event.
+   *
+   * @param[in] touchEvent The touch event.
+   * @return true if the touch event has been consumed by this control
    */
-  virtual bool OnMouseWheelEvent(const MouseWheelEvent& event);
+  virtual bool OnAccessibilityTouch( const TouchEvent& touchEvent );
 
   /**
-   * @copydoc Dali::CustomActorImpl::OnCalculateRelayoutSize()
+   * @brief This method should be overridden by deriving classes when they wish to respond
+   * the accessibility up and down action (i.e. value change of slider control).
+   *
+   * @param[in] isIncrease Whether the value should be increased or decreased
+   * @return true if the value changed action has been consumed by this control
    */
-  virtual void OnCalculateRelayoutSize( Dimension::Type dimension );
+  virtual bool OnAccessibilityValueChange( bool isIncrease );
 
-  /**
-   * @copydoc Dali::CustomActorImpl::OnLayoutNegotiated()
-   */
-  virtual void OnLayoutNegotiated( float size, Dimension::Type dimension );
+  // Keyboard focus
 
   /**
-   * @copydoc Dali::CustomActorImpl::OnRelayout()
+   * @brief Called when the control gains key input focus.
+   *
+   * Should be overridden by derived classes if they need to customize what happens when focus is gained.
    */
-  virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+  virtual void OnKeyInputFocusGained();
 
   /**
-   * @copydoc Dali::CustomActorImpl::OnSetResizePolicy()
+   * @brief Called when the control loses key input focus.
+   *
+   * Should be overridden by derived classes if they need to customize what happens when focus is lost.
    */
-  virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension );
+  virtual void OnKeyInputFocusLost();
 
   /**
-   * @copydoc Dali::CustomActorImpl::CalculateChildSize()
+   * @brief Gets the next keyboard focusable actor in this control towards the given direction.
+   *
+   * A control needs to override this function in order to support two dimensional keyboard navigation.
+   * @param[in] currentFocusedActor The current focused actor.
+   * @param[in] direction The direction to move the focus towards.
+   * @param[in] loopEnabled Whether the focus movement should be looped within the control.
+   * @return the next keyboard focusable actor in this control or an empty handle if no actor can be focused.
    */
-  virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension );
-
-  // From CustomActorImpl, derived classes should NOT override these.
+  virtual Actor GetNextKeyboardFocusableActor( Actor currentFocusedActor, Toolkit::Control::KeyboardFocusNavigationDirection direction, bool loopEnabled );
 
   /**
-   * @brief Sends a request to relayout this control.
-   *
-   * The control will be relaid out after the
-   * Dali::Stage::SignalMessageQueueFlushed() signal is emitted.
+   * @brief Informs this control that its chosen focusable actor will be focused.
    *
-   * It calls OnControlStageConnection() to notify derived classes.
+   * This allows the application to preform any actions if wishes
+   * before the focus is actually moved to the chosen actor.
    *
-   * @see Dali::CustomActorImpl::OnStageConnection()
+   * @param[in] commitedFocusableActor The commited focusable actor.
    */
-  virtual void OnStageConnection();
+  virtual void OnKeyboardFocusChangeCommitted( Actor commitedFocusableActor );
+
+  // Gestures
 
   /**
-   * @brief Calls OnControlStageDisconnection() to notify derived classed.
+   * @brief Called whenever a pinch gesture is detected on this control.
+   *
+   * This can be overridden by deriving classes when pinch detection
+   * is enabled.  The default behaviour is to scale the control by the
+   * pinch scale.
    *
-   * @see Dali::CustomActorImpl::OnStageDisconnection()
+   * @note If overridden, then the default behaviour will not occur.
+   * @note Pinch detection should be enabled via EnableGestureDetection().
+   * @param[in]  pinch  The pinch gesture.
+   * @see EnableGestureDetection
    */
-  virtual void OnStageDisconnection();
+  virtual void OnPinch( const PinchGesture& pinch );
 
   /**
-   * @brief Sends a request to relayout this control.
-   *
-   * The control will be relaid out after the
-   * Dali::Stage::SignalMessageQueueFlushed() signal is emitted.  It
-   * calls OnControlChildAdd() to notify derived classes.
-   *
-   * @note This method shouldn't be overridden by derived classes.
+   * @brief Called whenever a pan gesture is detected on this control.
    *
-   * @param[in] child The added actor.
+   * This should be overridden by deriving classes when pan detection
+   * is enabled.
    *
-   * @see Dali::CustomActorImpl::OnChildAdd(Actor&)
+   * @note There is no default behaviour with panning.
+   * @note Pan detection should be enabled via EnableGestureDetection().
+   * @param[in]  pan  The pan gesture.
+   * @see EnableGestureDetection
    */
-  virtual void OnChildAdd(Actor& child);
+  virtual void OnPan( const PanGesture& pan );
 
   /**
-   * @brief Sends a request to relayout this control.
-   *
-   * The control will be relaid out after the
-   * Dali::Stage::SignalMessageQueueFlushed() signal is emitted.  It
-   * calls OnControlChildRemove() to notify derived classes.
-   *
-   * @note This method shouldn't be overridden by derived classes.
+   * @brief Called whenever a tap gesture is detected on this control.
    *
-   * @param[in] child The removed actor.
+   * This should be overridden by deriving classes when tap detection
+   * is enabled.
    *
-   * @see Dali::CustomActorImpl::OnChildRemove(Actor&)
+   * @note There is no default behaviour with a tap.
+   * @note Tap detection should be enabled via EnableGestureDetection().
+   * @param[in]  tap  The tap gesture.
+   * @see EnableGestureDetection
    */
-  virtual void OnChildRemove(Actor& child);
+  virtual void OnTap( const TapGesture& tap );
 
   /**
-   * @brief It stores the size set by size negotiation and relayout.
-   *
-   * It also keeps a backup of the size set through the Actor's API used in the size negotiation.
-   * It calls the OnControlSizeSet() to notify derived classes.
+   * @brief Called whenever a long press gesture is detected on this control.
    *
-   * @param[in] targetSize The new size.
+   * This should be overridden by deriving classes when long press
+   * detection is enabled.
    *
-   * @see Dali::CustomActorImpl::OnSizeSet(const Vector3&)
+   * @note There is no default behaviour associated with a long press.
+   * @note Long press detection should be enabled via EnableGestureDetection().
+   * @param[in]  longPress  The long press gesture.
+   * @see EnableGestureDetection
    */
-  virtual void OnSizeSet(const Vector3& targetSize);
+  virtual void OnLongPress( const LongPressGesture& longPress );
 
   // From ConnectionTrackerInterface
 
@@ -666,18 +572,45 @@ private:
    */
   virtual void SignalDisconnected( SlotObserver* slotObserver, CallbackBase* callback );
 
+  /**
+   * Retrieve the extension for this control
+   *
+   * @return The extension if available, NULL otherwise
+   */
+  virtual Extension* GetControlExtension()
+  {
+    return NULL;
+  }
+
 private:
 
   // Undefined
-  DALI_INTERNAL Control(const Control&);
-  DALI_INTERNAL Control& operator=(const Control&);
+  DALI_INTERNAL Control( const Control& );
+  DALI_INTERNAL Control& operator=( const Control& );
 
   class Impl;
   Impl* mImpl;
 
-  friend class Internal::KeyInputFocusManager;     ///< KeyInputFocusManager needs to call several methods which are private. // TODO: Remove
 };
 
+/**
+ * @brief Get implementation from the handle
+ *
+ * @pre handle is initialized and points to a control
+ * @param handle
+ * @return implementation
+ */
+Internal::Control& GetImplementation( Dali::Toolkit::Control& handle );
+
+/**
+ * @brief Get implementation from the handle
+ *
+ * @pre handle is initialized and points to a control
+ * @param handle
+ * @return implementation
+ */
+const Internal::Control& GetImplementation( const Dali::Toolkit::Control& handle );
+
 } // namespace Internal
 
 } // namespace Toolkit
index 5bbc4e7..18eaeeb 100644 (file)
@@ -36,8 +36,8 @@ Control::Control()
 {
 }
 
-Control::Control(const Control& uiControl)
-: CustomActor( uiControl ? static_cast< const Internal::Control& >( uiControl.GetImplementation() ).GetOwner() : NULL)
+Control::Control( const Control& uiControl )
+: CustomActor( uiControl  )
 {
 }
 
@@ -59,99 +59,84 @@ Control Control::DownCast( BaseHandle handle )
   return DownCast< Control, Internal::Control >(handle);
 }
 
-Internal::Control& Control::GetImplementation()
-{
-  return static_cast<Internal::Control&>(CustomActor::GetImplementation());
-}
-
-const Internal::Control& Control::GetImplementation() const
-{
-  return static_cast<const Internal::Control&>(CustomActor::GetImplementation());
-}
-
 void Control::SetKeyInputFocus()
 {
-  GetImplementation().SetKeyInputFocus();
+  Internal::GetImplementation(*this).SetKeyInputFocus();
 }
 
 bool Control::HasKeyInputFocus()
 {
-  return GetImplementation().HasKeyInputFocus();
+  return Internal::GetImplementation(*this).HasKeyInputFocus();
 }
 
 void Control::ClearKeyInputFocus()
 {
-  GetImplementation().ClearKeyInputFocus();
+  Internal::GetImplementation(*this).ClearKeyInputFocus();
 }
 
 PinchGestureDetector Control::GetPinchGestureDetector() const
 {
-  return GetImplementation().GetPinchGestureDetector();
+  return Internal::GetImplementation(*this).GetPinchGestureDetector();
 }
 
 PanGestureDetector Control::GetPanGestureDetector() const
 {
-  return GetImplementation().GetPanGestureDetector();
+  return Internal::GetImplementation(*this).GetPanGestureDetector();
 }
 
 TapGestureDetector Control::GetTapGestureDetector() const
 {
-  return GetImplementation().GetTapGestureDetector();
+  return Internal::GetImplementation(*this).GetTapGestureDetector();
 }
 
 LongPressGestureDetector Control::GetLongPressGestureDetector() const
 {
-  return GetImplementation().GetLongPressGestureDetector();
+  return Internal::GetImplementation(*this).GetLongPressGestureDetector();
 }
 
 void Control::SetStyleName( const std::string& styleName )
 {
-  GetImplementation().SetStyleName( styleName );
+  Internal::GetImplementation(*this).SetStyleName( styleName );
 }
 
 const std::string& Control::GetStyleName() const
 {
-  return GetImplementation().GetStyleName();
+  return Internal::GetImplementation(*this).GetStyleName();
 }
 
 void Control::SetBackgroundColor( const Vector4& color )
 {
-  GetImplementation().SetBackgroundColor( color );
+  Internal::GetImplementation(*this).SetBackgroundColor( color );
 }
 
 Vector4 Control::GetBackgroundColor() const
 {
-  return GetImplementation().GetBackgroundColor();
+  return Internal::GetImplementation(*this).GetBackgroundColor();
 }
 
 void Control::SetBackgroundImage( Image image )
 {
-  GetImplementation().SetBackgroundImage( image );
+  Internal::GetImplementation(*this).SetBackgroundImage( image );
 }
 
 void Control::ClearBackground()
 {
-  GetImplementation().ClearBackground();
-}
-
-Actor Control::GetBackgroundActor() const
-{
-  return GetImplementation().GetBackgroundActor();
+  Internal::GetImplementation(*this).ClearBackground();
 }
 
 Control::KeyEventSignalType& Control::KeyEventSignal()
 {
-  return GetImplementation().KeyEventSignal();
+  return Internal::GetImplementation(*this).KeyEventSignal();
 }
 
 Control::KeyInputFocusSignalType& Control::KeyInputFocusGainedSignal()
 {
-  return GetImplementation().KeyInputFocusGainedSignal();
+  return Internal::GetImplementation(*this).KeyInputFocusGainedSignal();
 }
 
 Control::KeyInputFocusSignalType& Control::KeyInputFocusLostSignal()
 {
-  return GetImplementation().KeyInputFocusLostSignal();
+  return Internal::GetImplementation(*this).KeyInputFocusLostSignal();
 }
 
 Control::Control(Internal::Control& implementation)
index 7e4e693..7742bb7 100644 (file)
@@ -166,20 +166,6 @@ public:
    */
   static Control DownCast( BaseHandle handle );
 
-  /**
-   * @brief Retrieve the Control implementation.
-   *
-   * @return The implementation.
-   */
-  Internal::Control& GetImplementation();
-
-  /**
-   * @brief Retrieve the Control implementation.
-   *
-   * @return The implementation.
-   */
-  const Internal::Control& GetImplementation() const;
-
   // Key Input
 
   /**
@@ -248,7 +234,7 @@ public:
    */
   LongPressGestureDetector GetLongPressGestureDetector() const;
 
-  // Background
+  // Styling
 
   /**
    * @brief Sets the name of the style to be applied to the control.
@@ -296,13 +282,6 @@ public:
    */
   void ClearBackground();
 
-  /**
-   * @brief Retrieves the actor used as the background for this control.
-   *
-   * @return The actor that used as the background for this control.
-   */
-  Actor GetBackgroundActor() const;
-
   // Signals
 
   /**
diff --git a/dali-toolkit/public-api/controls/default-controls/check-button-factory.cpp b/dali-toolkit/public-api/controls/default-controls/check-button-factory.cpp
deleted file mode 100644 (file)
index 87fbb94..0000000
+++ /dev/null
@@ -1,147 +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 "check-button-factory.h"
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/images/resource-image.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/alignment/alignment.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace
-{
-
-Alignment CreateAlignedImage( Actor image )
-{
-  Alignment alignmentContainer = Toolkit::Alignment::New();
-  alignmentContainer.SetScaling( Toolkit::Alignment::ShrinkToFitKeepAspect );
-
-  alignmentContainer.Add( image );
-
-  return alignmentContainer;
-}
-
-Alignment CreateAlignedImage( const std::string& imagePath )
-{
-  Image image = ResourceImage::New( imagePath );
-
-  return CreateAlignedImage( ImageActor::New( image ) );
-}
-
-} // namespace
-
-
-CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& selectedImagePath, const std::string& disabledBackgroundImagePath, const std::string& disabledSelectedImagePath )
-{
-  CheckBoxButton button = Toolkit::CheckBoxButton::New();
-
-  if( !backgroundImagePath.empty() )
-  {
-    button.SetBackgroundImage( CreateAlignedImage( backgroundImagePath ) );
-  }
-
-  if( !selectedImagePath.empty() )
-  {
-    button.SetSelectedImage( CreateAlignedImage( selectedImagePath ) );
-  }
-
-  if( !disabledBackgroundImagePath.empty() )
-  {
-    button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImagePath ) );
-  }
-
-  if( !disabledSelectedImagePath.empty() )
-  {
-    button.SetDisabledSelectedImage( CreateAlignedImage( disabledSelectedImagePath ) );
-  }
-
-  return button;
-}
-
-CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor selectedImageActor, Actor disabledBackgroundImageActor, Actor disabledSelectedImagActor )
-{
-  CheckBoxButton button = Toolkit::CheckBoxButton::New();
-
-  if( backgroundImageActor )
-  {
-    button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) );
-  }
-
-  if( selectedImageActor )
-  {
-    button.SetSelectedImage( CreateAlignedImage( selectedImageActor ) );
-  }
-
-  if( disabledBackgroundImageActor )
-  {
-    button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImageActor ) );
-  }
-
-  if( disabledSelectedImagActor )
-  {
-    button.SetDisabledSelectedImage( CreateAlignedImage( disabledSelectedImagActor ) );
-  }
-
-  return button;
-}
-
-CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& selectedImagePath )
-{
-  CheckBoxButton button = Toolkit::CheckBoxButton::New();
-
-  if( !backgroundImagePath.empty() )
-  {
-    button.SetBackgroundImage( CreateAlignedImage( backgroundImagePath ) );
-  }
-
-  if( !selectedImagePath.empty() )
-  {
-    button.SetSelectedImage( CreateAlignedImage( selectedImagePath ) );
-  }
-
-  return button;
-}
-
-CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor selectedImageActor )
-{
-  CheckBoxButton button = Toolkit::CheckBoxButton::New();
-
-  if( backgroundImageActor )
-  {
-    button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) );
-  }
-
-  if( selectedImageActor )
-  {
-    button.SetSelectedImage( CreateAlignedImage( selectedImageActor ) );
-  }
-
-  return button;
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/default-controls/check-button-factory.h b/dali-toolkit/public-api/controls/default-controls/check-button-factory.h
deleted file mode 100644 (file)
index e78c1b8..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef __DALI_TOOLKIT_CHECK_BUTTON_FACTORY_H__
-#define __DALI_TOOLKIT_CHECK_BUTTON_FACTORY_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/buttons/check-box-button.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-/**
- * Creates a check box button with the given images.
- * Images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Images won't be scaled to fill the whole button size.
- * @note If an image path is empty, this image is not set to the button.
- *
- * @param[in] backgroundImagePath Image path to be shown as button background.
- * @param[in] selectedImagePath Image path to be shown as selected button.
- * @param[in] disabledBackgroundImagePath Image path to be shown as button isabled background.
- * @param[in] disabledSelectedImagePath Image path to be shown as disabled selected button.
- */
-DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& selectedImagePath, const std::string& disabledBackgroundImagePath, const std::string& disabledSelectedImagePath );
-
-/**
- * Creates a check box button with the given images.
- * Images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Images won't be scaled to fill the whole button size.
- * @note If an image is an empty handle, this image is not set to the button.
- *
- * @param[in] backgroundImageActor  Image to be shown as button background.
- * @param[in] selectedImageActor  Image to be shown as selected button.
- * @param[in] disabledBackgroundImageActor Image to be shown as button disabled background.
- * @param[in] disabledSelectedImagActor Image to be shown as disabled selected button.
- */
-DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor selectedImageActor, Actor disabledBackgroundImageActor, Actor disabledSelectedImagActor );
-
-/**
- * Creates a check box button with the given background and selected images.
- * Background and selected images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Background and selected images won't be scaled to fill the whole button size.
- *
- * @param[in] backgroundImagePath  Image path to be shown as button background.
- * @param[in] selectedImagePath  Image path to be shown as selected button.
- */
-DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( const std::string& backgroundImagePath, const std::string& selectedImagePath );
-
-/**
- * Creates a check box button with the given background and selected images.
- * Background and selected images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Background and selected images won't be scaled to fill the whole button size.
- *
- * @param[in] backgroundImageActor  Image to be shown as button background.
- * @param[in] selectedImageActor  Image to be shown as selected button.
- */
-DALI_IMPORT_API CheckBoxButton CreateCheckBoxButton( Actor backgroundImageActor, Actor selectedImageActor );
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_CHECK_BUTTON_FACTORY_H__
diff --git a/dali-toolkit/public-api/controls/default-controls/push-button-factory.cpp b/dali-toolkit/public-api/controls/default-controls/push-button-factory.cpp
deleted file mode 100644 (file)
index 6558ed5..0000000
+++ /dev/null
@@ -1,148 +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.
- *
- */
-
-// HEADER
-#include <dali-toolkit/public-api/controls/default-controls/push-button-factory.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
-#include <dali/public-api/images/resource-image.h>
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/alignment/alignment.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace
-{
-
-Alignment CreateAlignedImage( Actor image )
-{
-  Alignment alignmentContainer = Toolkit::Alignment::New();
-  alignmentContainer.SetScaling( Toolkit::Alignment::ShrinkToFitKeepAspect );
-
-  alignmentContainer.Add( image );
-
-  return alignmentContainer;
-}
-
-Alignment CreateAlignedImage( const std::string& imagePath )
-{
-  Image image = ResourceImage::New( imagePath );
-  return CreateAlignedImage( ImageActor::New( image ) );
-}
-
-} // namespace
-
-
-PushButton CreatePushButton( const std::string& unselectedImagePath, const std::string& selectedImagePath, const std::string& backgroundImagePath,
-                             const std::string& disabledUnselectedImagePath, const std::string& disabledBackgroundImagePath )
-{
-  PushButton button = Toolkit::PushButton::New();
-
-  if( !unselectedImagePath.empty() )
-  {
-    button.SetButtonImage( CreateAlignedImage( unselectedImagePath ) );
-  }
-
-  if( !selectedImagePath.empty() )
-  {
-    button.SetSelectedImage( CreateAlignedImage( selectedImagePath ) );
-  }
-
-  if( !backgroundImagePath.empty() )
-  {
-    button.SetBackgroundImage( CreateAlignedImage( backgroundImagePath ) );
-  }
-
-  if( !disabledUnselectedImagePath.empty() )
-  {
-    button.SetDisabledImage( CreateAlignedImage( disabledUnselectedImagePath ) );
-  }
-
-  if( !disabledBackgroundImagePath.empty() )
-  {
-    button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImagePath ) );
-  }
-
-  return button;
-}
-
-PushButton CreatePushButton( Actor unselectedImageActor, Actor selectedImageActor, Actor backgroundImageActor,
-                             Actor disabledUnselectedImageActor, Actor disabledBackgroundImageActor )
-{
-  PushButton button = Toolkit::PushButton::New();
-
-  if( unselectedImageActor )
-  {
-    button.SetButtonImage( CreateAlignedImage( unselectedImageActor ) );
-  }
-
-  if( selectedImageActor )
-  {
-    button.SetSelectedImage( CreateAlignedImage( selectedImageActor ) );
-  }
-
-  if( backgroundImageActor )
-  {
-    button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) );
-  }
-
-  if( disabledUnselectedImageActor )
-  {
-    button.SetDisabledImage( CreateAlignedImage( disabledUnselectedImageActor ) );
-  }
-
-  if( disabledBackgroundImageActor )
-  {
-    button.SetDisabledBackgroundImage( CreateAlignedImage( disabledBackgroundImageActor ) );
-  }
-
-  return button;
-}
-
-PushButton CreatePushButton( const std::string& backgroundImagePath )
-{
-  PushButton button = Toolkit::PushButton::New();
-
-  if( !backgroundImagePath.empty() )
-  {
-    button.SetBackgroundImage( CreateAlignedImage( backgroundImagePath ) );
-  }
-
-  return button;
-}
-
-PushButton CreatePushButton( Actor backgroundImageActor )
-{
-  PushButton button = Toolkit::PushButton::New();
-
-  if( backgroundImageActor )
-  {
-    button.SetBackgroundImage( CreateAlignedImage( backgroundImageActor ) );
-  }
-
-  return button;
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/default-controls/push-button-factory.h b/dali-toolkit/public-api/controls/default-controls/push-button-factory.h
deleted file mode 100644 (file)
index c04991d..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef __DALI_TOOLKIT_PUSH_BUTTON_FACTORY_H__
-#define __DALI_TOOLKIT_PUSH_BUTTON_FACTORY_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/buttons/push-button.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-/**
- * @brief Creates a push button with the given images.
- * Images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Images won't be scaled to fill the whole button size.
- * @note If an image path is empty, this image is not set to the button.
- *
- * @param[in] unselectedImagePath         Image path to be shown when the button is unselected.
- * @param[in] selectedImagePath           Image path to be shown when the button is selected.
- * @param[in] backgroundImagePath         Image path to be shown as button background.
- * @param[in] disabledUnselectedImagePath Image path to be shown when the button is unselected and disabled.
- * @param[in] disabledBackgroundImagePath Image path to be shown as button background when the button is disabled.
- * @return A handle to the new push button
- */
-DALI_IMPORT_API PushButton CreatePushButton( const std::string& unselectedImagePath, const std::string& selectedImagePath, const std::string& backgroundImagePath,
-                             const std::string& disabledUnselectedImagePath, const std::string& disabledBackgroundImagePath );
-
-/**
- * @brief Creates a push button with the given images.
- *
- * Images will be shrunk to fit the button size keeping their aspect ratio.
- * @note Images won't be scaled to fill the whole button size.
- * @note If an image is an empty handle, this image is not set to the button.
- *
- * @param[in] unselectedImageActor         Image to be shown when the button is unselected.
- * @param[in] selectedImageActor           Image to be shown when the button is pressed.
- * @param[in] backgroundImageActor         Image to be shown as button background.
- * @param[in] disabledUnselectedImageActor Image to be shown when the button is unselected and disabled.
- * @param[in] disabledBackgroundImageActor Image to be shown as button background when the button is disabled.
- * @return A handle to the new pushbutton
- */
-DALI_IMPORT_API PushButton CreatePushButton( Actor unselectedImageActor, Actor selectedImageActor, Actor backgroundImageActor,
-                             Actor disabledUnselectedImageActor, Actor disabledBackgroundImageActor );
-
-/**
- * @brief Creates a push button with the given background image.
- *
- * Background image will be shrunk to fit the button size keeping its aspect ratio.
- * @note Background image won't be scaled to fill the whole button size.
- *
- * @param[in] backgroundImagePath  Image path to be shown as button background.
- * @return a handle to the new push button
- */
-DALI_IMPORT_API PushButton CreatePushButton( const std::string& backgroundImagePath );
-
-/**
- * @brief Creates a push button with the given background image.
- *
- * Background image will be shrunk to fit the button size keeping its aspect ratio.
- * @note Background image won't be scaled to fill the whole button size.
- *
- * @param[in] backgroundImageActor  Image to be shown as button background.
- * @return a handle to the new push button
- */
-DALI_IMPORT_API PushButton CreatePushButton( Actor backgroundImageActor );
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_PUSH_BUTTON_FACTORY_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/image-view/masked-image-view.cpp b/dali-toolkit/public-api/controls/image-view/masked-image-view.cpp
deleted file mode 100644 (file)
index 1b7bd37..0000000
+++ /dev/null
@@ -1,163 +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.
- *
- */
-
-// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/image-view/masked-image-view.h>
-#include <dali-toolkit/internal/controls/image-view/masked-image-view-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-const float MaskedImageView::DEFAULT_MAXIMUM_SOURCE_SCALE(3.0f);
-
-MaskedImageView::MaskedImageView()
-{
-}
-
-MaskedImageView::MaskedImageView( const MaskedImageView& handle )
-: Control( handle )
-{
-}
-
-MaskedImageView& MaskedImageView::operator=( const MaskedImageView& handle )
-{
-  if( &handle != this )
-  {
-    Control::operator=( handle );
-  }
-  return *this;
-}
-
-MaskedImageView::~MaskedImageView()
-{
-}
-
-MaskedImageView MaskedImageView::New( unsigned int targetWidth,
-                                      unsigned int targetHeight,
-                                      Image sourceImage,
-                                      Image maskImage )
-{
-  return Internal::MaskedImageView::New( targetWidth, targetHeight, sourceImage, maskImage );
-}
-
-MaskedImageView MaskedImageView::DownCast( BaseHandle handle )
-{
-  return Control::DownCast<MaskedImageView, Internal::MaskedImageView>( handle );
-}
-
-void MaskedImageView::SetSourceImage( Image sourceImage )
-{
-  GetImpl(*this).SetSourceImage( sourceImage );
-}
-
-Image MaskedImageView::GetSourceImage()
-{
-  return GetImpl(*this).GetSourceImage();
-}
-
-void MaskedImageView::SetMaskImage( Image sourceImage )
-{
-  GetImpl(*this).SetMaskImage( sourceImage );
-}
-
-Image MaskedImageView::GetMaskImage()
-{
-  return GetImpl(*this).GetMaskImage();
-}
-
-Property::Index MaskedImageView::GetPropertyIndex( MaskedImageView::CustomProperty customProperty ) const
-{
-  return GetImpl(*this).GetPropertyIndex( customProperty );
-}
-
-void MaskedImageView::Pause()
-{
-  GetImpl(*this).Pause();
-}
-
-void MaskedImageView::Resume()
-{
-  GetImpl(*this).Resume();
-}
-
-bool MaskedImageView::IsPaused() const
-{
-  return GetImpl(*this).IsPaused();
-}
-
-void MaskedImageView::SetEditMode( MaskedImageView::EditMode editMode )
-{
-  GetImpl(*this).SetEditMode( editMode );
-}
-
-MaskedImageView::EditMode MaskedImageView::GetEditMode() const
-{
-  return GetImpl(*this).GetEditMode();
-}
-
-void MaskedImageView::SetSourceAspectRatio( float widthOverHeight )
-{
-  GetImpl(*this).SetSourceAspectRatio( widthOverHeight );
-}
-
-float MaskedImageView::GetSourceAspectRatio() const
-{
-  return GetImpl(*this).GetSourceAspectRatio();
-}
-
-void MaskedImageView::SetMaximumSourceScale( float scale )
-{
-  GetImpl(*this).SetMaximumSourceScale( scale );
-}
-
-float MaskedImageView::GetMaximumSourceScale() const
-{
-  return GetImpl(*this).GetMaximumSourceScale();
-}
-
-void MaskedImageView::SetSourceRotation( MaskedImageView::ImageRotation rotation )
-{
-  GetImpl(*this).SetSourceRotation( rotation );
-}
-
-MaskedImageView::ImageRotation MaskedImageView::GetSourceRotation() const
-{
-  return GetImpl(*this).GetSourceRotation();
-}
-
-MaskedImageView::MaskedImageViewSignal& MaskedImageView::MaskFinishedSignal()
-{
-  return GetImpl(*this).MaskFinishedSignal();
-}
-
-MaskedImageView::MaskedImageView(Internal::MaskedImageView& implementation)
-: Control(implementation)
-{
-}
-
-MaskedImageView::MaskedImageView( Dali::Internal::CustomActor* internal )
-: Control( internal )
-{
-  VerifyCustomActorPointer<Internal::MaskedImageView>(internal);
-}
-
-} // namespace Toolkit
-
-} // namespace Dali
diff --git a/dali-toolkit/public-api/controls/image-view/masked-image-view.h b/dali-toolkit/public-api/controls/image-view/masked-image-view.h
deleted file mode 100644 (file)
index b4e6208..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-#ifndef __DALI_TOOLKIT_MASKED_IMAGE_VIEW_H__
-#define __DALI_TOOLKIT_MASKED_IMAGE_VIEW_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
-{
-
-namespace Internal DALI_INTERNAL
-{
-class MaskedImageView;
-}
-
-/**
- * @brief MaskedImageView displays the result of an image created from a masking operation.
- *
- * Masking operations:
- *  - Firstly a target image size is chosen. The MaskedImageView handles the creation of this image internally. Initially the
- *    target image will be filled according to the BACKGROUND_COLOR property.
- *  - A source image is provided and positioned with the target image area. The position of the source image (in pixels), can
- *    be controlled using the SOURCE_OFFSET and SOURCE_SIZE properties. By default the source image is centered within the target
- *    image, and stretched to fill. Note that by default, no attempt is made to maintain the aspect ratio of the source image.
- *  - A mask image is provided and positioned in the same way as the source image, using the MASK_OFFSET and MASK_SIZE properties.
- *  - Conceptually the source image is then painted using the mask image as a stencil. Areas of the source which overlap with opaque
- *    areas of the mask, will be painted into the target image. However where the mask is transparent, the source will be faded away.
- *    Note that the edge of the mask image will be stretched to cover the entire target area.
- *
- * Initially MaskedImageView will perform the masking operation on a per-frame basis. This can impact performance, and may be
- * avoided by calling Pause() e.g. when the source & mask positions are not being modified. The Resume() method can then be called
- * to continue the masking operation when required.
- */
-class DALI_IMPORT_API MaskedImageView : public Control
-{
-public:
-
-  /**
-   * @brief The custom properties installed by this control.
-   */
-  enum CustomProperty
-  {
-    BACKGROUND_COLOR,    ///< Name "background-color", type Vector4
-    SOURCE_SIZE,         ///< Name "source-size",      type Vector2
-    SOURCE_OFFSET,       ///< Name "source-offset",    type Vector2
-    MASK_SIZE,           ///< Name "mask-size",        type Vector2
-    MASK_OFFSET,         ///< Name "mask-offset",      type Vector2
-
-    CUSTOM_PROPERTY_COUNT
-  };
-
-  /**
-   * @brief Edit mode for this control.
-   *
-   * @see SetEditMode()
-   */
-  enum EditMode
-  {
-    EDIT_DISABLED, ///< Editting is disabled
-    EDIT_SOURCE,   ///< Editting affects the source image
-    EDIT_MASK      ///< Editting affects the mask
-  };
-
-  /**
-   * @brief The rotation of the image.
-   *
-   * @see SetSourceRotation()
-   */
-  enum ImageRotation
-  {
-    ROTATE_0,   ///< No rotation
-    ROTATE_90,  ///< Image is rotated clockwise by 90 degrees
-    ROTATE_180, ///< Image is rotated clockwise by 180 degrees
-    ROTATE_270  ///< Image is rotated clockwise by 270 degrees
-  };
-
-  static const float DEFAULT_MAXIMUM_SOURCE_SCALE; ///< Default SetMaximumSourceScale() value
-
-  /**
-   * @brief Creates an empty MaskedImageView handle.
-   */
-  MaskedImageView();
-
-  /**
-   * @brief Copy constructor.
-   *
-   * Creates another handle that points to the same real object
-   * @param handle to copy from
-   */
-  MaskedImageView( const MaskedImageView& handle );
-
-  /**
-   * @brief Assignment operator.
-   *
-   * Changes this handle to point to another real object
-   * @param[in] handle the handle of the object to re-assign this to
-   * @return a reference to this
-   */
-  MaskedImageView& operator=( const MaskedImageView& handle );
-
-  /**
-   * @brief Destructor
-   *
-   * This is non-virtual since derived Handle types must not contain data or virtual methods.
-   */
-  ~MaskedImageView();
-
-  /**
-   * @brief Create the MaskedImageView control.
-   *
-   * @param[in] targetWidth The width of the target image
-   * @param[in] targetHeight The height of the target image
-   * @param[in] sourceImage The source image
-   * @param[in] maskImage The mask image
-   * @return A handle to the MaskedImageView control.
-   */
-  static MaskedImageView New( unsigned int targetWidth,
-                              unsigned int targetHeight,
-                              Image sourceImage,
-                              Image maskImage );
-
-  /**
-   * @brief Downcast an Object handle to MaskedImageView.
-   *
-   * If handle points to an MaskedImageView the downcast produces
-   * valid handle. If not the returned handle is left uninitialized.
-   *
-   * @param[in] handle Handle to an object
-   * @return handle to a MaskedImageView or an uninitialized handle
-   */
-  static MaskedImageView DownCast( BaseHandle handle );
-
-  /**
-   * @brief Set the image used as a source in the masking operation.
-   *
-   * @param[in] sourceImage The source image
-   */
-  void SetSourceImage( Image sourceImage );
-
-  /**
-   * @brief Retrieve the image used as a source in the masking operation.
-   *
-   * @return sourceImage The source image
-   */
-  Image GetSourceImage();
-
-  /**
-   * @brief Set the image used as a mask in the masking operation.
-   *
-   * @param[in] maskImage The mask image
-   */
-  void SetMaskImage( Image maskImage );
-
-  /**
-   * @brief Retrieve the image used as a mask in the masking operation.
-   *
-   * @return sourceImage The mask image
-   */
-  Image GetMaskImage();
-
-  /**
-   * @brief Get the property index for a custom MaskedImageView property.
-   *
-   * @param[in] customProperty A custom property enum defined in this class.
-   * @return The property index e.g. for use with Animation::AnimateTo()
-   */
-  Dali::Property::Index GetPropertyIndex( CustomProperty customProperty ) const;
-
-  /**
-   * @brief Pause the masking operation to improve performance.
-   *
-   * Call this when the source & mask positions etc. are not being modified.
-   */
-  void Pause();
-
-  /**
-   * @brief Resume the masking operation.
-   *
-   */
-  void Resume();
-
-  /**
-   * @brief Query whether the masking operation has been paused.
-   *
-   * @return True if the masking operation has been paused.
-   */
-  bool IsPaused() const;
-
-  /**
-   * @brief Enable or disable an edit mode.
-   *
-   * The default is EDIT_DISABLED.
-   * @param[in] editMode The edit mode required.
-   */
-  void SetEditMode( EditMode editMode );
-
-  /**
-   * @brief Query which edit mode is enabled.
-   */
-  EditMode GetEditMode() const;
-
-  /**
-   * @brief Set the aspect ratio to be preserved when editing the source image.
-   *
-   * @param[in] widthOverHeight The aspect ratio i.e. width divided by height. If a value
-   * of zero or less is set, then the aspect ratio of the source image will be ignored.
-   */
-  void SetSourceAspectRatio( float widthOverHeight );
-
-  /**
-   * @brief Query the aspect ratio preserved when editing the source image.
-   *
-   * @return The aspect ratio (width divided by height) or zero if no aspect ratio is set.
-   */
-  float GetSourceAspectRatio() const;
-
-  /**
-   * @brief Set the maximum scale applied when editing the source image.
-   *
-   * The minimum scale is implied by the target width/height i.e. the source image will
-   * always fill that area when edit mode is enabled.
-   * @param[in] scale The maximum scale.
-   */
-  void SetMaximumSourceScale( float scale );
-
-  /**
-   * @brief Query the maximum scale applied when editing the source image.
-   *
-   * @return The maximum scale.
-   */
-  float GetMaximumSourceScale() const;
-
-  /**
-   * @brief Set the rotation applied to the source image.
-   *
-   * @param[in] rotation The new rotation; by default the source image is not rotated (ROTATE_0).
-   */
-  void SetSourceRotation( ImageRotation rotation );
-
-  /**
-   * @brief Query the rotation applied to the source image.
-   *
-   * @return The current rotation.
-   */
-  ImageRotation GetSourceRotation() const;
-
-public: /* Signals */
-
-  /// @brief Finished signal type.
-  typedef Signal< void (MaskedImageView& source) > MaskedImageViewSignal;
-
-  /**
-   * @brief Signal emitted when the render task which targets the
-   * frame buffer of the masked image has finished.
-   *
-   * This signal carries information of the control handle to the callback function.
-   * @return the signal
-   */
-  MaskedImageViewSignal& MaskFinishedSignal();
-
-public: // Not intended for application developers
-
-  /**
-   * @brief Creates a handle using the Toolkit::Internal implementation.
-   *
-   * @param[in]  implementation  The Control implementation.
-   */
-  DALI_INTERNAL MaskedImageView(Internal::MaskedImageView& implementation);
-
-  /**
-   * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
-   *
-   * @param[in]  internal  A pointer to the internal CustomActor.
-   */
-  explicit DALI_INTERNAL MaskedImageView(Dali::Internal::CustomActor* internal);
-};
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_MASKED_IMAGE_VIEW_H__
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 e02c62b..d018716 100644 (file)
@@ -35,10 +35,12 @@ class ItemFactory
 {
 public:
 
+  class Extension; ///< Forward declare future extension interface
+
   /**
    * @brief Virtual destructor.
    */
-  DALI_EXPORT_API virtual ~ItemFactory() = 0;
+  DALI_EXPORT_API virtual ~ItemFactory() {};
 
   /**
    * @brief Query the number of items available from the factory.
@@ -63,6 +65,16 @@ public:
    * @param[in] actor The actor that represents the released item.
    */
   virtual void ItemReleased(unsigned int itemId, Actor actor) {};
+
+  /**
+   * Retrieve the extension for this control
+   *
+   * @return The extension if available, NULL otherwise
+   */
+  virtual Extension* GetExtension()
+  {
+    return NULL;
+  }
 };
 
 } // namespace Toolkit
index 6b570cc..39e09a3 100644 (file)
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-view.h>
 
-namespace
-{
-
-// Lerps between initial and target using the progress
-template< typename Type >
-void Lerp( Type& current, const Type& initial, const Type& target, float progress )
-{
-  current = initial + ((target - initial) * 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),
-   mInitialised( false )
-  {
-  }
-
-  void operator()( Dali::Quaternion& current, const Dali::PropertyInputContainer& inputs )
-  {
-    float offsetLayoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
-    float weight = inputs[3]->GetFloat();
-
-    if( !mInitialised )
-    {
-      mInitialised = true;
-      mInitial = current;
-    }
-
-    current = Dali::Quaternion::Slerp( mInitial, mWrapMe( current, offsetLayoutPosition, inputs[1]->GetFloat(), inputs[2]->GetVector3() ), weight );
-  }
-
-  Dali::Toolkit::ItemLayout::QuaternionFunction mWrapMe;
-  unsigned int mItemId;
-  Dali::Quaternion mInitial;
-  bool mInitialised:1;
-};
-
-struct WrappedVector3Constraint
+namespace Dali
 {
-  WrappedVector3Constraint( Dali::Toolkit::ItemLayout::Vector3Function wrapMe, unsigned int itemId )
-  : mWrapMe(wrapMe),
-    mItemId(itemId),
-    mInitial(),
-    mInitialised( false )
-  {
-  }
-
-  void operator()( Dali::Vector3& current, const Dali::PropertyInputContainer& inputs )
-  {
-    float offsetLayoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
-    float weight = inputs[3]->GetFloat();
-
-    if( !mInitialised )
-    {
-      mInitialised = true;
-      mInitial = current;
-    }
 
-    Lerp( current, mInitial, mWrapMe( current, offsetLayoutPosition, inputs[1]->GetFloat(), inputs[2]->GetVector3() ), weight );
-  }
-
-  Dali::Toolkit::ItemLayout::Vector3Function mWrapMe;
-  unsigned int mItemId;
-  Dali::Vector3 mInitial;
-  bool mInitialised:1;
-};
-
-struct WrappedVector4Constraint
+namespace Toolkit
 {
-  WrappedVector4Constraint( Dali::Toolkit::ItemLayout::Vector4Function wrapMe, unsigned int itemId )
-  : mWrapMe(wrapMe),
-    mItemId(itemId),
-    mInitial(),
-    mInitialised( false )
-  {
-  }
-
-  void operator()( Dali::Vector4& current, const Dali::PropertyInputContainer& inputs )
-  {
-    float offsetLayoutPosition = inputs[0]->GetFloat() + static_cast<float>(mItemId);
-    float weight = inputs[3]->GetFloat();
-
-    if( !mInitialised )
-    {
-      mInitialised = true;
-      mInitial = current;
-    }
-
-    Lerp( current, mInitial, mWrapMe( current, offsetLayoutPosition, inputs[1]->GetFloat(), inputs[2]->GetVector3() ), weight );
-  }
 
-  Dali::Toolkit::ItemLayout::Vector4Function mWrapMe;
-  unsigned int mItemId;
-  Dali::Vector4 mInitial;
-  bool mInitialised:1;
-};
-
-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)
@@ -230,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..08bd1ff 100644 (file)
@@ -248,7 +248,7 @@ unsigned int FixedRuler::GetPageFromPosition(float position, bool wrap) const
     {
       position = WrapInDomain(position, mDomain.min, mDomain.max);
     }
-    page = floor((position - mDomain.min) / mSpacing + 0.5f);
+    page = std::max(static_cast<double>(0.0f), floor((position - mDomain.min) / mSpacing + 0.5f));
 
     if(wrap)
     {
@@ -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,43 +496,38 @@ 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)
-{
-  GetImpl(*this).SetScrollPosition(position);
-}
-
 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..11f166a 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,15 +864,7 @@ public:
    *
    * @returns The current scroll position.
    */
-  Vector3 GetCurrentScrollPosition() const;
-
-  /**
-   * @brief Sets the current scroll position, overriding current scroll animations. If panning is currently taking place
-   *        SetScrollPosition will have no effect. Try to ensure panning has stopped before calling this function.
-   *
-   * @param[in] position The new scroll position to set.
-   */
-  void SetScrollPosition(const Vector3& position);
+  Vector2 GetCurrentScrollPosition() const;
 
   /**
    * @brief Retrieves current scroll page based on ScrollView
@@ -895,7 +889,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 +903,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 +918,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 +937,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 +958,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 +1104,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 96de982..1f6df9b 100644 (file)
@@ -90,7 +90,8 @@ public:
       SELECTION_HANDLE_PRESSED_IMAGE_LEFT,      ///< name "selection-handle-pressed-image-left"  The image to display when the left selection handle is pressed,           type STRING
       SELECTION_HANDLE_PRESSED_IMAGE_RIGHT,     ///< name "selection-handle-pressed-image-right" The image to display when the right selection handle is pressed,          type STRING
       SELECTION_HIGHLIGHT_COLOR,                ///< name "selection-highlight-color"            The color of the selection highlight,                                     type VECTOR4
-      DECORATION_BOUNDING_BOX                   ///< name "decoration-bounding-box"              The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE
+      DECORATION_BOUNDING_BOX,                  ///< name "decoration-bounding-box"              The decorations (handles etc) will positioned within this area on-screen, type RECTANGLE
+      INPUT_METHOD_SETTINGS                     ///< name "input-method-settings"                The settings to relating to the System's Input Method, Key and Value      type MAP
     };
   };
 
index d1c1763..9df4e58 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 = 41;
+const unsigned int TOOLKIT_MICRO_VERSION = 42;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 3eea93c..a7371c9 100755 (executable)
 # Add local source files here
 
 public_api_src_files = \
-  $(public_api_src_dir)/builder/builder.cpp \
-  $(public_api_src_dir)/builder/json-parser.cpp \
-  $(public_api_src_dir)/builder/tree-node.cpp \
   $(public_api_src_dir)/controls/control-impl.cpp \
   $(public_api_src_dir)/controls/control.cpp \
   $(public_api_src_dir)/controls/alignment/alignment.cpp \
-  $(public_api_src_dir)/controls/bubble-effect/bubble-emitter.cpp \
   $(public_api_src_dir)/controls/buttons/button.cpp \
   $(public_api_src_dir)/controls/buttons/check-box-button.cpp \
   $(public_api_src_dir)/controls/buttons/push-button.cpp \
   $(public_api_src_dir)/controls/buttons/radio-button.cpp \
-  $(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 \
-  $(public_api_src_dir)/controls/page-turn-view/page-turn-portrait-view.cpp \
-  $(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/item-factory.cpp \
+  $(public_api_src_dir)/controls/scrollable/item-view/default-item-layout.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 \
-  $(public_api_src_dir)/controls/super-blur-view/super-blur-view.cpp \
   $(public_api_src_dir)/controls/table-view/table-view.cpp \
   $(public_api_src_dir)/controls/text-controls/text-label.cpp \
   $(public_api_src_dir)/controls/text-controls/text-field.cpp \
-  $(public_api_src_dir)/controls/text-controls/text-selection-popup.cpp \
-  $(public_api_src_dir)/controls/tool-bar/tool-bar.cpp \
-  $(public_api_src_dir)/controls/bloom-view/bloom-view.cpp \
-  $(public_api_src_dir)/controls/effects-view/effects-view.cpp \
   $(public_api_src_dir)/controls/gaussian-blur-view/gaussian-blur-view.cpp \
-  $(public_api_src_dir)/controls/image-view/masked-image-view.cpp \
   $(public_api_src_dir)/focus-manager/focus-manager.cpp \
   $(public_api_src_dir)/focus-manager/keyboard-focus-manager.cpp \
   $(public_api_src_dir)/focus-manager/keyinput-focus-manager.cpp \
-  $(public_api_src_dir)/shader-effects/bubble-effect/bubble-effect.cpp \
-  $(public_api_src_dir)/shader-effects/bubble-effect/color-adjuster.cpp \
-  $(public_api_src_dir)/shader-effects/alpha-discard-effect.cpp \
-  $(public_api_src_dir)/shader-effects/bendy-effect.cpp \
-  $(public_api_src_dir)/shader-effects/blind-effect.cpp \
-  $(public_api_src_dir)/shader-effects/bouncing-effect.cpp \
-  $(public_api_src_dir)/shader-effects/carousel-effect.cpp \
-  $(public_api_src_dir)/shader-effects/displacement-effect.cpp \
-  $(public_api_src_dir)/shader-effects/dissolve-effect.cpp \
-  $(public_api_src_dir)/shader-effects/dissolve-local-effect.cpp \
-  $(public_api_src_dir)/shader-effects/distance-field-effect.cpp \
-  $(public_api_src_dir)/shader-effects/image-region-effect.cpp \
-  $(public_api_src_dir)/shader-effects/iris-effect.cpp \
-  $(public_api_src_dir)/shader-effects/mask-effect.cpp \
-  $(public_api_src_dir)/shader-effects/mirror-effect.cpp \
-  $(public_api_src_dir)/shader-effects/motion-blur-effect.cpp \
-  $(public_api_src_dir)/shader-effects/motion-stretch-effect.cpp \
-  $(public_api_src_dir)/shader-effects/nine-patch-mask-effect.cpp \
-  $(public_api_src_dir)/shader-effects/overlay-effect.cpp \
-  $(public_api_src_dir)/shader-effects/page-turn-book-spine-effect.cpp \
-  $(public_api_src_dir)/shader-effects/page-turn-effect.cpp \
-  $(public_api_src_dir)/shader-effects/quadratic-bezier.cpp \
-  $(public_api_src_dir)/shader-effects/ripple-effect.cpp \
-  $(public_api_src_dir)/shader-effects/ripple2d-effect.cpp \
-  $(public_api_src_dir)/shader-effects/shear-effect.cpp \
-  $(public_api_src_dir)/shader-effects/soft-button-effect.cpp \
-  $(public_api_src_dir)/shader-effects/spot-effect.cpp \
-  $(public_api_src_dir)/shader-effects/square-dissolve-effect.cpp \
-  $(public_api_src_dir)/shader-effects/swirl-effect.cpp \
-  $(public_api_src_dir)/shader-effects/water-effect.cpp \
-  $(public_api_src_dir)/styling/style-manager.cpp \
-  $(public_api_src_dir)/transition-effects/cube-transition-cross-effect.cpp \
-  $(public_api_src_dir)/transition-effects/cube-transition-effect.cpp \
-  $(public_api_src_dir)/transition-effects/cube-transition-fold-effect.cpp \
-  $(public_api_src_dir)/transition-effects/cube-transition-wave-effect.cpp \
-  $(public_api_src_dir)/scripting/script.cpp \
   $(public_api_src_dir)/dali-toolkit-version.cpp \
   $(public_api_src_dir)/enums.cpp
 
@@ -104,11 +34,6 @@ public_api_header_files = \
   $(public_api_src_dir)/dali-toolkit-version.h \
   $(public_api_src_dir)/enums.h
 
-public_api_builder_header_files = \
-  $(public_api_src_dir)/builder/builder.h \
-  $(public_api_src_dir)/builder/json-parser.h \
-  $(public_api_src_dir)/builder/tree-node.h
-
 public_api_controls_header_files = \
   $(public_api_src_dir)/controls/control-impl.h \
   $(public_api_src_dir)/controls/control.h
@@ -122,144 +47,42 @@ public_api_buttons_header_files = \
   $(public_api_src_dir)/controls/buttons/push-button.h \
   $(public_api_src_dir)/controls/buttons/radio-button.h
 
-public_api_bloom_view_header_files = \
-  $(public_api_src_dir)/controls/bloom-view/bloom-view.h
-
-public_api_bubble_emitter_header_files = \
-  $(public_api_src_dir)/controls/bubble-effect/bubble-emitter.h
-
 public_api_default_controls_header_files = \
-  $(public_api_src_dir)/controls/default-controls/check-button-factory.h \
-  $(public_api_src_dir)/controls/default-controls/push-button-factory.h \
   $(public_api_src_dir)/controls/default-controls/solid-color-actor.h
 
-public_api_effects_view_header_files = \
-  $(public_api_src_dir)/controls/effects-view/effects-view.h
-
 public_api_gaussian_blur_view_header_files = \
   $(public_api_src_dir)/controls/gaussian-blur-view/gaussian-blur-view.h
 
-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_magnifier_header_files = \
-  $(public_api_src_dir)/controls/magnifier/magnifier.h
-
-public_api_page_turn_view_header_files = \
-  $(public_api_src_dir)/controls/page-turn-view/page-factory.h \
-  $(public_api_src_dir)/controls/page-turn-view/page-turn-landscape-view.h \
-  $(public_api_src_dir)/controls/page-turn-view/page-turn-portrait-view.h \
-  $(public_api_src_dir)/controls/page-turn-view/page-turn-view.h
-
-public_api_popup_header_files = \
-  $(public_api_src_dir)/controls/popup/popup.h
+  $(public_api_src_dir)/controls/scrollable/item-view/item-view.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 = \
-  $(public_api_src_dir)/controls/slider/slider.h
-
-public_api_shadow_view_header_files = \
-  $(public_api_src_dir)/controls/shadow-view/shadow-view.h
-
-public_api_super_blur_view_header_files = \
-  $(public_api_src_dir)/controls/super-blur-view/super-blur-view.h
-
 public_api_table_view_header_files = \
   $(public_api_src_dir)/controls/table-view/table-view.h
 
 public_api_text_controls_header_files = \
   $(public_api_src_dir)/controls/text-controls/text-label.h \
-  $(public_api_src_dir)/controls/text-controls/text-field.h \
-  $(public_api_src_dir)/controls/text-controls/text-selection-popup.h
-
-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_src_dir)/controls/text-controls/text-field.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 \
   $(public_api_src_dir)/focus-manager/keyinput-focus-manager.h
 
-public_api_shader_effects_header_files = \
-  $(public_api_src_dir)/shader-effects/alpha-discard-effect.h \
-  $(public_api_src_dir)/shader-effects/bendy-effect.h \
-  $(public_api_src_dir)/shader-effects/blind-effect.h \
-  $(public_api_src_dir)/shader-effects/bouncing-effect.h \
-  $(public_api_src_dir)/shader-effects/carousel-effect.h \
-  $(public_api_src_dir)/shader-effects/displacement-effect.h \
-  $(public_api_src_dir)/shader-effects/dissolve-effect.h \
-  $(public_api_src_dir)/shader-effects/dissolve-local-effect.h \
-  $(public_api_src_dir)/shader-effects/distance-field-effect.h \
-  $(public_api_src_dir)/shader-effects/image-region-effect.h \
-  $(public_api_src_dir)/shader-effects/iris-effect.h \
-  $(public_api_src_dir)/shader-effects/mask-effect.h \
-  $(public_api_src_dir)/shader-effects/mirror-effect.h \
-  $(public_api_src_dir)/shader-effects/motion-blur-effect.h \
-  $(public_api_src_dir)/shader-effects/motion-stretch-effect.h \
-  $(public_api_src_dir)/shader-effects/nine-patch-mask-effect.h \
-  $(public_api_src_dir)/shader-effects/overlay-effect.h \
-  $(public_api_src_dir)/shader-effects/page-turn-book-spine-effect.h \
-  $(public_api_src_dir)/shader-effects/page-turn-effect.h \
-  $(public_api_src_dir)/shader-effects/quadratic-bezier.h \
-  $(public_api_src_dir)/shader-effects/ripple-effect.h \
-  $(public_api_src_dir)/shader-effects/ripple2d-effect.h \
-  $(public_api_src_dir)/shader-effects/shear-effect.h \
-  $(public_api_src_dir)/shader-effects/soft-button-effect.h \
-  $(public_api_src_dir)/shader-effects/spot-effect.h \
-  $(public_api_src_dir)/shader-effects/square-dissolve-effect.h \
-  $(public_api_src_dir)/shader-effects/swirl-effect.h \
-  $(public_api_src_dir)/shader-effects/water-effect.h
-
-public_api_bubble_effect_header_files =  \
-  $(public_api_src_dir)/shader-effects/bubble-effect/bubble-effect.h \
-  $(public_api_src_dir)/shader-effects/bubble-effect/color-adjuster.h
-
-public_api_styling_header_files = \
-  $(public_api_src_dir)/styling/style-manager.h
-
-public_api_transition_effects_header_files = \
-  $(public_api_src_dir)/transition-effects/cube-transition-effect.h \
-  $(public_api_src_dir)/transition-effects/cube-transition-cross-effect.h \
-  $(public_api_src_dir)/transition-effects/cube-transition-fold-effect.h \
-  $(public_api_src_dir)/transition-effects/cube-transition-wave-effect.h
-
-public_api_scripting_header_files = \
-  $(public_api_src_dir)/scripting/script.h \
-  $(public_api_src_dir)/scripting/script-plugin.h
-
 public_api_rendering_backend_header_files = \
   $(public_api_src_dir)/text/rendering-backend.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/dali-toolkit/styles/mobile/tizen-default-theme.json b/dali-toolkit/styles/mobile/tizen-default-theme.json
deleted file mode 120000 (symlink)
index bdcd8ba..0000000
+++ /dev/null
@@ -1 +0,0 @@
-./tizen-dark-theme.json
\ No newline at end of file
diff --git a/dali-toolkit/styles/tizen-default-theme.json b/dali-toolkit/styles/tizen-default-theme.json
deleted file mode 120000 (symlink)
index c09c1a1..0000000
+++ /dev/null
@@ -1 +0,0 @@
-tizen-dark-theme.json
\ No newline at end of file
index ce7bd16..0179c50 100644 (file)
@@ -1,2 +1,2 @@
 <hr>\r
-<a href="http://www.samsung.com">Copyright (c) 2008-2014 Samsung Electronics, Co., Ltd.</a></body></html>\r
+<a href="http://www.samsung.com">Copyright (c) 2008-2015 Samsung Electronics, Co., Ltd.</a></body></html>\r
diff --git a/docs/content/images/architecture.png b/docs/content/images/architecture.png
new file mode 100644 (file)
index 0000000..d9aaa26
Binary files /dev/null and b/docs/content/images/architecture.png differ
diff --git a/docs/content/images/dali-threads.png b/docs/content/images/dali-threads.png
new file mode 100644 (file)
index 0000000..997d238
Binary files /dev/null and b/docs/content/images/dali-threads.png differ
index 881dc8f..7d9cab6 100644 (file)
Binary files a/docs/content/images/example-documentation/example-code.png and b/docs/content/images/example-documentation/example-code.png differ
index 913d9f0..25659d9 100644 (file)
Binary files a/docs/content/images/screen-shot.png and b/docs/content/images/screen-shot.png differ
diff --git a/docs/content/images/stage-hand/blocks.png b/docs/content/images/stage-hand/blocks.png
new file mode 100644 (file)
index 0000000..fc5a28d
Binary files /dev/null and b/docs/content/images/stage-hand/blocks.png differ
diff --git a/docs/content/images/stage-hand/inner-workings.png b/docs/content/images/stage-hand/inner-workings.png
new file mode 100644 (file)
index 0000000..f77f16f
Binary files /dev/null and b/docs/content/images/stage-hand/inner-workings.png differ
diff --git a/docs/content/images/stage-hand/netstat.png b/docs/content/images/stage-hand/netstat.png
new file mode 100644 (file)
index 0000000..905f2c1
Binary files /dev/null and b/docs/content/images/stage-hand/netstat.png differ
diff --git a/docs/content/images/stage-hand/stagehand-logo.png b/docs/content/images/stage-hand/stagehand-logo.png
new file mode 100644 (file)
index 0000000..bdd1104
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-logo.png differ
diff --git a/docs/content/images/stage-hand/stagehand-mainscreen.png b/docs/content/images/stage-hand/stagehand-mainscreen.png
new file mode 100644 (file)
index 0000000..64ac3ea
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-mainscreen.png differ
diff --git a/docs/content/images/stage-hand/stagehand-modify.png b/docs/content/images/stage-hand/stagehand-modify.png
new file mode 100644 (file)
index 0000000..f1c2b48
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-modify.png differ
diff --git a/docs/content/images/stage-hand/stagehand-netcat.png b/docs/content/images/stage-hand/stagehand-netcat.png
new file mode 100644 (file)
index 0000000..c6d8cb8
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-netcat.png differ
diff --git a/docs/content/images/stage-hand/stagehand-performance.png b/docs/content/images/stage-hand/stagehand-performance.png
new file mode 100644 (file)
index 0000000..4f1d518
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-performance.png differ
diff --git a/docs/content/images/stage-hand/stagehand-refesh.png b/docs/content/images/stage-hand/stagehand-refesh.png
new file mode 100644 (file)
index 0000000..d7f77c4
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-refesh.png differ
diff --git a/docs/content/images/stage-hand/stagehand-save.png b/docs/content/images/stage-hand/stagehand-save.png
new file mode 100644 (file)
index 0000000..326fc0c
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-save.png differ
diff --git a/docs/content/images/stage-hand/stagehand-screenshot.png b/docs/content/images/stage-hand/stagehand-screenshot.png
new file mode 100644 (file)
index 0000000..bedbeac
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-screenshot.png differ
diff --git a/docs/content/images/stage-hand/stagehand-settings.png b/docs/content/images/stage-hand/stagehand-settings.png
new file mode 100644 (file)
index 0000000..f3b434d
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-settings.png differ
diff --git a/docs/content/images/stage-hand/stagehand-tizen-connection.png b/docs/content/images/stage-hand/stagehand-tizen-connection.png
new file mode 100644 (file)
index 0000000..fa4243a
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-tizen-connection.png differ
diff --git a/docs/content/images/stage-hand/stagehand-ubuntu-connection.png b/docs/content/images/stage-hand/stagehand-ubuntu-connection.png
new file mode 100644 (file)
index 0000000..cf824b9
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-ubuntu-connection.png differ
diff --git a/docs/content/images/stage-hand/stagehand-zoom.png b/docs/content/images/stage-hand/stagehand-zoom.png
new file mode 100644 (file)
index 0000000..e509acd
Binary files /dev/null and b/docs/content/images/stage-hand/stagehand-zoom.png differ
index 54bff7c..61b3c75 100644 (file)
-# 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, Text 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 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.html JSON and JavaScript Overview \endlink
- - \link javascriptwrapping.html JavaScript Wrapping Guide for DALi developers\endlink
- - \link script-hello Hello World in script \endlink
- - \link script-json-specification JSON Specification\endlink
-
- ## Rendering
- - \link viewing-modes Viewing modes \endlink
-
- ## Profiling
- - \link performanceprofiling.html Performance Profiling \endlink
- - \link resourcetracking.html Resource Tracking \endlink
-
- ## Performance
- - \link performancetips.html Performance Tips \endlink
- - \link textureatlases.html Texture Atlases  \endlink
- - \link texturecompression.html Compressing Textures \endlink
-
-## Testing
- See [Automated Tests](@ref auto_testing) for instructions.
-
-
-## Modifying this documentation
-- \link documentationguide.html Modifying this documentation \endlink
-
+# DALi Introduction
+
+### Introduction
+ + [What is DALi?](@ref dali-introduction)
+ + [Features](@ref dali-features)
+ + [High Level Design](@ref dali-hld)
+  + [Components](@ref dali-components)
+  + [Main, Update & Render Threads](@ref dali-threads)
+ + [DALi Fundamentals](@ref fundamentals)
+  + [Actors & Stage](@ref actors-and-stage)
+  + [Coordinate System](@ref coordinate-system)
+  + Units & the Default Camera (default unit 1 is 1 pixel with default camera)
+  + [Handle / Body Idiom](@ref handle-body-idiom)
+  + Signals
+  + [Properties](@ref properties)
+  + Actions
+ + Tutorial
+  + [Hello World](@ref hello-world)
+
+### Getting Started
+ + How to build DALi on Ubuntu Desktop
+
+### Programming Guide
+ + [Programming Languages:](@ref programming-languages)
+  + [C++](@ref c-plus-plus)
+  + [JavaScript](@ref java-script-support)
+  + [JSON](@ref json-support)
+ + [Application](@ref dali-application)
+ + Actors
+  + [Positioning](@ref positioning-actors)
+  + [Event Handling](@ref event-system)
+  + [Layouting](@ref size-negotiation)
+  + [Image Actor](@ref image-actor)
+ + Animation
+  + AnimateTo
+  + AnimateBy
+  + Key Frame Animations
+  + Path Animations
+  + [Constraints](@ref constraints)
+   + Equal To Constraint
+   + Relative To Constraint
+   + Linear Constrainer
+   + Path Constrainer
+  + [Multi-threading Notes](@ref animation-multi-threading-notes)
+  + [Shader Animation](@ref animation-shader)
+  + [Example and Usage](@ref animation-example)
+  + [Rotation with quaternions](@ref animation-rotation)
+
+### Resources
+ + Resource Image
+ + 9 Patch Image
+ + Buffer Image
+
+### Control Base Class
+ + [Background Feature](@ref background)
+ + Keyboard Focus
+ + Accessibility
+
+### UI Controls
+ + [Text Label](@ref text-label)
+ + [Text Field](@ref text-field)
+ + Buttons
+ + TableView
+ + [Scroll View](@ref scroll-view)
+ + ItemView
+
+### RenderTasks
+
+### Shader Effects
+ + [Overview](@ref shader-intro)
+
+### Scripting
+ + [JSON and JavaScript Overview](@ref scriptoverview)
+ + [JSON Syntax](@ref script-json-specification)
+ + [Scripting Hello World](@ref script-hello)
+
+### Tools
+ + Environment Variables
+ + [Resource Tracking](@ref resourcetracking)
+ + Logging
+ + GUI Builder
+ + [Stagehand - DALi Visual Debugger](@ref stagehand)
+
+### Viewing Modes
+ + [Overview](@ref viewing-modes)
+
+### Extending DALi
+ + Control Base Class Services
+ + How to write Custom UI Controls
+  + [Size Negotiation for Controls](@ref size-negotiation-controls)
+  + [Type Registration](@ref type-registration)
+  + How to make Controls Scriptable
+ + [Automated Tests](@ref auto_testing)
+ + [Programming Guide](@ref documentationguide)
+ + [JavaScript Wrapping Guide for DALi developers](@ref javascriptwrapping)
+
+### Application Optimization Guide
+ + [Texture Atlases](@ref textureatlases)
+ + [Texture Compression](@ref texturecompression)
+ + Performance & Debugging
+ + [Performance Tips](@ref performancetips)
+ + [Performance Profiling](@ref performanceprofiling)
 
diff --git a/docs/content/programming-guide/custom-actor.h b/docs/content/programming-guide/custom-actor.h
deleted file mode 100644 (file)
index 808bfca..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*! \page custom-actor Custom Actor
- * The Dali::CustomActor is used as a base class for UI controls.  It is a proxy object to enable derived classes access
- * to a subset of the methods defined in the internal Actor class.
- *
- * Classes deriving from Custom Actor should follow the same handle - body design principle as the rest of the Dali API.
- *
- * One class of the new UI control should inherit from Dali::CustomActor, while a second should inherit
- * Dali::CustomActorImpl.  This implementation class contains a number of pure virtual methods that enable the new UI
- * control to respond to a variety of events such as touch and notification of being added to the stage.
- *
- * For example, if creating a new button widget called myNewButton, the user would create two classes, myNewButton which
- * derives from Dali::CustomActor and an implementation part myNewButtonImpl which would derive from Dali::CustomActorImpl.
- *
- * In the New() method for the myNewButton class, the user should then create a new instance of the myNewButtonImpl class
- * and pass this to the constructor of the myNewButton object.  Internally the connection will be made
- * between the new widget actor and Dali, thus allowing messages such as OnPropertySet to be received by the new actor.
- *
- * It is the responsibility of the implementation of the new UI control to implement the method bodies for the inherited
- * pure virtual methods from Dali::CustomActorImpl.  Obviously the application won't compile if the methods are not
- * overidden, but the user does not need to fill in the code for methods they don't want or need to use.
- *
- * After the implementation object is created it is passed back to the basic Text View through the constructor,the
- * constructor uses this passed in object to initialise the internal implementation objects.
- *
- * After both the objects are created it calls an init method on the implementation which is used to initialise
- * objects.  THis is the preferred way to do things so to avoid errors in the constructors.
- *
- * If desired, the user can then use the myNewButtonImpl implementation class to handle only the callback message
- * handler methods, and do all the rest of their widget processing the the main myNewButton class.  Access to the
- * implementation class can be gained using the GetImpl(*this) method.  For example:
- *
- */
index 07cc934..3921284 100644 (file)
@@ -1,10 +1,12 @@
-/*! \page dali-application Dali Application and Adaptor
+/*! \page dali-application DALi Application
  *
 <h2 class="pg">Creating an Application</h2>
 
-The Adaptor framework provides several classes which intialises and sets up Dali appropriately so that the application writer does not have to.  These classes also provides many platform related services (e.g. orienation change notifications, timer services etc.).
+The Adaptor framework provides provides a Dali::Application class which initialises and sets up Dali appropriately so that the application writer does not have to.
+This provides many platform related services.
 
-The simplest way to create an application that uses Dali is to utilise the Dali::Application class.  In addition to initialising the environment used by Dali, it also provides several signals which the user can connect to when certain platform related activities occur.  It also ensures that, upon system events, Dali is called in a thread-safe manner.
+Several signals can be connected to so that the application writer is informed when certain platform related activities occur.
+It also ensures that, upon system events, DALi is called in a thread-safe manner.
 
 The following example shows how to create a Dali::Application instance and connect to its initialise signal (which is where a Dali::Actor hierarchy should be created).
 
@@ -18,7 +20,7 @@ void CreateProgram(Application& app)
 
 int main (int argc, char **argv)
 {
-  Application app = Application::New(&argc, &argv);
+  Dali::Application app = Application::New(&argc, &argv);
   app.InitSignal().Connect(&CreateProgram);
   app.MainLoop();
 }
@@ -26,98 +28,8 @@ int main (int argc, char **argv)
 
 Please see the Dali::Application class for other signals to which the application can connect.
 
-<h2 class="pg">Using an Adaptor or EvasPlugin instead of the Application class</h2>
-
-If the application requires finer grained control, an Dali::Adaptor can be created instead.  This allows the application writer to create other platform related functionality themselves (e.g managing the main loop, providing a surface to render to etc.).
-
-When using the Adaptor, the application writer can specify the use of normal window creation and drawing by using the New method with an appropriate Window.
-
-If the application writer wants Dali to draw to a specific surface then they need to create a Dali::RenderSurface instance and use the Adaptor constructor which takes the Dali::RenderSurface as the parameter.
-
-The only signal provided by the adaptors is a <i>surface resized signal</i>; the application writer will have to handle system signals like <i>initialise, pause, terminate </i> etc. themselves.  It is also important that any calls to Dali are made in a thread-safe manner from your application when using the adaptor directly.
-
-An adaptor can be created as shown below:
-
-@code
-void CreateProgram(void* data)
-{
-  // Start Adaptor
-  Dali::Adaptor* adaptor = reinterpret_cast<Dali::Adaptor*>(data);
-  adaptor->Start();
-
-  // Create Dali components...
-  // Can instantiate here, if required
-}
-
-int main ()
-{
-  // Initialise platform
-  MyPlatform.Init();
-
-  // Create an 800 by 1280 window positioned at (0,0).
-  Dali::PositionSize positionSize(0, 0, 800, 1280);
-  Dali::Window window = Dali::Window::New( positionSize, "My Application" );
-  Dali::Adaptor& adaptor = Dali::Adaptor::New( window );
-
-  // Assuming second parameter takes in data which is passed back to the callback function
-  MyPlatform.InitialisationConnection(&CreateProgram, &adaptor);
-
-  // Start Main Loop of your platform
-  MyPlatform.StartMainLoop();
-
-  return 0;
-}
-@endcode
-
-A Dali::EvasPlugin instance can be created by EFL applications that wish to use Dali.  Like the Adaptor, it also provides a means for initialising the resources required by the Dali::Core.
-
-The Dali::EvasPlugin emits several signals which the user can connect to.  The user should not create any Dali objects in the main function and instead should connect to the Init signal of the EvasPlugin and create the Dali objects in the connected callback.
-
-A Dali::EvasPlugin can be used in an EFL application as shown below:
-
-@code
-void Created(EvasPlugin& evasPlugin)
-{
-  // Create Dali components...
-  // Can instantiate here, if required
-}
-
-void Resized(EvasPlugin& evasPlugin)
-{
-  // Set size properties of Dali components
-  // Set screen layout
-}
-
-int main (int argc, char **argv)
-{
-  // Initialise Elementary
-  elm_init(&argc, &argv);
-
-  // Create an Evas Window
-  Evas_Object* win = elm_win_add(...);
-
-  // Get the actual window
-  Evas* e = evas_object_evas_get(win);
-
-  // Create the EvasPlugin and pass the actual window
-  Dali::EvasPlugin evasPlugin = Dali::EvasPlugin(e);
-
-  evasPlugin.SignalInit().Connect(&Created);
-  evasPlugin.SignalResize().Connect(&Resized);
-
-  // Retrieve the Evas_Object from the plugin and show it.
-  Evas_Object* evasObject = evasPlugin.GetEvasObject();
-  evas_object_show(evasObject);
-
-  // add evasObject to layout such as elm_box
-
-  // Start main loop
-  elm_run();
-}
-@endcode
-
 <h2 class="pg">Window</h2>
-Dali provides a Window class to manage drawing to a default surface. It is also responsible for drawing the Indicator bar if required. The Application class automatically creates a Window which the application author can access after the SignalInit has fired.
+DALi provides a Window class to manage drawing to a default surface. It is also responsible for drawing the Indicator bar if required. The Application class automatically creates a Window which the application author can access after the SignalInit has fired.
 
 @code
 void CreateProgram(Application& app)
@@ -127,32 +39,12 @@ void CreateProgram(Application& app)
 
 int main (int argc, char **argv)
 {
-  Application app = Application::New(argc, argv);
+  Dali::Application app = Application::New(argc, argv);
   app.SignalInit().Connect(&CreateProgram);
   app.MainLoop();
 }
 @endcode
 
-<h2 class="pg">Orientation</h2>
-
-The Adaptor Framework also provides a means of retrieving the current device orientation and connection to a signal when the orientation of the device changes.  The Dali::Application class provides access to an already created Dali::Orientation object.  If using a Dali::Adaptor, an instance of the Dali::Orientation class has to be created in the application.
-
-The following example shows how to connect to an orientation changed signal through the Dali::Application class:
-
-@code
-void OrientationChanged(const Orientation& orientation)
-{
-  int degrees = orientation.GetDegrees();
-  ...
-}
-
-int main(int argc, char **argv)
-{
-  Application app = Application::New(&argc, &argv);
-  app.GetWindow().GetOrientation().SignalChanged().Connect(&OrientationChanged);
-}
-@endcode
-
 <h2 class="pg">Timers</h2>
 
 Timers are also provided by the Adaptor Framework so that the application writer can execute a portion of their code periodically or just once, after a delay.  The example below shows how a Dali::Timer can be created and used:
@@ -167,7 +59,7 @@ bool Tick()
 ...
 
 // Elsewhere
-Timer timer = Timer::New(2000); // 2 second timeout
+Dali::Timer timer = Dali::Timer::New(2000); // 2 second timeout
 timer.SignalTick().Connect(&Tick);
 ...
 @endcode
diff --git a/docs/content/programming-guide/dynamics-bodies.h b/docs/content/programming-guide/dynamics-bodies.h
deleted file mode 100644 (file)
index 42c8195..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * \page dynamics-bodies Dynamics - Bodies
- * A Dali::DynamicsBody can be "Rigid" or "Soft". Rigid bodies require much less processing and should be used
- * in preference to a soft body.\n
- * All bodies are controlled by the simulation, the application developer can influence them by setting their
- * linear or angular velocities, but direct control of their position is not possible until the Dali::DynamicsBody is flagged
- * as a \ref kinematic-body "kinematic object".\n
- *
- * \section create-body Creating a body
- * <p>
- * Each Dali::DynamicsBody is created by an Dali::Actor through its Dali::Actor::EnableDynamics method using a
- * Dali::DynamicsBodyConfig object to specify options for the Dali::DynamicsBody.
- * \code
- * // Initialize and get a handle to the Dali::DynamicsWorld
- * Dali::DynamicsWorldConfig worldConfig( Dali::DynamicsWorldConfig::New() );
- * Dali::DynamicsWorld dynamicsWorld( Dali::Stage::GetCurrent().InitializeDynamics( worldConfig ) );
- * // Create an actor to represent the world
- * Dali::Actor dynamicsRootActor( Dali::Actor::New() );
- * dynamicsWorld.SetRootActor( dynamicsRootActor );
- * Dali::Stage::GetCurrent().Add( dynamicsRootActor );
- *
- * // create an actor to represent a rigid body
- * Dali::Actor actor( Dali::Actor::New() );
- * actor.SetParentOrigin( Dali::ParentOrigin::CENTER );
- * dynamicsRootActor.Add( actor );
- * // Enable dynamics for the actor, creating a rigid body with default configuration
- * actor.EnableDynamics( Dali::DynamicsBodyConfig::New() );
- * \endcode
- *
- * \section create-body-advanced Specifying options
- * <h4>Mass</h4>
- * Use Dali::DynamicsBodyConfig::SetMass to specify the mass of the body [default: 1].
- * <h4>Elasticity</h4>
- * Use Dali::DynamicsBodyConfig::SetElasticity to specify the elasticity of the body [default: 0.85].\n
- * This may also be known as the co-efficient of restitution or &apos;bounciness&apos;.
- * <h4>Damping</h4>
- * Use Dali::DynamicsBodyConfig::SetLinearDamping to specify the linear damping coefficient [default: 0].\n
- * and Dali::DynamicsBodyConfig::SetAngularDamping to specify the angular damping coefficient [default: 0].\n
- * <h4>Friction</h4>
- * Use Dali::DynamicsBodyConfig::SetFriction to specify the friction of the body [default: 0.5].\n
- * <h4>Collision Filtering</h4>
- * See \link dynamics-collisions Collision Detection and Filtering \endlink\n\n
- * Use Dali::DynamicsBodyConfig::SetCollisionGroup to specify the collision filter group.\n
- * Use Dali::DynamicsBodyConfig::SetCollisionMask to specify the collision filter mask.\n
- * <h3>Soft body specific options</h3>
- * <h4>Stiffness</h4>
- * Use Dali::DynamicsBodyConfig::SetStiffness to specify the stiffness of the links between the mesh vertices used to
- * define the soft body. Values clamped between 0 and 1 [default: 1].\n
- * <h4>Anchor hardness</h4>
- * Use Dali::DynamicsBodyConfig::SetAnchorHardness to specify the hardness or drift correction applied to anchors.
- * Values clamped between 0 and 1 [default: 0.7]. Smaller values mean less drift correction.\n
- * <h4>Conservation</h4>
- * Use Dali::DynamicsBodyConfig::SetShapeConservation to specify the shape conservation coefficient,
- * or the magnitude of the force which will attempt to maintain the soft bodies shape (see \ref Dali::DynamicsBody::ConserveShape).\n
- * Use Dali::DynamicsBodyConfig::SetVolumeConservation to specify the volume conservation coefficient,
- * or the magnitude of the force which will attempt to maintain the soft bodies volume (see \ref Dali::DynamicsBody::ConserveVolume).
- * Smaller values mean less conservation.\n
- * <h4>Create a rigid body with advanced options</h4>
- * \code
- * Dali::DynamicsBodyConfig bodyConfig( Dali::DynamicsBodyConfig::New() );
- * // increase mass from the default
- * bodyConfig.SetMass( 2.5f );
- * // set elasticity so that the velocity of the object will be halved after a collision
- * // (assuming the other body has a mass = 1 and a velocity 0f 0).
- * bodyConfig.SetElasticity( 0.5f );
- * // increase the rate at which a bodies linear velocity will decrease
- * bodyConfig.SetLinearDamping( 0.5f );
- * // reduce the friction to zero
- * bodyConfig.SetFriction( 0.0f );
- * // Ignore all collisions
- * bodyConfig.SetCollisionGroup( 0 );
- * bodyConfig.SetCollisionMask( 0 );
- *
- * // create an actor for the Dali::DynamicsBody
- * Actor actor( Actor::New() );
- * actor.SetParentOrigin( Dali::ParentOrigin::CENTER );
- * // create the Dali::DynamicsBody
- * actor.EnableDynamics( bodyConfig );
- *
- * // add to the simulation
- * dynamicsRootActor.Add( actor );
- * \endcode
- * <h4>Create a soft body with advanced options</h4>
- * \code
- * // Create a unit mesh with 25 vertices
- * Dali::Mesh mesh( Dali::Mesh::NewPlane(1.0f, 1.0f, 5, 5) );
- *
- * Dali::DynamicsBodyConfig bodyConfig( Dali::DynamicsBodyConfig::New() );
- * // select a soft body
- * bodyConfig.SetType( Dali::DynamicsBodyConfig::SOFT );
- * // set the mesh as the soft body shape
- * bodyConfig.SetShape( Dali::DynamicsShape::NewMesh( mesh ) );
- * // decrease the stiffness of the links between the soft body vertices
- * bodyConfig.SetStiffness( 0.25f );
- * // Make anchors very loose/weak
- * bodyConfig.SetAnchorHardness( 0.1f );
- *
- * // create an actor for the Dali::DynamicsBody
- * Actor actor( MeshActor::New(mesh) );
- * actor.SetParentOrigin( Dali::ParentOrigin::CENTER );
- * // create the Dali::DynamicsBody
- * actor.EnableDynamics( bodyConfig );
- *
- * // add to the simulation
- * dynamicsRootActor.Add( actor );
- * \endcode
- * \image html dynamics/dynamics-soft.png "A soft body (with debug rendering enabled)"
- * \section kinematic-body Kinematic bodies
- * A kinematic body is not controlled by the simulation, there is a one-way interaction with other dynamic objects
- * under control of the simulation, where other objects will be pushed away, but the kinematic object will be unaffected.\n
- * Kinematic objects can be animated with DALi's \ref animation-example "animation system", each DALi update the simulation will
- * get the current position of associated DALi actor.\n Use Dali::DynamicsBody::SetKinematic to make a kinematic object.
- * <h3>Animating a kinematic object</h3>
- * Other dynamics enabled actors that collide with the kinematic object during the animation will be pushed
- * away.
- * \code
- * ...
- * // create an actor to represent a rigid body
- * Dali::Actor actor( Dali::Actor::New() );
- * dynamicsRootActor.Add( actor );
- * // Enable dynamics for the actor, creating a rigid body with default configuration
- * actor.EnableDynamics( Dali::DynamicsBodyConfig::New() );
- * // get the DynamicsBody handle
- * DynamicsBody body( actor.GetDynamicsBody() );
- * body.SetKinematic( true );
- * // create a second animation to move the actor 100 units to the right
- * Animation animation( Animation::New( 1 ) );
- * animation.AnimateBy( Property( actor, Actor::Property::POSITION ), Vector3( 100, 0, 0 ), AlphaFunction::LINEAR );
- * animation.Play();
- * \endcode
- * <hr>
- * <p>See also
- * <ul>
- *  <li>Dali::DynamicsBodyConfig</li>
- *  <li>Dali::Actor::EnableDynamics</li>
- *  <li>\link dynamics-initialization DynamicsWorld Initialization and Usage\endlink</li>
- * </ul>
- * </p>
- */
-
diff --git a/docs/content/programming-guide/dynamics-collisions.h b/docs/content/programming-guide/dynamics-collisions.h
deleted file mode 100644 (file)
index 3dc6d14..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-/**
- * \page dynamics-collisions Collisions
- * \section collision-detection Collision Detection
- * <p>
- * Collision detection is automatic and occurs between all Dali::DynamicsBody objects in the simulation.@n
- * To respond to a detected collisions, the application developer can connect to a signal provided by
- * a Dali::DynamicsWorld object.
- * \code
- * ...
- *
- * // DynamicsWorld initialization code
- *
- * ...
- *
- * // Connect a signal handler to the signal
- * Dali::DynamicsWorld theWorld( Stage::GetCurrent().GetDynamicsWorld() );
- * theWorld.SignalCollision().Connect( this, &myClass::OnDynamicsCollision );
- *
- * ...
- *
- * // Implement a signal handler
- * void myClass::OnDynamicsCollision( Dali::DynamicsWorld world, Dali::DynamicsCollision collisionData )
- * {
- *   std::cout << "Collision between "
- *             << collisionData.GetActorA().GetName() << " and "
- *             << collisionData.GetActorB().GetName() << " ";
- *
- *   if( collisionData.GetImpactForce() != 0.0f )
- *   {
- *     std::cout << "detected (impact force: " << collisionData.GetImpactForce() << " )";
- *   }
- *   else
- *   {
- *     std::cout << "ended";
- *   }
- *   std::cout << std::endl;
- * }
- * \endcode
- *
- * <hr>
- * \section collision-filtering Collision Filtering
- *
- * <p>
- * When a large number of Dali::DynamicsBody objects are added to the simulation, collision detection can become a
- * significant performance drain, where every possible pairing of objects needs to be checked for collisions.</p>
- * <p>You can significantly reduce the number of pairs considered for collision detection by using a collision filter.</p>
- * <p>Each Dali::DynamicsBody can belong to a user defined collision filter group and have a user defined collision filter mask.<p>
- * <p>A Dali::DynamicsBody pair are considered for collision detection if one or more bits in the filter group from each Dali::DynamicsBody
- * matches one or more bits in the filter mask of the other Dali::DynamicsBody.
- * </p>
- * <center><table border="1">
- * <caption>Truth table</caption>
- * <tr align="center">
- * <th>&nbsp;P&nbsp;</th>
- * <th>&nbsp;Q&nbsp;</th>
- * <th>tested for collision?</th>
- * </tr>
- * <tr align="center">
- * <td>0</th>
- * <td>0</th>
- * <td>no</th>
- * </tr>
- * <tr align="center">
- * <td>0</th>
- * <td>1</th>
- * <td>no</th>
- * </tr>
- * <tr align="center">
- * <td>1</th>
- * <td>0</th>
- * <td>no</th>
- * </tr>
- * <tr align="center">
- * <td>1</th>
- * <td>1</th>
- * <td>yes</th>
- * </tr>
- * </table></center>
- * <p>
- * where <b>P</b> = bitwise AND of the collision group from the first Dali::DynamicsBody and the collision mask from the second Dali::DynamicsBody\n
- * and   <b>Q</b> = bitwise AND of the collision group from the second Dali::DynamicsBody and the collision mask from the first Dali::DynamicsBody.
- * </p><br>
- * <p>
- * <b>Pseudo code for the filter check.</b>
- * \code
- * const bool canCollide( (  firstBody->GetCollisionGroup() & secondBody->GetCollisionMask() &&
- *                        ( secondBody->GetCollisionGroup() &  firstBody->GetCollisionMask() );
- * \endcode
- * </p>
- * <h3 class="pg">Code example - Illustrating how to create multiple filter groups and masks.</h3>
- * \code
- * // Define some collision groups
- * const short int group0( 1 << 1 );
- * const short int group1( 1 << 2 );
- * const short int group2( 1 << 3 );
- *
- * // Create some Dali::DynamicsBodyConfig objects
- * Dali::DynamicsBodyConfig bodyConfig0( Dali::DynamicsBodyConfig::New() );
- * Dali::DynamicsBodyConfig bodyConfig1( Dali::DynamicsBodyConfig::New() );
- * Dali::DynamicsBodyConfig bodyConfig2( Dali::DynamicsBodyConfig::New() );
- *
- * // Assign the collision filters to the configurations
- * bodyConfig0->SetCollisionGroup(group0);
- * bodyConfig0->SetCollisionMask( group1 | group2 );
- * bodyConfig1->SetCollisionGroup(group1);
- * bodyConfig1->SetCollisionMask(group0);
- * bodyConfig2->SetCollisionGroup(group2);
- * bodyConfig2->SetCollisionMask(group0 | group2);
- * \endcode
- * <p>
- * Collision detection is \b enabled between Dali::DynamicsBody pairs of...
- * <ul>
- *  <li>group0 and group1 objects.</li>
- *  <li>group0 and group2 objects.</li>
- *  <li>group2 objects.</li>
- * </ul>
- * Collision detection is \b disabled between Dali::DynamicsBody pairs of...
- * <ul>
- *  <li>group0 objects.</li>
- *  <li>group1 objects.</li>
- *  <li>group1 and group2 objects.</li>
- * </ul>
- * </p>
- *
- * See
- * <ul>
- *  <li>Dali::DynamicsWorld::SignalCollision</li>
- *  <li>Dali::DynamicsCollision</li>
- *  <li>\ref Dali::DynamicsBodyConfig::SetCollisionGroup - to set the collision group</li>
- *  <li>\ref Dali::DynamicsBodyConfig::SetCollisionMask - to set the collision mask</li>
- * </ul>
- */
-
diff --git a/docs/content/programming-guide/dynamics-initialization.h b/docs/content/programming-guide/dynamics-initialization.h
deleted file mode 100644 (file)
index 638bd31..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * \page dynamics-initialization Initializing the Simulation
- * \section dynamics-prerequisites Dynamics prerequisites
- * <p>
- * In order to reduce binary size on devices, by default Dali core is built without Dynamics support. \n
- * This can be enabled by adding the --enable-debug option to configure. The configure command should output this: \n
- * \code
- * Configuration
- * -------------
- *  Dynamics support:                 yes
- * \endcode
- * <p>In addition to rebuilding Dali, a physics plugin (e.g. bullet, havok) should be installed on the target device.
- * Dali adaptor provides the bullet plugin e.g. install dali-adaptor-dali-bullet-plugin-X.armv7l.rpm.
- *
- * \section initializing-world Initializing the World
- * <p>
- * The simulation is encapsulated and controlled by a instance of a Dali::DynamicsWorld object.\n
- * \code
- * // DynamicsWorld initialisation code
- * Dali::DynamicsWorldConfig worldConfig( Dali::DynamicsWorldConfig::New() );
- * Dali::Stage::GetCurrent().InitializeDynamics( worldConfig );
- * \endcode
- * <p>If the DynamicsWorld handle empty, then a prerequisite is missing (see above).
- * Use a Dali::DynamicsWorldConfig object to specify options for the type of simulation required.\n
- * Dali::DynamicsWorldConfig::RIGID supports rigid body dynamics only, while Dali::DynamicsWorldConfig::SOFT supports
- * both rigid and soft body dynamics. Rigid body dynamics uses less CPU than soft body dynamics and is simpler to set up.
- * \code
- * // DynamicsWorld initialisation code
- * Dali::DynamicsWorldConfig worldConfig( Dali::DynamicsWorldConfig::New() );
- * // Choose a rigid body capable simulation
- * worldConfig.SetType( Dali::DynamicsWorldConfig::RIGID );
- * // or a soft and rigid body simulation
- * worldConfig.SetType( Dali::DynamicsWorldConfig::SOFT );
- * // Request Dali::Stage to create an instance of the DynamicsWorld
- * Dali::Stage::GetCurrent().InitializeDynamics( worldConfig );
- * \endcode
- *
- * \section initializing-world-advanced Advanced Initialization
- * <h3>Units</h3>
- * <p>All distance units in the simulation are based on meters, so positioning an actor at (0, -500, -1000)
- * will position it 0.5km in the air and 1km away from the camera.\n So if the actor was to fall under
- * the control of gravity it will seem to fall in slow motion. To counteract this the simulation units can
- * be modified using Dali::DynamicsWorldConfig::SetUnit. The default value is set to 0.01 to change the
- * simulation units to centimeters.
- * </p>
- * \code
- * // change simulation back to meters
- * worldConfig.SetUnit(1.0f);
- * // or change simulation unit to millimeters
- * worldConfig.SetUnit(1.0f/1000.0f);
- * \endcode
- *
- * <h3>Simulation update ticks</h3>
- * <p>The application developer can set the number of simulation time steps / DALi update tick using
- * Dali::DynamicsWorldConfig::SetSimulationSubSteps.\n
- * Use this to advance the simulation in smaller time steps, thus gaining a more accurate
- * simulation for collision detection.\n
- * Using this API may adversely affect performance, as the dynamics simulation is performing many more
- * calculations each DAli tick than normal.</p>
- * \code
- * // Assume DAli is updating at 60Hz (16.667ms / update)
- * //Setting subSteps to 1 will update the simulation once per DALi update.
- * worldConfig.SetSimulationSubSteps(1);
- * //Setting subSteps to 4 will perform 4 simulation updates per DALi update each with a time step of Approx 4.2ms.
- * worldConfig.SetSimulationSubSteps(1);
- * \endcode
- * \section manipulating-world Using the World
- * <h3>The Dynamics Simulation Root Actor</h3>
- * <p>To manipulate the world within the scene-graph it must be connected to a Dali::Actor.\n
- * All Rigid or Soft bodies that will be simulated must each be connected to a Dali::Actor which is a
- * direct child of the dynamics root actor.</p>
- * \code
- * // Create an actor to represent our view of the simulation
- * Dali::Actor dynamicsRootActor( Dali::Actor::New() );
- * // retrieve a handle to the DynamicsWorld object initialized previously
- * Dali::DynamicsWorld dynamicsWorld( Dali::Stage::GetCurrent().GetDynamicsWorld() );
- * // Connect the Dali::DynamicsWorld and the Dali::Actor
- * dynamicsWorld.SetRootActor( dynamicsRootActor );
- * // Add root actor to Dali::Stage
- * Dali::Stage::GetCurrent().Add( dynamicsRootActor );
- * \endcode
- * <h3>Gravity</h3>
- * <p>The gravity applicable to the entire simulation can be set through Dali::DynamicsWorld::SetGravity.\n
- * The gravity will apply a constant force on all Dali::DynamicsBody objects added to the world which have a
- * non zero mass and are not flagged as kinematic.</p>
- * \code
- * // Set gravity to apply a force on the negative Y axis
- * dynamicsWorld.SetGravity( Vector3( 0.0f, -10.0f, 0.0f ) );
- * \endcode
- * <hr>
- * <p>See also
-* <p>See
- * <ul>
- *  <li>Dali::DynamicsWorldConfig</li>
- *  <li>Dali::DynamicsWorld</li>
- *  <li>Dali::Stage::InitializeDynamics</li>
- * </ul>
- * </p>
- *
- */
-
diff --git a/docs/content/programming-guide/dynamics-intro.h b/docs/content/programming-guide/dynamics-intro.h
deleted file mode 100644 (file)
index 3f444b1..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*! \page dynamics-intro Dynamics - Introduction
- *
- * Dynamics gives the application developer a means to simulate physical kinetic properties on solid shapes.
- * Simple physical shapes can be associated with a given actor, e.g., an actor representing a ball would have
- * a spherical shape. Other simple shapes include cube, cone, cylinder and capsule (a pill or lozenge shape).
- * \image html dynamics/dynamics-shapes.png "Simple Shapes"
- * The application developer can provide more complex shapes using arbitrary meshes, however, this will use more
- * CPU than the simple shapes.\n\n
- * Dali supports both rigid body and soft body simulations.
- * <ul>
- * <li>Rigid body simulation means that the shapes used in the simulation cannot deform. This is simpler, and requires
- * less processing power.</li>
- * <li>Soft body simulation allows the shapes used in the simulation to deform, e.g. a rubber ball will squash and change
- * shape when it hits a wall; or a cloth flag will flutter, etc.</li>
- * </ul>
- * Both forms of simulation provide automatic collision detection, and can be detected on all bodies in the simulation.
- * The application developer can use signals to listen for detected collisions.
- *
- * \image html dynamics/dynamics-rigid.png "Example application"
- */
-
diff --git a/docs/content/programming-guide/dynamics-joints.h b/docs/content/programming-guide/dynamics-joints.h
deleted file mode 100644 (file)
index 3cf8d2e..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * \page dynamics-joints Joints
- * A Dali::DynamicsJoint represents a connection (or link) between a Dali::DynamicsBody pair.
- * A Joint can optionally allow \ref linear "linear motion" and/or \ref angular "angular rotation" around its origin on one or more axis, and
- * can have a \ref motors "motor" or \ref springs "spring" enabled on those axis.
- * \image html dynamics/dynamics-joint2.png
- * \section create-joint Creating a joint
- * <p>Each Dali::DynamicsJoint is created by a Dali::Actor through its Dali::Actor::AddDynamicsJoint method.\n
- * This method takes two parameters\n
- * 1. The other Dali::Actor in the joint relationship.\n
- * 2. A Dali::Vector3 relative offset from the owning Dali::Actor's current position.\n
- * A joint is active in the simulation when both of the actors are connected to the Stage via the Dali::Actor
- * set with Dali::DynamicsWorld::SetRootActorDynamics.
- * </p>
- * <h3>A code example creating two actors connected by a joint</h3>
- * \code
- * // create an actor to represent a rigid body
- * Dali::Actor actor1( Dali::Actor::New() );
- * // Enable dynamics for the actor, creating a rigid body with default configuration
- * actor1.EnableDynamics( Dali::DynamicsBodyConfig::New() );
- * actor1.SetPosition( Vector3( 0, 0, 0 ) );
- * // create an actor to represent a second rigid body
- * Dali::Actor actor2( Dali::Actor::New() );
- * actor1.SetPosition( Vector3( 100, 0, 0 ) );
- * // Enable dynamics for the actor, creating a rigid body with default configuration
- * actor2.EnableDynamics( Dali::DynamicsBodyConfig::New() );
- * // create the joint
- * Vector3 relativeOffset( 25, 0, 0 );
- * actor1.AddDynamicsJoint( actor2, relativeOffset );
- * \endcode
- * The joint is 25 units to the right of actor1 and 75 units to the left of actor2. If
- * either actor is moved the joint will follow pulling the other actor with it.
- * \section linear Linear Limits
- * \image html dynamics/dynamics-joint.png "A joint allowing linear motion on the Y Axis"
- * Limits control how much translation is allowed relative to the joints origin point, use Dali::DynamicsJoint::SetLinearLimit
- * to set linear limits.
- * \code
- * ...
- * actor1.AddDynamicsJoint( actor2, Vector3(0, 0, 0) );
- * DynamicsJoint joint( actor1.GetDynamicsJoint(actor2) );
- *
- * // Allow translation from the joint's origin along the X axis of +/- 50 units
- * joint.SetLinearLimit( Dali::DynamicsJoint::LINEAR_X, -50, 50);
- * \endcode
- * \section angular Angular Limits
- * Limits control how much rotation is allowed around the joint's origin point, use Dali::DynamicsJoint::SetAngularLimit
- * to set angular limits.
- * \code
- * ...
- * actor1.AddDynamicsJoint( actor2, Vector3(0, 0, 0) );
- * DynamicsJoint joint( actor1.GetDynamicsJoint(actor2) );
- *
- * // Allow rotation around the joint's origin on the Z axis of - 45 degrees and +90 degrees
- * joint.SetAngularLimit( Dali::DynamicsJoint::ANGULAR_Z, -Dali::Degree(45), Dali::Degree(90) );
- * \endcode
- * \section motors Motors
- * Motors apply a force along a given axis towards the lower or upper limit set on that axis.\n
- * Use Dali::DynamicsJoint::EnableMotor to enable/disable a motor.\n
- * The torque of the motor can be set with Dali::DynamicsJoint::SetMotorForce and the velocity
- * with Dali::DynamicsJoint::SetMotorVelocity.
- * \code
- * ...
- * actor1.AddDynamicsJoint( actor2, Vector3(0, 0, 0) );
- * DynamicsJoint joint( actor1.GetDynamicsJoint(actor2) );
- *
- * // allow angular rotation on the Z axis
- * joint.SetAngularLimit(Dali::DynamicsJoint::ANGULAR_Z, -Dali::Degree(90), Dali::Degree(90));
- * // enable the Z axis angular motor
- * joint.EnableMotor(Dali::DynamicsJoint::ANGULAR_Z, true);
- * // set the motor torque
- * joint.SetMotorForce(Dali::DynamicsJoint::ANGULAR_Z, 0.5f);
- * // set the motor velocity (acts towards lower limit)
- * joint.SetMotorVelocity(Dali::DynamicsJoint::ANGULAR_Z, -10.0f);
- * \endcode
- * \section springs Springs
- * Springs apply a force to keep the Dali::DynamicsJoint origin at the spring's center point.
- * A spring can be enabled for a given axis using Dali::DynamicsJoint::EnableSpring.\n
- * The center point is set as a ratio between the lower and upper limits on the given axis using
- * Dali::DynamicsJoint::SetSpringCenterPoint.\n
- * The magnitude of the spring's centering force can be set with Dali::DynamicsJoint::SetSpringStiffness.\n
- * Dali::DynamicsJoint::SetSpringDamping can be used to limit the amount of overshoot and oscillations
- * of the spring as it settles at its center point.
- * \code
- * ...
- * actor1.AddDynamicsJoint( actor2, Vector3(0, 0, 0) );
- * DynamicsJoint joint( actor1.GetDynamicsJoint(actor2) );
- *
- * // allow linear motion on Y axis
- * joint.SetLinearLimit(Dali::DynamicsJoint::LINEAR_Y, -50, 50);
- * // enable the Y axis linear spring
- * joint.EnableSpring(Dali::DynamicsJoint::LINEAR_Y, true);
- * // set the center point of the spring at -40 ( 10% of the limits set )
- * joint.SetSpringCenterPoint(Dali::DynamicsJoint::LINEAR_Y, 0.1f);
- * // set the springs stiffness or centering force
- * joint.SetSpringStiffness(Dali::DynamicsJoint::LINEAR_Y, 40.0f);
- * // allow more oscillations before the spring comes to reset
- * joint.SetSpringDamping(Dali::DynamicsJoint::LINEAR_Y, 0.1f);
- * \endcode
- * <hr>
- * <p>See also
- * <ul>
- *  <li>Dali::DynamicsJoint</li>
- *  <li>Dali::Actor::AddDynamicsJoint</li>
- *  <li>Dali::Actor::GetDynamicsJoint</li>
- * </ul>
- * </p>
- */
-
@@ -1,12 +1,11 @@
-/*! \page image-mesh-actor Image and Mesh actors
+/*! \page image-actor Image Actors
  *
  *
  * <h1 class="pg">Overview</h1>
- * The Dali::ImageActor & Dali::MeshActor are inherited from Dali::Actor and provide means to display resources like Images and Geometries (Triangle meshes) on the stage.
+ * The Dali::ImageActor inherits from Dali::Actor and provide means to display resources like Images on the stage.
  * All the Dali::Actor methods can be called on them.<br>
  *
  * - <b>ImageActor:</b> An actor for displaying Images. It allows the developer to display a Dali::Image object on the stage.<br>
- * - <b>MeshActor:</b>  An actor for displaying one or more mesh geometries. It may have children, which may be plain actors or other mesh actors.<br>
  *
  * <h1 class="pg">Image Actor</h1>
  *
  * myImageActor.SetImage( newImage );
  * @endcode
  *
- * <h2 class="pg">Fade in</h2>
- * It's possible to fade in the image gradually when first rendered.
- * @code
- * if (!myImageActor.GetFadeIn())
- * {
- *   myImageActor.SetFadeIn(true);
- * }
- *
- * // default : 1 Second
- * myImageActor.SetFadeInDuration(seconds);
- * @endcode
- *
- *
- * <h1 class="pg">Mesh Actor</h1>
- *
- * <h2 class="pg">Construction</h2>
- * The mesh actor is created by passing a reference to Dali::Mesh object
- *
- * @code
- * Dali::Mesh mesh = Dali::Mesh::New();
- * Dali::MeshActor myMeshActor = Dali::MeshActor::New(mesh);
- * @endcode
-
- *
- * <h2 class="pg">Modifying material</h2>
- * The developer can change the material of mesh actor using the material entity name.
- *
- * @code
- * Dali::Image image = Dali::Image::New(myTextureFile);
- * myCustomMaterial = Dali::Material::New("CustomMaterial");
- * myCustomMaterial.SetDiffuseTexture(image);
- * Dali::MeshActor::SetMaterial(myMeshActor, materialEntityNameInModel, 0, myCustomMaterial);
- *
- * @endcode
- *
- *
  */
 
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
- *
- */
-
-
index a3868c8..75fef8f 100644 (file)
@@ -6,38 +6,6 @@
 The shader effects allow the developer to apply visual deformations on the actors.
 They can affect the geometry, the colors and textures of the actor.
 
-There are some built-in shader effects in Dali Toolkit:
-- \ref Dali::Toolkit::BendyEffect "Bendy", bends the geometry around a point, useful to do a page turn effect,
-- \ref Dali::Toolkit::DissolveEffect "Dissolve", does a dissolve effect on the actor texture,
-- \ref Dali::Toolkit::RippleEffect "Ripple", does a concentric wave effect on the actor texture.
-
-@image html shader-effect-ripple.png "Ripple Effect"
-
-<br>
-<br>
-<h2 class="pg">Example and Usage</h2>
-Here is an example on how to use a shader effect, using the RippleEffect.
-
-First create the shader effect.
-@code
-Dali::RippleEffect effect = Dali::RippleEffect::New();
-@endcode
-
-Then set the values of the uniforms.
-@code
-// Set the radius of the bending
-effect.SetAmplitude( 45.0f );
-// Set the point around which the geometry will bend
-effect.SetCenter( Vector2() );
-// Set the direction of the bending
-effect.SetDirection( Vector2( 1.0f, 0.0f ) );
-@endcode
-
-Finally apply the shader effect to an actor:
-@code
-actor.SetShaderEffect( effect );
-@endcode
-
 
 <br>
 <br>
index a69d1e8..2f3ac40 100644 (file)
@@ -74,24 +74,10 @@ A table view is added to the popup to specify layout. It will fill to the width
 mPopupLayout.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
 mPopupLayout.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT );
 @endcode
-Override the OnRelayout method to position and resize the buttons. The trick to this is that the buttons do not know they are part of a popup and are
-about to be resized so could already have had their sizes negotiated. The call to PropagateRelayoutFlags on the button will ensure that it and all
-its child dependents are ready for a new size negotiation pass. The container.Add call will add the button to the relayout queue to be processed this frame.
-The buttonSize parameter is the desired size for the button. The desired size will only be set if the size policy of the button has already been changed to
-ResizePolicy::USE_ASSIGNED_SIZE, which is what happens when a button is added to the popup.
+Override the OnRelayout method to position and resize the buttons.
 @code
-void Popup::AddButton( Toolkit::Button button )
-...
-button.SetResizePolicy( ResizePolicy::USE_ASSIGNED_SIZE, Dimension::ALL_DIMENSIONS );
-...
-
 void Popup::OnRelayout( const Vector2& size, RelayoutContainer& container )
 ...
-button.SetPosition( buttonPosition );
-
-button.PropagateRelayoutFlags();    // Reset relayout flags for relayout
-container.Add( button, buttonSize );
-...
 @endcode
 Another aspect to the popup is that depending which resize policies are active on it then the inner table view requires different resize policies itself.
 OnSetResizePolicy can be overridden to receive notice that the resize policy has changed on the control and action can be taken.
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
-
-
- */
diff --git a/docs/content/shared-javascript-and-cpp-documentation/dali-introduction.md b/docs/content/shared-javascript-and-cpp-documentation/dali-introduction.md
new file mode 100644 (file)
index 0000000..50262f9
--- /dev/null
@@ -0,0 +1,30 @@
+/**
+ *
+# DALi 3D ( Dynamic Animation Library ) {#dali-introduction}
+
+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.
+
+## Features {#dali-features}
+
+ + Create Images & Text
+ + 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)
+
+*/
@@ -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 {#actors-and-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 {#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.
 
 ![ ](../assets/img/coordinate-system-and-stage.png)
+![ ](coordinate-system-and-stage.png)
 
-<h2 class="pg">Positioning Actors</h2>
+## Positioning Actors {#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.
 
 ![ ](../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.
 
 ![ ](../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.
 
 ![ ](../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/high-level-design.md b/docs/content/shared-javascript-and-cpp-documentation/high-level-design.md
new file mode 100644 (file)
index 0000000..81f4877
--- /dev/null
@@ -0,0 +1,26 @@
+/**
+ *
+
+# High Level Design {#dali-hld}
+
+## Components {#dali-components}
+
+ + **DALi Core:** Event handling, Scene Graph, Rendering, Resource Management
+ + **DALi Adaptor:** Threading Model, Integration with the main loop.
+ + **DALi Platform Abstraction:** Resource loading & decoding in multiple threads (part of dali-adaptor)
+ + **DALi Toolkit:** Reusable UI Controls, Effects & Scripting Support
+
+![ ](architecture.png)
+
+## Main, Update & Render Threads {#dali-threads}
+
+DALi uses a multithreaded architecture in order to provide the best performance and scalability.
+
+ + **Event Thread:** The main thread in which application code and event handling runs.
+ + **Update Thread:** Updates the nodes on the scene as well as running animations & constraints
+ + **Render Thread:** OpenGL drawing, texture and geometry uploading etc.
+ + **Resource Threads:** Loads images and decodes into bitmaps etc.
+
+![ ](dali-threads.png)
+
+*/
index 50dd022..287c8cf 100644 (file)
@@ -109,5 +109,5 @@ 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`
+@class _Guide_JavaScript_Wrapping
 */
\ No newline at end of file
index e96ae4d..c8662aa 100644 (file)
@@ -1,7 +1,7 @@
 /**
  *
 
-# Performance Tips  {#performancetips}
+# Performance Tips {#performancetips}
 
 ## High CPU occupancy
 
 
   - Reduce visible actor count ( == less draw calls)
   - For 2D UI graphics which require no z sorting you can use
+
 ~~~{.cpp}
-  // 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)
+// 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++
+~~~
 
-  Actor::SetDrawMode( DrawMode::OVERLAY ); // C++
-~~~~
 ~~~{.js}
-  actor.drawMode = dali.DRAW_MODE_OVERLAY; // JavaScript
+// 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
@@ -33,6 +40,7 @@
 
 
 @class _Guide_Performance_Tips
+
 */
 
 
diff --git a/docs/content/shared-javascript-and-cpp-documentation/programming-languages.md b/docs/content/shared-javascript-and-cpp-documentation/programming-languages.md
new file mode 100644 (file)
index 0000000..545d6c2
--- /dev/null
@@ -0,0 +1,83 @@
+/**
+ *
+# Programming Languages {#programming-languages}
+
+DALi applications can be written in several different programming languages.
+
+## C++ {#c-plus-plus}
+
+~~~{.cpp}
+Dali::Actor actor = Dali::Actor::New();
+actor.SetParentOrigin( Dali::ParentOrigin::CENTER );
+actor.SetAnchorPoint( Dali::AnchorPoint::CENTER );
+Dali::Stage::GetCurrent().Add( actor );
+...
+bool OnPressed( Dali::Actor, const TouchEvent& event )
+{
+  Dali::Animation anim = Dali::Animation::New( 1.5f );
+  anim.AnimateTo( Property( actor, Actor::Property::POSITION ), Vector3( 200,-100,0), AlphaFunctions::Bounce );
+  anim.play();
+  return true; // consume the touch event
+}
+...
+actor.TouchedSignal().Connect( &OnPressed );
+~~~
+
+*/
+
+## JavaScript {#java-script-support}
+
+~~~{.js}
+var actor = new dali.Actor();
+actor.parentOrigin = dali.CENTER;
+actor.anchorPoint = dali.CENTER;
+dali.stage.add( actor );
+...
+function onPressed( actor, touchEvent )
+{
+  var animOptions = { alpha: "bounce", delay: 0, duration: 15 };
+  var anim = new dali.Animation();
+  anim.animateTo( actor, "position", [ 200,-100,0], animOptions );
+  anim.play();
+  return true; // consume the touch event
+}
+...
+actor.connect( "touched", onPressed );
+
+~~~
+
+## JSON {#json-support}
+
+~~~{.json}
+{
+ "animations":
+  {
+    "move":
+    {
+      "duration": 1.5,
+      "properties":
+      [
+        {
+          "actor":"image",
+          "property":"position",
+          "value":[200,-100,0],
+          "alpha-function": "BOUNCE"
+        }
+      ]
+    }
+  },
+  "stage":
+  [
+    {
+      "name":"image",
+      "type":"Actor",
+      "anchor-point": "CENTER",
+      "parent-origin": "CENTER",
+      "signals" :
+      [
+        { "name" : "touched", "action": "play", "animation": "move" }
+      ]
+    }
+  ]
+}
+~~~
\ 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
@@ -143,14 +143,28 @@ where the first and last positions are braces.
 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
    {                                    //
@@ -189,16 +203,27 @@ styles to apply when creating using the template.
 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);
 ~~~
 
-The styles can also be applied as an animation.
+~~~{.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
@@ -285,7 +310,7 @@ instead of a single final value.
 Paths are defined in a top level path section and referenced by the
 animation property.
 
-~~~~
+~~~
     {                                    //
     "paths":                             // Path library
      {                                   //
@@ -329,7 +354,7 @@ animation property.
                                          // animation.
     },                                   //
     }                                    //
-~~~~
+~~~
 
 ## Shaders {#shaders}
 
@@ -345,7 +370,7 @@ instance.
 Similarly one named shader instance can be set to several actors and can
 be animated by one animation.
 
-~~~~
+~~~
     {                                             //
     "shader-effects":                             // Shader Effect section
     {                                             //
@@ -375,7 +400,7 @@ be animated by one animation.
      ...
     }]
     }
-~~~~
+~~~
 
 At least one of the vertex or fragment fields is mandatory. All
 other fields are optional will use internal defaults.
@@ -395,7 +420,7 @@ 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
     {                                    \\
@@ -431,7 +456,7 @@ uniforms with 'u'.
      }
      ]
     },
-~~~~
+~~~
 
 ## Stage {#stage}
 
@@ -441,6 +466,7 @@ 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);
@@ -448,6 +474,12 @@ 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
@@ -480,5 +512,5 @@ UI Control Specification".
 Please refer to the above document for further information about specific
 controls.
 
-@class ScriptJsonSpecification
+@class _Guide_JSON_Specification
 */
index bb7bb5d..311ad9f 100644 (file)
@@ -138,7 +138,7 @@ Actor userActorTree = builder.Create("users");
 #### JavaScript example
 
 ~~~{.js}
-builder.applyStyle = builder.create( "live-tv-focus", tvIcon );
+builder.applyStyle( "live-tv-focus", tvIcon );
 ~~~
 
 #### C++ example
@@ -184,12 +184,14 @@ builder.ApplyStyle( "live-tv-focus", tvIcon );
 #### JavaScript example
 
 ~~~{.js}
+// JavaScript
+
 var anim = builder.createAnimation( { animation:"animate-show", actor: myActor } );
 ~~~
 
-#### C++ example
-
 ~~~{.cpp}
+// C+++
+
 Animation anim = builder.createAnimation( "animate-show", propertyMap );
 ~~~
 
diff --git a/docs/content/shared-javascript-and-cpp-documentation/stage-hand.md b/docs/content/shared-javascript-and-cpp-documentation/stage-hand.md
new file mode 100644 (file)
index 0000000..ea16ab6
--- /dev/null
@@ -0,0 +1,167 @@
+/**
+ *
+# Stagehand Visual Debugger for DALi {#stagehand}
+
+![ ](../assets/img/stage-hand/blocks.png)
+![ ](blocks.png)
+
+## Introduction
+
+Stagehand  is an open source tool that allows a developer to:
+
+- Connect to a DALi application running on:
+ - Tizen
+ - Ubuntu
+- View a wireframe of the current scene on top of a screen shot
+- Modify properties in the scene
+- Monitor performance of the application
+
+  
+Full source code is available from http://github.com/gamoeba/stagehand.git
+
+Stagehand is released under the Apache 2 licence.
+
+## Installing StageHand on Ubuntu
+
+http://www.gamoeba.com/stagehand/
+
+Install both files on the website. Start with the QT dependencies first.
+
+
+## How it works
+
+Stagehand connects to DALi via the network using a TCP/IP connection.
+  
+![ ](../assets/img/stage-hand/inner-workings.png)
+![ ](inner-workings.png)
+
+## Network setup
+
+To enable network control on DALi, an environment variable must be set:
+
+~~~
+$ export DALI_NETWORK_CONTROL=1 to enable
+~~~
+Or run the application with the variable set.
+~~~
+$ DALI_NETWORK_CONTROL=1 /usr/apps/com.samsung.dali-demo/bin/dali-demo
+~~~
+
+Check what network port the application is using. It will be from port 3031 onwards.
+  
+If running DALi on desktop, just type netstat -tlnp. On Tizen log into the device and run netstat. E.g.
+~~~
+$ su
+
+$ netstat -tlpn
+~~~
+
+![ ](../assets/img/stage-hand/netstat.png)
+![ ](netstat.png)
+
+
+## Connecting with Stagehand
+
+Click the settings icons below
+  
+![ ](../assets/img/stage-hand/stagehand-settings.png)
+![ ](stagehand-settings.png)
+
+
+### Connecting to DALi running on Tizen
+
+Here we are connecting to a device running SDB
+  
+![ ](../assets/img/stage-hand/stagehand-tizen-connection.png)
+![ ](stagehand-tizen-connection.png)
+
+### Connect to DALi running on Desktop ( Ubuntu )
+  
+![ ](../assets/img/stage-hand/stagehand-ubuntu-connection.png)
+![ ](stagehand-ubuntu-connection.png)
+
+## Using Stagehand
+
+Click Refresh to load the current scene from the device.
+  
+![ ](../assets/img/stage-hand/stagehand-refesh.png)
+![ ](stagehand-refesh.png)
+
+Click screen shot to get overlay current screen
+  
+![ ](../assets/img/stage-hand/stagehand-screenshot.png)
+![ ](stagehand-screenshot.png)
+
+To cycle through the actor hierachy, keep clicking the same spot. Alternatively, select using the actor tree.
+
+  
+![ ](../assets/img/stage-hand/stagehand-mainscreen.png)
+![ ](stagehand-mainscreen.png)
+
+
+Click the save icon to save the scene
+  
+![ ](../assets/img/stage-hand/stagehand-save.png)
+![ ](stagehand-save.png)
+
+Zooming in and out
+  
+![ ](../assets/img/stage-hand/stagehand-zoom.png)
+![ ](stagehand-zoom.png)
+
+Modifying the scene
+  
+![ ](../assets/img/stage-hand/stagehand-modify.png)
+![ ](stagehand-modify.png)
+
+## Performance monitoring
+
+To enable performance option. Edit
+  
+~/.stagehand/stagehand.ini
+  
+Set perfmode=on
+
+Restart application. Click performance
+  
+![ ](../assets/img/stage-hand/stagehand-performance.png)
+![ ](stagehand-performance.png)
+
+## Trouble shooting
+
+You can manually check the network is enabled on the DALi application using netcat.
+
+In the example below we are connecting to a Tizen device using SDB port forwarding.
+  
+After running nc localhost 3031 we type help
+  
+![ ](../assets/img/stage-hand/stagehand-netcat.png)
+![ ](stagehand-netcat.png)
+
+
+## Tizen smack
+
+
+If you can't connect to a DALi application, but using netstat you can see a port is open.
+  
+Check the smack log for errors:
+~~~
+tail -f -n 10 /var/log/audit/audit.log | grep 'internet'
+~~~
+
+If it is being blocked, you temporarily enable it by editing:
+  
+~~~
+ /etc/smack/accesses2.d/ your-app-name
+
+then add: system::user_internet …..app-name rw
+~~~
+## Tizen Emulator connection problem
+
+
+Make sure  DALi application is run using launch_app:
+~~~
+launch_app [APP_ID] __AUL_SDK__ DEBUG __DLP_DEBUG_ARG__ :10003
+~~~
+
+@class _Guide_Visual_Debugger
\ No newline at end of file
diff --git a/docs/content/shared-javascript-and-cpp-documentation/text-field.md b/docs/content/shared-javascript-and-cpp-documentation/text-field.md
new file mode 100644 (file)
index 0000000..3706bfc
--- /dev/null
@@ -0,0 +1,146 @@
+/**
+ *
+
+# Text Field {#text-field}
+
+## Overview
+
+The Dali::Toolkit::TextField is a control which provides a single-line editable text field.
+
+### Basic usage
+
+Before any text has been entered, the TextField can display some placeholder text.
+An alternative placeholder can be displayed when the TextField has keyboard focus.
+For example a TextField used to enter a username could initially show "Unknown Name", and then show "Enter Name." when the cursor is shown. 
+
+~~~{.cpp}
+// C++
+
+TextField field = TextField::New();
+field.SetProperty( TextField::Property::PLACEHOLDER_TEXT, "Unnamed Name" );
+field.SetProperty( TextField::Property::PLACEHOLDER_TEXT_FOCUSED, "Enter Name." );
+
+Stage::GetCurrent().Add( field );
+~~~
+
+~~~{.js}
+// JavaScript
+
+var field = new dali.TextField();
+field.placeholderText = "Unnamed Name";
+field.placeholderTextFocused = "Enter Name.";
+
+dali.stage.add( field );
+~~~
+
+When the TextField is tapped, it will automatically gain the keyboard focus. Key events will then result in text being inserted, and the placeholder text will be removed.
+After text has been entered, it can be retrieved from the TEXT property.
+
+~~~{.cpp}
+// C++
+
+Property::Value fieldText = field.GetProperty( TextField::Property::TEXT );
+std::cout << "Received text: " << fieldText.Get< std::string >() << std::endl;
+~~~
+
+~~~{.js}
+// JavaScript
+
+console.log( field.text );
+~~~
+
+### Font Selection
+
+TextField will automatically select a suitable fonts, in the same was as TextLabel.
+The preferred font can also be selected from a JSON stylesheet:
+
+~~~{.json}
+{
+  "styles":
+  {
+    "textfield":
+    {
+      "font-family":"Arial",
+      "font-style":"Regular",
+      "point-size":8
+    }
+  }
+}
+~~~
+
+### Text Alignment
+
+TextField displays a single-line of text, which will scroll if there is not enough room for the text displayed.
+If there is enough room, then the text can be aligned horizontally to the beginning, end, or center of the available area:
+
+~~~{.cpp}
+// C++
+
+field.SetProperty( TextField::Property::HORIZONTAL_ALIGNMENT, "BEGIN" ); // "CENTER" or "END"
+~~~
+
+~~~{.js}
+// JavaScript
+
+field.HorizontalAlignment = "BEGIN"; // "CENTER" or "END"
+~~~
+
+### TextField Decorations
+
+#### Color
+
+To change the color of the text, the recommended way is to use the TEXT_COLOR property.
+An alternative color can be used for placeholder text by setting PLACEHOLDER_TEXT_COLOR.
+Note that unlike the Actor::COLOR property, these properties will not affect child Actors added to the TextField.
+
+~~~{.cpp}
+// C++
+field.SetProperty( TextField::Property::TEXT_COLOR, Color::CYAN );
+field.SetProperty( TextField::Property::PLACEHOLDER_TEXT_COLOR, Color::BLACK );
+~~~
+
+~~~{.js}
+// JavaScript
+
+field.textColor = dali.COLOR_CYAN;
+field.placeholderTextColor = dali.COLOR_BLACK;
+~~~
+
+### Text Field Properties
+
+ Name (JavaScript)                 |  Name (C++)                          |  Type        | Writable     | Animatable
+-----------------------------------|--------------------------------------|--------------|--------------|-----------
+ renderingBackend                  | RENDERING_BACKEND                    |  INTEGER     | O            | X
+ text                              | TEXT                                 |  STRING      | O            | X
+ placeholderText                   | PLACEHOLDER_TEXT                     |  STRING      | O            | X
+ placeholderTextFocused            | PLACEHOLDER_TEXT_FOCUSED             |  STRING      | O            | X
+ fontFamily                        | FONT_FAMILY                          |  STRING      | O            | X
+ fontStyle                         | FONT_STYLE                           |  STRING      | O            | X
+ pointSize                         | POINT_SIZE                           |  FLOAT       | O            | X
+ maxLength                         | MAX_LENGTH                           |  INTEGER     | O            | X
+ exceedPolicy                      | EXCEED_POLICY                        |  INTEGER     | O            | X
+ horizontalAlignment               | HORIZONTAL_ALIGNMENT                 |  STRING      | O            | X
+ verticalAlignment                 | VERTICAL_ALIGNMENT                   |  STRING      | O            | X
+ textColor                         | TEXT_COLOR                           |  VECTOR4     | O            | X
+ shadowOffset                      | SHADOW_OFFSET                        |  VECTOR2     | O            | X
+ shadowColor                       | SHADOW_COLOR                         |  VECTOR4     | O            | X
+ primaryCursorColor                | PRIMARY_CURSOR_COLOR                 |  VECTOR4     | O            | X
+ secondaryCursorColor              | SECONDARY_CURSOR_COLOR               |  VECTOR4     | O            | X
+ enableCursorBlink                 | ENABLE_CURSOR_BLINK                  |  BOOLEAN     | O            | X
+ cursorBlinkInterval               | CURSOR_BLINK_INTERVAL                |  FLOAT       | O            | X
+ cursorBlinkDuration               | CURSOR_BLINK_DURATION                |  FLOAT       | O            | X
+ grabHandleImage                   | GRAB_HANDLE_IMAGE                    |  STRING      | O            | X
+ grabHandlePressedImage            | GRAB_HANDLE_PRESSED_IMAGE            |  STRING      | O            | X
+ scrollThreshold                   | SCROLL_THRESHOLD                     |  FLOAT       | O            | X
+ scrollSpreed                      | SCROLL_SPEED                         |  FLOAT       | O            | X
+ selectionHandleImageLeft          | SELECTION_HANDLE_IMAGE_LEFT          |  STRING      | O            | X
+ selectionHandleImageRight         | SELECTION_HANDLE_IMAGE_RIGHT         |  STRING      | O            | X
+ selectionHandlePressedImageLeft   | SELECTION_HANDLE_PRESSED_IMAGE_LEFT  |  STRING      | O            | X
+ selectionHandlePressedImageRight  | SELECTION_HANDLE_PRESSED_IMAGE_RIGHT |  STRING      | O            | X
+ selectionHighlightColor           | SELECTION_HIGHLIGHT_COLOR            |  VECTOR4     | O            | X
+ decorationBoundingBox             | DECORATION_BOUNDING_BOX              |  RECTANGLE   | O            | X
+ inputMethodSettings               | INPUT_METHOD_SETTINGS                |  MAP         | O            | X
+
+@class TextField
+
+*/
@@ -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     | O            | X
+ text                | TEXT                |  STRING      | O            | X
+ fontFamily          | FONT_FAMILY         |  STRING      | O            | X
+ fontStyle           | FONT_STYLE          |  STRING      | O            | X
+ pointSize           | POINT_SIZE          |  FLOAT       | O            | X
+ multiLine           | MULTI_LINE          |  BOOLEAN     | O            | X
+ horizontalAlignment | HORIZONTAL_ALIGNMENT|  STRING      | O            | X
+ verticalAlignment   | VERTICAL_ALIGNMENT  |  STRING      | O            | X
+ textColor           | TEXT_COLOR          |  VECTOR4     | O            | X
+ shadowOffset        | SHADOW_OFFSET       |  VECTOR2     | O            | X
+ shadowColor         | SHADOW_COLOR        |  VECTOR4     | O            | X
+ underlineEnabled    | UNDERLINE_ENABLED   |  BOOLEAN     | O            | X
+ underlineColor      | UNDERLINE_COLOR     |  VECTOR4     | O            | X
+ underlineHeight     | UNDERLINE_HEIGHT    |  FLOAT       | O            | X
+
+
+
+@class TextLabel
 
 */
index 23f414a..94c0141 100644 (file)
@@ -229,7 +229,7 @@ void LoadAtlasImages()
 
 ## Atlas creation tips
 
-- Compress the atlas  - \link Texture_Compression Compressing Textures \endlink
+- 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.
   
index addf616..9614bfb 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.0.41
+Version:    1.0.42
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
index e2383d0..51c869a 100644 (file)
@@ -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  |
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
- */
-
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 );
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
@@ -1,3 +1,6 @@
+#ifndef __DALI_V8PLUGIN_CONSTRAINER_API_H__
+#define __DALI_V8PLUGIN_CONSTRAINER_API_H__
+
 /*
  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  *
  */
 
-#include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
+
+// EXTERNAL INCLUDES
+#include <v8.h>
+
 
 namespace Dali
 {
 
-namespace Toolkit
+namespace V8Plugin
 {
 
-ItemFactory::~ItemFactory()
+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 Toolkit
+}; // 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 4a1e891..5389612 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali-toolkit/public-api/scripting/script-plugin.h>
+#include <dali-toolkit/devel-api/scripting/script-plugin.h>
 #include <dali/public-api/common/dali-common.h>
 
 namespace Dali DALI_IMPORT_API
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 60c5c55..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
@@ -789,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 00ee9a7..7a682f4 100644 (file)
@@ -21,7 +21,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali-toolkit/public-api/builder/builder.h>
+#include <dali-toolkit/devel-api/builder/builder.h>
 
 
 namespace Dali
index 33445d6..90ab615 100644 (file)
@@ -20,7 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <v8.h>
-#include <dali-toolkit/public-api/builder/builder.h>
+#include <dali-toolkit/devel-api/builder/builder.h>
 
 // INTERNAL INCLUDES
 #include <shared/base-wrapped-object.h>