summaryrefslogtreecommitdiff
path: root/giscanner/annotationparser.py
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2021-06-23 19:12:18 +0100
committerEmmanuele Bassi <ebassi@gmail.com>2022-02-12 15:27:38 +0000
commit59a77cc7a96e34aa0d49b8c82f647115a8286a56 (patch)
tree8f696c73d427e5a2001132e704c48abf50fd14b1 /giscanner/annotationparser.py
parent9cbcd6dd958c090d967a6e74f8fd5e130cf173b8 (diff)
downloadgobject-introspection-59a77cc7a96e34aa0d49b8c82f647115a8286a56.tar.gz
scanner: Add (emitter) annotation for signals
Signals that have an emitter function should have an annotation to allow consumers of the introspection XML to effectively pair signals to their corresponding emitter functions that share the same prototype.
Diffstat (limited to 'giscanner/annotationparser.py')
-rw-r--r--giscanner/annotationparser.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index 9fbcfe7d..9a2677af 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -195,6 +195,7 @@ ANN_CLOSURE = 'closure'
ANN_CONSTRUCTOR = 'constructor'
ANN_DESTROY = 'destroy'
ANN_ELEMENT_TYPE = 'element-type'
+ANN_EMITTER = 'emitter'
ANN_FOREIGN = 'foreign'
ANN_GET_PROPERTY = 'get-property'
ANN_GET_VALUE_FUNC = 'get-value-func'
@@ -229,6 +230,7 @@ GI_ANNS = [ANN_ALLOW_NONE,
ANN_CONSTRUCTOR,
ANN_DESTROY,
ANN_ELEMENT_TYPE,
+ ANN_EMITTER,
ANN_FOREIGN,
ANN_GET_PROPERTY,
ANN_GET_VALUE_FUNC,
@@ -810,6 +812,18 @@ class GtkDocAnnotatable(object):
self._validate_annotation(position, ann_name, options, min_n_options=1, max_n_options=2)
+ def _do_validate_emitter(self, position, ann_name, options):
+ '''
+ Validate the ``(emitter)`` annotation.
+
+ :param position: :class:`giscanner.message.Position` of the line in the source file
+ containing the annotation to be validated
+ :param ann_name: name of the annotation holding the options to validate
+ :param options: annotation options to validate
+ '''
+
+ self._validate_annotation(position, ann_name, options, exact_n_options=1)
+
def _do_validate_foreign(self, position, ann_name, options):
'''
Validate the ``(foreign)`` annotation.
@@ -1153,6 +1167,7 @@ class GtkDocCommentBlock(GtkDocAnnotatable):
valid_annotations = (
ANN_ATTRIBUTES,
ANN_CONSTRUCTOR,
+ ANN_EMITTER,
ANN_FOREIGN,
ANN_GET_PROPERTY,
ANN_GET_VALUE_FUNC,