tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / vcl / headless / svpgdi.cxx
blobfb2dc14d146856f947440b9bb5bfa8f837cb6e11
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <headless/svpgdi.hxx>
21 #include <comphelper/lok.hxx>
23 SvpSalGraphics::SvpSalGraphics()
24 : m_aTextRenderImpl(m_aCairoCommon)
25 , m_pBackend(new SvpGraphicsBackend(m_aCairoCommon))
27 bool bLOKActive = comphelper::LibreOfficeKit::isActive();
28 initWidgetDrawBackends(bLOKActive);
31 SvpSalGraphics::~SvpSalGraphics()
33 ReleaseFonts();
36 void SvpSalGraphics::setSurface(cairo_surface_t* pSurface, const basegfx::B2IVector& rSize)
38 m_aCairoCommon.m_pSurface = pSurface;
39 m_aCairoCommon.m_aFrameSize = rSize;
40 dl_cairo_surface_get_device_scale(pSurface, &m_aCairoCommon.m_fScale, nullptr);
41 GetImpl()->ResetClipRegion();
44 void SvpSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
46 rDPIX = rDPIY = 96;
49 bool SvpSalGraphics::ShouldDownscaleIconsAtSurface(double& rScaleOut) const
51 if (comphelper::LibreOfficeKit::isActive())
52 return SalGraphics::ShouldDownscaleIconsAtSurface(rScaleOut);
53 rScaleOut = m_aCairoCommon.m_fScale;
54 return true;
57 #if ENABLE_CAIRO_CANVAS
58 bool SvpSalGraphics::SupportsCairo() const
60 return false;
63 cairo::SurfaceSharedPtr SvpSalGraphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& /*rSurface*/) const
65 return cairo::SurfaceSharedPtr();
68 cairo::SurfaceSharedPtr SvpSalGraphics::CreateSurface(const OutputDevice& /*rRefDevice*/, int /*x*/, int /*y*/, int /*width*/, int /*height*/) const
70 return cairo::SurfaceSharedPtr();
73 cairo::SurfaceSharedPtr SvpSalGraphics::CreateBitmapSurface(const OutputDevice& /*rRefDevice*/, const BitmapSystemData& /*rData*/, const Size& /*rSize*/) const
75 return cairo::SurfaceSharedPtr();
78 css::uno::Any SvpSalGraphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& /*rSurface*/, const basegfx::B2ISize& /*rSize*/) const
80 return css::uno::Any();
83 #endif // ENABLE_CAIRO_CANVAS
85 SystemGraphicsData SvpSalGraphics::GetGraphicsData() const
87 SystemGraphicsData aGraphicsData;
88 aGraphicsData.pSurface = m_aCairoCommon.m_pSurface;
89 return aGraphicsData;
92 #if USE_HEADLESS_CODE
93 void SvpSalGraphics::ApplyFullDamage() const
95 m_aCairoCommon.applyFullDamage();
97 #endif
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */