Blame gobject/gparam.h

Packit ae235b
/* GObject - GLib Type, Object, Parameter and Signal Library
Packit ae235b
 * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
Packit ae235b
 *
Packit ae235b
 * This library is free software; you can redistribute it and/or
Packit ae235b
 * modify it under the terms of the GNU Lesser General Public
Packit ae235b
 * License as published by the Free Software Foundation; either
Packit ae235b
 * version 2.1 of the License, or (at your option) any later version.
Packit ae235b
 *
Packit ae235b
 * This library is distributed in the hope that it will be useful,
Packit ae235b
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit ae235b
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit ae235b
 * Lesser General Public License for more details.
Packit ae235b
 *
Packit ae235b
 * You should have received a copy of the GNU Lesser General
Packit ae235b
 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit ae235b
 *
Packit ae235b
 * gparam.h: GParamSpec base class implementation
Packit ae235b
 */
Packit ae235b
#ifndef __G_PARAM_H__
Packit ae235b
#define __G_PARAM_H__
Packit ae235b
Packit ae235b
#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
Packit ae235b
#error "Only <glib-object.h> can be included directly."
Packit ae235b
#endif
Packit ae235b
Packit ae235b
#include	<gobject/gvalue.h>
Packit ae235b
Packit ae235b
G_BEGIN_DECLS
Packit ae235b
Packit ae235b
/* --- standard type macros --- */
Packit ae235b
/**
Packit ae235b
 * G_TYPE_IS_PARAM:
Packit ae235b
 * @type: a #GType ID
Packit ae235b
 * 
Packit ae235b
 * Checks whether @type "is a" %G_TYPE_PARAM.
Packit ae235b
 */
Packit ae235b
#define G_TYPE_IS_PARAM(type)		(G_TYPE_FUNDAMENTAL (type) == G_TYPE_PARAM)
Packit ae235b
/**
Packit ae235b
 * G_PARAM_SPEC:
Packit ae235b
 * @pspec: a valid #GParamSpec
Packit ae235b
 * 
Packit ae235b
 * Casts a derived #GParamSpec object (e.g. of type #GParamSpecInt) into
Packit ae235b
 * a #GParamSpec object.
Packit ae235b
 */
Packit ae235b
#define G_PARAM_SPEC(pspec)		(G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM, GParamSpec))
Packit ae235b
/**
Packit ae235b
 * G_IS_PARAM_SPEC:
Packit ae235b
 * @pspec: a #GParamSpec
Packit ae235b
 * 
Packit ae235b
 * Checks whether @pspec "is a" valid #GParamSpec structure of type %G_TYPE_PARAM
Packit ae235b
 * or derived.
Packit ae235b
 */
Packit ae235b
#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_42
Packit ae235b
#define G_IS_PARAM_SPEC(pspec)		(G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE ((pspec), G_TYPE_PARAM))
Packit ae235b
#else
Packit ae235b
#define G_IS_PARAM_SPEC(pspec)		(G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM))
Packit ae235b
#endif
Packit ae235b
/**
Packit ae235b
 * G_PARAM_SPEC_CLASS:
Packit ae235b
 * @pclass: a valid #GParamSpecClass
Packit ae235b
 * 
Packit ae235b
 * Casts a derived #GParamSpecClass structure into a #GParamSpecClass structure.
Packit ae235b
 */
Packit ae235b
#define G_PARAM_SPEC_CLASS(pclass)      (G_TYPE_CHECK_CLASS_CAST ((pclass), G_TYPE_PARAM, GParamSpecClass))
Packit ae235b
/**
Packit ae235b
 * G_IS_PARAM_SPEC_CLASS:
Packit ae235b
 * @pclass: a #GParamSpecClass
Packit ae235b
 * 
Packit ae235b
 * Checks whether @pclass "is a" valid #GParamSpecClass structure of type 
Packit ae235b
 * %G_TYPE_PARAM or derived.
Packit ae235b
 */
Packit ae235b
#define G_IS_PARAM_SPEC_CLASS(pclass)   (G_TYPE_CHECK_CLASS_TYPE ((pclass), G_TYPE_PARAM))
Packit ae235b
/**
Packit ae235b
 * G_PARAM_SPEC_GET_CLASS:
Packit ae235b
 * @pspec: a valid #GParamSpec
Packit ae235b
 * 
Packit ae235b
 * Retrieves the #GParamSpecClass of a #GParamSpec.
Packit ae235b
 */
