From 9fa99df5a72f3be42c952544e73de71c19c470d3 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sun, 1 Sep 2013 12:18:53 -0400 Subject: [PATCH] timeline-element: Add a set_parent vmethod API: GESTimelineElment->set_parent vmethod --- ges/ges-timeline-element.c | 6 ++++++ ges/ges-timeline-element.h | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ges/ges-timeline-element.c b/ges/ges-timeline-element.c index 67108d119e..b4fe32a859 100644 --- a/ges/ges-timeline-element.c +++ b/ges/ges-timeline-element.c @@ -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]); diff --git a/ges/ges-timeline-element.h b/ges/ges-timeline-element.h index f495a8ce2f..c8cfda8abf 100644 --- a/ges/ges-timeline-element.h +++ b/ges/ges-timeline-element.h @@ -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);