LibreOffice Module canvas (master)  1
cairo_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_CAIRO_CAIRO_DEVICEHELPER_HXX
21 #define INCLUDED_CANVAS_SOURCE_CAIRO_CAIRO_DEVICEHELPER_HXX
22 
23 #include <com/sun/star/rendering/XGraphicDevice.hpp>
24 
25 #include <vcl/outdev.hxx>
26 
28 
29 /* Definition of DeviceHelper class */
30 
31 namespace cairocanvas
32 {
34  {
35  public:
37  DeviceHelper(const DeviceHelper&) = delete;
38  const DeviceHelper& operator=(const DeviceHelper&) = delete;
39 
40  DeviceHelper();
41 
51  void init( SurfaceProvider& rSurfaceProvider,
52  OutputDevice& rRefDevice );
53 
55  void disposing();
56 
57  // XWindowGraphicDevice
58  css::geometry::RealSize2D getPhysicalResolution();
59  css::geometry::RealSize2D getPhysicalSize();
60  css::uno::Reference< css::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon(
61  const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
62  const css::uno::Sequence< css::uno::Sequence< css::geometry::RealPoint2D > >& points );
63  css::uno::Reference< css::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon(
64  const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
65  const css::uno::Sequence< css::uno::Sequence< css::geometry::RealBezierSegment2D > >& points );
66  css::uno::Reference< css::rendering::XBitmap > createCompatibleBitmap(
67  const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
68  const css::geometry::IntegerSize2D& size );
69  css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileBitmap(
70  const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
71  const css::geometry::IntegerSize2D& size );
72  css::uno::Reference< css::rendering::XBitmap > createCompatibleAlphaBitmap(
73  const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
74  const css::geometry::IntegerSize2D& size );
75  css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileAlphaBitmap(
76  const css::uno::Reference< css::rendering::XGraphicDevice >& rDevice,
77  const css::geometry::IntegerSize2D& size );
78 
79  css::uno::Any isAccelerated() const;
80  css::uno::Any getDeviceHandle() const;
81  css::uno::Any getSurfaceHandle() const;
82  css::uno::Reference<
83  css::rendering::XColorSpace > const & getColorSpace() const;
84 
88  void dumpScreenContent() const;
89 
91  const ::cairo::SurfaceSharedPtr& getSurface() const { return mpSurface; }
92  ::cairo::SurfaceSharedPtr createSurface( const ::basegfx::B2ISize& rSize, int aContent );
93  ::cairo::SurfaceSharedPtr createSurface( BitmapSystemData const & rData, const Size& rSize );
94 
95  protected:
105  void implInit( SurfaceProvider& rSurfaceProvider,
106  OutputDevice& rRefDevice );
107  void setSize( const ::basegfx::B2ISize& rSize );
108 
109  private:
117 
120  };
121 }
122 
123 #endif
124 
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Target interface for XCachedPrimitive implementations.
const DeviceHelper & operator=(const DeviceHelper &)=delete
css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileAlphaBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
css::uno::Any getSurfaceHandle() const
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)
void disposing()
Dispose all internal references.
css::uno::Reference< css::rendering::XVolatileBitmap > createVolatileBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
void init(SurfaceProvider &rSurfaceProvider, OutputDevice &rRefDevice)
init helper
std::shared_ptr< Surface > SurfaceSharedPtr
css::geometry::RealSize2D getPhysicalResolution()
void setSize(const ::basegfx::B2ISize &rSize)
css::uno::Reference< css::rendering::XBitmap > createCompatibleAlphaBitmap(const css::uno::Reference< css::rendering::XGraphicDevice > &rDevice, const css::geometry::IntegerSize2D &size)
const ::cairo::SurfaceSharedPtr & getSurface() const
css::uno::Any isAccelerated() const
size
css::uno::Any getDeviceHandle() const
VclPtr< OutputDevice > mpRefDevice
::cairo::SurfaceSharedPtr createSurface(const ::basegfx::B2ISize &rSize, int aContent)
void implInit(SurfaceProvider &rSurfaceProvider, OutputDevice &rRefDevice)
init helper
::cairo::SurfaceSharedPtr mpSurface
SurfaceProvider * mpSurfaceProvider
Surface provider.
css::geometry::RealSize2D getPhysicalSize()
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::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::XColorSpace > const & getColorSpace() const
void dumpScreenContent() const
called when DumpScreenContent property is enabled on XGraphicDevice, and writes out bitmaps of curren...
OutputDevice * getOutputDevice() const