[Libreoffice-commits] online.git: bundled/include Makefile.am
Makefile.am | 12 bundled/include/LibreOfficeKit/LibreOfficeKit.h | 452 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx| 977 --- bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 908 - bundled/include/LibreOfficeKit/LibreOfficeKitInit.h | 356 -- bundled/include/LibreOfficeKit/LibreOfficeKitTypes.h | 37 6 files changed, 7 insertions(+), 2735 deletions(-) New commits: commit b83610704bc8ac031112db8336df22380c9390e7 Author: Andras Timar AuthorDate: Tue Dec 3 15:14:57 2019 +0100 Commit: Andras Timar CommitDate: Fri Dec 6 13:40:09 2019 +0100 remove bundled LOKit headers It was a source of confusion that these bundled headers had to be synced with core all the time, and when it did not happen, the builds broke. Change-Id: Id9d0a8a496b293d20c39e855176a00bcb85df640 Reviewed-on: https://gerrit.libreoffice.org/84358 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/Makefile.am b/Makefile.am index 086ba7613..57a666adb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -230,11 +230,6 @@ kit_headers = kit/ChildSession.hpp \ kit/Watermark.hpp noinst_HEADERS = $(wsd_headers) $(shared_headers) $(kit_headers) \ - bundled/include/LibreOfficeKit/LibreOfficeKit.h \ - bundled/include/LibreOfficeKit/LibreOfficeKit.hxx \ - bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h \ - bundled/include/LibreOfficeKit/LibreOfficeKitInit.h \ - bundled/include/LibreOfficeKit/LibreOfficeKitTypes.h \ test/WopiTestServer.hpp \ test/countloolkits.hpp \ test/test.hpp \ @@ -242,6 +237,13 @@ noinst_HEADERS = $(wsd_headers) $(shared_headers) $(kit_headers) \ dist-hook: git log -1 --format=%h > $(distdir)/dist_git_hash 2> /dev/null || rm $(distdir)/dist_git_hash + mkdir -p $(distdir)/bundled/include/LibreOfficeKit/ + cp @LOKIT_PATH@/LibreOfficeKit/LibreOfficeKit.h \ + @LOKIT_PATH@/LibreOfficeKit/LibreOfficeKit.hxx \ + @LOKIT_PATH@/LibreOfficeKit/LibreOfficeKitEnums.h \ + @LOKIT_PATH@/LibreOfficeKit/LibreOfficeKitInit.h \ + @LOKIT_PATH@/LibreOfficeKit/LibreOfficeKitTypes.h \ + $(distdir)/bundled/include/LibreOfficeKit/ EXTRA_DIST = discovery.xml \ favicon.ico \ diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h deleted file mode 100644 index 4c9e6c66b..0 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ /dev/null @@ -1,452 +0,0 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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/. - */ - -#ifndef INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKIT_H -#define INCLUDED_LIBREOFFICEKIT_LIBREOFFICEKIT_H - -#include - -// the unstable API needs C99's bool -// TODO remove the C99 types from the API before making stable -#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY -# ifndef _WIN32 -# include -# endif -# include -#endif - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -typedef struct _LibreOfficeKit LibreOfficeKit; -typedef struct _LibreOfficeKitClass LibreOfficeKitClass; - -typedef struct _LibreOfficeKitDocument LibreOfficeKitDocument; -typedef struct _LibreOfficeKitDocumentClass LibreOfficeKitDocumentClass; - -// Do we have an extended member in this struct ? -#define LIBREOFFICEKIT_HAS_MEMBER(strct,member,nSize) \ -(offsetof(strct, member) < (nSize)) - -#define LIBREOFFICEKIT_HAS(pKit,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitClass,member,(pKit)->pClass->nSize) - -struct _LibreOfficeKit -{ -LibreOfficeKitClass* pClass; -}; - -struct _LibreOfficeKitClass -{ -size_t nSize; - -void (*destroy) (LibreOfficeKit* pThis); - -LibreOfficeKitDocument* (*documentLoad) (LibreOfficeKit* pThis, - const char* pURL); - -char* (*getError) (LibreOfficeKit* pThis); - -/// @since LibreOffice 5.0 -LibreOfficeKitDocument* (*documentLoadWithOptions) (LibreOfficeKit* pThis, -const char* pURL, -const char* pOptions); -/// @since LibreOffice 5.2 -void (*freeError) (char* pFree); - -/// @since LibreOffice 6.0 -void (*registerCallback) (LibreOfficeKit* pThis, - LibreOfficeKitCallback pCallback, - void* pData); - -/** @see lok::Office::getFilterTypes(). -@since LibreOffice 6.0 - */ -char*
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/ChildSession.hpp loleaflet/src wsd/ClientSession.cpp
bundled/include/LibreOfficeKit/LibreOfficeKit.h |4 +++ bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 10 + kit/ChildSession.cpp | 24 +- kit/ChildSession.hpp |1 loleaflet/src/control/Control.JSDialogBuilder.js |4 +++ loleaflet/src/layer/tile/TileLayer.js |4 +-- wsd/ClientSession.cpp | 17 ++- 7 files changed, 60 insertions(+), 4 deletions(-) New commits: commit 836ce7d636e8a2d0fec1e9c9801c3125df1c5d65 Author: Marco Cecchetti AuthorDate: Wed Nov 27 22:56:50 2019 +0100 Commit: Marco Cecchetti CommitDate: Mon Dec 2 17:34:13 2019 +0100 formula bar: function complete lok clients can request to complete a function name partially typed in the formula input box. Change-Id: If8e4485c5ed9f91a594dfcec04e0c0b10becdcd0 Reviewed-on: https://gerrit.libreoffice.org/83985 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index a486886c1..4c9e6c66b 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -436,6 +436,10 @@ struct _LibreOfficeKitDocumentClass const double dpiscale, int viewId); +/// @see lok::Document::completeFunction +void (*completeFunction) (LibreOfficeKitDocument* pThis, + int nIndex); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index ae17e4e71..d50ef4823 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -757,6 +757,16 @@ public: mpDoc->pClass->removeTextContext(mpDoc, nWindowId, nBefore, nAfter); } +/** + * Select the Calc function to be pasted into the formula input box + * + * @param nIndex is the index of the selected function + */ +void completeFunction(int nIndex) +{ +mpDoc->pClass->completeFunction(mpDoc, nIndex); +} + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index d07125a5c..7e8c1f70c 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -296,7 +296,8 @@ bool ChildSession::_handleInput(const char *buffer, int length) tokens[0] == "exportsignanduploaddocument" || tokens[0] == "rendershapeselection" || tokens[0] == "removetextcontext" || - tokens[0] == "dialogevent"); + tokens[0] == "dialogevent" || + tokens[0] == "completefunction"); if (tokens[0] == "clientzoom") { @@ -432,6 +433,10 @@ bool ChildSession::_handleInput(const char *buffer, int length) { return dialogEvent(buffer, length, tokens); } +else if (tokens[0] == "completefunction") +{ +return completeFunction(buffer, length, tokens); +} else { assert(false && "Unknown command token."); @@ -1405,6 +1410,23 @@ bool ChildSession::dialogEvent(const char* /*buffer*/, int /*length*/, const std return true; } +bool ChildSession::completeFunction(const char* /*buffer*/, int /*length*/, const std::vector& tokens) +{ +int index; + +if (tokens.size() != 2 || +!getTokenInteger(tokens[1], "index", index)) +{ +sendTextFrame("error: cmd=completefunction kind=syntax"); +return false; +} + +getLOKitDocument()->setView(_viewId); + +getLOKitDocument()->completeFunction(index); +return true; +} + bool ChildSession::unoCommand(const char* /*buffer*/, int /*length*/, const std::vector& tokens) { if (tokens.size() <= 1) diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp index 88e445671..8404bcddc 100644 --- a/kit/ChildSession.hpp +++ b/kit/ChildSession.hpp @@ -262,6 +262,7 @@ private: bool mouseEvent(const char* buffer, int length, const std::vector& tokens, const LokEventTargetEnum target); bool gestureEvent(const char* buffer, int length, const std::vector& tokens); bool dialogEvent(const char* buffer, int length, const std::vector& tokens); +bool completeFunction(const char* buffer, int length, const std::vector& tokens); bool unoCommand(const char* buffer, int length, const std::vector& tokens); bool selectText(const char* buffer, int length, const std::vector& tokens); bool selectGraphic(const char* buffer, int length, const std::vector& tokens); diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h |9 + bundled/include/LibreOfficeKit/LibreOfficeKit.hxx |7 --- 2 files changed, 13 insertions(+), 3 deletions(-) New commits: commit 983a493ca5466e9b2942e61afbf2fb852b60b237 Author: Andras Timar AuthorDate: Sun Dec 1 11:47:35 2019 +0100 Commit: Andras Timar CommitDate: Sun Dec 1 11:47:35 2019 +0100 Update bundled LibreOfficeKit headers Change-Id: I9a1864d6258cf9efa2dae9e150814c780e5054f2 diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 78f2b478e..a486886c1 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -427,6 +427,15 @@ struct _LibreOfficeKitDocumentClass int* pFontHeight, int pOrientation); +/// Switches view to viewId if viewId >= 0, and paints window +/// @see lok::Document::paintWindowDPI(). +void (*paintWindowForView) (LibreOfficeKitDocument* pThis, unsigned nWindowId, +unsigned char* pBuffer, +const int x, const int y, +const int width, const int height, +const double dpiscale, +int viewId); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 3b2d0ba7b..ae17e4e71 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -177,10 +177,11 @@ public: const int y, const int width, const int height, - const double dpiscale = 1.0) + const double dpiscale = 1.0, + const int viewId = -1) { -return mpDoc->pClass->paintWindowDPI(mpDoc, nWindowId, pBuffer, - x, y, width, height, dpiscale); +return mpDoc->pClass->paintWindowForView(mpDoc, nWindowId, pBuffer, x, y, + width, height, dpiscale, viewId); } /** ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 2bc1e8b6e21f0e486e588fb3fac0abff5d4dc7d0 Author: Andras Timar AuthorDate: Tue Nov 26 09:42:02 2019 +0100 Commit: Andras Timar CommitDate: Tue Nov 26 09:42:16 2019 +0100 sync LOKit headers with core (only comments) Change-Id: I7a073500732e8d9d181588a835fe1905c0cf7a58 diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index e620fb6c3..7ef3a3884 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -267,6 +267,10 @@ typedef enum * * Payload format is "width, height", i.e. clients get the new size without * having to do an explicit lok::Document::getDocumentSize() call. + * + * A size change is always preceeded by a series of + * LOK_CALLBACK_INVALIDATE_TILES events invalidating any areas + * need re-rendering to adapt. */ LOK_CALLBACK_DOCUMENT_SIZE_CHANGED = 13, @@ -713,7 +717,7 @@ typedef enum /** * Send the list of functions whose name starts with the characters entered - * by the user. + * by the user in the formula input bar. */ LOK_CALLBACK_CALC_FUNCTION_LIST = 47 } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h |8 1 file changed, 8 deletions(-) New commits: commit ada90815cf2b850a1ffa403a152d3bd72ceeceeb Author: Ashod Nakashian AuthorDate: Mon Nov 11 08:15:31 2019 -0500 Commit: Ashod Nakashian CommitDate: Mon Nov 11 14:17:35 2019 +0100 wsd: remove duplicate renderFontOrientation from bundled headers Change-Id: I91d4e2a9c76f6d62d0219e22442c8bf538a63908 Reviewed-on: https://gerrit.libreoffice.org/82438 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 2ca8631ed..78f2b478e 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -262,14 +262,6 @@ struct _LibreOfficeKitDocumentClass int* pFontWidth, int* pFontHeight); -/// @see lok::Document::renderFontOrientation(). -unsigned char* (*renderFontOrientation) (LibreOfficeKitDocument* pThis, - const char* pFontName, - const char* pChar, - int* pFontWidth, - int* pFontHeight, - int pOrientation); - /// @see lok::Document::getPartHash(). char* (*getPartHash) (LibreOfficeKitDocument* pThis, int nPart); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include kit/DummyLibreOfficeKit.cpp kit/Watermark.hpp
bundled/include/LibreOfficeKit/LibreOfficeKit.h |8 kit/DummyLibreOfficeKit.cpp | 23 +++ kit/Watermark.hpp |2 +- 3 files changed, 32 insertions(+), 1 deletion(-) New commits: commit 2c598ba4ef8015e9fd2a5a6ffe9fa064dbbead4e Author: mert AuthorDate: Thu Oct 24 12:13:46 2019 +0300 Commit: Ashod Nakashian CommitDate: Sun Nov 10 23:42:03 2019 +0100 Rotate Watermarks with 45 degree angle Change-Id: I9b399a4e1daf52f536d4becae2cc6dc692e16f7a Reviewed-on: https://gerrit.libreoffice.org/81436 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 78f2b478e..2ca8631ed 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -262,6 +262,14 @@ struct _LibreOfficeKitDocumentClass int* pFontWidth, int* pFontHeight); +/// @see lok::Document::renderFontOrientation(). +unsigned char* (*renderFontOrientation) (LibreOfficeKitDocument* pThis, + const char* pFontName, + const char* pChar, + int* pFontWidth, + int* pFontHeight, + int pOrientation); + /// @see lok::Document::getPartHash(). char* (*getPartHash) (LibreOfficeKitDocument* pThis, int nPart); diff --git a/kit/DummyLibreOfficeKit.cpp b/kit/DummyLibreOfficeKit.cpp index 1c70ce2ea..323da0e43 100644 --- a/kit/DummyLibreOfficeKit.cpp +++ b/kit/DummyLibreOfficeKit.cpp @@ -122,6 +122,12 @@ static unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis, const char *pChar, int* pFontWidth, int* pFontHeight); +static unsigned char* doc_renderFontOrientation(LibreOfficeKitDocument* pThis, + const char *pFontName, + const char *pChar, + int* pFontWidth, + int* pFontHeight, + int pOrientation); static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart); static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOutput); @@ -170,6 +176,7 @@ LibLODocument_Impl::LibLODocument_Impl() m_pDocumentClass->getViewIds = doc_getViewIds; m_pDocumentClass->renderFont = doc_renderFont; +m_pDocumentClass->renderFontOrientation = doc_renderFontOrientation; m_pDocumentClass->getPartHash = doc_getPartHash; m_pDocumentClass->renderShapeSelection = doc_renderShapeSelection; @@ -527,6 +534,22 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/, return nullptr; } +unsigned char* doc_renderFontOrientation(LibreOfficeKitDocument* /*pThis*/, +const char* pFontName, +const char* pChar, +int* pFontWidth, +int* pFontHeight, +int pOrientation) +{ +(void) pFontName; +(void) pChar; +(void) pFontWidth; +(void) pFontHeight; +(void) pOrientation; + +return nullptr; +} + static size_t doc_renderShapeSelection(LibreOfficeKitDocument* pThis, char** pOutput) { (void) pThis; diff --git a/kit/Watermark.hpp b/kit/Watermark.hpp index 40d6c35d3..79fd5fb2c 100644 --- a/kit/Watermark.hpp +++ b/kit/Watermark.hpp @@ -114,7 +114,7 @@ private: // are always set to 0 (black) and the alpha level is 0 everywhere // except on the text area; the alpha level take into account of // performing anti-aliasing over the text edges. -unsigned char* textPixels = _loKitDoc->renderFont(_font.c_str(), _text.c_str(), &_width, &_height); +unsigned char* textPixels = _loKitDoc->renderFont(_font.c_str(), _text.c_str(), &_width, &_height, 450); if (!textPixels) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h |8 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx |8 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) New commits: commit 5c34a55eff338f4d828c3479fec513060d032f81 Author: Ashod Nakashian AuthorDate: Sat Nov 9 21:42:54 2019 -0500 Commit: Ashod Nakashian CommitDate: Sun Nov 10 23:41:27 2019 +0100 wsd: update bundled headers Change-Id: I142d6b39c91215b34815bdb425942b3d1298e1b4 Reviewed-on: https://gerrit.libreoffice.org/82396 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 29d834969..78f2b478e 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -419,6 +419,14 @@ struct _LibreOfficeKitDocumentClass unsigned nLOKWindowId, const char* pArguments); +/// @see lok::Document::renderFontOrientation(). +unsigned char* (*renderFontOrientation) (LibreOfficeKitDocument* pThis, + const char* pFontName, + const char* pChar, + int* pFontWidth, + int* pFontHeight, + int pOrientation); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 26093f387..3b2d0ba7b 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -556,9 +556,13 @@ public: unsigned char* renderFont(const char *pFontName, const char *pChar, int *pFontWidth, - int *pFontHeight) + int *pFontHeight, + int pOrientation = 0) { -return mpDoc->pClass->renderFont(mpDoc, pFontName, pChar, pFontWidth, pFontHeight); +if (LIBREOFFICEKIT_DOCUMENT_HAS(mpDoc, renderFontOrientation)) +return mpDoc->pClass->renderFontOrientation(mpDoc, pFontName, pChar, pFontWidth, pFontHeight, pOrientation); +else +return mpDoc->pClass->renderFont(mpDoc, pFontName, pChar, pFontWidth, pFontHeight); } /** ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 443ed3274fda3c678508f18f6a356db9cd96 Author: Aron Budea AuthorDate: Mon Oct 21 20:18:15 2019 +0200 Commit: Aron Budea CommitDate: Mon Oct 21 20:20:45 2019 +0200 lokit: fix order of functions 74ce4a9261e69cb80e034b9be2a1e6345c28389e introduced a different order than in core. Change-Id: I4d601e1fcd3028c7bbe9d0119c15193fe1db1f35 Reviewed-on: https://gerrit.libreoffice.org/81270 Reviewed-by: Aron Budea Tested-by: Aron Budea diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 2e846c7fa..29d834969 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -199,11 +199,6 @@ struct _LibreOfficeKitDocumentClass int nButtons, int nModifier); -/// @see lok::Document::sendDialogEvent -void (*sendDialogEvent) (LibreOfficeKitDocument* pThis, -unsigned nLOKWindowId, -const char* pArguments); - /// @see lok::Document::postUnoCommand void (*postUnoCommand) (LibreOfficeKitDocument* pThis, const char* pCommand, @@ -419,6 +414,11 @@ struct _LibreOfficeKitDocumentClass int nBefore, int nAfter); +/// @see lok::Document::sendDialogEvent +void (*sendDialogEvent) (LibreOfficeKitDocument* pThis, +unsigned nLOKWindowId, +const char* pArguments); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/ChildSession.hpp loleaflet/src wsd/ClientSession.cpp
bundled/include/LibreOfficeKit/LibreOfficeKit.h |5 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 11 + kit/ChildSession.cpp | 25 +- kit/ChildSession.hpp |1 loleaflet/src/control/Control.JSDialogBuilder.js |4 ++- loleaflet/src/control/Control.LokDialog.js|2 + wsd/ClientSession.cpp |7 +- 7 files changed, 52 insertions(+), 3 deletions(-) New commits: commit 74ce4a9261e69cb80e034b9be2a1e6345c28389e Author: Szymon Kłos AuthorDate: Mon Oct 14 18:02:28 2019 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 15 15:59:16 2019 +0200 jsdialogs: send events to the core Change-Id: I23a5a14b93bda205c9c276a697e58d1dc4147f0c Reviewed-on: https://gerrit.libreoffice.org/80838 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 6060b015b..2e846c7fa 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -199,6 +199,11 @@ struct _LibreOfficeKitDocumentClass int nButtons, int nModifier); +/// @see lok::Document::sendDialogEvent +void (*sendDialogEvent) (LibreOfficeKitDocument* pThis, +unsigned nLOKWindowId, +const char* pArguments); + /// @see lok::Document::postUnoCommand void (*postUnoCommand) (LibreOfficeKitDocument* pThis, const char* pCommand, diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index a695c4113..26093f387 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -303,6 +303,17 @@ public: } /** + * Posts a dialog event for the window with given id + * + * @param nWindowId id of the window to notify + * @param pArguments arguments of the event. + */ +void sendDialogEvent(unsigned nWindowId, const char* pArguments = NULL) +{ +mpDoc->pClass->sendDialogEvent(mpDoc, nWindowId, pArguments); +} + +/** * Posts an UNO command to the document. * * Example argument string: diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index cd38ec7a7..05c9ba772 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -42,6 +42,7 @@ #include #include #include +#include using Poco::JSON::Object; using Poco::JSON::Parser; @@ -295,7 +296,8 @@ bool ChildSession::_handleInput(const char *buffer, int length) tokens[0] == "uploadsigneddocument" || tokens[0] == "exportsignanduploaddocument" || tokens[0] == "rendershapeselection" || - tokens[0] == "removetextcontext"); + tokens[0] == "removetextcontext" || + tokens[0] == "dialogevent"); if (tokens[0] == "clientzoom") { @@ -419,6 +421,10 @@ bool ChildSession::_handleInput(const char *buffer, int length) { return removeTextContext(buffer, length, tokens); } +else if (tokens[0] == "dialogevent") +{ +return dialogEvent(buffer, length, tokens); +} else { assert(false && "Unknown command token."); @@ -1375,6 +1381,23 @@ bool ChildSession::mouseEvent(const char* /*buffer*/, int /*length*/, return true; } +bool ChildSession::dialogEvent(const char* /*buffer*/, int /*length*/, const std::vector& tokens) +{ +if (tokens.size() <= 2) +{ +sendTextFrame("error: cmd=dialogevent kind=syntax"); +return false; +} + +getLOKitDocument()->setView(_viewId); + +unsigned nLOKWindowId = std::stoi(tokens[1].c_str()); +getLOKitDocument()->sendDialogEvent(nLOKWindowId, +Poco::cat(std::string(" "), tokens.begin() + 2, tokens.end()).c_str()); + +return true; +} + bool ChildSession::unoCommand(const char* /*buffer*/, int /*length*/, const std::vector& tokens) { if (tokens.size() <= 1) diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp index 88166a0c4..971b4158b 100644 --- a/kit/ChildSession.hpp +++ b/kit/ChildSession.hpp @@ -259,6 +259,7 @@ private: bool dialogKeyEvent(const char* buffer, int length, const std::vector& tokens); bool mouseEvent(const char* buffer, int length, const std::vector& tokens, const LokEventTargetEnum target); bool gestureEvent(const char* buffer, int length, const std::vector& tokens); +bool dialogEvent(const char* buffer, int length, const std::vector& tokens); bool unoCommand(const char* buffer, int length, const std::vector& tokens); bool selectText(const char* buffer, int length, const std::vector& tokens); bool
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/ChildSession.hpp loleaflet/src wsd/ClientSession.cpp
bundled/include/LibreOfficeKit/LibreOfficeKit.h |5 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 11 - kit/ChildSession.cpp | 25 -- kit/ChildSession.hpp |1 loleaflet/src/control/Control.JSDialogBuilder.js |4 --- loleaflet/src/control/Control.LokDialog.js|2 - wsd/ClientSession.cpp |7 -- 7 files changed, 3 insertions(+), 52 deletions(-) New commits: commit ca4351e6ef5be85378e4a88833510f326c37c06c Author: Szymon Kłos AuthorDate: Tue Oct 15 14:06:08 2019 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 15 14:06:08 2019 +0200 Revert "jsdialogs: send events to the core" core not yet ready This reverts commit 80ecaa60f62aa41584ef1ab8b040806f8d92a0a7. diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 2e846c7fa..6060b015b 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -199,11 +199,6 @@ struct _LibreOfficeKitDocumentClass int nButtons, int nModifier); -/// @see lok::Document::sendDialogEvent -void (*sendDialogEvent) (LibreOfficeKitDocument* pThis, -unsigned nLOKWindowId, -const char* pArguments); - /// @see lok::Document::postUnoCommand void (*postUnoCommand) (LibreOfficeKitDocument* pThis, const char* pCommand, diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 26093f387..a695c4113 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -303,17 +303,6 @@ public: } /** - * Posts a dialog event for the window with given id - * - * @param nWindowId id of the window to notify - * @param pArguments arguments of the event. - */ -void sendDialogEvent(unsigned nWindowId, const char* pArguments = NULL) -{ -mpDoc->pClass->sendDialogEvent(mpDoc, nWindowId, pArguments); -} - -/** * Posts an UNO command to the document. * * Example argument string: diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 05c9ba772..cd38ec7a7 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -42,7 +42,6 @@ #include #include #include -#include using Poco::JSON::Object; using Poco::JSON::Parser; @@ -296,8 +295,7 @@ bool ChildSession::_handleInput(const char *buffer, int length) tokens[0] == "uploadsigneddocument" || tokens[0] == "exportsignanduploaddocument" || tokens[0] == "rendershapeselection" || - tokens[0] == "removetextcontext" || - tokens[0] == "dialogevent"); + tokens[0] == "removetextcontext"); if (tokens[0] == "clientzoom") { @@ -421,10 +419,6 @@ bool ChildSession::_handleInput(const char *buffer, int length) { return removeTextContext(buffer, length, tokens); } -else if (tokens[0] == "dialogevent") -{ -return dialogEvent(buffer, length, tokens); -} else { assert(false && "Unknown command token."); @@ -1381,23 +1375,6 @@ bool ChildSession::mouseEvent(const char* /*buffer*/, int /*length*/, return true; } -bool ChildSession::dialogEvent(const char* /*buffer*/, int /*length*/, const std::vector& tokens) -{ -if (tokens.size() <= 2) -{ -sendTextFrame("error: cmd=dialogevent kind=syntax"); -return false; -} - -getLOKitDocument()->setView(_viewId); - -unsigned nLOKWindowId = std::stoi(tokens[1].c_str()); -getLOKitDocument()->sendDialogEvent(nLOKWindowId, -Poco::cat(std::string(" "), tokens.begin() + 2, tokens.end()).c_str()); - -return true; -} - bool ChildSession::unoCommand(const char* /*buffer*/, int /*length*/, const std::vector& tokens) { if (tokens.size() <= 1) diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp index 971b4158b..88166a0c4 100644 --- a/kit/ChildSession.hpp +++ b/kit/ChildSession.hpp @@ -259,7 +259,6 @@ private: bool dialogKeyEvent(const char* buffer, int length, const std::vector& tokens); bool mouseEvent(const char* buffer, int length, const std::vector& tokens, const LokEventTargetEnum target); bool gestureEvent(const char* buffer, int length, const std::vector& tokens); -bool dialogEvent(const char* buffer, int length, const std::vector& tokens); bool unoCommand(const char* buffer, int length, const std::vector& tokens); bool selectText(const char* buffer, int length, const std::vector& tokens); bool selectGraphic(const char* buffer, int length, const std::vector&
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/ChildSession.hpp loleaflet/src wsd/ClientSession.cpp
bundled/include/LibreOfficeKit/LibreOfficeKit.h |5 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 11 + kit/ChildSession.cpp | 25 +- kit/ChildSession.hpp |1 loleaflet/src/control/Control.JSDialogBuilder.js |4 ++- loleaflet/src/control/Control.LokDialog.js|2 + wsd/ClientSession.cpp |7 +- 7 files changed, 52 insertions(+), 3 deletions(-) New commits: commit 80ecaa60f62aa41584ef1ab8b040806f8d92a0a7 Author: Szymon Kłos AuthorDate: Mon Oct 14 18:02:28 2019 +0200 Commit: Szymon Kłos CommitDate: Mon Oct 14 19:18:07 2019 +0200 jsdialogs: send events to the core Change-Id: I23a5a14b93bda205c9c276a697e58d1dc4147f0c diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 6060b015b..2e846c7fa 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -199,6 +199,11 @@ struct _LibreOfficeKitDocumentClass int nButtons, int nModifier); +/// @see lok::Document::sendDialogEvent +void (*sendDialogEvent) (LibreOfficeKitDocument* pThis, +unsigned nLOKWindowId, +const char* pArguments); + /// @see lok::Document::postUnoCommand void (*postUnoCommand) (LibreOfficeKitDocument* pThis, const char* pCommand, diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index a695c4113..26093f387 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -303,6 +303,17 @@ public: } /** + * Posts a dialog event for the window with given id + * + * @param nWindowId id of the window to notify + * @param pArguments arguments of the event. + */ +void sendDialogEvent(unsigned nWindowId, const char* pArguments = NULL) +{ +mpDoc->pClass->sendDialogEvent(mpDoc, nWindowId, pArguments); +} + +/** * Posts an UNO command to the document. * * Example argument string: diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index cd38ec7a7..05c9ba772 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -42,6 +42,7 @@ #include #include #include +#include using Poco::JSON::Object; using Poco::JSON::Parser; @@ -295,7 +296,8 @@ bool ChildSession::_handleInput(const char *buffer, int length) tokens[0] == "uploadsigneddocument" || tokens[0] == "exportsignanduploaddocument" || tokens[0] == "rendershapeselection" || - tokens[0] == "removetextcontext"); + tokens[0] == "removetextcontext" || + tokens[0] == "dialogevent"); if (tokens[0] == "clientzoom") { @@ -419,6 +421,10 @@ bool ChildSession::_handleInput(const char *buffer, int length) { return removeTextContext(buffer, length, tokens); } +else if (tokens[0] == "dialogevent") +{ +return dialogEvent(buffer, length, tokens); +} else { assert(false && "Unknown command token."); @@ -1375,6 +1381,23 @@ bool ChildSession::mouseEvent(const char* /*buffer*/, int /*length*/, return true; } +bool ChildSession::dialogEvent(const char* /*buffer*/, int /*length*/, const std::vector& tokens) +{ +if (tokens.size() <= 2) +{ +sendTextFrame("error: cmd=dialogevent kind=syntax"); +return false; +} + +getLOKitDocument()->setView(_viewId); + +unsigned nLOKWindowId = std::stoi(tokens[1].c_str()); +getLOKitDocument()->sendDialogEvent(nLOKWindowId, +Poco::cat(std::string(" "), tokens.begin() + 2, tokens.end()).c_str()); + +return true; +} + bool ChildSession::unoCommand(const char* /*buffer*/, int /*length*/, const std::vector& tokens) { if (tokens.size() <= 1) diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp index 88166a0c4..971b4158b 100644 --- a/kit/ChildSession.hpp +++ b/kit/ChildSession.hpp @@ -259,6 +259,7 @@ private: bool dialogKeyEvent(const char* buffer, int length, const std::vector& tokens); bool mouseEvent(const char* buffer, int length, const std::vector& tokens, const LokEventTargetEnum target); bool gestureEvent(const char* buffer, int length, const std::vector& tokens); +bool dialogEvent(const char* buffer, int length, const std::vector& tokens); bool unoCommand(const char* buffer, int length, const std::vector& tokens); bool selectText(const char* buffer, int length, const std::vector& tokens); bool selectGraphic(const char* buffer, int length, const std::vector& tokens); diff --git
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 24 +++ kit/ChildSession.cpp |6 2 files changed, 30 insertions(+) New commits: commit 04b7b4bc6195cc9a7e6f637edd86574f0059 Author: Szymon Kłos AuthorDate: Fri Sep 27 12:50:12 2019 +0200 Commit: Szymon Kłos CommitDate: Fri Sep 27 22:39:04 2019 +0200 jsdialogs: introduce LOK_CALLBACK_JSDIALOG enum value Change-Id: Ib1175dedcc8b6c66a10f81915da07b3bcfe0b3f1 Reviewed-on: https://gerrit.libreoffice.org/79717 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index 44bf83eab..40696da13 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -685,6 +685,26 @@ typedef enum * cell. */ LOK_CALLBACK_TABLE_SELECTED = 44, + +/* + * Show reference marks from payload. + * + * Example payload: + * { + * "marks": [ + * { "rectangle": "3825, 3315, 1245, 2010", "color": "ff", "part": "0" }, + * { "rectangle": "8925, 4335, 2520, 735", "color": "ff", "part": "0" }, + * ... + * ] + * } + */ +LOK_CALLBACK_REFERENCE_MARKS = 45, + +/** + * Callback related to native dialogs generated in JavaScript from + * the description. + */ +LOK_CALLBACK_JSDIALOG = 46, } LibreOfficeKitCallbackType; @@ -803,6 +823,10 @@ static inline const char* lokCallbackTypeToString(int nType) return "LOK_CALLBACK_CELL_AUTO_FILL_AREA"; case LOK_CALLBACK_TABLE_SELECTED: return "LOK_CALLBACK_TABLE_SELECTED"; +case LOK_CALLBACK_REFERENCE_MARKS: +return "LOK_CALLBACK_REFERENCE_MARKS"; +case LOK_CALLBACK_JSDIALOG: +return "LOK_CALLBACK_JSDIALOG"; } assert(!"Unknown LibreOfficeKitCallbackType type."); diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 7e5d87c4a..b201e4d34 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -2394,6 +2394,12 @@ void ChildSession::loKitCallback(const int type, const std::string& payload) case LOK_CALLBACK_TABLE_SELECTED: sendTextFrame("tableselected: " + payload); break; +case LOK_CALLBACK_REFERENCE_MARKS: +// TODO +break; +case LOK_CALLBACK_JSDIALOG: +sendTextFrame("jsdialog: " + payload); +break; #if !ENABLE_DEBUG // we want a compilation-time failure in the debug builds; but ERR in the ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/Kit.cpp kit/KitHelper.hpp tools/KitClient.cpp
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 30 + bundled/include/LibreOfficeKit/LibreOfficeKit.hxx| 38 +- bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 112 +++ kit/ChildSession.cpp | 23 +-- kit/Kit.cpp |8 - kit/KitHelper.hpp| 101 - tools/KitClient.cpp | 54 - 7 files changed, 193 insertions(+), 173 deletions(-) New commits: commit 32007cbb329f4d2bb1b44d0353ad141996d623f7 Author: Ashod Nakashian AuthorDate: Fri Aug 16 09:24:38 2019 -0400 Commit: Ashod Nakashian CommitDate: Sat Aug 17 03:38:08 2019 +0200 Update LOK headers and reuse callback-type-to-string helper Also, avoid repeatedly converting INT_MAX to string. It's an arbitrary large number, so use 1 billion, which is probably more easily recognizable as an arbitrary large number. Change-Id: Ie6f898d6e8978efa29c355f3cb50b60114870f0d Reviewed-on: https://gerrit.libreoffice.org/77593 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index e4e96483c..93b430f5d 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -378,6 +378,36 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::createViewWithOptions(). int (*createViewWithOptions) (LibreOfficeKitDocument* pThis, const char* pOptions); +/// @see lok::Document::selectPart(). +void (*selectPart) (LibreOfficeKitDocument* pThis, int nPart, int nSelect); + +/// @see lok::Document::moveSelectedParts(). +void (*moveSelectedParts) (LibreOfficeKitDocument* pThis, int nPosition, bool bDuplicate); + +/// Resize window with given id. +/// @see lok::Document::resizeWindow(). +void (*resizeWindow) (LibreOfficeKitDocument* pThis, unsigned nWindowId, + const int width, const int height); + +/// Pass a nullptr terminated array of mime-type strings +/// @see lok::Document::getClipboard for more details +int (*getClipboard) (LibreOfficeKitDocument* pThis, + const char **pMimeTypes, + size_t *pOutCount, + char ***pOutMimeTypes, + size_t **pOutSizes, + char ***pOutStreams); + +/// @see lok::Document::setClipboard +int (*setClipboard) (LibreOfficeKitDocument* pThis, + const size_t nInCount, + const char **pInMimeTypes, + const size_t *pInSizes, + const char **pInStreams); + +/// @see lok::Document::getSelectionType +int (*getSelectionType) (LibreOfficeKitDocument* pThis); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 0d1c6e94d..517a38a50 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -188,7 +188,7 @@ public: * * @param nWindowid */ -void postWindow(unsigned nWindowId, int nAction, const char* pData) +void postWindow(unsigned nWindowId, int nAction, const char* pData = nullptr) { return mpDoc->pClass->postWindow(mpDoc, nWindowId, nAction, pData); } @@ -436,7 +436,7 @@ public: /** * Returns a json mapping of the possible values for the given command * e.g. {commandName: ".uno:StyleApply", commandValues: {"familyName1" : ["list of style names in the family1"], etc.}} - * @param pCommand a uno command for which the possible values are requested + * @param pCommand a UNO command for which the possible values are requested * @return {commandName: unoCmd, commandValues: {possible_values}} */ char* getCommandValues(const char* pCommand) @@ -676,7 +676,7 @@ public: /** * Gets an image of the selected shapes. * @param pOutput contains the result; use free to deallocate. - * @return the size ouf *pOutput in bytes. + * @return the size of *pOutput in bytes. */ size_t renderShapeSelection(char** pOutput) { @@ -698,6 +698,36 @@ public: { return mpDoc->pClass->postWindowGestureEvent(mpDoc, nWindowId, pType, nX, nY, nOffset); } + +/// Set a part's selection mode. +/// nSelect is 0 to deselect, 1 to select, and 2 to toggle. +void selectPart(int nPart, int nSelect) +{ +mpDoc->pClass->selectPart(mpDoc, nPart, nSelect); +} + +/// Moves the selected pages/slides to a new position. +/// nPosition is the new position where the
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/KitHelper.hpp loleaflet/build loleaflet/css loleaflet/images loleaflet/Makefile.am loleaflet/src tools/KitClient.cpp
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |9 kit/ChildSession.cpp |3 kit/KitHelper.hpp|2 loleaflet/Makefile.am|1 loleaflet/build/deps.js |3 loleaflet/css/loleaflet.css | 20 + loleaflet/images/table-column-resize-marker.svg | 10 loleaflet/images/table-row-resize-marker.svg | 10 loleaflet/src/layer/tile/TileLayer.TableOverlay.js | 191 +++ loleaflet/src/layer/tile/TileLayer.js|5 tools/KitClient.cpp |1 11 files changed, 254 insertions(+), 1 deletion(-) New commits: commit cc7060293945a6d45bf83376a456c57165a10f2f Author: Tomaž Vajngerl AuthorDate: Wed Aug 14 18:13:40 2019 +0900 Commit: Tomaž Vajngerl CommitDate: Thu Aug 15 05:16:04 2019 +0200 tdf#122529 Support for table overlay - column/row change markers This adds table markers for resizing rows and columns if the user has the table selected or the cursor is in the table. The code reacts to the callback "tableselected:", where the markers are created for each column and row, if the payload (json) of course has any data. When the marker is dragged, a uno command to resize the table column or row border is send to the core. Change-Id: I9b21d09639c1b2be70a1a897f9e3340b453d847e Reviewed-on: https://gerrit.libreoffice.org/77360 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index 4277adbe6..0c8e5938f 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -665,6 +665,15 @@ typedef enum * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. */ LOK_CALLBACK_CELL_AUTO_FILL_AREA = 43, + +/** + * When the cursor is in a table or a table is selected in the + * document, this sends the table's column and row border positions + * to the client. If the payload is empty (empty JSON object), then + * no table is currently selected or the cursor is not inside a table + * cell. + */ +LOK_CALLBACK_TABLE_SELECTED = 44, } LibreOfficeKitCallbackType; diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 9684553e9..428808835 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -2296,6 +2296,9 @@ void ChildSession::loKitCallback(const int type, const std::string& payload) case LOK_CALLBACK_CELL_AUTO_FILL_AREA: sendTextFrame("cellautofillarea: " + payload); break; +case LOK_CALLBACK_TABLE_SELECTED: +sendTextFrame("tableselected: " + payload); +break; #if !ENABLE_DEBUG // we want a compilation-time failure in the debug builds; but ERR in the diff --git a/kit/KitHelper.hpp b/kit/KitHelper.hpp index 9f51fe528..8a32cb2dd 100644 --- a/kit/KitHelper.hpp +++ b/kit/KitHelper.hpp @@ -137,6 +137,8 @@ namespace LOKitHelper return "CELL_SELECTION_AREA"; case LOK_CALLBACK_CELL_AUTO_FILL_AREA: return "CELL_AUTO_FILL_AREA"; +case LOK_CALLBACK_TABLE_SELECTED: +return "TABLE_SELECTED"; } assert(!"Missing LOK_CALLBACK type"); diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am index 00cfdc083..cb8522a6b 100644 --- a/loleaflet/Makefile.am +++ b/loleaflet/Makefile.am @@ -340,6 +340,7 @@ pot: src/errormessages.js \ src/layer/marker/Annotation.js \ src/layer/tile/TileLayer.js \ + src/layer/tile/TileLayer.TableOverlay.js \ src/map/Map.js \ src/map/Clipboard.js \ src/map/handler/Map.FileInserter.js \ diff --git a/loleaflet/build/deps.js b/loleaflet/build/deps.js index 45feef2b5..52a71fd24 100644 --- a/loleaflet/build/deps.js +++ b/loleaflet/build/deps.js @@ -36,7 +36,8 @@ var deps = { }, TileLayer: { - src: ['layer/tile/TileLayer.js'], + src: ['layer/tile/TileLayer.js', + 'layer/tile/TileLayer.TableOverlay.js'], desc: 'The base class for displaying tile layers on the map.', deps: ['GridLayer'] }, diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css index 576931f8d..62cecafa9 100644 --- a/loleaflet/css/loleaflet.css +++ b/loleaflet/css/loleaflet.css @@ -41,6 +41,26 @@ -ms-filter: "alpha(opacity=100)" !important; } +.table-column-resize-marker { + margin-left: 0px; + margin-top: 0px; + width: 24px; + height: 24px; + background-image: url('images/table-column-resize-marker.svg'); + background-size: 100% 100%; + background-repeat: no-repeat; +} +
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/KitHelper.hpp loleaflet/css loleaflet/images loleaflet/src tools/KitClient.cpp
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 23 +- kit/ChildSession.cpp |6 kit/KitHelper.hpp|4 loleaflet/css/spreadsheet.css| 20 + loleaflet/images/cell-autofill-marker.svg|3 loleaflet/images/cell-resize-marker.svg |3 loleaflet/src/layer/tile/TileLayer.js| 217 +++ tools/KitClient.cpp |2 8 files changed, 275 insertions(+), 3 deletions(-) New commits: commit 42c4c864feaa3559c1384b64a893fa6d24a123ac Author: Tomaž Vajngerl AuthorDate: Sun Jul 28 10:45:41 2019 +0900 Commit: Tomaž Vajngerl CommitDate: Mon Jul 29 08:51:55 2019 +0200 tdf#125425 add cell selection markers and cell auto fill marker This replaces the standard text selection marker with a cell selection markers to resize the cell selection. This looks and behaves better for cells in Calc and it is also easier to deal with. Additionally add auto fill marker to perform the auto fill action on the cells. This was not possible to do previously unless you hit an invisible part of the cell selection, which is not convenient when using touch. Change-Id: Ia02d03b7b8e8d98412ea98eb92fb47d1505ef979 Reviewed-on: https://gerrit.libreoffice.org/76494 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index f3fc91b2f..4277adbe6 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -164,7 +164,7 @@ typedef enum /** * The size and/or the position of the graphic selection changed, * the rotation angle of the embedded graphic object, and a property list - * which can be used for informing the client about severl properties. + * which can be used for informing the client about several properties. * * Format is "x, y, width, height, angle, { list of properties }", * where angle is in 100th of degree, and the property list is optional. @@ -195,7 +195,7 @@ typedef enum * } * * where the "svg" property is a string containing an svg document - * which is a rapresentation of the pie segment. + * which is a representation of the pie segment. */ LOK_CALLBACK_GRAPHIC_SELECTION = 6, @@ -593,6 +593,7 @@ typedef enum * "type" tells the type of the window the action is associated with * - "dialog" - window is a dialog * - "child" - window is a floating window (combo boxes, etc.) + * - "deck" - window is a docked/floating deck (i.e. the sidebar) * * "action" can take following values: * - "created" - window is created in the backend, client can render it now @@ -647,7 +648,23 @@ typedef enum * Profiling tracing information single string of multiple lines * containing and zone start/stop information */ -LOK_CALLBACK_PROFILE_FRAME = 41 +LOK_CALLBACK_PROFILE_FRAME = 41, + +/** + * The position and size of the cell selection area. It is used to + * draw the selection handles for cells in Calc documents. + * + * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. + */ +LOK_CALLBACK_CELL_SELECTION_AREA = 42, + +/** + * The position and size of the cell auto fill area. It is used to + * trigger auto fill functionality if that area is hit. + * + * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. + */ +LOK_CALLBACK_CELL_AUTO_FILL_AREA = 43, } LibreOfficeKitCallbackType; diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index b3ee31b0a..01853e94b 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -2133,6 +2133,12 @@ void ChildSession::loKitCallback(const int type, const std::string& payload) case LOK_CALLBACK_DOCUMENT_PASSWORD_TO_MODIFY: // these are not handled here. break; +case LOK_CALLBACK_CELL_SELECTION_AREA: +sendTextFrame("cellselectionarea: " + payload); +break; +case LOK_CALLBACK_CELL_AUTO_FILL_AREA: +sendTextFrame("cellautofillarea: " + payload); +break; #if !ENABLE_DEBUG // we want a compilation-time failure in the debug builds; but ERR in the diff --git a/kit/KitHelper.hpp b/kit/KitHelper.hpp index 88d090428..9f51fe528 100644 --- a/kit/KitHelper.hpp +++ b/kit/KitHelper.hpp @@ -133,6 +133,10 @@ namespace LOKitHelper return "SIGNATURE_STATUS"; case LOK_CALLBACK_PROFILE_FRAME: return "PROFILE_FRAME"; +case LOK_CALLBACK_CELL_SELECTION_AREA: +return "CELL_SELECTION_AREA"; +case LOK_CALLBACK_CELL_AUTO_FILL_AREA: +return "CELL_AUTO_FILL_AREA"; }
[Libreoffice-commits] online.git: bundled/include loleaflet/src
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |2 ++ loleaflet/src/control/Control.LokDialog.js |4 2 files changed, 6 insertions(+) New commits: commit 07f924baf6e352fe2e4088def7e631d7cb127680 Author: Szymon Kłos AuthorDate: Mon Apr 29 17:51:41 2019 +0200 Commit: Szymon Kłos CommitDate: Tue May 14 22:17:19 2019 +0200 loleaflet: Allow to hide dialog Change-Id: Ieb6ba7e51ad91916e550a529cd94151d062b33d3 Reviewed-on: https://gerrit.libreoffice.org/71549 Reviewed-by: Szymon Kłos Tested-by: Szymon Kłos diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index 33d235af8..af4952566 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -575,6 +575,8 @@ typedef enum * - "cursor_visible" - cursor visible status is changed. Status is available *in "visible" field * - "close" - window is closed + * - "show" - show the window + * - "hide" - hide the window */ LOK_CALLBACK_WINDOW = 36, diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index bc30c2e02..072ae72b5 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -270,6 +270,10 @@ L.Control.LokDialog = L.Control.extend({ this._onDialogChildClose(parent); else this._onDialogClose(e.id, false); + } else if (e.action === 'hide') { + $('#' + strId).parent().css({display: 'none'}); + } else if (e.action === 'show') { + $('#' + strId).parent().css({display: 'block'}); } }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp
bundled/include/LibreOfficeKit/LibreOfficeKit.h |2 +- bundled/include/LibreOfficeKit/LibreOfficeKit.hxx|4 ++-- bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |3 ++- kit/ChildSession.cpp |4 +++- 4 files changed, 8 insertions(+), 5 deletions(-) New commits: commit 6bb4edd62ce5d20ef0c2ddc648acd17f35bf1008 Author: Henry Castro AuthorDate: Thu Apr 18 18:22:18 2019 -0400 Commit: Henry Castro CommitDate: Fri Apr 26 15:32:58 2019 +0200 wsd: allow paste content to tunneled dialog Change-Id: I32fabaa533a0e9d853226b329d2d8b1c489dd776 Reviewed-on: https://gerrit.libreoffice.org/70960 Reviewed-by: Henry Castro Tested-by: Henry Castro diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 62bd3c429..e4e96483c 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -294,7 +294,7 @@ struct _LibreOfficeKitDocumentClass const int width, const int height); /// @see lok::Document::postWindow(). -void (*postWindow) (LibreOfficeKitDocument* pThis, unsigned nWindowId, int nAction); +void (*postWindow) (LibreOfficeKitDocument* pThis, unsigned nWindowId, int nAction, const char* pData); /// @see lok::Document::postWindowKeyEvent(). void (*postWindowKeyEvent) (LibreOfficeKitDocument* pThis, diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 7027298a1..47983e68f 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -188,9 +188,9 @@ public: * * @param nWindowid */ -void postWindow(unsigned nWindowId, int nAction) +void postWindow(unsigned nWindowId, int nAction, const char* pData) { -return mpDoc->pClass->postWindow(mpDoc, nWindowId, nAction); +return mpDoc->pClass->postWindow(mpDoc, nWindowId, nAction, pData); } /** diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index ef2482898..33d235af8 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -42,7 +42,8 @@ LibreOfficeKitTileMode; typedef enum { -LOK_WINDOW_CLOSE +LOK_WINDOW_CLOSE, +LOK_WINDOW_PASTE } LibreOfficeKitWindowAction; diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 7a98bfe2d..d8255442e 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -1358,7 +1358,9 @@ bool ChildSession::sendWindowCommand(const char* /*buffer*/, int /*length*/, con getLOKitDocument()->setView(_viewId); if (tokens.size() > 2 && tokens[2] == "close") -getLOKitDocument()->postWindow(winId, LOK_WINDOW_CLOSE); +getLOKitDocument()->postWindow(winId, LOK_WINDOW_CLOSE, nullptr); +else if (tokens.size() > 3 && tokens[2] == "paste") +getLOKitDocument()->postWindow(winId, LOK_WINDOW_PASTE, tokens[3].c_str()); return true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include kit/Kit.cpp
bundled/include/LibreOfficeKit/LibreOfficeKit.h |3 +++ bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 10 +++--- kit/Kit.cpp | 12 ++-- 3 files changed, 16 insertions(+), 9 deletions(-) New commits: commit 83a73e24e0c8fb622e721b40fdde273ea003a195 Author: Ashod Nakashian AuthorDate: Thu Jan 24 06:53:37 2019 -0500 Commit: Ashod Nakashian CommitDate: Tue Apr 23 03:44:07 2019 +0200 wsd: set the language when creating a new view This uses the new createViewWithOptions API to set the language of the user at the point of creating a new view. Change-Id: Ibf3e0af1b0cc300126388c1217692d8d969be0f3 Reviewed-on: https://gerrit.libreoffice.org/67501 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index f2c8dd40f..62bd3c429 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -375,6 +375,9 @@ struct _LibreOfficeKitDocumentClass int nY, int nOffset); +/// @see lok::Document::createViewWithOptions(). +int (*createViewWithOptions) (LibreOfficeKitDocument* pThis, const char* pOptions); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 6bebf3661..7027298a1 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -440,13 +440,17 @@ public: } /** - * Create a new view for an existing document. + * Create a new view for an existing document with + * options similar to documentLoadWithOptions. * By default a loaded document has 1 view. * @return the ID of the new view. */ -int createView() +int createView(const char* pOptions = nullptr) { -return mpDoc->pClass->createView(mpDoc); +if (LIBREOFFICEKIT_DOCUMENT_HAS(mpDoc, createViewWithOptions)) +return mpDoc->pClass->createViewWithOptions(mpDoc, pOptions); +else +return mpDoc->pClass->createView(mpDoc); } /** diff --git a/kit/Kit.cpp b/kit/Kit.cpp index 759e78e24..25050e04b 100644 --- a/kit/Kit.cpp +++ b/kit/Kit.cpp @@ -1571,6 +1571,10 @@ private: { const std::string sessionId = session->getId(); +std::string options; +if (!lang.empty()) +options = "Language=" + lang; + std::unique_lock lock(_documentMutex); if (!_loKitDocument) @@ -1594,10 +1598,6 @@ private: _jailedUrl = uri; _isDocPasswordProtected = false; -std::string options; -if (!lang.empty()) -options = "Language=" + lang; - LOG_DBG("Calling lokit::documentLoad(" << uriAnonym << ", \"" << options << "\")."); Timestamp timestamp; _loKitDocument.reset(_loKit->documentLoad(uri.c_str(), options.c_str())); @@ -1666,8 +1666,8 @@ private: } } -LOG_INF("Creating view to url [" << uriAnonym << "] for session [" << sessionId << "]."); -_loKitDocument->createView(); +LOG_INF("Creating view to url [" << uriAnonym << "] for session [" << sessionId << "] with " << options << '.'); +_loKitDocument->createView(options.c_str()); LOG_TRC("View to url [" << uriAnonym << "] created."); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |6 ++ 1 file changed, 6 insertions(+) New commits: commit 3ec0013f0466197ad21e27ad9ebfa49653539d5f Author: Aron Budea AuthorDate: Fri Apr 19 17:57:17 2019 +0200 Commit: Aron Budea CommitDate: Fri Apr 19 17:59:50 2019 +0200 Update bundled headers with profiling enum Change-Id: If14350cebf9e48b4338aacf55f95a40ef9fb27be Reviewed-on: https://gerrit.libreoffice.org/70986 Reviewed-by: Aron Budea Tested-by: Aron Budea diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index 1d55ce858..ef2482898 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -610,6 +610,12 @@ typedef enum * On-load notification of the document signature status. */ LOK_CALLBACK_SIGNATURE_STATUS = 40, + +/** + * Profiling tracing information single string of multiple lines + * containing and zone start/stop information + */ +LOK_CALLBACK_PROFILE_FRAME = 41 } LibreOfficeKitCallbackType; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKitInit.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 3791ebace315e4a20f5769980213a1fc03188519 Author: Tor Lillqvist AuthorDate: Wed Mar 27 09:22:49 2019 +0200 Commit: Tor Lillqvist CommitDate: Wed Mar 27 09:23:08 2019 +0200 Update to match core master Change-Id: I9670676db84cbce949bf230d62f9c1f7666fe09f diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h index 5dbf2f83f..c00c33193 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h @@ -249,13 +249,13 @@ typedef LibreOfficeKit *(LokHookFunction2)( const char *install_path, const char typedef int (LokHookPreInit) ( const char *install_path, const char *user_profile_url ); -#if defined(IOS) +#if defined(IOS) || defined(ANDROID) LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user_profile_path); #endif static LibreOfficeKit *lok_init_2( const char *install_path, const char *user_profile_url ) { -#if !defined(IOS) +#if !defined(IOS) && !defined(ANDROID) void *dlhandle; char *imp_lib; LokHookFunction *pSym; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h |9 + bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 16 2 files changed, 25 insertions(+) New commits: commit d0186aadee756882cf77fc5366b3298731c40923 Author: Tor Lillqvist AuthorDate: Tue Mar 26 18:01:16 2019 +0200 Commit: Tor Lillqvist CommitDate: Tue Mar 26 18:01:16 2019 +0200 Update to match core master Change-Id: I8932f9ea8ebd1addd9679f2f325b4dbafa48578c diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 2df1cea6d..0e596f506 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -356,10 +356,19 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::getSignatureState(). int (*getSignatureState) (LibreOfficeKitDocument* pThis); +// END CERTIFICATE AND SIGNING /// @see lok::Document::renderShapeSelection size_t (*renderShapeSelection)(LibreOfficeKitDocument* pThis, char** pOutput); +/// @see lok::Document::postWindowGestureEvent(). +void (*postWindowGestureEvent) (LibreOfficeKitDocument* pThis, + unsigned nWindowId, + const char* pType, + int nX, + int nY, + int nOffset); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 31e95a09c..bd678b0b8 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -629,6 +629,22 @@ public: return mpDoc->pClass->renderShapeSelection(mpDoc, pOutput); } +/** + * Posts a gesture event to the window with given id. + * + * @param nWindowId + * @param pType Event type, like panStart, panEnd, panUpdate. + * @param nX horizontal position in document coordinates + * @param nY vertical position in document coordinates + * @param nOffset difference value from when the gesture started to current value + */ +void postWindowGestureEvent(unsigned nWindowId, + const char* pType, + int nX, int nY, int nOffset) +{ +return mpDoc->pClass->postWindowGestureEvent(mpDoc, nWindowId, pType, nX, nY, nOffset); +} + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 10 ++ bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 12 2 files changed, 22 insertions(+) New commits: commit 49d5494bf3520f60bb2065f03de6fb7a36d39966 Author: Tor Lillqvist AuthorDate: Tue Jan 22 17:33:32 2019 +0200 Commit: Tor Lillqvist CommitDate: Tue Jan 22 17:33:57 2019 +0200 Update from core master Change-Id: I69e93f67be0cc5b75fecb0581348283fa0c6ed2c diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 4dd23a2cb..2df1cea6d 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -94,6 +94,16 @@ struct _LibreOfficeKitClass @since LibreOffice 6.0 */ int (*runMacro) (LibreOfficeKit *pThis, const char* pURL); + +/** @see lok::Office::signDocument(). +@since LibreOffice 6.2 + */ + bool (*signDocument) (LibreOfficeKit* pThis, + const char* pUrl, + const unsigned char* pCertificateBinary, + const int nCertificateBinarySize, + const unsigned char* pPrivateKeyBinary, + const int nPrivateKeyBinarySize); }; #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize) diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 5d7771cf8..31e95a09c 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -791,6 +791,18 @@ public: { return mpThis->pClass->runMacro( mpThis, pURL ); } + +/** + * Exports the document and signes its content. + */ +bool signDocument(const char* pURL, + const unsigned char* pCertificateBinary, const int nCertificateBinarySize, + const unsigned char* pPrivateKeyBinary, const int nPrivateKeyBinarySize) +{ +return mpThis->pClass->signDocument(mpThis, pURL, +pCertificateBinary, nCertificateBinarySize, +pPrivateKeyBinary, nPrivateKeyBinarySize); +} }; /// Factory method to create a lok::Office instance. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 10 --- bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 29 -- 2 files changed, 39 deletions(-) New commits: commit 07155e3b53132e368219634d011c29f38d5521df Author: Tor Lillqvist AuthorDate: Thu Dec 13 15:05:13 2018 +0200 Commit: Tor Lillqvist CommitDate: Thu Dec 13 15:05:32 2018 +0200 Revert "Update from core master" Was reverted in core, too. This reverts commit cd389cb6b0fffa4ba1b2a8c6428252715774f09a. diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 68074a637..4dd23a2cb 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -94,16 +94,6 @@ struct _LibreOfficeKitClass @since LibreOffice 6.0 */ int (*runMacro) (LibreOfficeKit *pThis, const char* pURL); - -/** @see lok::Office::translateGet(). -@since LibreOffice 6.3 - */ -char* (*translateGet) (LibreOfficeKit *pThis, const char* pId, const char* pPrefixName, const char* pBcp47LanguageTag); - -/** @see lok::Office::translateNGet(). -@since LibreOffice 6.3 - */ -char* (*translateNGet) (LibreOfficeKit *pThis, const char* pId, int n, const char* pPrefixName, const char* pBcp47LanguageTag); }; #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize) diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 923af7136..5d7771cf8 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -791,35 +791,6 @@ public: { return mpThis->pClass->runMacro( mpThis, pURL ); } - -/** - * Fetch translation for a string. - * - * @since LibreOffice 6.3 - * @returns the translated string, if available - * @param pId the context and string, separated by a '\004' character - * @param pPrefixName the prefix passed to Translate::Create() - * @param pBcp47LanguageTag the locale into which the string should be translated - */ -char* translateGet( const char* pId, const char* pPrefixName, const char* pBcp47LanguageTag ) -{ -return mpThis->pClass->translateGet( mpThis, pId, pPrefixName, pBcp47LanguageTag ); -} - -/** - * Fetch translation for a string corresponding to a specific number of something. - * - * @since LibreOffice 6.3 - * @returns the translated string, if available - * @param pId the context and string, separated by a '\004' character - * @param n the number - * @param pPrefixName the prefix passed to Translate::Create() - * @param pBcp47LanguageTag the locale into which the string should be translated - */ -char* translateNGet( const char* pId, int n, const char* pPrefixName, const char* pBcp47LanguageTag ) -{ -return mpThis->pClass->translateNGet( mpThis, pId, n, pPrefixName, pBcp47LanguageTag ); -} }; /// Factory method to create a lok::Office instance. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 10 +++ bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 29 ++ 2 files changed, 39 insertions(+) New commits: commit cd389cb6b0fffa4ba1b2a8c6428252715774f09a Author: Tor Lillqvist AuthorDate: Tue Dec 11 00:23:25 2018 +0200 Commit: Tor Lillqvist CommitDate: Tue Dec 11 00:23:25 2018 +0200 Update from core master Change-Id: Iae9ae1d0227a40bfc6de95557bd99210c7e437fa diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 4dd23a2cb..68074a637 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -94,6 +94,16 @@ struct _LibreOfficeKitClass @since LibreOffice 6.0 */ int (*runMacro) (LibreOfficeKit *pThis, const char* pURL); + +/** @see lok::Office::translateGet(). +@since LibreOffice 6.3 + */ +char* (*translateGet) (LibreOfficeKit *pThis, const char* pId, const char* pPrefixName, const char* pBcp47LanguageTag); + +/** @see lok::Office::translateNGet(). +@since LibreOffice 6.3 + */ +char* (*translateNGet) (LibreOfficeKit *pThis, const char* pId, int n, const char* pPrefixName, const char* pBcp47LanguageTag); }; #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize) diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 5d7771cf8..923af7136 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -791,6 +791,35 @@ public: { return mpThis->pClass->runMacro( mpThis, pURL ); } + +/** + * Fetch translation for a string. + * + * @since LibreOffice 6.3 + * @returns the translated string, if available + * @param pId the context and string, separated by a '\004' character + * @param pPrefixName the prefix passed to Translate::Create() + * @param pBcp47LanguageTag the locale into which the string should be translated + */ +char* translateGet( const char* pId, const char* pPrefixName, const char* pBcp47LanguageTag ) +{ +return mpThis->pClass->translateGet( mpThis, pId, pPrefixName, pBcp47LanguageTag ); +} + +/** + * Fetch translation for a string corresponding to a specific number of something. + * + * @since LibreOffice 6.3 + * @returns the translated string, if available + * @param pId the context and string, separated by a '\004' character + * @param n the number + * @param pPrefixName the prefix passed to Translate::Create() + * @param pBcp47LanguageTag the locale into which the string should be translated + */ +char* translateNGet( const char* pId, int n, const char* pPrefixName, const char* pBcp47LanguageTag ) +{ +return mpThis->pClass->translateNGet( mpThis, pId, n, pPrefixName, pBcp47LanguageTag ); +} }; /// Factory method to create a lok::Office instance. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h |9 - 1 file changed, 9 deletions(-) New commits: commit 027d12ff995f7f24e0a91775f96a3cc6864cdaa4 Author: Andras Timar AuthorDate: Tue Nov 20 16:25:50 2018 +0100 Commit: Andras Timar CommitDate: Tue Nov 20 16:25:50 2018 +0100 fix mismerge Change-Id: I34c002d86ca32f0dec8c04b31ec242129db20c4d diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 4409e62ec..27d968c4a 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -347,15 +347,6 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::getSignatureState(). int (*getSignatureState) (LibreOfficeKitDocument* pThis); -/// Paints window with given id to the buffer with the give DPI scale -/// (every pixel is dpiscale-times larger). -/// @see lok::Document::paintWindow(). -void (*paintWindowDPI) (LibreOfficeKitDocument* pThis, unsigned nWindowId, -unsigned char* pBuffer, -const int x, const int y, -const int width, const int height, -const double dpiscale); - #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/KitHelper.hpp tools/KitClient.cpp wsd/protocol.txt
bundled/include/LibreOfficeKit/LibreOfficeKit.h |9 +++ bundled/include/LibreOfficeKit/LibreOfficeKit.hxx| 24 --- bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 14 +++ bundled/include/LibreOfficeKit/LibreOfficeKitInit.h |3 -- kit/ChildSession.cpp | 15 +++ kit/KitHelper.hpp| 10 +++ tools/KitClient.cpp |2 - wsd/protocol.txt | 10 +++ 8 files changed, 74 insertions(+), 13 deletions(-) New commits: commit efe291c320f04db6ca664dcdb5f3ce76d700e65d Author: Jan Holesovsky AuthorDate: Tue Nov 6 11:21:35 2018 +0100 Commit: Jan Holesovsky CommitDate: Mon Nov 12 18:10:57 2018 +0100 Notify about the editing context. And also: * Hint the compiler to warn about the missing callbacks. * Add few missing ones. * Update the bundled headers. Change-Id: I8d31363eaaea289e8a517c0b9b1142b33ce3027e diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index e052765ac..27d968c4a 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -309,6 +309,15 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::getPartInfo(). char* (*getPartInfo) (LibreOfficeKitDocument* pThis, int nPart); +/// Paints window with given id to the buffer with the give DPI scale +/// (every pixel is dpiscale-times larger). +/// @see lok::Document::paintWindow(). +void (*paintWindowDPI) (LibreOfficeKitDocument* pThis, unsigned nWindowId, +unsigned char* pBuffer, +const int x, const int y, +const int width, const int height, +const double dpiscale); + #ifdef IOS /// @see lok::Document::paintTileToCGContext(). void (*paintTileToCGContext) (LibreOfficeKitDocument* pThis, diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 4057686a9..4a0ec6784 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -164,16 +164,23 @@ public: * @param y y-coordinate from where the dialog should start painting * @param width The width of the dialog image to be painted * @param height The height of the dialog image to be painted + * @param dpiscale The dpi scale value used by the client. Please note + * that the x, y, width, height are supposed to be the + * values with dpiscale applied (ie. dialog covering + * 100x100 "normal" pixels with dpiscale '2' will have + * 200x200 width x height), so that it is easy to compute + * the buffer sizes etc. */ void paintWindow(unsigned nWindowId, unsigned char* pBuffer, const int x, const int y, const int width, - const int height) + const int height, + const double dpiscale = 1.0) { -return mpDoc->pClass->paintWindow(mpDoc, nWindowId, pBuffer, - x, y, width, height); +return mpDoc->pClass->paintWindowDPI(mpDoc, nWindowId, pBuffer, + x, y, width, height, dpiscale); } /** @@ -582,13 +589,13 @@ public: * Insert certificate (in binary form) to the certificate store. */ bool insertCertificate(const unsigned char* pCertificateBinary, - const int nCertificateBinarySize, + const int pCertificateBinarySize, const unsigned char* pPrivateKeyBinary, const int nPrivateKeyBinarySize) { return mpDoc->pClass->insertCertificate(mpDoc, -pCertificateBinary, nCertificateBinarySize, -pPrivateKeyBinary, nPrivateKeyBinarySize); +pCertificateBinary, pCertificateBinarySize, +pPrivateKeyBinary, nPrivateKeyBinarySize); } /** @@ -596,9 +603,10 @@ public: * */ bool addCertificate(const unsigned char* pCertificateBinary, -const int pCertificateBinarySize) + const int pCertificateBinarySize) { -return mpDoc->pClass->addCertificate(mpDoc, pCertificateBinary, pCertificateBinarySize); +return mpDoc->pClass->addCertificate(mpDoc, + pCertificateBinary, pCertificateBinarySize); }
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h |9 - bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 18 -- 2 files changed, 24 insertions(+), 3 deletions(-) New commits: commit 0ff045609e4103e780e9dc68361a8c3982a70d91 Author: Tomaž Vajngerl AuthorDate: Mon Oct 29 23:32:32 2018 +0100 Commit: Tomaž Vajngerl CommitDate: Fri Nov 9 09:03:20 2018 +0100 update bundled LOKit headers with document signature functions Change-Id: I30ef122fdba369a73742a4cb11b971deb21b2a01 Reviewed-on: https://gerrit.libreoffice.org/62532 Reviewed-by: Tomaž Vajngerl Tested-by: Tomaž Vajngerl diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 24aa49621..e052765ac 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -326,7 +326,14 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::insertCertificate(). bool (*insertCertificate) (LibreOfficeKitDocument* pThis, const unsigned char* pCertificateBinary, -const int pCertificateBinarySize); +const int nCertificateBinarySize, +const unsigned char* pPrivateKeyBinary, +const int nPrivateKeyBinarySize); + +/// @see lok::Document::addCertificate(). +bool (*addCertificate) (LibreOfficeKitDocument* pThis, +const unsigned char* pCertificateBinary, +const int nCertificateBinarySize); /// @see lok::Document::getSignatureState(). int (*getSignatureState) (LibreOfficeKitDocument* pThis); diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index d6e4bee6f..4057686a9 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -582,9 +582,23 @@ public: * Insert certificate (in binary form) to the certificate store. */ bool insertCertificate(const unsigned char* pCertificateBinary, - const int pCertificateBinarySize) + const int nCertificateBinarySize, + const unsigned char* pPrivateKeyBinary, + const int nPrivateKeyBinarySize) { -return mpDoc->pClass->insertCertificate(mpDoc, pCertificateBinary, pCertificateBinarySize); +return mpDoc->pClass->insertCertificate(mpDoc, +pCertificateBinary, nCertificateBinarySize, +pPrivateKeyBinary, nPrivateKeyBinarySize); +} + +/** + * Add the certificate (in binary form) to the certificate store. + * + */ +bool addCertificate(const unsigned char* pCertificateBinary, +const int pCertificateBinarySize) +{ +return mpDoc->pClass->addCertificate(mpDoc, pCertificateBinary, pCertificateBinarySize); } /** ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKitInit.h |9 + 1 file changed, 9 insertions(+) New commits: commit 790f3aa5c5a4ca1cfdda41c255a18401c5ded40d Author: Tor Lillqvist AuthorDate: Thu Oct 25 15:39:50 2018 +0300 Commit: Tor Lillqvist CommitDate: Mon Oct 29 11:49:11 2018 +0200 Verify that we are actually passed a URL, not a pathname Sure, the test could be even more strict and actually do a case-insensitive check for an initial "file:" or "vnd.sun.star.pathname:". Change-Id: Ic252aeccdec708138530075d1f38fa348d1e469e diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h index ce5054ac9..3251ade7d 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h @@ -285,6 +285,15 @@ static LibreOfficeKit *lok_init_2( const char *install_path, const char *user_p return pSym( install_path ); } +if (user_profile_url != NULL && user_profile_url[0] == '/') +{ +// It should be either a file: URL or a vnd.sun.star.pathname: URL. +fprintf( stderr, "second parameter to lok_init_2 '%s' should be a URL, not a pathname\n", user_profile_url ); +lok_dlclose( dlhandle ); +free( imp_lib ); +return NULL; +} + free( imp_lib ); // dlhandle is "leaked" // coverity[leaked_storage] ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include ios/ios.h ios/ios.mm kit/Kit.cpp
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 12 + bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 28 ++ ios/ios.h |4 --- ios/ios.mm| 21 kit/Kit.cpp | 20 +-- 5 files changed, 42 insertions(+), 43 deletions(-) New commits: commit ab54f21a54e6b2b66d6ae4b45fd200fa6c7d4fa1 Author: Tor Lillqvist AuthorDate: Wed Oct 10 16:30:48 2018 +0300 Commit: Tor Lillqvist CommitDate: Wed Oct 10 16:31:38 2018 +0300 Adapt to change in core: paintTile() now takes a buffer pointer also on iOS Makes the code here a little bit simpler. diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 0799584d3..0ae5c6ff1 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -309,6 +309,18 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::getPartInfo(). char* (*getPartInfo) (LibreOfficeKitDocument* pThis, int nPart); +#ifdef IOS +/// @see lok::Document::paintTileToCGContext(). +void (*paintTileToCGContext) (LibreOfficeKitDocument* pThis, + void* rCGContext, + const int nCanvasWidth, + const int nCanvasHeight, + const int nTilePosX, + const int nTilePosY, + const int nTileWidth, + const int nTileHeight); +#endif // IOS + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 232eada69..3568c861f 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -550,6 +550,34 @@ public: mpDoc->pClass->postWindowExtTextInputEvent(mpDoc, nWindowId, nType, pText); } +#ifdef IOS +/** + * Renders a subset of the document to a Core Graphics context. + * + * Note that the buffer size and the tile size implicitly supports + * rendering at different zoom levels, as the number of rendered pixels and + * the rendered rectangle of the document are independent. + * + * @param rCGContext the CGContextRef, cast to a void*. + * @param nCanvasHeight number of pixels in a column of pBuffer. + * @param nTilePosX logical X position of the top left corner of the rendered rectangle, in TWIPs. + * @param nTilePosY logical Y position of the top left corner of the rendered rectangle, in TWIPs. + * @param nTileWidth logical width of the rendered rectangle, in TWIPs. + * @param nTileHeight logical height of the rendered rectangle, in TWIPs. + */ +void paintTileToCGContext(void* rCGContext, + const int nCanvasWidth, + const int nCanvasHeight, + const int nTilePosX, + const int nTilePosY, + const int nTileWidth, + const int nTileHeight) +{ +return mpDoc->pClass->paintTileToCGContext(mpDoc, rCGContext, nCanvasWidth, nCanvasHeight, + nTilePosX, nTilePosY, nTileWidth, nTileHeight); +} +#endif // IOS + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/ios/ios.h b/ios/ios.h index f613b93ff..0109b0eda 100644 --- a/ios/ios.h +++ b/ios/ios.h @@ -11,8 +11,4 @@ extern const char *lo_ios_app_getCacheDir(); extern int loolwsd_server_socket_fd; -extern unsigned char *lo_ios_app_get_cgcontext_for_buffer(unsigned char *buffer, int width, int height); - -extern void lo_ios_app_release_cgcontext_for_buffer(); - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ios/ios.mm b/ios/ios.mm index 277e807ba..b9afc0299 100644 --- a/ios/ios.mm +++ b/ios/ios.mm @@ -17,8 +17,6 @@ extern "C" { int loolwsd_server_socket_fd = -1; -static thread_local CGContextRef cgc = nullptr; - const char* lo_ios_app_getCacheDir() { static NSString *cachePath = [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0]; @@ -27,23 +25,4 @@ const char* lo_ios_app_getCacheDir() return result; } -extern unsigned char *lo_ios_app_get_cgcontext_for_buffer(unsigned char *buffer, int width, int height) -{ -assert(cgc == nullptr); - -cgc = CGBitmapContextCreate(buffer, width, height, 8, width*4, CGColorSpaceCreateDeviceRGB(), kCGImageAlphaNoneSkipFirst | kCGImageByteOrder32Little); - -CGContextTranslateCTM(cgc, 0, height); -CGContextScaleCTM(cgc, 1, -1); - -return
[Libreoffice-commits] online.git: bundled/include kit/Kit.cpp loleaflet/src test/httpwstest.cpp
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |8 +- kit/Kit.cpp | 24 --- loleaflet/src/layer/tile/TileLayer.js| 11 +--- test/httpwstest.cpp |8 +- 4 files changed, 42 insertions(+), 9 deletions(-) New commits: commit ffd7151443ee360c7764aaa77f9e7fe5f5d64eee Author: Tamás ZolnaiDate: Sun Apr 8 00:00:53 2018 +0200 Writer: View jumps to cursor position even if it is moved by an other view. Need to get the viewid which moved our visible cursor, so we can check whether it positioned changed by the owner of the cursor or not. Change-Id: Ie7b1fafc8d8f11fba0c0b0d5f02d755e15284514 Reviewed-on: https://gerrit.libreoffice.org/52571 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index 300d91e1c..74d49fa15 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -84,7 +84,13 @@ typedef enum /** * Enable range based header data */ -LOK_FEATURE_RANGE_HEADERS = (1ULL << 4) +LOK_FEATURE_RANGE_HEADERS = (1ULL << 4), + +/** + * Request to have the active view's Id as the 1st value in the + * LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR payload. + */ +LOK_FEATURE_VIEWID_IN_VISCURSOR_INVALIDATION_CALLBACK = (1ULL << 5) } LibreOfficeKitOptionalFeatures; diff --git a/kit/Kit.cpp b/kit/Kit.cpp index ffed796fb..1451778b3 100644 --- a/kit/Kit.cpp +++ b/kit/Kit.cpp @@ -1184,8 +1184,7 @@ public: // when we examine the content of the JSON std::string targetViewId; -if (type == LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR || -type == LOK_CALLBACK_CELL_CURSOR) +if (type == LOK_CALLBACK_CELL_CURSOR) { Poco::StringTokenizer tokens(payload, ",", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); // Payload may be 'EMPTY'. @@ -1199,6 +1198,24 @@ public: tileQueue->updateCursorPosition(0, 0, cursorX, cursorY, cursorWidth, cursorHeight); } } +else if (type == LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR) +{ +Poco::JSON::Parser parser; +const Poco::Dynamic::Var result = parser.parse(payload); +const auto& command = result.extract(); +std::string rectangle = command->get("rectangle").toString(); +Poco::StringTokenizer tokens(rectangle, ",", Poco::StringTokenizer::TOK_IGNORE_EMPTY | Poco::StringTokenizer::TOK_TRIM); +// Payload may be 'EMPTY'. +if (tokens.count() == 4) +{ +int cursorX = std::stoi(tokens[0]); +int cursorY = std::stoi(tokens[1]); +int cursorWidth = std::stoi(tokens[2]); +int cursorHeight = std::stoi(tokens[3]); + +tileQueue->updateCursorPosition(0, 0, cursorX, cursorY, cursorWidth, cursorHeight); +} +} else if (type == LOK_CALLBACK_INVALIDATE_VIEW_CURSOR || type == LOK_CALLBACK_CELL_VIEW_CURSOR) { @@ -1545,7 +1562,8 @@ private: | LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY | LOK_FEATURE_PART_IN_INVALIDATION_CALLBACK | LOK_FEATURE_NO_TILED_ANNOTATIONS - | LOK_FEATURE_RANGE_HEADERS; + | LOK_FEATURE_RANGE_HEADERS + | LOK_FEATURE_VIEWID_IN_VISCURSOR_INVALIDATION_CALLBACK; _loKit->setOptionalFeatures(flags); // Save the provided password with us and the jailed url diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index cc8fe0071..22c3bc634 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -761,7 +761,10 @@ L.TileLayer = L.GridLayer.extend({ _onInvalidateCursorMsg: function (textMsg) { var docLayer = this._map._docLayer; - var strTwips = textMsg.match(/\d+/g); + textMsg = textMsg.substring('invalidatecursor:'.length + 1); + var obj = JSON.parse(textMsg); + var modifierViewId = parseInt(obj.viewId); + var strTwips = obj.rectangle.match(/\d+/g); var topLeftTwips = new L.Point(parseInt(strTwips[0]), parseInt(strTwips[1])); var offset = new L.Point(parseInt(strTwips[2]), parseInt(strTwips[3])); var bottomRightTwips = topLeftTwips.add(offset); @@ -774,7 +777,7 @@ L.TileLayer = L.GridLayer.extend({
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/KitHelper.hpp loleaflet/dist loleaflet/src tools/KitClient.cpp
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 11 ++- kit/ChildSession.cpp |3 kit/KitHelper.hpp|2 loleaflet/dist/images/drop-down-button.svg |4 + loleaflet/dist/spreadsheet.css | 10 ++ loleaflet/src/layer/marker/Icon.js | 15 ++-- loleaflet/src/layer/tile/TileLayer.js| 66 +++ tools/KitClient.cpp |1 8 files changed, 105 insertions(+), 7 deletions(-) New commits: commit 89f37b5dd52882674c4e5f2339d365cfe338543d Author: Marco CecchettiDate: Mon Mar 19 14:08:10 2018 +0100 calc: drop down button marker Change-Id: Ic069ad40e6749f43709760e7f4f0d96b39d5a4ce Reviewed-on: https://gerrit.libreoffice.org/51598 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index 020bbff90..300d91e1c 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -570,6 +570,15 @@ typedef enum LOK_CALLBACK_WINDOW = 36, /** + * When for the current cell is defined a validity list we need to show + * a drop down button in the form of a marker. + * + * The payload format is: "x, y, visible" where x, y are the current + * cell cursor coordinates and visible is set to 0 or 1. + */ +LOK_CALLBACK_VALIDITY_LIST_BUTTON = 37, + +/** * Notification that the clipboard contents have changed. * Typically fired in response to copying to clipboard. * @@ -578,7 +587,7 @@ typedef enum * in the future the contents might be included for * convenience. */ -LOK_CALLBACK_CLIPBOARD_CHANGED = 37, +LOK_CALLBACK_CLIPBOARD_CHANGED = 38, } LibreOfficeKitCallbackType; diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 710c079b5..04ec7d93f 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -1548,6 +1548,9 @@ void ChildSession::loKitCallback(const int type, const std::string& payload) case LOK_CALLBACK_WINDOW: sendTextFrame("window: " + payload); break; +case LOK_CALLBACK_VALIDITY_LIST_BUTTON: +sendTextFrame("validitylistbutton: " + payload); +break; default: LOG_ERR("Unknown callback event (" << type << "): " << payload); } diff --git a/kit/KitHelper.hpp b/kit/KitHelper.hpp index 6dd1a0f41..bc4e2350e 100644 --- a/kit/KitHelper.hpp +++ b/kit/KitHelper.hpp @@ -117,6 +117,8 @@ namespace LOKitHelper return "CELL_ADDRESS"; case LOK_CALLBACK_WINDOW: return "WINDOW"; +case LOK_CALLBACK_VALIDITY_LIST_BUTTON: +return "VALIDITY_LIST_BUTTON"; } return std::to_string(type); diff --git a/loleaflet/dist/images/drop-down-button.svg b/loleaflet/dist/images/drop-down-button.svg new file mode 100644 index 0..f17c3 --- /dev/null +++ b/loleaflet/dist/images/drop-down-button.svg @@ -0,0 +1,4 @@ +http://www.w3.org/2000/svg; width="11px" height="11px"> + + + diff --git a/loleaflet/dist/spreadsheet.css b/loleaflet/dist/spreadsheet.css index ed5086321..01f0b0bd2 100644 --- a/loleaflet/dist/spreadsheet.css +++ b/loleaflet/dist/spreadsheet.css @@ -190,3 +190,13 @@ .spreadsheet-header-row-resize { cursor: row-resize; } + +.spreadsheet-drop-down-marker { + margin-left: 0px; + margin-top: 0px; + width: 18px; + height: 17px; + background-image: url('../images/drop-down-button.svg'); + background-size: 100% 100%; + background-repeat: no-repeat; + } diff --git a/loleaflet/src/layer/marker/Icon.js b/loleaflet/src/layer/marker/Icon.js index 58d5fd3c1..856995b23 100644 --- a/loleaflet/src/layer/marker/Icon.js +++ b/loleaflet/src/layer/marker/Icon.js @@ -47,10 +47,10 @@ L.Icon = L.Class.extend({ }, _setIconStyles: function (img, name) { - var options = this.options, - size = L.point(options[name + 'Size']), - anchor = L.point(name === 'shadow' && options.shadowAnchor || options.iconAnchor || - size && size.divideBy(2, true)); + var options = this.options; + var size = L.point(options[name + 'Size']); + var anchor = L.point(name === 'shadow' && options.shadowAnchor || options.iconAnchor || + size && size.x !== undefined && size.y !== undefined && size.divideBy(2, true)); img.className = 'leaflet-marker-' + name + ' ' + (options.className || ''); @@ -60,9 +60,12 @@ L.Icon = L.Class.extend({ } if (size) { -
[Libreoffice-commits] online.git: bundled/include kit/KitHelper.hpp loleaflet/src loleaflet/unocommands.js
bundled/include/LibreOfficeKit/LibreOfficeKit.h |3 + kit/KitHelper.hpp | 30 + loleaflet/src/control/Control.Menubar.js|1 loleaflet/src/control/Control.Tabs.js | 16 - loleaflet/src/control/Parts.js | 42 loleaflet/src/core/Socket.js|7 loleaflet/src/layer/tile/CalcTileLayer.js | 25 -- loleaflet/unocommands.js|3 + 8 files changed, 123 insertions(+), 4 deletions(-) New commits: commit d887b08d60d4335c2de27ea043253f017701c317 Author: Marco CecchettiDate: Thu Feb 1 16:36:24 2018 +0100 calc: added support for hidden sheets and validation of cell content Change-Id: I5db971b8826de7d5be2f88354925cd107082da77 Reviewed-on: https://gerrit.libreoffice.org/49112 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index d465d541b..0799584d3 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -306,6 +306,9 @@ struct _LibreOfficeKitDocumentClass int nType, const char* pText); +/// @see lok::Document::getPartInfo(). +char* (*getPartInfo) (LibreOfficeKitDocument* pThis, int nPart); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/kit/KitHelper.hpp b/kit/KitHelper.hpp index 49ff8f063..6dd1a0f41 100644 --- a/kit/KitHelper.hpp +++ b/kit/KitHelper.hpp @@ -13,6 +13,8 @@ #include #include +#include + #define LOK_USE_UNSTABLE_API #include @@ -140,6 +142,34 @@ namespace LOKitHelper if (type == LOK_DOCTYPE_SPREADSHEET || type == LOK_DOCTYPE_PRESENTATION) { +if (type == LOK_DOCTYPE_SPREADSHEET) +{ +std::ostringstream hposs; +for (int i = 0; i < parts; ++i) +{ + +ptrValue = loKitDocument->pClass->getPartInfo(loKitDocument, i); +std::string partinfo(ptrValue); +std::free(ptrValue); +const auto aPartInfo = Util::JsonToMap(partinfo); +for (const auto prop: aPartInfo) +{ +const std::string& name = prop.first; +if (name == "visible") +{ +if (prop.second == "0") +hposs << i << ","; +} +} +} +std::string hiddenparts = hposs.str(); +if (!hiddenparts.empty()) +{ +hiddenparts.pop_back(); +oss << " hiddenparts=" << hiddenparts; +} +} + for (int i = 0; i < parts; ++i) { oss << "\n"; diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 8d947afd4..81288d617 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -364,6 +364,7 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:DataSort'}, {uno: '.uno:SortAscending'}, {uno: '.uno:SortDescending'}, + {uno: '.uno:Validation'}, {type: 'separator'}, {uno: '.uno:DataFilterAutoFilter'}, {name: _UNO('.uno:FilterMenu', 'spreadsheet'), type: 'menu', menu: [ diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js index a2095457f..8295f2fd6 100644 --- a/loleaflet/src/control/Control.Tabs.js +++ b/loleaflet/src/control/Control.Tabs.js @@ -68,7 +68,19 @@ L.Control.Tabs = L.Control.extend({ map.renamePage(data.sheetname, nPos); } }); - }} + }}, + 'showsheets': { + name: _UNO('.uno:Show', 'spreadsheet', true), + callback: function() { + map.showPage(); + } + }, + 'hiddensheets': { +
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 11 +++ 1 file changed, 11 insertions(+) New commits: commit 8481689f93a1081c5a8d9e3ac8891d601049160d Author: Pranav KantDate: Wed Mar 21 21:39:46 2018 +0530 update bundled headers - clipboard_changed Change-Id: Idad3aef64acb01928f6f70010a0e9d7ed297aede diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index b90aa6279..020bbff90 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -568,6 +568,17 @@ typedef enum * - "close" - window is closed */ LOK_CALLBACK_WINDOW = 36, + +/** + * Notification that the clipboard contents have changed. + * Typically fired in response to copying to clipboard. + * + * The payload currently is empty and it's up to the + * client to get the contents, if necessary. However, + * in the future the contents might be included for + * convenience. + */ +LOK_CALLBACK_CLIPBOARD_CHANGED = 37, } LibreOfficeKitCallbackType; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 10 +- bundled/include/LibreOfficeKit/LibreOfficeKit.hxx |6 +++--- kit/ChildSession.cpp |2 +- 3 files changed, 9 insertions(+), 9 deletions(-) New commits: commit c73026cdf94de870c1a54758be8197d359397ade Author: Pranav KantDate: Wed Feb 21 22:05:18 2018 +0530 postExtTextInputEvent -> postWindowExtTextInputEvent Change-Id: If5612bffac612ca7f52c8eec242e5ad9984cd669 diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 7492fcc7..d465d541 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -300,11 +300,11 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::setViewLanguage(). void (*setViewLanguage) (LibreOfficeKitDocument* pThis, int nId, const char* language); -/// @see lok::Document::postExtTextInputEvent -void (*postExtTextInputEvent) (LibreOfficeKitDocument* pThis, - unsigned nWindowId, - int nType, - const char* pText); +/// @see lok::Document::postWindowExtTextInputEvent +void (*postWindowExtTextInputEvent) (LibreOfficeKitDocument* pThis, + unsigned nWindowId, + int nType, + const char* pText); #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 55e29ebd..232eada6 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -538,16 +538,16 @@ public: } /** - * Post the text input from external input window, like IME + * Post the text input from external input window, like IME, to given windowId * * @param nWindowId Specify the window id to post the input event to. If * nWindow is 0, the event is posted into the document * @param nType see LibreOfficeKitExtTextInputType * @param pText Text for LOK_EXT_TEXTINPUT */ -void postExtTextInputEvent(unsigned nWindowId, int nType, const char* pText) +void postWindowExtTextInputEvent(unsigned nWindowId, int nType, const char* pText) { -mpDoc->pClass->postExtTextInputEvent(mpDoc, nWindowId, nType, pText); +mpDoc->pClass->postWindowExtTextInputEvent(mpDoc, nWindowId, nType, pText); } #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index f09f5b39..6a10dca8 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -790,7 +790,7 @@ bool ChildSession::extTextInputEvent(const char* /*buffer*/, int /*length*/, std::unique_lock lock(_docManager.getDocumentMutex()); getLOKitDocument()->setView(_viewId); -getLOKitDocument()->postExtTextInputEvent(id, type, decodedText.c_str()); +getLOKitDocument()->postWindowExtTextInputEvent(id, type, decodedText.c_str()); return true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h |1 bundled/include/LibreOfficeKit/LibreOfficeKit.hxx|6 +++-- bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |2 - bundled/include/LibreOfficeKit/LibreOfficeKitInit.h | 22 +++ 4 files changed, 19 insertions(+), 12 deletions(-) New commits: commit 68b17446a0c08f28a195c9dc9fdee78e2c10b991 Author: Andras TimarDate: Thu Feb 15 10:08:47 2018 +0100 Updated LibreOfficeKit headers Change-Id: I6da94250d81d1f62d8f2191660b37b960033f11c diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index ebc112fb..7492fcc7 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -302,6 +302,7 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::postExtTextInputEvent void (*postExtTextInputEvent) (LibreOfficeKitDocument* pThis, + unsigned nWindowId, int nType, const char* pText); diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 09835608..55e29ebd 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -540,12 +540,14 @@ public: /** * Post the text input from external input window, like IME * + * @param nWindowId Specify the window id to post the input event to. If + * nWindow is 0, the event is posted into the document * @param nType see LibreOfficeKitExtTextInputType * @param pText Text for LOK_EXT_TEXTINPUT */ -void postExtTextInputEvent(int nType, const char* pText) +void postExtTextInputEvent(unsigned nWindowId, int nType, const char* pText) { -mpDoc->pClass->postExtTextInputEvent(mpDoc, nType, pText); +mpDoc->pClass->postExtTextInputEvent(mpDoc, nWindowId, nType, pText); } #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index ccbc3b96..b90aa627 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -563,7 +563,7 @@ typedef enum * - "invalidate" - the area as described by "rectangle" is invalidated *Clients must request the new area * - "cursor_invalidate" - cursor is invalidated. New position is in "rectangle" - * - "cursor_visible" - cursor visible status is changed. Status is availabe + * - "cursor_visible" - cursor visible status is changed. Status is available *in "visible" field * - "close" - window is closed */ diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h index a0c111a9..ce5054ac 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitInit.h @@ -68,7 +68,6 @@ extern "C" { (void)pPath; } -#endif // IOS static void *lok_dlsym(void *Hnd, const char *pName) { @@ -79,10 +78,10 @@ extern "C" { return dlclose(Hnd); } +#endif // IOS #else -#pragma warning(disable:4996) #if !defined WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif @@ -165,12 +164,12 @@ extern "C" } #endif +#if !defined(IOS) static void *lok_dlopen( const char *install_path, char ** _imp_lib ) { char *imp_lib; void *dlhandle; -#if !defined(IOS) size_t partial_length, imp_lib_size; struct stat dir_st; @@ -233,14 +232,10 @@ static void *lok_dlopen( const char *install_path, char ** _imp_lib ) return NULL; } } -#else -(void)install_path; -imp_lib = strdup("the app executable"); -dlhandle = RTLD_MAIN_ONLY; -#endif *_imp_lib = imp_lib; return dlhandle; } +#endif typedef LibreOfficeKit *(LokHookFunction)( const char *install_path); @@ -248,10 +243,16 @@ typedef LibreOfficeKit *(LokHookFunction2)( const char *install_path, const char typedef int (LokHookPreInit) ( const char *install_path, const char *user_profile_url ); +#if defined(IOS) +extern __attribute__ ((visibility("default"))) +LibreOfficeKit *libreofficekit_hook_2(const char* install_path, const char* user_profile_path); +#endif + static LibreOfficeKit *lok_init_2( const char *install_path, const char *user_profile_url ) { -char *imp_lib; +#if !defined(IOS) void *dlhandle; +char *imp_lib; LokHookFunction *pSym; LokHookFunction2 *pSym2; @@ -288,6 +289,9 @@ static LibreOfficeKit *lok_init_2( const char *install_path, const char *user_p // dlhandle is "leaked" //
[Libreoffice-commits] online.git: bundled/include common/Protocol.cpp kit/ChildSession.cpp kit/ChildSession.hpp loleaflet/src test/WhiteBoxTests.cpp wsd/ClientSession.cpp
bundled/include/LibreOfficeKit/LibreOfficeKit.h |5 + bundled/include/LibreOfficeKit/LibreOfficeKit.hxx| 11 bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 48 +-- common/Protocol.cpp |2 kit/ChildSession.cpp | 27 ++ kit/ChildSession.hpp |1 loleaflet/src/map/handler/Map.Keyboard.js| 15 +++-- test/WhiteBoxTests.cpp |3 + wsd/ClientSession.cpp|1 9 files changed, 102 insertions(+), 11 deletions(-) New commits: commit ad1da235d3c7ac893fc7c0d0369b4b7b3ed29db6 Author: Pranav KantDate: Thu Feb 8 00:00:45 2018 +0530 IME support Dialogs still need to be adapted to this. Only works for documents as of now. Change-Id: I0fb1114e279a9e563943f3f65dd5a577523e9841 diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index d42bd343..ebc112fb 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -300,6 +300,11 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::setViewLanguage(). void (*setViewLanguage) (LibreOfficeKitDocument* pThis, int nId, const char* language); +/// @see lok::Document::postExtTextInputEvent +void (*postExtTextInputEvent) (LibreOfficeKitDocument* pThis, + int nType, + const char* pText); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 310b9cfc..09835608 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -537,6 +537,17 @@ public: mpDoc->pClass->setViewLanguage(mpDoc, nId, language); } +/** + * Post the text input from external input window, like IME + * + * @param nType see LibreOfficeKitExtTextInputType + * @param pText Text for LOK_EXT_TEXTINPUT + */ +void postExtTextInputEvent(int nType, const char* pText) +{ +mpDoc->pClass->postExtTextInputEvent(mpDoc, nType, pText); +} + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index f14ce4d3..ccbc3b96 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -267,6 +267,11 @@ typedef enum /** * The size and/or the position of the cell cursor changed. * + * Payload format: "x, y, width, height, column, row", where the first + * 4 numbers are document coordinates, in twips, and the last 2 are table + * coordinates starting from 0. + * When the cursor is not shown the payload format is the "EMPTY" string. + * * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. */ LOK_CALLBACK_CELL_CURSOR = 17, @@ -509,11 +514,12 @@ typedef enum * The column/row header is no more valid because of a column/row insertion * or a similar event. Clients must query a new column/row header set. * - * The payload says if we are invalidating a row or column header. + * The payload says if we are invalidating a row or column header. So, + * payload values can be: "row", "column", "all". */ LOK_CALLBACK_INVALIDATE_HEADER = 33, /** - * The text content of the address field in Calc. + * The text content of the address field in Calc. Eg: "A7" */ LOK_CALLBACK_CELL_ADDRESS = 34, /** @@ -534,7 +540,32 @@ typedef enum */ LOK_CALLBACK_RULER_UPDATE = 35, /** - * Dialog invalidation + * Window related callbacks are emitted under this category. It includes + * external windows like dialogs, autopopups for now. + * + * The payload format is: + * + * { + *"id": "unique integer id of the dialog", + *"action": "", + *"type": "" + *"rectangle": "x, y, width, height" + * } + * + * "type" tells the type of the window the action is associated with + * - "dialog" - window is a dialog + * - "child" - window is a floating window (combo boxes, etc.) + * + * "action" can take following values: + * - "created" - window is created in the backend, client can render it now + * - "title_changed" - window's title is changed + * - "size_changed" - window's size is changed + * - "invalidate" - the area as described by "rectangle" is invalidated + *Clients must request the new area + * - "cursor_invalidate" - cursor is invalidated. New
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h |9 ++--- bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 11 +++ 2 files changed, 17 insertions(+), 3 deletions(-) New commits: commit 5beb6f64db6b69ae2f4fd1b0bda558d38d0e82c7 Author: Jan HolesovskyDate: Wed Dec 13 12:13:20 2017 +0100 Update the bundled headers. Change-Id: Ie581a50d5c46be295127a8bf4ac813169682c9ce Reviewed-on: https://gerrit.libreoffice.org/46379 Reviewed-by: Andras Timar Tested-by: Andras Timar (cherry picked from commit 081401991e12817bdcc2aba6fcd8b029f3b7d53f) Reviewed-on: https://gerrit.libreoffice.org/46783 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index f9c9e22a..d42bd343 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -228,9 +228,6 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::setVisibleArea). void (*setClientVisibleArea) (LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight); -/// @see lok::Document::setOutlineState). -void (*setOutlineState) (LibreOfficeKitDocument* pThis, bool bColumn, int nLevel, int nIndex, bool bHidden); - /// @see lok::Document::createView(). int (*createView) (LibreOfficeKitDocument* pThis); /// @see lok::Document::destroyView(). @@ -270,6 +267,9 @@ struct _LibreOfficeKitDocumentClass int* pArray, size_t nSize); +/// @see lok::Document::setOutlineState). +void (*setOutlineState) (LibreOfficeKitDocument* pThis, bool bColumn, int nLevel, int nIndex, bool bHidden); + /// Paints window with given id to the buffer /// @see lok::Document::paintWindow(). void (*paintWindow) (LibreOfficeKitDocument* pThis, unsigned nWindowId, @@ -297,6 +297,9 @@ struct _LibreOfficeKitDocumentClass int nButtons, int nModifier); +/// @see lok::Document::setViewLanguage(). +void (*setViewLanguage) (LibreOfficeKitDocument* pThis, int nId, const char* language); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 835710e0..310b9cfc 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -526,6 +526,17 @@ public: return mpDoc->pClass->getViewIds(mpDoc, pArray, nSize); } +/** + * Set the language tag of the window with the specified nId. + * + * @param nId a view ID, returned by createView(). + * @param language Bcp47 languageTag, like en-US or so. + */ +void setViewLanguage(int nId, const char* language) +{ +mpDoc->pClass->setViewLanguage(mpDoc, nId, language); +} + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include kit/Kit.cpp
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |7 ++- kit/Kit.cpp |6 -- 2 files changed, 10 insertions(+), 3 deletions(-) New commits: commit 96a2d3c36ce937454894b6a64e28a53a2c74b856 Author: Marco CecchettiDate: Tue Dec 12 12:23:36 2017 +0100 calc: LOK_FEATURE_RANGE_ADDRESS (solving compatibility issue) In order to make cp-5.3 compatible with online 2.1.x we introduced a new enum which by default disables collecting the new range based header data implementation. This patch (re-)enable this feature on online 3.x Change-Id: Ieab4145df9d132810bd871b1a315fd2171ba0ab5 Reviewed-on: https://gerrit.libreoffice.org/46288 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky (cherry picked from commit 2a2c04651c3a935a793f7710118b5945f6966ab0) Reviewed-on: https://gerrit.libreoffice.org/46598 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index cf85d7c6..f14ce4d3 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -79,7 +79,12 @@ typedef enum /** * Turn off tile rendering for annotations */ -LOK_FEATURE_NO_TILED_ANNOTATIONS = (1ULL << 3) +LOK_FEATURE_NO_TILED_ANNOTATIONS = (1ULL << 3), + +/** + * Enable range based header data + */ +LOK_FEATURE_RANGE_HEADERS = (1ULL << 4) } LibreOfficeKitOptionalFeatures; diff --git a/kit/Kit.cpp b/kit/Kit.cpp index 4e83df9b..13e791ac 100644 --- a/kit/Kit.cpp +++ b/kit/Kit.cpp @@ -1419,7 +1419,8 @@ private: const auto flags = LOK_FEATURE_DOCUMENT_PASSWORD | LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY | LOK_FEATURE_PART_IN_INVALIDATION_CALLBACK - | LOK_FEATURE_NO_TILED_ANNOTATIONS; + | LOK_FEATURE_NO_TILED_ANNOTATIONS + | LOK_FEATURE_RANGE_HEADERS; _loKit->setOptionalFeatures(flags); // Save the provided password with us and the jailed url @@ -2184,7 +2185,8 @@ void lokit_main(const std::string& childRoot, const auto flags = LOK_FEATURE_DOCUMENT_PASSWORD | LOK_FEATURE_DOCUMENT_PASSWORD_TO_MODIFY | LOK_FEATURE_PART_IN_INVALIDATION_CALLBACK - | LOK_FEATURE_NO_TILED_ANNOTATIONS; + | LOK_FEATURE_NO_TILED_ANNOTATIONS + | LOK_FEATURE_RANGE_HEADERS; loKit->setOptionalFeatures(flags); loKitDoc.reset(loKit->documentLoad(uri.c_str())); if (!loKitDoc || !loKitDoc->get()) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/ChildSession.hpp kit/DummyLibreOfficeKit.cpp loleaflet/src wsd/ClientSession.cpp wsd/protocol.txt
bundled/include/LibreOfficeKit/LibreOfficeKit.h |3 ++ bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 13 kit/ChildSession.cpp | 33 ++ kit/ChildSession.hpp |1 kit/DummyLibreOfficeKit.cpp | 11 +++ loleaflet/src/control/Control.Header.js | 16 -- wsd/ClientSession.cpp |1 wsd/protocol.txt |6 8 files changed, 75 insertions(+), 9 deletions(-) New commits: commit 29a233e5a9009cbe2ec0f62cc05cf0aceca8e459 Author: Marco CecchettiDate: Tue Nov 28 23:38:35 2017 +0100 calc: set outline state use a specific message from the client for set the visibility state of a group instead of hijacking the update row/column header message Change-Id: I69d66b30db0b4d8a0082cbd2524120491d4f97cb Reviewed-on: https://gerrit.libreoffice.org/45446 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 14824821..02e8e50e 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -227,6 +227,9 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::setVisibleArea). void (*setClientVisibleArea) (LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight); +/// @see lok::Document::setOutlineState). +void (*setOutlineState) (LibreOfficeKitDocument* pThis, bool bColumn, int nLevel, int nIndex, bool bHidden); + /// @see lok::Document::createView(). int (*createView) (LibreOfficeKitDocument* pThis); /// @see lok::Document::destroyView(). diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 19e121fe..1c4fcd03 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -465,6 +465,19 @@ public: } /** + * Show/Hide a single row/column header outline for Calc dosuments. + * + * @param bColumn - if we are dealing with a column or row group + * @param nLevel - the level to which the group belongs + * @param nIndex - the group entry index + * @param bHidden - the new group state (collapsed/expanded) + */ +void setOutlineState(bool bColumn, int nLevel, int nIndex, bool bHidden) +{ +mpDoc->pClass->setOutlineState(mpDoc, bColumn, nLevel, nIndex, bHidden); +} + +/** * Create a new view for an existing document. * By default a loaded document has 1 view. * @return the ID of the new view. diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index b540febe..ca4c855e 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -217,6 +217,7 @@ bool ChildSession::_handleInput(const char *buffer, int length) assert(tokens[0] == "clientzoom" || tokens[0] == "clientvisiblearea" || + tokens[0] == "outlinestate" || tokens[0] == "downloadas" || tokens[0] == "getchildid" || tokens[0] == "gettextselection" || @@ -243,6 +244,10 @@ bool ChildSession::_handleInput(const char *buffer, int length) { return clientVisibleArea(buffer, length, tokens); } +else if (tokens[0] == "outlinestate") +{ +return outlineState(buffer, length, tokens); +} else if (tokens[0] == "downloadas") { return downloadAs(buffer, length, tokens); @@ -592,6 +597,34 @@ bool ChildSession::clientVisibleArea(const char* /*buffer*/, int /*length*/, con return true; } +bool ChildSession::outlineState(const char* /*buffer*/, int /*length*/, const std::vector& tokens) +{ +std::string type, state; +int level, index; + +if (tokens.size() != 5 || +!getTokenString(tokens[1], "type", type) || +(type != "column" && type != "row") || +!getTokenInteger(tokens[2], "level", level) || +!getTokenInteger(tokens[3], "index", index) || +!getTokenString(tokens[4], "state", state) || +(state != "visible" && state != "hidden")) +{ +sendTextFrame("error: cmd=outlinestate kind=syntax"); +return false; +} + +bool column = type == "column"; +bool hidden = state == "hidden"; + +std::unique_lock lock(_docManager.getDocumentMutex()); + +getLOKitDocument()->setView(_viewId); + +getLOKitDocument()->setOutlineState(column, level, index, hidden); +return true; +} + bool ChildSession::downloadAs(const char* /*buffer*/, int /*length*/, const std::vector& tokens) { std::string name, id, format, filterOptions; diff --git
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 80 +-- bundled/include/LibreOfficeKit/LibreOfficeKit.hxx| 216 +-- bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 26 ++ bundled/include/LibreOfficeKit/LibreOfficeKitInit.h | 109 + bundled/include/LibreOfficeKit/LibreOfficeKitTypes.h |5 5 files changed, 307 insertions(+), 129 deletions(-) New commits: commit 3483a519736a51bf54407db0cb64019460aa801a Author: Pranav KantDate: Mon Oct 30 16:57:18 2017 +0530 Update bundled headers Change-Id: I292dac1d6c801914960b73e951b6565cc36df1e9 diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index fab12da1..cc4752e0 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -12,10 +12,13 @@ #include -#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY // the unstable API needs C99's bool -#include -#include +// TODO remove the C99 types from the API before making stable +#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY +# ifndef _WIN32 +# include +# endif +# include #endif #include @@ -60,26 +63,37 @@ struct _LibreOfficeKitClass /// @since LibreOffice 5.2 void (*freeError) (char* pFree); -#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY +/// @since LibreOffice 6.0 void (*registerCallback) (LibreOfficeKit* pThis, LibreOfficeKitCallback pCallback, void* pData); -/// @see lok::Office::getFilterTypes(). +/** @see lok::Office::getFilterTypes(). +@since LibreOffice 6.0 + */ char* (*getFilterTypes) (LibreOfficeKit* pThis); -/// @see lok::Office::setOptionalFeatures(). +/** @see lok::Office::setOptionalFeatures(). +@since LibreOffice 6.0 + */ void (*setOptionalFeatures)(LibreOfficeKit* pThis, unsigned long long features); -/// @see lok::Office::setDocumentPassword(). +/** @see lok::Office::setDocumentPassword(). +@since LibreOffice 6.0 + */ void (*setDocumentPassword) (LibreOfficeKit* pThis, char const* pURL, char const* pPassword); -/// @see lok::Office::getVersionInfo(). +/** @see lok::Office::getVersionInfo(). +@since LibreOffice 6.0 + */ char* (*getVersionInfo) (LibreOfficeKit* pThis); -#endif +/** @see lok::Office::runMacro(). +@since LibreOffice 6.0 + */ +int (*runMacro) (LibreOfficeKit *pThis, const char* pURL); }; #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize) @@ -100,10 +114,12 @@ struct _LibreOfficeKitDocumentClass const char* pFormat, const char* pFilterOptions); -#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY -/// @see lok::Document::getDocumentType(). +/** @see lok::Document::getDocumentType(). +@since LibreOffice 6.0 + */ int (*getDocumentType) (LibreOfficeKitDocument* pThis); +#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY /// @see lok::Document::getParts(). int (*getParts) (LibreOfficeKitDocument* pThis); @@ -250,15 +266,39 @@ struct _LibreOfficeKitDocumentClass int* pArray, size_t nSize); -/// Starts a batch of operations. -/// Events are emmitted only after ending the batch. -/// @see lok::Document::endBatch(); -void (*beginBatch) (LibreOfficeKitDocument* pThis); - -/// Ends a batch of operations. -/// @see lok::Document::beginBatch(); -void (*endBatch) (LibreOfficeKitDocument* pThis); - +/// Paints dialog with given dialog id to the buffer +/// @see lok::Document::paintDialog(). +void (*paintDialog) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, char** pDialogTitle, int* nWidth, int* nHeight); + +/// @see lok::Document::paintActiveFloatingWindow(). +void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); + +/// @see lok::Document::postDialogKeyEvent(). +void (*postDialogKeyEvent) (LibreOfficeKitDocument* pThis, +const char* pDialogId, +int nType, +int nCharCode, +int nKeyCode); + +/// @see lok::Document::postDialogMouseEvent(). +void (*postDialogMouseEvent) (LibreOfficeKitDocument* pThis, + const char* pDialogId, + int nType, + int nX, + int nY, + int nCount, +
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 9f99e40d5ecadaaefbb683d49fa0c6c0561677d9 Author: Marco CecchettiDate: Tue Sep 26 14:30:55 2017 +0200 Adapt bundled include to core include Change-Id: I3066a58545f85724fe07bf344d37ca6261312280 diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 55cff727..fab12da1 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -69,7 +69,7 @@ struct _LibreOfficeKitClass char* (*getFilterTypes) (LibreOfficeKit* pThis); /// @see lok::Office::setOptionalFeatures(). -void (*setOptionalFeatures)(LibreOfficeKit* pThis, uint64_t features); +void (*setOptionalFeatures)(LibreOfficeKit* pThis, unsigned long long features); /// @see lok::Office::setDocumentPassword(). void (*setDocumentPassword) (LibreOfficeKit* pThis, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 20 ++- 1 file changed, 19 insertions(+), 1 deletion(-) New commits: commit 124cf6a7b99643bea527993ac9d418d7fe9fecd2 Author: Marco CecchettiDate: Sun Sep 3 23:05:04 2017 +0200 ruler: added the ruler callback enum to the bundled include Change-Id: Ie8100b08897ce7f49b5108cea147bf9bfe6060ed diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index 0bf35024..477b6f4d 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -505,7 +505,25 @@ typedef enum /** * The text content of the address field in Calc. */ -LOK_CALLBACK_CELL_ADDRESS = 34 +LOK_CALLBACK_CELL_ADDRESS = 34, + +/** + * The key ruler related properties on change are reported by this. + * + * The payload format is: + * + * { + * "margin1": "...", + * "margin2": "...", + * "leftOffset": "...", + * "pageOffset": "...", + * "pageWidth": "...", + * "unit": "..." + * } + * + * Here all aproperties are same as described in svxruler. + */ +LOK_CALLBACK_RULER_UPDATE = 35 } LibreOfficeKitCallbackType; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/KitHelper.hpp loleaflet/dist loleaflet/src tools/KitClient.cpp wsd/protocol.txt
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h |8 kit/ChildSession.cpp |6 +++ kit/KitHelper.hpp|3 + loleaflet/dist/toolbar.css |7 +++- loleaflet/dist/toolbar/toolbar.js| 31 +++ loleaflet/src/layer/tile/TileLayer.js|8 tools/KitClient.cpp |1 wsd/protocol.txt |5 +++ 8 files changed, 66 insertions(+), 3 deletions(-) New commits: commit 024e786e8591bbb75b6828ef3aad1a65574b7e97 Author: Marco CecchettiDate: Mon May 8 00:38:13 2017 +0200 calc: added an address input field Change-Id: Ic030724e392693847a195b5e53866b40ebad7435 Reviewed-on: https://gerrit.libreoffice.org/37359 Reviewed-by: pranavk Tested-by: pranavk diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index dffc728e..0bf35024 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -500,7 +500,13 @@ typedef enum * * The payload says if we are invalidating a row or column header. */ -LOK_CALLBACK_INVALIDATE_HEADER = 33 +LOK_CALLBACK_INVALIDATE_HEADER = 33, + +/** + * The text content of the address field in Calc. + */ +LOK_CALLBACK_CELL_ADDRESS = 34 + } LibreOfficeKitCallbackType; diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 295f261f..1fbc1944 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -1000,7 +1000,8 @@ void ChildSession::rememberEventsForInactiveUser(const int type, const std::stri type == LOK_CALLBACK_CELL_CURSOR || type == LOK_CALLBACK_GRAPHIC_SELECTION || type == LOK_CALLBACK_DOCUMENT_SIZE_CHANGED || - type == LOK_CALLBACK_INVALIDATE_HEADER) + type == LOK_CALLBACK_INVALIDATE_HEADER || + type == LOK_CALLBACK_CELL_ADDRESS) { auto lock(getLock()); _stateRecorder.recordEvent(type, payload); @@ -1230,6 +1231,9 @@ void ChildSession::loKitCallback(const int type, const std::string& payload) case LOK_CALLBACK_INVALIDATE_HEADER: sendTextFrame("invalidateheader: " + payload); break; +case LOK_CALLBACK_CELL_ADDRESS: +sendTextFrame("celladdress: " + payload); +break; default: LOG_ERR("Unknown callback event (" << type << "): " << payload); } diff --git a/kit/KitHelper.hpp b/kit/KitHelper.hpp index 63040a1e..efb0d5cb 100644 --- a/kit/KitHelper.hpp +++ b/kit/KitHelper.hpp @@ -111,6 +111,9 @@ namespace LOKitHelper return "COMMENT"; case LOK_CALLBACK_INVALIDATE_HEADER: return "INVALIDATE_HEADER"; +case LOK_CALLBACK_CELL_ADDRESS: +return "CELL_ADDRESS"; + } return std::to_string(type); diff --git a/loleaflet/dist/toolbar.css b/loleaflet/dist/toolbar.css index a2b5c31f..e8288c68 100644 --- a/loleaflet/dist/toolbar.css +++ b/loleaflet/dist/toolbar.css @@ -52,9 +52,14 @@ padding-left: 125px; } +#addressInput { +height: 29px; +width: 100px; +} + #formulaInput { height: 29px; -width: 800px; +width: 700px; } #tb_toolbar-up_item_close { diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js index 793bd910..bbd4b81e 100644 --- a/loleaflet/dist/toolbar/toolbar.js +++ b/loleaflet/dist/toolbar/toolbar.js @@ -614,6 +614,8 @@ $(function () { name: 'formulabar', items: [ {type: 'html', id: 'left'}, + {type: 'html', id: 'address', html: ''}, + {type: 'break'}, {type: 'button', id: 'sum', img: 'autosum', hint: _('Sum')}, {type: 'button', id: 'function', img: 'equal', hint: _('Function')}, {type: 'button', hidden: true, id: 'cancelformula', img: 'cancel', hint: _('Cancel')}, @@ -624,6 +626,7 @@ $(function () { onClick(e.target); }, onRefresh: function(e) { + $('#addressInput').off('keyup', onAddressInput).on('keyup', onAddressInput); $('#formulaInput').off('keyup', onFormulaInput).on('keyup', onFormulaInput); $('#formulaInput').off('blur', onFormulaBarBlur).on('blur', onFormulaBarBlur); $('#formulaInput').off('focus', onFormulaBarFocus).on('focus', onFormulaBarFocus); @@ -868,6 +871,25 @@ function onInsertFile() { return false; } +function onAddressInput(e) { + if (e.keyCode === 13) { + // address control should not have
[Libreoffice-commits] online.git: bundled/include kit/ChildSession.cpp kit/KitHelper.hpp loleaflet/src tools/KitClient.cpp
bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 10 +- kit/ChildSession.cpp |6 +- kit/KitHelper.hpp|4 +++- loleaflet/src/control/Control.RowHeader.js |5 - loleaflet/src/layer/tile/CalcTileLayer.js|4 tools/KitClient.cpp |1 + 6 files changed, 22 insertions(+), 8 deletions(-) New commits: commit 1e0deae3df1e1a36c986983908be6180993292a1 Author: Marco CecchettiDate: Wed Apr 19 23:09:19 2017 +0200 Calc: changed the way header are updated on row/col insertion/deletion Now when a row/col is inserted/removed or resized is the core to notify the client that current header is no more valid and a new header should be requested by the client to core. In this way core can notify the header invalidation to all views. Change-Id: Ia3c1872b73cfb3458cd0d35907291a9fc9eebd11 Reviewed-on: https://gerrit.libreoffice.org/36729 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index 8a59b4cc..dffc728e 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -492,7 +492,15 @@ typedef enum * - 'action' can be 'Add', 'Remove' or 'Modify' depending on whether *comment has been added, removed or modified. */ -LOK_CALLBACK_COMMENT = 32 +LOK_CALLBACK_COMMENT = 32, + +/** + * The column/row header is no more valid because of a column/row insertion + * or a similar event. Clients must query a new column/row header set. + * + * The payload says if we are invalidating a row or column header. + */ +LOK_CALLBACK_INVALIDATE_HEADER = 33 } LibreOfficeKitCallbackType; diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index e3aaa5dd..97a384a7 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -979,7 +979,8 @@ void ChildSession::rememberEventsForInactiveUser(const int type, const std::stri type == LOK_CALLBACK_CELL_FORMULA || type == LOK_CALLBACK_CELL_CURSOR || type == LOK_CALLBACK_GRAPHIC_SELECTION || -type == LOK_CALLBACK_DOCUMENT_SIZE_CHANGED) +type == LOK_CALLBACK_DOCUMENT_SIZE_CHANGED || +type == LOK_CALLBACK_INVALIDATE_HEADER) { auto lock(getLock()); _stateRecorder.recordEvent(type, payload); @@ -1199,6 +1200,9 @@ void ChildSession::loKitCallback(const int type, const std::string& payload) case LOK_CALLBACK_COMMENT: sendTextFrame("comment: " + payload); break; +case LOK_CALLBACK_INVALIDATE_HEADER: +sendTextFrame("invalidateheader: " + payload); +break; default: LOG_ERR("Unknown callback event (" << type << "): " << payload); } diff --git a/kit/KitHelper.hpp b/kit/KitHelper.hpp index 19c36f3b..63040a1e 100644 --- a/kit/KitHelper.hpp +++ b/kit/KitHelper.hpp @@ -109,7 +109,9 @@ namespace LOKitHelper return "VIEW_LOCK"; case LOK_CALLBACK_COMMENT: return "COMMENT"; -} +case LOK_CALLBACK_INVALIDATE_HEADER: +return "INVALIDATE_HEADER"; + } return std::to_string(type); } diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js index 9ca3395d..d5f702a1 100644 --- a/loleaflet/src/control/Control.RowHeader.js +++ b/loleaflet/src/control/Control.RowHeader.js @@ -93,7 +93,6 @@ L.Control.RowHeader = L.Control.Header.extend({ this._selectRow(row, 0); } this._map.sendUnoCommand('.uno:InsertRows'); - this._updateRowHeader(); }, deleteRow: function(row) { @@ -101,7 +100,6 @@ L.Control.RowHeader = L.Control.Header.extend({ this._selectRow(row, 0); } this._map.sendUnoCommand('.uno:DeleteRows'); - this._updateRowHeader(); }, hideRow: function(row) { @@ -109,7 +107,6 @@ L.Control.RowHeader = L.Control.Header.extend({ this._selectRow(row, 0); } this._map.sendUnoCommand('.uno:HideRow'); - this._updateRowHeader(); }, showRow: function(row) { @@ -117,7 +114,6 @@ L.Control.RowHeader = L.Control.Header.extend({ this._selectRow(row, 0); } this._map.sendUnoCommand('.uno:ShowRow'); - this._updateRowHeader(); }, setScrollPosition: function (e) { @@ -286,7 +282,6 @@ L.Control.RowHeader = L.Control.Header.extend({ };
[Libreoffice-commits] online.git: bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 11 ++- bundled/include/LibreOfficeKit/LibreOfficeKit.hxx| 10 ++ bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 64 +-- 3 files changed, 52 insertions(+), 33 deletions(-) New commits: commit 494cdca018a62e805ba733739330c3d8ef4495bf Author: Ashod NakashianDate: Thu Jan 19 23:23:06 2017 -0500 wsd: update LO Kit headers Change-Id: Ia6905cf959dc284948e7ad43e9907ac0a2577545 Reviewed-on: https://gerrit.libreoffice.org/33420 Reviewed-by: Ashod Nakashian Tested-by: Ashod Nakashian diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 0b9535a..55cff72 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -61,7 +61,6 @@ struct _LibreOfficeKitClass void (*freeError) (char* pFree); #if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY -/// @see lok::Office::registerCallback(). void (*registerCallback) (LibreOfficeKit* pThis, LibreOfficeKitCallback pCallback, void* pData); @@ -251,6 +250,16 @@ struct _LibreOfficeKitDocumentClass int* pArray, size_t nSize); +/// Starts a batch of operations. +/// Events are emmitted only after ending the batch. +/// @see lok::Document::endBatch(); +void (*beginBatch) (LibreOfficeKitDocument* pThis); + +/// Ends a batch of operations. +/// @see lok::Document::beginBatch(); +void (*endBatch) (LibreOfficeKitDocument* pThis); + + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 447f44b..46ecb5f 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -452,6 +452,16 @@ public: return mpDoc->pClass->getViewIds(mpDoc, pArray, nSize); } +inline void beginBatch() +{ +mpDoc->pClass->beginBatch(mpDoc); +} + +inline void endBatch() +{ +mpDoc->pClass->endBatch(mpDoc); +} + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h index 187fa98..d2ccc0f 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -93,13 +93,13 @@ typedef enum * * @see LOK_FEATURE_PART_IN_INVALIDATION_CALLBACK. */ -LOK_CALLBACK_INVALIDATE_TILES, +LOK_CALLBACK_INVALIDATE_TILES = 0, /** * The size and/or the position of the visible cursor changed. * * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. */ -LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, +LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR = 1, /** * The list of rectangles representing the current text selection changed. * @@ -108,7 +108,7 @@ typedef enum * LOK_CALLBACK_INVALIDATE_TILES. When there is no selection, an empty * string is provided. */ -LOK_CALLBACK_TEXT_SELECTION, +LOK_CALLBACK_TEXT_SELECTION = 2, /** * The position and size of the cursor rectangle at the text * selection start. It is used to draw the selection handles. @@ -118,7 +118,7 @@ typedef enum * * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. */ -LOK_CALLBACK_TEXT_SELECTION_START, +LOK_CALLBACK_TEXT_SELECTION_START = 3, /** * The position and size of the cursor rectangle at the text * selection end. It is used to draw the selection handles. @@ -128,7 +128,7 @@ typedef enum * * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. */ -LOK_CALLBACK_TEXT_SELECTION_END, +LOK_CALLBACK_TEXT_SELECTION_END = 4, /** * The blinking text cursor is now visible or not. * @@ -137,26 +137,26 @@ typedef enum * LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR once it becomes false. Payload is * either the "true" or the "false" string. */ -LOK_CALLBACK_CURSOR_VISIBLE, +LOK_CALLBACK_CURSOR_VISIBLE = 5, /** * The size and/or the position of the graphic selection changed. * * Rectangle format is the same as LOK_CALLBACK_INVALIDATE_TILES. */ -LOK_CALLBACK_GRAPHIC_SELECTION, +LOK_CALLBACK_GRAPHIC_SELECTION = 6, /** * User clicked on an hyperlink that should be handled by other * applications accordingly. */ -LOK_CALLBACK_HYPERLINK_CLICKED, +LOK_CALLBACK_HYPERLINK_CLICKED = 7, /** * Emit state update to the client. * For