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

13 lines
363 B
Mathematica
Raw Normal View History

2020-11-20 03:08:39 +03:00
//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];
}