Add multi-mimetype feature for Drag and Drop 07/316807/4
authorTaehyub Kim <taehyub.kim@samsung.com>
Wed, 28 Aug 2024 10:48:29 +0000 (19:48 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Tue, 10 Sep 2024 08:31:06 +0000 (17:31 +0900)
Contents
- Allow to set multi-mimetypes for source client (use DragInfo)
- Target client receive source's mimetypes from source client when Enter, Move, Leave
- Target client can set mimetype to receive
- Refactoring code for readability

Change-Id: Ida5f4c2b35a0a85fd5acaab6d4dc25449b88b159

dali/devel-api/adaptor-framework/drag-and-drop.cpp
dali/devel-api/adaptor-framework/drag-and-drop.h
dali/internal/drag-and-drop/common/drag-and-drop-impl.h
dali/internal/drag-and-drop/generic/drag-and-drop-impl-generic.cpp
dali/internal/drag-and-drop/generic/drag-and-drop-impl-generic.h
dali/internal/drag-and-drop/tizen-wayland/drag-and-drop-impl-ecore-wl2.cpp
dali/internal/drag-and-drop/tizen-wayland/drag-and-drop-impl-ecore-wl2.h

index 9a7a5b4a7a85793fbf072e096c763e150853ad3d..e21235dab9464573aa728925e8e6cc037ea64e99 100644 (file)
@@ -44,9 +44,9 @@ bool DragAndDrop::StartDragAndDrop(Dali::Actor source, Dali::Window shadowWindow
   return GetImplementation(*this).StartDragAndDrop(source, shadowWindow, dragData, callback);
 }
 
-bool DragAndDrop::AddListener(Dali::Actor target, DragAndDropFunction callback)
+bool DragAndDrop::AddListener(Dali::Actor target, char* mimeType, DragAndDropFunction callback)
 {
-  return GetImplementation(*this).AddListener(target, callback);
+  return GetImplementation(*this).AddListener(target, mimeType, callback);
 }
 
 bool DragAndDrop::RemoveListener(Dali::Actor target)
@@ -54,9 +54,9 @@ bool DragAndDrop::RemoveListener(Dali::Actor target)
   return GetImplementation(*this).RemoveListener(target);
 }
 
-bool DragAndDrop::AddListener(Dali::Window target, DragAndDropFunction callback)
+bool DragAndDrop::AddListener(Dali::Window target, char* mimeType, DragAndDropFunction callback)
 {
-  return GetImplementation(*this).AddListener(target, callback);
+  return GetImplementation(*this).AddListener(target, mimeType, callback);
 }
 
 bool DragAndDrop::RemoveListener(Dali::Window target)
