From: Wonsik Jung Date: Sun, 7 Nov 2021 07:38:02 +0000 (+0900) Subject: Add auxiliary message for window X-Git-Tag: dali_2.1.0~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F98%2F266098%2F7;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Add auxiliary message for window Auxiliary message is sent by display server. When client application added the window's auxiliary hint and if the auxiliary is changed, display server send the auxiliary message. Auxiliary message has the key, value and options. Change-Id: I128cefc8b678fe239a74615f114a8e2611e2fc71 --- diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 09f070c..ae700b1 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -101,6 +101,11 @@ KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal(Win return GetImplementation(window).KeyboardRepeatSettingsChangedSignal(); } +AuxiliaryMessageSignalType& AuxiliaryMessageSignal(Window window) +{ + return GetImplementation(window).AuxiliaryMessageSignal(); +} + void SetParent(Window window, Window parent) { GetImplementation(window).SetParent(parent); diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index 321b294..199dea2 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -35,6 +35,7 @@ class RenderTaskList; namespace DevelWindow { + typedef Signal EventProcessingFinishedSignalType; ///< Event Processing finished signal type typedef Signal KeyEventSignalType; ///< Key event signal type @@ -49,6 +50,8 @@ typedef Signal TransitionEffe typedef Signal KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type +typedef Signal AuxiliaryMessageSignalType; ///< Auxiliary message signal type + /** * @brief Creates an initialized handle to a new Window. * @@ -146,6 +149,19 @@ DALI_ADAPTOR_API TransitionEffectEventSignalType& TransitionEffectEventSignal(Wi DALI_ADAPTOR_API KeyboardRepeatSettingsChangedSignalType& KeyboardRepeatSettingsChangedSignal(Window window); /** + * @brief This signal is emitted when window's auxiliary was changed then display server sent the message. + * + * Auxiliary message is sent by display server. + * When client application added the window's auxiliary hint and if the auxiliary is changed, + * display server send the auxiliary message. + * Auxiliary message has the key, value and options. + * + * @param[in] window The window instance + * @return The signal to connect to + */ +DALI_ADAPTOR_API AuxiliaryMessageSignalType& AuxiliaryMessageSignal(Window window); + +/** * @brief Sets parent window of the window. * * After setting that, these windows do together when raise-up, lower and iconified/deiconified. diff --git a/dali/internal/window-system/common/window-base.cpp b/dali/internal/window-system/common/window-base.cpp index 9e43d8d..e2b8707 100644 --- a/dali/internal/window-system/common/window-base.cpp +++ b/dali/internal/window-system/common/window-base.cpp @@ -40,7 +40,8 @@ WindowBase::WindowBase() mAccessibilitySignal(), mTransitionEffectEventSignal(), mKeyboardRepeatSettingsChangedSignal(), - mUpdatePositionSizeSignal() + mUpdatePositionSizeSignal(), + mAuxiliaryMessageSignal() { } @@ -133,6 +134,11 @@ WindowBase::UpdatePositionSizeType& WindowBase::UpdatePositionSizeSignal() return mUpdatePositionSizeSignal; } +WindowBase::AuxiliaryMessageSignalType& WindowBase::AuxiliaryMessageSignal() +{ + return mAuxiliaryMessageSignal; +} + } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 926a365..3ff6026 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -73,6 +73,7 @@ public: typedef Signal KeyboardRepeatSettingsChangedSignalType; typedef Signal WindowRedrawRequestSignalType; typedef Signal UpdatePositionSizeType; + typedef Signal AuxiliaryMessageSignalType; // Input events typedef Signal TouchEventSignalType; @@ -505,6 +506,11 @@ public: */ UpdatePositionSizeType& UpdatePositionSizeSignal(); + /** + * @brief This signal is emitted when the window is received the auxiliary message from display server. + */ + AuxiliaryMessageSignalType& AuxiliaryMessageSignal(); + protected: // Undefined WindowBase(const WindowBase&) = delete; @@ -530,6 +536,7 @@ protected: KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal; WindowRedrawRequestSignalType mWindowRedrawRequestSignal; UpdatePositionSizeType mUpdatePositionSizeSignal; + AuxiliaryMessageSignalType mAuxiliaryMessageSignal; }; } // namespace Adaptor diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index cd060f0..c14a0c4 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -92,7 +92,8 @@ Window::Window() mResizeSignal(), mVisibilityChangedSignal(), mTransitionEffectEventSignal(), - mKeyboardRepeatSettingsChangedSignal() + mKeyboardRepeatSettingsChangedSignal(), + mAuxiliaryMessageSignal() { } @@ -142,6 +143,7 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std mWindowBase->KeyboardRepeatSettingsChangedSignal().Connect(this, &Window::OnKeyboardRepeatSettingsChanged); mWindowBase->WindowRedrawRequestSignal().Connect(this, &Window::OnWindowRedrawRequest); mWindowBase->UpdatePositionSizeSignal().Connect(this, &Window::OnUpdatePositionSize); + mWindowBase->AuxiliaryMessageSignal().Connect(this, &Window::OnAuxiliaryMessage); mWindowSurface->OutputTransformedSignal().Connect(this, &Window::OnOutputTransformed); @@ -858,6 +860,11 @@ void Window::OnResume() mSurface->SetFullSwapNextFrame(); } +void Window::OnAuxiliaryMessage(const std::string& key, const std::string& value, const Property::Array& options) +{ + mAuxiliaryMessageSignal.Emit(key, value, options); +} + void Window::RecalculateTouchPosition(Integration::Point& point) { Vector2 position = point.GetScreenPosition(); diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index ef258cb..3e73f6e 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -64,6 +64,7 @@ public: typedef Dali::DevelWindow::VisibilityChangedSignalType VisibilityChangedSignalType; typedef Dali::DevelWindow::TransitionEffectEventSignalType TransitionEffectEventSignalType; typedef Dali::DevelWindow::KeyboardRepeatSettingsChangedSignalType KeyboardRepeatSettingsChangedSignalType; + typedef Dali::DevelWindow::AuxiliaryMessageSignalType AuxiliaryMessageSignalType; typedef Signal SignalType; /** @@ -488,6 +489,15 @@ private: void OnUpdatePositionSize(Dali::PositionSize& positionSize); /** + * @brief Called when display server sent the auxiliary message. + * + * @param[in] key the auxiliary message's key. + * @param[in] value the auxiliary message's value. + * @param[in] options the auxiliary message's options. This is the list of string. + */ + void OnAuxiliaryMessage(const std::string& key, const std::string& value, const Property::Array& options); + + /** * @brief Set available orientation to window base. */ void SetAvailableAnlges(const std::vector& angles); @@ -625,6 +635,14 @@ public: // Signals return mKeyboardRepeatSettingsChangedSignal; } + /** + * @copydoc Dali::DevelWindow::AuxiliaryMessageSignal() + */ + AuxiliaryMessageSignalType& AuxiliaryMessageSignal() + { + return mAuxiliaryMessageSignal; + } + private: WindowRenderSurface* mWindowSurface; ///< The window rendering surface WindowBase* mWindowBase; @@ -658,6 +676,7 @@ private: VisibilityChangedSignalType mVisibilityChangedSignal; TransitionEffectEventSignalType mTransitionEffectEventSignal; KeyboardRepeatSettingsChangedSignalType mKeyboardRepeatSettingsChangedSignal; + AuxiliaryMessageSignalType mAuxiliaryMessageSignal; }; } // namespace Adaptor diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index aa0d96a..c2ee17a 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -580,6 +580,20 @@ static Eina_Bool EcoreEventWindowRedrawRequest(void* data, int type, void* event } ///////////////////////////////////////////////////////////////////////////////////////////////// +// Window Auxiliary Message Callbacks +///////////////////////////////////////////////////////////////////////////////////////////////// +static Eina_Bool EcoreEventWindowAuxiliaryMessage(void *data, int type, void *event) +{ + WindowBaseEcoreWl2* windowBase = static_cast(data); + DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::EcoreEventWindowAuxiliaryMessage, window[ %d ]\n", windowAuxiliaryMessage->win); + if(windowBase) + { + windowBase->OnEcoreEventWindowAuxiliaryMessage(event); + } + return ECORE_CALLBACK_RENEW; +} + +///////////////////////////////////////////////////////////////////////////////////////////////// // ElDBus Accessibility Callbacks ///////////////////////////////////////////////////////////////////////////////////////////////// @@ -842,6 +856,9 @@ void WindowBaseEcoreWl2::Initialize(PositionSize positionSize, Any surface, bool // Register Window redraw request event mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_WINDOW_REDRAW_REQUEST, EcoreEventWindowRedrawRequest, this)); + // Register Window auxiliary event + mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_AUX_MESSAGE, EcoreEventWindowAuxiliaryMessage, this)); + // Register Vconf notify - font name and size vconf_notify_key_changed(DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this); vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, this); @@ -1385,6 +1402,33 @@ void WindowBaseEcoreWl2::OnEcoreEventWindowRedrawRequest() mWindowRedrawRequestSignal.Emit(); } +void WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage(void* event) +{ + Ecore_Wl2_Event_Aux_Message *message = static_cast(event); + if(message) + { + DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, key:%s, value:%s \n",message->key, message->val); + std::string key(message->key); + std::string value(message->val); + Dali::Property::Array options; + + if(message->options) + { + Eina_List *l; + void* data; + EINA_LIST_FOREACH(message->options, l, data) + { + DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, option: %s\n",(char*)data); + std::string option(static_cast(data)); + options.Add(option); + } + } + + mAuxiliaryMessageSignal.Emit(key, value, options); + } +} + + void WindowBaseEcoreWl2::KeymapChanged(void* data, int type, void* event) { Ecore_Wl2_Event_Seat_Keymap_Changed* changed = static_cast(event); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index 6c180c8..3df827b 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -169,6 +169,14 @@ public: */ void OnEcoreEventWindowRedrawRequest(); + /** + * @brief Called when window's auxiliary is changed then display server send the changed message. + * + * @param[in] auxiliary's message data. It has key, value and integer list data. + */ + void OnEcoreEventWindowAuxiliaryMessage(void* event); + + #ifdef DALI_ELDBUS_AVAILABLE /** * @brief Called when Ecore ElDBus accessibility event is received.