diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-04-08 20:04:03 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2022-01-09 19:21:01 +0000 |
commit | b712c7cdb7a7b12874f6fd5e127dfc1fd457ef34 (patch) | |
tree | 232d51419906759c698150d787d724cdb9be4729 /giscanner | |
parent | c71596d515b900c20da54077f5f6d0071547ec7d (diff) | |
download | gobject-introspection-b712c7cdb7a7b12874f6fd5e127dfc1fd457ef34.tar.gz |
Add "forever" scope
Some functions are meant to exist for the entire duration of the
process, and thus have no need for a notification function because
one will never be called.
Fixes: #49
Diffstat (limited to 'giscanner')
-rw-r--r-- | giscanner/annotationparser.py | 4 | ||||
-rw-r--r-- | giscanner/ast.py | 1 | ||||
-rw-r--r-- | giscanner/introspectablepass.py | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index 3307327e..9bba315b 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -286,10 +286,12 @@ NOT_OPTIONS = [OPT_NOT_NULLABLE] OPT_SCOPE_ASYNC = 'async' OPT_SCOPE_CALL = 'call' OPT_SCOPE_NOTIFIED = 'notified' +OPT_SCOPE_FOREVER = 'forever' SCOPE_OPTIONS = [OPT_SCOPE_ASYNC, OPT_SCOPE_CALL, - OPT_SCOPE_NOTIFIED] + OPT_SCOPE_NOTIFIED, + OPT_SCOPE_FOREVER] # (transfer) annotation options OPT_TRANSFER_CONTAINER = 'container' diff --git a/giscanner/ast.py b/giscanner/ast.py index b760c71d..c99c93d8 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -365,6 +365,7 @@ PARAM_DIRECTION_INOUT = 'inout' PARAM_SCOPE_CALL = 'call' PARAM_SCOPE_ASYNC = 'async' PARAM_SCOPE_NOTIFIED = 'notified' +PARAM_SCOPE_FOREVER = 'forever' PARAM_TRANSFER_NONE = 'none' PARAM_TRANSFER_CONTAINER = 'container' diff --git a/giscanner/introspectablepass.py b/giscanner/introspectablepass.py index 305e192e..d09b12a4 100644 --- a/giscanner/introspectablepass.py +++ b/giscanner/introspectablepass.py @@ -103,7 +103,7 @@ class IntrospectablePass(object): parent, node, "Missing (scope) annotation for callback without " - "GDestroyNotify (valid: %s, %s)" % (ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC)) + "GDestroyNotify (valid: %s, %s, %s)" % (ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC, ast.PARAM_SCOPE_FOREVER)) parent.introspectable = False return |