2008/04/21 07:30:14 thb 1.2.2.4: RESYNC: (1.2-1.3); FILE MERGED 2008/03/18 22:00:57 thb 1.2.2.3: Implementing non-backbuffered canvas for cairocanvas as well - reworked to share most of the code 2008/01/25 14:27:08 thb 1.2.2.2: Intermediate dump 2007/12/20 22:18:57 thb 1.2.2.1: #i81092# #i78888# #i78925# #i79258# #i79437# #i84784# Large canvas rework, completing various areas such as color spaces, bitmap data access, true sprite and non-sprite implementations, and upstreaming the canvas parts of rodos emf+ rendering
125 lines
5.5 KiB
C++
Executable File
125 lines
5.5 KiB
C++
Executable File
/*************************************************************************
|
|
*
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
*
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
|
*
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
*
|
|
* $RCSfile: dx_devicehelper.hxx,v $
|
|
* $Revision: 1.4 $
|
|
*
|
|
* This file is part of OpenOffice.org.
|
|
*
|
|
* 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.
|
|
*
|
|
* 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).
|
|
*
|
|
* 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.
|
|
*
|
|
************************************************************************/
|
|
|
|
#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();
|
|
|
|
/** 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 );
|
|
|
|
/// 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 );
|
|
|
|
sal_Bool hasFullScreenMode();
|
|
sal_Bool enterFullScreenMode( sal_Bool bEnter );
|
|
|
|
::com::sun::star::uno::Any isAccelerated() const;
|
|
::com::sun::star::uno::Any getDeviceHandle() const;
|
|
::com::sun::star::uno::Any getSurfaceHandle() const;
|
|
::com::sun::star::uno::Reference<
|
|
::com::sun::star::rendering::XColorSpace > getColorSpace() const;
|
|
|
|
/** called when DumpScreenContent property is enabled on
|
|
XGraphicDevice, and writes out bitmaps of current screen.
|
|
*/
|
|
void dumpScreenContent() const {}
|
|
|
|
protected:
|
|
HDC getHDC() const { return mnHDC; }
|
|
com::sun::star::rendering::XGraphicDevice* getDevice() const { return mpDevice; }
|
|
|
|
private:
|
|
/** Phyical output device
|
|
|
|
Deliberately not a refcounted reference, because of
|
|
potential circular references for canvas. Needed to
|
|
create bitmaps
|
|
*/
|
|
com::sun::star::rendering::XGraphicDevice* mpDevice;
|
|
HDC mnHDC;
|
|
};
|
|
|
|
typedef ::rtl::Reference< com::sun::star::rendering::XGraphicDevice > DeviceRef;
|
|
}
|
|
|
|
#endif /* _DXCANVAS_DEVICEHELPER_HXX */
|