diff options
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 13 | ||||
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.c | 14 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 2 |
3 files changed, 24 insertions, 5 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 1b207388223a..a4addb892f05 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 8eafb538af1c..4e13f0398dd3 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 b51d56b32506..d5e19024189a 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: */ |