[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h |1 + bundled/include/LibreOfficeKit/LibreOfficeKit.hxx |6 -- 2 files changed, 5 insertions(+), 2 deletions(-) New commits: commit f96d59cc023aeb15f1468082c4ab79392e007900 Author: Andras TimarDate: Thu Feb 15 23:01:26 2018 +0100 Update bundled LOK headers Change-Id: I526d3a4207f1721761a3877f50d8580aab840b7c diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index bb99e04a..2af965e4 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -291,6 +291,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 c076c0f0..fabd3b29 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -539,12 +539,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 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - bundled/include common/Protocol.cpp kit/ChildSession.cpp kit/ChildSession.hpp loleaflet/src test/WhiteBoxTests.cpp ws
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 e243ced8958759ee47d06567f3bfb72028fc8dc8 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 (cherry picked from commit ad1da235d3c7ac893fc7c0d0369b4b7b3ed29db6) Reviewed-on: https://gerrit.libreoffice.org/49774 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 8ac97371..bb99e04a 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -289,6 +289,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 d7fa22b7..c076c0f0 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -536,6 +536,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
[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h |9 ++--- bundled/include/LibreOfficeKit/LibreOfficeKit.hxx | 11 +++ 2 files changed, 17 insertions(+), 3 deletions(-) New commits: commit 081401991e12817bdcc2aba6fcd8b029f3b7d53f 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 diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 69b20106..8ac97371 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -217,9 +217,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(). @@ -259,6 +256,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, @@ -286,6 +286,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 7bdd2c47..d7fa22b7 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -525,6 +525,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: Branch 'distro/collabora/collabora-online-3-0' - bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 33 +++--- bundled/include/LibreOfficeKit/LibreOfficeKit.hxx| 60 +-- bundled/include/LibreOfficeKit/LibreOfficeKitEnums.h | 27 ++-- 3 files changed, 35 insertions(+), 85 deletions(-) New commits: commit a94966d8184b285286c93fa2f9950d6c6994ec24 Author: Jan HolesovskyDate: Tue Dec 5 15:59:05 2017 +0100 Update the bundled headers. Change-Id: Ic68e33efc369edff40c7503670dfa91b885cec9a Reviewed-on: https://gerrit.libreoffice.org/45883 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index af3355f9..69b20106 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -213,6 +213,7 @@ struct _LibreOfficeKitDocumentClass int nTilePixelHeight, int nTileTwipWidth, int nTileTwipHeight); + /// @see lok::Document::setVisibleArea). void (*setClientVisibleArea) (LibreOfficeKitDocument* pThis, int nX, int nY, int nWidth, int nHeight); @@ -258,26 +259,26 @@ struct _LibreOfficeKitDocumentClass int* pArray, size_t nSize); -/// Paints dialog with given dialog id to the buffer -/// @see lok::Document::paintDialog(). -void (*paintDialog) (LibreOfficeKitDocument* pThis, unsigned nDialogId, +/// Paints window with given id to the buffer +/// @see lok::Document::paintWindow(). +void (*paintWindow) (LibreOfficeKitDocument* pThis, unsigned nWindowId, unsigned char* pBuffer, const int x, const int y, const int width, const int height); -/// @see lok::Document::paintActiveFloatingWindow(). -void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, unsigned nDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); +/// @see lok::Document::postWindow(). +void (*postWindow) (LibreOfficeKitDocument* pThis, unsigned nWindowId, int nAction); -/// @see lok::Document::postDialogKeyEvent(). -void (*postDialogKeyEvent) (LibreOfficeKitDocument* pThis, -unsigned nDialogId, +/// @see lok::Document::postWindowKeyEvent(). +void (*postWindowKeyEvent) (LibreOfficeKitDocument* pThis, +unsigned nWindowId, int nType, int nCharCode, int nKeyCode); -/// @see lok::Document::postDialogMouseEvent(). -void (*postDialogMouseEvent) (LibreOfficeKitDocument* pThis, - unsigned nDialogId, +/// @see lok::Document::postWindowMouseEvent(). +void (*postWindowMouseEvent) (LibreOfficeKitDocument* pThis, + unsigned nWindowId, int nType, int nX, int nY, @@ -285,16 +286,6 @@ struct _LibreOfficeKitDocumentClass int nButtons, int nModifier); -/// @see lok::Document::postDialogChildMouseEvent(). -void (*postDialogChildMouseEvent) (LibreOfficeKitDocument* pThis, - unsigned nDialogId, - int nType, - int nX, - int nY, - int nCount, - int nButtons, - int nModifier); - #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 93c7e574..7bdd2c47 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -155,45 +155,34 @@ public: } /** - * Renders a dialog with give dialog id and writes the width and height of the rendered dialog + * Renders a window (dialog, popup, etc.) with give id * - * Client must truncate pBuffer according to the nWidth and nHeight returned after the call. - * - * @param nDialogId Unique dialog id to be painted + * @param nWindowId * @param pBuffer Buffer with enough memory allocated to render any dialog * @param x x-coordinate from where the dialog should start painting * @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 */ -void paintDialog(unsigned
[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - bundled/include kit/ChildSession.cpp kit/ChildSession.hpp kit/DummyLibreOfficeKit.cpp loleaflet/src wsd/ClientSession
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 b1366f39cd9d2bdc58a61bbeff0b79b1be7d5ce7 Author: Marco CecchettiDate: Wed Nov 29 00:07:05 2017 +0100 calc: set outline state use a specific message from the client in order to set the visibility state of a group instead of hijacking the update row/column header message Change-Id: I40cd44f61e91300519ea0eaf84617ff12e231025 Reviewed-on: https://gerrit.libreoffice.org/45506 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 355c4457..af3355f9 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -216,6 +216,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 08fbcf85..93c7e574 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -447,6 +447,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: Branch 'distro/collabora/collabora-online-3-0' - bundled/include
bundled/include/LibreOfficeKit/LibreOfficeKit.h | 44 + bundled/include/LibreOfficeKit/LibreOfficeKit.hxx| 154 --- bundled/include/LibreOfficeKit/LibreOfficeKitInit.h | 116 ++ bundled/include/LibreOfficeKit/LibreOfficeKitTypes.h |5 4 files changed, 130 insertions(+), 189 deletions(-) New commits: commit 3f743bc18b022f4c23cb8cea35761c949e126198 Author: Andras TimarDate: Wed Nov 29 15:51:06 2017 +0100 Update bundled headers Change-Id: I7c3ebdebe897c9697d5d52bd5f0cdeabee94c0ab diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 14824821..355c4457 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -63,37 +63,28 @@ struct _LibreOfficeKitClass /// @since LibreOffice 5.2 void (*freeError) (char* pFree); -/// @since LibreOffice 6.0 +#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY void (*registerCallback) (LibreOfficeKit* pThis, LibreOfficeKitCallback pCallback, void* pData); -/** @see lok::Office::getFilterTypes(). -@since LibreOffice 6.0 - */ +/// @see lok::Office::getFilterTypes(). char* (*getFilterTypes) (LibreOfficeKit* pThis); -/** @see lok::Office::setOptionalFeatures(). -@since LibreOffice 6.0 - */ +/// @see lok::Office::setOptionalFeatures(). void (*setOptionalFeatures)(LibreOfficeKit* pThis, unsigned long long features); -/** @see lok::Office::setDocumentPassword(). -@since LibreOffice 6.0 - */ +/// @see lok::Office::setDocumentPassword(). void (*setDocumentPassword) (LibreOfficeKit* pThis, char const* pURL, char const* pPassword); -/** @see lok::Office::getVersionInfo(). -@since LibreOffice 6.0 - */ +/// @see lok::Office::getVersionInfo(). char* (*getVersionInfo) (LibreOfficeKit* pThis); -/** @see lok::Office::runMacro(). -@since LibreOffice 6.0 - */ int (*runMacro) (LibreOfficeKit *pThis, const char* pURL); +#endif + }; #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize) @@ -114,12 +105,10 @@ struct _LibreOfficeKitDocumentClass const char* pFormat, const char* pFilterOptions); -/** @see lok::Document::getDocumentType(). -@since LibreOffice 6.0 - */ +#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY +/// @see lok::Document::getDocumentType(). int (*getDocumentType) (LibreOfficeKitDocument* pThis); -#if defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY /// @see lok::Document::getParts(). int (*getParts) (LibreOfficeKitDocument* pThis); @@ -268,29 +257,24 @@ struct _LibreOfficeKitDocumentClass /// Paints dialog with given dialog id to the buffer /// @see lok::Document::paintDialog(). -void (*paintDialog) (LibreOfficeKitDocument* pThis, const char* pDialogId, +void (*paintDialog) (LibreOfficeKitDocument* pThis, unsigned nDialogId, unsigned char* pBuffer, const int x, const int y, const int width, const int height); -/// Get info about dialog with given dialog id -/// @see lok::Document::getDialogInfo(). -void (*getDialogInfo) (LibreOfficeKitDocument* pThis, const char* pDialogId, - char** pDialogTitle, int* pWidth, int* pHeight); - /// @see lok::Document::paintActiveFloatingWindow(). -void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); +void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, unsigned nDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); /// @see lok::Document::postDialogKeyEvent(). void (*postDialogKeyEvent) (LibreOfficeKitDocument* pThis, -const char* pDialogId, +unsigned nDialogId, int nType, int nCharCode, int nKeyCode); /// @see lok::Document::postDialogMouseEvent(). void (*postDialogMouseEvent) (LibreOfficeKitDocument* pThis, - const char* pDialogId, + unsigned nDialogId, int nType, int nX, int nY, @@ -300,7 +284,7 @@ struct _LibreOfficeKitDocumentClass /// @see lok::Document::postDialogChildMouseEvent(). void (*postDialogChildMouseEvent) (LibreOfficeKitDocument* pThis, -
[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - bundled/include kit/ChildSession.cpp kit/ChildSession.hpp kit/DummyLibreOfficeKit.cpp loleaflet/src wsd/ClientSession
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, 9 insertions(+), 75 deletions(-) New commits: commit 39911df4be3df98737fb8ee2ffa5ffba06619db5 Author: Jan HolesovskyDate: Wed Nov 29 16:09:16 2017 +0200 Revert "calc: set outline state" This reverts commit 63dd187a7f5ad11a6536a8beb68c694abbadac57. Change-Id: I7e1a70bc1a26a7efc429081adc476dee1530213f Reviewed-on: https://gerrit.libreoffice.org/45505 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.h b/bundled/include/LibreOfficeKit/LibreOfficeKit.h index 02e8e50e..14824821 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.h +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.h @@ -227,9 +227,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(). diff --git a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx index 1c4fcd03..19e121fe 100644 --- a/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -465,19 +465,6 @@ 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 ca4c855e..b540febe 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -217,7 +217,6 @@ 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" || @@ -244,10 +243,6 @@ 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); @@ -597,34 +592,6 @@ 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 a/kit/ChildSession.hpp b/kit/ChildSession.hpp index ad9486a2..b5b9209c 100644 ---
[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - bundled/include kit/ChildSession.cpp kit/ChildSession.hpp kit/DummyLibreOfficeKit.cpp loleaflet/src wsd/ClientSession
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 63dd187a7f5ad11a6536a8beb68c694abbadac57 Author: Marco CecchettiDate: Wed Nov 29 00:07:05 2017 +0100 calc: set outline state use a specific message from the client in order to set the visibility state of a group instead of hijacking the update row/column header message Change-Id: Idbcc3cf46d6111c334a55220232d1db5a50be584 Reviewed-on: https://gerrit.libreoffice.org/45473 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky 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 71feb376..80e008fc 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -213,6 +213,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" || @@ -239,6 +240,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); @@ -588,6 +593,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