diff options
author | Colin Walters <walters@verbum.org> | 2009-02-19 21:48:51 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2009-03-03 17:26:37 -0500 |
commit | d5215b23315e7c9c22c6a32218bb6f8027a9dd4c (patch) | |
tree | e8d9e360099c756677ad23a1039f4d05533008b9 /tests/scanner | |
parent | 2bdd2bf9303ae0e718c00ec84078336e722138f1 (diff) | |
download | gobject-introspection-d5215b23315e7c9c22c6a32218bb6f8027a9dd4c.tar.gz |
Bug 571548 - Generic attributes
We now support an extensible mechanism where arbitrary key-value
pairs may be associated with almost all items, including objects,
methods, and properties.
These attributes appear in both the .gir and the .typelib.
Diffstat (limited to 'tests/scanner')
-rw-r--r-- | tests/scanner/annotation-1.0-expected.gir | 7 | ||||
-rw-r--r-- | tests/scanner/annotation-1.0-expected.tgir | 7 | ||||
-rw-r--r-- | tests/scanner/annotation.c | 9 | ||||
-rw-r--r-- | tests/scanner/annotation.h | 4 |
4 files changed, 27 insertions, 0 deletions
diff --git a/tests/scanner/annotation-1.0-expected.gir b/tests/scanner/annotation-1.0-expected.gir index 053d459a..f4273454 100644 --- a/tests/scanner/annotation-1.0-expected.gir +++ b/tests/scanner/annotation-1.0-expected.gir @@ -62,6 +62,7 @@ and/or use gtk-doc annotations. --> glib:type-name="AnnotationObject" glib:get-type="annotation_object_get_type" glib:type-struct="ObjectClass"> + <attribute name="org.example.Test" value="cows"/> <method name="method" c:identifier="annotation_object_method"> <return-value transfer-ownership="none"> <type name="int" c:type="gint"/> @@ -426,6 +427,12 @@ type."> <type name="GObject.Object" c:type="GObject*"/> </return-value> </method> + <method name="extra_annos" c:identifier="annotation_object_extra_annos"> + <attribute name="org.foobar" value="testvalue"/> + <return-value transfer-ownership="none"> + <type name="none" c:type="void"/> + </return-value> + </method> <property name="string-property" version="1.0" deprecated="Use better-string-property instead" diff --git a/tests/scanner/annotation-1.0-expected.tgir b/tests/scanner/annotation-1.0-expected.tgir index 643ffb28..2075143c 100644 --- a/tests/scanner/annotation-1.0-expected.tgir +++ b/tests/scanner/annotation-1.0-expected.tgir @@ -48,6 +48,7 @@ </parameters> </callback> <class name="Object" parent="GObject.Object" glib:type-struct="ObjectClass" glib:type-name="AnnotationObject" glib:get-type="annotation_object_get_type"> + <attribute name="org.example.Test" value="cows"/> <field name="parent_instance"> <type name="GObject.Object"/> </field> @@ -323,6 +324,12 @@ <type name="GObject.Object"/> </return-value> </method> + <method name="extra_annos" c:identifier="annotation_object_extra_annos"> + <attribute name="org.foobar" value="testvalue"/> + <return-value transfer-ownership="none"> + <type name="none"/> + </return-value> + </method> <property name="string-property" writable="1" construct="1"> <type name="utf8"/> </property> diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c index 20c27295..41508e2c 100644 --- a/tests/scanner/annotation.c +++ b/tests/scanner/annotation.c @@ -565,5 +565,14 @@ annotation_versioned (void) { } +/** + * annotation_object_extra_annos: + * + * Attributes: (org.foobar testvalue) + */ +void +annotation_object_extra_annos (AnnotationObject *object) +{ +} char backslash_parsing_tester_2 = '\\'; diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h index 6904f15c..79a686d0 100644 --- a/tests/scanner/annotation.h +++ b/tests/scanner/annotation.h @@ -25,6 +25,8 @@ typedef GList* (*AnnotationListCallback) (GList *in); * AnnotationObject: * * This is an object used to test annotations. + * + * Attributes: (org.example.Test cows) */ typedef struct _AnnotationObject AnnotationObject; typedef struct _AnnotationObjectClass AnnotationObjectClass; @@ -111,6 +113,8 @@ void annotation_versioned (void); char ** annotation_string_zero_terminated (void); void annotation_string_zero_terminated_out (char ***out); +void annotation_object_extra_annos (AnnotationObject *object); + /** * AnnotationStruct: * |