Merge branch 'devel/master' into tizen 82/131882/1
authorJinho, Lee <jeano.lee@samsung.com>
Wed, 31 May 2017 02:30:55 +0000 (11:30 +0900)
committerJinho, Lee <jeano.lee@samsung.com>
Wed, 31 May 2017 02:31:13 +0000 (11:31 +0900)
Change-Id: Icc197125023ac54a46648fbc6acbdd9858a9e743

com.samsung.dali-demo.xml
examples/blocks/blocks-example.cpp
examples/native-image-source/native-image-source-example.cpp
examples/simple-visuals-control/my-control-impl.cpp
examples/styling/image-channel-control-impl.cpp
examples/transitions/shadow-button-impl.cpp
examples/visual-transitions/beat-control-impl.cpp
packaging/com.samsung.dali-demo.spec

index dded921..9dab573 100644 (file)
        </ui-application>
        <ui-application appid="rendering-radial-progress.example" exec="/usr/apps/com.samsung.dali-demo/bin/rendering-radial-progress.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
                <label>Rendering Radial Progress</label>
+       </ui-application>
        <ui-application appid="ray-marching.example" exec="/usr/apps/com.samsung.dali-demo/bin/ray-marching.example" nodisplay="true" multiple="false" type="c++app" taskmanage="true">
                <label>Ray Marching example</label>
        </ui-application>
index ed7195f..e22260d 100644 (file)
@@ -25,8 +25,6 @@
 #include <dali-toolkit/dali-toolkit.h>
 #include "shared/view.h"
 
-#include <dali/devel-api/object/handle-devel.h>
-
 using namespace Dali;
 using namespace Dali::Toolkit;
 using namespace DemoHelper;
@@ -744,7 +742,7 @@ private:
   void OnHitPaddle(PropertyNotification& source)
   {
     Actor delegate = Actor::DownCast(source.GetTarget());
-    Vector3 collisionVector = DevelHandle::GetCurrentProperty< Vector3 >( delegate, source.GetTargetProperty() );
+    Vector3 collisionVector = delegate.GetCurrentProperty< Vector3 >( source.GetTargetProperty() );
     Vector3 ballRelativePosition(mBall.GetCurrentPosition() - mPaddle.GetCurrentPosition());
     ballRelativePosition.Normalize();
 
@@ -779,7 +777,7 @@ private:
   void OnHitBrick(PropertyNotification& source)
   {
     Actor brick = Actor::DownCast(source.GetTarget());
-    Vector3 collisionVector = DevelHandle::GetCurrentProperty< Vector3 >( brick, source.GetTargetProperty() );
+    Vector3 collisionVector = brick.GetCurrentProperty< Vector3 >( source.GetTargetProperty() );
 
     const float normalVelocity = fabsf(mBallVelocity.Dot(collisionVector));
     mBallVelocity += collisionVector * normalVelocity * 2.0f;
index f9f7a54..267452a 100644 (file)
@@ -32,6 +32,12 @@ using namespace Toolkit;
 namespace
 {
 
+const float BUTTON_HEIGHT = 100.0f;
+const float BUTTON_COUNT  = 5.0f;
+
+const std::string JPG_FILENAME = DEMO_IMAGE_DIR "gallery-medium-4.jpg";
+const std::string CAPTURE_FILENAME = "/tmp/native-image-capture.png";
+
 /**
  * @brief Creates a shader used to render a native image
  * @param[in] nativeImageInterface The native image interface
@@ -98,28 +104,6 @@ Shader CreateShader( NativeImageInterface& nativeImageInterface )
   }
 }
 
-/**
- * @brief Creates an actor to render a native image
- * @param[in] texture The texture creates from a native image
- * @param[in] nativeImageInterface The native image interface used to create the texture
- * @return An actor that renders the texture
- */
-Actor CreateNativeActor( Texture texture, NativeImageInterface& nativeImageInterface )
-{
-  Actor actor = Actor::New();
-  Geometry geometry = DemoHelper::CreateTexturedQuad();
-  Shader shader = CreateShader(nativeImageInterface);
-  Renderer renderer = Renderer::New( geometry, shader );
-  TextureSet textureSet = TextureSet::New();
-  textureSet.SetTexture( 0u, texture );
-  renderer.SetTextures( textureSet );
-
-  actor.AddRenderer( renderer );
-  actor.SetSize( texture.GetWidth(), texture.GetHeight() );
-  return actor;
-}
-
-const std::string JPG_FILENAME = DEMO_IMAGE_DIR "gallery-medium-4.jpg";
 }
 
 // This example shows how to create and use a NativeImageSource as the target of the render task.
@@ -129,7 +113,8 @@ class NativeImageSourceController : public ConnectionTracker
 public:
 
   NativeImageSourceController( Application& application )
-  : mApplication( application )
+  : mApplication( application ),
+    mRefreshAlways( true )
   {
     // Connect to the Application's Init signal
     mApplication.InitSignal().Connect( this, &NativeImageSourceController::Create );
@@ -152,121 +137,259 @@ public:
 
     stage.KeyEventSignal().Connect(this, &NativeImageSourceController::OnKeyEvent);
 
+    CreateButtonArea();
+
+    CreateContentAreas();
+  }
+
+  void CreateButtonArea()
+  {
+    Stage stage = Stage::GetCurrent();
+    Vector2 stageSize = stage.GetSize();
+
+    mButtonArea = Layer::New();
+    mButtonArea.SetSize( stageSize.x, BUTTON_HEIGHT );
+    mButtonArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
+    mButtonArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+    stage.Add( mButtonArea );
+
+    mButtonShow = PushButton::New();
+    mButtonShow.SetProperty( Button::Property::TOGGLABLE, true );
+    mButtonShow.SetProperty( Toolkit::Button::Property::LABEL, "SHOW" );
+    mButtonShow.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mButtonShow.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mButtonShow.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT );
+    mButtonShow.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
+    mButtonArea.Add( mButtonShow );
+
     mButtonRefreshAlways = PushButton::New();
     mButtonRefreshAlways.SetProperty( Button::Property::TOGGLABLE, true );
-    mButtonRefreshAlways.SetProperty( Button::Property::SELECTED, true );
-    mButtonRefreshAlways.SetProperty( Toolkit::Button::Property::LABEL, "Refresh ALWAYS" );
+    mButtonRefreshAlways.SetProperty( Toolkit::Button::Property::LABEL, "ALWAYS" );
     mButtonRefreshAlways.SetParentOrigin( ParentOrigin::TOP_LEFT );
     mButtonRefreshAlways.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mButtonRefreshAlways.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT );
+    mButtonRefreshAlways.SetPosition( (stageSize.x / BUTTON_COUNT)*1.0f, 0.0f );
     mButtonRefreshAlways.StateChangedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
-    stage.Add( mButtonRefreshAlways );
+    mButtonArea.Add( mButtonRefreshAlways );
 
     mButtonRefreshOnce = PushButton::New();
-    mButtonRefreshOnce.SetProperty( Toolkit::Button::Property::LABEL, "Refresh ONCE" );
-    mButtonRefreshOnce.SetParentOrigin( ParentOrigin::TOP_RIGHT );
-    mButtonRefreshOnce.SetAnchorPoint( AnchorPoint::TOP_RIGHT );
+    mButtonRefreshOnce.SetProperty( Toolkit::Button::Property::LABEL, "ONCE" );
+    mButtonRefreshOnce.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mButtonRefreshOnce.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mButtonRefreshOnce.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT );
+    mButtonRefreshOnce.SetPosition( (stageSize.x / BUTTON_COUNT)*2.0f, 0.0f );
     mButtonRefreshOnce.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
