From: Adeel Kazmi Date: Wed, 25 Feb 2015 12:00:13 +0000 (-0800) Subject: Merge "Scrollable public API clean-up phase 1" into tizen X-Git-Tag: dali_1.0.32~12 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=e217915091790637a8b4ea7e34480e852d242efd;hp=79182b18eabe71f0ffa2779f0ad17a859f855b9a Merge "Scrollable public API clean-up phase 1" into tizen --- diff --git a/dali-toolkit/dali-toolkit.h b/dali-toolkit/dali-toolkit.h index 942e62d..70f9652 100644 --- a/dali-toolkit/dali-toolkit.h +++ b/dali-toolkit/dali-toolkit.h @@ -111,6 +111,7 @@ #include #include #include +#include #include #include #include diff --git a/dali-toolkit/internal/controls/alignment/alignment-impl.cpp b/dali-toolkit/internal/controls/alignment/alignment-impl.cpp index 0f409f6..17dfff6 100644 --- a/dali-toolkit/internal/controls/alignment/alignment-impl.cpp +++ b/dali-toolkit/internal/controls/alignment/alignment-impl.cpp @@ -19,6 +19,7 @@ #include "alignment-impl.h" // EXTERNAL INCLUDES +#include #include // INTERNAL INCLUDES diff --git a/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp b/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp index cf24627..dfbebc4 100644 --- a/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp +++ b/dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp @@ -21,6 +21,8 @@ // EXTERNAL INCLUDES #include #include +#include +#include #include #include #include diff --git a/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.cpp b/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.cpp index 40ee650..f0d5497 100644 --- a/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.cpp @@ -20,6 +20,8 @@ // EXTERNAL INCLUDES #include +#include +#include #include #include diff --git a/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.cpp b/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.cpp index 5a60a1d..31176f4 100644 --- a/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.cpp @@ -21,6 +21,8 @@ // EXTERNAL INCLUDES #include #include +#include +#include #include #include diff --git a/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp b/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp index d140750..fcd9939 100644 --- a/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp +++ b/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp @@ -19,6 +19,8 @@ #include "effects-view-impl.h" // EXTERNAL INCLUDES +#include +#include #include #include #include diff --git a/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp b/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp index 430148a..ef1c7dd 100644 --- a/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp +++ b/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp @@ -21,6 +21,8 @@ // EXTERNAL INCLUDES #include #include +#include +#include #include #include #include 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 index fad0ade..95ccf59 100644 --- a/dali-toolkit/internal/controls/image-view/masked-image-view-impl.cpp +++ b/dali-toolkit/internal/controls/image-view/masked-image-view-impl.cpp @@ -20,6 +20,8 @@ // EXTERNAL INCLUDES #include +#include +#include #include #include #include diff --git a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp index 8df457f..24f8e4b 100644 --- a/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp +++ b/dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp @@ -19,6 +19,8 @@ #include // EXTERNAL INCLUDES +#include +#include #include #include #include diff --git a/dali-toolkit/internal/controls/navigation-frame/navigation-bar.h b/dali-toolkit/internal/controls/navigation-frame/navigation-bar.h index bf26399..ae6c948 100644 --- a/dali-toolkit/internal/controls/navigation-frame/navigation-bar.h +++ b/dali-toolkit/internal/controls/navigation-frame/navigation-bar.h @@ -22,6 +22,7 @@ #include // INTERNAL INCLUDES +#include #include #include #include diff --git a/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp b/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp index 392f733..e08a223 100644 --- a/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp +++ b/dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp @@ -20,6 +20,8 @@ // EXTERNAL INCLUDES #include +#include +#include #include #include #include diff --git a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp index 8c8923a..55a86e2 100755 --- a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp +++ b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.cpp @@ -19,6 +19,7 @@ #include // EXTERNAL INCLUDES +#include #include #include #include diff --git a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h index 1d717c2..6979c52 100755 --- a/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h +++ b/dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h @@ -21,6 +21,7 @@ // EXTERNAL INCLUDES #include #include +#include #include #include @@ -239,7 +240,7 @@ private: private: - Constrainable mScrollPositionObject; ///< From mScrollConnector + Handle mScrollPositionObject; ///< From mScrollConnector ImageActor mIndicator; ///< Image of scroll indicator. Animation mAnimation; ///< Scroll indicator Show/Hide Animation. 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 index bc12931..9af5f0b 100755 --- a/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp +++ b/dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.cpp @@ -19,6 +19,9 @@ #include // EXTERNAL INCLUDES +#include +#include +#include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp index 4e3bb67..a4f1ffb 100644 --- a/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp +++ b/dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp @@ -19,14 +19,14 @@ #include // EXTERNAL INCLUDES +#include #include -#include +#include #include +#include #include #include -#include - namespace Dali { diff --git a/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp b/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp index 3fbf1d4..cee9c8c 100644 --- a/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.cpp @@ -20,6 +20,8 @@ // EXTERNAL INCLUDES #include +#include +#include #include #include #include diff --git a/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h b/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h index 51bb3ae..991f538 100644 --- a/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h +++ b/dali-toolkit/internal/controls/scrollable/item-view/item-view-impl.h @@ -588,7 +588,7 @@ private: Actor mOvershootOverlay; ///< The overlay actor for overshoot effect Dali::Toolkit::ScrollConnector mScrollConnector; ///< Connects ItemView with scrollable components e.g. scroll bars - Constrainable mScrollPositionObject; ///< From mScrollConnector + Handle mScrollPositionObject; ///< From mScrollConnector bool mAddingItems; diff --git a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp index cf0d74e..76930e0 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp +++ b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.cpp @@ -99,7 +99,7 @@ ScrollConnector::ScrollConnector() mMaxLimit( 0.0f ), mContentLength( 0.0f ) { - mScrollPositionObject = Constrainable::New(); + mScrollPositionObject = Handle::New(); mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::SCROLL_POSITION_PROPERTY_NAME, 0.0f ); mScrollPositionObject.RegisterProperty( Toolkit::ScrollConnector::OVERSHOOT_PROPERTY_NAME, 0.0f ); diff --git a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h index 8cd176f..ff91e1b 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h @@ -115,7 +115,7 @@ public: * Retrieve the object which provides the "scroll-position" property. * @return The scroll-position object. */ - Constrainable GetScrollPositionObject() const + Handle GetScrollPositionObject() const { return mScrollPositionObject; } @@ -151,7 +151,7 @@ private: private: - Constrainable mScrollPositionObject; + Handle mScrollPositionObject; DomainChangedSignalType mDomainChangedSignal; ScrollPositionChangedSignalType mScrollPositionChangedSignal; diff --git a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h index 6c00f40..5ded775 100644 --- a/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h +++ b/dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h @@ -21,6 +21,8 @@ // EXTERNAL INCLUDES // TODO - Replace list with dali-vector.h #include +#include +#include // INTERNAL INCLUDES 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 index f396645..41276be 100644 --- 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 @@ -17,6 +17,9 @@ // EXTERNAL INCLUDES #include +#include +#include +#include // INTERNAL INCLUDES #include 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 index bda70a46..747eafb 100644 --- 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 @@ -17,6 +17,9 @@ // EXTERNAL INCLUDES #include +#include +#include +#include // INTERNAL INCLUDES #include 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 index f058f16..05c2cd5 100644 --- 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 @@ -15,6 +15,11 @@ * */ +// EXTERNAL INCLUDES +#include +#include +#include + // INTERNAL INCLUDES #include #include 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 index 93d41df..00cd646 100644 --- 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 @@ -20,6 +20,9 @@ // EXTERNAL INCLUDES #include +#include +#include +#include // INTERNAL INCLUDES #include 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 index 24a0a92..e47a3a3 100644 --- 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 @@ -20,6 +20,9 @@ // EXTERNAL INCLUDES #include +#include +#include +#include // INTERNAL INCLUDES #include diff --git a/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp b/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp index d47d9bf..3c762ca 100644 --- a/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp +++ b/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp @@ -21,6 +21,8 @@ // EXTERNAL INCLUDES #include #include +#include +#include #include #include #include diff --git a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp index d189ed6..37bfef4 100644 --- a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp +++ b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp @@ -20,6 +20,8 @@ // EXTERNAL INCLUDES #include +#include +#include #include #include #include diff --git a/dali-toolkit/internal/filters/blur-two-pass-filter.cpp b/dali-toolkit/internal/filters/blur-two-pass-filter.cpp index 5dd5437..a9b3c9e 100644 --- a/dali-toolkit/internal/filters/blur-two-pass-filter.cpp +++ b/dali-toolkit/internal/filters/blur-two-pass-filter.cpp @@ -288,7 +288,7 @@ void BlurTwoPassFilter::SetSize( const Vector2& size ) } } -Constrainable BlurTwoPassFilter::GetHandleForAnimateBlurStrength() +Handle BlurTwoPassFilter::GetHandleForAnimateBlurStrength() { return mShaderForBlending; } diff --git a/dali-toolkit/internal/filters/blur-two-pass-filter.h b/dali-toolkit/internal/filters/blur-two-pass-filter.h index 9b29dde..1e723b9 100644 --- a/dali-toolkit/internal/filters/blur-two-pass-filter.h +++ b/dali-toolkit/internal/filters/blur-two-pass-filter.h @@ -73,10 +73,10 @@ public: // From ImageFilter Property::Index GetBlurStrengthPropertyIndex() const {return mBlurStrengthPropertyIndex;} /** - * Retrieve the constrainable object to animate or constrain the blur strength property - * @return the constrainable object which blend the output image according to the blur strength + * Retrieve the handle to the object in order to animate or constrain the blur strength property + * @return The hadnle to the object which blends the output image according to the blur strength */ - Constrainable GetHandleForAnimateBlurStrength(); + Handle GetHandleForAnimateBlurStrength(); private: /** diff --git a/dali-toolkit/internal/shader-effects/page-turn-effect-impl.cpp b/dali-toolkit/internal/shader-effects/page-turn-effect-impl.cpp index d3d5ecf..ead7e40 100644 --- a/dali-toolkit/internal/shader-effects/page-turn-effect-impl.cpp +++ b/dali-toolkit/internal/shader-effects/page-turn-effect-impl.cpp @@ -20,6 +20,8 @@ // EXTERNAL HEADERS #include +#include +#include #include namespace Dali diff --git a/dali-toolkit/internal/shader-effects/page-turn-effect-impl.h b/dali-toolkit/internal/shader-effects/page-turn-effect-impl.h index 841d200..1e49e33 100644 --- a/dali-toolkit/internal/shader-effects/page-turn-effect-impl.h +++ b/dali-toolkit/internal/shader-effects/page-turn-effect-impl.h @@ -17,6 +17,10 @@ * limitations under the License. * */ + +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include diff --git a/dali-toolkit/public-api/controls/cluster/cluster.h b/dali-toolkit/public-api/controls/cluster/cluster.h index f8c845a..aff0afb 100644 --- a/dali-toolkit/public-api/controls/cluster/cluster.h +++ b/dali-toolkit/public-api/controls/cluster/cluster.h @@ -18,6 +18,10 @@ * */ +// EXTERNAL INCLUDES +#include +#include + // INTERNAL INCLUDES #include diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index f686766..1697c9b 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -22,12 +22,15 @@ #include #include #include +#include +#include #include #include #include #include #include +// INTERNAL INCLUDES #include #include #include diff --git a/dali-toolkit/public-api/controls/navigation-frame/navigation-control.h b/dali-toolkit/public-api/controls/navigation-frame/navigation-control.h index ffc7a44..87924f5 100644 --- a/dali-toolkit/public-api/controls/navigation-frame/navigation-control.h +++ b/dali-toolkit/public-api/controls/navigation-frame/navigation-control.h @@ -19,6 +19,7 @@ */ // INTERNAL INCLUDES +#include #include #include #include diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.h b/dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.h index c4e3683..f9b12af 100644 --- a/dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.h +++ b/dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.h @@ -19,7 +19,6 @@ */ // INTERNAL INCLUDES - #include namespace Dali diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp index 03a06c0..2f733e5 100644 --- a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp +++ b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.cpp @@ -19,6 +19,7 @@ #include // EXTERNAL INCLUDES +#include #include #include @@ -185,7 +186,7 @@ float ItemLayout::GetFlickSpeedFactor() const return GetScrollSpeedFactor(); } -void ItemLayout::ApplyConstraints( Actor& actor, const int itemId, const float durationSeconds, Constrainable scrollPositionObject, const Actor& itemViewActor ) +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. diff --git a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h index 030ddb9..c81fe2e 100644 --- a/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h +++ b/dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h @@ -19,6 +19,7 @@ */ // EXTERNAL INCLUDES +#include #include // INTERNAL INCLUDES @@ -375,7 +376,7 @@ public: * @param[in] scrollPositionObject The object which provides the layout position property. * @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, Constrainable scrollPositionObject, const Actor& itemViewActor ); + DALI_IMPORT_API virtual void ApplyConstraints( Actor& actor, const int itemId, const float durationSeconds, Handle scrollPositionObject, const Actor& itemViewActor ); /** * @brief Gets the position of a given item diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp b/dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp index 8650774..a8dac9e 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp +++ b/dali-toolkit/public-api/controls/scrollable/scroll-connector.cpp @@ -75,7 +75,7 @@ float ScrollConnector::GetContentLength() const return GetImpl(*this).GetContentLength(); } -Constrainable ScrollConnector::GetScrollPositionObject() const +Handle ScrollConnector::GetScrollPositionObject() const { return GetImpl(*this).GetScrollPositionObject(); } diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-connector.h b/dali-toolkit/public-api/controls/scrollable/scroll-connector.h index 8cd78b7..986f12f 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-connector.h +++ b/dali-toolkit/public-api/controls/scrollable/scroll-connector.h @@ -19,7 +19,7 @@ */ // EXTERNAL INCLUDES -#include +#include namespace Dali { @@ -161,7 +161,7 @@ public: * @brief Retrieve the object which provides the "scroll-position" property. * @return The scroll-position object. */ - Constrainable GetScrollPositionObject() const; + Handle GetScrollPositionObject() const; public: // Not intended for application developers diff --git a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h index 5a2e93d..818e4b4 100644 --- a/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h +++ b/dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h @@ -18,6 +18,9 @@ * */ +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include diff --git a/dali-toolkit/public-api/file.list b/dali-toolkit/public-api/file.list index 1b9307a..85a3702 100755 --- a/dali-toolkit/public-api/file.list +++ b/dali-toolkit/public-api/file.list @@ -85,6 +85,7 @@ public_api_src_files = \ $(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 \ @@ -250,6 +251,7 @@ public_api_shader_effects_header_files = \ $(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 \ diff --git a/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp b/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp index 1b77466..034b6b2 100644 --- a/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp @@ -19,6 +19,8 @@ #include // EXTERNAL INCLUDES +#include +#include #include namespace Dali diff --git a/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp b/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp index 48dff1d..eecf1d0 100644 --- a/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp @@ -19,6 +19,8 @@ #include // EXTERNAL INCLUDES +#include +#include #include namespace Dali diff --git a/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp b/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp index c18d9e7..334e609 100644 --- a/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp @@ -19,6 +19,9 @@ #include // EXTERNAL INCLUDES +#include +#include +#include #include #include diff --git a/dali-toolkit/public-api/shader-effects/quadratic-bezier.cpp b/dali-toolkit/public-api/shader-effects/quadratic-bezier.cpp new file mode 100644 index 0000000..7c8965c --- /dev/null +++ b/dali-toolkit/public-api/shader-effects/quadratic-bezier.cpp @@ -0,0 +1,163 @@ +/* + * 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 + +//EXTERNAL HEADERS +#include + +namespace Dali +{ + +namespace Toolkit +{ + +namespace +{ +const char* POINT_PROPERTY_NAME( "uPoint" ); +const char* LINEWIDTH_PROPERTY_NAME( "uLineWidth" ); +const char* COLOR_PROPERTY_NAME( "uColor" ); +} // namespace + +QuadraticBezier::QuadraticBezier() +{ +} + +//Call the Parent copy constructor to add reference to the implementation for this object +QuadraticBezier::QuadraticBezier(ShaderEffect handle) +:ShaderEffect(handle) +{ +} + +QuadraticBezier::~QuadraticBezier() +{ +} + +QuadraticBezier QuadraticBezier::New(unsigned int pointCount, bool filled ) +{ + std::string vertexShader = DALI_COMPOSE_SHADER + ( + uniform mediump vec3 uPoint[MAX_POINT_COUNT];\n + varying highp vec2 vCoefficient; + void main()\n + {\n + int vertexId = int(aNormal.z);\n + gl_Position = uMvpMatrix * vec4(uPoint[vertexId], 1.0);\n + vCoefficient = aNormal.xy;\n + }\n + ); + + std::string fragmentShader; + + if( filled ) + { + fragmentShader = DALI_COMPOSE_SHADER + ( + varying highp vec2 vCoefficient;\n + + void main()\n + {\n + highp float C = (vCoefficient.x*vCoefficient.x-vCoefficient.y);\n + highp float Cdx = dFdx(C);\n + highp float Cdy = dFdy(C);\n + + highp float distance = float(C / sqrt(Cdx*Cdx + Cdy*Cdy));\n + + gl_FragColor = uColor;\n + highp float alpha = 0.5 - distance;\n + if( alpha < 0.0 )\n + discard;\n + + gl_FragColor.w = alpha;\n + }\n + ); + } + else + { + fragmentShader = DALI_COMPOSE_SHADER + ( + varying highp vec2 vCoefficient;\n + uniform lowp float uLineWidth;\n + + void main()\n + {\n + highp float C = (vCoefficient.x*vCoefficient.x-vCoefficient.y);\n + highp float Cdx = dFdx(C);\n + highp float Cdy = dFdy(C);\n + highp float distance = abs(float(C / sqrt(Cdx*Cdx + Cdy*Cdy)));\n + gl_FragColor = uColor*(uLineWidth-distance);\n + }\n + ); + } + + std::ostringstream vertexShaderPrefix; + vertexShaderPrefix << "#define MAX_POINT_COUNT "<< pointCount << "\n"; + + Dali::ShaderEffect shaderEffectCustom = Dali::ShaderEffect::NewWithPrefix( vertexShaderPrefix.str(),vertexShader, + "#extension GL_OES_standard_derivatives:enable\n", fragmentShader, + GEOMETRY_TYPE_UNTEXTURED_MESH ); + + Dali::Toolkit::QuadraticBezier handle( shaderEffectCustom ); + + //Set default uniform values + handle.SetUniform( COLOR_PROPERTY_NAME, Vector4(1.0f,1.0f,1.0f,1.0f) ); + if( !filled ) + { + //Set default line widht to 1 pixel + handle.SetUniform( LINEWIDTH_PROPERTY_NAME, 1.0f ); + } + + return handle; +} + +void QuadraticBezier::SetPoint(unsigned int index, const Vector3& position) +{ + SetUniform( GetPointPropertyName(index), position ); +} + +void QuadraticBezier::SetLineWidth( float width ) +{ + SetUniform( LINEWIDTH_PROPERTY_NAME, width ); +} + +void QuadraticBezier::SetColor( const Vector4& color ) +{ + SetUniform( COLOR_PROPERTY_NAME, color ); +} + +std::string QuadraticBezier::GetPointPropertyName(unsigned int index) const +{ + std::ostringstream propertyName; + propertyName< + +namespace Dali +{ + +namespace Toolkit +{ +/** + * @brief QuadraticBezier is a custom shader to render quadratic bezier curves and bounded regions. + * + * Implementation based on the paper "Resolution Independent Curve Rendering using Programmable Graphics Hardware" + * by Charles Loop and Jim Blinn. + * + * The coordinates of the control points is passed to the shader via uniforms. + * aNormal attribute is used to pass the coefficients of each control point (xy coordinates) as well as the vertex ID (z coordinate). + * A quadratic curve should have as normal for the first control point (0.0,0.0), (0.5,0.0) for the second and (1.0,1.0) for the third. + * Triangles that do not contain curves should have coordinates (0.0,1.0) for each control point in order to be filled properly. + */ + +class DALI_IMPORT_API QuadraticBezier : public ShaderEffect +{ +public: + + /** + * @brief Create an uninitialized QuadraticBezier; this can be initialized with QuadraticBezier::New(). + * + * Calling member functions with an uninitialized Dali::Object is not allowed. + */ + QuadraticBezier(); + + /** + * @brief Destructor + * + * This is non-virtual since derived Handle types must not contain data or virtual methods. + */ + ~QuadraticBezier(); + + /** + * @brief Create an initialized QuadraticBezier. + * + * @param[in] pointCount The maximum number of vertices + * @param[in] filled Specify whether the the bounded region should be filled or not + * @return A handle to a newly allocated Dali resource. + */ + static QuadraticBezier New(unsigned int pointCount, bool filled ); + + /** + * @brief Set position coordinates for a point in the curve + * + * @param[in] index The index of the vertex + * @param[in] position The new position + */ + void SetPoint( unsigned int index, const Vector3& position ); + + /** + * @brief Set the width of the pathThis is only for not filled curves + * + * @param[in] width Width of the line in pixels + */ + void SetLineWidth( float width ); + + /** + * @brief Sets the color of the curve + * + * @param[in] color The new color + */ + void SetColor( const Vector4& color ); + + /** + * @brief Get the name of a the point property given its index + * + * @param[in] index Index of the vertex + * @return A std::string containing the property name + */ + std::string GetPointPropertyName( unsigned int index ) const; + + /** + * @brief Get the name of the line width property + * + * @return A std::string containing the property name + */ + std::string GetLineWidthPropertyName( ) const; + + /** + * @brief Get the name of the color property + * + * @return A std::string containing the property name + */ + std::string GetColorPropertyName( ) const; + +private: // Not intended for application developers + + DALI_INTERNAL QuadraticBezier(ShaderEffect handle); + +}; + +} // namespace Toolkit + +} // namespace Dali + +#endif // __DALI_TOOLKIT_IMAGE_REGION_EFFECT_H__ diff --git a/dali-toolkit/public-api/shader-effects/soft-button-effect.cpp b/dali-toolkit/public-api/shader-effects/soft-button-effect.cpp index 92015b9..0ea73e7 100644 --- a/dali-toolkit/public-api/shader-effects/soft-button-effect.cpp +++ b/dali-toolkit/public-api/shader-effects/soft-button-effect.cpp @@ -15,7 +15,14 @@ * */ +// EXTERNAL INCLUDES +#include +#include +#include + +// INTERNAL INCLUDES #include + namespace Dali {