Files
libreoffice/canvas/source/vcl/spritecanvas.cxx

342 lines
14 KiB
C++
Raw Normal View History

/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: spritecanvas.cxx,v $
*
* $Revision: 1.11 $
*
* last change: $Author: hr $ $Date: 2006-06-20 02:20:57 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library 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 for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
************************************************************************/
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:33 thb 1.2.2.13: #118514# Canvas module reorg 2004/09/29 23:36:05 thb 1.2.2.12: #110496# Making the new modules Wall clean 2004/09/29 08:31:23 thb 1.2.2.11: #110496# Removed extraneous trace outputs 2004/09/28 17:43:53 thb 1.2.2.10: #110496# Perform reinterpretative casting more carefully. The old version yielded wrong results for UltraSparc platform, possibly due to violated alignment requirements 2004/09/08 16:34:45 dbo 1.2.2.9: #110496# separate service names for all kinds of canvas implementations Issue number: Submitted by: Reviewed by: 2004/08/27 18:46:18 thb 1.2.2.8: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/02 17:51:00 thb 1.2.2.7: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 18:40:43 thb 1.2.2.6: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:57 thb 1.2.2.5: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/05/27 20:51:25 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:53 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:25 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:58:00 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:15:27 +00:00
#include <canvas/debug.hxx>
#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.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>
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:33 thb 1.2.2.13: #118514# Canvas module reorg 2004/09/29 23:36:05 thb 1.2.2.12: #110496# Making the new modules Wall clean 2004/09/29 08:31:23 thb 1.2.2.11: #110496# Removed extraneous trace outputs 2004/09/28 17:43:53 thb 1.2.2.10: #110496# Perform reinterpretative casting more carefully. The old version yielded wrong results for UltraSparc platform, possibly due to violated alignment requirements 2004/09/08 16:34:45 dbo 1.2.2.9: #110496# separate service names for all kinds of canvas implementations Issue number: Submitted by: Reviewed by: 2004/08/27 18:46:18 thb 1.2.2.8: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/02 17:51:00 thb 1.2.2.7: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 18:40:43 thb 1.2.2.6: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:57 thb 1.2.2.5: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/05/27 20:51:25 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:53 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:25 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:58:00 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:15:27 +00:00
#include <vcl/canvastools.hxx>
#include <vcl/outdev.hxx>
#include <vcl/window.hxx>
#include <vcl/bitmapex.hxx>
#include <basegfx/tools/canvastools.hxx>
#include <algorithm>
#include "spritecanvas.hxx"
using namespace ::com::sun::star;
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:33 thb 1.2.2.13: #118514# Canvas module reorg 2004/09/29 23:36:05 thb 1.2.2.12: #110496# Making the new modules Wall clean 2004/09/29 08:31:23 thb 1.2.2.11: #110496# Removed extraneous trace outputs 2004/09/28 17:43:53 thb 1.2.2.10: #110496# Perform reinterpretative casting more carefully. The old version yielded wrong results for UltraSparc platform, possibly due to violated alignment requirements 2004/09/08 16:34:45 dbo 1.2.2.9: #110496# separate service names for all kinds of canvas implementations Issue number: Submitted by: Reviewed by: 2004/08/27 18:46:18 thb 1.2.2.8: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/02 17:51:00 thb 1.2.2.7: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 18:40:43 thb 1.2.2.6: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:57 thb 1.2.2.5: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/05/27 20:51:25 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:53 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:25 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:58:00 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:15:27 +00:00
#define IMPLEMENTATION_NAME "VCLCanvas::SpriteCanvas"
#define SERVICE_NAME "com.sun.star.rendering.VCLCanvas"
namespace
{
static ::rtl::OUString SAL_CALL getImplementationName_SpriteCanvas()
{
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ) );
}
static uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_SpriteCanvas()
{
uno::Sequence< ::rtl::OUString > aRet(1);
aRet[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( SERVICE_NAME ) );
return aRet;
}
}
namespace vclcanvas
{
SpriteCanvas::SpriteCanvas( const uno::Reference< uno::XComponentContext >& rxContext ) :
mxComponentContext( rxContext )
{
OSL_TRACE( "SpriteCanvas created" );
// add our own property to GraphicDevice
maPropHelper.addProperties(
::canvas::PropertySetHelper::MakeMap
("UnsafeScrolling",
boost::bind(&SpriteCanvasHelper::isUnsafeScrolling,
boost::ref(maCanvasHelper)),
boost::bind(&SpriteCanvasHelper::enableUnsafeScrolling,
boost::ref(maCanvasHelper),
_1))
("SpriteBounds",
boost::bind(&SpriteCanvasHelper::isSpriteBounds,
boost::ref(maCanvasHelper)),
boost::bind(&SpriteCanvasHelper::enableSpriteBounds,
boost::ref(maCanvasHelper),
_1)));
}
SpriteCanvas::~SpriteCanvas()
{
OSL_TRACE( "SpriteCanvas destroyed" );
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:33 thb 1.2.2.13: #118514# Canvas module reorg 2004/09/29 23:36:05 thb 1.2.2.12: #110496# Making the new modules Wall clean 2004/09/29 08:31:23 thb 1.2.2.11: #110496# Removed extraneous trace outputs 2004/09/28 17:43:53 thb 1.2.2.10: #110496# Perform reinterpretative casting more carefully. The old version yielded wrong results for UltraSparc platform, possibly due to violated alignment requirements 2004/09/08 16:34:45 dbo 1.2.2.9: #110496# separate service names for all kinds of canvas implementations Issue number: Submitted by: Reviewed by: 2004/08/27 18:46:18 thb 1.2.2.8: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/02 17:51:00 thb 1.2.2.7: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 18:40:43 thb 1.2.2.6: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:57 thb 1.2.2.5: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/05/27 20:51:25 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:53 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:25 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:58:00 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:15:27 +00:00
void SAL_CALL SpriteCanvas::disposing()
{
tools::LocalGuard aGuard;
mxComponentContext.clear();
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:33 thb 1.2.2.13: #118514# Canvas module reorg 2004/09/29 23:36:05 thb 1.2.2.12: #110496# Making the new modules Wall clean 2004/09/29 08:31:23 thb 1.2.2.11: #110496# Removed extraneous trace outputs 2004/09/28 17:43:53 thb 1.2.2.10: #110496# Perform reinterpretative casting more carefully. The old version yielded wrong results for UltraSparc platform, possibly due to violated alignment requirements 2004/09/08 16:34:45 dbo 1.2.2.9: #110496# separate service names for all kinds of canvas implementations Issue number: Submitted by: Reviewed by: 2004/08/27 18:46:18 thb 1.2.2.8: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/02 17:51:00 thb 1.2.2.7: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 18:40:43 thb 1.2.2.6: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:57 thb 1.2.2.5: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/05/27 20:51:25 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:53 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:25 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:58:00 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:15:27 +00:00
// forward to parent
SpriteCanvasBaseT::disposing();
}
::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException)
{
tools::LocalGuard aGuard;
// 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)
{
tools::LocalGuard aGuard;
// 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 );
}
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:33 thb 1.2.2.13: #118514# Canvas module reorg 2004/09/29 23:36:05 thb 1.2.2.12: #110496# Making the new modules Wall clean 2004/09/29 08:31:23 thb 1.2.2.11: #110496# Removed extraneous trace outputs 2004/09/28 17:43:53 thb 1.2.2.10: #110496# Perform reinterpretative casting more carefully. The old version yielded wrong results for UltraSparc platform, possibly due to violated alignment requirements 2004/09/08 16:34:45 dbo 1.2.2.9: #110496# separate service names for all kinds of canvas implementations Issue number: Submitted by: Reviewed by: 2004/08/27 18:46:18 thb 1.2.2.8: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/02 17:51:00 thb 1.2.2.7: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 18:40:43 thb 1.2.2.6: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:57 thb 1.2.2.5: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/05/27 20:51:25 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:53 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:25 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:58:00 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:15:27 +00:00
sal_Bool SAL_CALL SpriteCanvas::updateScreen( sal_Bool bUpdateAll ) throw (uno::RuntimeException)
{
tools::LocalGuard aGuard;
// 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(bUpdateAll,
mbSurfaceDirty);
}
void SAL_CALL SpriteCanvas::initialize( const uno::Sequence< uno::Any >& aArguments ) throw( uno::Exception,
uno::RuntimeException)
{
tools::LocalGuard aGuard;
VERBOSE_TRACE( "VCLSpriteCanvas::initialize called" );
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:33 thb 1.2.2.13: #118514# Canvas module reorg 2004/09/29 23:36:05 thb 1.2.2.12: #110496# Making the new modules Wall clean 2004/09/29 08:31:23 thb 1.2.2.11: #110496# Removed extraneous trace outputs 2004/09/28 17:43:53 thb 1.2.2.10: #110496# Perform reinterpretative casting more carefully. The old version yielded wrong results for UltraSparc platform, possibly due to violated alignment requirements 2004/09/08 16:34:45 dbo 1.2.2.9: #110496# separate service names for all kinds of canvas implementations Issue number: Submitted by: Reviewed by: 2004/08/27 18:46:18 thb 1.2.2.8: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/02 17:51:00 thb 1.2.2.7: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 18:40:43 thb 1.2.2.6: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:57 thb 1.2.2.5: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/05/27 20:51:25 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:53 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:25 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:58:00 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:15:27 +00:00
CHECK_AND_THROW( aArguments.getLength() >= 1,
"SpriteCanvas::initialize: wrong number of arguments" );
// We expect a single Any here, containing a pointer to a valid
// VCL window, on which to output
if( aArguments.getLength() >= 1 &&
aArguments[0].getValueTypeClass() == uno::TypeClass_HYPER )
{
sal_Int64 nWindowPtr = 0;
aArguments[0] >>= nWindowPtr;
Window* pOutputWindow = reinterpret_cast<Window*>(nWindowPtr);
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED 2004/11/17 17:00:33 thb 1.2.2.13: #118514# Canvas module reorg 2004/09/29 23:36:05 thb 1.2.2.12: #110496# Making the new modules Wall clean 2004/09/29 08:31:23 thb 1.2.2.11: #110496# Removed extraneous trace outputs 2004/09/28 17:43:53 thb 1.2.2.10: #110496# Perform reinterpretative casting more carefully. The old version yielded wrong results for UltraSparc platform, possibly due to violated alignment requirements 2004/09/08 16:34:45 dbo 1.2.2.9: #110496# separate service names for all kinds of canvas implementations Issue number: Submitted by: Reviewed by: 2004/08/27 18:46:18 thb 1.2.2.8: #110496# Adapted to recent canvas API changes (XSpriteCanvas::updateScreen and sprite clip semantics 2004/08/02 17:51:00 thb 1.2.2.7: #110496# Adapted to recent XCanvas API changes, streamlined and factored out common code with directxcanvas 2004/07/22 18:40:43 thb 1.2.2.6: #110496# Overhauled sprite redraw algo, to also respect overlapping sprites 2004/07/20 19:23:57 thb 1.2.2.5: #110496# Removed self-references to various interface implementations, along the lines, factored out common base implementation for all c++ canvases 2004/05/27 20:51:25 thb 1.2.2.4: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/05/27 14:36:53 thb 1.2.2.3: #110496# verbose tracing is now guarded also with DBG_UTIL. Unified verbose trace output between directx and VCL canvas 2004/04/12 15:12:25 thb 1.2.2.2: #110496# Adaptions after canvas01 merge 2004/04/05 15:58:00 thb 1.2.2.1: Resync with canvas01 changes
2004-11-26 16:15:27 +00:00
CHECK_AND_THROW( pOutputWindow != NULL,
"SpriteCanvas::initialize: invalid Window pointer" );
// setup helper
maDeviceHelper.init( *pOutputWindow,
*this );
maCanvasHelper.init( *this,
maDeviceHelper.getBackBuffer(),
false, // no OutDev state preservation
false ); // no alpha on surface
maCanvasHelper.setRedrawManager( maRedrawManager );
}
}
::rtl::OUString SAL_CALL SpriteCanvas::getImplementationName() throw( uno::RuntimeException )
{
return getImplementationName_SpriteCanvas();
}
sal_Bool SAL_CALL SpriteCanvas::supportsService( const ::rtl::OUString& ServiceName ) throw( uno::RuntimeException )
{
return ServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( SERVICE_NAME ) );
}
uno::Sequence< ::rtl::OUString > SAL_CALL SpriteCanvas::getSupportedServiceNames() throw( uno::RuntimeException )
{
return getSupportedServiceNames_SpriteCanvas();
}
::rtl::OUString SAL_CALL SpriteCanvas::getServiceName( ) throw (::com::sun::star::uno::RuntimeException)
{
return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME ) );
}
uno::Reference< uno::XInterface > SAL_CALL SpriteCanvas::createInstance( const uno::Reference< uno::XComponentContext >& xContext ) throw ( uno::Exception )
{
return uno::Reference< uno::XInterface >( static_cast<cppu::OWeakObject*>(new SpriteCanvas( xContext )) );
}
bool SpriteCanvas::repaint( const GraphicObjectSharedPtr& rGrf,
const ::Point& rPt,
const ::Size& rSz,
const GraphicAttr& rAttr ) const
{
tools::LocalGuard aGuard;
return maCanvasHelper.repaint( rGrf, rPt, rSz, rAttr );
}
OutputDevice* SpriteCanvas::getOutDev() const
{
tools::LocalGuard aGuard;
return maDeviceHelper.getOutDev();
}
BackBufferSharedPtr SpriteCanvas::getBackBuffer() const
{
tools::LocalGuard aGuard;
return maDeviceHelper.getBackBuffer();
}
uno::Reference< beans::XPropertySetInfo > SAL_CALL SpriteCanvas::getPropertySetInfo() throw (uno::RuntimeException)
{
tools::LocalGuard aGuard;
return maPropHelper.getPropertySetInfo();
}
void SAL_CALL SpriteCanvas::setPropertyValue( const ::rtl::OUString& aPropertyName,
const uno::Any& aValue ) throw (beans::UnknownPropertyException,
beans::PropertyVetoException,
lang::IllegalArgumentException,
lang::WrappedTargetException,
uno::RuntimeException)
{
tools::LocalGuard aGuard;
maPropHelper.setPropertyValue( aPropertyName, aValue );
}
uno::Any SAL_CALL SpriteCanvas::getPropertyValue( const ::rtl::OUString& aPropertyName ) throw (beans::UnknownPropertyException,
lang::WrappedTargetException,
uno::RuntimeException)
{
tools::LocalGuard aGuard;
return maPropHelper.getPropertyValue( aPropertyName );
}
void SAL_CALL SpriteCanvas::addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException,
lang::WrappedTargetException,
uno::RuntimeException)
{
tools::LocalGuard aGuard;
maPropHelper.addPropertyChangeListener( aPropertyName,
xListener );
}
void SAL_CALL SpriteCanvas::removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw (beans::UnknownPropertyException,
lang::WrappedTargetException,
uno::RuntimeException)
{
tools::LocalGuard aGuard;
maPropHelper.removePropertyChangeListener( aPropertyName,
xListener );
}
void SAL_CALL SpriteCanvas::addVetoableChangeListener( const ::rtl::OUString& aPropertyName,
const uno::Reference< beans::XVetoableChangeListener >& xListener ) throw (beans::UnknownPropertyException,
lang::WrappedTargetException,
uno::RuntimeException)
{
tools::LocalGuard aGuard;
maPropHelper.addVetoableChangeListener( aPropertyName,
xListener );
}
void SAL_CALL SpriteCanvas::removeVetoableChangeListener( const ::rtl::OUString& aPropertyName,
const uno::Reference< beans::XVetoableChangeListener >& xListener ) throw (beans::UnknownPropertyException,
lang::WrappedTargetException,
uno::RuntimeException)
{
tools::LocalGuard aGuard;
maPropHelper.removeVetoableChangeListener( aPropertyName,
xListener );
}
}
namespace
{
/* shared lib exports implemented with helpers */
static struct ::cppu::ImplementationEntry s_component_entries [] =
{
{
vclcanvas::SpriteCanvas::createInstance, getImplementationName_SpriteCanvas,
getSupportedServiceNames_SpriteCanvas, ::cppu::createSingleComponentFactory,
0, 0
},
{ 0, 0, 0, 0, 0, 0 }
};
}
/* Exported UNO methods for registration and object creation.
==========================================================
*/
extern "C"
{
void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvTypeName,
uno_Environment** )
{
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
sal_Bool SAL_CALL component_writeInfo( lang::XMultiServiceFactory* xMgr,
registry::XRegistryKey* xRegistry )
{
return ::cppu::component_writeInfoHelper(
xMgr, xRegistry, s_component_entries );
}
void * SAL_CALL component_getFactory( sal_Char const* implName,
lang::XMultiServiceFactory* xMgr,
registry::XRegistryKey* xRegistry )
{
return ::cppu::component_getFactoryHelper(
implName, xMgr, xRegistry, s_component_entries );
}
}