aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/iphone/iphone_main.m
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/iphone/iphone_main.m')
-rw-r--r--backends/platform/iphone/iphone_main.m35
1 files changed, 20 insertions, 15 deletions
diff --git a/backends/platform/iphone/iphone_main.m b/backends/platform/iphone/iphone_main.m
index 6b709b0803..90dc4c8558 100644
--- a/backends/platform/iphone/iphone_main.m
+++ b/backends/platform/iphone/iphone_main.m
@@ -51,7 +51,7 @@ int main(int argc, char** argv) {
];
UIApplicationUseLegacyEvents(1);
- int returnCode = UIApplicationMain(argc, argv, [iPhoneMain class]);
+ int returnCode = UIApplicationMain(argc, argv, @"iPhoneMain", @"iPhoneMain");
[ autoreleasePool release ];
return returnCode;
}
@@ -69,47 +69,52 @@ int main(int argc, char** argv) {
[[NSAutoreleasePool alloc] init];
iphone_main(gArgc, gArgv);
- [UIApp terminate];
+ exit(0);
}
- (iPhoneView*) getView {
return _view;
}
-- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
+- (void)applicationDidFinishLaunching:(UIApplication *)application {
+ CGRect rect = [[UIScreen mainScreen] bounds];
+
// hide the status bar
- [UIHardware _setStatusBarHeight:0.0f];
- [self setStatusBarHidden:YES animated:NO];
+ [application setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
+ [application setStatusBarHidden:YES animated:YES];
- _window = [[UIWindow alloc] initWithContentRect: [UIHardware fullScreenApplicationContentRect]];
+ _window = [[UIWindow alloc] initWithFrame:rect];
[_window retain];
- _view = [[iPhoneView alloc] initWithFrame: [UIHardware fullScreenApplicationContentRect]];
+ _view = [[iPhoneView alloc] initWithFrame: rect];
[_window setContentView: _view];
- [_window orderFront: self];
- [_window makeKey: self];
+ //[_window orderFront: self];
+ //[_window makeKey: self];
+
+ [_window addSubview:_view];
+ [_window makeKeyAndVisible];
[NSThread detachNewThreadSelector:@selector(mainLoop:) toTarget:self withObject:nil];
}
-- (void)applicationSuspend:(GSEventRef)event {
+- (void)applicationSuspend:(struct __GSEvent *)event {
[self setApplicationBadge:NSLocalizedString(@"ON", nil)];
[_view applicationSuspend];
}
-- (void)applicationResume:(GSEventRef)event {
+- (void)applicationResume:(struct __GSEvent *)event {
[self removeApplicationBadge];
[_view applicationResume];
// Workaround, need to "hide" and unhide the statusbar to properly remove it,
// since the Springboard has put it back without apparently flagging our application.
- [self setStatusBarHidden:NO animated:NO]; // hide status bar
- [UIHardware _setStatusBarHeight:0.0f];
- [self setStatusBarHidden:YES animated:NO]; // hide status bar
+ [self setStatusBarHidden:YES animated:YES];
+ [self setStatusBarStyle:UIStatusBarStyleBlackTranslucent animated:NO];
+ [self setStatusBarHidden:YES animated:YES];
}
-- (void)deviceOrientationChanged:(GSEvent *)event {
+- (void)deviceOrientationChanged:(struct __GSEvent *)event {
int screenOrientation = GSEventDeviceOrientation(event);
[_view deviceOrientationChanged: screenOrientation];
}