ios/CustomTarget_iOS.mk                                         |   20 ++-
 ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj |   15 +-
 ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift         |    2 
 ios/LibreOfficeLight/LibreOfficeLight/LibreOfficeKit.mm         |   57 
----------
 ios/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h   |    4 
 solenv/bin/native-code.py                                       |    5 
 6 files changed, 30 insertions(+), 73 deletions(-)

New commits:
commit cd5a5c0baecac2832841208034b42724fcfbb49d
Author: jan Iversen <j...@libreoffice.org>
Date:   Mon Oct 16 20:23:24 2017 +0200

    added -C switch to native-code.py
    
    Android is using this script as well, so the iOS change
    needs to be hidden behind a flag
    
    Change-Id: Ica9064278f0b64ad3f078c7951eef15e39f2b6da

diff --git a/ios/CustomTarget_iOS.mk b/ios/CustomTarget_iOS.mk
index b07c6cbf99e8..e7f37778bf53 100644
--- a/ios/CustomTarget_iOS.mk
+++ b/ios/CustomTarget_iOS.mk
@@ -27,11 +27,20 @@ $(eval $(call gb_CustomTarget_CustomTarget,ios/ios))
 
 $(call gb_CustomTarget_get_target,ios/ios): $(IOSGEN)/$(IOSKIT)
 
+#- Setup directories  ---------------------------------------------------------
+IOSPREPARE:
+ifeq ("$(wildcard $(IOSGEN))","")
+       $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2)
+
+       mkdir -p $(IOSGEN) $(IOSRES) $(IOSRES)/services \
+                $(IOSRES)/share/config $(IOSRES)/share/filter 
$(IOSRES)/program \
+                $(IOSGEN) $(WORKDIR)/ios;
+endif
+
 
 #- Generate xcconfig files  ---------------------------------------------------
-$(IOSKITXC) $(IOSAPPXC): $(BUILDDIR)/config_host.mk 
$(SRCDIR)/ios/CustomTarget_iOS.mk
+$(IOSKITXC) $(IOSAPPXC): $(BUILDDIR)/config_host.mk 
$(SRCDIR)/ios/CustomTarget_iOS.mk IOSPREPARE
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2)
-       @mkdir -p $(IOSGEN) $(WORKDIR)/ios;
        sed -e "s'@BUILDDIR@'$(BUILDDIR)'g" \
            -e "s'@INSTDIR@'$(INSTDIR)'g" \
            -e "s'@SRCDIR@'$(SRC_ROOT)'g" \
@@ -53,12 +62,9 @@ $(IOSKITXC) $(IOSAPPXC): $(BUILDDIR)/config_host.mk 
$(SRCDIR)/ios/CustomTarget_i
 ifeq ("$(wildcard $(IOSRES))","")
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),ENV,2)
 
-       mkdir -p $(IOSGEN) $(IOSRES) $(IOSRES)/services \
-                $(IOSRES)/share/config $(IOSRES)/share/filter $(IOSRES)/program
-
        # generate file with call declarations
        $(SRCDIR)/solenv/bin/native-code.py \
-           -g core -g writer -g calc -g draw -g edit \
+           -C -g core -g writer -g calc -g draw -g edit \
            > $(IOSGEN)/native-code.h
 
        # generate resource files used to start/run LibreOffice
@@ -109,7 +115,7 @@ endif
 
 
 #- build  ---------------------------------------------------------------------
