Merge branch 'tizen' into devel/new_mesh 34/40734/2
authorFrancisco Santos <f1.santos@samsung.com>
Mon, 8 Jun 2015 09:56:13 +0000 (10:56 +0100)
committerFrancisco Santos <f1.santos@samsung.com>
Mon, 8 Jun 2015 12:24:09 +0000 (13:24 +0100)
Conflicts:
automated-tests/src/dali-toolkit/CMakeLists.txt
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-BubbleEmitter.cpp
automated-tests/src/dali-toolkit/utc-Dali-CarouselEffect.cpp
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-IrisEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-MaskEffect.cpp
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-PageTurnEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-PushButton.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-ShearEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-SoftButtonEffect.cpp
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-SwirlEffect.cpp
automated-tests/src/dali-toolkit/utc-Dali-WaterEffect.cpp
build/tizen/dali-toolkit/Makefile.am
dali-toolkit/dali-toolkit.h
dali-toolkit/devel-api/shader-effects/alpha-discard-effect.cpp
dali-toolkit/devel-api/shader-effects/bendy-effect.cpp
dali-toolkit/devel-api/shader-effects/blind-effect.cpp
dali-toolkit/devel-api/shader-effects/bouncing-effect.cpp
dali-toolkit/devel-api/shader-effects/bubble-effect/bubble-effect.cpp
dali-toolkit/devel-api/shader-effects/bubble-effect/bubble-effect.h
dali-toolkit/devel-api/shader-effects/bubble-effect/color-adjuster.cpp
dali-toolkit/devel-api/shader-effects/bubble-effect/color-adjuster.h
dali-toolkit/devel-api/shader-effects/carousel-effect.cpp
dali-toolkit/devel-api/shader-effects/displacement-effect.cpp
dali-toolkit/devel-api/shader-effects/dissolve-effect.cpp
dali-toolkit/devel-api/shader-effects/dissolve-local-effect.cpp
dali-toolkit/devel-api/shader-effects/distance-field-effect.cpp
dali-toolkit/devel-api/shader-effects/image-region-effect.cpp
dali-toolkit/devel-api/shader-effects/iris-effect.cpp
dali-toolkit/devel-api/shader-effects/mask-effect.cpp
dali-toolkit/devel-api/shader-effects/mirror-effect.cpp
dali-toolkit/devel-api/shader-effects/motion-blur-effect.cpp
dali-toolkit/devel-api/shader-effects/motion-stretch-effect.cpp
dali-toolkit/devel-api/shader-effects/nine-patch-mask-effect.cpp
dali-toolkit/devel-api/shader-effects/overlay-effect.cpp
dali-toolkit/devel-api/shader-effects/page-turn-book-spine-effect.cpp
dali-toolkit/devel-api/shader-effects/page-turn-book-spine-effect.h
dali-toolkit/devel-api/shader-effects/page-turn-effect.cpp
dali-toolkit/devel-api/shader-effects/page-turn-effect.h
dali-toolkit/devel-api/shader-effects/quadratic-bezier.cpp
dali-toolkit/devel-api/shader-effects/ripple-effect.cpp
dali-toolkit/devel-api/shader-effects/ripple2d-effect.cpp
dali-toolkit/devel-api/shader-effects/shear-effect.cpp
dali-toolkit/devel-api/shader-effects/soft-button-effect.cpp
dali-toolkit/devel-api/shader-effects/spot-effect.cpp
dali-toolkit/devel-api/shader-effects/square-dissolve-effect.cpp
dali-toolkit/devel-api/shader-effects/swirl-effect.cpp
dali-toolkit/devel-api/shader-effects/water-effect.cpp
dali-toolkit/devel-api/shader-effects/water-effect.h
dali-toolkit/internal/controls/bubble-effect/bubble-actor.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/check-box-button-impl.h
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
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/public-api/controls/control-impl.cpp
dali-toolkit/public-api/file.list
dali-toolkit/public-api/shader-effects/bubble-effect/bubble-effect.h
docs/content/programming-guide/shader-intro.h

Change-Id: I677eaa3e6a0558c360fc6b379a73fac18d0eb008

45 files changed:
1  2 
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/utc-Dali-BubbleEmitter.cpp
build/tizen/dali-toolkit/Makefile.am
dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.cpp
dali-toolkit/devel-api/controls/bubble-effect/bubble-emitter.h
dali-toolkit/devel-api/file.list
dali-toolkit/devel-api/shader-effects/alpha-discard-effect.h
dali-toolkit/devel-api/shader-effects/bendy-effect.h
dali-toolkit/devel-api/shader-effects/blind-effect.h
dali-toolkit/devel-api/shader-effects/bouncing-effect.h
dali-toolkit/devel-api/shader-effects/carousel-effect.h
dali-toolkit/devel-api/shader-effects/displacement-effect.h
dali-toolkit/devel-api/shader-effects/dissolve-effect.h
dali-toolkit/devel-api/shader-effects/dissolve-local-effect.h
dali-toolkit/devel-api/shader-effects/distance-field-effect.h
dali-toolkit/devel-api/shader-effects/image-region-effect.h
dali-toolkit/devel-api/shader-effects/iris-effect.h
dali-toolkit/devel-api/shader-effects/mask-effect.h
dali-toolkit/devel-api/shader-effects/mirror-effect.h
dali-toolkit/devel-api/shader-effects/motion-blur-effect.h
dali-toolkit/devel-api/shader-effects/motion-stretch-effect.h
dali-toolkit/devel-api/shader-effects/nine-patch-mask-effect.h
dali-toolkit/devel-api/shader-effects/overlay-effect.h
dali-toolkit/devel-api/shader-effects/quadratic-bezier.h
dali-toolkit/devel-api/shader-effects/ripple-effect.h
dali-toolkit/devel-api/shader-effects/ripple2d-effect.h
dali-toolkit/devel-api/shader-effects/shear-effect.h
dali-toolkit/devel-api/shader-effects/soft-button-effect.h
dali-toolkit/devel-api/shader-effects/spot-effect.h
dali-toolkit/devel-api/shader-effects/square-dissolve-effect.h
dali-toolkit/devel-api/shader-effects/swirl-effect.h
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h
dali-toolkit/internal/controls/buttons/check-box-button-impl.cpp
dali-toolkit/internal/controls/buttons/check-box-button-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/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/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/file.list
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/public-api/controls/control-impl.cpp

@@@ -8,39 -8,57 +8,40 @@@ SET(CAPI_LIB "dali-toolkit"
  # List of test case sources (Only these get parsed for test cases)
  SET(TC_SOURCES
     utc-Dali-Alignment.cpp
 -   utc-Dali-BendyEffect.cpp
 -   utc-Dali-BlindEffect.cpp
     utc-Dali-BloomView.cpp
     utc-Dali-BubbleEmitter.cpp
     utc-Dali-Builder.cpp
 -   utc-Dali-CarouselEffect.cpp
     utc-Dali-CheckBoxButton.cpp
     utc-Dali-CubeTransitionEffect.cpp
 -   utc-Dali-DisplacementEffect.cpp
 -   utc-Dali-DistanceFieldEffect.cpp
     utc-Dali-GaussianBlurView.cpp
     utc-Dali-JsonParser.cpp
     utc-Dali-KeyInputFocusManager.cpp
 -   utc-Dali-OverlayEffect.cpp
 -   utc-Dali-PageTurnEffect.cpp
     utc-Dali-PageTurnView.cpp
     utc-Dali-ScrollBar.cpp
     utc-Dali-ScrollView.cpp
 +   utc-Dali-ShaderEffects.cpp
     utc-Dali-ShadowView.cpp
 -   utc-Dali-ShearEffect.cpp
     utc-Dali-Slider.cpp
 -   utc-Dali-SoftButtonEffect.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
     utc-Dali-Control.cpp
     utc-Dali-ControlImpl.cpp
     utc-Dali-DefaultControls.cpp
-    utc-Dali-FocusManager.cpp
 -   utc-Dali-DissolveEffect.cpp
+    utc-Dali-AccessibilityFocusManager.cpp
 -   utc-Dali-IrisEffect.cpp
     utc-Dali-ItemLayout.cpp
     utc-Dali-ItemView.cpp
     utc-Dali-KeyboardFocusManager.cpp
 -   utc-Dali-MaskEffect.cpp
     utc-Dali-NinePatchMaskEffect.cpp
     utc-Dali-Popup.cpp
     utc-Dali-PushButton.cpp
     utc-Dali-RadioButton.cpp
 -   utc-Dali-Ripple2DEffect.cpp
 -   utc-Dali-RippleEffect.cpp
     utc-Dali-ScrollViewEffect.cpp
     utc-Dali-StyleManager.cpp
     utc-Dali-SuperBlurView.cpp
 -   utc-Dali-SwirlEffect.cpp
  )
  
  # Append list of test harness files (Won't get parsed for test cases)
@@@ -80,6 -98,7 +81,7 @@@ FOREACH(directory ${${CAPI_LIB}_LIBRARY
  ENDFOREACH(directory ${CAPI_LIB_LIBRARY_DIRS})
  
  INCLUDE_DIRECTORIES(
+     ../../../
      ${${CAPI_LIB}_INCLUDE_DIRS}
      dali-toolkit-test-utils
  )
@@@ -24,6 -24,9 +24,7 @@@
  
  #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;
@@@ -138,40 -141,13 +139,40 @@@ int UtcDaliBubbleEmitterNew(void
    END_TEST;
  }
  
 +int UtcDaliBubbleEmitterDownCast01(void)
 +{
 +  ToolkitTestApplication application;
 +
 +  tet_infoline(" UtcDaliBubbleEmitterDownCast01 ");
 +
 +  Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 +  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));
 +
 +  BaseHandle handle(emitter);
 +  BubbleEmitter emitter2 = BubbleEmitter::DownCast(handle);
 +  DALI_TEST_EQUALS( (bool)emitter2, true, TEST_LOCATION );
 +  END_TEST;
 +}
 +
 +int UtcDaliBubbleEmitterDownCast02(void)
 +{
 +  ToolkitTestApplication application;
 +
 +  tet_infoline(" UtcDaliBubbleEmitterDownCast02 ");
 +
 +  Handle handle = Handle::New(); // Create a custom object
 +  BubbleEmitter emitter = BubbleEmitter::DownCast(handle);
 +  DALI_TEST_EQUALS( (bool)emitter, false, TEST_LOCATION );
 +  END_TEST;
 +}
 +
  int UtcDaliBubbleEmitterGetRootActor(void)
  {
    ToolkitTestApplication application;
    tet_infoline( " UtcDaliBubbleEmitterGetRootActor " );
  
    Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 -  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));
 +  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 270, Vector2( 5.f, 10.f ));
  
    Actor root = emitter.GetRootActor();
    DALI_TEST_CHECK( root );
@@@ -200,39 -176,56 +201,39 @@@ int UtcDaliBubbleEmitterSetBackground(v
    END_TEST;
  }
  
 -int UtcDaliBubbleEmitterSetShapeImage(void)
 +//TODO: test case for BubbleEmitter::SetShapeImage(Image)
 +// To test that the bubble-shape image is successfully switched in the sampler
 +/*int UtcDaliBubbleEmitterSetShapeImage(void)
  {
 -  ToolkitTestApplication application;
 -  tet_infoline( " UtcDaliBubbleEmitterSetShapeImage " );
 -
 -  Image shapeImage1 = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 -  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage1, 200, Vector2( 5.f, 10.f ));
 -
 -  Actor root = emitter.GetRootActor();
 -  MeshActor bubbleMesh = MeshActor::DownCast( root.GetChildAt( 0 ) );
 -  Material material = bubbleMesh.GetMaterial();
 -
 -  DALI_TEST_CHECK( material.GetDiffuseTexture() == shapeImage1 );
 -
 -  Image shapeImage2 = CreateSolidColorImage( application, Color::RED, 8, 8 );
 -  emitter.SetShapeImage( shapeImage2 );
 -
 -  DALI_TEST_CHECK( material.GetDiffuseTexture() == shapeImage2 );
 -  END_TEST;
 -}
 +}*/
  
  int UtcDaliBubbleEmitterSetBubbleScale(void)
  {
    ToolkitTestApplication application;
    tet_infoline( " UtcDaliBubbleEmitterSetBubbleScale " );
  
 -  Image shapeImage1 = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 -  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage1, 200, Vector2( 5.f, 10.f ));
 -
 +  Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 +  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 150, Vector2( 5.f, 10.f ));
    Actor root = emitter.GetRootActor();
 -  MeshActor bubbleMesh = MeshActor::DownCast( root.GetChildAt( 0 ) );
 -  ShaderEffect effect = bubbleMesh.GetShaderEffect();
 -  DALI_TEST_CHECK( effect );
 +  Stage::GetCurrent().Add( root );
 +
 +  TestGlAbstraction& gl = application.GetGlAbstraction();
 +
 +  Wait(application);
  
 -  Property::Index scalePropertyIndex = effect.GetPropertyIndex( "uDynamicScale" );
    float scaleValue;
 -  (effect.GetProperty(scalePropertyIndex)).Get( scaleValue );
 -  DALI_TEST_EQUALS(scaleValue, 1.f, TEST_LOCATION );
 +  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uDynamicScale", scaleValue ) );
 +  DALI_TEST_EQUALS( scaleValue, 1.f, TEST_LOCATION );
  
    emitter.SetBubbleScale( 2.f );
 -  application.SendNotification();
 -  application.Render();
 -  (effect.GetProperty(scalePropertyIndex)).Get( scaleValue );
 -  DALI_TEST_EQUALS(scaleValue, 2.f, TEST_LOCATION );
 +  Wait(application);
 +  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uDynamicScale", scaleValue ) );
 +  DALI_TEST_EQUALS( scaleValue, 2.f, TEST_LOCATION );
  
    emitter.SetBubbleScale( 0.5f );
 -  application.SendNotification();
 -  application.Render();
 -  (effect.GetProperty(scalePropertyIndex)).Get( scaleValue );
 -  DALI_TEST_EQUALS(scaleValue, 0.5f, TEST_LOCATION );
 +  Wait(application);
 +  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uDynamicScale", scaleValue ) );
 +  DALI_TEST_EQUALS( scaleValue, 0.5f, TEST_LOCATION );
    END_TEST;
  }
  
@@@ -241,8 -234,8 +242,8 @@@ int UtcDaliBubbleEmitterSetBubbleDensit
    ToolkitTestApplication application;
    tet_infoline( " UtcDaliBubbleEmitterSetBubbleDensity " );
  
 -  Image shapeImage1 = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 -  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage1, 200, Vector2( 5.f, 10.f ));
 +  Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 +  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));
  
    try
    {
@@@ -262,8 -255,8 +263,8 @@@ int UtcDaliBubbleEmitterSetBubbleDensit
    ToolkitTestApplication application;
    tet_infoline( " UtcDaliBubbleEmitterSetBubbleDensity " );
  
 -  Image shapeImage1 = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 -  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage1, 200, Vector2( 5.f, 10.f ));
 +  Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 +  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 200, Vector2( 5.f, 10.f ));
  
    try
    {
@@@ -282,32 -275,27 +283,32 @@@ int UtcDaliBubbleEmitterSetBlendMode(vo
    ToolkitTestApplication application;
    tet_infoline( " UtcDaliBubbleEmitterSetBlendMode " );
  
 -  Image shapeImage1 = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 -  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage1, 200, Vector2( 5.f, 10.f ));
 -
 +  Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 +  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 150, Vector2( 5.f, 10.f ));
    Actor root = emitter.GetRootActor();
 -  MeshActor bubbleMesh = MeshActor::DownCast( root.GetChildAt( 0 ) );
 +  Stage::GetCurrent().Add( root );
  
 -  BlendingFactor::Type srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha;
 +  TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
 +  Wait(application);
 +  DALI_TEST_EQUALS( (GLenum)GL_SRC_ALPHA, glAbstraction.GetLastBlendFuncSrcRgb(), TEST_LOCATION );
 +  DALI_TEST_EQUALS( (GLenum)GL_ONE_MINUS_SRC_ALPHA, glAbstraction.GetLastBlendFuncDstRgb(), TEST_LOCATION );
 +  DALI_TEST_EQUALS( (GLenum)GL_ONE, glAbstraction.GetLastBlendFuncSrcAlpha(), TEST_LOCATION );
 +  DALI_TEST_EQUALS( (GLenum)GL_ONE_MINUS_SRC_ALPHA, glAbstraction.GetLastBlendFuncDstAlpha(), TEST_LOCATION );
  
    emitter.SetBlendMode( true );
 -  bubbleMesh.GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
 -  DALI_TEST_CHECK( srcFactorRgb == BlendingFactor::SRC_ALPHA );
 -  DALI_TEST_CHECK( destFactorRgb == BlendingFactor::ONE );
 -  DALI_TEST_CHECK( srcFactorAlpha == BlendingFactor::ZERO );
 -  DALI_TEST_CHECK( destFactorAlpha == BlendingFactor::ONE );
 +  Wait(application);
 +  DALI_TEST_EQUALS( (GLenum)GL_SRC_ALPHA, glAbstraction.GetLastBlendFuncSrcRgb(), TEST_LOCATION );
 +  DALI_TEST_EQUALS( (GLenum)GL_ONE, glAbstraction.GetLastBlendFuncDstRgb(), TEST_LOCATION );
 +  DALI_TEST_EQUALS( (GLenum)GL_ZERO, glAbstraction.GetLastBlendFuncSrcAlpha(), TEST_LOCATION );
 +  DALI_TEST_EQUALS( (GLenum)GL_ONE, glAbstraction.GetLastBlendFuncDstAlpha(), TEST_LOCATION );
  
    emitter.SetBlendMode( false );
 -  bubbleMesh.GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
 -  DALI_TEST_CHECK( srcFactorRgb == BlendingFactor::SRC_ALPHA );
 -  DALI_TEST_CHECK( destFactorRgb == BlendingFactor::ONE_MINUS_SRC_ALPHA );
 -  DALI_TEST_CHECK( srcFactorAlpha == BlendingFactor::ONE );
 -  DALI_TEST_CHECK( destFactorAlpha == BlendingFactor::ONE_MINUS_SRC_ALPHA );
 +  Wait(application);
 +  DALI_TEST_EQUALS( (GLenum)GL_SRC_ALPHA, glAbstraction.GetLastBlendFuncSrcRgb(), TEST_LOCATION );
 +  DALI_TEST_EQUALS( (GLenum)GL_ONE_MINUS_SRC_ALPHA, glAbstraction.GetLastBlendFuncDstRgb(), TEST_LOCATION );
 +  DALI_TEST_EQUALS( (GLenum)GL_ONE, glAbstraction.GetLastBlendFuncSrcAlpha(), TEST_LOCATION );
 +  DALI_TEST_EQUALS( (GLenum)GL_ONE_MINUS_SRC_ALPHA, glAbstraction.GetLastBlendFuncDstAlpha(), TEST_LOCATION );
 +
    END_TEST;
  }
  
@@@ -320,90 -308,103 +321,90 @@@ int UtcDaliBubbleEmitterEmitBubble(void
    BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage1, 200, Vector2( 5.f, 10.f ));
  
    Actor root = emitter.GetRootActor();
 -  MeshActor bubbleMesh = MeshActor::DownCast( root.GetChildAt( 0 ) );
 -  ShaderEffect effect = bubbleMesh.GetShaderEffect();
 -  DALI_TEST_CHECK( effect );
 +  Actor bubbleMesh = root.GetChildAt( 0 );
 +  Stage::GetCurrent().Add( root );
 +  DALI_TEST_CHECK( bubbleMesh );
  
 -  Property::Index propertyIndex0 = effect.GetPropertyIndex( "uPercentage[0]" );
 -  Property::Index propertyIndex1 = effect.GetPropertyIndex( "uPercentage[1]" );
 +  Property::Index propertyIndex0 = bubbleMesh.GetPropertyIndex( "percentage-0" );
 +  Property::Index propertyIndex1 = bubbleMesh.GetPropertyIndex( "percentage-1" );
    float value0, value1;
  
    Animation animation = Animation::New( 0.5f );
    emitter.EmitBubble( animation, Vector2(40.f,40.f), Vector2(-5.f,-5.f), Vector2(30.f,30.f) );
    emitter.EmitBubble( animation, Vector2(10.f,10.f), Vector2(5.f,5.f), Vector2(30.f,30.f) );
 -  (effect.GetProperty(propertyIndex0)).Get( value0 );
 -  (effect.GetProperty(propertyIndex1)).Get( value1 );
 +  (bubbleMesh.GetProperty(propertyIndex0)).Get( value0 );
 +  (bubbleMesh.GetProperty(propertyIndex1)).Get( value1 );
    DALI_TEST_EQUALS(value0, 0.f, TEST_LOCATION );
    DALI_TEST_EQUALS(value1, 0.f, TEST_LOCATION );
  
    animation.Play();
  
    Wait(application, 300);
 -  (effect.GetProperty(propertyIndex0)).Get( value0 );
 -  (effect.GetProperty(propertyIndex1)).Get( value1 );
 +  propertyIndex0 = bubbleMesh.GetPropertyIndex( "percentage-0" );
 +  propertyIndex1 = bubbleMesh.GetPropertyIndex( "percentage-1" );
 +  (bubbleMesh.GetProperty(propertyIndex0)).Get( value0 );
 +  (bubbleMesh.GetProperty(propertyIndex1)).Get( value1 );
    DALI_TEST_CHECK( value0 >= 0.6f );
    DALI_TEST_CHECK( value1 >= 0.6f );
  
 -  Wait(application, 600);
 -  (effect.GetProperty(propertyIndex0)).Get( value0 );
 -  (effect.GetProperty(propertyIndex1)).Get( value1 );
 +  Wait(application,500);
 +  (bubbleMesh.GetProperty(propertyIndex0)).Get( value0 );
 +  (bubbleMesh.GetProperty(propertyIndex1)).Get( value1 );
    DALI_TEST_EQUALS(value0, 1.f, TEST_LOCATION );
    DALI_TEST_EQUALS(value1, 1.f, TEST_LOCATION );
    END_TEST;
  }
  
 -int UtcDaliBubbleEmitterStartExplosion(void)
 +int UtcDaliBubbleEmitterRestore(void)
  {
    ToolkitTestApplication application;
 -  tet_infoline( " UtcDaliBubbleEmitterStartExplosion " );
 +  tet_infoline( " UtcDaliBubbleEmitterRestore " );
  
 -  Image shapeImage1 = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 -  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage1, 200, Vector2( 5.f, 10.f ));
 +  Image shapeImage = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 +  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage, 90, Vector2( 5.f, 10.f ));
    Actor root = emitter.GetRootActor();
 -  MeshActor bubbleMesh = MeshActor::DownCast( root.GetChildAt( 0 ) );
 -  ShaderEffect effect = bubbleMesh.GetShaderEffect();
 -  DALI_TEST_CHECK( effect );
 -
 -  Property::Index propertyIndex = effect.GetPropertyIndex( "uMagnification" );
 -  float value;
 -  (effect.GetProperty(propertyIndex)).Get( value );
 -  DALI_TEST_EQUALS(value, 1.f, TEST_LOCATION );
 -
 -  emitter.StartExplosion( 0.4, 4.f );
 +  Stage::GetCurrent().Add( root );
  
 -  Wait(application, 200); // 0.2s
 -  (effect.GetProperty(propertyIndex)).Get( value );
 -  DALI_TEST_CHECK( value >= 2.f );
 +  Actor bubbleMesh = root.GetChildAt( 0 );
 +  Renderer renderer = bubbleMesh.GetRendererAt( 0 );
 +  DALI_TEST_CHECK( renderer );
  
 -  Wait(application, 100); // 0.3s
 -  (effect.GetProperty(propertyIndex)).Get( value );
 -  DALI_TEST_CHECK( value >= 3.f );
 +  TestGlAbstraction& gl = application.GetGlAbstraction();
  
 -  Wait(application, 100); // 0.4s
 -  (effect.GetProperty(propertyIndex)).Get( value );
 -  DALI_TEST_EQUALS(value, 1.f, TEST_LOCATION );
 -  END_TEST;
 -}
 +  float percentageValue;
 +  Vector4 startEndPosValue;
  
 -int UtcDaliBubbleEmitterRestore(void)
 -{
 -  ToolkitTestApplication application;
 -  tet_infoline( " UtcDaliBubbleEmitterRestore " );
 +  Animation animation = Animation::New( 0.5f );
 +  emitter.EmitBubble( animation, Vector2(40.f,40.f), Vector2(-5.f,-5.f), Vector2(30.f,30.f) );
  
 -  Image shapeImage1 = CreateSolidColorImage( application, Color::GREEN, 5, 5 );
 -  BubbleEmitter emitter = BubbleEmitter::New( Vector2(50.f,50.f),shapeImage1, 200, Vector2( 5.f, 10.f ));
 -  Actor root = emitter.GetRootActor();
 -  MeshActor bubbleMesh = MeshActor::DownCast( root.GetChildAt( 0 ) );
 -  ShaderEffect effect = bubbleMesh.GetShaderEffect();
 -  DALI_TEST_CHECK( effect );
 +  Wait(application);
  
 -  Property::Index percentagePropertyIndex = effect.GetPropertyIndex( "uPercentage[0]" );
 -  float percentage;
 +  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
 +  DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION );
  
 -  Animation animation = Animation::New( 0.5f );
 -  emitter.EmitBubble( animation, Vector2(40.f,40.f), Vector2(-5.f,-5.f), Vector2(30.f,30.f) );
 -  (effect.GetProperty(percentagePropertyIndex)).Get( percentage );
 -  DALI_TEST_EQUALS(percentage, 0.f, TEST_LOCATION );
 +  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartAndEndPos[0]", startEndPosValue ) );
 +  DALI_TEST_EQUALS( startEndPosValue.x, 40.f, TEST_LOCATION );
 +  DALI_TEST_EQUALS( startEndPosValue.y, 40.f, TEST_LOCATION );
  
    animation.Play();
    Wait(application, 200);
    animation.Clear();
  
 -  (effect.GetProperty(percentagePropertyIndex)).Get( percentage );
 -  DALI_TEST_CHECK( percentage < 0.5f && percentage >= 0.4);
 +  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
 +  DALI_TEST_CHECK( percentageValue < 0.5f && percentageValue >= 0.4);
 +
 +  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartAndEndPos[0]", startEndPosValue ) );
 +  DALI_TEST_EQUALS( startEndPosValue.x, 40.f, TEST_LOCATION );
 +  DALI_TEST_EQUALS( startEndPosValue.y, 40.f, TEST_LOCATION );
  
    emitter.Restore();
    application.SendNotification();
    application.Render();
  
 -  (effect.GetProperty(percentagePropertyIndex)).Get( percentage );
 -  DALI_TEST_EQUALS(percentage, 1.f, TEST_LOCATION );
 +  DALI_TEST_CHECK( gl.GetUniformValue<float>( "uPercentage[0]", percentageValue ) );
 +  DALI_TEST_EQUALS( percentageValue, 0.f, TEST_LOCATION );
 +
 +  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uStartAndEndPos[0]", startEndPosValue ) );
 +  DALI_TEST_EQUALS( startEndPosValue,  Vector4::ZERO, TEST_LOCATION );
    END_TEST;
  }
@@@ -20,6 -20,7 +20,7 @@@ toolkit_images_dir = ../../../dali-tool
  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 +33,7 @@@ include ../../../dali-toolkit/sounds/fi
  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 +47,8 @@@ lib_LTLIBRARIES = libdali-toolkit.l
  
  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,78 -81,75 +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
+ develapifocusmanagerdir =       $(develapidir)/focus-manager
+ 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)
+ develapifocusmanager_HEADERS =      $(devel_api_focus_manager_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)
- 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)
  
@@@ -16,7 -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>
@@@ -109,6 -109,11 +109,6 @@@ void BubbleEmitter::EmitBubble( Animati
    GetImpl(*this).EmitBubble( animation, emitPosition, direction, displacement );
  }
  
 -void BubbleEmitter::StartExplosion( float duration, float multiple )
 -{
 -  GetImpl(*this).StartExplosion( duration, multiple );
 -}
 -
  void BubbleEmitter::Restore()
  {
    GetImpl(*this).Restore();
@@@ -131,9 -131,9 +131,9 @@@ public
    /**
     * @brief Set the density of the bubble.
     *
 -   * Ideally every bubble's moving track is controlled by different uniforms in BubbleEffect shaders.
 +   * Ideally every bubble's moving track is controlled by different uniforms in shader.
     * To increase the density, 'density' number of bubbles are sharing one group of uniforms, but with random offsets between these bubbles.
 -   * The available density is one to nine. The default density is five.
 +   * The available densities are one to nine only. The default value is five.
     * By set the density bigger than one, instead of emit one bubble each time, a 'density' number of bubbles are emitted.
     * @param[in] density The density of the bubble.
     */
    void EmitBubble( Animation& animation, const Vector2& emitPosition, const Vector2& direction, const Vector2& displacement );
  
    /**
 -   * @brief Start an animation to enlarge every activated bubble's size and moving speed.
 -   *
 -   * @param[in] duration The duration of the animation
 -   * @param[in] multiple The bubble size and moving speed will be increased gradually to multiple speed during the animation.
 -   */
 -  void StartExplosion( float duration, float multiple );
 -
 -  /**
     * @brief Reset all the parameters controlling the bubbles after animation.
     */
    void Restore();
index 0000000,ae50ba3..f10a341
mode 000000,100755..100755
--- /dev/null
@@@ -1,0 -1,151 +1,114 @@@
 -  $(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 \
+ # 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)/focus-manager/keyinput-focus-manager.cpp \
+   $(devel_api_src_dir)/styling/style-manager.cpp \
+   $(devel_api_src_dir)/scripting/script.cpp \
 -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_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_src_dir)/shader-effects/page-turn-book-spine-effect.h \
 -  $(devel_api_src_dir)/shader-effects/page-turn-effect.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_focus_manager_header_files = \
+   $(devel_api_src_dir)/focus-manager/keyinput-focus-manager.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/swirl-effect.h \
 -  $(devel_api_src_dir)/shader-effects/water-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_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
@@@ -28,35 -28,41 +28,35 @@@ namespace Toolki
  {
  
  /**
 + * @brief Creates a new Alpha discard effect
 + *
   * Alpha discard effect is used to discard fragments when the alpha colour value is below a threshold.
   * This is useful for stenciling.
   *
   * Usage example:
   *
   *   ImageActor actor = ImageActor::New( Image( EXAMPLE_IMAGE_PATH ) );
 - *   AlphaDiscardEffect alphaDiscardEffect = AlphaDiscardEffect::New();
 + *   ShaderEffect alphaDiscardEffect = CreateAlphaDiscardEffect();
   *   actor.SetShaderEffect( alphaDiscardEffect );
 + *
 + * @return A handle to a newly allocated ShaderEffect.
   */
 -class DALI_IMPORT_API AlphaDiscardEffect : public ShaderEffect
 +inline ShaderEffect CreateAlphaDiscardEffect()
  {
 -public:
 -
 -  /**
 -   * Create an empty AlphaDiscardEffect handle.
 -   */
 -  AlphaDiscardEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~AlphaDiscardEffect();
 -
 -  /**
 -   * Create a AlphaDiscardEffect.
 -   * @return A handle to a newly allocated AlphaDiscardEffect.
 -   */
 -  static AlphaDiscardEffect New();
 -
 -private: // Not intended for application developers
 +  const char* ALPHA_DISCARD_FRAGMENT_SHADER_SOURCE =
 +      "void main()                                                    \n"
 +      "{                                                              \n"
 +      "  mediump vec4 color = texture2D( sTexture, vTexCoord );       \n"
 +      "  if(color.a <= 0.0001)                                        \n"
 +      "  {                                                            \n"
 +      "    discard;                                                   \n"
 +      "  }                                                            \n"
 +      "  gl_FragColor = color * uColor;                               \n"
 +      "}                                                              \n";
  
 -  DALI_INTERNAL AlphaDiscardEffect( ShaderEffect handle );
 -};
 +  return ShaderEffect::New( "", // Use default
 +                            ALPHA_DISCARD_FRAGMENT_SHADER_SOURCE );
 +}
  
  } // namespace Toolkit
  
