summaryrefslogtreecommitdiff
path: root/include/LibreOfficeKit
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-11-05 14:01:42 +0530
committerpranavk <pranavk@collabora.co.uk>2017-11-09 04:12:50 +0100
commit446a37ece35dbe4c442f0679dd1cb4df79ed87a7 (patch)
tree092daeb0e04964719b9862debd1d3b5aae67fde2 /include/LibreOfficeKit
parentee57d2f8a57ac851c1250f2962ecd1fa987ee3d9 (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/LibreOfficeKit')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h6
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx14
2 files changed, 16 insertions, 4 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index cc4752e04ab2..cb0f17a41655 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -268,7 +268,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 ad5e6d74e878..586637f6606e 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -161,19 +161,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);
}