2006-11-20 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/Makefile.am:
	* clutter/clutter.h:
	* clutter/clutter-version.h.in: Auto-generated versioning macros.

	* clutter/clutter-actor.h:
	* clutter/clutter-actor.c: Add a ClutterActor::parent-set signal,
	for notificating changes of an actor's parent; add api-doc for
	the actor's properties; add the ClutterActor "name" property; clean
	up a bit some functions; emit the "parent-set" signal when setting
	te parent and when unparenting; better warnings when lowering
	and raising an actor.

	* configure.ac:
	* clutter/Makefile.am: Add a --enable-debug configure option,
	with three levels of debugging: no, minimum and yes; default
	for development releases (odd minor version) is "yes"; update
	the version m4 defines; update the libtool macros: now just
	changed the clutter_interface_age when releasing will update
	everything else.
This commit is contained in:
Emmanuele Bassi 2006-11-20 12:02:24 +00:00
parent c9b6a89d04
commit 5cc29888af
14 changed files with 543 additions and 229 deletions

View File

@ -1,3 +1,25 @@
2006-11-20 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/Makefile.am:
* clutter/clutter.h:
* clutter/clutter-version.h.in: Auto-generated versioning macros.
* clutter/clutter-actor.h:
* clutter/clutter-actor.c: Add a ClutterActor::parent-set signal,
for notificating changes of an actor's parent; add api-doc for
the actor's properties; add the ClutterActor "name" property; clean
up a bit some functions; emit the "parent-set" signal when setting
te parent and when unparenting; better warnings when lowering
and raising an actor.
* configure.ac:
* clutter/Makefile.am: Add a --enable-debug configure option,
with three levels of debugging: no, minimum and yes; default
for development releases (odd minor version) is "yes"; update
the version m4 defines; update the libtool macros: now just
changed the clutter_interface_age when releasing will update
everything else.
2006-11-17 Emmanuele Bassi <ebassi@openedhand.com> 2006-11-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-behaviour-path.h: * clutter/clutter-behaviour-path.h:

View File