@@@ -28,73 -28,73 +28,73 @@@ namespace Toolki
  {
  
  /**
 + * Creates a new Bendy effect
 + *
   * BendyEffect is a custom shader effect to achieve bendy effects in Image actors
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uCenter"    - The center point of the bendy effect
 + *  "uDirection" - The direction of the bendy effect
 + *  "uRadius"    - The radius of the bendy effect
 + *
 + * @return A handle to a newly allocated ShaderEffect.
   */
 -class DALI_IMPORT_API BendyEffect : public ShaderEffect
 +inline ShaderEffect CreateBendyEffect()
  {
 -public:
 -
 -  /**
 -   * Create an uninitialized BendyEffect; this can be initialized with BendyEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  BendyEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~BendyEffect();
 -
 -  /**
 -   * Create an initialized BendyEffect.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static BendyEffect New();
 -
 -  /**
 -   * Set the center point of the bendy effect.
 -   * @param [in] center The new center point.
 -   */
 -  void SetCenter(const Vector2& center);
 -
 -  /**
 -   * Set the direction of the bendy effect.
 -   * @param [in] direction The new direction.
 -   */
 -  void SetDirection(const Vector2& direction);
 -
 -  /**
 -   * Set the radius of the bendy effect.
 -   * @param [in] radius The new radius.
 -   */
 -  void SetRadius(float radius);
 -
 -  /**
 -   * Get the name for the center property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetCenterPropertyName() const;
 -
 -  /**
 -   * Get the name for the direction property
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetDirectionPropertyName() const;
 -
 -  /**
 -   * Get the name for the radius property
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetRadiusPropertyName() const;
 -
 -
 -private: // Not intended for application developers
 -  DALI_INTERNAL BendyEffect(ShaderEffect handle);
 -};
 +  // append the default version
 +  std::string vertextShader(
 +      "uniform mediump   vec2  uCenter;\n"
 +      "uniform mediump   vec2  uDirection;\n"
 +      "uniform mediump   float uRadius;\n"
 +      "\n"
 +      "varying mediump   float vShade;\n"
 +      "\n"
 +      "void main()\n"
 +      "{\n"
 +      " mediump float lighting = 0.25;\n"
 +      " mediump vec4 position = uModelView * vec4(aPosition,1.0);\n"
 +      "\n"
 +      " mediump vec2 d = position.xy - uCenter;\n"
 +      " mediump float dist = max( 0.0, dot(d,uDirection) );\n"
 +      " mediump float radius = max(0.0, uRadius - dist * 0.01);\n"
 +      "\n"
 +      " mediump float cs = cos(dist / radius / 2.0);\n"
 +      " mediump float sn = sin(dist / radius / 2.0);\n"
 +      "\n"
 +      "position.xy = position.xy - uDirection * dist;\n"
 +      "\n"
 +      "position.xy += uDirection * sn * radius;\n"
 +      "position.z += (1.0 - cs) * radius;\n"
 +      "\n"
 +      "gl_Position = uProjection * position;\n"
 +      "\n"
 +      "vShade = 1.0 - abs(sn) * lighting;\n"
 +      "\n"
 +      "vTexCoord = aTexCoord;\n"
 +      "}" );
 +
 +  std::string fragmentShader(
 +      "varying mediump float  vShade;\n"
 +      "\n"
 +      "void main()\n"
 +      "{\n"
 +      "  gl_FragColor = texture2D(sTexture, vTexCoord) * uColor * vec4(vShade,vShade,vShade,1.0);\n"
 +      "}" );
 +
 +  // Create the implementation, temporarily owned on stack,
 +  Dali::ShaderEffect shaderEffect =  Dali::ShaderEffect::New(
 +      vertextShader,
 +      fragmentShader,
 +      GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_GRID | ShaderEffect::HINT_DEPTH_BUFFER ));
 +
 +  shaderEffect.SetUniform( "uCenter", Vector2(0.0f, 0.0f), ShaderEffect::COORDINATE_TYPE_VIEWPORT_POSITION );
 +  shaderEffect.SetUniform( "uDirection", Vector2(0.0f, 0.0f), ShaderEffect::COORDINATE_TYPE_VIEWPORT_DIRECTION );
 +  shaderEffect.SetUniform( "uRadius", 0.0f );
 +
 +
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,48 -28,48 +28,48 @@@ namespace Toolki
  {
  
  /**
 - * BlindEffect is a custom shader effect to achieve blind effects in Image actors
 + * @brief BlindEffect is a custom shader effect to achieve blind effects in Image actors
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uStep" - The step of the blind effect.
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API BlindEffect : public ShaderEffect
 -{
 -public:
 -
 -  /**
 -   * Create an uninitialized BlindEffect; this can be initialized with BlindEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  BlindEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~BlindEffect();
 -
 -  /**
 -   * Create an initialized ~BlindEffect.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static BlindEffect New();
  
 +inline ShaderEffect CreateBlindEffect()
 +{
 +  std::string fragmentShader(
 +      "uniform mediump float uStep;                                                        \n"
 +      "void main()                                                                         \n"
 +      "{                                                                                   \n"
 +      "    mediump vec4 alphaColor;                                                        \n"
 +      "    mediump vec4 baseColor;                                                         \n"
 +      "    baseColor = texture2D( sTexture, vTexCoord);                                    \n"
 +      "    alphaColor = vec4(0.1,0.1,0.1,1.0);                                             \n"
 +      "    lowp float index = 0.0;                                                         \n"
 +      "    index = floor(vTexCoord.y/0.1);                                                 \n"
 +      "    if((vTexCoord.y < (index * 0.1 + uStep * 0.005)) && (vTexCoord.y > index * 0.1))\n"
 +      "    {                                                                               \n"
 +      "      gl_FragColor = alphaColor;                                                    \n"
 +      "    }                                                                               \n"
 +      "    else                                                                            \n"
 +      "    {                                                                               \n"
 +      "      gl_FragColor = baseColor;                                                     \n"
 +      "    }                                                                               \n"
 +      "    gl_FragColor*=uColor;                                                           \n"
 +      "}                                                                                   \n"
 +  );
  
 -  /**
 -   * Set the step of the blind effect.
 -   * @param [in] step The step
 -   */
 -  void SetStep(float step);
 +  Dali::ShaderEffect shaderEffect =  Dali::ShaderEffect::New(
 +      "",
 +      fragmentShader,
 +      GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING | ShaderEffect::HINT_GRID ));
  
 -  /**
 -   * Get the name for the step property
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetStepPropertyName() const;
 +  shaderEffect.SetUniform( "uStep", 0.0f );
  
 -private: // Not intended for application developers
 -  DALI_INTERNAL BlindEffect(ShaderEffect handle);
 -};
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,80 -28,69 +28,80 @@@ namespace Toolki
  {
  
  /**
 - * @brief BouncingEffect is a custom overscroll effect with two waves appearing at two sides then moving towards center and overlapping.
 + * @brief Creates a new bouncing effect
 + *
 + * BouncingEffect is a custom overscroll effect with two waves appearing at two sides then moving towards center and overlapping.
   *
   * Usage Example:
   *
   *  // Create the an imageActor, set shader effect, and add it to the stage
   *  ImageActor imageActor = ImageActor::New( BufferImage::New( 1, 1 ) );
   *  imageActor.SetSize(720.f,58.f);
 - *  Toolkit::BouncingEffect bouncingEffect = Toolkit::BouncingEffect::New( Vector4(0.f,1.f,1.f,0.5f) );
 + *  Toolkit::ShaderEffect bouncingEffect = CreateBouncingEffect( Vector4(0.f,1.f,1.f,0.5f) );
   *  imageActor.SetShaderEffect( bouncingEffect );
   *  imageActor.SetParentOrigin( ParentOrigin::CENTER );
   *  Stage::GetCurrent().Add( imageActor );
   *
   *   // Start the animation
   *   Animation animation = Animation::New(1.f);
 - *   animation.AnimateTo( Property( bouncingEffect, bouncingEffect.GetProgressRatePropertyName() ),
 + *   animation.AnimateTo( Property( bouncingEffect,"uProgressRate" ),
   *                        1.f, AlphaFunction::BOUNCE );
   *   animation.Play();
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uProgressRate" - The progress rate to the effect
 + *
 + * @param[in] color The color used on the bouncing stripe
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API BouncingEffect : public ShaderEffect
 -{
 -public:
 -
 -  /**
 -   * @brief Creates an empty BouncingEffect handle
 -   */
 -  BouncingEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~BouncingEffect();
  
 -  /**
 -   * @brief Create a BouncingEffect object
 -   *
 -   * @param[in] color The color used on the bouncing stripe
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static BouncingEffect New( const Vector4& color );
 -
 -  /**
 -   * @brief Set the progress rate to the effect.
 -   *
 -   * The whole progress ( with progress rate from 0.0 to 1.0 ):
 -   *      two waves appear at two sides; move towards center and overlap.
 -   * @param[in] progressRate The progress rate value.
 -   */
 -  void SetProgressRate( float progressRate );
 -
 -  /**
 -   * @brief Get the name for the progress rate property.
 -   *
 -   * @return A std::string containing the property name.
 -   */
 -  const std::string& GetProgressRatePropertyName() const;
 -
 -
 -private: // Not intended for application developers
 -  DALI_INTERNAL BouncingEffect( ShaderEffect handle );
 +inline ShaderEffect CreateBouncingEffect(const Vector4& color)
 +{
 +  std::string fragmentShader = DALI_COMPOSE_SHADER(
 +      precision mediump float;\n
 +      uniform float uProgressRate;\n
 +      uniform vec4 uAssignedColor;\n
 +      void main()\n
 +      {\n
 +        float progressRate = abs(uProgressRate)*0.5;\n
 +        float amplitude = 0.15 - progressRate*0.15 ;\n
 +        float x1 = 7.5 * (vTexCoord.x - progressRate);\n
 +        float x2 = 7.5 * (vTexCoord.x - 1.0 + progressRate);\n
 +        float height1 = max(0.00001, 0.3 - amplitude * ( exp(x1) + exp(-x1) ) );\n
 +        float height2 = max(0.00001, 0.3 - amplitude * ( exp(x2) + exp(-x2) ) );\n
 +        float height3 = max(0.00001, 1.0 - 3.0 * amplitude * ( exp(x1*0.5) + exp(-x1*0.5) ) );\n
 +        float height4 = max(0.00001, 1.0 - 3.0 * amplitude * ( exp(x2*0.5) + exp(-x2*0.5) ) );\n
 +        vec4 fragColor = vec4(0.0);\n
 +        float y = vTexCoord.y/(height1+height2);\n
 +        float y2 = vTexCoord.y/max(height3,height4);\n
 +        float coef = max(height1,height2)*5.0/( 1.0+exp(y*12.0-6.0) );\n
 +        float alpha = pow( max(0.0,(1.0-y2))*(1.0-min(abs(x1),abs(x2))/5.0), 2.0);\n
 +        if( vTexCoord.y < 0.075 )\n
 +        {\n
 +          fragColor= mix(uAssignedColor, vec4(1.0), coef);\n
 +          fragColor += (vec4(1.0)-fragColor) * alpha;\n
 +        }\n
 +        else if (y2<1.0)\n
 +        {\n
 +          fragColor =vec4(1.0,1.0,1.0, alpha + (1.0-alpha)*coef);\n
 +          fragColor.rgb -= ( vec3(1.0)-uAssignedColor.rgb )*min(clamp(y*1.2-0.3, 0.0, 0.3),clamp(0.9-y*1.2,0.0,0.3));\n
 +        }\n
 +        fragColor.a *= 10.0*min(min(vTexCoord.x, 1.0-vTexCoord.x),0.1)*min(1.0, progressRate/0.2);\n
 +        gl_FragColor =  fragColor;\n
 +      }
 +  );
 +
 +  ShaderEffect shaderEffect;
 +  shaderEffect = ShaderEffect::New( "", fragmentShader,
 +                                    GeometryType( GEOMETRY_TYPE_IMAGE),
 +                                    ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ) );
 +
 +  shaderEffect.SetUniform( "uAssignedColor", color );
 +  shaderEffect.SetUniform( "uProgressRate", 0.0f );
 +
 +  return shaderEffect;
 +}
  
 -};
  
  } // namespace Toolkit
  
@@@ -28,8 -28,6 +28,8 @@@ namespace Toolki
  {
  
  /**
 + * @brief Creates a new Carousel effect
 + *
   * CarouselEffect is a custom shader effect to achieve Carousel effects in actors
   *
   * A Carousel has a Radius property which can be +ve (appear as if viewing from the outside of
   *
   * Finally, the carousel's center position can be specified as a Screen coordinate (top-left being
   * the origin).
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uRadius"       - The radius of the Carousel effect. A positive Radius will bend toward the camera,
 + *                    while a negative Radius will bend away from the camera.
 + *  "uAnglePerUnit" - The angle deviation of Carousel in degrees per geometric unit for each axis
 +                      For example if you wish for the horizontal angle deviation to vary from +/- 10
 +                      degrees, then a Value of 20.0f / stageWidth for the X component should be specified.
 + *  "uCenter"       - The center point of the carousel (in screen coordinates) this is where the peek of the carousel should appear.
 + *                    Defaults value is top-left corner (0.0f, 0.0f).
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API CarouselEffect : public ShaderEffect
 +inline ShaderEffect CreateCarouselEffect()
  {
 -public:
 -
 -  /**
 -   * Create an uninitialized CarouselEffect; this can be initialized with CarouselEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  CarouselEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~CarouselEffect();
 -
 -  /**
 -   * Create an initialized CarouselEffect.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static CarouselEffect New();
 -
 -  /**
 -   * Set the radius of the Carousel effect.
 -   * A positive Radius will bend toward the camera,
 -   * while a negative Radius will bend away from the camera.
 -   * @param[in] radius The new radius.
 -   */
 -  void SetRadius( float radius);
 -
 -  /**
 -   * Sets the center point of the carousel (in screen coordinates)
 -   * this is where the peek of the carousel should appear.
 -   * this defaults to top-left corner (0.0f, 0.0f).
 -   *
 -   * @param[in] center The center point.
 -   */
 -  void SetCenter( const Vector2& center );
 -
 -  /**
 -   * Set the angle deviation of Carousel in degrees per
 -   * geometric unit for each axis. For example if you
 -   * wish for the horizontal angle deviation to vary from +/- 10
 -   * degrees, then a Value of 20.0f / stageWidth for the X
 -   * component should be specified.
 -   *
 -   * @param[in] angle the Angle Spread in X and Y axes.
 -   */
 -  void SetAnglePerUnit( const Vector2& angle );
 -
 -  /**
 -   * Get the name for the radius property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetRadiusPropertyName() const;
 -
 -  /**
 -   * Get the name for the center property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetCenterPropertyName() const;
 -
 -  /**
 -   * Get the name for the angle spread property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetAnglePerUnitPropertyName() const;
 -
 -
 -private: // Not intended for application developers
 -  DALI_INTERNAL CarouselEffect(ShaderEffect handle);
 -};
 +  // append the default version
 +    std::string vertexShader(
 +                "uniform float uRadius;\n"
 +                "uniform mediump vec2 uCenter;\n"
 +                "uniform mediump vec2 uAnglePerUnit;\n"
 +                "\n"
 +                "void main()\n"
 +                "{\n"
 +                "    mediump vec4 world = uModelView * vec4(aPosition,1.0);\n"
 +                "    mediump vec2 d = (world.xy - uCenter) * uAnglePerUnit;\n"
 +                "    mediump float a = length(d);\n"
 +                "    mediump float cs = cos(radians(a));\n"
 +                "    world.z -= cs * uRadius;\n"
 +                "    gl_Position = uProjection * world;\n"
 +                "    \n"
 +                "    vTexCoord = aTexCoord;\n"
 +                "}\n");
 +
 +    ShaderEffect shaderEffect = ShaderEffect::New(
 +        vertexShader,
 +        "",
 +        GeometryType( GEOMETRY_TYPE_IMAGE ),
 +        ShaderEffect::GeometryHints( ShaderEffect::HINT_GRID | ShaderEffect::HINT_DEPTH_BUFFER ));
 +
 +
 +    shaderEffect.SetUniform( "uRadius", 0.0f );
 +    shaderEffect.SetUniform( "uCenter", Vector2( 0.0f, 0.0f ) );
 +    shaderEffect.SetUniform( "uAnglePerUnit", Vector2( 0.0f, 0.0f ) );
 +
 +    return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,9 -28,8 +28,9 @@@ namespace Toolki
  {
  
  /**
 + * @brief Creates a new displacement effect
   *
 - * Class for two state displacement effect shader that works on a per object basis. By passing a height-normal map as an effect image, the user can create
 + * Two state displacement effect shader that works on a per object basis. By passing a height-normal map as an effect image, the user can create
   * various styles of buttons on an image actor. The shader requires two height-normal maps in one image, one for each state.
   *
   *    The normals and height information for the two states of the button should be strictly specified in this format:
@@@ -56,7 -55,7 +56,7 @@@
   * Usage example:-
   *
   * // Create shader used for doing soft button\n
 - * DisplacementEffect buttonEffect = DisplacementEffect::New();
 + * ShaderEffect buttonEffect = CreateDisplacementEffect();
   * buttonEffect.SetEffectImage(Image::New( FANCY_BUTTON_HEIGHT_MAP_IMAGE_PATH ););
   *
   * // set shader to the soft button\n
   *
   *
   * Animation animation = Animation::New( ... );\n
 - * animation.AnimateTo( Property(buttonEffect, buttonEffect.GetStatePropertyName()), 1.0f, AlphaFunction::BOUNCE, ... );\n
 + * animation.AnimateTo( Property(buttonEffect, "uState"), 1.0f, AlphaFunction::BOUNCE, ... );\n
   * animation.Play();\n
   *
 + * Animatable/Constrainable uniforms:
 + *   "uLightDirection"      - The light direction is used in the lighting calculation. The angle of incidence directly affects the amount of light reflected.
 + *                            Default (0.0f, 0.7070168f, 0.7071068f), i.e angled at the surface from in front and above.
 + *   "uAmbientLightColor"   - The ambient light is used in the lighting calculation. Care must be taken to not saturate the image by setting this value too high,
 + *                            or the indentation will not look correct. Default 0.15.
 + *   "uDiffuseLightColor"   - The diffuse light is used in the lighting calculation. Default is (1.0f, 1.0f, 1.0f).
 + *   "uLightMultiplier"     - The ambient and diffuse lighting is multiplied by this factor. Since a diffuse light at an angle will cause the whole image to darken,
 + *                            this property can be used to scale the image back up closer to the pixel values of the original diffuse texture. Care must be taken
 + *                            to not saturate the image,or the indentation will not look correct. Default 1.0
 + *   "uState"               - The shader can have a maximum of two end states 0 or 1, Animate between these two values to do the transitions
 + *                            between states. Default 0.0
 + *   "uHightScale"          - The height displacement is multiplied by this factor. Tweak this to get the required level of depth. Default 0.1
 + *   "uFixedNormal"         - The Fixed normal will be used for the light calculation. Tweak this to get the required level of light.
 + *                            Only applicable for the FIXED type shader and not for DISPLACED type
 + *
 + * @param type The type of the effect, can be either DISPLACED, or FIXED.
 + * @return A handle to a newly allocated ShaderEffect
 + *
   */
 -class DALI_IMPORT_API DisplacementEffect : public ShaderEffect
 -{
  
 -public:
 +typedef enum
 +{
 +  DISPLACEMENT_EFFECT_DISPLACED = 0,    /// Image gets displaced
 +  DISPLACEMENT_EFFECT_FIXED             /// Image does not displace. Useful for matching lighting between areas that do not displace and those that do, e.g for backgrounds which are visible between buttons.
 +}DisplacementEffectType;
  
 -  typedef enum
 +inline ShaderEffect CreateDisplacementEffect(DisplacementEffectType type)
 +{
 +  std::string fragmentSourceFixed;
 +  fragmentSourceFixed =  "precision mediump float;\n"
 +      "uniform vec3 uLightDirection;\n"
 +      "uniform vec3 uAmbientLightColor;\n"
 +      "uniform vec3 uDiffuseLightColor;\n"
 +      "uniform float uLightMultiplier;\n"
 +      "uniform float uState;\n"
 +      "uniform float uHightScale;\n"
 +      "uniform vec3 uFixedNormal;\n"
 +
 +      "void main()\n"
 +      "{\n"
 +      "  vec4 col = texture2D(sTexture, vTexCoord);\n"
 +      // calc lighting
 +      "  float intensity = dot(uLightDirection, uFixedNormal);"
 +      "  vec3 lighting = (intensity * uDiffuseLightColor) + uAmbientLightColor;\n"
 +      "  lighting *= uLightMultiplier;\n"
 +      // output col = image * light
 +      "  gl_FragColor = vec4(col.rgb * lighting * uColor.rgb, col.a * uColor.a);\n"
 +      "}\n";
 +
 +
 +
 +  std::string fragmentSourceDisplaced(
 +      "precision mediump float;\n"
 +      "uniform vec3 uLightDirection;\n"
 +      "uniform vec3 uAmbientLightColor;\n"
 +      "uniform vec3 uDiffuseLightColor;\n"
 +      "uniform float uLightMultiplier;\n"
 +      "uniform float uState;\n"
 +      "uniform float uHightScale;\n"
 +      "void main()\n"
 +      "{\n"
 +      "  highp vec4 displacementMap1 = texture2D(sEffect, vec2(vTexCoord.s, vTexCoord.t/2.0));\n"
 +      "  highp vec4 displacementMap2 = texture2D(sEffect, vec2(vTexCoord.s, 0.5+vTexCoord.t/2.0));\n"
 +      "  highp vec4 displacementMap = mix(displacementMap1, displacementMap2, uState);\n"
 +
 +      "  vec3 normalAdjusted = normalize(displacementMap.rgb*2.0-1.0);\n"
 +      "  float height = uHightScale * (displacementMap.a*2.0 - 1.0);\n"
 +      "  vec2 displacement = vec2(0.0);\n"
 +      "  displacement += (vec2(0.5)-vTexCoord.st)*height;\n"
 +      "  vec2 newCoord = vTexCoord.st + displacement.xy;\n"
 +
 +      "  vec4 col = texture2D(sTexture, newCoord);\n"
 +      // Y-Axis for the normal map is taken as in Y-Down format, So inverting it for GL
 +      "  float intensity = dot(uLightDirection, vec3(1.0,-1.0, 1.0) * normalAdjusted);"
 +      "  vec3 lighting = (intensity * uDiffuseLightColor) + uAmbientLightColor;\n"
 +      "  lighting *= uLightMultiplier;\n"
 +      "  vec3 color = col.rgb * lighting * uColor.rgb;\n"
 +      "  gl_FragColor = vec4(color, col.a * uColor.a);\n"
 +      "}\n");
 +
 +  //////////////////////////////////////
 +  // Create shader effect
 +  //
 +  //
 +
 +  ShaderEffect shaderEffect;
 +  switch(type)
    {
 -    DISPLACED = 0,    /// Image gets displaced
 -    FIXED             /// Image does not displace. Useful for matching lighting between areas that do not displace and those that do, e.g for backgrounds which are visible between buttons.
 -  }Type;
 -
 -  /**
 -   * Create an uninitialized DisplacementEffect; this can be initialized with DisplacementEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  DisplacementEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~DisplacementEffect();
 -
 -  /**
 -   * Create an initialized DisplacementEffect
 -   * @param type The type of the effect, can be either DISPLACED, or FIXED.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static DisplacementEffect New(Type type);
 -
 -  /**
 -   * Get the name for the light direction property (Vector3)
 -   * The light direction is used in the lighting calculation. The angle of incidence directly affects the amount of light reflected.
 -   * Default (0.0f, 0.7070168f, 0.7071068f), i.e angled at the surface from in front and above.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetLightDirectionPropertyName() const;
 -
 -  /**
 -   * Get the name for the ambient lighting color property (Vector3)
 -   * The ambient light is used in the lighting calculation. Care must be taken to not saturate the image by setting this value too high,
 -   * or the indentation will not look correct. Default 0.15.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetAmbientLightColorPropertyName() const;
 -
 -  /**
 -   * Get the name for the diffuse light color property (Vector3).
 -   * The diffuse light is used in the lighting calculation. Default is (1.0f, 1.0f, 1.0f).
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetDiffuseLightColorPropertyName() const;
 -
 -  /**
 -   * Get the name for the lighting multiplier property (float).
 -   * The ambient and diffuse lighting is multiplied by this factor. Since a diffuse light at an angle will cause the whole image to darken,
 -   * this property can be used to scale the image back up closer to the pixel values of the original diffuse texture. Care must be taken to not saturate the image,
 -   * or the indentation will not look correct. Default 1.0
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetLightingMultiplierPropertyName() const;
 -
 -  /**
 -   * Get the name for the state property (float).
 -   * The shader can have a maximum of two end states 0 or 1, Animate between these two values to do the transitions between states.
 -   * Default 0.0
 -   * @return A std::string containing the property name.
 -   */
 -  const std::string& GetStatePropertyName() const;
 -
 -  /**
 -   * Get the name for the height scale property (float).
 -   * The height displacement is multiplied by this factor. Tweak this to get the required level of depth.
 -   * Default 0.1
 -   * @return A std::string containing the property name.
 -   */
 -  const std::string& GetHeightScalePropertyName() const;
 -
 -  /**
 -   * Get the name for the fixed normal property (Vector3).
 -   * Only applicable for the FIXED type shader and not for DISPLACEMENT type.
 -   * The Fixed normal will be used for the light calculation. Tweak this to get the required level of light.
 -   * Default (0.0f, 0.0f, 1.0f)
 -   * @return A std::string containing the property name.
 -   */
 -  const std::string& GetFixedNormalPropertyName() const;
 -
 -  /**
 -   * Set the light direction property
 -   * The light direction is used in the lighting calculation. The angle of incidence directly affects the amount of light reflected.
 -   * Default (0.0f, 0.7070168f, 0.7071068f), i.e angled at the surface from in front and above.
 -   * @param [in] lightDirection The new light direction.
 -   */
 -  void SetLightDirection(Vector3 lightDirection);
 -
 -  /**
 -   * Set the ambient light color property
 -   * The ambient light is used in the lighting calculation. Care must be taken to not saturate the image by setting this value too high,
 -   * or the indentation will not look correct. Default (0.15f, 0.15f, 0.15f).
 -   * @param [in] ambientLight The new ambient light value.
 -   */
 -  void SetAmbientLightColorProperty(Vector3 ambientLight);
 -
 -  /**
 -   * Set the diffuse light color property.
 -   * The diffuse light is used in the lighting calculation. Default is (1.0f, 1.0f, 1.0f), i.e. a white light so the natural image color is shown.
 -   * @param [in] diffuseLight The new diffuse light value.
 -   */
 -  void SetDiffuseLightColorProperty(Vector3 diffuseLight);
 -
 -  /**
 -   * Get the name for the lighting multiplier property.
 -   * The ambient and diffuse lighting is multiplied by this factor. Since a diffuse light at an angle will cause the whole image to darken,
 -   * this property can be used to scale the image back up closer to the pixel values of the original diffuse texture. Care must be taken to not saturate the image,
 -   * or the indentation will not look correct. Default 1.0
 -   * @param [in] lightMultiplier The new light multiplier value.
 -   */
 -  void SetLightingMultiplierProperty(float lightMultiplier);
 -
 -  /**
 -   * Get the name for the state property.
 -   * The shader can only be in or in between two states 0 or 1, Animate between these two values to do the transitions between states.
 -   * @param [in] state The new state value.
 -   */
 -  void SetStateProperty(float state);
 -
 -  /**
 -   * Set the name for the height scale property.
 -   * The height displacement is multiplied by this factor. Tweak this to get the required level of depth. Default 0.1
 -   * @param [in] heightScale The new height scale.
 -   */
 -  void SetHeightScaleProperty(float heightScale);
 -
 -  /**
 -   * Set the name for fixed normal property, Only applicable for the FIXED type shader and not for DISPLACEMENT type.
 -   * The Fixed normal will be used for the light calculation. Tweak this to get the required level of light.
 -   * @param [in] fixedNormal The new normal for the fixed type shader effect.
 -   */
 -  void SetFixedNormalProperty(Vector3 fixedNormal);
 -
 -private:
 -  // Not intended for application developers
 -  DALI_INTERNAL DisplacementEffect(ShaderEffect handle);
 -};
 +    case DISPLACEMENT_EFFECT_DISPLACED:
 +      shaderEffect = ShaderEffect::New( "", fragmentSourceDisplaced);
 +      break;
 +
 +    case DISPLACEMENT_EFFECT_FIXED:
 +    default:
 +      shaderEffect = ShaderEffect::New( "", fragmentSourceFixed);
 +      break;
 +  }
 +
 +
 +  //////////////////////////////////////
 +  // Register uniform properties
 +  //
 +  //
 +  // factors that scale the look, defaults
 +  shaderEffect.SetUniform("uLightDirection",Vector3(0.0, 0.7070168f, 0.7071068f));
 +  shaderEffect.SetUniform("uAmbientLightColor",Vector3(0.15f, 0.15f, 0.15f));
 +  shaderEffect.SetUniform("uDiffuseLightColor",Vector3(1.0f, 1.0f, 1.0f));
 +  shaderEffect.SetUniform("uLightMultiplier",1.0f);
 +  shaderEffect.SetUniform("uState",0.0f);
 +  shaderEffect.SetUniform("uHightScale",0.1f);
 +
 +  if(type == DISPLACEMENT_EFFECT_FIXED)
 +  {
 +    shaderEffect.SetUniform("uFixedNormal",Vector3(0.0f, 0.0f, 1.0f) );
 +  }
 +
 +  return shaderEffect;
 +}
  
  }
  
