GESSimpleTimelineLayer: add _index() method

This commit is contained in:
Brandon Lewis 2010-12-16 16:50:35 +00:00 committed by Edward Hervey
parent e970c86753
commit 82e4d95a28
3 changed files with 24 additions and 0 deletions

View file

@ -452,6 +452,7 @@ ges_simple_timeline_layer_new
ges_simple_timeline_layer_add_object
ges_simple_timeline_layer_move_object
ges_simple_timeline_layer_nth
ges_simple_timeline_layer_index
ges_simple_timeline_layer_is_valid
<SUBSECTION Standard>
GESSimpleTimelineLayerClass

View file

@ -376,6 +376,25 @@ ges_simple_timeline_layer_nth (GESSimpleTimelineLayer * layer, gint position)
return NULL;
}
/**
* ges_simple_timeline_layer_index:
* @layer: a #GESSimpleTimelineLayer
* @object: a #GESTimelineObject in the layer
*
* Gets the position of the given object within the given layer.
*
* Returns: The position of the object starting from 0, or -1 if the
* object was not found.
*/
gint
ges_simple_timeline_layer_index (GESSimpleTimelineLayer * layer,
GESTimelineObject * object)
{
GESSimpleTimelineLayerPrivate *priv = layer->priv;
return g_list_index (priv->objects, object);
}
/**
* ges_simple_timeline_layer_move_object:
* @layer: a #GESSimpleTimelineLayer

View file

@ -91,6 +91,10 @@ const GESTimelineObject *
ges_simple_timeline_layer_nth (GESSimpleTimelineLayer *layer,
gint position);
gint
ges_simple_timeline_layer_index (GESSimpleTimelineLayer *layer,
GESTimelineObject *object);
G_END_DECLS
#endif /* _GES_SIMPLE_TIMELINE_LAYER */