index 6e66a33fc197fcb86b542a42c49756a0cc401cce..27c921aa6dbc2c5468fd55d8dc4a9c33ad58ce05 100644 (file)
@@ -76,15 +76,16 @@ public:
   {
     DragEvent()
     {
-      this->mimeType = nullptr;
+      this->mimeTypes = nullptr;
       this->data = nullptr;
     }
-    DragEvent(DragType type, Dali::Vector2 position, const char* mimeType = nullptr, char* data = nullptr)
+    DragEvent(DragType type, Dali::Vector2 position, const char** mimeTypes = nullptr, int mimeTypesSize = 0, char* data = nullptr)
     {
-      this->type     = type;
-      this->position = position;
-      this->mimeType = mimeType;
-      this->data     = data;
+      this->type          = type;
+      this->position      = position;
+      this->mimeTypes     = mimeTypes;
+      this->mimeTypesSize = mimeTypesSize;
+      this->data          = data;
     }
 
     void SetAction(DragType type)
@@ -103,13 +104,18 @@ public:
     {
       return position;
     }
-    void SetMimeType(const char* mimeType)
+    void SetMimeTypes(const char** mimeTypes, int mimeTypeSize)
+    {
+      this->mimeTypes = mimeTypes;
+      this->mimeTypesSize = mimeTypeSize;
+    }
+    const char** GetMimeTypes()
     {
-      this->mimeType = mimeType;
+      return this->mimeTypes;
     }
-    const char* GetMimeType()
+    int GetMimeTypesSize() const
     {
-      return mimeType;
+      return mimeTypesSize;
     }
     void SetData(char* data)
     {
@@ -123,8 +129,9 @@ public:
   private:
     DragType      type{DragType::DROP}; ///< The drag event type.
     Dali::Vector2 position;             ///< The position of drag object.
-    const char*   mimeType;             ///< The mime type of drag object.
+    const char**  mimeTypes{nullptr};   ///< The mime types of drag object.
     char*         data{nullptr};        ///< The data of drag object.
+    int           mimeTypesSize{0};     ///< The size of mime types array.
   };
 
   /**
@@ -132,26 +139,43 @@ public:
    */
   struct DragData
   {
-     void SetMimeType(const char* mimeType)
+     void SetMimeTypes(const char** mimeTypes, int mimeTypesSize)
+     {
+      this->mimeTypes = mimeTypes;
+      this->mimeTypesSize = mimeTypesSize;
+     }
+
+     const char** GetMimeTypes() const
      {
-       this->mimeType = mimeType;
+       return mimeTypes;
      }
-     const char* GetMimeType() const
+
+     int GetMimeTypesSize() const
+     {
+      return mimeTypesSize;
+     }
+
+     void SetDataSet(const char** dataSet, int dataSetSize)
      {
-       return mimeType;
+      this->dataSet = dataSet;
+      this->dataSetSize = dataSetSize;
      }
-     void SetData(const char* data)
+
+     const char** GetDataSet() const
      {
-       this->data = data;
+       return dataSet;
      }
-     const char* GetData() const
+
+     int GetDataSetSize() const
      {
-       return data;
+      return dataSetSize;
      }
 
   private:
-     const char* mimeType{nullptr}; ///<The mime type of drag data.
-     const char* data{nullptr};     ///<The drag data.
+     const char**             mimeTypes{nullptr};///< The mime types of drag object.
+     int                      mimeTypesSize{0};  ///< The size of mime types.
+     const char**             dataSet{nullptr};  ///<The drag data set.
+     int                      dataSetSize{0};    ///<The size of data set.
   };
 
   using DragAndDropFunction = std::function<void(const DragEvent&)>;
@@ -198,10 +222,11 @@ public:
    * @brief Add the listener for receiving the drag and drop events.
    *
    * @param[in] target The drop target object.
+   * @param[in] mimeType The mime type of target object.
    * @param[in] callback A drag and drop event callback.
    * @return bool true if the listener is added successfully.
    */
-  bool AddListener(Dali::Actor target, DragAndDropFunction callback);
+  bool AddListener(Dali::Actor target, char* mimeType, DragAndDropFunction callback);
 
   /**
    * @brief Remove the listener.
@@ -215,10 +240,11 @@ public:
    * @brief Add the listener for receiving the drag and drop events.
    *
    * @param[in] target The drop target object.
+   * @param[in] mimeType The mime type of target object.
    * @param[in] callback A drag and drop event callback.
    * @return bool true if the listener is added successfully.
    */
-  bool AddListener(Dali::Window target, DragAndDropFunction callback);
+  bool AddListener(Dali::Window target, char* mimeType, DragAndDropFunction callback);
 
   /**
    * @brief Remove the listener.
index 358beec609e3633157564d9a3ce04ddcb2c9c1fa..18e2bf8fb2d1842586bc2042baffe9d866c3a96b 100644 (file)
@@ -55,7 +55,7 @@ public:
   /**
    * @copydoc Dali::DragAndDrop::AddListener()
    */
-  virtual bool AddListener(Dali::Actor target, Dali::DragAndDrop::DragAndDropFunction callback) = 0;
+  virtual bool AddListener(Dali::Actor target, char* mimeType, Dali::DragAndDrop::DragAndDropFunction callback) = 0;
 
   /**
    * @copydoc Dali::DragAndDrop::RemoveListener()
@@ -65,7 +65,7 @@ public:
   /**
    * @copydoc Dali::DragAndDrop::AddListener()
    */
-  virtual bool AddListener(Dali::Window window, Dali::DragAndDrop::DragAndDropFunction callback) = 0;
+  virtual bool AddListener(Dali::Window window, char* mimeType, Dali::DragAndDrop::DragAndDropFunction callback) = 0;
 
   /**
    * @copydoc Dali::DragAndDrop::RemoveListener()
index 3eecfdc35f911e4742e36244b06d358eef6432b3..bc79f0ca206cfd2138ca906044ef4308d0e5b90f 100644 (file)
@@ -66,7 +66,7 @@ bool DragAndDropGeneric::StartDragAndDrop(Dali::Actor source, Dali::Window shado
   return true;
 }
 
-bool DragAndDropGeneric::AddListener(Dali::Actor target, Dali::DragAndDrop::DragAndDropFunction callback)
+bool DragAndDropGeneric::AddListener(Dali::Actor target, char* miemType, Dali::DragAndDrop::DragAndDropFunction callback)
 {
   return true;
 }
@@ -76,7 +76,7 @@ bool DragAndDropGeneric::RemoveListener(Dali::Actor target)
   return true;
 }
 
-bool DragAndDropGeneric::AddListener(Dali::Window target, Dali::DragAndDrop::DragAndDropFunction callback)
+bool DragAndDropGeneric::AddListener(Dali::Window target, char* miemType, Dali::DragAndDrop::DragAndDropFunction callback)
 {
   return true;
 }
index 94ac7c8de0360434f957be9524bd7ab780dccc96..92e7872a8a46a57507591ee059a5d65c74b59e25 100644 (file)
@@ -54,7 +54,7 @@ public:
   /**
    * @copydoc Dali::DragAndDrop::AddListener()
    */
-  bool AddListener(Dali::Actor target, Dali::DragAndDrop::DragAndDropFunction callback) override;
+  bool AddListener(Dali::Actor target, char* miemType, Dali::DragAndDrop::DragAndDropFunction callback) override;
 
   /**
    * @copydoc Dali::DragAndDrop::RemoveListener()
@@ -64,7 +64,7 @@ public:
   /**
    * @copydoc Dali::DragAndDrop::AddListener()
    */
-  bool AddListener(Dali::Window target, Dali::DragAndDrop::DragAndDropFunction callback) override;
+  bool AddListener(Dali::Window target, char* miemType, Dali::DragAndDrop::DragAndDropFunction callback) override;
 
   /**
    * @copydoc Dali::DragAndDrop::RemoveListener()
index ca6a4254ec1e71613aa5e25f43dbc5267fb090b0..e7fd680edad441b4b15cc3601f99156c4b957876 100644 (file)
@@ -49,8 +49,11 @@ namespace
 {
 static constexpr int32_t DEFAULT_POSITION            = -1;
 static constexpr int32_t INVALID_ECORE_WL2_WINDOW_ID = -1;
+static constexpr int32_t MAX_MIME_SIZE = 10;
 } // namespace
 
+static const char* mimesPool [MAX_MIME_SIZE];
+
 static bool IsIntersection(int px, int py, int tx, int ty, int tw, int th)
 {
   if(px >= tx && py >= ty && px <= (tx + tw) && py <= (ty + th))
@@ -193,9 +196,14 @@ bool DragAndDropEcoreWl::StartDragAndDrop(Dali::Actor source, Dali::Window shado
   // Get Parent Window
   auto parent = Dali::DevelWindow::Get(source);
 
-  // Set Drag Source Data
-  mMimeType = data.GetMimeType();
-  mData     = data.GetData();
+  const char** dataSet = data.GetDataSet();
+  const char** mimeTypes = data.GetMimeTypes();
+
+  mDataMap.clear();
+  for(int i=0; i<data.GetDataSetSize(); ++i)
+  {
+    mDataMap[std::string(mimeTypes[i])] = std::string(dataSet[i]);
+  }
 
   // Set Source Event
   mSourceCallback = callback;
@@ -209,13 +217,16 @@ bool DragAndDropEcoreWl::StartDragAndDrop(Dali::Actor source, Dali::Window shado
   Ecore_Wl2_Display* display      = ecore_wl2_connected_display_get(nullptr);
   Ecore_Wl2_Input*   input        = ecore_wl2_input_default_input_get(display);
 
-  // Set mime type for drag and drop
-  const char* mimeTypes[2];
-  mimeTypes[0] = mMimeType.c_str();
-  mimeTypes[1] = nullptr;
+  int mimeTypesCount = data.GetMimeTypesSize();
+  const char* waylandMimeTypes[mimeTypesCount + 1];
+  for (int i = 0; i < mimeTypesCount; ++i)
+  {
+    waylandMimeTypes[i] = mimeTypes[i];
+  }
+  waylandMimeTypes[mimeTypesCount] = nullptr;
 
-  // Set mime type
-  ecore_wl2_dnd_drag_types_set(input, (const char**)mimeTypes);
+  // Set mime types
+  ecore_wl2_dnd_drag_types_set(input, (const char**)waylandMimeTypes);
 
   // Start wayland drag and drop
   mSerial = ecore_wl2_dnd_drag_start(input, parentWindow, dragWindow);
@@ -226,7 +237,7 @@ bool DragAndDropEcoreWl::StartDragAndDrop(Dali::Actor source, Dali::Window shado
   return true;
 }
 
-bool DragAndDropEcoreWl::AddListener(Dali::Actor target, Dali::DragAndDrop::DragAndDropFunction callback)
+bool DragAndDropEcoreWl::AddListener(Dali::Actor target, char* mimeType, Dali::DragAndDrop::DragAndDropFunction callback)
 {
   std::vector<DropTarget>::iterator itr;
   for(itr = mDropTargets.begin(); itr < mDropTargets.end(); itr++)
@@ -259,6 +270,7 @@ bool DragAndDropEcoreWl::AddListener(Dali::Actor target, Dali::DragAndDrop::Drag
 
   DropTarget targetData;
   targetData.target         = target;
+  targetData.mimeType       = mimeType;
   targetData.callback       = callback;
   targetData.inside         = false;
   targetData.parentWindowId = parentWindowId;
@@ -268,7 +280,7 @@ bool DragAndDropEcoreWl::AddListener(Dali::Actor target, Dali::DragAndDrop::Drag
   return true;
 }
 
-bool DragAndDropEcoreWl::AddListener(Dali::Window target, Dali::DragAndDrop::DragAndDropFunction callback)
+bool DragAndDropEcoreWl::AddListener(Dali::Window target, char* mimeType, Dali::DragAndDrop::DragAndDropFunction callback)
 {
   std::vector<DropWindowTarget>::iterator itr;
   for(itr = mDropWindowTargets.begin(); itr < mDropWindowTargets.end(); itr++)
@@ -290,6 +302,7 @@ bool DragAndDropEcoreWl::AddListener(Dali::Window target, Dali::DragAndDrop::Dra
 
   DropWindowTarget targetData;
   targetData.target   = target;
+  targetData.mimeType = mimeType;
   targetData.callback = callback;
   targetData.inside   = false;
   targetData.windowId = windowId;
@@ -417,18 +430,12 @@ void DragAndDropEcoreWl::SendData(void* event)
     return;
   }
 
-  int dataLength = strlen(mData.c_str());
-  int bufferSize = dataLength;
-  if((mMimeType.find("text") != std::string::npos) ||
-     (mMimeType.find("markup") != std::string::npos) ||
-     (mMimeType.find("image") != std::string::npos))
-  {
-    bufferSize += 1;
-  }
+  int dataLength = strlen(mDataMap[std::string(event_->type)].c_str());
+  int bufferSize = dataLength + 1;
 
   data->slice.mem = new char[bufferSize];
   data->slice.len = bufferSize;
-  memcpy(data->slice.mem, mData.c_str(), dataLength);
+  memcpy(data->slice.mem, mDataMap[std::string(event_->type)].c_str(), dataLength);
   ((char*)data->slice.mem)[dataLength] = '\0';
 
   ecore_main_fd_handler_add(event_->fd, ECORE_FD_WRITE, WriteDelayedDataTofd, data, nullptr, nullptr);
@@ -440,7 +447,9 @@ void DragAndDropEcoreWl::ReceiveData(void* event)
 
   if(mTargetIndex != -1)
   {
-    Dali::DragAndDrop::DragEvent dragEvent(Dali::DragAndDrop::DragType::DROP, mPosition, event_->mimetype, event_->data);
+    mimesPool[0] = event_->mimetype;
+    mimesPool[1] = nullptr;
+    Dali::DragAndDrop::DragEvent dragEvent(Dali::DragAndDrop::DragType::DROP, mPosition, mimesPool, 1, event_->data);
     mDropTargets[mTargetIndex].callback(dragEvent);
     mDropTargets[mTargetIndex].inside = false;
   }
@@ -453,7 +462,9 @@ void DragAndDropEcoreWl::ReceiveData(void* event)
 
   if(mWindowTargetIndex != -1)
   {
-    Dali::DragAndDrop::DragEvent dragEvent(Dali::DragAndDrop::DragType::DROP, mWindowPosition, event_->mimetype, event_->data);
+    mimesPool[0] = event_->mimetype;
+    mimesPool[1] = nullptr;
+    Dali::DragAndDrop::DragEvent dragEvent(Dali::DragAndDrop::DragType::DROP, mWindowPosition, mimesPool, 1, event_->data);
     mDropWindowTargets[mWindowTargetIndex].callback(dragEvent);
     mDropWindowTargets[mWindowTargetIndex].inside = false;
   }
@@ -464,7 +475,9 @@ void DragAndDropEcoreWl::ReceiveData(void* event)
     {
       if(event_->win == static_cast<EcoreWl2EventDragAndDropWindowIdType>(mDropWindowTargets[i].windowId))
       {
-        Dali::DragAndDrop::DragEvent dragEvent(Dali::DragAndDrop::DragType::DROP, mWindowPosition, event_->mimetype, event_->data);
+        mimesPool[0] = event_->mimetype;
+        mimesPool[1] = nullptr;
+        Dali::DragAndDrop::DragEvent dragEvent(Dali::DragAndDrop::DragType::DROP, mWindowPosition, mimesPool, 1, event_->data);
         mDropWindowTargets[i].callback(dragEvent);
         break;
       }
@@ -627,11 +640,21 @@ bool DragAndDropEcoreWl::CalculateDragEvent(void* event)
   Eina_Array* mimes = ecore_wl2_offer_mimes_get(event_->offer);
   if(mimes == nullptr)
   {
-    dragEvent.SetMimeType("");
+    mimesPool[0] = "";
+    dragEvent.SetMimeTypes(mimesPool, 0);
   }
   else
   {
-    dragEvent.SetMimeType((const char*)eina_array_data_get(mimes, 0));
+    unsigned int mimeCount = (unsigned int)eina_array_count((Eina_Array*)mimes);
+    if (mimeCount > MAX_MIME_SIZE)
+    {
+      mimeCount = MAX_MIME_SIZE;
+    }
+    for (unsigned int i = 0; i < mimeCount; ++i)
+    {
+      mimesPool[i] = (char*)eina_array_data_get((Eina_Array*)mimes, i);
+    }
+    dragEvent.SetMimeTypes(mimesPool, mimeCount);
   }
 
   ProcessDragEventsForTargets(event_, dragEvent, mimes);
@@ -663,15 +686,25 @@ bool DragAndDropEcoreWl::ProcessDropEventsForTargets(Ecore_Wl2_Event_Dnd_Drop* e
       mPosition           = position;
       Dali::Window window = Dali::DevelWindow::Get(mDropTargets[i].target);
 
-      char* mimetype = (char*)eina_array_data_get(mimes, 0);
-      if(mimetype)
+      unsigned int mimeCount = (unsigned int)eina_array_count((Eina_Array*)mimes);
+      for (unsigned int j = 0; j < mimeCount; ++j)
       {
-        ecore_wl2_offer_receive(event->offer, mimetype);
-        Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(nullptr);
-        Ecore_Wl2_Input*   input   = ecore_wl2_input_default_input_get(display);
-        ecore_wl2_display_flush(ecore_wl2_input_display_get(input));
+        char* availableType = (char*)eina_array_data_get((Eina_Array*)mimes, j);
+        if (!availableType)
+        {
+          return false;
+        }
+
+        if (!strcmp(mDropTargets[i].mimeType.c_str(),"*/*")
+            || !strcmp(availableType, mDropTargets[i].mimeType.c_str()))
+        {
+          ecore_wl2_offer_receive(event->offer, availableType);
+          Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(nullptr);
+          Ecore_Wl2_Input*   input   = ecore_wl2_input_default_input_get(display);
+          ecore_wl2_display_flush(ecore_wl2_input_display_get(input));
+          return true;
+        }
       }
