1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/clipboard/clipboard_darwin.m
2020-11-20 01:08:55 +01:00

13 lines
363 B
Objective-C

//NSPasteboard* darwin_new_pasteboard() {
void* darwin_new_pasteboard() {
return (__bridge void*) [NSPasteboard generalPasteboard];
}
char* darwin_get_pasteboard_text(void* pb) {
NSString *ns_clip = [((__bridge NSPasteboard*)pb) stringForType:NSStringPboardType]; //NSPasteboardTypeString
if (ns_clip == nil) {
return "";
}
return [ns_clip UTF8String];
}