summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorjan Iversen <jani@libreoffice.org>2017-10-16 14:14:30 +0200
committerjan Iversen <jani@libreoffice.org>2017-10-16 19:14:26 +0200
commit7e7329873b263917ff963b38dfd804727d0914d0 (patch)
tree1394eb1a809ab75bd3304d96aa4bbb2f7429daab /ios
parent172954db84ec4a2d38bf154c3199c5e16ee4f546 (diff)
iOS, change prelink lib to pure C.
Removed object C and replaced with C to make lib pure. Change-Id: Ie0f49f7e2f4577195dadfa0fdec70212af7c698a
Diffstat (limited to 'ios')
-rw-r--r--ios/CustomTarget_iOS.mk8
-rw-r--r--ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj20
-rw-r--r--ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c (renamed from ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.mm)19
-rw-r--r--ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h8
4 files changed, 37 insertions, 18 deletions
diff --git a/ios/CustomTarget_iOS.mk b/ios/CustomTarget_iOS.mk
index 7effabcaa769..9f19f279a964 100644
--- a/ios/CustomTarget_iOS.mk
+++ b/ios/CustomTarget_iOS.mk
@@ -10,6 +10,8 @@ IOSGEN := $(SRCDIR)/ios/generated
IOSRES := $(IOSGEN)/resources
IOSKITXC := $(WORKDIR)/ios/loKit.xcconfig
IOSAPPXC := $(WORKDIR)/ios/loApp.xcconfig
+IOSKITSRC := $(SRCDIR)/ios/LibreOfficeKit/LibreOfficeKit
+IOSAPPSRC := $(SRCDIR)/ios/LibreOfficeLight/LibreOfficeLight
IOSKITPRJ := $(SRCDIR)/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj
IOSAPPPRJ := $(SRCDIR)/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj
IOSAPP := $(INSTDIR)/LibreOfficeLight.app
@@ -58,7 +60,7 @@ ifeq ("$(wildcard $(IOSRES))","")
# generate file with call declarations
$(SRCDIR)/solenv/bin/native-code.py \
-g core -g writer -g calc -g draw -g edit \
- > $(IOSGEN)/native-code.mm
+ > $(IOSGEN)/native-code.h
# generate resource files used to start/run LibreOffice
cp $(WORKDIR)/UnpackedTarball/icu/source/data/in/icudt59l.dat $(IOSRES)/icudt59l.dat
@@ -108,7 +110,7 @@ endif
#- build ---------------------------------------------------------------------
-$(IOSGEN)/$(IOSKIT): $(IOSKITPRJ)/project.pbxproj $(IOSKITXC) $(IOSAPPXC)
+$(IOSGEN)/$(IOSKIT): $(IOSKITPRJ)/project.pbxproj $(IOSKITXC) $(IOSAPPXC) $(IOSKITSRC)/LibreOfficeKit.h $(IOSKITSRC)/LibreOfficeKit.c
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
CC=; \
$(call gb_Helper_print_on_error, \
@@ -145,7 +147,7 @@ $(INSTDIR)/$(IOSAPP): $(IOSAPPPRJ)/project.pbxproj $(IOSGEN)/$(IOSKIT)
#- clean ios -----------------------------------------------------------------
$(call gb_CustomTarget_get_clean_target,ios/ios):
$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),ENV,2)
- rm $(IOSGEN)/$(IOSKIT)
+ rm -f $(IOSGEN)/$(IOSKIT)
rm -rf $(SRCDIR)/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.xcworkspace
rm -rf $(SRCDIR)/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/xcuserdata
rm -rf $(SRCDIR)/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.xcworkspace
diff --git a/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj b/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj
index 99a6a26ca0f7..69faf4fb80a9 100644
--- a/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeKit/LibreOfficeKit.xcodeproj/project.pbxproj
@@ -7,27 +7,25 @@
objects = {
/* Begin PBXBuildFile section */
- 39B5D21A1F78130F008FB162 /* LibreOfficeKit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 39B5D2191F78130F008FB162 /* LibreOfficeKit.mm */; };
- 39B5D21B1F78130F008FB162 /* LibreOfficeKit.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 39B5D2181F78130F008FB162 /* LibreOfficeKit.h */; };
+ 39503A731F94CBA000F19C78 /* LibreOfficeKit.c in Sources */ = {isa = PBXBuildFile; fileRef = 39503A721F94CBA000F19C78 /* LibreOfficeKit.c */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
39B5D2131F78130F008FB162 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
- dstPath = "include/$(PRODUCT_NAME)";
- dstSubfolderSpec = 16;
+ dstPath = "$(SRCDIR)/ios/generated";
+ dstSubfolderSpec = 0;
files = (
- 39B5D21B1F78130F008FB162 /* LibreOfficeKit.h in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 39503A6E1F94C3B700F19C78 /* LibreOfficeKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LibreOfficeKit.h; sourceTree = "<group>"; };
+ 39503A721F94CBA000F19C78 /* LibreOfficeKit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = LibreOfficeKit.c; sourceTree = "<group>"; };
39B5D2151F78130F008FB162 /* libLibreOfficeKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libLibreOfficeKit.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 39B5D2181F78130F008FB162 /* LibreOfficeKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LibreOfficeKit.h; sourceTree = "<group>"; };
- 39B5D2191F78130F008FB162 /* LibreOfficeKit.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LibreOfficeKit.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -68,8 +66,8 @@
39B5D2171F78130F008FB162 /* LibreOfficeKit */ = {
isa = PBXGroup;
children = (
- 39B5D2181F78130F008FB162 /* LibreOfficeKit.h */,
- 39B5D2191F78130F008FB162 /* LibreOfficeKit.mm */,
+ 39503A721F94CBA000F19C78 /* LibreOfficeKit.c */,
+ 39503A6E1F94C3B700F19C78 /* LibreOfficeKit.h */,
);
path = LibreOfficeKit;
sourceTree = "<group>";
@@ -131,7 +129,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 39B5D21A1F78130F008FB162 /* LibreOfficeKit.mm in Sources */,
+ 39503A731F94CBA000F19C78 /* LibreOfficeKit.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -276,6 +274,7 @@
39B5D21F1F78130F008FB162 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ MACH_O_TYPE = staticlib;
OTHER_LDFLAGS = "";
PRELINK_FLAGS = "-ios_version_min 10.3";
PRELINK_LIBS = "";
@@ -287,6 +286,7 @@
39B5D2201F78130F008FB162 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ MACH_O_TYPE = staticlib;
OTHER_LDFLAGS = "";
PRELINK_FLAGS = "-ios_version_min 10.3";
PRELINK_LIBS = "";
diff --git a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.mm b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c
index 677386ce196b..b3c41c3a5d4b 100644
--- a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.mm
+++ b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c
@@ -5,6 +5,7 @@
// 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 "LibreOfficeKit.h"
#include <stdio.h>
#include <TargetConditionals.h>
#define LOK_USE_UNSTABLE_API
@@ -16,11 +17,11 @@
#include <unicode/ucnv.h>
// generated by solenv/bin/native-code.py:
-#include "native-code.mm"
+#include "native-code.h"
// Force reference to libreofficekit_hook
-extern "C" __attribute__((used)) void *libreofficekit_hook(const char *);
+extern __attribute__((used)) void *libreofficekit_hook(const char *);
static __attribute__((used)) void *(*foop)(const char *) = libreofficekit_hook;
// pointers to our instance
@@ -31,7 +32,7 @@ static LibreOfficeKitDocument* document;
// Bridge functions to LibreOfficeKit
-extern "C" int BridgeLOkit_Init(const char *path)
+int BridgeLOkit_Init(const char *path)
{
char bufUserPath[200];
strcpy(bufUserPath, path);
@@ -43,10 +44,18 @@ extern "C" int BridgeLOkit_Init(const char *path)
return 0;
}
-int LOkit_open(char *file)
+
+
+int BridgeLOkit_open(const char *path)
{
- document = kit->pClass->documentLoad(kit, file);
+ document = kit->pClass->documentLoad(kit, path);
document->pClass->initializeForRendering(document, "");
return 0;
}
+
+
+int BridgeLOkit_ClientCommand(const char *input)
+{
+ return 0;
+}
diff --git a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h
index 3d4366495382..b86156211893 100644
--- a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h
+++ b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h
@@ -6,3 +6,11 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
+// Bridge functions between LibreOfficeKit library and swift application.
+// Only functions mentioned here can be used from the application
+// The swift compiler uses this header to generate a needed interface
+// The functions (LibreOfficeKit.mm) calls functions directly in LibreOffice
+
+int BridgeLOkit_Init(const char *path);
+int BridgeLOkit_open(const char *path);
+int BridgeLOkit_ClientCommand(const char *input);