-      return true;
     }
   }
   return false;
@@ -698,15 +731,25 @@ bool DragAndDropEcoreWl::ProcessDropEventsForWindowTargets(Ecore_Wl2_Event_Dnd_D
       mWindowTargetIndex = i;
       mWindowPosition    = Dali::Vector2(position.GetX(), position.GetY());
 
-      char* mimetype = (char*)eina_array_data_get(mimes, 0);
-      if(mimetype)
+      unsigned int mimeCount = (unsigned int)eina_array_count((Eina_Array*)mimes);
+      for (unsigned int j = 0; j < mimeCount; ++j)
       {
-        ecore_wl2_offer_receive(event->offer, mimetype);
-        Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(nullptr);
-        Ecore_Wl2_Input*   input   = ecore_wl2_input_default_input_get(display);
-        ecore_wl2_display_flush(ecore_wl2_input_display_get(input));
+        char* availableType = (char*)eina_array_data_get((Eina_Array*)mimes, j);
+        if (!availableType)
+        {
+          return false;
+        }
+
+        if (!strcmp(mDropTargets[i].mimeType.c_str(),"*/*")
+            || !strcmp(availableType, mDropTargets[i].mimeType.c_str()))
+        {
+          ecore_wl2_offer_receive(event->offer, availableType);
+          Ecore_Wl2_Display* display = ecore_wl2_connected_display_get(nullptr);
+          Ecore_Wl2_Input*   input   = ecore_wl2_input_default_input_get(display);
+          ecore_wl2_display_flush(ecore_wl2_input_display_get(input));
+          return true;
+        }
       }
-      return true;
     }
   }
   return false;
