]> git.saurik.com Git - cydia.git/commitdiff
Add cydia.setPasteboard*() for clipboard access.
authorJay Freeman (saurik) <saurik@saurik.com>
Tue, 1 Mar 2011 02:35:50 +0000 (18:35 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 7 Mar 2011 10:41:30 +0000 (02:41 -0800)
MobileCydia.mm

index 2f6d8a05146ba0b825a81f54f174b9a26d926c4d..1e5e0f696ed305c8db437733d25c2cc21e041546 100644 (file)
@@ -4214,6 +4214,10 @@ static NSMutableSet *Diversions_;
         return @"setNavigationBarStyle";
     else if (selector == @selector(setNavigationBarTintRed:green:blue:alpha:))
         return @"setNavigationBarTintColor";
+    else if (selector == @selector(setPasteboardString:))
+        return @"setPasteboardString";
+    else if (selector == @selector(setPasteboardURL:))
+        return @"setPasteboardURL";
     else if (selector == @selector(setToken:))
         return @"setToken";
     else if (selector == @selector(setViewportWidth:))
@@ -4457,6 +4461,14 @@ static NSMutableSet *Diversions_;
     [indirect_ performSelectorOnMainThread:@selector(setNavigationBarTintColor:) withObject:color waitUntilDone:NO];
 }
 
+- (void) setPasteboardString:(NSString *)value {
+    [[objc_getClass("UIPasteboard") generalPasteboard] setString:value];
+}
+
+- (void) setPasteboardURL:(NSString *)value {
+    [[objc_getClass("UIPasteboard") generalPasteboard] setURL:[NSURL URLWithString:value]];
+}
+
 - (void) _setToken:(NSString *)token {
     Token_ = token;