SVG input for wxWindows, wxcanvas?

0 views
Skip to first unread message

barbapapa

unread,
Dec 22, 2001, 7:22:01 AM12/22/01
to wx-users
Hi All,
I'm looking for a way to replace many of the bitmaps in my programs with
vector
graphics, and I'm flirting with the idea of SVG graphics.
I found the following wxWindows-related SVG projects:
---------------------------------------------------------------------------------------------
wxCanvas: very flexible canvas class with SVG import/export
http://www.xs4all.nl/~kholwerd/wxstuff/canvas/
by klaas holwerda

wxSVGFileDC: device context onto which graphics and text can be drawn ,
SVG output
http://biolpc22.york.ac.uk/wx/wxSVGFileDC/index.html
by chris elliott
---------------------------------------------------------------------------------------------
wxSVGFileDC seems to be output-only (concerning svg files) but I also
need input
wxCanvas seems somehow to be included in the wxGTK 2.3.2 contrib, but I
couldn't
find any evidence of SVG input on that one.
And the version on http://www.xs4all.nl/~kholwerd/wxstuff/canvas/
seems to have expat-based SVG input, but I have problems building it:
(just a few selected make error messages, the list is long)
../../../contrib/include/wx/canvas/xmlpars.h:16:28: expat/xmlparse.h: No
such file or directory
../../../contrib/include/wx/canvas/xmlpars.h:118: 'XML_Parser' is used as a
type, but is not defined as a type.

So the questions are:
1) has the wxcanvas from the contrib any svg load support?
2) what's the difference between the two wxcanvas ?
3) How do I get the wxCanvas with svg support to build?
4) how do I get an SVG input for wxWindows?

Robert Roebling

unread,
Dec 22, 2001, 12:55:02 PM12/22/01
to wx-u...@lists.wxwindows.org
barbapapa schrieb:

> wxCanvas: very flexible canvas class with SVG
> import/export
> http://www.xs4all.nl/~kholwerd/wxstuff/canvas/
> by klaas holwerda

Right.

> wxCanvas seems somehow to be included in the wxGTK 2.3.2
> contrib, but I couldn't find any evidence of SVG input

The one in CVS and in the wxGTK 2.3.2 snapshot is very
old. I have written the original version which Klaas
extended enormously and I just had no time to put it
back in CVS.

> seems to have expat-based SVG input, but I have problems
> building it:

The current build system has problems with third-party
code used in contirb code, but the wxCanvas code probably
can be built in some way :-) From your error message
I conclude that your system doesn't find the expat
headers and files.

Robert

--
Robert Roebling, MD <rob...@roebling.de>

Michael Chansky

unread,
Dec 22, 2001, 1:21:02 PM12/22/01
to wx-u...@lists.wxwindows.org
I don't have any experience with wxCanvas, but I found your expat errors a
little odd

> ../../../contrib/include/wx/canvas/xmlpars.h:16:28: expat/xmlparse.h: No
> such file or directory
> ../../../contrib/include/wx/canvas/xmlpars.h:118: 'XML_Parser' is used as
a
> type, but is not defined as a type.

The expat distribution doesn't have a file called xmlparse.h
I don't know how expat has been merged into wxCanvas, but if
it's not very tight (and I don't see why it should be), you might
consider downloading expat, compiling the library and then linking it in.

-Michael Chansky


Ken Edwards

unread,
Dec 24, 2001, 2:55:02 AM12/24/01
to wx-u...@lists.wxwindows.org
On Sat, 2001-12-22 at 13:20, barbapapa wrote:

> And the version on http://www.xs4all.nl/~kholwerd/wxstuff/canvas/
> seems to have expat-based SVG input, but I have problems building it:
> (just a few selected make error messages, the list is long)
> ../../../contrib/include/wx/canvas/xmlpars.h:16:28: expat/xmlparse.h: No
> such file or directory
> ../../../contrib/include/wx/canvas/xmlpars.h:118: 'XML_Parser' is used as a
> type, but is not defined as a type.
>
> So the questions are:
> 1) has the wxcanvas from the contrib any svg load support?

No.

> 2) what's the difference between the two wxcanvas ?

There is little simularity other than the name canvas. Klass forked the
canvas at least a year ago and has made immense progress since then.
Unfortunately, none of his changes have made it back to the CVS.

> 3) How do I get the wxCanvas with svg support to build?

Included in the tarball you downloaded is a toplevel directory called
third. In this directory you will find a copy of expat with xmlparse.h,
I believe this is a copy of the expat in the CVS src/xrc/expat
directory. In any case, you need to read the file in that directory
called readme.

> 4) how do I get an SVG input for wxWindows?

I have not tried SVG input to the Klass-canvas, but the SVG output works
fine and can be imported by other programs. All of the functions to
load the SVG seem to be in the library, so I imagine it will also work.


Ken Edwards

unread,
Dec 24, 2001, 3:18:02 AM12/24/01
to wx-u...@lists.wxwindows.org
On Mon, 2001-12-24 at 08:53, Ken Edwards wrote:
> On Sat, 2001-12-22 at 13:20, barbapapa wrote:

>
> > 2) what's the difference between the two wxcanvas ?
>
> There is little simularity other than the name canvas. Klass forked the
> canvas at least a year ago and has made immense progress since then.
> Unfortunately, none of his changes have made it back to the CVS.

My sincere apologies to Klass for mangling his name.

And my thanks to him for the immense amount of work he has put into the
canvas.


Reply all
Reply to author
Forward
0 new messages