~elementary-os/elementaryos/os-patch-mutter-bionic

« back to all changes in this revision

Viewing changes to clutter/clutter/clutter-container.h

  • Committer: RabbitBot
  • Date: 2018-04-11 14:49:36 UTC
  • Revision ID: rabbitbot@elementary.io-20180411144936-hgymqa9d8d1xfpbh
Initial import, version 3.28.0-2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 * ClutterContainer: Generic actor container interface.
 
24
 * Author: Emmanuele Bassi <ebassi@openedhand.com>
 
25
 */
 
26
 
 
27
#ifndef __CLUTTER_CONTAINER_H__
 
28
#define __CLUTTER_CONTAINER_H__
 
29
 
 
30
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
 
31
#error "Only <clutter/clutter.h> can be included directly."
 
32
#endif
 
33
 
 
34
#include <clutter/clutter-actor.h>
 
35
#include <clutter/clutter-child-meta.h>
 
36
#include <clutter/clutter-types.h>
 
37
 
 
38
G_BEGIN_DECLS
 
39
 
 
40
#define CLUTTER_TYPE_CONTAINER                  (clutter_container_get_type ())
 
41
#define CLUTTER_CONTAINER(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CONTAINER, ClutterContainer))
 
42
#define CLUTTER_IS_CONTAINER(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CONTAINER))
 
43
#define CLUTTER_CONTAINER_GET_IFACE(obj)        (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_CONTAINER, ClutterContainerIface))
 
44
 
 
45
typedef struct _ClutterContainerIface   ClutterContainerIface;
 
46
 
 
47
/**
 
48
 * ClutterContainer:
 
49
 *
 
50
 * #ClutterContainer is an opaque structure whose members cannot be directly
 
51
 * accessed
 
52
 *
 
53
 * Since: 0.4
 
54
 */
 
55
 
 
56
/**
 
57
 * ClutterContainerIface:
 
58
 * @add: virtual function for adding an actor to the container. This virtual
 
59
 *   function is deprecated, and it should not be overridden.
 
60
 * @remove: virtual function for removing an actor from the container. This
 
61
 *   virtual function is deprecated, and it should not be overridden.
 
62
 * @foreach: virtual function for iterating over the container's children.
 
63
 *   This virtual function is deprecated, and it should not be overridden.
 
64
 * @foreach_with_internals: virtual functions for iterating over the
 
65
 *   container's children, both added using the #ClutterContainer API
 
66
 *   and internal children. The implementation of this virtual function
 
67
 *   is required only if the #ClutterContainer implementation has
 
68
 *   internal children. This virtual function is deprecated, and it should
 
69
 *   not be overridden.
 
70
 * @raise: virtual function for raising a child. This virtual function is
 
71
 *   deprecated and it should not be overridden.
 
72
 * @lower: virtual function for lowering a child. This virtual function is
 
73
 *   deprecated and it should not be overridden.
 
74
 * @sort_depth_order: virtual function for sorting the children of a
 
75
 *   container depending on their depth. This virtual function is deprecated
 
76
 *   and it should not be overridden.
 
77
 * @child_meta_type: The GType used for storing auxiliary information about
 
78
 *   each of the containers children.
 
79
 * @create_child_meta: virtual function that gets called for each added
 
80
 *   child, the function should instantiate an object of type
 
81
 *   #ClutterContainerIface::child_meta_type, set the container and actor
 
82
 *   fields in the instance and add the record to a data structure for
 
83
 *   subsequent access for #ClutterContainerIface::get_child_meta
 
84
 * @destroy_child_meta: virtual function that gets called when a child is
 
85
 *   removed; it shuld release all resources held by the record
 
86
 * @get_child_meta: return the record for a container child
 
87
 * @actor_added: class handler for #ClutterContainer::actor-added
 
88
 * @actor_removed: class handler for #ClutterContainer::actor-removed
 
89
 * @child_notify: class handler for #ClutterContainer::child-notify
 
90
 *
 
91
 * Base interface for container actors. The @add, @remove and @foreach
 
92
 * virtual functions must be provided by any implementation; the other
 
93
 * virtual functions are optional.
 
94
 *
 
95
 * Since: 0.4
 
96
 */
 
97
struct _ClutterContainerIface
 
