## GESContainer GESContainer — Base Class for objects responsible for controlling other GESTimelineElement-s |

## Synopsis

    #include <ges/ges.h>

                        GESContainer;
                        GESContainerClass;
    #define             GES_CONTAINER_CHILDREN              (obj)
    #define             GES_CONTAINER_HEIGHT                (obj)
    GList *             ges_container_get_children          (GESContainer *container,
                                                             gboolean recursive);
    gboolean            ges_container_add                   (GESContainer *container,
                                                             GESTimelineElement *child);
    gboolean            ges_container_remove                (GESContainer *container,
                                                             GESTimelineElement *child);
    GList *             ges_container_ungroup               (GESContainer *container,
                                                             gboolean recursive);
    GESContainer *      ges_container_group                 (GList *containers);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----GESTimelineElement
                   +----GESContainer
                         +----GESClip

## Implemented Interfaces

GESContainer implements GESExtractable and GESMetaContainer.

## Description

## Details

### GESContainer

    typedef struct {
      /*< readonly >*/
      GList *children;

      /* We don't add those properties to the priv struct for optimization and code
       * readability purposes */
      guint32 height;       /* the span of priorities this object needs */
    } GESContainer;

The GESContainer base class.

GList *`children`; | A list of TimelineElement controlled by this Container. NOTE: Do not modify. [element-type GES.TimelineElement]
guint32 `height`; | The span of priorities this container occupies

### GESContainerClass

    typedef struct {
      /* signals */
      void (*child_added)             (GESContainer *container, GESTimelineElement *element);
      void (*child_removed)           (GESContainer *container, GESTimelineElement *element);
      gboolean (*add_child)           (GESContainer *container, GESTimelineElement *element);
      gboolean (*remove_child)        (GESContainer *container, GESTimelineElement *element);
      GList* (*ungroup)               (GESContainer *container, gboolean recursive);
      GESContainer * (*group)         (GList *containers);
      gboolean (*edit)                (GESContainer * container,
                                       GList * layers, gint new_layer_priority,
                                       GESEditMode mode,
                                       GESEdge edge,
                                       guint64 position);
    } GESContainerClass;

`child_added` () | Virtual method that is called right after a GESTimelineElement is added
`child_removed` () | Virtual method that is called right after a GESTimelineElement is removed
`add_child` () | Virtual method to add a child
`remove_child` () | Virtual method to remove a child
`ungroup` () | Ungroups the GESTimelineElement contained in this GESContainer, creating new
`group` () | Groups the GESContainers together GESContainer containing those GESTimelineElement apropriately.
`edit` () |

### GES_CONTAINER_CHILDREN()

    #define GES_CONTAINER_CHILDREN(obj) (((GESContainer*)obj)->children)

A GList containing the children of `object`

`obj` : | a GESContainer

### GES_CONTAINER_HEIGHT()

    #define GES_CONTAINER_HEIGHT(obj) (((GESContainer*)obj)->height)

The span of priorities this object occupies.

`obj` : | a GESContainer

### ges_container_get_children ()

    GList *             ges_container_get_children          (GESContainer *container,
                                                             gboolean recursive);

Get the list of GESTimelineElement contained in `container` The user is responsible for unreffing the contained objects and freeing the list.

`container` : | a GESContainer
`recursive` : | Whether to recursively get children in `container`
Returns : | The list of timeline element contained in `container`. [transfer full][element-type GESTimelineElement]

### ges_container_add ()

    gboolean            ges_container_add                   (GESContainer *container,
                                                             GESTimelineElement *child);

Add the GESTimelineElement to the container.

`container` : | a GESContainer
`child` : | the GESTimelineElement
Returns : | `TRUE` on success, `FALSE` on failure.

### ges_container_remove ()

    gboolean            ges_container_remove                (GESContainer *container,
                                                             GESTimelineElement *child);

Release the `child` from the control of `container`.

`container` : | a GESContainer
`child` : | the GESTimelineElement to release
Returns : | `TRUE` if the `child` was properly released, else `FALSE`.

### ges_container_ungroup ()

    GList *             ges_container_ungroup               (GESContainer *container,
                                                             gboolean recursive);

Ungroups the GESTimelineElement contained in this GESContainer, creating new GESContainer containing those GESTimelineElement apropriately.

`container` : | The GESContainer to ungroup. [transfer full]
`recursive` : | Wether to recursively ungroup `container`
Returns : | The list of GESContainer resulting from the ungrouping operation The user is responsible for unreffing the contained objects and freeing the list. [transfer full][element-type GESContainer]

### ges_container_group ()

    GESContainer *      ges_container_group                 (GList *containers);

Groups the GESContainer-s provided in `containers`. It creates a subclass of GESContainer, depending on the containers provided in `containers`. Basically, if all the containers in `containers` should be contained in a same clip (all the GESTrackElement they contain have the exact same start/inpoint/duration and are in the same layer), it will create a GESClip otherwise a GESGroup will be created

`containers` : | The GESContainer to group, they must all be in a same GESTimeline. [transfer none][element-type GESContainer][allow-none]
Returns : | The GESContainer (subclass) resulting of the grouping. [transfer none]