LibreOffice Module vcl (master) 1
svpgdi.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#ifdef IOS
23#error This file is not for iOS
24#endif
25
26#include <sal/config.h>
27#include <config_features.h>
28
29#include <osl/endian.h>
30#include <vcl/sysdata.hxx>
31#include <config_cairo_canvas.h>
32
34#include <salgdi.hxx>
35#include <sallayout.hxx>
38
41
42struct BitmapBuffer;
43class FreetypeFont;
44
46{
49 std::unique_ptr<SvpGraphicsBackend> m_pBackend;
50
51public:
52 void setSurface(cairo_surface_t* pSurface, const basegfx::B2IVector& rSize);
53 cairo_surface_t* getSurface() const { return m_aCairoCommon.m_pSurface; }
55 {
57 }
58
59protected:
60
62
63public:
65 virtual ~SvpSalGraphics() override;
66
67 virtual SalGraphicsImpl* GetImpl() const override { return m_pBackend.get(); }
68 std::unique_ptr<SvpGraphicsBackend> const& getSvpBackend() { return m_pBackend; }
69
70 virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) override;
71
72 virtual void SetTextColor( Color nColor ) override;
73 virtual void SetFont(LogicalFontInstance*, int nFallbackLevel) override;
74 virtual void GetFontMetric( FontMetricDataRef&, int nFallbackLevel ) override;
75 virtual FontCharMapRef GetFontCharMap() const override;
76 virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override;
78 virtual void ClearDevFontCache() override;
79 virtual bool AddTempDevFont( vcl::font::PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) override;
80 virtual std::unique_ptr<GenericSalLayout>
81 GetTextLayout(int nFallbackLevel) override;
82 virtual void DrawTextLayout( const GenericSalLayout& ) override;
83
84 virtual bool ShouldDownscaleIconsAtSurface(double* pScaleOut) const override;
85
86 virtual SystemGraphicsData GetGraphicsData() const override;
87
88#if ENABLE_CAIRO_CANVAS
89 virtual bool SupportsCairo() const override;
90 virtual cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const override;
91 virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const override;
92 virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const override;
93 virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const override;
94#endif // ENABLE_CAIRO_CANVAS
95
97 {
98 return m_aCairoCommon.getCairoContext(/*bXorModeAllowed*/false, getAntiAlias());
99 }
100
102 {
103 m_aCairoCommon.clipRegion(cr);
104 }
105
106 void copySource(const SalTwoRect& rTR, cairo_surface_t* source)
107 {
108 m_aCairoCommon.copySource(rTR, source, getAntiAlias());
109 }
110};
111
112/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _cairo_surface cairo_surface_t
Definition: CairoCommon.hxx:46
struct _cairo cairo_t
Definition: CairoCommon.hxx:45
struct _cairo_user_data_key cairo_user_data_key_t
Definition: CairoCommon.hxx:47
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
Implementation class for SalGraphics.
Definition: salgdiimpl.hxx:51
bool getAntiAlias() const
Definition: salgdi.hxx:92
CairoTextRender m_aTextRenderImpl
Definition: svpgdi.hxx:48
virtual FontCharMapRef GetFontCharMap() const override
std::unique_ptr< SvpGraphicsBackend > const & getSvpBackend()
Definition: svpgdi.hxx:68
virtual void ClearDevFontCache() override
virtual void SetFont(LogicalFontInstance *, int nFallbackLevel) override
static cairo_user_data_key_t * getDamageKey()
Definition: svpgdi.hxx:54
virtual void DrawTextLayout(const GenericSalLayout &) override
cairo_t * getCairoContext() const
Definition: svpgdi.hxx:96
cairo_surface_t * getSurface() const
Definition: svpgdi.hxx:53
virtual void SetTextColor(Color nColor) override
virtual SalGraphicsImpl * GetImpl() const override
Definition: svpgdi.hxx:67
void copySource(const SalTwoRect &rTR, cairo_surface_t *source)
Definition: svpgdi.hxx:106
virtual std::unique_ptr< GenericSalLayout > GetTextLayout(int nFallbackLevel) override
virtual void GetResolution(sal_Int32 &rDPIX, sal_Int32 &rDPIY) override
virtual bool ShouldDownscaleIconsAtSurface(double *pScaleOut) const override
void clipRegion(cairo_t *cr)
Definition: svpgdi.hxx:101
virtual ~SvpSalGraphics() override
virtual bool AddTempDevFont(vcl::font::PhysicalFontCollection *, const OUString &rFileURL, const OUString &rFontName) override
cairo_t * createTmpCompatibleCairoContext() const
virtual void GetDevFontList(vcl::font::PhysicalFontCollection *) override
void setSurface(cairo_surface_t *pSurface, const basegfx::B2IVector &rSize)
virtual SystemGraphicsData GetGraphicsData() const override
CairoCommon m_aCairoCommon
Definition: svpgdi.hxx:47
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override
std::unique_ptr< SvpGraphicsBackend > m_pBackend
Definition: svpgdi.hxx:49
virtual void GetFontMetric(FontMetricDataRef &, int nFallbackLevel) override
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
std::shared_ptr< Surface > SurfaceSharedPtr
Definition: cairo.hxx:72
std::shared_ptr< cairo_surface_t > CairoSurfaceSharedPtr
Definition: cairo.hxx:70
void clipRegion(cairo_t *cr)
cairo_t * getCairoContext(bool bXorModeAllowed, bool bAntiAlias) const
void copySource(const SalTwoRect &rTR, cairo_surface_t *source, bool bAntiAlias)
cairo_surface_t * m_pSurface
static cairo_user_data_key_t * getDamageKey()