2006-12-04 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/clutter-private.h: Add our own READABLE,
	WRITABLE and READWRITE paramspec flags, declaring the
	string components of the properties GParamSpec as static;
	this should shave off some bytes in the memory footprint
	and avoid relocations.

	* clutter/clutter-actor.c:
	* clutter/clutter-behaviour.c:
	* clutter/clutter-behaviour-opacity.c:
	* clutter/clutter-behaviour-path.c:
	* clutter/clutter-behavuour-scale.c:
	* clutter/clutter-clone-texture.c:
	* clutter/clutter-label.c:
	* clutter/clutter-rectangle.c:
	* clutter/clutter-stage.c:
	* clutter/clutter-texture.c:
	* clutter/clutter-timeline.c: Use the CLUTTER_PARAM_*
	macros we just added.

	* clutter/clutter-behaviour-scale.c: Add properties for
	the scale begin, scale end and gravity parameters.

	* clutter/clutter-behaviour-path.h: Mark the ClutterKnot
	memory management functions as public (for the bindings),
	since we use the slice allocator for copying knots around;
	add a clutter_knot_equal() function.

	* clutter/clutter-behaviour-path.c:
	(node_distance): Use clutter_knot_equal() as a fast path
	to avoid the sqrt() in case the nodes we are using are
	at the same position.
	(path_total_length): Additional check on the existence
	of the next node.

	* examples/behave.c: Do not leak the ClutterBehaviour
	objects around.
This commit is contained in:
Emmanuele Bassi 2006-12-04 16:26:35 +00:00
parent 28d83d3c1a
commit f83ffa3520
16 changed files with 249 additions and 62 deletions

View File

@ -1,3 +1,42 @@
2006-12-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-private.h: Add our own READABLE,
WRITABLE and READWRITE paramspec flags, declaring the
string components of the properties GParamSpec as static;
this should shave off some bytes in the memory footprint
and avoid relocations.
* clutter/clutter-actor.c:
* clutter/clutter-behaviour.c:
* clutter/clutter-behaviour-opacity.c:
* clutter/clutter-behaviour-path.c:
* clutter/clutter-behavuour-scale.c:
* clutter/clutter-clone-texture.c:
* clutter/clutter-label.c:
* clutter/clutter-rectangle.c:
* clutter/clutter-stage.c:
* clutter/clutter-texture.c:
* clutter/clutter-timeline.c: Use the CLUTTER_PARAM_*
macros we just added.
* clutter/clutter-behaviour-scale.c: Add properties for
the scale begin, scale end and gravity parameters.
* clutter/clutter-behaviour-path.h: Mark the ClutterKnot
memory management functions as public (for the bindings),
since we use the slice allocator for copying knots around;
add a clutter_knot_equal() function.
* clutter/clutter-behaviour-path.c:
(node_distance): Use clutter_knot_equal() as a fast path
to avoid the sqrt() in case the nodes we are using are
at the same position.
(path_total_length): Additional check on the existence
of the next node.
* examples/behave.c: Do not leak the ClutterBehaviour
objects around.
2006-12-03 Emmanuele Bassi <ebassi@openedhand.com> 2006-12-03 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-texture.h: Clean up. * clutter/clutter-texture.h: Clean up.

View File

