Re: [pygtk] adding wrappers for gtkhtml2

2001-11-28 Thread James Henstridge

Skip Montanaro wrote:

>James> If you want to see an example of distributing a binding outside
>James> of the pygtk module, take a look at the gnome-python package.  It
>James> has been set up to build separately.
>
>Matt> for example, when I wrapped atk:
>...
>Matt> The generic rule in pygtk cvs will handle the autogenerating.
>
>Thanks to Matt & James for the tutorial on wrapping Gtk-related libraries.
>I can now successfully display an HTML document in Python code using the
>GtkHtml2 widget.
>
>I have so far only wrapped the HtmlDocument and HtmlView classes.  I'm onto
>the next step: displaying embedded images.  I'm unsure which route to take
>to get there.  The HtmlDocument class supports a request-url signal.  When I
>connect to it, my signal handler gets three arguments, a document, a url,
>and an HtmlStream*.  The simple example that comes with GtkHtml2 doesn't do
>anything with it, but I presume I am supposed to write the image data I
>retrieve to the stream.  Since I have yet to wrap this class, I don't
>actually see an HtmlStream*, but a PyCObject.  HtmlStream is not a subclass
>of GObject, so I'm unclear how I am supposed to wrap it so that it is
>automagically mapped to the right kind of Python object.
>
>Any suggestions?
>
If it is not a GObject, then it should get a boxed type associated with 
it.  The fact that you are seeing a cobject in python indicates that 
gtkhtml2 is saying the signal argument is a G_TYPE_POINTER. 
 Essentially, gtkhtml2 needs to be fixed in this regard.

The code generator makes boxed types very easy to wrap.

If the HtmlStream doesn't match the memory management characteristics of 
a boxed type (ie. registering copy/free functions), and they won't 
convert it to a GObject, then try and convince them to register a type 
derived from G_TYPE_POINTER.

Which reminds me, I need to add support for easy wrapping of derived 
G_TYPE_POINTER objects to python to handle GtkCTree again, as 
GtkCTreeNode isn't a boxed type (again).

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] adding wrappers for gtkhtml2

2001-11-28 Thread Skip Montanaro


Matt> Get the authors to register it as a boxed type.

Thanks.  Where do I learn about boxed types?

Skip

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] adding wrappers for gtkhtml2

2001-11-28 Thread Matt Wilson

Get the authors to register it as a boxed type.

Cheers,

Matt

On Wed, Nov 28, 2001 at 02:23:31PM -0600, Skip Montanaro wrote:
> 
> James> If you want to see an example of distributing a binding outside
> James> of the pygtk module, take a look at the gnome-python package.  It
> James> has been set up to build separately.
> 
> Matt> for example, when I wrapped atk:
> ...
> Matt> The generic rule in pygtk cvs will handle the autogenerating.
> 
> Thanks to Matt & James for the tutorial on wrapping Gtk-related libraries.
> I can now successfully display an HTML document in Python code using the
> GtkHtml2 widget.
> 
> I have so far only wrapped the HtmlDocument and HtmlView classes.  I'm onto
> the next step: displaying embedded images.  I'm unsure which route to take
> to get there.  The HtmlDocument class supports a request-url signal.  When I
> connect to it, my signal handler gets three arguments, a document, a url,
> and an HtmlStream*.  The simple example that comes with GtkHtml2 doesn't do
> anything with it, but I presume I am supposed to write the image data I
> retrieve to the stream.  Since I have yet to wrap this class, I don't
> actually see an HtmlStream*, but a PyCObject.  HtmlStream is not a subclass
> of GObject, so I'm unclear how I am supposed to wrap it so that it is
> automagically mapped to the right kind of Python object.
> 
> Any suggestions?
> 
> Thx,
> 
> Skip
> ___
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] adding wrappers for gtkhtml2

2001-11-28 Thread Skip Montanaro


James> If you want to see an example of distributing a binding outside
James> of the pygtk module, take a look at the gnome-python package.  It
James> has been set up to build separately.

Matt> for example, when I wrapped atk:
...
Matt> The generic rule in pygtk cvs will handle the autogenerating.

