timeline-element: Add a set_parent vmethod

API:
        GESTimelineElment->set_parent vmethod
This commit is contained in:
Thibault Saunier 2013-09-01 12:18:53 -04:00
parent bd30bbd4a8
commit 9fa99df5a7
2 changed files with 13 additions and 1 deletions

View file

@ -225,6 +225,7 @@ ges_timeline_element_class_init (GESTimelineElementClass * klass)
object_class->finalize = ges_timeline_element_finalize;
klass->set_parent = NULL;
klass->set_start = NULL;
klass->set_inpoint = NULL;
klass->set_duration = NULL;
@ -267,6 +268,11 @@ ges_timeline_element_set_parent (GESTimelineElement * self,
if (self->parent != NULL && parent != NULL)
goto had_parent;
if (GES_TIMELINE_ELEMENT_GET_CLASS (self)->set_parent) {
if (!GES_TIMELINE_ELEMENT_GET_CLASS (self)->set_parent (self, parent))
return FALSE;
}
self->parent = parent;
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_PARENT]);

View file

@ -138,6 +138,7 @@ struct _GESTimelineElement
/**
* GESTimelineElementClass:
* @set_parent: method to set the parent of a #GESTimelineElement.
* @set_start: method to set the start of a #GESTimelineElement
* @set_duration: method to set the duration of a #GESTimelineElement
* @set_inpoint: method to set the inpoint of a #GESTimelineElement
@ -152,13 +153,18 @@ struct _GESTimelineElement
*
* The GESTimelineElement base class. Subclasses should override at least
* @set_start @set_inpoint @set_duration @ripple @ripple_end @roll_start
* @roll_end and @trim
* @roll_end and @trim.
*
* Vmethods in subclasses should apply all the operation they need to but
* the real method implementation is in charge of setting the proper field,
* and emit the notify signal.
*/
struct _GESTimelineElementClass
{
GInitiallyUnownedClass parent_class;
/*< public > */
gboolean (*set_parent) (GESTimelineElement * self, GESTimelineElement *parent);
gboolean (*set_start) (GESTimelineElement * self, GstClockTime start);
gboolean (*set_inpoint) (GESTimelineElement * self, GstClockTime inpoint);
gboolean (*set_duration) (GESTimelineElement * self, GstClockTime duration);