<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Very interesting -- I'll read more about the pygtk codegen stuff.
Thanks for the pointers! <br>
<br>
I tried to make my own project by copying the pycairo directory and
using it as a template, but that has hand-written Python interfaces
instead of using pygtk codegen, and the gnu automake configuration
stuff is being difficult and making my brain hurt. <br>
<br>
I took a look at the hippo canvas stuff, and it looks very nifty, and I
think that might be a good way to integrate the Poppler PDF library
with Cairo. <br>
<br>
I think I could just make a canvas object like the hippo image object,
that reads from PDF files instead, and calls Poppler to render into the
Cairo context. <br>
Maybe I could just add it to the hippo project without making my own
project, and use the canvas image object as an example of how to wrap
the interface. <br>
Hippo canvas uses the pygtk codegen to generate the interfaces, so
that's a point in its favor. <br>
<br>
Is the hippo canvas code set up to be extend with separate projects, or
is it easiest to just add new canvas components to the hippo project
itself? <br>
I guess it would be easier for me to just add some new stuff to an
existing project, that way I could avoid messing with the configuration
stuff. <br>
<br>
So is Hippo the cat's meow, and does Poppler taste like chicken? (Sorry
to mix animal metaphores...)<br>
<br>
Thanks for the help! <br>
<br>
-Don<br>
<br>
<br>
<br>
Marco Pesenti Gritti wrote:
<blockquote cite="mid1173088670.2954.16.camel@localhost.localdomain"
type="cite">
<pre wrap="">On Sun, 2007-03-04 at 17:10 -0800, Don Hopkins wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Can somebody please tell me where I can find some documentation on the
.defs files used by pygtk, pangocairo, etc?
It look like that is an alternative to SWIG for integrating C code with
Python. Is it preferred? Does it work with other languages?
Will it save memory or work better to use that ".defs" file based
interface generator instead of SWIG?
</pre>
</blockquote>
<pre wrap=""><!---->
There is no good documentation that I know about. I think there is some
outdated article you can find about in the Documentation section of
<a class="moz-txt-link-abbreviated" href="http://www.pygtk.org">www.pygtk.org</a>.
You can generate .defs from headers using pygtk/codegen/h2def.py. You
can also have a look to the auto* machinery we are using in
sugar/lib/python.
I don't know much about swig but I think pygtk codegen is definitely
preferred when you are wrapping gobjects.
</pre>
<blockquote type="cite">
<pre wrap="">I'm trying to figure out how best to integrate poppler into Python, and
pass a Cairo context into it (which was wrapped by pycairo), so it can
go to town drawing PDF through Cairo.
</pre>
</blockquote>
<pre wrap=""><!---->
I'd definitely use pygtk codegen for poppler.
</pre>
<blockquote type="cite">
<pre wrap="">And it seems that one way to do that might be to add it into pygtk's
cairo/pango interface, or into pycairo, but I don't know the politics
involved in that, or if it's easier to make a separate project for poppler.
Any suggestions please? Thanks a lot!
</pre>
</blockquote>
<pre wrap=""><!---->
What about just creating a project with python bindings for poppler? The
poppler glib API has already a way to draw to a cairo context, just
wrapping this should be enough.
See this on how to use the cairo_t type with pygtk codegen:
<a class="moz-txt-link-freetext" href="http://svn.mugshot.org/dumbhippo/trunk/client/canvas/python/">http://svn.mugshot.org/dumbhippo/trunk/client/canvas/python/</a>
(arg-types.py in particular)
Marco
</pre>
</blockquote>
<br>
</body>
</html>