summaryrefslogtreecommitdiff
path: root/girepository
diff options
context:
space:
mode:
authorColin Walters <walters@src.gnome.org>2008-10-20 17:04:17 +0000
committerColin Walters <walters@src.gnome.org>2008-10-20 17:04:17 +0000
commitad982938b3dfdc5a5df7c18ec49116e3b6bdce1a (patch)
treeb58d85b68be8dec773a779982e6af1793476ad94 /girepository
parentf20b1189e8ce6731db8ca07f890a457afab0f920 (diff)
downloadgobject-introspection-ad982938b3dfdc5a5df7c18ec49116e3b6bdce1a.tar.gz
Bug 557011 - Add g_object_info_get_abstract
svn path=/trunk/; revision=757
Diffstat (limited to 'girepository')
-rw-r--r--girepository/ginfo.c8
-rw-r--r--girepository/girepository.h1
-rw-r--r--girepository/girnode.c1
-rw-r--r--girepository/girnode.h1
-rw-r--r--girepository/girparser.c6
-rw-r--r--girepository/gtypelib.h9
6 files changed, 21 insertions, 5 deletions
diff --git a/girepository/ginfo.c b/girepository/ginfo.c
index ccb1760a..c165ade0 100644
--- a/girepository/ginfo.c
+++ b/girepository/ginfo.c
@@ -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)
{
diff --git a/girepository/girepository.h b/girepository/girepository.h
index 42db8d33..2e6c5c8d 100644
--- a/girepository/girepository.h
+++ b/girepository/girepository.h
@@ -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,
diff --git a/girepository/girnode.c b/girepository/girnode.c
index f4f337a7..ee1af3b3 100644
--- a/girepository/girnode.c
+++ b/girepository/girnode.c
@@ -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);
diff --git a/girepository/girnode.h b/girepository/girnode.h
index eba8c6b9..905bf90a 100644
--- a/girepository/girnode.h
+++ b/girepository/girnode.h
@@ -212,6 +212,7 @@ struct _GIrNodeInterface
{
GIrNode node;
+ gboolean abstract;
gboolean deprecated;
gchar *gtype_name;
diff --git a/girepository/girparser.c b/girepository/girparser.c
index f5bd7cca..539d68d2 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -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);
diff --git a/girepository/gtypelib.h b/girepository/gtypelib.h
index 54bf0523..443d34b6 100644
--- a/girepository/gtypelib.h
+++ b/girepository/gtypelib.h
@@ -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;