Further Setter/Getter public API removal from Dali::Actor
[platform/core/uifw/dali-demo.git] / examples / alpha-blending-cpu / alpha-blending-cpu-example.cpp
index 35a71fc..2389c93 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 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.
@@ -16,8 +16,6 @@
  */
 
 #include <dali-toolkit/dali-toolkit.h>
-#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
-#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
 #include <cstring>
 
 using namespace Dali;
@@ -62,21 +60,21 @@ private:
 
     mImageView = Toolkit::ImageView::New();
 
-    mImageView.SetSize(200, 200);
-    mImageView.SetParentOrigin( ParentOrigin::CENTER );
+    mImageView.SetProperty( Actor::Property::SIZE, Vector2(200, 200) );
+    mImageView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
     stage.Add(mImageView);
 
     mImageLabel = Toolkit::TextLabel::New();
-    mImageLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
-    mImageLabel.SetAnchorPoint( ParentOrigin::BOTTOM_CENTER );
-    mImageLabel.SetPosition( Vector3( 0.0f, -50.0f, 0.0f ) );
+    mImageLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+    mImageLabel.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::BOTTOM_CENTER );
+    mImageLabel.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, -50.0f, 0.0f ) );
     mImageLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLACK );
     stage.Add(mImageLabel);
 
     mMaskLabel = Toolkit::TextLabel::New();
-    mMaskLabel.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
-    mMaskLabel.SetAnchorPoint( ParentOrigin::BOTTOM_CENTER );
-    mMaskLabel.SetPosition( Vector3( 0.0f, 0.0f, 0.0f ) );
+    mMaskLabel.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_CENTER );
+    mMaskLabel.SetProperty( Actor::Property::ANCHOR_POINT, ParentOrigin::BOTTOM_CENTER );
+    mMaskLabel.SetProperty( Actor::Property::POSITION, Vector3( 0.0f, 0.0f, 0.0f ) );
     mMaskLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Color::BLACK );
     stage.Add(mMaskLabel);
 
@@ -112,17 +110,17 @@ private:
     Property::Map map;
     map.Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::Type::IMAGE );
     map.Add( Toolkit::ImageVisual::Property::URL, image );
-    map.Add( Toolkit::DevelImageVisual::Property::ALPHA_MASK_URL, mask );
+    map.Add( Toolkit::ImageVisual::Property::ALPHA_MASK_URL, mask );
 
     if( mImageCombinationIndex%2 == 0 )
     {
-      map.Add( Toolkit::DevelImageVisual::Property::MASK_CONTENT_SCALE, 1.f );
-      map.Add( Toolkit::DevelImageVisual::Property::CROP_TO_MASK, false );
+      map.Add( Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE, 1.f );
+      map.Add( Toolkit::ImageVisual::Property::CROP_TO_MASK, false );
     }
     else
     {
-      map.Add( Toolkit::DevelImageVisual::Property::MASK_CONTENT_SCALE, 1.6f );
-      map.Add( Toolkit::DevelImageVisual::Property::CROP_TO_MASK, true );
+      map.Add( Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE, 1.6f );
+      map.Add( Toolkit::ImageVisual::Property::CROP_TO_MASK, true );
     }
 
     mImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, map );
@@ -152,20 +150,10 @@ private:
   int mImageCombinationIndex;
 };
 
-void RunTest( Application& application )
-{
-  ImageViewAlphaBlendApp test( application );
-
-  application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
 int DALI_EXPORT_API main( int argc, char **argv )
 {
   Application application = Application::New( &argc, &argv );
-
-  RunTest( application );
-
+  ImageViewAlphaBlendApp test( application );
+  application.MainLoop();
   return 0;
 }