Next: , Previous: ClutterImage, Up: Top


40 Value intervals

An object holding an interval of two values

40.1 Overview

<clutter-interval> is a simple object that can hold two values defining an interval. <clutter-interval> can hold any value that can be enclosed inside a <gvalue>.

Once a <clutter-interval> for a specific <g-type> has been instantiated the <"value-type"> property cannot be changed anymore.

<clutter-interval> starts with a floating reference; this means that any object taking a reference on a <clutter-interval> instance should also take ownership of the interval by using g-object-ref-sink.

<clutter-interval> is used by <clutter-animation> to define the interval of values that an implicit animation should tween over.

<clutter-interval> can be subclassed to override the validation and value computation.

<clutter-interval> is available since Clutter 1.0

40.2 Usage

— Function: clutter-interval-new-with-values (gtype <gtype>) (initial <gvalue>) (final <gvalue>) ⇒  (ret <clutter-interval>)

Creates a new <clutter-interval> of type gtype, between initial and final.

This function is useful for language bindings.

gtype
the type of the values in the interval
initial
a <gvalue> holding the initial value of the interval
final
a <gvalue> holding the final value of the interval
ret
the newly created <clutter-interval>

Since 1.0

— Function: clutter-interval-clone (self <clutter-interval>) ⇒  (ret <clutter-interval>)
— Method: clone

Creates a copy of interval.

interval
a <clutter-interval>
ret
the newly created <clutter-interval>.

Since 1.0

— Function: clutter-interval-get-value-type (self <clutter-interval>) ⇒  (ret <gtype>)
— Method: get-value-type

Retrieves the <g-type> of the values inside interval.

interval
a <clutter-interval>
ret
the type of the value, or G_TYPE_INVALID

Since 1.0

— Function: clutter-interval-set-initial-value (self <clutter-interval>) (value <gvalue>)
— Method: set-initial-value

Sets the initial value of interval to value. The value is copied inside the <clutter-interval>.

Rename to: clutter_interval_set_initial

interval
a <clutter-interval>
value
a <gvalue>

Since 1.0

— Function: clutter-interval-get-initial-value (self <clutter-interval>) ⇒  (ret <gvalue>)
— Method: get-initial-value

Retrieves the initial value of interval and copies it into value.

The passed <gvalue> must be initialized to the value held by the <clutter-interval>.

interval
a <clutter-interval>
value
a <gvalue>.

Since 1.0

— Function: clutter-interval-set-final-value (self <clutter-interval>) (value <gvalue>)
— Method: set-final-value

Sets the final value of interval to value. The value is copied inside the <clutter-interval>.

Rename to: clutter_interval_set_final

interval
a <clutter-interval>
value
a <gvalue>

Since 1.0

— Function: clutter-interval-get-final-value (self <clutter-interval>) ⇒  (ret <gvalue>)
— Method: get-final-value

Retrieves the final value of interval and copies it into value.

The passed <gvalue> must be initialized to the value held by the <clutter-interval>.

interval
a <clutter-interval>
value
a <gvalue>.

Since 1.0

— Function: clutter-interval-validate (self <clutter-interval>) (pspec <gparam>) ⇒  (ret bool)
— Method: validate

Validates the initial and final values of interval against a <gparam>.

interval
a <clutter-interval>
pspec
a <gparam>
ret
#t’ if the <clutter-interval> is valid, ‘#f’ otherwise

Since 1.0

— Function: clutter-interval-compute (self <clutter-interval>) (factor double) ⇒  (ret <gvalue>)
— Method: compute

Computes the value between the interval boundaries given the progress factor

Unlike clutter-interval-compute-value, this function will return a const pointer to the computed value

You should use this function if you immediately pass the computed value to another function that makes a copy of it, like g-object-set-property

interval
a <clutter-interval>
factor
the progress factor, between 0 and 1
ret
a pointer to the computed value, or ‘#f’ if the computation was not successfull.

Since 1.4