Merge "(Automated Tests) Changes after Window changes in Adaptor" into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Mon, 13 Jul 2020 21:42:07 +0000 (21:42 +0000)
committerGerrit Code Review <gerrit@review>
Mon, 13 Jul 2020 21:42:07 +0000 (21:42 +0000)
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.h
docs/content/example-code/properties.cpp

index d7878e3..f06b89d 100644 (file)
@@ -164,6 +164,16 @@ FocusChangeSignalType& Window::FocusChangeSignal()
   return GetImplementation( *this ).mFocusChangeSignal;
 }
 
+Window::KeyEventSignalType& Window::KeyEventSignal()
+{
+  return GetImplementation( *this ).KeyEventSignal();
+}
+
+Window::TouchSignalType& Window::TouchSignal()
+{
+  return GetImplementation( *this ).TouchSignal();
+}
+
 namespace DevelWindow
 {
 
@@ -194,21 +204,11 @@ EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window
   return GetImplementation( window ).GetScene().EventProcessingFinishedSignal();
 }
 
-KeyEventSignalType& KeyEventSignal( Window window )
-{
-  return GetImplementation( window ).KeyEventSignal();
-}
-
 KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Window window )
 {
   return GetImplementation( window ).KeyEventGeneratedSignal();
 }
 
-TouchSignalType& TouchSignal( Window window )
-{
-  return GetImplementation( window ).TouchSignal();
-}
-
 WheelEventSignalType& WheelEventSignal( Window window )
 {
   return GetImplementation( window ).WheelEventSignal();
index 68ed472..2ff4370 100644 (file)
@@ -51,6 +51,8 @@ typedef Signal< void (Window,bool) > FocusChangeSignalType;
 class Window : public BaseHandle
 {
 public:
+  using KeyEventSignalType = Signal< void (const KeyEvent&) >;
+  using TouchSignalType = Signal< void (const TouchData&) >;
 
   static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false);
   static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
@@ -70,6 +72,8 @@ public:
   void Raise();
   void Hide();
   FocusChangeSignalType& FocusChangeSignal();
+  KeyEventSignalType& KeyEventSignal();
+  TouchSignalType& TouchSignal();
 
 public:
   explicit Window( Internal::Adaptor::Window* window );
@@ -81,9 +85,7 @@ const Internal::Adaptor::Window& GetImplementation(const Dali::Window& window);
 namespace DevelWindow
 {
 typedef Signal< void () > EventProcessingFinishedSignalType;
-typedef Signal< void (const KeyEvent&) > KeyEventSignalType;
 typedef Signal< bool (const KeyEvent&) > KeyEventGeneratedSignalType;
-typedef Signal< void (const TouchData&) > TouchSignalType;
 typedef Signal< void (const WheelEvent&) > WheelEventSignalType;
 typedef Signal< void ( Window, bool ) > VisibilityChangedSignalType;
 
@@ -91,9 +93,7 @@ Dali::Window Get( Actor actor );
 Dali::Window DownCast(  BaseHandle handle );
 
 EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window );
-KeyEventSignalType& KeyEventSignal( Dali::Window window );
 KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Dali::Window window );
-TouchSignalType& TouchSignal( Dali::Window window );
 WheelEventSignalType& WheelEventSignal( Window window );
 VisibilityChangedSignalType& VisibilityChangedSignal( Window window );
 }
index c1669f7..bbf5ae0 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.
@@ -56,8 +56,8 @@ public:
   // C++ EXAMPLE
   void Create( Application& application )
   {
-    // Get the stage handle
-    Stage stage = Stage::GetCurrent();
+    // Get the window handle
+    Window window = application.GetWindow();
 
     mImageView = ImageView::New();
 
@@ -72,8 +72,8 @@ public:
     imageMap[ ImageVisual::Property::DESIRED_HEIGHT ] = 100;
     mImageView.SetProperty( ImageView::Property::IMAGE, imageMap );
 
-    // Add the image view to the stage
-    stage.Add( mImageView );
+    // Add the image view to the window
+    window.Add( mImageView );
 
     // Register a custom float property on mImageView and use it to store the number of times we are tapped
     mTagPropertyIndex = mImageView.RegisterProperty( TAG_PROPERTY_NAME, 0, Property::READ_WRITE /* Event-side only, i.e. not animatable */ );
@@ -87,7 +87,7 @@ public:
     mTagText.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::BOTTOM_CENTER );
     mTagText.SetProperty( TextLabel::Property::TEXT_COLOR, Color::WHITE );
     mTagText.SetProperty( TextLabel::Property::HORIZONTAL_ALIGNMENT, "CENTER" );
-    stage.Add( mTagText );
+    window.Add( mTagText );
   }
 
   /**