Kaydet (Commit) 1cd9b5d8 authored tarafından Marcos Paulo de Souza's avatar Marcos Paulo de Souza Kaydeden (comit) David Tardon

fdo#60949: Remove UNOLIBS_OOO

By removing the last two libs: nullcanvas and directx5canvas.

directx5canvas seems to be dead and nullcanvas don't have entries in scp2.

Change-Id: Ib8fc1da123f8374fb83192f14db730638213f564
Reviewed-on: https://gerrit.libreoffice.org/3626Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst e986d3e3
......@@ -642,10 +642,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,UNOLIBS_OOO,OOO, \
localebe1 \
ucpexpand1 \
))
$(eval $(call gb_Helper_register_libraries,UNOLIBS_OOO, \
directx5canvas \
nullcanvas \
))
$(eval $(call gb_Helper_register_libraries,UNOLIBS_URE, \
testtools_cppobj \
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
# 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.
#
#*************************************************************************
$(eval $(call gb_Library_Library,nullcanvas))
$(eval $(call gb_Library_set_componentfile,nullcanvas,canvas/source/null/nullcanvas))
$(eval $(call gb_Library_use_external,nullcanvas,boost_headers))
$(eval $(call gb_Library_use_sdk_api,nullcanvas))
$(eval $(call gb_Library_use_libraries,nullcanvas,\
basegfx \
canvastools \
comphelper \
cppu \
cppuhelper \
sal \
vcl \
$(gb_UWINAPI) \
))
$(eval $(call gb_Library_add_exception_objects,nullcanvas,\
canvas/source/null/null_canvasbitmap \
canvas/source/null/null_canvascustomsprite \
canvas/source/null/null_canvasfont \
canvas/source/null/null_canvashelper \
canvas/source/null/null_devicehelper \
canvas/source/null/null_spritecanvas \
canvas/source/null/null_spritecanvashelper \
canvas/source/null/null_spritehelper \
canvas/source/null/null_textlayout \
))
# vim: set noet sw=4 ts=4:
......@@ -31,7 +31,6 @@ $(eval $(call gb_Module_Module,canvas))
$(eval $(call gb_Module_add_targets,canvas,\
Library_canvasfactory \
Library_canvastools \
Library_nullcanvas \
Library_simplecanvas \
Library_vclcanvas \
))
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
#include <canvas/canvastools.hxx>
#include "null_canvasbitmap.hxx"
using namespace ::com::sun::star;
namespace nullcanvas
{
CanvasBitmap::CanvasBitmap( const ::basegfx::B2ISize& rSize,
const DeviceRef& rDevice,
bool bHasAlpha ) :
mpDevice( rDevice )
{
ENSURE_OR_THROW( mpDevice.is(),
"CanvasBitmap::CanvasBitmap(): Invalid surface or device" );
maCanvasHelper.init( rSize,
*mpDevice.get(),
bHasAlpha );
}
void CanvasBitmap::disposeThis()
{
mpDevice.clear();
// forward to parent
CanvasBitmap_Base::disposeThis();
}
#define IMPLEMENTATION_NAME "NullCanvas.CanvasBitmap"
#define SERVICE_NAME "com.sun.star.rendering.CanvasBitmap"
OUString SAL_CALL CanvasBitmap::getImplementationName( ) throw (uno::RuntimeException)
{
return OUString( IMPLEMENTATION_NAME );
}
sal_Bool SAL_CALL CanvasBitmap::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException)
{
return ServiceName == SERVICE_NAME;
}
uno::Sequence< OUString > SAL_CALL CanvasBitmap::getSupportedServiceNames( ) throw (uno::RuntimeException)
{
uno::Sequence< OUString > aRet(1);
aRet[0] = SERVICE_NAME;
return aRet;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _NULLCANVAS_CANVASBITMAP_HXX
#define _NULLCANVAS_CANVASBITMAP_HXX
#include <cppuhelper/compbase3.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/rendering/XBitmapCanvas.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
#include <basegfx/vector/b2isize.hxx>
#include <boost/shared_ptr.hpp>
#include <canvas/base/integerbitmapbase.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include "null_canvashelper.hxx"
#include "null_spritecanvas.hxx"
#include "null_usagecounter.hxx"
/* Definition of CanvasBitmap class */
namespace nullcanvas
{
typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::rendering::XBitmapCanvas,
::com::sun::star::rendering::XIntegerBitmap,
::com::sun::star::lang::XServiceInfo > CanvasBitmapBase_Base;
typedef ::canvas::IntegerBitmapBase< ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >,
CanvasHelper,
::osl::MutexGuard,
::cppu::OWeakObject > CanvasBitmap_Base;
class CanvasBitmap : public CanvasBitmap_Base,
private UsageCounter< CanvasBitmap >
{
public:
/** Create a canvas bitmap for the given surface
@param rSize
Size of the bitmap
@param rDevice
Reference device, with which bitmap should be compatible
*/
CanvasBitmap( const ::basegfx::B2ISize& rSize,
const DeviceRef& rDevice,
bool bHasAlpha );
/// Dispose all internal references
virtual void disposeThis();
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
private:
/** MUST hold here, too, since CanvasHelper only contains a
raw pointer (without refcounting)
*/
DeviceRef mpDevice;
};
}
#endif /* _NULLCANVAS_CANVASBITMAP_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
#include <canvas/verbosetrace.hxx>
#include <rtl/logfile.hxx>
#include <rtl/math.hxx>
#include <canvas/canvastools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include "null_canvascustomsprite.hxx"
#include "null_spritecanvas.hxx"
using namespace ::com::sun::star;
namespace nullcanvas
{
CanvasCustomSprite::CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
const SpriteCanvasRef& rRefDevice ) :
mpSpriteCanvas( rRefDevice )
{
ENSURE_OR_THROW( rRefDevice.get(),
"CanvasCustomSprite::CanvasCustomSprite(): Invalid sprite canvas" );
maCanvasHelper.init( ::basegfx::B2ISize(
::canvas::tools::roundUp( rSpriteSize.Width ),
::canvas::tools::roundUp( rSpriteSize.Height ) ),
*rRefDevice.get(),
true );
maSpriteHelper.init( rSpriteSize,
rRefDevice );
}
void CanvasCustomSprite::disposeThis()
{
::osl::MutexGuard aGuard( m_aMutex );
mpSpriteCanvas.clear();
// forward to parent
CanvasCustomSpriteBaseT::disposeThis();
}
void CanvasCustomSprite::redraw() const
{
::osl::MutexGuard aGuard( m_aMutex );
maSpriteHelper.redraw( mbSurfaceDirty );
}
#define IMPLEMENTATION_NAME "NullCanvas.CanvasCustomSprite"
#define SERVICE_NAME "com.sun.star.rendering.CanvasCustomSprite"
OUString SAL_CALL CanvasCustomSprite::getImplementationName() throw( uno::RuntimeException )
{
return OUString( IMPLEMENTATION_NAME );
}
sal_Bool SAL_CALL CanvasCustomSprite::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
return ServiceName == SERVICE_NAME;
}
uno::Sequence< OUString > SAL_CALL CanvasCustomSprite::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
aRet[0] = SERVICE_NAME;
return aRet;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _NULLCANVAS_CANVASCUSTOMSPRITE_HXX
#define _NULLCANVAS_CANVASCUSTOMSPRITE_HXX
#include <cppuhelper/compbase4.hxx>
#include <comphelper/uno3.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/rendering/XCustomSprite.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
#include <com/sun/star/rendering/XPolyPolygon2D.hpp>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/canvascustomspritebase.hxx>
#include "sprite.hxx"
#include "null_canvashelper.hxx"
#include "null_spritehelper.hxx"
#include "null_spritecanvas.hxx"
#include "null_usagecounter.hxx"
namespace nullcanvas
{
typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::rendering::XCustomSprite,
::com::sun::star::rendering::XBitmapCanvas,
::com::sun::star::rendering::XIntegerBitmap,
::com::sun::star::lang::XServiceInfo > CanvasCustomSpriteBase_Base;
/** Mixin Sprite
Have to mixin the Sprite interface before deriving from
::canvas::CanvasCustomSpriteBase, as this template should
already implement some of those interface methods.
The reason why this appears kinda convoluted is the fact that
we cannot specify non-IDL types as WeakComponentImplHelperN
template args, and furthermore, don't want to derive
::canvas::CanvasCustomSpriteBase directly from
::canvas::Sprite (because derivees of
::canvas::CanvasCustomSpriteBase have to explicitly forward
the XInterface methods (e.g. via DECLARE_UNO3_AGG_DEFAULTS)
anyway). Basically, ::canvas::CanvasCustomSpriteBase should
remain a base class that provides implementation, not to
enforce any specific interface on its derivees.
*/
class CanvasCustomSpriteSpriteBase_Base : public ::canvas::DisambiguationHelper< CanvasCustomSpriteBase_Base >,
public Sprite
{
};
typedef ::canvas::CanvasCustomSpriteBase< CanvasCustomSpriteSpriteBase_Base,
SpriteHelper,
CanvasHelper,
::osl::MutexGuard,
::cppu::OWeakObject > CanvasCustomSpriteBaseT;
/* Definition of CanvasCustomSprite class */
class CanvasCustomSprite : public CanvasCustomSpriteBaseT,
private UsageCounter< CanvasCustomSprite >
{
public:
/** Create a custom sprite
@param rSpriteSize
Size of the sprite in pixel
@param rRefDevice
Associated output device
@param rSpriteCanvas
Target canvas
@param rDevice
Target DX device
*/
CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
const SpriteCanvasRef& rRefDevice );
virtual void disposeThis();
// Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base
// Classname Base doing refcount Base implementing the XComponent interface
// | | |
// V V V
DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( CanvasCustomSprite, CanvasCustomSpriteBase_Base, ::cppu::WeakComponentImplHelperBase );
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
// Sprite
virtual void redraw() const;
private:
/** MUST hold here, too, since CanvasHelper only contains a
raw pointer (without refcounting)
*/
SpriteCanvasRef mpSpriteCanvas;
};
}
#endif /* _NULLCANVAS_CANVASCUSTOMSPRITE_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#include "null_canvasfont.hxx"
#include "null_textlayout.hxx"
#include "null_spritecanvas.hxx"
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
#include <com/sun/star/rendering/PanoseWeight.hpp>
using namespace ::com::sun::star;
namespace nullcanvas
{
CanvasFont::CanvasFont( const rendering::FontRequest& rFontRequest,
const uno::Sequence< beans::PropertyValue >& /*extraFontProperties*/,
const geometry::Matrix2D& fontMatrix ) :
CanvasFont_Base( m_aMutex ),
maFontRequest( rFontRequest ),
maFontMatrix( fontMatrix )
{
}
void SAL_CALL CanvasFont::disposing()
{
::osl::MutexGuard aGuard( m_aMutex );
}
uno::Reference< rendering::XTextLayout > SAL_CALL CanvasFont::createTextLayout( const rendering::StringContext& aText,
sal_Int8 nDirection,
sal_Int64 nRandomSeed ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
return new TextLayout( aText, nDirection, nRandomSeed, ImplRef( this ) );
}
uno::Sequence< double > SAL_CALL CanvasFont::getAvailableSizes( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return uno::Sequence< double >();
}
uno::Sequence< beans::PropertyValue > SAL_CALL CanvasFont::getExtraFontProperties( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return uno::Sequence< beans::PropertyValue >();
}
rendering::FontRequest SAL_CALL CanvasFont::getFontRequest( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
return maFontRequest;
}
rendering::FontMetrics SAL_CALL CanvasFont::getFontMetrics( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return rendering::FontMetrics();
}
#define SERVICE_NAME "com.sun.star.rendering.CanvasFont"
#define IMPLEMENTATION_NAME "NullCanvas::CanvasFont"
OUString SAL_CALL CanvasFont::getImplementationName() throw( uno::RuntimeException )
{
return OUString( IMPLEMENTATION_NAME );
}
sal_Bool SAL_CALL CanvasFont::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
return ServiceName == SERVICE_NAME;
}
uno::Sequence< OUString > SAL_CALL CanvasFont::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
aRet[0] = SERVICE_NAME;
return aRet;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _NULLCANVAS_CANVASFONT_HXX
#define _NULLCANVAS_CANVASFONT_HXX
#include <comphelper/implementationreference.hxx>
#include <cppuhelper/compbase2.hxx>
#include <comphelper/broadcasthelper.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/rendering/XCanvas.hpp>
#include <com/sun/star/rendering/XCanvasFont.hpp>
#include <rtl/ref.hxx>
#include <boost/shared_ptr.hpp>
#include <boost/utility.hpp>
#include "null_usagecounter.hxx"
/* Definition of CanvasFont class */
namespace nullcanvas
{
typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XCanvasFont,
::com::sun::star::lang::XServiceInfo > CanvasFont_Base;
class CanvasFont : public ::comphelper::OBaseMutex,
public CanvasFont_Base,
private UsageCounter< CanvasFont >,
private ::boost::noncopyable
{
public:
typedef ::comphelper::ImplementationReference<
CanvasFont,
::com::sun::star::rendering::XCanvasFont > ImplRef;
CanvasFont( const ::com::sun::star::rendering::FontRequest& fontRequest,
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& extraFontProperties,
const ::com::sun::star::geometry::Matrix2D& fontMatrix );
/// Dispose all internal references
virtual void SAL_CALL disposing();
// XCanvasFont
virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XTextLayout > SAL_CALL createTextLayout( const ::com::sun::star::rendering::StringContext& aText, sal_Int8 nDirection, sal_Int64 nRandomSeed ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::rendering::FontRequest SAL_CALL getFontRequest( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::rendering::FontMetrics SAL_CALL getFontMetrics( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< double > SAL_CALL getAvailableSizes( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getExtraFontProperties( ) throw (::com::sun::star::uno::RuntimeException);
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
private:
::com::sun::star::rendering::FontRequest maFontRequest;
::com::sun::star::geometry::Matrix2D maFontMatrix;
};
}
#endif /* _NULLCANVAS_CANVASFONT_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#include <canvas/debug.hxx>
#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <osl/mutex.hxx>
#include <rtl/instance.hxx>
#include <cppuhelper/compbase1.hxx>
#include <com/sun/star/lang/NoSupportException.hpp>
#include <basegfx/tools/canvastools.hxx>
#include <basegfx/tools/unopolypolygon.hxx>
#include <vcl/canvastools.hxx>
#include "null_spritecanvas.hxx"
#include "null_canvasbitmap.hxx"
#include "null_devicehelper.hxx"
using namespace ::com::sun::star;
namespace nullcanvas
{
DeviceHelper::DeviceHelper() :
mpSpriteCanvas( NULL ),
maSize(),
mbFullScreen(false)
{
}
void DeviceHelper::init( SpriteCanvas& rSpriteCanvas,
const ::basegfx::B2ISize& rSize,
bool bFullscreen )
{
mpSpriteCanvas = &rSpriteCanvas;
maSize = rSize;
mbFullScreen = bFullscreen;
}
void DeviceHelper::disposing()
{
// release all references
mpSpriteCanvas = NULL;
}
geometry::RealSize2D DeviceHelper::getPhysicalResolution()
{
return geometry::RealSize2D( 75, 75 );
}
geometry::RealSize2D DeviceHelper::getPhysicalSize()
{
return geometry::RealSize2D( 210, 280 );
}
uno::Reference< rendering::XLinePolyPolygon2D > DeviceHelper::createCompatibleLinePolyPolygon(
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points )
{
// disposed?
if( !mpSpriteCanvas )
return uno::Reference< rendering::XLinePolyPolygon2D >(); // we're disposed
return uno::Reference< rendering::XLinePolyPolygon2D >(
new ::basegfx::unotools::UnoPolyPolygon(
::basegfx::unotools::polyPolygonFromPoint2DSequenceSequence( points )));
}
uno::Reference< rendering::XBezierPolyPolygon2D > DeviceHelper::createCompatibleBezierPolyPolygon(
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
const uno::Sequence< uno::Sequence< geometry::RealBezierSegment2D > >& points )
{
// disposed?
if( !mpSpriteCanvas )
return uno::Reference< rendering::XBezierPolyPolygon2D >(); // we're disposed
return uno::Reference< rendering::XBezierPolyPolygon2D >(
new ::basegfx::unotools::UnoPolyPolygon(
::basegfx::unotools::polyPolygonFromBezier2DSequenceSequence( points ) ) );
}
uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleBitmap(
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
const geometry::IntegerSize2D& size )
{
// disposed?
if( !mpSpriteCanvas )
return uno::Reference< rendering::XBitmap >(); // we're disposed
return uno::Reference< rendering::XBitmap >(
new CanvasBitmap(
::basegfx::unotools::b2ISizeFromIntegerSize2D( size ),
mpSpriteCanvas,
false ));
}
uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileBitmap(
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
const geometry::IntegerSize2D& /*size*/ )
{
return uno::Reference< rendering::XVolatileBitmap >();
}
uno::Reference< rendering::XBitmap > DeviceHelper::createCompatibleAlphaBitmap(
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
const geometry::IntegerSize2D& size )
{
// disposed?
if( !mpSpriteCanvas )
return uno::Reference< rendering::XBitmap >(); // we're disposed
return uno::Reference< rendering::XBitmap >(
new CanvasBitmap(
::basegfx::unotools::b2ISizeFromIntegerSize2D( size ),
mpSpriteCanvas,
true ));
}
uno::Reference< rendering::XVolatileBitmap > DeviceHelper::createVolatileAlphaBitmap(
const uno::Reference< rendering::XGraphicDevice >& /*rDevice*/,
const geometry::IntegerSize2D& /*size*/ )
{
return uno::Reference< rendering::XVolatileBitmap >();
}
sal_Bool DeviceHelper::hasFullScreenMode()
{
// TODO(F3): offer fullscreen mode the XCanvas way
return false;
}
sal_Bool DeviceHelper::enterFullScreenMode( sal_Bool /*bEnter*/ )
{
// TODO(F3): offer fullscreen mode the XCanvas way
return false;
}
::sal_Int32 DeviceHelper::createBuffers( ::sal_Int32 /*nBuffers*/ )
{
// TODO(F3): implement XBufferStrategy interface. For now, we
// _always_ will have exactly one backbuffer
return 1;
}
void DeviceHelper::destroyBuffers()
{
// TODO(F3): implement XBufferStrategy interface. For now, we
// _always_ will have exactly one backbuffer
}
::sal_Bool DeviceHelper::showBuffer( bool bIsVisible, ::sal_Bool bUpdateAll )
{
// forward to sprite canvas helper
if( !bIsVisible || !mpSpriteCanvas )
return false;
return mpSpriteCanvas->updateScreen( bUpdateAll );
}
::sal_Bool DeviceHelper::switchBuffer( bool bIsVisible, ::sal_Bool bUpdateAll )
{
// no difference for VCL canvas
return showBuffer( bIsVisible, bUpdateAll );
}
uno::Any DeviceHelper::isAccelerated() const
{
return ::com::sun::star::uno::makeAny(false);
}
uno::Any DeviceHelper::getDeviceHandle() const
{
return uno::Any();
}
uno::Any DeviceHelper::getSurfaceHandle() const
{
return uno::Any();
}
namespace
{
struct DeviceColorSpace: public rtl::StaticWithInit<uno::Reference<rendering::XColorSpace>,
DeviceColorSpace>
{
uno::Reference<rendering::XColorSpace> operator()()
{
return vcl::unotools::createStandardColorSpace();
}
};
}
uno::Reference<rendering::XColorSpace> DeviceHelper::getColorSpace() const
{
// always the same
return DeviceColorSpace::get();
}
void DeviceHelper::notifySizeUpdate( const awt::Rectangle& /*rBounds*/ )
{
// TODO
}
void DeviceHelper::dumpScreenContent() const
{
OSL_TRACE( "%s\n",
BOOST_CURRENT_FUNCTION );
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _NULLCANVAS_DEVICEHELPER_HXX
#define _NULLCANVAS_DEVICEHELPER_HXX
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/rendering/XGraphicDevice.hpp>
#include <com/sun/star/rendering/XBufferController.hpp>
#include <boost/utility.hpp>
/* Definition of DeviceHelper class */
namespace nullcanvas
{
class SpriteCanvas;
class DeviceHelper : private ::boost::noncopyable
{
public:
DeviceHelper();
void init( SpriteCanvas& rSpriteCanvas,
const ::basegfx::B2ISize& rSize,
bool bFullscreen );
/// 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 );
::sal_Int32 createBuffers( ::sal_Int32 nBuffers );
void destroyBuffers( );
::sal_Bool showBuffer( bool bIsVisible, ::sal_Bool bUpdateAll );
::sal_Bool switchBuffer( bool bIsVisible, ::sal_Bool bUpdateAll );
::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;
void notifySizeUpdate( const ::com::sun::star::awt::Rectangle& rBounds );
/** called when DumpScreenContent property is enabled on
XGraphicDevice, and writes out bitmaps of current screen.
*/
void dumpScreenContent() const;
private:
/// Pointer to sprite canvas (owner of this helper), needed to create bitmaps
SpriteCanvas* mpSpriteCanvas;
::basegfx::B2ISize maSize;
bool mbFullScreen;
};
}
#endif /* _NULLCANVAS_WINDOWGRAPHICDEVICE_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <osl/mutex.hxx>
#include <com/sun/star/registry/XRegistryKey.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <comphelper/servicedecl.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include "null_spritecanvas.hxx"
using namespace ::com::sun::star;
#define SERVICE_NAME "com.sun.star.rendering.NullCanvas"
namespace nullcanvas
{
SpriteCanvas::SpriteCanvas( const uno::Sequence< uno::Any >& aArguments,
const uno::Reference< uno::XComponentContext >& rxContext ) :
maArguments(aArguments),
mxComponentContext( rxContext )
{
}
void SpriteCanvas::initialize()
{
// #i64742# Only call initialize when not in probe mode
if( maArguments.getLength() == 0 )
return;
VERBOSE_TRACE( "SpriteCanvas::initialize called" );
// At index 1, we expect a system window handle here,
// containing a pointer to a valid window, on which to output
// At index 2, we expect the current window bound rect
ENSURE_ARG_OR_THROW( maArguments.getLength() >= 4 &&
maArguments[1].getValueTypeClass() == uno::TypeClass_LONG,
"SpriteCanvas::initialize: wrong number of arguments, or wrong types" );
awt::Rectangle aRect;
maArguments[2] >>= aRect;
const ::basegfx::B2ISize aSize(aRect.Width,
aRect.Height);
sal_Bool bIsFullscreen( sal_False );
maArguments[3] >>= bIsFullscreen;
// setup helper
maDeviceHelper.init( *this,
aSize,
bIsFullscreen );
maCanvasHelper.init( maRedrawManager,
*this,
aSize,
false );
maArguments.realloc(0);
}
void SpriteCanvas::disposeThis()
{
::osl::MutexGuard aGuard( m_aMutex );
mxComponentContext.clear();
// forward to parent
SpriteCanvasBaseT::disposeThis();
}
::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// avoid repaints on hidden window (hidden: not mapped to
// screen). Return failure, since the screen really has _not_
// been updated (caller should try again later)
return !mbIsVisible ? false : SpriteCanvasBaseT::showBuffer( bUpdateAll );
}
::sal_Bool SAL_CALL SpriteCanvas::switchBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// avoid repaints on hidden window (hidden: not mapped to
// screen). Return failure, since the screen really has _not_
// been updated (caller should try again later)
return !mbIsVisible ? false : SpriteCanvasBaseT::switchBuffer( bUpdateAll );
}
sal_Bool SAL_CALL SpriteCanvas::updateScreen( sal_Bool bUpdateAll ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// avoid repaints on hidden window (hidden: not mapped to
// screen). Return failure, since the screen really has _not_
// been updated (caller should try again later)
return !mbIsVisible ? false : maCanvasHelper.updateScreen(
::basegfx::unotools::b2IRectangleFromAwtRectangle(maBounds),
bUpdateAll,
mbSurfaceDirty );
}
OUString SAL_CALL SpriteCanvas::getServiceName( ) throw (uno::RuntimeException)
{
return OUString( SERVICE_NAME );
}
static uno::Reference<uno::XInterface> initCanvas( SpriteCanvas* pCanvas )
{
uno::Reference<uno::XInterface> xRet(static_cast<cppu::OWeakObject*>(pCanvas));
pCanvas->initialize();
return xRet;
}
namespace sdecl = comphelper::service_decl;
sdecl::class_<SpriteCanvas, sdecl::with_args<true> > serviceImpl(&initCanvas);
const sdecl::ServiceDecl nullCanvasDecl(
serviceImpl,
"com.sun.star.comp.rendering.NullCanvas",
SERVICE_NAME );
}
// The C shared lib entry points
COMPHELPER_SERVICEDECL_EXPORTS1(nullcanvas, nullcanvas::nullCanvasDecl)
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _NULLCANVAS_SPRITECANVAS_HXX_
#define _NULLCANVAS_SPRITECANVAS_HXX_
#include <rtl/ref.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/awt/XWindowListener.hpp>
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
#include <com/sun/star/rendering/XGraphicDevice.hpp>
#include <com/sun/star/rendering/XBufferController.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <cppuhelper/compbase8.hxx>
#include <comphelper/uno3.hxx>
#include <canvas/base/spritecanvasbase.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/bufferedgraphicdevicebase.hxx>
#include "null_spritecanvashelper.hxx"
#include "null_devicehelper.hxx"
#include "null_usagecounter.hxx"
namespace nullcanvas
{
typedef ::cppu::WeakComponentImplHelper8< ::com::sun::star::rendering::XSpriteCanvas,
::com::sun::star::rendering::XIntegerBitmap,
::com::sun::star::rendering::XGraphicDevice,
::com::sun::star::lang::XMultiServiceFactory,
::com::sun::star::rendering::XBufferController,
::com::sun::star::awt::XWindowListener,
::com::sun::star::beans::XPropertySet,
::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base;
typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >,
DeviceHelper,
::osl::MutexGuard,
::cppu::OWeakObject > SpriteCanvasBase_Base;
/** Mixin SpriteSurface
Have to mixin the SpriteSurface before deriving from
::canvas::SpriteCanvasBase, as this template should already
implement some of those interface methods.
The reason why this appears kinda convoluted is the fact that
we cannot specify non-IDL types as WeakComponentImplHelperN
template args, and furthermore, don't want to derive
::canvas::SpriteCanvasBase directly from
::canvas::SpriteSurface (because derivees of
::canvas::SpriteCanvasBase have to explicitly forward the
XInterface methods (e.g. via DECLARE_UNO3_AGG_DEFAULTS)
anyway). Basically, ::canvas::CanvasCustomSpriteBase should
remain a base class that provides implementation, not to
enforce any specific interface on its derivees.
*/
class SpriteCanvasBaseSpriteSurface_Base : public SpriteCanvasBase_Base,
public ::canvas::SpriteSurface
{
};
typedef ::canvas::SpriteCanvasBase< SpriteCanvasBaseSpriteSurface_Base,
SpriteCanvasHelper,
::osl::MutexGuard,
::cppu::OWeakObject > SpriteCanvasBaseT;
/** Product of this component's factory.
The SpriteCanvas object combines the actual Window canvas with
the XGraphicDevice interface. This is because there's a
one-to-one relation between them, anyway, since each window
can have exactly one canvas and one associated
XGraphicDevice. And to avoid messing around with circular
references, this is implemented as one single object.
*/
class SpriteCanvas : public SpriteCanvasBaseT,
private UsageCounter< SpriteCanvas >
{
public:
SpriteCanvas( const ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Any >& aArguments,
const ::com::sun::star::uno::Reference<
::com::sun::star::uno::XComponentContext >& rxContext );
void initialize();
/// Dispose all internal references
virtual void disposeThis();
// Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base
// Classname Base doing refcounting Base implementing the XComponent interface
// | | |
// V V V
DECLARE_UNO3_XCOMPONENT_AGG_DEFAULTS( SpriteCanvas, WindowGraphicDeviceBase_Base, ::cppu::WeakComponentImplHelperBase );
// XBufferController (partial)
virtual ::sal_Bool SAL_CALL showBuffer( ::sal_Bool bUpdateAll ) throw (::com::sun::star::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL switchBuffer( ::sal_Bool bUpdateAll ) throw (::com::sun::star::uno::RuntimeException);
// XSpriteCanvas (partial)
virtual sal_Bool SAL_CALL updateScreen( sal_Bool bUpdateAll ) throw (::com::sun::star::uno::RuntimeException);
// XServiceName
virtual OUString SAL_CALL getServiceName( ) throw (::com::sun::star::uno::RuntimeException);
private:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > maArguments;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxComponentContext;
};
typedef ::rtl::Reference< SpriteCanvas > SpriteCanvasRef;
typedef ::rtl::Reference< SpriteCanvas > DeviceRef;
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#include <canvas/debug.hxx>
#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
#include <comphelper/scopeguard.hxx>
#include <basegfx/range/b2drectangle.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <boost/cast.hpp>
#include "null_spritecanvashelper.hxx"
#include "null_canvascustomsprite.hxx"
using namespace ::com::sun::star;
namespace nullcanvas
{
SpriteCanvasHelper::SpriteCanvasHelper() :
mpRedrawManager( NULL )
{
}
void SpriteCanvasHelper::init( ::canvas::SpriteRedrawManager& rManager,
SpriteCanvas& rDevice,
const ::basegfx::B2ISize& rSize,
bool bHasAlpha )
{
mpRedrawManager = &rManager;
CanvasHelper::init( rSize, rDevice, bHasAlpha );
}
void SpriteCanvasHelper::disposing()
{
mpRedrawManager = NULL;
// forward to base
CanvasHelper::disposing();
}
uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromAnimation(
const uno::Reference< rendering::XAnimation >& /*animation*/ )
{
return uno::Reference< rendering::XAnimatedSprite >();
}
uno::Reference< rendering::XAnimatedSprite > SpriteCanvasHelper::createSpriteFromBitmaps(
const uno::Sequence< uno::Reference< rendering::XBitmap > >& /*animationBitmaps*/,
sal_Int8 /*interpolationMode*/ )
{
return uno::Reference< rendering::XAnimatedSprite >();
}
uno::Reference< rendering::XCustomSprite > SpriteCanvasHelper::createCustomSprite( const geometry::RealSize2D& spriteSize )
{
if( !mpRedrawManager )
return uno::Reference< rendering::XCustomSprite >(); // we're disposed
return uno::Reference< rendering::XCustomSprite >(
new CanvasCustomSprite( spriteSize,
mpDevice ) );
}
uno::Reference< rendering::XSprite > SpriteCanvasHelper::createClonedSprite( const uno::Reference< rendering::XSprite >& /*original*/ )
{
return uno::Reference< rendering::XSprite >();
}
sal_Bool SpriteCanvasHelper::updateScreen( const ::basegfx::B2IRange& /*rCurrArea*/,
sal_Bool /*bUpdateAll*/,
bool& /*io_bSurfaceDirty*/ )
{
// TODO
return sal_True;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _NULLCANVAS_SPRITECANVASHELPER_HXX_
#define _NULLCANVAS_SPRITECANVASHELPER_HXX_
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
#include <com/sun/star/rendering/XIntegerBitmap.hpp>
#include <canvas/spriteredrawmanager.hxx>
#include "null_canvashelper.hxx"
namespace basegfx
{
class B2IRange;
}
namespace nullcanvas
{
class SpriteCanvas;
class SpriteCanvasHelper : public CanvasHelper
{
public:
SpriteCanvasHelper();
void init( ::canvas::SpriteRedrawManager& rManager,
SpriteCanvas& rDevice,
const ::basegfx::B2ISize& rSize,
bool bHasAlpha );
/// Dispose all internal references
void disposing();
// XSpriteCanvas
::com::sun::star::uno::Reference<
::com::sun::star::rendering::XAnimatedSprite > createSpriteFromAnimation(
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XAnimation >& animation );
::com::sun::star::uno::Reference<
::com::sun::star::rendering::XAnimatedSprite > createSpriteFromBitmaps(
const ::com::sun::star::uno::Sequence<
::com::sun::star::uno::Reference<
::com::sun::star::rendering::XBitmap > >& animationBitmaps,
sal_Int8 interpolationMode );
::com::sun::star::uno::Reference<
::com::sun::star::rendering::XCustomSprite > createCustomSprite(
const ::com::sun::star::geometry::RealSize2D& spriteSize );
::com::sun::star::uno::Reference<
::com::sun::star::rendering::XSprite > createClonedSprite(
const ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XSprite >& original );
/** Actually perform the screen update
@param rCurrArea
Current window area in absolute screen coordinates
@param bUpdateAll
sal_True, if everything must be updated, not only changed
sprites
@param io_bSurfaceDirty
In/out parameter, whether backbuffer surface is dirty (if
yes, we're performing a full update, anyway)
*/
sal_Bool updateScreen( const ::basegfx::B2IRange& rCurrArea,
sal_Bool bUpdateAll,
bool& io_bSurfaceDirty );
private:
/// Set from the SpriteCanvas: instance coordinating sprite redraw
::canvas::SpriteRedrawManager* mpRedrawManager;
};
}
#endif /* _NULLCANVAS_SPRITECANVASHELPER_HXX_ */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
#include <canvas/verbosetrace.hxx>
#include <rtl/logfile.hxx>
#include <rtl/math.hxx>
#include <canvas/canvastools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolygontriangulator.hxx>
#include <basegfx/polygon/b2dpolygoncutandtouch.hxx>
#include "null_canvascustomsprite.hxx"
#include "null_spritehelper.hxx"
#include <memory>
using namespace ::com::sun::star;
namespace nullcanvas
{
SpriteHelper::SpriteHelper() :
mpSpriteCanvas(),
mbTextureDirty( true )
{
}
void SpriteHelper::init( const geometry::RealSize2D& rSpriteSize,
const SpriteCanvasRef& rSpriteCanvas )
{
ENSURE_OR_THROW( rSpriteCanvas.get(),
"SpriteHelper::init(): Invalid device, sprite canvas or surface" );
mpSpriteCanvas = rSpriteCanvas;
mbTextureDirty = true;
// also init base class
CanvasCustomSpriteHelper::init( rSpriteSize,
rSpriteCanvas.get() );
}
void SpriteHelper::disposing()
{
mpSpriteCanvas.clear();
// forward to parent
CanvasCustomSpriteHelper::disposing();
}
void SpriteHelper::redraw( bool& /*io_bSurfaceDirty*/ ) const
{
// TODO
}
::basegfx::B2DPolyPolygon SpriteHelper::polyPolygonFromXPolyPolygon2D( uno::Reference< rendering::XPolyPolygon2D >& xPoly ) const
{
return ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D( xPoly );
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _NULLCANVAS_SPRITEHELPER_HXX
#define _NULLCANVAS_SPRITEHELPER_HXX
#include <com/sun/star/rendering/XCustomSprite.hpp>
#include <canvas/base/canvascustomspritehelper.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include "null_spritecanvas.hxx"
namespace nullcanvas
{
/* Definition of SpriteHelper class */
/** Helper class for canvas sprites.
This class implements all sprite-related functionality, like
that available on the XSprite interface.
*/
class SpriteHelper : public ::canvas::CanvasCustomSpriteHelper
{
public:
/** Create sprite helper
*/
SpriteHelper();
// make CanvasCustomSpriteHelper::init visible for name lookup
using ::canvas::CanvasCustomSpriteHelper::init;
/** Late-init the sprite helper
@param rSpriteSize
Size of the sprite
@param rSpriteCanvas
Sprite canvas this sprite is part of. Object stores
ref-counted reference to it, thus, don't forget to pass on
disposing()!
@param rDevice
DX device to use
@param rSpriteSurface
The surface of the sprite (not the DX texture, but the
persistent target of content rendering)
@param bShowSpriteBounds
When true, little debug bound rects for sprites are shown
*/
void init( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
const SpriteCanvasRef& rSpriteCanvas );
void disposing();
/** Repaint sprite content via hardware to associated sprite
canvas
@param io_bSurfaceDirty
Input/output parameter, whether the sprite content is
dirty or not. If texture was updated, set to false
*/
void redraw( bool& io_bSurfaceDirty ) const;
private:
virtual ::basegfx::B2DPolyPolygon polyPolygonFromXPolyPolygon2D(
::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D >& xPoly ) const;
SpriteCanvasRef mpSpriteCanvas;
mutable bool mbTextureDirty; // when true, texture needs update
};
}
#endif /* _NULLCANVAS_SPRITEHELPER_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#include <canvas/debug.hxx>
#include <tools/diagnose_ex.h>
#include <canvas/verbosetrace.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/numeric/ftools.hxx>
#include "null_textlayout.hxx"
#include "null_spritecanvas.hxx"
using namespace ::com::sun::star;
namespace nullcanvas
{
TextLayout::TextLayout( const rendering::StringContext& aText,
sal_Int8 nDirection,
sal_Int64 /*nRandomSeed*/,
const CanvasFont::ImplRef& rFont ) :
TextLayout_Base( m_aMutex ),
maText( aText ),
maLogicalAdvancements(),
mpFont( rFont ),
mnTextDirection( nDirection )
{
}
TextLayout::~TextLayout()
{
}
void SAL_CALL TextLayout::disposing()
{
mpFont.reset();
}
// XTextLayout
uno::Sequence< uno::Reference< rendering::XPolyPolygon2D > > SAL_CALL TextLayout::queryTextShapes( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return uno::Sequence< uno::Reference< rendering::XPolyPolygon2D > >();
}
uno::Sequence< geometry::RealRectangle2D > SAL_CALL TextLayout::queryInkMeasures( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return uno::Sequence< geometry::RealRectangle2D >();
}
uno::Sequence< geometry::RealRectangle2D > SAL_CALL TextLayout::queryMeasures( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return uno::Sequence< geometry::RealRectangle2D >();
}
uno::Sequence< double > SAL_CALL TextLayout::queryLogicalAdvancements( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
return maLogicalAdvancements;
}
void SAL_CALL TextLayout::applyLogicalAdvancements( const uno::Sequence< double >& aAdvancements ) throw (lang::IllegalArgumentException, uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
if( aAdvancements.getLength() != maText.Length )
{
OSL_TRACE( "TextLayout::applyLogicalAdvancements(): mismatching number of advancements" );
throw lang::IllegalArgumentException();
}
maLogicalAdvancements = aAdvancements;
}
geometry::RealRectangle2D SAL_CALL TextLayout::queryTextBounds( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
ENSURE_OR_THROW( mpFont.get(),
"TextLayout::queryTextBounds(): invalid font" );
// fake text bounds by either taking the advancement values,
// or assuming square glyph boxes (width similar to height)
const rendering::FontRequest& rFontRequest( mpFont->getFontRequest() );
const double nFontSize( ::std::max( rFontRequest.CellSize,
rFontRequest.ReferenceAdvancement ) );
if( maLogicalAdvancements.getLength() )
{
return geometry::RealRectangle2D( 0, -nFontSize/2,
maLogicalAdvancements[ maLogicalAdvancements.getLength()-1 ],
nFontSize/2 );
}
else
{
return geometry::RealRectangle2D( 0, -nFontSize/2,
nFontSize * maText.Length,
nFontSize/2 );
}
}
double SAL_CALL TextLayout::justify( double /*nSize*/ ) throw (lang::IllegalArgumentException, uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return 0.0;
}
double SAL_CALL TextLayout::combinedJustify( const uno::Sequence< uno::Reference< rendering::XTextLayout > >& /*aNextLayouts*/,
double /*nSize*/ ) throw (lang::IllegalArgumentException, uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return 0.0;
}
rendering::TextHit SAL_CALL TextLayout::getTextHit( const geometry::RealPoint2D& /*aHitPoint*/ ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return rendering::TextHit();
}
rendering::Caret SAL_CALL TextLayout::getCaret( sal_Int32 /*nInsertionIndex*/,
sal_Bool /*bExcludeLigatures*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return rendering::Caret();
}
sal_Int32 SAL_CALL TextLayout::getNextInsertionIndex( sal_Int32 /*nStartIndex*/,
sal_Int32 /*nCaretAdvancement*/,
sal_Bool /*bExcludeLigatures*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return 0;
}
uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryVisualHighlighting( sal_Int32 /*nStartIndex*/,
sal_Int32 /*nEndIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return uno::Reference< rendering::XPolyPolygon2D >();
}
uno::Reference< rendering::XPolyPolygon2D > SAL_CALL TextLayout::queryLogicalHighlighting( sal_Int32 /*nStartIndex*/,
sal_Int32 /*nEndIndex*/ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return uno::Reference< rendering::XPolyPolygon2D >();
}
double SAL_CALL TextLayout::getBaselineOffset( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return 0.0;
}
sal_Int8 SAL_CALL TextLayout::getMainTextDirection( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
return mnTextDirection;
}
uno::Reference< rendering::XCanvasFont > SAL_CALL TextLayout::getFont( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
return mpFont.getRef();
}
rendering::StringContext SAL_CALL TextLayout::getText( ) throw (uno::RuntimeException)
{
::osl::MutexGuard aGuard( m_aMutex );
return maText;
}
bool TextLayout::draw( const rendering::ViewState& /*rViewState*/,
const rendering::RenderState& /*rRenderState*/,
const uno::Reference< rendering::XGraphicDevice >& /*xGraphicDevice*/ ) const
{
::osl::MutexGuard aGuard( m_aMutex );
// TODO
return true;
}
#define SERVICE_NAME "com.sun.star.rendering.TextLayout"
#define IMPLEMENTATION_NAME "NullCanvas::TextLayout"
OUString SAL_CALL TextLayout::getImplementationName() throw( uno::RuntimeException )
{
return OUString( IMPLEMENTATION_NAME );
}
sal_Bool SAL_CALL TextLayout::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException )
{
return ServiceName == SERVICE_NAME;
}
uno::Sequence< OUString > SAL_CALL TextLayout::getSupportedServiceNames() throw( uno::RuntimeException )
{
uno::Sequence< OUString > aRet(1);
aRet[0] = SERVICE_NAME;
return aRet;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _NULLCANVAS_TEXTLAYOUT_HXX
#define _NULLCANVAS_TEXTLAYOUT_HXX
#include <cppuhelper/compbase2.hxx>
#include <comphelper/broadcasthelper.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/rendering/XTextLayout.hpp>
#include <basegfx/vector/b2isize.hxx>
#include <boost/utility.hpp>
#include "null_canvasfont.hxx"
#include "null_usagecounter.hxx"
/* Definition of TextLayout class */
namespace nullcanvas
{
typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::rendering::XTextLayout,
::com::sun::star::lang::XServiceInfo > TextLayout_Base;
class TextLayout : public ::comphelper::OBaseMutex,
public TextLayout_Base,
private UsageCounter< TextLayout >,
private ::boost::noncopyable
{
public:
TextLayout( const ::com::sun::star::rendering::StringContext& aText,
sal_Int8 nDirection,
sal_Int64 nRandomSeed,
const CanvasFont::ImplRef& rFont );
/// Dispose all internal references
virtual void SAL_CALL disposing();
// XTextLayout
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > > SAL_CALL queryTextShapes( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealRectangle2D > SAL_CALL queryInkMeasures( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealRectangle2D > SAL_CALL queryMeasures( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< double > SAL_CALL queryLogicalAdvancements( ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL applyLogicalAdvancements( const ::com::sun::star::uno::Sequence< double >& aAdvancements ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::geometry::RealRectangle2D SAL_CALL queryTextBounds( ) throw (::com::sun::star::uno::RuntimeException);
virtual double SAL_CALL justify( double nSize ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
virtual double SAL_CALL combinedJustify( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XTextLayout > >& aNextLayouts, double nSize ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::rendering::TextHit SAL_CALL getTextHit( const ::com::sun::star::geometry::RealPoint2D& aHitPoint ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::rendering::Caret SAL_CALL getCaret( sal_Int32 nInsertionIndex, sal_Bool bExcludeLigatures ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getNextInsertionIndex( sal_Int32 nStartIndex, sal_Int32 nCaretAdvancement, sal_Bool bExcludeLigatures ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > SAL_CALL queryVisualHighlighting( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XPolyPolygon2D > SAL_CALL queryLogicalHighlighting( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual double SAL_CALL getBaselineOffset( ) throw (::com::sun::star::uno::RuntimeException);
virtual sal_Int8 SAL_CALL getMainTextDirection( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::rendering::XCanvasFont > SAL_CALL getFont( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::rendering::StringContext SAL_CALL getText( ) throw (::com::sun::star::uno::RuntimeException);
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
bool draw( const ::com::sun::star::rendering::ViewState& rViewState,
const ::com::sun::star::rendering::RenderState& rRenderState,
const ::com::sun::star::uno::Reference<
::com::sun::star::rendering::XGraphicDevice >& xGraphicDevice ) const;
protected:
~TextLayout(); // we're a ref-counted UNO class. _We_ destroy ourselves.
private:
::com::sun::star::rendering::StringContext maText;
::com::sun::star::uno::Sequence< double > maLogicalAdvancements;
CanvasFont::ImplRef mpFont;
sal_Int8 mnTextDirection;
};
}
#endif /* _NULLCANVAS_TEXTLAYOUT_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef _NULLCANVAS_USAGECOUNTER_HXX
#define _NULLCANVAS_USAGECOUNTER_HXX
#include <osl/interlck.h>
#include <boost/current_function.hpp>
#include "sal/log.hxx"
namespace nullcanvas
{
/** Little resource tracking counter.
When using this object, a global use counter, specific to the
given type is incremented on object construction, and
decremented on object destruction.
*/
template< class Type > class UsageCounter
{
public:
UsageCounter()
{
SAL_INFO("canvas.null","" << BOOST_CURRENT_FUNCTION << ", " << osl_atomic_increment( &s_nCount ) << " objects currently in use.\n");
}
~UsageCounter()
{
const sal_Int32 nCount( osl_atomic_decrement( &s_nCount ) );
if( !nCount )
{
SAL_INFO("canvas.null", "" << BOOST_CURRENT_FUNCTION << ", last instance deleted.\n");
}
else
{
SAL_INFO("canvas.null", "" << BOOST_CURRENT_FUNCTION << ", " << nCount << " instances left.\n");
}
}
private:
static oslInterlockedCount s_nCount;
};
template< class Type > oslInterlockedCount UsageCounter<Type>::s_nCount = 0;
}
#endif /* _NULLCANVAS_USAGECOUNTER_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<!--
* 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/.
-->
<component loader="com.sun.star.loader.SharedLibrary" prefix="nullcanvas"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.rendering.NullCanvas">
<service name="com.sun.star.rendering.NullCanvas"/>
</implementation>
</component>
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef INCLUDED_NULLCANVAS_SPRITE_HXX
#define INCLUDED_NULLCANVAS_SPRITE_HXX
#include <canvas/base/sprite.hxx>
namespace nullcanvas
{
/** Specialization of ::canvas::Sprite interface, to also provide
redraw methods.
*/
class Sprite : public ::canvas::Sprite
{
public:
/** Redraw sprite
*/
virtual void redraw() const = 0;
protected:
~Sprite() {}
};
}
#endif /* INCLUDED_NULLCANVAS_SPRITE_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment