kwin: correct metadata type

note that the getter (KWin::AnimationEffect::metaData()) used to return
signed integer while the setter (KWin::AnimationEffect::setMetaData())
takes unsigned integer as argument, i.e. looks like someone messed up
somewhere

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-12-12 09:40:52 +02:00
parent c6b3223495
commit 71ca696077
4 changed files with 8 additions and 6 deletions

View file

@ -38,7 +38,7 @@ AniData::AniData()
waitAtSource = keepAtTarget = false;
}
AniData::AniData(AnimationEffect::Attribute a, int meta, int ms, const FPx2 &to,
AniData::AniData(AnimationEffect::Attribute a, uint meta, int ms, const FPx2 &to,
QEasingCurve curve, int delay, const FPx2 &from, bool waitAtSource, bool keepAtTarget )
{
attribute = a;

View file

@ -30,7 +30,7 @@ namespace KWin {
class AniData {
public:
AniData();
AniData(AnimationEffect::Attribute a, int meta, int ms, const FPx2 &to,
AniData(AnimationEffect::Attribute a, uint meta, int ms, const FPx2 &to,
QEasingCurve curve, int delay, const FPx2 &from, bool waitAtSource, bool keepAtTarget = false);
AniData(const AniData &other);
inline void addTime(int t) { time += t; }

View file

@ -634,7 +634,7 @@ float AnimationEffect::progress( const AniData &a ) const
return 1.0; // we're done and "waiting" at the target value
}
int AnimationEffect::metaData( MetaType type, uint meta )
uint AnimationEffect::metaData( MetaType type, uint meta )
{
switch (type) {
case SourceAnchor:

View file

@ -103,8 +103,10 @@ public:
Position, Size, Translation, Clip, Generic, CrossFadePrevious,
NonFloatBase = Position
};
enum MetaType { SourceAnchor, TargetAnchor,
RelativeSourceX, RelativeSourceY, RelativeTargetX, RelativeTargetY, Axis };
enum MetaType {
SourceAnchor = 0, TargetAnchor,
RelativeSourceX, RelativeSourceY, RelativeTargetX, RelativeTargetY, Axis
};
/**
* Whenever you intend to connect to the EffectsHandler::windowClosed() signal, do so when reimplementing the constructor.
* Do *not* add private slots named _windowClosed( EffectWindow* w ) or _windowDeleted( EffectWindow* w ) !!
@ -120,7 +122,7 @@ public:
* The first 24 bits are reserved for the AnimationEffect class - you can use the last 8 bits for custom hints.
* In case you transform a Generic attribute, all 32 bits are yours and you can use them as you want and read them in your genericAnimation() implementation.
*/
static int metaData(MetaType type, uint meta );
static uint metaData(MetaType type, uint meta );
static void setMetaData(MetaType type, uint value, uint &meta );
/**