Add auxiliary message for window 98/266098/7
authorWonsik Jung <sidein@samsung.com>
Sun, 7 Nov 2021 07:38:02 +0000 (16:38 +0900)
committerWonsik Jung <sidein@samsung.com>
Thu, 18 Nov 2021 21:17:28 +0000 (06:17 +0900)
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

dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/internal/window-system/common/window-base.cpp
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h

index 09f070c..ae700b1 100644 (file)
@@ -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);
index 321b294..199dea2 100644 (file)
@@ -35,6 +35,7 @@ class RenderTaskList;
 
 namespace DevelWindow
 {
+
 typedef Signal<void()> EventProcessingFinishedSignalType; ///< Event Processing finished signal type
 
 typedef Signal<void(const KeyEvent&)> KeyEventSignalType; ///< Key event signal type
@@ -49,6 +50,8 @@ typedef Signal<void(Window, WindowEffectState, WindowEffectType)> TransitionEffe
 
 typedef Signal<void()> KeyboardRepeatSettingsChangedSignalType; ///< Keyboard repeat settings changed signal type
 
+typedef Signal<void(const std::string&, const std::string&, const Property::Array&)> 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.
index 9e43d8d..e2b8707 100644 (file)
@@ -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
index 926a365..3ff6026 100644 (file)
@@ -73,6 +73,7 @@ public:
   typedef Signal<void()>                                    KeyboardRepeatSettingsChangedSignalType;
   typedef Signal<void()>                                    WindowRedrawRequestSignalType;
   typedef Signal<void(Dali::PositionSize&)>                 UpdatePositionSizeType;
+  typedef Signal<void(const std::string&, const std::string&, const Property::Array&)>             AuxiliaryMessageSignalType;
 
   // Input events
   typedef Signal<void(Integration::Point&, uint32_t)> 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
index cd060f0..c14a0c4 100644 (file)
@@ -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();
index ef258cb..3e73f6e 100644 (file)
@@ -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<void()>                                             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<int>& 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
index aa0d96a..c2ee17a 100644 (file)
@@ -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<WindowBaseEcoreWl2*>(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<Ecore_Wl2_Event_Aux_Message*>(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<char*>(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<Ecore_Wl2_Event_Seat_Keymap_Changed*>(event);
index 6c180c8..3df827b 100644 (file)
@@ -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.