index 62c53cdb80a5b1ef65dbbd814afa7657670a8ecb..3805a79f4c3d70b5d8d55c0c36449631fc6e6630 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/internal/drag-and-drop/common/drag-and-drop-impl.h>
 #include <dali/internal/system/linux/dali-ecore.h>
 #include <dali/internal/adaptor/tizen-wayland/dali-ecore-wl2.h>
+#include <map>
 
 namespace Dali
 {
@@ -40,6 +41,7 @@ struct DelayedWritingData{
 struct DropTarget
 {
   Dali::Actor                            target;
+  std::string                            mimeType;
   Dali::DragAndDrop::DragAndDropFunction callback;
   bool                                   inside;
   int                                    parentWindowId;
@@ -48,6 +50,7 @@ struct DropTarget
 struct DropWindowTarget
 {
   Dali::Window                            target;
+  std::string                             mimeType;
   Dali::DragAndDrop::DragAndDropFunction  callback;
   bool                                    inside;
   int                                     windowId;
@@ -78,12 +81,12 @@ public:
   /**
    * @copydoc Dali::DragAndDrop::AddListener()
    */
-  bool AddListener(Dali::Actor target, Dali::DragAndDrop::DragAndDropFunction callback) override;
+  bool AddListener(Dali::Actor target, char* mimeType, Dali::DragAndDrop::DragAndDropFunction callback) override;
 
   /**
    * @copydoc Dali::DragAndDrop::AddListener()
    */
-  bool AddListener(Dali::Window target, Dali::DragAndDrop::DragAndDropFunction callback) override;
+  bool AddListener(Dali::Window target, char* mimeType, Dali::DragAndDrop::DragAndDropFunction callback) override;
 
   /**
    * @copydoc Dali::DragAndDrop::RemoveListener()
@@ -179,26 +182,24 @@ private:
   DragAndDropEcoreWl& operator=(DragAndDropEcoreWl&&) = delete;
 
 private:
-  Dali::Window                      mDragWindow;
-  uint32_t                          mSerial{std::numeric_limits<uint32_t>::max()};
-  Ecore_Event_Handler*              mSendHandler{nullptr};
-  Ecore_Event_Handler*              mSourceEndHandler{nullptr};
-  Ecore_Event_Handler*              mSourceDropHandler{nullptr};
-  Ecore_Event_Handler*              mReceiveHandler{nullptr};
-  Ecore_Event_Handler*              mMotionHandler{nullptr};
-  Ecore_Event_Handler*              mDropHandler{nullptr};
-  Ecore_Event_Handler*              mEnterHandler{nullptr};
-  Ecore_Event_Handler*              mLeaveHandler{nullptr};
-  int                               mTargetIndex{-1};
-  int                               mWindowTargetIndex{-1};
-  std::string                       mMimeType;
-  std::string                       mData;
-  int                               mDataSize{0};
-  Dali::Vector2                     mPosition;
-  Dali::Vector2                     mWindowPosition;
-  Dali::DragAndDrop::SourceFunction mSourceCallback{nullptr};
-  std::vector<DropTarget>           mDropTargets;
-  std::vector<DropWindowTarget>     mDropWindowTargets;
+  Dali::Window                       mDragWindow;
+  uint32_t                           mSerial{std::numeric_limits<uint32_t>::max()};
+  Ecore_Event_Handler*               mSendHandler{nullptr};
+  Ecore_Event_Handler*               mSourceEndHandler{nullptr};
+  Ecore_Event_Handler*               mSourceDropHandler{nullptr};
+  Ecore_Event_Handler*               mReceiveHandler{nullptr};
+  Ecore_Event_Handler*               mMotionHandler{nullptr};
+  Ecore_Event_Handler*               mDropHandler{nullptr};
+  Ecore_Event_Handler*               mEnterHandler{nullptr};
+  Ecore_Event_Handler*               mLeaveHandler{nullptr};
+  int                                mTargetIndex{-1};
+  int                                mWindowTargetIndex{-1};
+  Dali::Vector2                      mPosition;
+  Dali::Vector2                      mWindowPosition;
+  Dali::DragAndDrop::SourceFunction  mSourceCallback{nullptr};
+  std::vector<DropTarget>            mDropTargets;
+  std::vector<DropWindowTarget>      mDropWindowTargets;
+  std::map<std::string, std::string> mDataMap;
 }; // class DragAndDropEcoreWl
 
 } // namespace Adaptor