office-gobmx/canvas/source/vcl/canvascustomsprite.hxx
Stephan Bergmann 6ac0e1399a Remove silly PUT_SEMICOLON_AT_THE_END
...and rather live with macro calls not terminated by semicolons until those
macros are gone for good anyway.  Completely remove unused
DECLARE_UNO3_XCOMPONENT_DEFAULTS.

Change-Id: I0d4eb5a91736004b0da2b09fce860e57f6d1ddbd
2014-04-07 17:27:39 +02:00

125 lines
6.2 KiB
C++

/* -*- 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_CANVAS_SOURCE_VCL_CANVASCUSTOMSPRITE_HXX
#define INCLUDED_CANVAS_SOURCE_VCL_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 <vcl/virdev.hxx>
#include <canvas/vclwrapper.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/spritesurface.hxx>
#include <canvas/base/canvascustomspritebase.hxx>
#include "sprite.hxx"
#include "canvashelper.hxx"
#include "spritehelper.hxx"
#include "backbuffer.hxx"
#include "impltools.hxx"
#include "spritecanvas.hxx"
#include "repainttarget.hxx"
namespace vclcanvas
{
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::BaseMutexHelper< CanvasCustomSpriteBase_Base >,
public Sprite
{
};
typedef ::canvas::CanvasCustomSpriteBase< CanvasCustomSpriteSpriteBase_Base,
SpriteHelper,
CanvasHelper,
tools::LocalGuard,
::cppu::OWeakObject > CanvasCustomSpriteBaseT;
/* Definition of CanvasCustomSprite class */
class CanvasCustomSprite : public CanvasCustomSpriteBaseT,
public RepaintTarget
{
public:
CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
::com::sun::star::rendering::XGraphicDevice& rDevice,
const ::canvas::SpriteSurface::Reference& rOwningSpriteCanvas,
const OutDevProviderSharedPtr& rOutDevProvider,
bool bShowSpriteBounds );
// 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, std::exception ) SAL_OVERRIDE;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
// Sprite
virtual void redraw( OutputDevice& rOutDev,
bool bBufferedUpdate ) const SAL_OVERRIDE;
virtual void redraw( OutputDevice& rOutDev,
const ::basegfx::B2DPoint& rPos,
bool bBufferedUpdate ) const SAL_OVERRIDE;
// RepaintTarget
virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
const ::com::sun::star::rendering::ViewState& viewState,
const ::com::sun::star::rendering::RenderState& renderState,
const ::Point& rPt,
const ::Size& rSz,
const GraphicAttr& rAttr ) const SAL_OVERRIDE;
};
}
#endif // INCLUDED_CANVAS_SOURCE_VCL_CANVASCUSTOMSPRITE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */