Subject: Re: javascript animations

2010-04-29 Thread Adenilson Cavalcanti
plasma-devel@kde.org
Subject: Re: javascript animations

Aaron


we now have themable animation support in libplasma. one of the things we've
been dreaming of since the original Animator class was born has come true

Glad to know that I helped to make dreams come true (plus it provides
a heck of ego boost!).
:-)

Attending tokamak and being able to discuss the subject with you,
Marco and Richard was essential to get this rolling.


* a desktop theme can include one or more JS scripts in the animations/
subdirectory. each file can contain multiple animation definitions, each of
which must be registered by calling registerAnimation(String name, Function
func) in the script

Sweet! I was expecting that AnimationEngine::loadScript() would
require some further love to get this done. Nice surprise.


* scripted animation registration is first come, first serve so until the
theme is changed, animations can not overwrite each other. this should keep
things a sane (e.g. fallback themes won't overwrite existing anim defs)

I was wondering if a namespace approach could extend this in the
future?

The advantage of this FIFO approach is that we ensure that the users
can't mix animations of different themes, thus guarantees consistency.



what is left to do:
*do an audit of the js API for animations to make sure it does everything we
need/want, such as animation groups

This is working fine, at least in my tests in the playground.

Some other missing bits that I recall from the top of my head:

- export the easing curves to the js engine, since without this all
the js animation logic would be linear.

- allow more initialization parameters while creating the jsanim 
object/function/instance/whatever

- support calling a 'resetAnimation' method in the jsanim when the
animation is over to reset the target widget status properties accordingly 
(required if we want to port the PulseAnimation to js)


Do you have anything in mind for using QML in themes? As QML can also define
animations, I was wondering how it would conflict/help with the JS Animations 
?

Morpheuz, not sure about this (maybe wait for QML to mature a little
more?).

I can imagine that we could provide an Animator::create() factory that
would generate an animation object based in a QML file along the lines of
what exists for js?

I'm just not sure if we could share the script engine (i.e. execution
context) between them.


Best regards


Adenilson
a.k.a. Savago
INdT - Instituto Nokia de Tecnologia



  
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: javascript animations

2010-04-29 Thread Aaron J. Seigo
On April 28, 2010, Aaron J. Seigo wrote:
 here is how it currently works in trunk:

i've started to document this here:

http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/Animations

it's very much a work in progress.

i've also put a blurb on the themes page about js animations that points to 
the above tutorial as well.

-- 
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 Development Frameworks
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


javascript animations

2010-04-28 Thread Aaron J. Seigo
hi ...

we now have themable animation support in libplasma. one of the things we've 
been dreaming of since the original Animator class was born has come true, 
though there have been a few twists and turns to get here such as Qt Kinetic 
appearing and using Javascript for the theming.

here is how it currently works in trunk:

* a desktop theme can include one or more JS scripts in the animations/ 
subdirectory. each file can contain multiple animation definitions, each of 
which must be registered by calling registerAnimation(String name, Function 
func) in the script

* in the theme's metadata.desktop file there is a new section supported: 
[Animations]. this group must contain mappings between the script name and the 
aimations it contains, e.g.:

[Animations]
stockanims.js=ZoomAnimation,PulseAnimation,RotationAnimation

* fallback themes (aka theme inheritance) is supported for this

* scripted animation registration is first come, first serve so until the 
theme is changed, animations can not overwrite each other. this should keep 
things a sane (e.g. fallback themes won't overwrite existing anim defs)

* Animator::create(const QString animationName, QObject *parent = 0) will 
attempt to create an appropriate JavascriptAnimation, which is just another 
QAbastractAnimation ... well, a Plasma::EasingAnimation. same thing ;)

* Coronas can now map stock animations to each other (e.g. make 
DisappearAnimation mean ZoomAnimation) as well map stock animations to js 
animations. this means that the appear/disappear of Applets in a Containment 
are now back to using the correct semantic animations: Appear and Disappear. 
it is up to the Corona subclass to take care of mapping those.


what is left to do:

* allow javascript plasmoids to create and call their own animations from 
files in the PlasmoidPackage

* allow Coronas to load their own javascript script files (this will bring 
back the applet creation animation in plasma-desktop)

*do an audit of the js API for animations to make sure it does everything we 
need/want, such as animation groups

* put js versions of the stock anims in the Air theme to make sure it all 
works as expected :)


your feedback is wanted since once 4.5 is out, we'll be stuck with the 
above.

-- 
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 Development Frameworks
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: javascript animations

2010-04-28 Thread Artur Souza (MoRpHeUz)
Hi Aaron!

On Wednesday 28 April 2010, 15:14 Aaron J. Seigo wrote:
 we now have themable animation support in libplasma. one of the things
 we've been dreaming of since the original Animator class was born has come
 true, though there have been a few twists and turns to get here such as Qt
 Kinetic appearing and using Javascript for the theming.

That's great! :) I'll provide just a little bit of (not so useful) feedback 
because I'm running out of time for some tasks here, sorry for not being able 
to give a proper one :(.

 * a desktop theme can include one or more JS scripts in the animations/
 subdirectory. each file can contain multiple animation definitions, each of
 which must be registered by calling registerAnimation(String name, Function
 func) in the script

This seems a lot the way how you export QObjects to QML for example, so maybe 
this is a sign that it's a good approach (or that crazy people just took the 
same approach by accident :P).

 * fallback themes (aka theme inheritance) is supported for this

Great!

 * scripted animation registration is first come, first serve so until the
 theme is changed, animations can not overwrite each other. this should keep
 things a sane (e.g. fallback themes won't overwrite existing anim defs)

Makes sense

 your feedback is wanted since once 4.5 is out, we'll be stuck with the
 above.

Do you have anything in mind for using QML in themes? As QML can also define 
animations, I was wondering how it would conflict/help with the JS Animations ?

Cheers!

--
Artur Duque de Souza
openBossa
INdT - Instituto Nokia de Tecnologia
--
Blog: http://blog.morpheuz.cc
PGP: 0xDBEEAAC3 @ wwwkeys.pgp.net
--


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel