![]() |
![]() |
![]() |
libInstPatch Reference Manual | ![]() |
---|---|---|---|---|
IpatchRange; IpatchParamSpecRange; #define IPATCH_TYPE_RANGE #define IPATCH_VALUE_HOLDS_RANGE (value) #define IPATCH_RANGE_SET_VALUES (range, val1, val2) #define IPATCH_RANGE_SET_NULL (range) IpatchRange* ipatch_range_new (void); IpatchRange* ipatch_range_copy (IpatchRange *range); void ipatch_range_free (IpatchRange *range); void ipatch_value_set_range (GValue *value, const IpatchRange *range); void ipatch_value_set_static_range (GValue *value, IpatchRange *range); IpatchRange* ipatch_value_get_range (const GValue *value); #define IPATCH_TYPE_PARAM_RANGE GType ipatch_param_spec_range_get_type (void); GParamSpec* ipatch_param_spec_range (const char *name, const char *nick, const char *blurb, int min, int max, int default_low, int default_high, GParamFlags flags);
typedef struct { int low; /* low endpoint of range or -1 if undefined */ int high; /* high endpoint of range or -1 if undefined */ } IpatchRange;
typedef struct { GParamSpec parent_instance; /* derived from GParamSpec */ int min, max; /* min and max values for range endpoints */ int default_low, default_high; /* default vals for low and high endpoints */ } IpatchParamSpecRange;
IpatchRange* ipatch_range_new (void);
Create a new value range structure (to store an integer range).
Returns : | Newly allocated integer range structure. |
IpatchRange* ipatch_range_copy (IpatchRange *range);
Duplicates an integer range structure.
range : |
Range structure to duplicate |
Returns : | New duplicate range structure. |
void ipatch_range_free (IpatchRange *range);
Free a range structure previously allocated with ipatch_range_new()
.
range : |
Integer range structure to free |
void ipatch_value_set_range (GValue *value, const IpatchRange *range);
Set the range values of a IPATCH_TYPE_RANGE GValue. The range
structure is copied.
value : |
a valid GValue of IPATCH_TYPE_RANGE boxed type |
range : |
Range structure to assign to value
|
void ipatch_value_set_static_range (GValue *value, IpatchRange *range);
Set the range values of a IPATCH_TYPE_RANGE GValue. This function uses
range
directly and so it should be static, use ipatch_value_set_range()
if the range
value should be duplicated.
value : |
A valid GValue of IPATCH_TYPE_RANGE boxed type |
range : |
Range structure to assign to value
|
IpatchRange* ipatch_value_get_range (const GValue *value);
Get the range structure from a IPATCH_TYPE_RANGE GValue.
value : |
A valid GValue of IPATCH_TYPE_RANGE boxed type |
Returns : | IpatchRange structure containing the range values of value or
NULL if not set. The returned structure is NOT duplicated and is the
same pointer used in value .
|
GParamSpec* ipatch_param_spec_range (const char *name, const char *nick, const char *blurb, int min, int max, int default_low, int default_high, GParamFlags flags);
Create a parameter specification for IPATCH_TYPE_RANGE GValues.
name : |
Property name |
nick : |
Property nick name |
blurb : |
Property description blurb |
min : |
Minimum value for range end points (can be -1 to allow undefined ranges) |
max : |
Maximum value for range end points |
default_low : |
Default value for low endpoint of range |
default_high : |
Default value for high endpoint of range |
flags : |
Property flags |
Returns : | New range parameter specification. |