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

@ -74,7 +74,7 @@ TimelineHeaderContainer::TimelineHeaderContainer(
void
TimelineHeaderContainer::update_headers()
{
{
// Ensure headers are parented correctly
pair<shared_ptr<model::Track>, shared_ptr<timeline::Track> > pair;
BOOST_FOREACH( pair, timelineWidget.trackMap )
@ -274,10 +274,11 @@ TimelineHeaderContainer::forall_vfunc(gboolean /* include_internals */,
{
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);
forall_vfunc_recursive(track, callback, callback_data);
REQUIRE(pair.second);
callback(pair.second->get_header_widget().gobj(), callback_data);
}
}
@ -394,22 +395,6 @@ TimelineHeaderContainer::layout_headers()
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
TimelineHeaderContainer::draw_header_decoration(
shared_ptr<model::Track> model_track,
@ -524,13 +509,6 @@ TimelineHeaderContainer::lookup_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
TimelineHeaderContainer::register_styles() const
{

View file

@ -152,18 +152,7 @@ private:
* stacking etc.
*/
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.
* @param model_track The track to draw the decoration for.
@ -207,17 +196,6 @@ private:
**/
boost::shared_ptr<timeline::Track> lookup_timeline_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.