mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +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 "GdkMacosGLView.h"
|
||||||
#import "GdkMacosWindow.h"
|
#import "GdkMacosWindow.h"
|
||||||
|
|
||||||
|
#include "gdkmacosclipboard-private.h"
|
||||||
#include "gdkmacosdisplay-private.h"
|
#include "gdkmacosdisplay-private.h"
|
||||||
#include "gdkmacosmonitor-private.h"
|
#include "gdkmacosmonitor-private.h"
|
||||||
#include "gdkmacossurface-private.h"
|
#include "gdkmacossurface-private.h"
|
||||||
@ -287,6 +288,9 @@ typedef NSString *CALayerContentsGravity;
|
|||||||
[self setContentView:view];
|
[self setContentView:view];
|
||||||
[view release];
|
[view release];
|
||||||
|
|
||||||
|
/* TODO: We might want to make this more extensible at some point */
|
||||||
|
_gdk_macos_clipboard_register_drag_types (self);
|
||||||
|
|
||||||
return 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 _gdk_macos_clipboard_to_ns_type (const char *mime_type,
|
||||||
NSPasteboardType *alternate);
|
NSPasteboardType *alternate);
|
||||||
const char *_gdk_macos_clipboard_from_ns_type (NSPasteboardType ns_type);
|
const char *_gdk_macos_clipboard_from_ns_type (NSPasteboardType ns_type);
|
||||||
|
void _gdk_macos_clipboard_register_drag_types (NSWindow *window);
|
||||||
|
|
||||||
@interface GdkMacosClipboardDataProvider : NSObject <NSPasteboardItemDataProvider>
|
@interface GdkMacosClipboardDataProvider : NSObject <NSPasteboardItemDataProvider>
|
||||||
{
|
{
|
||||||
|
@ -622,4 +622,17 @@ on_data_ready_cb (GObject *object,
|
|||||||
write_request_free (wr);
|
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
|
@end
|
||||||
|
Loading…
Reference in New Issue
Block a user