ios/CustomTarget_Viewer_app.mk | 13 +++++++-- ios/experimental/Viewer/Viewer.xcodeproj/project.pbxproj | 2 - ios/experimental/Viewer/Viewer/LOViewerAppDelegate.h | 2 + ios/experimental/Viewer/Viewer/LOViewerAppDelegate.mm | 21 ++++++++++++--- 4 files changed, 30 insertions(+), 8 deletions(-)
New commits: commit 4b4bcb1af57ee376a1185d3559202857d9777b69 Author: Tor Lillqvist <[email protected]> Date: Fri Mar 15 22:55:33 2013 +0200 Make the Xcode build of the Viewer app work when SRCDIR!=BUILDDIR Change-Id: I03dd3639841bf00d427b8d1b3db13f65f705724f diff --git a/ios/CustomTarget_Viewer_app.mk b/ios/CustomTarget_Viewer_app.mk index 7640a14..a4ef0eb 100644 --- a/ios/CustomTarget_Viewer_app.mk +++ b/ios/CustomTarget_Viewer_app.mk @@ -47,6 +47,7 @@ endif endif ifneq ($(SCRIPT_OUTPUT_FILE_0),) +ifeq ($(EXECUTABLE_NAME),Viewer) # When run from Xcode, we move the Viewer executable from solver into # the Viewer.app directory that Xcode uses. We also set up/copy all # the run-time configuration etc files that the app needs. @@ -130,11 +131,17 @@ $(SCRIPT_OUTPUT_FILE_0) : $(call gb_Executable_get_target,Viewer) # Copy a sample document... good old test1.odt... # cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt $(appdir) - +endif else # When run just from the command line, we don't have any app bundle to -# copy or move the executable to. So do nothing. -$(call gb_CustomTarget_get_target,ios/Viewer_app) : $(call gb_Executable_get_target,Viewer) +# copy or move the executable to. So do nothing. Except one trick: +# Copy the Xcode project to BUILDDIR if SRCDIR!=BUILDDIR, so that one +# can then open it from there in Xcode. +$(call gb_CustomTarget_get_target,ios/Viewer_app) : $(gb_Helper_PHONY) + if test $(SRCDIR) != $(BUILDDIR); then \ + rm -rf $(BUILDDIR)/ios/experimental/Viewer; \ + (cd $(SRCDIR) && tar cf - ios/experimental/Viewer) | (cd $(BUILDDIR) && tar xf -); \ + fi $(call gb_CustomTarget_get_clean_target,ios/Viewer_app) : $(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),APP,2) diff --git a/ios/experimental/Viewer/Viewer.xcodeproj/project.pbxproj b/ios/experimental/Viewer/Viewer.xcodeproj/project.pbxproj index 4fad8f0..0535a2b 100644 --- a/ios/experimental/Viewer/Viewer.xcodeproj/project.pbxproj +++ b/ios/experimental/Viewer/Viewer.xcodeproj/project.pbxproj @@ -191,7 +191,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "cd ../.. && /opt/lo/bin/make -r"; + shellScript = "cd ../../.. && /opt/lo/bin/make ios"; }; /* End PBXShellScriptBuildPhase section */ commit afce2becdd284c5353eb67155278e609c195e99a Author: Tor Lillqvist <[email protected]> Date: Fri Mar 15 09:35:42 2013 +0200 For kicks, run the lo_initialize() in a separate thread Change-Id: Ie31bda8f1e035127d60b281cca9538d3e8803f9f diff --git a/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.h b/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.h index 3b33bc9..7f4b724 100644 --- a/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.h +++ b/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.h @@ -12,4 +12,6 @@ @property (strong, nonatomic) UIWindow *window; +- (void) threadMainMethod: (id) argument; + @end diff --git a/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.mm b/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.mm index bf0c67a..bb95e5e 100644 --- a/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.mm +++ b/ios/experimental/Viewer/Viewer/LOViewerAppDelegate.mm @@ -23,17 +23,30 @@ (void) launchOptions; self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - // Override point for customization after application launch. + self.window.backgroundColor = [UIColor whiteColor]; - lo_initialize(); + [self.window makeKeyAndVisible]; - // Do something here + NSThread* thread = [[NSThread alloc] initWithTarget:self + selector:@selector(threadMainMethod:) + object:nil]; + [thread start]; - [self.window makeKeyAndVisible]; return YES; } +- (void)threadMainMethod:(id)argument +{ + (void) argument; + + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + + lo_initialize(); + + [pool release]; +} + - (void)applicationWillResignActive:(UIApplication *)application { (void) application; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
