update dev300-m58
[ooovba.git] / canvas / source / directx / dx_devicehelper.hxx
blob9dfb19b935b02f7ad64f5783cd5dae70d72b0a34
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dx_devicehelper.hxx,v $
10 * $Revision: 1.4 $
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 _DXCANVAS_DEVICEHELPER_HXX
32 #define _DXCANVAS_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 "dx_rendermodule.hxx"
39 #include "dx_bitmap.hxx"
41 #include <canvas/rendering/isurfaceproxymanager.hxx>
43 #include <boost/utility.hpp>
46 /* Definition of DeviceHelper class */
48 namespace dxcanvas
50 class DeviceHelper : private ::boost::noncopyable
52 public:
53 DeviceHelper();
55 /** Init the device helper
57 @param hdc
58 private or class dc of the output device. is only stored,
59 not release
61 @param rDevice
62 Ref back to owning UNO device
64 void init( HDC hdc,
65 com::sun::star::rendering::XGraphicDevice& rDevice );
67 /// Dispose all internal references
68 void disposing();
70 // XWindowGraphicDevice
71 ::com::sun::star::geometry::RealSize2D getPhysicalResolution();
72 ::com::sun::star::geometry::RealSize2D getPhysicalSize();
73 ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon(
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::RealPoint2D > >& points );
76 ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon(
77 const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
78 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& points );
79 ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap(
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::XVolatileBitmap > createVolatileBitmap(
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::XBitmap > createCompatibleAlphaBitmap(
86 const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
87 const ::com::sun::star::geometry::IntegerSize2D& size );
88 ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap(
89 const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
90 const ::com::sun::star::geometry::IntegerSize2D& size );
92 sal_Bool hasFullScreenMode();
93 sal_Bool enterFullScreenMode( sal_Bool bEnter );
95 ::com::sun::star::uno::Any isAccelerated() const;
96 ::com::sun::star::uno::Any getDeviceHandle() const;
97 ::com::sun::star::uno::Any getSurfaceHandle() const;
98 ::com::sun::star::uno::Reference<
99 ::com::sun::star::rendering::XColorSpace > getColorSpace() const;
101 /** called when DumpScreenContent property is enabled on
102 XGraphicDevice, and writes out bitmaps of current screen.
104 void dumpScreenContent() const {}
106 protected:
107 HDC getHDC() const { return mnHDC; }
108 com::sun::star::rendering::XGraphicDevice* getDevice() const { return mpDevice; }
110 private:
111 /** Phyical output device
113 Deliberately not a refcounted reference, because of
114 potential circular references for canvas. Needed to
115 create bitmaps
117 com::sun::star::rendering::XGraphicDevice* mpDevice;
118 HDC mnHDC;
121 typedef ::rtl::Reference< com::sun::star::rendering::XGraphicDevice > DeviceRef;
124 #endif /* _DXCANVAS_DEVICEHELPER_HXX */