2007-04-30 04:39:11 -04:00
|
|
|
/* -*- mode:C; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
|
|
|
/*
|
|
|
|
* Clutter.
|
|
|
|
*
|
|
|
|
* An OpenGL based 'interactive canvas' library.
|
|
|
|
*
|
|
|
|
* Authored By Tomas Frydrych <tf@openedhand.com>
|
|
|
|
*
|
|
|
|
* Copyright (C) 2007 OpenedHand
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:clutter-behaviour-ellipse
|
|
|
|
* @short_description: elliptic path behaviour.
|
|
|
|
*
|
|
|
|
* #ClutterBehaviourEllipse interpolates actors along a path defined by
|
2007-06-01 06:00:35 -04:00
|
|
|
* an ellipse.
|
2007-04-30 04:39:11 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "clutter-fixed.h"
|
|
|
|
#include "clutter-marshal.h"
|
|
|
|
#include "clutter-behaviour-ellipse.h"
|
2007-07-22 18:35:45 -04:00
|
|
|
#include "clutter-debug.h"
|
2007-04-30 04:39:11 -04:00
|
|
|
#include "clutter-enum-types.h"
|
|
|
|
#include "clutter-private.h"
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <memory.h>
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* *
|
|
|
|
* ClutterBehaviourEllipse *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (ClutterBehaviourEllipse,
|
|
|
|
clutter_behaviour_ellipse,
|
|
|
|
CLUTTER_TYPE_BEHAVIOUR);
|
|
|
|
|
|
|
|
#define CLUTTER_BEHAVIOUR_ELLIPSE_GET_PRIVATE(obj) \
|
|
|
|
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
|
|
|
|
CLUTTER_TYPE_BEHAVIOUR_ELLIPSE, \
|
|
|
|
ClutterBehaviourEllipsePrivate))
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
|
|
|
|
PROP_CENTER,
|
|
|
|
PROP_WIDTH,
|
|
|
|
PROP_HEIGHT,
|
|
|
|
PROP_ANGLE_BEGIN,
|
|
|
|
PROP_ANGLE_END,
|
2007-05-15 07:51:14 -04:00
|
|
|
PROP_ANGLE_TILT,
|
2007-04-30 04:39:11 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _ClutterBehaviourEllipsePrivate
|
|
|
|
{
|
|
|
|
ClutterKnot center;
|
2007-07-22 18:35:45 -04:00
|
|
|
|
2007-04-30 04:39:11 -04:00
|
|
|
gint a;
|
|
|
|
gint b;
|
2007-07-22 18:35:45 -04:00
|
|
|
|
2007-04-30 04:39:11 -04:00
|
|
|
ClutterAngle angle_begin;
|
|
|
|
ClutterAngle angle_end;
|
2007-05-15 07:51:14 -04:00
|
|
|
ClutterAngle angle_tilt;
|
2007-04-30 04:39:11 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_advance (ClutterBehaviourEllipse *e,
|
|
|
|
ClutterAngle angle,
|
|
|
|
ClutterKnot *knot)
|
2007-04-30 04:39:11 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterBehaviourEllipsePrivate *priv = e->priv;
|
|
|
|
gint x, y;
|
|
|
|
|
|
|
|
x = CLUTTER_FIXED_INT (priv->a * clutter_cosi (angle));
|
|
|
|
y = CLUTTER_FIXED_INT (priv->b * clutter_sini (angle));
|
2007-04-30 04:39:11 -04:00
|
|
|
|
2007-05-15 07:51:14 -04:00
|
|
|
if (e->priv->angle_tilt)
|
|
|
|
{
|
2007-05-29 05:21:18 -04:00
|
|
|
/*
|
|
|
|
* x2 = r * cos (angle + tilt)
|
|
|
|
* y2 = r * sin (angle + tilt)
|
|
|
|
*
|
|
|
|
* These can be trasformed to the formulas below using properties of
|
|
|
|
* sin (a + b) and cos (a + b)
|
2007-05-15 07:51:14 -04:00
|
|
|
*
|
|
|
|
*/
|
2007-05-29 05:21:18 -04:00
|
|
|
ClutterFixed x2, y2;
|
2007-05-15 07:51:14 -04:00
|
|
|
|
2007-07-22 18:35:45 -04:00
|
|
|
x2 = x * clutter_cosi (priv->angle_tilt)
|
|
|
|
- y * clutter_sini (priv->angle_tilt);
|
2007-05-15 07:51:14 -04:00
|
|
|
|
2007-07-22 18:35:45 -04:00
|
|
|
y2 = y * clutter_cosi (priv->angle_tilt)
|
|
|
|
+ x * clutter_sini (priv->angle_tilt);
|
2007-05-29 05:21:18 -04:00
|
|
|
|
2007-07-22 18:35:45 -04:00
|
|
|
knot->x = CLUTTER_FIXED_INT (x2);
|
|
|
|
knot->y = CLUTTER_FIXED_INT (y2);
|
2007-05-29 05:21:18 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
knot->x = x;
|
|
|
|
knot->y = y;
|
2007-05-15 07:51:14 -04:00
|
|
|
}
|
|
|
|
|
2007-07-22 18:35:45 -04:00
|
|
|
CLUTTER_NOTE (BEHAVIOUR, "advancing to angle %d [%d, %d] (a: %d, b: %d)",
|
|
|
|
angle,
|
|
|
|
knot->x, knot->y,
|
|
|
|
priv->a, priv->b);
|
2007-04-30 04:39:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
actor_apply_knot_foreach (ClutterBehaviour *behave,
|
|
|
|
ClutterActor *actor,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
ClutterKnot *knot = data;
|
2007-07-22 18:35:45 -04:00
|
|
|
|
2007-04-30 04:39:11 -04:00
|
|
|
clutter_actor_set_position (actor, knot->x, knot->y);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_alpha_notify (ClutterBehaviour *behave,
|
|
|
|
guint32 alpha)
|
2007-04-30 04:39:11 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterBehaviourEllipse *self = CLUTTER_BEHAVIOUR_ELLIPSE (behave);
|
|
|
|
ClutterBehaviourEllipsePrivate *priv = self->priv;
|
2007-04-30 04:39:11 -04:00
|
|
|
ClutterKnot knot;
|
|
|
|
ClutterAngle angle;
|
|
|
|
|
2007-07-22 18:35:45 -04:00
|
|
|
if (priv->angle_end >= priv->angle_begin)
|
2007-04-30 04:39:11 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
angle = (priv->angle_end - priv->angle_begin)
|
|
|
|
* alpha
|
|
|
|
/ CLUTTER_ALPHA_MAX_ALPHA
|
|
|
|
+ priv->angle_begin;
|
2007-04-30 04:39:11 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
angle = priv->angle_begin
|
|
|
|
- ((priv->angle_begin - priv->angle_end) * alpha)
|
|
|
|
/ CLUTTER_ALPHA_MAX_ALPHA;
|
2007-04-30 04:39:11 -04:00
|
|
|
}
|
2007-05-31 05:29:12 -04:00
|
|
|
|
2007-04-30 04:39:11 -04:00
|
|
|
clutter_behaviour_ellipse_advance (self, angle, &knot);
|
|
|
|
|
2007-07-22 18:35:45 -04:00
|
|
|
knot.x += priv->center.x;
|
|
|
|
knot.y += priv->center.y;
|
2007-04-30 04:39:11 -04:00
|
|
|
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_actors_foreach (behave, actor_apply_knot_foreach, &knot);
|
2007-04-30 04:39:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_behaviour_ellipse_set_property (GObject *gobject,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterBehaviourEllipse *el = CLUTTER_BEHAVIOUR_ELLIPSE (gobject);
|
|
|
|
ClutterBehaviourEllipsePrivate *priv = el->priv;
|
2007-04-30 04:39:11 -04:00
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_ANGLE_BEGIN:
|
2007-07-22 18:35:45 -04:00
|
|
|
priv->angle_begin = CLUTTER_ANGLE_FROM_DEG (g_value_get_double (value));
|
2007-04-30 04:39:11 -04:00
|
|
|
break;
|
|
|
|
case PROP_ANGLE_END:
|
2007-07-22 18:35:45 -04:00
|
|
|
priv->angle_end = CLUTTER_ANGLE_FROM_DEG (g_value_get_double (value));
|
2007-04-30 04:39:11 -04:00
|
|
|
break;
|
2007-05-15 07:51:14 -04:00
|
|
|
case PROP_ANGLE_TILT:
|
2007-07-22 18:35:45 -04:00
|
|
|
priv->angle_tilt = CLUTTER_ANGLE_FROM_DEG (g_value_get_double (value));
|
2007-05-15 07:51:14 -04:00
|
|
|
break;
|
2007-04-30 04:39:11 -04:00
|
|
|
case PROP_WIDTH:
|
2007-04-30 04:39:20 -04:00
|
|
|
priv->a = g_value_get_int (value) >> 1;
|
2007-04-30 04:39:11 -04:00
|
|
|
break;
|
|
|
|
case PROP_HEIGHT:
|
2007-04-30 04:39:20 -04:00
|
|
|
priv->b = g_value_get_int (value) >> 1;
|
2007-04-30 04:39:11 -04:00
|
|
|
break;
|
|
|
|
case PROP_CENTER:
|
2007-05-25 08:07:24 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterKnot *knot = g_value_get_boxed (value);
|
|
|
|
if (knot)
|
|
|
|
clutter_behaviour_ellipse_set_center (el, knot->x, knot->y);
|
2007-05-25 08:07:24 -04:00
|
|
|
}
|
2007-04-30 04:39:11 -04:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_behaviour_ellipse_get_property (GObject *gobject,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
ClutterBehaviourEllipsePrivate *priv;
|
|
|
|
|
|
|
|
priv = CLUTTER_BEHAVIOUR_ELLIPSE (gobject)->priv;
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_ANGLE_BEGIN:
|
2007-07-22 18:35:45 -04:00
|
|
|
g_value_set_double (value, CLUTTER_ANGLE_TO_DEG (priv->angle_begin));
|
2007-04-30 04:39:11 -04:00
|
|
|
break;
|
|
|
|
case PROP_ANGLE_END:
|
2007-07-22 18:35:45 -04:00
|
|
|
g_value_set_double (value, CLUTTER_ANGLE_TO_DEG (priv->angle_end));
|
2007-04-30 04:39:11 -04:00
|
|
|
break;
|
2007-05-15 07:51:14 -04:00
|
|
|
case PROP_ANGLE_TILT:
|
2007-07-22 18:35:45 -04:00
|
|
|
g_value_set_double (value, CLUTTER_ANGLE_TO_DEG (priv->angle_tilt));
|
2007-05-15 07:51:14 -04:00
|
|
|
break;
|
2007-04-30 04:39:11 -04:00
|
|
|
case PROP_WIDTH:
|
2007-07-22 18:35:45 -04:00
|
|
|
g_value_set_int (value, (priv->a << 1));
|
2007-04-30 04:39:11 -04:00
|
|
|
break;
|
|
|
|
case PROP_HEIGHT:
|
2007-07-22 18:35:45 -04:00
|
|
|
g_value_set_int (value, (priv->b << 1));
|
2007-04-30 04:39:11 -04:00
|
|
|
break;
|
|
|
|
case PROP_CENTER:
|
|
|
|
g_value_set_boxed (value, &priv->center);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-07-11 03:16:21 -04:00
|
|
|
static void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_applied (ClutterBehaviour *behave,
|
|
|
|
ClutterActor *actor)
|
2007-07-11 03:16:21 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterBehaviourEllipse *e = CLUTTER_BEHAVIOUR_ELLIPSE (behave);
|
2007-07-11 03:16:21 -04:00
|
|
|
ClutterKnot knot;
|
|
|
|
|
|
|
|
clutter_behaviour_ellipse_advance (e, e->priv->angle_begin, &knot);
|
|
|
|
|
|
|
|
clutter_actor_set_position (actor, knot.x, knot.y);
|
2007-07-22 18:35:45 -04:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* no need to chain up: ClutterBehaviourEllipse's parent class does
|
|
|
|
* not have a class closure for ::apply
|
|
|
|
*/
|
2007-07-11 03:16:21 -04:00
|
|
|
if (CLUTTER_BEHAVIOUR_CLASS (clutter_behaviour_ellipse_parent_class)->apply)
|
|
|
|
CLUTTER_BEHAVIOUR_CLASS (clutter_behaviour_ellipse_parent_class)->apply (behave, actor);
|
2007-07-22 18:35:45 -04:00
|
|
|
#endif
|
2007-07-11 03:16:21 -04:00
|
|
|
}
|
|
|
|
|
2007-04-30 04:39:11 -04:00
|
|
|
static void
|
|
|
|
clutter_behaviour_ellipse_class_init (ClutterBehaviourEllipseClass *klass)
|
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass);
|
2007-04-30 04:39:11 -04:00
|
|
|
|
|
|
|
object_class->set_property = clutter_behaviour_ellipse_set_property;
|
|
|
|
object_class->get_property = clutter_behaviour_ellipse_get_property;
|
|
|
|
|
|
|
|
behave_class->alpha_notify = clutter_behaviour_ellipse_alpha_notify;
|
2007-07-22 18:35:45 -04:00
|
|
|
behave_class->applied = clutter_behaviour_ellipse_applied;
|
2007-07-11 03:16:21 -04:00
|
|
|
|
2007-04-30 04:39:11 -04:00
|
|
|
/**
|
|
|
|
* ClutterBehaviourEllipse:angle-begin:
|
|
|
|
*
|
2007-04-30 04:39:20 -04:00
|
|
|
* The initial angle from where the rotation should begin.
|
2007-04-30 04:39:11 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_ANGLE_BEGIN,
|
2007-07-22 18:35:45 -04:00
|
|
|
g_param_spec_double ("angle-begin",
|
|
|
|
"Angle Begin",
|
|
|
|
"Initial angle",
|
|
|
|
0.0, 360.0, 0.0,
|
|
|
|
CLUTTER_PARAM_READWRITE));
|
2007-04-30 04:39:11 -04:00
|
|
|
/**
|
|
|
|
* ClutterBehaviourEllipse:angle-end:
|
|
|
|
*
|
|
|
|
* The final angle to where the rotation should end.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_ANGLE_END,
|
2007-07-22 18:35:45 -04:00
|
|
|
g_param_spec_double ("angle-end",
|
|
|
|
"Angle End",
|
|
|
|
"Final angle",
|
|
|
|
0.0, 360.0, 360.0,
|
|
|
|
CLUTTER_PARAM_READWRITE));
|
2007-05-15 07:51:14 -04:00
|
|
|
/**
|
2007-07-22 18:35:45 -04:00
|
|
|
* ClutterBehaviourEllipse:angle-tilt:
|
2007-05-15 07:51:14 -04:00
|
|
|
*
|
2007-07-22 18:35:45 -04:00
|
|
|
* The tilt angle for the rotation
|
2007-05-15 07:51:14 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_ANGLE_TILT,
|
2007-07-22 18:35:45 -04:00
|
|
|
g_param_spec_double ("angle-tilt",
|
|
|
|
"Angle Tilt",
|
|
|
|
"Tilt of the ellipse",
|
|
|
|
0.0, 360.0, 360.0,
|
|
|
|
CLUTTER_PARAM_READWRITE));
|
2007-04-30 04:39:11 -04:00
|
|
|
/**
|
|
|
|
* ClutterBehaviourEllipse:width:
|
|
|
|
*
|
|
|
|
* Width of the ellipse.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_WIDTH,
|
|
|
|
g_param_spec_int ("width",
|
|
|
|
"Width",
|
|
|
|
"Width of ellipse",
|
|
|
|
0, G_MAXINT, 100,
|
|
|
|
CLUTTER_PARAM_READWRITE));
|
|
|
|
/**
|
|
|
|
* ClutterBehaviourEllipse:height:
|
|
|
|
*
|
|
|
|
* Height of the ellipse.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_HEIGHT,
|
|
|
|
g_param_spec_int ("height",
|
|
|
|
"Height",
|
|
|
|
"Height of ellipse",
|
|
|
|
0, G_MAXINT, 50,
|
|
|
|
CLUTTER_PARAM_READWRITE));
|
|
|
|
/**
|
|
|
|
* ClutterBehaviourEllipse:center:
|
|
|
|
*
|
|
|
|
* The center of the ellipse.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_CENTER,
|
|
|
|
g_param_spec_boxed ("center",
|
|
|
|
"Center",
|
|
|
|
"Center of ellipse",
|
|
|
|
CLUTTER_TYPE_KNOT,
|
|
|
|
CLUTTER_PARAM_READWRITE));
|
|
|
|
|
|
|
|
g_type_class_add_private (klass, sizeof (ClutterBehaviourEllipsePrivate));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_behaviour_ellipse_init (ClutterBehaviourEllipse * self)
|
|
|
|
{
|
|
|
|
ClutterBehaviourEllipsePrivate *priv;
|
|
|
|
|
|
|
|
self->priv = priv = CLUTTER_BEHAVIOUR_ELLIPSE_GET_PRIVATE (self);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_new:
|
|
|
|
* @alpha: a #ClutterAlpha, or %NULL
|
2007-05-25 08:07:24 -04:00
|
|
|
* @x: x coordinace of the center
|
|
|
|
* @y: y coordiance of the center
|
2007-04-30 04:39:11 -04:00
|
|
|
* @width: width of the ellipse
|
2007-04-30 04:39:20 -04:00
|
|
|
* @height: height of the ellipse
|
2007-05-25 08:07:24 -04:00
|
|
|
* @begin: angle in degrees at which movement begins
|
|
|
|
* @end: angle in degrees at which movement ends
|
|
|
|
* @tilt: angle in degrees with which the ellipse should be tilted around its
|
2007-05-15 07:51:14 -04:00
|
|
|
* center
|
2007-04-30 04:39:11 -04:00
|
|
|
*
|
2007-04-30 04:39:20 -04:00
|
|
|
* Creates a behaviour that drives actors along an elliptical path with
|
2007-05-31 06:11:06 -04:00
|
|
|
* given center, width and height; the movement begins at angle_begin (with 0
|
|
|
|
* corresponding to 12 o'clock) and ends at angle_end; if angle_end > angle_begin,
|
|
|
|
* the movement is in clockwise direction, counter-clockwise otherwise.
|
2007-04-30 04:39:11 -04:00
|
|
|
*
|
|
|
|
* Return value: a #ClutterBehaviour
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
ClutterBehaviour *
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_new (ClutterAlpha *alpha,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
gdouble begin,
|
|
|
|
gdouble end,
|
|
|
|
gdouble tilt)
|
2007-04-30 04:39:11 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterKnot center;
|
2007-04-30 04:39:11 -04:00
|
|
|
|
|
|
|
g_return_val_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha), NULL);
|
2007-05-25 08:07:24 -04:00
|
|
|
|
|
|
|
center.x = x;
|
|
|
|
center.y = y;
|
|
|
|
|
2007-07-22 18:35:45 -04:00
|
|
|
return g_object_new (CLUTTER_TYPE_BEHAVIOUR_ELLIPSE,
|
|
|
|
"alpha", alpha,
|
|
|
|
"center", ¢er,
|
|
|
|
"width", width,
|
|
|
|
"height", height,
|
|
|
|
"angle-begin", begin,
|
|
|
|
"angle-end", end,
|
|
|
|
"angle-tilt", tilt,
|
|
|
|
NULL);
|
2007-04-30 04:39:11 -04:00
|
|
|
}
|
|
|
|
|
2007-05-25 08:07:24 -04:00
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_newx:
|
|
|
|
* @alpha: a #ClutterAlpha, or %NULL
|
|
|
|
* @x: x coordinace of the center
|
|
|
|
* @y: y coordiance of the center
|
|
|
|
* @width: width of the ellipse
|
|
|
|
* @height: height of the ellipse
|
|
|
|
* @begin: #ClutterFixed angle in degrees at which movement begins
|
|
|
|
* @end: #ClutterFixed angle in degrees at which movement ends
|
2007-05-31 06:11:06 -04:00
|
|
|
* @tilt: #ClutterFixed angle in degrees with which the ellipse should be
|
|
|
|
* tilted around its center
|
2007-05-25 08:07:24 -04:00
|
|
|
*
|
|
|
|
* Creates a behaviour that drives actors along an elliptical path with
|
2007-05-31 06:11:06 -04:00
|
|
|
* given center, width and height; the movement begins at angle_begin (with 0
|
|
|
|
* corresponding to 12 o'clock) and ends at angle_end; if angle_end > angle_begin,
|
|
|
|
* the movement is in clockwise direction, counter-clockwise otherwise.
|
2007-05-25 08:07:24 -04:00
|
|
|
*
|
|
|
|
* Return value: a #ClutterBehaviour
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
ClutterBehaviour *
|
|
|
|
clutter_behaviour_ellipse_newx (ClutterAlpha * alpha,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint width,
|
|
|
|
gint height,
|
|
|
|
ClutterFixed begin,
|
|
|
|
ClutterFixed end,
|
|
|
|
ClutterFixed tilt)
|
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterKnot center;
|
2007-05-25 08:07:24 -04:00
|
|
|
|
|
|
|
g_return_val_if_fail (alpha == NULL || CLUTTER_IS_ALPHA (alpha), NULL);
|
|
|
|
|
|
|
|
center.x = x;
|
|
|
|
center.y = y;
|
|
|
|
|
2007-07-22 18:35:45 -04:00
|
|
|
return g_object_new (CLUTTER_TYPE_BEHAVIOUR_ELLIPSE,
|
|
|
|
"alpha", alpha,
|
|
|
|
"center", ¢er,
|
|
|
|
"width", width,
|
|
|
|
"height", height,
|
|
|
|
"angle-begin", CLUTTER_ANGLE_FROM_DEGX (begin),
|
|
|
|
"angle-end", CLUTTER_ANGLE_FROM_DEGX (end),
|
|
|
|
"angle-tilt", CLUTTER_ANGLE_FROM_DEGX (tilt),
|
|
|
|
NULL);
|
2007-05-25 08:07:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-04-30 04:39:11 -04:00
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_set_center
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
2007-05-25 08:07:24 -04:00
|
|
|
* @x: x coordinace of centre
|
|
|
|
* @y: y coordinace of centre
|
2007-04-30 04:39:11 -04:00
|
|
|
*
|
2007-04-30 04:39:20 -04:00
|
|
|
* Sets the center of the elliptical path to the point represented by knot.
|
2007-04-30 04:39:11 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_set_center (ClutterBehaviourEllipse *self,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
2007-04-30 04:39:11 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterBehaviourEllipsePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
|
|
|
|
|
|
|
priv = self->priv;
|
|
|
|
|
|
|
|
if (priv->center.x != x || priv->center.y != y)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
priv->center.x = x;
|
|
|
|
priv->center.y = y;
|
|
|
|
|
2007-04-30 04:39:20 -04:00
|
|
|
g_object_notify (G_OBJECT (self), "center");
|
|
|
|
}
|
2007-04-30 04:39:11 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_get_center
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
2007-05-25 08:07:24 -04:00
|
|
|
* @x: location to store the x coordinace of the center, or NULL
|
|
|
|
* @y: location to store the y coordinace of the center, or NULL
|
2007-04-30 04:39:11 -04:00
|
|
|
*
|
2007-04-30 04:39:20 -04:00
|
|
|
* Gets the center of the elliptical path path.
|
2007-04-30 04:39:11 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_get_center (ClutterBehaviourEllipse *self,
|
|
|
|
gint *x,
|
|
|
|
gint *y)
|
2007-04-30 04:39:11 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterBehaviourEllipsePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
|
|
|
|
|
|
|
priv = self->priv;
|
|
|
|
|
2007-05-25 08:07:24 -04:00
|
|
|
if (x)
|
2007-07-22 18:35:45 -04:00
|
|
|
*x = priv->center.x;
|
2007-05-25 08:07:24 -04:00
|
|
|
|
|
|
|
if (y)
|
2007-07-22 18:35:45 -04:00
|
|
|
*y = priv->center.y;
|
2007-04-30 04:39:11 -04:00
|
|
|
}
|
|
|
|
|
2007-04-30 04:39:20 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_set_width
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
* @width: width of the ellipse
|
|
|
|
*
|
|
|
|
* Sets the width of the elliptical path.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
clutter_behaviour_ellipse_set_width (ClutterBehaviourEllipse * self,
|
|
|
|
gint width)
|
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterBehaviourEllipsePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
|
|
|
|
|
|
|
priv = self->priv;
|
|
|
|
|
|
|
|
if (priv->a != width >> 1)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
priv->a = width >> 1;
|
|
|
|
|
2007-04-30 04:39:20 -04:00
|
|
|
g_object_notify (G_OBJECT (self), "width");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_get_width
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
*
|
|
|
|
* Gets the width of the elliptical path.
|
2007-05-17 08:03:43 -04:00
|
|
|
*
|
2007-06-01 06:00:35 -04:00
|
|
|
* Return value: the width of the path
|
2007-04-30 04:39:20 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
gint
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_get_width (ClutterBehaviourEllipse *self)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0);
|
|
|
|
|
2007-04-30 04:39:20 -04:00
|
|
|
return self->priv->a << 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_set_height
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
* @height: height of the ellipse
|
|
|
|
*
|
|
|
|
* Sets the height of the elliptical path.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_set_height (ClutterBehaviourEllipse *self,
|
|
|
|
gint height)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterBehaviourEllipsePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
|
|
|
|
|
|
|
priv = self->priv;
|
|
|
|
|
|
|
|
if (priv->b != height >> 1)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
priv->b = height >> 1;
|
|
|
|
|
2007-04-30 04:39:20 -04:00
|
|
|
g_object_notify (G_OBJECT (self), "height");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_get_height
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
*
|
|
|
|
* Gets the height of the elliptical path.
|
2007-05-17 08:03:43 -04:00
|
|
|
*
|
|
|
|
* Return value: the height of the path
|
2007-04-30 04:39:20 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
gint
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_get_height (ClutterBehaviourEllipse *self)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0);
|
|
|
|
|
2007-04-30 04:39:20 -04:00
|
|
|
return self->priv->b << 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_set_angle_begin
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
2007-07-11 03:16:21 -04:00
|
|
|
* @angle_begin: angle at which movement begins in degrees
|
2007-04-30 04:39:20 -04:00
|
|
|
*
|
|
|
|
* Sets the angle at which movement begins.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_set_angle_begin (ClutterBehaviourEllipse *self,
|
|
|
|
gdouble angle_begin)
|
2007-07-11 03:16:21 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
|
|
|
|
2007-07-11 03:16:21 -04:00
|
|
|
clutter_behaviour_ellipse_set_angle_beginx (self,
|
|
|
|
CLUTTER_ANGLE_FROM_DEG (angle_begin));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_set_angle_beginx
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
* @angle_begin: #ClutterAngle at which movement begins
|
|
|
|
*
|
|
|
|
* Sets the angle at which movement begins.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_set_angle_beginx (ClutterBehaviourEllipse *self,
|
|
|
|
ClutterAngle angle_begin)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterBehaviourEllipsePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
|
|
|
|
|
|
|
priv = self->priv;
|
|
|
|
if (priv->angle_begin != angle_begin)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
priv->angle_begin = angle_begin;
|
2007-04-30 04:39:20 -04:00
|
|
|
g_object_notify (G_OBJECT (self), "angle-begin");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_get_angle_begin
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
*
|
2007-05-17 08:03:43 -04:00
|
|
|
* Gets the angle at which movements begins.
|
|
|
|
*
|
2007-07-11 03:16:21 -04:00
|
|
|
* Return value: angle in degrees
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
gdouble
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_get_angle_begin (ClutterBehaviourEllipse *self)
|
2007-07-11 03:16:21 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0.0);
|
|
|
|
|
2007-07-11 03:16:21 -04:00
|
|
|
return CLUTTER_ANGLE_TO_DEG (self->priv->angle_begin);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_get_angle_beginx
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
*
|
|
|
|
* Gets the angle at which movements begins.
|
|
|
|
*
|
2007-05-17 08:03:43 -04:00
|
|
|
* Return value: a #ClutterAngle
|
2007-04-30 04:39:20 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
ClutterAngle
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_get_angle_beginx (ClutterBehaviourEllipse *self)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0);
|
|
|
|
|
2007-04-30 04:39:20 -04:00
|
|
|
return self->priv->angle_begin;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_set_angle_end
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
2007-07-11 03:16:21 -04:00
|
|
|
* @angle_end: angle at which movement ends in degrees.
|
2007-04-30 04:39:20 -04:00
|
|
|
*
|
|
|
|
* Sets the angle at which movement ends.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_set_angle_end (ClutterBehaviourEllipse *self,
|
|
|
|
gdouble angle_end)
|
2007-07-11 03:16:21 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
|
|
|
|
2007-07-11 03:16:21 -04:00
|
|
|
clutter_behaviour_ellipse_set_angle_endx (self,
|
|
|
|
CLUTTER_ANGLE_FROM_DEG (angle_end));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_set_angle_endx
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
* @angle_end: #ClutterAngle at which movement ends
|
|
|
|
*
|
|
|
|
* Sets the angle at which movement ends.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_set_angle_endx (ClutterBehaviourEllipse *self,
|
|
|
|
ClutterAngle angle_end)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterBehaviourEllipsePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
|
|
|
|
|
|
|
priv = self->priv;
|
|
|
|
|
|
|
|
if (priv->angle_end != angle_end)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
priv->angle_end = angle_end;
|
|
|
|
|
2007-04-30 04:39:20 -04:00
|
|
|
g_object_notify (G_OBJECT (self), "angle-end");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_get_angle_end
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
*
|
|
|
|
* Gets the at which movements ends.
|
2007-05-17 08:03:43 -04:00
|
|
|
*
|
2007-07-11 03:16:21 -04:00
|
|
|
* Return value: angle in degrees
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
gdouble
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_get_angle_end (ClutterBehaviourEllipse *self)
|
2007-07-11 03:16:21 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0.0);
|
|
|
|
|
2007-07-11 03:16:21 -04:00
|
|
|
return CLUTTER_ANGLE_TO_DEG (self->priv->angle_end);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_get_angle_endx
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
*
|
|
|
|
* Gets the angle at which movements ends.
|
|
|
|
*
|
2007-05-17 08:03:43 -04:00
|
|
|
* Return value: a #ClutterAngle
|
2007-04-30 04:39:20 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
ClutterAngle
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_get_angle_endx (ClutterBehaviourEllipse *self)
|
2007-04-30 04:39:20 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0);
|
|
|
|
|
2007-04-30 04:39:20 -04:00
|
|
|
return self->priv->angle_end;
|
|
|
|
}
|
|
|
|
|
2007-05-15 07:51:14 -04:00
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_set_angle_tilt
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
2007-07-11 03:16:21 -04:00
|
|
|
* @angle_tilt: tilt of the elipse around the center in degrees.
|
2007-05-15 07:51:14 -04:00
|
|
|
*
|
|
|
|
* Sets the angle at which the ellipse should be tilted around it's center.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_set_angle_tilt (ClutterBehaviourEllipse *self,
|
|
|
|
gdouble angle_tilt)
|
2007-07-11 03:16:21 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
|
|
|
|
2007-07-11 03:16:21 -04:00
|
|
|
clutter_behaviour_ellipse_set_angle_tiltx (self,
|
|
|
|
CLUTTER_ANGLE_FROM_DEG (angle_tilt));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_set_angle_tiltx
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
* @angle_tilt: #ClutterAngle tilt of the elipse around the center
|
|
|
|
*
|
|
|
|
* Sets the angle at which the ellipse should be tilted around it's center.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
void
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_set_angle_tiltx (ClutterBehaviourEllipse *self,
|
|
|
|
ClutterAngle angle_tilt)
|
2007-05-15 07:51:14 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
ClutterBehaviourEllipsePrivate *priv;
|
|
|
|
|
|
|
|
g_return_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self));
|
|
|
|
|
|
|
|
priv = self->priv;
|
|
|
|
|
|
|
|
if (priv->angle_tilt != angle_tilt)
|
2007-05-15 07:51:14 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
priv->angle_tilt = angle_tilt;
|
|
|
|
|
2007-05-15 07:51:14 -04:00
|
|
|
g_object_notify (G_OBJECT (self), "angle-tilt");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_get_angle_tilt
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
*
|
|
|
|
* Gets the tilt of the ellipse around the center.
|
2007-05-17 08:03:43 -04:00
|
|
|
*
|
2007-07-11 03:16:21 -04:00
|
|
|
* Return value: angle in degrees.
|
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
gdouble
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_get_angle_tilt (ClutterBehaviourEllipse *self)
|
2007-07-11 03:16:21 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0.0);
|
|
|
|
|
2007-07-11 03:16:21 -04:00
|
|
|
return CLUTTER_ANGLE_TO_DEG (self->priv->angle_tilt);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* clutter_behaviour_ellipse_get_angle_tiltx
|
|
|
|
* @self: a #ClutterBehaviourEllipse
|
|
|
|
*
|
|
|
|
* Gets the tilt of the ellipse around the center.
|
|
|
|
*
|
2007-05-17 08:03:43 -04:00
|
|
|
* Return value: a #ClutterAngle
|
2007-05-15 07:51:14 -04:00
|
|
|
*
|
|
|
|
* Since: 0.4
|
|
|
|
*/
|
|
|
|
ClutterAngle
|
2007-07-22 18:35:45 -04:00
|
|
|
clutter_behaviour_ellipse_get_angle_tiltx (ClutterBehaviourEllipse *self)
|
2007-05-15 07:51:14 -04:00
|
|
|
{
|
2007-07-22 18:35:45 -04:00
|
|
|
g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR_ELLIPSE (self), 0);
|
|
|
|
|
2007-05-15 07:51:14 -04:00
|
|
|
return self->priv->angle_tilt;
|
|
|
|
}
|
|
|
|
|