Moving on to the second part, I'd like to use this system used to
split the animation plugin in two again:
animations-core and event-animations. The reason? Well, if we want to
add more event animations then
we need to modify the animation plugin directly. Also, the event
handling code and the actual animation
code are too coupled. A lot of plugins have to write their own code to
handle animating from point-a to
point-b. This is a huge waste of code, especially when we could be
re-using animations from the animations
plugin to do that. Here's how it would boil down.
Animations-Core:
Animations core would essentially be the bit that does the animations,
i,e the bit that wraps into paintWindow,
paintOutput, drawWindowTexture, drawWindow, addWindowGeometry etc etc.
It handles the playback of
animations. All the event-handling code would essentially be stripped
out and moved into another plugin
which would make use of animation. Some API's necessary would be:
* The plugin sets the <extender feature="animation_*> flag on all
it's animation-selection options, so that other plugins can select
animations.
* The plugin would have an api, something like functionPointer =
animGetAnimation (s, char *animation); which
would return a function pointer (This would have to be typedef'd)
to the animation requested.
* Every animation function (which plays the animation) would have to
be constructed something like:
void animation (CompObject *object, CompOption *option, int
nOption). The CompOption contains all the options
for the animation determining how it would be played. We need some
kind of interface for retreiving these options,
I would think - through compizconfig would be nice. The CompObject
is there to specify whether to animate a whole
screen's texture, or just a window texture. Perhaps we could just
pass a CompTexture to be more general?
Window-Animations:
Window animations is essentially the event-handler part of the
animations. It wraps into handleEvent, initWindow etc
in order to play the user-specified animation on that event. It uses
the API's made avaliable to it via animations-core,
so a breakdown of how it would work is:
* Set the <extended feature="animation_*"> on relevant options, so
that animation can give it's options to the plugin
* Hook into events, select the animation for the window based on the
match etc, get the function pointer for that animation
and call it with relative options.
This way, we can have other plugins animate windows from A to B via
animations-core just like window-animations does.
--
Sam Spilsbury -- Developer
_______________________________________________
Dev mailing list
[email protected]
http://lists.compiz-fusion.org/mailman/listinfo/dev