summaryrefslogtreecommitdiff
path: root/desktop
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 /desktop
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 'desktop')
-rw-r--r--desktop/source/lib/init.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 891911429438..d126da925b2b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -610,7 +610,7 @@ static unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis,
int* pFontHeight);
static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart);
-static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, char** pDialogTitle, int* nWidth, int* nHeight);
+static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId, const int x, const int y, unsigned char* pBuffer, char** pDialogTitle, int* nWidth, int* nHeight);
static void doc_paintActiveFloatingWindow(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight);
@@ -3091,7 +3091,11 @@ unsigned char* doc_renderFont(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pTh
return nullptr;
}
-static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, char** pDialogTitle, int* nWidth, int* nHeight)
+static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId,
+ const int x, const int y,
+ unsigned char* pBuffer,
+ char** pDialogTitle,
+ int* nWidth, int* nHeight)
{
SolarMutexGuard aGuard;
@@ -3104,8 +3108,11 @@ static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId
vcl::DialogID aDialogID = OUString::createFromAscii(pDialogId);
- comphelper::LibreOfficeKit::setDialogPainting(true);
+ MapMode aMapMode(pDevice->GetMapMode());
+ aMapMode.SetOrigin(Point(-x, -y));
+ pDevice->SetMapMode(aMapMode);
+ comphelper::LibreOfficeKit::setDialogPainting(true);
// copy the title of the dialog to outparam
OUString aDialogTitle;
pDialogRenderable->paintDialog(aDialogID, *pDevice.get(), aDialogTitle, *nWidth, *nHeight);