static VALUE
rbclt_behaviour_path_clear (VALUE self)
{
  ClutterBehaviourPath *bpath = CLUTTER_BEHAVIOUR_PATH (RVAL2GOBJ (self));
  clutter_behaviour_path_clear (bpath);
  return self;
}
Exemple #2
0
static void
clutter_behaviour_path_alpha_notify (ClutterBehaviour *behave,
                                     gdouble           alpha_value)
{
  ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (behave);
  ClutterBehaviourPathPrivate *priv = pathb->priv;
  ClutterKnot position;
  guint knot_num;

  if (priv->path)
    knot_num = clutter_path_get_position (priv->path, alpha_value, &position);
  else
    {
      memset (&position, 0, sizeof (position));
      knot_num = 0;
    }

  clutter_behaviour_actors_foreach (behave,
                                    actor_apply_knot_foreach,
                                    &position);

  if (knot_num != priv->last_knot_passed)
    {
      g_signal_emit (behave, path_signals[KNOT_REACHED], 0, knot_num);
      priv->last_knot_passed = knot_num;
    }
}
static VALUE
rbclt_behaviour_path_remove_knot (VALUE self, VALUE offset)
{
  ClutterBehaviourPath *bpath = CLUTTER_BEHAVIOUR_PATH (RVAL2GOBJ (self));
  clutter_behaviour_path_remove_knot (bpath, NUM2UINT (offset));
  return self;
}
static VALUE
rbclt_behaviour_path_insert_knot (VALUE self, VALUE offset, VALUE knot)
{
  ClutterBehaviourPath *bpath = CLUTTER_BEHAVIOUR_PATH (RVAL2GOBJ (self));
  clutter_behaviour_path_insert_knot (bpath, NUM2UINT (offset),
                                      RVAL2BOXED (knot, CLUTTER_TYPE_KNOT));
  return self;
}
Exemple #5
0
static void
clutter_behaviour_path_dispose (GObject *gobject)
{
  ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (gobject);

  clutter_behaviour_path_set_path (pathb, NULL);

  G_OBJECT_CLASS (clutter_behaviour_path_parent_class)->dispose (gobject);
}
static VALUE
rbclt_behaviour_path_append_knot (int argc, VALUE *argv, VALUE self)
{
  ClutterBehaviourPath *bpath = CLUTTER_BEHAVIOUR_PATH (RVAL2GOBJ (self));
  int i;

  for (i = 0; i < argc; i++)
    clutter_behaviour_path_append_knot (bpath, RVAL2BOXED (argv[i], CLUTTER_TYPE_KNOT));

  return self;
}
static VALUE
rbclt_behaviour_path_initialize (int argc, VALUE *argv, VALUE self)
{
  ClutterBehaviour *behaviour = clutter_behaviour_path_new (NULL, 0, 0);
  int i;

  G_INITIALIZE (self, behaviour);

  if (argc >= 1)
    clutter_behaviour_set_alpha (behaviour, RVAL2GOBJ (argv[0]));
  for (i = 1; i < argc; i++)
    clutter_behaviour_path_append_knot (CLUTTER_BEHAVIOUR_PATH (behaviour),
                                        RVAL2BOXED (argv[i], CLUTTER_TYPE_KNOT));

  return Qnil;
}
Exemple #8
0
static void
clutter_behaviour_path_set_property (GObject      *gobject,
                                     guint         prop_id,
                                     const GValue *value,
                                     GParamSpec   *pspec)
{
  ClutterBehaviourPath *pathb = CLUTTER_BEHAVIOUR_PATH (gobject);

  switch (prop_id)
    {
    case PROP_PATH:
      clutter_behaviour_path_set_path (pathb, g_value_get_object (value));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
      break;
    }
}
static VALUE
rbclt_behaviour_path_knots (VALUE self)
{
  ClutterBehaviourPath *bpath = CLUTTER_BEHAVIOUR_PATH (RVAL2GOBJ (self));
  return GSLIST2ARY2F (clutter_behaviour_path_get_knots (bpath), CLUTTER_TYPE_KNOT);
}