1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <vcl/sysdata.hxx>
12 #include <unx/salunx.h>
13 #include <unx/saldisp.hxx>
14 #include <unx/salgdi.h>
15 #include <unx/salvd.h>
17 #include <skia/x11/salvd.hxx>
19 void X11SalGraphics::Init(X11SkiaSalVirtualDevice
* pDevice
)
21 SalDisplay
* pDisplay
= pDevice
->GetDisplay();
23 m_nXScreen
= pDevice
->GetXScreenNumber();
24 maX11Common
.m_pColormap
= &pDisplay
->GetColormap(m_nXScreen
);
29 bWindow_
= pDisplay
->IsDisplay();
35 X11SkiaSalVirtualDevice::X11SkiaSalVirtualDevice(const SalGraphics
& rGraphics
, tools::Long nDX
,
36 tools::Long nDY
, const SystemGraphicsData
* pData
,
37 std::unique_ptr
<X11SalGraphics
> pNewGraphics
)
38 : mpGraphics(std::move(pNewGraphics
))
44 // TODO Check where a VirtualDevice is created from SystemGraphicsData
45 assert(pData
== nullptr);
48 mpDisplay
= vcl_sal::getSalDisplay(GetGenericUnixSalData());
49 mnXScreen
= static_cast<const X11SalGraphics
&>(rGraphics
).GetScreenNumber();
52 mpGraphics
->Init(this);
55 X11SkiaSalVirtualDevice::~X11SkiaSalVirtualDevice() {}
57 SalGraphics
* X11SkiaSalVirtualDevice::AcquireGraphics()
65 return mpGraphics
.get();
68 void X11SkiaSalVirtualDevice::ReleaseGraphics(SalGraphics
*) { mbGraphics
= false; }
70 bool X11SkiaSalVirtualDevice::SetSize(tools::Long nDX
, tools::Long nDY
)
80 mpGraphics
->Init(this);
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */