summaryrefslogtreecommitdiff
path: root/ios/source
diff options
context:
space:
mode:
authorjan Iversen <jani@libreoffice.org>2018-01-05 22:53:57 +0100
committerjan Iversen <jani@libreoffice.org>2018-01-06 10:43:47 +0100
commit72db74239a0853df72f323e756d304cb3e5dae02 (patch)
treec9313424cff2332e4cff4c049bd3214e0bdbc321 /ios/source
parentf04ad5673a9de1eda94ed3ae5719d8b761da80bb (diff)
iOS, allow calls to LibreOfficeKit from swift
Extended the bridge to include original LibreOfficeKit.h as well as Kit pointer (set in init call) Change-Id: I5e96f2706ac4d1ee897b977d3322bdc1b91f1a0b
Diffstat (limited to 'ios/source')
-rw-r--r--ios/source/LibreOfficeKit.c9
-rw-r--r--ios/source/LibreOfficeKit.h14
2 files changed, 18 insertions, 5 deletions
diff --git a/ios/source/LibreOfficeKit.c b/ios/source/LibreOfficeKit.c
index cdd1c09a8ed5..841c19ceff26 100644
--- a/ios/source/LibreOfficeKit.c
+++ b/ios/source/LibreOfficeKit.c
@@ -7,14 +7,13 @@
//
#include <stdio.h>
#include <TargetConditionals.h>
-#define LOK_USE_UNSTABLE_API
+#define LOK_USE_UNSTABLE_API 1
+#include "LibreOfficeKit.h"
+
#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.h"
@@ -24,7 +23,7 @@ extern __attribute__((used)) void *libreofficekit_hook(const char *);
static __attribute__((used)) void *(*foop)(const char *) = libreofficekit_hook;
// pointers to our instance
-static LibreOfficeKit* kit;
+LibreOfficeKit* kit;
static LibreOfficeKitDocument* document;
diff --git a/ios/source/LibreOfficeKit.h b/ios/source/LibreOfficeKit.h
index 3c6498c06854..0f5ca6edc95f 100644
--- a/ios/source/LibreOfficeKit.h
+++ b/ios/source/LibreOfficeKit.h
@@ -18,3 +18,17 @@ int BridgeLOkit_open(const char *path);
int BridgeLOkit_ClientCommand(const char *input);
int BridgeLOkit_Hipernate(void);
int BridgeLOkit_LeaveHipernate(void);
+
+
+// Use LOK_USE_UNSTABLE_API to get access to the low level
+// LibreOfficeKit.
+// REMARK: There are no guarantee these functions will work !!
+// REMARK: BridgeLOkit_Init MUST be called, NOT the original init()
+
+#ifdef LOK_USE_UNSTABLE_API
+#include <LibreOfficeKit/LibreOfficeKit.h>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+
+extern LibreOfficeKit* kit;
+#endif
+