From df47032c66854eadfadd79c9233e630a8c1770e8 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Wed, 8 Jul 2020 18:13:03 +0100 Subject: [PATCH] (Automated Tests) Changes after Window changes in Adaptor Change-Id: I072408e718712dce63e1fe8bdc9ecc2894a05299 --- .../dali-toolkit-test-utils/toolkit-window.cpp | 20 ++++++++++---------- .../dali-toolkit-test-utils/toolkit-window.h | 8 ++++---- docs/content/example-code/properties.cpp | 12 ++++++------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp index d7878e3..f06b89d 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp @@ -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(); diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.h index 68ed472..2ff4370 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.h @@ -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 ); } diff --git a/docs/content/example-code/properties.cpp b/docs/content/example-code/properties.cpp index c1669f7..bbf5ae0 100644 --- a/docs/content/example-code/properties.cpp +++ b/docs/content/example-code/properties.cpp @@ -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 ); } /** -- 2.7.4