@@@ -28,163 -28,64 +28,163 @@@ namespace Toolki
  {
  
  /**
 - * @brief DissolveEffect is a custom shader effect to achieve Dissolve effects in Image actors.
 + * @brief Set the dissolve central line.
 + *
 + * Use one point (position) and one direction ( displacement ) vector to define this line
 + * As we use the texture coordinate as pixel position to calculate random offset,
 + * the line should passing through rectangle {(0,0),(0,1),(1,0),(1,1)},
 + * so make the position parameter with two component values between 0.0 to 1.0
 + * @param[in] dissolveEffect The shader effect
 + * @param[in] position The point ( locates within rectangle {(0,0),(0,1),(1,0),(1,1)} ) passed through by the central line
 + * @param[in] displacement The direction of the central line
 + */
 +inline void DissolveEffectSetCentralLine( ShaderEffect& dissolveEffect, const Vector2& position, const Vector2& displacement )
 +{
 +  // the line passes through 'position' and has the direction of 'displacement'
 +    float coefA, coefB, coefC; //line equation: Ax+By+C=0;
 +    coefA = displacement.y;
 +    coefB = -displacement.x;
 +    coefC = -displacement.y*position.x + displacement.x*position.y;
 +
 +    float inversedAABB = 1.f / (coefA*coefA+coefB*coefB);
 +    float inversedSqrtAABB = sqrtf(inversedAABB);
 +    float saddleA;
 +
 +    //saddle surface(Hyperbolic paraboloid)function, used to calculate the dissolve starting time
 +    //z = y*y/a/a - x*x/b/b
 +    //with our selection of parameters(a and b), this value for any texture coordinate is between -1.0 and 1.0
 +
 +    Vector3 saddleParam; // [0]: a*a, [1]: b*b, [2] b
 +    Vector2 translation;
 +    Vector2 rotation;
 +    float toNext = -1.f;
 +    if( displacement.x > 0.f || (EqualsZero(displacement.x) && displacement.y > 0.f) )
 +    {
 +      toNext = 1.f;
 +    }
 +
 +    if( (displacement.y * displacement.x < 0.0f) )
 +    {
 +      //distance from (0,0) to the line
 +      float distanceTopLeft =  fabsf(coefC) * inversedSqrtAABB;
 +      //distance from (1, 1 ) to the line
 +      float distanceBottomRight = fabsf(coefA+coefB+coefC) * inversedSqrtAABB;
 +      saddleA = std::max( distanceTopLeft, distanceBottomRight );
 +
 +      //foot of a perpendicular: (1,0) to the line
 +      float footX1 = ( coefB*coefB - coefA*coefC) * inversedAABB;
 +      float footY1 = (-coefA*coefB - coefB*coefC) * inversedAABB;
 +      //foot of a perpendicular: (0,1) to the line
 +      float footX2 = (-coefA*coefB - coefA*coefC) * inversedAABB;
 +      float footY2 = ( coefA*coefA - coefB*coefC) * inversedAABB;
 +      saddleParam[1] = (footX1-footX2)*(footX1-footX2) + (footY1-footY2)*(footY1-footY2);
 +      translation = Vector2(-footX2,-footY2);
 +    }
 +    else
 +    {
 +      //distance from(1,0) to the line
 +      float distanceTopRight = fabsf(coefA+coefC) * inversedSqrtAABB;
 +      //distance from(0,1) to the line
 +      float distanceBottomLeft = fabsf(coefB+coefC) * inversedSqrtAABB;
 +      saddleA = std::max( distanceTopRight, distanceBottomLeft );
 +      //foot of a perpendicular: (0,0) to the line
 +      float footX3 = (-coefA*coefC) * inversedAABB;
 +      float footY3 = (-coefB*coefC) * inversedAABB;
 +      //foot of a perpendicular: (1.0,1.0) to the line
 +      float footX4 = ( coefB*coefB - coefA*coefB - coefA*coefC) * inversedAABB;
 +      float footY4 = (-coefA*coefB + coefA*coefA- coefB*coefC) * inversedAABB;
 +      saddleParam[1] = (footX3-footX4)*(footX3-footX4) + (footY3-footY4)*(footY3-footY4);
 +      translation = Vector2(-footX3, -footY3);
 +    }
 +
 +    saddleParam[2] = sqrtf(saddleParam[1]);
 +    saddleParam[0] = saddleA*saddleA;
 +    rotation = Vector2(-displacement.x, displacement.y);
 +    rotation.Normalize();
 +
 +    dissolveEffect.SetUniform( "uSaddleParam", saddleParam );
 +    dissolveEffect.SetUniform( "uTranslation", translation );
 +    dissolveEffect.SetUniform( "uRotation", rotation );
 +    dissolveEffect.SetUniform( "uToNext", toNext );
 +}
 +/**
 + * @brief Create a new Dissolve effect
 + *
 + *  DissolveEffect is a custom shader effect to achieve Dissolve effects in Image actors.
 + *
 + *  Animatable/Constrainable uniforms:
 + *    "uPercentage" - This value is proportional to the distortion applied; a value of zero means no distortion.
 + *
 + *  @param[in] useHighPrecision True if using high precision in fragment shader for fully random noise, false otherwise
 + *  @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API DissolveEffect : public ShaderEffect
 +
 +inline ShaderEffect CreateDissolveEffect(bool useHighPrecision = true)
  {
 -public:
 -
 -  /**
 -   * @brief Create an uninitialized DissolveEffect; this can be initialized with DissolveEffect::New().
 -   *
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  DissolveEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~DissolveEffect();
 -
 -  /**
 -   * @brief Create an initialized DissolveEffect.
 -   *
 -   * @param[in] useHighPrecision True if using high precision in fragment shader for fully random noise, false otherwise
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static DissolveEffect New( bool useHighPrecision = true);
 -
 -  /**
 -   * @brief Set the dissolve central line.
 -   *
 -   * Use one point (position) and one direction ( displacement ) vector to define this line
 -   * As we use the texture coordinate as pixel position to calculate random offset,
 -   * the line should passing through rectangle {(0,0),(0,1),(1,0),(1,1)},
 -   * so make the position parameter with two component values between 0.0 to 1.0
 -   * @param[in] position The point ( locates within rectangle {(0,0),(0,1),(1,0),(1,1)} ) passed through by the central line
 -   * @param[in] displacement The direction of the central line
 -   */
 -  void SetCentralLine( const Vector2& position, const Vector2& displacement );
 -
 -  /**
 -   * @brief Sets the distortion applied to the effect texture.
 -   *
 -   * This value is proportional to the distortion applied; a value of zero means no distortion.
 -   * @param [in] distortion The distortion value.
 -   */
 -  void SetDistortion( float distortion );
 -
 -  /**
 -   * @brief Get the name for the distortion property.
 -   *
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetDistortionPropertyName() const;
 -
 -private: // Not intended for application developers
 -  DALI_INTERNAL DissolveEffect(ShaderEffect handle);
 -};
 +  std::string prefixHighPrecision( "precision highp float;\n");
 +    std::string prefixMediumPrecision( "precision mediump float;\n" );
 +    std::string vertexShader(
 +      "uniform float uPercentage;\n"
 +      "uniform vec3 uSaddleParam;\n"
 +      "uniform vec2 uTranslation;\n"
 +      "uniform vec2 uRotation; \n"
 +      "uniform float uToNext;\n"
 +      "varying float vPercentage;\n"
 +      "void main()\n"
 +      "{\n"
 +        "gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);\n"
 +        "vTexCoord = aTexCoord;\n"
 +        //Calculate the distortion value given the dissolve central line
 +        "vec2 texCoor = vec2( (aTexCoord.s - sTextureRect.s ) / (sTextureRect.p - sTextureRect.s), (aTexCoord.t- sTextureRect.t)/(sTextureRect.q - sTextureRect.t) ); \n"
 +        "vec2 value = texCoor + uTranslation; \n"
 +        "mat2 rotateMatrix = mat2( uRotation.s, uRotation.t, -uRotation.t, uRotation.s ); \n"
 +        "value = rotateMatrix * value; \n"
 +        "if(uToNext == 1.0)  \n"
 +        "  value.s = uSaddleParam[2] + value.s; \n"
 +        "float delay = value.t*value.t / uSaddleParam[0] - value.s*value.s/uSaddleParam[1];\n"
 +        "vPercentage = clamp( uPercentage*2.0 - 0.5*sin(delay*1.571) - 0.5, 0.0, 1.0 ); \n"
 +      "}\n");
 +    std::string fragmentShader(
 +      "varying float vPercentage;\n"
 +      "float rand(vec2 co) \n"
 +      "{\n"
 +      "  return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); \n"
 +      "}\n"
 +      "void main()\n"
 +      "{\n"
 +        //Calculate the randomness
 +        "float offsetS = rand( vTexCoord * vPercentage ) * (sTextureRect.p - sTextureRect.s) - vTexCoord.s  + sTextureRect.s; \n"
 +        "float offsetT = rand( vec2(vTexCoord.t*vPercentage, vTexCoord.s * vPercentage) ) * (sTextureRect.q - sTextureRect.t) - vTexCoord.t + sTextureRect.t; \n"
 +        "vec2 lookupCoord = vTexCoord + vec2(offsetS, offsetT) * vPercentage; \n"
 +        "gl_FragColor = texture2D( sTexture, lookupCoord ) * uColor; \n"
 +        "gl_FragColor.a *= 1.0 - vPercentage; \n"
 +      "}" );
 +
 +    // Create the implementation, temporarily owned on stack,
 +    Dali::ShaderEffect shaderEffect;
 +    if( useHighPrecision )
 +    {
 +      shaderEffect =  Dali::ShaderEffect::New(
 +          prefixHighPrecision+vertexShader, prefixHighPrecision + fragmentShader,
 +          GeometryType( GEOMETRY_TYPE_IMAGE),
 +          ShaderEffect::GeometryHints( ShaderEffect::HINT_GRID | ShaderEffect::HINT_BLENDING ) );
 +    }
 +    else
 +    {
 +      shaderEffect =  Dali::ShaderEffect::New(
 +          prefixMediumPrecision+vertexShader, prefixMediumPrecision + fragmentShader,
 +          GeometryType( GEOMETRY_TYPE_IMAGE),
 +          ShaderEffect::GeometryHints( ShaderEffect::HINT_GRID | ShaderEffect::HINT_BLENDING ) );
 +    }
 +
 +    shaderEffect.SetUniform( "uPercentage", 0.0f );
 +    shaderEffect.SetProperty( ShaderEffect::Property::GRID_DENSITY, Dali::Property::Value(50.0f) );
 +
 +    DissolveEffectSetCentralLine( shaderEffect, Vector2(1.0f,0.5f), Vector2(-1.0f, 0.0f) );
 +
 +    return shaderEffect;
 +
 +}
  
  } // namespace Toolkit
  
@@@ -20,7 -20,6 +20,7 @@@
  
  // EXTERNAL INCLUDES
  #include <dali/public-api/shader-effects/shader-effect.h>
 +#include <sstream>
  
  namespace Dali
  {
@@@ -29,89 -28,102 +29,89 @@@ namespace Toolki
  {
  
  /**
 + * @brief Create a new DissolveLocalEffect
 + *
   * DissolveLocalEffect is a custom shader effect to achieve Dissolve effects in multiple small areas of Image actors
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uTransparency"
 + *  "uCenter"     - The center positions of each dimples
 + *  "uRadius"     - The propagation radius of each dimple
 + *  "uPercentage" - The distortion applied to the effect texture. A value of zero means no distortion
 + *
 + * @param[in] numberOfDimples The number of dimples
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API DissolveLocalEffect : public ShaderEffect
 +inline ShaderEffect CreateDissolveLocalEffect( unsigned int numberOfDimples )
  {
 -public:
 -
 -  /**
 -   * Create an uninitialized DissolveLocalEffect; this can be initialized with DissolveLocalEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  DissolveLocalEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~DissolveLocalEffect();
 -
 -  /**
 -   * Create an initialized DissolveLocalEffect.
 -   * @param[in] numberOfDimples The number of dimples
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static DissolveLocalEffect New( unsigned int numberOfDimples );
 -
 -  /**
 -   * Get the number of dimples the shader supports.
 -   * @return The number of dimples in the shader.
 -   */
 -  unsigned int GetNumberOfDimples() const;
 -
 -  /**
 -  * Set the transparency of the drifted pixels.
 -  * @param[in] transparency The transparency of the drifted pixels.
 -  */
 -  void SetTransparency( float transparency);
 -
 -  /**
 -   * Set the certer position of a dimple.
 -   * @param[in] index The index of the dimple to change.
 -   * @param[in] center The center position of the dimple.
 -   * @pre index has to be between 0 and GetNumberOfDimples() - 1
 -   */
 -  void SetCenter( unsigned int index, const Vector2& center );
 -
 -  /**
 -   * Set the propogation radius of a dimple.
 -   * @param[in] index The index of the dimple to change.
 -   * @param[in] radius The propagation radius of the dimple.
 -   * @pre index has to be between 0 and GetNumberOfDimples() - 1
 -   */
 -  void SetRadius( unsigned int index, float radius );
 -
 -  /**
 -   * Sets the distortion applied to the effect texture.
 -   * This value is proportional to the distortion applied; a value of zero means no distortion.
 -   * @param[in] index The index of the dimple to change.
 -   * @param[in] distortion The distortion value.
 -   * @pre index has to be between 0 and GetNumberOfDimples() - 1
 -   */
 -  void SetDistortion( unsigned int index, float distortion );
 -
 -  /**
 -   * Get the name of the center property of a dimple.
 -   * @param[in] index The index of the dimple.
 -   * @return A std::string containing the property name.
 -   * @pre index has to be between 0 and GetNumberOfDimples() - 1
 -   */
 -  std::string GetCenterPropertyName( unsigned int index ) const;
 -
 -  /**
 -   * Get the name of the radius property of a dimple.
 -   * @param[in] index The index of the dimple.
 -   * @return A std::string containing the property name
 -   * @pre index has to be between 0 and GetNumberOfDimples() - 1
 -   */
 -  std::string GetRadiusPropertyName( unsigned int index ) const;
 -
 -  /**
 -   * Get the name for the distortion property of a dimple
 -   * @param[in] index the index of a dimple.
 -   * @return A std::string containing the property name
 -   * @pre index has to be between 0 and GetNumberOfDimples() - 1
 -   */
 -  std::string GetDistortionPropertyName( unsigned int index ) const;
 -
 -private: // Not intended for application developers
 -
 -  DALI_INTERNAL DissolveLocalEffect( ShaderEffect handle );
 -
 -private:
 -
 -  unsigned int mNumberOfDimples;  ///< The number of dimples the shader supports
 -
 -};
 +  std::ostringstream vertexShaderStringStream;
 +  vertexShaderStringStream << "#define NUMBER_OF_DIMPLE "<< numberOfDimples << "\n";
 +  std::string vertexShader(
 +      "precision highp float;\n"
 +      "uniform vec2 uCenter[ NUMBER_OF_DIMPLE ];\n"
 +      "uniform float uRadius[ NUMBER_OF_DIMPLE ]; \n"
 +      "uniform float uPercentage[ NUMBER_OF_DIMPLE ]; \n"
 +      "varying float vPercentage;\n"
 +      "void main()\n"
 +      "{\n"
 +      "  vec4 position = uModelView * vec4( aPosition, 1.0 );\n"
 +      "  float percentage = 0.0;\n"
 +      "  for( int i=0; i<NUMBER_OF_DIMPLE; ++i )\n"
 +      "  {\n"
 +      "    float distance = distance(uCenter[i], position.xy);\n"
 +      "    percentage = max(percentage, uPercentage[i] * cos(clamp( distance/uRadius[i], 0.0, 1.0 )*1.57) );"
 +      "  }\n"
 +      "  vPercentage = clamp( percentage, 0.0, 1.0 );\n"
 +      "  gl_Position = uProjection * position;\n"
 +      "  vTexCoord = aTexCoord;\n"
 +      "}\n");
 +  vertexShaderStringStream << vertexShader;
 +
 +  std::string fragmentShader(
 +      "precision highp float;\n"
 +      "uniform float uTransparency;\n"
 +      "varying float vPercentage;\n"
 +      "float rand(vec2 co) \n"
 +      "{\n"
 +      "  return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); \n"
 +      "}\n"
 +      "void main()\n"
 +      "{\n"
 +      //Calculate the randomness
 +      "  float offsetS = rand( vTexCoord * vPercentage ); \n"
 +      "  float offsetT = rand( vec2(vTexCoord.t*vPercentage, vTexCoord.s * vPercentage) ); \n"
 +      "  vec2 lookupCoord = vTexCoord + vec2(offsetS, offsetT) * vPercentage; \n"
 +      "  gl_FragColor = texture2D( sTexture, lookupCoord ) * uColor; \n"
 +      "  gl_FragColor.a *= 1.0 - uTransparency*vPercentage; \n"
 +      "}\n");
 +
 +  ShaderEffect shaderEffect = ShaderEffect::New(
 +      vertexShaderStringStream.str(), fragmentShader,
 +      GeometryType( GEOMETRY_TYPE_IMAGE),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_GRID | ShaderEffect::HINT_BLENDING ) );
 +
 +  //Register uniform properties
 +  std::ostringstream oss;
 +  for( unsigned int i = 0; i < numberOfDimples; i++ )
 +  {
 +    oss.str("");
 +    oss<< "uCenter["<< i << "]";
 +    shaderEffect.SetUniform(oss.str(), Vector2(0.f,0.f));
 +
 +    oss.str("");
 +    oss<< "uRadius["<< i << "]";
 +    shaderEffect.SetUniform(oss.str(), 0.f);
 +
 +    oss.str("");
 +    oss<< "uPercentage["<< i << "]";
 +    shaderEffect.SetUniform( oss.str(), 0.f );
 +  }
 +
 +  shaderEffect.SetProperty( ShaderEffect::Property::GRID_DENSITY, Dali::Property::Value(5.f) );
 +  shaderEffect.SetUniform( "uTransparency", 0.5f );
 +
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,157 -28,169 +28,157 @@@ namespace Toolki
  {
  
  /**
 + * Creates a new DistanceFieldEffect
 + *
   * DistanceFieldEffect is a custom shader effect to achieve distance field on Image actors
 + *
 + * Animatable/Constrainable uniforms:
 + *
 + *  "uSmoothing"    - Soft edge smoothing. Specify the distance field value for the center of the edge.
 +
 + *  "uDoGlow"       - The glow state. If true, glow is enabled
 + *  "uGlowBoundary" - The glow boundary factor
 + *  "uGlowColor"    - The glow color multiplier
 +
 + *  "uDoShadow"     - The shadow state. If true, shadows is enabled. Cannot be used with glow/and or outline
 + *  "uShadowColor"  - The shadow color multiplier
 + *  "uShadowOffset" - The shadow offset
 +
 + *  "uDoOutline"    - The outline state. If true, outline is enabled
 + *  "uOutlineColor" - The outline color multiplier
 + *  "uOutlineParams"- Thickness of outline. The outline thickness is determined by two values.
 + *                    First value [0-1] Specifies the distance field value for the center of the outline.
 + *                    Second value [0-1] Specifies the softness/width/anti-aliasing of the outlines inner edge.
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API DistanceFieldEffect : public ShaderEffect
 +inline ShaderEffect CreateDistanceFieldEffect()
  {
 -public:
 -
 -  /**
 -   * Create an uninitialized DistanceFieldEffect; this can be initialized with DistanceFieldEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  DistanceFieldEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~DistanceFieldEffect();
 -
 -  /**
 -   * Create an initialized DistanceFieldEffect.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static DistanceFieldEffect New();
 -
 -  /**
 -   * Set the shadow state
 -   * @param[in] shadowEnable value - true, enable shadow.
 -   * @note Shadow cannot be used with glow/and or outline.
 -   */
 -  void SetShadow(bool shadowEnable);
 -
 -  /**
 -   * Set the shadow color multiplier (e.g. output RGB)
 -   * @param[in] color Shadow color value
 -   */
 -  void SetShadowColor(const Vector4& color);
 -
 -  /**
 -   * Set the shadow offset
 -   * @param[in] color shadow offset value
 -   */
 -  void SetShadowOffset(const Vector2& color);
 -
 -  /**
 -   * Set the glow state
 -   * @param[in] glowEnable value - true, enable glow.
 -   */
 -
 -  void SetGlow(bool glowEnable);
 -
 -  /**
 -   * Set the glow color multiplier (e.g. output RGB)
 -   * @param[in] color Glow color value
 -   */
 -  void SetGlowColor(const Vector4& color);
 -
 -  /**
 -   * Set the glow boundary factor
 -   * @param[in] glowBoundary glow boundary
 -   */
 -  void SetGlowBoundary(float glowBoundary);
 -
 -  /**
 -   * Set the outline state
 -   * @param[in] outlineEnable value - true, enable outline.
 -   */
 -
 -  void SetOutline(bool outlineEnable);
 -
 -  /**
 -   * Set the outline color multiplier (e.g. output RGB)
 -   * @param[in] color Outline color value
 -   */
 -  void SetOutlineColor(const Vector4& color);
 -
 -  /**
 -   * Sets the outline parameters.
 -   * @param[in] outlineParams  Thickness of outline. The outline thickness is determined by two parameters.
 -   *              params[0] (0-1) Specifies the distance field value for the center of the outline.
 -   *                      0 <= params[0] <= 1
 -   *              params[1] (0-1) Specifies the softness/width/anti-aliasing of the outlines inner edge.
 -   *                      0 <= params[0] <= 1
 -   */
 -  void SetOutlineParams(const Vector2& outlineParams);
 -
 -  /**
 -   * Set soft edge smoothing
 -   * @param[in] smoothing Specify the distance field value for the center of the edge.
 -   *                      0 <= params <= 1
 -   */
 -  void SetSmoothingEdge(float smoothing);
 -
 -  /**
 -   * Get the name for the outline-enable property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetOutlineEnablePropertyName() const;
 -
 -  /**
 -   * Get the name for the glow-enable property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetGlowEnablePropertyName() const;
 -
 -  /**
 -   * Get the name for the shadow-enable property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetShadowEnablePropertyName() const;
 -
 -  /**
 -   * Get the name for the radius property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetColorPropertyName() const;
 -
 -  /**
 -   * Get the name for the smoothing property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetSmoothingPropertyName() const;
 -
 -  /**
 -   * Get the name for the outline color property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetOutlineColorPropertyName() const;
 -
 -  /**
 -   * Get the name for the outline size property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetOutlineSizePropertyName() const;
 -
 -  /**
 -   * Get the name for the shadow color property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetShadowColorPropertyName() const;
 -
 -  /**
 -   * Get the name for the shadow offset property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetShadowOffsetPropertyName() const;
 -
 -  /**
 -   * Get the name for the glow color property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetGlowColorPropertyName() const;
 -
 -  /**
 -   * Get the name for the glow boundary property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetGlowBoundaryPropertyName() const;
 -
 -private:
 -  DALI_INTERNAL DistanceFieldEffect(ShaderEffect handle);
 -
 -};
 +  std::string fragmentShaderPrefix(
 +      "#extension GL_OES_standard_derivatives : enable\n"
 +      "\n"
 +  );
 +
 +  std::string fragmentShader(
 +      "uniform mediump float uSmoothing;\n"
 +      "uniform mediump float uGlowBoundary;\n"
 +      "uniform mediump vec2  uOutlineParams;\n"
 +      "uniform lowp    vec4  uOutlineColor;\n"
 +      "uniform lowp    vec4  uShadowColor;\n"
 +      "uniform mediump vec2  uShadowOffset;\n"
 +      "uniform lowp    vec4  uGlowColor;\n"
 +      "uniform lowp    float uDoOutline;\n"
 +      "uniform lowp    float uDoShadow;\n"
 +      "uniform lowp    float uDoGlow;\n"
 +      "\n"
 +      "void main()\n"
 +      "{\n"
 +      "  // sample distance field\n"
 +      "  mediump float distance = texture2D(sTexture, vTexCoord).a;\n"
 +      "  mediump float smoothWidth = fwidth(distance);\n"
 +      "  mediump float alphaFactor = smoothstep(uSmoothing - smoothWidth, uSmoothing + smoothWidth, distance);\n"
 +      "  lowp    vec4  color;\n"
 +      "  if (uDoShadow == 0.0)\n"
 +      "  {\n"
 +      "    mediump float alpha = uColor.a * alphaFactor;\n"
 +      "    lowp    vec4  rgb = uColor;\n"
 +      "\n"
 +      "    if (uDoOutline > 0.0)\n"
 +      "    {\n"
 +      "      mediump float outlineWidth = uOutlineParams[1] + smoothWidth;\n"
 +      "      mediump float outlineBlend = smoothstep(uOutlineParams[0] - outlineWidth, uOutlineParams[0] + outlineWidth, distance);\n"
 +      "      alpha = smoothstep(uSmoothing - smoothWidth, uSmoothing + smoothWidth, distance);\n"
 +      "      rgb = mix(uOutlineColor, uColor, outlineBlend);\n"
 +      "    }\n"
 +      "\n"
 +      "    if (uDoGlow > 0.0)\n"
 +      "    {\n"
 +      "      rgb = mix(uGlowColor, rgb, alphaFactor);\n"
 +      "      alpha = smoothstep(uGlowBoundary, uSmoothing, distance);\n"
 +      "    }\n"
 +      "\n"
 +      "    // set fragment color\n"
 +      "    color = vec4(rgb.rgb, alpha);\n"
 +      "  }\n"
 +      "\n"
 +      "  else // (uDoShadow > 0.0)\n"
 +      "  {\n"
 +      "    mediump float shadowDistance = texture2D(sTexture, vTexCoord - uShadowOffset).a;\n"
 +      "    mediump float inText = alphaFactor;\n"
 +      "    mediump float inShadow = smoothstep(uSmoothing - smoothWidth, uSmoothing + smoothWidth, shadowDistance);\n"
 +      "\n"
 +      "    // inside object, outside shadow\n"
 +      "    if (inText == 1.0)\n"
 +      "    {\n"
 +      "      color = uColor;\n"
 +      "    }\n"
 +      "    // inside object, outside shadow\n"
 +      "    else if ((inText != 0.0) && (inShadow == 0.0))\n"
 +      "    {\n"
 +      "      color = uColor;\n"
 +      "      color.a *= inText;\n"
 +      "    }\n"
 +      "    // outside object, completely inside shadow\n"
 +      "    else if ((inText == 0.0) && (inShadow == 1.0))\n"
 +      "    {\n"
 +      "      color = uShadowColor;\n"
 +      "    }\n"
 +      "    // inside object, completely inside shadow\n"
 +      "    else if ((inText != 0.0) && (inShadow == 1.0))\n"
 +      "    {\n"
 +      "      color = mix(uShadowColor, uColor, inText);\n"
 +      "      color.a = uShadowColor.a;\n"
 +      "    }\n"
 +      "    // inside object, inside shadow's border\n"
 +      "    else if ((inText != 0.0) && (inShadow != 0.0))\n"
 +      "    {\n"
 +      "      color = mix(uShadowColor, uColor, inText);\n"
 +      "      color.a *= max(inText, inShadow);\n"
 +      "    }\n"
 +      "    // inside shadow's border\n"
 +      "    else if (inShadow != 0.0)\n"
 +      "    {\n"
 +      "      color = uShadowColor;\n"
 +      "      color.a *= inShadow;\n"
 +      "    }\n"
 +      "    // outside shadow and object\n"
 +      "    else \n"
 +      "    {\n"
 +      "      color.a = 0.0;\n"
 +      "    }\n"
 +      "\n"
 +      "  }\n"
 +      "\n"
 +      "  gl_FragColor = color;\n"
 +      "\n"
 +      "}\n"
 +  );
 +
 +  // Create the implementation, temporarily owned on stack
 +  Dali::ShaderEffect shaderEffect =  Dali::ShaderEffect::NewWithPrefix(
 +      "", "",
 +      fragmentShaderPrefix, fragmentShader,
 +      GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING));
 +
 +  shaderEffect.SetUniform("uSmoothing",0.5f);
 +  shaderEffect.SetUniform("uOutlineColor",Color::BLACK);
 +  shaderEffect.SetUniform("uOutlineParams",Vector2(0.51f, 0.0f));
 +  shaderEffect.SetUniform("uGlowBoundary",0.4f);
 +  shaderEffect.SetUniform("uGlowColor",Color::GREEN);
 +  shaderEffect.SetUniform("uShadowColor",Vector4(0.0f, 0.0f, 0.0f, 0.4f));
 +
 +  // TODO: find a way to set the shadow offset in texel coordinates instead of UVs.
 +  shaderEffect.SetUniform("uShadowOffset",Vector2(0.05f, 0.05f));
 +
 +  // Default:
 +  shaderEffect.SetUniform("uDoOutline",false);
 +  shaderEffect.SetUniform("uDoGlow",false);
 +  shaderEffect.SetUniform("uDoShadow",false);
 +
 +  return shaderEffect;
 +}
 +
  
  } // namespace Toolkit
  
@@@ -28,43 -28,67 +28,43 @@@ namespace Toolki
  {
  
  /**
 - * @brief ImageRegionEffect is a custom shader effect to show only a region of an Image actor.
 + * @brief Creates a new ImageRegionEffect
 + *
 + * ImageRegionEffect is a custom shader effect to show only a region of an Image actor.
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uTopLeft"      - The top-left corner of the image region. The coordinates are in percentage,
 + *                    (0,0) being the top-left and (1,1) the bottom right of the original image
 + *  "uBottomRight"  - The bottom-right corner of the image region. The coordinates are in percentage,
 + *                    (0,0) being the top-left and (1,1) the bottom right of the original image
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API ImageRegionEffect : public ShaderEffect
 +inline ShaderEffect CreateImageRegionEffect()
  {
 -public:
 -
 -  /**
 -   * @brief Create an uninitialized ImageRegionEffect; this can be initialized with ImageRegionEffect::New().
 -   *
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  ImageRegionEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~ImageRegionEffect();
 -
 -  /**
 -   * @brief Create an initialized ImageRegionEffect.
 -   *
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static ImageRegionEffect New();
 -
 -  /**
 -   * @brief Set the top-left corner of the image region.
 -   *
 -   * The coordinates are in percentage, (0,0) being the top-left and (1,1) the bottom right of the original image.
 -   * @param [in] point The top-left corner of the region.
 -   */
 -  void SetTopLeft(const Vector2& point);
 -
 -  /**
 -   * @brief Set the bottom-right corner of the image region.
 -   *
 -   * The coordinates are in percentage, (0,0) being the top-left and (1,1) the bottom right of the original image.
 -   * @param [in] point The bottom-right corner of the region.
 -   */
 -  void SetBottomRight(const Vector2& point);
 -
 -  /**
 -   * @brief Get the name for the top-left point property.
 -   *
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetTopLeftPropertyName() const;
 -
 -  /**
 -   * @brief Get the name for the bottom-right point property which can be used in Animation APIs.
 -   *
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetBottomRightPropertyName() const;
 -
 -private: // Not intended for application developers
 -  DALI_INTERNAL ImageRegionEffect(ShaderEffect handle);
 -};
 +  std::string vertexShader(
 +      "uniform mediump vec2 uTopLeft;\n"
 +      "uniform mediump vec2 uBottomRight;\n"
 +      "void main()\n"
 +      "{\n"
 +      "  mediump vec4 position = vec4(aPosition,1.0);\n"
 +      "  gl_Position = uMvpMatrix * position;\n"
 +      // The line below is doing the same as the following commented lines:
 +      //"  vec2 imageSize = sTextureRect.zw - sTextureRect.xy;\n"
 +      //"  vec2 topLeft = sTextureRect.xy + uTopLeft * imageSize;\n"
 +      //"  vec2 bottomRight = sTextureRect.xy + uBottomRight * imageSize;\n"
 +      //"  vec2 texCoord = (aTexCoord - sTextureRect.xy) / imageSize;\n"
 +      //"  vTexCoord = topLeft + texCoord * ( bottomRight - topLeft );\n"
 +      "  vTexCoord = sTextureRect.xy + uTopLeft * ( sTextureRect.zw - sTextureRect.xy ) + ( aTexCoord - sTextureRect.xy ) * ( uBottomRight - uTopLeft );\n"
 +      "}\n"
 +  );
 +
 +  Dali::ShaderEffect shaderEffect = Dali::ShaderEffect::New( vertexShader, "" );
 +  shaderEffect.SetUniform( "uTopLeft", Vector2( 0.f, 0.f ) );
 +  shaderEffect.SetUniform( "uBottomRight", Vector2( 1.f, 1.f ) );
 +
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,65 -28,90 +28,65 @@@ namespace Toolki
  {
  
  /**
 - * @brief IrisEffect is a custom shader effect to achieve iris effects in Image actors
 + * @brief Creates a new IrisEffect
 + *
 + * IrisEffect is a custom shader effect to achieve iris effects in Image actors
 + *
 + * Animatable/Constrainable uniforms:
 + *
 + *  "uRadius"       - The radius of the iris effect in texture coordinate distance,
 + *                    i.e. 0.0 (no circle) to 1.0 (complete circle), to > 1.0 (extending outside of texture).
 + *                    @note For Atlas Textures results may be unpredictable.
 + *
 + *  "uBlendFactor"  - The blend factor of the iris effect. The lower the value, the larger the blending portion
 + *                    (between Opaque & Transparent). Blending will account for 1 / blendFactor of the radius
 + *                    of the texture.
 + *
 + *  "uCenter"       - The center point of the iris (in texture coordinates)
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API IrisEffect : public ShaderEffect
 +inline ShaderEffect CreateIrisEffect()
  {
 -
 -public:
 -
 -  /**
 -   * @brief Create an uninitialized IrisEffect; this can be initialized with IrisEffect::New().
 -   *
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  IrisEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~IrisEffect();
 -
 -  /**
 -   * @brief Create an initialized IrisEffect.
 -   *
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static IrisEffect New();
 -
 -  /**
 -   * @brief Set the radius of the iris effect in texture coordinate distance,
 -   * i.e. 0.0 (no circle) to 1.0 (complete circle), to > 1.0 (extending
 -   * outside of texture).
 -   *
 -   * @note For Atlas Textures results may be unpredictable.
 -   *
 -   * @param [in] radius The new radius.
 -   */
 -  void SetRadius(float radius);
 -
 -  /**
 -   * @brief Set the blend factor of the iris effect.
 -   *
 -   * The lower the value, the larger the blending portion
 -   * (between Opaque & Transparent)
 -   *
 -   * Blending will account for 1 / blendFactor of the radius
 -   * of the texture.
 -   *
 -   * @param [in] value The new blend Factor.
 -   */
 -  void SetBlendFactor(float value);
 -
 -  /**
 -   * @brief Sets the center point of the iris (in texture coordinates).
 -   *
 -   * @param[in] center The center point.
 -   */
 -  void SetCenter( const Vector2& center );
 -
 -  /**
 -   * @brief Get the name for the radius property which can be used in Animation APIs.
 -   *
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetRadiusPropertyName() const;
 -
 -  /**
 -   * @brief Get the name for the blend factor property.
 -   *
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetBlendFactorPropertyName() const;
 -
 -  /**
 -   * @brief Get the name for the center property.
 -   *
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetCenterPropertyName() const;
 -
 -
 -private: // Not intended for application developers
 -  DALI_INTERNAL IrisEffect(ShaderEffect handle);
 -};
 +  // append the default version
 +  std::string vertexShader(
 +      "uniform mediump vec2 uCenter;\n"
 +      "varying mediump vec2 vRelativePosition;\n"
 +      "\n"
 +      "void main()\n"
 +      "{\n"
 +      "    mediump vec4 world = uModelView * vec4(aPosition,1.0);\n"
 +      "    gl_Position = uProjection * world;\n"
 +      "    \n"
 +      "    vTexCoord = aTexCoord;\n"
 +      "    vRelativePosition = aTexCoord - uCenter;\n"
 +      "}\n");
 +
 +  std::string fragmentShader(
 +      "uniform mediump float uRadius;                                                           \n"
 +      "uniform mediump float uBlendFactor;                                                      \n"
 +      "varying mediump vec2 vRelativePosition;                                                  \n"
 +      "void main()                                                                      \n"
 +      "{                                                                                \n"
 +      "   mediump float delta = (length(vRelativePosition) - uRadius);                          \n"
 +      "   delta = clamp(0.0 - delta * uBlendFactor, 0.0, 1.0);                          \n"
 +      "   gl_FragColor = texture2D(sTexture, vTexCoord) * uColor;                       \n"
 +      "   gl_FragColor.a *= delta;                                                      \n"
 +      "}                                                                                \n"
 +  );
 +
 +  Dali::ShaderEffect shaderEffect =  Dali::ShaderEffect::New(
 +      vertexShader,
 +      fragmentShader,
 +      GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ));
 +
 +  shaderEffect.SetUniform( "uRadius", 0.0f );
 +  shaderEffect.SetUniform( "uBlendFactor", 100.0f );
 +  shaderEffect.SetUniform( "uCenter", Vector2(0.5f, 0.5f) );
 +
 +  return shaderEffect;
 +}
  
  }
  }
@@@ -29,40 -29,44 +29,40 @@@ namespace Toolki
  {
  
  /**
 - * @brief MaskEffect is used to control which parts of an image are visible, using the alpha channel of a separate mask image.
 + * @brief Creates a new MaskEffect
 + *
 + * MaskEffect is used to control which parts of an image are visible, using the alpha channel of a separate mask image.
   *
   * Typically mask images should be the same size as the main image being viewed, but this isn't essential.
   *
   * Usage example:
   *
   *   ImageActor actor = ImageActor::New( Image( EXAMPLE_IMAGE_PATH ) );
 - *   MaskEffect maskEffect = MaskEffect::New( Image::New( MASK_IMAGE_PATH ) );
 + *   ShaderEffect maskEffect = CreateMaskEffect( Image::New( MASK_IMAGE_PATH ) );
   *   actor.SetShaderEffect( maskEffect );
 + *
 + * @param[in] maskImage The image to use as a mask
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API MaskEffect : public ShaderEffect
 +inline ShaderEffect CreateMaskEffect(Image maskImage)
  {
 -public:
 -
 -  /**
 -   * @brief Create an empty MaskEffect handle.
 -   */
 -  MaskEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~MaskEffect();
 +  const char* ALPHA_MASK_FRAGMENT_SHADER_SOURCE =
 +      "void main()                                                                    \n"
 +      "{                                                                              \n"
 +      "  highp vec4 mask = texture2D(sEffect, vTexCoord);                             \n"
 +      "  gl_FragColor = texture2D(sTexture, vTexCoord) * uColor * vec4(1,1,1,mask.a); \n"
 +      "}                                                                              \n";
  
 -  /**
 -   * @brief Create a MaskEffect.
 -   *
 -   * @param[in] maskImage The image to use as a mask
 -   * @return A handle to a newly allocated MaskEffect.
 -   */
 -  static MaskEffect New( Image maskImage );
 +  ShaderEffect shaderEffect = ShaderEffect::New(
 +      "", // Use default
 +      ALPHA_MASK_FRAGMENT_SHADER_SOURCE,
 +      GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ) );
  
 -private: // Not intended for application developers
 +  shaderEffect.SetEffectImage( maskImage );
  
 -  DALI_INTERNAL MaskEffect( ShaderEffect handle );
 -};
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,64 -28,60 +28,64 @@@ namespace Toolki
  {
  
  /**
 + * @brief Creates a new MirrorEffect
 + *
   * MirrorEffect is a custom shader effect to achieve square effects in Image actors
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uDepth"  - The depth of the mirror effect. Default value 0.5
 + *  "uAlpha"  - The alpha of the mirror effect. Default value 1.0
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API MirrorEffect : public ShaderEffect
 +inline ShaderEffect CreateMirrorEffect()
  {
 -public:
 -
 -  /**
 -   * Create an uninitialized MirrorEffect; this can be initialized with MirrorEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  MirrorEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~MirrorEffect();
 -
 -  /**
 -   * Create an initialized MirrorEffect.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static MirrorEffect New();
 -
 -  /**
 -   * Set the depth of the mirror effect.
 -   * @param [in] depth The new mirror depth value.
 -   */
 -  void SetDepth(float depth);
 -
 -  /**
 -   * Set the alpha of the mirror effect.
 -   * @param [in] alpha The new mirror alpha value.
 -   */
 -  void SetAlpha(float alpha);
 -
 -  /**
 -   * Get the name for the depth property
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetDepthPropertyName() const;
 -
 -  /**
 -   * Get the name for the alpha property
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetAlphaPropertyName() const;
 +  std::string vertexShader(
 +      "void main()                                  \n"
 +      "{                                            \n"
 +      "  mediump vec3 pos = aPosition;              \n"
 +      "  pos.y = pos.y * 3.0;                       \n"
 +      "  mediump vec4 world = uModelView * vec4(pos,1.0); \n"
 +      "  gl_Position = uProjection * world;         \n"
 +      "  vTexCoord = aTexCoord;                     \n"
 +      "}                                            \n" );
 +
 +  std::string fragmentShader(
 +      "uniform  mediump float  uDepth;              \n"
 +      "uniform  mediump float  uAlpha;              \n"
 +      "void main()                                  \n"
 +      "{                                            \n"
 +      " if(vTexCoord.y < 1.0 / 3.0)                 \n"
 +      " {                                           \n"
 +      "   gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);  \n"
 +      " }                                           \n"
 +      " else if(vTexCoord.y < 2.0 / 3.0)            \n"
 +      " {                                           \n"
 +      "   gl_FragColor = texture2D(sTexture, vec2(vTexCoord.x, vTexCoord.y * 3.0 - 1.0)) * uColor;    \n"
 +      "   gl_FragColor.a *= uAlpha;                 \n"
 +      " }                                           \n"
 +      " else                                        \n"
 +      " {                                           \n"
 +      "   highp float darkness = 3.0 - vTexCoord.y * 3.0;                                                   \n"
 +      "   darkness = (1.0 - 1.0 / uDepth + darkness * 1.0/ uDepth) * 0.65;                            \n"
 +      "   highp vec4 color = texture2D(sTexture, vec2(vTexCoord.x, -vTexCoord.y *3.0 + 3.0)) * uColor;      \n"
 +      "   color.a *= uAlpha;                                                                          \n"
 +      "   gl_FragColor = color * vec4(darkness, darkness, darkness, darkness);                        \n"
 +      " }                                           \n"
 +      "}                                            \n" );
 +
 +  Dali::ShaderEffect shaderEffect =  Dali::ShaderEffect::New(
 +      vertexShader,
 +      fragmentShader,
 +      GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ));
 +
 +  shaderEffect.SetUniform("uAlpha", 1.0f);
 +  shaderEffect.SetUniform("uDepth", 0.5f);
 +
 +  return shaderEffect;
 +}
  
 -private: // Not intended for application developers
 -  DALI_INTERNAL MirrorEffect(ShaderEffect handle);
 -};
  
  } // namespace Toolkit
  
@@@ -19,7 -19,7 +19,7 @@@
   */
  
  // EXTERNAL INCLUDES
 -#include <dali/public-api/actors/renderable-actor.h>
 +#include <dali/public-api/actors/image-actor.h>
  #include <dali/public-api/shader-effects/shader-effect.h>
  
  namespace Dali
@@@ -29,211 -29,185 +29,211 @@@ namespace Toolki
  {
  
  /**
 + * @brief Create a new MotionBlurEffect
   *
 - * Class for motion blur shader that works on a per object basis. Objects will
 + * Motion blur shader works on a per object basis. Objects will
   * blur when they move, or if the camera moves. Can be applied to ImageActor or
   * TextActor only.
   *
   * Usage example:-
   *
   * // Create shader used for doing motion blur\n
 - * MotionBlurEffect MotionBlurEffect = MotionBlurEffect::New();
 + * ShaderEffect MotionBlurEffect = CreateMotionBlurEffect();
   *
   * // set actor shader to the blur one\n
 - * Actor Actor = Actor::New( ... );\n
 - * Actor.SetShaderEffect( MotionBlurEffect );
 + * Actor actor = Actor::New( ... );\n
 + * actor.SetShaderEffect( MotionBlurEffect );
   *
 + * // Constrain "uModelLastFrame" to be the same as the actor's world matrix\n
 + * Dali::Property::Index uModelProperty = MotionBlurEffect.GetPropertyIndex( "uModelLastFrame" );
 + * Constraint constraint = Constraint::New<Matrix>( MotionBlurEffect, uModelProperty, EqualToConstraint() );\n
 + * constraint.AddSource( Source( actor , Actor::Property::WORLD_MATRIX ) );\n
 + * constraint.Apply();\n
 + *
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uBlurTexCoordScale"      - This scales the offset for texture samples along the motion velocity vector.
 + *                              A smaller value means the samples will be spaced closer, larger value further
 + *                              apart. User should use this to get the blur to look contiguous, i.e. the blur
 + *                              texels should not be too widely spread, with gaps in between. Default 0.125.
 + *  "uGeometryStretchFactor"  - This scales the amount the geometry stretches backwards along the motion velocity
 + *                              vector. A smaller value means the geometry stretches less, larger it stretches more.
 + *                              User should use this to get the blur to 'bleed' into areas outside the physical
 + *                              bounds of the actor. We need this as the blur is only applied inside the bounds of
 + *                              the actor, but you would expect motion blur trails where the actor was previously
 + *                              but is there no longer. Default 0.05.
 + *  "uSpeedScalingFactor"     - This takes the magnitude of the motion velocity vector and scales it to produce a
 + *                              value which is used to fade the blur in / out with the speed that the actor is moving.
 + *                              As the blur fades in, more of the blur is visible and less of the original actor, and
 + *                              viceversa. This value is also used to control how much to fade the actor near the
 + *                              edges, based on the speed the actor is moving. When the actor is at rest this is not applied.
 + *                              Default 0.5.
 + *  "uObjectFadeStart"        - The displacement from the centre of the actor that the actor will start to fade towards its
 + *                              edges. This is used to prevent an unsightly hard edge between the blurred actor and the scene.
 + *                              Depends on the values of the vertices in the vertex stream. When the actor is at rest this is
 + *                              not applied. Default 0.25, which is half way towards the edge for an ImageRenderer::QUAD.
 + *  "uObjectFadeEnd"          - The displacement from the centre of the actor that the actor will finish fading towards its
 + *                              edges. This is used to prevent an unsightly hard edge between the blurred actor and the scene.
 + *                              Depends on the values of the vertices in the vertex stream. When the actor is at rest this is
 + *                              not applied.Default 0.5, which is all the way towards the edge for an ImageRenderer::QUAD.
 + *  "uAlphaScale"             - Global scaler applied to the alpha of the actor. Used to make the blurred actor a bit more subtle
 + *                              (helps to hide discontinuities due to limited number of texture samples) and reveal a bit of the
 + *                              background behind it as it moves. When the actor is at rest this is not applied. Default 0.75.
 + *  "uNumSamples"             - The number of texture samples to be taken. Increasing the number of samples provides better quality
 + *                              at the cost of performance.
 + *  "uModelLastFrame"         - The model to world space transformation matrix of the actor in the previous frame.
 + *
 + * @param numBlurSamples Number of samples used by the shader
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API MotionBlurEffect : public ShaderEffect
 +inline ShaderEffect CreateMotionBlurEffect( unsigned int numBlurSamples = 8 )
  {
 -
 -public:
 -
 -  /**
 -   * Create an uninitialized MotionBlurEffect; this can be initialized with MotionBlurEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  MotionBlurEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~MotionBlurEffect();
 -
 -  /**
 -   * Create an initialized MotionBlurEffect
 -   * The number of texture samples taken along the motion velocity vector of the
 -   * actor, producing the blur, is set to a default of 8.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static MotionBlurEffect New();
 -
 -  /**
 -   * Create a  MotionBlurEffect and attach it to the specified actor
 -   * The number of texture samples taken along the motion velocity vector of the
 -   * actor, producing the blur, is set to a default of 8.
 -   * @param renderable actor to apply the effect to
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static MotionBlurEffect Apply( RenderableActor renderable );
 -
 -  /**
 -   * Create an initialized MotionBlurEffect
 -   * @param numBlurSamples The number of texture samples taken along the motion
 -   * velocity vector of the actor, producing the blur. A higher number gives a
 -   * smoother blur but costs more in terms of performance.
 -   * @param numBlurSamples to have
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static MotionBlurEffect New( unsigned int numBlurSamples );
 -
 -  /**
 -   * Set texcoord scale property. This scales the offset for texture samples
 -   * along the motion velocity vector. A smaller value means the samples will
 -   * be spaced closer, larger value further apart. User should use this to get
 -   * the blur to look contiguous, i.e. the blur texels should not be too widely
 -   * spread, with gaps in between. Default 0.125.
 -   * @param texcoordScale The scaling factor that multiplies the motion velocity vector for texture lookups.
 -   */
 -  void SetTexcoordScale( float texcoordScale );
 -
 -  /**
 -   * Set geometry stretch factor property. This scales the amount the
 -   * geometry stretches backwards along the motion velocity vector. A smaller
 -   * value means the geometry stretches less, larger it stretches more. User
 -   * should use this to get the blur to 'bleed' into areas outside the physical
 -   * bounds of the actor. We need this as the blur is only applied inside the
 -   * bounds of the actor, but you would expect motion blur trails where the
 -   * actor was previously but is there no longer. Default 0.05.
 -   * @param scalingFactor The scaling factor that extrudes the geometry backwards along the motion velocity vector.
 -   */
 -  void SetGeometryStretchFactor( float scalingFactor );
 -
 -  /**
 -   * Set speed scaling factor property. This takes the magnitude of the motion
 -   * velocity vector and scales it to produce a value which is used to fade the
 -   * blur in / out with the speed that the actor is moving. As the blur fades
 -   * in, more of the blur is visible and less of the original actor, and vice
 -   * versa.
 -   * This value is also used to control how much to fade the actor near the
 -   * edges, based on the speed the actor is moving. When the actor is at rest
 -   * this is not applied. Default 0.5.
 -   * @param scalingFactor The scaling factor that controls the edge fade / blur fade of the actor.
 -   */
 -  void SetSpeedScalingFactor( float scalingFactor );
 -
 -  /**
 -   * Set the displacement from the centre of the actor that the actor will start
 -   * to fade towards its edges. This is used to prevent an unsightly hard edge
 -   * between the blurred actor and the scene. Depends on the values of the
 -   * vertices in the vertex stream. When the actor is at rest this is not applied.
 -   * Default 0.25, which is half way towards the edge for an ImageRenderer::QUAD.
 -   * @param displacement The displacement from the centre of the actor that the actor will start to edge fade.
 -   */
 -  void SetObjectFadeStart( Vector2 displacement );
 -
 -  /**
 -   * Set the displacement from the centre of the actor that the actor will
 -   * finish fading towards its edges. This is used to prevent an unsightly hard
 -   * edge between the blurred actor and the scene. Depends on the values of the
 -   * vertices in the vertex stream. When the actor is at rest this is not applied.
 -   * Default 0.5, which is all the way towards the edge for an ImageRenderer::QUAD.
 -   * @param displacement The displacement from the centre of the actor that the actor will finish edge fading.
 -   */
 -  void SetObjectFadeEnd( Vector2 displacement );
 -
 -  /**
 -   * Set a global scaler applied to the alpha of the actor. Used to make the
 -   * blurred actor a bit more subtle (helps to hide discontinuities due to
 -   * limited number of texture samples) and reveal a bit of the background
 -   * behind it as it moves. When the actor is at rest this is not applied. Default 0.75.
 -   * @param alphaScale The scaling factor which multiplies the alpha of each pixel of the actor.
 -   */
 -  void SetAlphaScale( float alphaScale );
 -
 -  /**
 -   * Set the number of texture samples to be taken. Increasing the number of
 -   * samples provides better quality at the cost of performance.
 -   * @param numSamples The number of texture samples to be taken. Default is 8.
 -   */
 -  void SetNumSamples( int numSamples );
 -
 -  /**
 -   * Get the name for the texcoord scale property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetTexcoordScalePropertyName() const;
 -
 -  /**
 -   * Get the name for the geometry stretching property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetGeometryStretchFactorPropertyName() const;
 -
 -  /**
 -   * Get the name for the speed scaling property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetSpeedScalingFactorPropertyName() const;
 -
 -  /**
 -   * Get the name for the fade start property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetObjectFadeStartPropertyName() const;
 -
 -  /**
 -   * Get the name for the fade end property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetObjectFadeEndPropertyName() const;
 -
 -  /**
 -   * Get the name for the alpha scale property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetAlphaScalePropertyName() const;
 -
 -  /**
 -   * Downcast an ShaderEffect handle to MotionBlurEffect handle. If handle points to a MotionBlurEffect object the
 -   * downcast produces valid handle. If not the returned handle is left uninitialized.
 -   * @param[in] handle to a ShaderEffect
 -   * @return handle to a MotionBlurEffect object or an uninitialized handle
 -   */
 -  static MotionBlurEffect DownCast( ShaderEffect handle );
 -
 -private:
 -  // Not intended for application developers
 -  DALI_INTERNAL MotionBlurEffect( ShaderEffect handle );
 -};
 +  // Dali vertexSource prefix for reference:
 +  // precision highp float;
 +  // attribute vec3  aPosition;
 +  // attribute vec2  aTexCoord;
 +  // uniform   mat4  uMvpMatrix;
 +  // uniform   mat4  uModelView;
 +  // uniform   mat3  uNormalMatrix;
 +  // uniform   mat4  uProjection;
 +  // uniform   vec4  uColor;
 +  // varying   vec2  vTexCoord;
 +  std::string vertexSource;
 +  vertexSource =
 +      "precision mediump float;\n"
 +      "uniform mat4 uModelLastFrame;\n"
 +      "uniform float uTimeDelta;\n"
 +
 +      "uniform float uGeometryStretchFactor;\n"
 +      "uniform float uSpeedScalingFactor;\n"
 +
 +      // outputs
 +      "varying vec2 vModelSpaceCenterToPos;\n"
 +      "varying vec2 vScreenSpaceVelocityVector;\n"
 +      "varying float vSpeed;\n"
 +
 +      "void main()\n"
 +      "{\n"
 +      // get view space position of vertex this frame and last frame
 +      " vec4 vertex = vec4(aPosition, 1.0);\n"
 +      " vec4 viewSpaceVertex = uModelView * vertex;\n"
 +      " vec4 viewSpaceVertexLastFrame = (uViewMatrix * uModelLastFrame) * vertex;\n"
 +      " float reciprocalTimeDelta = 1.0 / ((uTimeDelta > 0.0) ? uTimeDelta : 0.01);\n"
 +
 +      // work out vertex's last movement in view space
 +      " vec3 viewSpacePosDelta = viewSpaceVertex.xyz - viewSpaceVertexLastFrame.xyz;\n"
 +
 +      // get clip space position of vertex this frame and last frame
 +      " vec4 clipSpaceVertex = uMvpMatrix * vertex;\n"
 +      " vec4 clipSpaceVertexLastFrame = uProjection * viewSpaceVertexLastFrame;\n"
 +
 +      // decide how much this vertex is 'trailing', i.e. at the back of the object relative to its direction of motion. We do this
 +      // by assuming the objects model space origin is at its center and taking the dot product of the vector from center to vertex with the motion direction
 +      " float t = 0.0;\n"
 +      " float posDeltaLength = length(viewSpacePosDelta);\n"
 +      " if(posDeltaLength > 0.001)\n" // avoid div by 0 if object has barely moved
 +      " {\n"
 +      "   vec4 viewSpaceCenterToPos = uModelView * vec4(aPosition, 0.0);\n"
 +      "   float centerToVertexDist = length(viewSpaceCenterToPos);\n"
 +      "   if(centerToVertexDist > 0.001)\n" // avoid div by 0 if object has vertex at model space origin
 +      "   {\n"
 +      "     vec3 viewSpacePosDeltaNormalised = viewSpacePosDelta / posDeltaLength;\n"
 +      "     vec3 viewSpaceCenterToPosNormalised = viewSpaceCenterToPos.xyz / centerToVertexDist;\n"
 +      "     t = (dot(viewSpacePosDeltaNormalised, viewSpaceCenterToPosNormalised) * 0.5 ) + 0.5;\n" // scale and bias from [-1..1] to [0..1]
 +      "   }\n"
 +      " }\n"
 +      // output vertex position lerped with its last position, based on how much it is trailing,
 +      // this stretches the geom back along where it has just been, giving a warping effect
 +      // Note: we must take account of time delta to convert position delta into a velocity, so changes are smooth (take into account frame time correctly)
 +      " gl_Position = mix(clipSpaceVertexLastFrame, clipSpaceVertex, t * uGeometryStretchFactor * reciprocalTimeDelta);\n"
 +
 +      // work out vertex's last movement in normalised device coordinates [-1..1] space, i.e. perspective divide
 +      " vec2 ndcVertex = clipSpaceVertex.xy / clipSpaceVertex.w;\n"
 +      " vec2 ndcVertexLastFrame = clipSpaceVertexLastFrame.xy / clipSpaceVertexLastFrame.w;\n"
 +      // scale and bias so that a value of 1.0 corresponds to screen size (NDC is [-1..1] = 2)
 +      " vScreenSpaceVelocityVector = ((ndcVertex - ndcVertexLastFrame) * 0.5 * reciprocalTimeDelta);\n"
 +      " vScreenSpaceVelocityVector.y = -vScreenSpaceVelocityVector.y;\n" // TODO negated due to y being inverted in our coordinate system?
 +      // calculate a scaling factor proportional to velocity, which we can use to tweak how things look
 +      " vSpeed = length(vScreenSpaceVelocityVector) * uSpeedScalingFactor;\n"
 +      " vSpeed = clamp(vSpeed, 0.0, 1.0);\n"
 +
 +      // provide fragment shader with vector from center of object to pixel (assumes the objects model space origin is at its center and verts have same z)
 +      " vModelSpaceCenterToPos = aPosition.xy;\n"
 +
 +      " vTexCoord = aTexCoord;\n"
 +      "}\n";
 +
 +
 +  // Dali fragmentSource prefix for reference:
 +  // precision highp     float;
 +  // uniform   sampler2D sTexture;
 +  // uniform   sampler2D sEffect;
 +  // uniform   vec4      uColor;
 +  // varying   vec2      vTexCoord;
 +  std::string fragmentSource;
 +  fragmentSource =
 +      "precision mediump float;\n"
 +      "uniform vec2 uObjectFadeStart;\n"
 +      "uniform vec2 uObjectFadeEnd;\n"
 +      "uniform float uAlphaScale;\n"
 +      "uniform float uBlurTexCoordScale;\n"
 +      "uniform float uNumSamples;\n"
 +      "uniform float uRecipNumSamples;\n"
 +      "uniform float uRecipNumSamplesMinusOne;\n"
 +      // inputs
 +      "varying vec2 vModelSpaceCenterToPos;\n"
 +      "varying vec2 vScreenSpaceVelocityVector;\n"
 +      "varying float vSpeed;\n"
 +
 +      "void main()\n"
 +      "{\n"
 +      // calculate an alpha value that will fade the object towards its extremities, we need this to avoid an unsightly hard edge between color values of
 +      // the blurred object and the unblurred background. Use smoothstep also to hide any hard edges (discontinuities) in rate of change of this alpha gradient
 +      " vec2 centerToPixel = abs(vModelSpaceCenterToPos);\n"
 +      " vec2 fadeToEdges = smoothstep(0.0, 1.0, 1.0 - ((centerToPixel - uObjectFadeStart) / (uObjectFadeEnd - uObjectFadeStart)));\n"
 +      " float fadeToEdgesScale = fadeToEdges.x * fadeToEdges.y * uAlphaScale;\n" // apply global scaler
 +      " fadeToEdgesScale = mix(1.0, fadeToEdgesScale, vSpeed);\n" // fade proportional to speed, so opaque when at rest
 +
 +      // scale velocity vector by user requirements
 +      " vec2 velocity = vScreenSpaceVelocityVector * uBlurTexCoordScale;\n"
 +
 +      // standard actor texel
 +      " vec4 colActor = texture2D(sTexture, vTexCoord);\n"
 +
 +      // blurred actor - gather texture samples from the actor texture in the direction of motion
 +      " vec4 col = colActor * uRecipNumSamples;\n"
 +      " for(float i = 1.0; i < uNumSamples; i += 1.0)\n"
 +      " {\n"
 +      "   float t = i * uRecipNumSamplesMinusOne;\n"
 +      "   col += texture2D(sTexture, vTexCoord + (velocity * t)) * uRecipNumSamples;\n"
 +      " }\n"
 +      " gl_FragColor = mix(colActor, col, vSpeed);\n" // lerp blurred and non-blurred actor based on speed of motion
 +      " gl_FragColor.a = colActor.a * fadeToEdgesScale;\n" // fade blurred actor to its edges based on speed of motion
 +      " gl_FragColor *= uColor;\n"
 +      "}\n";
 +
 +  // NOTE: we must turn on alpha blending for the actor (HINT_BLENDING)
 +  ShaderEffect shader = ShaderEffect::New( vertexSource, fragmentSource,
 +                                           GeometryType(GEOMETRY_TYPE_IMAGE),
 +                                           ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING | ShaderEffect::HINT_GRID) );
 +
 +  //////////////////////////////////////
 +  // Register uniform properties
 +  //
 +  //
 +  shader.SetUniform( "uBlurTexCoordScale", 0.125f );
 +  shader.SetUniform( "uGeometryStretchFactor", 0.05f );
 +  shader.SetUniform( "uSpeedScalingFactor", 0.5f );
 +  shader.SetUniform( "uObjectFadeStart", Vector2( 0.25f, 0.25f ) );
 +  shader.SetUniform( "uObjectFadeEnd", Vector2( 0.5f, 0.5f ) );
 +  shader.SetUniform( "uAlphaScale", 0.75f );
 +  shader.SetUniform( "uNumSamples", static_cast<float>( numBlurSamples ) );
 +  shader.SetUniform( "uRecipNumSamples", 1.0f / static_cast<float>( numBlurSamples ) );
 +  shader.SetUniform( "uRecipNumSamplesMinusOne", 1.0f / static_cast<float>( numBlurSamples - 1.0f ) );
 +  shader.SetUniform( "uModelLastFrame", Matrix::IDENTITY );
 +
 +  return shader;
 +}
  
  }
  
