Re: cairo + librsvg = svg viewer

View: New views
5 Messages — Rating Filter:   Alert me  

Re: cairo + librsvg = svg viewer

by Flippinho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,

I am trying to do the same thing like you (display svg in Delphi-programs using cairo for rendering and librsvg for svg-parsing)and I have
exactly the same problem like you.

I was using the h2pas tool from Lazarus
http://wiki.lazarus.freepascal.org/Creating_bindings_for_C_libraries
to do a header conversion of the librsvg.dll-headers I found on the gnome homepage. Unfortunatly I got stuck because in those header-files there are dependencies which point out of the scope covered by the header-files.
I was suspecting I had the wrong header files because afaik header-files for dynamic libs should not have outside dependencies except for maybe very basic libaries.
May be you have advanced a little bit in the problem of converting the librsvg header-files or have found other solutions to display svg in Delphi.

I would be happy to hear from you,

Greets, Philipp

--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo

Re: cairo + librsvg = svg viewer

by Arjen Nienhuis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> May be you have advanced a little bit in the problem of converting the librsvg header-files or have found other solutions to display svg in Delphi.

Doe something like this work?

type SVGHandle = Pointer;

function rsvg_handle_new_from_file(path: PChar; error: Pointer):
SVGHandle; stdcall; external 'librsvg-2-2.dll';
function rsvg_handle_render_cairo(handle: SVGHandle; ctx: Pointer):
BOOL; stdcall; external 'librsvg-2-2.dll';
_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo

Re: cairo + librsvg = svg viewer

by Luiz Americo Pereira Camara :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

philipp koehler escreveu:

> Hello,
>
> I am trying to do the same thing like you (display svg in Delphi-programs using cairo for rendering and librsvg for svg-parsing)and I have
> exactly the same problem like you.
>
> I was using the h2pas tool from Lazarus
> http://wiki.lazarus.freepascal.org/Creating_bindings_for_C_libraries
> to do a header conversion of the librsvg.dll-headers I found on the gnome homepage. Unfortunatly I got stuck because in those header-files there are dependencies which point out of the scope covered by the header-files.
> I was suspecting I had the wrong header files because afaik header-files for dynamic libs should not have outside dependencies except for maybe very basic libaries.
> May be you have advanced a little bit in the problem of converting the librsvg header-files or have found other solutions to display svg in Delphi.
>  

I did that with fpc/Lazarus almost a year ago.

Take a look at
http://code.google.com/p/luipack/source/browse/trunk/cairo/rsvg/rsvg.pas 
. You can adapt for Delphi

Luiz

_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo

Re: cairo + librsvg = svg viewer

by Flippinho :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,

thank you guys for your answers.
Luiz, your code-conversion for rsvg is exactly what I was looking for.
Now I can include the rsvg library and compile under lazarus. Unfortunately I can not get the function "rsvg_handle_new_from_file" to work properly.
In an code example based on code of your "RsvgClasses.pas" unit, the function "rsvg_handle_new_from_file" always returns NULL. I did not find a way to interpret the error codes neither.
Maybe someone has an idea what could be the problem and how to solve it.

thanks to all of you,
best regards, Philipp

-------- Original-Nachricht --------
> Datum: Wed, 28 Oct 2009 13:19:34 -0300
> Von: Luiz Americo Pereira Camara <luizmed@...>
> An:
> CC: "cairographics.org" <cairo@...>
> Betreff: Re: [cairo] cairo + librsvg = svg viewer

> philipp koehler escreveu:
> > Hello,
> >
> > I am trying to do the same thing like you (display svg in
> Delphi-programs using cairo for rendering and librsvg for svg-parsing)and I have
> > exactly the same problem like you.
> >
> > I was using the h2pas tool from Lazarus
> > http://wiki.lazarus.freepascal.org/Creating_bindings_for_C_libraries
> > to do a header conversion of the librsvg.dll-headers I found on the
> gnome homepage. Unfortunatly I got stuck because in those header-files there
> are dependencies which point out of the scope covered by the header-files.
> > I was suspecting I had the wrong header files because afaik header-files
> for dynamic libs should not have outside dependencies except for maybe
> very basic libaries.
> > May be you have advanced a little bit in the problem of converting the
> librsvg header-files or have found other solutions to display svg in Delphi.
> >  
>
> I did that with fpc/Lazarus almost a year ago.
>
> Take a look at
> http://code.google.com/p/luipack/source/browse/trunk/cairo/rsvg/rsvg.pas 
> . You can adapt for Delphi
>
> Luiz
>
> _______________________________________________
> cairo mailing list
> cairo@...
> http://lists.cairographics.org/mailman/listinfo/cairo

--
DSL-Preisknaller: DSL Komplettpakete von GMX schon für
16,99 Euro mtl.!* Hier klicken: http://portal.gmx.net/de/go/dsl02
_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo

Re: cairo + librsvg = svg viewer

by Luiz Americo Pereira Camara :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

philipp koehler escreveu:
> Hello,
>
> thank you guys for your answers.
> Luiz, your code-conversion for rsvg is exactly what I was looking for.
> Now I can include the rsvg library and compile under lazarus. Unfortunately I can not get the function "rsvg_handle_new_from_file" to work properly.
>  

Are you working under Windows?

> In an code example based on code of your "RsvgClasses.pas" unit, the function "rsvg_handle_new_from_file" always returns NULL. I did not find a way to interpret the error codes neither.
> Maybe someone has an idea what could be the problem and how to solve it.

If you are using Lazarus you can try the svgviewer demo found in demos
directory. It needs the cairolcl and rsvg packages found in
luipack/cairo dir. I just fixed it now and is working under Windows
although some images are not show.

Luiz
_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo