seed r123 - in trunk: libseed tests
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r123 - in trunk: libseed tests
- Date: Wed, 5 Nov 2008 10:56:45 +0000 (UTC)
Author: racarr
Date: Wed Nov 5 10:56:45 2008
New Revision: 123
URL: http://svn.gnome.org/viewvc/seed?rev=123&view=rev
Log:
Automatically generate native closures when functions except
GI_INFO_TYPE_CALLBACK and JavaScript functions are passed. Allows
JavaScript functions to be passed in to things like
gtk_container_foreach transparently.
Modified:
trunk/libseed/seed-types.c
trunk/tests/native-closure.js
Modified: trunk/libseed/seed-types.c
==============================================================================
--- trunk/libseed/seed-types.c (original)
+++ trunk/libseed/seed-types.c Wed Nov 5 10:56:45 2008
@@ -292,7 +292,10 @@
else if (JSObjectIsFunction(eng->context,
(JSObjectRef)value))
{
-
+ SeedClosurePrivates * privates =
+ seed_make_closure((GICallableInfo*)interface, value);
+ arg->v_pointer = privates->closure;
+ break;
}
}
Modified: trunk/tests/native-closure.js
==============================================================================
--- trunk/tests/native-closure.js (original)
+++ trunk/tests/native-closure.js Wed Nov 5 10:56:45 2008
@@ -9,8 +9,7 @@
w = new Gtk.Window();
vbox = new Gtk.VBox();
-closure = Seed.closure_native(function(widget){Seed.print(widget)},
- Gtk.Callback);
+closure = function(widget){Seed.print(widget)};
w.add(vbox);
vbox.pack_start(new Gtk.Label());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]