-    stage.Add( mButtonRefreshOnce);
-
-    CreateScene();
+    mButtonArea.Add( mButtonRefreshOnce );
+
+    mButtonCapture = PushButton::New();
+    mButtonCapture.SetProperty( Toolkit::Button::Property::LABEL, "CAPTURE" );
+    mButtonCapture.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mButtonCapture.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mButtonCapture.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT );
+    mButtonCapture.SetPosition( (stageSize.x / BUTTON_COUNT)*3.0f, 0.0f );
+    mButtonCapture.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
+    mButtonArea.Add( mButtonCapture );
+
+    mButtonReset = PushButton::New();
+    mButtonReset.SetProperty( Toolkit::Button::Property::LABEL, "RESET" );
+    mButtonReset.SetParentOrigin( ParentOrigin::TOP_LEFT );
+    mButtonReset.SetAnchorPoint( AnchorPoint::TOP_LEFT );
+    mButtonReset.SetSize( stageSize.x / BUTTON_COUNT, BUTTON_HEIGHT );
+    mButtonReset.SetPosition( (stageSize.x / BUTTON_COUNT)*4.0f, 0.0f );
+    mButtonReset.ClickedSignal().Connect( this, &NativeImageSourceController::OnButtonSelected );
+    mButtonArea.Add( mButtonReset );
   }
 
