diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-11-05 14:01:42 +0530 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-11-15 17:07:17 +0100 |
commit | f13dfb4c018080e94d8ed247984bf2f37e0653b8 (patch) | |
tree | 0307994500d53238cfd8a97954f1153dfd034b91 /desktop | |
parent | lokdialog: Tunnel dialog title to lokclient as outparam (diff) | |
download | core-f13dfb4c018080e94d8ed247984bf2f37e0653b8.tar.gz core-f13dfb4c018080e94d8ed247984bf2f37e0653b8.zip |
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.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 6da4125ddf1d..55a9e18b27fa 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -631,7 +631,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); @@ -3112,7 +3112,11 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/, 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; @@ -3125,8 +3129,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); |