Re: Gtk2::MozEmbed + DOM



On Fri, 25 Mar 2005, Torsten Schoenfeld wrote:
On Thu, 2005-03-24 at 18:40 +0100, Scott Lanning wrote:
Another thing I'm not sure of is if I have to use
gperl_signal_set_marshaller_for; and, if so, I'm not sure
what to put for the first argument, since I didn't set up
those macros like was done for GTK_TYPE_MOZ_EMBED.
Maybe this is the problem.

gperl_signal_set_marshaller_for() expects the three arguments to be: the
type macro of the object in question (so GTK_TYPE_MOZ_EMBED is correct
in your case);

Oh, so simple! I was thinking it had to be for gpointer,
but I think I understand now: the signal is handled for
the mozembed object, so that's used.

the signal name in question (so you'd have to call
gperl_signal_set_marshaller_for() once for every dom_* signal you want);
and the new marshaller for that signal (that would be
gtk2perl_moz_embed_dom_key_marshal or
gtk2perl_moz_embed_dom_mouse_marshal depending on what kind of argument
the current signal takes).

Yep.

About the patch:

+static void
+gtk2perl_moz_embed_dom_key_marshal (GClosure *closure,
[...]
+       if (count != 1)
+               croak ("signal handlers for `dom_key_*' are supposed to "
+                      "return an integer");

You still need to actually set the return value here:

        gperl_value_from_sv (return_value, POPs);

        PUTBACK;

Okay, thanks. I applied your patch to Gtk2::CodeGen,
and I'll try wrapping the headers with 'extern "C"' like
muppet mentioned (in fact I think I'll put them around
`#include "gtkmozembed2perl.h' and `#include gperl_marshal.h'.

Also, I read a tutorial called "Gluing C++ And Perl Together",
and "Dean's Extension-Building Cookbook" tutorial (very old).
This latter mentions using another typemap for C++ called
perlobject.map, but it's from 1996 so I'm not sure if it's
still valid (also, maybe gtk-perl already takes care of things).



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]