@ -38,6 +38,7 @@
#include "clutter-enum-types.h" #include "clutter-enum-types.h"
#include "clutter-marshal.h" #include "clutter-marshal.h"
#include "clutter-private.h" #include "clutter-private.h"
#include "clutter-debug.h"
G_DEFINE_ABSTRACT_TYPE (ClutterActor, G_DEFINE_ABSTRACT_TYPE (ClutterActor,
clutter_actor, clutter_actor,
@ -603,7 +604,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
"X co-ord of actor", "X co-ord of actor",
0, G_MAXINT, 0, G_MAXINT,
0, 0,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
/** /**
* ClutterActor:y: * ClutterActor:y:
* *
@ -616,7 +617,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
"Y co-ord of actor", "Y co-ord of actor",
0, G_MAXINT, 0, G_MAXINT,
0, 0,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
/** /**
* ClutterActor:width: * ClutterActor:width:
* *
@ -629,7 +630,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
"Width of actor in pixels", "Width of actor in pixels",
0, G_MAXINT, 0, G_MAXINT,
0, 0,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
/** /**
* ClutterActor:height: * ClutterActor:height:
* *
@ -642,7 +643,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
"Height of actor in pixels", "Height of actor in pixels",
0, G_MAXINT, 0, G_MAXINT,
0, 0,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
/** /**
* ClutterActor:opacity: * ClutterActor:opacity:
* *
@ -655,7 +656,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
"Opacity of actor", "Opacity of actor",
0, 0xff, 0, 0xff,
0xff, 0xff,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
/** /**
* ClutterActor:visible: * ClutterActor:visible:
* *
@ -667,7 +668,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
"Visible", "Visible",
"Whether the actor is visible or not", "Whether the actor is visible or not",
FALSE, FALSE,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
/** /**
* ClutterActor:has-clip: * ClutterActor:has-clip:
* *
@ -679,7 +680,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
"Has Clip", "Has Clip",
"Whether the actor has a clip set or not", "Whether the actor has a clip set or not",
FALSE, FALSE,
G_PARAM_READABLE)); CLUTTER_PARAM_READABLE));
/** /**
* ClutterActor:clip: * ClutterActor:clip:
* *
@ -691,7 +692,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
"Clip", "Clip",
"The clip region for the actor", "The clip region for the actor",
CLUTTER_TYPE_GEOMETRY, CLUTTER_TYPE_GEOMETRY,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
/** /**
* ClutterActor:name: * ClutterActor:name:
* *
@ -705,7 +706,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
"Name", "Name",
"Name of the actor", "Name of the actor",
NULL, NULL,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
/** /**
* ClutterActor::destroy: * ClutterActor::destroy:

View File

@ -201,7 +201,7 @@ clutter_alpha_class_init (ClutterAlphaClass *klass)
"Timeline", "Timeline",
"Timeline", "Timeline",
CLUTTER_TYPE_TIMELINE, CLUTTER_TYPE_TIMELINE,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
/** /**
* ClutterAlpha:alpha: * ClutterAlpha:alpha:
* *
@ -217,7 +217,7 @@ clutter_alpha_class_init (ClutterAlphaClass *klass)
0, 0,
CLUTTER_ALPHA_MAX_ALPHA, CLUTTER_ALPHA_MAX_ALPHA,
0, 0,
G_PARAM_READABLE)); CLUTTER_PARAM_READABLE));
} }
static void static void

View File

@ -178,7 +178,7 @@ clutter_behaviour_opacity_class_init (ClutterBehaviourOpacityClass *klass)
"Initial opacity level", "Initial opacity level",
0, 255, 0, 255,
0, 0,
G_PARAM_READWRITE | CLUTTER_PARAM_READWRITE |
G_PARAM_CONSTRUCT)); G_PARAM_CONSTRUCT));
/** /**
@ -195,7 +195,7 @@ clutter_behaviour_opacity_class_init (ClutterBehaviourOpacityClass *klass)
"Final opacity level", "Final opacity level",
0, 255, 0, 255,
0, 0,
G_PARAM_READWRITE | CLUTTER_PARAM_READWRITE |
G_PARAM_CONSTRUCT)); G_PARAM_CONSTRUCT));
behave_class->alpha_notify = clutter_behaviour_alpha_notify; behave_class->alpha_notify = clutter_behaviour_alpha_notify;

View File

@ -50,10 +50,12 @@
#include "clutter-enum-types.h" #include "clutter-enum-types.h"
#include "clutter-main.h" #include "clutter-main.h"
#include "clutter-behaviour-path.h" #include "clutter-behaviour-path.h"
#include "clutter-private.h"
#include "clutter-debug.h"
#include <math.h> #include <math.h>
static ClutterKnot * ClutterKnot *
clutter_knot_copy (const ClutterKnot *knot) clutter_knot_copy (const ClutterKnot *knot)
{ {
ClutterKnot *copy; ClutterKnot *copy;
@ -65,7 +67,7 @@ clutter_knot_copy (const ClutterKnot *knot)
return copy; return copy;
} }
static void void
clutter_knot_free (ClutterKnot *knot) clutter_knot_free (ClutterKnot *knot)
{ {
if (G_LIKELY (knot)) if (G_LIKELY (knot))
@ -74,16 +76,29 @@ clutter_knot_free (ClutterKnot *knot)
} }
} }
gboolean
clutter_knot_equal (const ClutterKnot *knot_a,
const ClutterKnot *knot_b)
{
g_return_val_if_fail (knot_a != NULL, FALSE);
g_return_val_if_fail (knot_b != NULL, FALSE);
return knot_a->x == knot_b->x && knot_a->y == knot_b->y;
}
GType GType
clutter_knot_get_type (void) clutter_knot_get_type (void)
{ {
static GType our_type = 0; static GType our_type = 0;
if (G_UNLIKELY (!our_type)) if (G_UNLIKELY (!our_type))
our_type = g_boxed_type_register_static {
("ClutterKnot", our_type =
(GBoxedCopyFunc) clutter_knot_copy, g_boxed_type_register_static ("ClutterKnot",
(GBoxedFreeFunc) clutter_knot_free); (GBoxedCopyFunc) clutter_knot_copy,
(GBoxedFreeFunc) clutter_knot_free);
}
return our_type; return our_type;
} }
@ -147,6 +162,9 @@ node_distance (const ClutterKnot *begin,
g_return_val_if_fail (begin != NULL, 0); g_return_val_if_fail (begin != NULL, 0);
g_return_val_if_fail (end != NULL, 0); g_return_val_if_fail (end != NULL, 0);
if (clutter_knot_equal (begin, end))
return 0;
/* FIXME: need fixed point here */ /* FIXME: need fixed point here */
return sqrt ((end->x - begin->x) * (end->x - begin->x) + return sqrt ((end->x - begin->x) * (end->x - begin->x) +
(end->y - begin->y) * (end->y - begin->y)); (end->y - begin->y) * (end->y - begin->y));
@ -159,7 +177,7 @@ path_total_length (ClutterBehaviourPath *behave)
gint len = 0; gint len = 0;
for (l = behave->priv->knots; l != NULL; l = l->next) for (l = behave->priv->knots; l != NULL; l = l->next)
if (l->next) if (l->next && l->next->data)
len += node_distance (l->data, l->next->data); len += node_distance (l->data, l->next->data);
return len; return len;
@ -288,7 +306,7 @@ clutter_behaviour_path_class_init (ClutterBehaviourPathClass *klass)
"Knot", "Knot",
"Can be used to append a knot to the path", "Can be used to append a knot to the path",
CLUTTER_TYPE_KNOT, CLUTTER_TYPE_KNOT,
G_PARAM_WRITABLE)); CLUTTER_PARAM_WRITABLE));
/** /**
* ClutterBehaviourPath::knot-reached: * ClutterBehaviourPath::knot-reached:

View File

@ -43,7 +43,11 @@ struct _ClutterKnot
/* FIXME: optionally include bezier control points also ? */ /* FIXME: optionally include bezier control points also ? */
}; };
GType clutter_knot_get_type (void) G_GNUC_CONST; GType clutter_knot_get_type (void) G_GNUC_CONST;
ClutterKnot *clutter_knot_copy (const ClutterKnot *knot);
void clutter_knot_free (ClutterKnot *knot);
gboolean clutter_knot_equal (const ClutterKnot *knot_a,
const ClutterKnot *knot_b);
#define CLUTTER_TYPE_BEHAVIOUR_PATH (clutter_behaviour_path_get_type ()) #define CLUTTER_TYPE_BEHAVIOUR_PATH (clutter_behaviour_path_get_type ())

View File

@ -71,6 +71,15 @@ struct _ClutterBehaviourScalePrivate
CLUTTER_TYPE_BEHAVIOUR_SCALE, \ CLUTTER_TYPE_BEHAVIOUR_SCALE, \
ClutterBehaviourScalePrivate)) ClutterBehaviourScalePrivate))
enum
{
PROP_0,
PROP_SCALE_BEGIN,
PROP_SCALE_END,
PROP_SCALE_GRAVITY
};
static void static void
scale_frame_foreach (ClutterActor *actor, scale_frame_foreach (ClutterActor *actor,
ClutterBehaviourScale *behave) ClutterBehaviourScale *behave)
@ -139,12 +148,115 @@ clutter_behaviour_scale_alpha_notify (ClutterBehaviour *behave,
CLUTTER_BEHAVIOUR_SCALE (behave)); CLUTTER_BEHAVIOUR_SCALE (behave));
} }
static void
clutter_behaviour_scale_set_property (GObject *gobject,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ClutterBehaviourScalePrivate *priv;
priv = CLUTTER_BEHAVIOUR_SCALE (gobject)->priv;
switch (prop_id)
{
case PROP_SCALE_BEGIN:
priv->scale_begin = CLUTTER_FLOAT_TO_FIXED (g_value_get_double (value));
break;
case PROP_SCALE_END:
priv->scale_end = CLUTTER_FLOAT_TO_FIXED (g_value_get_double (value));
break;
case PROP_SCALE_GRAVITY:
priv->gravity = g_value_get_enum (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break;
}
}
static void
clutter_behaviour_scale_get_property (GObject *gobject,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ClutterBehaviourScalePrivate *priv;
priv = CLUTTER_BEHAVIOUR_SCALE (gobject)->priv;
switch (prop_id)
{
case PROP_SCALE_BEGIN:
g_value_set_double (value, CLUTTER_FIXED_TO_FLOAT (priv->scale_begin));
break;
case PROP_SCALE_END:
g_value_set_double (value, CLUTTER_FIXED_TO_FLOAT (priv->scale_end));
break;
case PROP_SCALE_GRAVITY:
g_value_set_enum (value, priv->gravity);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break;
}
}
static void static void
clutter_behaviour_scale_class_init (ClutterBehaviourScaleClass *klass) clutter_behaviour_scale_class_init (ClutterBehaviourScaleClass *klass)
{ {
ClutterBehaviourClass *behave_class; GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
ClutterBehaviourClass *behave_class = CLUTTER_BEHAVIOUR_CLASS (klass);
gobject_class->set_property = clutter_behaviour_scale_set_property;
gobject_class->get_property = clutter_behaviour_scale_get_property;
/**
* ClutterBehaviourScale:scale-begin:
*
* The initial scaling factor for the actors.
*
* Since: 0.2
*/
g_object_class_install_property (gobject_class,
PROP_SCALE_BEGIN,
g_param_spec_double ("scale-begin",
"Scale Begin",
"Initial scale",
1.0, G_MAXDOUBLE,
1.0,
CLUTTER_PARAM_READWRITE));
/**
* ClutterBehaviourScale:scale-end:
*
* The final scaling factor for the actors.
*
* Since: 0.2
*/
g_object_class_install_property (gobject_class,
PROP_SCALE_END,
g_param_spec_double ("scale-end",
"Scale End",
"Final scale",
1.0, G_MAXDOUBLE,
1.0,
CLUTTER_PARAM_READWRITE));
/**
* ClutterBehaviourScale:gravity:
*
* The gravity of the scaling.
*
* Since: 0.2
*/
g_object_class_install_property (gobject_class,
PROP_SCALE_GRAVITY,
g_param_spec_enum ("scale-gravity",
"Scale Gravity",
"The gravity of the scaling",
CLUTTER_TYPE_GRAVITY,
CLUTTER_GRAVITY_CENTER,
CLUTTER_PARAM_READWRITE));
behave_class = (ClutterBehaviourClass*) klass;
behave_class->alpha_notify = clutter_behaviour_scale_alpha_notify; behave_class->alpha_notify = clutter_behaviour_scale_alpha_notify;

View File

@ -49,10 +49,15 @@
* (or properties) of every actor controlled by the behaviour. * (or properties) of every actor controlled by the behaviour.
*/ */
#ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif
#include "clutter-main.h"
#include "clutter-actor.h" #include "clutter-actor.h"
#include "clutter-behaviour.h" #include "clutter-behaviour.h"
#include "clutter-debug.h"
#include "clutter-private.h"
G_DEFINE_ABSTRACT_TYPE (ClutterBehaviour, G_DEFINE_ABSTRACT_TYPE (ClutterBehaviour,
clutter_behaviour, clutter_behaviour,
@ -156,7 +161,7 @@ clutter_behaviour_class_init (ClutterBehaviourClass *klass)
"Alpha Object to drive the behaviour", "Alpha Object to drive the behaviour",
CLUTTER_TYPE_ALPHA, CLUTTER_TYPE_ALPHA,
G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT |
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
g_type_class_add_private (klass, sizeof (ClutterBehaviourPrivate)); g_type_class_add_private (klass, sizeof (ClutterBehaviourPrivate));
} }

View File

@ -319,7 +319,7 @@ clutter_clone_texture_class_init (ClutterCloneTextureClass *klass)
"Parent Texture", "Parent Texture",
"The parent texture to clone", "The parent texture to clone",
CLUTTER_TYPE_TEXTURE, CLUTTER_TYPE_TEXTURE,
(G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE))); (G_PARAM_CONSTRUCT_ONLY | CLUTTER_PARAM_READWRITE)));
g_type_class_add_private (gobject_class, sizeof (ClutterCloneTexturePrivate)); g_type_class_add_private (gobject_class, sizeof (ClutterCloneTexturePrivate));
} }

