summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-01-05 15:05:36 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-08 10:59:25 +0100
commit39f3ce42dcde447779cb1583501b681ba85d86d4 (patch)
tree4bb1c113250dbabbcd8ee6405c34c8539bf53004 /src/lib/ecore_evas
parent40a62ddf94f590b2e79caf63eb399d9bc257b216 (diff)
ecore_evas: Introduce cnp / dnd API for ecore evas
The idea of copy and paste here is: - The user specifies the content he wants to have in the selection buffer with a Eina_Content, these content pointer ownerships are passed to the called. Internally ecore_evas code will memorieze the pointer, and pass on function callbacks to the modules, which then do not have to deal with the ownership. - In case the module does not specify these APIs, the callback implementation will be called, which only works for cnp *not* dnd. - Action and mime types are handled as strings, which allows way better custom organisations. (The docs needs improvement) Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D11192
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h214
-rw-r--r--src/lib/ecore_evas/ecore_evas.c362
-rw-r--r--src/lib/ecore_evas/ecore_evas_fallback_selection.c115
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h53
-rw-r--r--src/lib/ecore_evas/meson.build3
5 files changed, 738 insertions, 9 deletions
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index d59900d788..ddc3622741 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -3669,6 +3669,219 @@ EAPI unsigned long ecore_evas_pixmap_colormap_get(const Ecore_Evas *ee);
3669 */ 3669 */
3670EAPI int ecore_evas_pixmap_depth_get(const Ecore_Evas *ee); 3670EAPI int ecore_evas_pixmap_depth_get(const Ecore_Evas *ee);
3671 3671
3672typedef enum {
3673 ECORE_EVAS_SELECTION_BUFFER_SELECTION_BUFFER = 0, /**< Stores selected / highlighted selection */
3674 ECORE_EVAS_SELECTION_BUFFER_COPY_AND_PASTE_BUFFER = 1, /**< Stores copied things (Ctrl + C) */
3675 ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER = 2, /**< Stores dragged things while drag and drop is happening. */
3676 ECORE_EVAS_SELECTION_BUFFER_LAST = 3,
3677} Ecore_Evas_Selection_Buffer;
3678
3679/**
3680 * @brief Callback called when the content of one of the selection buffers changes.
3681 *
3682 * @param[in] ee The Ecore_Evas that handles this selection.
3683 * @param[in] selection The selection buffer that has changed.
3684 */
3685typedef void (*Ecore_Evas_Selection_Changed_Cb)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection);
3686
3687/**
3688 * @brief Sets a callback for Ecore_Evas to be called when a selection buffer changes.
3689 *
3690 * @param[in] ee The Ecore_Evas to set the callback on.
3691 * @param[in] cb The function to call.
3692 *
3693 * A call to this function will set a callback on an Ecore_Evas, causing
3694 * @p func to be called whenever @p ee selections change.
3695 * Only one such callback can exist for each Ecore_Evas. Calling this method multiple
3696 * times overwrites previous functions. Use a NULL @p func to stop being notified.
3697 *
3698 * You will not be notified about selection changes caused by yourself. (TODO: bu5hm4n?)
3699 *
3700 * @warning If and when this function is called depends on the underlying
3701 * windowing system.
3702 */
3703EAPI void ecore_evas_callback_selection_changed_set(Ecore_Evas *ee, Ecore_Evas_Selection_Changed_Cb cb);
3704
3705/**
3706 * @brief Sets the content of the specified selection buffer.
3707 *
3708 * @param[in] ee The Ecore_Evas to set the selection buffer on.
3709 * @param[in] buffer The selection buffer to set.
3710 * @param[in] content Content to set to the selection buffer. The Eina_Content specifies the MIME type of the data.
3711 * Ownership of the content is transferred.
3712 *
3713 * @note Only ECORE_EVAS_SELECTION_BUFFER_SELECTION_BUFFER and ECORE_EVAS_SELECTION_BUFFER_COPY_AND_PASTE_BUFFER
3714 * buffers can be set. Drag and drop operations use a different set of methods.
3715 */
3716EAPI Eina_Bool ecore_evas_selection_set(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, Eina_Content *content);
3717
3718/**
3719 * @brief Checks if the specified selection buffer has content.
3720 *
3721 * @param[in] ee The ecore evas to query
3722 * @param[in] buffer Which selection buffer to ask
3723 *
3724 * @return EINA_TRUE if there is an available selection for the specified buffer.
3725 *
3726 * EINA_TRUE is also returned when the selection is in the window associated with @p ee
3727 *
3728 * @note Due to the asynchronous nature of selection buffers, this method might not return
3729 * the right result when invoked from the selection callback set with ecore_evas_callback_selection_changed_set.
3730 */
3731EAPI Eina_Bool ecore_evas_selection_exists(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer);
3732
3733/**
3734 * @brief Retrieves the content of the specified selection buffer.
3735 *
3736 * @param[in] ee The ecore evas to query.
3737 * @param[in] buffer Selection buffer to retrieve.
3738 * @param[in] acceptable_types MIME types which are acceptable for the returned Eina_Content.
3739 * The iterator contains plain strings (char *). Ownership is transferred for the iterator but not for the strings.
3740 * This is convenient for the usual case of a hard-coded array of strings, since the iterator can be generated
3741 * on the fly, used and forgotten.
3742 *
3743 * @return An Eina_Future containing an Eina_Content which has one of the types in @p acceptable_type.
3744 * An error is delivered when no matching type is found or when the requested selection buffer is empty.
3745 *
3746 * This method is time consuming, therefore, it is recommended to verify the existence of a selection
3747 * using ecore_evas_selection_exists before calling it.
3748 */
3749EAPI Eina_Future* ecore_evas_selection_get(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, Eina_Iterator *acceptable_types);
3750
3751/**
3752 * @brief This method is called when the mouse pointer enters or exits the specified window while
3753 * performing a drag operation.
3754 *
3755 * @param[in] ee The Ecore Evas the drag operation started on.
3756 * @param[in] p Position (in window coordinates) where the event occurred.
3757 * @param[in] inside @c EINA_TRUE if the pointer just entered this window. @c EINA_FALSE if it has just exited.
3758 *
3759 * Set this callback using ecore_evas_callback_drop_state_changed_set.
3760 */
3761typedef void (*Ecore_Evas_Drag_Finished)(Ecore_Evas *ee, unsigned int seat, void *data, Eina_Bool accepted);
3762
3763/**
3764 * @brief Starts a new drag operation.
3765 *
3766 * @param[in] ee The Ecore Evas the drag operation started on.
3767 * @param[in] content The content to delivery at the drop site (ownership is transferred).
3768 * The Eina_Content has data and its associated MIME type, plus a list of alternate types that can be provided.
3769 * @param[in] drag_rep An Ecore_Evas used as a visual representation of the content being dragged.
3770 * It must have the same type as @p ee. This is the transparent object dragged along the mouse pointer to indicate that
3771 * a drag operation is in progress.
3772 * @p terminate_cb will be called when @p drag_rep is not needed anymore and it must be disposed of.
3773 * Use @p data to convey @p drag_rep to @p terminate_cb. For example, if @p drag_rep is owned by an Efl_Window, @p data
3774 * can point to that window.
3775 * @param[in] action Action the target application should perform upon receiving this content. It is entirely up to the
3776 * target application to honor (or even understand) this request.
3777 * @return @c EINA_TRUE if the drag operation has been successfully started.
3778 *
3779 * This method must be called when a drag operation is initiated in order to provide the necessary information.
3780 */
3781EAPI Eina_Bool ecore_evas_drag_start(Ecore_Evas *ee, unsigned int seat, Eina_Content *content, Ecore_Evas *drag_rep, const char* action, Ecore_Evas_Drag_Finished terminate_cb, void *data);
3782
3783/**
3784 * @brief Cancels an ongoing drag operation.
3785 *
3786 * @param[in] ee The Ecore Evas the drag operation started on.
3787 * @return @c EINA_TRUE if the drag operation has been successfully cancelled.
3788 *
3789 * The initiator of a drag operation can call this method to abort it.
3790 */
3791EAPI Eina_Bool ecore_evas_drag_cancel(Ecore_Evas *ee, unsigned int seat);
3792
3793/**
3794 * @brief This method is called when the mouse pointer enters or exits the specified window while
3795 * performing a drag operation.
3796 *
3797 * @param[in] ee The Ecore Evas the drag operation started on.
3798 * @param[in] p Position (in window coordinates) where the event occurred.
3799 * @param[in] inside @c EINA_TRUE if the pointer just entered this window. @c EINA_FALSE if it has just exited.
3800 *
3801 * Set this callback using ecore_evas_callback_drop_state_changed_set.
3802 */
3803typedef void (*Ecore_Evas_State_Changed)(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, Eina_Bool inside);
3804
3805/**
3806 * @brief Sets the method (callback) to call when the mouse pointer enters or exits the specified window while
3807 * performing a drag operation.
3808 *
3809 * @param[in] ee The Ecore Evas the drag operation started on.
3810 * @param[in] cb Method to call when the events are received.
3811 *
3812 * Only one such callback can exist for each Ecore_Evas. Calling this method multiple
3813 * times overwrites previous functions. Use a NULL @cb func to stop being notified.
3814 */
3815EAPI void ecore_evas_callback_drop_state_changed_set(Ecore_Evas *ee, Ecore_Evas_State_Changed cb);
3816
3817/**
3818 * @brief This method is called when the mouse pointer moves over the specified window while
3819 * performing a drag operation.
3820 *
3821 * @param[in] ee The Ecore Evas the drag operation started on.
3822 * @param[in] p Position (in window coordinates) where the event occurred.
3823 *
3824 * Set this callback using ecore_evas_callback_drop_motion_set.
3825 */
3826
3827typedef void (*Ecore_Evas_Motion_Cb)(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p);
3828/**
3829 * @brief Sets the method (callback) to call when the mouse pointer moves over the specified window while
3830 * performing a drag operation.
3831 *
3832 * @param[in] ee The Ecore Evas the drag operation started on.
3833 * @param[in] cb Method to call when the events are received.
3834 *
3835 * Only one such callback can exist for each Ecore_Evas. Calling this method multiple
3836 * times overwrites previous functions. Use a NULL @cb func to stop being notified.
3837 */
3838EAPI void ecore_evas_callback_drop_motion_set(Ecore_Evas *ee, Ecore_Evas_Motion_Cb cb);
3839
3840/**
3841 * @brief This method is called when the mouse pointer is released over the specified window while
3842 * performing a drag operation (thus dropping the dragged content over the window).
3843 *
3844 * @param[in] ee The Ecore Evas the drag operation started on.
3845 * @param[in] p Position (in window coordinates) where the event occurred.
3846 *
3847 * The dropped data can be retrieved using ecore_evas_selection_get and the
3848 * ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER buffer.
3849 *
3850 * Set this callback using ecore_evas_callback_drop_drop_set.
3851 */
3852typedef void (*Ecore_Evas_Drop_Cb)(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, const char *action);
3853
3854/**
3855 * @brief Sets the method (callback) to call when the mouse pointer is released over the specified window while
3856 * performing a drag operation (thus dropping the dragged content over the window).
3857 *
3858 * @param[in] ee The Ecore Evas the drag operation started on.
3859 * @param[in] cb Method to call when the events are received.
3860 *
3861 * Only one such callback can exist for each Ecore_Evas. Calling this method multiple
3862 * times overwrites previous functions. Use a NULL @cb func to stop being notified.
3863 */
3864EAPI void ecore_evas_callback_drop_drop_set(Ecore_Evas *ee, Ecore_Evas_Drop_Cb cb);
3865
3866// app calls this (from one of the motion cb's, for example) to know the type (and auto conversion) of the thing being dragged.
3867// This is the same as calling selection_get and retrieving the types from there (but faster).
3868/**
3869 * @brief Retrieves the list of types the data currently being dragged can be automatically converted to.
3870 *
3871 * @param[in] ee The Ecore Evas the drag operation started on.
3872 * @return
3873 *
3874 * This can be used in any of the drag and drop callbacks (Ecore_Evas_State_Changed, Ecore_Evas_Motion_Cb and
3875 * Ecore_Evas_Drop_Cb) to check if the data being dragged is acceptable and give the user some early feedback
3876 * before the data is actually dropped on the window.
3877 *
3878 * This is functionally equivalent to calling ecore_evas_selection_get and examining the available types in the
3879 * returned Eina_Content, but much faster since the actual data does not have to be asynchronously requested to the
3880 * initiator application.
3881 */
3882EAPI Eina_Accessor* ecore_evas_drop_available_types_get(Ecore_Evas *ee, unsigned int seat);
3883
3884
3672/** 3885/**
3673 * @} 3886 * @}
3674 */ 3887 */
@@ -3685,3 +3898,4 @@ EAPI int ecore_evas_pixmap_depth_get(const Ecore_Evas *ee);
3685#define EAPI 3898#define EAPI
3686 3899
3687#endif 3900#endif
3901
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index d3c26ddb19..a95f7903d8 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -652,6 +652,10 @@ ecore_evas_init(void)
652 iface.del = _ecore_evas_animator_del; 652 iface.del = _ecore_evas_animator_del;
653 ecore_evas_object_animator_init(&iface); 653 ecore_evas_object_animator_init(&iface);
654 654
655 ecore_evas_no_matching_type = eina_error_msg_register("No fitting type could be found");
656 ecore_evas_no_selection = eina_error_msg_register("No selection available");
657 ecore_evas_request_replaced = eina_error_msg_register("Selection request replaced");
658
655 return _ecore_evas_init_count; 659 return _ecore_evas_init_count;
656 660
657 shutdown_ecore: 661 shutdown_ecore:
@@ -2818,7 +2822,7 @@ ecore_evas_shadow_geometry_get(const Ecore_Evas *ee, int *l, int *r, int *t, int
2818 if (b) *b = ee->shadow.b; 2822 if (b) *b = ee->shadow.b;
2819} 2823}
2820 2824
2821EAPI void 2825EAPI void
2822ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y) 2826ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
2823{ 2827{
2824 if (x) *x = 0; 2828 if (x) *x = 0;
@@ -2828,7 +2832,7 @@ ecore_evas_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
2828 IFE; 2832 IFE;
2829} 2833}
2830 2834
2831EAPI Eina_Bool 2835EAPI Eina_Bool
2832ecore_evas_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y) 2836ecore_evas_pointer_warp(const Ecore_Evas *ee, Evas_Coord x, Evas_Coord y)
2833{ 2837{
2834 ECORE_EVAS_CHECK(ee, EINA_FALSE); 2838 ECORE_EVAS_CHECK(ee, EINA_FALSE);
@@ -2905,7 +2909,7 @@ ecore_evas_pixmap_visual_get(const Ecore_Evas *ee)
2905 return NULL; 2909 return NULL;
2906} 2910}
2907 2911
2908EAPI unsigned long 2912EAPI unsigned long
2909ecore_evas_pixmap_colormap_get(const Ecore_Evas *ee) 2913ecore_evas_pixmap_colormap_get(const Ecore_Evas *ee)
2910{ 2914{
2911 ECORE_EVAS_CHECK(ee, 0); 2915 ECORE_EVAS_CHECK(ee, 0);
@@ -2932,7 +2936,7 @@ ecore_evas_pixmap_colormap_get(const Ecore_Evas *ee)
2932 return 0; 2936 return 0;
2933} 2937}
2934 2938
2935EAPI int 2939EAPI int
2936ecore_evas_pixmap_depth_get(const Ecore_Evas *ee) 2940ecore_evas_pixmap_depth_get(const Ecore_Evas *ee)
2937{ 2941{
2938 ECORE_EVAS_CHECK(ee, 0); 2942 ECORE_EVAS_CHECK(ee, 0);
@@ -3524,6 +3528,9 @@ _ecore_evas_free(Ecore_Evas *ee)
3524 free(iface); 3528 free(iface);
3525 3529
3526 ee->engine.ifaces = NULL; 3530 ee->engine.ifaces = NULL;
3531
3532 if (ee->fallback_interface)
3533 fallback_selection_shutdown(ee);
3527 free(ee); 3534 free(ee);
3528} 3535}
3529 3536
@@ -3542,7 +3549,7 @@ _ecore_evas_idle_timeout_update(Ecore_Evas *ee)
3542{ 3549{
3543 if (ee->engine.idle_flush_timer) 3550 if (ee->engine.idle_flush_timer)
3544 ecore_timer_del(ee->engine.idle_flush_timer); 3551 ecore_timer_del(ee->engine.idle_flush_timer);
3545 ee->engine.idle_flush_timer = 3552 ee->engine.idle_flush_timer =
3546 ecore_timer_loop_add(IDLE_FLUSH_TIME, _ecore_evas_cb_idle_flush, ee); 3553 ecore_timer_loop_add(IDLE_FLUSH_TIME, _ecore_evas_cb_idle_flush, ee);
3547} 3554}
3548 3555
@@ -4007,7 +4014,7 @@ ecore_evas_software_x11_pixmap_new(const char *disp_name, Ecore_X_Window parent,
4007 4014
4008} 4015}
4009 4016
4010EAPI Ecore_X_Pixmap 4017EAPI Ecore_X_Pixmap
4011ecore_evas_software_x11_pixmap_get(const Ecore_Evas *ee) 4018ecore_evas_software_x11_pixmap_get(const Ecore_Evas *ee)
4012{ 4019{
4013 Ecore_Evas_Interface_Software_X11 *iface; 4020 Ecore_Evas_Interface_Software_X11 *iface;
@@ -4082,7 +4089,7 @@ ecore_evas_gl_x11_pixmap_new(const char *disp_name, Ecore_X_Window parent, int x
4082 4089
4083} 4090}
4084 4091
4085EAPI Ecore_X_Pixmap 4092EAPI Ecore_X_Pixmap
4086ecore_evas_gl_x11_pixmap_get(const Ecore_Evas *ee) 4093ecore_evas_gl_x11_pixmap_get(const Ecore_Evas *ee)
4087{ 4094{
4088 Ecore_Evas_Interface_Gl_X11 *iface; 4095 Ecore_Evas_Interface_Gl_X11 *iface;
@@ -5449,3 +5456,344 @@ _ecore_evas_animator_thaw(Ecore_Animator *in)
5449 EINA_INLIST_GET(animator)); 5456 EINA_INLIST_GET(animator));
5450 _ticking_start(ee); 5457 _ticking_start(ee);
5451} 5458}
5459
5460EAPI void
5461ecore_evas_callback_selection_changed_set(Ecore_Evas *ee, Ecore_Evas_Selection_Changed_Cb func)
5462{
5463 ECORE_EVAS_CHECK(ee);
5464 ee->func.fn_selection_changed = func;
5465}
5466
5467static Ecore_Evas_Selection_Seat_Buffers*
5468_fetch_selection_buffers_of_seat(Ecore_Evas *ee, unsigned int seat, Eina_Bool create)
5469{
5470 Ecore_Evas_Selection_Seat_Buffers *buffers;
5471 if (!ee->selection_buffers)
5472 ee->selection_buffers = eina_hash_int32_new(free);
5473
5474 buffers = eina_hash_find(ee->selection_buffers, &seat);
5475
5476 if (!buffers && create)
5477 {
5478 buffers = calloc(1, sizeof(Ecore_Evas_Selection_Seat_Buffers));
5479 buffers->seat = seat;
5480 eina_hash_add(ee->selection_buffers, &seat, buffers);
5481 }
5482 return buffers;
5483}
5484
5485static Eina_Bool
5486_deliver_cb(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, const char *type, Eina_Rw_Slice *slice)
5487{
5488 Ecore_Evas_Selection_Seat_Buffers *buffers;
5489 Eina_Content *content;
5490 Eina_Content *converted = NULL;
5491 Eina_Bool result = EINA_FALSE;
5492
5493 INF("Delivery request on seat %d in buffer %d", seat, buffer);
5494
5495 buffers = _fetch_selection_buffers_of_seat(ee, seat, EINA_FALSE);
5496 EINA_SAFETY_ON_NULL_GOTO(buffers, free_everything);
5497 content = buffers->selection_buffer[buffer];
5498 EINA_SAFETY_ON_NULL_GOTO(content, free_everything);
5499 if (!eina_streq(type, eina_content_type_get(content)))
5500 converted = eina_content_convert(content, type);
5501 else
5502 converted = content;
5503
5504 EINA_SAFETY_ON_NULL_GOTO(converted, free_everything);
5505 *slice = eina_slice_dup(eina_content_data_get(converted));
5506 result = EINA_TRUE;
5507
5508 if (buffer == ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER)
5509 {
5510 ee->drag.accepted = EINA_TRUE;
5511 }
5512
5513free_everything:
5514 if (converted && content && !eina_streq(type, eina_content_type_get(content)))
5515 eina_content_free(converted);
5516
5517 return result;
5518}
5519
5520static void
5521_cancel_cb(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer)
5522{
5523 Ecore_Evas_Selection_Seat_Buffers *buffers;
5524
5525 INF("Cancel request on seat %d in buffer %d", seat, buffer);
5526
5527 buffers = _fetch_selection_buffers_of_seat(ee, seat, EINA_FALSE);
5528 EINA_SAFETY_ON_FALSE_RETURN(buffers);
5529 EINA_SAFETY_ON_FALSE_RETURN(buffers->selection_buffer[buffer]);
5530 eina_content_free(buffers->selection_buffer[buffer]);
5531 buffers->selection_buffer[buffer] = NULL;
5532
5533 if (buffer == ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER)
5534 {
5535 ee->drag.rep = NULL;
5536 if (ee->drag.free)
5537 ee->drag.free(ee, seat, ee->drag.data, EINA_FALSE);
5538 ee->drag.free = NULL;
5539 }
5540}
5541
5542#define CALL(call) (ee->engine.func->fn_ ##call ? : fallback_ ##call)
5543
5544static Eina_Array*
5545_iterator_to_array(Eina_Iterator *iter, const char *existing_type)
5546{
5547 Eina_Array *ret = eina_array_new(10);
5548 const char *type;
5549
5550 if (existing_type)
5551 eina_array_push(ret, existing_type);
5552
5553 EINA_ITERATOR_FOREACH(iter, type)
5554 {
5555 eina_array_push(ret, type);
5556 }
5557 eina_iterator_free(iter);
5558
5559 return ret;
5560}
5561
5562EAPI Eina_Bool
5563ecore_evas_selection_set(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, Eina_Content *content)
5564{
5565 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, EINA_FALSE);
5566 EINA_SAFETY_ON_FALSE_RETURN_VAL(buffer >= 0 && buffer < ECORE_EVAS_SELECTION_BUFFER_LAST, EINA_FALSE);
5567 Eina_Iterator *available_type = NULL;
5568 Eina_Bool success;
5569 Ecore_Evas_Selection_Seat_Buffers *buffers;
5570
5571 INF("Selection set on seat %d in buffer %d", seat, buffer);
5572
5573 buffers = _fetch_selection_buffers_of_seat(ee, seat, EINA_TRUE);
5574
5575 if (content)
5576 available_type = eina_content_possible_conversions(content);
5577
5578 if (buffer == ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER)
5579 {
5580 ERR("You cannot set a selection with this API, please use the API to start a drag operation");
5581 return EINA_FALSE;
5582 }
5583
5584 success = CALL(selection_claim)(ee, seat, buffer, _iterator_to_array(available_type, content ? eina_content_type_get(content) : NULL), content ? _deliver_cb : NULL, content ? _cancel_cb : NULL);
5585 if (success)
5586 {
5587 EINA_SAFETY_ON_FALSE_RETURN_VAL(buffers->selection_buffer[buffer] == NULL, EINA_FALSE);
5588 //keep this after the claim, the claim might call cancel, which would overwrite this.
5589 buffers->selection_buffer[buffer] = content;
5590 }
5591 else
5592 {
5593 eina_content_free(content);
5594 }
5595
5596 return success;
5597}
5598
5599EAPI Eina_Bool
5600ecore_evas_selection_exists(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer)
5601{
5602 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, EINA_FALSE);
5603 EINA_SAFETY_ON_FALSE_RETURN_VAL(buffer >= 0 && buffer < ECORE_EVAS_SELECTION_BUFFER_LAST, EINA_FALSE);
5604 Ecore_Evas_Selection_Seat_Buffers *buffers;
5605
5606 INF("Exists request on seat %d in buffer %d", seat, buffer);
5607
5608 buffers = _fetch_selection_buffers_of_seat(ee, seat, EINA_TRUE);
5609 if (buffers->selection_buffer[buffer])
5610 return EINA_TRUE;
5611 else
5612 {
5613 return CALL(selection_has_owner)(ee, seat, buffer);
5614 }
5615}
5616
5617static Eina_Array*
5618_iterator_to_array_stringshared(Eina_Iterator *iter)
5619{
5620 Eina_Array *ret = eina_array_new(10);
5621 const char *type;
5622
5623 EINA_ITERATOR_FOREACH(iter, type)
5624 {
5625 eina_array_push(ret, eina_stringshare_add(type));
5626 }
5627 eina_iterator_free(iter);
5628
5629 return ret;
5630}
5631
5632EAPI Eina_Future*
5633ecore_evas_selection_get(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, Eina_Iterator *acceptable_types)
5634{
5635 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, NULL);
5636 EINA_SAFETY_ON_FALSE_RETURN_VAL(buffer >= 0 && buffer < ECORE_EVAS_SELECTION_BUFFER_LAST, NULL);
5637
5638 INF("Selection get request on seat %d in buffer %d", seat, buffer);
5639
5640 return CALL(selection_request)(ee, seat, buffer, _iterator_to_array_stringshared(acceptable_types));
5641}
5642
5643EAPI Eina_Bool
5644ecore_evas_drag_start(Ecore_Evas *ee, unsigned int seat, Eina_Content *content, Ecore_Evas *drag_rep, const char* action, Ecore_Evas_Drag_Finished terminate_cb, void *data)
5645{
5646 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, EINA_FALSE);
5647 EINA_SAFETY_ON_NULL_RETURN_VAL(content, EINA_FALSE);
5648 Eina_Iterator *available_type = eina_content_possible_conversions(content);
5649 Eina_Bool success;
5650 Ecore_Evas_Selection_Seat_Buffers *buffers;
5651
5652 INF("Drag start on seat %d", seat);
5653
5654 buffers = _fetch_selection_buffers_of_seat(ee, seat, EINA_TRUE);
5655 success = CALL(dnd_start)(ee, seat, _iterator_to_array(available_type, eina_content_type_get(content)), drag_rep, _deliver_cb, _cancel_cb, action);
5656 EINA_SAFETY_ON_FALSE_RETURN_VAL(buffers->selection_buffer[ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER] == NULL, EINA_FALSE);
5657 //keep this after the claim, the claim might call cancel, which would overwrite this.
5658 buffers->selection_buffer[ECORE_EVAS_SELECTION_BUFFER_DRAG_AND_DROP_BUFFER] = content;
5659
5660 ee->drag.rep = drag_rep;
5661 ee->drag.free = terminate_cb;
5662 ee->drag.data = data;
5663 ee->drag.accepted = EINA_FALSE;
5664
5665 return success;
5666}
5667
5668EAPI Eina_Bool
5669ecore_evas_drag_cancel(Ecore_Evas *ee, unsigned int seat)
5670{
5671 EINA_SAFETY_ON_NULL_RETURN_VAL(ee, EINA_FALSE);
5672
5673 INF("Drag cancel on seat %d", seat);
5674
5675 return CALL(dnd_stop)(ee, seat);
5676}
5677
5678EAPI void
5679ecore_evas_callback_drop_motion_set(Ecore_Evas *ee, Ecore_Evas_Motion_Cb cb)
5680{
5681 ECORE_EVAS_CHECK(ee);
5682 ee->func.fn_dnd_motion = cb;
5683}
5684
5685EAPI void
5686ecore_evas_callback_drop_state_changed_set(Ecore_Evas *ee, Ecore_Evas_State_Changed cb)
5687{
5688 ECORE_EVAS_CHECK(ee);
5689 ee->func.fn_dnd_state_change = cb;
5690}
5691
5692EAPI void
5693ecore_evas_callback_drop_drop_set(Ecore_Evas *ee, Ecore_Evas_Drop_Cb cb)
5694{
5695 ECORE_EVAS_CHECK(ee);
5696 ee->func.fn_dnd_drop = cb;
5697}
5698
5699typedef struct {
5700 Eina_Array *available_mime_types;
5701 Eina_Position2D pos;
5702} Ecore_Evas_Active_Dnd;
5703
5704static void
5705_ecore_evas_active_dnd_free(Ecore_Evas_Active_Dnd *dnd)
5706{
5707 eina_array_free(dnd->available_mime_types);
5708 free(dnd);
5709}
5710
5711EAPI void
5712ecore_evas_dnd_enter(Ecore_Evas *ee, unsigned int seat, Eina_Iterator *available_types, Eina_Position2D pos)
5713{
5714 Eina_Stringshare *s;
5715 Ecore_Evas_Active_Dnd *dnd;
5716
5717 ECORE_EVAS_CHECK(ee);
5718 if (!ee->active_drags)
5719 {
5720 ee->active_drags = eina_hash_int32_new((Eina_Free_Cb)_ecore_evas_active_dnd_free);
5721 }
5722
5723 dnd = calloc(1, sizeof(Ecore_Evas_Active_Dnd));
5724 dnd->available_mime_types = eina_array_new(5);
5725 eina_hash_add(ee->active_drags, &seat, dnd);
5726
5727 EINA_ITERATOR_FOREACH(available_types, s)
5728 {
5729 eina_array_push(dnd->available_mime_types, s);
5730 }
5731 eina_iterator_free(available_types);
5732
5733 if (ee->func.fn_dnd_state_change)
5734 ee->func.fn_dnd_state_change(ee, seat, pos, EINA_TRUE);
5735}
5736
5737EAPI void
5738ecore_evas_dnd_position_set(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos)
5739{
5740 Ecore_Evas_Active_Dnd *dnd;
5741
5742 ECORE_EVAS_CHECK(ee);
5743 EINA_SAFETY_ON_NULL_RETURN(ee->active_drags);
5744 dnd = eina_hash_find(ee->active_drags, &seat);
5745 EINA_SAFETY_ON_NULL_RETURN(dnd);
5746 dnd->pos = pos;
5747 if (ee->func.fn_dnd_motion)
5748 ee->func.fn_dnd_motion(ee, seat, pos);
5749}
5750
5751EAPI void
5752ecore_evas_dnd_leave(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos)
5753{
5754 Ecore_Evas_Active_Dnd *dnd;
5755
5756 ECORE_EVAS_CHECK(ee);
5757 EINA_SAFETY_ON_NULL_RETURN(ee->active_drags);
5758 dnd = eina_hash_find(ee->active_drags, &seat);
5759 EINA_SAFETY_ON_NULL_RETURN(dnd);
5760
5761 if (ee->func.fn_dnd_state_change)
5762 ee->func.fn_dnd_state_change(ee, seat, pos, EINA_FALSE);
5763 eina_hash_del(ee->active_drags, &seat, dnd);
5764 if (eina_hash_population(ee->active_drags) == 0)
5765 {
5766 eina_hash_free(ee->active_drags);
5767 ee->active_drags = NULL;
5768 }
5769}
5770
5771EAPI Eina_Position2D
5772ecore_evas_dnd_pos_get(Ecore_Evas *ee, unsigned int seat)
5773{
5774 Ecore_Evas_Active_Dnd *dnd;
5775
5776 ECORE_EVAS_CHECK_GOTO(ee, err);
5777 EINA_SAFETY_ON_NULL_RETURN_VAL(ee->active_drags, EINA_POSITION2D(0, 0));
5778 dnd = eina_hash_find(ee->active_drags, &seat);
5779 EINA_SAFETY_ON_NULL_RETURN_VAL(dnd, EINA_POSITION2D(0, 0));
5780
5781 return dnd->pos;
5782err:
5783 return EINA_POSITION2D(0, 0);
5784}
5785
5786EAPI Eina_Accessor*
5787ecore_evas_drop_available_types_get(Ecore_Evas *ee, unsigned int seat)
5788{
5789 Ecore_Evas_Active_Dnd *dnd;
5790
5791 ECORE_EVAS_CHECK_GOTO(ee, err);
5792 EINA_SAFETY_ON_NULL_RETURN_VAL(ee->active_drags, NULL);
5793 dnd = eina_hash_find(ee->active_drags, &seat);
5794 EINA_SAFETY_ON_NULL_RETURN_VAL(dnd, NULL);
5795
5796 return eina_array_accessor_new(dnd->available_mime_types);
5797err:
5798 return NULL;
5799}
diff --git a/src/lib/ecore_evas/ecore_evas_fallback_selection.c b/src/lib/ecore_evas/ecore_evas_fallback_selection.c
new file mode 100644
index 0000000000..1088e617f7
--- /dev/null
+++ b/src/lib/ecore_evas/ecore_evas_fallback_selection.c
@@ -0,0 +1,115 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <Ecore.h>
6#include "ecore_private.h"
7#include "Ecore_Evas.h"
8#include "ecore_evas_private.h"
9#include <Efl_Core.h>
10
11typedef struct {
12 Ecore_Evas_Selection_Callbacks callbacks[ECORE_EVAS_SELECTION_BUFFER_LAST];
13 int seat;
14} Ecore_Evas_Fallback_Selection_Data;
15
16static Ecore_Evas_Fallback_Selection_Data data[ECORE_EVAS_SELECTION_BUFFER_LAST];
17
18void
19fallback_selection_shutdown(Ecore_Evas *ee)
20{
21 for (int i = 0; i < ECORE_EVAS_SELECTION_BUFFER_LAST; ++i)
22 {
23 if (data->callbacks[i].cancel)
24 data->callbacks[i].cancel(ee, data->seat, i);
25 }
26}
27
28Eina_Bool
29fallback_selection_claim(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *available_types, Ecore_Evas_Internal_Delivery delivery, Ecore_Evas_Internal_Cancel cancel)
30{
31 Ecore_Evas_Selection_Callbacks *callbacks = &data->callbacks[selection];
32
33 if (callbacks->cancel)
34 {
35 callbacks->cancel(ee, data->seat, selection);
36 eina_array_free(callbacks->available_types);
37 }
38
39 callbacks->delivery = delivery;
40 callbacks->cancel = cancel;
41 callbacks->available_types = available_types;
42 data->seat = seat;
43
44 if (ee->func.fn_selection_changed)
45 ee->func.fn_selection_changed(ee, seat, selection);
46
47 return EINA_TRUE;
48}
49
50Eina_Bool
51fallback_selection_has_owner(Ecore_Evas *ee EINA_UNUSED, unsigned int seat EINA_UNUSED, Ecore_Evas_Selection_Buffer selection EINA_UNUSED)
52{
53 return EINA_FALSE; //if the real selection buffer does not contain it, then we dont know it either.
54}
55
56Eina_Stringshare*
57available_types(Eina_Array *acceptable_types, Eina_Array *available_types)
58{
59 unsigned int found_type_id = INT_MAX;
60 Eina_Stringshare *found_type = NULL;
61 Eina_Stringshare *type;
62
63 for (unsigned int i = 0; i < eina_array_count_get(acceptable_types); ++i)
64 {
65 unsigned int out = -1;
66
67 type = eina_array_data_get(acceptable_types, i);
68
69 if (!eina_array_find(available_types, type, &out))
70 continue;
71 if (out >= found_type_id)
72 continue;
73 found_type_id = out;
74 found_type = type;
75 eina_stringshare_del(type);
76 }
77 eina_array_free(acceptable_types);
78
79 return found_type;
80}
81
82Eina_Future*
83fallback_selection_request(Ecore_Evas *ee EINA_UNUSED, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *acceptable_type)
84{
85 Ecore_Evas_Selection_Callbacks callbacks = data->callbacks[selection];
86 Eina_Content *result;
87 Eina_Stringshare *serving_type;
88 Eina_Rw_Slice slice_data;
89 Eina_Value value;
90
91 if (!callbacks.delivery)
92 return eina_future_resolved(efl_loop_future_scheduler_get(efl_main_loop_get()), eina_value_int_init(0));
93
94 serving_type = available_types(acceptable_type, callbacks.available_types);
95 if (!serving_type)
96 return NULL; //Silent return cause we cannot deliver a good type
97
98 EINA_SAFETY_ON_FALSE_RETURN_VAL(callbacks.delivery(ee, seat, selection, serving_type, &slice_data), NULL);
99 result = eina_content_new(eina_rw_slice_slice_get(slice_data), serving_type);
100 value = eina_value_content_init(result);
101 eina_content_free(result);
102
103 return eina_future_resolved(efl_loop_future_scheduler_get(efl_main_loop_get()), value);
104}
105Eina_Bool
106fallback_dnd_start(Ecore_Evas *ee EINA_UNUSED, unsigned int seat EINA_UNUSED, Eina_Array *available_types EINA_UNUSED, Ecore_Evas *drag_rep EINA_UNUSED, Ecore_Evas_Internal_Delivery delivery EINA_UNUSED, Ecore_Evas_Internal_Cancel cancel EINA_UNUSED, const char* action EINA_UNUSED)
107{
108 return EINA_FALSE;
109}
110
111Eina_Bool
112fallback_dnd_stop(Ecore_Evas *ee EINA_UNUSED, unsigned int seat EINA_UNUSED)
113{
114 return EINA_FALSE;
115}
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index 474b7a35ed..10191b0152 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -33,6 +33,10 @@
33 33
34EAPI extern int _ecore_evas_log_dom; 34EAPI extern int _ecore_evas_log_dom;
35 35
36EAPI Eina_Error ecore_evas_no_matching_type;
37EAPI Eina_Error ecore_evas_no_selection;
38EAPI Eina_Error ecore_evas_request_replaced;
39
36#ifdef ECORE_EVAS_DEFAULT_LOG_COLOR 40#ifdef ECORE_EVAS_DEFAULT_LOG_COLOR
37# undef ECORE_EVAS_DEFAULT_LOG_COLOR 41# undef ECORE_EVAS_DEFAULT_LOG_COLOR
38#endif 42#endif
@@ -78,6 +82,13 @@ typedef struct _Ecore_Evas_Interface Ecore_Evas_Interface;
78typedef struct _Ecore_Evas_Aux_Hint Ecore_Evas_Aux_Hint; 82typedef struct _Ecore_Evas_Aux_Hint Ecore_Evas_Aux_Hint;
79typedef struct _Ecore_Evas_Cursor Ecore_Evas_Cursor; 83typedef struct _Ecore_Evas_Cursor Ecore_Evas_Cursor;
80 84
85typedef Eina_Bool (*Ecore_Evas_Internal_Delivery)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer, const char *type, Eina_Rw_Slice *slice);
86typedef void (*Ecore_Evas_Internal_Cancel)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer buffer);
87typedef struct {
88 Ecore_Evas_Internal_Delivery delivery;
89 Ecore_Evas_Internal_Cancel cancel;
90 Eina_Array *available_types;
91} Ecore_Evas_Selection_Callbacks;
81/* Engines interfaces */ 92/* Engines interfaces */
82struct _Ecore_Evas_Engine_Func 93struct _Ecore_Evas_Engine_Func
83{ 94{
@@ -171,6 +182,12 @@ struct _Ecore_Evas_Engine_Func
171 Eina_Bool (*fn_prepare)(Ecore_Evas *ee); 182 Eina_Bool (*fn_prepare)(Ecore_Evas *ee);
172 183
173 double (*fn_last_tick_get)(Ecore_Evas *ee); 184 double (*fn_last_tick_get)(Ecore_Evas *ee);
185
186 Eina_Bool (*fn_selection_claim)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *available_types, Ecore_Evas_Internal_Delivery delivery, Ecore_Evas_Internal_Cancel cancel);
187 Eina_Bool (*fn_selection_has_owner)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection);
188 Eina_Future* (*fn_selection_request)(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *acceptable_types); // a future containing a Eina_Content, type must be in acceptable_types
189 Eina_Bool (*fn_dnd_start)(Ecore_Evas *ee, unsigned int seat, Eina_Array *available_types, Ecore_Evas *drag_rep, Ecore_Evas_Internal_Delivery delivery, Ecore_Evas_Internal_Cancel cancel, const char *action);
190 Eina_Bool (*fn_dnd_stop)(Ecore_Evas *ee, unsigned int seat);
174}; 191};
175 192
176struct _Ecore_Evas_Interface 193struct _Ecore_Evas_Interface
@@ -202,6 +219,11 @@ struct _Ecore_Evas_Cursor {
202 int pos_y; 219 int pos_y;
203}; 220};
204 221
222typedef struct {
223 unsigned int seat;
224 Eina_Content *selection_buffer[ECORE_EVAS_SELECTION_BUFFER_LAST];
225} Ecore_Evas_Selection_Seat_Buffers;
226
205struct _Ecore_Evas 227struct _Ecore_Evas
206{ 228{
207 EINA_INLIST; 229 EINA_INLIST;
@@ -224,6 +246,8 @@ struct _Ecore_Evas
224 246
225 Eina_List *vnc_server; /* @since 1.19 */ 247 Eina_List *vnc_server; /* @since 1.19 */
226 248
249 Eina_Hash *selection_buffers;
250
227 struct { 251 struct {
228 int x, y, w, h; 252 int x, y, w, h;
229 } req; 253 } req;
@@ -259,7 +283,7 @@ struct _Ecore_Evas
259 Eina_Bool supported; // indicate that the underlying window system supports window manager rotation protocol 283 Eina_Bool supported; // indicate that the underlying window system supports window manager rotation protocol
260 Eina_Bool app_set; // indicate that the ee supports window manager rotation protocol 284 Eina_Bool app_set; // indicate that the ee supports window manager rotation protocol
261 Eina_Bool win_resize; // indicate that the ee will be resized by the WM 285 Eina_Bool win_resize; // indicate that the ee will be resized by the WM
262 int angle; // rotation value which is decided by the WM 286 int angle; // rotation value which is decided by the WM
263 int w, h; // window size to rotate 287 int w, h; // window size to rotate
264 int preferred_rot; // preferred rotation hint 288 int preferred_rot; // preferred rotation hint
265 int *available_rots; // array of avaialable rotation values 289 int *available_rots; // array of avaialable rotation values
@@ -323,6 +347,10 @@ struct _Ecore_Evas
323 void (*fn_focus_device_out) (Ecore_Evas *ee, Efl_Input_Device *seat); 347 void (*fn_focus_device_out) (Ecore_Evas *ee, Efl_Input_Device *seat);
324 void (*fn_device_mouse_in) (Ecore_Evas *ee, Efl_Input_Device *mouse); 348 void (*fn_device_mouse_in) (Ecore_Evas *ee, Efl_Input_Device *mouse);
325 void (*fn_device_mouse_out) (Ecore_Evas *ee, Efl_Input_Device *mouse); 349 void (*fn_device_mouse_out) (Ecore_Evas *ee, Efl_Input_Device *mouse);
350 void (*fn_selection_changed) (Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection);
351 void (*fn_dnd_motion) (Ecore_Evas *ee, unsigned int seat, Eina_Position2D p);
352 void (*fn_dnd_state_change) (Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, Eina_Bool inside);
353 void (*fn_dnd_drop)(Ecore_Evas *ee, unsigned int seat, Eina_Position2D p, const char *action);
326 } func; 354 } func;
327 355
328 Ecore_Evas_Engine engine; 356 Ecore_Evas_Engine engine;
@@ -353,6 +381,14 @@ struct _Ecore_Evas
353 unsigned char rotation_changed : 1; 381 unsigned char rotation_changed : 1;
354 } delayed; 382 } delayed;
355 383
384 Eina_Hash *active_drags;
385 struct {
386 Ecore_Evas *rep;
387 void *data;
388 Ecore_Evas_Drag_Finished free;
389 Eina_Bool accepted;
390 } drag;
391
356 int refcount; 392 int refcount;
357//#define ECORE_EVAS_ASYNC_RENDER_DEBUG 1 /* TODO: remove me */ 393//#define ECORE_EVAS_ASYNC_RENDER_DEBUG 1 /* TODO: remove me */
358#ifdef ECORE_EVAS_ASYNC_RENDER_DEBUG 394#ifdef ECORE_EVAS_ASYNC_RENDER_DEBUG
@@ -374,6 +410,7 @@ struct _Ecore_Evas
374 unsigned char first_frame : 1; 410 unsigned char first_frame : 1;
375 unsigned char self_del : 1; 411 unsigned char self_del : 1;
376 unsigned char evas_dying : 1; 412 unsigned char evas_dying : 1;
413 unsigned char fallback_interface : 1;
377}; 414};
378 415
379struct _Ecore_Evas_Aux_Hint 416struct _Ecore_Evas_Aux_Hint
@@ -486,6 +523,20 @@ EAPI Eina_Bool ecore_evas_render(Ecore_Evas *ee);
486EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h); 523EAPI Evas *ecore_evas_evas_new(Ecore_Evas *ee, int w, int h);
487EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window); 524EAPI void ecore_evas_done(Ecore_Evas *ee, Eina_Bool single_window);
488 525
526EAPI void ecore_evas_dnd_position_set(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos);
527EAPI void ecore_evas_dnd_leave(Ecore_Evas *ee, unsigned int seat, Eina_Position2D pos);
528EAPI void ecore_evas_dnd_enter(Ecore_Evas *ee, unsigned int seat, Eina_Iterator *available_types, Eina_Position2D pos);
529EAPI Eina_Position2D ecore_evas_dnd_pos_get(Ecore_Evas *ee, unsigned int seat);
530
531
532void fallback_selection_init(Ecore_Evas *ee);
533void fallback_selection_shutdown(Ecore_Evas *ee);
534Eina_Bool fallback_selection_claim(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *available_types, Ecore_Evas_Internal_Delivery delivery, Ecore_Evas_Internal_Cancel cancel);
535Eina_Bool fallback_selection_has_owner(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection);
536Eina_Future* fallback_selection_request(Ecore_Evas *ee, unsigned int seat, Ecore_Evas_Selection_Buffer selection, Eina_Array *acceptable_type);
537Eina_Bool fallback_dnd_start(Ecore_Evas *ee, unsigned int seat, Eina_Array *available_types, Ecore_Evas *drag_rep, Ecore_Evas_Internal_Delivery delivery, Ecore_Evas_Internal_Cancel cancel, const char* action);
538Eina_Bool fallback_dnd_stop(Ecore_Evas *ee, unsigned int seat);
539
489#ifdef IPA_YLNO_ESU_LANRETNI_MLE 540#ifdef IPA_YLNO_ESU_LANRETNI_MLE
490EAPI Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame); 541EAPI Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame);
491EAPI Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt); 542EAPI Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt);
diff --git a/src/lib/ecore_evas/meson.build b/src/lib/ecore_evas/meson.build
index c0fb459a56..890e3c42b3 100644
--- a/src/lib/ecore_evas/meson.build
+++ b/src/lib/ecore_evas/meson.build
@@ -23,7 +23,8 @@ ecore_evas_src = [
23 'ecore_evas_cocoa.h', 23 'ecore_evas_cocoa.h',
24 'ecore_evas_win32.h', 24 'ecore_evas_win32.h',
25 'ecore_evas_x11.h', 25 'ecore_evas_x11.h',
26 'ecore_evas_util.c' 26 'ecore_evas_util.c',
27 'ecore_evas_fallback_selection.c'
27] 28]
28 29
29 30