mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-23 17:38:54 +02:00
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
This commit is contained in:
committed by
Emmanuele Bassi
parent
c493763ff2
commit
4398e1fde2
@@ -1244,6 +1244,8 @@ start_parameter (GMarkupParseContext *context,
|
|||||||
param->scope = GI_SCOPE_TYPE_ASYNC;
|
param->scope = GI_SCOPE_TYPE_ASYNC;
|
||||||
else if (scope && strcmp (scope, "notified") == 0)
|
else if (scope && strcmp (scope, "notified") == 0)
|
||||||
param->scope = GI_SCOPE_TYPE_NOTIFIED;
|
param->scope = GI_SCOPE_TYPE_NOTIFIED;
|
||||||
|
else if (scope && strcmp (scope, "forever") == 0)
|
||||||
|
param->scope = GI_SCOPE_TYPE_FOREVER;
|
||||||
else
|
else
|
||||||
param->scope = GI_SCOPE_TYPE_INVALID;
|
param->scope = GI_SCOPE_TYPE_INVALID;
|
||||||
|
|
||||||
|
@@ -532,6 +532,9 @@ write_callable_info (const gchar *namespace,
|
|||||||
case GI_SCOPE_TYPE_NOTIFIED:
|
case GI_SCOPE_TYPE_NOTIFIED:
|
||||||
xml_printf (file, " scope=\"notified\"");
|
xml_printf (file, " scope=\"notified\"");
|
||||||
break;
|
break;
|
||||||
|
case GI_SCOPE_TYPE_FOREVER:
|
||||||
|
xml_printf (file, " scope=\"forever\"");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
}
|
}
|
||||||
|
15
gitypes.h
15
gitypes.h
@@ -358,12 +358,14 @@ typedef enum {
|
|||||||
* GIScopeType:
|
* GIScopeType:
|
||||||
* @GI_SCOPE_TYPE_INVALID: The argument is not of callback type.
|
* @GI_SCOPE_TYPE_INVALID: The argument is not of callback type.
|
||||||
* @GI_SCOPE_TYPE_CALL: The callback and associated user_data is only
|
* @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
|
* @GI_SCOPE_TYPE_ASYNC: The callback and associated user_data is
|
||||||
* only used until the callback is invoked, and the callback.
|
* only used until the callback is invoked, and the callback.
|
||||||
* is invoked always exactly once.
|
* is invoked always exactly once.
|
||||||
* @GI_SCOPE_TYPE_NOTIFIED: The callback and and associated
|
* @GI_SCOPE_TYPE_NOTIFIED: The callback and associated
|
||||||
* user_data is used until the caller is notfied via the destroy_notify.
|
* 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
|
* Scope type of a #GIArgInfo representing callback, determines how the
|
||||||
* callback is invoked and is used to decided when the invoke structs
|
* 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_INVALID,
|
||||||
GI_SCOPE_TYPE_CALL,
|
GI_SCOPE_TYPE_CALL,
|
||||||
GI_SCOPE_TYPE_ASYNC,
|
GI_SCOPE_TYPE_ASYNC,
|
||||||
GI_SCOPE_TYPE_NOTIFIED
|
GI_SCOPE_TYPE_NOTIFIED,
|
||||||
|
GI_SCOPE_TYPE_FOREVER
|
||||||
} GIScopeType;
|
} GIScopeType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user