Further Setter/Getter public API removal from Dali::Actor
[platform/core/uifw/dali-demo.git] / examples / magnifier / magnifier-example.cpp
index fb461b5..0f0f08f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 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.
@@ -173,6 +173,7 @@ public:
   : mApplication( application ),
     mView(),
     mAnimationTime(0.0f),
+    mAnimationTimeProperty( Property::INVALID_INDEX ),
     mMagnifierShown(false)
   {
     // Connect to the Application's Init signal
@@ -212,21 +213,21 @@ public:
                                        TOOLBAR_IMAGE,
                                        APPLICATION_TITLE );
 
-    mContent.SetLeaveRequired(true);
+    mContent.SetProperty( Actor::Property::LEAVE_REQUIRED,true);
     mContent.TouchSignal().Connect( this, &ExampleController::OnTouched );
 
     // Create magnifier (controlled by human touch)
     Layer overlay = Layer::New();
-    overlay.SetSensitive(false);
-    overlay.SetParentOrigin( ParentOrigin::CENTER );
-    overlay.SetSize(mStageSize);
+    overlay.SetProperty( Actor::Property::SENSITIVE,false);
+    overlay.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+    overlay.SetProperty( Actor::Property::SIZE, mStageSize);
     Stage::GetCurrent().Add(overlay);
 
     mMagnifier = Toolkit::Magnifier::New();
     mMagnifier.SetSourceActor( mView );
-    mMagnifier.SetSize( MAGNIFIER_SIZE * mStageSize.width );  // Size of magnifier is in relation to stage width
+    mMagnifier.SetProperty( Actor::Property::SIZE, MAGNIFIER_SIZE * mStageSize.width );  // Size of magnifier is in relation to stage width
     mMagnifier.SetProperty( Toolkit::Magnifier::Property::MAGNIFICATION_FACTOR, MAGNIFICATION_FACTOR );
-    mMagnifier.SetScale(Vector3::ZERO);
+    mMagnifier.SetProperty( Actor::Property::SCALE,Vector3::ZERO);
     overlay.Add( mMagnifier );
 
     // Apply constraint to animate the position of the magnifier.
@@ -241,7 +242,7 @@ public:
     // Create bouncing magnifier automatically bounces around screen.
     mBouncingMagnifier = Toolkit::Magnifier::New();
     mBouncingMagnifier.SetSourceActor( mView );
-    mBouncingMagnifier.SetSize( MAGNIFIER_SIZE * mStageSize.width ); // Size of magnifier is in relation to stage width
+    mBouncingMagnifier.SetProperty( Actor::Property::SIZE, MAGNIFIER_SIZE * mStageSize.width ); // Size of magnifier is in relation to stage width
     mBouncingMagnifier.SetProperty( Toolkit::Magnifier::Property::MAGNIFICATION_FACTOR, MAGNIFICATION_FACTOR );
     overlay.Add( mBouncingMagnifier );
 
@@ -373,7 +374,7 @@ public:
     Vector3 glassPosition(position);
     glassPosition.y -= mStageSize.width * MAGNIFIER_SIZE.height * 0.5f + Stage::GetCurrent().GetDpi().height * FINGER_RADIUS_INCHES;
 
-    mMagnifier.SetPosition( glassPosition );
+    mMagnifier.SetProperty( Actor::Property::POSITION, glassPosition );
   }
 
   void OnKeyEvent(const KeyEvent& event)
@@ -401,20 +402,10 @@ private:
 
 };
 
-void RunTest( Application& application )
-{
-  ExampleController 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, DEMO_THEME_PATH );
-
-  RunTest( application );
-
+  ExampleController test( application );
+  application.MainLoop();
   return 0;
 }