LibreOffice Module canvas (master) 1
dx_devicehelper.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#include <com/sun/star/awt/Rectangle.hpp>
23#include <com/sun/star/rendering/XGraphicDevice.hpp>
24#include <com/sun/star/rendering/XBufferController.hpp>
25
26#include "dx_rendermodule.hxx"
27#include "dx_bitmap.hxx"
28
30#include <vcl/vclptr.hxx>
31
32class OutputDevice;
33/* Definition of DeviceHelper class */
34
35namespace dxcanvas
36{
38 {
39 public:
42
44 DeviceHelper(const DeviceHelper&) = delete;
45 const DeviceHelper& operator=(const DeviceHelper&) = delete;
46
56 void init( HDC hdc, OutputDevice* pOutputDev,
57 css::rendering::XGraphicDevice& rDevice );
58
60 void disposing();
61
62 // XWindowGraphicDevice
63 css::geometry::RealSize2D getPhysicalResolution();
64 css::geometry::RealSize2D getPhysicalSize();
65 css::uno::Reference< css::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon(
66 const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
67 const css::uno::Sequence< css::uno::Sequence< css::geometry::RealPoint2D > >& points );
68 css::uno::Reference< css::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon(
69 const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
70 const css::uno::Sequence< css::uno::Sequence< css::geometry::RealBezierSegment2D > >& points );
71 css::uno::Reference< css::rendering::XBitmap > createCompatibleBitmap(
72 const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
73 const css::geometry::IntegerSize2D& size );
74 css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileBitmap(
75 const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
76 const css::geometry::IntegerSize2D& size );
77 css::uno::Reference< css::rendering::XBitmap > createCompatibleAlphaBitmap(
78 const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
79 const css::geometry::IntegerSize2D& size );
80 css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileAlphaBitmap(
81 const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
82 const css::geometry::IntegerSize2D& size );
83
84 css::uno::Any isAccelerated() const;
85 css::uno::Any getDeviceHandle() const;
86 css::uno::Any getSurfaceHandle() const;
87 css::uno::Reference<
88 css::rendering::XColorSpace > getColorSpace() const;
89
93 void dumpScreenContent() const {}
94
95 protected:
96 HDC getHDC() const { return mnHDC; }
97 css::rendering::XGraphicDevice* getDevice() const { return mpDevice; }
98
99 private:
106 css::rendering::XGraphicDevice* mpDevice;
107 HDC mnHDC;
109 };
110
111 typedef ::rtl::Reference< css::rendering::XGraphicDevice > DeviceRef;
112}
113
114/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileAlphaBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
css::geometry::RealSize2D getPhysicalSize()
css::uno::Any getSurfaceHandle() const
DeviceHelper(const DeviceHelper &)=delete
make noncopyable
css::rendering::XGraphicDevice * getDevice() const
css::uno::Reference< css::rendering::XBitmap > createCompatibleBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
css::uno::Reference< css::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::uno::Sequence< css::uno::Sequence< css::geometry::RealPoint2D > > &points)
css::uno::Reference< css::rendering::XBitmap > createCompatibleAlphaBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
const DeviceHelper & operator=(const DeviceHelper &)=delete
void disposing()
Dispose all internal references.
css::uno::Reference< css::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::uno::Sequence< css::uno::Sequence< css::geometry::RealBezierSegment2D > > &points)
VclPtr< OutputDevice > mpOutDev
void init(HDC hdc, OutputDevice *pOutputDev, css::rendering::XGraphicDevice &rDevice)
Init the device helper.
css::rendering::XGraphicDevice * mpDevice
Phyical output device.
css::uno::Any getDeviceHandle() const
css::uno::Any isAccelerated() const
void dumpScreenContent() const
called when DumpScreenContent property is enabled on XGraphicDevice, and writes out bitmaps of curren...
css::uno::Reference< css::rendering::XColorSpace > getColorSpace() const
css::geometry::RealSize2D getPhysicalResolution()
::rtl::Reference< css::rendering::XGraphicDevice > DeviceRef