1 /* GStreamer Editing Services
2 * Copyright (C) 2009 Edward Hervey <edward.hervey@collabora.co.uk>
3 * 2009 Nokia Corporation
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef _GES_CONTAINER
22 #define _GES_CONTAINER
24 #include <glib-object.h>
26 #include <ges/ges-timeline-element.h>
27 #include <ges/ges-types.h>
28 #include <ges/ges-track.h>
32 #define GES_TYPE_CONTAINER ges_container_get_type()
33 #define GES_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GES_TYPE_CONTAINER, GESContainer))
34 #define GES_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GES_TYPE_CONTAINER, GESContainerClass))
35 #define GES_IS_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GES_TYPE_CONTAINER))
36 #define GES_IS_CONTAINER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GES_TYPE_CONTAINER))
37 #define GES_CONTAINER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GES_TYPE_CONTAINER, GESContainerClass))
39 typedef struct _GESContainerPrivate GESContainerPrivate;
41 /* To be used by sublcasses only */
45 GES_CHILDREN_IGNORE_NOTIFIES,
46 GES_CHILDREN_UPDATE_OFFSETS,
47 GES_CHILDREN_UPDATE_ALL_VALUES,
49 } GESChildrenControlMode;
52 * GES_CONTAINER_HEIGHT:
53 * @obj: a #GESContainer
55 * The span of priorities this object occupies.
57 #define GES_CONTAINER_HEIGHT(obj) (((GESContainer*)obj)->height)
60 * GES_CONTAINER_CHILDREN:
61 * @obj: a #GESContainer
63 * A #GList containing the children of @object
65 #define GES_CONTAINER_CHILDREN(obj) (((GESContainer*)obj)->children)
69 * @children: (element-type GES.TimelineElement): A list of TimelineElement
70 * controlled by this Container. NOTE: Do not modify.
71 * @height: The span of priorities this container occupies
73 * The #GESContainer base class.
77 GESTimelineElement parent;
83 /* We don't add those properties to the priv struct for optimization and code
84 * readability purposes */
85 guint32 height; /* the span of priorities this object needs */
88 GESChildrenControlMode children_control_mode;
90 GESTimelineElement *initiated_move;
93 GESContainerPrivate *priv;
95 /* Padding for API extension */
96 gpointer _ges_reserved[GES_PADDING_LARGE];
101 * @child_added: Virtual method that is called right after a #GESTimelineElement is added
102 * @child_removed: Virtual method that is called right after a #GESTimelineElement is removed
103 * @remove_child: Virtual method to remove a child
104 * @add_child: Virtual method to add a child
105 * @ungroup: Ungroups the #GESTimelineElement contained in this #GESContainer, creating new
106 * @group: Groups the #GESContainers together
107 * #GESContainer containing those #GESTimelineElement apropriately.
109 struct _GESContainerClass
112 GESTimelineElementClass parent_class;
116 void (*child_added) (GESContainer *container, GESTimelineElement *element);
117 void (*child_removed) (GESContainer *container, GESTimelineElement *element);
118 gboolean (*add_child) (GESContainer *container, GESTimelineElement *element);
119 gboolean (*remove_child) (GESContainer *container, GESTimelineElement *element);
120 GList* (*ungroup) (GESContainer *container, gboolean recursive);
121 GESContainer * (*group) (GList *containers);
122 gboolean (*edit) (GESContainer * container,
123 GList * layers, gint new_layer_priority,
131 guint grouping_priority;
133 /* Padding for API extension */
134 gpointer _ges_reserved[GES_PADDING_LARGE];
138 GType ges_container_get_type (void);
140 /* Children handling */
142 GList* ges_container_get_children (GESContainer *container, gboolean recursive);
144 gboolean ges_container_add (GESContainer *container, GESTimelineElement *child);
146 gboolean ges_container_remove (GESContainer *container, GESTimelineElement *child);
148 GList * ges_container_ungroup (GESContainer * container, gboolean recursive);
150 GESContainer *ges_container_group (GList *containers);
153 gboolean ges_container_edit (GESContainer * container,
154 GList * layers, gint new_layer_priority,
160 #endif /* _GES_CONTAINER */