Merge "Scrollable public API clean-up phase 1" into tizen
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 25 Feb 2015 12:00:13 +0000 (04:00 -0800)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 25 Feb 2015 12:00:13 +0000 (04:00 -0800)
47 files changed:
dali-toolkit/dali-toolkit.h
dali-toolkit/internal/controls/alignment/alignment-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/buttons/check-box-button-default-painter-impl.cpp
dali-toolkit/internal/controls/buttons/push-button-default-painter-impl.cpp
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/image-view/masked-image-view-impl.cpp
dali-toolkit/internal/controls/magnifier/magnifier-impl.cpp
dali-toolkit/internal/controls/navigation-frame/navigation-bar.h
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
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
dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.cpp
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/scroll-connector-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-carousel-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-cube-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-depth-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-carousel-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-cube-effect-impl.cpp
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/filters/blur-two-pass-filter.cpp
dali-toolkit/internal/filters/blur-two-pass-filter.h
dali-toolkit/internal/shader-effects/page-turn-effect-impl.cpp
dali-toolkit/internal/shader-effects/page-turn-effect-impl.h
dali-toolkit/public-api/controls/cluster/cluster.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/navigation-frame/navigation-control.h
dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.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/scroll-connector.cpp
dali-toolkit/public-api/controls/scrollable/scroll-connector.h
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h
dali-toolkit/public-api/file.list
dali-toolkit/public-api/shader-effects/motion-blur-effect.cpp
dali-toolkit/public-api/shader-effects/motion-stretch-effect.cpp
dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.cpp
dali-toolkit/public-api/shader-effects/quadratic-bezier.cpp [new file with mode: 0644]
dali-toolkit/public-api/shader-effects/quadratic-bezier.h [new file with mode: 0644]
dali-toolkit/public-api/shader-effects/soft-button-effect.cpp

index 942e62d..70f9652 100644 (file)
 #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>
index 0f409f6..17dfff6 100644 (file)
@@ -19,6 +19,7 @@
 #include "alignment-impl.h"
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/object/property-input.h>
 #include <dali/public-api/object/type-registry.h>
 
 // INTERNAL INCLUDES
index cf24627..dfbebc4 100644 (file)
@@ -21,6 +21,8 @@
 // EXTERNAL INCLUDES
 #include <sstream>
 #include <iomanip>
+#include <dali/public-api/animation/active-constraint.h>
+#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/object/type-registry.h>
index 40ee650..f0d5497 100644 (file)
@@ -20,6 +20,8 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/image-actor.h>
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/ref-object.h>
 
index 5a60a1d..31176f4 100644 (file)
@@ -21,6 +21,8 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/adaptor-framework/timer.h>
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/ref-object.h>
 
index d140750..fcd9939 100644 (file)
@@ -19,6 +19,8 @@
 #include "effects-view-impl.h"
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/animation/active-constraint.h>
+#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/object/type-registry.h>
index 430148a..ef1c7dd 100644 (file)
@@ -21,6 +21,8 @@
 // EXTERNAL INCLUDES
 #include <sstream>
 #include <iomanip>
+#include <dali/public-api/animation/active-constraint.h>
+#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/object/type-registry.h>
index fad0ade..95ccf59 100644 (file)
@@ -20,6 +20,8 @@
 
 // EXTERNAL INCLUDES
 #include <sstream>
+#include <dali/public-api/animation/active-constraint.h>
+#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>
index 8df457f..24f8e4b 100644 (file)
@@ -19,6 +19,8 @@
 #include <dali-toolkit/internal/controls/magnifier/magnifier-impl.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/animation/active-constraint.h>
+#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>
index bf26399..ae6c948 100644 (file)
@@ -22,6 +22,7 @@
 #include <string>
 
 // INTERNAL INCLUDES
+#include <dali/public-api/animation/alpha-functions.h>
 #include <dali-toolkit/public-api/controls/table-view/table-view.h>
 #include <dali-toolkit/public-api/controls/navigation-frame/page.h>
 #include <dali-toolkit/public-api/controls/navigation-frame/navigation-bar-style.h>
index 392f733..e08a223 100644 (file)
@@ -20,6 +20,8 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/animation/animation.h>
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/events/hit-test-algorithm.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
index 8c8923a..55a86e2 100755 (executable)
@@ -19,6 +19,7 @@
 #include <dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h>
 
 // EXTERNAL INCLUDES