View File

@ -348,7 +348,7 @@ clutter_label_class_init (ClutterLabelClass *klass)
"Font Name", "Font Name",
"Pango font description", "Pango font description",
NULL, NULL,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_TEXT, (gobject_class, PROP_TEXT,
@ -356,7 +356,7 @@ clutter_label_class_init (ClutterLabelClass *klass)
"Text", "Text",
"Text to render", "Text to render",
NULL, NULL,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_COLOR, (gobject_class, PROP_COLOR,
@ -364,7 +364,7 @@ clutter_label_class_init (ClutterLabelClass *klass)
"Font Colour", "Font Colour",
"Font Colour", "Font Colour",
CLUTTER_TYPE_COLOR, CLUTTER_TYPE_COLOR,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_ATTRIBUTES, (gobject_class, PROP_ATTRIBUTES,
@ -373,7 +373,7 @@ clutter_label_class_init (ClutterLabelClass *klass)
"A list of style attributes to apply to the" "A list of style attributes to apply to the"
"text of the label", "text of the label",
PANGO_TYPE_ATTR_LIST, PANGO_TYPE_ATTR_LIST,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_USE_MARKUP, (gobject_class, PROP_USE_MARKUP,
@ -382,7 +382,7 @@ clutter_label_class_init (ClutterLabelClass *klass)
"The text of the label includes XML markup." "The text of the label includes XML markup."
"See pango_parse_markup()", "See pango_parse_markup()",
FALSE, FALSE,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_WRAP, (gobject_class, PROP_WRAP,
@ -390,7 +390,7 @@ clutter_label_class_init (ClutterLabelClass *klass)
"Line wrap", "Line wrap",
"If set, wrap lines if the text becomes too wide", "If set, wrap lines if the text becomes too wide",
TRUE, TRUE,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_WRAP_MODE, (gobject_class, PROP_WRAP_MODE,
@ -399,7 +399,7 @@ clutter_label_class_init (ClutterLabelClass *klass)
"If wrap is set, controls how linewrapping is done", "If wrap is set, controls how linewrapping is done",
PANGO_TYPE_WRAP_MODE, PANGO_TYPE_WRAP_MODE,
PANGO_WRAP_WORD, PANGO_WRAP_WORD,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_ELLIPSIZE, (gobject_class, PROP_ELLIPSIZE,
@ -410,7 +410,7 @@ clutter_label_class_init (ClutterLabelClass *klass)
"display the entire string", "display the entire string",
PANGO_TYPE_ELLIPSIZE_MODE, PANGO_TYPE_ELLIPSIZE_MODE,
PANGO_ELLIPSIZE_NONE, PANGO_ELLIPSIZE_NONE,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_ALIGNMENT, (gobject_class, PROP_ALIGNMENT,
@ -419,7 +419,7 @@ clutter_label_class_init (ClutterLabelClass *klass)
"The preferred alignment for the string,", "The preferred alignment for the string,",
PANGO_TYPE_ALIGNMENT, PANGO_TYPE_ALIGNMENT,
PANGO_ALIGN_LEFT, PANGO_ALIGN_LEFT,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
g_type_class_add_private (gobject_class, sizeof (ClutterLabelPrivate)); g_type_class_add_private (gobject_class, sizeof (ClutterLabelPrivate));
} }

View File

@ -43,8 +43,6 @@
#include <pango/pangoft2.h> #include <pango/pangoft2.h>
#include <clutter/clutter-debug.h>
G_BEGIN_DECLS G_BEGIN_DECLS
typedef struct _ClutterMainContext ClutterMainContext; typedef struct _ClutterMainContext ClutterMainContext;
@ -87,6 +85,13 @@ typedef enum {
void clutter_feature_init (void); void clutter_feature_init (void);
#define CLUTTER_PARAM_READABLE \
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB
#define CLUTTER_PARAM_WRITABLE \
G_PARAM_WRITABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB
#define CLUTTER_PARAM_READWRITE \
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |G_PARAM_STATIC_BLURB
G_END_DECLS G_END_DECLS
#endif #endif

View File

@ -220,7 +220,7 @@ clutter_rectangle_class_init (ClutterRectangleClass *klass)
"Color", "Color",
"The color of the rectangle", "The color of the rectangle",
CLUTTER_TYPE_COLOR, CLUTTER_TYPE_COLOR,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
/** /**
* ClutterRectangle:border-color: * ClutterRectangle:border-color:
* *
@ -234,7 +234,7 @@ clutter_rectangle_class_init (ClutterRectangleClass *klass)
"Border Color", "Border Color",
"The color of the border of the rectangle", "The color of the border of the rectangle",
CLUTTER_TYPE_COLOR, CLUTTER_TYPE_COLOR,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
/** /**
* ClutterRectangle:border-width: * ClutterRectangle:border-width:
* *
@ -249,7 +249,7 @@ clutter_rectangle_class_init (ClutterRectangleClass *klass)
"The width of the border of the rectangle", "The width of the border of the rectangle",
0, G_MAXUINT, 0, G_MAXUINT,
0, 0,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
/** /**
* ClutterRectangle:has-border: * ClutterRectangle:has-border:
* *
@ -263,7 +263,7 @@ clutter_rectangle_class_init (ClutterRectangleClass *klass)
"Has Border", "Has Border",
"Whether the rectangle should have a border", "Whether the rectangle should have a border",
FALSE, FALSE,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
g_type_class_add_private (gobject_class, sizeof (ClutterRectanglePrivate)); g_type_class_add_private (gobject_class, sizeof (ClutterRectanglePrivate));
} }

View File

@ -690,7 +690,7 @@ clutter_stage_class_init (ClutterStageClass *klass)
"Fullscreen", "Fullscreen",
"Make Clutter stage fullscreen", "Make Clutter stage fullscreen",
FALSE, FALSE,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_OFFSCREEN, (gobject_class, PROP_OFFSCREEN,
@ -698,7 +698,7 @@ clutter_stage_class_init (ClutterStageClass *klass)
"Offscreen", "Offscreen",
"Make Clutter stage offscreen", "Make Clutter stage offscreen",
FALSE, FALSE,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
@ -707,7 +707,7 @@ clutter_stage_class_init (ClutterStageClass *klass)
"Hide Cursor", "Hide Cursor",
"Make Clutter stage cursor-less", "Make Clutter stage cursor-less",
FALSE, FALSE,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_COLOR, (gobject_class, PROP_COLOR,
@ -715,7 +715,7 @@ clutter_stage_class_init (ClutterStageClass *klass)
"Color", "Color",
"The color of the stage", "The color of the stage",
CLUTTER_TYPE_COLOR, CLUTTER_TYPE_COLOR,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
stage_signals[INPUT_EVENT] = stage_signals[INPUT_EVENT] =
g_signal_new ("input-event", g_signal_new ("input-event",

View File

@ -848,7 +848,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
g_param_spec_pointer ("pixbuf", g_param_spec_pointer ("pixbuf",
"Pixbuf source for Texture.", "Pixbuf source for Texture.",
"Pixbuf source for Texture.", "Pixbuf source for Texture.",
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_USE_TILES, (gobject_class, PROP_USE_TILES,
@ -862,7 +862,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
*/ */
(clutter_feature_available (clutter_feature_available
(CLUTTER_FEATURE_TEXTURE_RECTANGLE) == FALSE), (CLUTTER_FEATURE_TEXTURE_RECTANGLE) == FALSE),
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT_ONLY | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_SYNC_SIZE, (gobject_class, PROP_SYNC_SIZE,
@ -871,7 +871,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
"Auto sync size of actor to underlying pixbuf" "Auto sync size of actor to underlying pixbuf"
"dimentions", "dimentions",
TRUE, TRUE,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_REPEAT_X, (gobject_class, PROP_REPEAT_X,
@ -880,7 +880,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
"Reapeat underlying pixbuf rather than scale" "Reapeat underlying pixbuf rather than scale"
"in x direction. Currently UNWORKING", "in x direction. Currently UNWORKING",
FALSE, FALSE,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_REPEAT_Y, (gobject_class, PROP_REPEAT_Y,
@ -889,7 +889,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
"Reapeat underlying pixbuf rather than scale" "Reapeat underlying pixbuf rather than scale"
"in y direction. Currently UNWORKING", "in y direction. Currently UNWORKING",
FALSE, FALSE,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
/* FIXME: Ideally this option needs to have some kind of global /* FIXME: Ideally this option needs to have some kind of global
* overide as to imporve performance. * overide as to imporve performance.
@ -905,7 +905,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
0, 0,
G_MAXINT, G_MAXINT,
1, 1,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_MAX_TILE_WASTE, (gobject_class, PROP_MAX_TILE_WASTE,
@ -917,7 +917,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
0, 0,
G_MAXINT, G_MAXINT,
64, 64,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT_ONLY | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_PIXEL_TYPE, (gobject_class, PROP_PIXEL_TYPE,
@ -927,7 +927,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
0, 0,
G_MAXINT, G_MAXINT,
PIXEL_TYPE, PIXEL_TYPE,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT_ONLY | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(gobject_class, PROP_PIXEL_FORMAT, (gobject_class, PROP_PIXEL_FORMAT,
@ -937,7 +937,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
0, 0,
G_MAXINT, G_MAXINT,
GL_RGBA, GL_RGBA,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT_ONLY | CLUTTER_PARAM_READWRITE));
texture_signals[SIGNAL_SIZE_CHANGE] = texture_signals[SIGNAL_SIZE_CHANGE] =
g_signal_new ("size-change", g_signal_new ("size-change",

View File

@ -189,7 +189,7 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
0, 0,
1000, 1000,
50, 50,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_NUM_FRAMES, (object_class, PROP_NUM_FRAMES,
@ -199,7 +199,7 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
0, 0,
G_MAXINT, G_MAXINT,
0, 0,
G_PARAM_READWRITE)); CLUTTER_PARAM_READWRITE));
g_object_class_install_property g_object_class_install_property
(object_class, PROP_LOOP, (object_class, PROP_LOOP,
@ -207,7 +207,7 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
"Loop", "Loop",
"Should the timeline automatically restart", "Should the timeline automatically restart",
FALSE, FALSE,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
timeline_signals[NEW_FRAME] = timeline_signals[NEW_FRAME] =
g_signal_new ("new-frame", g_signal_new ("new-frame",

View File

@ -5,7 +5,7 @@ main (int argc, char *argv[])
{ {
ClutterTimeline *timeline; ClutterTimeline *timeline;
ClutterAlpha *alpha; ClutterAlpha *alpha;
ClutterBehaviour *behave; ClutterBehaviour *o_behave, *p_behave;
ClutterActor *stage; ClutterActor *stage;
ClutterActor *group, *rect, *hand; ClutterActor *group, *rect, *hand;
ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff }; ClutterColor stage_color = { 0xcc, 0xcc, 0xcc, 0xff };
@ -64,14 +64,14 @@ main (int argc, char *argv[])
NULL, NULL); NULL, NULL);
/* Create a behaviour for that alpha */ /* Create a behaviour for that alpha */
behave = clutter_behaviour_opacity_new (alpha, 0X33, 0xff); o_behave = clutter_behaviour_opacity_new (alpha, 0X33, 0xff);
/* Apply it to our actor */ /* Apply it to our actor */
clutter_behaviour_apply (behave, group); clutter_behaviour_apply (o_behave, group);
/* Make a path behaviour and apply that too */ /* Make a path behaviour and apply that too */
behave = clutter_behaviour_path_new (alpha, knots, 5); p_behave = clutter_behaviour_path_new (alpha, knots, 5);
clutter_behaviour_apply (behave, group); clutter_behaviour_apply (p_behave, group);
/* start the timeline and thus the animations */ /* start the timeline and thus the animations */
clutter_timeline_start (timeline); clutter_timeline_start (timeline);
@ -80,5 +80,8 @@ main (int argc, char *argv[])
clutter_main(); clutter_main();
g_object_unref (o_behave);
g_object_unref (p_behave);
return 0; return 0;
} }