mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 18:52:09 +01:00
gparam: Add setters for static nick and blurb
We are going to need them for GProperty. https://bugzilla.gnome.org/show_bug.cgi?id=648526
This commit is contained in:
parent
b47e898e5c
commit
12947909b5
@ -283,6 +283,56 @@ g_param_spec_ref_sink (GParamSpec *pspec)
|
||||
return pspec;
|
||||
}
|
||||
|
||||
/**
|
||||
* g_param_spec_set_static_nick:
|
||||
* @pspec: a valid #GParamSpec
|
||||
* @nick: a static string with a human readable name for the @pspec
|
||||
*
|
||||
* Sets the "nick" of a #GParamSpec, unless one has been already specified.
|
||||
*
|
||||
* The passed string must be static.
|
||||
*
|
||||
* Since: 2.38
|
||||
*/
|
||||
void
|
||||
g_param_spec_set_static_nick (GParamSpec *pspec,
|
||||
const char *nick)
|
||||
{
|
||||
g_return_if_fail (G_IS_PARAM_SPEC (pspec));
|
||||
g_return_if_fail (nick != NULL);
|
||||
|
||||
if (pspec->_nick != NULL)
|
||||
return;
|
||||
|
||||
pspec->_nick = (gchar *) nick;
|
||||
pspec->flags |= G_PARAM_STATIC_NICK;
|
||||
}
|
||||
|
||||
/**
|
||||
* g_param_spec_set_static_blurb:
|
||||
* @pspec: a valid #GParamSpec
|
||||
* @blurb: a static string with a human readable description for the @pspec
|
||||
*
|
||||
* Sets the "blurb" of a #GParamSpec, unless one has been already specified.
|
||||
*
|
||||
* The passed string must be static.
|
||||
*
|
||||
* Since: 2.38
|
||||
*/
|
||||
void
|
||||
g_param_spec_set_static_blurb (GParamSpec *pspec,
|
||||
const char *blurb)
|
||||
{
|
||||
g_return_if_fail (G_IS_PARAM_SPEC (pspec));
|
||||
g_return_if_fail (blurb != NULL);
|
||||
|
||||
if (pspec->_blurb != NULL)
|
||||
return;
|
||||
|
||||
pspec->_blurb = (gchar *) blurb;
|
||||
pspec->flags |= G_PARAM_STATIC_BLURB;
|
||||
}
|
||||
|
||||
/**
|
||||
* g_param_spec_get_name:
|
||||
* @pspec: a valid #GParamSpec
|
||||
|
@ -321,6 +321,12 @@ GLIB_AVAILABLE_IN_ALL
|
||||
const gchar * g_param_spec_get_nick (GParamSpec *pspec);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
const gchar * g_param_spec_get_blurb (GParamSpec *pspec);
|
||||
GLIB_AVAILABLE_IN_2_38
|
||||
void g_param_spec_set_static_nick (GParamSpec *pspec,
|
||||
const char *nick);
|
||||
GLIB_AVAILABLE_IN_2_38
|
||||
void g_param_spec_set_static_blurb (GParamSpec *pspec,
|
||||
const char *blurb);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
void g_value_set_param (GValue *value,
|
||||
GParamSpec *param);
|
||||
|
Loading…
x
Reference in New Issue
Block a user