summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-08-03 14:42:55 +0530
committerJan Holesovsky <kendy@collabora.com>2017-11-15 17:07:11 +0100
commitcc42b2599dfffa3483699d918f0b8eb28505b54f (patch)
treeb9057eccb41acd41f58d757a4be33ac279faaa4d /desktop
parentbba61e62f3481fe389bc9d8cfb2f786624b96b5a (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.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ed891b44a32c..66f340f71df5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -625,6 +625,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)
{
@@ -674,6 +676,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;
}
@@ -3103,6 +3106,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;