LibreOffice Module svx (master)  1
overlayanimatedbitmapex.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
23 
24 
25 namespace sdr::overlay
26 {
28  {
29  if(mbOverlayState)
30  {
35  mnCenterX1,
36  mnCenterY1,
37  getShearX(),
38  getRotation()));
39 
41  }
42  else
43  {
48  mnCenterX2,
49  mnCenterY2,
50  getShearX(),
51  getRotation()));
52 
54  }
55  }
56 
58  const basegfx::B2DPoint& rBasePos,
59  const BitmapEx& rBitmapEx1,
60  const BitmapEx& rBitmapEx2,
61  sal_uInt64 nBlinkTime,
62  sal_uInt16 nCenX1,
63  sal_uInt16 nCenY1,
64  sal_uInt16 nCenX2,
65  sal_uInt16 nCenY2,
66  double fShearX,
67  double fRotation)
69  maBitmapEx1(rBitmapEx1),
70  maBitmapEx2(rBitmapEx2),
71  mnCenterX1(nCenX1), mnCenterY1(nCenY1),
72  mnCenterX2(nCenX2), mnCenterY2(nCenY2),
73  mnBlinkTime(impCheckBlinkTimeValueRange(nBlinkTime)),
74  mfShearX(fShearX),
75  mfRotation(fRotation),
76  mbOverlayState(false)
77  {
78  // set AllowsAnimation flag to mark this object as animation capable
79  mbAllowsAnimation = true;
80  }
81 
83  {
84  }
85 
86  void OverlayAnimatedBitmapEx::Trigger(sal_uInt32 nTime)
87  {
88  if(getOverlayManager())
89  {
90  // #i53216# produce event after nTime + x
91  SetTime(nTime + mnBlinkTime);
92 
93  // switch state
94  if(mbOverlayState)
95  {
96  mbOverlayState = false;
97  }
98  else
99  {
100  mbOverlayState = true;
101  }
102 
103  // re-insert me as event
104  getOverlayManager()->InsertEvent(*this);
105 
106  // register change (after change)
107  objectChange();
108  }
109  }
110 
111 } // end of namespace
112 
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void Trigger(sal_uInt32 nTime) override
virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override
OverlayManager * getOverlayManager() const
void SetTime(sal_uInt32 nNew)
Definition: scheduler.cxx:39
const basegfx::B2DPoint & getBasePosition() const
void InsertEvent(sdr::animation::Event &rNew)
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
OverlayAnimatedBitmapEx(const basegfx::B2DPoint &rBasePos, const BitmapEx &rBitmapEx1, const BitmapEx &rBitmapEx2, sal_uInt64 nBlinkTime, sal_uInt16 nCenX1=0, sal_uInt16 nCenY1=0, sal_uInt16 nCenX2=0, sal_uInt16 nCenY2=0, double fShearX=0.0, double fRotation=0.0)