* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/*
#include <string.h>
+#define GLIB_DISABLE_DEPRECATION_WARNINGS
+
#include "gparamspecs.h"
+#include "gtype-private.h"
#include "gvaluecollector.h"
+
#include "gvaluearray.h"
GType *g_param_spec_types = NULL;
void
-g_param_spec_types_init (void)
+_g_param_spec_types_init (void)
{
const guint n_types = 23;
GType type, *spec_types, *spec_types_bound;
/* --- GParamSpec initialization --- */
/**
- * g_param_spec_char: (skip)
+ * g_param_spec_char:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* Creates a new #GParamSpecChar instance specifying a %G_TYPE_CHAR property.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_char (const gchar *name,
nick,
blurb,
flags);
+ if (cspec == NULL)
+ return NULL;
cspec->minimum = minimum;
cspec->maximum = maximum;
}
/**
- * g_param_spec_uchar: (skip)
+ * g_param_spec_uchar:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* Creates a new #GParamSpecUChar instance specifying a %G_TYPE_UCHAR property.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_uchar (const gchar *name,
nick,
blurb,
flags);
+ if (uspec == NULL)
+ return NULL;
uspec->minimum = minimum;
uspec->maximum = maximum;
}
/**
- * g_param_spec_boolean: (skip)
+ * g_param_spec_boolean:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_boolean (const gchar *name,
nick,
blurb,
flags);
+ if (bspec == NULL)
+ return NULL;
bspec->default_value = default_value;
}
/**
- * g_param_spec_int: (skip)
+ * g_param_spec_int:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_int (const gchar *name,
nick,
blurb,
flags);
+ if (ispec == NULL)
+ return NULL;
ispec->minimum = minimum;
ispec->maximum = maximum;
}
/**
- * g_param_spec_uint: (skip)
+ * g_param_spec_uint:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_uint (const gchar *name,
nick,
blurb,
flags);
+ if (uspec == NULL)
+ return NULL;
uspec->minimum = minimum;
uspec->maximum = maximum;
}
/**
- * g_param_spec_long: (skip)
+ * g_param_spec_long:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_long (const gchar *name,
nick,
blurb,
flags);
+ if (lspec == NULL)
+ return NULL;
lspec->minimum = minimum;
lspec->maximum = maximum;
}
/**
- * g_param_spec_ulong: (skip)
+ * g_param_spec_ulong:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_ulong (const gchar *name,
nick,
blurb,
flags);
+ if (uspec == NULL)
+ return NULL;
uspec->minimum = minimum;
uspec->maximum = maximum;
}
/**
- * g_param_spec_int64: (skip)
+ * g_param_spec_int64:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_int64 (const gchar *name,
nick,
blurb,
flags);
+ if (lspec == NULL)
+ return NULL;
lspec->minimum = minimum;
lspec->maximum = maximum;
}
/**
- * g_param_spec_uint64: (skip)
+ * g_param_spec_uint64:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_uint64 (const gchar *name,
nick,
blurb,
flags);
+ if (uspec == NULL)
+ return NULL;
uspec->minimum = minimum;
uspec->maximum = maximum;
}
/**
- * g_param_spec_unichar: (skip)
+ * g_param_spec_unichar:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_unichar (const gchar *name,
nick,
blurb,
flags);
+ if (uspec == NULL)
+ return NULL;
uspec->default_value = default_value;
}
/**
- * g_param_spec_enum: (skip)
+ * g_param_spec_enum:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_enum (const gchar *name,
nick,
blurb,
flags);
+ if (espec == NULL)
+ return NULL;
espec->enum_class = enum_class;
espec->default_value = default_value;
}
/**
- * g_param_spec_flags: (skip)
+ * g_param_spec_flags:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_flags (const gchar *name,
nick,
blurb,
flags);
+ if (fspec == NULL)
+ return NULL;
fspec->flags_class = flags_class;
fspec->default_value = default_value;
}
/**
- * g_param_spec_float: (skip)
+ * g_param_spec_float:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_float (const gchar *name,
nick,
blurb,
flags);
+ if (fspec == NULL)
+ return NULL;
fspec->minimum = minimum;
fspec->maximum = maximum;
}
/**
- * g_param_spec_double: (skip)
+ * g_param_spec_double:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_double (const gchar *name,
nick,
blurb,
flags);
+ if (dspec == NULL)
+ return NULL;
dspec->minimum = minimum;
dspec->maximum = maximum;
}
/**
- * g_param_spec_string: (skip)
+ * g_param_spec_string:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_string (const gchar *name,
nick,
blurb,
flags);
+ if (sspec == NULL)
+ return NULL;
+
g_free (sspec->default_value);
sspec->default_value = g_strdup (default_value);
}
/**
- * g_param_spec_param: (skip)
+ * g_param_spec_param:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_param (const gchar *name,
nick,
blurb,
flags);
+ if (pspec == NULL)
+ return NULL;
+
G_PARAM_SPEC (pspec)->value_type = param_type;
return G_PARAM_SPEC (pspec);
}
/**
- * g_param_spec_boxed: (skip)
+ * g_param_spec_boxed:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_boxed (const gchar *name,
nick,
blurb,
flags);
+ if (bspec == NULL)
+ return NULL;
+
G_PARAM_SPEC (bspec)->value_type = boxed_type;
return G_PARAM_SPEC (bspec);
}
/**
- * g_param_spec_pointer: (skip)
+ * g_param_spec_pointer:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
* @flags: flags for the property specified
*
- * Creates a new #GParamSpecPoiner instance specifying a pointer property.
+ * Creates a new #GParamSpecPointer instance specifying a pointer property.
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_pointer (const gchar *name,
nick,
blurb,
flags);
+ if (pspec == NULL)
+ return NULL;
+
return G_PARAM_SPEC (pspec);
}
/**
- * g_param_spec_gtype: (skip)
+ * g_param_spec_gtype:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* Since: 2.10
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_gtype (const gchar *name,
nick,
blurb,
flags);
+ if (tspec == NULL)
+ return NULL;
tspec->is_a_type = is_a_type;
nick,
blurb,
flags);
+ if (aspec == NULL)
+ return NULL;
+
if (element_spec)
{
aspec->element_spec = g_param_spec_ref (element_spec);
}
/**
- * g_param_spec_object: (skip)
+ * g_param_spec_object:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: a newly created parameter specification
+ * Returns: (transfer full): a newly created parameter specification
*/
GParamSpec*
g_param_spec_object (const gchar *name,
nick,
blurb,
flags);
+ if (ospec == NULL)
+ return NULL;
+
G_PARAM_SPEC (ospec)->value_type = object_type;
return G_PARAM_SPEC (ospec);
pspec = g_param_spec_internal (G_TYPE_PARAM_OVERRIDE,
name, NULL, NULL,
overridden->flags);
+ if (pspec == NULL)
+ return NULL;
pspec->value_type = G_PARAM_SPEC_VALUE_TYPE (overridden);
G_PARAM_SPEC_OVERRIDE (pspec)->overridden = g_param_spec_ref (overridden);
}
/**
- * g_param_spec_variant: (skip)
+ * g_param_spec_variant:
* @name: canonical name of the property specified
* @nick: nick name for the property specified
* @blurb: description of the property specified
* @type: a #GVariantType
- * @default_value: (allow-none): a #GVariant of type @type to use as the
- * default value, or %NULL
+ * @default_value: (allow-none) (transfer full): a #GVariant of type @type to
+ * use as the default value, or %NULL
* @flags: flags for the property specified
*
* Creates a new #GParamSpecVariant instance specifying a #GVariant
*
* See g_param_spec_internal() for details on property names.
*
- * Returns: the newly created #GParamSpec
+ * Returns: (transfer full): the newly created #GParamSpec
*
* Since: 2.26
*/
nick,
blurb,
flags);
+ if (vspec == NULL)
+ return NULL;
vspec->type = g_variant_type_copy (type);
if (default_value)