[seed] libseed: Drop the seed_gobject_initialize handler, and instead add signals in seed_wrap_object.



commit 52e69504ae186aae9ed63a1d925bfeb46186e116
Author: Robert Carr <racarr svn gnome org>
Date:   Thu May 21 13:12:36 2009 -0400

    libseed: Drop the seed_gobject_initialize handler, and instead add signals in seed_wrap_object.
---
 libseed/seed-engine.c |   26 +-------------------------
 libseed/seed-types.c  |    4 +++-
 2 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/libseed/seed-engine.c b/libseed/seed-engine.c
index f5add30..8c3fe9b 100644
--- a/libseed/seed-engine.c
+++ b/libseed/seed-engine.c
@@ -751,30 +751,6 @@ seed_gobject_finalize (JSObjectRef object)
   g_object_run_dispose (gobject);
 }
 
-static void
-seed_gobject_initialize (JSContextRef ctx, JSObjectRef object)
-{
-  GObject *gobject;
-  GIBaseInfo *base;
-
-  gobject = seed_value_to_object (ctx, (JSValueRef) object, 0);
-  if (!gobject)
-    return;
-
-  base = g_irepository_find_by_gtype (g_irepository_get_default (),
-				      G_OBJECT_TYPE (gobject));
-
-  
-  seed_add_signals_to_object (ctx,
-			      object,
-			      gobject);
-
-  if (!base)
-    return;
-
-  g_assert (g_base_info_get_type (base) == GI_INFO_TYPE_OBJECT);
-}
-
 static JSValueRef
 seed_gobject_get_property (JSContextRef context,
 			   JSObjectRef object,
@@ -1021,7 +997,7 @@ JSClassDefinition gobject_def = {
   NULL,				/* Parent Class */
   NULL,				/* Static Values */
   gobject_static_funcs,		/* Static Functions */
-  seed_gobject_initialize,	/* Initialize */
+  NULL, 
   seed_gobject_finalize,	/* Finalize */
   NULL,				/* Has Property */
   seed_gobject_get_property,	/* Get Property */
diff --git a/libseed/seed-types.c b/libseed/seed-types.c
index 077e665..3fe181b 100644
--- a/libseed/seed-types.c
+++ b/libseed/seed-types.c
@@ -63,7 +63,7 @@ static JSValueRef
 seed_wrap_object (JSContextRef ctx, GObject * object)
 {
   JSValueRef user_data;
-  JSValueRef js_ref;
+  JSObjectRef js_ref;
   JSClassRef class;
   GType type;
   JSValueRef prototype;
@@ -96,6 +96,8 @@ seed_wrap_object (JSContextRef ctx, GObject * object)
 
   JSValueProtect (eng->context, js_ref);
   g_object_add_toggle_ref (object, seed_toggle_ref, (gpointer) js_ref);
+  
+  seed_add_signals_to_object (ctx, js_ref, object);
 
   return js_ref;
 }



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