+#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/images/resource-image.h>
index 1d717c2..6979c52 100755 (executable)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/actors/image-actor.h>
+#include <dali/public-api/animation/active-constraint.h>
 #include <dali/public-api/animation/animation.h>
 #include <dali/public-api/object/property-notification.h>
 
@@ -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.
index bc12931..9af5f0b 100755 (executable)
@@ -19,6 +19,9 @@
 #include <dali-toolkit/internal/controls/scroll-component/scroll-bar-internal-impl.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/animation/active-constraint.h>
+#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/images/resource-image.h>
 
index 4e3bb67..a4f1ffb 100644 (file)
 #include <dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h>
 
 // EXTERNAL INCLUDES
+#include <math.h>
 #include <dali/public-api/actors/mesh-actor.h>
-#include <dali/public-api/geometry/animatable-mesh.h>
+#include <dali/public-api/animation/active-constraint.h>
 #include <dali/public-api/animation/constraint.h>
+#include <dali/public-api/geometry/animatable-mesh.h>
 #include <dali/public-api/shader-effects/shader-effect.h>
 #include <dali/public-api/math/vector3.h>
 
-#include <math.h>
-
 namespace Dali
 {
 
index 3fbf1d4..cee9c8c 100644 (file)
@@ -20,6 +20,8 @@
 
 // EXTERNAL INCLUDES
 #include <algorithm>
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/common/set-wrapper.h>
 #include <dali/public-api/common/stage.h>
index 51bb3ae..991f538 100644 (file)
@@ -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;
 
index cf0d74e..76930e0 100644 (file)
@@ -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 );
index 8cd176f..ff91e1b 100644 (file)
@@ -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;
index 6c00f40..5ded775 100644 (file)
@@ -21,6 +21,8 @@
 // EXTERNAL INCLUDES
 // TODO - Replace list with dali-vector.h
 #include <list>
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
 
 // INTERNAL INCLUDES
 
index f396645..41276be 100644 (file)
@@ -17,6 +17,9 @@
 
 // EXTERNAL INCLUDES
 #include <boost/bind.hpp>
+#include <dali/public-api/animation/active-constraint.h>
+#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>
index bda70a4..747eafb 100644 (file)
@@ -17,6 +17,9 @@
 
 // EXTERNAL INCLUDES
 #include <boost/bind.hpp>
+#include <dali/public-api/animation/active-constraint.h>
+#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>
index f058f16..05c2cd5 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/animation/active-constraint.h>
+#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>
index 93d41df..00cd646 100644 (file)
@@ -20,6 +20,9 @@
 
 // EXTERNAL INCLUDES
 #include <boost/bind.hpp>
+#include <dali/public-api/animation/active-constraint.h>
+#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>
index 24a0a92..e47a3a3 100644 (file)
@@ -20,6 +20,9 @@
 
 // EXTERNAL INCLUDES
 #include <boost/bind.hpp>
+#include <dali/public-api/animation/active-constraint.h>
+#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>
index d47d9bf..3c762ca 100644 (file)
@@ -21,6 +21,8 @@
 // EXTERNAL INCLUDES
 #include <sstream>
 #include <iomanip>
+#include <dali/public-api/animation/active-constraint.h>
+#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/render-tasks/render-task-list.h>
index d189ed6..37bfef4 100644 (file)
@@ -20,6 +20,8 @@
 
 // EXTERNAL INCLUDES
 #include <cmath>
+#include <dali/public-api/animation/active-constraint.h>
+#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/scripting/scripting.h>
index 5dd5437..a9b3c9e 100644 (file)
@@ -288,7 +288,7 @@ void BlurTwoPassFilter::SetSize( const Vector2& size )
   }
 }
 
-Constrainable BlurTwoPassFilter::GetHandleForAnimateBlurStrength()
+Handle BlurTwoPassFilter::GetHandleForAnimateBlurStrength()
 {
   return mShaderForBlending;
 }
