Class: Clutter::Interval

Inherits:
GObject::InitiallyUnowned
  • Object
show all
Defined in:
(unknown)

Overview

The Clutter::IntervalClass contains only private data.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gtype, initial, final) ⇒ Clutter::Interval

Creates a new Clutter::Interval of type gtype, between initial and final.

This function is useful for language bindings.

Parameters:

  • gtype (GLib::Type)

    the type of the values in the interval

  • initial (GObject::Value)

    a #GValue holding the initial value of the interval

  • final (GObject::Value)

    a #GValue holding the final value of the interval

Class Method Details

.register_progress_func(value_type, func) ⇒ nil

Sets the progress function for a given value_type, like:

|[ clutter_interval_register_progress_func (MY_TYPE_FOO, my_foo_progress); ]|

Whenever a Clutter::Interval instance using the default Clutter::Interval::compute_value implementation is set as an interval between two #GValue of type value_type, it will call func to establish the value depending on the given progress, for instance:

|[ static gboolean my_int_progress (const GValue *a, const GValue *b, gdouble progress, GValue *retval) { gint ia = g_value_get_int (a); gint ib = g_value_get_int (b); gint res = factor * (ib - ia) + ia;

g_value_set_int (retval, res);

return TRUE;

}

clutter_interval_register_progress_func (G_TYPE_INT, my_int_progress); ]|

To unset a previously set progress function of a #GType, pass nil for func.

Parameters:

  • value_type (GLib::Type)

    a #GType

  • func (Clutter::ProgressFunc)

    a Clutter::ProgressFunc, or nil to unset a previously set progress function

Returns:

  • (nil)

Instance Method Details

#cloneClutter::Interval

Creates a copy of interval.

Returns:

#compute(factor) ⇒ GObject::Value

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()

Parameters:

  • factor (Float)

    the progress factor, between 0 and 1

Returns:

  • (GObject::Value)

    a pointer to the computed value, or nil if the computation was not successfull

#compute_value(factor, value) ⇒ Boolean

Computes the value between the interval boundaries given the progress factor and copies it into value.

Parameters:

  • factor (Float)

    the progress factor, between 0 and 1

  • value (GObject::Value)

    return location for an initialized #GValue

Returns:

  • (Boolean)

    true if the operation was successful

#finalGObject::Value

The final value of the interval.

Returns:

  • (GObject::Value)

    final

#final=(final) ⇒ GObject::Value

The final value of the interval.

Parameters:

  • final (GObject::Value)

Returns:

  • (GObject::Value)

    final

  • (GObject::Value)

    final

#final_value=(value) ⇒ nil

Sets the final value of interval to value. The value is copied inside the Clutter::Interval.

Parameters:

  • value (GObject::Value)

    a #GValue

Returns:

  • (nil)

#get_final_value(value) ⇒ nil

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.

Parameters:

  • value (GObject::Value)

    a #GValue

Returns:

  • (nil)

#get_initial_value(value) ⇒ nil

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.

Parameters:

  • value (GObject::Value)

    a #GValue

Returns:

  • (nil)

#get_interval(array) ⇒ nil

Variable arguments wrapper for clutter_interval_get_initial_value() and clutter_interval_get_final_value() that avoids using the #GValue arguments:

|[ gint a = 0, b = 0; clutter_interval_get_interval (interval, &a, &b); ]|

This function is meant for the convenience of the C API; bindings should reimplement this function using the #GValue-based API.

Parameters:

  • array (Array)

    return locations for the initial and final values of the interval

Returns:

  • (nil)

#initialGObject::Value

The initial value of the interval.

Returns:

  • (GObject::Value)

    initial

#initial=(initial) ⇒ GObject::Value

The initial value of the interval.

Parameters:

  • initial (GObject::Value)

Returns:

  • (GObject::Value)

    initial

  • (GObject::Value)

    initial

#initial_value=(value) ⇒ nil

Sets the initial value of interval to value. The value is copied inside the Clutter::Interval.

Parameters:

  • value (GObject::Value)

    a #GValue

Returns:

  • (nil)

#interval=(array) ⇒ nil

Variable arguments wrapper for clutter_interval_set_initial_value() and clutter_interval_set_final_value() that avoids using the #GValue arguments:

|[ clutter_interval_set_interval (interval, 0, 50); clutter_interval_set_interval (interval, 1.0, 0.0); clutter_interval_set_interval (interval, FALSE, TRUE); ]|

This function is meant for the convenience of the C API; bindings should reimplement this function using the #GValue-based API.

Parameters:

  • array (Array)

    the initial and final values of the interval

Returns:

  • (nil)

#is_validBoolean

Checks if the interval has a valid initial and final values.

Returns:

  • (Boolean)

    true if the Clutter::Interval has an initial and final values, and false otherwise

#peek_final_valueGObject::Value

Gets the pointer to the final value of interval

Returns:

  • (GObject::Value)

    the final value of the interval. The value is owned by the Clutter::Interval and it should not be modified or freed

#peek_initial_valueGObject::Value

Gets the pointer to the initial value of interval

Returns:

  • (GObject::Value)

    the initial value of the interval. The value is owned by the Clutter::Interval and it should not be modified or freed

#validate(pspec) ⇒ Boolean

Validates the initial and final values of interval against a GParam::Spec.

Parameters:

  • pspec (GObject::ParamSpec)

    a GParam::Spec

Returns:

  • (Boolean)

    true if the Clutter::Interval is valid, false otherwise

#value_typeGLib::Type

The type of the values in the interval.

Returns:

  • (GLib::Type)

    value-type

#value_type=(value_type) ⇒ GLib::Type

The type of the values in the interval.

Parameters:

  • value_type (GLib::Type)

Returns:

  • (GLib::Type)

    value-type

  • (GLib::Type)

    value-type