summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-11-05 14:01:42 +0530
committerJan Holesovsky <kendy@collabora.com>2017-11-15 17:07:17 +0100
commitf13dfb4c018080e94d8ed247984bf2f37e0653b8 (patch)
tree0307994500d53238cfd8a97954f1153dfd034b91 /include
parentdd2c566b29b74d025761df77f5744c5b21e97625 (diff)
lokdialog: Support painting parts of the dialog
Pass the dimensions of the region to the paintDialog call to paint only that much of the region in the dialog. The DIALOG_INVALIDATE callback also returns a 'rectangle' field now in the payload that tells the region of the dialog invalidated. It can be used in combination with the new paintDialog call then to paint only the invalidated region in the dialog. Change-Id: Iebb228865c71684e0f75dd01271b71ae41a0f906 Reviewed-on: https://gerrit.libreoffice.org/44472 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h6
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx14
-rw-r--r--include/sfx2/lokhelper.hxx2
-rw-r--r--include/vcl/IDialogRenderable.hxx2
4 files changed, 18 insertions, 6 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index de425f4f965e..3941b329a97d 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -254,7 +254,11 @@ struct _LibreOfficeKitDocumentClass
/// Paints dialog with given dialog id to the buffer
/// @see lok::Document::paintDialog().
- void (*paintDialog) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, char** pDialogTitle, int* nWidth, int* nHeight);
+ void (*paintDialog) (LibreOfficeKitDocument* pThis, const char* pDialogId,
+ const int x, const int y,
+ unsigned char* pBuffer,
+ char** pDialogTitle,
+ int* nWidth, int* nHeight);
/// @see lok::Document::paintActiveFloatingWindow().
void (*paintActiveFloatingWindow) (LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 4c682cf6635a..b029aa001ad1 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -160,19 +160,27 @@ public:
* Client must truncate pBuffer according to the nWidth and nHeight returned after the call.
*
* @param pDialogId Unique dialog id to be painted
+ * @param x x-coordinate from where the dialog should start painting
+ * @param y y-coordinate from where the dialog should start painting
* @param pBuffer Buffer with enough memory allocated to render any dialog
* @param pDialogTitle output parameter pointing to a dialog title
* string. Should be freed by the caller.
- * @param nWidth output parameter returning the width of the rendered dialog.
- * @param nHeight output parameter returning the height of the rendered dialog
+ * @param nWidth in/out parameter returning the width of the rendered
+ * dialog. The input width value is used to determined the size of the
+ * image to be painted.
+ * @param nHeight in/out parameter returning the height of the rendered
+ * dialog. The input height value is used to determine the size of the
+ * image to be painted.
*/
void paintDialog(const char* pDialogId,
+ const int x,
+ const int y,
unsigned char* pBuffer,
char** pDialogTitle,
int& nWidth,
int& nHeight)
{
- return mpDoc->pClass->paintDialog(mpDoc, pDialogId, pBuffer,
+ return mpDoc->pClass->paintDialog(mpDoc, pDialogId, x, y, pBuffer,
pDialogTitle, &nWidth, &nHeight);
}
diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index 4738b3e65020..01d519173c2a 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -41,7 +41,7 @@ public:
/// Same as notifyOtherViews(), but works on a selected "other" view, not on all of them.
static void notifyOtherView(SfxViewShell* pThisView, SfxViewShell* pOtherView, int nType, const OString& rKey, const OString& rPayload);
/// Emits a LOK_CALLBACK_DIALOG
- static void notifyDialog(const OUString& rPayload, const OUString& rAction);
+ static void notifyDialog(const OUString& rPayload, const OUString& rAction, const Rectangle* rRect);
/// Emits a LOK_CALLBACK_DIALOG_CHILD
static void notifyDialogChild(const OUString& rDialogID, const OUString& rAction, const Point& rPos);
/// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to setOptionalFeatures() if needed.
diff --git a/include/vcl/IDialogRenderable.hxx b/include/vcl/IDialogRenderable.hxx
index 539d2117f201..94d8a1f4e9e7 100644
--- a/include/vcl/IDialogRenderable.hxx
+++ b/include/vcl/IDialogRenderable.hxx
@@ -46,7 +46,7 @@ public:
int nCount, int nButtons, int nModifier) = 0;
// Callbacks
- virtual void notifyDialog(const DialogID& rDialogID, const OUString& rAction) = 0;
+ virtual void notifyDialog(const DialogID& rDialogID, const OUString& rAction, const Rectangle* rRect) = 0;
virtual void notifyDialogChild(const DialogID& rDialogID, const OUString& rAction, const Point& rPos) = 0;
};