@ -2,6 +2,7 @@ SUBDIRS=pango
MARSHALFILES = clutter-marshal.c clutter-marshal.h MARSHALFILES = clutter-marshal.c clutter-marshal.h
ENUMFILES = clutter-enum-types.c clutter-enum-types.h ENUMFILES = clutter-enum-types.c clutter-enum-types.h
STAMPFILES = stamp-clutter-marshal.h stamp-clutter-enum-types.h
GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0` GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
GLIB_MKENUMS=`pkg-config --variable=glib_mkenums glib-2.0` GLIB_MKENUMS=`pkg-config --variable=glib_mkenums glib-2.0`
@ -28,15 +29,28 @@ source_h = \
$(srcdir)/clutter-behaviour-scale.h \ $(srcdir)/clutter-behaviour-scale.h \
$(srcdir)/clutter-alpha.h \ $(srcdir)/clutter-alpha.h \
$(srcdir)/clutter-media.h \ $(srcdir)/clutter-media.h \
$(srcdir)/clutter-version.h \
$(srcdir)/clutter-main.h $(srcdir)/clutter-main.h
clutter-marshal.h: clutter-marshal.list clutter-marshal.h: stamp-clutter-marshal.h
( $(GLIB_GENMARSHAL) --prefix=clutter_marshal \ @true
$(srcdir)/clutter-marshal.list --header > clutter-marshal.h ) stamp-clutter-marshal.h: clutter-marshal.list
$(GLIB_GENMARSHAL) \
--prefix=clutter_marshal \
--header \
$(srcdir)/clutter-marshal.list > xgen-cmh \
&& (cmp -s xgen-cmh clutter-marshal.h || cp xgen-cmh clutter-marshal.h ) \
&& rm -f xgen-cmh \
&& echo timestamp > $(@F)
clutter-marshal.c: clutter-marshal.h clutter-marshal.c: clutter-marshal.h Makefile
( $(GLIB_GENMARSHAL) --prefix=clutter_marshal \ ( echo "#include \"clutter-marshal.h\"" ; \
$(srcdir)/clutter-marshal.list --body --header > clutter-marshal.c ) $(GLIB_GENMARSHAL) \
--prefix=clutter_marshal \
--body \
$(srcdir)/clutter-marshal.list --body ) >> xgen-cmc \
&& cp xgen-cmc clutter-marshal.c \
&& rm -f xgen-cmc
clutter-enum-types.h: stamp-clutter-enum-types.h clutter-enum-types.h: stamp-clutter-enum-types.h
@true @true
@ -73,7 +87,9 @@ clutter-enum-types.c: clutter-enum-types.h
&& cp xgen-cetc clutter-enum-types.c \ && cp xgen-cetc clutter-enum-types.c \
&& rm -f xgen-cetc && rm -f xgen-cetc
CLEANFILES = $(BUILT_SOURCES) stamp-clutter-enum-types.h CLEANFILES = \
$(BUILT_SOURCES) \
$(STAMPFILES)
source_c = clutter-main.c \ source_c = clutter-main.c \
clutter-util.c \ clutter-util.c \
@ -103,7 +119,16 @@ libclutter_@CLUTTER_MAJORMINOR@_la_SOURCES = $(MARSHALFILES) \
$(source_h) \ $(source_h) \
$(source_h_priv) $(source_h_priv)
INCLUDES = @GCC_FLAGS@ @CLUTTER_CFLAGS@ -I$(top_srcdir) -I$(top_srcdir)/clutter/pango INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/clutter/pango \
-DPREFIX=\""$(prefix)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DG_DISABLE_DEPRECATED \
$(GCC_FLAGS) \
$(CLUTTER_CFLAGS) \
$(CLUTTER_DEBUG_CFLAGS)
lib_LTLIBRARIES = libclutter-@CLUTTER_MAJORMINOR@.la lib_LTLIBRARIES = libclutter-@CLUTTER_MAJORMINOR@.la
@ -119,4 +144,4 @@ clutterheaders_HEADERS = $(source_h) \
clutter-enum-types.h \ clutter-enum-types.h \
clutter.h clutter.h
EXTRA_DIST = clutter-marshal.list EXTRA_DIST = clutter-marshal.list clutter-version.h.in

View File

@ -90,6 +90,7 @@ enum
SHOW, SHOW,
HIDE, HIDE,
DESTROY, DESTROY,
PARENT_SET,
LAST_SIGNAL LAST_SIGNAL
}; };
@ -590,69 +591,121 @@ clutter_actor_class_init (ClutterActorClass *klass)
g_type_class_add_private (klass, sizeof (ClutterActorPrivate)); g_type_class_add_private (klass, sizeof (ClutterActorPrivate));
g_object_class_install_property (object_class, PROP_X, /**
* ClutterActor:x:
*
* X coordinate of the actor.
*/
g_object_class_install_property (object_class,
PROP_X,
g_param_spec_int ("x", g_param_spec_int ("x",
"X co-ord", "X co-ord",
"X co-ord of actor", "X co-ord of actor",
0, 0, G_MAXINT,
G_MAXINT,
0, 0,
G_PARAM_READWRITE)); G_PARAM_READWRITE));
/**
g_object_class_install_property (object_class, PROP_Y, * ClutterActor:y:
*
* Y coordinate of the actor.
*/
g_object_class_install_property (object_class,
PROP_Y,
g_param_spec_int ("y", g_param_spec_int ("y",
"Y co-ord", "Y co-ord",
"Y co-ord of actor", "Y co-ord of actor",
0, 0, G_MAXINT,
G_MAXINT,
0, 0,
G_PARAM_READWRITE)); G_PARAM_READWRITE));
/**
g_object_class_install_property (object_class, PROP_WIDTH, * ClutterActor:width:
*
* Width of the actor (in pixels).
*/
g_object_class_install_property (object_class,
PROP_WIDTH,
g_param_spec_int ("width", g_param_spec_int ("width",
"Width", "Width",
"Width of actor in pixels", "Width of actor in pixels",
0, 0, G_MAXINT,
G_MAXINT,
0, 0,
G_PARAM_READWRITE)); G_PARAM_READWRITE));
/**
g_object_class_install_property (object_class, PROP_HEIGHT, * ClutterActor:height:
*
* Height of the actor (in pixels).
*/
g_object_class_install_property (object_class,
PROP_HEIGHT,
g_param_spec_int ("height", g_param_spec_int ("height",
"Height", "Height",
"Height of actor in pixels", "Height of actor in pixels",
0, 0, G_MAXINT,
G_MAXINT,
0, 0,
G_PARAM_READWRITE)); G_PARAM_READWRITE));
/**
g_object_class_install_property (object_class, PROP_OPACITY, * ClutterActor:opacity:
*
* Opacity of the actor.
*/
g_object_class_install_property (object_class,
PROP_OPACITY,
g_param_spec_uchar ("opacity", g_param_spec_uchar ("opacity",
"Opacity", "Opacity",
"Opacity of actor", "Opacity of actor",
0, 0, 0xff,
0xff,
0xff, 0xff,
G_PARAM_CONSTRUCT | G_PARAM_READWRITE)); G_PARAM_CONSTRUCT | G_PARAM_READWRITE));
/**
g_object_class_install_property (object_class, PROP_VISIBLE, * ClutterActor:visible:
*
* Whether the actor is visible or not.
*/
g_object_class_install_property (object_class,
PROP_VISIBLE,
g_param_spec_boolean ("visible", g_param_spec_boolean ("visible",
"Visible", "Visible",
"Whether the actor is visible or not", "Whether the actor is visible or not",
FALSE, FALSE,
G_PARAM_READWRITE)); G_PARAM_READWRITE));
g_object_class_install_property (object_class, PROP_HAS_CLIP, /**
* ClutterActor:has-clip:
*
* Whether the actor has the clip property set or not.
*/
g_object_class_install_property (object_class,
PROP_HAS_CLIP,
g_param_spec_boolean ("has-clip", g_param_spec_boolean ("has-clip",
"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)); G_PARAM_READABLE));
g_object_class_install_property (object_class, PROP_CLIP, /**
* ClutterActor:clip:
*
* The clip region for the actor.
*/
g_object_class_install_property (object_class,
PROP_CLIP,
g_param_spec_boxed ("clip", g_param_spec_boxed ("clip",
"Clip", "Clip",
"The clip region for the actor", "The clip region for the actor",
CLUTTER_TYPE_GEOMETRY, CLUTTER_TYPE_GEOMETRY,
G_PARAM_READWRITE)); G_PARAM_READWRITE));
/**
* ClutterActor:name:
*
* The name of the actor.
*
* Since: 0.2
*/
g_object_class_install_property (object_class,
PROP_NAME,
g_param_spec_string ("name",
"Name",
"Name of the actor",
NULL,
G_PARAM_READWRITE));
/** /**
* ClutterActor::destroy: * ClutterActor::destroy:
@ -662,7 +715,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
* either by direct invocation of clutter_actor_destroy() or * either by direct invocation of clutter_actor_destroy() or
* when the #ClutterGroup that contains the actor is destroyed. * when the #ClutterGroup that contains the actor is destroyed.
* *
* Since: 0.1.1 * Since: 0.2
*/ */
actor_signals[DESTROY] = actor_signals[DESTROY] =
g_signal_new ("destroy", g_signal_new ("destroy",
@ -678,7 +731,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
* *
* The ::show signal is emitted when an actor becomes visible. * The ::show signal is emitted when an actor becomes visible.
* *
* Since: 0.1.1 * Since: 0.2
*/ */
actor_signals[SHOW] = actor_signals[SHOW] =
g_signal_new ("show", g_signal_new ("show",
@ -694,7 +747,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
* *
* The ::hide signal is emitted when an actor is no longer visible. * The ::hide signal is emitted when an actor is no longer visible.
* *
* Since: 0.1.1 * Since: 0.2
*/ */
actor_signals[HIDE] = actor_signals[HIDE] =
g_signal_new ("hide", g_signal_new ("hide",
@ -704,6 +757,24 @@ clutter_actor_class_init (ClutterActorClass *klass)
NULL, NULL, NULL, NULL,
clutter_marshal_VOID__VOID, clutter_marshal_VOID__VOID,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
/**
* ClutterActor::parent-set:
* @actor: the object which received the signal
* @old_parent: the previous parent of the actor, or %NULL
*
* This signal is emitted when the parent of the actor changes.
*
* Since: 0.2
*/
actor_signals[PARENT_SET] =
g_signal_new ("parent-set",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterActorClass, parent_set),
NULL, NULL,
clutter_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
CLUTTER_TYPE_ACTOR);
} }
static void static void
@ -840,10 +911,17 @@ clutter_actor_get_coords (ClutterActor *self,
clutter_actor_allocate_coords (self, &box); clutter_actor_allocate_coords (self, &box);
if (x1) *x1 = box.x1; if (x1)
if (y1) *y1 = box.y1; *x1 = box.x1;
if (x2) *x2 = box.x2;
if (y2) *y2 = box.y2; if (y1)
*y1 = box.y1;
if (x2)
*x2 = box.x2;
if (y2)
*y2 = box.y2;
} }
/** /**
@ -950,6 +1028,7 @@ clutter_actor_get_size (ClutterActor *self,
if (width) if (width)
*width = clutter_actor_get_width (self); *width = clutter_actor_get_width (self);
if (height) if (height)
*height = clutter_actor_get_height (self); *height = clutter_actor_get_height (self);
} }
@ -981,14 +1060,20 @@ clutter_actor_get_abs_position (ClutterActor *self,
/* FIXME: must be nicer way to get 0,0 for stage ? */ /* FIXME: must be nicer way to get 0,0 for stage ? */
if (parent) if (parent)
{ {
ClutterFixed parent_scale_x, parent_scale_y, fx, fy; ClutterFixed parent_scale_x, parent_scale_y;
ClutterFixed fx, fy;
clutter_actor_get_scalex(parent, &parent_scale_x, &parent_scale_y); clutter_actor_get_scalex (parent,
&parent_scale_x,
&parent_scale_y);
if (parent_scale_x != CFX_ONE || parent_scale_y != CFX_ONE) if (parent_scale_x != CFX_ONE ||
parent_scale_y != CFX_ONE)
{ {
fx = CLUTTER_FIXED_MUL(CLUTTER_INT_TO_FIXED(box.x1),parent_scale_x); fx = CLUTTER_FIXED_MUL (CLUTTER_INT_TO_FIXED (box.x1),
fy = CLUTTER_FIXED_MUL(CLUTTER_INT_TO_FIXED(box.y1),parent_scale_y); parent_scale_x);
fy = CLUTTER_FIXED_MUL (CLUTTER_INT_TO_FIXED (box.y1),
parent_scale_y);
box.x1 = CLUTTER_FIXED_INT (fx); box.x1 = CLUTTER_FIXED_INT (fx);
box.y1 = CLUTTER_FIXED_INT (fy); box.y1 = CLUTTER_FIXED_INT (fy);
@ -1026,6 +1111,7 @@ clutter_actor_get_abs_size (ClutterActor *self,
if (width) if (width)
*width = box.x2 - box.x1; *width = box.x2 - box.x1;
if (height) if (height)
*height = box.y2 - box.y1; *height = box.y2 - box.y1;
@ -1033,7 +1119,8 @@ clutter_actor_get_abs_size (ClutterActor *self,
do do
{ {
if (parent->priv->scale_x != CFX_ONE || parent->priv->scale_y != CFX_ONE) if (parent->priv->scale_x != CFX_ONE ||
parent->priv->scale_y != CFX_ONE)
{ {
ClutterFixed fx, fy; ClutterFixed fx, fy;
@ -1206,8 +1293,8 @@ clutter_actor_get_scalex (ClutterActor *self,
*/ */
void void
clutter_actor_get_scale (ClutterActor *self, clutter_actor_get_scale (ClutterActor *self,
double *scale_x, gdouble *scale_x,
double *scale_y) gdouble *scale_y)
{ {
if (scale_x) if (scale_x)
*scale_x = CLUTTER_FIXED_TO_FLOAT (self->priv->scale_x); *scale_x = CLUTTER_FIXED_TO_FLOAT (self->priv->scale_x);
@ -1273,12 +1360,15 @@ clutter_actor_set_name (ClutterActor *self,
{ {
g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (self));
g_object_ref (self);
g_free (self->priv->name); g_free (self->priv->name);
if (name || name[0] != '\0') if (name && name[0] != '\0')
{
self->priv->name = g_strdup(name); self->priv->name = g_strdup(name);
}
g_object_notify (G_OBJECT (self), "name");
g_object_unref (self);
} }
/** /**
@ -1537,11 +1627,17 @@ clutter_actor_set_parent (ClutterActor *self,
g_object_ref_sink (self); g_object_ref_sink (self);
self->priv->parent_actor = parent; self->priv->parent_actor = parent;
g_signal_emit (self, actor_signals[PARENT_SET], 0, NULL);
if (CLUTTER_ACTOR_IS_REALIZED (self->priv->parent_actor))
clutter_actor_realize (self);
if (CLUTTER_ACTOR_IS_VISIBLE (self->priv->parent_actor) && if (CLUTTER_ACTOR_IS_VISIBLE (self->priv->parent_actor) &&
CLUTTER_ACTOR_IS_VISIBLE (self)) CLUTTER_ACTOR_IS_VISIBLE (self))
{
clutter_actor_queue_redraw (self); clutter_actor_queue_redraw (self);
} }
}
/** /**
* clutter_actor_get_parent: * clutter_actor_get_parent:
@ -1571,6 +1667,8 @@ clutter_actor_get_parent (ClutterActor *self)
void void
clutter_actor_unparent (ClutterActor *self) clutter_actor_unparent (ClutterActor *self)
{ {
ClutterActor *old_parent;
g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (self));
if (self->priv->parent_actor == NULL) if (self->priv->parent_actor == NULL)
@ -1585,7 +1683,10 @@ clutter_actor_unparent (ClutterActor *self)
clutter_actor_unrealize (self); clutter_actor_unrealize (self);
} }
old_parent = self->priv->parent_actor;
self->priv->parent_actor = NULL; self->priv->parent_actor = NULL;
g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent);
g_object_unref (self); g_object_unref (self);
} }
@ -1598,7 +1699,7 @@ clutter_actor_unparent (ClutterActor *self)
* logically equivalent to calling clutter_actory_unparent() * logically equivalent to calling clutter_actory_unparent()
* and clutter_actor_set_parent(). * and clutter_actor_set_parent().
* *
* Since: 0.1.1 * Since: 0.2
*/ */
void void
clutter_actor_reparent (ClutterActor *self, clutter_actor_reparent (ClutterActor *self,
@ -1616,6 +1717,8 @@ clutter_actor_reparent (ClutterActor *self,
if (self->priv->parent_actor != new_parent) if (self->priv->parent_actor != new_parent)
{ {
ClutterActor *old_parent;
/* if the actor and the parent have already been realized, /* if the actor and the parent have already been realized,
* mark the actor as reparenting, so that clutter_actor_unparent() * mark the actor as reparenting, so that clutter_actor_unparent()
* just hides the actor instead of unrealize it. * just hides the actor instead of unrealize it.
@ -1626,6 +1729,8 @@ clutter_actor_reparent (ClutterActor *self,
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_REPARENT); CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_REPARENT);
} }
old_parent = self->priv->parent_actor;
g_object_ref (self); g_object_ref (self);
clutter_group_remove (CLUTTER_GROUP (self->priv->parent_actor), self); clutter_group_remove (CLUTTER_GROUP (self->priv->parent_actor), self);
clutter_group_add (CLUTTER_GROUP (new_parent), self); clutter_group_add (CLUTTER_GROUP (new_parent), self);
@ -1648,14 +1753,34 @@ clutter_actor_reparent (ClutterActor *self,
* Both actors must have the same parent. * Both actors must have the same parent.
*/ */
void void
clutter_actor_raise (ClutterActor *self, ClutterActor *below) clutter_actor_raise (ClutterActor *self,
ClutterActor *below)
{ {
g_return_if_fail (CLUTTER_IS_ACTOR(self)); ClutterActor *parent;
g_return_if_fail (clutter_actor_get_parent (self) != NULL);
clutter_group_raise (CLUTTER_GROUP(clutter_actor_get_parent (self)), g_return_if_fail (CLUTTER_IS_ACTOR (self));
self,
below); parent = clutter_actor_get_parent (self);
if (!parent)
{
g_warning ("Actor of type %s is not inside a group",
g_type_name (G_OBJECT_TYPE (self)));
return;
}
if (below)
{
if (parent != clutter_actor_get_parent (below))
{
g_warning ("Actor of type %s is not in the same "
"group of actor of type %s",
g_type_name (G_OBJECT_TYPE (self)),
g_type_name (G_OBJECT_TYPE (below)));
return;
}
}
clutter_group_raise (CLUTTER_GROUP (parent), self, below);
} }
/** /**
@ -1667,22 +1792,35 @@ clutter_actor_raise (ClutterActor *self, ClutterActor *below)
* Both actors must have the same parent. * Both actors must have the same parent.
*/ */
void void
clutter_actor_lower (ClutterActor *self, ClutterActor *above) clutter_actor_lower (ClutterActor *self,
ClutterActor *above)
{ {
g_return_if_fail (CLUTTER_IS_ACTOR(self)); ClutterActor *parent;
g_return_if_fail (clutter_actor_get_parent (self) != NULL);
if (above != NULL) g_return_if_fail (CLUTTER_IS_ACTOR(self));
parent = clutter_actor_get_parent (self);
if (!parent)
{ {
g_return_if_fail g_warning ("Actor of type %s is not inside a group",
(clutter_actor_get_parent (self) g_type_name (G_OBJECT_TYPE (self)));
!= clutter_actor_get_parent (above)); return;
}
if (above)
{
if (parent != clutter_actor_get_parent (above))
{
g_warning ("Actor of type %s is not in the same "
"group of actor of type %s",
g_type_name (G_OBJECT_TYPE (self)),
g_type_name (G_OBJECT_TYPE (above)));
return;
}
} }
/* FIXME: group_lower should be an overidable method ? */ /* FIXME: group_lower should be an overidable method ? */
clutter_group_lower (CLUTTER_GROUP(clutter_actor_get_parent (self)), clutter_group_lower (CLUTTER_GROUP (parent), self, above);
self,
above);
} }
/** /**

View File

@ -119,6 +119,8 @@ struct _ClutterActorClass
void (* set_depth) (ClutterActor *actor, void (* set_depth) (ClutterActor *actor,
gint depth); gint depth);
gint (* get_depth) (ClutterActor *actor); gint (* get_depth) (ClutterActor *actor);
void (* parent_set) (ClutterActor *actor,
ClutterActor *old_parent);
void (* destroy) (ClutterActor *actor); void (* destroy) (ClutterActor *actor);

View File

@ -0,0 +1,17 @@
#ifndef __CLUTTER_VERSION_H__
#define __CLUTTER_VERSION_H__
#define CLUTTER_MAJOR_VERSION @CLUTTER_MAJOR_VERSION@
#define CLUTTER_MINOR_VERSION @CLUTTER_MINOR_VERSION@
#define CLUTTER_MICRO_VERSION @CLUTTER_MICRO_VERSION@
#define CLUTTER_VERSION @CLUTTER_VERSION@
#define CLUTTER_VERSION_S "@CLUTTER_VERSION@"
#define CLUTTER_VERSION_HEX 0x@CLUTTER_MAJOR_VERSION@0@CLUTTER_MINOR_VERSION@0@CLUTTER_MICRO_VERSION@
#define CLUTTER_CHECK_VERSION(major,minor,micro) \
((CLUTTER_MAJOR_VERSION > (major)) || \
(CLUTTER_MAJOR_VERSION == (major) && CLUTTER_MINOR_VERSION > (minor)) || \
(CLUTTER_MAJOR_VERSION == (major) && CLUTTER_MINOR_VERSION == (minor) || CLUTTER_MICRO_VERSION > (micro)))
#endif /* __CLUTTER_VERSION_H__ */

View File

@ -20,6 +20,8 @@
#include "clutter-label.h" #include "clutter-label.h"
#include "clutter-alpha.h" #include "clutter-alpha.h"
#include "clutter-media.h" #include "clutter-media.h"
#include "clutter-feature.h"
#include "clutter-version.h"
#include "clutter-enum-types.h" #include "clutter-enum-types.h"
#endif #endif

View File

@ -1,31 +1,49 @@
AC_PREREQ(2.53)
# clutter package version number, (as distinct from shared library version) # clutter package version number, (as distinct from shared library version)
# An odd micro number indicates in-progress development, (eg. from CVS) # An odd micro number indicates in-progress development, (eg. from CVS)
# An even micro number indicates a released version. # An even micro number indicates a released version.
m4_define(clutter_version_major, 0) m4_define([clutter_major_version], [0])
m4_define(clutter_version_minor, 1) m4_define([clutter_minor_version], [1])
m4_define(clutter_version_micro, 1) m4_define([clutter_micro_version], [1])
m4_define([clutter_version],
[clutter_major_version.clutter_minor_version.clutter_micro_version])
m4_define([clutter_api_version],
[clutter_major_version.clutter_minor_version])
# increase the interface age for each release; if the API changes, set to 0
m4_define([clutter_interface_age], [0])
m4_define([clutter_binary_age],
[m4_eval(100 * clutter_minor_version + clutter_micro_version)])
AC_PREREQ(2.53)
AC_INIT([clutter], AC_INIT([clutter],
clutter_version_major.clutter_version_minor.clutter_version_micro, [clutter_version],
[http://bugzilla.o-hand.com/enter_bug.cgi?product=Clutter]) [http://bugzilla.o-hand.com/enter_bug.cgi?product=Clutter])
AC_CONFIG_SRCDIR([clutter/clutter.h]) AC_CONFIG_SRCDIR([clutter/clutter.h])
AM_CONFIG_HEADER([config.h]) AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([1.7]) AM_INIT_AUTOMAKE([1.7])
CLUTTER_MAJORMINOR=clutter_version_major.clutter_version_minor CLUTTER_MAJOR_VERSION=clutter_major_version
CLUTTER_MINOR_VERSION=clutter_minor_version
CLUTTER_MICRO_VERSION=clutter_micro_version
CLUTTER_VERSION=clutter_version
CLUTTER_MAJORMINOR=clutter_api_version
AC_SUBST(CLUTTER_MAJOR_VERSION)
AC_SUBST(CLUTTER_MINOR_VERSION)
AC_SUBST(CLUTTER_MICRO_VERSION)
AC_SUBST(CLUTTER_VERSION)
AC_SUBST(CLUTTER_MAJORMINOR) AC_SUBST(CLUTTER_MAJORMINOR)
# CURRENT, REVISION, AGE m4_define([lt_current],
# - library source changed -> increment REVISION [m4_eval(100 * clutter_minor_version + clutter_micro_version - clutter_interface_age)])
# - interfaces added/removed/changed -> increment CURRENT, REVISION = 0 m4_define([lt_revision], [clutter_interface_age])
# - interfaces added -> increment AGE m4_define([lt_age], [m4_eval(clutter_binary_age - clutter_interface_age)])
# - interfaces removed -> AGE = 0 CLUTTER_LT_CURRENT=lt_current
CLUTTER_LT_CURRENT=1 CLUTTER_LT_REV=lt_revision
CLUTTER_LT_REV=0 CLUTTER_LT_AGE=lt_age
CLUTTER_LT_AGE=1
CLUTTER_LT_VERSION="$CLUTTER_LT_CURRENT:$CLUTTER_LT_REV:$CLUTTER_LT_AGE" CLUTTER_LT_VERSION="$CLUTTER_LT_CURRENT:$CLUTTER_LT_REV:$CLUTTER_LT_AGE"
CLUTTER_LT_LDFLAGS="-version-info $CLUTTER_LT_VERSION" CLUTTER_LT_LDFLAGS="-version-info $CLUTTER_LT_VERSION"
@ -101,9 +119,36 @@ if test "x$GCC" = "xyes"; then
GCC_FLAGS="-g -Wall" GCC_FLAGS="-g -Wall"
fi fi
dnl = Enable debug level ===================================================
m4_define([debug_default],
m4_if(m4_eval(clutter_minor_version % 2), [1], [yes], [minimum]))
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
[turn on debugging @<:@default=debug_default@:>@]),
,
enable_debug=debug_default)
if test "x$enable_debug" = "xyes"; then
test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
CLUTTER_DEBUG_CFLAGS="-DG_ENABLE_DEBUG"
else
if test "x$enable_debug" = "xno"; then
CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST
_CHECKS"
else
CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_CAST_CHECKS"
fi
fi
AC_SUBST(CLUTTER_DEBUG_CFLAGS)
dnl ======================================================================== dnl ========================================================================
GTK_DOC_CHECK([1.0]) dnl = GTK Doc check ========================================================
GTK_DOC_CHECK([1.4])
dnl ======================================================================== dnl ========================================================================
@ -117,9 +162,11 @@ CLUTTER_LIBS="$GLX_LIBS $CLUTTER_DEPS_LIBS"
AC_SUBST(CLUTTER_CFLAGS) AC_SUBST(CLUTTER_CFLAGS)
AC_SUBST(CLUTTER_LIBS) AC_SUBST(CLUTTER_LIBS)
AC_OUTPUT([Makefile AC_CONFIG_FILES([
Makefile
clutter/pango/Makefile clutter/pango/Makefile
clutter/Makefile clutter/Makefile
clutter/clutter-version.h
gtk/Makefile gtk/Makefile
gtk/gtk-clutter.pc gtk/gtk-clutter.pc
examples/Makefile examples/Makefile
@ -129,6 +176,8 @@ doc/reference/version.xml
clutter.pc clutter.pc
]) ])
AC_OUTPUT
dnl ======================================================================== dnl ========================================================================
echo "" echo ""
@ -138,5 +187,6 @@ echo ""
echo " prefix: ${prefix}" echo " prefix: ${prefix}"
echo "" echo ""
echo " GTK+ Widget: ${enable_gtk}" echo " GTK+ Widget: ${enable_gtk}"
echo " Debug level: ${enable_debug}"
echo " Documentation: ${enable_gtk_doc}" echo " Documentation: ${enable_gtk_doc}"
echo "" echo ""

View File

@ -1,3 +1,16 @@
2006-11-20 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-sections.txt: Remove debug macros; add clutter-version
section.
* Makefile.am: Ignore the stamp files.
* clutter-docs.sgml: Add a link to the version utils.
* tmpl/clutter-actor.sgml:
* tmpl/clutter-main.sgml:
* tmpl/clutter-version.sgml: Update templates.
2006-11-17 Emmanuele Bassi <ebassi@openedhand.com> 2006-11-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter-sections.txt: Move stuff around: get_type and Private * clutter-sections.txt: Move stuff around: get_type and Private

View File

@ -53,6 +53,7 @@ IGNORE_HFILES=\
clutter-keysyms.h \ clutter-keysyms.h \
clutter-enum-types.h \ clutter-enum-types.h \
stamp-clutter-enum-types.h \ stamp-clutter-enum-types.h \
stamp-clutter-marshal.h \
pango pango
# Images to copy into HTML directory. # Images to copy into HTML directory.

View File

@ -91,6 +91,7 @@
<xi:include href="xml/clutter-event.xml"/> <xi:include href="xml/clutter-event.xml"/>
<xi:include href="xml/clutter-color.xml"/> <xi:include href="xml/clutter-color.xml"/>
<xi:include href="xml/clutter-util.xml"/> <xi:include href="xml/clutter-util.xml"/>
<xi:include href="xml/clutter-version.xml"/>
</chapter> </chapter>
<appendix id="license"> <appendix id="license">

View File

@ -477,10 +477,6 @@ clutter_keysym_to_unicode
<SECTION> <SECTION>
<FILE>clutter-main</FILE> <FILE>clutter-main</FILE>
CLUTTER_HAS_DEBUG_MESSGES
CLUTTER_DBG
CLUTTER_GLERR
CLUTTER_MARK
ClutterInitError ClutterInitError
clutter_init clutter_init
clutter_main clutter_main
@ -493,4 +489,20 @@ clutter_root_xwindow
clutter_want_debug clutter_want_debug
clutter_threads_enter clutter_threads_enter
clutter_threads_leave clutter_threads_leave
<SUBSECTION Private>
CLUTTER_HAS_DEBUG_MESSGES
CLUTTER_DBG
CLUTTER_GLERR
CLUTTER_MARK
</SECTION>
<SECTION>
<FILE>clutter-version</FILE>
CLUTTER_MAJOR_VERSION
CLUTTER_MINOR_VERSION
CLUTTER_MICRO_VERSION
CLUTTER_VERSION
CLUTTER_VERSION_S
CLUTTER_VERSION_HEX
CLUTTER_CHECK_VERSION
</SECTION> </SECTION>

View File

@ -140,6 +140,14 @@ ClutterActor
@clutteractor: the object which received the signal. @clutteractor: the object which received the signal.
<!-- ##### SIGNAL ClutterActor::parent-set ##### -->
<para>
</para>
@clutteractor: the object which received the signal.
@arg1:
<!-- ##### SIGNAL ClutterActor::show ##### --> <!-- ##### SIGNAL ClutterActor::show ##### -->
<para> <para>
@ -162,6 +170,11 @@ ClutterActor
</para> </para>
<!-- ##### ARG ClutterActor:name ##### -->
<para>
</para>
<!-- ##### ARG ClutterActor:opacity ##### --> <!-- ##### ARG ClutterActor:opacity ##### -->
<para> <para>
@ -202,6 +215,7 @@ ClutterActor
@allocate_coords: @allocate_coords:
@set_depth: @set_depth:
@get_depth: @get_depth:
@parent_set:
@destroy: @destroy:
@show_all: @show_all:
@hide_all: @hide_all:

View File

@ -17,62 +17,6 @@ clutter-main
<!-- ##### SECTION Stability_Level ##### --> <!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO CLUTTER_HAS_DEBUG_MESSGES ##### -->
<para>
</para>
<!-- ##### MACRO CLUTTER_DBG ##### -->
<para>
</para>
@x:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
@a...:
<!-- ##### MACRO CLUTTER_GLERR ##### -->
<para>
</para>
<!-- ##### MACRO CLUTTER_MARK ##### -->
<para>
</para>
<!-- ##### ENUM ClutterInitError ##### --> <!-- ##### ENUM ClutterInitError ##### -->
<para> <para>

View File

@ -0,0 +1,73 @@
<!-- ##### SECTION Title ##### -->
clutter-version
<!-- ##### SECTION Short_Description ##### -->
Versioning utilities
<!-- ##### SECTION Long_Description ##### -->
<para>
Clutter exports some macros representing the version at compile time. These
macros are useful for configure and compile time checks.
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO CLUTTER_MAJOR_VERSION ##### -->
<para>
The major version component of Clutter version
</para>
<!-- ##### MACRO CLUTTER_MINOR_VERSION ##### -->
<para>
The minor version component of Clutter version
</para>
<!-- ##### MACRO CLUTTER_MICRO_VERSION ##### -->
<para>
The micro version component of Clutter version
</para>
<!-- ##### MACRO CLUTTER_VERSION ##### -->
<para>
The Clutter version
</para>
<!-- ##### MACRO CLUTTER_VERSION_S ##### -->
<para>
The Clutter version as a string
</para>
<!-- ##### MACRO CLUTTER_VERSION_HEX ##### -->
<para>
The Clutter version as a hexadecimal number
</para>
<!-- ##### MACRO CLUTTER_CHECK_VERSION ##### -->
<para>
Returns TRUE if the version of the Clutter header files is the same as or newer
than the passed-in version.
</para>
@major: major version (e.g. 1, for 1.2.3)
@minor: minor version (e.g. 2, for 1.2.3)
@micro: micro version (e.g. 3, for 1.2.3)