-  bool CreateScene()
+  void CreateContentAreas()
   {
     Stage stage = Stage::GetCurrent();
     Vector2 stageSize = stage.GetSize();
 
-    float buttonHeight = 100.f;
-    mButtonRefreshAlways.SetSize( stageSize.x / 2.f, buttonHeight );
-    mButtonRefreshOnce.SetSize( stageSize.x / 2.f, buttonHeight );
+    float contentHeight( (stageSize.y - BUTTON_HEIGHT)/2.0f );
 
-    Vector2 imageSize( stageSize.x, (stageSize.y-buttonHeight)/2.f );
+    mTopContentArea = Actor::New();
+    mTopContentArea.SetSize( stageSize.x, contentHeight );
+    mTopContentArea.SetParentOrigin( ParentOrigin::TOP_CENTER );
+    mTopContentArea.SetAnchorPoint( AnchorPoint::TOP_CENTER );
+    mTopContentArea.SetY( BUTTON_HEIGHT );
+    stage.Add( mTopContentArea );
 
-    // Create the native image source
-    NativeImageSourcePtr nativeImageSourcePtr = NativeImageSource::New( imageSize.width, imageSize.height, NativeImageSource::COLOR_DEPTH_DEFAULT );
+    mBottomContentArea = Actor::New();
+    mBottomContentArea.SetSize( stageSize.x, contentHeight );
+    mBottomContentArea.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
+    mBottomContentArea.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
+    stage.Add( mBottomContentArea );
 
-    // Create a image view as source actor to be renderer to the native image source
-    Actor sourceActor = ImageView::New(JPG_FILENAME);
-    sourceActor.SetParentOrigin( ParentOrigin::CENTER);
-    sourceActor.SetAnchorPoint( AnchorPoint::CENTER );
-    sourceActor.SetY( - (imageSize.height-buttonHeight)/2.f );
-    stage.Add( sourceActor );
+    mSourceActor = ImageView::New(JPG_FILENAME);
+    mSourceActor.SetParentOrigin( ParentOrigin::CENTER);
+    mSourceActor.SetAnchorPoint( AnchorPoint::CENTER );
+    mTopContentArea.Add( mSourceActor );
 
     Animation animation = Animation::New(2.f);
     Degree relativeRotationDegrees(90.0f);
     Radian relativeRotationRadians(relativeRotationDegrees);
-    animation.AnimateTo( Property( sourceActor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::ZAXIS ), AlphaFunction::LINEAR, TimePeriod(0.f, 0.5f));
-    animation.AnimateBy( Property( sourceActor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::ZAXIS ), AlphaFunction::LINEAR, TimePeriod(0.5f, 0.5f));
-    animation.AnimateBy( Property( sourceActor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::ZAXIS ), AlphaFunction::LINEAR, TimePeriod(1.f, 0.5f));
-    animation.AnimateBy( Property( sourceActor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::ZAXIS ), AlphaFunction::LINEAR, TimePeriod(1.5f, 0.5f));
+    animation.AnimateTo( Property( mSourceActor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::ZAXIS ), AlphaFunction::LINEAR, TimePeriod(0.f, 0.5f));
+    animation.AnimateBy( Property( mSourceActor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::ZAXIS ), AlphaFunction::LINEAR, TimePeriod(0.5f, 0.5f));
+    animation.AnimateBy( Property( mSourceActor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::ZAXIS ), AlphaFunction::LINEAR, TimePeriod(1.f, 0.5f));
+    animation.AnimateBy( Property( mSourceActor, Actor::Property::ORIENTATION ), Quaternion( relativeRotationRadians, Vector3::ZAXIS ), AlphaFunction::LINEAR, TimePeriod(1.5f, 0.5f));
     animation.SetLooping(true);
     animation.Play();
 
-    // create a offscreen renderer task to render content into the native image source
-    Texture nativeTexture = Texture::New( *nativeImageSourcePtr );
-    // Create a FrameBuffer object with no default attachments.
-    FrameBuffer targetBuffer = FrameBuffer::New( nativeTexture.GetWidth(), nativeTexture.GetHeight(), FrameBuffer::Attachment::NONE );
-    // Add a color attachment to the FrameBuffer object.
-    targetBuffer.AttachColorTexture( nativeTexture );
-
-    CameraActor cameraActor = CameraActor::New(imageSize);
-    cameraActor.SetParentOrigin(ParentOrigin::TOP_CENTER);
-    cameraActor.SetParentOrigin( AnchorPoint::TOP_CENTER );
-    cameraActor.SetY( buttonHeight + imageSize.height/2.f );
-    stage.Add(cameraActor);
-
-    RenderTaskList taskList = stage.GetRenderTaskList();
-    mOffscreenRenderTask = taskList.CreateTask();
-    mOffscreenRenderTask.SetSourceActor( sourceActor );
-    mOffscreenRenderTask.SetClearColor( Color::WHITE );
-    mOffscreenRenderTask.SetClearEnabled(true);
-    mOffscreenRenderTask.SetCameraActor(cameraActor);
-    mOffscreenRenderTask.GetCameraActor().SetInvertYAxis(true);
-    mOffscreenRenderTask.SetFrameBuffer( targetBuffer );
-    mOffscreenRenderTask.SetRefreshRate( RenderTask::REFRESH_ALWAYS );
-
-    // Display the native image on the screen
-    Actor nativeImageActor = CreateNativeActor( nativeTexture, *nativeImageSourcePtr );
-    nativeImageActor.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
-    nativeImageActor.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-    stage.Add( nativeImageActor );
-
-    TextLabel textLabel1 = TextLabel::New( "Resource Image" );
-    textLabel1.SetParentOrigin( ParentOrigin::TOP_CENTER );
+    TextLabel textLabel1 = TextLabel::New( "Image" );
+    textLabel1.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
     textLabel1.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-    nativeImageActor.Add( textLabel1 );
+    mTopContentArea.Add( textLabel1 );
+
+    // Wait until button press before creating mOffscreenRenderTask
 
     TextLabel textLabel2 = TextLabel::New( "Native Image" );
     textLabel2.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
     textLabel2.SetAnchorPoint( AnchorPoint::BOTTOM_CENTER );
-    nativeImageActor.Add( textLabel2 );
-
-    return false;
+    mBottomContentArea.Add( textLabel2 );
   }
 