Packit ae235b
#define G_PARAM_SPEC_GET_CLASS(pspec)	(G_TYPE_INSTANCE_GET_CLASS ((pspec), G_TYPE_PARAM, GParamSpecClass))
Packit ae235b
Packit ae235b
Packit ae235b
/* --- convenience macros --- */
Packit ae235b
/**
Packit ae235b
 * G_PARAM_SPEC_TYPE:
Packit ae235b
 * @pspec: a valid #GParamSpec
Packit ae235b
 * 
Packit ae235b
 * Retrieves the #GType of this @pspec.
Packit ae235b
 */
Packit ae235b
#define G_PARAM_SPEC_TYPE(pspec)	(G_TYPE_FROM_INSTANCE (pspec))
Packit ae235b
/**
Packit ae235b
 * G_PARAM_SPEC_TYPE_NAME:
Packit ae235b
 * @pspec: a valid #GParamSpec
Packit ae235b
 * 
Packit ae235b
 * Retrieves the #GType name of this @pspec.
Packit ae235b
 */
Packit ae235b
#define G_PARAM_SPEC_TYPE_NAME(pspec)	(g_type_name (G_PARAM_SPEC_TYPE (pspec)))
Packit ae235b
/**
Packit ae235b
 * G_PARAM_SPEC_VALUE_TYPE:
Packit ae235b
 * @pspec: a valid #GParamSpec
Packit ae235b
 * 
Packit ae235b
 * Retrieves the #GType to initialize a #GValue for this parameter.
Packit ae235b
 */
Packit ae235b
#define	G_PARAM_SPEC_VALUE_TYPE(pspec)	(G_PARAM_SPEC (pspec)->value_type)
Packit ae235b
/**
Packit ae235b
 * G_VALUE_HOLDS_PARAM:
Packit ae235b
 * @value: a valid #GValue structure
Packit ae235b
 * 
Packit ae235b
 * Checks whether the given #GValue can hold values derived from type %G_TYPE_PARAM.
Packit ae235b
 * 
Packit ae235b
 * Returns: %TRUE on success.
Packit ae235b
 */
Packit ae235b
#define G_VALUE_HOLDS_PARAM(value)	(G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_PARAM))
Packit ae235b
       
Packit ae235b
Packit ae235b
/* --- flags --- */
Packit ae235b
/**
Packit ae235b
 * GParamFlags:
Packit ae235b
 * @G_PARAM_READABLE: the parameter is readable
Packit ae235b
 * @G_PARAM_WRITABLE: the parameter is writable
Packit ae235b
 * @G_PARAM_READWRITE: alias for %G_PARAM_READABLE | %G_PARAM_WRITABLE
Packit ae235b
 * @G_PARAM_CONSTRUCT: the parameter will be set upon object construction
Packit ae235b
 * @G_PARAM_CONSTRUCT_ONLY: the parameter can only be set upon object construction
Packit ae235b
 * @G_PARAM_LAX_VALIDATION: upon parameter conversion (see g_param_value_convert())
Packit ae235b
 *  strict validation is not required
Packit ae235b
 * @G_PARAM_STATIC_NAME: the string used as name when constructing the 
Packit ae235b
 *  parameter is guaranteed to remain valid and
Packit ae235b
 *  unmodified for the lifetime of the parameter. 
Packit ae235b
 *  Since 2.8
Packit ae235b
 * @G_PARAM_STATIC_NICK: the string used as nick when constructing the
Packit ae235b
 *  parameter is guaranteed to remain valid and
Packit ae235b
 *  unmmodified for the lifetime of the parameter.
Packit ae235b
 *  Since 2.8
Packit ae235b
 * @G_PARAM_STATIC_BLURB: the string used as blurb when constructing the 
Packit ae235b
 *  parameter is guaranteed to remain valid and 
Packit ae235b
 *  unmodified for the lifetime of the parameter. 
Packit ae235b
 *  Since 2.8
Packit ae235b
 * @G_PARAM_EXPLICIT_NOTIFY: calls to g_object_set_property() for this
Packit ae235b
 *   property will not automatically result in a "notify" signal being
Packit ae235b
 *   emitted: the implementation must call g_object_notify() themselves
Packit ae235b
 *   in case the property actually changes.  Since: 2.42.
Packit ae235b
 * @G_PARAM_PRIVATE: internal
Packit ae235b
 * @G_PARAM_DEPRECATED: the parameter is deprecated and will be removed
Packit ae235b
 *  in a future version. A warning will be generated if it is used
Packit ae235b
 *  while running with G_ENABLE_DIAGNOSTIC=1.
Packit ae235b
 *  Since 2.26
Packit ae235b
 * 
Packit ae235b
 * Through the #GParamFlags flag values, certain aspects of parameters
Packit ae235b
 * can be configured. See also #G_PARAM_STATIC_STRINGS.
Packit ae235b
 */
Packit ae235b
typedef enum
Packit ae235b
{
Packit ae235b
  G_PARAM_READABLE            = 1 << 0,
Packit ae235b
  G_PARAM_WRITABLE            = 1 << 1,
Packit ae235b
  G_PARAM_READWRITE           = (G_PARAM_READABLE | G_PARAM_WRITABLE),
Packit ae235b
  G_PARAM_CONSTRUCT	      = 1 << 2,
Packit ae235b
  G_PARAM_CONSTRUCT_ONLY      = 1 << 3,
Packit ae235b
  G_PARAM_LAX_VALIDATION      = 1 << 4,
Packit ae235b
  G_PARAM_STATIC_NAME	      = 1 << 5,
Packit ae235b
#ifndef G_DISABLE_DEPRECATED
Packit ae235b
  G_PARAM_PRIVATE	      = G_PARAM_STATIC_NAME,
Packit ae235b
#endif
Packit ae235b
  G_PARAM_STATIC_NICK	      = 1 << 6,
Packit ae235b
  G_PARAM_STATIC_BLURB	      = 1 << 7,
Packit ae235b
  /* User defined flags go here */
Packit ae235b
  G_PARAM_EXPLICIT_NOTIFY     = 1 << 30,
Packit ae235b
  /* Avoid warning with -Wpedantic for gcc6 */
Packit ae235b
  G_PARAM_DEPRECATED          = (gint)(1u << 31)
Packit ae235b
} GParamFlags;
Packit ae235b
Packit ae235b
/**
Packit ae235b
 * G_PARAM_STATIC_STRINGS:
Packit ae235b
 * 
Packit ae235b
 * #GParamFlags value alias for %G_PARAM_STATIC_NAME | %G_PARAM_STATIC_NICK | %G_PARAM_STATIC_BLURB.
Packit ae235b
 * 
Packit ae235b
 * Since 2.13.0
Packit ae235b
 */
Packit ae235b
#define	G_PARAM_STATIC_STRINGS (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)
Packit ae235b
/* bits in the range 0xffffff00 are reserved for 3rd party usage */
Packit ae235b
/**
Packit ae235b
 * G_PARAM_MASK:
Packit ae235b
 * 
Packit ae235b
 * Mask containing the bits of #GParamSpec.flags which are reserved for GLib.
Packit ae235b
 */
Packit ae235b
#define	G_PARAM_MASK		(0x000000ff)
Packit ae235b
/**
Packit ae235b
 * G_PARAM_USER_SHIFT:
Packit ae235b
 * 
Packit ae235b
 * Minimum shift count to be used for user defined flags, to be stored in
Packit ae235b
 * #GParamSpec.flags. The maximum allowed is 10.
Packit ae235b
 */
Packit ae235b
#define	G_PARAM_USER_SHIFT	(8)
Packit ae235b
Packit ae235b
/* --- typedefs & structures --- */
Packit ae235b
typedef struct _GParamSpec      GParamSpec;
Packit ae235b
typedef struct _GParamSpecClass GParamSpecClass;
Packit ae235b
typedef struct _GParameter	GParameter;
Packit ae235b
typedef struct _GParamSpecPool  GParamSpecPool;
Packit ae235b
/**
Packit ae235b
 * GParamSpec: (ref-func g_param_spec_ref_sink) (unref-func g_param_spec_uref) (set-value-func g_value_set_param) (get-value-func g_value_get_param)
Packit ae235b
 * @g_type_instance: private #GTypeInstance portion
Packit ae235b
 * @name: name of this parameter: always an interned string
Packit ae235b
 * @flags: #GParamFlags flags for this parameter
Packit ae235b
 * @value_type: the #GValue type for this parameter
Packit ae235b
 * @owner_type: #GType type that uses (introduces) this parameter
Packit ae235b
 * 
Packit ae235b
 * All other fields of the GParamSpec struct are private and
Packit ae235b
 * should not be used directly.
Packit ae235b
 */
Packit ae235b
struct _GParamSpec
Packit ae235b
{
Packit ae235b
  GTypeInstance  g_type_instance;
Packit ae235b
Packit ae235b
  const gchar   *name;          /* interned string */
Packit ae235b
  GParamFlags    flags;
Packit ae235b
  GType		 value_type;
Packit ae235b
  GType		 owner_type;	/* class or interface using this property */
Packit ae235b
Packit ae235b
  /*< private >*/
Packit ae235b
  gchar         *_nick;
Packit ae235b
  gchar         *_blurb;
Packit ae235b
  GData		*qdata;
Packit ae235b
  guint          ref_count;
Packit ae235b
  guint		 param_id;	/* sort-criteria */
Packit ae235b
};
Packit ae235b
/**
Packit ae235b
 * GParamSpecClass:
Packit ae235b
 * @g_type_class: the parent class
Packit ae235b
 * @value_type: the #GValue type for this parameter
Packit ae235b
 * @finalize: The instance finalization function (optional), should chain 
Packit ae235b
 *  up to the finalize method of the parent class.
Packit ae235b
 * @value_set_default: Resets a @value to the default value for this type
Packit ae235b
 *  (recommended, the default is g_value_reset()), see 
Packit ae235b
 *  g_param_value_set_default().
Packit ae235b
 * @value_validate: Ensures that the contents of @value comply with the 
Packit ae235b
 *  specifications set out by this type (optional), see 
Packit ae235b
 *  g_param_value_validate().
Packit ae235b
 * @values_cmp: Compares @value1 with @value2 according to this type
Packit ae235b
 *  (recommended, the default is memcmp()), see g_param_values_cmp().
Packit ae235b
 * 
Packit ae235b
 * The class structure for the GParamSpec type.
Packit ae235b
 * Normally, GParamSpec classes are filled by
Packit ae235b
 * g_param_type_register_static().
Packit ae235b
 */
Packit ae235b
struct _GParamSpecClass
Packit ae235b
{
Packit ae235b
  GTypeClass      g_type_class;
Packit ae235b
Packit ae235b
  GType		  value_type;
Packit ae235b
Packit ae235b
  void	        (*finalize)		(GParamSpec   *pspec);
Packit ae235b
Packit ae235b
  /* GParam methods */
Packit ae235b
  void          (*value_set_default)    (GParamSpec   *pspec,
Packit ae235b
					 GValue       *value);
Packit ae235b
  gboolean      (*value_validate)       (GParamSpec   *pspec,
Packit ae235b
					 GValue       *value);
Packit ae235b
  gint          (*values_cmp)           (GParamSpec   *pspec,
Packit ae235b
					 const GValue *value1,
Packit ae235b
					 const GValue *value2);
Packit ae235b
  /*< private >*/
Packit ae235b
  gpointer	  dummy[4];
Packit ae235b
};
Packit ae235b
/**
Packit ae235b
 * GParameter:
Packit ae235b
 * @name: the parameter name
Packit ae235b
 * @value: the parameter value
Packit ae235b
 * 
Packit ae235b
 * The GParameter struct is an auxiliary structure used
Packit ae235b
 * to hand parameter name/value pairs to g_object_newv().
Packit ae235b
 *
Packit ae235b
 * Deprecated: 2.54: This type is not introspectable.
Packit ae235b
 */
Packit ae235b
struct _GParameter /* auxiliary structure for _setv() variants */
Packit ae235b
{
Packit ae235b
  const gchar *name;
Packit ae235b
  GValue       value;
Packit ae235b
};
Packit ae235b
Packit ae235b
Packit ae235b
/* --- prototypes --- */
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GParamSpec*	g_param_spec_ref		(GParamSpec    *pspec);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void		g_param_spec_unref		(GParamSpec    *pspec);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void		g_param_spec_sink		(GParamSpec    *pspec);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GParamSpec*	g_param_spec_ref_sink   	(GParamSpec    *pspec);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gpointer        g_param_spec_get_qdata		(GParamSpec    *pspec,
Packit ae235b
						 GQuark         quark);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void            g_param_spec_set_qdata		(GParamSpec    *pspec,
Packit ae235b
						 GQuark         quark,
Packit ae235b
						 gpointer       data);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void            g_param_spec_set_qdata_full	(GParamSpec    *pspec,
Packit ae235b
						 GQuark         quark,
Packit ae235b
						 gpointer       data,
Packit ae235b
						 GDestroyNotify destroy);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gpointer        g_param_spec_steal_qdata	(GParamSpec    *pspec,
Packit ae235b
						 GQuark         quark);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GParamSpec*     g_param_spec_get_redirect_target (GParamSpec   *pspec);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void		g_param_value_set_default	(GParamSpec    *pspec,
Packit ae235b
						 GValue	       *value);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean	g_param_value_defaults		(GParamSpec    *pspec,
Packit ae235b
						 GValue	       *value);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean	g_param_value_validate		(GParamSpec    *pspec,
Packit ae235b
						 GValue	       *value);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gboolean	g_param_value_convert		(GParamSpec    *pspec,
Packit ae235b
						 const GValue  *src_value,
Packit ae235b
						 GValue	       *dest_value,
Packit ae235b
						 gboolean	strict_validation);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gint		g_param_values_cmp		(GParamSpec    *pspec,
Packit ae235b
						 const GValue  *value1,
Packit ae235b
						 const GValue  *value2);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
const gchar *   g_param_spec_get_name           (GParamSpec    *pspec);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
const gchar *   g_param_spec_get_nick           (GParamSpec    *pspec);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
const gchar *   g_param_spec_get_blurb          (GParamSpec    *pspec);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void            g_value_set_param               (GValue	       *value,
Packit ae235b
						 GParamSpec    *param);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GParamSpec*     g_value_get_param               (const GValue  *value);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GParamSpec*     g_value_dup_param               (const GValue  *value);
Packit ae235b
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void           g_value_take_param               (GValue        *value,
Packit ae235b
					         GParamSpec    *param);
Packit ae235b
GLIB_DEPRECATED_FOR(g_value_take_param)
Packit ae235b
void           g_value_set_param_take_ownership (GValue        *value,
Packit ae235b
                                                 GParamSpec    *param);
Packit ae235b
GLIB_AVAILABLE_IN_2_36
Packit ae235b
const GValue *  g_param_spec_get_default_value  (GParamSpec    *pspec);
Packit ae235b
Packit ae235b
GLIB_AVAILABLE_IN_2_46
Packit ae235b
GQuark          g_param_spec_get_name_quark     (GParamSpec    *pspec);
Packit ae235b
Packit ae235b
/* --- convenience functions --- */
Packit ae235b
typedef struct _GParamSpecTypeInfo GParamSpecTypeInfo;
Packit ae235b
/**
Packit ae235b
 * GParamSpecTypeInfo:
Packit ae235b
 * @instance_size: Size of the instance (object) structure.
Packit ae235b
 * @n_preallocs: 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 [slice allocator][glib-Memory-Slices] now.
Packit ae235b
 * @instance_init: Location of the instance initialization function (optional).
Packit ae235b
 * @value_type: The #GType of values conforming to this #GParamSpec
Packit ae235b
 * @finalize: The instance finalization function (optional).
Packit ae235b
 * @value_set_default: Resets a @value to the default value for @pspec 
Packit ae235b
 *  (recommended, the default is g_value_reset()), see 
Packit ae235b
 *  g_param_value_set_default().
Packit ae235b
 * @value_validate: Ensures that the contents of @value comply with the 
Packit ae235b
 *  specifications set out by @pspec (optional), see 
Packit ae235b
 *  g_param_value_validate().
Packit ae235b
 * @values_cmp: Compares @value1 with @value2 according to @pspec 
Packit ae235b
 *  (recommended, the default is memcmp()), see g_param_values_cmp().
Packit ae235b
 * 
Packit ae235b
 * This structure is used to provide the type system with the information
Packit ae235b
 * required to initialize and destruct (finalize) a parameter's class and
Packit ae235b
 * instances thereof.
Packit ae235b
 * The initialized structure is passed to the g_param_type_register_static() 
Packit ae235b
 * The type system will perform a deep copy of this structure, so its memory 
Packit ae235b
 * does not need to be persistent across invocation of 
Packit ae235b
 * g_param_type_register_static().
Packit ae235b
 */
