Qt Kinetic + Plasma Call For Ideas / Project Plan

Aaron J. Seigo aseigo at kde.org
Fri May 29 18:03:01 CEST 2009


On Friday 29 May 2009, Ivan Čukić wrote:
> > in which case an API like this:
> >
> > Animation a(item);
> > a.add(animator.fadeIn());
> > Animation b;
> > b.setParallel(true);
> > b.add(animator.blur(0.8));
> > b.add(animator.bounce(4));
> > a.add(b);
> > a.addPause(10); // a.add(animator.pause(10));?
> > a.add(animator.fadeOut());
> > a.run(250); // builds the qt animation objects and runs it all
>
> This starts to look like something. But I would propose an addition.
> 1 - that add returns a reference to the Animation object so that the
> following is possible:
>      b.add(animator.blur(...))
>        .add(animator.bounce(...))
> or with << operator (like QList...)
>      b << animator.blur(...)
>         << animator.bounce(...)

remember that we don't operator overloading like we do in C++ in JavaScript 
(though we do have some crazy ass things in JavScript that we don't have in 
C++ too :)

returning a reference looks good though.

> 2 - to have static 'constructors' Animation::series(item) and
> Animation::parallel(item), or, even better, just to have the
> Animation::Type enum (Parallel, Serial) passed to the constructor
>      Animation a(item, Animation::Parallel)

yes, we can definitely do ctors like that as well.

> With the solution above, we could have it /both ways/ the way that is
> clearer to you (Aaron) and the way it is clearer for me while having no
> additional API.

yes, and it definitely helps reduce the complexity of the implementation.

-- 
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/20090529/cb61d6a8/attachment.sig 


More information about the Plasma-devel mailing list