seed r105 - trunk/libseed
- From: racarr svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r105 - trunk/libseed
- Date: Tue, 4 Nov 2008 08:52:27 +0000 (UTC)
Author: racarr
Date: Tue Nov 4 08:52:26 2008
New Revision: 105
URL: http://svn.gnome.org/viewvc/seed?rev=105&view=rev
Log:
Add SeedCallback class. For things like GtkCallback, sometime later
figure out libffi and make it work.
Modified:
trunk/libseed/seed-engine.c
trunk/libseed/seed-engine.h
trunk/libseed/seed-types.c
Modified: trunk/libseed/seed-engine.c
==============================================================================
--- trunk/libseed/seed-engine.c (original)
+++ trunk/libseed/seed-engine.c Tue Nov 4 08:52:26 2008
@@ -708,8 +708,15 @@
struct_ref);
JSValueProtect(eng->context, (JSValueRef) struct_ref);
+ } else if (info &&
+ (g_base_info_get_type(info) == GI_INFO_TYPE_CALLBACK))
+ {
+ JSObjectRef callback_ref = JSObjectMake(eng->context, seed_callback_class, info);
+ seed_value_set_property(namespace_ref,
+ g_base_info_get_name(info),
+ (JSValueRef)callback_ref);
}
- }
+ }
extension =
g_strdup_printf("Seed.include(\"/usr/local/share/seed/%s.js\")",
@@ -769,6 +776,26 @@
NULL /* Convert To Type */
};
+JSClassDefinition seed_callback_def = {
+ 0, /* Version, always 0 */
+ 0,
+ "seed_callback", /* Class Name */
+ NULL, /* Parent Class */
+ NULL, /* Static Values */
+ NULL, /* Static Functions */
+ NULL,
+ NULL, /* Finalize */
+ NULL, /* Has Property */
+ NULL, /* Get Property */
+ NULL, /* Set Property */
+ NULL, /* Delete Property */
+ NULL, /* Get Property Names */
+ NULL, /* Call As Function */
+ NULL, /* Call As Constructor */
+ NULL, /* Has Instance */
+ NULL /* Convert To Type */
+};
+
JSClassDefinition gobject_constructor_def = {
0, /* Version, always 0 */
0,
@@ -829,6 +856,8 @@
JSClassRetain(gobject_constructor_class);
gobject_signal_class = JSClassCreate(seed_get_signal_class());
JSClassRetain(gobject_signal_class);
+ seed_callback_class = JSClassCreate(&seed_callback_def);
+ JSClassRetain(seed_callback_class);
g_type_set_qdata(G_TYPE_OBJECT, qname, gobject_class);
Modified: trunk/libseed/seed-engine.h
==============================================================================
--- trunk/libseed/seed-engine.h (original)
+++ trunk/libseed/seed-engine.h Tue Nov 4 08:52:26 2008
@@ -25,6 +25,7 @@
extern JSClassRef gobject_class;
extern JSClassRef gobject_method_class;
extern JSClassRef gobject_constructor_class;
+extern JSClassRef seed_callback_class;
extern SeedEngine *eng;
typedef struct _SeedScript {
Modified: trunk/libseed/seed-types.c
==============================================================================
--- trunk/libseed/seed-types.c (original)
+++ trunk/libseed/seed-types.c Tue Nov 4 08:52:26 2008
@@ -24,6 +24,7 @@
JSClassRef gobject_class;
JSClassRef gobject_method_class;
JSClassRef gobject_constructor_class;
+JSClassRef seed_callback_class;
SeedEngine *eng;
static gboolean seed_value_is_gobject(SeedValue value)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]