return blob->alignment;
}
+gboolean
+g_struct_info_is_foreign (GIStructInfo *info)
+{
+ GIRealInfo *rinfo = (GIRealInfo *)info;
+ StructBlob *blob = (StructBlob *)&rinfo->typelib->data[rinfo->offset];
+
+ return blob->foreign;
+}
+
/**
* g_struct_info_is_gtype_struct:
* @info: GIStructInfo
gsize g_struct_info_get_size (GIStructInfo *info);
gsize g_struct_info_get_alignment (GIStructInfo *info);
gboolean g_struct_info_is_gtype_struct (GIStructInfo *info);
+gboolean g_struct_info_is_foreign (GIStructInfo *info);
/* GIRegisteredTypeInfo */
GList *members;
blob->blob_type = BLOB_TYPE_STRUCT;
+ blob->foreign = struct_->foreign;
blob->deprecated = struct_->deprecated;
blob->is_gtype_struct = struct_->is_gtype_struct;
blob->reserved = 0;
gboolean deprecated;
gboolean disguised;
gboolean is_gtype_struct;
+ gboolean foreign;
gchar *gtype_name;
gchar *gtype_init;
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);
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)
{
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_);
* @unregistered: If this is set, the type is not registered with GType.
* @alignment: The byte boundary that the struct is aligned to in memory
* @is_gtype_struct: Whether this structure is the class or interface layout for a GObject
+ * @foreign: If the type is foreign, eg if it's expected to be overridden by
+ * a native language binding instead of relying of introspected bindings.
* @size: The size of the struct in bytes.
* @gtype_name: String name of the associated #GType
* @gtype_init: String naming the symbol which gets the runtime #GType
guint16 unregistered : 1;
guint16 is_gtype_struct : 1;
guint16 alignment : 6;
- guint16 reserved : 7;
+ guint16 foreign : 1;
+ guint16 reserved : 6;
guint32 name;
const gchar *type_init;
gboolean deprecated;
gboolean is_gtype_struct;
+ gboolean foreign;
gint i;
gint size;
int n_elts;
if (show_all && size >= 0)
xml_printf (file, " size=\"%d\"", size);
+ foreign = g_struct_info_is_foreign (info);
+ if (foreign)
+ xml_printf (file, " foreign=\"1\"");
+
n_elts = g_struct_info_get_n_fields (info) + g_struct_info_get_n_methods (info);
if (n_elts > 0)
{