LibreOffice Module vcl (master) 1
genpspgraphics.h
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#include <sal/config.h>
23
24#include <vcl/vclenum.hxx>
25#include <config_cairo_canvas.h>
26
27#include <unx/fontmanager.hxx>
28#include <salgdi.hxx>
29#include <sallayout.hxx>
30
32
33namespace vcl::font
34{
35class PhysicalFontFace;
36class PhysicalFontCollection;
37}
38
39namespace psp { struct JobData; class PrinterGfx; }
40
42class FontAttributes;
43class SalInfoPrinter;
44class FontMetricData;
45
47{
48 std::unique_ptr<GenPspGfxBackend> m_pBackend;
49
52
54 m_pFreetypeFont[ MAX_FALLBACK ];
55
56public:
58 virtual ~GenPspGraphics() override;
59
60 void Init( psp::JobData* pJob, psp::PrinterGfx* pGfx );
61
62 // helper methods
64
65 // helper methods for sharing with FreeTypeTextRenderImpl
68 std::u16string_view rFileURL,
69 const OUString& rFontName);
70
71 // override all pure virtual methods
72 virtual SalGraphicsImpl* GetImpl() const override
73 {
74 return m_pBackend.get();
75 }
76
77 virtual void GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) override;
78
79 virtual void SetTextColor( Color nColor ) override;
80 virtual void SetFont(LogicalFontInstance*, int nFallbackLevel) override;
81 virtual void GetFontMetric( FontMetricDataRef&, int nFallbackLevel ) override;
82 virtual FontCharMapRef GetFontCharMap() const override;
83 virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override;
85 // graphics must drop any cached font info
86 virtual void ClearDevFontCache() override;
88 const OUString& rFileURL,
89 const OUString& rFontName ) override;
90
91 virtual std::unique_ptr<GenericSalLayout>
92 GetTextLayout(int nFallbackLevel) override;
93 virtual void DrawTextLayout( const GenericSalLayout& ) override;
94
95 virtual SystemGraphicsData GetGraphicsData() const override;
96
97#if ENABLE_CAIRO_CANVAS
98 virtual bool SupportsCairo() const override;
99 virtual cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const override;
100 virtual cairo::SurfaceSharedPtr CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const override;
101 virtual cairo::SurfaceSharedPtr CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const override;
102 virtual css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const override;
103#endif // ENABLE_CAIRO_CANVAS
104};
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void ClearDevFontCache() override
psp::JobData * m_pJobData
static FontAttributes Info2FontAttributes(const psp::FastPrintFontInfo &)
virtual void GetFontMetric(FontMetricDataRef &, int nFallbackLevel) override
virtual SalGraphicsImpl * GetImpl() const override
virtual FontCharMapRef GetFontCharMap() const override
virtual void SetFont(LogicalFontInstance *, int nFallbackLevel) override
static bool AddTempDevFontHelper(vcl::font::PhysicalFontCollection *pFontCollection, std::u16string_view rFileURL, const OUString &rFontName)
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const override
virtual void DrawTextLayout(const GenericSalLayout &) override
virtual void SetTextColor(Color nColor) override
virtual void GetDevFontList(vcl::font::PhysicalFontCollection *) override
virtual bool AddTempDevFont(vcl::font::PhysicalFontCollection *, const OUString &rFileURL, const OUString &rFontName) override
static void GetDevFontListHelper(vcl::font::PhysicalFontCollection *)
virtual void GetResolution(sal_Int32 &rDPIX, sal_Int32 &rDPIY) override
psp::PrinterGfx * m_pPrinterGfx
std::unique_ptr< GenPspGfxBackend > m_pBackend
virtual SystemGraphicsData GetGraphicsData() const override
virtual std::unique_ptr< GenericSalLayout > GetTextLayout(int nFallbackLevel) override
virtual ~GenPspGraphics() override
void Init(psp::JobData *pJob, psp::PrinterGfx *pGfx)
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
#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
A PhysicalFontFaceCollection is created by a PhysicalFontCollection and becomes invalid when original...
#define MAX_FALLBACK
Definition: sallayout.hxx:46