Retired iteration through the model tree in header container

This commit is contained in:
Joel Holdsworth 2009-01-10 11:08:48 +00:00
parent ab900e6b28
commit c9420126f1
2 changed files with 6 additions and 50 deletions

View file

@ -274,10 +274,11 @@ TimelineHeaderContainer::forall_vfunc(gboolean /* include_internals */,
{ {
REQUIRE(callback != NULL); REQUIRE(callback != NULL);
BOOST_FOREACH( shared_ptr<model::Track> track, get_tracks() ) pair<shared_ptr<model::Track>, shared_ptr<timeline::Track> > pair;
BOOST_FOREACH( pair, timelineWidget.trackMap )
{ {
REQUIRE(track); REQUIRE(pair.second);
forall_vfunc_recursive(track, callback, callback_data); callback(pair.second->get_header_widget().gobj(), callback_data);
} }
} }
@ -394,22 +395,6 @@ TimelineHeaderContainer::layout_headers()
queue_draw (); queue_draw ();
} }
void
TimelineHeaderContainer::forall_vfunc_recursive(
shared_ptr<model::Track> model_track, GtkCallback callback,
gpointer callback_data)
{
REQUIRE(callback != NULL);
callback( lookup_timeline_track(model_track)->
get_header_widget().gobj(), callback_data) ;
// Recurse through all the children
BOOST_FOREACH( shared_ptr<model::Track> child,
model_track->get_child_tracks() )
forall_vfunc_recursive(child, callback, callback_data);
}
void void
TimelineHeaderContainer::draw_header_decoration( TimelineHeaderContainer::draw_header_decoration(
shared_ptr<model::Track> model_track, shared_ptr<model::Track> model_track,
@ -524,13 +509,6 @@ TimelineHeaderContainer::lookup_timeline_track(
return timeline_track; return timeline_track;
} }
const std::list< boost::shared_ptr<model::Track> >
TimelineHeaderContainer::get_tracks() const
{
REQUIRE(timelineWidget.sequence);
return timelineWidget.sequence->get_child_tracks();
}
void void
TimelineHeaderContainer::register_styles() const TimelineHeaderContainer::register_styles() const
{ {

View file

@ -153,17 +153,6 @@ private:
*/ */
void layout_headers(); void layout_headers();
/**
* Recursively calls a callback on all the header widgets in a branch.
* @param model_track The root track of the branch.
* @param callback The callback to apply to the branch. This includes
* model_track and all it's children.
* @param callback_data The user data parameter for the callback.
**/
void forall_vfunc_recursive(
boost::shared_ptr<model::Track> model_track,
GtkCallback callback, gpointer callback_data);
/** /**
* Draws the border decoration around the track header. * Draws the border decoration around the track header.
* @param model_track The track to draw the decoration for. * @param model_track The track to draw the decoration for.
@ -208,17 +197,6 @@ private:
boost::shared_ptr<timeline::Track> lookup_timeline_track( boost::shared_ptr<timeline::Track> lookup_timeline_track(
boost::shared_ptr<model::Track> model_track); boost::shared_ptr<model::Track> model_track);
/**
* A helper function which calls get_tracks within the sequence of the
* parent timeline widget, but also applies lots of data consistency
* checks in the process.
* @param model_track The model track to look up in the parent widget.
* @return Returns the track found, or returns NULL if no matching
* track was found.
**/
const std::list< boost::shared_ptr<model::Track> >
get_tracks() const;
/** /**
* Registers all the styles that this class will respond to. * Registers all the styles that this class will respond to.
*/ */