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