-$(IOSGEN)/$(IOSKIT): $(IOSKITPRJ)/project.pbxproj $(IOSKITXC) $(IOSAPPXC) 
$(IOSKITSRC)/LibreOfficeKit.h $(IOSKITSRC)/LibreOfficeKit.c
+$(IOSGEN)/$(IOSKIT): $(IOSKITXC) $(IOSAPPXC) IOSPREPARE
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),APP,2)
        CC=; \
        $(call gb_Helper_print_on_error, \
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 886c70a9cbfd..430a429e9b6d 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -408,6 +408,7 @@ opts = OptionParser()
 opts.add_option("-j", "--java-guard", action="store_true", help="include 
external java functions", dest="java", default=False)
 opts.add_option("-g", "--group", action="append", help="group of 
implementations to make available in application", dest="groups")
 opts.add_option("-r", "--limit-rdb", action="append", help="instead of 
outputting native-code.cxx, limit the services.rdb only to the services defined 
by the groups", dest="services")
+opts.add_option("-C", "--pure-c", action="store_true", help="do not print 
extern \"C\"", dest="pure_c", default=False)
 
 (options, args) = opts.parse_args()
 
@@ -447,6 +448,8 @@ print ("""/*
 #include <osl/detail/component-mapping.h>
 
 """)
+if not options.pure_c:
+    print ("""extern "C" {""")
 
 for entry in sorted(full_factory_map.keys()):
     factory_function = full_factory_map[entry]['function']
@@ -520,5 +523,7 @@ print ("""
 }
 
 """)
+if not options.pure_c:
+    print("""}""")
 
 # vim:set shiftwidth=4 softtabstop=4 expandtab:
commit 30c873ed750df42b565ea44b937096d743903b52
Author: jan Iversen <j...@libreoffice.org>
Date:   Mon Oct 16 14:15:34 2017 +0200

    iOS, update to app due to prelink lib change
    
    Change-Id: I86074b2bf6779834760e19cd206d469b93a1c480

diff --git a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj 
b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
index 26cc02235d3f..168bf689fac9 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
@@ -15,6 +15,7 @@
                392ED9B31E5E4B03005C8435 /* ViewPrintManager.swift in Sources 
*/ = {isa = PBXBuildFile; fileRef = 392ED9B21E5E4B03005C8435 /* 
ViewPrintManager.swift */; };
                393975781F8BECB0002DC80B /* libiconv.tbd in Frameworks */ = 
{isa = PBXBuildFile; fileRef = 393975771F8BECB0002DC80B /* libiconv.tbd */; };
                3939757A1F8BECC1002DC80B /* libz.tbd in Frameworks */ = {isa = 
PBXBuildFile; fileRef = 393975791F8BECC1002DC80B /* libz.tbd */; };
+               39503A751F94D44900F19C78 /* libc++.tbd in Frameworks */ = {isa 
= PBXBuildFile; fileRef = 39503A741F94D44900F19C78 /* libc++.tbd */; };
                396F92F71E7AE62400A28C82 /* Settings.bundle in Resources */ = 
{isa = PBXBuildFile; fileRef = 396F92F61E7AE62400A28C82 /* Settings.bundle */; 
};
                397868D61E59A3EA007F9248 /* LaunchScreen.xib in Resources */ = 
{isa = PBXBuildFile; fileRef = 397868D81E59A3EA007F9248 /* LaunchScreen.xib */; 
};
                397E08FE1E597BD8001374E0 /* AppDelegate.swift in Sources */ = 
{isa = PBXBuildFile; fileRef = 397E08FD1E597BD8001374E0 /* AppDelegate.swift 
*/; };
@@ -23,7 +24,6 @@
                3992D85A1E5B762A00BEA987 /* DocumentController.swift in Sources 
*/ = {isa = PBXBuildFile; fileRef = 3992D8591E5B762A00BEA987 /* 
DocumentController.swift */; };
                3992D85D1E5B764A00BEA987 /* SideMenu.swift in Sources */ = {isa 
= PBXBuildFile; fileRef = 3992D85B1E5B764A00BEA987 /* SideMenu.swift */; };
                399648471E5B87DC00E73E83 /* ViewProperties.swift in Sources */ 
= {isa = PBXBuildFile; fileRef = 399648461E5B87DC00E73E83 /* 
ViewProperties.swift */; };
-               39A356E01F8D077500C780F2 /* LibreOfficeKit.mm in Sources */ = 
{isa = PBXBuildFile; fileRef = 39A356DF1F8D077500C780F2 /* LibreOfficeKit.mm 
*/; };
                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 */; };
@@ -34,7 +34,6 @@
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
-               39022C191EDC14D300100066 /* lokit-Bridging-Header.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
"lokit-Bridging-Header.h"; sourceTree = "<group>"; };
                39022C1A1EDC2A0E00100066 /* program */ = {isa = 
PBXFileReference; lastKnownFileType = folder; name = program; path = 
../generated/resources/program; sourceTree = "<group>"; };
                39022C1C1EDC2A2C00100066 /* services */ = {isa = 
PBXFileReference; lastKnownFileType = folder; name = services; path = 
../generated/resources/services; sourceTree = "<group>"; };
                39022C1E1EDC2AB000100066 /* share */ = {isa = PBXFileReference; 
lastKnownFileType = folder; name = share; path = ../generated/resources/share; 
sourceTree = "<group>"; };
@@ -43,6 +42,8 @@
                392ED9B21E5E4B03005C8435 /* ViewPrintManager.swift */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name 
= ViewPrintManager.swift; path = LibreOfficeLight/ViewPrintManager.swift; 
sourceTree = SOURCE_ROOT; };
                393975771F8BECB0002DC80B /* libiconv.tbd */ = {isa = 
PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; 
name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
                393975791F8BECC1002DC80B /* libz.tbd */ = {isa = 
PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; 
name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
+               39503A6F1F94C4AC00F19C78 /* lokit-Bridging-Header.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
"lokit-Bridging-Header.h"; sourceTree = "<group>"; };
+               39503A741F94D44900F19C78 /* libc++.tbd */ = {isa = 
PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; 
name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
                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>"; };
                397868D71E59A3EA007F9248 /* en */ = {isa = PBXFileReference; 
lastKnownFileType = file.xib; name = en; path = en.lproj/LaunchScreen.xib; 
sourceTree = "<group>"; };
@@ -53,7 +54,6 @@
                3992D8591E5B762A00BEA987 /* DocumentController.swift */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; 
name = DocumentController.swift; path = 
LibreOfficeLight/DocumentController.swift; sourceTree = SOURCE_ROOT; };
                3992D85B1E5B764A00BEA987 /* SideMenu.swift */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name 
= SideMenu.swift; path = LibreOfficeLight/SideMenu.swift; sourceTree = 
SOURCE_ROOT; };
                399648461E5B87DC00E73E83 /* ViewProperties.swift */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name 
= ViewProperties.swift; path = LibreOfficeLight/ViewProperties.swift; 
sourceTree = SOURCE_ROOT; };
-               39A356DF1F8D077500C780F2 /* LibreOfficeKit.mm */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; 
path = LibreOfficeKit.mm; sourceTree = "<group>"; };
                39ACF4181F8A317600DA7334 /* loApp.xcconfig */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = 
loApp.xcconfig; path = 
../../../../../../../Users/jani/lo_ios/workdir/ios/loApp.xcconfig; sourceTree = 
"<group>"; };
                39B084E51E5F0BB400682A59 /* fundamentalrc */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = 
fundamentalrc; path = ../generated/resources/fundamentalrc; sourceTree = 
SOURCE_ROOT; };
                39B084E61E5F0BB400682A59 /* offapi.rdb */ = {isa = 
PBXFileReference; lastKnownFileType = file; name = offapi.rdb; path = 
../generated/resources/offapi.rdb; sourceTree = SOURCE_ROOT; };
@@ -70,6 +70,7 @@
                        isa = PBXFrameworksBuildPhase;
                        buildActionMask = 2147483647;
                        files = (
+                               39503A751F94D44900F19C78 /* libc++.tbd in 
Frameworks */,
                                3939757A1F8BECC1002DC80B /* libz.tbd in 
Frameworks */,
                                393975781F8BECB0002DC80B /* libiconv.tbd in 
Frameworks */,
                        );
@@ -95,6 +96,7 @@
                3972753A1E77D9F7006ACDCC /* Frameworks */ = {
                        isa = PBXGroup;
                        children = (
+                               39503A741F94D44900F19C78 /* libc++.tbd */,
                                393975791F8BECC1002DC80B /* libz.tbd */,
                                393975771F8BECB0002DC80B /* libiconv.tbd */,
                        );
@@ -123,8 +125,7 @@
                397E08FC1E597BD8001374E0 /* LibreOfficeLight */ = {
                        isa = PBXGroup;
                        children = (
-                               39A356DF1F8D077500C780F2 /* LibreOfficeKit.mm 
*/,
-                               39022C191EDC14D300100066 /* 
lokit-Bridging-Header.h */,
+                               39503A6F1F94C4AC00F19C78 /* 
lokit-Bridging-Header.h */,
                                397E08FD1E597BD8001374E0 /* AppDelegate.swift 
*/,
                                3992D85B1E5B764A00BEA987 /* SideMenu.swift */,
                                3992D8591E5B762A00BEA987 /* 
DocumentController.swift */,
@@ -256,7 +257,6 @@
                                399648471E5B87DC00E73E83 /* 
ViewProperties.swift in Sources */,
                                3992D85A1E5B762A00BEA987 /* 
DocumentController.swift in Sources */,
                                397E08FE1E597BD8001374E0 /* AppDelegate.swift 
in Sources */,
-                               39A356E01F8D077500C780F2 /* LibreOfficeKit.mm 
in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
@@ -366,6 +366,7 @@
                                OTHER_LDFLAGS = "$(LINK_LDFLAGS)";
                                SDKROOT = iphoneos;
                                SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+                               SWIFT_OBJC_BRIDGING_HEADER = 
"lokit-Bridging-Header.h";
                                SWIFT_OPTIMIZATION_LEVEL = "-Onone";
                                SWIFT_SWIFT3_OBJC_INFERENCE = Default;
                                SWIFT_VERSION = 4.0;
@@ -441,6 +442,7 @@
                                ONLY_ACTIVE_ARCH = YES;
                                OTHER_LDFLAGS = "$(LINK_LDFLAGS)";
                                SDKROOT = iphoneos;
+                               SWIFT_OBJC_BRIDGING_HEADER = 
"lokit-Bridging-Header.h";
                                SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
                                SWIFT_SWIFT3_OBJC_INFERENCE = Default;
                                SWIFT_VERSION = 4.0;
@@ -591,6 +593,7 @@
                                OTHER_LDFLAGS = "$(LINK_LDFLAGS)";
                                SDKROOT = iphoneos;
                                SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+                               SWIFT_OBJC_BRIDGING_HEADER = 
"lokit-Bridging-Header.h";
                                SWIFT_OPTIMIZATION_LEVEL = "-Onone";
                                SWIFT_SWIFT3_OBJC_INFERENCE = Default;
                                SWIFT_VERSION = 4.0;
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift 
b/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
index bd9c7cbafe59..466881aded13 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
@@ -38,6 +38,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate
 
         // start LibreOfficeKit
         BridgeLOkit_Init(Bundle.main.bundlePath)
+        BridgeLOkit_open("jan");
+        BridgeLOkit_ClientCommand("jan");
 
         // Override point for customization after application launch.
         return true
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/LibreOfficeKit.mm 
b/ios/LibreOfficeLight/LibreOfficeLight/LibreOfficeKit.mm
deleted file mode 100644
index 501c21cea8ae..000000000000
--- a/ios/LibreOfficeLight/LibreOfficeLight/LibreOfficeKit.mm
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// 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 <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>
-
-//#define NO_LO
-
-// generated by solenv/bin/native-code.py:
-#ifndef NO_LO
-#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;
-#endif
-
-
-
-
-// Bridge functions to LibreOfficeKit
-extern "C" int BridgeLOkit_Init(const char *path)
-{
-    char bufUserPath[200];
-    strcpy(bufUserPath, path);
-    strcpy(bufUserPath + strlen(path), "/user");
-
-    // Initialize LibreOfficeKit
-#ifndef NO_LO
-    if (!kit)
-      kit = lok_init_2(path, bufUserPath);
-#endif
-    return 0;
-}
-
-int LOkit_open(char *file)
-{
-#ifndef NO_LO
-    document = kit->pClass->documentLoad(kit, file);
-    document->pClass->initializeForRendering(document, "");
-#endif
-    return 0;
-}
-
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h 
b/ios/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h
index 9254f96c3545..2eaf8fed39a6 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h
+++ b/ios/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h
@@ -6,6 +6,4 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 //
 
-// Bridge functions to LibreOfficeKit
-int BridgeLOkit_Init(const char *path);
-int BridgeLOkit_ClientCommand(const char *input);
+#import "../LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h"
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to