<refentry id="gobject-GParamSpec">
<refmeta>
<refentrytitle role="top_of_page" id="gobject-GParamSpec.top_of_page">GParamSpec</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GOBJECT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GParamSpec</refname>
<refpurpose>Metadata for parameter specifications</refpurpose>
</refnamediv>

<refsynopsisdiv id="gobject-GParamSpec.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;glib-object.h&gt;

#define             <link linkend="G-TYPE-IS-PARAM--CAPS">G_TYPE_IS_PARAM</link>                     (type)
#define             <link linkend="G-PARAM-SPEC--CAPS">G_PARAM_SPEC</link>                        (pspec)
#define             <link linkend="G-IS-PARAM-SPEC--CAPS">G_IS_PARAM_SPEC</link>                     (pspec)
#define             <link linkend="G-PARAM-SPEC-CLASS--CAPS">G_PARAM_SPEC_CLASS</link>                  (pclass)
#define             <link linkend="G-IS-PARAM-SPEC-CLASS--CAPS">G_IS_PARAM_SPEC_CLASS</link>               (pclass)
#define             <link linkend="G-PARAM-SPEC-GET-CLASS--CAPS">G_PARAM_SPEC_GET_CLASS</link>              (pspec)
#define             <link linkend="G-PARAM-SPEC-TYPE--CAPS">G_PARAM_SPEC_TYPE</link>                   (pspec)
#define             <link linkend="G-PARAM-SPEC-TYPE-NAME--CAPS">G_PARAM_SPEC_TYPE_NAME</link>              (pspec)
#define             <link linkend="G-PARAM-SPEC-VALUE-TYPE--CAPS">G_PARAM_SPEC_VALUE_TYPE</link>             (pspec)
                    <link linkend="GParamSpec">GParamSpec</link>;
                    <link linkend="GParamSpecClass">GParamSpecClass</link>;
