g_struct_info_find_method
g_struct_info_get_size
g_struct_info_get_alignment
-g_struct_info_is_class_struct
+g_struct_info_is_gtype_struct
g_registered_type_info_get_type_name
g_registered_type_info_get_type_init
g_registered_type_info_get_g_type
g_interface_info_get_vfunc
g_interface_info_get_n_constants
g_interface_info_get_constant
+g_interface_info_get_iface_struct
g_property_info_get_flags
g_property_info_get_type
g_signal_info_get_flags
}
/**
- * g_struct_info_is_class_struct:
+ * g_struct_info_is_gtype_struct:
* @info: GIStructInfo
*
* Return true if this structure represents the "class structure" for some
- * GObject. This function is mainly useful to hide this kind of structure
- * from public APIs.
+ * #GObject or #GInterface. This function is mainly useful to hide this kind of structure
+ * from generated public APIs.
*
- * Returns: TRUE if it's a class struct, otherwise FALSE
+ * Returns: %TRUE if this is a class struct, %FALSE otherwise
*/
gboolean
-g_struct_info_is_class_struct (GIStructInfo *info)
+g_struct_info_is_gtype_struct (GIStructInfo *info)
{
GIBaseInfo *base = (GIBaseInfo *)info;
StructBlob *blob = (StructBlob *)&base->typelib->data[base->offset];
- return blob->is_class_struct;
+ return blob->is_gtype_struct;
}
gint
* g_object_info_get_class_struct:
* @info: A #GIObjectInfo to query
*
- * Every GObject has two structures; an instance structure and a class
+ * Every #GObject has two structures; an instance structure and a class
* structure. This function returns the metadata for the class structure.
*
- * Returns: a GIStrucTInfo for the class struct or NULL if none found.
+ * Returns: a #GIStructInfo for the class struct or %NULL if none found.
*/
GIStructInfo *
g_object_info_get_class_struct (GIObjectInfo *info)
GIBaseInfo *base = (GIBaseInfo *)info;
ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
- if (blob->class_struct)
+ if (blob->gtype_struct)
return (GIStructInfo *) g_info_from_entry (base->repository,
- base->typelib, blob->class_struct);
+ base->typelib, blob->gtype_struct);
else
return NULL;
}
base->typelib, offset);
}
+/**
+ * g_interface_info_get_iface_struct:
+ * @info: A #GIInterfaceInfo to query
+ *
+ * Returns the layout C structure associated with this #GInterface.
+ *
+ * Returns: A #GIStructInfo for the class struct or %NULL if none found.
+ */
+GIStructInfo *
+g_interface_info_get_iface_struct (GIInterfaceInfo *info)
+{
+ GIBaseInfo *base = (GIBaseInfo *)info;
+ InterfaceBlob *blob = (InterfaceBlob *)&base->typelib->data[base->offset];
-
+ if (blob->gtype_struct)
+ return (GIStructInfo *) g_info_from_entry (base->repository,
+ base->typelib, blob->gtype_struct);
+ else
+ return NULL;
+}
/* GIPropertyInfo functions */
GParamFlags
const gchar *name);
gsize g_struct_info_get_size (GIStructInfo *info);
gsize g_struct_info_get_alignment (GIStructInfo *info);
-gboolean g_struct_info_is_class_struct (GIStructInfo *info);
+gboolean g_struct_info_is_gtype_struct (GIStructInfo *info);
/* GIRegisteredTypeInfo */
GIConstantInfo * g_interface_info_get_constant (GIInterfaceInfo *info,
gint n);
+GIStructInfo * g_interface_info_get_iface_struct (GIInterfaceInfo *info);
+
/* GIPropertyInfo */
g_free (iface->gtype_name);
g_free (iface->gtype_init);
- g_free (iface->class_struct);
+
+ g_free (iface->glib_type_struct);
g_free (iface->parent);
for (l = iface->interfaces; l; l = l->next)
size = sizeof(ObjectBlob);
if (iface->parent)
size += ALIGN_VALUE (strlen (iface->parent) + 1, 4);
- if (iface->class_struct)
- size += ALIGN_VALUE (strlen (iface->class_struct) + 1, 4);
+ if (iface->glib_type_struct)
+ size += ALIGN_VALUE (strlen (iface->glib_type_struct) + 1, 4);
size += ALIGN_VALUE (strlen (node->name) + 1, 4);
size += ALIGN_VALUE (strlen (iface->gtype_name) + 1, 4);
if (iface->gtype_init)
blob->blob_type = BLOB_TYPE_STRUCT;
blob->deprecated = struct_->deprecated;
- blob->is_class_struct = struct_->is_gclass_struct;
+ blob->is_gtype_struct = struct_->is_gtype_struct;
blob->reserved = 0;
blob->name = write_string (node->name, strings, data, offset2);
blob->alignment = struct_->alignment;
blob->parent = find_entry (module, modules, object->parent);
else
blob->parent = 0;
- if (object->class_struct)
- blob->class_struct = find_entry (module, modules, object->class_struct);
+ if (object->glib_type_struct)
+ blob->gtype_struct = find_entry (module, modules, object->glib_type_struct);
else
- blob->class_struct = 0;
+ blob->gtype_struct = 0;
blob->n_interfaces = 0;
blob->n_fields = 0;
blob->name = write_string (node->name, strings, data, offset2);
blob->gtype_name = write_string (iface->gtype_name, strings, data, offset2);
blob->gtype_init = write_string (iface->gtype_init, strings, data, offset2);
+ if (iface->glib_type_struct)
+ blob->gtype_struct = find_entry (module, modules, iface->glib_type_struct);
+ else
+ blob->gtype_struct = 0;
blob->n_prerequisites = 0;
blob->n_properties = 0;
blob->n_methods = 0;
gchar *gtype_init;
gchar *parent;
- gchar *class_struct; /* Only applies to classes */
+ gchar *glib_type_struct;
GList *interfaces;
GList *prerequisites;
gboolean deprecated;
gboolean disguised;
- gboolean is_gclass_struct;
+ gboolean is_gtype_struct;
gchar *gtype_name;
gchar *gtype_init;
const gchar *typename;
const gchar *typeinit;
const gchar *deprecated;
+ const gchar *glib_type_struct;
name = find_attribute ("name", attribute_names, attribute_values);
typename = find_attribute ("glib:type-name", attribute_names, attribute_values);
typeinit = find_attribute ("glib:get-type", attribute_names, attribute_values);
+ glib_type_struct = find_attribute ("glib:type-struct", attribute_names, attribute_values);
deprecated = find_attribute ("deprecated", attribute_names, attribute_values);
if (name == NULL)
((GIrNode *)iface)->name = g_strdup (name);
iface->gtype_name = g_strdup (typename);
iface->gtype_init = g_strdup (typeinit);
+ iface->glib_type_struct = g_strdup (glib_type_struct);
if (deprecated)
iface->deprecated = TRUE;
else
{
const gchar *name;
const gchar *parent;
- const gchar *class_struct;
+ const gchar *glib_type_struct;
const gchar *typename;
const gchar *typeinit;
const gchar *deprecated;
name = find_attribute ("name", attribute_names, attribute_values);
parent = find_attribute ("parent", attribute_names, attribute_values);
- class_struct = find_attribute ("glib:class-struct", attribute_names, attribute_values);
+ glib_type_struct = find_attribute ("glib:type-struct", attribute_names, attribute_values);
typename = find_attribute ("glib:type-name", attribute_names, attribute_values);
typeinit = find_attribute ("glib:get-type", attribute_names, attribute_values);
deprecated = find_attribute ("deprecated", attribute_names, attribute_values);
iface->gtype_name = g_strdup (typename);
iface->gtype_init = g_strdup (typeinit);
iface->parent = g_strdup (parent);
- iface->class_struct = g_strdup (class_struct);
+ iface->glib_type_struct = g_strdup (glib_type_struct);
if (deprecated)
iface->deprecated = TRUE;
else
const gchar *disguised;
const gchar *gtype_name;
const gchar *gtype_init;
- const gchar *gclass_struct;
+ const gchar *gtype_struct;
GIrNodeStruct *struct_;
name = find_attribute ("name", attribute_names, attribute_values);
disguised = find_attribute ("disguised", 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);
- gclass_struct = find_attribute ("glib:is-class-struct-for", attribute_names, attribute_values);
+ gtype_struct = find_attribute ("glib:is-gtype-struct-for", attribute_names, attribute_values);
if (name == NULL && ctx->node_stack == NULL)
{
if (disguised && strcmp (disguised, "1") == 0)
struct_->disguised = TRUE;
- struct_->is_gclass_struct = gclass_struct != NULL;
+ struct_->is_gtype_struct = gtype_struct != NULL;
struct_->gtype_name = g_strdup (gtype_name);
struct_->gtype_init = g_strdup (gtype_init);
CHECK_SIZE (SignalBlob, 16);
CHECK_SIZE (VFuncBlob, 20);
CHECK_SIZE (ObjectBlob, 44);
- CHECK_SIZE (InterfaceBlob, 36);
+ CHECK_SIZE (InterfaceBlob, 40);
CHECK_SIZE (ConstantBlob, 24);
CHECK_SIZE (AnnotationBlob, 12);
CHECK_SIZE (UnionBlob, 40);
}
}
- if (blob->class_struct != 0)
+ if (blob->gtype_struct != 0)
{
DirEntry *entry;
- entry = get_dir_entry_checked (typelib, blob->class_struct, error);
+ entry = get_dir_entry_checked (typelib, blob->gtype_struct, error);
if (!entry)
return FALSE;
if (entry->blob_type != BLOB_TYPE_STRUCT && entry->local)
TYPELIB HISTORY
-----
Version 1.0
+- Rename class_struct to gtype_struct, add to interfaces
Changes since 0.9:
- Add padding to structures
* @deprecated: Whether this structure is deprecated
* @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_class_struct: Whether this structure is the "class structure" for a GObject
+ * @is_gtype_struct: Whether this structure is the class or interface layout for a GObject
* @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 deprecated : 1;
guint16 unregistered : 1;
- guint16 is_class_struct : 1;
+ guint16 is_gtype_struct : 1;
guint16 alignment : 6;
guint16 reserved : 7;
guint32 gtype_init;
guint16 parent;
- guint16 class_struct;
+ guint16 gtype_struct;
guint16 n_interfaces;
guint16 n_fields;
/**
* InterfaceBlob:
+ * @gtype_struct: Name of the interface "class" C structure
* @n_prerequisites: Number of prerequisites
* @n_properties: Number of properties
* @n_methods: Number of methods
guint32 gtype_name;
guint32 gtype_init;
+ guint16 gtype_struct;
guint16 n_prerequisites;
guint16 n_properties;
# -*- Mode: Python -*-
# GObject-Introspection - a framework for introspecting GObject libraries
# Copyright (C) 2008 Johan Dahlin
+# Copyright (C) 2008, 2009 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
self.symbol = symbol
self.disguised = disguised
self.doc = None
- self.constructors = []
self.methods = []
- # If true, this record defines the FooClass C structure
- # for some Foo GObject
- self.is_gobject_struct_for = False
# BW compat, remove
Struct = Record
Node.__init__(self, name)
self.ctype = name
self.parent = parent
- self.class_struct = None
+ self.glib_type_struct = None
self.is_abstract = is_abstract
self.methods = []
self.static_methods = []
Node.__init__(self, name)
self.parent = parent
self.methods = []
+ self.glib_type_struct = None
self.properties = []
self.fields = []
self.prerequisites = []
# -*- Mode: Python -*-
# GObject-Introspection - a framework for introspecting GObject libraries
# Copyright (C) 2008 Johan Dahlin
+# Copyright (C) 2008, 2009 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Function, Interface, List, Map, Member, Struct, Union,
Varargs)
from .glibast import (GLibBoxed, GLibEnum, GLibEnumMember,
- GLibFlags, GLibObject, GLibInterface)
+ GLibFlags, GLibObject, GLibInterface,
+ GLibRecord)
from .xmlwriter import XMLWriter
attrs.append(('glib:type-name', node.type_name))
if node.get_type:
attrs.append(('glib:get-type', node.get_type))
- if isinstance(node, GLibObject):
- if node.class_struct:
- attrs.append(('glib:class-struct', node.class_struct.name))
+ if node.glib_type_struct:
+ attrs.append(('glib:type-struct', node.glib_type_struct.name))
with self.tagcontext(tag_name, attrs):
if isinstance(node, GLibObject):
for iface in node.interfaces:
attrs.append(('c:type', record.symbol))
if record.disguised:
attrs.append(('disguised', '1'))
- if record.is_gobject_struct_for:
- attrs.append(('glib:is-class-struct-for',
- record.is_gobject_struct_for))
+ if isinstance(record, GLibRecord):
+ if record.is_gtype_struct_for:
+ attrs.append(('glib:is-gtype-struct-for',
+ record.is_gtype_struct_for))
if record.doc:
attrs.append(('doc', record.doc))
self._append_version(record, attrs)
#
from .ast import (Bitfield, Class, Enum, Interface, Member, Node,
- Property, Struct, Union)
+ Property, Struct, Union, Record)
from .ast import (
type_names, default_array_types,
TYPE_STRING, TYPE_INT8, TYPE_UINT8, TYPE_INT16, TYPE_UINT16,
default_array_types['guint8*'] = TYPE_UINT8
default_array_types['gchar**'] = TYPE_STRING
+class GLibRecord(Record):
+ def __init__(self, *args, **kwargs):
+ Record.__init__(self, *args, **kwargs)
+
+ @classmethod
+ def from_record(cls, record):
+ obj = cls(record.name, record.symbol)
+ obj.fields = record.fields
+ obj.constructors = record.constructors
+ obj.disguised = record.disguised
+ obj.doc = record.doc
+ obj.methods = record.methods
+ # If true, this record defines the FooClass C structure
+ # for some Foo GObject (or similar for GInterface)
+ obj.is_gtype_struct_for = False
+ return obj
class GLibEnum(Enum):
from .transformer import Names
from .glibast import (GLibBoxed, GLibEnum, GLibEnumMember, GLibFlags,
GLibInterface, GLibObject, GLibSignal, GLibBoxedStruct,
- GLibBoxedUnion, GLibBoxedOther, type_names)
+ GLibBoxedUnion, GLibBoxedOther, GLibRecord, type_names)
from .utils import to_underscores, to_underscores_noprefix
default_array_types['guchar*'] = TYPE_UINT8
for field in maybe_class.fields:
if isinstance(field, Field):
field.writable = False
+ # TODO: remove this, we should be computing vfuncs instead
if isinstance(pair_class, GLibInterface):
for field in maybe_class.fields[1:]:
pair_class.fields.append(field)
- return
- elif isinstance(pair_class, GLibObject):
- pair_class.class_struct = class_struct
- class_struct.is_gobject_struct_for = name
+ gclass_struct = GLibRecord.from_record(class_struct)
+ self._remove_attribute(class_struct.name)
+ self._add_attribute(gclass_struct, True)
+ pair_class.glib_type_struct = gclass_struct
+ gclass_struct.is_gtype_struct_for = name
# Introspection
test_constructor_return_type (info);
+ info = g_irepository_find_by_name (repo, "Gio", "ThisDoesNotExist");
+ g_assert (info == NULL);
+
exit(0);
}
parent="GObject.Object"
glib:type-name="BarBaz"
glib:get-type="bar_baz_get_type"
- glib:class-struct="BazClass">
+ glib:type-struct="BazClass">
<field name="parent_instance">
<type name="GObject.Object" c:type="GObject"/>
</field>
</class>
<record name="BazClass"
c:type="BarBazClass"
- glib:is-class-struct-for="Baz">
+ glib:is-gtype-struct-for="Baz">
<field name="parent_class">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
<include name="GObject" version="2.0"/>
<include name="GLib" version="2.0"/>
<namespace name="BarApp" version="1.0" shared-library="">
- <class name="Baz" parent="GObject.Object" glib:class-struct="BazClass" glib:type-name="BarBaz" glib:get-type="bar_baz_get_type">
+ <class name="Baz" parent="GObject.Object" glib:type-struct="BazClass" glib:type-name="BarBaz" glib:get-type="bar_baz_get_type">
<field name="parent_instance">
<type name="GObject.Object"/>
</field>
</class>
- <record name="BazClass" glib:is-class-struct="1">
+ <record name="BazClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
parent="GObject.Object"
glib:type-name="AnnotationObject"
glib:get-type="annotation_object_get_type"
- glib:class-struct="ObjectClass">
+ glib:type-struct="ObjectClass">
<method name="method" c:identifier="annotation_object_method">
<return-value transfer-ownership="none">
<type name="int" c:type="gint"/>
</class>
<record name="ObjectClass"
c:type="AnnotationObjectClass"
- glib:is-class-struct-for="Object">
+ glib:is-gtype-struct-for="Object">
<field name="parent_class">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
</parameter>
</parameters>
</callback>
- <class name="Object" parent="GObject.Object" glib:class-struct="ObjectClass" glib:type-name="AnnotationObject" glib:get-type="annotation_object_get_type">
+ <class name="Object" parent="GObject.Object" glib:type-struct="ObjectClass" glib:type-name="AnnotationObject" glib:get-type="annotation_object_get_type">
<field name="parent_instance">
<type name="GObject.Object"/>
</field>
</parameters>
</glib:signal>
</class>
- <record name="ObjectClass" glib:is-class-struct="1">
+ <record name="ObjectClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
abstract="1"
glib:type-name="TestDrawable"
glib:get-type="test_drawable_get_type"
- glib:class-struct="TestDrawableClass">
+ glib:type-struct="TestDrawableClass">
<method name="do_foo" c:identifier="test_drawable_do_foo">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</class>
<record name="TestDrawableClass"
c:type="TestDrawableClass"
- glib:is-class-struct-for="TestDrawable">
+ glib:is-gtype-struct-for="TestDrawable">
<field name="parent_class">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
<include name="GObject" version="2.0"/>
<include name="GLib" version="2.0"/>
<namespace name="drawable" version="1.0" shared-library="drawable">
- <class name="TestDrawable" parent="GObject.Object" glib:class-struct="TestDrawableClass" abstract="1" glib:type-name="TestDrawable" glib:get-type="test_drawable_get_type">
+ <class name="TestDrawable" parent="GObject.Object" glib:type-struct="TestDrawableClass" abstract="1" glib:type-name="TestDrawable" glib:get-type="test_drawable_get_type">
<field name="parent_instance">
<type name="GObject.Object"/>
</field>
</parameters>
</method>
</class>
- <record name="TestDrawableClass" glib:is-class-struct="1">
+ <record name="TestDrawableClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
parent="GObject.Object"
glib:type-name="FooBuffer"
glib:get-type="foo_buffer_get_type"
- glib:class-struct="BufferClass">
+ glib:type-struct="BufferClass">
<implements name="Interface"/>
<method name="some_method" c:identifier="foo_buffer_some_method">
<return-value transfer-ownership="none">
</class>
<record name="BufferClass"
c:type="FooBufferClass"
- glib:is-class-struct-for="Buffer">
+ glib:is-gtype-struct-for="Buffer">
</record>
<callback name="Callback" c:type="FooCallback">
<return-value transfer-ownership="none">
<interface name="Interface"
c:type="FooInterface"
glib:type-name="FooInterface"
- glib:get-type="foo_interface_get_type">
+ glib:get-type="foo_interface_get_type"
+ glib:type-struct="InterfaceIface">
<callback name="do_foo" c:type="do_foo">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</parameters>
</callback>
</interface>
- <record name="InterfaceIface" c:type="FooInterfaceIface">
+ <record name="InterfaceIface"
+ c:type="FooInterfaceIface"
+ glib:is-gtype-struct-for="Interface">
<field name="parent_iface">
<type name="GObject.TypeInterface" c:type="GTypeInterface"/>
</field>
parent="GObject.Object"
glib:type-name="FooObject"
glib:get-type="foo_object_get_type"
- glib:class-struct="ObjectClass">
+ glib:type-struct="ObjectClass">
<implements name="Interface"/>
<constructor name="new" c:identifier="foo_object_new">
<return-value transfer-ownership="full">
</class>
<record name="ObjectClass"
c:type="FooObjectClass"
- glib:is-class-struct-for="Object">
+ glib:is-gtype-struct-for="Object">
<field name="parent_class">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
<interface name="SubInterface"
c:type="FooSubInterface"
glib:type-name="FooSubInterface"
- glib:get-type="foo_sub_interface_get_type">
+ glib:get-type="foo_sub_interface_get_type"
+ glib:type-struct="SubInterfaceIface">
<prerequisite name="Interface"/>
<method name="do_bar" c:identifier="foo_sub_interface_do_bar">
<return-value transfer-ownership="none">
</parameters>
</callback>
</interface>
- <record name="SubInterfaceIface" c:type="FooSubInterfaceIface">
+ <record name="SubInterfaceIface"
+ c:type="FooSubInterfaceIface"
+ glib:is-gtype-struct-for="SubInterface">
<field name="parent_iface">
<type name="GObject.TypeInterface" c:type="GTypeInterface"/>
</field>
abstract="1"
glib:type-name="FooSubobject"
glib:get-type="foo_subobject_get_type"
- glib:class-struct="SubobjectClass">
+ glib:type-struct="SubobjectClass">
<implements name="Interface"/>
<constructor name="new" c:identifier="foo_subobject_new">
<return-value transfer-ownership="full">
</class>
<record name="SubobjectClass"
c:type="FooSubobjectClass"
- glib:is-class-struct-for="Subobject">
+ glib:is-gtype-struct-for="Subobject">
<field name="parent_class">
<type name="ObjectClass" c:type="FooObjectClass"/>
</field>
</return-value>
</method>
</record>
- <class name="Buffer" parent="GObject.Object" glib:class-struct="BufferClass" glib:type-name="FooBuffer" glib:get-type="foo_buffer_get_type">
+ <class name="Buffer" parent="GObject.Object" glib:type-struct="BufferClass" glib:type-name="FooBuffer" glib:get-type="foo_buffer_get_type">
<implements name="Interface"/>
<method name="some_method" c:identifier="foo_buffer_some_method">
<return-value transfer-ownership="none">
</return-value>
</method>
</class>
- <record name="BufferClass" glib:is-class-struct="1"/>
+ <record name="BufferClass" glib:is-gtype-struct="1"/>
<callback name="Callback">
<return-value transfer-ownership="none">
<type name="boolean"/>
<member name="second" value="2"/>
<member name="third" value="4"/>
</bitfield>
- <interface name="Interface" glib:type-name="FooInterface" glib:get-type="foo_interface_get_type"/>
- <record name="InterfaceIface">
+ <interface name="Interface" glib:type-name="FooInterface" glib:get-type="foo_interface_get_type" glib:type-struct="InterfaceIface"/>
+ <record name="InterfaceIface" glib:is-gtype-struct="1">
<field name="parent_iface">
<type name="GObject.TypeInterface"/>
</field>
</record>
- <class name="Object" parent="GObject.Object" glib:class-struct="ObjectClass" glib:type-name="FooObject" glib:get-type="foo_object_get_type">
+ <class name="Object" parent="GObject.Object" glib:type-struct="ObjectClass" glib:type-name="FooObject" glib:get-type="foo_object_get_type">
<implements name="Interface"/>
<field name="parent_instance">
<type name="GObject.Object"/>
</parameters>
</glib:signal>
</class>
- <record name="ObjectClass" glib:is-class-struct="1">
+ <record name="ObjectClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
</field>
</record>
<record name="StructPrivate"/>
- <interface name="SubInterface" glib:type-name="FooSubInterface" glib:get-type="foo_sub_interface_get_type">
+ <interface name="SubInterface" glib:type-name="FooSubInterface" glib:get-type="foo_sub_interface_get_type" glib:type-struct="SubInterfaceIface">
<prerequisite name="Interface"/>
<method name="do_bar" c:identifier="foo_sub_interface_do_bar">
<return-value transfer-ownership="none">
</return-value>
</method>
</interface>
- <record name="SubInterfaceIface">
+ <record name="SubInterfaceIface" glib:is-gtype-struct="1">
<field name="parent_iface">
<type name="GObject.TypeInterface"/>
</field>
</record>
- <class name="Subobject" parent="Object" glib:class-struct="SubobjectClass" abstract="1" glib:type-name="FooSubobject" glib:get-type="foo_subobject_get_type">
+ <class name="Subobject" parent="Object" glib:type-struct="SubobjectClass" abstract="1" glib:type-name="FooSubobject" glib:get-type="foo_subobject_get_type">
<implements name="Interface"/>
<field name="parent_instance">
<type name="Object"/>
</return-value>
</constructor>
</class>
- <record name="SubobjectClass" glib:is-class-struct="1">
+ <record name="SubobjectClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="ObjectClass"/>
</field>
parent="GObject.Object"
glib:type-name="UtilityObject"
glib:get-type="utility_object_get_type"
- glib:class-struct="ObjectClass">
+ glib:type-struct="ObjectClass">
<method name="watch_dir" c:identifier="utility_object_watch_dir">
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</class>
<record name="ObjectClass"
c:type="UtilityObjectClass"
- glib:is-class-struct-for="Object">
+ glib:is-gtype-struct-for="Object">
<field name="parent_class">
<type name="GObject.ObjectClass" c:type="GObjectClass"/>
</field>
<member name="b" value="1"/>
<member name="c" value="2"/>
</enumeration>
- <class name="Object" parent="GObject.Object" glib:class-struct="ObjectClass" glib:type-name="UtilityObject" glib:get-type="utility_object_get_type">
+ <class name="Object" parent="GObject.Object" glib:type-struct="ObjectClass" glib:type-name="UtilityObject" glib:get-type="utility_object_get_type">
<field name="parent_instance">
<type name="GObject.Object"/>
</field>
</parameters>
</method>
</class>
- <record name="ObjectClass" glib:is-class-struct="1">
+ <record name="ObjectClass" glib:is-gtype-struct="1">
<field name="parent_class">
<type name="GObject.ObjectClass"/>
</field>
const gchar *type_name;
const gchar *type_init;
gboolean deprecated;
- gboolean is_class_struct;
+ gboolean is_gtype_struct;
gint i;
int n_elts;
if (deprecated)
xml_printf (file, " deprecated=\"1\"");
- is_class_struct = g_struct_info_is_class_struct (info);
- if (is_class_struct)
- xml_printf (file, " glib:is-class-struct=\"1\"");
+ is_gtype_struct = g_struct_info_is_gtype_struct (info);
+ if (is_gtype_struct)
+ xml_printf (file, " glib:is-gtype-struct=\"1\"");
n_elts = g_struct_info_get_n_fields (info) + g_struct_info_get_n_methods (info);
if (n_elts > 0)
class_struct = g_object_info_get_class_struct (info);
if (class_struct)
{
- write_type_name_attribute (namespace, (GIBaseInfo*) class_struct, "glib:class-struct", file);
+ write_type_name_attribute (namespace, (GIBaseInfo*) class_struct, "glib:type-struct", file);
g_base_info_unref ((GIBaseInfo*)class_struct);
}
const gchar *name;
const gchar *type_name;
const gchar *type_init;
+ GIStructInfo *class_struct;
gboolean deprecated;
gint i;
xml_printf (file, " name=\"%s\" glib:type-name=\"%s\" glib:get-type=\"%s\"",
name, type_name, type_init);
+ class_struct = g_interface_info_get_iface_struct (info);
+ if (class_struct)
+ {
+ write_type_name_attribute (namespace, (GIBaseInfo*) class_struct, "glib:type-struct", file);
+ g_base_info_unref ((GIBaseInfo*)class_struct);
+ }
+
if (deprecated)
xml_printf (file, " deprecated=\"1\"");