@@@ -19,7 -19,7 +19,7 @@@
   */
  
  // EXTERNAL INCLUDES
 -#include <dali/public-api/actors/renderable-actor.h>
 +#include <dali/public-api/actors/image-actor.h>
  #include <dali/public-api/shader-effects/shader-effect.h>
  
  namespace Dali
@@@ -29,180 -29,136 +29,180 @@@ namespace Toolki
  {
  
  /**
 + * @brief Creates a new MotionStretchEffect
   *
 - * Class for motion stretch shader that works on a per object basis. Objects will stretch in the direction of motion when they move, or if the camera moves. Can be applied
 + * Motion stretch shader works on a per object basis. Objects will stretch in the direction of motion when they move, or if the camera moves. Can be applied
   * to ImageActor or TextActor only.
   *
   * Usage example:-
   *
   * // Create shader used for doing motion stretch\n
 - * MotionStretchEffect MotionStretchEffect = MotionStretchEffect::New();
 + * ShaderEffect MotionStretchEffect = CreateMotionStretchEffect();
   *
   * // set actor shader to the stretch one\n
 - * Actor Actor = Actor::New( ... );\n
 - * Actor.SetShaderEffect( MotionStretchEffect );
 + * Actor actor = Actor::New( ... );\n
 + * actor.SetShaderEffect( MotionStretchEffect );
   *
 + * // Constrain "uModelLastFrame" to be the same as the actor's world matrix\n
 + * Dali::Property::Index uModelProperty = MotionBlurEffect.GetPropertyIndex( "uModelLastFrame" );
 + * Constraint constraint = Constraint::New<Matrix>( MotionBlurEffect, uModelProperty, EqualToConstraint() );\n
 + * constraint.AddSource( Source( actor , Actor::Property::WORLD_MATRIX ) );\n
 + * constraint.Apply();\n
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uGeometryStretchFactor"  - This scales the amount the geometry stretches along the motion velocity vector.
 + *                              A smaller value means the geometry stretches less, larger it stretches more. Default 0.5.
 + *  "uSpeedScalingFactor"     - This value is used to control how much to fade the actor near the edges, based on the
 + *                              speed the actor is moving. When the actor is at rest this is not applied. Default 0.5.
 + *  "uObjectFadeStart"        - The displacement from the centre of the actor that the actor will start to fade towards
 + *                              its edges. This is used to prevent an unsightly hard edge between the stretched actor and
 + *                              the scene. Depends on the values of the vertices in the vertex stream. When the actor is at
 + *                              rest this is not applied. Default Vector2(0.25, 0.25), which is half way towards the edge for
 + *                              an ImageRenderer::QUAD.
 + *  "uObjectFadeEnd"          - The displacement from the centre of the actor that the actor will finish fading towards its edges.
 + *                              This is used to prevent an unsightly hard edge between the stretched actor and the scene. Depends
 + *                              on the values of the vertices in the vertex stream. When the actor is at rest this is not applied.
 + *                              Default 0.5, which is all the way towards the edge for an ImageRenderer::QUAD.
 + *  "uAlphaScale"             - Global scaler applied to the alpha of the actor. Used to make the stretched actor a bit more subtle
 + *                              and reveal a bit of the background behind it as it moves. When the actor is at rest this is not
 + *                              applied. Default 0.75.
 + *  "uModelLastFrame"         - The model to world space transformation matrix of the actor in the previous frame.
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API MotionStretchEffect : public ShaderEffect
 +inline ShaderEffect CreateMotionStretchEffect()
  {
 -
 -public:
 -
 -  /**
 -   * Create an uninitialized MotionStretchEffect; this can be initialized with MotionStretchEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  MotionStretchEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~MotionStretchEffect();
 -
 -  /**
 -   * Create an initialized MotionStretchEffect
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static MotionStretchEffect New();
 -
 -  /**
 -   * Create a  MotionStretchEffect and attach it to the specified actor
 -   * @param renderable actor to apply the effect to
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static MotionStretchEffect Apply( RenderableActor renderable );
 -
 -  /**
 -   * Set geometry stretch factor property. This scales the amount the geometry
 -   * stretches along the motion velocity vector. A smaller value means the geometry
 -   * stretches less, larger it stretches more. Default 0.5.
 -   * @param scalingFactor The scaling factor that extrudes the geometry forwards along the motion velocity vector.
 -   */
 -  void SetGeometryStretchFactor( float scalingFactor );
 -
 -  /**
 -   * Set speed scaling factor property. This value is used to control how much
 -   * to fade the actor near the edges, based on the speed the actor is moving.
 -   * When the actor is at rest this is not applied. Default 0.5.
 -   * @param scalingFactor The scaling factor that controls the edge fade of the actor.
 -   */
 -  void SetSpeedScalingFactor( float scalingFactor );
 -
 -  /**
 -   * Set the displacement from the centre of the actor that the actor will start to
 -   * fade towards its edges. This is used to prevent an unsightly hard edge
 -   * between the stretched actor and the scene. Depends on the values of the
 -   * vertices in the vertex stream. When the actor is at rest this is not applied.
 -   * Default Vector2(0.25, 0.25), which is half way towards the edge for an ImageRenderer::QUAD.
 -   * @param displacement The displacement from the centre of the actor that the actor will start to edge fade.
 -   */
 -  void SetObjectFadeStart( Vector2 displacement );
 -
 -  /**
 -   * Set the displacement from the centre of the actor that the actor will
 -   * finish fading towards its edges. This is used to prevent an unsightly hard
 -   * edge between the stretched actor and the scene. Depends on the values of
 -   * the vertices in the vertex stream. When the actor is at rest this is not applied.
 -   * Default 0.5, which is all the way towards the edge for an ImageRenderer::QUAD.
 -   * @param displacement The displacement from the centre of the actor that the actor will finish edge fading.
 -   */
 -  void SetObjectFadeEnd( Vector2 displacement );
 -
 -  /**
 -   * Set a global scaler applied to the alpha of the actor. Used to make the
 -   * stretched actor a bit more subtle and reveal a bit of the background behind
 -   * it as it moves. When the actor is at rest this is not applied. Default 0.75.
 -   * @param alphaScale The scaling factor which multiplies the alpha of each pixel of the actor.
 -   */
 -  void SetAlphaScale( float alphaScale );
 -
 -
 -  /**
 -   * Get the name for the texcoord scale property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetTexcoordScalePropertyName() const;
 -
 -  /**
 -   * Get the name for the geometry stretching property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetGeometryStretchFactorPropertyName() const;
 -
 -  /**
 -   * Get the name for the speed scaling property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetSpeedScalingFactorPropertyName() const;
 -
 -  /**
 -   * Get the name for the fade start X property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetObjectFadeStartPropertyName() const;
 -
 -  /**
 -   * Get the name for the fade end X property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetObjectFadeEndPropertyName() const;
 -
 -  /**
 -   * Get the name for the alpha scale property. Useful for animation.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetAlphaScalePropertyName() const;
 -
 -private:
 -  // Not intended for application developers
 -  DALI_INTERNAL MotionStretchEffect( ShaderEffect handle );
 -};
 +  // Dali vertexSource prefix for reference:
 +  // precision highp float;
 +  // attribute vec3  aPosition;
 +  // attribute vec2  aTexCoord;
 +  // uniform   mat4  uMvpMatrix;
 +  // uniform   mat4  uModelView;
 +  // uniform   mat3  uNormalMatrix;
 +  // uniform   mat4  uProjection;
 +  // uniform   vec4  uColor;
 +  // varying   vec2  vTexCoord;
 +  std::string vertexSource;
 +  vertexSource =
 +      "precision mediump float;\n"
 +      "uniform mat4  uModelLastFrame;\n"
 +      "uniform float uTimeDelta;\n"
 +
 +      "uniform float uGeometryStretchFactor;\n"
 +      "uniform float uSpeedScalingFactor;\n"
 +
 +      // outputs
 +      "varying vec2 vModelSpaceCenterToPos;\n"
 +      "varying vec2 vScreenSpaceVelocityVector;\n"
 +      "varying float vSpeed;\n"
 +
 +      "void main()\n"
 +      "{\n"
 +      // get view space position of vertex this frame and last frame
 +      " vec4 vertex = vec4(aPosition, 1.0);\n"
 +      " vec4 viewSpaceVertex = uModelView * vertex;\n"
 +      " vec4 viewSpaceVertexLastFrame = uViewMatrix * uModelLastFrame * vertex;\n"
 +
 +      // work out vertex's last movement in view space
 +      " vec3 viewSpacePosDelta = viewSpaceVertex.xyz - viewSpaceVertexLastFrame.xyz;\n"
 +      " float reciprocalTimeDelta = 1.0 / ((uTimeDelta > 0.0) ? uTimeDelta : 0.01);\n"
 +
 +      // get clip space position of vertex this frame and last frame
 +      " vec4 clipSpaceVertex = uMvpMatrix * vertex;\n"
 +      " vec4 clipSpaceVertexLastFrame = uProjection * viewSpaceVertexLastFrame;\n"
 +
 +      // decide how much this vertex is 'trailing', i.e. at the back of the object relative to its direction of motion. We do this
 +      // by assuming the objects model space origin is at its center and taking the dot product of the vector from center to vertex with the motion direction
 +      " float t = 0.0;\n"
 +      " float posDeltaLength = length(viewSpacePosDelta);\n"
 +      " if(posDeltaLength > 0.001)\n" // avoid div by 0 if object has barely moved
 +      " {\n"
 +      "   vec4 viewSpaceCenterToPos = uModelView * vec4(aPosition, 0.0);\n"
 +      "   float centerToVertexDist = length(viewSpaceCenterToPos);\n"
 +      "   if(centerToVertexDist > 0.001)\n" // avoid div by 0 if object has vertex at model space origin
 +      "   {\n"
 +      "     vec3 viewSpacePosDeltaNormalised = viewSpacePosDelta / posDeltaLength;\n"
 +      "     vec3 viewSpaceCenterToPosNormalised = viewSpaceCenterToPos.xyz / centerToVertexDist;\n"
 +      "     t = (dot(viewSpacePosDeltaNormalised, viewSpaceCenterToPosNormalised) * 0.5 ) + 0.5;\n" // scale and bias from [-1..1] to [0..1]
 +      "   }\n"
 +      " }\n"
 +      // output vertex position lerped with its last position, based on how much it is trailing,
 +      // this stretches the geom back along where it has just been, giving a warping effect
 +      // We raise t to a power in order that non-trailing vertices are effected much more than trailing ones
 +      // Note: we must take account of time delta to convert position delta into a velocity, so changes are smooth (take into account frame time correctly)
 +      " gl_Position = mix(clipSpaceVertexLastFrame, clipSpaceVertex, t * t * t * uGeometryStretchFactor * reciprocalTimeDelta);\n"
 +
 +      // work out vertex's last movement in normalised device coordinates [-1..1] space, i.e. perspective divide
 +      " vec2 ndcVertex = clipSpaceVertex.xy / clipSpaceVertex.w;\n"
 +      " vec2 ndcVertexLastFrame = clipSpaceVertexLastFrame.xy / clipSpaceVertexLastFrame.w;\n"
 +      // scale and bias so that a value of 1.0 corresponds to screen size (NDC is [-1..1] = 2)
 +      " vScreenSpaceVelocityVector = ((ndcVertex - ndcVertexLastFrame) * 0.5 * reciprocalTimeDelta);\n"
 +      " vScreenSpaceVelocityVector.y = -vScreenSpaceVelocityVector.y;\n" // TODO negated due to y being inverted in our coordinate system?
 +      // calculate a scaling factor proportional to velocity, which we can use to tweak how things look
 +      " vSpeed = length(vScreenSpaceVelocityVector) * uSpeedScalingFactor;\n"
 +      " vSpeed = clamp(vSpeed, 0.0, 1.0);\n"
 +
 +      // provide fragment shader with vector from center of object to pixel (assumes the objects model space origin is at its center and verts have same z)
 +      " vModelSpaceCenterToPos = aPosition.xy;\n"
 +
 +      " vTexCoord = aTexCoord;\n"
 +      "}\n";
 +
 +
 +  // Dali fragmentSource prefix for reference:
 +  // precision highp     float;
 +  // uniform   sampler2D sTexture;
 +  // uniform   sampler2D sEffect;
 +  // uniform   vec4      uColor;
 +  // varying   vec2      vTexCoord;
 +  std::string fragmentSource;
 +  fragmentSource =
 +      "precision mediump float;\n"
 +
 +      "uniform vec2 uObjectFadeStart;\n"
 +      "uniform vec2 uObjectFadeEnd;\n"
 +      "uniform float uAlphaScale;\n"
 +
 +      // inputs
 +      "varying vec2 vModelSpaceCenterToPos;\n"
 +      "varying vec2 vScreenSpaceVelocityVector;\n"
 +      "varying float vSpeed;\n"
 +
 +      "void main()\n"
 +      "{\n"
 +      // calculate an alpha value that will fade the object towards its extremities, we need this to avoid an unsightly hard edge between color values of
 +      // the stretched object and the background. Use smoothstep also to hide any hard edges (discontinuities) in rate of change of this alpha gradient
 +      " vec2 centerToPixel = abs( vModelSpaceCenterToPos );\n"
 +      " vec2 fadeToEdges = smoothstep(0.0, 1.0, 1.0 - ((centerToPixel - uObjectFadeStart) / (uObjectFadeEnd - uObjectFadeStart)));\n"
 +      " float fadeToEdgesScale = fadeToEdges.x * fadeToEdges.y * uAlphaScale;\n" // apply global scaler
 +      " fadeToEdgesScale = mix(1.0, fadeToEdgesScale, vSpeed);\n" // fade proportional to speed, so opaque when at rest
 +
 +      // standard actor texel
 +      " vec4 colActor = texture2D(sTexture, vTexCoord);\n"
 +      " gl_FragColor = colActor;\n"
 +      " gl_FragColor.a *= fadeToEdgesScale;\n" // fade actor to its edges based on speed of motion
 +      " gl_FragColor *= uColor;\n"
 +      "}";
 +
 +  // NOTE: we must turn on alpha blending for the actor (HINT_BLENDING)
 +  ShaderEffect shaderEffect = ShaderEffect::New(
 +      vertexSource, fragmentSource, GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING | ShaderEffect::HINT_GRID ) );
 +
 +
 +  //////////////////////////////////////
 +  // Register uniform properties
 +  //
 +  //
 +  shaderEffect.SetUniform( "uGeometryStretchFactor",  0.5f );
 +  shaderEffect.SetUniform( "uSpeedScalingFactor",     0.5f );
 +  shaderEffect.SetUniform( "uObjectFadeStart",        Vector2( 0.25f, 0.25f ) );
 +  shaderEffect.SetUniform( "uObjectFadeEnd",          Vector2( 0.5f, 0.5f ) );
 +  shaderEffect.SetUniform( "uAlphaScale",             0.75f );
 +  shaderEffect.SetUniform( "uModelLastFrame",         Matrix::IDENTITY );
 +
 +  return shaderEffect;
 +}
  
  }
  
@@@ -45,74 -45,6 +45,74 @@@ namespace Toolki
  namespace NinePatchMaskEffect
  {
  
 +static void NinePatchMaskEffectSizeConstraint( Vector2& current, const PropertyInputContainer& inputs )
 +{
 +  const Vector3& actorSize = inputs[0]->GetVector3();
 +  current.x = actorSize.x;
 +  current.y = actorSize.y;
 +}
 +
 +inline void DoApply( ImageActor actor, const std::string& maskImage, const Vector2& maskSize, Vector4 maskBorder )
 +{
 +  const char* ALPHA_MASK_VERTEX_SHADER_SOURCE =
 +  "precision mediump float;\n"
 +  "uniform vec2 uImageSize;                                                       \n"
 +  "uniform vec2 uMaskSize;                                                        \n"
 +  "varying vec2 vMaskTexCoord;                                                    \n"
 +  "                                                                               \n"
 +  "void main()                                                                    \n"
 +  "{                                                                              \n"
 +  "  gl_Position = uMvpMatrix * vec4(aPosition, 1.0);                             \n"
 +  "                                                                               \n"
 +  "  // Ignore mask UVs for image                                                 \n"
 +  "                                                                               \n"
 +  "  highp vec2 halfImageSize = uImageSize * 0.5;                                 \n"
 +  "  vTexCoord = (aPosition.xy + halfImageSize) / uImageSize;                     \n"
 +  "                                                                               \n"
 +  "  // UVs were calculated for image size, so convert for mask size              \n"
 +  "                                                                               \n"
 +  "  highp vec2 halfMaskSize  = uMaskSize * 0.5;                                  \n"
 +  "  highp vec2 halfSizeDelta = halfImageSize - halfMaskSize;                     \n"
 +  "                                                                               \n"
 +  "  highp vec2 maskPosition = aPosition.xy;                                      \n"
 +  "  maskPosition.x -= halfSizeDelta.x * sign(aPosition.x);                       \n"
 +  "  maskPosition.y -= halfSizeDelta.y * sign(aPosition.y);                       \n"
 +  "                                                                               \n"
 +  "  vMaskTexCoord = (maskPosition + halfMaskSize) / uMaskSize;                   \n"
 +  "}                                                                              \n";
 +
 +  const char* ALPHA_MASK_FRAGMENT_SHADER_SOURCE =
 +  "varying mediump vec2 vMaskTexCoord;                                            \n"
 +  "                                                                               \n"
 +  "void main()                                                                    \n"
 +  "{                                                                              \n"
 +  "  highp vec4 mask = texture2D(sEffect, vMaskTexCoord);                         \n"
 +  "  gl_FragColor = texture2D(sTexture, vTexCoord) * uColor * vec4(1,1,1,mask.a); \n"
 +  "}                                                                              \n";
 +
 +  ShaderEffect maskEffect = ShaderEffect::New(
 +    ALPHA_MASK_VERTEX_SHADER_SOURCE,
 +    ALPHA_MASK_FRAGMENT_SHADER_SOURCE,
 +    GeometryType( GEOMETRY_TYPE_IMAGE ),
 +    ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ) );
 +
 +  maskEffect.SetEffectImage( ResourceImage::New( maskImage ) );
 +
 +  maskEffect.SetUniform( "uImageSize", Vector2(0,0) /*Constrained to actor size*/ );
 +
 +  Constraint constraint = Constraint::New<Vector2>( maskEffect, maskEffect.GetPropertyIndex("uImageSize"), NinePatchMaskEffectSizeConstraint );
 +  constraint.AddSource( Source(actor, Actor::Property::SIZE) );
 +  constraint.Apply();
 +
 +  maskEffect.SetUniform( "uMaskSize", maskSize );
 +
 +  // Actor must provide nine-patch style geometry for this effect to work
 +  actor.SetStyle( ImageActor::STYLE_NINE_PATCH );
 +  actor.SetNinePatchBorder( maskBorder );
 +
 +  actor.SetShaderEffect( maskEffect );
 +}
 +
  /**
   * @brief Apply the mask effect to an ImageActor.
   *
   * @param [in] actor The actor which needs the effect. To remove the effect call actor.RemoveShaderEffect().
   * @param [in] maskImage The path to a file containing the mask. The center pixels of the mask will be stretched.
   */
 -DALI_IMPORT_API void Apply( ImageActor actor, const std::string& maskImage );
 +inline void Apply( ImageActor actor, const std::string& maskImage )
 +{
 +  const Uint16Pair maskSize = ResourceImage::GetImageSize( maskImage );
 +
 +  const float leftRight = (maskSize.GetWidth()  - 1.0f) * 0.5f;
 +  const float topBottom = (maskSize.GetHeight() - 1.0f) * 0.5f;
 +
 +  DoApply( actor, maskImage, Vector2( maskSize.GetWidth(), maskSize.GetHeight() ), Vector4( leftRight, topBottom, leftRight, topBottom ) );
 +}
  
  /**
   * @brief Apply the mask effect to an ImageActor.
   * @param [in] maskImage The path to a file containing the mask.
   * @param [in] maskBorder Specifies the part of the mask image that will be stretched (left, top, right, bottom).
   */
 -DALI_IMPORT_API void Apply( ImageActor actor, const std::string& maskImage, const Vector4& maskBorder );
 +inline void Apply( ImageActor actor, const std::string& maskImage, const Vector4& maskBorder )
 +{
 +  const Uint16Pair maskSize = ResourceImage::GetImageSize( maskImage );
 +
 +  DoApply( actor, maskImage, Vector2( maskSize.GetWidth(), maskSize.GetHeight() ), maskBorder );
 +}
  
  } // namespace NinePatchMaskEffect
  
