Coverage Report

Created: 2026-03-31 11:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/canvas/source/vcl/devicehelper.hxx
Line
Count
Source
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 <com/sun/star/rendering/XGraphicDevice.hpp>
23
24
#include "outdevprovider.hxx"
25
26
27
/* Definition of DeviceHelper class */
28
29
namespace vclcanvas
30
{
31
    class DeviceHelper
32
    {
33
    public:
34
        DeviceHelper();
35
36
        /// make noncopyable
37
        DeviceHelper(const DeviceHelper&) = delete;
38
        const DeviceHelper& operator=(const DeviceHelper&) = delete;
39
40
        void init( const OutDevProviderSharedPtr& rOutDev );
41
42
        /// Dispose all internal references
43
        void disposing();
44
45
        // XWindowGraphicDevice
46
        css::geometry::RealSize2D getPhysicalResolution();
47
        css::geometry::RealSize2D getPhysicalSize();
48
        css::uno::Reference< css::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon(
49
            const css::uno::Reference< css::rendering::XGraphicDevice >&                               rDevice,
50
            const css::uno::Sequence< css::uno::Sequence< css::geometry::RealPoint2D > >& points );
51
        css::uno::Reference< css::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon(
52
            const css::uno::Reference< css::rendering::XGraphicDevice >&                                       rDevice,
53
            const css::uno::Sequence< css::uno::Sequence< css::geometry::RealBezierSegment2D > >& points );
54
        css::uno::Reference< css::rendering::XBitmap > createCompatibleBitmap(
55
            const css::uno::Reference< css::rendering::XGraphicDevice >&  rDevice,
56
            const css::geometry::IntegerSize2D&                                        size );
57
        css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileBitmap(
58
            const css::uno::Reference< css::rendering::XGraphicDevice >&  rDevice,
59
            const css::geometry::IntegerSize2D&                                        size );
60
        css::uno::Reference< css::rendering::XBitmap > createCompatibleAlphaBitmap(
61
            const css::uno::Reference< css::rendering::XGraphicDevice >&  rDevice,
62
            const css::geometry::IntegerSize2D&                                        size );
63
        css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileAlphaBitmap(
64
            const css::uno::Reference< css::rendering::XGraphicDevice >&  rDevice,
65
            const css::geometry::IntegerSize2D&                                        size );
66
67
        css::uno::Any isAccelerated() const;
68
        css::uno::Any getDeviceHandle() const;
69
        css::uno::Any getSurfaceHandle() const;
70
        css::uno::Reference<
71
            css::rendering::XColorSpace > const & getColorSpace() const;
72
73
0
        const OutDevProviderSharedPtr& getOutDev() const { return mpOutDev; }
74
75
        /** called when DumpScreenContent property is enabled on
76
            XGraphicDevice, and writes out bitmaps of current screen.
77
         */
78
        void dumpScreenContent() const;
79
80
    private:
81
        /// For retrieving device info
82
        OutDevProviderSharedPtr mpOutDev;
83
    };
84
}
85
86
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */