[Libreoffice-commits] core.git: ios/CustomTarget_iOS_link.mk ios/LibreOfficeLight ios/source

2018-01-29 Thread Jon Nermut
 ios/CustomTarget_iOS_link.mk|1 
 ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj |   49 
--
 ios/LibreOfficeLight/LibreOfficeLight/LOKit/LibreOfficeKitWrapper.swift |5 
-
 ios/source/LibreOfficeKit.c |7 
-
 ios/source/LibreOfficeKit.h |2 
 5 files changed, 49 insertions(+), 15 deletions(-)

New commits:
commit 671e67dfc24205a133dbbaf87bc7be9f3af56b3a
Author: Jon Nermut 
Date:   Wed Jan 24 22:00:52 2018 +1100

iOS: linker changes for on device

[ae490dd] iOS: add script to sym link the dylib to the right spot

Adds a shell script to symlink the right dylib into the build products 
folder,
which means we can reference libKit.dylib relative to that, rather than 
absolutely

[ba4c072] iOS: pass in user path

On device using appPath/user as the user directory causes a crash, as an 
app cannot write inside it's bundle. Instead, add a new param to pass the 
documents dir into the init.

[088ad49] iOS: linker changes to run on device

Change-Id: I16f5d85f3ca483df11b82108ee39c4ec461214f4
Reviewed-on: https://gerrit.libreoffice.org/48866
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/ios/CustomTarget_iOS_link.mk b/ios/CustomTarget_iOS_link.mk
index ab5ad721d8d7..ef6303a217d8 100644
--- a/ios/CustomTarget_iOS_link.mk
+++ b/ios/CustomTarget_iOS_link.mk
@@ -51,6 +51,7 @@ $(IOSKIT): $(IOSOBJ) $(IOSLIBS)
$(gb_CC) -dynamiclib \
-Xlinker -rpath -Xlinker @executable_path/Frameworks \
-Xlinker -rpath -Xlinker @loader_path/Frameworks \
+-install_name @rpath/libKit.dylib \
-dead_strip \
-Xlinker -export_dynamic \
-Xlinker -no_deduplicate \
diff --git a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj 
b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
index 856d8b353bfb..4310b7862e3b 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
@@ -13,7 +13,6 @@
39022C211EDC2D0800100066 /* icudt60l.dat in Resources */ = {isa 
= PBXBuildFile; fileRef = 39022C201EDC2D0800100066 /* icudt60l.dat */; };
39284DB31FA5F207006F43E4 /* DocumentActions.swift in Sources */ 
= {isa = PBXBuildFile; fileRef = 39284DB21FA5F207006F43E4 /* 
DocumentActions.swift */; };
392ED9B31E5E4B03005C8435 /* ViewPrintManager.swift in Sources 
*/ = {isa = PBXBuildFile; fileRef = 392ED9B21E5E4B03005C8435 /* 
ViewPrintManager.swift */; };
-   396C833F1FC9D89E008E662A /* libKit.dylib in Frameworks */ = 
{isa = PBXBuildFile; fileRef = 396C833E1FC9D89D008E662A /* libKit.dylib */; };
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 
*/; };
@@ -42,8 +41,24 @@
FCC2E4012004B65E00CEB504 /* example.odt in Resources */ = {isa 
= PBXBuildFile; fileRef = FCC2E4002004B65E00CEB504 /* example.odt */; };
FCC2E4032004B72700CEB504 /* Util.swift in Sources */ = {isa = 
PBXBuildFile; fileRef = FCC2E4022004B72700CEB504 /* Util.swift */; };
FCC2E4052004B74000CEB504 /* AsyncUtil.swift in Sources */ = 
{isa = PBXBuildFile; fileRef = FCC2E4042004B74000CEB504 /* AsyncUtil.swift */; 
};
+   FCC7651D201C7F8A007D190C /* libKit.dylib in Frameworks */ = 
{isa = PBXBuildFile; fileRef = FCC7651C201C7F8A007D190C /* libKit.dylib */; };
+   FCC7651E201C80A5007D190C /* libKit.dylib in Embed Libraries */ 
= {isa = PBXBuildFile; fileRef = FCC7651C201C7F8A007D190C /* libKit.dylib */; 
settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
 /* End PBXBuildFile section */
 
+/* Begin PBXCopyFilesBuildPhase section */
+   FC148CE420187F7800C349CA /* Embed Libraries */ = {
+   isa = PBXCopyFilesBuildPhase;
+   buildActionMask = 2147483647;
+   dstPath = "";
+   dstSubfolderSpec = 10;
+   files = (
+   FCC7651E201C80A5007D190C /* libKit.dylib in 
Embed Libraries */,
+   );
+   name = "Embed Libraries";
+   runOnlyForDeploymentPostprocessing = 0;
+   };
+/* End PBXCopyFilesBuildPhase section */
+
 /* Begin PBXFileReference section */
39022C1A1EDC2A0E0010

[Libreoffice-commits] core.git: ios/LibreOfficeLight

2018-01-23 Thread Jon Nermut
 ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj  |8 
 ios/LibreOfficeLight/LibreOfficeLight/ButtonScrollView.swift |  145 
++
 ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift   |   39 ++
 ios/LibreOfficeLight/LibreOfficeLight/LOKit/DocumentHolder.swift |   14 
 ios/LibreOfficeLight/LibreOfficeLight/UIViewExtensions.swift |   74 +
 ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard   |6 
 6 files changed, 281 insertions(+), 5 deletions(-)

New commits:
commit 810dfda5556c5e0f0cc65f01c9634996951fd3e5
Author: Jon Nermut 
Date:   Tue Jan 23 15:18:42 2018 +1100

iOS: implement tabs for spreadsheets

Change-Id: I210d68f013e56efd90da004891b872434ce65f68
Reviewed-on: https://gerrit.libreoffice.org/48368
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj 
b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
index 315d4d18151b..4897f40a1641 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
@@ -35,6 +35,8 @@
39EF4E2F1FA500C9001914AC /* PropertiesController.swift in 
Sources */ = {isa = PBXBuildFile; fileRef = 39EF4E2E1FA500C9001914AC /* 
PropertiesController.swift */; };
FC31D01E2012F65500E7F402 /* DocumentHolder.swift in Sources */ 
= {isa = PBXBuildFile; fileRef = FC31D01D2012F65500E7F402 /* 
DocumentHolder.swift */; };
FC31D0202012F6D300E7F402 /* RenderCache.swift in Sources */ = 
{isa = PBXBuildFile; fileRef = FC31D01F2012F6D300E7F402 /* RenderCache.swift 
*/; };
+   FC31D02B2013500E00E7F402 /* ButtonScrollView.swift in Sources 
*/ = {isa = PBXBuildFile; fileRef = FC31D02A2013500E00E7F402 /* 
ButtonScrollView.swift */; };
+   FC31D02D2015DE1700E7F402 /* UIViewExtensions.swift in Sources 
*/ = {isa = PBXBuildFile; fileRef = FC31D02C2015DE1700E7F402 /* 
UIViewExtensions.swift */; };
FCAB1CB82009DB6900F1CC34 /* DocumentOverlaysView.swift in 
Sources */ = {isa = PBXBuildFile; fileRef = FCAB1CB72009DB6900F1CC34 /* 
DocumentOverlaysView.swift */; };
FCC2E3FA2004A01500CEB504 /* Document.swift in Sources */ = {isa 
= PBXBuildFile; fileRef = FCC2E3F62004A01400CEB504 /* Document.swift */; };
FCC2E3FC2004A01500CEB504 /* LibreOfficeKitWrapper.swift in 
Sources */ = {isa = PBXBuildFile; fileRef = FCC2E3F82004A01400CEB504 /* 
LibreOfficeKitWrapper.swift */; };
@@ -87,6 +89,8 @@
FC31D0132012EE4A00E7F402 /* LibreOfficeKitTypes.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
LibreOfficeKitTypes.h; sourceTree = ""; };
FC31D01D2012F65500E7F402 /* DocumentHolder.swift */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.swift; path = 
DocumentHolder.swift; sourceTree = ""; };
FC31D01F2012F6D300E7F402 /* RenderCache.swift */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.swift; path = 
RenderCache.swift; sourceTree = ""; };
+   FC31D02A2013500E00E7F402 /* ButtonScrollView.swift */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.swift; path = 
ButtonScrollView.swift; sourceTree = ""; };
+   FC31D02C2015DE1700E7F402 /* UIViewExtensions.swift */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.swift; path = 
UIViewExtensions.swift; sourceTree = ""; };
FCAB1CB72009DB6900F1CC34 /* DocumentOverlaysView.swift */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = 
DocumentOverlaysView.swift; sourceTree = ""; };
FCC2E3F62004A01400CEB504 /* Document.swift */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path 
= Document.swift; sourceTree = ""; };
FCC2E3F82004A01400CEB504 /* LibreOfficeKitWrapper.swift */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.swift; path = LibreOfficeKitWrapper.swift; sourceTree = ""; };
@@ -172,11 +176,13 @@
39EE81531FA644E800B73AB8 /* Info.plist */,
39503A6F1F94C4AC00F19C78 /* 
lokit-Bridging-Header.h */,
397E08FD1E597BD8001374E0 /* AppDelegate.swift 
*/,
+   FC31D02A2013500E00E7F402 /* 
ButtonScrollView.swift */,
3992D8591E5B762A00BEA987 /* 
DocumentController.swift */,
FCAB1CB72009DB6900F1CC34 /* 
DocumentOverlaysView.swift */,
FCC2E3FE2004B59B00CEB504 /* 
DocumentTiledView.swift */,
39284DB21FA5F207006F43E4 /* 
DocumentActions.swift */,
   

