From 3130b22fcbdfa4cf284e3612a2d7f5f80a4b7c81 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 7 Jan 2016 12:36:47 +0100 Subject: IOS7: Make filename style consistent in itself. --- backends/platform/ios7/iOS7AppDelegate.h | 38 ------- backends/platform/ios7/iOS7AppDelegate.mm | 113 --------------------- backends/platform/ios7/iOS7ScummVMViewController.h | 33 ------ .../platform/ios7/iOS7ScummVMViewController.mm | 32 ------ backends/platform/ios7/ios7_app_delegate.h | 38 +++++++ backends/platform/ios7/ios7_app_delegate.mm | 113 +++++++++++++++++++++ backends/platform/ios7/ios7_osys_video.mm | 2 +- .../platform/ios7/ios7_scummvm_view_controller.h | 33 ++++++ .../platform/ios7/ios7_scummvm_view_controller.mm | 32 ++++++ backends/platform/ios7/ios7_video.mm | 2 +- backends/platform/ios7/module.mk | 4 +- 11 files changed, 220 insertions(+), 220 deletions(-) delete mode 100644 backends/platform/ios7/iOS7AppDelegate.h delete mode 100644 backends/platform/ios7/iOS7AppDelegate.mm delete mode 100644 backends/platform/ios7/iOS7ScummVMViewController.h delete mode 100644 backends/platform/ios7/iOS7ScummVMViewController.mm create mode 100644 backends/platform/ios7/ios7_app_delegate.h create mode 100644 backends/platform/ios7/ios7_app_delegate.mm create mode 100644 backends/platform/ios7/ios7_scummvm_view_controller.h create mode 100644 backends/platform/ios7/ios7_scummvm_view_controller.mm (limited to 'backends') diff --git a/backends/platform/ios7/iOS7AppDelegate.h b/backends/platform/ios7/iOS7AppDelegate.h deleted file mode 100644 index 08696c7b61..0000000000 --- a/backends/platform/ios7/iOS7AppDelegate.h +++ /dev/null @@ -1,38 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef BACKENDS_PLATFORM_IOS7_IOS7_APP_DELEGATE_H -#define BACKENDS_PLATFORM_IOS7_IOS7_APP_DELEGATE_H - -#include - -@class iPhoneView; - - -@interface iOS7AppDelegate : NSObject - -+ (iOS7AppDelegate *)iOS7AppDelegate; -+ (iPhoneView *)iPhoneView; - -@end - -#endif diff --git a/backends/platform/ios7/iOS7AppDelegate.mm b/backends/platform/ios7/iOS7AppDelegate.mm deleted file mode 100644 index dbc81725a4..0000000000 --- a/backends/platform/ios7/iOS7AppDelegate.mm +++ /dev/null @@ -1,113 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#define FORBIDDEN_SYMBOL_ALLOW_ALL -#include "iOS7AppDelegate.h" -#include "iOS7ScummVMViewController.h" -#include "ios7_video.h" - -@implementation iOS7AppDelegate { - UIWindow *_window; - iOS7ScummVMViewController *_controller; - iPhoneView *_view; -} - -- (id)init { - if (self = [super init]) { - _window = nil; - _view = nil; - } - return self; -} - -- (void)mainLoop:(id)param { - @autoreleasepool { - iOS7_main(iOS7_argc, iOS7_argv); - } - - exit(0); -} - -- (void)applicationDidFinishLaunching:(UIApplication *)application { - CGRect rect = [[UIScreen mainScreen] bounds]; - -#ifdef IPHONE_SANDBOXED - // Create the directory for savegames - NSFileManager *fm = [NSFileManager defaultManager]; - NSString *documentPath = [NSString stringWithUTF8String:iOS7_getDocumentsDir()]; - NSString *savePath = [documentPath stringByAppendingPathComponent:@"Savegames"]; - if (![fm fileExistsAtPath:savePath]) { - [fm createDirectoryAtPath:savePath withIntermediateDirectories:YES attributes:nil error:nil]; - } -#endif - - _window = [[UIWindow alloc] initWithFrame:rect]; - [_window retain]; - - _controller = [[iOS7ScummVMViewController alloc] init]; - - _view = [[iPhoneView alloc] initWithFrame:rect]; - _view.multipleTouchEnabled = YES; - _controller.view = _view; - - [_window setRootViewController:_controller]; - [_window makeKeyAndVisible]; - - [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(didRotate:) - name:@"UIDeviceOrientationDidChangeNotification" - object:nil]; - - [NSThread detachNewThreadSelector:@selector(mainLoop:) toTarget:self withObject:nil]; -} - -- (void)applicationWillResignActive:(UIApplication *)application { - [_view applicationSuspend]; -} - -- (void)applicationDidBecomeActive:(UIApplication *)application { - [_view applicationResume]; -} - -- (void)didRotate:(NSNotification *)notification { - UIDeviceOrientation screenOrientation = [[UIDevice currentDevice] orientation]; - [_view deviceOrientationChanged:screenOrientation]; -} - -+ (iOS7AppDelegate *)iOS7AppDelegate { - UIApplication *app = [UIApplication sharedApplication]; - return (iOS7AppDelegate *) app.delegate; -} - -+ (iPhoneView *)iPhoneView { - iOS7AppDelegate *appDelegate = [self iOS7AppDelegate]; - return appDelegate->_view; -} - -@end - -const char *iOS7_getDocumentsDir() { - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *documentsDirectory = [paths objectAtIndex:0]; - return [documentsDirectory UTF8String]; -} diff --git a/backends/platform/ios7/iOS7ScummVMViewController.h b/backends/platform/ios7/iOS7ScummVMViewController.h deleted file mode 100644 index 39168aaee7..0000000000 --- a/backends/platform/ios7/iOS7ScummVMViewController.h +++ /dev/null @@ -1,33 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef BACKENDS_PLATFORM_IOS7_IOS7_SCUMMVM_VIEW_CONTROLLER_H -#define BACKENDS_PLATFORM_IOS7_IOS7_SCUMMVM_VIEW_CONTROLLER_H - -#include - - -@interface iOS7ScummVMViewController : UIViewController - -@end - -#endif diff --git a/backends/platform/ios7/iOS7ScummVMViewController.mm b/backends/platform/ios7/iOS7ScummVMViewController.mm deleted file mode 100644 index 8dfa0122dd..0000000000 --- a/backends/platform/ios7/iOS7ScummVMViewController.mm +++ /dev/null @@ -1,32 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "iOS7ScummVMViewController.h" - - -@implementation iOS7ScummVMViewController - -- (BOOL)prefersStatusBarHidden { - return YES; -} - -@end diff --git a/backends/platform/ios7/ios7_app_delegate.h b/backends/platform/ios7/ios7_app_delegate.h new file mode 100644 index 0000000000..08696c7b61 --- /dev/null +++ b/backends/platform/ios7/ios7_app_delegate.h @@ -0,0 +1,38 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef BACKENDS_PLATFORM_IOS7_IOS7_APP_DELEGATE_H +#define BACKENDS_PLATFORM_IOS7_IOS7_APP_DELEGATE_H + +#include + +@class iPhoneView; + + +@interface iOS7AppDelegate : NSObject + ++ (iOS7AppDelegate *)iOS7AppDelegate; ++ (iPhoneView *)iPhoneView; + +@end + +#endif diff --git a/backends/platform/ios7/ios7_app_delegate.mm b/backends/platform/ios7/ios7_app_delegate.mm new file mode 100644 index 0000000000..8c1ef9033b --- /dev/null +++ b/backends/platform/ios7/ios7_app_delegate.mm @@ -0,0 +1,113 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#define FORBIDDEN_SYMBOL_ALLOW_ALL +#include "ios7_app_delegate.h" +#include "ios7_scummvm_view_controller.h" +#include "ios7_video.h" + +@implementation iOS7AppDelegate { + UIWindow *_window; + iOS7ScummVMViewController *_controller; + iPhoneView *_view; +} + +- (id)init { + if (self = [super init]) { + _window = nil; + _view = nil; + } + return self; +} + +- (void)mainLoop:(id)param { + @autoreleasepool { + iOS7_main(iOS7_argc, iOS7_argv); + } + + exit(0); +} + +- (void)applicationDidFinishLaunching:(UIApplication *)application { + CGRect rect = [[UIScreen mainScreen] bounds]; + +#ifdef IPHONE_SANDBOXED + // Create the directory for savegames + NSFileManager *fm = [NSFileManager defaultManager]; + NSString *documentPath = [NSString stringWithUTF8String:iOS7_getDocumentsDir()]; + NSString *savePath = [documentPath stringByAppendingPathComponent:@"Savegames"]; + if (![fm fileExistsAtPath:savePath]) { + [fm createDirectoryAtPath:savePath withIntermediateDirectories:YES attributes:nil error:nil]; + } +#endif + + _window = [[UIWindow alloc] initWithFrame:rect]; + [_window retain]; + + _controller = [[iOS7ScummVMViewController alloc] init]; + + _view = [[iPhoneView alloc] initWithFrame:rect]; + _view.multipleTouchEnabled = YES; + _controller.view = _view; + + [_window setRootViewController:_controller]; + [_window makeKeyAndVisible]; + + [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(didRotate:) + name:@"UIDeviceOrientationDidChangeNotification" + object:nil]; + + [NSThread detachNewThreadSelector:@selector(mainLoop:) toTarget:self withObject:nil]; +} + +- (void)applicationWillResignActive:(UIApplication *)application { + [_view applicationSuspend]; +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + [_view applicationResume]; +} + +- (void)didRotate:(NSNotification *)notification { + UIDeviceOrientation screenOrientation = [[UIDevice currentDevice] orientation]; + [_view deviceOrientationChanged:screenOrientation]; +} + ++ (iOS7AppDelegate *)iOS7AppDelegate { + UIApplication *app = [UIApplication sharedApplication]; + return (iOS7AppDelegate *) app.delegate; +} + ++ (iPhoneView *)iPhoneView { + iOS7AppDelegate *appDelegate = [self iOS7AppDelegate]; + return appDelegate->_view; +} + +@end + +const char *iOS7_getDocumentsDir() { + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + NSString *documentsDirectory = [paths objectAtIndex:0]; + return [documentsDirectory UTF8String]; +} diff --git a/backends/platform/ios7/ios7_osys_video.mm b/backends/platform/ios7/ios7_osys_video.mm index 908d0bf23c..2a198e13bc 100644 --- a/backends/platform/ios7/ios7_osys_video.mm +++ b/backends/platform/ios7/ios7_osys_video.mm @@ -27,7 +27,7 @@ #include "ios7_video.h" #include "graphics/conversion.h" -#include "iOS7AppDelegate.h" +#include "ios7_app_delegate.h" @interface iOS7AlertHandler : NSObject @end diff --git a/backends/platform/ios7/ios7_scummvm_view_controller.h b/backends/platform/ios7/ios7_scummvm_view_controller.h new file mode 100644 index 0000000000..39168aaee7 --- /dev/null +++ b/backends/platform/ios7/ios7_scummvm_view_controller.h @@ -0,0 +1,33 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef BACKENDS_PLATFORM_IOS7_IOS7_SCUMMVM_VIEW_CONTROLLER_H +#define BACKENDS_PLATFORM_IOS7_IOS7_SCUMMVM_VIEW_CONTROLLER_H + +#include + + +@interface iOS7ScummVMViewController : UIViewController + +@end + +#endif diff --git a/backends/platform/ios7/ios7_scummvm_view_controller.mm b/backends/platform/ios7/ios7_scummvm_view_controller.mm new file mode 100644 index 0000000000..18d6770037 --- /dev/null +++ b/backends/platform/ios7/ios7_scummvm_view_controller.mm @@ -0,0 +1,32 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "ios7_scummvm_view_controller.h" + + +@implementation iOS7ScummVMViewController + +- (BOOL)prefersStatusBarHidden { + return YES; +} + +@end diff --git a/backends/platform/ios7/ios7_video.mm b/backends/platform/ios7/ios7_video.mm index 337d4603f2..4f027cd812 100644 --- a/backends/platform/ios7/ios7_video.mm +++ b/backends/platform/ios7/ios7_video.mm @@ -27,7 +27,7 @@ #include "graphics/colormasks.h" #include "common/system.h" -#include "iOS7AppDelegate.h" +#include "ios7_app_delegate.h" static int g_needsScreenUpdate = 0; diff --git a/backends/platform/ios7/module.mk b/backends/platform/ios7/module.mk index 5ee4c7a601..ad4f7fda5b 100644 --- a/backends/platform/ios7/module.mk +++ b/backends/platform/ios7/module.mk @@ -8,8 +8,8 @@ MODULE_OBJS := \ ios7_main.o \ ios7_video.o \ ios7_keyboard.o \ - iOS7ScummVMViewController.o \ - iOS7AppDelegate.o + ios7_scummvm_view_controller.o \ + ios7_app_delegate.o # We don't use rules.mk but rather manually update OBJS and MODULE_DIRS. MODULE_OBJS := $(addprefix $(MODULE)/, $(MODULE_OBJS)) -- cgit v1.2.3