LibreOffice Module svx (master) 1
overlayrectangle.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#include <vcl/svapp.hxx>
24#include <vcl/settings.hxx>
25
26
27namespace sdr::overlay
28{
30 {
32 basegfx::BColor aColor(getBaseColor().getBColor());
33 static const double fChange(0.1); // just small optical change, do not make it annoying
34
36 {
37 aColor += basegfx::B3DTuple(fChange, fChange, fChange);
38 aColor.clamp();
39 }
40 else
41 {
42 aColor -= basegfx::B3DTuple(fChange, fChange, fChange);
43 aColor.clamp();
44 }
45
48 aHatchRange,
49 aColor,
53 mfRotation));
54
56 }
57
59 const basegfx::B2DPoint& rBasePosition,
60 const basegfx::B2DPoint& rSecondPosition,
61 const Color& rHatchColor,
62 double fTransparence,
63 double fDiscreteGrow,
64 double fDiscreteShrink,
65 double fRotation,
66 bool bAnimate)
67 : OverlayObjectWithBasePosition(rBasePosition, rHatchColor),
68 maSecondPosition(rSecondPosition),
69 mfTransparence(fTransparence),
70 mfDiscreteGrow(fDiscreteGrow),
71 mfDiscreteShrink(fDiscreteShrink),
72 mfRotation(fRotation),
73 mnBlinkTime(impCheckBlinkTimeValueRange(500)),
74 mbOverlayState(false)
75 {
76 if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
77 {
78 // no animation in high contrast mode
79 bAnimate = false;
80 }
81
82 // set AllowsAnimation flag to mark this object as animation capable
83 mbAllowsAnimation = bAnimate;
84 // use selection colors in HighContrast mode
86 }
87
88 void OverlayRectangle::Trigger(sal_uInt32 nTime)
89 {
91 return;
92
93 // #i53216# produce event after nTime + x
94 SetTime(nTime + mnBlinkTime);
95
96 // switch state
98 {
99 mbOverlayState = false;
100 }
101 else
102 {
103 mbOverlayState = true;
104 }
105
106 // re-insert me as event
108
109 // register change (after change)
110 objectChange();
111 }
112} // end of namespace
113
114
115/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
basegfx::B2DPoint maSecondPosition
static const AllSettings & GetSettings()
BColor & clamp()
void SetTime(sal_uInt32 nNew)
Definition: scheduler.cxx:39
void InsertEvent(sdr::animation::Event &rNew)
const basegfx::B2DPoint & getBasePosition() const
const Color & getBaseColor() const
OverlayManager * getOverlayManager() const
virtual void Trigger(sal_uInt32 nTime) override
OverlayRectangle(const basegfx::B2DPoint &rBasePosition, const basegfx::B2DPoint &rSecondPosition, const Color &rHatchColor, double fTransparence, double fDiscreteGrow, double fDiscreteShrink, double fRotation, bool bAnimate)
virtual drawinglayer::primitive2d::Primitive2DContainer createOverlayObjectPrimitive2DSequence() override