Changes after TouchedSignal changes
[platform/core/uifw/dali-demo.git] / examples / clipping-draw-order / clipping-draw-order.cpp
index efe0162..0653f2a 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.
@@ -49,12 +49,12 @@ 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();
-    stage.SetBackgroundColor( Color::WHITE );
+    // Get a handle to the window
+    Window window = application.GetWindow();
+    window.SetBackgroundColor( Color::WHITE );
 
-    // Connect to the stage's key signal to allow Back and Escape to exit.
-    stage.KeyEventSignal().Connect( this, &ClippingDrawOrderVerification::OnKeyEvent );
+    // Connect to the window's key signal to allow Back and Escape to exit.
+    window.KeyEventSignal().Connect( this, &ClippingDrawOrderVerification::OnKeyEvent );
 
     // Create the title label.
     TextLabel title = TextLabel::New( "Clipping draw order verification" );
@@ -69,7 +69,7 @@ public:
     description.SetProperty( TextLabel::Property::MULTI_LINE, true );
     description.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
     description.SetProperty( Actor::Property::PARENT_ORIGIN, Vector3( 0.5f, 1.0f, 0.5f ) );
-    stage.Add( description );
+    window.Add( description );
 
     /*
      * Create a 4-row TableView.
@@ -194,14 +194,14 @@ public:
       view.AddChild( container, TableView::CellPosition( 1u + tree, 0u ) );
     }
 
-    // Add the finished TableView to the stage.
-    stage.Add( view );
+    // Add the finished TableView to the window.
+    window.Add( view );
 
-    // Respond to a click anywhere on the stage
-    stage.GetRootLayer().TouchSignal().Connect( this, &ClippingDrawOrderVerification::OnTouch );
+    // Respond to a click anywhere on the window
+    window.GetRootLayer().TouchedSignal().Connect( this, &ClippingDrawOrderVerification::OnTouch );
   }
 
-  bool OnTouch( Actor actor, const TouchData& touch )
+  bool OnTouch( Actor actor, const TouchEvent& touch )
   {
     // Quit the application.
     mApplication.Quit();
@@ -216,7 +216,7 @@ public:
    */
   void OnKeyEvent( const KeyEvent& event )
   {
-    if( event.state == KeyEvent::Down )
+    if( event.GetState() == KeyEvent::DOWN )
     {
       if( IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK ) )
       {