1
/*
2
 * Clutter.
3
 *
4
 * An OpenGL based 'interactive canvas' library.
5
 *
6
 * Authored By Matthew Allum  <mallum@openedhand.com>
7
 *
8
 * Copyright (C) 2006 OpenedHand
9
 *
10
 * This library is free software; you can redistribute it and/or
11
 * modify it under the terms of the GNU Lesser General Public
12
 * License as published by the Free Software Foundation; either
13
 * version 2 of the License, or (at your option) any later version.
14
 *
15
 * This library is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18
 * Lesser General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU Lesser General Public
21
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
22
 */
23
24
#ifndef __CHAMPLAIN_GROUP_H__
25
#define __CHAMPLAIN_GROUP_H__
26
27
#include <glib-object.h>
28
#include <clutter/clutter.h>
29
30
G_BEGIN_DECLS
31
32
#define CHAMPLAIN_TYPE_GROUP champlain_group_get_type ()
33
34
#define CHAMPLAIN_GROUP(obj) \
35
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHAMPLAIN_TYPE_GROUP, ChamplainGroup))
36
37
#define CHAMPLAIN_GROUP_CLASS(klass) \
38
  (G_TYPE_CHECK_CLASS_CAST ((klass), CHAMPLAIN_TYPE_GROUP, ChamplainGroupClass))
39
40
#define CHAMPLAIN_IS_GROUP(obj) \
41
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHAMPLAIN_TYPE_GROUP))
42
43
#define CHAMPLAIN_IS_GROUP_CLASS(klass) \
44
  (G_TYPE_CHECK_CLASS_TYPE ((klass), CHAMPLAIN_TYPE_GROUP))
45
46
#define CHAMPLAIN_GROUP_GET_CLASS(obj) \
47
  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHAMPLAIN_TYPE_GROUP, ChamplainGroupClass))
48
49
typedef struct _ChamplainGroup ChamplainGroup;
50
typedef struct _ChamplainGroupClass ChamplainGroupClass;
51
typedef struct _ChamplainGroupPrivate ChamplainGroupPrivate;
52
53
/**
54
 * ChamplainGroup:
55
 *
56
 * The #ChamplainGroup structure contains only private data
57
 * and should be accessed using the provided API
58
 *
59
 * Since: 0.1
60
 */
61
struct _ChamplainGroup
62
{
63
  /*< private >*/
64
  ClutterActor parent_instance;
65
66
  ChamplainGroupPrivate *priv;
67
};
68
69
/**
70
 * ChamplainGroupClass:
71
 *
72
 * The #ChamplainGroupClass structure contains only private data
73
 *
74
 * Since: 0.1
75
 */
76
struct _ChamplainGroupClass
77
{
78
  /*< private >*/
79
  ClutterActorClass parent_class;
80
81
  /* padding for future expansion */
82
  void (*_clutter_reserved1)(void);
83
  void (*_clutter_reserved2)(void);
84
  void (*_clutter_reserved3)(void);
85
  void (*_clutter_reserved4)(void);
86
  void (*_clutter_reserved5)(void);
87
  void (*_clutter_reserved6)(void);
88
};
89
90
GType champlain_group_get_type (void) G_GNUC_CONST;
91
ClutterActor *champlain_group_new (void);
92
ClutterActor *champlain_group_get_nth_child (ChamplainGroup *self,
93
    gint index_);
94
gint champlain_group_get_n_children (ChamplainGroup *self);
95
void champlain_group_remove_all (ChamplainGroup *group);
96
97
/* for Mr. Mallum */
98
#define champlain_group_add(group, actor)                  G_STMT_START {  \
99
    ClutterActor *_actor = (ClutterActor *) (actor);                      \
100
    if (CHAMPLAIN_IS_GROUP ((group)) && CLUTTER_IS_ACTOR ((_actor)))        \
101
      {                                                                   \
102
        ClutterContainer *_container = (ClutterContainer *) (group);      \
103
        clutter_container_add_actor (_container, _actor);                 \
104
      } } G_STMT_END
105
106
  G_END_DECLS
107
108
#endif /* __CHAMPLAIN_GROUP_H__ */