Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwinanimationeffect.cpp
Show First 20 Lines • Show All 350 Lines • ▼ Show 20 Line(s) | 327 | for (auto entryIt = d->m_animations.begin(); entryIt != d->m_animations.end(); ++entryIt) { | |||
---|---|---|---|---|---|
351 | animIt->terminationPolicy = terminationPolicy; | 351 | animIt->terminationPolicy = terminationPolicy; | ||
352 | 352 | | |||
353 | return true; | 353 | return true; | ||
354 | } | 354 | } | ||
355 | 355 | | |||
356 | return false; | 356 | return false; | ||
357 | } | 357 | } | ||
358 | 358 | | |||
359 | bool AnimationEffect::complete(quint64 animationId) | ||||
360 | { | ||||
361 | Q_D(AnimationEffect); | ||||
362 | | ||||
363 | if (animationId == d->m_justEndedAnimation) { | ||||
364 | return false; | ||||
365 | } | ||||
366 | | ||||
367 | for (auto entryIt = d->m_animations.begin(); entryIt != d->m_animations.end(); ++entryIt) { | ||||
368 | auto animIt = std::find_if(entryIt->first.begin(), entryIt->first.end(), | ||||
369 | [animationId] (AniData &anim) { | ||||
370 | return anim.id == animationId; | ||||
371 | } | ||||
372 | ); | ||||
373 | if (animIt == entryIt->first.end()) { | ||||
374 | continue; | ||||
375 | } | ||||
376 | | ||||
377 | animIt->timeLine.setElapsed(animIt->timeLine.duration()); | ||||
378 | | ||||
379 | return true; | ||||
380 | } | ||||
381 | | ||||
382 | return false; | ||||
383 | } | ||||
384 | | ||||
359 | bool AnimationEffect::cancel(quint64 animationId) | 385 | bool AnimationEffect::cancel(quint64 animationId) | ||
360 | { | 386 | { | ||
361 | Q_D(AnimationEffect); | 387 | Q_D(AnimationEffect); | ||
362 | if (animationId == d->m_justEndedAnimation) | 388 | if (animationId == d->m_justEndedAnimation) | ||
363 | return true; // this is just ending, do not try to cancel it but fake success | 389 | return true; // this is just ending, do not try to cancel it but fake success | ||
364 | for (AniMap::iterator entry = d->m_animations.begin(), mapEnd = d->m_animations.end(); entry != mapEnd; ++entry) { | 390 | for (AniMap::iterator entry = d->m_animations.begin(), mapEnd = d->m_animations.end(); entry != mapEnd; ++entry) { | ||
365 | for (QList<AniData>::iterator anim = entry->first.begin(), animEnd = entry->first.end(); anim != animEnd; ++anim) { | 391 | for (QList<AniData>::iterator anim = entry->first.begin(), animEnd = entry->first.end(); anim != animEnd; ++anim) { | ||
366 | if (anim->id == animationId) { | 392 | if (anim->id == animationId) { | ||
▲ Show 20 Lines • Show All 663 Lines • Show Last 20 Lines |