More hacking on an iOS "Viewer" app that doesn't do much anything yet

The Viewer app is intended to eventually resemble the experimental
Android DocumentLoader app.

Build using the gbuild mechanism, which is also invoked from an Xcode
project. This seems to work out fine, the resulting app installs at
least on the simulator, and you can debug all the LO code involved
even if Xcode (obviously) has no knowledge of the LO source
files/classes/etc.

Change-Id: Ic96178d80b8d6467cac969b29e37f0d39513acf9
This commit is contained in:
Tor Lillqvist 2013-01-03 13:29:08 +02:00
parent f6c44ad3f7
commit 13eca8620a
26 changed files with 660 additions and 197 deletions

View file

@ -287,6 +287,9 @@ endif
ifeq ($(OS),ANDROID)
cd android && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS)
endif
ifeq ($(OS),IOS)
cd ios && $(GNUMAKE) -j $(PARALLELISM) $(GMAKE_OPTIONS)
endif
build-nocheck : export SKIP_TESTS := YES
build-nocheck : build

View file

@ -208,6 +208,14 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \
))
endif
ifeq ($(OS),IOS)
$(eval $(call gb_Helper_register_executables,NONE,\
Viewer \
))
endif
ifeq ($(OS),MACOSX)
$(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE, \

View file

@ -98,6 +98,7 @@ $(eval $(call gb_Module_add_moduledirs,ooo,\
idl \
$(call gb_Helper_optional,DESKTOP,idlc) \
io \
ios \
javaunohelper \
$(call gb_Helper_optional,JFREEREPORT,jfreereport) \
jurt \

View file

@ -0,0 +1,59 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
$(eval $(call gb_CustomTarget_CustomTarget,ios/Viewer_app))
# We distinguish between builds for the simulator and device by
# looking for the "iarmv7" or "i386" in the -arch option that is part
# of $(CC)
ifneq ($(filter i386,$(CC)),)
xcode_sdk=iphonesimulator
xcode_arch=i386
else
xcode_sdk=iphoneos
xcode_arch=armv7
endif
ifeq ($(debug),)
xcode_config := Release
else
xcode_config := Debug
endif
# If run from Xcode, check that its configuration (device or
# simulator) matches that of gbuild. We detect being run from Xcode by
# looking for $(XCODE_VERSION_ACTUAL)
ifneq ($(XCODE_VERSION_ACTUAL),)
export CCACHE_CPP2=y
ifneq ($(CURRENT_ARCH),$(xcode_arch))
$(error Xcode platform (device or simulator) does not match that of this build tree)
endif
ifneq ($(CONFIGURATION),$(xcode_config))
$(error Xcode configuration (release or debug) does not match that of this build tree)
endif
endif
APP := Viewer
ios_Viewer_app_DIR := $(SRC_ROOT)/ios/experimental/Viewer/DerivedData/$(APP)/Build/Products/$(xcode_config)-$(xcode_sdk)/$(APP).app
ios_Viewer_app_EXE := $(ios_Viewer_app_DIR)/Viewer
$(call gb_CustomTarget_get_target,ios/Viewer_app) : $(ios_Viewer_app_EXE)
$(ios_Viewer_app_EXE): $(call gb_Executable_get_target,Viewer)
mkdir -p $(ios_Viewer_app_DIR)
cp $(call gb_Executable_get_target,Viewer) $(ios_Viewer_app_DIR)
# vim: set noet sw=4 ts=4:

33
ios/Executable_Viewer.mk Normal file
View file

@ -0,0 +1,33 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
$(eval $(call gb_Executable_Executable,Viewer))
$(eval $(call gb_Executable_use_api,Viewer,\
udkapi \
offapi \
))
$(eval $(call gb_Executable_use_externals,Viewer,\
iconv \
zlib \
))
$(eval $(call gb_Executable_set_include,Viewer,\
$$(INCLUDE) \
))
$(eval $(call gb_Executable_use_system_darwin_frameworks,Viewer,\
Foundation \
CoreFoundation \
CoreGraphics \
CoreText \
UIKit \
))
$(eval $(call gb_Executable_add_objcxxobjects,Viewer,\
ios/experimental/Viewer/Viewer/lo-viewer \
ios/experimental/Viewer/Viewer/LOViewerAppDelegate \
ios/experimental/Viewer/Viewer/main \
))
# vim: set ts=4 sw=4 et:

13
ios/Makefile Normal file
View file

@ -0,0 +1,13 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
include $(module_directory)/../solenv/gbuild/partial_build.mk
# vim: set noet sw=4 ts=4:

20
ios/Module_ios.mk Normal file
View file

@ -0,0 +1,20 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
$(eval $(call gb_Module_Module,ios))
ifeq ($(OS),IOS)
$(eval $(call gb_Module_add_targets,ios,\
Executable_Viewer \
CustomTarget_Viewer_app \
))
endif
# vim: set noet sw=4 ts=4:

View file

@ -1,134 +0,0 @@
include ../../../config_host.mk
APP=LODocumentLoader
# If run from Xcode, check the CURRENT_ARCH env var for which platform we are
# building, device or simulator
ifneq (,$(filter i386,$(CC)))
PLATFORM=iphonesimulator
else
PLATFORM=iphoneos
endif
APPDIR=build/Debug-$(PLATFORM)/$(APP).app
# Stuff lifted from solenv/gbuild
COMMA := ,
gb_CPUDEFS := -DARM32
gb_CPUDEFS += -D$(CPUNAME)
gb_OSDEFS := \
-D$(OS) \
-D_PTHREADS \
-DUNIX \
-DUNX \
-D_REENTRANT \
-DNO_PTHREAD_PRIORITY \
$(EXTRA_CDEFS) \
gb_CPPU_ENV := gcc3
gb_COMPILERDEFS := \
-D$(COM) \
-DCPPU_ENV=$(gb_CPPU_ENV) \
gb_DEBUGLEVEL := 1
gb_GLOBALDEFS := \
-D_REENTRANT \
-DOSL_DEBUG_LEVEL=$(gb_DEBUGLEVEL) \
-DSUPD=$(UPD) \
$(gb_OSDEFS) \
$(gb_COMPILERDEFS) \
$(gb_CPUDEFS) \
-DDISABLE_DYNLOADING \
gb_OBJC_OBJCXX_COMMON_FLAGS := -fobjc-abi-version=2 -fobjc-legacy-dispatch -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -g
gb_OBJCFLAGS := -x objective-c $(gb_OBJC_OBJCXX_COMMON_FLAGS)
gb_OBJCXXFLAGS := -x objective-c++ $(gb_OBJC_OBJCXX_COMMON_FLAGS)
gb_Library__FRAMEWORKS := \
Foundation \
CoreFoundation \
CoreGraphics \
CoreText \
UIKit \
SRCS = docloader.mm
CFLAGS = $(SOLARINC)
MOREINCLUDES = -I$(OUTDIR)/inc/udkapi -I$(OUTDIR)/inc/offapi
LIBS = \
$(addprefix -Wl$(COMMA),$(wildcard $(OUTDIR)/lib/*.a)) \
$(addprefix -framework , $(gb_Library__FRAMEWORKS)) \
-lz \
-liconv
all: $(APPDIR)/$(APP) stuff
$(APPDIR)/$(APP): $(SRCS)
mkdir -p $(APPDIR)
$(CXX) -v -miphoneos-version-min=4.3 -fobjc-link-runtime -Wl,-map,$(APP).map.mangled -Wl,-dead_strip -o $@ $(gb_GLOBALDEFS) $(CFLAGS) $(gb_OBJCXXFLAGS) $(MOREINCLUDES) $(SRCS) $(LIBS)
c++filt <$(APP).map.mangled >$(APP).map && rm $(APP).map.mangled
stuff:
# inifile:
echo 'URE_BOOTSTRAP=$${ORIGIN}/fundamentalrc' >$(APPDIR)/rc
#
# URE_BOOTSTRAP file, fundamentalrc:
( \
echo '[Bootstrap]'; \
echo 'BRAND_BASE_DIR=$${ORIGIN}'; \
echo 'CONFIGURATION_LAYERS=xcsxcu:$${BRAND_BASE_DIR}/registry module:$${BRAND_BASE_DIR}/registry/modules res:$${BRAND_BASE_DIR}/registry' \
) >$(APPDIR)/fundamentalrc
#
# An unorc is *mandatory*, sigh. We leave it empty except for the
# [Bootstrap} section header, though, and set all the stuff using
# -env: options in docloader.m. Whether that makes sense or not,
# no idea. The ideal would clearly be if *none* of the various rc
# files was mandatory, and the code would automatically use sane
# defaults. (Sane for the particular platform, that is.)
( \
echo '[Bootstrap]' \
) >$(APPDIR)/unorc
#
# hmm, once again, a hodgepodge of stuff, I don't really know which
# files of which are actually needed...
mkdir -p $(APPDIR)/registry/res
cp $(OUTDIR)/xml/*.xcd $(APPDIR)/registry
mv $(APPDIR)/registry/fcfg_langpack_en-US.xcd $(APPDIR)/registry/res
cp -R $(OUTDIR)/xml/registry/* $(APPDIR)/registry
#
# .rdb files
cp $(OUTDIR)/bin/udkapi.rdb $(OUTDIR)/bin/types.rdb $(OUTDIR)/xml/ure/services.rdb $(APPDIR)
mkdir -p $(APPDIR)/ure
cp $(OUTDIR)/bin/ure/types.rdb $(APPDIR)/ure
#
# a bunch of .component files
for F in framework/util/fwk i18npool/util/i18npool sfx2/util/sfx ucb/source/core/ucb1 ucb/source/ucp/file/ucpfile1 unoxml/source/service/unoxml configmgr/source/configmgr basic/util/sb chart2/source/controller/chartcontroller chart2/source/chartcore comphelper/util/comphelp eventattacher/source/evtatt fileaccess/source/fileacc filter/source/config/cache/filterconfig1 oox/util/oox package/source/xstor/xstor package/util/package2 sax/source/expatwrap/expwrap sax/source/fastparser/fastsax sc/util/sc sc/util/scfilt scaddins/source/analysis/analysis scaddins/source/datefunc/date sot/util/sot svl/util/svl toolkit/util/tk ucb/source/ucp/tdoc/ucptdoc1 unotools/util/utl unoxml/source/rdf/unordf; do \
mkdir -p $(APPDIR)/ComponentTarget/`dirname $$F`; \
cp $(WORKDIR)/ComponentTarget/$$F.component $(APPDIR)/ComponentTarget/$$F.component; \
done
#
# .res files
#
# $BRAND_BASE_DIR/program/resource hardcoded in
# ResMgrContainer::init() in tools/source/rc/resmgr.cxx, so let's use
# that.
mkdir -p $(APPDIR)/program/resource
for F in $(OUTDIR)/bin/*.res; do \
cp $$F $(APPDIR)/program/resource; \
done
#
# Test documents
cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt $(APPDIR)
clean:
rm -rf $(APPDIR)

4
ios/experimental/Viewer/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
.DS_Store
DerivedData
Viewer.xcodeproj/project.xcworkspace
Viewer.xcodeproj/xcuserdata

View file

@ -0,0 +1,302 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
BE5A22641664F87600CF01C9 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = BE5A22621664F87600CF01C9 /* InfoPlist.strings */; };
BE5A226C1664F87600CF01C9 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = BE5A226B1664F87600CF01C9 /* Default.png */; };
BE5A226E1664F87600CF01C9 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BE5A226D1664F87600CF01C9 /* Default@2x.png */; };
BE5A22701664F87600CF01C9 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BE5A226F1664F87600CF01C9 /* Default-568h@2x.png */; };
BE69AD88169592C4001BE1CD /* iTunesArtwork in Resources */ = {isa = PBXBuildFile; fileRef = BE69AD87169592C4001BE1CD /* iTunesArtwork */; };
BE69AD8D1695954D001BE1CD /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = BE69AD8A1695954D001BE1CD /* Icon-72.png */; };
BE69AD8E1695954D001BE1CD /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = BE69AD8B1695954D001BE1CD /* Icon.png */; };
BE69AD8F1695954D001BE1CD /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = BE69AD8C1695954D001BE1CD /* Icon@2x.png */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
BE5A22551664F87600CF01C9 /* Viewer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Viewer.app; sourceTree = BUILT_PRODUCTS_DIR; };
BE5A22591664F87600CF01C9 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
BE5A225B1664F87600CF01C9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
BE5A225D1664F87600CF01C9 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
BE5A22611664F87600CF01C9 /* Viewer-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Viewer-Info.plist"; sourceTree = "<group>"; };
BE5A22631664F87600CF01C9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
BE5A22651664F87600CF01C9 /* main.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
BE5A22671664F87600CF01C9 /* Viewer-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Viewer-Prefix.pch"; sourceTree = "<group>"; };
BE5A22681664F87600CF01C9 /* LOViewerAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LOViewerAppDelegate.h; sourceTree = "<group>"; };
BE5A22691664F87600CF01C9 /* LOViewerAppDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LOViewerAppDelegate.mm; sourceTree = "<group>"; };
BE5A226B1664F87600CF01C9 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
BE5A226D1664F87600CF01C9 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
BE5A226F1664F87600CF01C9 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
BE5A22771664F87600CF01C9 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
BE69AD87169592C4001BE1CD /* iTunesArtwork */ = {isa = PBXFileReference; lastKnownFileType = file; path = iTunesArtwork; sourceTree = "<group>"; };
BE69AD8A1695954D001BE1CD /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
BE69AD8B1695954D001BE1CD /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
BE69AD8C1695954D001BE1CD /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
BECC59C2169344C300D29860 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
BE5A224A1664F87600CF01C9 = {
isa = PBXGroup;
children = (
BE5A225F1664F87600CF01C9 /* Viewer */,
BE5A22581664F87600CF01C9 /* Frameworks */,
BE5A22561664F87600CF01C9 /* Products */,
);
sourceTree = "<group>";
};
BE5A22561664F87600CF01C9 /* Products */ = {
isa = PBXGroup;
children = (
BE5A22551664F87600CF01C9 /* Viewer.app */,
);
name = Products;
sourceTree = "<group>";
};
BE5A22581664F87600CF01C9 /* Frameworks */ = {
isa = PBXGroup;
children = (
BE5A22591664F87600CF01C9 /* UIKit.framework */,
BE5A225B1664F87600CF01C9 /* Foundation.framework */,
BE5A225D1664F87600CF01C9 /* CoreGraphics.framework */,
BE5A22771664F87600CF01C9 /* SenTestingKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
BE5A225F1664F87600CF01C9 /* Viewer */ = {
isa = PBXGroup;
children = (
BE69AD3716958CA0001BE1CD /* Resources */,
BE5A22681664F87600CF01C9 /* LOViewerAppDelegate.h */,
BE5A22691664F87600CF01C9 /* LOViewerAppDelegate.mm */,
BE5A22601664F87600CF01C9 /* Supporting Files */,
);
path = Viewer;
sourceTree = "<group>";
};
BE5A22601664F87600CF01C9 /* Supporting Files */ = {
isa = PBXGroup;
children = (
BE5A22611664F87600CF01C9 /* Viewer-Info.plist */,
BE5A22621664F87600CF01C9 /* InfoPlist.strings */,
BE5A22651664F87600CF01C9 /* main.mm */,
BE5A22671664F87600CF01C9 /* Viewer-Prefix.pch */,
BE5A226B1664F87600CF01C9 /* Default.png */,
BE5A226D1664F87600CF01C9 /* Default@2x.png */,
BE5A226F1664F87600CF01C9 /* Default-568h@2x.png */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
BE69AD3716958CA0001BE1CD /* Resources */ = {
isa = PBXGroup;
children = (
BE69AD87169592C4001BE1CD /* iTunesArtwork */,
BE69AD8A1695954D001BE1CD /* Icon-72.png */,
BE69AD8B1695954D001BE1CD /* Icon.png */,
BE69AD8C1695954D001BE1CD /* Icon@2x.png */,
);
name = Resources;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
BE5A22541664F87600CF01C9 /* Viewer */ = {
isa = PBXNativeTarget;
buildConfigurationList = BE5A22881664F87600CF01C9 /* Build configuration list for PBXNativeTarget "Viewer" */;
buildPhases = (
BE8B879916933FCD00F61E9F /* ShellScript */,
BE5A22531664F87600CF01C9 /* Resources */,
BECC59C2169344C300D29860 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Viewer;
productName = Viewer;
productReference = BE5A22551664F87600CF01C9 /* Viewer.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
BE5A224C1664F87600CF01C9 /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = LOViewer;
LastUpgradeCheck = 0450;
ORGANIZATIONNAME = "Tor Lillqvist";
};
buildConfigurationList = BE5A224F1664F87600CF01C9 /* Build configuration list for PBXProject "Viewer" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = BE5A224A1664F87600CF01C9;
productRefGroup = BE5A22561664F87600CF01C9 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
BE5A22541664F87600CF01C9 /* Viewer */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
BE5A22531664F87600CF01C9 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
BE5A22641664F87600CF01C9 /* InfoPlist.strings in Resources */,
BE5A226C1664F87600CF01C9 /* Default.png in Resources */,
BE5A226E1664F87600CF01C9 /* Default@2x.png in Resources */,
BE5A22701664F87600CF01C9 /* Default-568h@2x.png in Resources */,
BE69AD88169592C4001BE1CD /* iTunesArtwork in Resources */,
BE69AD8D1695954D001BE1CD /* Icon-72.png in Resources */,
BE69AD8E1695954D001BE1CD /* Icon.png in Resources */,
BE69AD8F1695954D001BE1CD /* Icon@2x.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
BE8B879916933FCD00F61E9F /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Viewer.app",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd ../.. && /opt/lo/bin/make";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXVariantGroup section */
BE5A22621664F87600CF01C9 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
BE5A22631664F87600CF01C9 /* en */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
BE5A22861664F87600CF01C9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = "";
OTHER_LDFLAGS = "-v";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 2;
VALID_ARCHS = armv7;
};
name = Debug;
};
BE5A22871664F87600CF01C9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = "";
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
OTHER_LDFLAGS = "-v";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 2;
VALID_ARCHS = armv7;
};
name = Release;
};
BE5A22891664F87600CF01C9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Viewer/Viewer-Prefix.pch";
INFOPLIST_FILE = "Viewer/Viewer-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = "../../../workdir/$(LO_INPATH)/LinkTarget/Library";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Debug;
};
BE5A228A1664F87600CF01C9 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Viewer/Viewer-Prefix.pch";
INFOPLIST_FILE = "Viewer/Viewer-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
LIBRARY_SEARCH_PATHS = "../../../workdir/$(LO_INPATH)/LinkTarget/Library";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
BE5A224F1664F87600CF01C9 /* Build configuration list for PBXProject "Viewer" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BE5A22861664F87600CF01C9 /* Debug */,
BE5A22871664F87600CF01C9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
BE5A22881664F87600CF01C9 /* Build configuration list for PBXNativeTarget "Viewer" */ = {
isa = XCConfigurationList;
buildConfigurations = (
BE5A22891664F87600CF01C9 /* Debug */,
BE5A228A1664F87600CF01C9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = BE5A224C1664F87600CF01C9 /* Project object */;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -0,0 +1,15 @@
//
// LOViewerAppDelegate.h
// Viewer
//
// Created by Tor Lillqvist on 2012-11-27.
// Copyright (c) 2012 Tor Lillqvist. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LOViewerAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end

View file

@ -0,0 +1,76 @@
// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
// This file is part of the LibreOffice project.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
#include <stdlib.h>
#import <UIKit/UIKit.h>
#import "LOViewerAppDelegate.h"
#include "lo-viewer.h"
@implementation LOViewerAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
(void) application;
(void) launchOptions;
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
lo_initialize();
// Do something here
[self.window makeKeyAndVisible];
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
(void) application;
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
(void) application;
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
(void) application;
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
(void) application;
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
(void) application;
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
// vim:set shiftwidth=4 softtabstop=4 expandtab:

View file

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>org.libreoffice.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>CFBundleIconFile</key>
<string></string>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Icon-72.png</string>
<string>Icon@2x.png</string>
</array>
</dict>
</plist>

View file

@ -0,0 +1,14 @@
//
// Prefix header for all source files of the 'Viewer' target in the 'Viewer' project
//
#import <Availability.h>
#ifndef __IPHONE_3_0
#warning "This project uses features only available in iOS SDK 3.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif

View file

@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

View file

@ -0,0 +1,18 @@
// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
// This file is part of the LibreOffice project.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
#ifndef LO_VIEWER_H
#define LO_VIEWER_H
void lo_initialize(void);
#endif // LO_VIEWER_H
// vim:set shiftwidth=4 softtabstop=4 expandtab:

View file

@ -1,11 +1,11 @@
/* -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
// This file is part of the LibreOffice project.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
#include <stdlib.h>
@ -119,37 +119,9 @@ lo_get_libmap(void)
return map;
}
int
main(int argc, char ** argv)
void
lo_initialize(void)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain (argc, argv, @"UIApplication", @"loAppDelegate");
[pool release];
return retVal;
}
@interface loAppDelegate : NSObject <UIApplicationDelegate> {
}
@property (nonatomic, retain) UIWindow *window;
@end
@implementation loAppDelegate
@synthesize window=_window;
- (BOOL)application: (UIApplication *) application
didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
{
int i;
(void) application;
(void) launchOptions;
UIWindow *uiw = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
uiw.backgroundColor = [UIColor redColor];
self.window = uiw;
[uiw release];
// See unotest/source/cpp/bootstrapfixturebase.cxx
const char *app_root = [[[NSBundle mainBundle] bundlePath] UTF8String];
setenv("SRC_ROOT", app_root, 1);
@ -158,15 +130,7 @@ didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
setenv("SAL_LOG", "yes", 1);
const char *argv[] = {
"lo-qa-sc-filters-test",
"dummy-testlib",
"--headless",
"--protector",
"dummy-libunoexceptionprotector",
"unoexceptionprotector",
"--protector",
"dummy-libunobootstrapprotector",
"unobootstrapprotector",
"Viewer",
"-env:URE_INTERNAL_LIB_DIR=file:///",
"placeholder-uno-types",
"placeholder-uno-services"
@ -227,7 +191,7 @@ didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
"ComponentTarget/ucb/source/ucp/file/ucpfile1.component"
};
for (i = 0; i < sizeof(services)/sizeof(services[0]); i++) {
for (unsigned i = 0; i < sizeof(services)/sizeof(services[0]); i++) {
uno_services = [uno_services stringByAppendingString: @"file://"];
uno_services = [uno_services stringByAppendingString: [app_root_escaped stringByAppendingPathComponent: [NSString stringWithUTF8String: services[i]]]];
if (i < sizeof(services)/sizeof(services[0]) - 1)
@ -239,22 +203,17 @@ didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
osl_setCommandArgs(argc, (char **) argv);
Reference< XComponentContext > xComponentContext(::cppu::defaultBootstrap_InitialComponentContext());
try {
Reference< XMultiComponentFactory > xMultiComponentFactoryClient(
xComponentContext->getServiceManager() );
Reference< XComponentContext > xComponentContext(::cppu::defaultBootstrap_InitialComponentContext());
Reference< XInterface > xInterface =
xMultiComponentFactoryClient->createInstanceWithContext(
OUString("com.sun.star.frame.Desktop"),
xComponentContext );
Reference< XMultiComponentFactory > xMultiComponentFactoryClient( xComponentContext->getServiceManager() );
// Do something here
[self.window makeKeyAndVisible];
return YES;
Reference< XInterface > xInterface =
xMultiComponentFactoryClient->createInstanceWithContext( OUString("com.sun.star.frame.Desktop"),
xComponentContext );
}
catch (Exception e) {
SAL_WARN("Viewer", e.Message);
}
}
@end
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -0,0 +1,21 @@
// -*- Mode: ObjC; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
//
// This file is part of the LibreOffice project.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
#import <UIKit/UIKit.h>
#import "LOViewerAppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([LOViewerAppDelegate class]));
}
}
// vim:set shiftwidth=4 softtabstop=4 expandtab:

2
ios/prj/build.lst Normal file
View file

@ -0,0 +1,2 @@
ios ios :: packimages postprocess NULL
ios ios\prj nmake - all an_prj NULL