98
{
 
99
  /*< private >*/
 
100
  GTypeInterface g_iface;
 
101
 
 
102
  /*< public >*/
 
103
  void (* add)              (ClutterContainer *container,
 
104
                             ClutterActor     *actor);
 
105
  void (* remove)           (ClutterContainer *container,
 
106
                             ClutterActor     *actor);
 
107
  void (* foreach)          (ClutterContainer *container,
 
108
                             ClutterCallback   callback,
 
109
                             gpointer          user_data);
 
110
 
 
111
  void (* foreach_with_internals) (ClutterContainer *container,
 
112
                                   ClutterCallback   callback,
 
113
                                   gpointer          user_data);
 
114
 
 
115
  /* child stacking */
 
116
  void (* raise)            (ClutterContainer *container,
 
117
                             ClutterActor     *actor,
 
118
                             ClutterActor     *sibling);
 
119
  void (* lower)            (ClutterContainer *container,
 
120
                             ClutterActor     *actor,
 
121
                             ClutterActor     *sibling);
 
122
  void (* sort_depth_order) (ClutterContainer *container);
 
123
 
 
124
  /* ClutterChildMeta management */
 
125
  GType                child_meta_type;
 
126
  void              (* create_child_meta)  (ClutterContainer *container,
 
127
                                            ClutterActor     *actor);
 
128
  void              (* destroy_child_meta) (ClutterContainer *container,
 
129
                                            ClutterActor     *actor);
 
130
  ClutterChildMeta *(* get_child_meta)     (ClutterContainer *container,
 
131
                                            ClutterActor     *actor);
 
132
 
 
133
  /* signals */
 
134
  void (* actor_added)   (ClutterContainer *container,
 
135
                          ClutterActor     *actor);
 
136
  void (* actor_removed) (ClutterContainer *container,
 
137
                          ClutterActor     *actor);
 
138
 
 
139
  void (* child_notify)  (ClutterContainer *container,
 
140
                          ClutterActor     *child,
 
141
                          GParamSpec       *pspec);
 
142
};
 
143
 
 
144
CLUTTER_AVAILABLE_IN_ALL
 
145
GType clutter_container_get_type (void) G_GNUC_CONST;
 
146
 
 
147
CLUTTER_AVAILABLE_IN_ALL
 
148
ClutterActor *          clutter_container_find_child_by_name            (ClutterContainer *container,
 
149
                                                                         const gchar      *child_name);
 
150
 
 
151
CLUTTER_AVAILABLE_IN_ALL
 
152
GParamSpec *            clutter_container_class_find_child_property     (GObjectClass     *klass,
 
153
                                                                         const gchar      *property_name);
 
154
CLUTTER_AVAILABLE_IN_ALL
 
155
GParamSpec **           clutter_container_class_list_child_properties   (GObjectClass     *klass,
 
156
                                                                         guint            *n_properties);
 
157
 
 
158
CLUTTER_AVAILABLE_IN_ALL
 
159
void                    clutter_container_create_child_meta             (ClutterContainer *container,
 
160
                                                                         ClutterActor     *actor);
 
161
CLUTTER_AVAILABLE_IN_ALL
 
162
void                    clutter_container_destroy_child_meta            (ClutterContainer *container,
 
163
                                                                         ClutterActor     *actor);
 
164
CLUTTER_AVAILABLE_IN_ALL
 
165
ClutterChildMeta *      clutter_container_get_child_meta                (ClutterContainer *container,
 
166
                                                                         ClutterActor     *actor);
 
167
 
 
168
CLUTTER_AVAILABLE_IN_ALL
 
169
void                    clutter_container_child_set_property            (ClutterContainer *container,
 
170
                                                                         ClutterActor     *child,
 
171
                                                                         const gchar      * property,
 
172
                                                                         const GValue     *value);
 
173
CLUTTER_AVAILABLE_IN_ALL
 
174
void                    clutter_container_child_get_property            (ClutterContainer *container,
 
175
                                                                         ClutterActor     *child,
 
176
                                                                         const gchar      *property,
 
177
                                                                         GValue           *value);
 
178
CLUTTER_AVAILABLE_IN_ALL
 
179
void                    clutter_container_child_set                     (ClutterContainer *container,
 
180
                                                                         ClutterActor     *actor,
 
181
                                                                         const gchar      *first_prop,
 
182
                                                                         ...) G_GNUC_NULL_TERMINATED;
 
183
CLUTTER_AVAILABLE_IN_ALL
 
184
void                    clutter_container_child_get                     (ClutterContainer *container,
 
185
                                                                         ClutterActor     *actor,
 
186
                                                                         const gchar      *first_prop,
 
187
                                                                         ...) G_GNUC_NULL_TERMINATED;
 
188
 
 
189
CLUTTER_AVAILABLE_IN_ALL
 
190
void                    clutter_container_child_notify                  (ClutterContainer *container,
 
191
                                                                         ClutterActor     *child,
 
192
                                                                         GParamSpec       *pspec);
 
193
 
 
194
G_END_DECLS
 
195
 
 
196
#endif /* __CLUTTER_CONTAINER_H__ */