mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
app/internal/window: [iOS] implement clipboard
Updates gio#31 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -279,6 +279,24 @@ NSArray<UIKeyCommand *> *_keyCommands;
|
||||
}
|
||||
@end
|
||||
|
||||
void gio_writeClipboard(unichar *chars, NSUInteger length) {
|
||||
@autoreleasepool {
|
||||
NSString *s = [NSString string];
|
||||
if (length > 0) {
|
||||
s = [NSString stringWithCharacters:chars length:length];
|
||||
}
|
||||
UIPasteboard *p = UIPasteboard.generalPasteboard;
|
||||
p.string = s;
|
||||
}
|
||||
}
|
||||
|
||||
CFTypeRef gio_readClipboard(void) {
|
||||
@autoreleasepool {
|
||||
UIPasteboard *p = UIPasteboard.generalPasteboard;
|
||||
return (__bridge_retained CFTypeRef)p.string;
|
||||
}
|
||||
}
|
||||
|
||||
void gio_setAnimating(CFTypeRef viewRef, int anim) {
|
||||
GioView *view = (__bridge GioView *)viewRef;
|
||||
[view setAnimating:(anim ? YES : NO)];
|
||||
|
||||
Reference in New Issue
Block a user