summaryrefslogtreecommitdiff
path: root/girepository
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-04-08 20:04:03 +0100
committerEmmanuele Bassi <ebassi@gmail.com>2022-01-09 19:21:01 +0000
commitb712c7cdb7a7b12874f6fd5e127dfc1fd457ef34 (patch)
tree232d51419906759c698150d787d724cdb9be4729 /girepository
parentc71596d515b900c20da54077f5f6d0071547ec7d (diff)
downloadgobject-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 'girepository')
-rw-r--r--girepository/girparser.c2
-rw-r--r--girepository/girwriter.c3
-rw-r--r--girepository/gitypes.h15
3 files changed, 14 insertions, 6 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 470f0933..e5878b43 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -1244,6 +1244,8 @@ start_parameter (GMarkupParseContext *context,
param->scope = GI_SCOPE_TYPE_ASYNC;
else if (scope && strcmp (scope, "notified") == 0)
param->scope = GI_SCOPE_TYPE_NOTIFIED;
+ else if (scope && strcmp (scope, "forever") == 0)
+ param->scope = GI_SCOPE_TYPE_FOREVER;
else
param->scope = GI_SCOPE_TYPE_INVALID;
diff --git a/girepository/girwriter.c b/girepository/girwriter.c
index a45edfd8..44e18801 100644
--- a/girepository/girwriter.c
+++ b/girepository/girwriter.c
@@ -532,6 +532,9 @@ write_callable_info (const gchar *namespace,
case GI_SCOPE_TYPE_NOTIFIED:
xml_printf (file, " scope=\"notified\"");
break;
+ case GI_SCOPE_TYPE_FOREVER:
+ xml_printf (file, " scope=\"forever\"");
+ break;
default:
g_assert_not_reached ();
}
diff --git a/girepository/gitypes.h b/girepository/gitypes.h
index 33897520..83268e89 100644
--- a/girepository/gitypes.h
+++ b/girepository/gitypes.h
@@ -358,12 +358,14 @@ typedef enum {
* GIScopeType:
* @GI_SCOPE_TYPE_INVALID: The argument is not of callback type.
* @GI_SCOPE_TYPE_CALL: The callback and associated user_data is only
- * used during the call to this function.
+ * used during the call to this function.
* @GI_SCOPE_TYPE_ASYNC: The callback and associated user_data is
- * only used until the callback is invoked, and the callback.
- * is invoked always exactly once.
- * @GI_SCOPE_TYPE_NOTIFIED: The callback and and associated
- * user_data is used until the caller is notfied via the destroy_notify.
+ * only used until the callback is invoked, and the callback.
+ * is invoked always exactly once.
+ * @GI_SCOPE_TYPE_NOTIFIED: The callback and associated
+ * user_data is used until the caller is notfied via the destroy_notify.
+ * @GI_SCOPE_TYPE_FOREVER: The callback and associated user_data is
+ * used until the process terminates
*
* Scope type of a #GIArgInfo representing callback, determines how the
* callback is invoked and is used to decided when the invoke structs
@@ -373,7 +375,8 @@ typedef enum {
GI_SCOPE_TYPE_INVALID,
GI_SCOPE_TYPE_CALL,
GI_SCOPE_TYPE_ASYNC,
- GI_SCOPE_TYPE_NOTIFIED
+ GI_SCOPE_TYPE_NOTIFIED,
+ GI_SCOPE_TYPE_FOREVER
} GIScopeType;
/**