[Libreoffice-commits] online.git: Branch 'private/tml/ios-gen2' - 51 commits - common/AppDocument.cpp common/AppDocument.hpp common/Log.cpp common/Log.hpp common/Rectangle.hpp common/RenderTiles.hpp common/SigUtil.cpp common/SigUtil.hpp configure.ac cypress_test/data cypress_test/integration_tests cypress_test/package.json .gitignore gtk/Makefile.am ios/ios.h ios/ios.mm ios/Mobile ios/Mobile.xcodeproj kit/ForKit.cpp kit/Kit.cpp kit/Kit.hpp loleaflet/css loleaflet/images loleaflet/src loleaflet/util Makefile.am net/Socket.hpp net/WebSocketHandler.hpp test/TileCacheTests.cpp wsd/ClientSession.cpp wsd/ClientSession.hpp wsd/DocumentBroker.cpp wsd/DocumentBroker.hpp wsd/LOOLWSD.cpp wsd/TileCache.cpp wsd/TileCache.hpp wsd/TileDesc.hpp
Tor Lillqvist (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 15 10:56:48 UTC 2020
.gitignore | 3
Makefile.am | 1
common/AppDocument.cpp | 176 ++
common/AppDocument.hpp | 50
common/Log.cpp | 14
common/Log.hpp | 10
common/Rectangle.hpp | 60
common/RenderTiles.hpp | 775 ++++++++++
common/SigUtil.cpp | 17
common/SigUtil.hpp | 9
configure.ac | 8
cypress_test/data/mobile/impress/hamburger_menu.odp |binary
cypress_test/integration_tests/common/calc_helper.js | 2
cypress_test/integration_tests/common/helper.js | 2
cypress_test/integration_tests/common/impress_helper.js | 7
cypress_test/integration_tests/desktop/impress/slide_operations_spec.js | 14
cypress_test/integration_tests/mobile/calc/calc_mobile_helper.js | 5
cypress_test/integration_tests/mobile/calc/hamburger_menu_spec.js | 8
cypress_test/integration_tests/mobile/impress/apply_font_spec.js | 1
cypress_test/integration_tests/mobile/impress/apply_paragraph_props_spec.js | 1
cypress_test/integration_tests/mobile/impress/hamburger_menu_spec.js | 538 ++++++
cypress_test/integration_tests/mobile/impress/impress_mobile_helper.js | 10
cypress_test/integration_tests/mobile/writer/hamburger_menu_spec.js | 8
cypress_test/integration_tests/mobile/writer/shape_properties_spec.js | 4
cypress_test/package.json | 2
gtk/Makefile.am | 6
ios/Mobile.xcodeproj/project.pbxproj | 100 -
ios/Mobile/AppDelegate.h | 2
ios/Mobile/AppDelegate.mm | 72
ios/Mobile/COAppDocument.hpp | 32
ios/Mobile/COAppDocument.mm | 42
ios/Mobile/CODocument.h | 12
ios/Mobile/CODocument.mm | 49
ios/Mobile/DocumentBrowserViewController.mm | 1
ios/Mobile/DocumentViewController.mm | 114 -
ios/Mobile/TemplateCollectionViewController.mm | 5
ios/ios.h | 4
ios/ios.mm | 2
kit/ForKit.cpp | 31
kit/Kit.cpp | 641 --------
kit/Kit.hpp | 4
loleaflet/css/mobilewizard.css | 4
loleaflet/css/notebookbar.css | 14
loleaflet/css/spreadsheet.css | 2
loleaflet/css/toolbar.css | 16
loleaflet/images/lc_aligncenter.svg | 1
loleaflet/images/lc_aligndown.svg | 1
loleaflet/images/lc_alignmiddle.svg | 1
loleaflet/images/lc_alignup.svg | 1
loleaflet/images/lc_entergroup.svg | 1
loleaflet/images/lc_formatarea.svg | 1
loleaflet/images/lc_formatline.svg | 1
loleaflet/images/lc_leavegroup.svg | 1
loleaflet/images/lc_objectalignleft.svg | 1
loleaflet/images/lc_objectalignright.svg | 1
loleaflet/src/control/Control.ColumnHeader.js | 17
loleaflet/src/control/Control.ContextMenu.js | 2
loleaflet/src/control/Control.DocumentNameInput.js | 3
loleaflet/src/control/Control.Header.js | 2
loleaflet/src/control/Control.JSDialogBuilder.js | 4
loleaflet/src/control/Control.LokDialog.js | 2
loleaflet/src/control/Control.Menubar.js | 18
loleaflet/src/control/Control.MobileTopBar.js | 2
loleaflet/src/control/Control.MobileWizard.js | 2
loleaflet/src/control/Control.Notebookbar.js | 2
loleaflet/src/control/Control.NotebookbarBuilder.js | 16
loleaflet/src/control/Control.NotebookbarWriter.js | 6
loleaflet/src/control/Control.PartsPreview.js | 2
loleaflet/src/control/Control.PresentationBar.js | 2
loleaflet/src/control/Control.RowHeader.js | 17
loleaflet/src/control/Control.SearchBar.js | 4
loleaflet/src/control/Control.Tabs.js | 2
loleaflet/src/control/Control.Toolbar.js | 17
loleaflet/src/control/Control.UIManager.js | 16
loleaflet/src/control/Parts.js | 13
loleaflet/src/control/Permission.js | 19
loleaflet/src/control/Ruler.js | 4
loleaflet/src/control/Toolbar.js | 21
loleaflet/src/core/Socket.js | 2
loleaflet/src/layer/SplitPanesContext.js | 16
loleaflet/src/layer/marker/Annotation.js | 9
loleaflet/src/layer/marker/Cursor.js | 2
loleaflet/src/layer/marker/Marker.js | 13
loleaflet/src/layer/marker/TextInput.js | 2
loleaflet/src/layer/tile/CalcTileLayer.js | 49
loleaflet/src/layer/tile/CanvasTileLayer.js | 30
loleaflet/src/layer/tile/GridLayer.js | 2
loleaflet/src/layer/tile/TileLayer.TableOverlay.js | 2
loleaflet/src/layer/tile/TileLayer.js | 49
loleaflet/src/layer/vector/Polyline.js | 14
loleaflet/src/layer/vector/Renderer.js | 4
loleaflet/src/layer/vector/SplitPanesRenderer.js | 4
loleaflet/src/layer/vector/SplitPanesSVG.js | 6
loleaflet/src/layer/vector/SplitterLine.js | 15
loleaflet/src/map/Clipboard.js | 2
loleaflet/src/map/Map.js | 35
loleaflet/src/map/handler/Map.Keyboard.js | 4
loleaflet/src/map/handler/Map.Mouse.js | 2
loleaflet/src/map/handler/Map.TouchGesture.js | 4
loleaflet/src/map/handler/Map.WOPI.js | 4
loleaflet/util/create-l10n-all-js.pl | 8
net/Socket.hpp | 1
net/WebSocketHandler.hpp | 2
test/TileCacheTests.cpp | 9
wsd/ClientSession.cpp | 8
wsd/ClientSession.hpp | 2
wsd/DocumentBroker.cpp | 10
wsd/DocumentBroker.hpp | 7
wsd/LOOLWSD.cpp | 8
wsd/TileCache.cpp | 146 -
wsd/TileCache.hpp | 76
wsd/TileDesc.hpp | 19
112 files changed, 2354 insertions(+), 1293 deletions(-)
New commits:
commit c88646d1a542111b153126bf35db4942dff4a97d
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Jul 15 13:52:26 2020 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Jul 15 13:52:26 2020 +0300
Work in progress on a re-working of the iOS app plumbing
No more use of FakeSocket, yay.
Functionality still quite limited compared to the main branch. Many of
the messages sent by JS are ignored. Most callbacks from core are
ignored yet. But at least tiles show up.
The app is temporarily renamed in this branch while work is ongoing,
so that one can have both versions on the same device.
diff --git a/common/AppDocument.cpp b/common/AppDocument.cpp
new file mode 100644
index 000000000..635336e10
--- /dev/null
+++ b/common/AppDocument.cpp
@@ -0,0 +1,176 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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 <string>
+
+#include "AppDocument.hpp"
+#include "KitHelper.hpp"
+#include "Log.hpp"
+#include "Protocol.hpp"
+#include "RenderTiles.hpp"
+#include "Util.hpp"
+
+static void messageQueueThreadFunction(AppDocument *document)
+{
+ PngCache pngCache;
+ ThreadPool pngPool;
+
+ LOG_ERR("messageQueueThreadFunction " << document->getAppDocId() << " started");
+
+ Util::setThreadName("message_queue_" + std::to_string(document->getAppDocId()));
+
+ while (true) {
+ TileQueue::Payload message = document->getTileQueue()->get();
+ if (std::strcmp(message.data(), "closedocument") == 0)
+ break;
+
+ const std::string firstLine = LOOLProtocol::getFirstLine(message.data(), message.size());
+ const StringVector tokens = Util::tokenize(firstLine.data(), firstLine.size());
+ LOG_INF("Handling " << tokens[0]);
+ if (tokens.equals(0, "tile") ||
+ tokens.equals(0, "tilecombine"))
+ {
+ TileCombined tileCombined(TileCombined::parse(tokens));
+ if (!RenderTiles::doRender(document->getLoKitDoc(), tileCombined, pngCache, pngPool, false,
+ [&](unsigned char *,
+ int, int,
+ size_t, size_t,
+ int, int,
+ LibreOfficeKitTileMode) {
+ // Nothing
+ },
+ [&](const char *buffer, size_t length) {
+ document->sendMessageToJS(buffer, length);
+ }
+ ))
+ {
+ LOG_ERR("Rendering tiles failed");
+ }
+ }
+ else
+ {
+ LOG_ERR("Unhandled " << tokens[0]);
+ }
+ }
+ LOG_ERR("messageQueueThreadFunction " << document->getAppDocId() << " finishing");
+}
+
+std::atomic<int> AppDocument::appDocIdCounter(1);
+
+AppDocument::AppDocument(std::shared_ptr<lok::Office> theLoKit)
+ : loKit(theLoKit),
+ tileQueue(std::make_shared<TileQueue>()),
+ appDocId(appDocIdCounter++),
+ messageQueueThread(std::thread(messageQueueThreadFunction, this))
+{
+}
+
+static void docCallback(const int type, const char* p, void* data)
+{
+ LOG_INF("docCallback: " << lokCallbackTypeToString(type) << (p ? p : "(null"));
+
+ AppDocument* document = (AppDocument*)data;
+
+ switch (type) {
+ case LOK_CALLBACK_INVALIDATE_TILES:
+ break;
+ }
+}
+
+void AppDocument::handleProtocolMessage(const char* buffer, int length)
+{
+ const std::string firstLine = LOOLProtocol::getFirstLine(buffer, length);
+ const StringVector tokens = Util::tokenize(firstLine.data(), firstLine.size());
+
+ if (tokens.equals(0, "loolclient"))
+ {
+ if (tokens.size() < 2)
+ {
+ sendMessageToJS("error: cmd=loolclient kind=badprotocolversion");
+ return;
+ }
+
+ const std::tuple<int, int, std::string> versionTuple = LOOLProtocol::ParseVersion(tokens[1]);
+ if (std::get<0>(versionTuple) != LOOLProtocol::ProtocolMajorVersionNumber ||
+ std::get<1>(versionTuple) != LOOLProtocol::ProtocolMinorVersionNumber)
+ {
+ sendMessageToJS("error: cmd=loolclient kind=badprotocolversion");
+ return;
+ }
+
+ // Send LOOL version information
+ sendMessageToJS("loolserver " + Util::getVersionJSON());
+ // Send LOKit version information
+ sendMessageToJS("lokitversion " + std::string(loKit->getVersionInfo()));
+ }
+ else if (tokens.equals(0, "jserror"))
+ {
+ LOG_ERR(std::string(buffer, length));
+ return;
+ }
+ else if (tokens.equals(0, "load"))
+ {
+ loKitDoc.reset(loKit->documentLoad(getDocumentURL().c_str(), ""));
+ sendMessageToJS("statusindicator: find");
+ sendMessageToJS("statusindicator: connect");
+ sendMessageToJS("statusindicator: ready");
+ sendMessageToJS("loolserver " + Util::getVersionJSON());
+ sendMessageToJS("lokitversion " + std::string(loKit->getVersionInfo()));
+ sendMessageToJS("statusindicatorsetvalue: 100");
+ sendMessageToJS("statusindicatorstart:");
+ sendMessageToJS("status: " + LOKitHelper::documentStatus(loKitDoc->get()));
+ sendMessageToJS("statusindicatorfinish:");
+
+ loKitDoc->initializeForRendering("");
+ int viewId = loKitDoc->getView();
+ loKitDoc->setViewLanguage(viewId, getAppLocale().c_str());
+ loKitDoc->registerCallback(docCallback, this);
+ }
+ else if (tokens.equals(0, "closedocument") ||
+ tokens.equals(0, "tile") ||
+ tokens.equals(0, "tilecombine"))
+ {
+ tileQueue->put(std::string(buffer));
+ }
+ else if (tokens.equals(0, "canceltiles") ||
+ tokens.equals(0, "clientvisiblearea") ||
+ tokens.equals(0, "clientzoom") ||
+ tokens.equals(0, "renderfont") ||
+ tokens.equals(0, "save") ||
+ tokens.equals(0, "status") ||
+ tokens.equals(0, "statusupdate"))
+ {
+ LOG_WRN("Not yet implemented: " << tokens[0]);
+ }
+ else if (tokens.equals(0, "xxx"))
+ {
+ LOG_WRN("Ignoring: " << tokens[0]);
+ }
+ else
+ {
+ LOG_ERR("Unrecognized: " << tokens[0]);
+ }
+}
+
+std::shared_ptr<lok::Document> AppDocument::getLoKitDoc() const
+{
+ return loKitDoc;
+}
+
+std::shared_ptr<TileQueue> AppDocument::getTileQueue() const
+{
+ return tileQueue;
+}
+
+int AppDocument::getAppDocId() const
+{
+ return appDocId;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/common/AppDocument.hpp b/common/AppDocument.hpp
new file mode 100644
index 000000000..0de007042
--- /dev/null
+++ b/common/AppDocument.hpp
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+#include <thread>
+
+#define LOK_USE_UNSTABLE_API
+#include <LibreOfficeKit/LibreOfficeKit.hxx>
+
+#include "MessageQueue.hpp"
+#include "TileDesc.hpp"
+
+// The C++ document-specific data in the next-gen iOS (and Android?) app.
+class AppDocument
+{
+public:
+ AppDocument(std::shared_ptr<lok::Office> theLoKit);
+
+ void handleProtocolMessage(const char* buffer, int length);
+ std::shared_ptr<lok::Document> getLoKitDoc() const;
+ std::shared_ptr<TileQueue> getTileQueue() const;
+ int getAppDocId() const;
+
+ virtual void sendMessageToJS(std::string) = 0;
+ virtual void sendMessageToJS(const char* buffer, int length) = 0;
+
+protected:
+ virtual std::string getDocumentURL() = 0;
+ virtual std::string getAppLocale() = 0;
+
+private:
+ std::shared_ptr<lok::Office> loKit;
+ std::shared_ptr<lok::Document> loKitDoc;
+ std::shared_ptr<TileQueue> tileQueue;
+
+ static std::atomic<int> appDocIdCounter;
+ const int appDocId;
+ std::thread messageQueueThread;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ios/Mobile.xcodeproj/project.pbxproj b/ios/Mobile.xcodeproj/project.pbxproj
index a15dda8fc..924197d5f 100644
--- a/ios/Mobile.xcodeproj/project.pbxproj
+++ b/ios/Mobile.xcodeproj/project.pbxproj
@@ -17,19 +17,14 @@
BE18C7DE226DE09A001AD27E /* Branding in Resources */ = {isa = PBXBuildFile; fileRef = BE18C7DD226DE09A001AD27E /* Branding */; };
BE5EB5C1213FE29900E0826C /* Log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5B9213FE29900E0826C /* Log.cpp */; };
BE5EB5C2213FE29900E0826C /* SpookyV2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5BA213FE29900E0826C /* SpookyV2.cpp */; };
- BE5EB5C3213FE29900E0826C /* Session.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5BB213FE29900E0826C /* Session.cpp */; };
BE5EB5C4213FE29900E0826C /* Util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5BC213FE29900E0826C /* Util.cpp */; };
BE5EB5C5213FE29900E0826C /* MessageQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5BD213FE29900E0826C /* MessageQueue.cpp */; };
BE5EB5C6213FE29900E0826C /* SigUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5BE213FE29900E0826C /* SigUtil.cpp */; };
BE5EB5C7213FE29900E0826C /* Protocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5BF213FE29900E0826C /* Protocol.cpp */; };
- BE5EB5C8213FE29900E0826C /* FileUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5C0213FE29900E0826C /* FileUtil.cpp */; };
- BE5EB5CF213FE2D000E0826C /* ClientSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5CC213FE2D000E0826C /* ClientSession.cpp */; };
- BE5EB5D0213FE2D000E0826C /* TileCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5CD213FE2D000E0826C /* TileCache.cpp */; };
- BE5EB5D22140039100E0826C /* LOOLWSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5D12140039100E0826C /* LOOLWSD.cpp */; };
- BE5EB5D421400DC100E0826C /* DocumentBroker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5D321400DC100E0826C /* DocumentBroker.cpp */; };
- BE5EB5D621401E0F00E0826C /* Storage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5D521401E0F00E0826C /* Storage.cpp */; };
BE5EB5DA2140363100E0826C /* ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = BE5EB5D92140363100E0826C /* ios.mm */; };
BE5EB5DC2140480B00E0826C /* ICU.dat in Resources */ = {isa = PBXBuildFile; fileRef = BE5EB5DB2140480B00E0826C /* ICU.dat */; };
+ BE62A58724BEE1F600AFFD77 /* AppDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE62A58624BEE1F500AFFD77 /* AppDocument.cpp */; };
+ BE62A58A24BEE55200AFFD77 /* COAppDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = BE62A58924BEE55100AFFD77 /* COAppDocument.mm */; };
BE6362C22153B5B500F4237E /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE6362C12153B5B500F4237E /* MobileCoreServices.framework */; };
BE7228E22417BC9F000ADABD /* StringVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE7228E02417BC9F000ADABD /* StringVector.cpp */; };
BE7D6A6B23FAA8B500C2E605 /* loolkitconfig.xcu in Resources */ = {isa = PBXBuildFile; fileRef = BE7D6A6A23FAA8B500C2E605 /* loolkitconfig.xcu */; };
@@ -56,15 +51,8 @@
BE8D85D4214055F3009F1860 /* fundamentalrc in Resources */ = {isa = PBXBuildFile; fileRef = BE8D85C6214055F3009F1860 /* fundamentalrc */; };
BE8D85D5214055F3009F1860 /* unorc in Resources */ = {isa = PBXBuildFile; fileRef = BE8D85C7214055F3009F1860 /* unorc */; };
BE8D85D6214055F3009F1860 /* rc in Resources */ = {isa = PBXBuildFile; fileRef = BE8D85C8214055F3009F1860 /* rc */; };
- BEA2835621467FDD00848631 /* Kit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA2835521467FDD00848631 /* Kit.cpp */; };
- BEA283582146945500848631 /* ChildSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA283572146945500848631 /* ChildSession.cpp */; };
BEA2835A21470A1C00848631 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BEA2835921470A1C00848631 /* WebKit.framework */; };
- BEA2835D21498AD400848631 /* Socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA2835C21498AD400848631 /* Socket.cpp */; };
- BEA28360214ACA8500848631 /* FakeSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA2835F214ACA8500848631 /* FakeSocket.cpp */; };
- BEA28377214FFD8C00848631 /* Unit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEA28376214FFD8C00848631 /* Unit.cpp */; };
- BEABFC6824AC94C3004DE339 /* Authorization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEABFC6624AC94C3004DE339 /* Authorization.cpp */; };
BEB0E5D921C7CA800085A0CF /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = BEB0E5D821C7CA800085A0CF /* Settings.bundle */; };
- BEBF3EB0246EB1C800415E87 /* RequestDetails.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEBF3EAF246EB1C800415E87 /* RequestDetails.cpp */; };
BECD984024336DD400016117 /* device-mobile.css in Resources */ = {isa = PBXBuildFile; fileRef = BECD983E24336DD400016117 /* device-mobile.css */; };
BECD984124336DD400016117 /* device-tablet.css in Resources */ = {isa = PBXBuildFile; fileRef = BECD983F24336DD400016117 /* device-tablet.css */; };
BEDCC84E2452F82800FB02BD /* MobileApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BEDCC84C2452F82800FB02BD /* MobileApp.cpp */; };
@@ -80,6 +68,8 @@
BE00F89E21396585001CE2D4 /* images */ = {isa = PBXFileReference; lastKnownFileType = folder; name = images; path = ../../../loleaflet/dist/images; sourceTree = "<group>"; };
BE00F8B4213ED543001CE2D4 /* libiconv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libiconv.tbd; path = usr/lib/libiconv.tbd; sourceTree = SDKROOT; };
BE00F8B6213ED573001CE2D4 /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; };
+ BE04F4DA24B86E8E0079A1FB /* KitHelper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = KitHelper.hpp; sourceTree = "<group>"; };
+ BE04F4DB24B895780079A1FB /* TileDesc.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = TileDesc.hpp; sourceTree = "<group>"; };
BE18C7DD226DE09A001AD27E /* Branding */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Branding; path = Mobile/Branding; sourceTree = SOURCE_ROOT; };
BE28F880228CE04600C00C48 /* langselect.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = langselect.hxx; path = "../../ios-device/desktop/source/app/langselect.hxx"; sourceTree = "<group>"; };
BE28F881228CE04600C00C48 /* officeipcthread.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = officeipcthread.hxx; path = "../../ios-device/desktop/source/app/officeipcthread.hxx"; sourceTree = "<group>"; };
@@ -477,7 +467,6 @@
BE484B6E228CF36E001EE76C /* configvaluecontainer.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = configvaluecontainer.cxx; path = "../../ios-device/unotools/source/config/configvaluecontainer.cxx"; sourceTree = "<group>"; };
BE484B6F228CF36E001EE76C /* bootstrap.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = bootstrap.cxx; path = "../../ios-device/unotools/source/config/bootstrap.cxx"; sourceTree = "<group>"; };
BE484B70228CF36E001EE76C /* saveopt.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = saveopt.cxx; path = "../../ios-device/unotools/source/config/saveopt.cxx"; sourceTree = "<group>"; };
- BE484B71228D8622001EE76C /* DocumentBroker.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = DocumentBroker.hpp; sourceTree = "<group>"; };
BE484B732292AF96001EE76C /* frmload.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = frmload.cxx; path = "../../ios-device/sfx2/source/view/frmload.cxx"; sourceTree = "<group>"; };
BE484B742292AF96001EE76C /* sfxbasecontroller.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = sfxbasecontroller.cxx; path = "../../ios-device/sfx2/source/view/sfxbasecontroller.cxx"; sourceTree = "<group>"; };
BE484B752292AF96001EE76C /* frame.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = frame.cxx; path = "../../ios-device/sfx2/source/view/frame.cxx"; sourceTree = "<group>"; };
@@ -503,7 +492,6 @@
BE58E12C217F295B00249358 /* Util.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Util.hpp; sourceTree = "<group>"; };
BE58E12D217F295B00249358 /* MessageQueue.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = MessageQueue.hpp; sourceTree = "<group>"; };
BE58E12E217F295B00249358 /* Protocol.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Protocol.hpp; sourceTree = "<group>"; };
- BE58E12F217F295B00249358 /* Session.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Session.hpp; sourceTree = "<group>"; };
BE58E13021874A2E00249358 /* Mobile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Mobile.entitlements; sourceTree = "<group>"; };
BE58E132218793B500249358 /* svpbmp.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = svpbmp.cxx; path = "../../ios-device/vcl/headless/svpbmp.cxx"; sourceTree = "<group>"; };
BE58E133218793B500249358 /* svpglyphcache.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = svpglyphcache.cxx; path = "../../ios-device/vcl/headless/svpglyphcache.cxx"; sourceTree = "<group>"; };
@@ -519,20 +507,16 @@
BE58E13D218793B600249358 /* svpframe.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = svpframe.cxx; path = "../../ios-device/vcl/headless/svpframe.cxx"; sourceTree = "<group>"; };
BE5EB5B9213FE29900E0826C /* Log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Log.cpp; sourceTree = "<group>"; };
BE5EB5BA213FE29900E0826C /* SpookyV2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpookyV2.cpp; sourceTree = "<group>"; };
- BE5EB5BB213FE29900E0826C /* Session.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Session.cpp; sourceTree = "<group>"; };
BE5EB5BC213FE29900E0826C /* Util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Util.cpp; sourceTree = "<group>"; };
BE5EB5BD213FE29900E0826C /* MessageQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MessageQueue.cpp; sourceTree = "<group>"; };
BE5EB5BE213FE29900E0826C /* SigUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SigUtil.cpp; sourceTree = "<group>"; };
BE5EB5BF213FE29900E0826C /* Protocol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Protocol.cpp; sourceTree = "<group>"; };
- BE5EB5C0213FE29900E0826C /* FileUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileUtil.cpp; sourceTree = "<group>"; };
- BE5EB5CC213FE2D000E0826C /* ClientSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ClientSession.cpp; sourceTree = "<group>"; };
- BE5EB5CD213FE2D000E0826C /* TileCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TileCache.cpp; sourceTree = "<group>"; };
- BE5EB5D12140039100E0826C /* LOOLWSD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LOOLWSD.cpp; sourceTree = "<group>"; };
- BE5EB5D321400DC100E0826C /* DocumentBroker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentBroker.cpp; sourceTree = "<group>"; };
- BE5EB5D521401E0F00E0826C /* Storage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Storage.cpp; sourceTree = "<group>"; };
BE5EB5D92140363100E0826C /* ios.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ios.mm; path = ../../ios/ios.mm; sourceTree = "<group>"; };
BE5EB5DB2140480B00E0826C /* ICU.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = ICU.dat; path = ../../../ICU.dat; sourceTree = "<group>"; };
- BE636210215101D000F4237E /* WebSocketHandler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = WebSocketHandler.hpp; sourceTree = "<group>"; };
+ BE62A58524BEE1F500AFFD77 /* AppDocument.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = AppDocument.hpp; sourceTree = "<group>"; };
+ BE62A58624BEE1F500AFFD77 /* AppDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDocument.cpp; sourceTree = "<group>"; };
+ BE62A58824BEE55100AFFD77 /* COAppDocument.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = COAppDocument.hpp; sourceTree = "<group>"; };
+ BE62A58924BEE55100AFFD77 /* COAppDocument.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = COAppDocument.mm; sourceTree = "<group>"; };
BE6362C12153B5B500F4237E /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
BE7228E02417BC9F000ADABD /* StringVector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringVector.cpp; sourceTree = "<group>"; };
BE7228E12417BC9F000ADABD /* StringVector.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = StringVector.hpp; sourceTree = "<group>"; };
@@ -779,7 +763,7 @@
BE8C03C32242BA680048B7EA /* appdata.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = appdata.cxx; path = "../../ios-device/sfx2/source/appl/appdata.cxx"; sourceTree = "<group>"; };
BE8C03C42242BA680048B7EA /* shellimpl.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = shellimpl.cxx; path = "../../ios-device/sfx2/source/appl/shellimpl.cxx"; sourceTree = "<group>"; };
BE8C03C52242BA680048B7EA /* panelist.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = panelist.hxx; path = "../../ios-device/sfx2/source/appl/panelist.hxx"; sourceTree = "<group>"; };
- BE8D77272136762500AC58EA /* Mobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Mobile.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BE8D77272136762500AC58EA /* Collabora Office2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Collabora Office2.app"; sourceTree = BUILT_PRODUCTS_DIR; };
BE8D772A2136762500AC58EA /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
BE8D772B2136762500AC58EA /* AppDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = "<group>"; };
BE8D772D2136762500AC58EA /* DocumentBrowserViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DocumentBrowserViewController.h; sourceTree = "<group>"; };
@@ -975,14 +959,7 @@
BE93D46A216D5582007A39F4 /* watermarkitem.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = watermarkitem.cxx; path = "../../ios-device/sfx2/source/doc/watermarkitem.cxx"; sourceTree = "<group>"; };
BE93D46B216D5582007A39F4 /* new.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = new.cxx; path = "../../ios-device/sfx2/source/doc/new.cxx"; sourceTree = "<group>"; };
BE93D46C216D5582007A39F4 /* objembed.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = objembed.cxx; path = "../../ios-device/sfx2/source/doc/objembed.cxx"; sourceTree = "<group>"; };
- BEA2835521467FDD00848631 /* Kit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Kit.cpp; sourceTree = "<group>"; };
- BEA283572146945500848631 /* ChildSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ChildSession.cpp; sourceTree = "<group>"; };
BEA2835921470A1C00848631 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
- BEA2835C21498AD400848631 /* Socket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Socket.cpp; path = ../net/Socket.cpp; sourceTree = "<group>"; };
- BEA2835E214A8E2000848631 /* Socket.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Socket.hpp; sourceTree = "<group>"; };
- BEA2835F214ACA8500848631 /* FakeSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FakeSocket.cpp; sourceTree = "<group>"; };
- BEA28376214FFD8C00848631 /* Unit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Unit.cpp; sourceTree = "<group>"; };
- BEA283782150172600848631 /* Unit.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Unit.hpp; sourceTree = "<group>"; };
BEA8CD7421959342009FE17E /* caserotate.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = caserotate.cxx; path = "../../ios-device/unotools/source/i18n/caserotate.cxx"; sourceTree = "<group>"; };
BEA8CD7521959342009FE17E /* intlwrapper.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = intlwrapper.cxx; path = "../../ios-device/unotools/source/i18n/intlwrapper.cxx"; sourceTree = "<group>"; };
BEA8CD7621959342009FE17E /* transliterationwrapper.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = transliterationwrapper.cxx; path = "../../ios-device/unotools/source/i18n/transliterationwrapper.cxx"; sourceTree = "<group>"; };
@@ -997,8 +974,6 @@
BEA8CDC32199AC9D009FE17E /* lok.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = lok.cxx; path = "../../ios-device/comphelper/source/misc/lok.cxx"; sourceTree = "<group>"; };
BEA8CDC52199E621009FE17E /* languagetagicu.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = languagetagicu.cxx; path = "../../ios-device/i18nlangtag/source/languagetag/languagetagicu.cxx"; sourceTree = "<group>"; };
BEA8CDC62199E621009FE17E /* languagetag.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = languagetag.cxx; path = "../../ios-device/i18nlangtag/source/languagetag/languagetag.cxx"; sourceTree = "<group>"; };
- BEABFC6624AC94C3004DE339 /* Authorization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Authorization.cpp; sourceTree = "<group>"; };
- BEABFC6724AC94C3004DE339 /* Authorization.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Authorization.hpp; sourceTree = "<group>"; };
BEB0E5D821C7CA800085A0CF /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
BEB0E5DB21CA7C780085A0CF /* graphicfilter.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = graphicfilter.cxx; path = "../../ios-device/vcl/source/filter/graphicfilter.cxx"; sourceTree = "<group>"; };
BEB0E5E021CA9DC00085A0CF /* salbmp.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = salbmp.cxx; path = "../../ios-device/vcl/quartz/salbmp.cxx"; sourceTree = "<group>"; };
@@ -1060,8 +1035,6 @@
BEB6524E216FD0CA00B8C09A /* stream.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = stream.cxx; path = "../../ios-device/tools/source/stream/stream.cxx"; sourceTree = "<group>"; };
BEB6524F216FD0CA00B8C09A /* strmwnt.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = strmwnt.cxx; path = "../../ios-device/tools/source/stream/strmwnt.cxx"; sourceTree = "<group>"; };
BEB65250216FD0CA00B8C09A /* strmunx.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = strmunx.cxx; path = "../../ios-device/tools/source/stream/strmunx.cxx"; sourceTree = "<group>"; };
- BEBF3EAE246EB1C800415E87 /* RequestDetails.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RequestDetails.hpp; sourceTree = "<group>"; };
- BEBF3EAF246EB1C800415E87 /* RequestDetails.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RequestDetails.cpp; sourceTree = "<group>"; };
BECBD30323D7152900DA5582 /* SlsFramePainter.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SlsFramePainter.cxx; path = "../../ios-device/sd/source/ui/slidesorter/view/SlsFramePainter.cxx"; sourceTree = "<group>"; };
BECBD30423D7152900DA5582 /* SlideSorterView.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SlideSorterView.cxx; path = "../../ios-device/sd/source/ui/slidesorter/view/SlideSorterView.cxx"; sourceTree = "<group>"; };
BECBD30523D7152900DA5582 /* SlsFramePainter.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = SlsFramePainter.hxx; path = "../../ios-device/sd/source/ui/slidesorter/view/SlsFramePainter.hxx"; sourceTree = "<group>"; };
@@ -1889,9 +1862,8 @@
BE5EB5B6213FE21000E0826C /* common */ = {
isa = PBXGroup;
children = (
- BEABFC6624AC94C3004DE339 /* Authorization.cpp */,
- BEABFC6724AC94C3004DE339 /* Authorization.hpp */,
- BE5EB5C0213FE29900E0826C /* FileUtil.cpp */,
+ BE62A58624BEE1F500AFFD77 /* AppDocument.cpp */,
+ BE62A58524BEE1F500AFFD77 /* AppDocument.hpp */,
BE5EB5B9213FE29900E0826C /* Log.cpp */,
BE58E129217F295B00249358 /* Log.hpp */,
BE5EB5BD213FE29900E0826C /* MessageQueue.cpp */,
@@ -1901,15 +1873,11 @@
BE58E12A217F295B00249358 /* Png.hpp */,
BE5EB5BF213FE29900E0826C /* Protocol.cpp */,
BE58E12E217F295B00249358 /* Protocol.hpp */,
- BE5EB5BB213FE29900E0826C /* Session.cpp */,
- BE58E12F217F295B00249358 /* Session.hpp */,
BE5EB5BE213FE29900E0826C /* SigUtil.cpp */,
BE58E12B217F295B00249358 /* SigUtil.hpp */,
BE5EB5BA213FE29900E0826C /* SpookyV2.cpp */,
BE7228E02417BC9F000ADABD /* StringVector.cpp */,
BE7228E12417BC9F000ADABD /* StringVector.hpp */,
- BEA28376214FFD8C00848631 /* Unit.cpp */,
- BEA283782150172600848631 /* Unit.hpp */,
BE5EB5BC213FE29900E0826C /* Util.cpp */,
BE58E12C217F295B00249358 /* Util.hpp */,
);
@@ -1919,14 +1887,7 @@
BE5EB5B7213FE21600E0826C /* wsd */ = {
isa = PBXGroup;
children = (
- BEBF3EAF246EB1C800415E87 /* RequestDetails.cpp */,
- BEBF3EAE246EB1C800415E87 /* RequestDetails.hpp */,
- BE5EB5CC213FE2D000E0826C /* ClientSession.cpp */,
- BE5EB5D321400DC100E0826C /* DocumentBroker.cpp */,
- BE484B71228D8622001EE76C /* DocumentBroker.hpp */,
- BE5EB5D12140039100E0826C /* LOOLWSD.cpp */,
- BE5EB5D521401E0F00E0826C /* Storage.cpp */,
- BE5EB5CD213FE2D000E0826C /* TileCache.cpp */,
+ BE04F4DB24B895780079A1FB /* TileDesc.hpp */,
);
name = wsd;
path = ../wsd;
@@ -2268,7 +2229,7 @@
BE8D77282136762500AC58EA /* Products */ = {
isa = PBXGroup;
children = (
- BE8D77272136762500AC58EA /* Mobile.app */,
+ BE8D77272136762500AC58EA /* Collabora Office2.app */,
);
name = Products;
sourceTree = "<group>";
@@ -2276,6 +2237,8 @@
BE8D77292136762500AC58EA /* Mobile */ = {
isa = PBXGroup;
children = (
+ BE62A58824BEE55100AFFD77 /* COAppDocument.hpp */,
+ BE62A58924BEE55100AFFD77 /* COAppDocument.mm */,
BE58E13021874A2E00249358 /* Mobile.entitlements */,
BE5EB5D92140363100E0826C /* ios.mm */,
BE00F8922139494E001CE2D4 /* Resources */,
@@ -2538,8 +2501,7 @@
BEA2835421467F8200848631 /* kit */ = {
isa = PBXGroup;
children = (
- BEA283572146945500848631 /* ChildSession.cpp */,
- BEA2835521467FDD00848631 /* Kit.cpp */,
+ BE04F4DA24B86E8E0079A1FB /* KitHelper.hpp */,
);
name = kit;
path = ../kit;
@@ -2548,10 +2510,6 @@
BEA2835B21498ABF00848631 /* net */ = {
isa = PBXGroup;
children = (
- BEA2835F214ACA8500848631 /* FakeSocket.cpp */,
- BEA2835C21498AD400848631 /* Socket.cpp */,
- BEA2835E214A8E2000848631 /* Socket.hpp */,
- BE636210215101D000F4237E /* WebSocketHandler.hpp */,
);
name = net;
path = ../net;
@@ -2957,7 +2915,7 @@
);
name = Mobile;
productName = Mobile;
- productReference = BE8D77272136762500AC58EA /* Mobile.app */;
+ productReference = BE8D77272136762500AC58EA /* Collabora Office2.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@@ -3040,36 +2998,24 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- BEA2835D21498AD400848631 /* Socket.cpp in Sources */,
BE5EB5C4213FE29900E0826C /* Util.cpp in Sources */,
- BEA283582146945500848631 /* ChildSession.cpp in Sources */,
BE80E45E21B6CEF200859C97 /* TemplateSectionHeaderView.m in Sources */,
- BE5EB5C3213FE29900E0826C /* Session.cpp in Sources */,
- BE5EB5D22140039100E0826C /* LOOLWSD.cpp in Sources */,
BEFB1EE121C29CC70081D757 /* L10n.mm in Sources */,
BEDCC8992456FFAD00FB02BD /* SceneDelegate.m in Sources */,
BE5EB5C6213FE29900E0826C /* SigUtil.cpp in Sources */,
BE5EB5C1213FE29900E0826C /* Log.cpp in Sources */,
BEDCC84E2452F82800FB02BD /* MobileApp.cpp in Sources */,
BE5EB5DA2140363100E0826C /* ios.mm in Sources */,
- BE5EB5D421400DC100E0826C /* DocumentBroker.cpp in Sources */,
- BEA28377214FFD8C00848631 /* Unit.cpp in Sources */,
- BE5EB5CF213FE2D000E0826C /* ClientSession.cpp in Sources */,
- BEBF3EB0246EB1C800415E87 /* RequestDetails.cpp in Sources */,
BE5EB5C2213FE29900E0826C /* SpookyV2.cpp in Sources */,
BE8D77402136762600AC58EA /* main.m in Sources */,
- BE5EB5C8213FE29900E0826C /* FileUtil.cpp in Sources */,
- BEABFC6824AC94C3004DE339 /* Authorization.cpp in Sources */,
- BEA28360214ACA8500848631 /* FakeSocket.cpp in Sources */,
+ BE62A58724BEE1F600AFFD77 /* AppDocument.cpp in Sources */,
BE80E45821B68F5700859C97 /* TemplateCollectionViewController.mm in Sources */,
BE8D77352136762500AC58EA /* CODocument.mm in Sources */,
BE5EB5C7213FE29900E0826C /* Protocol.cpp in Sources */,
BE8D772F2136762500AC58EA /* DocumentBrowserViewController.mm in Sources */,
- BE5EB5D0213FE2D000E0826C /* TileCache.cpp in Sources */,
BE5EB5C5213FE29900E0826C /* MessageQueue.cpp in Sources */,
+ BE62A58A24BEE55200AFFD77 /* COAppDocument.mm in Sources */,
BE7228E22417BC9F000ADABD /* StringVector.cpp in Sources */,
- BE5EB5D621401E0F00E0826C /* Storage.cpp in Sources */,
- BEA2835621467FDD00848631 /* Kit.cpp in Sources */,
BE8D77322136762500AC58EA /* DocumentViewController.mm in Sources */,
BE8D772C2136762500AC58EA /* AppDelegate.mm in Sources */,
);
@@ -3265,8 +3211,8 @@
"-lPocoJSONd",
"-lPocoNetd",
);
- PRODUCT_BUNDLE_IDENTIFIER = com.collabora.office.Mobile;
- PRODUCT_NAME = "$(TARGET_NAME)";
+ PRODUCT_BUNDLE_IDENTIFIER = com.collabora.office.Mobile2;
+ PRODUCT_NAME = "Collabora Office2";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
@@ -3324,8 +3270,8 @@
"-lPocoJSONd",
"-lPocoNetd",
);
- PRODUCT_BUNDLE_IDENTIFIER = com.collabora.office.Mobile;
- PRODUCT_NAME = "$(TARGET_NAME)";
+ PRODUCT_BUNDLE_IDENTIFIER = com.collabora.office.Mobile2;
+ PRODUCT_NAME = "Collabora Office2";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
diff --git a/ios/Mobile/AppDelegate.h b/ios/Mobile/AppDelegate.h
index 58c09bf46..cc6d4a629 100644
--- a/ios/Mobile/AppDelegate.h
+++ b/ios/Mobile/AppDelegate.h
@@ -8,8 +8,6 @@
#import <UIKit/UIKit.h>
-#import <LibreOfficeKit/LibreOfficeKit.h>
-
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index d6962b840..b66c38186 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -9,14 +9,14 @@
#import "config.h"
#import <cassert>
-#import <cstdlib>
-#import <cstring>
+#import <thread>
+#define LOK_USE_UNSTABLE_API
#import <LibreOfficeKit/LibreOfficeKit.hxx>
#define LIBO_INTERNAL_ONLY
-#include <comphelper/lok.hxx>
-#include <i18nlangtag/languagetag.hxx>
+#import <comphelper/lok.hxx>
+#import <i18nlangtag/languagetag.hxx>
#import "ios.h"
#import "AppDelegate.h"
@@ -24,10 +24,7 @@
#import "CODocument.h"
#import "DocumentViewController.h"
-#import "FakeSocket.hpp"
-#import "Kit.hpp"
#import "Log.hpp"
-#import "LOOLWSD.hpp"
#import "SetupKitEnvironment.hpp"
#import "Util.hpp"
@@ -179,6 +176,44 @@ static void updateTemplates(NSData *data, NSURLResponse *response)
}
}
+static int pollCallback(void* pData, int timeoutUs)
+{
+ std::this_thread::sleep_for(std::chrono::microseconds(timeoutUs));
+
+ return 0;
+}
+
+static void wakeCallback(void* pData)
+{
+}
+
+// We can have several documents open in the app process at the same time, thus
+// several lokit_main() functions running at the same time. We want just one LO main loop, though,
+// so we start it separately in its own thread.
+
+static void runKitLoopInAThread()
+{
+ std::thread([&]
+ {
+ Util::setThreadName("lokit_runloop");
+
+ int dummy;
+ lo_kit->runLoop(pollCallback, wakeCallback, &dummy);
+
+ // Should never return
+ assert(false);
+
+ NSLog(@"LOOLWSD::runLoop() unexpectedly returned");
+
+ std::abort();
+ }).detach();
+}
+
+static void kitCallback(const int type, const char* p, void* data)
+{
+ NSLog(@"kitCallback: %s %s", lokCallbackTypeToString(type), (p ? p : "(null)"));
+}
+
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
@@ -201,7 +236,9 @@ static void updateTemplates(NSData *data, NSURLResponse *response)
else
app_locale = [[NSLocale preferredLanguages] firstObject];
- lo_kit = lok_init_2(nullptr, nullptr);
+ lo_kit.reset(lok::lok_cpp_init(nullptr, nullptr));
+
+ lo_kit->registerCallback(kitCallback, NULL);
comphelper::LibreOfficeKit::setLanguageTag(LanguageTag(OUString::fromUtf8(OString([app_locale UTF8String])), true));
@@ -247,25 +284,6 @@ static void updateTemplates(NSData *data, NSURLResponse *response)
}
}
- fakeSocketSetLoggingCallback([](const std::string& line)
- {
- LOG_INF_NOFILE(line);
- });
-
- dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
- ^{
- char *argv[2];
- argv[0] = strdup([[NSBundle mainBundle].executablePath UTF8String]);
- argv[1] = nullptr;
- Util::setThreadName("app");
- auto loolwsd = new LOOLWSD();
- loolwsd->run(1, argv);
-
- // Should never return
- assert(false);
- NSLog(@"lolwsd->run() unexpectedly returned");
- std::abort();
- });
return YES;
}
diff --git a/ios/Mobile/COAppDocument.hpp b/ios/Mobile/COAppDocument.hpp
new file mode 100644
index 000000000..0e8ef78a5
--- /dev/null
+++ b/ios/Mobile/COAppDocument.hpp
@@ -0,0 +1,32 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#pragma once
+
+#import "CODocument.h"
+#import "AppDocument.hpp"
+
+class COAppDocument : public AppDocument
+{
+public:
+ COAppDocument(std::shared_ptr<lok::Office> theLoKit, CODocument* aDocument);
+
+ void sendMessageToJS(std::string message) override;
+ void sendMessageToJS(const char* buffer, int length) override;
+
+protected:
+ std::string getDocumentURL() override;
+ std::string getAppLocale() override;
+
+private:
+ // Objective-C pointer to the Objective-C document object.
+ CODocument* __weak document;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ios/Mobile/COAppDocument.mm b/ios/Mobile/COAppDocument.mm
new file mode 100644
index 000000000..93082acf6
--- /dev/null
+++ b/ios/Mobile/COAppDocument.mm
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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/.
+ */
+
+#import <string>
+
+#import "AppDelegate.h"
+#import "CODocument.h"
+#import "COAppDocument.hpp"
+
+COAppDocument::COAppDocument(std::shared_ptr<lok::Office> theLoKit, CODocument* aDocument)
+ : AppDocument(theLoKit),
+ document(aDocument)
+{
+}
+
+void COAppDocument::sendMessageToJS(std::string message)
+{
+ [document send2JS:message];
+}
+
+void COAppDocument::sendMessageToJS(const char* buffer, int length)
+{
+ [document send2JS:buffer length:length];
+}
+
+std::string COAppDocument::getDocumentURL()
+{
+ return std::string([[document->copyFileURL absoluteString] UTF8String]);
+}
+
+std::string COAppDocument::getAppLocale()
+{
+ return [app_locale UTF8String];
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ios/Mobile/CODocument.h b/ios/Mobile/CODocument.h
index 7aa262c25..638d0383d 100644
--- a/ios/Mobile/CODocument.h
+++ b/ios/Mobile/CODocument.h
@@ -6,24 +6,26 @@
// 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/.
+#import <memory>
#import <string>
#import <UIKit/UIKit.h>
-#define LOK_USE_UNSTABLE_API
-#import <LibreOfficeKit/LibreOfficeKit.h>
-
@class DocumentViewController;
+class COAppDocument;
+
@interface CODocument : UIDocument {
@public
- int fakeClientFd;
NSURL *copyFileURL;
- unsigned appDocId;
+ std::shared_ptr<COAppDocument> appDocument;
}
@property (weak) DocumentViewController *viewController;
+- (void)handleProtocolMessage:(NSString*)message;
+
+- (void)send2JS:(std::string)string;
- (void)send2JS:(const char*)buffer length:(int)length;
@end
diff --git a/ios/Mobile/CODocument.mm b/ios/Mobile/CODocument.mm
index d25c7ded7..6592bc0ac 100644
--- a/ios/Mobile/CODocument.mm
+++ b/ios/Mobile/CODocument.mm
@@ -8,30 +8,16 @@
#import "config.h"
-#import <algorithm>
+#import <cstring>
-// This is not "external" code in the UNO-based extensions sense. To be able to include
-// <comphelper/lok.hxx>, we must #define LIBO_INTERNAL_ONLY.
-
-#define LIBO_INTERNAL_ONLY
#include <sal/config.h>
-#include <sal/log.hxx>
-#include <rtl/ustring.hxx>
-#include <comphelper/lok.hxx>
-#include <i18nlangtag/languagetag.hxx>
#import "ios.h"
#import "AppDelegate.h"
+#import "COAppDocument.hpp"
#import "CODocument.h"
#import "DocumentViewController.h"
-
-#import "ClientSession.hpp"
-#import "DocumentBroker.hpp"
-#import "FakeSocket.hpp"
-#import "Kit.hpp"
-#import "KitHelper.hpp"
#import "Log.hpp"
-#import "LOOLWSD.hpp"
#import "MobileApp.hpp"
#import "Protocol.hpp"
@@ -45,19 +31,11 @@
// DocBrokerId in DocumentBroker due to potential parallelism when opening multiple documents in
// quick succession.
-static std::atomic<unsigned> appDocIdCounter(1);
-
- (BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName error:(NSError **)errorPtr {
- // If this method is called a second time on the same CODocument object, just ignore it. This
- // seems to happen occasionally when the device is awakened after sleep. See tdf#122543.
- if (fakeClientFd >= 0)
- return YES;
+ appDocument = std::make_shared<COAppDocument>(lo_kit, self);
- fakeClientFd = fakeSocketSocket();
-
- appDocId = appDocIdCounter++;
- NSURL *copyFileDirectory = [[NSFileManager.defaultManager temporaryDirectory] URLByAppendingPathComponent:[NSString stringWithFormat:@"%d", appDocId]];
+ NSURL *copyFileDirectory = [[NSFileManager.defaultManager temporaryDirectory] URLByAppendingPathComponent:[NSString stringWithFormat:@"%d", appDocument->getAppDocId()]];
if (![NSFileManager.defaultManager createDirectoryAtURL:copyFileDirectory withIntermediateDirectories:YES attributes:nil error:nil]) {
LOG_ERR("Could not create directory " << [[copyFileDirectory path] UTF8String]);
return NO;
@@ -73,12 +51,12 @@ static std::atomic<unsigned> appDocIdCounter(1);
NSURL *url = [[NSBundle mainBundle] URLForResource:@"loleaflet" withExtension:@"html"];
NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
- allocateDocumentDataForMobileAppDocId(appDocId).coDocument = self;
+ allocateDocumentDataForMobileAppDocId(appDocument->getAppDocId()).coDocument = self;
components.queryItems = @[ [NSURLQueryItem queryItemWithName:@"file_path" value:[copyFileURL absoluteString]],
[NSURLQueryItem queryItemWithName:@"closebutton" value:@"1"],
[NSURLQueryItem queryItemWithName:@"permission" value:@"edit"],
[NSURLQueryItem queryItemWithName:@"lang" value:app_locale],
- [NSURLQueryItem queryItemWithName:@"appdocid" value:[NSString stringWithFormat:@"%u", appDocId]],
+ [NSURLQueryItem queryItemWithName:@"appdocid" value:[NSString stringWithFormat:@"%u", appDocument->getAppDocId()]],
];
NSURLRequest *request = [[NSURLRequest alloc]initWithURL:components.URL];
@@ -87,8 +65,19 @@ static std::atomic<unsigned> appDocIdCounter(1);
return YES;
}
+- (void)handleProtocolMessage:(NSString*)message {
+ const char *buffer = [message UTF8String];
+ int length = strlen(buffer);
+
+ appDocument->handleProtocolMessage(buffer, length);
+}
+
+- (void)send2JS:(std::string)string {
+ [self send2JS:string.c_str() length:string.size()];
+}
+
- (void)send2JS:(const char *)buffer length:(int)length {
- LOG_TRC("To JS: " << LOOLProtocol::getAbbreviatedMessage(buffer, length).c_str());
+ LOG_ERR("To JS: " << LOOLProtocol::getAbbreviatedMessage(buffer, length).c_str());
NSString *js;
@@ -114,8 +103,6 @@ static std::atomic<unsigned> appDocIdCounter(1);
if (subjs.length < js.length)
subjs = [subjs stringByAppendingString:@"..."];
- // LOG_TRC("Evaluating JavaScript: " << [subjs UTF8String]);
-
dispatch_async(dispatch_get_main_queue(), ^{
[self.viewController.webView evaluateJavaScript:js
completionHandler:^(id _Nullable obj, NSError * _Nullable error)
diff --git a/ios/Mobile/DocumentBrowserViewController.mm b/ios/Mobile/DocumentBrowserViewController.mm
index 92a9dedf0..6cc7001e2 100644
--- a/ios/Mobile/DocumentBrowserViewController.mm
+++ b/ios/Mobile/DocumentBrowserViewController.mm
@@ -68,7 +68,6 @@
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
DocumentViewController *documentViewController = [storyBoard instantiateViewControllerWithIdentifier:@"DocumentViewController"];
documentViewController.document = [[CODocument alloc] initWithFileURL:documentURL];
- documentViewController.document->fakeClientFd = -1;
documentViewController.document.viewController = documentViewController;
[self presentViewController:documentViewController animated:YES completion:nil];
}
diff --git a/ios/Mobile/DocumentViewController.mm b/ios/Mobile/DocumentViewController.mm
index 2467bbfbb..660d1f05e 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -15,12 +15,10 @@
#import <objc/message.h>
#import <objc/runtime.h>
-#import <poll.h>
#import <sys/stat.h>
#import "ios.h"
-#import "FakeSocket.hpp"
-#import "LOOLWSD.hpp"
+#import "COAppDocument.hpp"
#import "Log.hpp"
#import "MobileApp.hpp"
#import "SigUtil.hpp"
@@ -180,10 +178,6 @@ static IMP standardImpOfInputAccessoryView = nil;
// removed. After the photo is taken it is then added back to the hierarchy. Our Document object
// is still there intact, however, so no need to re-open the document when we re-appear.
- // Check whether the Document object is an already initialised one.
- if (self.document->fakeClientFd >= 0)
- return;
-
[self.document openWithCompletionHandler:^(BOOL success) {
if (success) {
// Display the content of the document
@@ -268,9 +262,6 @@ static IMP standardImpOfInputAccessoryView = nil;
}
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
- int rc;
- struct pollfd p;
-
if ([message.name isEqualToString:@"error"]) {
LOG_ERR("Error from WebView: " << [message.body UTF8String]);
} else if ([message.name isEqualToString:@"debug"]) {
@@ -280,82 +271,14 @@ static IMP standardImpOfInputAccessoryView = nil;
if (subBody.length < ((NSString*)message.body).length)
subBody = [subBody stringByAppendingString:@"..."];
- LOG_TRC("To Online: " << [subBody UTF8String]);
+ LOG_ERR("From JS: " << [subBody UTF8String]);
if ([message.body isEqualToString:@"HULLO"]) {
// Now we know that the JS has started completely
-
- // Contact the permanently (during app lifetime) listening LOOLWSD server
- // "public" socket
- assert(loolwsd_server_socket_fd != -1);
- rc = fakeSocketConnect(self.document->fakeClientFd, loolwsd_server_socket_fd);
- assert(rc != -1);
-
- // Create a socket pair to notify the below thread when the document has been closed
- fakeSocketPipe2(closeNotificationPipeForForwardingThread);
-
- // Start another thread to read responses and forward them to the JavaScript
- dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
- ^{
- Util::setThreadName("app2js");
- while (true) {
- struct pollfd p[2];
- p[0].fd = self.document->fakeClientFd;
- p[0].events = POLLIN;
- p[1].fd = self->closeNotificationPipeForForwardingThread[1];
- p[1].events = POLLIN;
- if (fakeSocketPoll(p, 2, -1) > 0) {
- if (p[1].revents == POLLIN) {
- // The code below handling the "BYE" fake Websocket
- // message has closed the other end of the
- // closeNotificationPipeForForwardingThread. Let's close
- // the other end too just for cleanliness, even if a
- // FakeSocket as such is not a system resource so nothing
- // is saved by closing it.
- fakeSocketClose(self->closeNotificationPipeForForwardingThread[1]);
-
- // Close our end of the fake socket connection to the
- // ClientSession thread, so that it terminates
- fakeSocketClose(self.document->fakeClientFd);
-
- return;
- }
- if (p[0].revents == POLLIN) {
- int n = fakeSocketAvailableDataLength(self.document->fakeClientFd);
- // I don't want to check for n being -1 here, even if
- // that will lead to a crash (std::length_error from the
- // below std::vector constructor), as n being -1 is a
- // sign of something being wrong elsewhere anyway, and I
- // prefer to fix the root cause. Let's see how well this
- // works out. See tdf#122543 for such a case.
- if (n == 0)
- return;
- std::vector<char> buf(n);
- n = fakeSocketRead(self.document->fakeClientFd, buf.data(), n);
- [self.document send2JS:buf.data() length:n];
- }
- }
- else
- break;
- }
- assert(false);
- });
-
- // First we simply send the Online C++ parts the URL and the appDocId. This corresponds
- // to the GET request with Upgrade to WebSocket.
- std::string url([[self.document->copyFileURL absoluteString] UTF8String]);
- p.fd = self.document->fakeClientFd;
- p.events = POLLOUT;
- fakeSocketPoll(&p, 1, -1);
- std::string message(url + " " + std::to_string(self.document->appDocId));
- fakeSocketWrite(self.document->fakeClientFd, message.c_str(), message.size());
-
- return;
} else if ([message.body isEqualToString:@"BYE"]) {
LOG_TRC("Document window terminating on JavaScript side. Closing our end of the socket.");
[self bye];
- return;
} else if ([message.body isEqualToString:@"SLIDESHOW"]) {
// Create the SVG for the slideshow.
@@ -363,7 +286,7 @@ static IMP standardImpOfInputAccessoryView = nil;
self.slideshowFile = Util::createRandomTmpDir() + "/slideshow.svg";
self.slideshowURL = [NSURL fileURLWithPath:[NSString stringWithUTF8String:self.slideshowFile.c_str()] isDirectory:NO];
- getDocumentDataForMobileAppDocId(self.document->appDocId).loKitDocument->saveAs([[self.slideshowURL absoluteString] UTF8String], "svg", nullptr);
+ getDocumentDataForMobileAppDocId(self.document->appDocument->getAppDocId()).loKitDocument->saveAs([[self.slideshowURL absoluteString] UTF8String], "svg", nullptr);
// Add a new full-screen WebView displaying the slideshow.
@@ -400,8 +323,6 @@ static IMP standardImpOfInputAccessoryView = nil;
metrics:nil
views:views]];
[self.slideshowWebView loadRequest:[NSURLRequest requestWithURL:self.slideshowURL]];
-
- return;
} else if ([message.body isEqualToString:@"EXITSLIDESHOW"]) {
std::remove(self.slideshowFile.c_str());
@@ -409,15 +330,13 @@ static IMP standardImpOfInputAccessoryView = nil;
[self.slideshowWebView removeFromSuperview];
self.slideshowWebView = nil;
self.webView.hidden = false;
-
- return;
} else if ([message.body isEqualToString:@"PRINT"]) {
// Create the PDF to print.
std::string printFile = Util::createRandomTmpDir() + "/print.pdf";
NSURL *printURL = [NSURL fileURLWithPath:[NSString stringWithUTF8String:printFile.c_str()] isDirectory:NO];
- getDocumentDataForMobileAppDocId(self.document->appDocId).loKitDocument->saveAs([[printURL absoluteString] UTF8String], "pdf", nullptr);
+ getDocumentDataForMobileAppDocId(self.document->appDocument->getAppDocId()).loKitDocument->saveAs([[printURL absoluteString] UTF8String], "pdf", nullptr);
UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
@@ -435,15 +354,12 @@ static IMP standardImpOfInputAccessoryView = nil;
LOG_TRC("print completion handler gets " << (completed?"YES":"NO"));
std::remove(printFile.c_str());
}];
-
- return;
} else if ([message.body hasPrefix:@"HYPERLINK"]) {
NSArray *messageBodyItems = [message.body componentsSeparatedByString:@" "];
if ([messageBodyItems count] >= 2) {
NSURL *url = [[NSURL alloc] initWithString:messageBodyItems[1]];
UIApplication *application = [UIApplication sharedApplication];
[application openURL:url options:@{} completionHandler:nil];
- return;
}
} else if ([message.body hasPrefix:@"downloadas "]) {
NSArray<NSString*> *messageBodyItems = [message.body componentsSeparatedByString:@" "];
@@ -470,7 +386,7 @@ static IMP standardImpOfInputAccessoryView = nil;
std::remove([[downloadAsTmpURL path] UTF8String]);
- getDocumentDataForMobileAppDocId(self.document->appDocId).loKitDocument->saveAs([[downloadAsTmpURL absoluteString] UTF8String], [format UTF8String], nullptr);
+ getDocumentDataForMobileAppDocId(self.document->appDocument->getAppDocId()).loKitDocument->saveAs([[downloadAsTmpURL absoluteString] UTF8String], [format UTF8String], nullptr);
// Then verify that it indeed was saved, and then use an
// UIDocumentPickerViewController to ask the user where to store the exported
@@ -499,13 +415,9 @@ static IMP standardImpOfInputAccessoryView = nil;
LOG_SYS("Could not unlink tile " << [[tile path] UTF8String]);
}
return;
+ } else {
+ [self.document handleProtocolMessage:message.body];
}
-
- const char *buf = [message.body UTF8String];
- p.fd = self.document->fakeClientFd;
- p.events = POLLOUT;
- fakeSocketPoll(&p, 1, -1);
- fakeSocketWrite(self.document->fakeClientFd, buf, strlen(buf));
} else {
LOG_ERR("Unrecognized kind of message received from WebView: " << [message.name UTF8String] << ":" << [message.body UTF8String]);
}
@@ -526,9 +438,6 @@ static IMP standardImpOfInputAccessoryView = nil;
}
- (void)bye {
- // Close one end of the socket pair, that will wake up the forwarding thread above
- fakeSocketClose(closeNotificationPipeForForwardingThread[0]);
-
// deallocateDocumentDataForMobileAppDocId(self.document->appDocId);
[[NSFileManager defaultManager] removeItemAtURL:self.document->copyFileURL error:nil];
diff --git a/ios/Mobile/TemplateCollectionViewController.mm b/ios/Mobile/TemplateCollectionViewController.mm
index b283d580a..9f7156125 100644
--- a/ios/Mobile/TemplateCollectionViewController.mm
+++ b/ios/Mobile/TemplateCollectionViewController.mm
@@ -141,9 +141,8 @@ static NSString *mapTemplateExtensionToActual(NSString *templateName) {
// Load the template into LibreOffice core, save as the corresponding document type (with the
// same basename), and then proceed to edit that.
- LibreOfficeKitDocument *doc = lo_kit->pClass->documentLoad(lo_kit, [[selectedTemplate absoluteString] UTF8String]);
- doc->pClass->saveAs(doc, [[newURL absoluteString] UTF8String], nullptr, nullptr);
- doc->pClass->destroy(doc);
+ lok::Document *doc = lo_kit->documentLoad([[selectedTemplate absoluteString] UTF8String]);
+ doc->saveAs([[newURL absoluteString] UTF8String], nullptr, nullptr);
self.importHandler(newURL, UIDocumentBrowserImportModeMove);
diff --git a/ios/ios.h b/ios/ios.h
index 198b9e90a..be4462294 100644
--- a/ios/ios.h
+++ b/ios/ios.h
@@ -7,10 +7,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <memory>
+
#include <LibreOfficeKit/LibreOfficeKit.hxx>
extern int loolwsd_server_socket_fd;
-extern LibreOfficeKit *lo_kit;
+extern std::shared_ptr<lok::Office> lo_kit;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ios/ios.mm b/ios/ios.mm
index b5c6ac65b..243928753 100644
--- a/ios/ios.mm
+++ b/ios/ios.mm
@@ -17,6 +17,6 @@ extern "C" {
int loolwsd_server_socket_fd = -1;
-LibreOfficeKit *lo_kit;
+std::shared_ptr<lok::Office> lo_kit;
// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 284e552f3..bd42d5e13 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -2316,33 +2316,6 @@ void lokit_main(
#endif
}
-#ifdef IOS
-
-// In the iOS app we can have several documents open in the app process at the same time, thus
-// several lokit_main() functions running at the same time. We want just one LO main loop, though,
-// so we start it separately in its own thread.
-
-void runKitLoopInAThread()
-{
- std::thread([&]
- {
- Util::setThreadName("lokit_runloop");
-
- std::shared_ptr<lok::Office> loKit = std::make_shared<lok::Office>(lo_kit);
- int dummy;
- loKit->runLoop(pollCallback, wakeCallback, &dummy);
-
- // Should never return
- assert(false);
-
- NSLog(@"loKit->runLoop() unexpectedly returned");
-
- std::abort();
- }).detach();
-}
-
-#endif // IOS
-
#endif // !BUILDING_TESTS
std::string anonymizeUrl(const std::string& url)
diff --git a/kit/Kit.hpp b/kit/Kit.hpp
index a260a9d11..1fdd37636 100644
--- a/kit/Kit.hpp
+++ b/kit/Kit.hpp
@@ -43,10 +43,6 @@ void lokit_main(
size_t numericIdentifier
);
-#ifdef IOS
-void runKitLoopInAThread();
-#endif
-
bool globalPreinit(const std::string& loTemplate);
/// Wrapper around private Document::ViewCallback().
void documentViewCallback(const int type, const char* p, void* data);
commit e633dd7c5ac0b9840cae37c41c0bfd974f45a8fa
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Jul 14 18:47:36 2020 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Jul 14 19:02:37 2020 +0200
Make TileCache::_dontCache const
Change-Id: Ic932a836fc47de4b707d0468bafba65eaf5bf86a
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98774
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tor Lillqvist <tml at collabora.com>
diff --git a/wsd/TileCache.hpp b/wsd/TileCache.hpp
index 3fecd7a1b..04c3b8e17 100644
--- a/wsd/TileCache.hpp
+++ b/wsd/TileCache.hpp
@@ -175,7 +175,7 @@ private:
std::thread::id _owner;
- bool _dontCache;
+ const bool _dontCache;
/// Approximate size of tilecache in bytes
size_t _cacheSize;
commit 6ca6a7649eff18e3e48bfe97c3cafcf41fb16363
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Tue Jul 14 15:20:05 2020 +0100
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Jul 14 17:28:32 2020 +0200
Forkit: add dump_forkit_state and re-factor state checks to simplify.
Change-Id: Ic65bbd0894f26f69e1b55c769ac47013f9aaf163
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98746
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/common/SigUtil.cpp b/common/SigUtil.cpp
index 2bc3d5aa7..f768005c6 100644
--- a/common/SigUtil.cpp
+++ b/common/SigUtil.cpp
@@ -66,17 +66,18 @@ namespace SigUtil
}
#endif
-#if !MOBILEAPP
- bool getDumpGlobalState()
+ void checkDumpGlobalState(GlobalDumpStateFn dumpState)
{
- return DumpGlobalState;
- }
-
- void resetDumpGlobalState()
- {
- DumpGlobalState = false;
+#if !MOBILEAPP
+ if (DumpGlobalState)
+ {
+ dumpState();
+ DumpGlobalState = false;
+ }
+#endif
}
+#if !MOBILEAPP
/// This traps the signal-handler so we don't _Exit
/// while dumping stack trace. It's re-entrant.
/// Used to safely increment and decrement the signal-handler trap.
diff --git a/common/SigUtil.hpp b/common/SigUtil.hpp
index 9cc5b69d4..9f8296426 100644
--- a/common/SigUtil.hpp
+++ b/common/SigUtil.hpp
@@ -46,12 +46,11 @@ namespace SigUtil
}
#endif
-#if !MOBILEAPP
- /// Get the flag to dump internal state.
- bool getDumpGlobalState();
- /// Reset the flag to dump internal state.
- void resetDumpGlobalState();
+ extern "C" { typedef void (*GlobalDumpStateFn)(void); }
+
+ void checkDumpGlobalState(GlobalDumpStateFn dumpState);
+#if !MOBILEAPP
/// Wait for the signal handler, if any,
/// and prevent _Exit while collecting backtrace.
void waitSigHandlerTrap();
diff --git a/kit/ForKit.cpp b/kit/ForKit.cpp
index 721670bd1..9daa93576 100644
--- a/kit/ForKit.cpp
+++ b/kit/ForKit.cpp
@@ -67,6 +67,33 @@ int ClientPortNumber = DEFAULT_CLIENT_PORT_NUMBER;
std::string MasterLocation;
#endif
+extern "C" { void dump_forkit_state(void); /* easy for gdb */ }
+
+#if !MOBILEAPP
+void dump_forkit_state()
+{
+ std::ostringstream oss;
+
+ oss << "Forkit: " << ForkCounter << " forks\n"
+ << " loglevel: " << LogLevel << "\n"
+ << " unit test: " << UnitTestLibrary << "\n"
+#ifndef KIT_IN_PROCESS
+ << " NoCapsForKit: " << NoCapsForKit << "\n"
+ << " NoSeccomp: " << NoSeccomp << "\n"
+# if ENABLE_DEBUG
+ << " SingleKit: " << SingleKit << "\n"
+# endif
+#endif
+ << " ClientPortNumber: " << ClientPortNumber << "\n"
+ << " MasterLocation: " << MasterLocation
+ << "\n";
+
+ const std::string msg = oss.str();
+ fprintf(stderr, "%s", msg.c_str());
+ LOG_TRC(msg);
+}
+#endif
+
class ServerWSHandler;
// We have a single thread and a single connection so we won't bother with
@@ -627,6 +654,8 @@ int main(int argc, char** argv)
mainPoll.insertNewUnixSocket(MasterLocation, FORKIT_URI, WSHandler);
#endif
+ SigUtil::setUserSignals();
+
LOG_INF("ForKit process is ready.");
while (!SigUtil::getTerminationFlag())
@@ -635,6 +664,8 @@ int main(int argc, char** argv)
mainPoll.poll(POLL_TIMEOUT_MICRO_S);
+ SigUtil::checkDumpGlobalState(dump_forkit_state);
+
#if ENABLE_DEBUG
if (!SingleKit)
#endif
diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index 9815e4158..cef10cc11 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -3599,13 +3599,7 @@ private:
void wakeupHook() override
{
-#if !MOBILEAPP
- if (SigUtil::getDumpGlobalState())
- {
- dump_state();
- SigUtil::resetDumpGlobalState();
- }
-#endif
+ SigUtil::checkDumpGlobalState(dump_state);
}
};
/// This thread & poll accepts incoming connections.
commit e64bbeb81914d5f58681cb4ea15fec4f5128a76b
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Mon Jul 13 23:00:44 2020 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Jul 14 17:00:35 2020 +0200
Pass rendered tiles as uncompressed BMP files in the iOS app
Avoids the need for PNG encoding (takes significant amount of CPU
time) and Base64 encoding in the app process, transfer to JavaScript
(running in a WebKit process of its own), and corresponding decoding
(in the WebKit process). Instead simply pass the URL of each tile file
to the JavaScript. Remove each BMP file once it has been loaded.
Change-Id: I6e7b9450691679c64813979976c59f1763ec104c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98710
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/common/RenderTiles.hpp b/common/RenderTiles.hpp
index 03308879b..1385665a7 100644
--- a/common/RenderTiles.hpp
+++ b/common/RenderTiles.hpp
@@ -16,6 +16,12 @@
#include <unordered_map>
#include <vector>
+#ifdef IOS
+#import <fcntl.h>
+#import <sys/mman.h>
+#import <unistd.h>
+#endif
+
#include "Png.hpp"
#include "Rectangle.hpp"
#include "TileDesc.hpp"
@@ -356,6 +362,110 @@ namespace RenderTiles
renderedTiles.back().setImgSize(imgSize);
}
+#ifdef IOS
+
+#pragma pack(push)
+#pragma pack(2)
+ typedef struct
+ {
+ uint16_t bfType;
+ uint32_t bfSize;
+ uint16_t bfReserved1;
+ uint16_t bfReserved2;
+ uint32_t bfOffBits;
+ } BITMAPFILEHEADER;
+#pragma pack(pop)
+
+ typedef uint32_t FXPT2DOT30; // Fixed point 2.30, whatever that means
+
+ typedef struct
+ {
+ FXPT2DOT30 ciexyzX;
+ FXPT2DOT30 ciexyzY;
+ FXPT2DOT30 ciexyzZ;
+ } CIEXYZ;
+
+ typedef struct
+ {
+ CIEXYZ ciexyzRed;
+ CIEXYZ ciexyzGreen;
+ CIEXYZ ciexyzBlue;
+ } CIEXYZTRIPLE;
+
+ // We must use the BITMAPV5HEADER to get proper alpha handling.
+ typedef struct
+ {
+ uint32_t bV5Size;
+ int32_t bV5Width;
+ int32_t bV5Height;
+ uint16_t bV5Planes;
+ uint16_t bV5BitCount;
+ uint32_t bV5Compression;
+ uint32_t bV5SizeImage;
+ int32_t bV5XPelsPerMeter;
+ int32_t bV5YPelsPerMeter;
+ uint32_t bV5ClrUsed;
+ uint32_t bV5ClrImportant;
+ uint32_t bV5RedMask;
+ uint32_t bV5GreenMask;
+ uint32_t bV5BlueMask;
+ uint32_t bV5AlphaMask;
+ uint32_t bV5CSType;
+ CIEXYZTRIPLE bV5Endpoints;
+ uint32_t bV5GammaRed;
+ uint32_t bV5GammaGreen;
+ uint32_t bV5GammaBlue;
+ uint32_t bV5Intent;
+ uint32_t bV5ProfileData;
+ uint32_t bV5ProfileSize;
+ uint32_t bV5Reserved;
+ } BITMAPV5HEADER;
+
+#define BI_BITFIELDS 3
+
+#define LCS_sRGB 0x73524742
+#define LCS_GM_IMAGES 4
+
+ static size_t bmpFileSize(int width, int height)
+ {
+ return sizeof(BITMAPFILEHEADER) + sizeof(BITMAPV5HEADER) + width * height * 4;
+ }
+
+ static void generateBmpHeader(char *buffer, int width, int height)
+ {
+ assert(width%4 == 0);
+
+ BITMAPFILEHEADER *bf = (BITMAPFILEHEADER*)buffer;
+ bf->bfType = ('B' | ('M' << 8));
+ bf->bfSize = bmpFileSize(width, height);
+ bf->bfReserved1 = 0;
+ bf->bfReserved2 = 0;
+ bf->bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPV5HEADER);
+
+ BITMAPV5HEADER *bV5 = (BITMAPV5HEADER*) (buffer + sizeof(BITMAPFILEHEADER));
+ bV5->bV5Size = sizeof(BITMAPV5HEADER);
+ bV5->bV5Width = width;
+ bV5->bV5Height = -height;
+ bV5->bV5Planes = 1;
+ bV5->bV5BitCount = 32;
+ bV5->bV5Compression = BI_BITFIELDS;
+ bV5->bV5SizeImage = 0;
+ bV5->bV5XPelsPerMeter = 1000; // Dummy
+ bV5->bV5YPelsPerMeter = 1000;
+ bV5->bV5ClrUsed = 0;
+ bV5->bV5ClrImportant = 0;
+ bV5->bV5RedMask = 0x00FF0000;
+ bV5->bV5GreenMask = 0x0000FF00;
+ bV5->bV5BlueMask = 0x000000FF;
+ bV5->bV5AlphaMask = 0xFF000000;
+ bV5->bV5CSType = LCS_sRGB;
+ // Leave out fields that are ignored with above settings.
+ bV5->bV5Intent = LCS_GM_IMAGES; // ???
+ bV5->bV5Reserved = 0;
+ }
+
+#endif
+
bool doRender(std::shared_ptr<lok::Document> document,
TileCombined &tileCombined,
PngCache &pngCache,
@@ -392,10 +502,14 @@ namespace RenderTiles
tileRecs.push_back(rectangle);
}
+ assert(tiles.size() == tileRecs.size());
+
const size_t tilesByX = renderArea.getWidth() / tileCombined.getTileWidth();
const size_t tilesByY = renderArea.getHeight() / tileCombined.getTileHeight();
- const size_t pixmapWidth = tilesByX * tileCombined.getWidth();
- const size_t pixmapHeight = tilesByY * tileCombined.getHeight();
+ const int pixelWidth = tileCombined.getWidth();
+ const int pixelHeight = tileCombined.getHeight();
+ const size_t pixmapWidth = tilesByX * pixelWidth;
+ const size_t pixmapHeight = tilesByY * pixelHeight;
if (pixmapWidth > 4096 || pixmapHeight > 4096)
LOG_WRN("Unusual extremely large tile combine of size " << pixmapWidth << 'x' << pixmapHeight);
@@ -420,15 +534,78 @@ namespace RenderTiles
renderArea.getWidth() << ", " << renderArea.getHeight() << ") " <<
" rendered in " << totalTime << " ms (" << area / elapsed << " MP/s).");
+#ifdef IOS
+
+ for (int i = 0; i < tiles.size(); i++)
+ {
+ static int bmpFileCounter = 0;
+ const int bmpId = bmpFileCounter++;
+
+ const size_t positionX = (tileRecs[i].getLeft() - renderArea.getLeft()) / tileCombined.getTileWidth();
+ const size_t positionY = (tileRecs[i].getTop() - renderArea.getTop()) / tileCombined.getTileHeight();
+
+ const int offsetX = positionX * pixelWidth;
+ const int offsetY = positionY * pixelHeight;
+
+ NSString *mmapFileBaseName = [NSString stringWithFormat:@"%d.bmp", bmpId];
+ NSURL *mmapFileURL = [[NSFileManager.defaultManager temporaryDirectory] URLByAppendingPathComponent:mmapFileBaseName];
+
+ int fd = open([[mmapFileURL path] UTF8String], O_RDWR|O_CREAT, 0666);
+ if (fd == -1)
+ {
+ LOG_SYS("Could not create file " << [[mmapFileURL path] UTF8String]);
+ return false;
+ }
+
+ const size_t mmapFileSize = bmpFileSize(pixelWidth, pixelHeight);
+
+ if (lseek(fd, mmapFileSize-1, SEEK_SET) == -1)
+ {
+ LOG_SYS("Could not seek in file " << [[mmapFileURL path] UTF8String]);
+ return false;
+ }
+
+ if (write(fd, "", 1) == -1)
+ {
+ LOG_SYS("Could not write at end of " << [[mmapFileURL path] UTF8String]);
+ return false;
+ }
+
+ char *mmapMemory = (char *)mmap(NULL, mmapFileSize, PROT_READ|PROT_WRITE, MAP_FILE|MAP_SHARED, fd, 0);
+ if (mmapMemory == MAP_FAILED)
+ {
+ LOG_SYS("Could not map in file " << [[mmapFileURL path] UTF8String]);
+ close(fd);
+ return false;
+ }
+
+ close(fd);
+
+ generateBmpHeader(mmapMemory, pixelWidth, pixelHeight);
+
+ for (int y = 0; y < pixelHeight; y++)
+ memcpy(mmapMemory + sizeof(BITMAPFILEHEADER) + sizeof(BITMAPV5HEADER) + y * pixelWidth * 4,
+ pixmap.data() + (offsetY + y) * pixmapWidth * 4 + offsetX * 4,
+ pixelWidth * 4);
+
+ if (munmap(mmapMemory, mmapFileSize) == -1)
+ {
+ LOG_SYS("Could not unmap file " << [[mmapFileURL path] UTF8String]);
+ return false;
+ }
+
+ std::string tileMsg = tiles[i].serialize("tile:", ADD_DEBUG_RENDERID) + std::string([[mmapFileURL absoluteString] UTF8String]);
+ outputMessage(tileMsg.c_str(), tileMsg.length());
+ }
+
+#else
+
const auto mode = static_cast<LibreOfficeKitTileMode>(document->getTileMode());
std::vector<char> output;
output.reserve(pixmapSize);
// Compress the area as tiles
- const int pixelWidth = tileCombined.getWidth();
- const int pixelHeight = tileCombined.getHeight();
-
std::vector<TileDesc> renderedTiles;
std::vector<TileDesc> duplicateTiles;
std::vector<TileBinaryHash> duplicateHashes;
@@ -590,7 +767,7 @@ namespace RenderTiles
outputOffset += i.getImgSize();
}
}
-
+#endif
return true;
}
}
diff --git a/ios/Mobile/DocumentViewController.mm b/ios/Mobile/DocumentViewController.mm
index 3f8744fe4..2467bbfbb 100644
--- a/ios/Mobile/DocumentViewController.mm
+++ b/ios/Mobile/DocumentViewController.mm
@@ -490,6 +490,15 @@ static IMP standardImpOfInputAccessoryView = nil;
completion:nil];
return;
}
+ } else if ([message.body hasPrefix:@"REMOVE "]) {
+ // Sent from the img element's onload event handler. Remove tile file once it has been loaded.
+ NSArray<NSString*> *messageBodyItems = [message.body componentsSeparatedByString:@" "];
+ assert([messageBodyItems count] == 2);
+ NSURL *tile = [NSURL URLWithString:messageBodyItems[1]];
+ if (unlink([[tile path] UTF8String]) == -1) {
+ LOG_SYS("Could not unlink tile " << [[tile path] UTF8String]);
+ }
+ return;
}
const char *buf = [message.body UTF8String];
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index 1f2dcf047..9b9b3c236 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -794,7 +794,7 @@ L.Socket = L.Class.extend({
}
}
else if (window.ThisIsTheiOSApp) {
- // In the iOS app, the native code sends us the PNG tile already as a data: URL after the newline
+ // In the iOS app, the native code sends us the URL of the BMP for the tile after the newline
var newlineIndex = textMsg.indexOf('\n');
if (newlineIndex > 0) {
img = textMsg.substring(newlineIndex+1);
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 198b511f1..e19626eb2 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -2066,6 +2066,9 @@ L.TileLayer = L.GridLayer.extend({
_tileOnLoad: function (done, tile) {
done(null, tile);
+ if (window.ThisIsTheiOSApp) {
+ window.webkit.messageHandlers.lool.postMessage('REMOVE ' + tile.src, '*');
+ }
},
_tileOnError: function (done, tile, e) {
commit 7336133319881161907cbba2fcbfebf09b95c6a8
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Tue Jul 14 10:44:21 2020 +0100
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Tue Jul 14 16:59:51 2020 +0200
Handle multiple queued fragments in WebSocket _inBuffer without timeout.
Change-Id: I488a1311404a94f64e145db99f76782e171965ba
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98714
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp
index 4aca03e38..66620a1d0 100644
--- a/net/WebSocketHandler.hpp
+++ b/net/WebSocketHandler.hpp
@@ -389,7 +389,7 @@ public:
{
_inFragmentBlock = true;
// If is not final fragment then wait for next fragment.
- return false;
+ return true;
}
#else
handleMessage(_wsPayload);
commit 07bf5984305955725c1cfe0d5cada0b46d42dbc6
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Jul 14 17:06:11 2020 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Jul 14 16:56:20 2020 +0200
Make objects and threads go away more reliably in the iOS app
We probably used to have circular references that made KitSocketPoll
and KitWebSocketHandler objects hang around forever, or something.
(Not a problem in web-based Online where kit processes have a
restricted lifetime.)
Change-Id: Ia6eebc51f4a4a8fb4f69a2c83a0131de921ea1d6
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98744
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tor Lillqvist <tml at collabora.com>
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index f10493e50..284e552f3 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1623,19 +1623,7 @@ class KitSocketPoll final : public SocketPoll
public:
~KitSocketPoll()
{
-#ifdef IOS
- std::unique_lock<std::mutex> lock(KSPollsMutex);
- std::shared_ptr<KitSocketPoll> p;
- auto i = KSPolls.begin();
- for (; i != KSPolls.end(); ++i)
- {
- p = i->lock();
- if (p && p.get() == this)
- break;
- }
- assert(i != KSPolls.end());
- KSPolls.erase(i);
-#endif
+ // Just to make it easier to set a breakpoint
}
static std::shared_ptr<KitSocketPoll> create()
@@ -1645,7 +1633,6 @@ public:
#ifdef IOS
std::unique_lock<std::mutex> lock(KSPollsMutex);
KSPolls.push_back(result);
- // KSPollsCV.notify_one();
#endif
return result;
}
@@ -1762,6 +1749,11 @@ public:
{
}
+ ~KitWebSocketHandler()
+ {
+ // Just to make it easier to set a breakpoint
+ }
+
protected:
void handleMessage(const std::vector<char>& data) override
{
@@ -1881,10 +1873,13 @@ protected:
SigUtil::setTerminationFlag();
#endif
#ifdef IOS
- std::unique_lock<std::mutex> lock(_ksPoll->terminationMutex);
- _ksPoll->terminationFlag = true;
- _ksPoll->terminationCV.notify_all();
+ {
+ std::unique_lock<std::mutex> lock(_ksPoll->terminationMutex);
+ _ksPoll->terminationFlag = true;
+ _ksPoll->terminationCV.notify_all();
+ }
#endif
+ _ksPoll.reset();
}
};
@@ -1903,22 +1898,20 @@ int pollCallback(void* pData, int timeoutUs)
return reinterpret_cast<KitSocketPoll*>(pData)->kitPoll(timeoutUs);
#else
std::unique_lock<std::mutex> lock(KitSocketPoll::KSPollsMutex);
- if (KitSocketPoll::KSPolls.size() == 0)
+ std::vector<std::shared_ptr<KitSocketPoll>> v;
+ for (const auto &i : KitSocketPoll::KSPolls)
+ {
+ auto p = i.lock();
+ if (p)
+ v.push_back(p);
+ }
+ lock.unlock();
+ if (v.size() == 0)
{
- // KitSocketPoll::KSPollsCV.wait(lock);
- lock.unlock();
std::this_thread::sleep_for(std::chrono::microseconds(timeoutUs));
}
else
{
- std::vector<std::shared_ptr<KitSocketPoll>> v;
- for (const auto &i : KitSocketPoll::KSPolls)
- {
- auto p = i.lock();
- if (p)
- v.push_back(p);
- }
- lock.unlock();
for (const auto &p : v)
p->kitPoll(timeoutUs);
}
diff --git a/net/Socket.hpp b/net/Socket.hpp
index 9ee336950..84b4bfafd 100644
--- a/net/Socket.hpp
+++ b/net/Socket.hpp
@@ -799,6 +799,7 @@ public:
{
assertCorrectThread();
_socketHandler->onDisconnect();
+ _socketHandler.reset();
}
if (!_shutdownSignalled)
commit ef7e79a20b1ad487164eabe827092ed1da294690
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Jul 14 16:46:40 2020 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Jul 14 16:55:12 2020 +0200
Use LOG_INF_NOFILE() for the FakeSocket logging callbacks
(Why not call LOG_INF directly in FakeSocket.cpp instead? Good
question. I guess my idea was originally to keep FakeSocket separately
testable without all the Online logging stuff.)
Change-Id: I1e6b730a9742ad653d431774d88fec6a36d98850
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98736
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tor Lillqvist <tml at collabora.com>
diff --git a/ios/Mobile/AppDelegate.mm b/ios/Mobile/AppDelegate.mm
index c98211205..d6962b840 100644
--- a/ios/Mobile/AppDelegate.mm
+++ b/ios/Mobile/AppDelegate.mm
@@ -249,7 +249,7 @@ static void updateTemplates(NSData *data, NSURLResponse *response)
fakeSocketSetLoggingCallback([](const std::string& line)
{
- LOG_INF(line);
+ LOG_INF_NOFILE(line);
});
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
commit 137981f3608ef29287eae4798e9f2880eaf8093b
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Tue Jul 14 16:43:07 2020 +0300
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Tue Jul 14 16:52:28 2020 +0200
Add LOG_INF_NOFILE that doesn't display the source file location
Useful (like LOG_TRC_NOFILE) in cases where the source file location
of the LOG_INF call is uninteresting. (Like if the message to be
logged has originated somewhere else.)
Change-Id: Id6d8c137be073a958943f01b3d7b98143fcd7dfd
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98735
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tor Lillqvist <tml at collabora.com>
diff --git a/common/Log.hpp b/common/Log.hpp
index b2bb43860..64d215317 100644
--- a/common/Log.hpp
+++ b/common/Log.hpp
@@ -339,6 +339,16 @@ namespace Log
} \
} while (false)
+#define LOG_INF_NOFILE(X) \
+ do \
+ { \
+ auto& log_ = Log::logger(); \
+ if (log_.information() && !Log::isShutdownCalled()) \
+ { \
+ LOG_BODY_(log_, INFORMATION, "INF", X, false); \
+ } \
+ } while (false)
+
#define LOG_WRN(X) \
do \
{ \
commit 52eeae509bc5d0e70e5532a41d749e1e9a79eced
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sat Jul 11 03:04:41 2020 +0200
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Tue Jul 14 16:20:38 2020 +0200
Fix gtk fake mobile application build
Just adds the missing source files to the automake file.
Still it seems unmaintained since a year and doesn't look that
mobile at all (from my expectations), but it still works AFAI
can tell.
While at it add the mobile binary to .gitignore.
Change-Id: I7db21041c6848f94fcb4058c730385b077048a9c
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98553
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
diff --git a/.gitignore b/.gitignore
index 1129e29e6..fc30a33db 100644
--- a/.gitignore
+++ b/.gitignore
@@ -110,6 +110,9 @@ BUNDLE-VERSION
/android/lib/src/main/assets/hello-world.od*
/android/lib/src/main/cpp/CMakeLists.txt
+# gtk fake mobile app
+gtk/mobile
+
# backup and temporary editor files: the only convenience rules allowed here.
*~
.*sw?
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index 6694a88bd..c0bbcbb3b 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -17,7 +17,8 @@ AM_CPPFLAGS = -pthread \
AM_LDFLAGS = -pthread ${WEBKIT_LIBS} -ldl
-common_sources = ../common/Unit.cpp \
+common_sources = \
+ ../common/Authorization.cpp \
../common/FileUtil.cpp \
../common/Log.cpp \
../common/MessageQueue.cpp \
@@ -25,6 +26,8 @@ common_sources = ../common/Unit.cpp \
../common/Session.cpp \
../common/SigUtil.cpp \
../common/SpookyV2.cpp \
+ ../common/StringVector.cpp \
+ ../common/Unit.cpp \
../common/Util.cpp
kit_sources = ../kit/ChildSession.cpp \
@@ -36,6 +39,7 @@ net_sources = ../net/FakeSocket.cpp \
wsd_sources = ../wsd/ClientSession.cpp \
../wsd/DocumentBroker.cpp \
../wsd/LOOLWSD.cpp \
+ ../wsd/RequestDetails.cpp \
../wsd/Storage.cpp \
../wsd/TileCache.cpp
commit af091dbb1add066d21485b6f134721a90716dfb5
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Jul 14 15:16:18 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Jul 14 15:46:44 2020 +0200
Revert "cypress: update writer shape related tests."
This reverts commit f3572dc98828b1c5d617f3b503e76c7448fa5439.
Change-Id: I2b12aaa4c4ace0119be98e6d46ce95fdd1ac0f73
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98732
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
index e9c2aeede..01dcd3c71 100644
--- a/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
+++ b/cypress_test/integration_tests/mobile/writer/shape_properties_spec.js
@@ -43,32 +43,15 @@ describe('Change shape properties via mobile wizard.', function() {
function triggerNewSVG() {
mobileHelper.closeMobileWizard();
- // Remove selection first with clicking next to handler
- cy.get('.leaflet-drag-transform-marker.drag-marker--0')
- .then(function(items) {
- var XPos = items[0].getBoundingClientRect().left;
- var YPos = items[0].getBoundingClientRect().top;
- // Sometimes selection is persistent, so click more times
- // to achive actual deselection.
- cy.get('body')
- .click(XPos - 10, YPos);
-
- cy.get('body')
- .dblclick(XPos - 10, YPos);
-
- cy.get('.leaflet-drag-transform-marker')
- .should('not.exist');
-
- // Reselect the shape
- cy.get('body')
- .click(XPos + 20, YPos);
-
- cy.get('body')
- .click(XPos + 20, YPos);
-
- cy.get('.leaflet-drag-transform-marker')
- .should('exist');
- });
+ // Change width
+ openPosSizePanel();
+
+ cy.get('#selectwidth .plus')
+ .should('be.visible');
+
+ helper.clickOnIdle('#selectwidth .plus');
+
+ mobileHelper.closeMobileWizard();
}
function openPosSizePanel() {
@@ -99,6 +82,7 @@ describe('Change shape properties via mobile wizard.', function() {
});
it('Change shape width.', function() {
+
openPosSizePanel();
cy.get('#selectwidth .spinfield')
@@ -114,6 +98,7 @@ describe('Change shape properties via mobile wizard.', function() {
});
it('Change shape height.', function() {
+
openPosSizePanel();
cy.get('#selectheight .spinfield')
@@ -170,7 +155,7 @@ describe('Change shape properties via mobile wizard.', function() {
.should('not.have.attr', 'd', defaultGeometry);
cy.get('.leaflet-pane.leaflet-overlay-pane svg g svg g g g path')
- .should('have.attr', 'd', 'M 7955,4863 L 1963,10855 7955,10855 7955,4863 7955,4863 Z');
+ .should('have.attr', 'd', 'M 8010,4863 L 1963,10855 8010,10855 8010,4863 8010,4863 Z');
});
it('Trigger moving backward / forward', function() {
@@ -217,7 +202,7 @@ describe('Change shape properties via mobile wizard.', function() {
.should('have.length.greaterThan', 12);
});
- it('Change line width', function() {
+ it.skip('Change line width', function() {
openLinePropertyPanel();
cy.get('#linewidth .spinfield')
@@ -229,6 +214,15 @@ describe('Change shape properties via mobile wizard.', function() {
cy.get('.leaflet-pane.leaflet-overlay-pane svg g svg g g g path[fill="none"]')
.should('have.attr', 'stroke-width', '141');
+
+ openLinePropertyPanel();
+
+ helper.clickOnIdle('#linewidth .minus');
+
+ triggerNewSVG();
+
+ cy.get('.leaflet-pane.leaflet-overlay-pane svg g svg g g g path[fill="none"]')
+ .should('have.attr', 'stroke-width', '88');
});
it('Change line transparency', function() {
commit aba09e165b64be795ff21eaa6e23b292bd3f23ff
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Jul 12 12:25:49 2020 -0400
Commit: Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Tue Jul 14 15:35:20 2020 +0200
wsd: improved TileCache
* Excised TileCacheDesc to improve performance and simplify code.
* clang-tidy suggestions and auto-rewrite fixes.
* Const-correctness.
* Inlined and improved a couple of trivial functions (that are called
often).
* Reduced some logs from INF to DBG as they are only meaningful to devs.
Change-Id: I1c4eb8c63da49aa061afbf3eb68cae23d4d5e7f3
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98661
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/common/Rectangle.hpp b/common/Rectangle.hpp
index 0869d207f..05099312a 100644
--- a/common/Rectangle.hpp
+++ b/common/Rectangle.hpp
@@ -51,65 +51,29 @@ public:
_y2 = rectangle._y2;
}
- void setLeft(int x1)
- {
- _x1 = x1;
- }
+ void setLeft(int x1) { _x1 = x1; }
- int getLeft() const
- {
- return _x1;
- }
+ int getLeft() const { return _x1; }
- void setRight(int x2)
- {
- _x2 = x2;
- }
+ void setRight(int x2) { _x2 = x2; }
- int getRight() const
- {
- return _x2;
- }
+ int getRight() const { return _x2; }
- void setTop(int y1)
- {
- _y1 = y1;
- }
+ void setTop(int y1) { _y1 = y1; }
- int getTop() const
- {
- return _y1;
- }
+ int getTop() const { return _y1; }
- void setBottom(int y2)
- {
- _y2 = y2;
- }
+ void setBottom(int y2) { _y2 = y2; }
- int getBottom() const
- {
- return _y2;
- }
+ int getBottom() const { return _y2; }
- int getWidth()
- {
- return _x2 - _x1;
- }
+ int getWidth() const { return _x2 - _x1; }
- int getHeight()
- {
- return _y2 - _y1;
- }
+ int getHeight() const { return _y2 - _y1; }
- bool isValid()
- {
- return _x1 <= _x2 && _y1 <= _y2;
- }
+ bool isValid() const { return _x1 <= _x2 && _y1 <= _y2; }
- bool hasSurface()
- {
- return _x1 < _x2 && _y1 < _y2;
- }
+ bool hasSurface() const { return _x1 < _x2 && _y1 < _y2; }
bool intersects(const Rectangle& rOther)
{
diff --git a/test/TileCacheTests.cpp b/test/TileCacheTests.cpp
index 5a14a4c09..a98dcbe21 100644
--- a/test/TileCacheTests.cpp
+++ b/test/TileCacheTests.cpp
@@ -180,11 +180,12 @@ public:
void TileCacheTests::testDesc()
{
- TileCacheDesc descA = TileDesc(0, 0, 256, 256, 0, 0, 3200, 3200, /* ignored in cache */ 0, 1234, 1, true);
- TileCacheDesc descB = TileDesc(0, 0, 256, 256, 0, 0, 3200, 3200, /* ignored in cache */ 1, 1235, 2, false);
+ TileDesc descA = TileDesc(0, 0, 256, 256, 0, 0, 3200, 3200, /* ignored in cache */ 0, 1234, 1, true);
+ TileDesc descB = TileDesc(0, 0, 256, 256, 0, 0, 3200, 3200, /* ignored in cache */ 1, 1235, 2, false);
- LOK_ASSERT_MESSAGE("versions do match", descA.getVersion() != descB.getVersion());
- LOK_ASSERT_MESSAGE("Compare includes fields it should not", descA == descB);
+ TileDescCacheCompareEq pred;
+ LOK_ASSERT_MESSAGE("TileDesc versions do match", descA.getVersion() != descB.getVersion());
+ LOK_ASSERT_MESSAGE("TileDesc should match, ignoring unimportant fields", pred(descA, descB));
}
void TileCacheTests::testSimple()
diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 76e93fa33..293fff67d 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -1615,10 +1615,10 @@ void ClientSession::removeOutdatedTilesOnFly()
size_t ClientSession::countIdenticalTilesOnFly(const TileDesc& tile) const
{
size_t count = 0;
- std::string tileID = tile.generateID();
- for(auto& tileItem : _tilesOnFly)
+ const std::string tileID = tile.generateID();
+ for (const auto& tileItem : _tilesOnFly)
{
- if(tileItem.first == tileID)
+ if (tileItem.first == tileID)
++count;
}
return count;
diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp
index 6304cd4a9..9802e889c 100644
--- a/wsd/ClientSession.hpp
+++ b/wsd/ClientSession.hpp
@@ -297,7 +297,7 @@ private:
std::string _clipboardKeys[2];
/// TileID's of the sent tiles. Push by sending and pop by tileprocessed message from the client.
- std::list<std::pair<std::string, std::chrono::steady_clock::time_point>> _tilesOnFly;
+ std::vector<std::pair<std::string, std::chrono::steady_clock::time_point>> _tilesOnFly;
/// Requested tiles are stored in this list, before we can send them to the client
std::deque<TileDesc> _requestedTiles;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list