DALi Version 1.3.38
[platform/core/uifw/dali-demo.git] / examples / magnifier / magnifier-example.cpp
index 4433e59..d319540 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
@@ -213,7 +214,7 @@ public:
                                        APPLICATION_TITLE );
 
     mContent.SetLeaveRequired(true);
-    mContent.TouchedSignal().Connect( this, &ExampleController::OnTouched );
+    mContent.TouchSignal().Connect( this, &ExampleController::OnTouched );
 
     // Create magnifier (controlled by human touch)
     Layer overlay = Layer::New();
@@ -300,33 +301,32 @@ public:
    * @param[in] actor The actor that received the touch
    * @param[in] event The touch-event information
    */
-  bool OnTouched( Actor actor, const TouchEvent& event )
+  bool OnTouched( Actor actor, const TouchData& event )
   {
     if(event.GetPointCount() > 0)
     {
-      const TouchPoint& point = event.GetPoint(0);
-      switch(point.state)
+      switch( event.GetState( 0 ) )
       {
-        case TouchPoint::Down:
-        case TouchPoint::Motion:
+        case PointState::DOWN:
+        case PointState::MOTION:
         {
           ShowMagnifier();
           break;
         }
-        case TouchPoint::Up:
-        case TouchPoint::Leave:
-        case TouchPoint::Interrupted:
+        case PointState::UP:
+        case PointState::LEAVE:
+        case PointState::INTERRUPTED:
         {
           HideMagnifier();
           break;
         }
-        default:
+        case PointState::STATIONARY:
         {
           break;
         }
       } // end switch
 
-      Vector3 touchPoint(point.screen);
+      Vector3 touchPoint( event.GetScreenPosition( 0 ) );
 
       SetMagnifierPosition(touchPoint - mStageSize * 0.5f);
     }
@@ -402,20 +402,10 @@ private:
 
 };
 
-void RunTest( Application& application )
+int DALI_EXPORT_API main( int argc, char **argv )
 {
+  Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
   ExampleController test( application );
-
   application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
-int main( int argc, char **argv )
-{
-  Application application = Application::New( &argc, &argv, DEMO_THEME_PATH );
-
-  RunTest( application );
-
   return 0;
 }