diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-02-16 09:09:14 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2012-02-16 15:25:37 +0200 |
commit | a1fe0a772f40c221f5d788192543352b302ac4e8 (patch) | |
tree | 9d386d629ffc7239913b0b11e2896aaa18d70b93 /sal | |
parent | 3675980cc1804e842b955b656fc03133ffbecea8 (diff) |
Use the same simple lo_main() on iOS as on Android
Let's do the iOS specific stuff in separate main() source
file(s). Don't attempt to build complete iOS programs using normal
LibreOffice mechanisms, it will work for only the very lowest level
unit tests anyway, because of static linking and the circularish
UNO/URE/bootstrap/whatnot (run-time) dependencies between different
parts of the code.
We thus can't build the various iOS-specific *_cppunittester_all unit
test executables any more. Corresponding unit tests (and more complex
ones) for iOS will have to be done in a different way.
Diffstat (limited to 'sal')
-rw-r--r-- | sal/inc/sal/main.h | 78 |
1 files changed, 1 insertions, 77 deletions
diff --git a/sal/inc/sal/main.h b/sal/inc/sal/main.h index 49c8b5de6e2d..0f68012bd057 100644 --- a/sal/inc/sal/main.h +++ b/sal/inc/sal/main.h @@ -41,83 +41,7 @@ extern "C" { SAL_DLLPUBLIC void SAL_CALL sal_detail_initialize(int argc, char ** argv); SAL_DLLPUBLIC void SAL_CALL sal_detail_deinitialize(); -#ifdef IOS - -#include <premac.h> -#import <UIKit/UIKit.h> -#include <postmac.h> - -#define SAL_MAIN_WITH_ARGS_IMPL \ -int SAL_CALL main(int argc, char ** argv) \ -{ \ - sal_detail_initialize(argc, argv); \ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; \ - int retVal = UIApplicationMain (argc, argv, @"UIApplication", @"salAppDelegate"); \ - [pool release]; \ - sal_detail_deinitialize(); \ - return retVal; \ -} \ - \ -static int sal_main_with_args(int argc, char **argv); \ - \ -static int \ -sal_main(void) \ -{ \ - char *argv[] = { NULL }; \ - return sal_main_with_args(0, argv); \ -} - -#define SAL_MAIN_IMPL \ -int SAL_CALL main(int argc, char ** argv) \ -{ \ - sal_detail_initialize(argc, argv); \ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; \ - int retVal = UIApplicationMain (argc, argv, @"UIApplication", @"salAppDelegate"); \ - [pool release]; \ - sal_detail_deinitialize(); \ - return retVal; \ -} - -#define SAL_MAIN_WITH_GUI_IMPL \ -int SAL_CALL main(int argc, char ** argv) \ -{ \ - sal_detail_initialize(argc, argv); \ - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; \ - int retVal = sal_main(); \ - [pool release]; \ - sal_detail_deinitialize(); \ - return retVal; \ -} - -@interface salAppDelegate : NSObject <UIApplicationDelegate> { -} -@property (nonatomic, retain) UIWindow *window; -@end - -static int sal_main(void); - -@implementation salAppDelegate - -@synthesize window=_window; - -- (BOOL)application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions -{ - (void) application; - (void) launchOptions; - UIWindow *uiw = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - uiw.backgroundColor = [UIColor redColor]; - self.window = uiw; - [uiw release]; - - sal_main(); - - [self.window makeKeyAndVisible]; - return YES; -} - -@end - -#elif defined ANDROID +#if defined IOS || defined ANDROID #ifdef __cplusplus extern "C" __attribute__ ((visibility("default"))) void lo_main(int argc, char **argv); |