[gobject-introspection] support setting gobjects and ginterfaces in struct fields



commit 2d39aac59cb245b81e7c92abf816b90d8916aace
Author: John (J5) Palmieri <johnp redhat com>
Date:   Mon Mar 14 14:18:22 2011 -0400

    support setting gobjects and ginterfaces in struct fields
    
    https://bugzilla.gnome.org/show_bug.cgi?id=644749

 girepository/gifieldinfo.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/girepository/gifieldinfo.c b/girepository/gifieldinfo.c
index d4fd14e..cf5c233 100644
--- a/girepository/gifieldinfo.c
+++ b/girepository/gifieldinfo.c
@@ -512,6 +512,23 @@ g_field_info_set_field (GIFieldInfo     *field_info,
 	  }
 	  break;
 	}
+    } else {
+      switch (g_type_info_get_tag (type_info))
+        {
+        case GI_TYPE_TAG_INTERFACE:
+          {
+	    GIBaseInfo *interface = g_type_info_get_interface (type_info);
+	    switch (g_base_info_get_type (interface))
+              {
+                case GI_INFO_TYPE_OBJECT:
+                case GI_INFO_TYPE_INTERFACE:
+                  G_STRUCT_MEMBER (gpointer, mem, offset) = (gpointer)value->v_pointer;
+                  result = TRUE;
+                  break;
+              }
+              g_base_info_unref ((GIBaseInfo *)interface);
+          }
+        }
     }
 
   g_base_info_unref ((GIBaseInfo *)type_info);



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