Deprecate ClutterGroup

The Group functionality is now provided by ClutterActor.

Sadly, we need to keep the ClutterGroup structure definition in the
non-deprecated header because ClutterStage inherits from Group - an API
wart that was never fixed during the 0.x cycles, and that we'll have to
keep around until we can break API.
This commit is contained in:
Emmanuele Bassi 2011-12-06 17:33:44 +00:00 committed by Emmanuele Bassi
parent b4d269705e
commit 6237eb7892
4 changed files with 32 additions and 7 deletions

View File

@ -157,7 +157,6 @@ source_c = \
$(srcdir)/clutter-flatten-effect.c \
$(srcdir)/clutter-flow-layout.c \
$(srcdir)/clutter-gesture-action.c \
$(srcdir)/clutter-group.c \
$(srcdir)/clutter-input-device.c \
$(srcdir)/clutter-interval.c \
$(srcdir)/clutter-keysyms-table.c \
@ -261,6 +260,7 @@ deprecated_c = \
$(srcdir)/deprecated/clutter-box.c \
$(srcdir)/deprecated/clutter-fixed.c \
$(srcdir)/deprecated/clutter-frame-source.c \
$(srcdir)/deprecated/clutter-group.c \
$(srcdir)/deprecated/clutter-timeout-pool.c \
$(srcdir)/deprecated/clutter-score.c \
$(srcdir)/deprecated/clutter-shader.c \

View File

@ -41,6 +41,12 @@ G_BEGIN_DECLS
#define CLUTTER_IS_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_GROUP))
#define CLUTTER_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_GROUP, ClutterGroupClass))
/* XXX - ClutterGroup is to be considered fully deprecated; the only
* reason we keep this header is because ClutterStage inherits from
* ClutterGroup, and thus we need to have a structure definition for
* the Stage object to expand.
*/
typedef struct _ClutterGroup ClutterGroup;
typedef struct _ClutterGroupClass ClutterGroupClass;
typedef struct _ClutterGroupPrivate ClutterGroupPrivate;
@ -84,12 +90,6 @@ struct _ClutterGroupClass
GType clutter_group_get_type (void) G_GNUC_CONST;
ClutterActor * clutter_group_new (void);
ClutterActor * clutter_group_get_nth_child (ClutterGroup *self,
gint index_);
gint clutter_group_get_n_children (ClutterGroup *self);
void clutter_group_remove_all (ClutterGroup *self);
G_END_DECLS
#endif /* __CLUTTER_GROUP_H__ */

View File

@ -42,6 +42,8 @@
* the visible area of a #ClutterGroup to a specified allocation is to
* explicitly set the size of the #ClutterGroup and then use the
* #ClutterActor:clip-to-allocation property.
*
* Deprecated: 1.10: Use #ClutterActor instead.
*/
#ifdef HAVE_CONFIG_H
@ -200,6 +202,8 @@ clutter_group_init (ClutterGroup *self)
* Create a new #ClutterGroup.
*
* Return value: the newly created #ClutterGroup actor
*
* Deprecated: 1.10: Use clutter_actor_new() instead.
*/
ClutterActor *
clutter_group_new (void)
@ -212,6 +216,9 @@ clutter_group_new (void)
* @self: A #ClutterGroup
*
* Removes all children actors from the #ClutterGroup.
*
* Deprecated: 1.10: Use clutter_actor_get_children() and
* clutter_actor_remove_child() instead.
*/
void
clutter_group_remove_all (ClutterGroup *self)
@ -242,6 +249,8 @@ clutter_group_remove_all (ClutterGroup *self)
* Return value: The number of child actors held in the group.
*
* Since: 0.2
*
* Deprecated: 1.10: Use clutter_actor_get_n_children() instead.
*/
gint
clutter_group_get_n_children (ClutterGroup *self)
@ -262,6 +271,8 @@ clutter_group_get_n_children (ClutterGroup *self)
* @index_ is invalid.
*
* Since: 0.2
*
* Deprecated: 1.10: Use clutter_actor_get_child_at_index() instead.
*/
ClutterActor *
clutter_group_get_nth_child (ClutterGroup *self,

View File

@ -2,9 +2,23 @@
#define __CLUTTER_GROUP_DEPRECATED_H__
#include <clutter/clutter-types.h>
#include <clutter/clutter-group.h>
G_BEGIN_DECLS
CLUTTER_DEPRECATED_FOR(clutter_actor_new)
ClutterActor * clutter_group_new (void);
CLUTTER_DEPRECATED_FOR(clutter_actor_get_child_at_index)
ClutterActor * clutter_group_get_nth_child (ClutterGroup *self,
gint index_);
CLUTTER_DEPRECATED_FOR(clutter_actor_get_n_children)
gint clutter_group_get_n_children (ClutterGroup *self);
CLUTTER_DEPRECATED
void clutter_group_remove_all (ClutterGroup *self);
#ifndef CLUTTER_DISABLE_DEPRECATED
/* for Mr. Mallum only */