[AT-SPI] Squashed implementation
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / shadow-view / shadow-view-impl.cpp
index 90ff3f4..b22bff0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -22,7 +22,7 @@
 #include <sstream>
 #include <iomanip>
 #include <dali/public-api/animation/constraint.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/common/stage.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
@@ -34,6 +34,7 @@
 #include <dali-toolkit/internal/controls/control/control-renderers.h>
 #include <dali-toolkit/internal/controls/shadow-view/shadow-view-impl.h>
 #include <dali-toolkit/internal/filters/blur-two-pass-filter.h>
+#include <dali-toolkit/internal/controls/control/control-data-impl.h>
 
 // TODO:
 // pixel format / size - set from JSON
@@ -131,6 +132,10 @@ ShadowView::ShadowView( float downsampleWidthScale, float downsampleHeightScale
   mDownsampleWidthScale(downsampleWidthScale),
   mDownsampleHeightScale(downsampleHeightScale)
 {
+  DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) {
+    return std::unique_ptr< Dali::Accessibility::Accessible >(
+      new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::FILLER ) );
+  } );
 }
 
 ShadowView::~ShadowView()
@@ -169,7 +174,7 @@ void ShadowView::SetShadowPlaneBackground(Actor shadowPlaneBackground)
   // position, instead parent the shadow plane drawable on the shadow plane passed in.
   mShadowPlaneBg.Add( mShadowPlane );
   mShadowPlane.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
-  mShadowPlane.SetZ( 1.0f );
+  mShadowPlane.SetProperty( Actor::Property::POSITION_Z,  1.0f );
 
   ConstrainCamera();
 
@@ -209,7 +214,7 @@ void ShadowView::SetShadowColor(Vector4 color)
 
 void ShadowView::Activate()
 {
-  DALI_ASSERT_ALWAYS( Self().OnStage() && "ShadowView should be on stage before calling Activate()\n" );
+  DALI_ASSERT_ALWAYS( Self().GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) && "ShadowView should be on stage before calling Activate()\n" );
 
   // make sure resources are allocated and start the render tasks processing
   CreateRenderTasks();
@@ -217,7 +222,7 @@ void ShadowView::Activate()
 
 void ShadowView::Deactivate()
 {
-  DALI_ASSERT_ALWAYS( Self().OnStage() && "ShadowView should be on stage before calling Deactivate()\n" )
+  DALI_ASSERT_ALWAYS( Self().GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) && "ShadowView should be on stage before calling Deactivate()\n" )
 
   // stop render tasks processing
   // Note: render target resources are automatically freed since we set the Image::Unused flag
@@ -244,7 +249,7 @@ void ShadowView::OnInitialize()
   mCameraActor.SetNearClippingPlane( 1.0f );
   mCameraActor.SetType( Dali::Camera::FREE_LOOK ); // Camera orientation constrained to point at shadow plane world position
   mCameraActor.SetProperty( Actor::Property::ORIENTATION, Quaternion(Radian(Degree(180)), Vector3::YAXIS) );
-  mCameraActor.SetPosition(DEFAULT_LIGHT_POSITION);
+  mCameraActor.SetProperty( Actor::Property::POSITION, DEFAULT_LIGHT_POSITION );
 
   // Create render targets needed for rendering from light's point of view
   mSceneFromLightRenderTarget = FrameBuffer::New( stageSize.width, stageSize.height, FrameBuffer::Attachment::NONE );