[Libreoffice] [GSoC 2011][svgexport] weekly report #13

Marco mrcekets at gmail.com
Sat Aug 20 14:54:40 PDT 2011

Hi all,
first off I would to thanks my mentor Thorsten for all the help
(and patience) that provided to me. I want also to thanks
Fridrich Strba and Jan Holesovsky for supporting me from the
start, and all the guys of the community that pointed me in
the right direction any time I asked for help.
In any case for me this one  has been a very instructive experience.

Now, it follows my report for the final GSoC week.

== porting/adapting ==
I ported/adapdated the following class from Impress slideshow engine:
For helping in implementing color effects: RGBColor, HSLColor.
Node Animation classes: PropertyAnimationNode, AnimationSetNode,
AnimationColorNode, AnimationTransitionFilterNode.
For animations: GenericAnimation, HSLAnimationWrapper classes and
createPropertyAnimations routine.
Activities: all except DiscreteActivity.

== implemented ==
I also implemented a Timing class for handling the begin/end attributes;
a Duration class for handling valid duration attribute values.
An AnimatedElement class responsible to get/set properties of an
animated shape. Reimplemented a KeyStopLerp class for managing
keytimes that are utilized by the ValuesActivity.
A Priority Queue class used by TimerEventQueue and based on the
std::priority_queue<std::vector> as implemented in the standard
library included in the gcc compiler.
And the last but not the least all the code for parsing animation
elements attributes

== available effects ==
Entrance:    Appear, Fly in, Zoom, Fade in, Fade in and Zoom
Emphasis:    Change Fill Color, Change Line Color, Darken, Desaturate,  
Exit:        Disappear, Fly out, Zoom, Fade out, Fade out and Zoom

Indeed any effect based on the GenericAnimation and on
the SimpleActivity, FromToByActivity and ValuesActivity
classes should works.

I tested them on the following browsers:

on Linux OpenSuse 11.4
Firefox 5,
Opera 11.50,
Google Chrome 13 [1];

on Ubuntu 10.10 [2]
Firefox 3.6.10 [3],
Google Chrome 11;

on Windows 7 [2]
Internet Explorer 9,
Firefox 6,
Google Chrome 13,
Safary 5.0

[1] animations involving movements show trailing pixels
[2] running into a virtual machine
[3] Thorsten report crashes on his own FF 3.6 version.

You can download a sample svg document here:

What's left out:
Slide transitions.
The support for skipping an effect and go back to the previous
effect. (You can always navigate through slides using PgUp,
PgDown, Home, End, and the slides index page.)
Text animations (each text paragraph should be exported inside
a svg:g element in order to make them work).
Activating an animation by clicking on a given shape.

I attached a patch set based on the master branch, as it was on
Monday July 7, that includes all enhancements I implemented until now.

Side note:
== a JavaScript workaround ==
While porting I found out a nice way for simulating class template
in JavaScript. Indeed in general there is no need for that as
in JavaScript there is no type checking at all. Anyway the need for
a parametrized class can arise when the class inherits from one of
its template parameters. So what this workaround is really about is
parametrized inheritance.
Here is the way I ported the template class FromToByActivity that
inherits from its template parameter BaseType:

function FromToByActivityTemplate( BaseType )
     function FromToByActivity( aFrom, aTo, aBy, aAnimation, // ... and so  
on )
         // constructor implementation here
     extend(FromToByActivityTemplate, BaseType)

     FromToByActivity.prototype =
	// FromToByActivity methods;

     return FromToByActivity;

so now if you want to get a FromToByActivity class that inherits from
a given BaseType, such as ContinuousActivityBase, all you have to do
it is just to write the following line of code:
var ContinuosFromToByActivity = FromToByActivityTemplate(  
ContinuousActivityBase );

In case you are interested I can give you some details on how to make
this code more robust.

extend is an helper function for implementing pseudo classical
inheritance btw two "classes", it is independent from this workaround.


Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: svg-export-filter_master_patch-set-05_filters-01-16_libs-core-01-03.tar.gz
Type: application/x-gzip
Size: 150682 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110820/76b5146c/attachment-0001.bin>

More information about the LibreOffice mailing list