diff options
author | Pranav Kant <pranavk@collabora.co.uk> | 2017-08-03 14:42:55 +0530 |
---|---|---|
committer | Pranav Kant <pranavk@collabora.co.uk> | 2017-10-02 11:01:18 +0530 |
commit | 9cdaccc0cc5664ffb22035f65135b6be876de92f (patch) | |
tree | db1a7c5ff2d08c90c3cb0c6ae94ff870783b49e5 /desktop | |
parent | 44737be728c1d1afa23631e7576569ddf2d3016c (diff) |
lokdialog: Support for rendering floating window dialog widgets
Now gtktiledviewer can show floating window dialog widgets when user
clicks any of such widget in the dialog.
Change-Id: I13d756f236379bc8b2041ed41cb7b502f7fd9b24
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 8246894e22dc..c5ca3666f9e7 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -606,6 +606,8 @@ static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart); static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); +static void doc_paintActiveFloatingWindow(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight); + LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent) : mxComponent(xComponent) { @@ -655,6 +657,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone m_pDocumentClass->getPartHash = doc_getPartHash; m_pDocumentClass->paintDialog = doc_paintDialog; + m_pDocumentClass->paintActiveFloatingWindow = doc_paintActiveFloatingWindow; gDocumentClass = m_pDocumentClass; } @@ -3075,6 +3078,24 @@ static void doc_paintDialog(LibreOfficeKitDocument* pThis, const char* pDialogId comphelper::LibreOfficeKit::setDialogPainting(false); } +static void doc_paintActiveFloatingWindow(LibreOfficeKitDocument* pThis, const char* pDialogId, unsigned char* pBuffer, int* nWidth, int* nHeight) +{ + SolarMutexGuard aGuard; + + IDialogRenderable* pDialogRenderable = getDialogRenderable(pThis); + + ScopedVclPtrInstance<VirtualDevice> pDevice(nullptr, Size(1, 1), DeviceFormat::DEFAULT); + pDevice->SetBackground(Wallpaper(Color(COL_TRANSPARENT))); + + pDevice->SetOutputSizePixelScaleOffsetAndBuffer(Size(*nWidth, *nHeight), Fraction(1.0), Point(), pBuffer); + + vcl::DialogID aDialogID = OUString::createFromAscii(pDialogId); + + comphelper::LibreOfficeKit::setDialogPainting(true); + pDialogRenderable->paintActiveFloatingWindow(aDialogID, *pDevice.get(), *nWidth, *nHeight); + comphelper::LibreOfficeKit::setDialogPainting(false); +} + static char* lo_getError (LibreOfficeKit *pThis) { SolarMutexGuard aGuard; |