Thanks to Matt & James for the tutorial on wrapping Gtk-related libraries.
I can now successfully display an HTML document in Python code using the
GtkHtml2 widget.

I have so far only wrapped the HtmlDocument and HtmlView classes.  I'm onto
the next step: displaying embedded images.  I'm unsure which route to take
to get there.  The HtmlDocument class supports a request-url signal.  When I
connect to it, my signal handler gets three arguments, a document, a url,
and an HtmlStream*.  The simple example that comes with GtkHtml2 doesn't do
anything with it, but I presume I am supposed to write the image data I
retrieve to the stream.  Since I have yet to wrap this class, I don't
actually see an HtmlStream*, but a PyCObject.  HtmlStream is not a subclass
of GObject, so I'm unclear how I am supposed to wrap it so that it is
automagically mapped to the right kind of Python object.

Any suggestions?

Thx,

Skip
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] adding wrappers for gtkhtml2

2001-11-27 Thread James Henstridge

Skip Montanaro wrote:

>I decided to wrap the gtkhtml2 library today.  Seemed easy enough, small
>gtkhtml2.defs and gtkhtml2.override files did the trick, or so I thought.
>Then I started wading through the morass known as autoconf/automake/etc and
>quickly gave up on trying to do it "right".  I ended up simply editing
>pygtk/gtk/Makefile, trying to mimic what was there for gtk and gobject.  I
>eventually got to the point where I had something that compiled, linked and
>installed.  Now I get a segfault during import, which I have trouble
>stepping up to because it's in a shared library.
>
>*sigh* Does anyone have a "recipe" for adding new wrappers to PyGtk2?  I
>believe I have suitable .defs and .override files.  I need the rest of the
>glue.
>
If you want to see an example of distributing a binding outside of the 
pygtk module, take a look at the gnome-python package.  It has been set 
up to build separately.

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] adding wrappers for gtkhtml2

2001-11-27 Thread Matt Wilson

for example, when I wrapped atk:

add atkmodule.la to pyexec_LTLIBRARIES.

add:

atkmodule_la_LDFLAGS = -module -avoid-version -export-symbols-regex initatk
atkmodule_la_SOURCES = \
  atkmodule.c \
  atk.c
atkmodule_la_LIBADD = $(ATK_LIBS)

add:

atk.defs
atk.override

to EXTRA_DIST

The generic rule in pygtk cvs will handle the autogenerating.

On Tue, Nov 27, 2001 at 04:25:40PM -0600, Skip Montanaro wrote:
> 
> I decided to wrap the gtkhtml2 library today.  Seemed easy enough, small
> gtkhtml2.defs and gtkhtml2.override files did the trick, or so I thought.
> Then I started wading through the morass known as autoconf/automake/etc and
> quickly gave up on trying to do it "right".  I ended up simply editing
> pygtk/gtk/Makefile, trying to mimic what was there for gtk and gobject.  I
> eventually got to the point where I had something that compiled, linked and
> installed.  Now I get a segfault during import, which I have trouble
> stepping up to because it's in a shared library.
> 
> *sigh* Does anyone have a "recipe" for adding new wrappers to PyGtk2?  I
> believe I have suitable .defs and .override files.  I need the rest of the
> glue.
> 
> wrapping-other-libraries-was-never-this-hard-ly, y'rs,
> 
> Skip
> 
> ___
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] adding wrappers for gtkhtml2

2001-11-27 Thread Skip Montanaro


I decided to wrap the gtkhtml2 library today.  Seemed easy enough, small
gtkhtml2.defs and gtkhtml2.override files did the trick, or so I thought.
Then I started wading through the morass known as autoconf/automake/etc and
quickly gave up on trying to do it "right".  I ended up simply editing
pygtk/gtk/Makefile, trying to mimic what was there for gtk and gobject.  I
eventually got to the point where I had something that compiled, linked and
installed.  Now I get a segfault during import, which I have trouble
stepping up to because it's in a shared library.

*sigh* Does anyone have a "recipe" for adding new wrappers to PyGtk2?  I
believe I have suitable .defs and .override files.  I need the rest of the
glue.

wrapping-other-libraries-was-never-this-hard-ly, y'rs,

Skip

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk