app/internal/window: macOS clipboard support

Updates gio#31

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-05-17 12:50:15 +02:00
parent 1e934673d7
commit 9534337a43
4 changed files with 71 additions and 1 deletions
+11
View File
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: Unlicense OR MIT
@import Dispatch;
@import Foundation;
#include "_cgo_export.h"
@@ -9,3 +10,13 @@ void gio_wakeupMainThread(void) {
gio_dispatchMainFuncs();
});
}
NSUInteger gio_nsstringLength(CFTypeRef cstr) {
NSString *str = (__bridge NSString *)cstr;
return [str length];
}
void gio_nsstringGetCharacters(CFTypeRef cstr, unichar *chars, NSUInteger loc, NSUInteger length) {
NSString *str = (__bridge NSString *)cstr;
[str getCharacters:chars range:NSMakeRange(loc, length)];
}