1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_CANVAS_SOURCE_DIRECTX_DX_DEVICEHELPER_HXX
21 #define INCLUDED_CANVAS_SOURCE_DIRECTX_DX_DEVICEHELPER_HXX
23 #include <com/sun/star/awt/Rectangle.hpp>
24 #include <com/sun/star/rendering/XGraphicDevice.hpp>
25 #include <com/sun/star/rendering/XBufferController.hpp>
27 #include "dx_rendermodule.hxx"
28 #include "dx_bitmap.hxx"
30 #include <canvas/rendering/isurfaceproxymanager.hxx>
31 #include <vcl/vclptr.hxx>
32 #include <boost/utility.hpp>
35 /* Definition of DeviceHelper class */
39 class DeviceHelper
: private ::boost::noncopyable
45 /** Init the device helper
48 private or class dc of the output device. is only stored,
52 Ref back to owning UNO device
54 void init( HDC hdc
, OutputDevice
* pOutputDev
,
55 com::sun::star::rendering::XGraphicDevice
& rDevice
);
57 /// Dispose all internal references
60 // XWindowGraphicDevice
61 ::com::sun::star::geometry::RealSize2D
getPhysicalResolution();
62 ::com::sun::star::geometry::RealSize2D
getPhysicalSize();
63 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XLinePolyPolygon2D
> createCompatibleLinePolyPolygon(
64 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
65 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::geometry::RealPoint2D
> >& points
);
66 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XBezierPolyPolygon2D
> createCompatibleBezierPolyPolygon(
67 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
68 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::geometry::RealBezierSegment2D
> >& points
);
69 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XBitmap
> createCompatibleBitmap(
70 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
71 const ::com::sun::star::geometry::IntegerSize2D
& size
);
72 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XVolatileBitmap
> createVolatileBitmap(
73 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
74 const ::com::sun::star::geometry::IntegerSize2D
& size
);
75 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XBitmap
> createCompatibleAlphaBitmap(
76 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
77 const ::com::sun::star::geometry::IntegerSize2D
& size
);
78 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XVolatileBitmap
> createVolatileAlphaBitmap(
79 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
80 const ::com::sun::star::geometry::IntegerSize2D
& size
);
82 bool hasFullScreenMode();
83 bool enterFullScreenMode( bool bEnter
);
85 ::com::sun::star::uno::Any
isAccelerated() const;
86 ::com::sun::star::uno::Any
getDeviceHandle() const;
87 ::com::sun::star::uno::Any
getSurfaceHandle() const;
88 ::com::sun::star::uno::Reference
<
89 ::com::sun::star::rendering::XColorSpace
> getColorSpace() const;
91 /** called when DumpScreenContent property is enabled on
92 XGraphicDevice, and writes out bitmaps of current screen.
94 void dumpScreenContent() const {}
97 HDC
getHDC() const { return mnHDC
; }
98 com::sun::star::rendering::XGraphicDevice
* getDevice() const { return mpDevice
; }
101 /** Phyical output device
103 Deliberately not a refcounted reference, because of
104 potential circular references for canvas. Needed to
107 com::sun::star::rendering::XGraphicDevice
* mpDevice
;
109 VclPtr
<OutputDevice
> mpOutDev
;
112 typedef ::rtl::Reference
< com::sun::star::rendering::XGraphicDevice
> DeviceRef
;
115 #endif // INCLUDED_CANVAS_SOURCE_DIRECTX_DX_DEVICEHELPER_HXX
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */