1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <svx/sdr/overlay/overlayanimatedbitmapex.hxx>
21 #include <svx/sdr/overlay/overlaymanager.hxx>
22 #include <sdr/overlay/overlaytools.hxx>
25 namespace sdr::overlay
27 drawinglayer::primitive2d::Primitive2DContainer
OverlayAnimatedBitmapEx::createOverlayObjectPrimitive2DSequence()
31 const drawinglayer::primitive2d::Primitive2DReference
aPrimitive(
32 new drawinglayer::primitive2d::OverlayBitmapExPrimitive(
40 return drawinglayer::primitive2d::Primitive2DContainer
{ aPrimitive
};
44 const drawinglayer::primitive2d::Primitive2DReference
aPrimitive(
45 new drawinglayer::primitive2d::OverlayBitmapExPrimitive(
53 return drawinglayer::primitive2d::Primitive2DContainer
{ aPrimitive
};
57 OverlayAnimatedBitmapEx::OverlayAnimatedBitmapEx(
58 const basegfx::B2DPoint
& rBasePos
,
59 const BitmapEx
& rBitmapEx1
,
60 const BitmapEx
& rBitmapEx2
,
61 sal_uInt64 nBlinkTime
,
68 : OverlayObjectWithBasePosition(rBasePos
, COL_WHITE
),
69 maBitmapEx1(rBitmapEx1
),
70 maBitmapEx2(rBitmapEx2
),
71 mnCenterX1(nCenX1
), mnCenterY1(nCenY1
),
72 mnCenterX2(nCenX2
), mnCenterY2(nCenY2
),
73 mnBlinkTime(impCheckBlinkTimeValueRange(nBlinkTime
)),
75 mfRotation(fRotation
),
78 // set AllowsAnimation flag to mark this object as animation capable
79 mbAllowsAnimation
= true;
82 OverlayAnimatedBitmapEx::~OverlayAnimatedBitmapEx()
86 void OverlayAnimatedBitmapEx::Trigger(sal_uInt32 nTime
)
88 if(!getOverlayManager())
91 // #i53216# produce event after nTime + x
92 SetTime(nTime
+ mnBlinkTime
);
97 mbOverlayState
= false;
101 mbOverlayState
= true;
104 // re-insert me as event
105 getOverlayManager()->InsertEvent(*this);
107 // register change (after change)
111 } // end of namespace
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */