Details
G_TYPE_IS_PARAM()
#define G_TYPE_IS_PARAM(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_PARAM)
|
Returns whether type "is a" G_TYPE_PARAM.
G_PARAM_SPEC()
#define G_PARAM_SPEC(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM, GParamSpec))
|
Cast a derived GParamSpec object (e.g. of type GParamSpecInt) into
a GParamSpec object.
G_IS_PARAM_SPEC()
#define G_IS_PARAM_SPEC(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM))
|
Check whether pspec "is a" valid GParamSpec structure of type G_TYPE_PARAM
or derived.
G_PARAM_SPEC_CLASS()
#define G_PARAM_SPEC_CLASS(pclass) (G_TYPE_CHECK_CLASS_CAST ((pclass), G_TYPE_PARAM, GParamSpecClass))
|
Cast a derived GParamSpecClass structure into a GParamSpecClass structure.
G_IS_PARAM_SPEC_CLASS()
#define G_IS_PARAM_SPEC_CLASS(pclass) (G_TYPE_CHECK_CLASS_TYPE ((pclass), G_TYPE_PARAM))
|
Check whether pclass "is a" valid GParamSpecClass structure of type G_TYPE_PARAM
or derived.
G_PARAM_SPEC_GET_CLASS()
#define G_PARAM_SPEC_GET_CLASS(pspec) (G_TYPE_INSTANCE_GET_CLASS ((pspec), G_TYPE_PARAM, GParamSpecClass))
|
Retrieve the GParamSpecClass of a GParamSpec.
G_PARAM_SPEC_TYPE()
#define G_PARAM_SPEC_TYPE(pspec) (G_TYPE_FROM_INSTANCE (pspec))
|
Retrive the GType of this pspec.
G_PARAM_SPEC_TYPE_NAME()
#define G_PARAM_SPEC_TYPE_NAME(pspec) (g_type_name (G_PARAM_SPEC_TYPE (pspec)))
|
Retrive the GType name of this pspec.
G_PARAM_SPEC_VALUE_TYPE()
#define G_PARAM_SPEC_VALUE_TYPE(pspec) (G_PARAM_SPEC (pspec)->value_type)
|
Retrive the GType to intiialize a GValue for this parameter.
struct GParamSpec
struct GParamSpec
{
GTypeInstance g_type_instance;
gchar *name;
GParamFlags flags;
GType value_type;
GType owner_type; /* class using this property */
/*< private >*/
gchar *_nick;
gchar *_blurb;
GData *qdata;
guint ref_count;
guint param_id; /* sort-criteria */
};
|
enum GParamFlags
typedef enum
{
G_PARAM_READABLE = 1 << 0,
G_PARAM_WRITABLE = 1 << 1,
G_PARAM_CONSTRUCT = 1 << 2,
G_PARAM_CONSTRUCT_ONLY = 1 << 3,
G_PARAM_LAX_VALIDATION = 1 << 4,
G_PARAM_PRIVATE = 1 << 5
} GParamFlags;
|
Through the GParamFlags flag values, certain aspects of parameters
can be configured.
G_PARAM_READWRITE
#define G_PARAM_READWRITE (G_PARAM_READABLE | G_PARAM_WRITABLE)
|
GParamFlags value alias for G_PARAM_READABLE | G_PARAM_WRITABLE.
G_PARAM_MASK
#define G_PARAM_MASK (0x000000ff)
|
Mask containing the bits of GParamSpec.flags which are reserved for GLib.
G_PARAM_USER_SHIFT
#define G_PARAM_USER_SHIFT (8)
|
Minimum shift count to be used for user defined flags, to be stored in
GParamSpec.flags.
g_param_spec_ref ()
Increment the reference count of pspec.
g_param_spec_unref ()
Decrement the reference count of a pspec.
g_param_spec_sink ()
The initial reference count of a newly created GParamSpec is 1,
eventhough no one has explicitely called g_param_spec_ref() on it yet.
So the einital reference count is flagged as "floating", untill someone
calls: g_param_spec_ref (pspec); g_param_spec_sink (pspec);
in sequence on it, taking over the initial reference count (thus
ending up with a pspec that has a reference count of 1 still, but is
not flagged "floating" anymore).
g_param_value_set_default ()
Set value to its default value as specified in pspec.
g_param_value_defaults ()
Check whether value contains the default value as specified in pspec.
g_param_value_validate ()
Ensure that the contents of value comply with the specifications
set out by pspec. For example, a GParamSpecInt might require
that integers stored in value may not be smaller than -42 and not be
greater than +42. If value contains an integer outside of this range,
it is modified accordingly, so the resulting value will fit into the
range -42 .. +42.
g_param_value_convert ()
This function transforms src_value into dest_value if possible,
and then validates dest_value, in order for it to conform to
pspec.
If strict_validation is TRUE this function will only suceed if
the transformed dest_value complied to pspec without modifications.
See also g_value_type_transformable(), g_value_transform() and
g_param_value_validate().
g_param_values_cmp ()
Compare value1 with value2 according to pspec, and return -1, 0 or +1,
if value1 is found to be less than, equal to or greater than value2, respectively.
g_param_spec_get_blurb ()
g_param_spec_get_qdata ()
g_param_spec_set_qdata ()
g_param_spec_set_qdata_full ()
g_param_spec_steal_qdata ()
struct GParamSpecTypeInfo
struct GParamSpecTypeInfo
{
/* 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);
};
|
g_param_type_register_static ()
g_param_spec_pool_insert ()
g_param_spec_pool_remove ()
g_param_spec_pool_lookup ()
g_param_spec_pool_list ()
g_param_spec_pool_list_owned ()