/usr/include/Wt/WAnimation is in libwt-dev 3.3.0-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2011 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef WTRANSITION_H_
#define WTRANSITION_H_
#include <Wt/WGlobal>
namespace Wt {
/*! \class WAnimation Wt/WAnimation Wt/WAnimation
* \brief A value class that defines a transition effect.
*
* This class defines an animation used as a transition to show or
* hide a widget.
*
* The animation can be defined as a motion effect (e.g. sliding in or
* out), optionally combined with a fade effect. A timing function
* defines how the effects(s) are animated during the total duration of
* the animation.
*
* \sa WWidget::animateShow(), WWidget::animateHide(), WWidget::setHidden()
*/
class WT_API WAnimation
{
public:
/*! \brief An enumeration describing an animation effect
*
* An animation effect can be the combination of a motion and an optional
* fade effect, e.g:
* \code
* SlideInFromRight
* SlideInFromTop | Fade
* \endcode
*
* You can specify only one motion effect.
*
* \sa setEffects()
*/
enum AnimationEffect {
SlideInFromLeft = 0x1, //!< Slides right to show, left to hide
SlideInFromRight = 0x2, //!< Slides left to show, right to hide
SlideInFromBottom = 0x3, //!< Slides up to show, down to hide
SlideInFromTop = 0x4, //!< Slides down to show, up to hide
Pop = 0x5, //!< Pops up to show, pops away to hide
Fade = 0x100 //!< Fade effect
};
/*! \brief A timing function
*
* The timing function defines how the animation effects are animated
* during the total duration of the animation.
*/
enum TimingFunction {
Ease, //!< Slow start and slow finish
Linear, //!< Linear throughout
EaseIn, //!< Slow start
EaseOut, //!< Slow finish
EaseInOut, //!< Slow start and even slower finish
CubicBezier //!< (Currently unsupported)
};
/*! \brief Default constructor.
*
* Creates an animation that actually represent <i>no</i> animation.
* (effects() == 0).
*/
WAnimation();
/*! \brief Creates an animation.
*
* An animation is created with given effects, timing and duration.
*/
WAnimation(WFlags<AnimationEffect> effects, TimingFunction timing = Linear,
int duration = 250);
#ifdef WT_TARGET_JAVA
/*! \brief Creates an animation.
*
* An animation is created with one effect, timing and duration.
*/
WAnimation(AnimationEffect effect, TimingFunction timing = Linear,
int duration = 250);
/*! \brief Creates an animation.
*
* An animation is created with two effects (a motion and Fade).
*/
WAnimation(AnimationEffect effect1, AnimationEffect effect2,
TimingFunction timing = Linear, int duration = 250);
/*! \brief Clone method.
*
* Clones this animation object.
*/
WAnimation clone() const;
#endif
/*! \brief Sets the animation effects.
*
* A motion effect (\link WAnimation::SlideInFromLeft
* SlideInFromLeft\endlink, \link WAnimation::SlideInFromRight
* SlideInFromRight\endlink, \link WAnimation::SlideInFromBottom
* SlideInFromBottom\endlink, \link WAnimation::SlideInFromTop
* SlideInFromTop\endlink or \link WAnimation::Pop Pop\endlink) can be combined
* with a fade effect (\link WAnimation::Fade Fade\endlink).
*
* When effects are 0, the animation does not actually specify an
* animation, but instead an instant transition.
*/
void setEffects(WFlags<AnimationEffect> effects);
/*! \brief Returns animation effects.
*
* \sa setEffects()
*/
WFlags<AnimationEffect> effects() const { return effects_; }
/*! \brief Comparison operator.
*
* Returns \c true if the transitions are exactly the same.
*/
bool operator==(const WAnimation& other) const;
/*! \brief Comparison operator.
*
* Returns \c true if the transitions are different.
*/
bool operator!=(const WAnimation& other) const;
/*! \brief Sets the duration.
*
* The default animation duration is 250 ms.
*
* \sa duration()
*/
void setDuration(int msecs);
/*! \brief Returns the duration.
*
* \sa setDuration()
*/
int duration() const { return duration_; }
/*! \brief Sets a timing function.
*
* The default timinig function is WAnimation::Linear.
*/
void setTimingFunction(TimingFunction function);
/*! \brief Returns the timing function.
*
* \sa setTimingFunction()
*/
TimingFunction timingFunction() const { return timing_; }
/*
void setTimingFunction(double x1, double y1, double x2, double y2);
const double[] timingFunction();
*/
/*! \brief Returns whether the animation is empty.
*
* An animation is empty (meaning the transition is instant), if the
* duration is 0, or if no effects are defined.
*/
bool empty() const;
private:
WFlags<AnimationEffect> effects_;
TimingFunction timing_;
int duration_;
};
W_DECLARE_OPERATORS_FOR_FLAGS(WAnimation::AnimationEffect);
}
#endif // WTRANSITION_H_
|