[Libreoffice-commits] core.git: ios/LibreOfficeLight

2018-01-20 Thread Jon Nermut
 ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj  |   28 
 ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift   |4 
 ios/LibreOfficeLight/LibreOfficeLight/DocumentTiledView.swift|   65 +
 ios/LibreOfficeLight/LibreOfficeLight/LOKit/DocumentHolder.swift |  327 
+
 ios/LibreOfficeLight/LibreOfficeLight/LOKit/LOKitThread.swift|  350 
--
 ios/LibreOfficeLight/LibreOfficeLight/LOKit/RenderCache.swift|   78 ++
 6 files changed, 489 insertions(+), 363 deletions(-)

New commits:
commit a468fef9ac977e812e83e3cce462b75d8d24c64d
Author: Jon Nermut 
Date:   Sat Jan 20 17:08:43 2018 +1100

iOS: keep track of doc part

- implement swipe left/right and tap gestures for presentations
- move some classes to their own files

Change-Id: I3ddd3e17ec809c87097d5515f08038bbc969764f
Reviewed-on: https://gerrit.libreoffice.org/48231
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj 
b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
index 48174b80e271..315d4d18151b 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
@@ -33,6 +33,8 @@
39B091CE1E5F0BB800682A59 /* unorc in Resources */ = {isa = 
PBXBuildFile; fileRef = 39B08B9C1E5F0BB600682A59 /* unorc */; };
39E950531FC9842000D82C49 /* source in Resources */ = {isa = 
PBXBuildFile; fileRef = 39E950521FC9842000D82C49 /* source */; };
39EF4E2F1FA500C9001914AC /* PropertiesController.swift in 
Sources */ = {isa = PBXBuildFile; fileRef = 39EF4E2E1FA500C9001914AC /* 
PropertiesController.swift */; };
+   FC31D01E2012F65500E7F402 /* DocumentHolder.swift in Sources */ 
= {isa = PBXBuildFile; fileRef = FC31D01D2012F65500E7F402 /* 
DocumentHolder.swift */; };
+   FC31D0202012F6D300E7F402 /* RenderCache.swift in Sources */ = 
{isa = PBXBuildFile; fileRef = FC31D01F2012F6D300E7F402 /* RenderCache.swift 
*/; };
FCAB1CB82009DB6900F1CC34 /* DocumentOverlaysView.swift in 
Sources */ = {isa = PBXBuildFile; fileRef = FCAB1CB72009DB6900F1CC34 /* 
DocumentOverlaysView.swift */; };
FCC2E3FA2004A01500CEB504 /* Document.swift in Sources */ = {isa 
= PBXBuildFile; fileRef = FCC2E3F62004A01400CEB504 /* Document.swift */; };
FCC2E3FC2004A01500CEB504 /* LibreOfficeKitWrapper.swift in 
Sources */ = {isa = PBXBuildFile; fileRef = FCC2E3F82004A01400CEB504 /* 
LibreOfficeKitWrapper.swift */; };
@@ -77,6 +79,14 @@
39E950521FC9842000D82C49 /* source */ = {isa = 
PBXFileReference; lastKnownFileType = folder; name = source; path = ../source; 
sourceTree = ""; };
39EE81531FA644E800B73AB8 /* Info.plist */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = 
Info.plist; sourceTree = ""; };
39EF4E2E1FA500C9001914AC /* PropertiesController.swift */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.swift; path = PropertiesController.swift; sourceTree = ""; };
+   FC31D00E2012EE4A00E7F402 /* LibreOfficeKit.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
LibreOfficeKit.h; sourceTree = ""; };
+   FC31D00F2012EE4A00E7F402 /* LibreOfficeKit.hxx */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path 
= LibreOfficeKit.hxx; sourceTree = ""; };
+   FC31D0102012EE4A00E7F402 /* LibreOfficeKitEnums.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
LibreOfficeKitEnums.h; sourceTree = ""; };
+   FC31D0112012EE4A00E7F402 /* LibreOfficeKitGtk.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
LibreOfficeKitGtk.h; sourceTree = ""; };
+   FC31D0122012EE4A00E7F402 /* LibreOfficeKitInit.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
LibreOfficeKitInit.h; sourceTree = ""; };
+   FC31D0132012EE4A00E7F402 /* LibreOfficeKitTypes.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = 
LibreOfficeKitTypes.h; sourceTree = ""; };
+   FC31D01D2012F65500E7F402 /* DocumentHolder.swift */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.swift; path = 
DocumentHolder.swift; sourceTree = ""; };
+   FC31D01F2012F6D300E7F402 /* RenderCache.swift */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.swift; path = 
RenderCache.swift; sourceTree = ""; };
FCAB1CB72009DB6900F1CC34 /* DocumentOverlaysView.swift */ = 

[Libreoffice-commits] core.git: ios/LibreOfficeLight

2018-01-20 Thread Jon Nermut
 ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a41ec55c8c86f962392cd64edc382a6eae113cfd
Author: Jon Nermut 
Date:   Sat Jan 20 10:10:26 2018 +1100

iOS: Fix debugging in xcode by making include path non-recursive

it was picking up the wrong headers in the debugger

Change-Id: I0bf6a10504e3b3e9a6eb13355f3f8a4f63a15a1e
Reviewed-on: https://gerrit.libreoffice.org/48230
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj 
b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
index 9dfb847307cc..48174b80e271 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
@@ -489,7 +489,7 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
-   "$(PROJECT_DIR)/../../include/**",
+   "$(PROJECT_DIR)/../../include",
);
INFOPLIST_FILE = LibreOfficeLight/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
@@ -522,7 +522,7 @@
GCC_PREFIX_HEADER = 
"LibreOfficeLight/LibreOfficeLight-Prefix.pch";
HEADER_SEARCH_PATHS = (
"$(inherited)",
-   "$(PROJECT_DIR)/../../include/**",
+   "$(PROJECT_DIR)/../../include",
);
INFOPLIST_FILE = LibreOfficeLight/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
@@ -624,7 +624,7 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (
"$(inherited)",
-   "$(PROJECT_DIR)/../../include/**",
+   "$(PROJECT_DIR)/../../include",
);
INFOPLIST_FILE = LibreOfficeLight/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.2;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: desktop/source ios/LibreOfficeLight

2018-01-18 Thread Jon Nermut
 desktop/source/lib/init.cxx   |   18 ++
 ios/LibreOfficeLight/LibreOfficeLight/LOKit/Document.swift|6 +++
 ios/LibreOfficeLight/LibreOfficeLight/LOKit/LOKitThread.swift |   10 +
 ios/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h |2 +
 4 files changed, 36 insertions(+)

New commits:
commit 0c6cfea81e99a815c35b1a0e908a29bc6dc424f1
Author: Jon Nermut 
Date:   Thu Jan 18 20:38:00 2018 +1100

iOS: add a temporarily exposed function that calls 
CallbackFlushHandler::Invoke in order to manually flush the callback queue. To 
be reverted once the callback problem is solved.

Change-Id: I95273b8a01eec62f639edd6767f69e02a294d8aa
Reviewed-on: https://gerrit.libreoffice.org/48101
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5688dab671f6..db8a5c5142c9 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3802,4 +3802,22 @@ static void lo_destroy(LibreOfficeKit* pThis)
 
 }
 
+#ifdef IOS
+extern "C"
+{
+__attribute__((visibility("default")))
+{
+SolarMutexGuard aGuard;
+LibLODocument_Impl* pDocument = static_cast(pThis);
+
+int nOrigViewId = doc_getView(pThis);
+
+if (nOrigViewId >= 0 && pDocument->mpCallbackFlushHandlers[nOrigViewId])
+{
+pDocument->mpCallbackFlushHandlers[nOrigViewId]->Invoke();
+}
+}
+}
+#endif
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/LOKit/Document.swift 
b/ios/LibreOfficeLight/LibreOfficeLight/LOKit/Document.swift
index f708334f5c97..79e28d674595 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight/LOKit/Document.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/LOKit/Document.swift
@@ -536,6 +536,12 @@ open class Document
 {
 docClass.setViewLanguage(pDoc, id, language);
 }
+
+public func invokeHandlers()
+{
+temporaryHackToInvokeCallbackHandlers(pDoc)
+
+}
 
 }
 
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/LOKit/LOKitThread.swift 
b/ios/LibreOfficeLight/LibreOfficeLight/LOKit/LOKitThread.swift
index 314ef0355f3f..e8f60e0f2119 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight/LOKit/LOKitThread.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/LOKit/LOKitThread.swift
@@ -212,6 +212,15 @@ public class DocumentHolder
 {
 closure(self.doc)
 }
+self.invokeHandlers()
+}
+
+public func invokeHandlers()
+{
+LOKitThread.instance.async
+{
+self.doc.invokeHandlers()
+}
 }
 
 /// Gives sync access to the document - blocks until the closure runs.
@@ -220,6 +229,7 @@ public class DocumentHolder
 {
 return LOKitThread.instance.sync
 {
+self.invokeHandlers()
 return closure(self.doc)
 }
 }
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h 
b/ios/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h
index bc276e9d31e2..67feadb801f3 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h
+++ b/ios/LibreOfficeLight/LibreOfficeLight/lokit-Bridging-Header.h
@@ -12,3 +12,5 @@
 // as its own xCode project.
 #define LOK_USE_UNSTABLE_API
 #import "../../source/LibreOfficeKit.h"
+
+void temporaryHackToInvokeCallbackHandlers(LibreOfficeKitDocument* pThis);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: ios/LibreOfficeLight

2018-01-18 Thread Jon Nermut
 ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj |4 
 ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift  |   74 
+++
 ios/LibreOfficeLight/LibreOfficeLight/DocumentOverlaysView.swift|   68 
+++
 ios/LibreOfficeLight/LibreOfficeLight/DocumentTiledView.swift   |   62 
---
 ios/LibreOfficeLight/LibreOfficeLight/LOKit/Document.swift  |9 
 ios/LibreOfficeLight/LibreOfficeLight/LOKit/LOKitThread.swift   |  198 
+-
 ios/LibreOfficeLight/LibreOfficeLight/LOKit/LibreOfficeKitWrapper.swift |1 
 7 files changed, 361 insertions(+), 55 deletions(-)

New commits:
commit 80799ed83b5ba4b803224966737d7c040f17f5d9
Author: Jon Nermut 
Date:   Sat Jan 13 21:22:25 2018 +1100

iOS: keep track of the keyboard, and scroll the next search result into 
view. Reimplement RenderCache (+2 squashed commits)
Squashed commits:
[3c3f36f] iOS: quieten warnings
[8eae946] iOS: display search results in an overlay view

Change-Id: I04a38943d5a22b8e6a52ae854e65f01bf43fda7b
Reviewed-on: https://gerrit.libreoffice.org/48100
Reviewed-by: jan iversen 
Tested-by: jan iversen 

diff --git a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj 
b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
index a0b303ce58a4..9dfb847307cc 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
@@ -33,6 +33,7 @@
39B091CE1E5F0BB800682A59 /* unorc in Resources */ = {isa = 
PBXBuildFile; fileRef = 39B08B9C1E5F0BB600682A59 /* unorc */; };
39E950531FC9842000D82C49 /* source in Resources */ = {isa = 
PBXBuildFile; fileRef = 39E950521FC9842000D82C49 /* source */; };
39EF4E2F1FA500C9001914AC /* PropertiesController.swift in 
Sources */ = {isa = PBXBuildFile; fileRef = 39EF4E2E1FA500C9001914AC /* 
PropertiesController.swift */; };
+   FCAB1CB82009DB6900F1CC34 /* DocumentOverlaysView.swift in 
Sources */ = {isa = PBXBuildFile; fileRef = FCAB1CB72009DB6900F1CC34 /* 
DocumentOverlaysView.swift */; };
FCC2E3FA2004A01500CEB504 /* Document.swift in Sources */ = {isa 
= PBXBuildFile; fileRef = FCC2E3F62004A01400CEB504 /* Document.swift */; };
FCC2E3FC2004A01500CEB504 /* LibreOfficeKitWrapper.swift in 
Sources */ = {isa = PBXBuildFile; fileRef = FCC2E3F82004A01400CEB504 /* 
LibreOfficeKitWrapper.swift */; };
FCC2E3FD2004A01500CEB504 /* LOKitThread.swift in Sources */ = 
{isa = PBXBuildFile; fileRef = FCC2E3F92004A01400CEB504 /* LOKitThread.swift 
*/; };
@@ -76,6 +77,7 @@
39E950521FC9842000D82C49 /* source */ = {isa = 
PBXFileReference; lastKnownFileType = folder; name = source; path = ../source; 
sourceTree = ""; };
39EE81531FA644E800B73AB8 /* Info.plist */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = 
Info.plist; sourceTree = ""; };
39EF4E2E1FA500C9001914AC /* PropertiesController.swift */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.swift; path = PropertiesController.swift; sourceTree = ""; };
+   FCAB1CB72009DB6900F1CC34 /* DocumentOverlaysView.swift */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = 
DocumentOverlaysView.swift; sourceTree = ""; };
FCC2E3F62004A01400CEB504 /* Document.swift */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path 
= Document.swift; sourceTree = ""; };
FCC2E3F82004A01400CEB504 /* LibreOfficeKitWrapper.swift */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.swift; path = LibreOfficeKitWrapper.swift; sourceTree = ""; };
FCC2E3F92004A01400CEB504 /* LOKitThread.swift */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path 
= LOKitThread.swift; sourceTree = ""; };
@@ -161,6 +163,7 @@
39503A6F1F94C4AC00F19C78 /* 
lokit-Bridging-Header.h */,
397E08FD1E597BD8001374E0 /* AppDelegate.swift 
*/,
3992D8591E5B762A00BEA987 /* 
DocumentController.swift */,
+   FCAB1CB72009DB6900F1CC34 /* 
DocumentOverlaysView.swift */,
FCC2E3FE2004B59B00CEB504 /* 
DocumentTiledView.swift */,
39284DB21FA5F207006F43E4 /* 
DocumentActions.swift */,
39EF4E2E1FA500C9001914AC /* 
PropertiesController.swift */,
@@ -303,6 +306,7 @@
files = (
FCC2E4032004B72700CEB504 /* Util.swift in 
Sources */,
392ED9B31E5E4B03005C8435 /* 
ViewPrintManager.swift i

Jon Nermut license statement

2018-01-11 Thread Jon Nermut
All of my past & future contributions to LibreOffice may be
   licensed under the MPLv2/LGPLv3+ dual license.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: LibreOfficeLight / iOS

2018-01-01 Thread Jon Nermut
The tile rendering exception was caused by this path:

OUString VclBuilderContainer::getUIRootDir()

{

OUString sShareLayer(
"$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/config/soffice.cfg/");

rtl::Bootstrap::expandMacros(sShareLayer);

return sShareLayer;

}

In my build $BRAND_SHARE_SUBDIR
was not defined.
Manually adding BRAND_SHARE_SUBDIR=share
to fundamentalrc allowed me to render a tile using the CGContext based code
in the unit test, and save it to a png. Woohoo!

I'm not sure where that should be added?



On Mon, Jan 1, 2018 at 9:44 PM, Jon Nermut  wrote:

> Well a framework is effectively dylib *in a bundle*. For swift there is
> some special module stuff baked in too. So I also moved all the resources
> to the framework (hence the changes I made to look up the framework bundle
> instead of the main bundle to find the rc / unorc etc files.
>
> You're probably right that you should be able to spit out a dylib or a
> framework from ld - I've just spent *way* too much of my professional life
> fighting xcode on this kind of stuff that I'll always go with what the IDE
> says. Which these days is frameworks. But if you can get the .mk to produce
> a dylib and be able to use it the dev process will be better whether you
> use a framework to encapsulate the library or not.
>
> Does the dylib load at all on the device? Or does it give image not found
> error, or symbol not found? It's very sensitve to paths - both where the
> dylib is in the bundle (if you put it in the embed section it will be under
> /Frameworks/), and the runtime search path setting, which needs to include
> that location.
>
> NB our app which has an embedded framework wrapping the pdfium lib, has
> been in the appstore with that framework for at least a year.
>
> > My problem was more how to use the returned array in order to render it
> effectively
>
> So that was using the paintTile function? What did you pass into it - a
> CGContextRef or a byte array? Or is paintTile the wrong function to be
> calling entirely??
> If a CGContextRef (which is what it has to be, given this)
>
>
> static void doc_paintTile(LibreOfficeKitDocument* pThis,
>
>   unsigned char* pBuffer,
>
>   const int nCanvasWidth, const int nCanvasHeight,
>
>   const int nTilePosX, const int nTilePosY,
>
>   const int nTileWidth, const int nTileHeight)
>
> {
>
> ...
>
>
> #if defined(IOS)
>
> SystemGraphicsData aData;
>
> aData.rCGContext = reinterpret_cast(pBuffer);
>
> // the Size argument is irrelevant, I hope
>
> ScopedVclPtrInstance pDevice(&aData, Size(1, 1),
> DeviceFormat::DEFAULT);
>
>
> pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,
>
> nTilePosX, nTilePosY, nTileWidth, nTileHeight);
>
> #else
>
> then the overall way to get a UIImage is as per the POC code in
> DocumentController - set up a Image CGContext, do the render, then call
> UIGraphicsGetImageFromCurrentImageContext
>
> UIGraphicsBeginImageContextWithOptions(CGSize(width:
> canvasWidth, height: canvasHeight), false, 1.0)
>
>
>
> let ctx = UIGraphicsGetCurrentContext()
>
> print(ctx)
>
> let ptr = unsafeBitCast(ctx, to: UnsafeMutablePointer.
> self)
>
> print(ptr)
>
> doc.paintTile(pBuffer:ptr,
>
>   canvasWidth: Int32(canvasWidth),
>
>   canvasHeight: Int32(canvasHeight),
>
>   tilePosX: tilePosX,
>
>   tilePosY: tilePosY,
>
>   tileWidth: tileWidth,
>
>   tileHeight: tileHeight)
>
>
>
> let image = UIGraphicsGetImageFromCurrentImageContext()
>
> UIGraphicsEndImageContext()
>
> The unsafeBitCast in there is really just the reverse, (and just as
> horriable) of the reinterpret_cast in doc_paintTile
>
> Once you have a UIImage you can blat it to the screen in a UIImageView, or
> save it to disk etc.
> From memory to get a UIImage from a byte array you have to go via CGImage
>
> This is some sample code that goes from a byte buffer to a CGImage, then
> to a UIImage
>
> let buffer = FPDFBitmap_GetBuffer(bitmap)
>
> let bitsPerComponent = 8
>
> let bitsPerPixel = 32
>
> let bytesPerRow = 4 * width
>
> let colorSpaceRef = CGColorSpaceCreateDeviceRGB()
>
> let intent = CGColorRenderingIntent.defaultIntent
>
> let bitmapInfo = CGBitmapInfo.byteOrder32Little.union(CGBitmapInfo(rawValue:
> CGImageAlphaInfo

Re: LibreOfficeLight / iOS

2018-01-01 Thread Jon Nermut
Well a framework is effectively dylib *in a bundle*. For swift there is
some special module stuff baked in too. So I also moved all the resources
to the framework (hence the changes I made to look up the framework bundle
instead of the main bundle to find the rc / unorc etc files.

You're probably right that you should be able to spit out a dylib or a
framework from ld - I've just spent *way* too much of my professional life
fighting xcode on this kind of stuff that I'll always go with what the IDE
says. Which these days is frameworks. But if you can get the .mk to produce
a dylib and be able to use it the dev process will be better whether you
use a framework to encapsulate the library or not.

Does the dylib load at all on the device? Or does it give image not found
error, or symbol not found? It's very sensitve to paths - both where the
dylib is in the bundle (if you put it in the embed section it will be under
/Frameworks/), and the runtime search path setting, which needs to include
that location.

NB our app which has an embedded framework wrapping the pdfium lib, has
been in the appstore with that framework for at least a year.

> My problem was more how to use the returned array in order to render it
effectively

So that was using the paintTile function? What did you pass into it - a
CGContextRef or a byte array? Or is paintTile the wrong function to be
calling entirely??
If a CGContextRef (which is what it has to be, given this)


static void doc_paintTile(LibreOfficeKitDocument* pThis,

  unsigned char* pBuffer,

  const int nCanvasWidth, const int nCanvasHeight,

  const int nTilePosX, const int nTilePosY,

  const int nTileWidth, const int nTileHeight)

{

...


#if defined(IOS)

SystemGraphicsData aData;

aData.rCGContext = reinterpret_cast(pBuffer);

// the Size argument is irrelevant, I hope

ScopedVclPtrInstance pDevice(&aData, Size(1, 1),
DeviceFormat::DEFAULT);


pDoc->paintTile(*pDevice.get(), nCanvasWidth, nCanvasHeight,

nTilePosX, nTilePosY, nTileWidth, nTileHeight);

#else

then the overall way to get a UIImage is as per the POC code in
DocumentController - set up a Image CGContext, do the render, then call
UIGraphicsGetImageFromCurrentImageContext

UIGraphicsBeginImageContextWithOptions(CGSize(width:
canvasWidth, height: canvasHeight), false, 1.0)



let ctx = UIGraphicsGetCurrentContext()

print(ctx)

let ptr = unsafeBitCast(ctx, to: UnsafeMutablePointer.
self)

print(ptr)

doc.paintTile(pBuffer:ptr,

  canvasWidth: Int32(canvasWidth),

  canvasHeight: Int32(canvasHeight),

  tilePosX: tilePosX,

  tilePosY: tilePosY,

  tileWidth: tileWidth,

  tileHeight: tileHeight)



let image = UIGraphicsGetImageFromCurrentImageContext()

UIGraphicsEndImageContext()

The unsafeBitCast in there is really just the reverse, (and just as
horriable) of the reinterpret_cast in doc_paintTile

Once you have a UIImage you can blat it to the screen in a UIImageView, or
save it to disk etc.
>From memory to get a UIImage from a byte array you have to go via CGImage

This is some sample code that goes from a byte buffer to a CGImage, then to
a UIImage

let buffer = FPDFBitmap_GetBuffer(bitmap)

let bitsPerComponent = 8

let bitsPerPixel = 32

let bytesPerRow = 4 * width

let colorSpaceRef = CGColorSpaceCreateDeviceRGB()

let intent = CGColorRenderingIntent.defaultIntent

let bitmapInfo =
CGBitmapInfo.byteOrder32Little.union(CGBitmapInfo(rawValue:
CGImageAlphaInfo.noneSkipFirst.rawValue))

let cgImage = CGImage(width: width, height: height, bitsPerComponent:
bitsPerComponent, bitsPerPixel: bitsPerPixel, bytesPerRow: bytesPerRow,
space: colorSpaceRef, bitmapInfo: bitmapInfo, provider: provider!, decode:
nil, shouldInterpolate: false, intent: intent)


return UIImage(cgImage: cgImage, scale: 0.5, orientation: UIImageOrientation
.up)



I can see this stuff is used and working on Android, but there are quite a
few #ifdef IOS in there haven't been exercised in a while... And it's using
quite a different rendering mechanism drawing to a CGContext compared to
drawing to a byte buffer.




On Mon, Jan 1, 2018 at 8:31 PM, jan iversen  wrote:

> Happy new year, very interesting work.
>
> I have just updated my master, and now I see your problem with libassuan,
> which I am trying to solve. It is being build locally but not copied to the
> right place. I did a couple of commits yesterday to a.o. include your idea
> on how to make LIBRARY_PATH relative, thanks for that.
>
> > try the -r flag which is for prelinking. you can see that in the .mk
> file
>
>> Couldn't get that to do anything. I also tried -flto=thin which
>> supposedly can do increment

Re: LibreOfficeLight / iOS

2017-12-29 Thread Jon Nermut
Hi Jan,
The way I understand it is that the static libs, the .a files, aren't
actually linked yet - they are just an archive of .o object files collected
together.
When you link the app with the static lib it has to do a full read of the
symbols in the .a file and write the relevant ones into the executable.
There are 1.3 million symbols in the .a file (from nm libKit_X86_64_debug.a
| wc -l )
Adding -print_statistics to the linker flags gives this:

   ld total time:  894.4 seconds ( 100.0%)
 option parsing time:   11.0 milliseconds (   0.0%)
  object file processing:0.1 milliseconds (   0.0%)
 resolve symbols:  612.3 seconds (  68.4%)
 build atom list:0.0 milliseconds (   0.0%)
 passess:  486.3 milliseconds (   0.0%)
write output:  281.6 seconds (  31.4%)
pageins=447127, pageouts=2622, faults=3099715
processed   7 object files,  totaling 476,732 bytes
processed   2 archive files, totaling 456,642,248 bytes
processed  32 dylib files
wrote output filetotaling 324,771,884 bytes

Eg most of the time is spent reading symbols from the .a file, and then
writing them into the executable.
I also played around of using ld independantly of XCode and just trying to
link the .a file with no app and no swift involved - times were about the
same.
So to improve the linking of the .a file I think the main game would be
reducing the number of symbols in the .a. Probably not that practical.

So what I think you will get with a Framework project is actually linking
the .a file, seperately to the application executable. That means you won't
have that full link every time you build the app, but only when the
framework needs to build. That's the theory, anyway.

iOS has allowed dylibs since iOS 8 and the introduction of Swift. In fact
you can't produce a static lib with Swift, only a dylib.
For our Pdfium wrapper we produce a static lib out of the Pdfium code
itself, and link that in a framework project with the swift wrappers, to
produce a dylib which is a swift module that can be imported into an app.
Beside the linking benefits this then gives you a nice encapsulated library
that is easy to consume from swift.

If I have time over the next couple of days I'll have a go at creating a
framework to see if it does actually behave as I expect.

Cheers

Jon


On Sat, Dec 30, 2017 at 2:43 AM, jan iversen  wrote:

> Please do not misunderstand my comments, I am open to any enhancements
> especially on the linking process of the app...but I would like to see a
> benefit of the changes.
>
> rgds
> jan I.
>
> On 29 December 2017 at 09:36, Jon Nermut  wrote:
>
>> Thanks for the reply Jan.
>>
>> My main point about BridgeLOKit was that you don't really need to add
>> another FFI on top of the existing LibreOfficeKit.h FFI.
>> Swift can import and use the existing _LibreOfficeKit /
>> _LibreOfficeKitClass and _LibreOfficeKitDocument /
>> _LibreOfficeKitDocumentClass structs and their functions just fine. Swift
>> actually has excellent C integration (and non-existent C++). To do so I
>> just added:
>>
>> #define LOK_USE_UNSTABLE_API 1
>>
>> #import "../../../include/LibreOfficeKit/LibreOfficeKit.h"
>>
>> Into lokit-Bridging-Header.h, and the struct types mentioned above are
>> usable directly within Swift without anymore C needed
>> - LibreOfficeKitWrapper.swift is an example of using the functions from
>> these structs directly, and wrapping the C struct pointers in swift
>> classes, making them encapsulated and easier to use.
>> The exception being the lok_init functions, which need to be included and
>> called from within a C file.
>>
>> >> The LIBRARY_SEARCH_PATH should be overwritten by the xcconfig file,
>> but I will need to check that.
>>
>> Oh, I couldn't find it... where is it supposed to be generated to? I
>> changed the the path settings in LibreOfficeLight.xcodeproj like this:
>>
>> - LIBRARY_SEARCH_PATHS = /Users/jani/LO/core/ios/generated/;
>> + LIBRARY_SEARCH_PATHS = $PROJECT_DIR/../generated/;
>>
>> I tried a few settings on the linking, couldn't make it better. Need to
>> find a way to work out what its doing... I'll have more of a play.
>> My suggestion is to split the C integration, and it's swift wrappers,
>> into a separate Framework project, and let that produce a dylib.
>> That should link pretty much instantly to the app, and should only
>> rebuild and link when the libreoffice lib changes, or the code in the
>> Framework
>>
>> Cheers
>>
>> Jon
>>
>>
>> On Fri, Dec 29, 2017 at 6:38 PM, jan iversen  wrote:
>>
>>> Hi
>>>
>>> adding d

Re: LibreOfficeLight / iOS

2017-12-29 Thread Jon Nermut
y LibreOfficeKitInit works (which seems
>> weird...), for which I reused BridgeLOkit_Init and added a func to get
>> the pointer to kit out.
>> See the attached LibreOfficeKitWrapper.swift file - it has just a couple
>> wrapped functions done but you can see what I mean. Needs the rest filled
>> in and memory handling done.
>>
> Functions not declared in the bridge are unlikely to work in swift
> (according to the swift documentation).
>
>
>> I've done this before for Pdfium - which also has a C based FFI. We
>> created a framework called PdfiumSwift which had swift classes like
>> PDFDocument, PDFPage etc which wrapped the C interface and made consuming
>> it easy in Swift. We hooked the memory management off the swift deinit()
>> etc.  It used an internal private module to consume the C API so it was
>> just the Swift API exposed outside of the framework / module.
>>
> this is basically the same the kit project does, except it does not use
> classes.
>
> rgds
> jan i
>
>>
>> Once the basic wrapping is done, then these classes provide a good place
>> to add stuff like converting the raw tiles into iOS friendly bitmaps etc.
>>
>> Anyway, good job on getting it this far, and happy new year.
>>
>> Cheers
>>
>>
>> Jon Nermut
>>
> --
> Sent from My iPad, sorry for any misspellings.
>
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice