diff options
author | Thierry Crozat | 2019-08-04 16:30:41 +0100 |
---|---|---|
committer | Thierry Crozat | 2019-08-04 19:03:34 +0100 |
commit | 160070347f1ae2b3b15390a8f9e9273fcb0d4419 (patch) | |
tree | 4a813deff3d8e18e35c026afecd3530efda4b45d /backends/platform/ios7/ios7_osys_video.mm | |
parent | c505a7b4bb14c532a2f343fd27032bd97ad716b7 (diff) | |
download | scummvm-rg350-160070347f1ae2b3b15390a8f9e9273fcb0d4419.tar.gz scummvm-rg350-160070347f1ae2b3b15390a8f9e9273fcb0d4419.tar.bz2 scummvm-rg350-160070347f1ae2b3b15390a8f9e9273fcb0d4419.zip |
IOS7: Move non-video related functions to a separate file
Diffstat (limited to 'backends/platform/ios7/ios7_osys_video.mm')
-rw-r--r-- | backends/platform/ios7/ios7_osys_video.mm | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm index f0a7db6265..20cf687709 100644 --- a/backends/platform/ios7/ios7_osys_video.mm +++ b/backends/platform/ios7/ios7_osys_video.mm @@ -28,7 +28,6 @@ #include "graphics/conversion.h" #include "backends/platform/ios7/ios7_app_delegate.h" -#include "common/translation.h" @interface iOS7AlertHandler : NSObject<UIAlertViewDelegate> @end @@ -604,54 +603,3 @@ void OSystem_iOS7::setShowKeyboard(bool show) { bool OSystem_iOS7::isKeyboardShown() const { return [[iOS7AppDelegate iPhoneView] isKeyboardShown]; } - - -bool OSystem_iOS7::hasTextInClipboard() { - return [[UIPasteboard generalPasteboard] containsPasteboardTypes:UIPasteboardTypeListString]; -} - -Common::String OSystem_iOS7::getTextFromClipboard() { - if (!hasTextInClipboard()) - return Common::String(); - - UIPasteboard *pb = [UIPasteboard generalPasteboard]; - NSString *str = pb.string; - if (str == nil) - return Common::String(); - - // If translations are supported, use the current TranslationManager charset and otherwise - // use ASCII. If the string cannot be represented using the requested encoding we get a null - // pointer below, which is fine as ScummVM would not know what to do with the string anyway. -#ifdef USE_TRANSLATION - NSString* encStr = [NSString stringWithCString:TransMan.getCurrentCharset().c_str() encoding:NSASCIIStringEncoding]; - NSStringEncoding encoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)encStr)); -#else - NSStringEncoding encoding = NSISOLatin1StringEncoding; -#endif - return Common::String([str cStringUsingEncoding:encoding]); -} - -bool OSystem_iOS7::setTextInClipboard(const Common::String &text) { -#ifdef USE_TRANSLATION - NSString* encStr = [NSString stringWithCString:TransMan.getCurrentCharset().c_str() encoding:NSASCIIStringEncoding]; - NSStringEncoding encoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)encStr)); -#else - NSStringEncoding encoding = NSISOLatin1StringEncoding; -#endif - UIPasteboard *pb = [UIPasteboard generalPasteboard]; - [pb setString:[NSString stringWithCString:text.c_str() encoding:encoding]]; - return true; -} - -bool OSystem_iOS7::openUrl(const Common::String &url) { - UIApplication *application = [UIApplication sharedApplication]; - NSURL *nsurl = [NSURL URLWithString:[NSString stringWithCString:url.c_str() encoding:NSISOLatin1StringEncoding]]; - // The way to oipen a URL has changed in iOS 10. Check if the iOS 10 method is recognized - // and otherwise use the old method. - if ([application respondsToSelector:@selector(openURL:options:completionHandler:)]) { - [application openURL:nsurl options:@{} completionHandler:nil]; - return true; - } else { - return [application openURL:nsurl]; - } -} |