-  bool OnButtonSelected( Toolkit::Button button )
+  void SetupNativeImage()
   {
-    bool isSelected = mButtonRefreshAlways.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
+    if( ! mOffscreenRenderTask )
+    {
+      Stage stage = Stage::GetCurrent();
+      Vector2 stageSize = stage.GetSize();
+
+      float contentHeight( (stageSize.y - BUTTON_HEIGHT)/2.0f );
+      Vector2 imageSize( stageSize.x, contentHeight );
+
+      mNativeImageSourcePtr = NativeImageSource::New( imageSize.width, imageSize.height, NativeImageSource::COLOR_DEPTH_DEFAULT );
+      mNativeTexture = Texture::New( *mNativeImageSourcePtr );
+
+      mFrameBuffer = FrameBuffer::New( mNativeTexture.GetWidth(), mNativeTexture.GetHeight(), FrameBuffer::Attachment::NONE );
+      mFrameBuffer.AttachColorTexture( mNativeTexture );
+
+      mCameraActor = CameraActor::New( imageSize );
+      mCameraActor.SetParentOrigin( ParentOrigin::CENTER );
+      mCameraActor.SetParentOrigin( AnchorPoint::CENTER );
+      mTopContentArea.Add( mCameraActor );
+
+      RenderTaskList taskList = stage.GetRenderTaskList();
+      mOffscreenRenderTask = taskList.CreateTask();
+      mOffscreenRenderTask.SetSourceActor( mSourceActor );
+      mOffscreenRenderTask.SetClearColor( Color::WHITE );
+      mOffscreenRenderTask.SetClearEnabled( true );
+      mOffscreenRenderTask.SetCameraActor( mCameraActor );
+      mOffscreenRenderTask.GetCameraActor().SetInvertYAxis( true );
+      mOffscreenRenderTask.SetFrameBuffer( mFrameBuffer );
+    }
 
-    Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( button );
-    if( pushButton == mButtonRefreshAlways )
+    if( mRefreshAlways )
     {
-      if( isSelected )
-      {
-        mOffscreenRenderTask.SetRefreshRate( RenderTask::REFRESH_ALWAYS );
-      }
-      else
+      mOffscreenRenderTask.SetRefreshRate( RenderTask::REFRESH_ALWAYS );
+    }
+    else
+    {
+      mOffscreenRenderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
+    }
+  }
+
+  void SetupDisplayActor( bool show )
+  {
+    if( show )
+    {
+      if( ! mDisplayActor )
       {
-        mOffscreenRenderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
+        // Make sure we have something to display
+        SetupNativeImage();
+
+        mDisplayActor = Actor::New();
+        mDisplayActor.SetParentOrigin( ParentOrigin::CENTER );
+        mDisplayActor.SetAnchorPoint( AnchorPoint::CENTER );
+
+        Geometry geometry = DemoHelper::CreateTexturedQuad();
+
+        Shader shader = CreateShader( *mNativeImageSourcePtr );
+
+        Renderer renderer = Renderer::New( geometry, shader );
+
+        TextureSet textureSet = TextureSet::New();
+        textureSet.SetTexture( 0u, mNativeTexture );
+        renderer.SetTextures( textureSet );
+
+        mDisplayActor.AddRenderer( renderer );
+        mDisplayActor.SetSize( mNativeTexture.GetWidth(), mNativeTexture.GetHeight() );
+
+        mBottomContentArea.Add( mDisplayActor );
       }
     }
+    else
+    {
+      UnparentAndReset( mDisplayActor );
+    }
+  }
+
+  void Capture()
+  {
+    mRefreshAlways = false;
+    SetupNativeImage();
+
+    mOffscreenRenderTask.FinishedSignal().Connect( this, &NativeImageSourceController::DoCapture );
+  }
+
+  void DoCapture(RenderTask& task)
+  {
+    task.FinishedSignal().Disconnect( this, &NativeImageSourceController::DoCapture );
+
+    mNativeImageSourcePtr->EncodeToFile( CAPTURE_FILENAME );
+  }
+
+  void Reset()
+  {
+    SetupDisplayActor( false );
+
+    Stage stage = Stage::GetCurrent();
+    RenderTaskList taskList = stage.GetRenderTaskList();
+    taskList.RemoveTask( mOffscreenRenderTask );
+    mOffscreenRenderTask.Reset();
+    mCameraActor.Reset();
+
+    mFrameBuffer.Reset();
+    mNativeTexture.Reset();
+    mNativeImageSourcePtr.Reset();
+  }
+
+  bool OnButtonSelected( Toolkit::Button button )
+  {
+    Toolkit::PushButton pushButton = Toolkit::PushButton::DownCast( button );
+
+    if( pushButton == mButtonShow )
+    {
+      bool isSelected = mButtonShow.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
+
+      SetupDisplayActor( isSelected );
+    }
+    else if( pushButton == mButtonRefreshAlways )
+    {
+      bool isSelected = mButtonRefreshAlways.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
+
+      mRefreshAlways = isSelected;
+      SetupNativeImage();
+    }
     else if( pushButton == mButtonRefreshOnce )
     {
+      bool isSelected = mButtonRefreshAlways.GetProperty( Toolkit::Button::Property::SELECTED ).Get<bool>();
+
       if( isSelected )
       {
         mButtonRefreshAlways.SetProperty( Button::Property::SELECTED, false );
       }
-      mOffscreenRenderTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
+
+      mRefreshAlways = false;
+      SetupNativeImage();
+    }
+    else if( pushButton == mButtonCapture )
+    {
+      Capture();
+    }
+    else if( pushButton == mButtonReset )
+    {
+      Reset();
     }
 
     return true;
@@ -284,11 +407,31 @@ public:
   }
 
 private:
+
   Application&  mApplication;
-  RenderTask mOffscreenRenderTask;
+
+  Layer mButtonArea;
+  Actor mTopContentArea;
+  Actor mBottomContentArea;
+
+  PushButton mButtonShow;
   PushButton mButtonRefreshAlways;
   PushButton mButtonRefreshOnce;
+  PushButton mButtonCapture;
+  PushButton mButtonReset;
+
+  Actor mSourceActor;
+
+  NativeImageSourcePtr mNativeImageSourcePtr;
+  Texture              mNativeTexture;
+  FrameBuffer          mFrameBuffer;
+
+  RenderTask mOffscreenRenderTask;
+  CameraActor mCameraActor;
+
+  Actor mDisplayActor;
 
+  bool mRefreshAlways;
 };
 
 void RunTest( Application& application )
index 7c8a602..9a2aa51 100644 (file)
@@ -26,6 +26,7 @@
 #include <dali-toolkit/devel-api/focus-manager/keyinput-focus-manager.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 
 using namespace Dali;
 using namespace Dali::Toolkit;
@@ -102,7 +103,7 @@ void MyControl::SetProperty( BaseObject* object, Property::Index index, const Pr
 
         if ( iconVisual )
         {
-          impl.RegisterVisual( index, iconVisual );
+          DevelControl::RegisterVisual( impl, index, iconVisual );
         }
         break;
       }