@@@ -29,48 -29,41 +29,48 @@@ namespace Toolki
  {
  
  /**
 + * @brief Creates a new OverlayEffect
 + *
   * OverlayEffect is used to apply an overlay image to the actor.
   * Typically overlay images should be the same size as the main image being viewed, but this isn't essential.
   *
   * Usage example:
   *
   *   ImageActor actor = ImageActor::New( Image( EXAMPLE_IMAGE_PATH ) );
 - *   OverlayEffect overlayEffect = OverlayEffect::New( Image::New( OVERLAY_IMAGE_PATH ) );
 + *   ShaderEffect overlayEffect = CreateOverlayEffect( Image::New( OVERLAY_IMAGE_PATH ) );
   *   actor.SetShaderEffect( overlayEffect );
 + *
 + *   @param[in] overlayImage The image to overlay on top of the actor
 + *   @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API OverlayEffect : public ShaderEffect
 +inline ShaderEffect CreateOverlayEffect(Image overlayImage)
  {
 -public:
 -
 -  /**
 -   * Create an empty OverlayEffect handle.
 -   */
 -  OverlayEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~OverlayEffect();
 +  // (Target > 0.5) * (1 - (1-2*(Target-0.5)) * (1-Blend)) + (Target <= 0.5) * ((2*Target) * Blend)
 +  const char* OVERLAY_FRAGMENT_SHADER_SOURCE =
 +      "void main()\n"
 +      "{\n"
 +      "  lowp vec4 target = texture2D(sTexture, vTexCoord);\n"
 +      "  lowp vec4 overlay = texture2D(sEffect, vTexCoord);\n"
 +      "  if ( length( target.rgb ) > 0.5 )\n"
 +      "  {\n"
 +      "    gl_FragColor = vec4( mix( target.rgb, 1.0 - ( 1.0 - 2.0 * ( target.rgb - 0.5 ) )  * ( 1.0 - overlay.rgb ), overlay.a ), min( 1.0, target.a + overlay.a ) );\n"
 +      "  }\n"
 +      "  else\n"
 +      "  {\n"
 +      "    gl_FragColor = vec4( mix( target.rgb, 2.0 * target.rgb * overlay.rgb, overlay.a ), target.a + overlay.a );\n"
 +      "  }\n"
 +      "}\n";
  
 -  /**
 -   * Create a OverlayEffect.
 -   * @return A handle to a newly allocated OverlayEffect.
 -   */
 -  static OverlayEffect New( Image overlayImage );
 +  ShaderEffect shaderEffect = ShaderEffect::New(
 +      "", // Use default
 +      OVERLAY_FRAGMENT_SHADER_SOURCE,
 +      GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING ) );
  
 -private: // Not intended for application developers
 +  shaderEffect.SetEffectImage( overlayImage );
  
 -  DALI_INTERNAL OverlayEffect( ShaderEffect handle );
 -};
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -27,9 -27,7 +27,9 @@@ namespace Dal
  namespace Toolkit
  {
  /**
 - * @brief QuadraticBezier is a custom shader to render quadratic bezier curves and bounded regions.
 + * @brief Creates a new QuadraticBezier shader effect
 + *
 + * 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.
   * 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.
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uPoint"      - Position coordinates for the points in the curve
 + *  "uColor"      - The color of the curve or bounded region
 + *  "uLineWidth"  - The width of the path. Only for not filled curves
 + *
 + * @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 ShaderEffect
   */
 -
 -class DALI_IMPORT_API QuadraticBezier : public ShaderEffect
 +inline ShaderEffect CreateQuadraticBezier(unsigned int pointCount, bool filled)
  {
 -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);
 -
 -};
 +  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 shaderEffect = Dali::ShaderEffect::NewWithPrefix(
 +      vertexShaderPrefix.str(),vertexShader,
 +      "#extension GL_OES_standard_derivatives:enable\n", fragmentShader,
 +      GeometryType(GEOMETRY_TYPE_UNTEXTURED_MESH) );
 +
 +  //Set default uniform values
 +  shaderEffect.SetUniform( "uColor", Vector4(1.0f,1.0f,1.0f,1.0f) );
 +  if( !filled )
 +  {
 +    //Set default line widht to 1 pixel
 +    shaderEffect.SetUniform( "uLineWidth", 1.0f );
 +  }
 +
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,70 -28,81 +28,70 @@@ namespace Toolki
  {
  
  /**
 - * @brief RippleEffect is a custom shader effect to achieve ripple effects on Image actors.
 + * @brief Creates a new RippleEffect
 + *
 + * RippleEffect is a custom shader effect to achieve ripple effects on Image actors.
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uAmplitude"  - The amplitude of the effect
 + *  "uCenter"     - The center point of the effect as screen coordinates
 + *  "uTime"       - The time duration for the ripple
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API RippleEffect : public ShaderEffect
 +inline ShaderEffect CreateRippleEffect()
  {
 -public:
 -
 -  /**
 -   * @brief Create an uninitialized RippleEffect; this can be initialized with RippleEffect::New().
 -   *
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  RippleEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~RippleEffect();
 -
 -  /**
 -   * @brief Create an initialized RippleEffect.
 -   *
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static RippleEffect New();
 -
 -  /**
 -   * @brief Set the amplitude of the effect.
 -   *
 -   * @param [in] amplitude The new amplitude.
 -   */
 -  void SetAmplitude(float amplitude);
 -
 -  /**
 -   * @brief Set the center point of the effect as screen coordinates.
 -   *
 -   * @param [in] center The new center point.
 -   */
 -  void SetCenter(const Vector2& center);
 -
 -  /**
 -   * @brief Set the time duration for the ripple.
 -   *
 -   * @param[in] time The time duration in float.
 -   */
 -  void SetTime(float time);
 -
 -  /**
 -   * @brief Get the name for the amplitude property.
 -   *
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetAmplitudePropertyName() const;
 -
 -  /**
 -   * @brief Get the name for the center property.
 -   *
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetCenterPropertyName() const;
 -
 -  /**
 -   * @brief Get the name for the time property.
 -   *
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetTimePropertyName() const;
 -
 -private:
 -  DALI_INTERNAL RippleEffect(ShaderEffect handle);
 -
 -};
 +  std::string vertexShader(
 +      "precision mediump float;\n"
 +      "uniform mediump   vec2  uCenter;\n"
 +      "uniform mediump   float uTime;\n"
 +      "uniform mediump   float uAmplitude;\n"
 +      "varying mediump   float vLight;\n"
 +      "varying mediump   float vShade;\n"
 +      "void main()\n"
 +      "{\n"
 +      "float lighting = uAmplitude * 0.02;\n"
 +      "float waveLength = uAmplitude * 0.0016;\n"
 +      "vec4 world = uModelView * vec4(aPosition,1.0);\n"
 +      "vec2 d = vec2(world.x - uCenter.x, world.y - uCenter.y);\n"
 +      "float dist = length(d);\n"
 +      "float amplitude = cos(uTime - dist*waveLength);\n"
 +      "float slope     = sin(uTime - dist*waveLength);\n"
 +      "world.z += amplitude * uAmplitude;\n"
 +      "gl_Position = uProjection * world;\n"
 +      "vec2 lightDirection = vec2(-0.707,0.707);\n"
 +      "float dot = 0.0;\n"
 +      "if(dist > 0.0)\n"
 +      "{\n"
 +      "  dot = dot(normalize(d),lightDirection) * lighting;\n"
 +      "}\n"
 +      "vShade = 1.0 - (dot * slope);\n"
 +      "vLight = max(0.0, dot * -slope);\n"
 +      "vTexCoord = aTexCoord;\n"
 +      "}" );
 +
 +  // append the default version
 +  std::string imageFragmentShader(
 +      "precision mediump float;\n"
 +      "varying mediump float  vLight;\n"
 +      "varying mediump float  vShade;\n"
 +      "void main()\n"
 +      "{\n"
 +      "  gl_FragColor = texture2D(sTexture, vTexCoord) * uColor * vec4(vShade,vShade,vShade,1.0) + vec4(vLight, vLight, vLight,0.0);\n"
 +      "}" );
 +
 +
 +  Dali::ShaderEffect shaderEffect =  Dali::ShaderEffect::New(
 +      vertexShader, imageFragmentShader,
 +      GeometryType(GEOMETRY_TYPE_IMAGE), ShaderEffect::GeometryHints(ShaderEffect::HINT_GRID) );
 +
 +
 +  shaderEffect.SetUniform( "uAmplitude", 0.0f );
 +  shaderEffect.SetUniform( "uCenter", Vector2(0.0f, 0.0f));
 +  shaderEffect.SetUniform( "uTime", 0.0f );
 +
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,45 -28,66 +28,45 @@@ namespace Toolki
  {
  
  /**
 - * @brief Ripple2DEffect is a custom shader effect to achieve 2d ripple effects on Image actors.
 + * @brief Creates a new Ripple2DEffect
 + *
 + * Ripple2DEffect is a custom shader effect to achieve 2d ripple effects on Image actors.
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uTime"       - The time duration for the 2d ripple
 + *  "uAmplitude"  - The amplitude of the 2d ripple
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API Ripple2DEffect : public ShaderEffect
 +inline ShaderEffect CreateRipple2DEffect()
  {
 -public:
 -
 -  /**
 -   * @brief Create an uninitialized Ripple2DEffect; this can be initialized with Ripple2DEffect::New().
 -   *
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  Ripple2DEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~Ripple2DEffect();
 -
 -  /**
 -   * @brief Create an initialized Ripple2DEffect.
 -   *
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static Ripple2DEffect New();
 -
 -  /**
 -   * @brief Set the amplitude of the 2d ripple.
 -   *
 -   * @param[in] amplitude The amplitude in float.
 -   */
 -  void SetAmplitude(float amplitude);
 -
 -  /**
 -   * @brief Set the time duration for the 2d ripple.
 -   *
 -   * @param[in] time The time duration in float.
 -   */
 -  void SetTime(float time);
 -
 -  /**
 -   * @brief Get the name for the amplitude property.
 -   *
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetAmplitudePropertyName() const;
 -
 -  /**
 -   * @brief Get the name for the time property.
 -   *
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetTimePropertyName() const;
 -
 -private:
 -  DALI_INTERNAL Ripple2DEffect(ShaderEffect handle);
 -
 -};
 +  // append the default version
 +  std::string fragmentShader(
 +      "precision mediump float;\n"
 +      "uniform float uAmplitude;\n"
 +      "uniform float uTime;\n"
 +      "void main()\n"
 +      "{\n"
 +      "  highp vec2 textureSize = sTextureRect.zw - sTextureRect.xy;\n"
 +      "  highp vec2 pos = -1.0 + 2.0 * vTexCoord.st/textureSize;\n"
 +      "  highp float len = length(pos);\n"
 +      "  highp vec2 texCoord = vTexCoord.st/textureSize + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude;\n"
 +      "  gl_FragColor = texture2D(sTexture, texCoord) * uColor;\n"
 +      "}" );
 +
 +  Dali::ShaderEffect shaderEffect =  Dali::ShaderEffect::New(
 +      "", fragmentShader,
 +      Dali::GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING | ShaderEffect::HINT_GRID ));
 +
 +
 +
 +  shaderEffect.SetUniform( "uTextureSize", Vector2(0.0f, 0.0f) ); //@note: Is this needed?
 +  shaderEffect.SetUniform( "uAmplitude", 0.0f );
 +  shaderEffect.SetUniform( "uTime", 0.0f );
 +
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,51 -28,71 +28,51 @@@ namespace Toolki
  {
  
  /**
 + * @brief Creates a new ShearEffect
 + *
   * ShearEffect is a custom shader effect to achieve shear effects in Image actors
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uCenter"     - The center point of the shear effect in screen coordinates
 + *  "uAngleXAxis" - The angle of the shear effect in the X axis
 + *  "uAngleYAxis" - The angle of the shear effect in the Y axis
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API ShearEffect : public ShaderEffect
 +inline ShaderEffect CreateShearEffect()
  {
 -public:
 -
 -  /**
 -   * Create an uninitialized ShearEffect; this can be initialized with ShearEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  ShearEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~ShearEffect();
 -
 -  /**
 -   * Create an initialized ShearEffect.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static ShearEffect New();
 -
 -  /**
 -   * Set the center point of the shear effect in screen coordinates.
 -   * @param [in] center The new center point.
 -   */
 -  void SetCenter(const Vector2& center);
 -
 -  /**
 -   * Set the angle of the shear effect in the X axis.
 -   * @param [in] angle The new angle.
 -   */
 -  void SetAngleXAxis(float angle);
 -
 -  /**
 -   * Set the angle of the shear effect in the Y axis.
 -   * @param [in] angle The new angle.
 -   */
 -  void SetAngleYAxis(float angle);
 -
 -  /**
 -   * Get the name for the center property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetCenterPropertyName() const;
 -
 -  /**
 -   * Get the name for the X axis property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetAngleXAxisPropertyName() const;
 -
 -  /**
 -   * Get the name for the Y axis property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetAngleYAxisPropertyName() const;
 -
 -
 -private: // Not intended for application developers
 -  DALI_INTERNAL ShearEffect(ShaderEffect handle);
 -};
 +  // append the default version
 +  std::string vertexShader(
 +      "uniform mediump  vec2  uCenter;\n"
 +      "uniform mediump  float uAngleXAxis;\n"
 +      "uniform mediump  float uAngleYAxis;\n"
 +      "\n"
 +      "void main()\n"
 +      "{\n"
 +      "mediump vec4 world = uModelView * vec4(aPosition,1.0);\n"
 +      "\n"
 +      "world.x = world.x + tan(radians(uAngleXAxis)) * (world.y - uCenter.y * world.w);\n"
 +      "world.y = world.y + tan(radians(uAngleYAxis)) * (world.x - uCenter.x * world.w);\n"
 +      "\n"
 +      "gl_Position = uProjection * world;\n"
 +      "\n"
 +      "vTexCoord = aTexCoord;\n"
 +      "}" );
 +
 +  // Create the implementation, temporarily owned on stack,
 +  ShaderEffect shaderEffect =  Dali::ShaderEffect::New(
 +      vertexShader,
 +      "",
 +      Dali::GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_GRID ));
 +
 +
 +  shaderEffect.SetUniform( "uCenter", Vector2(0.0f, 0.0f), ShaderEffect::COORDINATE_TYPE_VIEWPORT_POSITION );
 +  shaderEffect.SetUniform( "uAngleXAxis", 0.0f);
 +  shaderEffect.SetUniform( "uAngleYAxis", 0.0f);
 +
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,15 -28,13 +28,15 @@@ namespace Toolki
  {
  
  /**
 + * @brief Creates a new soft button shader effect
   *
 - * Class for soft button shader that works on a per object basis. Using animatable parameters user can create effect of button pushing in / out. Can be applied to ImageActor only.
 + * Soft button shader effect works on a per object basis. Using animatable parameters user can create
 + * effect of button pushing in / out. Can be applied to ImageActor only.
   *
   * Usage example:-
   *
   * // Create shader used for doing soft button\n
 - * SoftButtonEffect softButtonEffect = SoftButtonEffect::New();
 + * ShaderEffect softButtonEffect = CreateSoftButtonEffect();
   *
   * // set image actor shader to the soft button one\n
   * ImageActor imageActor = ImageActor::New( ... );\n
   *
   * // animate a button push, using e.g. AlphaFunction::BOUNCE. With these values the button pushes in and pops out slightly at the end\n
   * Animation animation = Animation::New( ... );\n
 - * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetLightingIndentationAmountPropertyName()), 0.25f, AlphaFunction::BOUNCE, ... );\n
 - * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetLightingIndentationAmountPropertyName()), -0.05f, AlphaFunction::BOUNCE, ... );\n
 - * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetTextureDistortionAmountPropertyName()), 0.25f, AlphaFunction::BOUNCE, ... );\n
 - * animation.AnimateTo( Property(softButtonEffect, softButtonEffect.GetTextureDistortionAmountPropertyName()), -0.05f, AlphaFunction::BOUNCE, ... );\n
 + * animation.AnimateTo( Property(softButtonEffect, "uLightingIndentationAmount), 0.25f, AlphaFunction::BOUNCE, ... );\n
 + * animation.AnimateTo( Property(softButtonEffect, "uLightingIndentationAmount"), -0.05f, AlphaFunction::BOUNCE, ... );\n
 + * animation.AnimateTo( Property(softButtonEffect, "uTextureDistortAmount"), 0.25f, AlphaFunction::BOUNCE, ... );\n
 + * animation.AnimateTo( Property(softButtonEffect, "uTextureDistortAmount"), -0.05f, AlphaFunction::BOUNCE, ... );\n
   * animation.Play();\n
   *
 + * Animatable/Constrainable uniforms:
 + *
 + *  "uLightingIndentationAmount"  - This property changes the lighting, to make it look like the button is pushed in. User should animate
 + *                                  this in conjunction with texture distortion. Allowable values range from [-1..1], higher values give
 + *                                  more change in lighting. Default 0.0 (no lighting change).
 + *  "uTextureDistortAmount"       - This property changes the distortion, to make it look like the button is pushed in. User should animate
 + *                                  this in conjunction with lighting indentation. Allowable values range from [-1..1) - note 1.0 is NOT
 + *                                  allowed - higher values give more distortion. Default 0.0 (no distortion).
 + *  "uAmbientLight"               - The ambient light is used in the lighting calculation. Care must be taken to not saturate the image by
 + *                                  setting this value too high, or the indentation will not look correct. Default 0.15
 + *  "uDiffuseLight"               - The diffuse light is used in the lighting calculation. Default is (0.0, 0.7070168, 0.7070168),
 + *                                  i.e. a light angled at the surface from in front and above. Note that you need to Normalize()
 + *                                  the Vector3 that you set with this property
 + *  "uLightMultiplier"            - The ambient and diffuse lighting is multiplied by this factor. Since a diffuse light at an angle will
 + *                                  cause the whole image to darken, even outside the soft button indentation, this property can be used
 + *                                  to scale the image back up closer to the pixel values of the original diffuse texture. Care must be
 + *                                  taken to not saturate the image,or the indentation will not look correct. Default 1.2.
 + *  "uInsideCircleSizeScale"      - The SoftButtonEffect consists of two shapes, one inside the other. The outside shape fits exactly to
 + *                                  the actor, touching its edges but completely contained. The inside shape size is given by a multiplier
 + *                                  of the outside shape size. For example a value of 0.5 means that the inside shape is half the size of
 + *                                  the outside one. Allowable values are in the range (0.0 - 1.0), note that 0.0 and 1.0 themselves are
 + *                                  not allowed. Default 0.75.
 + *  "uOutsideCircleDepth"         - The SoftButtonEffect consists of two shapes, one inside the other. The depth of the indentation at the
 + *                                  transition between the inside and outside shapes is controlled by this property. The values lies in the
 + *                                  range [0.0 - 1.0]. A value of 0.0 means the outside shape has no depth (and is thus invisible), value of
 + *                                  1.0 means the outside shape has maximum depth (and the inside shape is thus invisible). Default 0.05
 + *  "uEffectRegion"               - The soft button effect is applied within the supplied rect region of the texture. Default values for this
 + *                                  is (0.0, 0.0, 1.0, 1.0) which is the entire image with 0,0 being the top left and 1.0, 1.0 being the bottom
 + *                                  right. If the image texture is split between multiple ImageActors then the developer should specify the pixel
 + *                                  area of the texture the effect should be applied with. Example, If the Image is split among two ImageActors
 + *                                  side by side, with the left one using left half of the texture and right one using the right half of the
 + *                                  texture then the pixel area value for the left ImageActor will be (0.0, 0.0, 0.5, 1.0) and the pixel area for
 + *                                  the right will be (0.5,0.0,1.0,1.0).
 + * "uRectangleSizeScale"          - This property can be used to set the mix between proportion of rectangle and proportion of ellipse - the
 + *                                  result is a rectangle with rounded corners. If the value is 0.0, the shape is an ellipse. If the value is
 + *                                  close to 1.0, the shape is close to a rectangle. The value lies in the range [0.0 - 1.0). Note that a value
 + *                                  of 1.0 is NOT allowed.Default 0.5.
 + *
 + * @param type The type of the soft button, can be either ELLIPTICAL, RECTANGULAR, or FIXED.
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API SoftButtonEffect : public ShaderEffect
 +typedef enum
  {
 +  SOFT_BUTTON_ELLIPTICAL = 0,   /// Button is elliptical
 +  SOFT_BUTTON_RECTANGULAR,      /// Button is rectangular
 +  SOFT_BUTTON_FIXED             /// Button does not indent (move). Useful for matching lighting between areas that do not indent (which can thus use a cheaper shader) and those that do indent.
 +}SoftButtonEffectType;
 +
 +static void InverseConstraint( float& current, const PropertyInputContainer& inputs )
 +{
 +  current = 1.0f / inputs[0]->GetFloat();
 +}
 +
 +inline ShaderEffect CreateSoftButtonEffect(SoftButtonEffectType type)
 +{
 +  std::string vertexSource;
 +  vertexSource =  "precision mediump float;\n"
 +      "uniform vec3 uDiffuseLight;\n"
 +      "uniform float uAmbientLight;\n"
 +      "uniform float uLightMultiplier;\n"
 +      "uniform vec4 uEffectRegion;\n"
 +      "varying vec2 vCentredCoord;\n"
 +
 +      "const vec3 norm = vec3(0.0, 0.0, 1.0);\n"
 +
 +      "void main()\n"
 +      "{\n"
 +      "  vTexCoord = aTexCoord;\n"
 +      // Get the rect coords of the effect region in -1..1 range, i.e. circle centred around the center of the rect
 +      // Done in the vertex shader itself to make use of gl interpolation for varying.
 +      "  vCentredCoord = vec2( ( (vTexCoord.x - uEffectRegion.x)/(uEffectRegion.z - uEffectRegion.x) * 2.0 - 1.0 ), ( (vTexCoord.y - uEffectRegion.y)/(uEffectRegion.w - uEffectRegion.y) * 2.0 - 1.0  ) );\n"
 +      "  gl_Position = uMvpMatrix * vec4(aPosition, 1.0);\n"
 +      "}\n";
 +
 +  std::string fragmentSourceFixed;
 +  fragmentSourceFixed =  "precision mediump float;\n"
 +
 +      "uniform vec3 uDiffuseLight;\n"
 +      "uniform float uAmbientLight;\n"
 +      "uniform float uLightMultiplier;\n"
 +      "varying vec2 vCentredCoord;\n"
 +
 +      "const vec3 norm = vec3(0.0, 0.0, 1.0);\n"
 +
 +      "void main()\n"
 +      "{\n"
 +      "   vec4 col = texture2D(sTexture, vTexCoord);\n"
 +      // calc lighting
 +      "   float lighting = (dot(uDiffuseLight, norm) + uAmbientLight) * uLightMultiplier;\n"
 +      // output col = image * light
 +      // use the lighting value for colors only
 +      "   gl_FragColor = vec4(col.rgb * uColor.rgb * lighting, col.a * uColor.a);\n"
 +      "}\n";
 +
 +  std::string fragmentSourceElliptical;
 +  fragmentSourceElliptical =  "precision mediump float;\n"
 +
 +      "uniform float uLightingIndentationAmount;\n"
 +      "uniform float uTextureDistortAmount;\n"
 +      "uniform vec3 uDiffuseLight;\n"
 +      "uniform float uAmbientLight;\n"
 +      "uniform float uLightMultiplier;\n"
 +      "uniform float uInsideCircleSizeScale;\n"
 +      "uniform float uRecipInsideCircleSizeScale;\n"
 +      "uniform float uOutsideCircleDepth;\n"
 +      "uniform vec4 uEffectRegion;\n"
 +      "varying vec2 vCentredCoord;\n"
 +
 +      "const float PI = 3.1415927;\n"
 +
 +      "void main()\n"
 +      "{\n"
 +      // Apply distortion only if the pixel is within the rect specified
 +      "if( (vTexCoord.x > uEffectRegion.x) && (vTexCoord.x < uEffectRegion.z) && (vTexCoord.y > uEffectRegion.y) && (vTexCoord.y < uEffectRegion.w) )\n"
 +      "{\n"
 +      "   vec2 coord = vCentredCoord;\n"
 +
 +      // find a coordinate representing distance from circle centre, such that we split into inside / outside circles that can have different gradients / normals
 +      "   float realDistFromCentre = length(coord);\n"
 +      "   realDistFromCentre = min(1.0, realDistFromCentre);\n" // clamp corners of square to vertical normal
 +      "   float distFromCentre;\n"
 +      "   if(realDistFromCentre <= uInsideCircleSizeScale)\n"
 +      "   {\n"
 +      "     distFromCentre = realDistFromCentre * uRecipInsideCircleSizeScale * (1.0 - uOutsideCircleDepth);\n" // inside circle indent, up to outline depth
 +      "   }\n"
 +      "   else                                                                                                                      \n"
 +      "   {\n"
 +      "     distFromCentre = mix(1.0 - uOutsideCircleDepth, 1.0, (realDistFromCentre - ( uInsideCircleSizeScale)) / (1.0 - uInsideCircleSizeScale));\n" // outside circle
 +      "   }\n"
  
 -public:
 +      // get coords in -PI..PI range, i.e. scale the circle for use by trig functions
 +      "  coord *= PI;\n"
  
 -  /**
 -   * Create an uninitialized SoftButtonEffect; this can be initialized with SoftButtonEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  SoftButtonEffect();
 +      // get a z value for the distorted surface in 0..1 range, using cos for a smooth curve (note, we ignore inside / outside circles since the difference isn't noticeable visually)
 +      "   vec2 cosThetaCoord = (cos(coord) * 0.5) + 0.5;\n"
 +      "   float z = cosThetaCoord.x * cosThetaCoord.y;\n"
  
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~SoftButtonEffect();
 +      // get the normal for the distorted surface, using the fact that the derivative of cos is -sin, finding tangent vector from slope and then normal by cross product...
 +      "   float sinThetaCoord = sin(distFromCentre*PI) * uLightingIndentationAmount;\n" // slope, so tangent vec is (1.0, -sin)
 +      // ...2D normal vector along distFromCentre vec is (sin, 1.0), convert to components in 3D.
 +      "   vec3 norm = normalize(vec3(coord.x * sinThetaCoord, coord.y * sinThetaCoord, 1.0));\n"
  
 -  typedef enum
 +      // form surface z and project texture onto it.
 +      "   float indentAmount = 1.0 / (1.0 - (z * uTextureDistortAmount));\n"
 +      "   vec2 distortedCoord = vCentredCoord * indentAmount;\n"
 +
 +      // Convert the rect coordinates in -1 to 1 range back to the original coordinates
 +      "   vec2 texCoord = vec2( ( (distortedCoord.x + 1.0)*(0.5) * (uEffectRegion.z - uEffectRegion.x) + uEffectRegion.x ), ( (distortedCoord.y + 1.0)*(0.5) * (uEffectRegion.w - uEffectRegion.y) + uEffectRegion.y  ) );  \n"
 +      "   vec4 col = texture2D(sTexture, texCoord);\n"
 +
 +      // calc lighting
 +      "   float lighting = (dot(uDiffuseLight, norm) + uAmbientLight) * uLightMultiplier;\n"
 +      "  gl_FragColor = vec4(col.rgb * uColor.rgb * lighting, col.a * uColor.a);\n"
 +      "}\n"
 +      "else\n"
 +      "{\n"
 +      "  vec4 col = texture2D(sTexture, vTexCoord);\n"
 +      "  float lighting = (dot(uDiffuseLight, vec3(0.0, 0.0, 1.0)) + uAmbientLight) * uLightMultiplier;\n"
 +      "  gl_FragColor = vec4(col.rgb * uColor.rgb * lighting, col.a * uColor.a);\n"
 +      "}\n"
 +      "}\n";
 +
 +  std::string fragmentSourceRectangular;
 +  fragmentSourceRectangular =  "precision mediump float;\n"
 +
 +      "uniform float uLightingIndentationAmount;\n"
 +      "uniform float uTextureDistortAmount;\n"
 +      "uniform vec3 uDiffuseLight;\n"
 +      "uniform float uAmbientLight;\n"
 +      "uniform float uLightMultiplier;\n"
 +      "uniform float uInsideCircleSizeScale;\n"
 +      "uniform float uRecipInsideCircleSizeScale;\n"
 +      "uniform float uOutsideCircleDepth;\n"
 +      "uniform float uRectangleSizeScale;\n"
 +      "uniform vec4 uEffectRegion;\n"
 +      "varying vec2 vCentredCoord;\n"
 +
 +      "const float PI = 3.1415927;\n"
 +
 +      "void main()\n"
 +      "{\n"
 +      // Apply distortion only if the pixel is within the rect specified
 +      "if( (vTexCoord.x > uEffectRegion.x) && (vTexCoord.x < uEffectRegion.z) && (vTexCoord.y > uEffectRegion.y) && (vTexCoord.y < uEffectRegion.w) )\n"
 +      "{ \n"
 +      // get the rect coords to -1..1 range, i.e. circle centred around the center of the rect
 +      "   vec2 centredCoord = vCentredCoord;\n"
 +      // clamp coords such that the circle is split into 4 pieces that lie in the corners of the actor. uRectangleScale is the distance along each axis from the centre
 +      // of the actor, e.g. 0.5 is half way along an axis from centre to actor edge.
 +      "   vec2 clampedCoord;\n"
 +      "   if(centredCoord.x > 0.0)\n"
 +      "   {\n"
 +      "     if(centredCoord.x < uRectangleSizeScale)\n"
 +      "     {\n"
 +      // we are in a rectangular region along this axis, clamp coord to be same as centre pixel
 +      "       clampedCoord.x = 0.0;\n"
 +      "     }\n"
 +      "     else\n"
 +      "     {\n"
 +      // we are outside rectangular region along this axis, so we want curvature.
 +      "       clampedCoord.x = smoothstep(0.0, 1.0, (centredCoord.x - uRectangleSizeScale) / (1.0 - uRectangleSizeScale));\n"
 +      "     }\n"
 +      "   }\n"
 +      "   else\n"
 +      "   {\n"
 +      "     if(centredCoord.x > -uRectangleSizeScale)\n"
 +      "     {\n"
 +      // we are in a rectangular region along this axis, clamp coord to be same as centre pixel
 +      "       clampedCoord.x = 0.0;\n"
 +      "     }\n"
 +      "     else\n"
 +      "     {\n"
 +      // we are outside rectangular region along this axis, so we want curvature.
 +      "       clampedCoord.x = -smoothstep(0.0, 1.0, (centredCoord.x + uRectangleSizeScale) / (uRectangleSizeScale - 1.0));\n"
 +      "     }\n"
 +      "   }\n"
 +      "   if(centredCoord.y > 0.0)\n"
 +      "   {\n"
 +      "     if(centredCoord.y < uRectangleSizeScale)\n"
 +      "     {\n"
 +      // we are in a rectangular region along this axis, clamp coord to be same as centre pixel
 +      "       clampedCoord.y = 0.0;\n"
 +      "     }\n"
 +      "     else\n"
 +      "     {\n"
 +      // we are outside rectangular region along this axis, so we want curvature.
 +      "       clampedCoord.y = smoothstep(0.0, 1.0, (centredCoord.y - uRectangleSizeScale) / (1.0 - uRectangleSizeScale));\n"
 +      "     }\n"
 +      "   }\n"
 +      "   else\n"
 +      "   {\n"
 +      "     if(centredCoord.y > -uRectangleSizeScale)\n"
 +      "     {\n"
 +      // we are in a rectangular region along this axis, clamp coord to be same as centre pixel
 +      "       clampedCoord.y = 0.0;\n"
 +      "     }\n"
 +      "     else\n"
 +      "     {\n"
 +      // we are outside rectangular region along this axis, so we want curvature.
 +      "       clampedCoord.y = -smoothstep(0.0, 1.0, (centredCoord.y + uRectangleSizeScale) / (uRectangleSizeScale - 1.0));\n"
 +      "     }\n"
 +      "   }\n"
 +      // get coords in -PI..PI range, i.e. scale above circle for use by trig functions
 +      "   vec2 thetaCoord = clampedCoord * PI;\n"
 +      // get a z value for the distorted surface in 0..1 range, using cos for a smooth curve (note, we ignore inside / outside circles since the difference isn't noticeable visually)
 +      "   vec2 cosThetaCoord = (cos(thetaCoord) * 0.5) + 0.5;\n"
 +      "   float z = cosThetaCoord.x * cosThetaCoord.y;\n"
 +      // find a coordinate representing distance from circle centre, such that we split into inside / outside circles that can have different gradients / normals
 +      "   float realDistFromCentre = length(thetaCoord);\n"
 +      "   realDistFromCentre = min(PI, realDistFromCentre);\n" // clamp corners of square to vertical normal
 +      "   float distFromCentre;\n"
 +      "   if(realDistFromCentre <= PI * uInsideCircleSizeScale)\n"
 +      "   {\n"
 +      "     distFromCentre = realDistFromCentre * uRecipInsideCircleSizeScale * (PI - (uOutsideCircleDepth * PI)) / PI;\n" // inside circle indent, up to outline depth
 +      "   }\n"
 +      "   else\n"
 +      "   {\n"
 +      "     distFromCentre = mix(PI - (uOutsideCircleDepth * PI), PI, (realDistFromCentre - ( PI * uInsideCircleSizeScale)) / (PI - (PI * uInsideCircleSizeScale)));\n" // outside circle
 +      "   }\n"
 +      // get the normal for the distorted surface, using the fact that the derivative of cos is -sin, finding tangent vector from slope and then normal by cross product...
 +      "   float sinThetaCoord = sin(distFromCentre) * uLightingIndentationAmount;\n" // slope, so tangent vec is (1.0, -sin)
 +      // ...2D normal vector along distFromCentre vec is (sin, 1.0), convert to components in 3D.
 +      "   vec3 norm = normalize(vec3(thetaCoord.x * sinThetaCoord, thetaCoord.y * sinThetaCoord, 1.0));\n"
 +      // form surface z and project texture onto it.
 +      "   float indentAmount = 1.0 / (1.0 - (z * uTextureDistortAmount));\n"
 +      "   vec2 distortedCoord = centredCoord * indentAmount;\n"
 +      // Convert the rect coordinates in -1 to 1 range back to the original coordinates
 +      "   vec2 texCoord = vec2( ( (distortedCoord.x + 1.0)/(2.0) * (uEffectRegion.z - uEffectRegion.x) + uEffectRegion.x ), ( (distortedCoord.y + 1.0)/(2.0) * (uEffectRegion.w - uEffectRegion.y) + uEffectRegion.y  ) );\n"
 +      "   vec4 col = texture2D(sTexture, texCoord);\n"
 +      // calc lighting
 +      "   float lighting = (dot(uDiffuseLight, norm) + uAmbientLight) * uLightMultiplier;\n"
 +      // output col = image * light
 +      // use the lighting value for colors only
 +      "   gl_FragColor = vec4(col.rgb * uColor.rgb * lighting, col.a * uColor.a);\n"
 +
 +      "}\n"
 +      "else\n"
 +      "{\n"
 +      "   vec4 col = texture2D(sTexture, vTexCoord);\n"
 +      "   float lighting = (dot(uDiffuseLight, vec3(0.0, 0.0, 1.0)) + uAmbientLight) * uLightMultiplier;\n"
 +      "   gl_FragColor = vec4(col.rgb * uColor.rgb * lighting, col.a * uColor.a);\n"
 +      "} \n"
 +      "}\n";
 +
 +
 +  //////////////////////////////////////
 +  // Create shader effectCreateSoftButtonEffect
 +  //
 +  //
 +
 +  ShaderEffect shader;
 +  switch(type)
    {
 -    ELLIPTICAL = 0,   /// Button is elliptical
 -    RECTANGULAR,      /// Button is rectangular
 -    FIXED             /// Button does not indent (move). Useful for matching lighting between areas that do not indent (which can thus use a cheaper shader) and those that do indent.
 -  }Type;
 -
 -  /**
 -   * Create an initialized SoftButtonEffect
 -   * @param type The type of the soft button, can be either ELLIPTICAL, RECTANGULAR, or FIXED.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static SoftButtonEffect New(Type type);
 -
 -  /**
 -   * Get the name for the lighting indentation amount property (float). Useful for animation.
 -   * This property changes the lighting, to make it look like the button is pushed in. User should animate this in conjunction
 -   * with texture distortion. Allowable values range from [-1..1], higher values give more change in lighting. Default 0.0 (no lighting change).
 -   * See also GetTextureDistortionAmountPropertyName().
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetLightingIndentationAmountPropertyName() const;
 -
 -  /**
 -   * Get the name for the texture distortion amount property (float). Useful for animation.
 -   * This property changes the distortion, to make it look like the button is pushed in. User should animate this is conjunction
 -   * with lighting indentation. Allowable values range from [-1..1) - note 1.0 is NOT allowed - higher values give more distortion. Default 0.0 (no distortion).
 -   * See also GetLightingIndentationAmountPropertyName().
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetTextureDistortionAmountPropertyName() const;
 -
 -  /**
 -   * Get the name for the ambient lighting amount property (float)
 -   * The ambient light is used in the lighting calculation. Care must be taken to not saturate the image by setting this value too high,
 -   * or the indentation will not look correct. Default 0.15.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetAmbientLightAmountPropertyName() const;
 -
 -  /**
 -   * Get the name for the diffuse light property (Vector3).
 -   * The diffuse light is used in the lighting calculation. Default is (0.0, 0.7070168, 0.7070168), i.e. a light angled at the surface from in front and above. Note that
 -   * you need to Normalize() the Vector3 that you set with this property.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetDiffuseLightPropertyName() const;
 -
 -  /**
 -   * Get the name for the lighting multiplier property (float).
 -   * The ambient and diffuse lighting is multiplied by this factor. Since a diffuse light at an angle will cause the whole image to darken, even outside the soft button
 -   * indentation, this property can be used to scale the image back up closer to the pixel values of the original diffuse texture. Care must be taken to not saturate the image,
 -   * or the indentation will not look correct. Default 1.2.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetLightingMultiplierPropertyName() const;
 -
 -  /**
 -   * Get the name for the inside shape size scale property (float).
 -   * The SoftButtonEffect consists of two shapes, one inside the other. The outside shape fits exactly to the actor, touching its edges but completely contained. The inside
 -   * shape size is given by a multiplier of the outside shape size. For example a value of 0.5 means that the inside shape is half the size of the outside one. Allowable
 -   * values are in the range (0.0 - 1.0), note that 0.0 and 1.0 themselves are not allowed. Default 0.75.
 -   * See also GetOutsideShapeDepthPropertyName().
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetInsideShapeSizeScalePropertyName() const;
 -
 -  /**
 -   * Get the name for the outside shape depth property (float).
 -   * The SoftButtonEffect consists of two shapes, one inside the other. The depth of the indentation at the transition between the inside and outside shapes is controlled by
 -   * this property. The values lies in the range [0.0 - 1.0]. A value of 0.0 means the outside shape has no depth (and is thus invisible), value of 1.0 means the outside shape
 -   * has maximum depth (and the inside shape is thus invisible). Default 0.05.
 -   * See also GetInsideShapeSizeScalePropertyName().
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetOutsideShapeDepthPropertyName() const;
 -
 -  /**
 -   * Get the name for the effect pixel area property (Vector4).
 -   * The soft button effect is applied within the supplied rect region of the texture. Default values for this is (0.0, 0.0, 1.0, 1.0) which is the entire image with
 -   * 0,0 being the top left and 1.0, 1.0 being the bottom right. If the image texture is split between multiple ImageActors then the developer should specify the
 -   * pixel area of the texture the effect should be applied with. Example, If the Image is split among two ImageActors side by side, with the left one using left half of the
 -   * texture and right one using the right half of the texture then the pixel area value for the left ImageActor will be (0.0, 0.0, 0.5, 1.0) and the pixel area for the right
 -   * will be (0.5, 0.0, 1.0, 1.0).
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetEffectPixelAreaPropertyName() const;
 -
 -  /**
 -   * Get the name for the rectangle size scale property (float). Only applicable having created this SoftButtonEffect via a call to New() with RECTANGULAR as the type.
 -   * This property can be used to set the mix between proportion of rectangle and proportion of ellipse - the result is a rectangle with rounded corners. If the value is 0.0,
 -   * the shape is an ellipse. If the value is close to 1.0, the shape is close to a rectangle. The value lies in the range [0.0 - 1.0). Note that a value of 1.0 is NOT allowed.
 -   * Default 0.5.
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetRectangleSizeScalePropertyName() const;
 -
 -
 -private:
 -  // Not intended for application developers
 -  DALI_INTERNAL SoftButtonEffect(ShaderEffect handle);
 -};
 +    case SOFT_BUTTON_RECTANGULAR:
 +      shader = ShaderEffect::New( vertexSource, fragmentSourceRectangular, GeometryType( GEOMETRY_TYPE_IMAGE ), ShaderEffect::GeometryHints( ShaderEffect::HINT_NONE ));
 +      break;
 +
 +    case SOFT_BUTTON_ELLIPTICAL:
 +      shader = ShaderEffect::New( vertexSource, fragmentSourceElliptical, GeometryType( GEOMETRY_TYPE_IMAGE ), ShaderEffect::GeometryHints( ShaderEffect::HINT_NONE ));
 +      break;
 +
 +    case SOFT_BUTTON_FIXED:
 +    default:
 +      shader = ShaderEffect::New( vertexSource, fragmentSourceFixed, GeometryType( GEOMETRY_TYPE_IMAGE ), ShaderEffect::GeometryHints( ShaderEffect::HINT_NONE ));
 +      break;
 +  }
 +
 +  //////////////////////////////////////
 +  // Register uniform properties
 +  //
 +  //
 +  static const float SOFT_BUTTON_LIGHTING_INDENTATION_AMOUNT_DEFAULT = 0.0f;
 +  static const float SOFT_BUTTON_TEXTURE_DISTORTION_AMOUNT_DEFAULT = 0.0f;
 +  static const float SOFT_BUTTON_AMBIENT_LIGHT_AMOUNT_DEFAULT = 0.15f;
 +  static const Vector3 SOFT_BUTTON_DIFFUSE_LIGHT_DEFAULT = Vector3(0.0f, 0.7070168f, 0.7071068f);
 +  static const float SOFT_BUTTON_LIGHTING_MULTIPLIER_DEFAULT = 1.2f;
 +  static const float SOFT_BUTTON_INSIDE_SHAPE_SIZE_SCALE_DEFAULT = 0.75f;
 +  static const float SOFT_BUTTON_OUTSIDE_SHAPE_DEPTH_DEFAULT = Math::PI * 0.05f;
 +  static const Vector4 SOFT_BUTTON_EFFECT_PIXEL_AREA_DEFAULT = Vector4(0.0f, 0.0f, 1.0f, 1.0f);
 +  static const float SOFT_BUTTON_RECTANGLE_SIZE_SCALE_DEFAULT = 0.5f;
 +
 +  // factors that scale the look, defaults
 +  shader.SetUniform("uAmbientLight", SOFT_BUTTON_AMBIENT_LIGHT_AMOUNT_DEFAULT);
 +  shader.SetUniform("uDiffuseLight", SOFT_BUTTON_DIFFUSE_LIGHT_DEFAULT);
 +  shader.SetUniform("uLightMultiplier", SOFT_BUTTON_LIGHTING_MULTIPLIER_DEFAULT);
 +  if(SOFT_BUTTON_FIXED != type)
 +  {
 +    shader.SetUniform("uLightingIndentationAmount", SOFT_BUTTON_LIGHTING_INDENTATION_AMOUNT_DEFAULT);
 +    shader.SetUniform("uTextureDistortAmount", SOFT_BUTTON_TEXTURE_DISTORTION_AMOUNT_DEFAULT);
 +    shader.SetUniform("uInsideCircleSizeScale", SOFT_BUTTON_INSIDE_SHAPE_SIZE_SCALE_DEFAULT);
 +    shader.SetUniform("uRecipInsideCircleSizeScale", 1.0f / SOFT_BUTTON_INSIDE_SHAPE_SIZE_SCALE_DEFAULT);
 +    shader.SetUniform("uOutsideCircleDepth", SOFT_BUTTON_OUTSIDE_SHAPE_DEPTH_DEFAULT);
 +    shader.SetUniform("uEffectRegion", SOFT_BUTTON_EFFECT_PIXEL_AREA_DEFAULT);
 +    if(SOFT_BUTTON_RECTANGULAR == type)
 +    {
 +      shader.SetUniform("uRectangleSizeScale", SOFT_BUTTON_RECTANGLE_SIZE_SCALE_DEFAULT);
 +    }
 +
 +    // precalc 1.0 / uInsideCircleSizeScale on CPU to save shader insns, using constraint to tie to the normal property
 +    Dali::Property::Index insideCircleSizeScalePropertyIndex = shader.GetPropertyIndex("uInsideCircleSizeScale");
 +    Dali::Property::Index recipInsideCircleSizeScalePropertyIndex = shader.GetPropertyIndex("uRecipInsideCircleSizeScale");
 +    Constraint constraint = Constraint::New<float>( shader, recipInsideCircleSizeScalePropertyIndex, InverseConstraint );
 +    constraint.AddSource( LocalSource(insideCircleSizeScalePropertyIndex) );
 +    constraint.Apply();
 +  }
 +
 +  return shader;
 +}
  
  }
  
@@@ -28,56 -28,58 +28,56 @@@ namespace Toolki
  {
  
  /**
 - * SpotEffect2D is a custom shader effect to achieve spot effects on Image actors
 + * @brief Creates a new SpotEffect
 + *
 + * SpotEffect is a custom shader effect to achieve spot effects on Image actors
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uCenter" - The center of the spot. Default value (0.0,0.0)
 + *  "uRadius" - The radius of the spot. Default value 0.0
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API SpotEffect : public ShaderEffect
 +inline ShaderEffect CreateSpotEffect()
  {
 -public:
 -
 -  /**
 -   * Create an uninitialized SpotEffect; this can be initialized with SpotEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  SpotEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~SpotEffect();
 -
 -  /**
 -   * Create an initialized SpotEffect.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static SpotEffect New();
 -
 -  /**
 -   * Set the center of the spot.
 -   * @param[in] center The center in Vector2.
 -   */
 -  void SetCenter(const Vector2& center);
 -
 -  /**
 -   * Set the radius of the spot.
 -   * @param[in] radius The radius in float.
 -   */
 -  void SetRadius(float radius);
 -
 -  /**
 -   * Get the name for the center property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetCenterPropertyName() const;
 -
 -  /**
 -   * Get the name for the radius property
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetRadiusPropertyName() const;
 -
 -private:
 -  DALI_INTERNAL SpotEffect(ShaderEffect handle);
 -};
 +  // append the default version
 +  std::string vertexShader(
 +      "uniform mediump   vec2  uCenter;\n"
 +      "uniform mediump   float  uRadius;\n"
 +      "varying mediump   float  vRange;\n"
 +      "\n"
 +      "void main()\n"
 +      "{\n"
 +      "  mediump vec4 world = vec4(aPosition, 1.0);\n"
 +      "  \n"
 +      "  mediump vec2 d = vec2(world.xy - uCenter);\n"
 +      "  mediump float dist = length(d);\n"
 +      "  \n"
 +      "  mediump float range = (uRadius - dist) / (uRadius);\n"
 +      "  vRange = max(0.1, range);\n"
 +      "  \n"
 +      "  gl_Position = uMvpMatrix * world;\n"
 +      "  vTexCoord = aTexCoord;\n"
 +      "}");
 +
 +  std::string fragmentShader(
 +      "varying mediump   float  vRange;\n"
 +      "\n"
 +      "void main()\n"
 +      "{\n"
 +      "  gl_FragColor = texture2D(sTexture, vTexCoord) * vec4(vRange, vRange, vRange, 1.0) * uColor;\n"
 +      "}" );
 +
 +  Dali::ShaderEffect shaderEffect =  Dali::ShaderEffect::New(
 +      vertexShader, fragmentShader,
 +      Dali::GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_GRID ));
 +
 +  shaderEffect.SetUniform( "uCenter", Vector2(0.0f, 0.0f) );
 +  shaderEffect.SetUniform( "uRadius", 0.0f );
 +
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,54 -28,86 +28,54 @@@ namespace Toolki
  {
  
  /**
 + * @brief Creates a new SquareDissolveEffect
 + *
   * SquareDissolveEffect is a custom shader effect to achieve square effects in Image actors
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uStep"       - The step of the square effect
 + *  "uRows"       - The rows of the square dissolve effect
 + *  "uColumns"    - The columns of the square dissolve effect
 + *  "uTextureSize"- The texture size of the square dissolve
 + *
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API SquareDissolveEffect : public ShaderEffect
 +inline ShaderEffect CreateSquareDissolveEffect()
  {
 -public:
 -
 -  /**
 -   * Create an uninitialized SquareDissolveEffect; this can be initialized with BendyEffect::New()
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  SquareDissolveEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~SquareDissolveEffect();
 -
 -  /**
 -   * Create an initialized SquareDissolveEffect.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static SquareDissolveEffect New();
 -
 -  /**
 -   * Set the step of the square effect.
 -   * @param [in] step the new step.
 -   */
 -  void SetStep(float step);
 -
 -  /**
 -   * Set the rows of the square dissolve effect.
 -   * @param [in] rows the new rows value.
 -   */
 -  void SetRows(float rows);
 -
 -  /**
 -   * Set the columns of the square dissolve effect.
 -   * @param [in] columns the new columns value.
 -   */
 -  void SetColumns(float columns);
 -
 -  /**
 -   * Set the texture size of the square dissolve.
 -   * @param[in] textureSize The texture size in Vector2.
 -   */
 -  void SetTextureSize(const Vector2& textureSize);
 -
 -  /**
 -   * Get the name for the step property
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetStepPropertyName() const;
 -
 -  /**
 -   * Get the name for the rows property
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetRowsPropertyName() const;
 -
 -  /**
 -   * Get the name for the columns property
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetColumnsPropertyName() const;
 -
 -  /**
 -   * Get the name for the texSize property
 -   * which can be used in Animation API's
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetTexSizePropertyName() const;
 -
 -private: // Not intended for application developers
 -  DALI_INTERNAL SquareDissolveEffect(ShaderEffect handle);
 -};
 +  // variable "uStep" range scope : [0.0, 1.0]
 +  std::string fragmentShader(
 +      "uniform  mediump vec2   uTextureSize;\n"
 +      "uniform  mediump float  uStep;\n"
 +      "uniform  mediump float  uRows;\n"
 +      "uniform  mediump float  uColumns;\n"
 +      "void main()\n"
 +      "{\n"
 +      "  mediump vec2 mosaicSize = vec2(1.0 / uRows, 1.0 / uColumns);                               \n"
 +      "  mediump vec2 intXY = vec2(vTexCoord.x * uTextureSize.x, vTexCoord.y * uTextureSize.y);               \n"
 +      "  mediump vec2 XYMosaic = vec2(floor(intXY.x / mosaicSize.x) * mosaicSize.x, floor(intXY.y / mosaicSize.y) * mosaicSize.y); \n"
 +      "  mediump vec2 UVMosaic = vec2(XYMosaic.x /uTextureSize.x, XYMosaic.y / uTextureSize.y);               \n"
 +      "  mediump vec4 noiseVec = texture2D(sEffect, UVMosaic);                                      \n"
 +      "  mediump float intensity = (noiseVec[0] + noiseVec[1] + noiseVec[2] + noiseVec[3]) / 4.0;   \n"
 +      "  if(intensity < uStep)                                                              \n"
 +      "    gl_FragColor = vec4(0.1, 0.1, 0.1, 1.0);                                         \n"
 +      "  else                                                                               \n"
 +      "    gl_FragColor = texture2D(sTexture, vTexCoord);                                   \n"
 +      "  gl_FragColor *= uColor;                                                            \n"
 +      "}                                                                                    \n" );
 +
 +  Dali::ShaderEffect shaderEffect =  Dali::ShaderEffect::New(
 +      "",
 +      fragmentShader,
 +      GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING | ShaderEffect::HINT_GRID ));
 +
 +  shaderEffect.SetUniform( "uTextureSize", Vector2(1.0f, 1.0f) );//COORDINATE_TYPE_DEFAULT
 +  shaderEffect.SetUniform( "uStep", 0.1f);
 +  shaderEffect.SetUniform( "uRows", 25.0f);
 +  shaderEffect.SetUniform( "uColumns", 25.0f);
 +
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -28,67 -28,79 +28,67 @@@ namespace Toolki
  {
  
  /**
 - * @brief SwirlEffect is a custom shader effect to achieve swirl effects in Image actors.
 + * @brief Creates a new SwirlEffect
 + *
 + * SwirlEffect is a custom shader effect to achieve swirl effects in Image actors.
 + *
 + * Animatable/Constrainable uniforms:
 + *  "uAngle"  - The angle of the swirl
 + *  "uCenter" - The center of the swirl
 + *  "uRadius" - The radius of the swirl
 + *
 + * @param[in] warp True if the effect should warp
 + * @return A handle to a newly allocated ShaderEffect
   */
 -class DALI_IMPORT_API SwirlEffect : public ShaderEffect
 +inline ShaderEffect CreateSwirlEffect( bool warp )
  {
 -public:
 -
 -  /**
 -   * @brief Create an uninitialized SwirlEffect; this can be initialized with SwirlEffect::New().
 -   *
 -   * Calling member functions with an uninitialized Dali::Object is not allowed.
 -   */
 -  SwirlEffect();
 -
 -  /**
 -   * @brief Destructor
 -   *
 -   * This is non-virtual since derived Handle types must not contain data or virtual methods.
 -   */
 -  ~SwirlEffect();
 -
 -  /**
 -   * @brief Create an initialized SwirlEffect.
 -   *
 -   * @param[in] warp True if the effect should warp.
 -   * @return A handle to a newly allocated Dali resource.
 -   */
 -  static SwirlEffect New(bool warp);
 -
 -  /**
 -   * @brief Set the angle of the swirl.
 -   *
 -   * @param[in] angle The angle in float.
 -   */
 -  void SetAngle(float angle);
 -
 -  /**
 -   * @brief Set the center of the swirl.
 -   *
 -   * @param[in] center The center in Vector2.
 -   */
 -  void SetCenter(const Vector2& center);
 -
 -  /**
 -   * @brief Set the radius of the swirl.
 -   *
 -   * @param[in] radius The radius in float.
 -   */
 -  void SetRadius(float radius);
 -
 -  /**
 -   * @brief Get the name for the angle property.
 -   *
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetAnglePropertyName() const;
 -
 -  /**
 -   * @brief Get the name for the center property.
 -   *
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetCenterPropertyName() const;
 -
 -  /**
 -   * @brief Get the name for the radius property.
 -   *
 -   * @return A std::string containing the property name
 -   */
 -  const std::string& GetRadiusPropertyName() const;
 -
 -private: // Not intended for application developers
 -  DALI_INTERNAL SwirlEffect(ShaderEffect handle);
 -};
 +  // append the default version
 +  std::string fragmentShader(
 +      "uniform mediump vec2  uTextureSize;\n"
 +      "uniform highp float uRadius;\n"
 +      "uniform highp float uAngle;\n"
 +      "uniform mediump vec2  uCenter;\n"
 +      "void main()\n"
 +      "{\n"
 +      "  highp vec2 textureCenter = (sTextureRect.xy + sTextureRect.zw) * 0.5;\n"
 +      "  textureCenter = vTexCoord.st - textureCenter;\n"
 +      "  highp float distance = length(textureCenter);\n"
 +      "  if (distance >= uRadius)\n"
 +      "     discard;\n"
 +      "  highp float percent = (uRadius - distance) / uRadius;\n"
 +      "  highp float theta = percent * percent * uAngle * 4.0;\n"
 +      "  highp float sinTheta = sin(theta);\n"
 +      "  highp float cosTheta = cos(theta);\n" );
 +  // if warp, loose the sign from sin
 +  if( warp )
 +  {
 +    fragmentShader.append(
 +        "  textureCenter = vec2( dot( textureCenter, vec2(cosTheta, sinTheta) ), "
 +        "                        dot( textureCenter, vec2(sinTheta, cosTheta) ) );\n" );
 +  }
 +  else
 +  {
 +    fragmentShader.append(
 +        "  textureCenter = vec2( dot( textureCenter, vec2(cosTheta, -sinTheta) ), "
 +        "                        dot( textureCenter, vec2(sinTheta, cosTheta) ) );\n" );
 +  }
 +  fragmentShader.append(
 +      "  textureCenter += uCenter;\n"
 +      "  gl_FragColor = texture2D( sTexture, textureCenter ) * uColor;\n"
 +      "}" );
 +
 +  Dali::ShaderEffect shaderEffect =  Dali::ShaderEffect::New(
 +      "",
 +      fragmentShader,
 +      Dali::GeometryType( GEOMETRY_TYPE_IMAGE ),
 +      ShaderEffect::GeometryHints( ShaderEffect::HINT_BLENDING | ShaderEffect::HINT_GRID ));
 +
 +  shaderEffect.SetUniform( "uAngle", 0.0f );
 +  shaderEffect.SetUniform( "uCenter", Vector2(0.5f, 0.5f) );
 +  shaderEffect.SetUniform( "uRadius", 1.0f );
 +
 +  return shaderEffect;
 +}
  
  } // namespace Toolkit
  
@@@ -20,7 -20,6 +20,6 @@@
  
  // EXTERNAL INCLUDES
  #include <sys/stat.h>
- #include <boost/function.hpp>
  #include <sstream>
  #include <dali/public-api/render-tasks/render-task-list.h>
  #include <dali/public-api/object/type-info.h>
  #include <dali/public-api/actors/image-actor.h>
  #include <dali/public-api/actors/camera-actor.h>
  #include <dali/devel-api/scripting/scripting.h>
+ #include <dali/public-api/signals/functor-delegate.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>
@@@ -56,8 -56,8 +56,8 @@@ extern bool SetPropertyFromNode( const 
  extern bool SetPropertyFromNode( const TreeNode& node, Property::Value& value, const Replacement& replacements );
  extern bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value );
  extern bool SetPropertyFromNode( const TreeNode& node, Property::Type type, Property::Value& value, const Replacement& replacements );
- extern Actor SetupSignalAction(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor, boost::function<void (void)> quitAction, Dali::Toolkit::Internal::Builder* const builder);
- extern Actor SetupPropertyNotification(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor, boost::function<void (void)> quitAction, Dali::Toolkit::Internal::Builder* const builder);
+ extern Actor SetupSignalAction(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor, Dali::Toolkit::Internal::Builder* const builder);
+ extern Actor SetupPropertyNotification(ConnectionTracker* tracker, const TreeNode &root, const TreeNode &child, Actor actor, Dali::Toolkit::Internal::Builder* const builder);
  extern Actor SetupActor( const TreeNode& node, Actor& actor, const Replacement& constant );
  
  #if defined(DEBUG_ENABLED)
@@@ -217,22 -217,6 +217,6 @@@ void CollectAllStyles( const TreeNode& 
    }
  }
  
- struct QuitAction
- {
- public:
-   QuitAction( Builder& builder )
-   : mBuilder( builder )
-   {
-   }
-   void operator()(void)
-   {
-     mBuilder.EmitQuitSignal();
-   }
- private:
-   Builder& mBuilder;
- };
  
  } // namespace anon
  
