diff options
author | jan Iversen <jani@libreoffice.org> | 2017-05-29 11:06:59 +0200 |
---|---|---|
committer | jan Iversen <jani@libreoffice.org> | 2017-05-29 11:13:11 +0200 |
commit | 30da68bc7b42a960ac0bcb38ed5b82cce9af1ef0 (patch) | |
tree | 032314b5abfa3699157886c47da453d065d21b9f /ios/experimental | |
parent | 68ca63cf2c830d3a1ddbbcac9cc7edaa23b71c51 (diff) |
iOS, LOkit link problems solved
.swift -> .c -> LibreOfficeKit
does not work (LOkit is compiled with C++)
changed to
.swift -> .mm -> LibreOfficeKit
Change-Id: I4d4684876ca21534389189a431fcaadbbac78d3f
Diffstat (limited to 'ios/experimental')
-rw-r--r-- | ios/experimental/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj | 38 | ||||
-rw-r--r-- | ios/experimental/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift | 2 | ||||
-rw-r--r-- | ios/experimental/LibreOfficeLight/LibreOfficeLight/en.lproj/InfoPlist.strings | 2 | ||||
-rw-r--r-- | ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h | 4 | ||||
-rwxr-xr-x | ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.mm (renamed from ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c) | 28 |
5 files changed, 48 insertions, 26 deletions
diff --git a/ios/experimental/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj b/ios/experimental/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj index 2b395c08a596..31a667b88560 100644 --- a/ios/experimental/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj +++ b/ios/experimental/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 39022C181EDC142F00100066 /* lokit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39022C171EDC142F00100066 /* lokit.mm */; }; 392ED9B31E5E4B03005C8435 /* ViewPrintManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 392ED9B21E5E4B03005C8435 /* ViewPrintManager.swift */; }; 396F92F71E7AE62400A28C82 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 396F92F61E7AE62400A28C82 /* Settings.bundle */; }; 397868D61E59A3EA007F9248 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 397868D81E59A3EA007F9248 /* LaunchScreen.xib */; }; @@ -19,8 +20,6 @@ 3992D85D1E5B764A00BEA987 /* SideMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3992D85B1E5B764A00BEA987 /* SideMenu.swift */; }; 3992D85E1E5B764A00BEA987 /* FileManagerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3992D85C1E5B764A00BEA987 /* FileManagerController.swift */; }; 399648471E5B87DC00E73E83 /* ViewProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 399648461E5B87DC00E73E83 /* ViewProperties.swift */; }; - 39A83A8F1E5F471D00D0C683 /* lokit.c in Sources */ = {isa = PBXBuildFile; fileRef = 39A83A8E1E5F471D00D0C683 /* lokit.c */; }; - 39B084E31E5F0A9600682A59 /* lo.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 39B084E21E5F0A9600682A59 /* lo.xcconfig */; }; 39B08B9D1E5F0BB600682A59 /* fundamentalrc in Resources */ = {isa = PBXBuildFile; fileRef = 39B084E51E5F0BB400682A59 /* fundamentalrc */; }; 39B08B9E1E5F0BB600682A59 /* offapi.rdb in Resources */ = {isa = PBXBuildFile; fileRef = 39B084E61E5F0BB400682A59 /* offapi.rdb */; }; 39B08B9F1E5F0BB600682A59 /* oovbaapi.rdb in Resources */ = {isa = PBXBuildFile; fileRef = 39B084E71E5F0BB400682A59 /* oovbaapi.rdb */; }; @@ -48,6 +47,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 39022C171EDC142F00100066 /* lokit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = lokit.mm; sourceTree = "<group>"; }; + 39022C191EDC14D300100066 /* lokit-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "lokit-Bridging-Header.h"; sourceTree = "<group>"; }; 392ED9B21E5E4B03005C8435 /* ViewPrintManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewPrintManager.swift; path = LibreOfficeLight/ViewPrintManager.swift; sourceTree = SOURCE_ROOT; }; 396F92F61E7AE62400A28C82 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; }; 397275391E77D9F1006ACDCC /* LibreOfficeLight.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = LibreOfficeLight.entitlements; sourceTree = "<group>"; }; @@ -67,8 +68,6 @@ 3992D85B1E5B764A00BEA987 /* SideMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SideMenu.swift; path = LibreOfficeLight/SideMenu.swift; sourceTree = SOURCE_ROOT; }; 3992D85C1E5B764A00BEA987 /* FileManagerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FileManagerController.swift; path = LibreOfficeLight/FileManagerController.swift; sourceTree = SOURCE_ROOT; }; 399648461E5B87DC00E73E83 /* ViewProperties.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ViewProperties.swift; path = LibreOfficeLight/ViewProperties.swift; sourceTree = SOURCE_ROOT; }; - 39A83A8D1E5F471C00D0C683 /* lokit-Bridging-Header.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; name = "lokit-Bridging-Header.h"; path = "LibreOfficeLight/lokit-Bridging-Header.h"; sourceTree = SOURCE_ROOT; }; - 39A83A8E1E5F471D00D0C683 /* lokit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = lokit.c; path = LibreOfficeLight/lokit.c; sourceTree = SOURCE_ROOT; }; 39B084E21E5F0A9600682A59 /* lo.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = lo.xcconfig; path = "../../../../ios-work/workdir/ios/generated/lo.xcconfig"; sourceTree = SOURCE_ROOT; }; 39B084E51E5F0BB400682A59 /* fundamentalrc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = fundamentalrc; path = "../../../../ios-work/workdir/ios/resources/fundamentalrc"; sourceTree = SOURCE_ROOT; }; 39B084E61E5F0BB400682A59 /* offapi.rdb */ = {isa = PBXFileReference; lastKnownFileType = file; name = offapi.rdb; path = "../../../../ios-work/workdir/ios/resources/offapi.rdb"; sourceTree = SOURCE_ROOT; }; @@ -152,7 +151,8 @@ 397E08FC1E597BD8001374E0 /* LibreOfficeLight */ = { isa = PBXGroup; children = ( - 39A83A8E1E5F471D00D0C683 /* lokit.c */, + 39022C191EDC14D300100066 /* lokit-Bridging-Header.h */, + 39022C171EDC142F00100066 /* lokit.mm */, 397E08FD1E597BD8001374E0 /* AppDelegate.swift */, 3992D85B1E5B764A00BEA987 /* SideMenu.swift */, 3992D8591E5B762A00BEA987 /* DocumentController.swift */, @@ -161,7 +161,6 @@ 399648461E5B87DC00E73E83 /* ViewProperties.swift */, 397E09011E597BD8001374E0 /* Main.storyboard */, 397868D81E59A3EA007F9248 /* LaunchScreen.xib */, - 39A83A8D1E5F471C00D0C683 /* lokit-Bridging-Header.h */, ); path = LibreOfficeLight; sourceTree = SOURCE_ROOT; @@ -261,7 +260,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0820; + LastUpgradeCheck = 0830; ORGANIZATIONNAME = jani; TargetAttributes = { 397E08F91E597BD8001374E0 = { @@ -317,7 +316,6 @@ 397E09081E597BD8001374E0 /* Assets.xcassets in Resources */, 39B08BD71E5F0BB600682A59 /* rc in Resources */, 39B08B9E1E5F0BB600682A59 /* offapi.rdb in Resources */, - 39B084E31E5F0A9600682A59 /* lo.xcconfig in Resources */, 397868D61E59A3EA007F9248 /* LaunchScreen.xib in Resources */, 396F92F71E7AE62400A28C82 /* Settings.bundle in Resources */, 39B08B9F1E5F0BB600682A59 /* oovbaapi.rdb in Resources */, @@ -355,8 +353,8 @@ 399648471E5B87DC00E73E83 /* ViewProperties.swift in Sources */, 3992D85E1E5B764A00BEA987 /* FileManagerController.swift in Sources */, 3992D85A1E5B762A00BEA987 /* DocumentController.swift in Sources */, + 39022C181EDC142F00100066 /* lokit.mm in Sources */, 397E08FE1E597BD8001374E0 /* AppDelegate.swift in Sources */, - 39A83A8F1E5F471D00D0C683 /* lokit.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -477,6 +475,10 @@ IPHONEOS_DEPLOYMENT_TARGET = 10.2; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "$(LINK_LDFLAGS)", + "-lstdc++", + ); SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -542,6 +544,10 @@ IPHONEOS_DEPLOYMENT_TARGET = 10.2; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "$(LINK_LDFLAGS)", + "-lstdc++", + ); SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; @@ -553,10 +559,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 39B084E21E5F0A9600682A59 /* lo.xcconfig */; buildSettings = { - ARCHS = ( - "$(ARCHS_STANDARD)", - i386, - ); ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = NO; @@ -569,12 +571,13 @@ GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = LibreOfficeLight/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + OTHER_LDFLAGS = "$(LINK_LDFLAGS)"; PRODUCT_BUNDLE_IDENTIFIER = com.jani.Editors.LibreOfficeLight; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "LibreOfficeLight/lokit-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; - VALID_ARCHS = "i386 $(ARCHS_STANDARD)"; + VALID_ARCHS = i386; }; name = Debug; }; @@ -582,10 +585,6 @@ isa = XCBuildConfiguration; baseConfigurationReference = 39B084E21E5F0A9600682A59 /* lo.xcconfig */; buildSettings = { - ARCHS = ( - "$(ARCHS_STANDARD)", - i386, - ); ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = NO; @@ -599,11 +598,12 @@ INFOPLIST_FILE = LibreOfficeLight/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = "$(LINK_LDFLAGS)"; PRODUCT_BUNDLE_IDENTIFIER = com.jani.Editors.LibreOfficeLight; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "LibreOfficeLight/lokit-Bridging-Header.h"; SWIFT_VERSION = 3.0; - VALID_ARCHS = "i386 $(ARCHS_STANDARD)"; + VALID_ARCHS = i386; }; name = Release; }; diff --git a/ios/experimental/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift b/ios/experimental/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift index e50e462939aa..97693370478a 100644 --- a/ios/experimental/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift +++ b/ios/experimental/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift @@ -24,7 +24,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // start LibreOfficeKit - BridgeLOkit_Init() + BridgeLOkit_Init(Bundle.main.bundlePath) // Get version info let appInfo = Bundle.main.infoDictionary! as Dictionary<String,AnyObject> diff --git a/ios/experimental/LibreOfficeLight/LibreOfficeLight/en.lproj/InfoPlist.strings b/ios/experimental/LibreOfficeLight/LibreOfficeLight/en.lproj/InfoPlist.strings new file mode 100644 index 000000000000..477b28ff8f86 --- /dev/null +++ b/ios/experimental/LibreOfficeLight/LibreOfficeLight/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h b/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h index 2591dd90ae1d..9254f96c3545 100644 --- a/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h +++ b/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h @@ -6,8 +6,6 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. // - // Bridge functions to LibreOfficeKit -int BridgeLOkit_Init(); +int BridgeLOkit_Init(const char *path); int BridgeLOkit_ClientCommand(const char *input); - diff --git a/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c b/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.mm index ec566a6e78ee..1964de9a7420 100755 --- a/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c +++ b/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.mm @@ -6,23 +6,45 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/. // #include <stdio.h> +#include <TargetConditionals.h> #define LOK_USE_UNSTABLE_API #include <LibreOfficeKit/LibreOfficeKitInit.h> +#include <osl/process.h> + +#include <unicode/udata.h> +#include <unicode/ucnv.h> + +// generated by solenv/bin/native-code.py: +#include "native-code.mm" + + +// Force reference to libreofficekit_hook +extern "C" __attribute__((used)) void *libreofficekit_hook(const char *); +static __attribute__((used)) void *(*foop)(const char *) = libreofficekit_hook; + // pointers to our instance static LibreOfficeKit* kit; static LibreOfficeKitDocument* document; // Bridge functions to LibreOfficeKit -int BridgeLOkit_Init() +extern "C" int BridgeLOkit_Init(const char *path) { // Initialize LibreOfficeKit - kit = lok_init(NULL); + kit = lok_init(path); + + udata_setCommonData(NULL, NULL); + ucnv_open("iso-8859-3", NULL); + + ucnv_getName(NULL,NULL); + ucnv_close(NULL); + osl_setCommandArgs(8, NULL); + kit->pClass->documentLoad(kit, NULL); + document->pClass->initializeForRendering(document, ""); return 0; } - int LOkit_open(char *file) { document = kit->pClass->documentLoad(kit, file); |