Implement drag and drop of text/plain for Wayland as well

This commit is contained in:
Kovid Goyal
2020-03-19 13:00:52 +05:30
parent e827e6fa21
commit 2458c3a7c6
17 changed files with 205 additions and 226 deletions

25
kitty/glfw-wrapper.h generated
View File

@@ -1353,19 +1353,22 @@ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double,int);
*/
typedef void (* GLFWkeyboardfun)(GLFWwindow*, GLFWkeyevent*);
/*! @brief The function pointer type for path drop callbacks.
/*! @brief The function pointer type for drag and drop callbacks.
*
* This is the function pointer type for path drop callbacks. A path drop
* This is the function pointer type for drop callbacks. A drop
* callback function has the following signature:
* @code
* void function_name(GLFWwindow* window, int path_count, const char* paths[])
* int function_name(GLFWwindow* window, const char* mime, const char* text)
* @endcode
*
* @param[in] window The window that received the event.
* @param[in] path_count The number of dropped paths.
* @param[in] paths The UTF-8 encoded file and/or directory path names.
* @param[in] mime The UTF-8 encoded drop mime-type
* @param[in] data The dropped data or NULL for drag enter events
* @param[in] sz The size of the dropped data
* @return For drag events should return the priority for the specified mime type. A priority of zero
* or lower means the mime type is not accepted. Highest priority will be the finally accepted mime-type.
*
* @pointer_lifetime The path array and its strings are valid until the
* @pointer_lifetime The text is valid until the
* callback function returns.
*
* @sa @ref path_drop
@@ -1375,7 +1378,7 @@ typedef void (* GLFWkeyboardfun)(GLFWwindow*, GLFWkeyevent*);
*
* @ingroup input
*/
typedef void (* GLFWdropfun)(GLFWwindow*,int,const char*[]);
typedef int (* GLFWdropfun)(GLFWwindow*, const char *, const char*, size_t);
typedef void (* GLFWliveresizefun)(GLFWwindow*, bool);
@@ -1747,14 +1750,14 @@ typedef void (*glfwSetWindowSizeLimits_func)(GLFWwindow*, int, int, int, int);
glfwSetWindowSizeLimits_func glfwSetWindowSizeLimits_impl;
#define glfwSetWindowSizeLimits glfwSetWindowSizeLimits_impl
typedef void (*glfwSetWindowAspectRatio_func)(GLFWwindow*, int, int);
glfwSetWindowAspectRatio_func glfwSetWindowAspectRatio_impl;
#define glfwSetWindowAspectRatio glfwSetWindowAspectRatio_impl
typedef void (*glfwSetWindowSizeIncrements_func)(GLFWwindow*, int, int);
glfwSetWindowSizeIncrements_func glfwSetWindowSizeIncrements_impl;
#define glfwSetWindowSizeIncrements glfwSetWindowSizeIncrements_impl
typedef void (*glfwSetWindowAspectRatio_func)(GLFWwindow*, int, int);
glfwSetWindowAspectRatio_func glfwSetWindowAspectRatio_impl;
#define glfwSetWindowAspectRatio glfwSetWindowAspectRatio_impl
typedef void (*glfwSetWindowSize_func)(GLFWwindow*, int, int);
glfwSetWindowSize_func glfwSetWindowSize_impl;
#define glfwSetWindowSize glfwSetWindowSize_impl