[Libreoffice-commits] core.git: Branch 'feature/tiled-editing' - include/LibreOfficeKit libreofficekit/source sw/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Jan 6 08:33:07 PST 2015


 include/LibreOfficeKit/LibreOfficeKit.h |   13 +++++++++++++
 libreofficekit/source/gtk/lokdocview.c  |   14 ++++++++++----
 sw/source/uibase/docvw/edtwin.cxx       |    2 +-
 3 files changed, 24 insertions(+), 5 deletions(-)

New commits:
commit 21c3a1b61733ef017ee4622a76058b3ecad5da08
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jan 6 17:31:42 2015 +0100

    LOK: add LibreOfficeKitCallbackType enumeration
    
    Change-Id: I0147b1985f87f25e70f4d8672beba18fdd9ba6c2

diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 594f83c..5763d54 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -51,6 +51,19 @@ typedef enum
 }
 LibreOfficeKitPartMode;
 
+typedef enum
+{
+    /**
+     * Any tiles which are over the rectangle described in the payload are no
+     * longer valid.
+     *
+     * Rectangle format: "width,height,x,y", where all numbers are document
+     * coordinates, in twips.
+     */
+    LOK_CALLBACK_INVALIDATE_TILES
+}
+LibreOfficeKitCallbackType;
+
 typedef void (*LibreOfficeKitCallback)(int nType, const char* pPayload, void* pData);
 #endif // LOK_USE_UNSTABLE_API
 
diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c
index 8eafb53..4e13f03 100644
--- a/libreofficekit/source/gtk/lokdocview.c
+++ b/libreofficekit/source/gtk/lokdocview.c
@@ -153,10 +153,16 @@ static void lok_docview_callback(int nType, const char* pPayload, void* pData)
 {
     LOKDocView* pDocView = pData;
 
-    // TODO for now just always render the document.
-    (void)nType;
-    (void)pPayload;
-    renderDocument( pDocView );
+    switch (nType)
+    {
+    case LOK_CALLBACK_INVALIDATE_TILES:
+        // TODO for now just always render the document.
+        (void)pPayload;
+        renderDocument( pDocView );
+        break;
+    default:
+        break;
+    }
 }
 
 SAL_DLLPUBLIC_EXPORT gboolean lok_docview_open_document( LOKDocView* pDocView, char* pPath )
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index b51d56b3..d5e1902 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -6247,7 +6247,7 @@ void SwEditWin::LogicInvalidate(const vcl::Region* pRegion)
         ss << aRectangle.getWidth() << ", " << aRectangle.getHeight() << ", " << aRectangle.getX() << ", " << aRectangle.getY();
         sRectangle = ss.str().c_str();
     }
-    m_rView.GetWrtShell().libreOfficeKitCallback(0, sRectangle.getStr());
+    m_rView.GetWrtShell().libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list