summaryrefslogtreecommitdiff
path: root/girepository/girparser.c
diff options
context:
space:
mode:
authorJohan Dahlin <jdahlin@litl.com>2010-03-25 23:12:12 -0300
committerJohan Dahlin <johan@gnome.org>2010-03-25 23:12:12 -0300
commitd65f65cef8996e3dc1c305a6606930a061f2a99b (patch)
tree1ee6aa1b22f3663ed76c641ade614cc240a725a4 /girepository/girparser.c
parentd8a304b16bd285b671f144687d6fbe4a1d2bd43c (diff)
downloadgobject-introspection-d65f65cef8996e3dc1c305a6606930a061f2a99b.tar.gz
Add support for foreign structs
Foreign structs are special in the sense that there might be native bindings (for instance PyCairo for PyGI) that provides the same functionallity as the introspected variant. https://bugzilla.gnome.org/show_bug.cgi?id=610357
Diffstat (limited to 'girepository/girparser.c')
-rw-r--r--girepository/girparser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 12c1d989..5b24604a 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -2201,6 +2201,7 @@ start_struct (GMarkupParseContext *context,
const gchar *gtype_name;
const gchar *gtype_init;
const gchar *gtype_struct;
+ const gchar *foreign;
GIrNodeStruct *struct_;
name = find_attribute ("name", attribute_names, attribute_values);
@@ -2209,6 +2210,7 @@ start_struct (GMarkupParseContext *context,
gtype_name = find_attribute ("glib:type-name", attribute_names, attribute_values);
gtype_init = find_attribute ("glib:get-type", attribute_names, attribute_values);
gtype_struct = find_attribute ("glib:is-gtype-struct-for", attribute_names, attribute_values);
+ foreign = find_attribute ("foreign", attribute_names, attribute_values);
if (name == NULL && ctx->node_stack == NULL)
{
@@ -2242,6 +2244,8 @@ start_struct (GMarkupParseContext *context,
struct_->gtype_name = g_strdup (gtype_name);
struct_->gtype_init = g_strdup (gtype_init);
+ struct_->foreign = (g_strcmp0 (foreign, "1") == 0);
+
if (ctx->node_stack == NULL)
ctx->current_module->entries =
g_list_append (ctx->current_module->entries, struct_);