Remove use of deprecated Control flag REQUIRES_STYLE_CHANGE_SIGNALS
[platform/core/uifw/dali-demo.git] / examples / styling / image-channel-control-impl.cpp
index 155e145..40065ce 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.
@@ -37,12 +37,11 @@ const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   uniform sampler2D sTexture;\n
   uniform mediump vec4 uColor;\n
   uniform mediump vec3 mixColor;\n
-  uniform mediump float opacity;\n
   uniform mediump vec3 uChannels;\n
   \n
   void main()\n
   {\n
-      gl_FragColor = texture2D( sTexture, vTexCoord ) * vec4(mixColor,opacity) * uColor * vec4(uChannels, 1.0) ;\n
+      gl_FragColor = texture2D( sTexture, vTexCoord ) * vec4(mixColor,1.0) * uColor * vec4(uChannels, 1.0) ;\n
   }\n
 );
 
@@ -69,7 +68,7 @@ DALI_TYPE_REGISTRATION_END();
 
 
 Internal::ImageChannelControl::ImageChannelControl()
-: Control( ControlBehaviour( REQUIRES_STYLE_CHANGE_SIGNALS ) ),
+: Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
   mChannels( 1.0f, 1.0f, 1.0f ),
   mChannelIndex( Property::INVALID_INDEX ),
   mVisibility(true),
@@ -111,7 +110,7 @@ void ImageChannelControl::SetImage( const std::string& url )
 
 void ImageChannelControl::SetVisibility( bool visibility )
 {
-  printf("ImageChannelControl %s: SetVisibility( %s )\n", Self().GetName().c_str(), visibility?"T":"F" );
+  printf("ImageChannelControl %s: SetVisibility( %s )\n", Self().GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str(), visibility?"T":"F" );
 
   if( mAnimation )
   {
@@ -161,14 +160,14 @@ void ImageChannelControl::OnInitialize()
   mChannelIndex = self.RegisterProperty( "uChannels", Vector3(1.0f, 1.0f, 1.0f) );
 }
 
-void ImageChannelControl::OnStageConnection( int depth )
+void ImageChannelControl::OnSceneConnection( int depth )
 {
-  Control::OnStageConnection( depth );
+  Control::OnSceneConnection( depth );
 }
 
-void ImageChannelControl::OnStageDisconnection()
+void ImageChannelControl::OnSceneDisconnection()
 {
-  Control::OnStageDisconnection();
+  Control::OnSceneDisconnection();
 }
 
 void ImageChannelControl::OnSizeSet( const Vector3& targetSize )