mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 10:52:49 +00:00
plasma: remove unused and bogus water animation
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
53efbdfa94
commit
e0cbdd94f3
7 changed files with 0 additions and 490 deletions
|
@ -67,7 +67,6 @@ set(plasma_LIB_SRCS
|
||||||
animations/slide.cpp
|
animations/slide.cpp
|
||||||
animations/stackedlayout.cpp
|
animations/stackedlayout.cpp
|
||||||
animations/geometry.cpp
|
animations/geometry.cpp
|
||||||
animations/water.cpp
|
|
||||||
animations/widgetsnapshot.cpp
|
animations/widgetsnapshot.cpp
|
||||||
animations/zoom.cpp
|
animations/zoom.cpp
|
||||||
applet.cpp
|
applet.cpp
|
||||||
|
@ -113,7 +112,6 @@ set(plasma_LIB_SRCS
|
||||||
private/windowpreview.cpp
|
private/windowpreview.cpp
|
||||||
private/declarative/declarativenetworkaccessmanagerfactory.cpp
|
private/declarative/declarativenetworkaccessmanagerfactory.cpp
|
||||||
private/effects/halopainter.cpp
|
private/effects/halopainter.cpp
|
||||||
private/effects/ripple.cpp
|
|
||||||
querymatch.cpp
|
querymatch.cpp
|
||||||
runnercontext.cpp
|
runnercontext.cpp
|
||||||
runnermanager.cpp
|
runnermanager.cpp
|
||||||
|
|
|
@ -1,69 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2010 Bruno Abinader <bruno.abinader@indt.org.br>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <plasma/private/effects/ripple_p.h>
|
|
||||||
#include "water_p.h"
|
|
||||||
|
|
||||||
namespace Plasma
|
|
||||||
{
|
|
||||||
|
|
||||||
WaterAnimation::WaterAnimation(QObject *parent)
|
|
||||||
: EasingAnimation(parent),
|
|
||||||
m_offset(1)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
qint8 WaterAnimation::offset() const
|
|
||||||
{
|
|
||||||
return m_offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WaterAnimation::setOffset(qint8 offset)
|
|
||||||
{
|
|
||||||
m_offset = offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WaterAnimation::updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
|
|
||||||
{
|
|
||||||
QGraphicsWidget *widget = targetWidget();
|
|
||||||
if (!widget) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
RippleEffect *effect = qobject_cast<RippleEffect*>(widget->graphicsEffect());
|
|
||||||
if (!effect) {
|
|
||||||
effect = new RippleEffect(widget);
|
|
||||||
widget->setGraphicsEffect(effect);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (oldState == Stopped && newState == Running) {
|
|
||||||
effect->setOffset(m_offset);
|
|
||||||
effect->setEnabled(true);
|
|
||||||
} else if (newState == Stopped) {
|
|
||||||
effect->setEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WaterAnimation::updateEffectiveTime(int currentTime)
|
|
||||||
{
|
|
||||||
QGraphicsWidget *widget = targetWidget();
|
|
||||||
if (widget && widget->graphicsEffect()) {
|
|
||||||
widget->graphicsEffect()->setProperty("opacity", currentTime / qreal(duration()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Plasma
|
|
|
@ -1,68 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2010 Bruno Abinader <bruno.abinader@indt.org.br>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef PLASMA_ANIMATIONS_WATER_P_H
|
|
||||||
#define PLASMA_ANIMATIONS_WATER_P_H
|
|
||||||
|
|
||||||
#include <plasma/animations/easinganimation_p.h>
|
|
||||||
|
|
||||||
namespace Plasma
|
|
||||||
{
|
|
||||||
|
|
||||||
/*
|
|
||||||
* @class Water plasma/animations/water_p.h
|
|
||||||
* @short Water animation using ripple effect
|
|
||||||
*
|
|
||||||
* Simulates a water animation using ripple effect
|
|
||||||
*/
|
|
||||||
class WaterAnimation : public EasingAnimation
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PROPERTY(qint8 offset READ offset WRITE setOffset)
|
|
||||||
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* Default constructor
|
|
||||||
* @param parent Animation object parent
|
|
||||||
*/
|
|
||||||
explicit WaterAnimation(QObject *parent = 0);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the ripple offset. The ripple offset is the distance between neighbour pixels used to
|
|
||||||
* calculate the wave propagation.
|
|
||||||
* @return ripple offset
|
|
||||||
*/
|
|
||||||
qint8 offset() const;
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
/**
|
|
||||||
* Sets the ripple offset
|
|
||||||
* @param offset ripple offset
|
|
||||||
*/
|
|
||||||
void setOffset(qint8 offset);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
|
|
||||||
void updateEffectiveTime(int currentTime);
|
|
||||||
|
|
||||||
private:
|
|
||||||
qint8 m_offset; /** Ripple offset (default is 1) */
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Plasma
|
|
||||||
|
|
||||||
#endif // PLASMA_ANIMATIONS_WATER_P_H
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include "animations/geometry_p.h"
|
#include "animations/geometry_p.h"
|
||||||
#include "animations/zoom_p.h"
|
#include "animations/zoom_p.h"
|
||||||
#include "animations/pixmaptransition_p.h"
|
#include "animations/pixmaptransition_p.h"
|
||||||
#include "animations/water_p.h"
|
|
||||||
#include "animations/pendulumcurve_p.h"
|
#include "animations/pendulumcurve_p.h"
|
||||||
#include "animations/javascriptanimation_p.h"
|
#include "animations/javascriptanimation_p.h"
|
||||||
#include "theme.h"
|
#include "theme.h"
|
||||||
|
@ -133,13 +132,6 @@ Plasma::Animation* Animator::create(Animator::Animation type, QObject *parent)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WaterAnimation:
|
|
||||||
result = create("WaterAnimation", parent);
|
|
||||||
if (!result) {
|
|
||||||
result = new Plasma::WaterAnimation(parent);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
//kDebug() << "Unsupported animation type.";
|
//kDebug() << "Unsupported animation type.";
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -65,7 +65,6 @@ public:
|
||||||
GeometryAnimation, /*<< Geometry animation*/
|
GeometryAnimation, /*<< Geometry animation*/
|
||||||
ZoomAnimation, /*<<Zoom animation */
|
ZoomAnimation, /*<<Zoom animation */
|
||||||
PixmapTransitionAnimation, /*<< Transition between two pixmaps*/
|
PixmapTransitionAnimation, /*<< Transition between two pixmaps*/
|
||||||
WaterAnimation /*<< Water animation using ripple effect */,
|
|
||||||
LastAnimation = 1024
|
LastAnimation = 1024
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,210 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2010 Bruno Abinader <bruno.abinader@indt.org.br>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
|
||||||
#include <QtGui/QPainter>
|
|
||||||
|
|
||||||
#include "kdebug.h"
|
|
||||||
|
|
||||||
#include "ripple_p.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Allocates an integer matrix with the given size.
|
|
||||||
* @param size Matrix size
|
|
||||||
* @return integer matrix
|
|
||||||
*/
|
|
||||||
int **allocateWaveMap(const QSize &size)
|
|
||||||
{
|
|
||||||
int **waveMap = new int *[size.width()];
|
|
||||||
if (!waveMap) {
|
|
||||||
kDebug() << "could not allocate wave map";
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int x = 0; x < size.width(); ++x) {
|
|
||||||
waveMap[x] = new int[size.height()];
|
|
||||||
if (!waveMap[x]) {
|
|
||||||
kDebug() << "could not allocate wave map";
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return waveMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Deallocates an integer matrix
|
|
||||||
* @param waveMap integer matrix
|
|
||||||
*/
|
|
||||||
void deallocateWaveMap(int **waveMap)
|
|
||||||
{
|
|
||||||
if (waveMap) {
|
|
||||||
delete [] *waveMap;
|
|
||||||
delete [] waveMap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Plasma
|
|
||||||
{
|
|
||||||
|
|
||||||
RippleEffect::RippleEffect(QObject *parent)
|
|
||||||
: QGraphicsEffect(parent),
|
|
||||||
m_offset(1),
|
|
||||||
m_damping(16),
|
|
||||||
m_heigth(1),
|
|
||||||
m_opacity(0.0),
|
|
||||||
m_mapSize(boundingRect().size().toSize()),
|
|
||||||
m_previousMap(0),
|
|
||||||
m_currentMap(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
RippleEffect::~RippleEffect()
|
|
||||||
{
|
|
||||||
deallocateWaveMap(m_previousMap);
|
|
||||||
deallocateWaveMap(m_currentMap);
|
|
||||||
}
|
|
||||||
|
|
||||||
qint8 RippleEffect::offset() const
|
|
||||||
{
|
|
||||||
return m_offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
qint8 RippleEffect::damping() const
|
|
||||||
{
|
|
||||||
return m_damping;
|
|
||||||
}
|
|
||||||
|
|
||||||
qint8 RippleEffect::heigth() const
|
|
||||||
{
|
|
||||||
return m_heigth;
|
|
||||||
}
|
|
||||||
|
|
||||||
qreal RippleEffect::opacity() const
|
|
||||||
{
|
|
||||||
return m_opacity;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RippleEffect::setOffset(qint8 offset)
|
|
||||||
{
|
|
||||||
m_offset = offset;
|
|
||||||
emit offsetChanged(m_offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RippleEffect::setDamping(qint8 damping)
|
|
||||||
{
|
|
||||||
m_damping = damping;
|
|
||||||
emit dampingChanged(m_damping);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RippleEffect::setHeigth(qint8 heigth)
|
|
||||||
{
|
|
||||||
m_heigth = heigth;
|
|
||||||
emit heigthChanged(m_heigth);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RippleEffect::setOpacity(qreal opacity)
|
|
||||||
{
|
|
||||||
m_opacity = opacity;
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void RippleEffect::draw(QPainter *painter)
|
|
||||||
{
|
|
||||||
QPoint offset;
|
|
||||||
const QImage currentImage = sourcePixmap(Qt::LogicalCoordinates, &offset).toImage();
|
|
||||||
QImage modifiedImage = currentImage;
|
|
||||||
if (!m_previousMap && !m_currentMap) {
|
|
||||||
m_previousMap = allocateWaveMap(currentImage.size());
|
|
||||||
m_currentMap = allocateWaveMap(currentImage.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
int x, y;
|
|
||||||
if (qFuzzyCompare(m_opacity, qreal(0.0))) {
|
|
||||||
for (x = 0; x < currentImage.width(); ++x) {
|
|
||||||
memset(m_currentMap[x], 0, sizeof(int) * currentImage.height());
|
|
||||||
memset(m_previousMap[x], 0, sizeof(int) * currentImage.height());
|
|
||||||
}
|
|
||||||
m_mapSize = currentImage.size();
|
|
||||||
int waveLength = m_mapSize.width() > m_mapSize.height() ? m_mapSize.width() : m_mapSize.height();
|
|
||||||
m_currentMap[m_mapSize.width() >> 1][m_mapSize.height() >> 1] = waveLength << m_heigth;
|
|
||||||
} else if (m_mapSize != currentImage.size()) {
|
|
||||||
const qreal scaleFactorX = qreal(currentImage.width()) / qreal(m_mapSize.width());
|
|
||||||
const qreal scaleFactorY = qreal(currentImage.height()) / qreal(m_mapSize.height());
|
|
||||||
int **newPreviousMap = allocateWaveMap(currentImage.size());
|
|
||||||
int **newCurrentMap = allocateWaveMap(currentImage.size());
|
|
||||||
int i, j;
|
|
||||||
for (y = 0; y < currentImage.height(); ++y) {
|
|
||||||
for (x = 0; x < currentImage.width(); ++x) {
|
|
||||||
i = x / scaleFactorX;
|
|
||||||
j = y / scaleFactorY;
|
|
||||||
newPreviousMap[x][y] = m_previousMap[i][j];
|
|
||||||
newCurrentMap[x][y] = m_currentMap[i][j];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
deallocateWaveMap(m_previousMap);
|
|
||||||
deallocateWaveMap(m_currentMap);
|
|
||||||
m_mapSize = currentImage.size();
|
|
||||||
m_previousMap = newPreviousMap;
|
|
||||||
m_currentMap = newCurrentMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
const int width = m_mapSize.width();
|
|
||||||
const int height = m_mapSize.height();
|
|
||||||
int neighbours;
|
|
||||||
int wave;
|
|
||||||
int xOffset, yOffset;
|
|
||||||
for (y = m_offset; y < height - m_offset - 1; ++y) {
|
|
||||||
for (x = m_offset; x < width - m_offset - 1; ++x) {
|
|
||||||
neighbours = m_previousMap[x+m_offset][y] +
|
|
||||||
m_previousMap[x-m_offset][y] +
|
|
||||||
m_previousMap[x][y+m_offset] +
|
|
||||||
m_previousMap[x][y-m_offset];
|
|
||||||
if (!neighbours && !m_currentMap[x][y]) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
wave = (neighbours >> 1) - m_currentMap[x][y];
|
|
||||||
wave -= wave >> m_damping;
|
|
||||||
m_currentMap[x][y] = wave;
|
|
||||||
|
|
||||||
xOffset = x + m_currentMap[x+m_offset][y] - wave;
|
|
||||||
yOffset = y + m_currentMap[x][y+m_offset] - wave;
|
|
||||||
|
|
||||||
modifiedImage.setPixel(x, y, currentImage.pixel(
|
|
||||||
qBound(0, xOffset, width - 1),
|
|
||||||
qBound(0, yOffset, height - 1)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Swap wave maps
|
|
||||||
int **pointer = m_previousMap;
|
|
||||||
m_previousMap = m_currentMap;
|
|
||||||
m_currentMap = pointer;
|
|
||||||
|
|
||||||
// Restart wave if image center has no wave
|
|
||||||
if (m_currentMap[width >> 1][height >> 1] == 0) {
|
|
||||||
int waveLength = width > height ? width : height;
|
|
||||||
m_currentMap[width >> 1][height >> 1] = waveLength << m_heigth;
|
|
||||||
}
|
|
||||||
|
|
||||||
painter->drawImage(offset, currentImage);
|
|
||||||
painter->setOpacity(1 - m_opacity);
|
|
||||||
painter->drawImage(offset, modifiedImage);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Plasma
|
|
|
@ -1,132 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2010 Bruno Abinader <bruno.abinader@indt.org.br>
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef PLASMA_EFFECTS_RIPPLE_P_H
|
|
||||||
#define PLASMA_EFFECTS_RIPPLE_P_H
|
|
||||||
|
|
||||||
#include <QtGui/QGraphicsEffect>
|
|
||||||
|
|
||||||
#include <QObject>
|
|
||||||
#include <QPainter>
|
|
||||||
|
|
||||||
namespace Plasma
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class RippleEffect plasma/private/effects/ripple_p.h
|
|
||||||
* @short Ripple effect.
|
|
||||||
*
|
|
||||||
* Simulates a ripple effect on the source. This class can be used to simulate a "water" animation.
|
|
||||||
*/
|
|
||||||
class RippleEffect : public QGraphicsEffect
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PROPERTY(qint8 offset READ offset WRITE setOffset)
|
|
||||||
Q_PROPERTY(qint8 damping READ damping WRITE setDamping)
|
|
||||||
Q_PROPERTY(qint8 heigth READ heigth WRITE setHeigth)
|
|
||||||
Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity)
|
|
||||||
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* Default constructor
|
|
||||||
*
|
|
||||||
* @param parent Effect object parent.
|
|
||||||
*/
|
|
||||||
RippleEffect(QObject *parent = 0);
|
|
||||||
|
|
||||||
/** Destructor */
|
|
||||||
~RippleEffect();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the ripple offset. The offset is used to calculate the distande between
|
|
||||||
* neighbour pixels.
|
|
||||||
* @return ripple offset
|
|
||||||
*/
|
|
||||||
qint8 offset() const;
|
|
||||||
/** Returns the ripple damping factor. The damping factor is used to reduce the wave height
|
|
||||||
* through each pass.
|
|
||||||
* @return ripple damping factor
|
|
||||||
*/
|
|
||||||
qint8 damping() const;
|
|
||||||
/** Returns the ripple wave heigth factor. The heigth factor is used to enlarge or reduce the
|
|
||||||
* initial wave heigth.
|
|
||||||
* @return ripple wave heigth factor
|
|
||||||
*/
|
|
||||||
qint8 heigth() const;
|
|
||||||
/** Returns the ripple opacity. The opacity is used to reduce the effect opacity when
|
|
||||||
* animating.
|
|
||||||
* @return ripple opacity level
|
|
||||||
*/
|
|
||||||
qreal opacity() const;
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
/**
|
|
||||||
* Set ripple offset (e.g. 1).
|
|
||||||
*/
|
|
||||||
void setOffset(qint8 offset);
|
|
||||||
/**
|
|
||||||
* Set ripple damping factor (e.g. 16).
|
|
||||||
*/
|
|
||||||
void setDamping(qint8 damping);
|
|
||||||
/**
|
|
||||||
* Set ripple wave heigth factor (e.g. 1).
|
|
||||||
*/
|
|
||||||
void setHeigth(qint8 heigth);
|
|
||||||
/**
|
|
||||||
* Set ripple opacity level (e.g. 1.0).
|
|
||||||
*/
|
|
||||||
void setOpacity(qreal opacity);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
/**
|
|
||||||
* Emitted when the ripple offset has changed.
|
|
||||||
* @param offset the ripple offset
|
|
||||||
*/
|
|
||||||
void offsetChanged(qint8 offset);
|
|
||||||
/**
|
|
||||||
* Emitted when the ripple damping factor has changed.
|
|
||||||
* @param damping the ripple damping factor
|
|
||||||
*/
|
|
||||||
void dampingChanged(qint8 damping);
|
|
||||||
/**
|
|
||||||
* Emitted when the ripple wave heigth factor has changed.
|
|
||||||
* @param heigth the ripple wave heigth factor
|
|
||||||
*/
|
|
||||||
void heigthChanged(qint8 heigth);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
/**
|
|
||||||
* Reimplemented from QGraphicsEffect::draw().
|
|
||||||
* @param painter source painter
|
|
||||||
*/
|
|
||||||
void draw(QPainter *painter);
|
|
||||||
|
|
||||||
private:
|
|
||||||
Q_DISABLE_COPY(RippleEffect)
|
|
||||||
|
|
||||||
qint8 m_offset; /** Ripple offset (default is 1) */
|
|
||||||
qint8 m_damping; /** Ripple damping factor (default is 16) */
|
|
||||||
qint8 m_heigth; /** Ripple wave heigth factor (default is 1) */
|
|
||||||
qreal m_opacity; /** Ripple opacity level (default is 0.0) */
|
|
||||||
QSize m_mapSize; /** Ripple matrix wave size */
|
|
||||||
int **m_previousMap; /** Last ripple matrix wave */
|
|
||||||
int **m_currentMap; /** Current ripple matrix wave */
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Plasma
|
|
||||||
|
|
||||||
#endif // PLASMA_EFFECTS_RIPPLE_P_H
|
|
Loading…
Add table
Reference in a new issue