mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 13:11:13 +00:00
macos: register known clipboard types for drag destination
This commit is contained in:
parent
352898ae9e
commit
057bda6cd7
@ -28,6 +28,7 @@
|
||||
#import "GdkMacosGLView.h"
|
||||
#import "GdkMacosWindow.h"
|
||||
|
||||
#include "gdkmacosclipboard-private.h"
|
||||
#include "gdkmacosdisplay-private.h"
|
||||
#include "gdkmacosmonitor-private.h"
|
||||
#include "gdkmacossurface-private.h"
|
||||
@ -287,6 +288,9 @@ typedef NSString *CALayerContentsGravity;
|
||||
[self setContentView:view];
|
||||
[view release];
|
||||
|
||||
/* TODO: We might want to make this more extensible at some point */
|
||||
_gdk_macos_clipboard_register_drag_types (self);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@ void _gdk_macos_clipboard_check_externally_modified (GdkMacosClipbo
|
||||
NSPasteboardType _gdk_macos_clipboard_to_ns_type (const char *mime_type,
|
||||
NSPasteboardType *alternate);
|
||||
const char *_gdk_macos_clipboard_from_ns_type (NSPasteboardType ns_type);
|
||||
void _gdk_macos_clipboard_register_drag_types (NSWindow *window);
|
||||
|
||||
@interface GdkMacosClipboardDataProvider : NSObject <NSPasteboardItemDataProvider>
|
||||
{
|
||||
|
@ -622,4 +622,17 @@ on_data_ready_cb (GObject *object,
|
||||
write_request_free (wr);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_macos_clipboard_register_drag_types (NSWindow *window)
|
||||
{
|
||||
[window registerForDraggedTypes:[NSArray arrayWithObjects:PTYPE(STRING),
|
||||
PTYPE(PBOARD),
|
||||
PTYPE(URL),
|
||||
PTYPE(FILE_URL),
|
||||
PTYPE(COLOR),
|
||||
PTYPE(TIFF),
|
||||
PTYPE(PNG),
|
||||
nil]];
|
||||
}
|
||||
|
||||
@end
|
||||
|
Loading…
Reference in New Issue
Block a user