Merge "Removing unused variables" into devel/master
[platform/core/uifw/dali-demo.git] / examples / image-view-url / image-view-url-example.cpp
index 58d0910..86f639e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 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.
@@ -71,9 +71,9 @@ private:
   // The Init signal is received once (only) during the Application lifetime
   void Create( Application& application )
   {
-    // Get a handle to the stage
-    Stage stage = Stage::GetCurrent();
-    stage.KeyEventSignal().Connect(this, &ImageViewUrlApp::OnKeyEvent);
+    // Get a handle to the window
+    Window window = application.GetWindow();
+    window.KeyEventSignal().Connect(this, &ImageViewUrlApp::OnKeyEvent);
 
     Toolkit::ToolBar toolBar;
     Toolkit::Control background;
@@ -107,18 +107,18 @@ private:
 
   void CreateRenderTask( const std::string& url )
   {
-    auto rootActor = Stage::GetCurrent().GetRootLayer();
+    auto rootActor = mApplication.GetWindow().GetRootLayer();
 
     auto cameraActor = CameraActor::New(TARGET_SIZE);
-    cameraActor.SetParentOrigin(ParentOrigin::CENTER);
+    cameraActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
     cameraActor.SetInvertYAxis(true);
     rootActor.Add(cameraActor);
 
     {
       // create actor to render input with applied shader
       mActorForInput = Toolkit::ImageView::New( url );
-      mActorForInput.SetParentOrigin(ParentOrigin::CENTER);
-      mActorForInput.SetSize(TARGET_SIZE);
+      mActorForInput.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+      mActorForInput.SetProperty( Actor::Property::SIZE, TARGET_SIZE);
       Property::Map customShader;
       customShader[Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = FILTER_FRAGMENT_SOURCE;
       Property::Map visualMap;
@@ -129,7 +129,7 @@ private:
 
       rootActor.Add(mActorForInput);
 
-      RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+      RenderTaskList taskList = mApplication.GetWindow().GetRenderTaskList();
 
       // perform a horizontal blur targeting the internal buffer
       auto renderTask = taskList.CreateTask();
@@ -166,8 +166,8 @@ private:
     auto url = Dali::Toolkit::TextureManager::AddTexture(mOutputTexture);
     mImageView = Toolkit::ImageView::New(url);
 
-    mImageView.SetParentOrigin(ParentOrigin::CENTER);
-    mImageView.SetAnchorPoint(AnchorPoint::CENTER);
+    mImageView.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+    mImageView.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
     mContent.Add(mImageView);
   }
 
@@ -186,7 +186,7 @@ private:
 
   void OnKeyEvent(const KeyEvent& event)
   {
-    if(event.state == KeyEvent::Down)
+    if(event.GetState() == KeyEvent::DOWN)
     {
       if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) )
       {