diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-06 15:56:23 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-01-06 20:55:25 +0100 |
commit | d9997df11fb353aa0d6856554e4f845abc315d4f (patch) | |
tree | 4b9f48bcc942a38f98aa3590203e687dca124b4d | |
parent | aa827f5fde5a95343bb5fa819eda7a10f57e9d36 (diff) |
gtktiledviewer: register a LOK callback and re-render the document ...
... when the callback is invoked
Change-Id: I979a75bc7c7ad1e0d0b9c5413c238ed7260d2093
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.c | 13 |
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; } |