1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: null_devicehelper.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _NULLCANVAS_DEVICEHELPER_HXX
32 #define _NULLCANVAS_DEVICEHELPER_HXX
34 #include <com/sun/star/awt/Rectangle.hpp>
35 #include <com/sun/star/rendering/XGraphicDevice.hpp>
36 #include <com/sun/star/rendering/XBufferController.hpp>
38 #include <boost/utility.hpp>
41 /* Definition of DeviceHelper class */
46 class SpriteCanvasHelper
;
48 class DeviceHelper
: private ::boost::noncopyable
53 void init( SpriteCanvas
& rSpriteCanvas
,
54 const ::basegfx::B2ISize
& rSize
,
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
);
81 sal_Bool
hasFullScreenMode( );
82 sal_Bool
enterFullScreenMode( sal_Bool bEnter
);
84 ::sal_Int32
createBuffers( ::sal_Int32 nBuffers
);
85 void destroyBuffers( );
86 ::sal_Bool
showBuffer( bool bIsVisible
, ::sal_Bool bUpdateAll
);
87 ::sal_Bool
switchBuffer( bool bIsVisible
, ::sal_Bool bUpdateAll
);
89 ::com::sun::star::uno::Any
isAccelerated() const;
90 ::com::sun::star::uno::Any
getDeviceHandle() const;
91 ::com::sun::star::uno::Any
getSurfaceHandle() const;
92 ::com::sun::star::uno::Reference
<
93 ::com::sun::star::rendering::XColorSpace
> getColorSpace() const;
95 void notifySizeUpdate( const ::com::sun::star::awt::Rectangle
& rBounds
);
97 /** called when DumpScreenContent property is enabled on
98 XGraphicDevice, and writes out bitmaps of current screen.
100 void dumpScreenContent() const;
103 /// Pointer to sprite canvas (owner of this helper), needed to create bitmaps
104 SpriteCanvas
* mpSpriteCanvas
;
105 ::basegfx::B2ISize maSize
;
110 #endif /* _NULLCANVAS_WINDOWGRAPHICDEVICE_HXX */