summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/kde5/KDE5SalGraphics.cxx2
-rw-r--r--vcl/unx/kde5/KDE5SalInstance.cxx18
-rw-r--r--vcl/unx/kde5/KDE5SalInstance.hxx4
-rw-r--r--vcl/unx/kde5/KDE5SalVirtualDevice.hxx36
4 files changed, 58 insertions, 2 deletions
diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx
index 6e30b9599740..268f8331f7e7 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.cxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.cxx
@@ -40,7 +40,7 @@ static void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf)
}
KDE5SalGraphics::KDE5SalGraphics(Qt5Frame* pFrame)
- : Qt5SvpGraphics(pFrame->GetQWidget())
+ : Qt5SvpGraphics(pFrame ? pFrame->GetQWidget() : nullptr)
, m_pFrame(pFrame)
{
}
diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx
index cbbf40f87a4d..96d1501cca19 100644
--- a/vcl/unx/kde5/KDE5SalInstance.cxx
+++ b/vcl/unx/kde5/KDE5SalInstance.cxx
@@ -35,7 +35,7 @@
#include "KDE5FilePicker.hxx"
#include "KDE5SalData.hxx"
#include "KDE5SalInstance.hxx"
-#include "KDE5SalFrame.hxx"
+#include "KDE5SalVirtualDevice.hxx"
using namespace com::sun::star;
@@ -89,6 +89,22 @@ KDE5SalInstance::createFolderPicker(const uno::Reference<uno::XComponentContext>
bool KDE5SalInstance::IsMainThread() const { return qApp->thread() == QThread::currentThread(); }
+std::unique_ptr<SalVirtualDevice> KDE5SalInstance::CreateVirtualDevice(SalGraphics* pGraphics,
+ long& nDX, long& nDY,
+ DeviceFormat eFormat,
+ const SystemGraphicsData*)
+{
+ std::unique_ptr<SalVirtualDevice> pVD;
+ assert(pGraphics);
+ RunInMainThread([&]() {
+ KDE5SalGraphics* pKDE5Graphics = dynamic_cast<KDE5SalGraphics*>(pGraphics);
+ assert(pKDE5Graphics);
+ pVD.reset(new KDE5SalVirtualDevice(eFormat, pKDE5Graphics->getSurface()));
+ pVD->SetSize(nDX, nDY);
+ });
+ return pVD;
+}
+
extern "C" {
VCLPLUG_KDE5_PUBLIC SalInstance* create_SalInstance()
{
diff --git a/vcl/unx/kde5/KDE5SalInstance.hxx b/vcl/unx/kde5/KDE5SalInstance.hxx
index 5980ea4699cc..ecb8f74627bb 100644
--- a/vcl/unx/kde5/KDE5SalInstance.hxx
+++ b/vcl/unx/kde5/KDE5SalInstance.hxx
@@ -42,6 +42,10 @@ public:
virtual bool IsMainThread() const override;
+ virtual std::unique_ptr<SalVirtualDevice>
+ CreateVirtualDevice(SalGraphics*, long&, long&, DeviceFormat,
+ const SystemGraphicsData* = nullptr) override;
+
private:
virtual SalFrame* CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle) override;
diff --git a/vcl/unx/kde5/KDE5SalVirtualDevice.hxx b/vcl/unx/kde5/KDE5SalVirtualDevice.hxx
new file mode 100644
index 000000000000..baa8a2e31aa8
--- /dev/null
+++ b/vcl/unx/kde5/KDE5SalVirtualDevice.hxx
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <headless/svpvd.hxx>
+#include "KDE5SalGraphics.hxx"
+
+class VCL_DLLPUBLIC KDE5SalVirtualDevice : public SvpSalVirtualDevice
+{
+public:
+ KDE5SalVirtualDevice(DeviceFormat eFormat, cairo_surface_t* pRefSurface)
+ : SvpSalVirtualDevice(eFormat, pRefSurface)
+ {
+ }
+
+ SalGraphics* AcquireGraphics() override { return AddGraphics(new KDE5SalGraphics(nullptr)); }
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */