1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _DXCANVAS_DEVICEHELPER_HXX
29 #define _DXCANVAS_DEVICEHELPER_HXX
31 #include <com/sun/star/awt/Rectangle.hpp>
32 #include <com/sun/star/rendering/XGraphicDevice.hpp>
33 #include <com/sun/star/rendering/XBufferController.hpp>
35 #include "dx_rendermodule.hxx"
36 #include "dx_bitmap.hxx"
38 #include <canvas/rendering/isurfaceproxymanager.hxx>
40 #include <boost/utility.hpp>
43 /* Definition of DeviceHelper class */
47 class DeviceHelper
: private ::boost::noncopyable
52 /** Init the device helper
55 private or class dc of the output device. is only stored,
59 Ref back to owning UNO device
62 com::sun::star::rendering::XGraphicDevice
& rDevice
);
64 /// Dispose all internal references
67 // XWindowGraphicDevice
68 ::com::sun::star::geometry::RealSize2D
getPhysicalResolution();
69 ::com::sun::star::geometry::RealSize2D
getPhysicalSize();
70 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XLinePolyPolygon2D
> createCompatibleLinePolyPolygon(
71 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
72 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::geometry::RealPoint2D
> >& points
);
73 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XBezierPolyPolygon2D
> createCompatibleBezierPolyPolygon(
74 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
75 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::geometry::RealBezierSegment2D
> >& points
);
76 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XBitmap
> createCompatibleBitmap(
77 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
78 const ::com::sun::star::geometry::IntegerSize2D
& size
);
79 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XVolatileBitmap
> createVolatileBitmap(
80 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
81 const ::com::sun::star::geometry::IntegerSize2D
& size
);
82 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XBitmap
> createCompatibleAlphaBitmap(
83 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
84 const ::com::sun::star::geometry::IntegerSize2D
& size
);
85 ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XVolatileBitmap
> createVolatileAlphaBitmap(
86 const ::com::sun::star::uno::Reference
< ::com::sun::star::rendering::XGraphicDevice
>& rDevice
,
87 const ::com::sun::star::geometry::IntegerSize2D
& size
);
89 sal_Bool
hasFullScreenMode();
90 sal_Bool
enterFullScreenMode( sal_Bool bEnter
);
92 ::com::sun::star::uno::Any
isAccelerated() const;
93 ::com::sun::star::uno::Any
getDeviceHandle() const;
94 ::com::sun::star::uno::Any
getSurfaceHandle() const;
95 ::com::sun::star::uno::Reference
<
96 ::com::sun::star::rendering::XColorSpace
> getColorSpace() const;
98 /** called when DumpScreenContent property is enabled on
99 XGraphicDevice, and writes out bitmaps of current screen.
101 void dumpScreenContent() const {}
104 HDC
getHDC() const { return mnHDC
; }
105 com::sun::star::rendering::XGraphicDevice
* getDevice() const { return mpDevice
; }
108 /** Phyical output device
110 Deliberately not a refcounted reference, because of
111 potential circular references for canvas. Needed to
114 com::sun::star::rendering::XGraphicDevice
* mpDevice
;
118 typedef ::rtl::Reference
< com::sun::star::rendering::XGraphicDevice
> DeviceRef
;
121 #endif /* _DXCANVAS_DEVICEHELPER_HXX */