Changes after TouchedSignal changes
[platform/core/uifw/dali-demo.git] / examples / ray-marching / ray-marching-example.cpp
index 39f97df..39caa42 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.
@@ -113,20 +113,17 @@ public:
   // 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();
+    // Get a handle to the window
+    Window window = application.GetWindow();
 
-    stage.GetRootLayer().TouchSignal().Connect( this, &RayMarchingExample::OnTouch );
+    window.GetRootLayer().TouchedSignal().Connect( this, &RayMarchingExample::OnTouch );
 
-    stage.KeyEventSignal().Connect(this, &RayMarchingExample::OnKeyEvent);
+    window.KeyEventSignal().Connect(this, &RayMarchingExample::OnKeyEvent);
 
-    stage.SetBackgroundColor( Color::YELLOW );
-
-    // Hide the indicator bar
-    application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
+    window.SetBackgroundColor( Color::YELLOW );
 
     // Creates a default view with a default tool bar.
-    // The view is added to the stage.
+    // The view is added to the window.
     mContentLayer = DemoHelper::CreateView( application,
                                             mView,
                                             mToolBar,
@@ -135,12 +132,12 @@ public:
                                             APPLICATION_TITLE );
 
     // Add an extra space on the right to center the title text.
-    mToolBar.AddControl( Actor::New(), DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HorizontalRight );
+    mToolBar.AddControl( Actor::New(), DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage, Toolkit::Alignment::HORIZONTAL_RIGHT );
 
     AddContentLayer();
 
   }
-  bool OnTouch( Actor actor, const TouchData& touch )
+  bool OnTouch( Actor actor, const TouchEvent& touch )
   {
     // quit the application
     mApplication.Quit();
@@ -152,7 +149,7 @@ public:
    */
   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) )
       {
@@ -171,7 +168,7 @@ public:
 
     Property::Map vertexFormat;
     vertexFormat["aPosition"] = Property::VECTOR2;
-    PropertyBuffer vertexBuffer = PropertyBuffer::New( vertexFormat );
+    VertexBuffer vertexBuffer = VertexBuffer::New( vertexFormat );
 
     const float P( 0.5f );
     const Vector2 vertices[] = {
@@ -206,7 +203,7 @@ public:
 
   void AddContentLayer()
   {
-    Stage stage = Stage::GetCurrent();
+    Window window = mApplication.GetWindow();
 
      //Create all the renderers
     Renderer renderer = CreateQuadRenderer();