@@ -123,7 +124,8 @@ Property::Value MyControl::GetProperty( BaseObject* object, Property::Index prop
       case Demo::MyControl::Property::ICON_VISUAL:
       {
         Property::Map map;
-        Toolkit::Visual::Base visual =  GetImpl( myControl ).GetVisual( propertyIndex );
+        MyControl& impl = GetImpl( myControl );
+        Toolkit::Visual::Base visual =  DevelControl::GetVisual( impl, propertyIndex );
         if ( visual )
         {
           visual.CreatePropertyMap( map ); // Creates a Property map containing the Visual that ICON_VISUAL currently is. Can change if state changes.
index 2d2f48c..b0d9dbb 100644 (file)
@@ -18,6 +18,7 @@
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali-toolkit/devel-api/align-enums.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 
@@ -104,7 +105,7 @@ void ImageChannelControl::SetImage( const std::string& url )
   properties[Dali::Toolkit::ImageVisual::Property::URL] = url;
 
   mVisual = Toolkit::VisualFactory::Get().CreateVisual( properties );
-  RegisterVisual( Demo::ImageChannelControl::Property::IMAGE_VISUAL, mVisual );
+  Toolkit::DevelControl::RegisterVisual( *this, Demo::ImageChannelControl::Property::IMAGE_VISUAL, mVisual );
   mVisual.SetName("imageVisual");
 
   RelayoutRequest();
@@ -127,14 +128,14 @@ void ImageChannelControl::SetVisibility( bool visibility )
     {
       if( mDisableVisibilityTransition.Count() > 0 )
       {
-        mAnimation = CreateTransition( mDisableVisibilityTransition );
+        mAnimation = Toolkit::DevelControl::CreateTransition( *this, mDisableVisibilityTransition );
       }
     }
     else
     {
       if( mEnableVisibilityTransition.Count() > 0 )
       {
-        mAnimation = CreateTransition( mEnableVisibilityTransition );
+        mAnimation = Toolkit::DevelControl::CreateTransition( *this, mEnableVisibilityTransition );
       }
     }
   }
@@ -236,7 +237,7 @@ void ImageChannelControl::SetProperty( BaseObject* object, Property::Index index
         if( map )
         {
           impl.mVisual = Toolkit::VisualFactory::Get().CreateVisual( *map );
-          impl.RegisterVisual( Demo::ImageChannelControl::Property::IMAGE_VISUAL, impl.mVisual );
+          Toolkit::DevelControl::RegisterVisual( impl, Demo::ImageChannelControl::Property::IMAGE_VISUAL, impl.mVisual );
         }
         break;
       }
index e24041a..edcfbec 100644 (file)
@@ -21,6 +21,7 @@
 #include <dali-toolkit/devel-api/align-enums.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 
 #include <cstdio>
 
@@ -124,7 +125,7 @@ bool ShadowButton::GetActiveState()
 void ShadowButton::SetCheckState( bool checkState )
 {
   mCheckState = checkState;
-  EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, true );
+  DevelControl::EnableVisual( *this, Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, true );
   if( Self().OnStage() )
   {
     if( checkState )
@@ -157,7 +158,7 @@ void ShadowButton::StartTransition( Property::Index transitionId )
       iter->mAnimation.FinishedSignal().Disconnect( this, &ShadowButton::OnTransitionFinished );
     }
 
-    iter->mAnimation = CreateTransition( iter->mTransitionData );
+    iter->mAnimation = DevelControl::CreateTransition( *this, iter->mTransitionData );
     StoreTargetLayouts( iter->mTransitionData );
 
     iter->mAnimation.FinishedSignal().Connect( this, &ShadowButton::OnTransitionFinished );
@@ -189,7 +190,7 @@ void ShadowButton::OnTransitionFinished( Animation& src )
         }
         case Demo::ShadowButton::Property::UNCHECK_TRANSITION:
         {
-          EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, false );
+          DevelControl::EnableVisual( *this, Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, false );
           break;
         }
       }
