GESTimelineLayer: add get_objects virtual method

This commit is contained in:
Brandon Lewis 2010-09-22 12:29:26 +01:00 committed by Edward Hervey
parent 9848c33e40
commit 06695545e0
3 changed files with 36 additions and 0 deletions

View file

@ -232,6 +232,7 @@ ges_timeline_layer_add_object
ges_timeline_layer_new
ges_timeline_layer_remove_object
ges_timeline_layer_set_priority
ges_timeline_layer_get_objects
<SUBSECTION Standard>
ges_timeline_layer_set_timeline
ges_timeline_layer_get_type

View file

@ -333,3 +333,35 @@ ges_timeline_layer_set_priority (GESTimelineLayer * layer, guint priority)
ges_timeline_layer_resync_priorities (layer);
}
}
/**
* ges_timeline_layer_get_objects:
* @layer: a #GESTimelineLayer
*
* Get the timeline objects this layer contains.
*
* Returns: a #GList of timeline objects. The user is responsible for
* unreffing the contained objects and freeing the list.
*/
GList *
ges_timeline_layer_get_objects (GESTimelineLayer * layer)
{
GList *ret = NULL;
GSList *tmp;
GESTimelineLayerClass *klass;
klass = GES_TIMELINE_LAYER_GET_CLASS (layer);
if (klass->get_objects) {
return klass->get_objects (layer);
}
for (tmp = layer->objects_start; tmp; tmp = tmp->next) {
ret = g_list_prepend (ret, tmp->data);
g_object_ref (tmp->data);
}
ret = g_list_reverse (ret);
return ret;
}

View file

@ -73,6 +73,8 @@ struct _GESTimelineLayer {
struct _GESTimelineLayerClass {
GObjectClass parent_class;
GList *(*get_objects) (GESTimelineLayer * layer);
/*< signals >*/
void (*object_added) (GESTimelineLayer * layer, GESTimelineObject * object);
void (*object_removed) (GESTimelineLayer * layer, GESTimelineObject * object);
@ -87,6 +89,7 @@ gboolean ges_timeline_layer_add_object (GESTimelineLayer * layer, GESTimelineObj
gboolean ges_timeline_layer_remove_object (GESTimelineLayer * layer, GESTimelineObject * object);
void ges_timeline_layer_set_priority (GESTimelineLayer * layer, guint priority);
GList * ges_timeline_layer_get_objects (GESTimelineLayer * layer);
G_END_DECLS