From: dongsug.song Date: Mon, 23 Sep 2019 07:10:22 +0000 (+0900) Subject: Moved some signals such as KeyEventGenerated to SceneHolder from Window X-Git-Tag: submit/tizen/20190924.003932^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c2af1230b350deb60ba57b5f36da4a316920eb4;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Moved some signals such as KeyEventGenerated to SceneHolder from Window - This is not the cause of csfs exception issue. merged again. - It is reverted twice : Revert "[Tizen] Revert "Moved some signals such as KeyEventGenerated to SceneHolder from Window"" This reverts commit 2af28226ffba4a607cbb88e177b64f5fe611368a. Change-Id: I78894e279001bc254191218d922f49bb50131c17 --- diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 238aee572..9d9334820 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -55,11 +55,6 @@ KeyEventSignalType& KeyEventSignal( Window window ) return GetImplementation( window ).KeyEventSignal(); } -KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Window window ) -{ - return GetImplementation( window ).KeyEventGeneratedSignal(); -} - TouchSignalType& TouchSignal( Window window ) { return GetImplementation( window ).TouchSignal(); diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index 07756addc..ca90c51da 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -35,8 +35,6 @@ typedef Signal< void () > EventProcessingFinishedSignalType; ///< Event Pr typedef Signal< void (const KeyEvent&) > KeyEventSignalType; ///< Key event signal type -typedef Signal< bool (const KeyEvent&) > KeyEventGeneratedSignalType; ///< Key event generated signal type - typedef Signal< void (const TouchData&) > TouchSignalType; ///< Touch signal type typedef Signal< void (const WheelEvent&) > WheelEventSignalType; ///< Touched signal type @@ -85,18 +83,6 @@ DALI_ADAPTOR_API EventProcessingFinishedSignalType& EventProcessingFinishedSigna */ DALI_ADAPTOR_API KeyEventSignalType& KeyEventSignal( Window window ); -/** - * @brief This signal is emitted when key event is received. - * - * A callback of the following type may be connected: - * @code - * bool YourCallbackName(const KeyEvent& event); - * @endcode - * @param[in] window The window instance - * @return The signal to connect to - */ -DALI_ADAPTOR_API KeyEventGeneratedSignalType& KeyEventGeneratedSignal( Window window ); - /** * @brief This signal is emitted when the screen is touched and when the touch ends * (i.e. the down & up touch events only). diff --git a/dali/integration-api/adaptor.h b/dali/integration-api/adaptor.h index cb19fa09b..eb0f6f02f 100755 --- a/dali/integration-api/adaptor.h +++ b/dali/integration-api/adaptor.h @@ -52,6 +52,8 @@ namespace Integration class SceneHolder; } +using SceneHolderList = std::vector; + namespace Internal { @@ -125,7 +127,7 @@ class DALI_ADAPTOR_API Adaptor public: typedef Signal< void (Adaptor&) > AdaptorSignalType; ///< Generic Type for adaptor signals - typedef Signal< void (Window&) > WindowCreatedSignalType; ///< Window created signal type + typedef Signal< void (Dali::Integration::SceneHolder&) > WindowCreatedSignalType; ///< SceneHolder created signal type using SurfaceSize = Uint16Pair; ///< Surface size type @@ -468,6 +470,12 @@ public: */ Dali::WindowContainer GetWindows() const; + /** + * @brief Get the list of scene holders. + * @return The list of scene holers + */ + SceneHolderList GetSceneHolders() const; + /** * @brief Called when the window becomes fully or partially visible. */ @@ -496,7 +504,7 @@ public: // Signals AdaptorSignalType& LanguageChangedSignal(); /** - * @brief This signal is emitted when a new window is created + * @brief This signal is emitted when a new window (scene holder) is created * * @return The signal to connect to */ diff --git a/dali/integration-api/scene-holder-impl.h b/dali/integration-api/scene-holder-impl.h index c08c11d24..2e44aa21f 100644 --- a/dali/integration-api/scene-holder-impl.h +++ b/dali/integration-api/scene-holder-impl.h @@ -172,6 +172,26 @@ public: */ static Dali::Integration::SceneHolder Get( Dali::Actor actor ); + /** + * @copydoc Dali::Integration::SceneHolder::KeyEventSignal() + */ + Dali::Integration::SceneHolder::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); } + + /** + * @copydoc Dali::Integration::SceneHolder::KeyEventGeneratedSignal() + */ + Dali::Integration::SceneHolder::KeyEventGeneratedSignalType& KeyEventGeneratedSignal() { return mScene.KeyEventGeneratedSignal(); } + + /** + * @copydoc Dali::Integration::SceneHolder::TouchSignal() + */ + Dali::Integration::SceneHolder::TouchSignalType& TouchSignal() { return mScene.TouchSignal(); } + + /** + * @copydoc Dali::Integration::SceneHolder::WheelEventSignal() + */ + Dali::Integration::SceneHolder::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); } + public: // The following methods can be overridden if required /** diff --git a/dali/integration-api/scene-holder.cpp b/dali/integration-api/scene-holder.cpp index 8f456d9be..7a232b9dd 100644 --- a/dali/integration-api/scene-holder.cpp +++ b/dali/integration-api/scene-holder.cpp @@ -111,6 +111,26 @@ SceneHolder SceneHolder::Get( Actor actor ) return Internal::Adaptor::SceneHolder::Get( actor ); } +SceneHolder::KeyEventSignalType& SceneHolder::KeyEventSignal() +{ + return GetImplementation(*this).KeyEventSignal(); +} + +SceneHolder::KeyEventGeneratedSignalType& SceneHolder::KeyEventGeneratedSignal() +{ + return GetImplementation(*this).KeyEventGeneratedSignal(); +} + +SceneHolder::TouchSignalType& SceneHolder::TouchSignal() +{ + return GetImplementation(*this).TouchSignal(); +} + +SceneHolder::WheelEventSignalType& SceneHolder::WheelEventSignal() +{ + return GetImplementation(*this).WheelEventSignal(); +} + }// Integration } // Dali diff --git a/dali/integration-api/scene-holder.h b/dali/integration-api/scene-holder.h index 4881d2206..905ed6b5b 100644 --- a/dali/integration-api/scene-holder.h +++ b/dali/integration-api/scene-holder.h @@ -22,6 +22,7 @@ #include #include #include +#include namespace Dali { @@ -29,6 +30,7 @@ namespace Dali class Actor; class Layer; class Any; +class TouchData; struct TouchPoint; struct WheelEvent; struct KeyEvent; @@ -55,6 +57,14 @@ class DALI_ADAPTOR_API SceneHolder : public BaseHandle { public: + typedef Signal< void (const Dali::KeyEvent&) > KeyEventSignalType; ///< Key event signal type + + typedef Signal< bool (const Dali::KeyEvent&) > KeyEventGeneratedSignalType; ///< Key event generated signal type + + typedef Signal< void (const Dali::TouchData&) > TouchSignalType; ///< Touch signal type + + typedef Signal< void (const Dali::WheelEvent&) > WheelEventSignalType; ///< Touched signal type + /** * @brief Create an uninitialized SceneHolder handle. */ @@ -158,6 +168,55 @@ public: */ static SceneHolder Get( Actor actor ); + /** + * @brief This signal is emitted when key event is received. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName(const KeyEvent& event); + * @endcode + * @return The signal to connect to + */ + KeyEventSignalType& KeyEventSignal(); + + /** + * @brief This signal is emitted when key event is received. + * + * A callback of the following type may be connected: + * @code + * bool YourCallbackName(const KeyEvent& event); + * @endcode + * @return The signal to connect to + */ + KeyEventGeneratedSignalType& KeyEventGeneratedSignal(); + + /** + * @brief This signal is emitted when the screen is touched and when the touch ends + * (i.e. the down & up touch events only). + * + * If there are multiple touch points, then this will be emitted when the first touch occurs and + * then when the last finger is lifted. + * An interrupted event will also be emitted (if it occurs). + * A callback of the following type may be connected: + * @code + * void YourCallbackName( TouchData event ); + * @endcode + * @return The touch signal to connect to + * @note Motion events are not emitted. + */ + TouchSignalType& TouchSignal(); + + /** + * @brief This signal is emitted when wheel event is received. + * + * A callback of the following type may be connected: + * @code + * void YourCallbackName(const WheelEvent& event); + * @endcode + * @return The signal to connect to + */ + WheelEventSignalType& WheelEventSignal(); + public: // Not intended for application developers /** diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 189ac3bf1..bff490a7a 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -189,11 +189,9 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration: defaultWindow->SetAdaptor( Get() ); - Dali::Window window( dynamic_cast( defaultWindow ) ); - if ( window ) - { - mWindowCreatedSignal.Emit( window ); - } + Dali::Integration::SceneHolder defaultSceneHolder( defaultWindow ); + + mWindowCreatedSignal.Emit( defaultSceneHolder ); const unsigned int timeInterval = mEnvironmentOptions->GetObjectProfilerInterval(); if( 0u < timeInterval ) @@ -646,11 +644,7 @@ bool Adaptor::AddWindow( Dali::Integration::SceneHolder childWindow, const std:: // Add the new Window to the container - the order is not important mWindows.push_back( &windowImpl ); - Dali::Window window( dynamic_cast( &windowImpl ) ); - if ( window ) - { - mWindowCreatedSignal.Emit( window ); - } + mWindowCreatedSignal.Emit( childWindow ); return true; } @@ -1117,6 +1111,18 @@ Dali::WindowContainer Adaptor::GetWindows() const return windows; } +Dali::SceneHolderList Adaptor::GetSceneHolders() const +{ + Dali::SceneHolderList sceneHolderList; + + for( auto iter = mWindows.begin(); iter != mWindows.end(); ++iter ) + { + sceneHolderList.push_back( Dali::Integration::SceneHolder( *iter ) ); + } + + return sceneHolderList; +} + Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions) : mResizedSignal(), mLanguageChangedSignal(), diff --git a/dali/internal/adaptor/common/adaptor-impl.h b/dali/internal/adaptor/common/adaptor-impl.h index 99e4a0c58..74f7ab334 100755 --- a/dali/internal/adaptor/common/adaptor-impl.h +++ b/dali/internal/adaptor/common/adaptor-impl.h @@ -313,6 +313,11 @@ public: // AdaptorInternalServices implementation */ Dali::WindowContainer GetWindows() const; + /** + * @copydoc Dali::Adaptor::GetSceneHolders() + */ + Dali::SceneHolderList GetSceneHolders() const; + public: /** @@ -650,7 +655,7 @@ private: // Data AdaptorSignalType mResizedSignal; ///< Resized signal. AdaptorSignalType mLanguageChangedSignal; ///< Language changed signal. - WindowCreatedSignalType mWindowCreatedSignal; ///< Window created signal. + WindowCreatedSignalType mWindowCreatedSignal; ///< Window created signal. Dali::Adaptor& mAdaptor; ///< Reference to public adaptor instance. State mState; ///< Current state of the adaptor diff --git a/dali/internal/adaptor/common/adaptor.cpp b/dali/internal/adaptor/common/adaptor.cpp index 73fe2b331..195f936f3 100755 --- a/dali/internal/adaptor/common/adaptor.cpp +++ b/dali/internal/adaptor/common/adaptor.cpp @@ -261,6 +261,11 @@ Dali::WindowContainer Adaptor::GetWindows() const return mImpl->GetWindows(); } +SceneHolderList Adaptor::GetSceneHolders() const +{ + return mImpl->GetSceneHolders(); +} + void Adaptor::OnWindowShown() { mImpl->OnWindowShown(); diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index 3418a7c17..bebb11bcc 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -484,26 +484,6 @@ public: // Signals */ Dali::DevelWindow::EventProcessingFinishedSignalType& EventProcessingFinishedSignal() { return mScene.EventProcessingFinishedSignal(); } - /** - * @copydoc Dali::Window::KeyEventSignal() - */ - Dali::DevelWindow::KeyEventSignalType& KeyEventSignal() { return mScene.KeyEventSignal(); } - - /** - * @copydoc Dali::Window::KeyEventGeneratedSignal() - */ - Dali::DevelWindow::KeyEventGeneratedSignalType& KeyEventGeneratedSignal() { return mScene.KeyEventGeneratedSignal(); } - - /** - * @copydoc Dali::Window::TouchSignal() - */ - Dali::DevelWindow::TouchSignalType& TouchSignal() { return mScene.TouchSignal(); } - - /** - * @copydoc Dali::Window::WheelEventSignal() - */ - Dali::DevelWindow::WheelEventSignalType& WheelEventSignal() { return mScene.WheelEventSignal(); } - private: WindowRenderSurface* mWindowSurface; ///< The window rendering surface