@@ -352,25 +353,25 @@ void ShadowButton::ResetVisual(
     {
       case Demo::ShadowButton::Property::BACKGROUND_VISUAL:
       {
-        RegisterVisual( index, visual );
+        DevelControl::RegisterVisual( *this, index, visual );
         visual.SetDepthIndex(0.0f);
         break;
       }
       case Demo::ShadowButton::Property::CHECKBOX_BG_VISUAL:
       {
-        RegisterVisual( index, visual );
+        DevelControl::RegisterVisual( *this, index, visual );
         visual.SetDepthIndex(1.0f);
         break;
       }
       case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL:
       {
-        RegisterVisual( index, visual, mCheckState );
+        DevelControl::RegisterVisual( *this, index, visual, mCheckState );
         visual.SetDepthIndex(2.0f);
         break;
       }
       case Demo::ShadowButton::Property::LABEL_VISUAL:
       {
-        RegisterVisual( index, visual );
+        DevelControl::RegisterVisual( *this, index, visual );
         visual.SetDepthIndex(1.0f);
         break;
       }
@@ -496,7 +497,7 @@ void ShadowButton::SetProperty( BaseObject* object, Property::Index index, const
       case Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL:
       {
         impl.ResetVisual( index, impl.mCheckboxFgVisual, value );
-        impl.EnableVisual( Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, impl.mCheckState );
+        DevelControl::EnableVisual( impl, Demo::ShadowButton::Property::CHECKBOX_FG_VISUAL, impl.mCheckState );
         break;
       }
       case Demo::ShadowButton::Property::LABEL_VISUAL:
index ef0c56d..d160e5b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
@@ -18,6 +18,7 @@
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali-toolkit/devel-api/align-enums.h>
+#include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 
@@ -102,7 +103,7 @@ void BeatControl::StartBounceAnimation()
     OnBounceAnimationFinished(mAnimation);
   }
 
-  mAnimation = CreateTransition( mBounceTransition );
+  mAnimation = DevelControl::CreateTransition( *this, mBounceTransition );
   mAnimation.FinishedSignal().Connect( this, &BeatControl::OnBounceAnimationFinished );
   mAnimation.Play();
   mAnimationPlaying |= BOUNCE_ANIMATION_RUNNING;
@@ -118,7 +119,7 @@ void BeatControl::StartXAnimation()
     OnXAnimationFinished(mXAnimation);
   }
 
-  mXAnimation = CreateTransition( mLeftTransition );
+  mXAnimation = DevelControl::CreateTransition( *this, mLeftTransition );
   mXAnimation.FinishedSignal().Connect( this, &BeatControl::OnXAnimationFinished );
   mXAnimation.Play();
   mAnimationPlaying |= X_ANIMATION_RUNNING;
@@ -133,7 +134,7 @@ void BeatControl::StartYAnimation()
     OnYAnimationFinished(mYAnimation);
   }
 
-  mYAnimation = CreateTransition( mUpTransition );
+  mYAnimation = DevelControl::CreateTransition( *this, mUpTransition );
   mYAnimation.FinishedSignal().Connect( this, &BeatControl::OnYAnimationFinished );
   mYAnimation.Play();
   mAnimationPlaying |= Y_ANIMATION_RUNNING;
@@ -148,7 +149,7 @@ void BeatControl::StartFadeAnimation()
     OnFadeAnimationFinished(mFadeAnimation);
   }
 
-  mFadeAnimation = CreateTransition( mFadeTransition );
+  mFadeAnimation = DevelControl::CreateTransition( *this, mFadeTransition );
   mFadeAnimation.FinishedSignal().Connect( this, &BeatControl::OnFadeAnimationFinished );
   mFadeAnimation.Play();
   mAnimationPlaying |= FADE_ANIMATION_RUNNING;
@@ -276,7 +277,7 @@ void BeatControl::SetProperty( BaseObject* object, Property::Index index, const
           {
             // Only register a visual if there is more than just a size setting
             impl.mVisual = Toolkit::VisualFactory::Get().CreateVisual( *map );
-            impl.RegisterVisual( Demo::BeatControl::Property::BEAT_VISUAL, impl.mVisual );
+            DevelControl::RegisterVisual( impl, Demo::BeatControl::Property::BEAT_VISUAL, impl.mVisual );
 
             // We have registered a new visual: must trigger size negotiation
             // in order to call SetTransformAndSize on the visual with the right size:
index e787d56..4bedd00 100755 (executable)
@@ -2,7 +2,7 @@
 
 Name:       com.samsung.dali-demo
 Summary:    The OpenGLES Canvas Core Demo
-Version:    1.2.39
+Version:    1.2.41
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0