Packit ae235b
struct _GParamSpecTypeInfo
Packit ae235b
{
Packit ae235b
  /* type system portion */
Packit ae235b
  guint16         instance_size;                               /* obligatory */
Packit ae235b
  guint16         n_preallocs;                                 /* optional */
Packit ae235b
  void		(*instance_init)	(GParamSpec   *pspec); /* optional */
Packit ae235b
Packit ae235b
  /* class portion */
Packit ae235b
  GType           value_type;				       /* obligatory */
Packit ae235b
  void          (*finalize)             (GParamSpec   *pspec); /* optional */
Packit ae235b
  void          (*value_set_default)    (GParamSpec   *pspec,  /* recommended */
Packit ae235b
					 GValue       *value);
Packit ae235b
  gboolean      (*value_validate)       (GParamSpec   *pspec,  /* optional */
Packit ae235b
					 GValue       *value);
Packit ae235b
  gint          (*values_cmp)           (GParamSpec   *pspec,  /* recommended */
Packit ae235b
					 const GValue *value1,
Packit ae235b
					 const GValue *value2);
Packit ae235b
};
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GType	g_param_type_register_static	(const gchar		  *name,
Packit ae235b
					 const GParamSpecTypeInfo *pspec_info);
Packit ae235b
Packit ae235b
/* For registering builting types */
Packit ae235b
GType  _g_param_type_register_static_constant (const gchar              *name,
Packit ae235b
					       const GParamSpecTypeInfo *pspec_info,
Packit ae235b
					       GType                     opt_type);
Packit ae235b
Packit ae235b
Packit ae235b
/* --- protected --- */
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
gpointer	g_param_spec_internal		(GType	        param_type,
Packit ae235b
						 const gchar   *name,
Packit ae235b
						 const gchar   *nick,
Packit ae235b
						 const gchar   *blurb,
Packit ae235b
						 GParamFlags    flags);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GParamSpecPool* g_param_spec_pool_new		(gboolean	type_prefixing);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void		g_param_spec_pool_insert	(GParamSpecPool	*pool,
Packit ae235b
						 GParamSpec	*pspec,
Packit ae235b
						 GType		 owner_type);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
void		g_param_spec_pool_remove	(GParamSpecPool	*pool,
Packit ae235b
						 GParamSpec	*pspec);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GParamSpec*	g_param_spec_pool_lookup	(GParamSpecPool	*pool,
Packit ae235b
						 const gchar	*param_name,
Packit ae235b
						 GType		 owner_type,
Packit ae235b
						 gboolean	 walk_ancestors);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GList*		g_param_spec_pool_list_owned	(GParamSpecPool	*pool,
Packit ae235b
						 GType		 owner_type);
Packit ae235b
GLIB_AVAILABLE_IN_ALL
Packit ae235b
GParamSpec**	g_param_spec_pool_list		(GParamSpecPool	*pool,
Packit ae235b
						 GType		 owner_type,
Packit ae235b
						 guint		*n_pspecs_p);
Packit ae235b
Packit ae235b
Packit ae235b
/* contracts:
Packit ae235b
 *
Packit ae235b
 * gboolean value_validate (GParamSpec *pspec,
Packit ae235b
 *                          GValue     *value):
Packit ae235b
 *	modify value contents in the least destructive way, so
Packit ae235b
 *	that it complies with pspec's requirements (i.e.
Packit ae235b
 *	according to minimum/maximum ranges etc...). return
Packit ae235b
 *	whether modification was necessary.
Packit ae235b
 *
Packit ae235b
 * gint values_cmp (GParamSpec   *pspec,
Packit ae235b
 *                  const GValue *value1,
Packit ae235b
 *                  const GValue *value2):
Packit ae235b
 *	return value1 - value2, i.e. (-1) if value1 < value2,
Packit ae235b
 *	(+1) if value1 > value2, and (0) otherwise (equality)
Packit ae235b
 */
Packit ae235b
Packit ae235b
G_END_DECLS
Packit ae235b
Packit ae235b
#endif /* __G_PARAM_H__ */