Qt Kinetic + Plasma Call For Ideas / Project Plan

Aaron J. Seigo aseigo at kde.org
Thu May 28 20:38:50 CEST 2009


On Thursday 28 May 2009, Alexis Ménard wrote:
> > doseries(fadein, doparallel(bounce, blur), fadeout)
>
> That is what QSequentialAnimationGroup is doing...

the question is how to expose this in the API.

there are two use cases here .. there's "fire and forget" and "define and run 
later".

in the "fire and forget" use case, an applet should be able to say in one line 
of code, something like:

Animator::move(item, toPoint);

we shouldn't make widget writers do anything more than that to use the 
standard animations.

in the other use case, we could use QAG perhaps by doing something like:

QAnimationGroup g;
g.addAnimation(Animator::bounce(item, timesToBounce));
g.addAnimation(Animator::blur(item, amount));

QSequentialAnimation s;
s.addAnimation(Animator::fadeIn(item));
s.addAnimation(g);
s.addAnimation(Animator::fadeOut(item));

but i wonder if we can't make it a bit easier (and less API to import into the 
JavaScript engine?) ...

Animation *a = Animator::fadeIn(item);
Animation *b = Animator::add(a, Animator::bounce(item, timesToBounce));
a = Animator::while(b, Animator::blur(item, amount));
Animator::add(a, Animator::fadeOut(item));
// auto starts when event loop is hit again, unless a->stop() is called

or. .. hm..

Animation *a = Animator::fadeIn(item);
Animator::bounce(item, timeToBounce, a, Animator::Add);
Animator::blur(item, amount, a, Animator::While);
Animator::fadeOut(item, a, Animator::Add);

if Animation was a QAnimationGroup (or QAbstractAnimation?) subclass with the 
auto-start-when-event-loop-enters magic, we could do all the grouping for the 
user, and they could still use Animator objects with Kinetic directly.

meanwhile the user gets something simpler to dive into with at the start and 
we'd only need to tell our JavaScript runtime about Animator, not the rest of 
Kinetic.

is it worth the added code and work?

the caveats are:

* probably still wouldn't cover every possible use case that using 
QAnimationGroup could?

* means two phase learning curve (Animator's shortcut, then Kinetic) if you 
need to "graduate" from Add/While in Plasa::Animator to Kinetic's groups

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090528/b7bf090a/attachment.sig 


More information about the Plasma-devel mailing list