e_comp_wl_data: Add function for accept mimetype and action for given offer 19/296419/1
authorJunseok Kim <juns.kim@samsung.com>
Wed, 12 Jul 2023 05:51:26 +0000 (14:51 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 27 Jul 2023 07:15:32 +0000 (16:15 +0900)
Change-Id: I45b1e385424ac7ea2463aafbc95f5a3da66398b8

src/bin/e_comp_wl_data.c
src/bin/e_comp_wl_data.h

index 6ab844d..2b9653f 100644 (file)
@@ -1569,3 +1569,24 @@ e_comp_wl_data_current_device_id_get(void)
 {
    return e_comp_wl->drag_device_id;
 }
+
+EINTERN void
+e_comp_wl_data_offer_mimetype_action_accept(E_Comp_Wl_Data_Offer *offer)
+{
+   E_Comp_Wl_Data_Source *source;
+
+   if (!offer) return;
+
+   source = offer->source;
+   if (!source) return;
+
+   // set all mime type to accepted
+   if (source->mime_types)
+     source->target(source, 0, eina_array_pop(source->mime_types));
+   source->accepted = EINA_TRUE;
+
+   // set all actions to accepted
+   offer->dnd_actions = WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY | WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE;
+   offer->preferred_dnd_action = WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY;
+   _e_comp_wl_data_offer_update_action(offer);
+}
index 6372e3c..b9c4bc0 100644 (file)
@@ -105,6 +105,7 @@ EINTERN void e_comp_wl_data_device_only_set(struct wl_resource *data_device_res,
 EINTERN Eina_Bool e_comp_wl_data_device_manual_selection_set(void *data, size_t size, Eina_List *mime_list);
 EINTERN void e_comp_wl_data_current_device_id_set(int id);
 EINTERN int e_comp_wl_data_current_device_id_get(void);
+EINTERN void e_comp_wl_data_offer_mimetype_action_accept(E_Comp_Wl_Data_Offer *offer);
 
 # endif
 #endif