2007-11-01 16:56:28 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-11 08:11:29 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2007-11-01 16:56:28 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2007-11-01 16:56:28 +00:00
|
|
|
*
|
2008-04-11 08:11:29 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2007-11-01 16:56:28 +00:00
|
|
|
*
|
2008-04-11 08:11:29 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2007-11-01 16:56:28 +00:00
|
|
|
*
|
2008-04-11 08:11:29 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2007-11-01 16:56:28 +00:00
|
|
|
*
|
2008-04-11 08:11:29 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2007-11-01 16:56:28 +00:00
|
|
|
*
|
2008-04-11 08:11:29 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2007-11-01 16:56:28 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _DXCANVAS_DEVICEHELPER_HXX
|
|
|
|
#define _DXCANVAS_DEVICEHELPER_HXX
|
|
|
|
|
|
|
|
#include <com/sun/star/awt/Rectangle.hpp>
|
|
|
|
#include <com/sun/star/rendering/XGraphicDevice.hpp>
|
|
|
|
#include <com/sun/star/rendering/XBufferController.hpp>
|
|
|
|
|
|
|
|
#include "dx_rendermodule.hxx"
|
|
|
|
#include "dx_bitmap.hxx"
|
|
|
|
|
|
|
|
#include <canvas/rendering/isurfaceproxymanager.hxx>
|
|
|
|
|
|
|
|
#include <boost/utility.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
/* Definition of DeviceHelper class */
|
|
|
|
|
|
|
|
namespace dxcanvas
|
|
|
|
{
|
|
|
|
class DeviceHelper : private ::boost::noncopyable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DeviceHelper();
|
|
|
|
|
2008-06-24 09:34:18 +00:00
|
|
|
/** Init the device helper
|
|
|
|
|
|
|
|
@param hdc
|
|
|
|
private or class dc of the output device. is only stored,
|
|
|
|
not release
|
|
|
|
|
|
|
|
@param rDevice
|
|
|
|
Ref back to owning UNO device
|
|
|
|
*/
|
|
|
|
void init( HDC hdc,
|
|
|
|
com::sun::star::rendering::XGraphicDevice& rDevice );
|
2007-11-01 16:56:28 +00:00
|
|
|
|
|
|
|
/// Dispose all internal references
|
|
|
|
void disposing();
|
|
|
|
|
|
|
|
// XWindowGraphicDevice
|
|
|
|
::com::sun::star::geometry::RealSize2D getPhysicalResolution();
|
|
|
|
::com::sun::star::geometry::RealSize2D getPhysicalSize();
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XLinePolyPolygon2D > createCompatibleLinePolyPolygon(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
|
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > >& points );
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBezierPolyPolygon2D > createCompatibleBezierPolyPolygon(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
|
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealBezierSegment2D > >& points );
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleBitmap(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
|
|
|
|
const ::com::sun::star::geometry::IntegerSize2D& size );
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileBitmap(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
|
|
|
|
const ::com::sun::star::geometry::IntegerSize2D& size );
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XBitmap > createCompatibleAlphaBitmap(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
|
|
|
|
const ::com::sun::star::geometry::IntegerSize2D& size );
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XVolatileBitmap > createVolatileAlphaBitmap(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XGraphicDevice >& rDevice,
|
|
|
|
const ::com::sun::star::geometry::IntegerSize2D& size );
|
|
|
|
|
2008-06-24 09:34:18 +00:00
|
|
|
sal_Bool hasFullScreenMode();
|
|
|
|
sal_Bool enterFullScreenMode( sal_Bool bEnter );
|
2007-11-01 16:56:28 +00:00
|
|
|
|
2008-06-24 09:34:18 +00:00
|
|
|
::com::sun::star::uno::Any isAccelerated() const;
|
2007-11-01 16:56:28 +00:00
|
|
|
::com::sun::star::uno::Any getDeviceHandle() const;
|
|
|
|
::com::sun::star::uno::Any getSurfaceHandle() const;
|
2008-06-24 09:34:18 +00:00
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::rendering::XColorSpace > getColorSpace() const;
|
2007-11-01 16:56:28 +00:00
|
|
|
|
|
|
|
/** called when DumpScreenContent property is enabled on
|
|
|
|
XGraphicDevice, and writes out bitmaps of current screen.
|
|
|
|
*/
|
2008-06-24 09:34:18 +00:00
|
|
|
void dumpScreenContent() const {}
|
2007-11-01 16:56:28 +00:00
|
|
|
|
2008-06-24 09:34:18 +00:00
|
|
|
protected:
|
|
|
|
HDC getHDC() const { return mnHDC; }
|
|
|
|
com::sun::star::rendering::XGraphicDevice* getDevice() const { return mpDevice; }
|
2007-11-01 16:56:28 +00:00
|
|
|
|
2008-06-24 09:34:18 +00:00
|
|
|
private:
|
|
|
|
/** Phyical output device
|
2007-11-01 16:56:28 +00:00
|
|
|
|
2008-06-24 09:34:18 +00:00
|
|
|
Deliberately not a refcounted reference, because of
|
|
|
|
potential circular references for canvas. Needed to
|
|
|
|
create bitmaps
|
|
|
|
*/
|
|
|
|
com::sun::star::rendering::XGraphicDevice* mpDevice;
|
|
|
|
HDC mnHDC;
|
2007-11-01 16:56:28 +00:00
|
|
|
};
|
2008-06-24 09:34:18 +00:00
|
|
|
|
|
|
|
typedef ::rtl::Reference< com::sun::star::rendering::XGraphicDevice > DeviceRef;
|
2007-11-01 16:56:28 +00:00
|
|
|
}
|
|
|
|
|
2008-06-24 09:34:18 +00:00
|
|
|
#endif /* _DXCANVAS_DEVICEHELPER_HXX */
|