loolwsd/LOOLSession.cpp | 28 ++++++++++++++++++++++++++++ loolwsd/LOOLSession.hpp | 1 + loolwsd/protocol.txt | 4 ++++ 3 files changed, 33 insertions(+)
New commits: commit 8e95cf10fbb0aa8bcf2016e0a6cba256b072f49c Author: Miklos Vajna <[email protected]> Date: Tue Feb 2 11:48:41 2016 +0100 loolwsd: add clientvisiblearea client -> server command (cherry picked from commit aa450a0c3887dfee75262816ec29a9e28f48f7bf) Conflicts: loolwsd/ChildProcessSession.cpp loolwsd/ChildProcessSession.hpp loolwsd/MasterProcessSession.cpp Change-Id: I7fa50eb52d2db892529729bc3c1826b14f266eb6 diff --git a/loolwsd/LOOLSession.cpp b/loolwsd/LOOLSession.cpp index 73b9a5c..8643196 100644 --- a/loolwsd/LOOLSession.cpp +++ b/loolwsd/LOOLSession.cpp @@ -379,6 +379,7 @@ bool MasterProcessSession::handleInput(const char *buffer, int length) } else if (tokens[0] != "canceltiles" && tokens[0] != "clientzoom" && + tokens[0] != "clientvisiblearea" && tokens[0] != "commandvalues" && tokens[0] != "downloadas" && tokens[0] != "getchildid" && @@ -880,6 +881,7 @@ bool ChildProcessSession::handleInput(const char *buffer, int length) // i.e. need to be handled in a child process. assert(tokens[0] == "clientzoom" || + tokens[0] == "clientvisiblearea" || tokens[0] == "downloadas" || tokens[0] == "getchildid" || tokens[0] == "gettextselection" || @@ -901,6 +903,10 @@ bool ChildProcessSession::handleInput(const char *buffer, int length) { return clientZoom(buffer, length, tokens); } + else if (tokens[0] == "clientvisiblearea") + { + return clientVisibleArea(buffer, length, tokens); + } else if (tokens[0] == "downloadas") { return downloadAs(buffer, length, tokens); @@ -1416,6 +1422,28 @@ bool ChildProcessSession::clientZoom(const char* /*buffer*/, int /*length*/, Str _loKitDocument->pClass->setClientZoom(_loKitDocument, tilePixelWidth, tilePixelHeight, tileTwipWidth, tileTwipHeight); return true; } + +bool ChildProcessSession::clientVisibleArea(const char* /*buffer*/, int /*length*/, StringTokenizer& tokens) +{ + int x; + int y; + int width; + int height; + + if (tokens.count() != 5 || + !getTokenInteger(tokens[1], "x", x) || + !getTokenInteger(tokens[2], "y", y) || + !getTokenInteger(tokens[3], "width", width) || + !getTokenInteger(tokens[4], "height", height)) + { + sendTextFrame("error: cmd=clientvisiblearea kind=syntax"); + return false; + } + + _loKitDocument->pClass->setClientVisibleArea(_loKitDocument, x, y, width, height); + return true; +} + bool ChildProcessSession::downloadAs(const char* /*buffer*/, int /*length*/, StringTokenizer& tokens) { std::string name, id, format, filterOptions; diff --git a/loolwsd/LOOLSession.hpp b/loolwsd/LOOLSession.hpp index 9413544..75feacd 100644 --- a/loolwsd/LOOLSession.hpp +++ b/loolwsd/LOOLSession.hpp @@ -206,6 +206,7 @@ public: virtual void sendFontRendering(const char *buffer, int length, Poco::StringTokenizer& tokens); bool clientZoom(const char *buffer, int length, Poco::StringTokenizer& tokens); + bool clientVisibleArea(const char *buffer, int length, Poco::StringTokenizer& tokens); bool downloadAs(const char *buffer, int length, Poco::StringTokenizer& tokens); bool getChildId(); bool getTextSelection(const char *buffer, int length, Poco::StringTokenizer& tokens); diff --git a/loolwsd/protocol.txt b/loolwsd/protocol.txt index 1d8890d..d3071c6 100644 --- a/loolwsd/protocol.txt +++ b/loolwsd/protocol.txt @@ -107,6 +107,10 @@ partpagerectangles Invokes lok::Document::getPartPageRectangles(). +clientvisiblearea x=<x> y=<y> width=<width> height=<height> + + Invokes lok::Document::setClientVisibleArea(). + server -> client ================ _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