@@@ -279,7 -263,7 +263,7 @@@ void Builder::SetProperties( const Tree
        // special field 'effect' references the shader effect instances
        if(key == "effect")
        {
 -        RenderableActor actor = RenderableActor::DownCast(handle);
 +        ImageActor actor = ImageActor::DownCast(handle);
          if( actor )
          {
            OptionalString str = constant.IsString( keyChild.second );
  
        if( Property::INVALID_INDEX == index )
        {
 -        RenderableActor actor = RenderableActor::DownCast(handle);
 +        ImageActor actor = ImageActor::DownCast(handle);
          if( actor )
          {
            if( ShaderEffect effect = actor.GetShaderEffect() )
@@@ -361,9 -345,8 +345,8 @@@ void Builder::ApplyProperties( const Tr
        SetupActor( node, actor, constant );
  
        // add signals
-       QuitAction quitAction( *this );
-       SetupSignalAction( mSlotDelegate.GetConnectionTracker(), root, node, actor, quitAction, this );
-       SetupPropertyNotification( mSlotDelegate.GetConnectionTracker(), root, node, actor, quitAction, this );
+       SetupSignalAction( mSlotDelegate.GetConnectionTracker(), root, node, actor, this );
+       SetupPropertyNotification( mSlotDelegate.GetConnectionTracker(), root, node, actor, this );
     }
    }
    else
@@@ -2,7 -2,7 +2,7 @@@
  #define __DALI_TOOLKIT_INTERNAL_BUBBLE_EMITTER_IMPL_H__
  
  /*
 - * Copyright (c) 2014 Samsung Electronics Co., Ltd.
 + * Copyright (c) 2015 Samsung Electronics Co., Ltd.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
  // EXTERNAL INCLUDES
  #include <dali/public-api/actors/camera-actor.h>
  #include <dali/public-api/actors/image-actor.h>
 -#include <dali/devel-api/actors/mesh-actor.h>
  #include <dali/public-api/common/stage.h>
 +#include <dali/public-api/geometry/geometry.h>
  #include <dali/public-api/images/frame-buffer-image.h>
 -#include <dali/devel-api/geometry/mesh.h>
  #include <dali/public-api/render-tasks/render-task.h>
 +#include <dali/public-api/shader-effects/sampler.h>
 +#include <dali/public-api/shader-effects/material.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/devel-api/controls/bubble-effect/bubble-emitter.h>
 -#include <dali-toolkit/devel-api/shader-effects/bubble-effect/bubble-effect.h>
  
  namespace Dali
  {
@@@ -41,9 -41,6 +41,9 @@@ namespace Toolki
  namespace Internal
  {
  
 +class BubbleActor;
 +typedef IntrusivePtr<BubbleActor> BubbleActorPtr;
 +
  /**
   * BubbleEmitter implementation class.
   */
@@@ -100,6 -97,11 +100,6 @@@ public
    void EmitBubble( Animation& animation, const Vector2& emitPosition, const Vector2& direction, const Vector2& displacement );
  
    /**
 -   * @copydoc Toolkit::BubbleEmitter::StartExplosion
 -   */
 -  void StartExplosion( float duration, float multiple );
 -
 -  /**
     * @copydoc Toolkit::BubbleEmitter::Restore
     */
    void Restore();
@@@ -125,13 -127,6 +125,13 @@@ private
    void OnInitialize();
  
    /**
 +   * Create the geometry of a mesh.
 +   * @param[in] numOfPatch The triangle number in the mesh is 2*numOfPatch; two triangles for each bubble.
 +   * @return The mesh geometry.
 +   */
 +  Geometry CreateGeometry( unsigned int numOfPatch );
 +
 +  /**
     * Callback function of the finished signal of off-screen render task.
     * @param[in] source The render task used to create the color adjusted background image.
     */
    void OnContextRegained();
  
    /**
 -   * Generate the material object which is attached to the meshActor to describe its color, texture, texture mapping mode etc.
 -   */
 -  void GenMaterial();
 -
 -  /**
 -   * Add a vertex to the mesh data.
 -   * @param[in] vertices The collection of vertices.
 -   * @param[in] XYZ The vertex position coordinates.
 -   * @param[in] UV The vertex texture coordinate.
 -   */
 -  void AddVertex(MeshData::VertexContainer& vertices, Vector3 XYZ, Vector2 UV);
 -
 -  /**
 -   * Add a triangle to the mesh data.
 -   * @param[in] faces The collection od FaceIndex items.
 -   * @param[in] v0 The index of the first point of the triangle.
 -   * @param[in] v1 The index of the second point of the triangle.
 -   * @param[in] v3 The index of the first point of the triangle.
 -   */
 -  void AddTriangle(MeshData::FaceIndices& faces,size_t v0, size_t v1, size_t v2);
 -
 -  /**
 -   * Create a new mesh.
 -   * @param[in] meshData The MeshData object which encompasses all the data required to describe and render the 3D mesh.
 -   * @param[in] numberOfBubble The triangle number in the meshData is 2*numOfBubble; two triangles for each bubble
 -   */
 -  void ConstructBubbleMesh( MeshData& meshData, unsigned int numOfBubble);
 -
 -  /**
 -   * Set the uniform values to the shader effect to emit a bubble
 -   * @param[in] effect The BubbleEffect to render the current bubble
 -   * @param[in] curUniform The index of the uniform array in the shader
 -   * @param[in] emitPosition The start position of the bubble movement.
 -   * @param[in] displacement The displacement used to bound the moving distance of the bubble.
 -   */
 -  void SetBubbleParameter( BubbleEffect& effect, unsigned int curUniform,
 -                           const Vector2& emitPosition, const Vector2& displacement );
 -
 -  /**
     * Set the uniform values to the shader effect to emit a bubble
 -   * @param[in] effect The BubbleEffect to render the current bubble
 +   * @param[in] bubbleActor The BubbleActor to render the current bubble
     * @param[in] curUniform The index of the uniform array in the shader
     * @param[in] emitPosition The start position of the bubble movement.
     * @param[in] direction The direction used to constrain the bubble to move in an adjacent direction around it.
     * @param[in] displacement The displacement used to bound the moving distance of the bubble.
     */
 -  void SetBubbleParameter( BubbleEffect& effect, unsigned int curUniform,
 +  void SetBubbleParameter( BubbleActorPtr bubbleActor, unsigned int curUniform,
                             const Vector2& emitPosition, const Vector2& direction, const Vector2& displacement );
  
 -  /**
 -   * Callback function of the explosion animation finished signal to reset the shader parameters
 -   * @param[in] source The explosion animation.
 -   */
 -  void OnExplosionFinished( Animation& source );
 -
 -  /**
 -   * Return a random value between the given interval.
 -   * @param[in] f0 The low bound
 -   * @param[in] f1 The up bound
 -   * @return A random value between the given interval
 -   */
 -  float RandomRange(float f0, float f1);
 -
  private:
  
 -  Vector2                     mMovementArea;        ///< The size of the bubble moving area, usually the same size as the background image actor.
 -  Image                       mShapeImage;          ///< The alpha channnel of this texture defines the bubble shape.
    Actor                       mBubbleRoot;          ///<The bubble root actor. Need to add it to stage to get the bubbles rendered.
 -
 -  unsigned int                mNumBubblePerShader;  ///< How many bubbles for each BubbleEffect shader.
 -  unsigned int                mNumShader;           ///< How many BubbleEffect shaders are used.
 -  unsigned int                mTotalNumOfBubble;    ///< mNumBubblePerShader*mNumShader.
 -  bool                        mRenderTaskRunning;   ///< If the background render task is currently running
 -
 -  Vector2                     mBubbleSizeRange;     ///< The bubble size range.
 -
 -  std::vector<Mesh>           mMesh;                ///< The mesh vector, each mesh is used to create a meshActor which applies a BubbleEffect.
 -  std::vector<MeshActor>      mMeshActor;           ///< The meshActor vector, its size is mNumShader.
 -  MeshActor                   mMeshActorForNoise;   ///< An Extra mesh data to emit bubbles which emit bubble in totally random angle.
 -  Material                    mCustomMaterial;      ///< The material object which is attached to the meshActor to describe its color, texture, texture mapping mode etc.
 -
 -  std::vector<BubbleEffect>   mEffect;              ///< The bubbleEffect vector, corresponding to the mMeshActoe vector.
 -  BubbleEffect                mEffectForNoise;      ///< The extra bubbleEffect, corresponding to the mMeshActorForNoise.
 -
 -  unsigned int                mCurrentUniform;      ///< Keep track of the uniform index for the newly emitted bubble
 -
 -  Vector3                     mHSVDelta;            ///< The HSV difference used to adjust the background image color.
 +  Image                       mShapeImage;          ///< The alpha channnel of this texture defines the bubble shape.
    Image                       mBackgroundImage;     ///< The original background image
    FrameBufferImage            mEffectImage;         ///< The image stores the adjusted color of the background image.The bubbles pick color from this image.
    CameraActor                 mCameraActor;         ///< The render task views the scene from the perspective of this actor.
  
 +  Sampler                     mSamplerBackground;    ///< The sampler which provides the background image to material
 +  Sampler                     mSamplerBubbleShape;   ///< The sampler which provides the bubble shape image to material
 +  Geometry                    mMeshGeometry;         ///< The mesh geometry which contains the vertices and indices data
 +  Material                    mMaterial;             ///< The material which controls the bubble display
 +  std::vector<BubbleActorPtr> mBubbleActors;         ///< The meshActor vector, its size is mNumShader.
 +
 +  Vector2                     mMovementArea;        ///< The size of the bubble moving area, usually the same size as the background image actor.
 +  Vector2                     mBubbleSizeRange;     ///< The size range of the bubbles; x component is the low bound, and y component is the up bound.
 +  Vector3                     mHSVDelta;            ///< The HSV difference used to adjust the background image color.
 +
 +  unsigned int                mNumBubblePerActor;   ///< How many bubbles for each BubbleActor.
 +  unsigned int                mNumActor;            ///< How many BubbleActors are used.
    unsigned int                mDensity;             ///< How many bubbles will emit at each time, they are controlled by same uniforms in the shader.
 +  unsigned int                mTotalNumOfBubble;    ///< mNumBubblePerShader*mNumShader.
 +  unsigned int                mCurrentBubble;       ///< Keep track of the index for the newly emitted bubble
 +
 +  bool                        mRenderTaskRunning;   ///< If the background render task is currently running
  
  };
  
@@@ -22,9 -22,6 +22,9 @@@
  #include <dali/public-api/actors/image-actor.h>
  #include <dali/public-api/object/type-registry.h>
  
- #include <dali-toolkit/public-api/shader-effects/image-region-effect.h>
 +//INTERNAL INCLUDES
++#include <dali-toolkit/devel-api/shader-effects/image-region-effect.h>
 +
  namespace Dali
  {
  
@@@ -233,13 -230,13 +233,13 @@@ void CheckBoxButton::StartTransitionAni
      if( !mTickUVEffect )
      {
        ImageActor imageActor = ImageActor::DownCast( actor );
 -      mTickUVEffect = ImageRegionEffect::New();
 +      mTickUVEffect = CreateImageRegionEffect();
        imageActor.SetShaderEffect( mTickUVEffect );
      }
  
      actor.SetScale( Vector3( 0.0f, 1.0f, 1.0f ) );
  
 -    mTickUVEffect.SetBottomRight( Vector2( 0.0f, 1.0f ) );
 +    mTickUVEffect.SetUniform("uBottomRight", Vector2( 0.0f, 1.0f ) );
  
      if( !mTransitionAnimation )
      {
      }
  
      // UV anim
 -    mTransitionAnimation.AnimateTo( Property( mTickUVEffect, mTickUVEffect.GetBottomRightPropertyName() ), Vector2( 1.0f, 1.0f ) );
 +    mTransitionAnimation.AnimateTo( Property( mTickUVEffect, "uBottomRight" ), Vector2( 1.0f, 1.0f ) );
  
      // Actor size anim
      mTransitionAnimation.AnimateTo( Property( actor, Actor::Property::SCALE_X ), 1.0f );
  // EXTERNAL INCLUDES
  #include <dali/public-api/common/dali-vector.h>
  #include <dali/public-api/animation/animation.h>
 +#include <dali/public-api/shader-effects/shader-effect.h>
 +
  
  // INTERNAL INCLUDES
  #include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
+ #include <dali-toolkit/devel-api/shader-effects/image-region-effect.h>
  
  #include "button-impl.h"
  
@@@ -125,7 -124,7 +126,7 @@@ private
  
  private:
    Animation                 mTransitionAnimation;  ///< Animation used in the state transitions.
 -  ImageRegionEffect         mTickUVEffect;         ///< ImageRegionEffect to expand the tick across
 +  ShaderEffect              mTickUVEffect;         ///< ImageRegionEffect to expand the tick across
  };
  
  } // namespace Internal
@@@ -1,5 -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.
@@@ -28,8 -28,6 +28,8 @@@
  
  // INTERNAL INCLUDES
  #include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 +#include <dali-toolkit/internal/controls/page-turn-view/page-turn-effect.h>
 +#include <dali-toolkit/internal/controls/page-turn-view/page-turn-book-spine-effect.h>
  
  using namespace Dali;
  
@@@ -297,26 -295,26 +297,26 @@@ PageTurnView::~PageTurnView(
  void PageTurnView::OnInitialize()
  {
     // create the two book spine effect for static images, left and right side pages respectively
 -  mSpineEffectFront = PageTurnBookSpineEffect::New();
 -  mSpineEffectFront.SetIsBackImageVisible( false );
 -  mSpineEffectFront.SetPageWidth( mPageSize.width );
 -  mSpineEffectFront.SetShadowWidth( 0.f );
 -  mSpineEffectFront.SetSpineShadowParameter( mSpineShadowParameter );
 -
 -  mSpineEffectBack = PageTurnBookSpineEffect::New();
 -  mSpineEffectBack.SetIsBackImageVisible( true );
 -  mSpineEffectBack.SetPageWidth( mPageSize.width );
 -  mSpineEffectBack.SetShadowWidth( 0.f );
 -  mSpineEffectBack.SetSpineShadowParameter( mSpineShadowParameter );
 +  mSpineEffectFront = CreatePageTurnBookSpineEffect();
 +  mSpineEffectFront.SetUniform("uIsBackImageVisible", false );
 +  mSpineEffectFront.SetUniform("uPageWidth", mPageSize.width );
 +  mSpineEffectFront.SetUniform("uShadowWidth", 0.f );
 +  mSpineEffectFront.SetUniform("uSpineShadowParameter", mSpineShadowParameter );
 +
 +  mSpineEffectBack = CreatePageTurnBookSpineEffect();
 +  mSpineEffectBack.SetUniform("uIsBackImageVisible", true );
 +  mSpineEffectBack.SetUniform("uPageWidth", mPageSize.width );
 +  mSpineEffectBack.SetUniform("uShadowWidth", 0.f );
 +  mSpineEffectBack.SetUniform("uSpineShadowParameter", mSpineShadowParameter );
  
    // create the page turn effect objects
    for( int i = 0; i < MAXIMUM_TURNING_NUM; i++ )
    {
 -    mTurnEffect[i] = Toolkit::PageTurnEffect::New( false );
 +    mTurnEffect[i] = CreatePageTurnEffect( false );
      mTurnEffect[i].SetProperty( ShaderEffect::Property::GRID_DENSITY, Property::Value( DEFAULT_GRID_DENSITY ) );
 -    mTurnEffect[i].SetPageSize( mPageSize );
 -    mTurnEffect[i].SetShadowWidth(0.f);
 -    mTurnEffect[i].SetSpineShadowParameter( mSpineShadowParameter );
 +    mTurnEffect[i].SetUniform( "uPageSize", mPageSize );
 +    mTurnEffect[i].SetUniform( "uShadowWidth", 0.f);
 +    mTurnEffect[i].SetUniform( "uSpineShadowParameter", mSpineShadowParameter );
      mIsAnimating[i] = false;
      mIsSliding[i] = false;
      mPropertyPanDisplacement[i] = Self().RegisterProperty("PAN_DISPLACEMENT_PROPERTY_"+i, 0.0f);
@@@ -425,13 -423,13 +425,13 @@@ void PageTurnView::SetupShadowView(
    mShadowView.Activate();
  }
  
- void PageTurnView::OnControlStageConnection()
+ void PageTurnView::OnStageConnection()
  {
    SetupShadowView();
    mTurningPageLayer.RaiseToTop();
  }
  
- void PageTurnView::OnControlStageDisconnection()
+ void PageTurnView::OnStageDisconnection()
  {
    if(mShadowView)
    {
    }
  }
  
- 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;
  
    // set spine shadow parameter to all the shader effects
 -  mSpineEffectFront.SetSpineShadowParameter( mSpineShadowParameter );
 -  mSpineEffectBack.SetSpineShadowParameter( mSpineShadowParameter );
 +  mSpineEffectFront.SetUniform("uSpineShadowParameter", mSpineShadowParameter );
 +  mSpineEffectBack.SetUniform("uSpineShadowParameter", mSpineShadowParameter );
    for( int i = 0; i < MAXIMUM_TURNING_NUM; i++ )
    {
 -    mTurnEffect[i].SetSpineShadowParameter( mSpineShadowParameter );
 +    mTurnEffect[i].SetUniform("uSpineShadowParameter", mSpineShadowParameter );
    }
  }
  
@@@ -756,7 -748,7 +750,7 @@@ void PageTurnView::PanStarted( const Ve
    }
  
    mOriginalCenter = gesturePosition;
 -  mTurnEffect[mIndex].SetIsTurningBack( mIsTurnBack[ mPanActor] );
 +  mTurnEffect[mIndex].SetUniform("uIsTurningBack", mIsTurnBack[ mPanActor] );
    mPress = false;
    mPageUpdated = false;
  
@@@ -793,9 -785,9 +787,9 @@@ void PageTurnView::PanContinuing( cons
        mDistanceBottomCorner = ( mOriginalCenter - Vector2( 0.0f, mPageSize.height ) ).Length();
        mShadowView.Add( mPanActor );
        SetShaderEffect( mPanActor, mTurnEffect[mIndex] );
 -      mTurnEffect[mIndex].SetOriginalCenter( mOriginalCenter );
 +      mTurnEffect[mIndex].SetUniform("uOriginalCenter", mOriginalCenter );
        mCurrentCenter = mOriginalCenter;
 -      mTurnEffect[mIndex].SetCurrentCenter( mCurrentCenter );
 +      mTurnEffect[mIndex].SetUniform("uCurrentCenter", mCurrentCenter );
        mPanDisplacement = 0.f;
        mConstraints = true;
        mPress = true;
        self.SetProperty( mPropertyPanDisplacement[mIndex], 0.f );
  
        Constraint shadowBlurStrengthConstraint = Constraint::New<float>( mShadowView, mShadowView.GetBlurStrengthPropertyIndex(), ShadowBlurStrengthConstraint( mPageSize.width*PAGE_TURN_OVER_THRESHOLD_RATIO ) );
 -      shadowBlurStrengthConstraint.AddSource( Source(mTurnEffect[mIndex],  mTurnEffect[mIndex].GetPropertyIndex(mTurnEffect[mIndex].PageTurnEffect::GetCurrentCenterPropertyName())) );
 -      shadowBlurStrengthConstraint.AddSource( Source(mTurnEffect[mIndex],  mTurnEffect[mIndex].GetPropertyIndex(mTurnEffect[mIndex].PageTurnEffect::GetOriginalCenterPropertyName())) );
 +      shadowBlurStrengthConstraint.AddSource( Source(mTurnEffect[mIndex],  mTurnEffect[mIndex].GetPropertyIndex("uCurrentCenter")) );
 +      shadowBlurStrengthConstraint.AddSource( Source(mTurnEffect[mIndex],  mTurnEffect[mIndex].GetPropertyIndex("uOriginalCenter")) );
        shadowBlurStrengthConstraint.AddSource( Source( self, mPropertyPanDisplacement[mIndex] ) );
        shadowBlurStrengthConstraint.Apply();
      }
          offset *= k;
          Actor self = Self();
  
 -        Property::Index shaderOriginalCenterPropertyIndex = mTurnEffect[mIndex].GetPropertyIndex(mTurnEffect[mIndex].PageTurnEffect::GetOriginalCenterPropertyName());
 +        Property::Index shaderOriginalCenterPropertyIndex = mTurnEffect[mIndex].GetPropertyIndex("uOriginalCenter");
          Constraint originalCenterConstraint = Constraint::New<Vector2>( mTurnEffect[mIndex], shaderOriginalCenterPropertyIndex, OriginalCenterConstraint( mOriginalCenter, offset ));
          originalCenterConstraint.AddSource( Source( self, mPropertyPanDisplacement[mIndex] ) );
          originalCenterConstraint.Apply();
  
 -        Property::Index shaderCurrentCenterPropertyIndex = mTurnEffect[mIndex].GetPropertyIndex(mTurnEffect[mIndex].PageTurnEffect::GetCurrentCenterPropertyName());
 +        Property::Index shaderCurrentCenterPropertyIndex = mTurnEffect[mIndex].GetPropertyIndex("uCurrentCenter");
          Constraint currentCenterConstraint = Constraint::New<Vector2>( mTurnEffect[mIndex], shaderCurrentCenterPropertyIndex, CurrentCenterConstraint(mPageSize.width));
          currentCenterConstraint.AddSource( Source(self, mPropertyCurrentCenter[mIndex]) );
          currentCenterConstraint.AddSource( Source(mTurnEffect[mIndex], shaderOriginalCenterPropertyIndex) );
          currentCenterConstraint.Apply();
  
 -        GetImpl( mTurnEffect[mIndex] ).ApplyInternalConstraint();
 +        PageTurnApplyInternalConstraint(mTurnEffect[mIndex]);
  
          float distance = offset.Length();
          Constraint rotationConstraint = Constraint::New<Quaternion>( mPanActor, Actor::Property::ORIENTATION, RotationConstraint(distance, mPageSize.width, mIsTurnBack[mPanActor]));
        {
          mPanActor.RemoveConstraints();
          mTurnEffect[mIndex].RemoveConstraints();
 -        mTurnEffect[mIndex].SetOriginalCenter( mOriginalCenter );
 +        mTurnEffect[mIndex].SetUniform("uOriginalCenter",mOriginalCenter );
          mConstraints = true;
          mPanDisplacement = 0.f;
        }
  
 -      mTurnEffect[mIndex].SetCurrentCenter( currentCenter );
 +      mTurnEffect[mIndex].SetUniform("uCurrentCenter", currentCenter );
        mCurrentCenter = currentCenter;
 -      GetImpl( mTurnEffect[mIndex] ).ApplyInternalConstraint();
 +      PageTurnApplyInternalConstraint(mTurnEffect[mIndex]);
      }
    }
  }
@@@ -966,7 -958,7 +960,7 @@@ void PageTurnView::PanFinished( const V
      else // the pan finished position is far away from the spine, set up an animation to slide the page back instead of turning over
      {
        Animation animation= Animation::New( PAGE_SLIDE_BACK_ANIMATION_DURATION * (mOriginalCenter.x - mCurrentCenter.x) / mPageSize.width / PAGE_TURN_OVER_THRESHOLD_RATIO );
 -      animation.AnimateTo( Property( mTurnEffect[mIndex], mTurnEffect[mIndex].PageTurnEffect::GetCurrentCenterPropertyName() ),
 +      animation.AnimateTo( Property( mTurnEffect[mIndex], "uCurrentCenter" ),
                             mOriginalCenter, AlphaFunction::LINEAR );
        mAnimationActorPair[animation] = actor;
        mAnimationIndexPair[animation] = mIndex;
  
  // 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/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/controls/page-turn-view/page-turn-view.h>
 -#include <dali-toolkit/internal/shader-effects/page-turn-effect-impl.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
  {
@@@ -196,19 -199,14 +196,14 @@@ private: // from Contro
    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
  
@@@ -321,9 -319,9 +316,9 @@@ protected
    CameraActor                    mCameraActor;             ///< The camera actor attached to the off screen tasks
    bool                           mPanning;                 ///< The boolean to indicate whether the pan gesture is continuing
  
 -  std::vector<Toolkit::PageTurnEffect>    mTurnEffect;     ///< The group of PageTurnEffects
 -  PageTurnBookSpineEffect        mSpineEffectFront;        ///< The book spine shader effect without flipping image content
 -  PageTurnBookSpineEffect        mSpineEffectBack;         ///< The book spine shader effect with image content flipped
 +  std::vector<ShaderEffect>      mTurnEffect;              ///< The group of PageTurnEffects
 +  ShaderEffect                   mSpineEffectFront;        ///< The book spine shader effect without flipping image content
 +  ShaderEffect                   mSpineEffectBack;         ///< The book spine shader effect with image content flipped
    Vector2                        mSpineShadowParameter;    ///< The spine shadow parameter for all the above shader effects
    Vector2                        mOriginalCenter;          ///< The original center set to the PageTurnEffect
    Vector2                        mCurrentCenter;           ///< The current center set to the PageTurnEffect
@@@ -117,7 -117,9 +117,9 @@@ DALI_PROPERTY_REGISTRATION( Toolkit, Te
  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, "text-changed",       SIGNAL_TEXT_CHANGED )
  DALI_SIGNAL_REGISTRATION( Toolkit, TextField, "max-length-reached", SIGNAL_MAX_LENGTH_REACHED )
  
  DALI_TYPE_REGISTRATION_END()
@@@ -158,6 -160,7 +160,7 @@@ void TextField::SetProperty( BaseObject
          {
            impl.mRenderingBackend = backend;
            impl.mRenderer.Reset();
+           impl.RequestTextRelayout();
          }
          break;
        }
        {
          if( impl.mController )
          {
-           std::string text = value.Get< std::string >();
+           const std::string text = value.Get< std::string >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p TEXT %s\n", impl.mController.Get(), text.c_str() );
  
            impl.mController->SetText( text );
        {
          if( impl.mController )
          {
-           std::string text = value.Get< std::string >();
+           const std::string text = value.Get< std::string >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PLACEHOLDER_TEXT %s\n", impl.mController.Get(), text.c_str() );
  
            impl.mController->SetPlaceholderText( PLACEHOLDER_TYPE_INACTIVE, text );
        {
          if( impl.mController )
          {
-           std::string text = value.Get< std::string >();
+           const std::string text = value.Get< std::string >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PLACEHOLDER_TEXT_FOCUSED %s\n", impl.mController.Get(), text.c_str() );
  
            impl.mController->SetPlaceholderText( PLACEHOLDER_TYPE_ACTIVE, text );
        {
          if( impl.mController )
          {
-           std::string fontFamily = value.Get< std::string >();
+           const std::string fontFamily = value.Get< std::string >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p FONT_FAMILY %s\n", impl.mController.Get(), fontFamily.c_str() );
  
            if( impl.mController->GetDefaultFontFamily() != fontFamily )
            {
              impl.mController->SetDefaultFontFamily( fontFamily );
-             impl.RequestTextRelayout();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           std::string fontStyle = value.Get< std::string >();
+           const std::string fontStyle = value.Get< std::string >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p FONT_STYLE %s\n", impl.mController.Get(), fontStyle.c_str() );
  
            if( impl.mController->GetDefaultFontStyle() != fontStyle )
            {
              impl.mController->SetDefaultFontStyle( fontStyle );
-             impl.RequestTextRelayout();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           float pointSize = value.Get< float >();
+           const float pointSize = value.Get< float >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p FONT_STYLE %f\n", impl.mController.Get(), pointSize );
  
            if( !Equals( impl.mController->GetDefaultPointSize(), pointSize ) )
            {
              impl.mController->SetDefaultPointSize( pointSize );
-             impl.RequestTextRelayout();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           std::string alignStr = value.Get< std::string >();
+           const std::string alignStr = value.Get< std::string >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p HORIZONTAL_ALIGNMENT %f\n", impl.mController.Get(), alignStr.c_str() );
  
-           LayoutEngine& engine = impl.mController->GetLayoutEngine();
-           LayoutEngine::HorizontalAlignment alignment = Scripting::GetEnumeration< LayoutEngine::HorizontalAlignment >( alignStr.c_str(),
+           const LayoutEngine::HorizontalAlignment alignment = Scripting::GetEnumeration< LayoutEngine::HorizontalAlignment >( alignStr.c_str(),
                                                                                                                          HORIZONTAL_ALIGNMENT_STRING_TABLE,
                                                                                                                          HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT );
  
-           if( engine.GetHorizontalAlignment() != alignment )
-           {
-             engine.SetHorizontalAlignment( alignment );
-             impl.RequestTextRelayout();
-           }
+           impl.mController->SetHorizontalAlignment( alignment );
          }
          break;
        }
        {
          if( impl.mController )
          {
-           std::string alignStr = value.Get< std::string >();
+           const std::string alignStr = value.Get< std::string >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p VERTICAL_ALIGNMENT %f\n", impl.mController.Get(), alignStr.c_str() );
  
-           LayoutEngine& engine = impl.mController->GetLayoutEngine();
            LayoutEngine::VerticalAlignment alignment = Scripting::GetEnumeration< LayoutEngine::VerticalAlignment >( alignStr.c_str(),
                                                                                                                      VERTICAL_ALIGNMENT_STRING_TABLE,
                                                                                                                      VERTICAL_ALIGNMENT_STRING_TABLE_COUNT );
  
-           if( engine.GetVerticalAlignment() != alignment )
-           {
-             engine.SetVerticalAlignment( alignment );
-             impl.RequestTextRelayout();
-           }
+           impl.mController->SetVerticalAlignment( alignment );
          }
          break;
        }
        case Toolkit::TextField::Property::TEXT_COLOR:
        {
-         if ( impl.mController )
+         if( impl.mController )
          {
-           Vector4 textColor = value.Get< Vector4 >();
+           const Vector4 textColor = value.Get< Vector4 >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p TEXT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), textColor.r, textColor.g, textColor.b, textColor.a );
  
-           if ( impl.mController->GetTextColor() != textColor )
+           if( impl.mController->GetTextColor() != textColor )
            {
              impl.mController->SetTextColor( textColor );
-             impl.RequestTextRelayout();
+             impl.mRenderer.Reset();
            }
          }
          break;
        }
        case Toolkit::TextField::Property::PLACEHOLDER_TEXT_COLOR:
        {
-         if ( impl.mController )
+         if( impl.mController )
          {
-           Vector4 textColor = value.Get< Vector4 >();
+           const Vector4 textColor = value.Get< Vector4 >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PLACEHOLDER_TEXT_COLOR %f,%f,%f,%f\n", impl.mController.Get(), textColor.r, textColor.g, textColor.b, textColor.a );
  
-           if ( impl.mController->GetPlaceholderTextColor() != textColor )
+           if( impl.mController->GetPlaceholderTextColor() != textColor )
            {
              impl.mController->SetPlaceholderTextColor( textColor );
-             impl.RequestTextRelayout();
+             impl.mRenderer.Reset();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           Vector2 shadowOffset = value.Get< Vector2 >();
+           const Vector2 shadowOffset = value.Get< Vector2 >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SHADOW_OFFSET %f,%f\n", impl.mController.Get(), shadowOffset.x, shadowOffset.y );
  
            if ( impl.mController->GetShadowOffset() != shadowOffset )
            {
              impl.mController->SetShadowOffset( shadowOffset );
-             impl.RequestTextRelayout();
+             impl.mRenderer.Reset();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           Vector4 shadowColor = value.Get< Vector4 >();
+           const Vector4 shadowColor = value.Get< Vector4 >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SHADOW_COLOR %f,%f,%f,%f\n", impl.mController.Get(), shadowColor.r, shadowColor.g, shadowColor.b, shadowColor.a );
  
            if ( impl.mController->GetShadowColor() != shadowColor )
            {
              impl.mController->SetShadowColor( shadowColor );
-             impl.RequestTextRelayout();
+             impl.mRenderer.Reset();
            }
          }
          break;
        {
          if( impl.mDecorator )
          {
-           Vector4 color = value.Get< Vector4 >();
+           const Vector4 color = value.Get< Vector4 >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p PRIMARY_CURSOR_COLOR %f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a );
  
            impl.mDecorator->SetColor( PRIMARY_CURSOR, color );
+           impl.RequestTextRelayout();
          }
          break;
        }
        {
          if( impl.mDecorator )
          {
-           Vector4 color = value.Get< Vector4 >();
+           const Vector4 color = value.Get< Vector4 >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SECONDARY_CURSOR_COLOR %f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a );
  
            impl.mDecorator->SetColor( SECONDARY_CURSOR, color );
+           impl.RequestTextRelayout();
          }
          break;
        }
        {
          if( impl.mController )
          {
-           bool enable = value.Get< bool >();
+           const bool enable = value.Get< bool >();
            DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p ENABLE_CURSOR_BLINK %d\n", impl.mController.Get(), enable );
  
            impl.mController->SetEnableCursorBlink( enable );
+           impl.RequestTextRelayout();
          }
          break;
        }
        {
          if( impl.mDecorator )
          {
-           float interval = value.Get< float >();
+           const float interval = value.Get< float >();
            DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p CURSOR_BLINK_INTERVAL %f\n", impl.mController.Get(), interval );
  
            impl.mDecorator->SetCursorBlinkInterval( interval );
        {
          if( impl.mDecorator )
          {
-           float duration = value.Get< float >();
+           const float duration = value.Get< float >();
            DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p CURSOR_BLINK_INTERVAL %f\n", impl.mController.Get(), duration );
  
            impl.mDecorator->SetCursorBlinkDuration( duration );
        }
        case Toolkit::TextField::Property::GRAB_HANDLE_IMAGE:
        {
-         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p GRAB_HANDLE_IMAGE %s\n", impl.mController.Get(), image.GetUrl().c_str() );
  
          if( impl.mDecorator )
          {
            impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_RELEASED, image );
+           impl.RequestTextRelayout();
          }
          break;
        }
        case Toolkit::TextField::Property::GRAB_HANDLE_PRESSED_IMAGE:
        {
-         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p GRAB_HANDLE_PRESSED_IMAGE %s\n", impl.mController.Get(), image.GetUrl().c_str() );
  
          if( impl.mDecorator )
          {
            impl.mDecorator->SetHandleImage( GRAB_HANDLE, HANDLE_IMAGE_PRESSED, image );
+           impl.RequestTextRelayout();
          }
          break;
        }
        case Toolkit::TextField::Property::SCROLL_THRESHOLD:
        {
-         float threshold = value.Get< float >();
+         const float threshold = value.Get< float >();
          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SCROLL_THRESHOLD %f\n", impl.mController.Get(), threshold );
  
          if( impl.mDecorator )
        }
        case Toolkit::TextField::Property::SCROLL_SPEED:
        {
-         float speed = value.Get< float >();
+         const float speed = value.Get< float >();
          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SCROLL_SPEED %f\n", impl.mController.Get(), speed );
  
          if( impl.mDecorator )
        }
        case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_LEFT:
        {
-         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_IMAGE_LEFT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
  
          if( impl.mDecorator )
          {
            impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
+           impl.RequestTextRelayout();
          }
          break;
        }
        case Toolkit::TextField::Property::SELECTION_HANDLE_IMAGE_RIGHT:
        {
-         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_IMAGE_RIGHT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
  
          if( impl.mDecorator )
          {
            impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_RELEASED, image );
+           impl.RequestTextRelayout();
          }
          break;
        }
        case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_LEFT:
        {
-         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_PRESSED_IMAGE_LEFT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
  
          if( impl.mDecorator )
          {
            impl.mDecorator->SetHandleImage( LEFT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
+           impl.RequestTextRelayout();
          }
          break;
        }
        case Toolkit::TextField::Property::SELECTION_HANDLE_PRESSED_IMAGE_RIGHT:
        {
-         ResourceImage image = ResourceImage::New( value.Get< std::string >() );
+         const ResourceImage image = ResourceImage::New( value.Get< std::string >() );
          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField %p SELECTION_HANDLE_PRESSED_IMAGE_RIGHT %f\n", impl.mController.Get(), image.GetUrl().c_str() );
  
          if( impl.mDecorator )
          {
            impl.mDecorator->SetHandleImage( RIGHT_SELECTION_HANDLE, HANDLE_IMAGE_PRESSED, image );
+           impl.RequestTextRelayout();
          }
          break;
        }
        case Toolkit::TextField::Property::SELECTION_HIGHLIGHT_COLOR:
        {
-         Vector4 color = value.Get< Vector4 >();
+         const Vector4 color = value.Get< Vector4 >();
          DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p SELECTION_HIGHLIGHT_COLOR %f,%f\n", impl.mController.Get(), color.r, color.g, color.b, color.a );
  
          if( impl.mDecorator )
          {
            impl.mDecorator->SetHighlightColor( color );
+           impl.RequestTextRelayout();
          }
          break;
        }
        {
          if( impl.mDecorator )
          {
-           Rect<int> box = value.Get< Rect<int> >();
+           const Rect<int> box = value.Get< Rect<int> >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p DECORATION_BOUNDING_BOX %d,%d %dx%d\n", impl.mController.Get(), box.x, box.y, box.width, box.height );
  
            impl.mDecorator->SetBoundingBox( box );
+           impl.RequestTextRelayout();
          }
          break;
        }
        {
          if( impl.mController )
          {
-           int max = value.Get< int >();
+           const int max = value.Get< int >();
            DALI_LOG_INFO( gLogFilter, Debug::General, "TextField %p MAX_LENGTH %d\n", impl.mController.Get(), max );
  
            impl.mController->SetMaximumNumberOfCharacters( max );
          }
          break;
        }
+       case Toolkit::TextField::Property::INPUT_METHOD_SETTINGS:
+       {
+         const Property::Map map = value.Get<Property::Map>();
+         VirtualKeyboard::ApplySettings( map );
+         break;
+       }
      } // switch
    } // textfield
  }
@@@ -572,6 -579,30 +579,30 @@@ Property::Value TextField::GetProperty
          }
          break;
        }
+       case Toolkit::TextField::Property::FONT_FAMILY:
+       {
+         if( impl.mController )
+         {
+           value = impl.mController->GetDefaultFontFamily();
+         }
+         break;
+       }
+       case Toolkit::TextField::Property::FONT_STYLE:
+       {
+         if( impl.mController )
+         {
+           value = impl.mController->GetDefaultFontStyle();
+         }
+         break;
+       }
+       case Toolkit::TextField::Property::POINT_SIZE:
+       {
+         if( impl.mController )
+         {
+           value = impl.mController->GetDefaultPointSize();
+         }
+         break;
+       }
        case Toolkit::TextField::Property::EXCEED_POLICY:
        {
          value = impl.mExceedPolicy;
          }
          break;
        }
+       case Toolkit::TextField::Property::INPUT_METHOD_SETTINGS:
+       {
+         break;
+       }
      } //switch
    }
  
@@@ -791,7 -826,11 +826,11 @@@ bool TextField::DoConnectSignal( BaseOb
    bool connected( true );
    Toolkit::TextField field = Toolkit::TextField::DownCast( handle );
  
-   if( 0 == strcmp( signalName.c_str(), SIGNAL_MAX_LENGTH_REACHED ) )
+   if( 0 == strcmp( signalName.c_str(), SIGNAL_TEXT_CHANGED ) )
+   {
+     field.TextChangedSignal().Connect( tracker, functor );
+   }
+   else if( 0 == strcmp( signalName.c_str(), SIGNAL_MAX_LENGTH_REACHED ) )
    {
      field.MaxLengthReachedSignal().Connect( tracker, functor );
    }
    return connected;
  }
  
+ Toolkit::TextField::TextChangedSignalType& TextField::TextChangedSignal()
+ {
+   return mTextChangedSignal;
+ }
  Toolkit::TextField::MaxLengthReachedSignalType& TextField::MaxLengthReachedSignal()
  {
    return mMaxLengthReachedSignal;
@@@ -826,6 -870,8 +870,8 @@@ void TextField::OnInitialize(
    GetTapGestureDetector().SetMaximumTapsRequired( 2 );
    EnableGestureDetection(Gesture::Pan);
  
+   self.TouchedSignal().Connect( this, &TextField::OnTouched );
    // Set BoundingBox to stage size if not already set.
    if ( mDecorator->GetBoundingBox().IsEmpty() )
    {
    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() ) );
  }
@@@ -870,7 -916,7 +916,7 @@@ void TextField::OnRelayout( const Vecto
        mRenderer = Backend::Get().NewRenderer( mRenderingBackend );
      }
  
 -    RenderableActor renderableActor;
 +    Actor renderableActor;
      if( mRenderer )
      {
        renderableActor = mRenderer->Render( mController->GetView() );
@@@ -988,55 -1034,7 +1034,7 @@@ bool TextField::OnKeyEvent( const KeyEv
  ImfManager::ImfCallbackData TextField::OnImfEvent( Dali::ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent )
  {
    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnImfEvent %p eventName %d\n", mController.Get(), imfEvent.eventName );
-   bool update( false );
-   std::string text;
-   unsigned int cursorPosition( 0 );
-   switch ( imfEvent.eventName )
-   {
-     case ImfManager::COMMIT:
-     {
-       mController->InsertText( imfEvent.predictiveString, Text::Controller::COMMIT );
-       break;
-     }
-     case ImfManager::PREEDIT:
-     {
-       mController->InsertText( imfEvent.predictiveString, Text::Controller::PRE_EDIT );
-       update = true;
-       break;
-     }
-     case ImfManager::DELETESURROUNDING:
-     {
-       mController->RemoveText( imfEvent.cursorOffset, imfEvent.numberOfChars );
-       break;
-     }
-     case ImfManager::GETSURROUNDING:
-     {
-       mController->GetText( text );
-       cursorPosition = mController->GetLogicalCursorPosition();
-       imfManager.SetSurroundingText( text );
-       imfManager.SetCursorPosition( cursorPosition );
-       break;
-     }
-     case ImfManager::VOID:
-     {
-       // do nothing
-       break;
-     }
-   } // end switch
-   if( ImfManager::GETSURROUNDING != imfEvent.eventName )
-   {
-     mController->GetText( text );
-     cursorPosition = mController->GetLogicalCursorPosition();
-   }
-   ImfManager::ImfCallbackData callbackData( update, cursorPosition, text, false );
-   return callbackData;
+   return mController->OnImfEvent( imfManager, imfEvent );
  }
  
  void TextField::RequestTextRelayout()
    RelayoutRequest();
  }
  
+ void TextField::TextChanged()
+ {
+   Dali::Toolkit::TextField handle( GetOwner() );
+   mTextChangedSignal.Emit( handle );
+ }
  void TextField::MaxLengthReached()
  {
    Dali::Toolkit::TextField handle( GetOwner() );
@@@ -1089,6 -1093,11 +1093,11 @@@ void TextField::KeyboardStatusChanged(b
    }
  }
  
+ bool TextField::OnTouched( Actor actor, const TouchEvent& event )
+ {
+   return true;
+ }
  TextField::TextField()
  : Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
    mRenderingBackend( DEFAULT_RENDERING_BACKEND ),
@@@ -18,9 -18,6 +18,6 @@@
   *
   */
  
- // EXTERNAL INCLUDES
- #include <dali/devel-api/adaptor-framework/imf-manager.h>
  // INTERNAL INCLUDES
  #include <dali-toolkit/public-api/controls/control-impl.h>
  #include <dali-toolkit/public-api/controls/text-controls/text-field.h>
@@@ -83,6 -80,11 +80,11 @@@ public
    static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
  
    /**
+    * @copydoc TextField::TextChangedSignal()
+    */
+   Toolkit::TextField::TextChangedSignalType&  TextChangedSignal();
+   /**
     * @copydoc TextField::MaxLengthReachedSignal()
     */
    Toolkit::TextField::MaxLengthReachedSignalType&  MaxLengthReachedSignal();
@@@ -97,7 -99,7 +99,7 @@@ private: // From Contro
    /**
     * @copydoc Control::OnStyleChange()
     */
-   virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange change );
+   virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
  
    /**
     * @copydoc Control::GetNaturalSize()
    virtual bool OnKeyEvent(const KeyEvent& event);
  
    /**
-    * @brief Event received from IMF manager
-    *
-    * @param[in] imfManager The IMF manager.
-    * @param[in] imfEvent The event received.
-    * @return A data struture indicating if update is needed, cursor position and current text.
+    * @copydoc Dali::Toolkit::Text::Controller::(ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent)
     */
    ImfManager::ImfCallbackData OnImfEvent( ImfManager& imfManager, const ImfManager::ImfEventData& imfEvent );
  
    virtual void RequestTextRelayout();
  
    /**
+    * @copydoc Text::ControlInterface::TextChanged()
+    */
+   virtual void TextChanged();
+   /**
     * @copydoc Text::ControlInterface::MaxLengthReached()
     */
    virtual void MaxLengthReached();
@@@ -176,6 -179,14 +179,14 @@@ private: // Implementatio
    void KeyboardStatusChanged( bool keyboardShown );
  
    /**
+    * @brief Callback when Textfield is touched
+    *
+    * @param[in] actor TextField touched
+    * @param[in] event TouchEvent information
+    */
+   bool OnTouched( Actor actor, const TouchEvent& event );
+   /**
     * Construct a new TextField.
     */
    TextField();
  private: // Data
  
    // Signals
+   Toolkit::TextField::TextChangedSignalType mTextChangedSignal;
    Toolkit::TextField::MaxLengthReachedSignalType mMaxLengthReachedSignal;
  
    Text::ControllerPtr mController;
    Text::DecoratorPtr mDecorator;
    Text::ClipperPtr mClipper; ///< For EXCEED_POLICY_CLIP
  
 -  RenderableActor mRenderableActor;
 +  Actor mRenderableActor;
  
    int mRenderingBackend;
    int mExceedPolicy;
@@@ -120,7 -120,7 +120,7 @@@ void TextLabel::SetProperty( BaseObject
      {
        case Toolkit::TextLabel::Property::RENDERING_BACKEND:
        {
-         int backend = value.Get< int >();
+         const int backend = value.Get< int >();
  
          if( impl.mRenderingBackend != backend )
          {
          if( impl.mController )
          {
            impl.mController->SetText( value.Get< std::string >() );
-           impl.RequestTextRelayout();
          }
          break;
        }
        {
          if( impl.mController )
          {
-           std::string fontFamily = value.Get< std::string >();
+           const std::string fontFamily = value.Get< std::string >();
  
            if( impl.mController->GetDefaultFontFamily() != fontFamily )
            {
              impl.mController->SetDefaultFontFamily( fontFamily );
-             impl.RequestTextRelayout();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           std::string fontStyle = value.Get< std::string >();
+           const std::string fontStyle = value.Get< std::string >();
  
            if( impl.mController->GetDefaultFontStyle() != fontStyle )
            {
              impl.mController->SetDefaultFontStyle( fontStyle );
-             impl.RequestTextRelayout();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           float pointSize = value.Get< float >();
+           const float pointSize = value.Get< float >();
  
            if( !Equals( impl.mController->GetDefaultPointSize(), pointSize ) )
            {
              impl.mController->SetDefaultPointSize( pointSize );
-             impl.RequestTextRelayout();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           LayoutEngine& engine = impl.mController->GetLayoutEngine();
-           LayoutEngine::Layout layout = value.Get< bool >() ? LayoutEngine::MULTI_LINE_BOX : LayoutEngine::SINGLE_LINE_BOX;
-           if( engine.GetLayout() != layout )
-           {
-             engine.SetLayout( layout );
-             impl.RequestTextRelayout();
-           }
+           impl.mController->SetMultiLineEnabled( value.Get< bool >() );
          }
          break;
        }
        case Toolkit::TextLabel::Property::HORIZONTAL_ALIGNMENT:
        {
-         LayoutEngine& engine = impl.mController->GetLayoutEngine();
-         const LayoutEngine::HorizontalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::HorizontalAlignment >( value.Get< std::string >().c_str(),
-                                                                                                                                            HORIZONTAL_ALIGNMENT_STRING_TABLE,
-                                                                                                                                            HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT );
-         if( engine.GetHorizontalAlignment() != alignment )
+         if( impl.mController )
          {
-           engine.SetHorizontalAlignment( alignment );
-           impl.RequestTextRelayout();
+           const LayoutEngine::HorizontalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::HorizontalAlignment >( value.Get< std::string >().c_str(),
+                                                                                                                                              HORIZONTAL_ALIGNMENT_STRING_TABLE,
+                                                                                                                                              HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT );
+           impl.mController->SetHorizontalAlignment( alignment );
          }
          break;
        }
        case Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT:
        {
-         LayoutEngine& engine = impl.mController->GetLayoutEngine();
-         const LayoutEngine::VerticalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::VerticalAlignment >( value.Get< std::string >().c_str(),
-                                                                                                                                        VERTICAL_ALIGNMENT_STRING_TABLE,
-                                                                                                                                        VERTICAL_ALIGNMENT_STRING_TABLE_COUNT );
-         if( engine.GetVerticalAlignment() != alignment )
+         if( impl.mController )
          {
-           engine.SetVerticalAlignment( alignment );
-           impl.RequestTextRelayout();
+           const LayoutEngine::VerticalAlignment alignment = Scripting::GetEnumeration< Toolkit::Text::LayoutEngine::VerticalAlignment >( value.Get< std::string >().c_str(),
+                                                                                                                                          VERTICAL_ALIGNMENT_STRING_TABLE,
+                                                                                                                                          VERTICAL_ALIGNMENT_STRING_TABLE_COUNT );
+           impl.mController->SetVerticalAlignment( alignment );
          }
          break;
        }
  
        case Toolkit::TextLabel::Property::TEXT_COLOR:
        {
-         if ( impl.mController )
+         if( impl.mController )
          {
-           Vector4 textColor = value.Get< Vector4 >();
-           if ( impl.mController->GetTextColor() != textColor )
+           const Vector4 textColor = value.Get< Vector4 >();
+           if( impl.mController->GetTextColor() != textColor )
            {
              impl.mController->SetTextColor( textColor );
-             impl.RequestTextRelayout();
+             impl.mRenderer.Reset();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           Vector2 shadowOffset = value.Get< Vector2 >();
+           const Vector2 shadowOffset = value.Get< Vector2 >();
            if ( impl.mController->GetShadowOffset() != shadowOffset )
            {
              impl.mController->SetShadowOffset( shadowOffset );
-             impl.RequestTextRelayout();
+             impl.mRenderer.Reset();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           Vector4 shadowColor = value.Get< Vector4 >();
+           const Vector4 shadowColor = value.Get< Vector4 >();
            if ( impl.mController->GetShadowColor() != shadowColor )
            {
              impl.mController->SetShadowColor( shadowColor );
-             impl.RequestTextRelayout();
+             impl.mRenderer.Reset();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           Vector4 color = value.Get< Vector4 >();
+           const Vector4 color = value.Get< Vector4 >();
            if ( impl.mController->GetUnderlineColor() != color )
            {
              impl.mController->SetUnderlineColor( color );
-             impl.RequestTextRelayout();
+             impl.mRenderer.Reset();
            }
          }
          break;
        {
          if( impl.mController )
          {
-           bool enabled = value.Get< bool >();
+           const bool enabled = value.Get< bool >();
            if ( impl.mController->IsUnderlineEnabled() != enabled )
            {
              impl.mController->SetUnderlineEnabled( enabled );
-             impl.RequestTextRelayout();
+             impl.mRenderer.Reset();
            }
          }
          break;
            if ( impl.mController->GetUnderlineHeight() != height )
            {
              impl.mController->SetUnderlineHeight( height );
-             impl.RequestTextRelayout();
+             impl.mRenderer.Reset();
            }
          }
          break;
@@@ -335,11 -320,35 +320,35 @@@ Property::Value TextLabel::GetProperty
          }
          break;
        }
+       case Toolkit::TextLabel::Property::FONT_FAMILY:
+       {
+         if( impl.mController )
+         {
+           value = impl.mController->GetDefaultFontFamily();
+         }
+         break;
+       }
+       case Toolkit::TextLabel::Property::FONT_STYLE:
+       {
+         if( impl.mController )
+         {
+           value = impl.mController->GetDefaultFontStyle();
+         }
+         break;
+       }
+       case Toolkit::TextLabel::Property::POINT_SIZE:
+       {
+         if( impl.mController )
+         {
+           value = impl.mController->GetDefaultPointSize();
+         }
+         break;
+       }
        case Toolkit::TextLabel::Property::MULTI_LINE:
        {
          if( impl.mController )
          {
-           value = static_cast<bool>( LayoutEngine::MULTI_LINE_BOX == impl.mController->GetLayoutEngine().GetLayout() );
+           value = impl.mController->IsMultiLineEnabled();
          }
          break;
        }
        {
          if( impl.mController )
          {
-           value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::HorizontalAlignment >( impl.mController->GetLayoutEngine().GetHorizontalAlignment(),
+           value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::HorizontalAlignment >( impl.mController->GetHorizontalAlignment(),
                                                                                                                    HORIZONTAL_ALIGNMENT_STRING_TABLE,
                                                                                                                    HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT ) );
          }
        {
          if( impl.mController )
          {
-           value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::VerticalAlignment >( impl.mController->GetLayoutEngine().GetVerticalAlignment(),
+           value = std::string( Scripting::GetEnumerationName< Toolkit::Text::LayoutEngine::VerticalAlignment >( impl.mController->GetVerticalAlignment(),
                                                                                                                  VERTICAL_ALIGNMENT_STRING_TABLE,
                                                                                                                  VERTICAL_ALIGNMENT_STRING_TABLE_COUNT ) );
          }
@@@ -432,7 -441,7 +441,7 @@@ void TextLabel::OnInitialize(
    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() ) );
  }
@@@ -457,7 -466,7 +466,7 @@@ void TextLabel::OnRelayout( const Vecto
        mRenderer = Backend::Get().NewRenderer( mRenderingBackend );
      }
  
 -    RenderableActor renderableActor;
 +    Actor renderableActor;
      if( mRenderer )
      {
        renderableActor = mRenderer->Render( mController->GetView() );
@@@ -485,6 -494,11 +494,11 @@@ void TextLabel::RequestTextRelayout(
    RelayoutRequest();
  }
  
+ void TextLabel::TextChanged()
+ {
+   // TextLabel does not provide a signal for this
+ }
  void TextLabel::MaxLengthReached()
  {
    // Pure Virtual from TextController Interface, only needed when inputting text
@@@ -75,7 -75,7 +75,7 @@@ private: // From Contro
    /**
     * @copydoc Control::OnStyleChange()
     */
-   virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange change );
+   virtual void OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change );
  
    /**
     * @copydoc Control::OnRelayout()
    virtual void RequestTextRelayout();
  
    /**
+    * @copydoc Text::ControlInterface::TextChanged()
+    */
+   virtual void TextChanged();
+   /**
     * @copydoc Text::ControlInterface::MaxLengthReached()
     */
    virtual void MaxLengthReached();
@@@ -124,7 -129,7 +129,7 @@@ private: // Dat
  
    Text::ControllerPtr mController;
    Text::RendererPtr mRenderer;
 -  RenderableActor mRenderableActor;
 +  Actor mRenderableActor;
  
    int mRenderingBackend;
  };
  #include "tool-bar-impl.h"
  
  // EXTERNAL INCLUDES
 -#include <dali/public-api/actors/renderable-actor.h>
 +#include <dali/public-api/actors/image-actor.h>
  #include <dali/public-api/animation/constraints.h>
  #include <dali/public-api/object/type-registry.h>
  #include <dali/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 +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 ) );
-   ImageActor renderableActor = ImageActor::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 +336,6 @@@ void ToolBar::OnControlChildAdd(Actor& 
    // 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
@@@ -15,19 -15,16 +15,18 @@@ toolkit_src_files = 
     $(toolkit_src_dir)/controls/alignment/alignment-impl.cpp \
     $(toolkit_src_dir)/controls/bloom-view/bloom-view-impl.cpp \
     $(toolkit_src_dir)/controls/bubble-effect/bubble-emitter-impl.cpp \
 +   $(toolkit_src_dir)/controls/bubble-effect/bubble-actor.cpp \
     $(toolkit_src_dir)/controls/buttons/button-impl.cpp \
     $(toolkit_src_dir)/controls/buttons/check-box-button-impl.cpp \
     $(toolkit_src_dir)/controls/buttons/push-button-impl.cpp \
     $(toolkit_src_dir)/controls/buttons/radio-button-impl.cpp \
     $(toolkit_src_dir)/controls/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/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-effect.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/text-controls/text-label-impl.cpp \
     $(toolkit_src_dir)/controls/text-controls/text-selection-popup-impl.cpp \
     $(toolkit_src_dir)/controls/tool-bar/tool-bar-impl.cpp \
-    $(toolkit_src_dir)/focus-manager/focus-manager-impl.cpp \
+    $(toolkit_src_dir)/focus-manager/accessibility-focus-manager-impl.cpp \
     $(toolkit_src_dir)/focus-manager/keyboard-focus-manager-impl.cpp \
     $(toolkit_src_dir)/focus-manager/keyinput-focus-manager-impl.cpp \
     $(toolkit_src_dir)/filters/blur-two-pass-filter.cpp \
     $(toolkit_src_dir)/filters/emboss-filter.cpp \
     $(toolkit_src_dir)/filters/image-filter.cpp \
     $(toolkit_src_dir)/filters/spread-filter.cpp \
 -   $(toolkit_src_dir)/shader-effects/page-turn-effect-impl.cpp \
 -   $(toolkit_src_dir)/shader-effects/water-effect-impl.cpp \
     $(toolkit_src_dir)/styling/style-manager-impl.cpp \
     $(toolkit_src_dir)/text/bidirectional-support.cpp \
     $(toolkit_src_dir)/text/character-set-conversion.cpp \
  #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/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/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>
@@@ -44,7 -48,7 +45,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
@@@ -234,7 -238,6 +235,7 @@@ struct Decorator::Impl : public Connect
      // TODO - Remove this if nothing is active
      CreateActiveLayer();
  
 +    /*
      // Show or hide the cursors
      CreateCursors();
      if( mPrimaryCursor )
        }
        mSecondaryCursor.SetVisible( mSecondaryCursorVisible );
      }
 -
 +    */
      // Show or hide the grab handle
      HandleImpl& grabHandle = mHandle[GRAB_HANDLE];
      if( grabHandle.active )
      {
        UnparentAndReset( primary.actor );
        UnparentAndReset( secondary.actor );
 -      UnparentAndReset( mHighlightMeshActor );
 +      //UnparentAndReset( mHighlightMeshActor );
      }
  
      if ( mActiveCopyPastePopup )
    // Add or Remove cursor(s) from parent
    void CreateCursors()
    {
 +    /*
      if( mActiveCursor == ACTIVE_CURSOR_NONE )
      {
        UnparentAndReset( mPrimaryCursor );
      }
      else
      {
 -      /* Create Primary and or Secondary Cursor(s) if active and add to parent */
 +      // Create Primary and or Secondary Cursor(s) if active and add to parent
        if ( mActiveCursor == ACTIVE_CURSOR_PRIMARY ||
             mActiveCursor == ACTIVE_CURSOR_BOTH )
        {
          UnparentAndReset( mSecondaryCursor );
        }
      }
 +    */
    }
  
    bool OnCursorBlinkTimerTick()
    {
 +    /*
      // Cursor blinking
      if ( mPrimaryCursor )
      {
      }
  
      mCursorBlinkStatus = !mCursorBlinkStatus;
 -
 +    */
      return true;
    }
  
        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 );
  
  
    void CreateHighlight()
    {
 +    /*
      if ( !mHighlightMeshActor )
      {
        mHighlightMaterial = Material::New( "HighlightMaterial" );
        Actor parent = mTextControlParent.Self();
        parent.Add( mHighlightMeshActor );
      }
 +    */
    }
  
    void UpdateHighlight()
      //  9*    *7
      //
  
 +    /*
      if ( mHighlightMesh && mHighlightMaterial && !mHighlightQuadList.empty() )
      {
        MeshData::VertexContainer vertices;
        mHighlightMeshData.SetData( vertices, faceIndices, bones, mHighlightMaterial );
        mHighlightMesh.UpdateMeshData( mHighlightMeshData );
      }
 +    */
    }
  
    void OnTap( Actor actor, const TapGesture& tap )
      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;
          mHandleScrolling = type;
          StartScrollTimer();
        }
-       else if( x > mTextControlParent.GetControlSize().width - mScrollThreshold )
+       else if( x > mTextControlParent.Self().GetTargetSize().width - mScrollThreshold )
        {
          mScrollDirection = SCROLL_LEFT;
          mHandleScrolling = type;
      }
    }
  
+   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
    {
      float alternativePosition=0.0f;;
  
 +    /*
      if ( mPrimaryCursor ) // Secondary cursor not used for paste
      {
        Cursor cursor = PRIMARY_CURSOR;
        alternativePosition = mCursor[cursor].position.y;
      }
 -
 +    */
      const float popupHeight = 120.0f; // todo Set as a MaxSize Property in Control or retrieve from CopyPastePopup class.
  
      if( mHandle[GRAB_HANDLE].active )
    Timer               mScrollTimer;               ///< Timer used to scroll the text when the grab handle is moved close to the edges.
  
    Layer               mActiveLayer;               ///< Layer for active handles and alike that ensures they are above all else.
 -  ImageActor          mPrimaryCursor;
 -  ImageActor          mSecondaryCursor;
 -  MeshActor           mHighlightMeshActor;        ///< Mesh Actor to display highlight
 +  //ImageActor          mPrimaryCursor;
 +  //ImageActor          mSecondaryCursor;
 +  //MeshActor           mHighlightMeshActor;        ///< Mesh Actor to display highlight
    TextSelectionPopup  mCopyPastePopup;
  
    Image               mHandleImages[HANDLE_TYPE_COUNT][HANDLE_IMAGE_TYPE_COUNT];
    Image               mCursorImage;
 -  Mesh                mHighlightMesh;             ///< Mesh for highlight
 -  MeshData            mHighlightMeshData;         ///< Mesh Data for highlight
 -  Material            mHighlightMaterial;         ///< Material used for highlight
 +  //Mesh                mHighlightMesh;             ///< Mesh for highlight
 +  //MeshData            mHighlightMeshData;         ///< Mesh Data for highlight
 +  //Material            mHighlightMaterial;         ///< Material used for highlight
  
    CursorImpl          mCursor[CURSOR_COUNT];
    HandleImpl          mHandle[HANDLE_TYPE_COUNT];
  #include <limits>
  #include <stack>
  #include <dali/public-api/actors/image-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/devel-api/geometry/mesh.h>
  #include <dali/public-api/object/type-registry.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
- #include <dali-toolkit/public-api/focus-manager/keyinput-focus-manager.h>
+ #include <dali-toolkit/devel-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
@@@ -47,33 -49,116 +47,116 @@@ namespace Toolki
  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 Property::Map& 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()
  
@@@ -98,10 -183,10 +181,10 @@@ struct Backgroun
  /**
   * Creates a white coloured Mesh.
   */
 -Mesh CreateMesh()
 +Vector3 CreateMesh()
  {
    Vector3 white( Color::WHITE );
 -
 +  /*
    MeshData meshData;
  
    // Create vertices with a white color (actual color is set by actor color)
    meshData.SetVertices( vertices );
    meshData.SetFaceIndices( faces );
    meshData.SetHasColor( true );
 -
 -  return Mesh::New( meshData );
 +  */
 +  return white;
 +  //return Mesh::New( meshData );
  }
  
  /**
@@@ -138,7 -222,6 +221,6 @@@ void SetupBackgroundActor( Actor actor
    actor.SetColor( color );
    actor.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
    actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
-   actor.SetZ( BACKGROUND_ACTOR_Z_POSITION );
    actor.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
  }
  
@@@ -154,7 -237,6 +236,6 @@@ void SetupBackgroundActorConstrained( A
    actor.SetColor( color );
    actor.SetPositionInheritanceMode( USE_PARENT_POSITION_PLUS_LOCAL_POSITION );
    actor.SetColorMode( USE_OWN_MULTIPLY_PARENT_COLOR );
-   actor.SetZ( BACKGROUND_ACTOR_Z_POSITION );
  
    Constraint constraint = Constraint::New<Vector3>( actor,
                                                      constrainingIndex,
@@@ -172,16 -254,6 +253,6 @@@ class Control::Impl : public Connection
  {
  public:
  
-   /**
-    * Size indices for mMinMaxSize array
-    */
-   enum
-   {
-     MIN_SIZE_INDEX = 0,
-     MAX_SIZE_INDEX = 1
-   };
- public:
    // Construction & Destruction
    Impl(Control& controlImpl)
    : mControlImpl( controlImpl ),
      mPanGestureDetector(),
      mTapGestureDetector(),
      mLongPressGestureDetector(),
-     mCurrentSize(),
-     mNaturalSize(),
      mFlags( Control::ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
      mIsKeyboardNavigationSupported( false ),
      mIsKeyboardFocusGroup( false ),
-     mInitialized( false )
+     mAddRemoveBackgroundChild( false )
    {
    }
  
  
      if ( control )
      {
-       Control& controlImpl( control.GetImplementation() );
+       Control& controlImpl( GetImplementation( control ) );
  
        switch ( index )
        {
  
      if ( control )
      {
-       Control& controlImpl( control.GetImplementation() );
+       Control& controlImpl( GetImplementation( control ) );
  
        switch ( index )
        {
          {
            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();
    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;
+   bool mAddRemoveBackgroundChild:1;        ///< Flag to know when we are adding or removing our own actor to avoid call to OnControlChildAdd
  
    // Properties - these need to be members of Internal::Control::Impl as they need to function within this class.
    static PropertyRegistration PROPERTY_1;
@@@ -431,101 -498,6 +497,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 )
@@@ -552,7 -524,6 +523,7 @@@ void Control::SetBackgroundColor( cons
      // Just set the actor color
      background.actor.SetColor( color );
    }
 +  /*
    else
    {
      // Create Mesh Actor
  
      SetupBackgroundActorConstrained( meshActor, Actor::Property::SCALE, color );
  
-     // Set the background actor before adding so that we do not inform deriving classes
      background.actor = meshActor;
-     Self().Add( meshActor );
+     // Set the flag to avoid notifying children
+     mImpl->mAddRemoveBackgroundChild = true;
+     // use insert to guarantee its the first child (so that OVERLAY mode works)
+     Self().Insert( 0, meshActor );
+     mImpl->mAddRemoveBackgroundChild = false;
    }
 +  */
  
    background.color = color;
  }
@@@ -584,19 -557,22 +558,24 @@@ void Control::SetBackgroundImage( Imag
  
    if ( background.actor )
    {
-     // Remove Current actor, unset AFTER removal so that we do not inform deriving classes
+     // Remove Current actor, unset AFTER removal
+     mImpl->mAddRemoveBackgroundChild = true;
      Self().Remove( background.actor );
+     mImpl->mAddRemoveBackgroundChild = false;
      background.actor.Reset();
    }
  
 +  /*
    ImageActor imageActor = ImageActor::New( image );
-   SetupBackgroundActor( imageActor, Actor::Property::SIZE, background.color );
+   SetupBackgroundActor( imageActor, background.color );
  
    // Set the background actor before adding so that we do not inform derived classes
    background.actor = imageActor;
-   Self().Add( imageActor );
+   mImpl->mAddRemoveBackgroundChild = true;
+   // use insert to guarantee its the first child (so that OVERLAY mode works)
+   Self().Insert( 0, imageActor );
+   mImpl->mAddRemoveBackgroundChild = false;
 +  */
  }
  
  void Control::ClearBackground()
    if ( mImpl->mBackground )
    {
      Background& background( mImpl->GetBackground() );
+     mImpl->mAddRemoveBackgroundChild = true;
      Self().Remove( background.actor );
+     mImpl->mAddRemoveBackgroundChild = false;
  
      delete mImpl->mBackground;
      mImpl->mBackground = NULL;
    }
  }
  
- 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)
@@@ -631,25 -677,30 +680,30 @@@ bool Control::IsKeyboardNavigationSuppo
    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)
@@@ -665,82 -716,39 +719,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::KeyboardFocus::Direction 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()
@@@ -789,9 -797,6 +800,6 @@@ Control::Control( ControlBehaviour beha
  
  void Control::Initialize()
  {
-   // Calling deriving classes
-   OnInitialize();
    if( mImpl->mFlags & REQUIRES_STYLE_CHANGE_SIGNALS )
    {
      Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
      SetKeyboardNavigationSupport( true );
    }
  
-   mImpl->mInitialized = true;
+   // Calling deriving classes
+   OnInitialize();
  }
  
- void Control::EnableGestureDetection(Gesture::Type type)
+ void Control::OnInitialize()
  {
-   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());
-   }
  }
  
- 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();
-   }
- }
- 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() ) );
    }
@@@ -914,46 -866,6 +869,6 @@@ void Control::OnLongPress( const LongPr
  {
  }
  
- 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() );
    }
  }
  
+ void Control::OnStageConnection()
+ {
+ }
+ void Control::OnStageDisconnection()
+ {
+ }
  void Control::OnKeyInputFocusGained()
  {
    EmitKeyInputFocusSignal( true );
@@@ -986,9 -906,38 +909,38 @@@ void Control::OnKeyInputFocusLost(
    EmitKeyInputFocusSignal( false );
  }
  
+ void Control::OnChildAdd(Actor& child)
+ {
+   // If this is the background actor, then we do not want to inform deriving classes
+   if ( mImpl->mAddRemoveBackgroundChild )
+   {
+     return;
+   }
+   // Notify derived classes.
+   OnControlChildAdd( child );
+ }
+ void Control::OnChildRemove(Actor& child)
+ {
+   // If this is the background actor, then we do not want to inform deriving classes
+   if ( mImpl->mAddRemoveBackgroundChild )
+   {
+     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)
@@@ -1006,63 -955,78 +958,78 @@@ bool Control::OnKeyEvent(const KeyEvent
    return false; // Do not consume
  }
  
- bool Control::OnMouseWheelEvent(const MouseWheelEvent& event)
+ bool Control::OnWheelEvent(const WheelEvent& 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 )
@@@ -1075,6 -1039,22 +1042,22 @@@ void Control::SignalDisconnected( SlotO
    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