2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-19 17:56:50 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-11-01 16:56:28 +00:00
|
|
|
|
2013-11-05 01:47:54 +01:00
|
|
|
#ifndef INCLUDED_CANVAS_SOURCE_DIRECTX_DX_DEVICEHELPER_HXX
|
|
|
|
#define INCLUDED_CANVAS_SOURCE_DIRECTX_DX_DEVICEHELPER_HXX
|
2007-11-01 16:56:28 +00:00
|
|
|
|
|
|
|
#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>
|
2015-04-17 21:59:29 +01:00
|
|
|
#include <vcl/vclptr.hxx>
|
2007-11-01 16:56:28 +00:00
|
|
|
#include <boost/utility.hpp>
|
|
|
|
|
2014-05-08 16:39:25 +02:00
|
|
|
class OutputDevice;
|
2007-11-01 16:56:28 +00:00
|
|
|
/* Definition of DeviceHelper class */
|
|
|
|
|
|
|
|
namespace dxcanvas
|
|
|
|
{
|
|
|
|
class DeviceHelper : private ::boost::noncopyable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DeviceHelper();
|
2015-04-17 21:59:29 +01:00
|
|
|
~DeviceHelper();
|
2007-11-01 16:56:28 +00:00
|
|
|
|
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
|
|
|
|
*/
|
2014-05-08 16:39:25 +02:00
|
|
|
void init( HDC hdc, OutputDevice* pOutputDev,
|
2008-06-24 09:34:18 +00:00
|
|
|
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
|
|
|
::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;
|
2015-04-14 14:11:02 +01:00
|
|
|
VclPtr<OutputDevice> mpOutDev;
|
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
|
|
|
}
|
|
|
|
|
2013-11-05 01:47:54 +01:00
|
|
|
#endif // INCLUDED_CANVAS_SOURCE_DIRECTX_DX_DEVICEHELPER_HXX
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|