enum                <link linkend="GParamFlags">GParamFlags</link>;
#define             <link linkend="G-PARAM-READWRITE--CAPS">G_PARAM_READWRITE</link>
#define             <link linkend="G-PARAM-STATIC-STRINGS--CAPS">G_PARAM_STATIC_STRINGS</link>
#define             <link linkend="G-PARAM-MASK--CAPS">G_PARAM_MASK</link>
#define             <link linkend="G-PARAM-USER-SHIFT--CAPS">G_PARAM_USER_SHIFT</link>
<link linkend="GParamSpec">GParamSpec</link>*         <link linkend="g-param-spec-ref">g_param_spec_ref</link>                    (<link linkend="GParamSpec">GParamSpec</link> *pspec);
<link linkend="void">void</link>                <link linkend="g-param-spec-unref">g_param_spec_unref</link>                  (<link linkend="GParamSpec">GParamSpec</link> *pspec);
<link linkend="void">void</link>                <link linkend="g-param-spec-sink">g_param_spec_sink</link>                   (<link linkend="GParamSpec">GParamSpec</link> *pspec);
<link linkend="GParamSpec">GParamSpec</link>*         <link linkend="g-param-spec-ref-sink">g_param_spec_ref_sink</link>               (<link linkend="GParamSpec">GParamSpec</link> *pspec);
<link linkend="void">void</link>                <link linkend="g-param-value-set-default">g_param_value_set_default</link>           (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GValue">GValue</link> *value);
<link linkend="gboolean">gboolean</link>            <link linkend="g-param-value-defaults">g_param_value_defaults</link>              (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GValue">GValue</link> *value);
<link linkend="gboolean">gboolean</link>            <link linkend="g-param-value-validate">g_param_value_validate</link>              (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GValue">GValue</link> *value);
<link linkend="gboolean">gboolean</link>            <link linkend="g-param-value-convert">g_param_value_convert</link>               (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         const <link linkend="GValue">GValue</link> *src_value,
                                                         <link linkend="GValue">GValue</link> *dest_value,
                                                         <link linkend="gboolean">gboolean</link> strict_validation);
<link linkend="gint">gint</link>                <link linkend="g-param-values-cmp">g_param_values_cmp</link>                  (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         const <link linkend="GValue">GValue</link> *value1,
                                                         const <link linkend="GValue">GValue</link> *value2);
const <link linkend="gchar">gchar</link>*        <link linkend="g-param-spec-get-name">g_param_spec_get_name</link>               (<link linkend="GParamSpec">GParamSpec</link> *pspec);
const <link linkend="gchar">gchar</link>*        <link linkend="g-param-spec-get-nick">g_param_spec_get_nick</link>               (<link linkend="GParamSpec">GParamSpec</link> *pspec);
const <link linkend="gchar">gchar</link>*        <link linkend="g-param-spec-get-blurb">g_param_spec_get_blurb</link>              (<link linkend="GParamSpec">GParamSpec</link> *pspec);
<link linkend="gpointer">gpointer</link>            <link linkend="g-param-spec-get-qdata">g_param_spec_get_qdata</link>              (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GQuark">GQuark</link> quark);
<link linkend="void">void</link>                <link linkend="g-param-spec-set-qdata">g_param_spec_set_qdata</link>              (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GQuark">GQuark</link> quark,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="void">void</link>                <link linkend="g-param-spec-set-qdata-full">g_param_spec_set_qdata_full</link>         (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GQuark">GQuark</link> quark,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> destroy);
<link linkend="gpointer">gpointer</link>            <link linkend="g-param-spec-steal-qdata">g_param_spec_steal_qdata</link>            (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GQuark">GQuark</link> quark);
<link linkend="GParamSpec">GParamSpec</link>*         <link linkend="g-param-spec-get-redirect-target">g_param_spec_get_redirect_target</link>    (<link linkend="GParamSpec">GParamSpec</link> *pspec);
<link linkend="gpointer">gpointer</link>            <link linkend="g-param-spec-internal">g_param_spec_internal</link>               (<link linkend="GType">GType</link> param_type,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="gchar">gchar</link> *nick,
                                                         const <link linkend="gchar">gchar</link> *blurb,
                                                         <link linkend="GParamFlags">GParamFlags</link> flags);
                    <link linkend="GParamSpecTypeInfo">GParamSpecTypeInfo</link>;
<link linkend="GType">GType</link>               <link linkend="g-param-type-register-static">g_param_type_register_static</link>        (const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="GParamSpecTypeInfo">GParamSpecTypeInfo</link> *pspec_info);
                    <link linkend="GParamSpecPool">GParamSpecPool</link>;
<link linkend="GParamSpecPool">GParamSpecPool</link>*     <link linkend="g-param-spec-pool-new">g_param_spec_pool_new</link>               (<link linkend="gboolean">gboolean</link> type_prefixing);
<link linkend="void">void</link>                <link linkend="g-param-spec-pool-insert">g_param_spec_pool_insert</link>            (<link linkend="GParamSpecPool">GParamSpecPool</link> *pool,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GType">GType</link> owner_type);
<link linkend="void">void</link>                <link linkend="g-param-spec-pool-remove">g_param_spec_pool_remove</link>            (<link linkend="GParamSpecPool">GParamSpecPool</link> *pool,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec);
<link linkend="GParamSpec">GParamSpec</link>*         <link linkend="g-param-spec-pool-lookup">g_param_spec_pool_lookup</link>            (<link linkend="GParamSpecPool">GParamSpecPool</link> *pool,
                                                         const <link linkend="gchar">gchar</link> *param_name,
                                                         <link linkend="GType">GType</link> owner_type,
                                                         <link linkend="gboolean">gboolean</link> walk_ancestors);
<link linkend="GParamSpec">GParamSpec</link>**        <link linkend="g-param-spec-pool-list">g_param_spec_pool_list</link>              (<link linkend="GParamSpecPool">GParamSpecPool</link> *pool,
                                                         <link linkend="GType">GType</link> owner_type,
                                                         <link linkend="guint">guint</link> *n_pspecs_p);
<link linkend="GList">GList</link>*              <link linkend="g-param-spec-pool-list-owned">g_param_spec_pool_list_owned</link>        (<link linkend="GParamSpecPool">GParamSpecPool</link> *pool,
                                                         <link linkend="GType">GType</link> owner_type);
</synopsis>
</refsynopsisdiv>









<refsect1 id="gobject-GParamSpec.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="GParamSpec"><type>GParamSpec</type></link> is an object structure that encapsulates the metadata
required to specify parameters, such as e.g. <link linkend="GObject"><type>GObject</type></link> properties.
</para>
<para>
<para id="canonical-parameter-name">
Parameter names need to start with a letter (a-z or A-Z). Subsequent
characters can be letters, numbers or a '-'.
All other characters are replaced by a '-' during construction.
The result of this replacement is called the canonical name of the
parameter.
</para></para>
<para>
</para>
</refsect1>

<refsect1 id="gobject-GParamSpec.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="G-TYPE-IS-PARAM--CAPS" role="macro">
<title>G_TYPE_IS_PARAM()</title>
<indexterm zone="G-TYPE-IS-PARAM--CAPS"><primary sortas="TYPE_IS_PARAM">G_TYPE_IS_PARAM</primary></indexterm><programlisting>#define G_TYPE_IS_PARAM(type)		(G_TYPE_FUNDAMENTAL (type) == G_TYPE_PARAM)
</programlisting>
<para>
Checks whether <parameter>type</parameter> "is a" <link linkend="G-TYPE-PARAM--CAPS"><literal>G_TYPE_PARAM</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GType"><type>GType</type></link> ID
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-PARAM-SPEC--CAPS" role="macro">
<title>G_PARAM_SPEC()</title>
<indexterm zone="G-PARAM-SPEC--CAPS"><primary sortas="PARAM_SPEC">G_PARAM_SPEC</primary></indexterm><programlisting>#define G_PARAM_SPEC(pspec)		(G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM, GParamSpec))
</programlisting>
<para>
Casts a derived <link linkend="GParamSpec"><type>GParamSpec</type></link> object (e.g. of type <link linkend="GParamSpecInt"><type>GParamSpecInt</type></link>) into
a <link linkend="GParamSpec"><type>GParamSpec</type></link> object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-IS-PARAM-SPEC--CAPS" role="macro">
<title>G_IS_PARAM_SPEC()</title>
<indexterm zone="G-IS-PARAM-SPEC--CAPS"><primary sortas="IS_PARAM_SPEC">G_IS_PARAM_SPEC</primary></indexterm><programlisting>#define G_IS_PARAM_SPEC(pspec)		(G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM))
</programlisting>
<para>
Checks whether <parameter>pspec</parameter> "is a" valid <link linkend="GParamSpec"><type>GParamSpec</type></link> structure of type <link linkend="G-TYPE-PARAM--CAPS"><literal>G_TYPE_PARAM</literal></link>
or derived.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-PARAM-SPEC-CLASS--CAPS" role="macro">
<title>G_PARAM_SPEC_CLASS()</title>
<indexterm zone="G-PARAM-SPEC-CLASS--CAPS"><primary sortas="PARAM_SPEC_CLASS">G_PARAM_SPEC_CLASS</primary></indexterm><programlisting>#define G_PARAM_SPEC_CLASS(pclass)      (G_TYPE_CHECK_CLASS_CAST ((pclass), G_TYPE_PARAM, GParamSpecClass))
</programlisting>
<para>
Casts a derived <link linkend="GParamSpecClass"><type>GParamSpecClass</type></link> structure into a <link linkend="GParamSpecClass"><type>GParamSpecClass</type></link> structure.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pclass</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpecClass"><type>GParamSpecClass</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-IS-PARAM-SPEC-CLASS--CAPS" role="macro">
<title>G_IS_PARAM_SPEC_CLASS()</title>
<indexterm zone="G-IS-PARAM-SPEC-CLASS--CAPS"><primary sortas="IS_PARAM_SPEC_CLASS">G_IS_PARAM_SPEC_CLASS</primary></indexterm><programlisting>#define G_IS_PARAM_SPEC_CLASS(pclass)   (G_TYPE_CHECK_CLASS_TYPE ((pclass), G_TYPE_PARAM))
</programlisting>
<para>
Checks whether <parameter>pclass</parameter> "is a" valid <link linkend="GParamSpecClass"><type>GParamSpecClass</type></link> structure of type 
<link linkend="G-TYPE-PARAM--CAPS"><literal>G_TYPE_PARAM</literal></link> or derived.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pclass</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GParamSpecClass"><type>GParamSpecClass</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-PARAM-SPEC-GET-CLASS--CAPS" role="macro">
<title>G_PARAM_SPEC_GET_CLASS()</title>
<indexterm zone="G-PARAM-SPEC-GET-CLASS--CAPS"><primary sortas="PARAM_SPEC_GET_CLASS">G_PARAM_SPEC_GET_CLASS</primary></indexterm><programlisting>#define G_PARAM_SPEC_GET_CLASS(pspec)	(G_TYPE_INSTANCE_GET_CLASS ((pspec), G_TYPE_PARAM, GParamSpecClass))
</programlisting>
<para>
Retrieves the <link linkend="GParamSpecClass"><type>GParamSpecClass</type></link> of a <link linkend="GParamSpec"><type>GParamSpec</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-PARAM-SPEC-TYPE--CAPS" role="macro">
<title>G_PARAM_SPEC_TYPE()</title>
<indexterm zone="G-PARAM-SPEC-TYPE--CAPS"><primary sortas="PARAM_SPEC_TYPE">G_PARAM_SPEC_TYPE</primary></indexterm><programlisting>#define G_PARAM_SPEC_TYPE(pspec)	(G_TYPE_FROM_INSTANCE (pspec))
</programlisting>
<para>
Retrieves the <link linkend="GType"><type>GType</type></link> of this <parameter>pspec</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-PARAM-SPEC-TYPE-NAME--CAPS" role="macro">
<title>G_PARAM_SPEC_TYPE_NAME()</title>
<indexterm zone="G-PARAM-SPEC-TYPE-NAME--CAPS"><primary sortas="PARAM_SPEC_TYPE_NAME">G_PARAM_SPEC_TYPE_NAME</primary></indexterm><programlisting>#define G_PARAM_SPEC_TYPE_NAME(pspec)	(g_type_name (G_PARAM_SPEC_TYPE (pspec)))
</programlisting>
<para>
Retrieves the <link linkend="GType"><type>GType</type></link> name of this <parameter>pspec</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-PARAM-SPEC-VALUE-TYPE--CAPS" role="macro">
<title>G_PARAM_SPEC_VALUE_TYPE()</title>
<indexterm zone="G-PARAM-SPEC-VALUE-TYPE--CAPS"><primary sortas="PARAM_SPEC_VALUE_TYPE">G_PARAM_SPEC_VALUE_TYPE</primary></indexterm><programlisting>#define	G_PARAM_SPEC_VALUE_TYPE(pspec)	(G_PARAM_SPEC (pspec)-&gt;value_type)
</programlisting>
<para>
Retrieves the <link linkend="GType"><type>GType</type></link> to initialize a <link linkend="GValue"><type>GValue</type></link> for this parameter.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GParamSpec" role="struct">
<title>GParamSpec</title>
<indexterm zone="GParamSpec"><primary sortas="ParamSpec">GParamSpec</primary></indexterm><programlisting>typedef struct {
  GTypeInstance  g_type_instance;

  gchar         *name;
  GParamFlags    flags;
  GType		 value_type;
  GType		 owner_type;	/* class or interface using this property */
} GParamSpec;
</programlisting>
<para>
All other fields of the <structname>GParamSpec</structname> struct are private and
should not be used directly.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GTypeInstance">GTypeInstance</link>&#160;<structfield>g_type_instance</structfield>;</term>
<listitem><simpara> private <link linkend="GTypeInstance"><type>GTypeInstance</type></link> portion
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="gchar">gchar</link>&#160;*<structfield>name</structfield>;</term>
<listitem><simpara> name of this parameter
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GParamFlags">GParamFlags</link>&#160;<structfield>flags</structfield>;</term>
<listitem><simpara> <link linkend="GParamFlags"><type>GParamFlags</type></link> flags for this parameter
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GType">GType</link>&#160;<structfield>value_type</structfield>;</term>
<listitem><simpara> the <link linkend="GValue"><type>GValue</type></link> type for this parameter
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GType">GType</link>&#160;<structfield>owner_type</structfield>;</term>
<listitem><simpara> <link linkend="GType"><type>GType</type></link> type that uses (introduces) this paremeter
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GParamSpecClass" role="struct">
<title>GParamSpecClass</title>
<indexterm zone="GParamSpecClass"><primary sortas="ParamSpecClass">GParamSpecClass</primary></indexterm><programlisting>typedef struct {
  GTypeClass      g_type_class;

  GType		  value_type;

  void	        (*finalize)		(GParamSpec   *pspec);

  /* GParam methods */
  void          (*value_set_default)    (GParamSpec   *pspec,
					 GValue       *value);
  gboolean      (*value_validate)       (GParamSpec   *pspec,
					 GValue       *value);
  gint          (*values_cmp)           (GParamSpec   *pspec,
					 const GValue *value1,
					 const GValue *value2);
} GParamSpecClass;
</programlisting>
<para>
The class structure for the <structname>GParamSpec</structname> type.
Normally, <structname>GParamSpec</structname> classes are filled by
<link linkend="g-param-type-register-static"><function>g_param_type_register_static()</function></link>.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GTypeClass">GTypeClass</link>&#160;<structfield>g_type_class</structfield>;</term>
<listitem><simpara> the parent class
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GType">GType</link>&#160;<structfield>value_type</structfield>;</term>
<listitem><simpara> the <link linkend="GValue"><type>GValue</type></link> type for this parameter
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>finalize</structfield>&#160;()</term>
<listitem><simpara> The instance finalization function (optional), should chain 
 up to the finalize method of the parent class.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>value_set_default</structfield>&#160;()</term>
<listitem><simpara> Resets a <parameter>value</parameter> to the default value for this type
 (recommended, the default is <link linkend="g-value-reset"><function>g_value_reset()</function></link>), see 
 <link linkend="g-param-value-set-default"><function>g_param_value_set_default()</function></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>value_validate</structfield>&#160;()</term>
<listitem><simpara> Ensures that the contents of <parameter>value</parameter> comply with the 
 specifications set out by this type (optional), see 
 <link linkend="g-param-value-set-validate"><function>g_param_value_set_validate()</function></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>values_cmp</structfield>&#160;()</term>
<listitem><simpara> Compares <parameter>value1</parameter> with <parameter>value2</parameter> according to this type
 (recommended, the default is <link linkend="memcmp"><function>memcmp()</function></link>), see <link linkend="g-param-values-cmp"><function>g_param_values_cmp()</function></link>.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GParamFlags" role="enum">
<title>enum GParamFlags</title>
<indexterm zone="GParamFlags"><primary sortas="ParamFlags">GParamFlags</primary></indexterm><programlisting>typedef enum
{
  G_PARAM_READABLE            = 1 &lt;&lt; 0,
  G_PARAM_WRITABLE            = 1 &lt;&lt; 1,
  G_PARAM_CONSTRUCT	      = 1 &lt;&lt; 2,
  G_PARAM_CONSTRUCT_ONLY      = 1 &lt;&lt; 3,
  G_PARAM_LAX_VALIDATION      = 1 &lt;&lt; 4,
  G_PARAM_STATIC_NAME	      = 1 &lt;&lt; 5,
#ifndef G_DISABLE_DEPRECATED
  G_PARAM_PRIVATE	      = G_PARAM_STATIC_NAME,
#endif
  G_PARAM_STATIC_NICK	      = 1 &lt;&lt; 6,
  G_PARAM_STATIC_BLURB	      = 1 &lt;&lt; 7
} GParamFlags;
</programlisting>
<para>
Through the <link linkend="GParamFlags"><type>GParamFlags</type></link> flag values, certain aspects of parameters
can be configured.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="G-PARAM-READABLE--CAPS" role="constant">
<term><literal>G_PARAM_READABLE</literal></term>
<listitem><simpara> the parameter is readable
</simpara></listitem>
</varlistentry>
<varlistentry id="G-PARAM-WRITABLE--CAPS" role="constant">
<term><literal>G_PARAM_WRITABLE</literal></term>
<listitem><simpara> the parameter is writable
</simpara></listitem>
</varlistentry>
<varlistentry id="G-PARAM-CONSTRUCT--CAPS" role="constant">
<term><literal>G_PARAM_CONSTRUCT</literal></term>
<listitem><simpara> the parameter will be set upon object construction
</simpara></listitem>
</varlistentry>
<varlistentry id="G-PARAM-CONSTRUCT-ONLY--CAPS" role="constant">
<term><literal>G_PARAM_CONSTRUCT_ONLY</literal></term>
<listitem><simpara> the parameter will only be set upon object construction
</simpara></listitem>
</varlistentry>
<varlistentry id="G-PARAM-LAX-VALIDATION--CAPS" role="constant">
<term><literal>G_PARAM_LAX_VALIDATION</literal></term>
<listitem><simpara> upon parameter conversion (see <link linkend="g-param-value-convert"><function>g_param_value_convert()</function></link>)
 strict validation is not required
</simpara></listitem>
</varlistentry>
<varlistentry id="G-PARAM-STATIC-NAME--CAPS" role="constant">
<term><literal>G_PARAM_STATIC_NAME</literal></term>
<listitem><simpara> the string used as name when constructing the 
 parameter is guaranteed to remain valid and
 unmodified for the lifetime of the parameter. 
 Since 2.8
</simpara></listitem>
</varlistentry>
<varlistentry id="G-PARAM-PRIVATE--CAPS" role="constant">
<term><literal>G_PARAM_PRIVATE</literal></term>
<listitem><simpara> internal
</simpara></listitem>
</varlistentry>
<varlistentry id="G-PARAM-STATIC-NICK--CAPS" role="constant">
<term><literal>G_PARAM_STATIC_NICK</literal></term>
<listitem><simpara> the string used as nick when constructing the
 parameter is guaranteed to remain valid and
 unmmodified for the lifetime of the parameter.
 Since 2.8
</simpara></listitem>
</varlistentry>
<varlistentry id="G-PARAM-STATIC-BLURB--CAPS" role="constant">
<term><literal>G_PARAM_STATIC_BLURB</literal></term>
<listitem><simpara> the string used as blurb when constructing the 
 parameter is guaranteed to remain valid and 
 unmodified for the lifetime of the parameter. 
 Since 2.8
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="G-PARAM-READWRITE--CAPS" role="macro">
<title>G_PARAM_READWRITE</title>
<indexterm zone="G-PARAM-READWRITE--CAPS"><primary sortas="PARAM_READWRITE">G_PARAM_READWRITE</primary></indexterm><programlisting>#define	G_PARAM_READWRITE	(G_PARAM_READABLE | G_PARAM_WRITABLE)
</programlisting>
<para>
<link linkend="GParamFlags"><type>GParamFlags</type></link> value alias for <link linkend="G-PARAM-READABLE--CAPS"><literal>G_PARAM_READABLE</literal></link> | <link linkend="G-PARAM-WRITABLE--CAPS"><literal>G_PARAM_WRITABLE</literal></link>.</para>
<para>
</para></refsect2>
<refsect2 id="G-PARAM-STATIC-STRINGS--CAPS" role="macro">
<title>G_PARAM_STATIC_STRINGS</title>
<indexterm zone="G-PARAM-STATIC-STRINGS--CAPS"><primary sortas="PARAM_STATIC_STRINGS">G_PARAM_STATIC_STRINGS</primary></indexterm><programlisting>#define	G_PARAM_STATIC_STRINGS (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)
</programlisting>
<para>
<link linkend="GParamFlags"><type>GParamFlags</type></link> value alias for <link linkend="G-PARAM-STATIC-NAME--CAPS"><literal>G_PARAM_STATIC_NAME</literal></link> | <link linkend="G-PARAM-STATIC-NICK--CAPS"><literal>G_PARAM_STATIC_NICK</literal></link> | <link linkend="G-PARAM-STATIC-BLURB--CAPS"><literal>G_PARAM_STATIC_BLURB</literal></link>.
</para>
<para>
Since 2.13.0</para>
<para>
</para></refsect2>
<refsect2 id="G-PARAM-MASK--CAPS" role="macro">
<title>G_PARAM_MASK</title>
<indexterm zone="G-PARAM-MASK--CAPS"><primary sortas="PARAM_MASK">G_PARAM_MASK</primary></indexterm><programlisting>#define	G_PARAM_MASK		(0x000000ff)
</programlisting>
<para>
Mask containing the bits of <link linkend="GParamSpec"><type>GParamSpec</type></link>.flags which are reserved for GLib.</para>
<para>
</para></refsect2>
<refsect2 id="G-PARAM-USER-SHIFT--CAPS" role="macro">
<title>G_PARAM_USER_SHIFT</title>
<indexterm zone="G-PARAM-USER-SHIFT--CAPS"><primary sortas="PARAM_USER_SHIFT">G_PARAM_USER_SHIFT</primary></indexterm><programlisting>#define	G_PARAM_USER_SHIFT	(8)
</programlisting>
<para>
Minimum shift count to be used for user defined flags, to be stored in
<link linkend="GParamSpec"><type>GParamSpec</type></link>.flags.</para>
<para>
</para></refsect2>
<refsect2 id="g-param-spec-ref" role="function">
<title>g_param_spec_ref ()</title>
<indexterm zone="g-param-spec-ref"><primary sortas="param_spec_ref">g_param_spec_ref</primary></indexterm><programlisting><link linkend="GParamSpec">GParamSpec</link>*         g_param_spec_ref                    (<link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
Increments the reference count of <parameter>pspec</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> that was passed into this function
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-unref" role="function">
<title>g_param_spec_unref ()</title>
<indexterm zone="g-param-spec-unref"><primary sortas="param_spec_unref">g_param_spec_unref</primary></indexterm><programlisting><link linkend="void">void</link>                g_param_spec_unref                  (<link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
Decrements the reference count of a <parameter>pspec</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-sink" role="function">
<title>g_param_spec_sink ()</title>
<indexterm zone="g-param-spec-sink"><primary sortas="param_spec_sink">g_param_spec_sink</primary></indexterm><programlisting><link linkend="void">void</link>                g_param_spec_sink                   (<link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
The initial reference count of a newly created <link linkend="GParamSpec"><type>GParamSpec</type></link> is 1,
even though no one has explicitly called <link linkend="g-param-spec-ref"><function>g_param_spec_ref()</function></link> on it
yet. So the initial reference count is flagged as "floating", until
someone calls <literal>g_param_spec_ref (pspec); g_param_spec_sink
(pspec);</literal> in sequence on it, taking over the initial
reference count (thus ending up with a <parameter>pspec</parameter> that has a reference
count of 1 still, but is not flagged "floating" anymore).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-ref-sink" role="function" condition="since:2.10">
<title>g_param_spec_ref_sink ()</title>
<indexterm zone="g-param-spec-ref-sink" role="2.10"><primary sortas="param_spec_ref_sink">g_param_spec_ref_sink</primary></indexterm><programlisting><link linkend="GParamSpec">GParamSpec</link>*         g_param_spec_ref_sink               (<link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
Convenience function to ref and sink a <link linkend="GParamSpec"><type>GParamSpec</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> that was passed into this function
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="g-param-value-set-default" role="function">
<title>g_param_value_set_default ()</title>
<indexterm zone="g-param-value-set-default"><primary sortas="param_value_set_default">g_param_value_set_default</primary></indexterm><programlisting><link linkend="void">void</link>                g_param_value_set_default           (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GValue">GValue</link> *value);</programlisting>
<para>
Sets <parameter>value</parameter> to its default value as specified in <parameter>pspec</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> of correct type for <parameter>pspec</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-value-defaults" role="function">
<title>g_param_value_defaults ()</title>
<indexterm zone="g-param-value-defaults"><primary sortas="param_value_defaults">g_param_value_defaults</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_param_value_defaults              (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GValue">GValue</link> *value);</programlisting>
<para>
Checks whether <parameter>value</parameter> contains the default value as specified in <parameter>pspec</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> of correct type for <parameter>pspec</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether <parameter>value</parameter> contains the canonical default for this <parameter>pspec</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-value-validate" role="function">
<title>g_param_value_validate ()</title>
<indexterm zone="g-param-value-validate"><primary sortas="param_value_validate">g_param_value_validate</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_param_value_validate              (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GValue">GValue</link> *value);</programlisting>
<para>
Ensures that the contents of <parameter>value</parameter> comply with the specifications
set out by <parameter>pspec</parameter>. For example, a <link linkend="GParamSpecInt"><type>GParamSpecInt</type></link> might require
that integers stored in <parameter>value</parameter> may not be smaller than -42 and not be
greater than +42. If <parameter>value</parameter> contains an integer outside of this range,
it is modified accordingly, so the resulting value will fit into the
range -42 .. +42.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> of correct type for <parameter>pspec</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> whether modifying <parameter>value</parameter> was necessary to ensure validity
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-value-convert" role="function">
<title>g_param_value_convert ()</title>
<indexterm zone="g-param-value-convert"><primary sortas="param_value_convert">g_param_value_convert</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_param_value_convert               (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         const <link linkend="GValue">GValue</link> *src_value,
                                                         <link linkend="GValue">GValue</link> *dest_value,
                                                         <link linkend="gboolean">gboolean</link> strict_validation);</programlisting>
<para>
Transforms <parameter>src_value</parameter> into <parameter>dest_value</parameter> if possible, and then
validates <parameter>dest_value</parameter>, in order for it to conform to <parameter>pspec</parameter>.  If
<parameter>strict_validation</parameter> is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> this function will only succeed if the
transformed <parameter>dest_value</parameter> complied to <parameter>pspec</parameter> without modifications.
</para>
<para>
See also <link linkend="g-value-type-transformable"><function>g_value_type_transformable()</function></link>, <link linkend="g-value-transform"><function>g_value_transform()</function></link> and
<link linkend="g-param-value-validate"><function>g_param_value_validate()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>src_value</parameter>&#160;:</term>
<listitem><simpara> souce <link linkend="GValue"><type>GValue</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>dest_value</parameter>&#160;:</term>
<listitem><simpara> destination <link linkend="GValue"><type>GValue</type></link> of correct type for <parameter>pspec</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>strict_validation</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> requires <parameter>dest_value</parameter> to conform to <parameter>pspec</parameter>
without modifications
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if transformation and validation were successful,
 <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> otherwise and <parameter>dest_value</parameter> is left untouched.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-values-cmp" role="function">
<title>g_param_values_cmp ()</title>
<indexterm zone="g-param-values-cmp"><primary sortas="param_values_cmp">g_param_values_cmp</primary></indexterm><programlisting><link linkend="gint">gint</link>                g_param_values_cmp                  (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         const <link linkend="GValue">GValue</link> *value1,
                                                         const <link linkend="GValue">GValue</link> *value2);</programlisting>
<para>
Compares <parameter>value1</parameter> with <parameter>value2</parameter> according to <parameter>pspec</parameter>, and return -1, 0 or +1,
if <parameter>value1</parameter> is found to be less than, equal to or greater than <parameter>value2</parameter>,
respectively.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value1</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> of correct type for <parameter>pspec</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value2</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> of correct type for <parameter>pspec</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> -1, 0 or +1, for a less than, equal to or greater than result
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-get-name" role="function">
<title>g_param_spec_get_name ()</title>
<indexterm zone="g-param-spec-get-name"><primary sortas="param_spec_get_name">g_param_spec_get_name</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link>*        g_param_spec_get_name               (<link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
Get the name of a <link linkend="GParamSpec"><type>GParamSpec</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the name of <parameter>pspec</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-get-nick" role="function">
<title>g_param_spec_get_nick ()</title>
<indexterm zone="g-param-spec-get-nick"><primary sortas="param_spec_get_nick">g_param_spec_get_nick</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link>*        g_param_spec_get_nick               (<link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
Get the nickname of a <link linkend="GParamSpec"><type>GParamSpec</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the nickname of <parameter>pspec</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-get-blurb" role="function">
<title>g_param_spec_get_blurb ()</title>
<indexterm zone="g-param-spec-get-blurb"><primary sortas="param_spec_get_blurb">g_param_spec_get_blurb</primary></indexterm><programlisting>const <link linkend="gchar">gchar</link>*        g_param_spec_get_blurb              (<link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
Get the short description of a <link linkend="GParamSpec"><type>GParamSpec</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the short description of <parameter>pspec</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-get-qdata" role="function">
<title>g_param_spec_get_qdata ()</title>
<indexterm zone="g-param-spec-get-qdata"><primary sortas="param_spec_get_qdata">g_param_spec_get_qdata</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_param_spec_get_qdata              (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GQuark">GQuark</link> quark);</programlisting>
<para>
Gets back user data pointers stored via <link linkend="g-param-spec-set-qdata"><function>g_param_spec_set_qdata()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>quark</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GQuark"><type>GQuark</type></link>, naming the user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the user data pointer set, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-set-qdata" role="function">
<title>g_param_spec_set_qdata ()</title>
<indexterm zone="g-param-spec-set-qdata"><primary sortas="param_spec_set_qdata">g_param_spec_set_qdata</primary></indexterm><programlisting><link linkend="void">void</link>                g_param_spec_set_qdata              (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GQuark">GQuark</link> quark,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Sets an opaque, named pointer on a <link linkend="GParamSpec"><type>GParamSpec</type></link>. The name is
specified through a <link linkend="GQuark"><type>GQuark</type></link> (retrieved e.g. via
<link linkend="g-quark-from-static-string"><function>g_quark_from_static_string()</function></link>), and the pointer can be gotten back
from the <parameter>pspec</parameter> with <link linkend="g-param-spec-get-qdata"><function>g_param_spec_get_qdata()</function></link>.  Setting a
previously set user data pointer, overrides (frees) the old pointer
set, using <link linkend="NULL--CAPS"><literal>NULL</literal></link> as pointer essentially removes the data stored.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> to set store a user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>quark</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GQuark"><type>GQuark</type></link>, naming the user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> an opaque user data pointer
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-set-qdata-full" role="function">
<title>g_param_spec_set_qdata_full ()</title>
<indexterm zone="g-param-spec-set-qdata-full"><primary sortas="param_spec_set_qdata_full">g_param_spec_set_qdata_full</primary></indexterm><programlisting><link linkend="void">void</link>                g_param_spec_set_qdata_full         (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GQuark">GQuark</link> quark,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> destroy);</programlisting>
<para>
This function works like <link linkend="g-param-spec-set-qdata"><function>g_param_spec_set_qdata()</function></link>, but in addition,
a <literal>void (*destroy) (gpointer)</literal> function may be
specified which is called with <parameter>data</parameter> as argument when the <parameter>pspec</parameter> is
finalized, or the data is being overwritten by a call to
<link linkend="g-param-spec-set-qdata"><function>g_param_spec_set_qdata()</function></link> with the same <parameter>quark</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> to set store a user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>quark</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GQuark"><type>GQuark</type></link>, naming the user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> an opaque user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>destroy</parameter>&#160;:</term>
<listitem><simpara> function to invoke with <parameter>data</parameter> as argument, when <parameter>data</parameter> needs to
 be freed
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-steal-qdata" role="function">
<title>g_param_spec_steal_qdata ()</title>
<indexterm zone="g-param-spec-steal-qdata"><primary sortas="param_spec_steal_qdata">g_param_spec_steal_qdata</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_param_spec_steal_qdata            (<link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GQuark">GQuark</link> quark);</programlisting>
<para>
Gets back user data pointers stored via <link linkend="g-param-spec-set-qdata"><function>g_param_spec_set_qdata()</function></link>
and removes the <parameter>data</parameter> from <parameter>pspec</parameter> without invoking its <link linkend="destroy"><function>destroy()</function></link>
function (if any was set).  Usually, calling this function is only
required to update user data pointers with a destroy notifier.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> to get a stored user data pointer from
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>quark</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GQuark"><type>GQuark</type></link>, naming the user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the user data pointer set, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-get-redirect-target" role="function" condition="since:2.4">
<title>g_param_spec_get_redirect_target ()</title>
<indexterm zone="g-param-spec-get-redirect-target" role="2.4"><primary sortas="param_spec_get_redirect_target">g_param_spec_get_redirect_target</primary></indexterm><programlisting><link linkend="GParamSpec">GParamSpec</link>*         g_param_spec_get_redirect_target    (<link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
If the paramspec redirects operations to another paramspec,
returns that paramspec. Redirect is used typically for
providing a new implementation of a property in a derived
type while preserving all the properties from the parent
type. Redirection is established by creating a property
of type <link linkend="GParamSpecOverride"><type>GParamSpecOverride</type></link>. See <link linkend="g-object-class-override-property"><function>g_object_class_override_property()</function></link>
for an example of the use of this capability.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> paramspec to which requests on this paramspec should
         be redirected, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if none.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="g-param-spec-internal" role="function">
<title>g_param_spec_internal ()</title>
<indexterm zone="g-param-spec-internal"><primary sortas="param_spec_internal">g_param_spec_internal</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_param_spec_internal               (<link linkend="GType">GType</link> param_type,
                                                         const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="gchar">gchar</link> *nick,
                                                         const <link linkend="gchar">gchar</link> *blurb,
                                                         <link linkend="GParamFlags">GParamFlags</link> flags);</programlisting>
<para>
Creates a new <link linkend="GParamSpec"><type>GParamSpec</type></link> instance.
</para>
<para>
A property name consists of segments consisting of ASCII letters and
digits, separated by either the '-' or '_' character. The first
character of a property name must be a letter. Names which violate these
rules lead to undefined behaviour.
</para>
<para>
When creating and looking up a <link linkend="GParamSpec"><type>GParamSpec</type></link>, either separator can be
used, but they cannot be mixed. Using '-' is considerably more
efficient and in fact required when using property names as detail
strings for signals.
</para>
<para>
Beyond the name, <link linkend="GParamSpec"><type>GParamSpec</type></link><!-- -->s have two more descriptive
strings associated with them, the <parameter>nick</parameter>, which should be suitable
for use as a label for the property in a property editor, and the
<parameter>blurb</parameter>, which should be a somewhat longer description, suitable for
e.g. a tooltip. The <parameter>nick</parameter> and <parameter>blurb</parameter> should ideally be localized.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>param_type</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GType"><type>GType</type></link> for the property; must be derived from <link linkend="G-TYPE-PARAM--CAPS"><type>G_TYPE_PARAM</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> the canonical name of the property
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>nick</parameter>&#160;:</term>
<listitem><simpara> the nickname of the property
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>blurb</parameter>&#160;:</term>
<listitem><simpara> a short description of the property
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>flags</parameter>&#160;:</term>
<listitem><simpara> a combination of <link linkend="GParamFlags"><type>GParamFlags</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated <link linkend="GParamSpec"><type>GParamSpec</type></link> instance
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GParamSpecTypeInfo" role="struct">
<title>GParamSpecTypeInfo</title>
<indexterm zone="GParamSpecTypeInfo"><primary sortas="ParamSpecTypeInfo">GParamSpecTypeInfo</primary></indexterm><programlisting>typedef struct {
  /* type system portion */
  guint16         instance_size;                               /* obligatory */
  guint16         n_preallocs;                                 /* optional */
  void		(*instance_init)	(GParamSpec   *pspec); /* optional */

  /* class portion */
  GType           value_type;				       /* obligatory */
  void          (*finalize)             (GParamSpec   *pspec); /* optional */
  void          (*value_set_default)    (GParamSpec   *pspec,  /* recommended */
					 GValue       *value);
  gboolean      (*value_validate)       (GParamSpec   *pspec,  /* optional */
					 GValue       *value);
  gint          (*values_cmp)           (GParamSpec   *pspec,  /* recommended */
					 const GValue *value1,
					 const GValue *value2);
} GParamSpecTypeInfo;
</programlisting>
<para>
This structure is used to provide the type system with the information
required to initialize and destruct (finalize) a parameter's class and
instances thereof.
The initialized structure is passed to the <link linkend="g-param-type-register-static"><function>g_param_type_register_static()</function></link> 
The type system will perform a deep copy of this structure, so its memory 
does not need to be persistent across invocation of 
<link linkend="g-param-type-register-static"><function>g_param_type_register_static()</function></link>.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="guint16">guint16</link>&#160;<structfield>instance_size</structfield>;</term>
<listitem><simpara> Size of the instance (object) structure.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="guint16">guint16</link>&#160;<structfield>n_preallocs</structfield>;</term>
<listitem><simpara> Prior to GLib 2.10, it specified the number of pre-allocated (cached) instances to reserve memory for (0 indicates no caching). Since GLib 2.10, it is ignored, since instances are allocated with the <link linkend="glib-Memory-Slices">slice allocator</link> now.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>instance_init</structfield>&#160;()</term>
<listitem><simpara> Location of the instance initialization function (optional).
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GType">GType</link>&#160;<structfield>value_type</structfield>;</term>
<listitem><simpara> The <link linkend="GType"><type>GType</type></link> of values conforming to this <link linkend="GParamSpec"><type>GParamSpec</type></link>
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>finalize</structfield>&#160;()</term>
<listitem><simpara> The instance finalization function (optional).
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>value_set_default</structfield>&#160;()</term>
<listitem><simpara> Resets a <parameter>value</parameter> to the default value for <parameter>pspec</parameter> 
 (recommended, the default is <link linkend="g-value-reset"><function>g_value_reset()</function></link>), see 
 <link linkend="g-param-value-set-default"><function>g_param_value_set_default()</function></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>value_validate</structfield>&#160;()</term>
<listitem><simpara> Ensures that the contents of <parameter>value</parameter> comply with the 
 specifications set out by <parameter>pspec</parameter> (optional), see 
 <link linkend="g-param-value-set-validate"><function>g_param_value_set_validate()</function></link>.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>values_cmp</structfield>&#160;()</term>
<listitem><simpara> Compares <parameter>value1</parameter> with <parameter>value2</parameter> according to <parameter>pspec</parameter> 
 (recommended, the default is <link linkend="memcmp"><function>memcmp()</function></link>), see <link linkend="g-param-values-cmp"><function>g_param_values_cmp()</function></link>.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-type-register-static" role="function">
<title>g_param_type_register_static ()</title>
<indexterm zone="g-param-type-register-static"><primary sortas="param_type_register_static">g_param_type_register_static</primary></indexterm><programlisting><link linkend="GType">GType</link>               g_param_type_register_static        (const <link linkend="gchar">gchar</link> *name,
                                                         const <link linkend="GParamSpecTypeInfo">GParamSpecTypeInfo</link> *pspec_info);</programlisting>
<para>
Registers <parameter>name</parameter> as the name of a new static type derived from
<link linkend="G-TYPE-PARAM--CAPS"><type>G_TYPE_PARAM</type></link>. The type system uses the information contained in
the <link linkend="GParamSpecTypeInfo"><type>GParamSpecTypeInfo</type></link> structure pointed to by <parameter>info</parameter> to manage the
<link linkend="GParamSpec"><type>GParamSpec</type></link> type and its instances.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> 0-terminated string used as the name of the new <link linkend="GParamSpec"><type>GParamSpec</type></link> type.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pspec_info</parameter>&#160;:</term>
<listitem><simpara> The <link linkend="GParamSpecTypeInfo"><type>GParamSpecTypeInfo</type></link> for this <link linkend="GParamSpec"><type>GParamSpec</type></link> type.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The new type identifier.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GParamSpecPool" role="struct">
<title>GParamSpecPool</title>
<indexterm zone="GParamSpecPool"><primary sortas="ParamSpecPool">GParamSpecPool</primary></indexterm><programlisting>typedef struct _GParamSpecPool GParamSpecPool;</programlisting>
<para>
A <link linkend="GParamSpecPool"><type>GParamSpecPool</type></link> maintains a collection of <link linkend="GParamSpec"><type>GParamSpec</type></link><!-- -->s which can be
quickly accessed by owner and name. The implementation of the <link linkend="GObject"><type>GObject</type></link> property
system uses such a pool to store the <link linkend="GParamSpecs"><type>GParamSpecs</type></link> of the properties all object
types.</para>
<para>
</para></refsect2>
<refsect2 id="g-param-spec-pool-new" role="function">
<title>g_param_spec_pool_new ()</title>
<indexterm zone="g-param-spec-pool-new"><primary sortas="param_spec_pool_new">g_param_spec_pool_new</primary></indexterm><programlisting><link linkend="GParamSpecPool">GParamSpecPool</link>*     g_param_spec_pool_new               (<link linkend="gboolean">gboolean</link> type_prefixing);</programlisting>
<para>
Creates a new <link linkend="GParamSpecPool"><type>GParamSpecPool</type></link>.
</para>
<para>
If <parameter>type_prefixing</parameter> is <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, lookups in the newly created pool will
allow to specify the owner as a colon-separated prefix of the
property name, like "GtkContainer:border-width". This feature is
deprecated, so you should always set <parameter>type_prefixing</parameter> to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>type_prefixing</parameter>&#160;:</term>
<listitem><simpara> Whether the pool will support type-prefixed property names.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated <link linkend="GParamSpecPool"><type>GParamSpecPool</type></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-pool-insert" role="function">
<title>g_param_spec_pool_insert ()</title>
<indexterm zone="g-param-spec-pool-insert"><primary sortas="param_spec_pool_insert">g_param_spec_pool_insert</primary></indexterm><programlisting><link linkend="void">void</link>                g_param_spec_pool_insert            (<link linkend="GParamSpecPool">GParamSpecPool</link> *pool,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                         <link linkend="GType">GType</link> owner_type);</programlisting>
<para>
Inserts a <link linkend="GParamSpec"><type>GParamSpec</type></link> in the pool.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pool</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GParamSpecPool"><type>GParamSpecPool</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> to insert
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>owner_type</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GType"><type>GType</type></link> identifying the owner of <parameter>pspec</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-pool-remove" role="function">
<title>g_param_spec_pool_remove ()</title>
<indexterm zone="g-param-spec-pool-remove"><primary sortas="param_spec_pool_remove">g_param_spec_pool_remove</primary></indexterm><programlisting><link linkend="void">void</link>                g_param_spec_pool_remove            (<link linkend="GParamSpecPool">GParamSpecPool</link> *pool,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
Removes a <link linkend="GParamSpec"><type>GParamSpec</type></link> from the pool.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pool</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GParamSpecPool"><type>GParamSpecPool</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> to remove
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-pool-lookup" role="function">
<title>g_param_spec_pool_lookup ()</title>
<indexterm zone="g-param-spec-pool-lookup"><primary sortas="param_spec_pool_lookup">g_param_spec_pool_lookup</primary></indexterm><programlisting><link linkend="GParamSpec">GParamSpec</link>*         g_param_spec_pool_lookup            (<link linkend="GParamSpecPool">GParamSpecPool</link> *pool,
                                                         const <link linkend="gchar">gchar</link> *param_name,
                                                         <link linkend="GType">GType</link> owner_type,
                                                         <link linkend="gboolean">gboolean</link> walk_ancestors);</programlisting>
<para>
Looks up a <link linkend="GParamSpec"><type>GParamSpec</type></link> in the pool.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pool</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GParamSpecPool"><type>GParamSpecPool</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>param_name</parameter>&#160;:</term>
<listitem><simpara> the name to look for
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>owner_type</parameter>&#160;:</term>
<listitem><simpara> the owner to look for
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>walk_ancestors</parameter>&#160;:</term>
<listitem><simpara> If <link linkend="TRUE--CAPS"><literal>TRUE</literal></link>, also try to find a <link linkend="GParamSpec"><type>GParamSpec</type></link> with <parameter>param_name</parameter>
 owned by an ancestor of <parameter>owner_type</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The found <link linkend="GParamSpec"><type>GParamSpec</type></link>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no matching <link linkend="GParamSpec"><type>GParamSpec</type></link> was found.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-pool-list" role="function">
<title>g_param_spec_pool_list ()</title>
<indexterm zone="g-param-spec-pool-list"><primary sortas="param_spec_pool_list">g_param_spec_pool_list</primary></indexterm><programlisting><link linkend="GParamSpec">GParamSpec</link>**        g_param_spec_pool_list              (<link linkend="GParamSpecPool">GParamSpecPool</link> *pool,
                                                         <link linkend="GType">GType</link> owner_type,
                                                         <link linkend="guint">guint</link> *n_pspecs_p);</programlisting>
<para>
Gets an array of all <link linkend="GParamSpec"><type>GParamSpec</type></link><!-- -->s owned by <parameter>owner_type</parameter> in
the pool.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pool</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GParamSpecPool"><type>GParamSpecPool</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>owner_type</parameter>&#160;:</term>
<listitem><simpara> the owner to look for
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_pspecs_p</parameter>&#160;:</term>
<listitem><simpara> return location for the length of the returned array
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a newly allocated array containing pointers to all
         <link linkend="GParamSpec"><type>GParamSpec</type></link><!-- -->s owned by <parameter>owner_type</parameter> in the pool
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-param-spec-pool-list-owned" role="function">
<title>g_param_spec_pool_list_owned ()</title>
<indexterm zone="g-param-spec-pool-list-owned"><primary sortas="param_spec_pool_list_owned">g_param_spec_pool_list_owned</primary></indexterm><programlisting><link linkend="GList">GList</link>*              g_param_spec_pool_list_owned        (<link linkend="GParamSpecPool">GParamSpecPool</link> *pool,
                                                         <link linkend="GType">GType</link> owner_type);</programlisting>
<para>
Gets an <link linkend="GList"><type>GList</type></link> of all <link linkend="GParamSpec"><type>GParamSpec</type></link><!-- -->s owned by <parameter>owner_type</parameter> in
the pool.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>pool</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GParamSpecPool"><type>GParamSpecPool</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>owner_type</parameter>&#160;:</term>
<listitem><simpara> the owner to look for
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a <link linkend="GList"><type>GList</type></link> of all <link linkend="GParamSpec"><type>GParamSpec</type></link><!-- -->s owned by <parameter>owner_type</parameter>
         in the pool<link linkend="GParamSpec"><type>GParamSpec</type></link><!-- -->s.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>



<refsect1 id="gobject-GParamSpec.see-also">
<title>See Also</title>
<link linkend="g-object-class-install-property"><function>g_object_class_install_property()</function></link>, <link linkend="g-object-set"><function>g_object_set()</function></link>,
    <link linkend="g-object-get"><function>g_object_get()</function></link>, <link linkend="g-object-set-property"><function>g_object_set_property()</function></link>, <link linkend="g-object-get-property"><function>g_object_get_property()</function></link>,
    <link linkend="g-value-register-transform-func"><function>g_value_register_transform_func()</function></link>
</refsect1>

</refentry>
