Function

ClutterIntervalregister_progress_func

Declaration [src]

void
clutter_interval_register_progress_func (
  GType value_type,
  ClutterProgressFunc func
)

Description [src]

Sets the progress function for a given value_type, like:

  clutter_interval_register_progress_func (MY_TYPE_FOO,
                                           my_foo_progress);

Whenever a ClutterInterval 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 NULL for func.

This function is not directly available to language bindings.

Parameters

value_type

Type: GType

A GType.

func

Type: ClutterProgressFunc

A ClutterProgressFunc, or NULL to unset a previously set progress function.