index 9b29dde..1e723b9 100644 (file)
@@ -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:
   /**
index d3d5ecf..ead7e40 100644 (file)
@@ -20,6 +20,8 @@
 
 // EXTERNAL HEADERS
 #include <sstream>
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/common/stage.h>
 
 namespace Dali
index 841d200..1e49e33 100644 (file)
  * limitations under the License.
  *
  */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/animation/constraint.h>
+
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/shader-effects/page-turn-effect.h>
 
index f8c845a..aff0afb 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/time-period.h>
+
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
 
index f686766..1697c9b 100644 (file)
 #include <stack>
 #include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/actors/mesh-actor.h>
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/geometry/mesh.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
+// INTERNAL INCLUDES
 #include <dali-toolkit/internal/controls/relayout-controller.h>
 #include <dali-toolkit/internal/controls/relayout-helper.h>
 #include <dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h>
index ffc7a44..87924f5 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // INTERNAL INCLUDES
+#include <dali/public-api/animation/alpha-functions.h>
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/controls/navigation-frame/page.h>
 #include <dali-toolkit/public-api/controls/navigation-frame/navigation-bar-style.h>
index 03a06c0..2f733e5 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/animation/active-constraint.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/time-period.h>
 
@@ -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.
index 030ddb9..c81fe2e 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/animation/alpha-functions.h>
 #include <dali/public-api/common/vector-wrapper.h>
 
 // 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
index 8650774..a8dac9e 100644 (file)
@@ -75,7 +75,7 @@ float ScrollConnector::GetContentLength() const
   return GetImpl(*this).GetContentLength();
 }
 
-Constrainable ScrollConnector::GetScrollPositionObject() const
+Handle ScrollConnector::GetScrollPositionObject() const
 {
   return GetImpl(*this).GetScrollPositionObject();
 }
index 8cd78b7..986f12f 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/object/constrainable.h>
+#include <dali/public-api/object/handle.h>
 
 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
 
index 5a2e93d..818e4b4 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/animation/alpha-functions.h>
+
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
 
index 1b9307a..85a3702 100755 (executable)
@@ -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 \
index 1b77466..034b6b2 100644 (file)
@@ -19,6 +19,8 @@
 #include <dali-toolkit/public-api/shader-effects/motion-blur-effect.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 
 namespace Dali
index 48dff1d..eecf1d0 100644 (file)
@@ -19,6 +19,8 @@
 #include <dali-toolkit/public-api/shader-effects/motion-stretch-effect.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/constraints.h>
 
 namespace Dali
index c18d9e7..334e609 100644 (file)
@@ -19,6 +19,9 @@
 #include <dali-toolkit/public-api/shader-effects/nine-patch-mask-effect.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
+#include <dali/public-api/object/property-input.h>
 #include <dali/public-api/shader-effects/shader-effect.h>
 #include <dali/public-api/images/resource-image.h>
 
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 (file)
index 0000000..7c8965c
--- /dev/null
@@ -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 <dali-toolkit/public-api/shader-effects/quadratic-bezier.h>
+
+//EXTERNAL HEADERS
+#include <sstream>
+
+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<<POINT_PROPERTY_NAME<<"["<<index<<"]";
+  return propertyName.str();
+}
+
+std::string QuadraticBezier::GetLineWidthPropertyName( ) const
+{
+  return LINEWIDTH_PROPERTY_NAME;
+}
+
+std::string QuadraticBezier::GetColorPropertyName( ) const
+{
+  return COLOR_PROPERTY_NAME;
+}
+
+} // namespace Toolkit
+
+} // namespace Dali
+
diff --git a/dali-toolkit/public-api/shader-effects/quadratic-bezier.h b/dali-toolkit/public-api/shader-effects/quadratic-bezier.h
new file mode 100644 (file)
index 0000000..7d5e199
--- /dev/null
@@ -0,0 +1,122 @@
+#ifndef __DALI_TOOLKIT_QUADRATIC_BEZIER_H__
+#define __DALI_TOOLKIT_QUADRATIC_BEZIER_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/shader-effects/shader-effect.h>
+
+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__
index 92015b9..0ea73e7 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <dali/public-api/animation/active-constraint.h>
+#include <dali/public-api/animation/constraint.h>
+#include <dali/public-api/object/property-input.h>
+
+// INTERNAL INCLUDES
 #include <dali-toolkit/public-api/shader-effects/soft-button-effect.h>
+
 namespace Dali
 {