Workbook: big pile of rendering cleanups
[AROS.git] / arch / all-ios / bootstrap / appdelegate.m
blob8b04febf4400ac01690910c1f37f9133d5a89df3
1 #include <UIKit/UIAlertView.h>
2 #include <stdlib.h>
4 #include "appdelegate.h"
5 #include "bootstrap.h"
7 @implementation BootstrapDelegate
9 @synthesize alert;
10 @synthesize rc;
12 - (void)ShowAlert:(NSString *)text withTitle:(NSString *)title
14     self.alert = [[UIAlertView alloc] initWithTitle:title message:text delegate:self
15                                            cancelButtonTitle:@"Abort" otherButtonTitles:nil];
17     [self.alert show];
18     [self.alert release];
21 - (void)RunBootstrap
23     self.rc = bootstrap(_argc, _argv);
25     /* Fall down into event loop. We have alert view here. */
28 - (void)alertView:(UIAlertView *)av didDismissWithButtonIndex:(NSInteger)choice
30     /* I know it's considered bad. But what else to do here? Restart? */
31     exit(self.rc);
34 - (void)applicationDidFinishLaunching:(UIApplication *)app
36     /*
37      * This causes RunBootstrap method to be called after all internal UIKit setup is complete,
38      * when event handling loop is entered
39      */
40     [self performSelector:@selector(RunBootstrap) withObject:nil afterDelay:0.0];
43 /* The following are placeholders for now. Should likely be forwarded to AROS via HostInterface. */
45 - (void)applicationWillTerminate:(UIApplication *)application
50 - (void) applicationWillResignActive:(UIApplication*)application
55 - (void) applicationDidBecomeActive:(UIApplication*)application
60 @end