Building a GUI with SVG files is a bad idea unless we are talking about
something really minimalistic.

The main issue here is that librsvg is really slow rendering them. Take a
look at Cairo for the heavylifting.

On Thu, May 12, 2011 at 9:27 AM, Veli Ogla Sungutay
<[email protected]>wrote:

> Hi guys,
>
> I've been experimenting with building SVG GUIs for a while now.
> Some tips you may find useful:
>
> 1. Inkscape can be called from command line with -S switch to give us
> id,x,y,width,height information for each element. These could be
> used to initialize  ClutterCairoTexture actors.
>
> 2. We rely on librsvg's rsvg_handle_render_cairo_sub. You may also use
> cairo itself to reposition each actor:
>
> ClutterActor* actor =
> clutter_cairo_texture_new(svgElement->width,svgElement->height);
> cairoHandle = clutter_cairo_texture_create(CLUTTER_CAIRO_TEXTURE(actor));
> cairo_translate(cairoHandle, -svgElement->x, -svgElement->y);
>
> rsvg_handle_render_cairo_sub(svgHandle, cairoHandle, "#elemID");
> cairo_destroy(cairoHandle);
>
> clutter_actor_set_position(actor,svgElement->x - xParent,svgElement->y -
> yParent)
>
> //Only opaque areas will react to mouse events. Useful for non rectangular
> shapes.
> clutter_texture_set_pick_with_alpha(CLUTTER_TEXTURE(actor), TRUE);
>
> You can let me know how it goes. I'm hoping to share my entire code some
> time in the summer.
>
>
>
>
>
> On Wed, May 11, 2011 at 1:10 PM, Damien Lespiau 
> <[email protected]>wrote:
>
>> On Wed, 2011-05-11 at 06:00 +0100, Alexandre Quessy wrote:
>> > Hello,
>> > I would like to build a GUI with SVG files in Clutter.
>> >
>> > To do so, should I use dax?
>> > http://git.clutter-project.org/dax/tree/
>>
>> Oh, no, not a good idea. Dax is an unfinished science project that goes
>> boom when people try to use it.
>>
>> > If so, is it packaged for Debian?
>>
>> Dax is highly unfinished, does not even compile because it relies on
>> Clutter branches that I never ended pushing to master (because of them
>> being unfinished too). Thus, not ready yet to get in Debian :p
>>
>> > Otherwise, does mx provide this?
>>
>> The best way (best as in, working) to do this right now is to use
>> librsvg + ClutterCairoTexture. That does mean that a few things are not
>> ideal when thinking "SVG as Scalable graphics" (ie when you scale a SVG
>> subtree you may want to re-render it and upload it again to the GPU (but
>> when animating maybe not?)
>>
>> Interesting stuff to look at:
>>
>> * Lasem. another SVG (amd MathML) renderer
>> http://git.gnome.org/browse/lasem
>> It's been a while since I have looked at it,
>> * http://jyro.blogspot.com/2008/09/inkface-svg-based-gui-design.html
>>
>> HTH,
>>
>> --
>> Damien
>>
>> ---------------------------------------------------------------------
>> Intel Corporation (UK) Limited
>> Registered No. 1134945 (England)
>> Registered Office: Pipers Way, Swindon SN3 1RJ
>> VAT No: 860 2173 47
>>
>> This e-mail and any attachments may contain confidential material for
>> the sole use of the intended recipient(s). Any review or distribution
>> by others is strictly prohibited. If you are not the intended
>> recipient, please contact the sender and delete all copies.
>> _______________________________________________
>> clutter-app-devel-list mailing list
>> [email protected]
>> http://lists.clutter-project.org/listinfo/clutter-app-devel-list
>>
>
>
>
> --
> Veli Sungutay
> http://www.lyciasoft.com
>
> _______________________________________________
> clutter-app-devel-list mailing list
> [email protected]
> http://lists.clutter-project.org/listinfo/clutter-app-devel-list
>
>
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to