seed r340 - trunk/libseed



Author: racarr
Date: Tue Nov 25 01:34:50 2008
New Revision: 340
URL: http://svn.gnome.org/viewvc/seed?rev=340&view=rev

Log:
Get rid of some more global context usage. Down to 145...


Modified:
   trunk/libseed/seed-engine.c
   trunk/libseed/seed-signals.c
   trunk/libseed/seed-signals.h

Modified: trunk/libseed/seed-engine.c
==============================================================================
--- trunk/libseed/seed-engine.c	(original)
+++ trunk/libseed/seed-engine.c	Tue Nov 25 01:34:50 2008
@@ -617,7 +617,7 @@
 	base = g_irepository_find_by_gtype(g_irepository_get_default(),
 									   G_OBJECT_TYPE(gobject));
 
-	seed_add_signals_to_object(object, gobject);
+	seed_add_signals_to_object(ctx, object, gobject);
 	if (!base)
 		return;
 

Modified: trunk/libseed/seed-signals.c
==============================================================================
--- trunk/libseed/seed-signals.c	(original)
+++ trunk/libseed/seed-signals.c	Tue Nov 25 01:34:50 2008
@@ -39,7 +39,7 @@
 }
 
 static void
-seed_add_signal_to_object(JSObjectRef object_ref,
+seed_add_signal_to_object(JSContextRef ctx, JSObjectRef object_ref,
 						  GObject * obj, GSignalQuery * signal)
 {
 	guint k;
@@ -54,7 +54,7 @@
 			js_signal_name[k] = '_';
 	}
 
-	signal_ref = JSObjectMake(eng->context, gobject_signal_class, priv);
+	signal_ref = JSObjectMake(ctx, gobject_signal_class, priv);
 
 	priv->signal_id = signal->signal_id;
 	priv->object = obj;
@@ -65,7 +65,9 @@
 }
 
 static void
-seed_add_signals_for_type(JSObjectRef object_ref, GObject * obj, GType type)
+seed_add_signals_for_type(JSContextRef ctx, 
+						  JSObjectRef object_ref, 
+						  GObject * obj, GType type)
 {
 	guint n, i;
 	guint *signal_ids;
@@ -76,7 +78,7 @@
 		g_signal_query(signal_ids[i], &query);
 		if (query.signal_id != 0)
 		{
-			seed_add_signal_to_object(object_ref, obj, &query);
+			seed_add_signal_to_object(ctx, object_ref, obj, &query);
 		}
 	}
 	g_free(signal_ids);
@@ -161,7 +163,9 @@
 	g_free(signal_name);
 }
 
-void seed_add_signals_to_object(JSObjectRef object_ref, GObject * obj)
+void seed_add_signals_to_object(JSContextRef ctx, 
+								JSObjectRef object_ref, 
+								GObject * obj)
 {
 	GType type;
 	GType *interfaces;
@@ -176,11 +180,11 @@
 
 	while (type != 0)
 	{
-		seed_add_signals_for_type(signals_ref, obj, type);
+		seed_add_signals_for_type(ctx, signals_ref, obj, type);
 
 		interfaces = g_type_interfaces(type, &n);
 		for (i = 0; i < n; i++)
-			seed_add_signals_for_type(signals_ref, obj, interfaces[i]);
+			seed_add_signals_for_type(ctx, signals_ref, obj, interfaces[i]);
 
 		type = g_type_parent(type);
 
@@ -284,7 +288,7 @@
 									 argumentCount);
 		seed_make_exception(exception, "ArgumentError", mes);
 		g_free(mes);
-		return JSValueMakeNull(eng->context);
+		return JSValueMakeNull(ctx);
 	}
 
 	params = g_new0(GValue, argumentCount + 1);
@@ -331,7 +335,7 @@
 		seed_make_exception(exception, "ArgumentError", mes);
 
 		g_free(mes);
-		return JSValueMakeNull(eng->context);
+		return JSValueMakeNull(ctx);
 	}
 	
 	if (argumentCount == 1)

Modified: trunk/libseed/seed-signals.h
==============================================================================
--- trunk/libseed/seed-signals.h	(original)
+++ trunk/libseed/seed-signals.h	Tue Nov 25 01:34:50 2008
@@ -30,7 +30,8 @@
 							  const GValue * param_values,
 							  gpointer invocation_hint, gpointer marshall_data);
 
-void seed_add_signals_to_object(JSObjectRef object_ref, GObject * obj);
+void seed_add_signals_to_object(JSContextRef ctx, 
+								JSObjectRef object_ref, GObject * obj);
 JSClassDefinition *seed_get_signal_class(void);
 extern JSClassRef gobject_signal_class;
 



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