Bug 557011 - Add g_object_info_get_abstract

svn path=/trunk/; revision=757
This commit is contained in:
Colin Walters 2008-10-20 17:04:17 +00:00
parent 0de03983be
commit c3330c06c7
6 changed files with 21 additions and 5 deletions

View File

@ -1123,6 +1123,14 @@ g_object_info_get_parent (GIObjectInfo *info)
return NULL;
}
gboolean
g_object_info_get_abstract (GIObjectInfo *info)
{
GIBaseInfo *base = (GIBaseInfo *)info;
ObjectBlob *blob = (ObjectBlob *)&base->typelib->data[base->offset];
return blob->abstract != 0;
}
const gchar *
g_object_info_get_type_name (GIObjectInfo *info)
{

View File

@ -392,6 +392,7 @@ GIValueInfo * g_enum_info_get_value (GIEnumInfo *in
const gchar * g_object_info_get_type_name (GIObjectInfo *info);
const gchar * g_object_info_get_type_init (GIObjectInfo *info);
gboolean g_object_info_get_abstract (GIObjectInfo *info);
GIObjectInfo * g_object_info_get_parent (GIObjectInfo *info);
gint g_object_info_get_n_interfaces (GIObjectInfo *info);
GIInterfaceInfo * g_object_info_get_interface (GIObjectInfo *info,

View File

@ -1872,6 +1872,7 @@ g_ir_node_build_typelib (GIrNode *node,
GList *members;
blob->blob_type = BLOB_TYPE_OBJECT;
blob->abstract = object->abstract;
blob->deprecated = object->deprecated;
blob->reserved = 0;
blob->name = write_string (node->name, strings, data, offset2);

View File

@ -212,6 +212,7 @@ struct _GIrNodeInterface
{
GIrNode node;
gboolean abstract;
gboolean deprecated;
gchar *gtype_name;

View File

@ -1362,12 +1362,14 @@ start_class (GMarkupParseContext *context,
const gchar *typename;
const gchar *typeinit;
const gchar *deprecated;
const gchar *abstract;
name = find_attribute ("name", attribute_names, attribute_values);
parent = find_attribute ("parent", 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);
abstract = find_attribute ("abstract", attribute_names, attribute_values);
if (name == NULL)
MISSING_ATTRIBUTE (context, error, element_name, "name");
@ -1388,7 +1390,9 @@ start_class (GMarkupParseContext *context,
iface->deprecated = TRUE;
else
iface->deprecated = FALSE;
iface->abstract = abstract && strcmp (abstract, "1") == 0;
ctx->current_node = (GIrNode *) iface;
ctx->current_module->entries =
g_list_append (ctx->current_module->entries, iface);

View File

@ -407,9 +407,10 @@ typedef struct
typedef struct
{
guint16 blob_type; /* 7 */
guint16 deprecated : 1;
guint16 reserved :15;
guint32 name;
guint16 deprecated : 1;
guint16 abstract : 1;
guint16 reserved :14;
guint32 name;
guint32 gtype_name;
guint32 gtype_init;
@ -440,7 +441,7 @@ typedef struct
typedef struct
{
guint16 blob_type;
guint16 deprecated : 1;
guint16 deprecated : 1;
guint16 reserved :15;
guint32 name;