A set of animations is provided in the Plasma library which build on top of the Qt Kinetic animation system. Qt Kinetic is really a fairly "low-level" set of classes for defining animation timelines and having them push and pull various values around on a curve. To avoid a lot of duplication of implementation for things like "an animation that fades an item on the canvas out" as well as to provide some more semantics based options such as "make something appear", libplasma provides a way to access such animations as well as some additional curves via the Animator class. In previous releases, prior to Qt Kinetic, Animator was the animation engine. Now it's essentially a factory for animations.
When I first decided, pre-KDE SC 4.0, that libplasma should provide a way to animate things one of the things I wanted to do was to allow different Plasma applications, plugins and themes to either add new animations or define and alter existing ones. Zack may even remember that conversation from my living room a few years back. :)
We ended up delaying work on that when we found out that Qt Kinetic was in development. Now that we have both Qt Kinetic and good support for it in libplasma, we could move on to realizing that part of the vision.
At Tokamak 4, we decided to try out the concept of driving animations with Javascript. Why? Well, here were our use cases that we needed to fulfill:
- Desktop themes may want different animations; for instance, one theme may wish for a Plasmoid to spin and grow when it appears instead of grow and pulse.
- Different Plasma Workspace shells may have different needs: Plasma Desktop may want something more eye catchy and can afford to spend more CPU cycles, while Plasma Mobile may not.
- A scripted Plasmoid may wish to provide additional animations for its own use and distribute them as part of the package.
To avoid coming up with three different solutions or tying the platform-neutral themes and scripted Plasmoids to C++ plugins, Javascript via QtScript seemed like a good option to explore. After an afternoon design session at Tokamak 4 between myself, Marco, Adenilson and Igor, Adenilson started in on an implementation. I helped out with some of the scripting approach and integration with libplasma while Adenilson kept an eye on performance issues, as he documented on his blog here and here. Our biggest concern was: would it be performant enough, would the overhead be low enough? Turns out that it was, and we now have a solution that covers all our cases elegantly.
In KDE SC 4.5, both Plasma applications as well as desktop themes can define animations using Javascript. With a bit more internal work in libplasma, Plasmoids will also be able to do the same. This is a really interesting alternative to lightweight plugins that extend core functionality in an platform-independent way. To date, we've been using QtScript mostly for adding features on top of Plasma applications, but now we're harnessing it to provide feature sets within libplasma itself.
We've gotten into a bit of rut over the last few months here, though it's the good kind of rut: we've been going on hikes most weekends, exploring the outdoors. The southwest coast of Canada is just perfect for it: mountains, oceans, forests and relatively temperate weather. I bought some new hiking boots last week in recognition that we were going out more often and onto more difficult terrain. While the shoes I had had done me well in past hikes, it was time to move on up. This weekend we went out to the Sigurd Creek trail to break them in.
Our group of eight trudged upwards, taking a short detour and subsequent snack break to enjoy Crooked Falls. We
As we neared our destination, patches of snow started appearing between the trees. The last several hundred meters of the hike were mostly over these last snows of winter, with the peak itself glazed in a white cap. By the time we sat down for lunch, I had glimpsed the general shape of my Akademy presentation. It would be a series of short topical explorations linked together in the style of 
