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

jan Iversen jani at libreoffice.org
Sun Oct 29 10:21:46 UTC 2017


 ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c              |   23 ++-
 ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h              |    2 
 ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj |    4 
 ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift         |    4 
 ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift  |   74 ++++++----
 ios/LibreOfficeLight/LibreOfficeLight/dummyLOkit.c              |   48 ++++++
 6 files changed, 126 insertions(+), 29 deletions(-)

New commits:
commit adff3863890af26c9c3fb4fb5611c333c746fe61
Author: jan Iversen <jani at libreoffice.org>
Date:   Sun Oct 29 11:19:42 2017 +0100

    iOS, added dummy calls for LO
    
    In order to speed up UI work, a dummy source is added.
    
    Change-Id: Ic226b1365681ac65036729a672c97aa5579ed118

diff --git a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
index 986ce57cc1b2..fd71169bfa57 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
+++ b/ios/LibreOfficeLight/LibreOfficeLight.xcodeproj/project.pbxproj
@@ -12,6 +12,7 @@
 		39022C1F1EDC2AB000100066 /* share in Resources */ = {isa = PBXBuildFile; fileRef = 39022C1E1EDC2AB000100066 /* share */; };
 		39022C211EDC2D0800100066 /* icudt59l.dat in Resources */ = {isa = PBXBuildFile; fileRef = 39022C201EDC2D0800100066 /* icudt59l.dat */; };
 		39022C241EDC303200100066 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 39022C221EDC303200100066 /* InfoPlist.strings */; };
+		39284DB11FA5E150006F43E4 /* dummyLOkit.c in Sources */ = {isa = PBXBuildFile; fileRef = 39284DB01FA5E150006F43E4 /* dummyLOkit.c */; };
 		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 */; };
@@ -39,6 +40,7 @@
 		39022C1E1EDC2AB000100066 /* share */ = {isa = PBXFileReference; lastKnownFileType = folder; name = share; path = ../generated/resources/share; sourceTree = "<group>"; };
 		39022C201EDC2D0800100066 /* icudt59l.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = icudt59l.dat; path = ../generated/resources/icudt59l.dat; sourceTree = "<group>"; };
 		39022C231EDC303200100066 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		39284DB01FA5E150006F43E4 /* dummyLOkit.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = dummyLOkit.c; sourceTree = "<group>"; };
 		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; };
@@ -126,6 +128,7 @@
 			isa = PBXGroup;
 			children = (
 				39503A6F1F94C4AC00F19C78 /* lokit-Bridging-Header.h */,
+				39284DB01FA5E150006F43E4 /* dummyLOkit.c */,
 				397E08FD1E597BD8001374E0 /* AppDelegate.swift */,
 				3992D8591E5B762A00BEA987 /* DocumentController.swift */,
 				39EF4E2E1FA500C9001914AC /* PropertiesController.swift */,
@@ -254,6 +257,7 @@
 			files = (
 				392ED9B31E5E4B03005C8435 /* ViewPrintManager.swift in Sources */,
 				399648471E5B87DC00E73E83 /* ViewProperties.swift in Sources */,
+				39284DB11FA5E150006F43E4 /* dummyLOkit.c in Sources */,
 				3992D85A1E5B762A00BEA987 /* DocumentController.swift in Sources */,
 				397E08FE1E597BD8001374E0 /* AppDelegate.swift in Sources */,
 				39EF4E2F1FA500C9001914AC /* PropertiesController.swift in Sources */,
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift b/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
index 9bdc1fefa48e..31da9986b9f3 100644
--- a/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/AppDelegate.swift
@@ -25,7 +25,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate
     func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool
     {
         // called when started from another Application.
-        // Jan to be done
+        //FIXME
         return true
     }
 
@@ -46,7 +46,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate
         defaults.synchronize()
 
         // start LibreOfficeKit
-        //FIX BridgeLOkit_Init(Bundle.main.bundlePath)
+        BridgeLOkit_Init(Bundle.main.bundlePath)
         return true
     }
 
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
index c05da106344a..28f18b5afd66 100755
--- a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
@@ -15,6 +15,32 @@ import UIKit
 // It is a delegate class to recieve Menu events as well as file handling events
 class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewControllerDelegate
 {
+    // Handling of DocumentController
+    // this is normal functions every controller must implement
+
+
+    // called once controller is loaded
+    override func viewDidLoad()
+    {
+        super.viewDidLoad()
+        //FIXME
+        // we should load the document types, so we can use them for the open call
+        // let path = Bundle.main.path(forResource: "Info", ofType: "plist")
+        // let dict = NSDictionary(contentsOfFile: path!)
+        // let tableData = dict!.object(forKey: "CFBundleDocumentTypes")
+    }
+
+
+
+    // called when there is a memory constraint
+    override func didReceiveMemoryWarning()
+    {
+        super.didReceiveMemoryWarning()
+        // not used in this App
+    }
+
+
+
     // Handling of Background (hipernate)
     // iOS is not true multitasking, only 1 app can be active (foreground) at any time,
     // therefore apps frequently are moved to the background.
@@ -94,6 +120,10 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
         }
     }
 
+
+
+
+
     // var currentDocumentName : String?
 
 
@@ -177,25 +207,6 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
                 print("unknown menu" + String(tag))
         }
     }
-
-
-    override func viewDidLoad()
-    {
-        super.viewDidLoad()
-        // Do any additional setup after loading the view.
-
-        // let path = Bundle.main.path(forResource: "Info", ofType: "plist")
-        // let dict = NSDictionary(contentsOfFile: path!)
-        // let tableData = dict!.object(forKey: "CFBundleDocumentTypes")
-    }
-
-
-
-    override func didReceiveMemoryWarning()
-    {
-        super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
-    }
 }
 
 
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/dummyLOkit.c b/ios/LibreOfficeLight/LibreOfficeLight/dummyLOkit.c
new file mode 100644
index 000000000000..5063f0f1317e
--- /dev/null
+++ b/ios/LibreOfficeLight/LibreOfficeLight/dummyLOkit.c
@@ -0,0 +1,48 @@
+//
+// 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/.
+//
+
+
+// replaces LibreOfficeKit and thereby reducing turn around time, which is
+// favorized while working on pure UI issues
+// It can be turned on/off by adding/removing it from settings/build phases/compile sources
+
+int BridgeLOkit_Init(const char *path)
+{
+    (void)path;
+    return 0;
+}
+
+
+
+int BridgeLOkit_open(const char *path)
+{
+    (void)path;
+    return 0;
+}
+
+
+
+int BridgeLOkit_ClientCommand(const char *input)
+{
+    (void)input;
+    return 0;
+}
+
+
+
+int BridgeLOkit_Hipernate()
+{
+    return 0;
+}
+
+
+
+int BridgeLOkit_LeaveHipernate()
+{
+    return 0;
+}
commit cbe828b7f759969c0d70eb818fca62d67379e648
Author: jan Iversen <jani at libreoffice.org>
Date:   Sun Oct 29 11:05:39 2017 +0100

    iOS, move hipernate handling to LOkit interface
    
    Hipernate means stopping LOkit but of course saving first if a
    document is active
    
    and returning means starting LOkit again.
    
    for now the implementation is left as FIXME
    
    Change-Id: Id9ea2b056e87caec13c1d3fe82d4623ca3901ef2

diff --git a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c
index 59a1c217b514..a56daa71a09e 100644
--- a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c
+++ b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.c
@@ -57,5 +57,26 @@ int BridgeLOkit_open(const char *path)
 
 int BridgeLOkit_ClientCommand(const char *input)
 {
-  return 0;
+    return 0;
+}
+
+
+
+int BridgeLOkit_Hipernate()
+{
+    //FIXME
+    // check if document needs to be saved, to avoid data loss
+    // terminate all threads (basically terminate LOkit)
+    return 0;
 }
+
+
+
+int BridgeLOkit_LeaveHipernate()
+{
+    //FIXME
+    // restart LOkit
+    // reload document (it may have been changed by other programs, especially if iCloud
+    return 0;
+}
+
diff --git a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h
index b86156211893..56843ddfe0a2 100644
--- a/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h
+++ b/ios/LibreOfficeKit/LibreOfficeKit/LibreOfficeKit.h
@@ -14,3 +14,5 @@
 int BridgeLOkit_Init(const char *path);
 int BridgeLOkit_open(const char *path);
 int BridgeLOkit_ClientCommand(const char *input);
+int BridgeLOkit_Hipernate();
+int BridgeLOkit_LeaveHipernate();
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
index 39a49d2a01eb..c05da106344a 100755
--- a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
+++ b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
@@ -15,6 +15,28 @@ import UIKit
 // It is a delegate class to recieve Menu events as well as file handling events
 class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewControllerDelegate
 {
+    // Handling of Background (hipernate)
+    // iOS is not true multitasking, only 1 app can be active (foreground) at any time,
+    // therefore apps frequently are moved to the background.
+    // background really means hipernate by terminating all threads and solely keep the
+    // data
+
+    // Moving to hipernate
+    public func Hipernate() -> Void
+    {
+        BridgeLOkit_Hipernate()
+    }
+
+
+
+    // Moving back to foreground
+    public func LeaveHipernate() -> Void
+    {
+        BridgeLOkit_LeaveHipernate()
+    }
+
+
+
     // handling of PropertiesController
     // The PropertiesController is a left sidebar, that will scroll in when activated
     // The Controller handles manipulation of properties in the document
@@ -72,17 +94,6 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC
         }
     }
 
-
-
-    // Handling of Background (hipernate)
-    public func Hipernate() -> Void
-    {
-    }
-
-    public func LeaveHipernate() -> Void
-    {
-    }
-
     // var currentDocumentName : String?
 
 


More information about the Libreoffice-commits mailing list