24#include <com/sun/star/graphic/XGraphic.hpp>
25#include <com/sun/star/graphic/XGraphicRenderer.hpp>
26#include <com/sun/star/drawing/GraphicExportFilter.hpp>
68 for( pCurrAct =
const_cast<GDIMetaFile&
>(rMtf).FirstAction();
70 pCurrAct =
const_cast<GDIMetaFile&
>(rMtf).NextAction() )
74 case MetaActionType::RASTEROP:
76 if( RasterOp::OverPaint ==
82 case MetaActionType::MOVECLIPREGION:
83 case MetaActionType::REFPOINT:
84 case MetaActionType::WALLPAPER:
96typedef ::cppu::WeakComponentImplHelper< graphic::XGraphicRenderer > DummyRenderer_Base;
108 virtual void SAL_CALL render(
const uno::Reference< graphic::XGraphic >& rGraphic )
override
110 ::osl::MutexGuard aGuard( m_aMutex );
124 ::osl::MutexGuard aGuard( m_aMutex );
128 if( aGraphic.GetType() == GraphicType::Bitmap ||
139 xMtf->SetPrefSize( aBmpEx.GetPrefSize() );
140 xMtf->SetPrefMapMode( aBmpEx.GetPrefMapMode() );
144 return std::make_shared<GDIMetaFile>(aGraphic.GetGDIMetaFile());
162 SAL_WARN(
"slideshow.opengl",
"getMetaFile(): Invalid context" );
176 drawing::GraphicExportFilter::create(rxContext);
186 uno::UNO_QUERY_THROW ))
195 xExporter->setSourceDocument( xSource );
196 if( !xExporter->filter( aProps ) )
217 case MetaActionType::TEXT: {
222 case MetaActionType::TEXTARRAY: {
228 case MetaActionType::STRETCHTEXT: {
234 case MetaActionType::FLOATTRANSPARENT: {
249 sal_uInt32& o_rLoopCount,
259 const Point aEmptyPoint;
267 pVDev->SetOutputSizePixel( aAnimSize );
268 pVDev->EnableMapMode(
false );
272 pVDevMask->SetOutputSizePixel( aAnimSize );
273 pVDevMask->EnableMapMode(
false );
291 pVDevMask->GetOutputSizePixel());
293 pVDevMask->DrawWallpaper(aRect,
318 pVDevMask->SetLineColor();
319 pVDevMask->DrawRect(aRect);
328 case Disposal::Previous :
341 Bitmap aAlphaMask = pVDevMask->GetBitmap(aEmptyPoint, aAnimSize);
354 pMtf->SetPrefMapMode(
MapMode() );
355 pMtf->SetPrefSize( aAnimSize );
359 sal_Int32 nWaitTime100thSeconds(rAnimationFrame.
mnWait);
364 nWaitTime100thSeconds = 100 * 60 * 60 * 24;
369 if( nWaitTime100thSeconds == 0 )
370 nWaitTime100thSeconds = 10;
372 o_rFrames.emplace_back( pMtf, nWaitTime100thSeconds / 100.0 );
375 return !o_rFrames.empty();
383 bool bScrollRectSet(
false);
384 bool bPaintRectSet(
false);
386 for (
MetaAction * pCurrAct = rMtf->FirstAction();
387 pCurrAct !=
nullptr; pCurrAct = rMtf->NextAction() )
389 if (pCurrAct->GetType() == MetaActionType::COMMENT)
394 if( pAct->
GetComment().matchIgnoreAsciiCase(
"XTEXT" ) )
396 if (pAct->
GetComment().equalsIgnoreAsciiCase(
"XTEXT_SCROLLRECT"))
402 bScrollRectSet =
true;
404 else if (pAct->
GetComment().equalsIgnoreAsciiCase(
"XTEXT_PAINTRECT") )
410 bPaintRectSet =
true;
416 return bScrollRectSet && bPaintRectSet;
#define ANIMATION_TIMEOUT_ON_CLICK
const Size & GetDisplaySizePixel() const
const AnimationFrame & Get(sal_uInt16 nAnimation) const
sal_uInt32 GetLoopCount() const
const AlphaMask & GetAlphaMask() const
Bitmap GetBitmap(Color aTransparentReplaceColor) const
Size GetSizePixel() const
Animation GetAnimation() const
sal_Int32 GetIndex() const
const OUString & GetText() const
const OUString & GetText() const
sal_Int32 GetIndex() const
sal_Int32 GetIndex() const
const OUString & GetText() const
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
::std::shared_ptr< GDIMetaFile > GDIMetaFileSharedPtr
#define SAL_WARN(area, stream)
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
@ MTF_LOAD_FOREIGN_SOURCE
the source of the metafile might be a foreign application.
@ MTF_LOAD_BACKGROUND_ONLY
retrieve a meta file for the page background only
@ MTF_LOAD_SCROLL_TEXT_MTF
retrieve the drawing layer scroll text metafile
static bool hasUnsupportedActions(const GDIMetaFile &rMtf)
std::shared_ptr< GDIMetaFile > GDIMetaFileSharedPtr
bool getRectanglesFromScrollMtf(::basegfx::B2DRectangle &o_rScrollRect, ::basegfx::B2DRectangle &o_rPaintRect, const GDIMetaFileSharedPtr &rMtf)
Retrieve scroll text animation rectangles from given metafile.
bool getAnimationFromGraphic(VectorOfMtfAnimationFrames &o_rFrames, sal_uInt32 &o_rLoopCount, const Graphic &rGraphic)
Extract a vector of animation frames from given Graphic.
::std::vector< MtfAnimationFrame > VectorOfMtfAnimationFrames
GDIMetaFileSharedPtr getMetaFile(const uno::Reference< lang::XComponent > &xSource, const uno::Reference< drawing::XDrawPage > &xContainingPage, int mtfLoadFlags, const uno::Reference< uno::XComponentContext > &rxContext)
sal_Int32 getNextActionOffset(MetaAction *pCurrAct)
Gets the next action offset for iterating meta actions which is most often returns 1.