seed r636 - trunk/libseed



Author: racarr
Date: Sun Jan  4 07:07:04 2009
New Revision: 636
URL: http://svn.gnome.org/viewvc/seed?rev=636&view=rev

Log:
Add seed_gobject_named_constructor

Modified:
   trunk/libseed/seed-engine.c

Modified: trunk/libseed/seed-engine.c
==============================================================================
--- trunk/libseed/seed-engine.c	(original)
+++ trunk/libseed/seed-engine.c	Sun Jan  4 07:07:04 2009
@@ -27,6 +27,7 @@
 GQuark qprototype = 0;
 
 JSClassRef gobject_signal_class;
+JSClassRef gobject_named_constructor_class;
 JSClassRef seed_struct_constructor_class;
 
 JSContextGroupRef context_group;
@@ -440,6 +441,19 @@
 	return retval_ref;
 }
 
+static JSObjectRef
+seed_gobject_named_constructor_invoked(JSContextRef ctx,
+								 JSObjectRef constructor,
+								 size_t argumentCount,
+								 const JSValueRef arguments[],
+								 JSValueRef * exception)
+{
+	return (JSObjectRef)seed_gobject_method_invoked(ctx, constructor, 
+									   NULL, argumentCount,
+									   arguments,
+									   exception);
+}
+
 void
 seed_gobject_define_property_from_function_info(JSContextRef ctx,
 												GIFunctionInfo * info,
@@ -1177,6 +1191,26 @@
 	NULL						/* Convert To Type */
 };
 
+JSClassDefinition gobject_named_constructor_def = {
+	0,							/* Version, always 0 */
+	0,
+	"gobject_named_constructor",		/* 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 */
+	seed_gobject_named_constructor_invoked,	/* Call As Constructor */
+	NULL,						/* Has Instance */
+	NULL						/* Convert To Type */
+};
+
 JSClassDefinition struct_constructor_def = {
 	0,							/* Version, always 0 */
 	0,
@@ -1322,6 +1356,8 @@
 	JSClassRetain(gobject_method_class);
 	gobject_constructor_class = JSClassCreate(&gobject_constructor_def);
 	JSClassRetain(gobject_constructor_class);
+	gobject_named_constructor_class = JSClassCreate(&gobject_named_constructor_def);
+	JSClassRetain(gobject_named_constructor_class);
 	gobject_signal_class = JSClassCreate(seed_get_signal_class());
 	JSClassRetain(gobject_signal_class);
 	seed_callback_class = JSClassCreate(&seed_callback_def);



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