summaryrefslogtreecommitdiffstats
path: root/libreofficekit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-01-06 15:56:23 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-01-06 20:55:25 +0100
commitd9997df11fb353aa0d6856554e4f845abc315d4f (patch)
tree4b9f48bcc942a38f98aa3590203e687dca124b4d /libreofficekit
parentlok::Document: add registerCallback() (diff)
downloadcore-d9997df11fb353aa0d6856554e4f845abc315d4f.tar.gz
core-d9997df11fb353aa0d6856554e4f845abc315d4f.zip
gtktiledviewer: register a LOK callback and re-render the document ...
... when the callback is invoked Change-Id: I979a75bc7c7ad1e0d0b9c5413c238ed7260d2093
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/source/gtk/lokdocview.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c
index 5884e66031ae..8eafb538af1c 100644
--- a/libreofficekit/source/gtk/lokdocview.c
+++ b/libreofficekit/source/gtk/lokdocview.c
@@ -149,6 +149,16 @@ void renderDocument( LOKDocView* pDocView )
gtk_image_set_from_pixbuf( GTK_IMAGE( pDocView->pCanvas ), pDocView->pPixBuf );
}
+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 );
+}
+
SAL_DLLPUBLIC_EXPORT gboolean lok_docview_open_document( LOKDocView* pDocView, char* pPath )
{
if ( pDocView->pDocument )
@@ -167,7 +177,10 @@ SAL_DLLPUBLIC_EXPORT gboolean lok_docview_open_document( LOKDocView* pDocView, c
return FALSE;
}
else
+ {
renderDocument( pDocView );
+ pDocView->pDocument->pClass->registerCallback(pDocView->pDocument, &lok_docview_callback, pDocView);
+ }
return TRUE;
}