loolwsd/LOOLSession.cpp                                 |   34 ++++++++++++++++
 loolwsd/LOOLSession.hpp                                 |    6 ++
 loolwsd/Makefile.am                                     |    4 +
 loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKit.h |   25 +++++++++--
 4 files changed, 64 insertions(+), 5 deletions(-)

New commits:
commit 80ec8a5b4f4f0e323a98a348c1e1a1ef7018dcd8
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Tue Sep 29 12:27:45 2015 +0200

    loolwsd: parse the partpagerectangles command and cache the values

diff --git a/loolwsd/LOOLSession.cpp b/loolwsd/LOOLSession.cpp
index 233e999..4b00dea 100644
--- a/loolwsd/LOOLSession.cpp
+++ b/loolwsd/LOOLSession.cpp
@@ -214,6 +214,10 @@ bool MasterProcessSession::handleInput(const char *buffer, 
int length)
                 std::string commandName = 
object->get("commandName").toString();
                 peer->_tileCache->saveTextFile(std::string(buffer, length), 
"cmdValues" + commandName + ".txt");
             }
+            else if (tokens[0] == "partpagerectangles:")
+            {
+                peer->_tileCache->saveTextFile(std::string(buffer, length), 
"partpagerectangles.txt");
+            }
             else if (tokens[0] == "invalidatetiles:")
             {
                 // FIXME temporarily, set the editing on the 1st invalidate, 
TODO extend
@@ -283,6 +287,7 @@ bool MasterProcessSession::handleInput(const char *buffer, 
int length)
     }
     else if (tokens[0] != "canceltiles" &&
              tokens[0] != "commandvalues" &&
+             tokens[0] != "partpagerectangles" &&
              tokens[0] != "gettextselection" &&
              tokens[0] != "invalidatetiles" &&
              tokens[0] != "key" &&
@@ -315,6 +320,10 @@ bool MasterProcessSession::handleInput(const char *buffer, 
int length)
     {
         return getCommandValues(buffer, length, tokens);
     }
+    else if (tokens[0] == "partpagerectangles")
+    {
+        return getPartPageRectangles(buffer, length);
+    }
     else if (tokens[0] == "invalidatetiles")
     {
         return invalidateTiles(buffer, length, tokens);
@@ -454,6 +463,21 @@ bool MasterProcessSession::getCommandValues(const char 
*buffer, int length, Stri
     return true;
 }
 
+bool MasterProcessSession::getPartPageRectangles(const char *buffer, int 
length)
+{
+    std::string partPageRectangles = 
_tileCache->getTextFile("partpagerectangles.txt");
+    if (partPageRectangles.size() > 0)
+    {
+        sendTextFrame(partPageRectangles);
+        return true;
+    }
+
+    if (_peer.expired())
+        dispatchChild();
+    forwardToPeer(buffer, length);
+    return true;
+}
+
 void MasterProcessSession::sendTile(const char *buffer, int length, 
StringTokenizer& tokens)
 {
     int part, width, height, tilePosX, tilePosY, tileWidth, tileHeight;
@@ -633,6 +657,10 @@ bool ChildProcessSession::handleInput(const char *buffer, 
int length)
     {
         return getCommandValues(buffer, length, tokens);
     }
+    if (tokens[0] == "partpagerectangles")
+    {
+        return getPartPageRectangles(buffer, length);
+    }
     if (tokens[0] == "load")
     {
         if (_docURL != "")
@@ -895,6 +923,12 @@ bool ChildProcessSession::getCommandValues(const char 
*buffer, int length, Strin
     return true;
 }
 
+bool ChildProcessSession::getPartPageRectangles(const char* /*buffer*/, int 
/*length*/)
+{
+    sendTextFrame("partpagerectangles: " + 
std::string(_loKitDocument->pClass->getPartPageRectangles(_loKitDocument)));
+    return true;
+}
+
 void ChildProcessSession::sendTile(const char *buffer, int length, 
StringTokenizer& tokens)
 {
     int part, width, height, tilePosX, tilePosY, tileWidth, tileHeight;
diff --git a/loolwsd/LOOLSession.hpp b/loolwsd/LOOLSession.hpp
index 247012c..13970c6 100644
--- a/loolwsd/LOOLSession.hpp
+++ b/loolwsd/LOOLSession.hpp
@@ -47,6 +47,8 @@ public:
 
     virtual bool getCommandValues(const char *buffer, int length, 
Poco::StringTokenizer& tokens) = 0;
 
+    virtual bool getPartPageRectangles(const char *buffer, int length) = 0;
+
     virtual bool handleInput(const char *buffer, int length) = 0;
 
 protected:
@@ -113,6 +115,8 @@ public:
 
     virtual bool getCommandValues(const char *buffer, int length, 
Poco::StringTokenizer& tokens);
 
+    virtual bool getPartPageRectangles(const char *buffer, int length) 
override;
+
  protected:
     bool invalidateTiles(const char *buffer, int length, 
Poco::StringTokenizer& tokens);
 
@@ -161,6 +165,8 @@ public:
 
     virtual bool getCommandValues(const char *buffer, int length, 
Poco::StringTokenizer& tokens);
 
+    virtual bool getPartPageRectangles(const char *buffer, int length) 
override;
+
     LibreOfficeKitDocument *_loKitDocument;
     std::string _docType;
 
commit 5d5d41d6198f7b30839a5534dcfea7f6bb1f9006
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Tue Sep 29 12:27:27 2015 +0200

    loolwsd: update bundled LOK headers

diff --git a/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKit.h 
b/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKit.h
index 8060f0e..d83dd49 100644
--- a/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/loolwsd/bundled/include/LibreOfficeKit/LibreOfficeKit.h
@@ -54,6 +54,9 @@ struct _LibreOfficeKitClass
     void (*registerCallback) (LibreOfficeKit* pThis,
                               LibreOfficeKitCallback pCallback,
                               void* pData);
+
+    /// @see lok::Office::getFilterTypes().
+    char* (*getFilterTypes) (LibreOfficeKit* pThis);
 #endif
 };
 
@@ -82,6 +85,9 @@ struct _LibreOfficeKitDocumentClass
     /// @see lok::Document::getParts().
     int (*getParts) (LibreOfficeKitDocument* pThis);
 
+    /// @see lok::Document::getPartPageRectangles().
+    char* (*getPartPageRectangles) (LibreOfficeKitDocument* pThis);
+
     /// @see lok::Document::getPart().
     int (*getPart) (LibreOfficeKitDocument* pThis);
 
@@ -93,10 +99,7 @@ struct _LibreOfficeKitDocumentClass
     char* (*getPartName) (LibreOfficeKitDocument* pThis,
                           int nPart);
 
-    /** Sets mode of the current part.
-     *
-     * @param nMode - element from the LibreOfficeKitPartMode enum.
-     */
+    /// @see lok::Document::setPartMode().
     void (*setPartMode) (LibreOfficeKitDocument* pThis,
                          int nMode);
 
@@ -118,6 +121,7 @@ struct _LibreOfficeKitDocumentClass
     /// @see lok::Document::initializeForRendering().
     void (*initializeForRendering) (LibreOfficeKitDocument* pThis);
 
+    /// @see lok::Document::registerCallback().
     void (*registerCallback) (LibreOfficeKitDocument* pThis,
                               LibreOfficeKitCallback pCallback,
                               void* pData);
@@ -160,8 +164,19 @@ struct _LibreOfficeKitDocumentClass
     /// @see lok::Document::resetSelection
     void (*resetSelection) (LibreOfficeKitDocument* pThis);
 
-    /// @see lok::Document:getStyles
+    /// @see lok::Document::getCommandValues().
     char* (*getCommandValues) (LibreOfficeKitDocument* pThis, const char* 
pCommand);
+
+    /// @see lok::Document::createView().
+    int (*createView) (LibreOfficeKitDocument* pThis);
+    /// @see lok::Document::destroyView().
+    void (*destroyView) (LibreOfficeKitDocument* pThis, int nId);
+    /// @see lok::Document::setView().
+    void (*setView) (LibreOfficeKitDocument* pThis, int nId);
+    /// @see lok::Document::getView().
+    int (*getView) (LibreOfficeKitDocument* pThis);
+    /// @see lok::Document::getViews().
+    int (*getViews) (LibreOfficeKitDocument* pThis);
 #endif // LOK_USE_UNSTABLE_API
 };
 
commit 1feac82b2116b32cce1eb99397bc6d8a9980fe86
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Tue Sep 29 11:15:02 2015 +0200

    loolwsd: implement a 'make tags'

diff --git a/loolwsd/Makefile.am b/loolwsd/Makefile.am
index 07b68ca..9e1f143 100644
--- a/loolwsd/Makefile.am
+++ b/loolwsd/Makefile.am
@@ -34,3 +34,7 @@ all-local: loolwsd
                sudo chown root loolwsd && sudo chmod u+s loolwsd; \
            fi; \
        fi
+
+tags:
+       ctags --c++-kinds=+p --fields=+iaS --extra=+q -R --totals=yes \
+               --exclude=jails *
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to