diff -ru Gtk2-MozEmbed-0.03-orig/Makefile.PL Gtk2-MozEmbed-0.03/Makefile.PL --- Gtk2-MozEmbed-0.03-orig/Makefile.PL 2005-03-23 23:33:18.000000000 +0100 +++ Gtk2-MozEmbed-0.03/Makefile.PL 2005-03-24 18:04:08.974388880 +0100 @@ -55,11 +55,14 @@ ); my $mozembed = ExtUtils::Depends->new('Gtk2::MozEmbed', 'Gtk2'); -$mozembed->set_inc($pkgcfg{cflags}); + +my $incdir = '-I' . `pkg-config --variable=includedir mozilla-gtkmozembed`; +chomp($incdir); +$mozembed->set_inc($pkgcfg{cflags}, $incdir); $mozembed->set_libs($pkgcfg{libs}); $mozembed->add_xs(@xs_files); $mozembed->add_pm('MozEmbed.pm' => '$(INST_LIBDIR)/MozEmbed.pm'); -$mozembed->add_typemaps(map {File::Spec->catfile(cwd(), $_)} 'build/gtkmozembed2perl.typemap'); +$mozembed->add_typemaps(map {File::Spec->catfile(cwd(), $_)} qw{build/gtkmozembed2perl.typemap dom.typemap}); $mozembed->install(qw(gtkmozembed2perl.h build/gtkmozembed2perl-autogen.h)); $mozembed->save_config('build/IFiles.pm'); @@ -74,6 +77,7 @@ XSPROTOARG => '-noprototypes', MAN3PODS => \%pod_files, LD => "LD_RUN_PATH=$libdir $Config{ld}", + CC => 'c++', $mozembed->get_makefile_vars, ); diff -ru Gtk2-MozEmbed-0.03-orig/gtkmozembed2perl.h Gtk2-MozEmbed-0.03/gtkmozembed2perl.h --- Gtk2-MozEmbed-0.03-orig/gtkmozembed2perl.h 2005-03-23 23:33:17.000000000 +0100 +++ Gtk2-MozEmbed-0.03/gtkmozembed2perl.h 2005-03-24 02:25:26.000000000 +0100 @@ -44,6 +44,15 @@ * #endif */ + +/* type conversion for dom_* signals */ +#include +#include + +SV * newSVnsIDOMKeyEvent (nsIDOMKeyEvent *event); +nsIDOMKeyEvent * SvnsIDOMKeyEvent (SV *event); + + #include "gtkmozembed2perl-autogen.h" #endif /* _GTKMOZEMBED2PERL_H_ */ diff -ru Gtk2-MozEmbed-0.03-orig/xs/GtkMozEmbed.xs Gtk2-MozEmbed-0.03/xs/GtkMozEmbed.xs --- Gtk2-MozEmbed-0.03-orig/xs/GtkMozEmbed.xs 2005-03-23 23:33:17.000000000 +0100 +++ Gtk2-MozEmbed-0.03/xs/GtkMozEmbed.xs 2005-03-24 18:33:23.247698800 +0100 @@ -129,6 +129,118 @@ /* ------------------------------------------------------------------------- */ +/* conversion functions for dom_* signals */ + +SV * +newSVnsIDOMKeyEvent (nsIDOMKeyEvent *event) +{ + SV *sv = newSV (0); + return sv_setref_pv (sv, "Gtk2::MozEmbed::KeyEvent", event); +} + +nsIDOMKeyEvent * +SvnsIDOMKeyEvent (SV *event) +{ + return INT2PTR (nsIDOMKeyEvent *, SvIV (SvRV (event))); +} + +SV * +newSVnsIDOMMouseEvent (nsIDOMMouseEvent *event) +{ + SV *sv = newSV (0); + return sv_setref_pv (sv, "Gtk2::MozEmbed::MouseEvent", event); +} + +nsIDOMMouseEvent * +SvnsIDOMMouseEvent (SV *event) +{ + return INT2PTR (nsIDOMMouseEvent *, SvIV (SvRV (event))); +} + +/* can these two be combined? */ + +static void +gtk2perl_moz_embed_dom_key_marshal (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + dGPERL_CLOSURE_MARSHAL_ARGS; + + GPERL_CLOSURE_MARSHAL_INIT (closure, marshal_data); + + ENTER; + SAVETMPS; + + PUSHMARK (SP); + + GPERL_CLOSURE_MARSHAL_PUSH_INSTANCE (param_values); + + /* param_values + 1 is the `pointer dom_event' */ + XPUSHs (sv_2mortal (newSVnsIDOMKeyEvent ((nsIDOMKeyEvent *) + g_value_get_pointer (param_values + 1)))); + + + GPERL_CLOSURE_MARSHAL_PUSH_DATA; + + PUTBACK; + + GPERL_CLOSURE_MARSHAL_CALL (G_SCALAR); + + SPAGAIN; + + if (count != 1) + croak ("signal handlers for `dom_key_*' are supposed to " + "return an integer"); + + FREETMPS; + LEAVE; +} + +static void +gtk2perl_moz_embed_dom_mouse_marshal (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) +{ + dGPERL_CLOSURE_MARSHAL_ARGS; + + GPERL_CLOSURE_MARSHAL_INIT (closure, marshal_data); + + ENTER; + SAVETMPS; + + PUSHMARK (SP); + + GPERL_CLOSURE_MARSHAL_PUSH_INSTANCE (param_values); + + /* param_values + 1 is the `pointer dom_event' */ + XPUSHs (sv_2mortal (newSVnsIDOMMouseEvent ((nsIDOMMouseEvent *) + g_value_get_pointer (param_values + 1)))); + + + GPERL_CLOSURE_MARSHAL_PUSH_DATA; + + PUTBACK; + + GPERL_CLOSURE_MARSHAL_CALL (G_SCALAR); + + SPAGAIN; + + if (count != 1) + croak ("signal handlers for `dom_mouse_*' are supposed to " + "return an integer"); + + FREETMPS; + LEAVE; +} + +/* ------------------------------------------------------------------------- */ + MODULE = Gtk2::MozEmbed PACKAGE = Gtk2::MozEmbed PREFIX = gtk_moz_embed_ BOOT: @@ -140,6 +252,12 @@ /* gperl_signal_set_marshaller_for (GTK_TYPE_MOZ_EMBED_SINGLE, "new_window_orphan", gtk2perl_moz_embed_new_window_marshal); */ + /* gperl_signal_set_marshaller_for (GTK_TYPE_MOZ_EMBED, + "new_window", + gtk2perl_moz_embed_new_window_marshal); + gperl_signal_set_marshaller_for (GTK_TYPE_MOZ_EMBED, + "new_window", + gtk2perl_moz_embed_new_window_marshal); */ =for object Gtk2::MozEmbed::main @@ -508,3 +626,15 @@ # gtk_moz_embed_single_get (class) # C_ARGS: # /* void */ + +# --------------------------------------------------------------------------- # + +MODULE = Gtk2::MozEmbed PACKAGE = Gtk2::MozEmbed::KeyEvent PREFIX = gtk_moz_embed_ + +# --------------------------------------------------------------------------- # + +MODULE = Gtk2::MozEmbed PACKAGE = Gtk2::MozEmbed::MouseEvent PREFIX = gtk_moz_embed_ + + +MODULE = Gtk2::MozEmbed PACKAGE = Gtk2::MozEmbed +