/* -*- 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 .
*/
namespace slideshow::internal
{ class Activity; struct SlideShowContext; class DrawShape; typedef ::std::shared_ptr< DrawShape > DrawShapeSharedPtr;
/** This Struct store data needed to make Animation from Graphic. If the Animation is too big, we won't load all of it at once. From time to time we load small parts until it is completely loaded. Because of it, we have to keep some data alive until the animation is fully loaded.
*/ struct DelayedGraphicLoader
{
sal_uInt16 mnLoadedFrames = 0;
::std::shared_ptr<Graphic> mpGraphic;
ScopedVclPtrInstance<VirtualDevice> mpVDev;
ScopedVclPtrInstance<VirtualDevice> mpVDevMask;
/** This class is the representation of a draw document's XShape, and implements the Shape, AnimatableShape, and AttributableShape interfaces.
@attention this class is to be treated 'final', i.e. one should not derive from it.
*/ class DrawShape : public AttributableShape, public DocTreeNodeSupplier, public HyperlinkArea, public ::osl::DebugBase<DrawShape>
{ public: /** Create a shape for the given XShape
@param xShape The XShape to represent.
@param xContainingPage The page that contains this shape. Needed for proper import (currently, the UnoGraphicExporter needs this information).
@param nPrio Externally-determined shape priority (used e.g. for paint ordering). This number _must be_ unique!
@param bForeignSource When true, the source of the shape metafile might be a foreign application. The metafile is checked against unsupported content, and, if necessary, returned as a pre-rendered bitmap.
*/ static DrawShapeSharedPtr create( const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::drawing::XDrawPage >& xContainingPage, double nPrio, bool bForeignSource, const SlideShowContext& rContext ); // throw ShapeLoadFailedException;
/** Create a shape for the given XShape and graphic content
@param xShape The XShape to represent.
@param xContainingPage The page that contains this shape. Needed for proper import (currently, the UnoGraphicExporter needs this information).
@param nPrio Externally-determined shape priority (used e.g. for paint ordering). This number _must be_ unique!
@param rGraphic Graphic to display in the shape's bound rect. If this Graphic contains animatable content, the created DrawShape will register itself for intrinsic animation events.
*/ static DrawShapeSharedPtr create( const css::uno::Reference< css::drawing::XShape >& xShape, const css::uno::Reference< css::drawing::XDrawPage >& xContainingPage, double nPrio,
std::shared_ptr<Graphic> pGraphic,
Used by IntrinsicAnimationActivity, to show the next animation frame.
*/ void setIntrinsicAnimationFrame( ::std::size_t nCurrFrame );
/** forces the drawshape to load and return a specially crafted metafile, usable to display drawing layer text animations.
*/
GDIMetaFileSharedPtr const & forceScrollTextMetaFile();
/** extract some Animation Frames from the Graphic set in DelayedGraphicLoader.
@param nFrameCount Load this many frames.
@param nLastToLoad If nLastToLoad > nFrameCount + loadedFrames then Load frames until this frame.
*/ void getSomeAnimationFramesFromGraphic(::std::size_t nFrameCount,
::std::size_t nLastToLoad = 0);
private: /** Create a shape for the given XShape
@param xShape The XShape to represent.
@param xContainingPage The page that contains this shape. Needed for proper import (currently, the UnoGraphicExporter needs this information).
@param nPrio Externally-determined shape priority (used e.g. for paint ordering). This number _must be_ unique!
@param bForeignSource When true, the source of the shape metafile might be a foreign application. The metafile is checked against unsupported content, and, if necessary, returned as a pre-rendered bitmap.
*/
DrawShape( const css::uno::Reference<
css::drawing::XShape >& xShape, const css::uno::Reference<
css::drawing::XDrawPage >& xContainingPage, double nPrio, bool bForeignSource, const SlideShowContext& rContext ); // throw ShapeLoadFailedException;
/** Create a shape for the given XShape and graphic content
@param xShape The XShape to represent.
@param xContainingPage The page that contains this shape. Needed for proper import (currently, the UnoGraphicExporter needs this information).
@param nPrio Externally-determined shape priority (used e.g. for paint ordering). This number _must be_ unique!
@param rGraphic Graphic to display in the shape's bound rect. If this Graphic contains animatable content, the created DrawShape will register itself for intrinsic animation events.
*/
DrawShape( const css::uno::Reference< css::drawing::XShape >& xShape,
css::uno::Reference< css::drawing::XDrawPage > xContainingPage, double nPrio,
std::shared_ptr<Graphic> pGraphic, const SlideShowContext& rContext ); // throw ShapeLoadFailedException;
/** Private copy constructor
Used to create subsetted shapes
*/
DrawShape( const DrawShape&, const DocTreeNode& rTreeNode, double nPrio );
/** A vector of metafiles actually representing the Shape.
If this shape is not animated, only a single entry is available.
*/ mutable VectorOfMtfAnimationFrames maAnimationFrames;
::std::size_t mnCurrFrame;
::std::unique_ptr<DelayedGraphicLoader> mpGraphicLoader; //to load more Frames later
/// Metafile of currently active frame (static for shapes w/o intrinsic animation) mutable GDIMetaFileSharedPtr mpCurrMtf;
/// loadflags of current meta file mutableint mnCurrMtfLoadFlags;
/// Contains the current shape bounds, in unit rect space mutable ::std::optional<basegfx::B2DRectangle> maCurrentShapeUnitBounds;
// The attributes of this Shape constdouble mnPriority;
::basegfx::B2DRectangle maBounds; // always needed for rendering. // for subset shapes, this member // might change when views are // added, as minimal bounds are // calculated
// Pointer to modifiable shape attributes
ShapeAttributeLayerSharedPtr mpAttributeLayer; // only created lazily
// held here, to signal our destruction
std::weak_ptr<Activity> mpIntrinsicAnimationActivity;
// The attribute states, to detect attribute changes, // without buffering and querying each single attribute mutable State::StateId mnAttributeTransformationState; mutable State::StateId mnAttributeClipState; mutable State::StateId mnAttributeAlphaState; mutable State::StateId mnAttributePositionState; mutable State::StateId mnAttributeContentState; mutable State::StateId mnAttributeVisibilityState;
/// the list of active view shapes (one for each registered view layer) typedef ::std::vector< ViewShapeSharedPtr > ViewShapeVector;
ViewShapeVector maViewShapes;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.