mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-19 15:04:50 +02:00
API for registering MIME types for drag enter
This commit is contained in:
@@ -3876,6 +3876,17 @@ glfwCocoaCycleThroughOSWindows(bool backwards) {
|
||||
}
|
||||
|
||||
|
||||
GLFWAPI void
|
||||
glfwCocoaRegisterMIMETypes(GLFWwindow *window, const char **mimes, size_t count) {
|
||||
_GLFWwindow *w = (_GLFWwindow*)window;
|
||||
NSArray *currentTypes = [w->ns.view registeredDraggedTypes];
|
||||
NSMutableArray *updatedTypes = [NSMutableArray arrayWithArray:currentTypes];
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
NSString *uti = mime_to_uti(mimes[i]);
|
||||
if (![updatedTypes containsObject:uti]) [updatedTypes addObject:uti];
|
||||
}
|
||||
[w->ns.view registerForDraggedTypes:updatedTypes];
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW internal API //////
|
||||
|
||||
@@ -316,6 +316,7 @@ def generate_wrappers(glfw_header: str) -> None:
|
||||
void glfwCocoaCycleThroughOSWindows(bool backwards)
|
||||
void glfwCocoaSetWindowChrome(GLFWwindow* window, unsigned int color, bool use_system_color, unsigned int system_color,\
|
||||
int background_blur, unsigned int hide_window_decorations, bool show_text_in_titlebar, int color_space, float background_opacity, bool resizable)
|
||||
void glfwCocoaRegisterMIMETypes(GLFWwindow *window, const char **mimes, size_t count)
|
||||
const char* glfwGetPrimarySelectionString(GLFWwindow* window, void)
|
||||
int glfwGetNativeKeyForName(const char* key_name, int case_sensitive)
|
||||
void glfwRequestWaylandFrameEvent(GLFWwindow *handle, unsigned long long id, GLFWwaylandframecallbackfunc callback)
|
||||
|
||||
Reference in New Issue
Block a user