several style fixes, underscore to camel case

This commit is contained in:
Stefan Kangas 2011-01-02 10:47:04 +01:00 committed by Stefan Kangas
parent 7500732976
commit 5c4992310e
14 changed files with 99 additions and 99 deletions

View file

@ -25,8 +25,8 @@
namespace gui {
namespace controller {
Controller::Controller(model::Project &model_project) :
project(model_project)
Controller::Controller(model::Project &modelProject) :
project(modelProject)
{
}

View file

@ -40,7 +40,7 @@ namespace controller {
class Controller
{
public:
Controller(model::Project &model_project);
Controller(model::Project &modelProject);
PlaybackController& get_playback_controller();

View file

@ -33,9 +33,9 @@ namespace model {
{
// TEST CODE: add a clip to the track
boost::shared_ptr<model::Clip> model_clip(new model::Clip());
model_clip->setName("Clip Name");
clips.push_back(model_clip);
boost::shared_ptr<model::Clip> modelClip(new model::Clip());
modelClip->setName("Clip Name");
clips.push_back(modelClip);
// END TEST CODE
}

View file

@ -286,39 +286,39 @@ TimelineWidget::create_timeline_tracks()
void
TimelineWidget::create_timeline_tracks_from_branch(
shared_ptr<model::Track> model_track)
shared_ptr<model::Track> modelTrack)
{
REQUIRE(model_track);
REQUIRE(modelTrack);
// Is a timeline UI track present in the map already?
if(!contains(trackMap, model_track))
if(!contains(trackMap, modelTrack))
{
// The timeline UI track is not present
// We will need to create one
trackMap[model_track] =
create_timeline_track_from_model_track(model_track);
trackMap[modelTrack] =
create_timeline_track_from_modelTrack(modelTrack);
}
// Recurse to child tracks
BOOST_FOREACH(shared_ptr<model::Track> child,
model_track->get_child_tracks())
modelTrack->get_child_tracks())
create_timeline_tracks_from_branch(child);
}
shared_ptr<timeline::Track>
TimelineWidget::create_timeline_track_from_model_track(
shared_ptr<model::Track> model_track)
TimelineWidget::create_timeline_track_from_modelTrack(
shared_ptr<model::Track> modelTrack)
{
REQUIRE(model_track);
REQUIRE(modelTrack);
// Choose a corresponding timeline track class from the model track's
// class
if(typeid(*model_track) == typeid(model::ClipTrack))
if(typeid(*modelTrack) == typeid(model::ClipTrack))
return shared_ptr<timeline::Track>(new timeline::ClipTrack(
*this, dynamic_pointer_cast<model::ClipTrack>(model_track)));
else if(typeid(*model_track) == typeid(model::GroupTrack))
*this, dynamic_pointer_cast<model::ClipTrack>(modelTrack)));
else if(typeid(*modelTrack) == typeid(model::GroupTrack))
return shared_ptr<timeline::Track>(new timeline::GroupTrack(
*this, dynamic_pointer_cast<model::GroupTrack>(model_track)));
*this, dynamic_pointer_cast<model::GroupTrack>(modelTrack)));
ASSERT(NULL); // Unknown track type;
return shared_ptr<timeline::Track>();
@ -349,32 +349,32 @@ TimelineWidget::remove_orphaned_tracks()
void
TimelineWidget::search_orphaned_tracks_in_branch(
boost::shared_ptr<model::Track> model_track,
boost::shared_ptr<model::Track> modelTrack,
std::map<boost::shared_ptr<model::Track>,
boost::shared_ptr<timeline::Track> > &orphan_track_map)
{
REQUIRE(model_track);
REQUIRE(modelTrack);
// Is the timeline UI still present?
if(contains(orphan_track_map, model_track))
orphan_track_map.erase(model_track);
if(contains(orphan_track_map, modelTrack))
orphan_track_map.erase(modelTrack);
// Recurse to child tracks
BOOST_FOREACH(shared_ptr<model::Track> child,
model_track->get_child_tracks())
modelTrack->get_child_tracks())
search_orphaned_tracks_in_branch(child, orphan_track_map);
}
shared_ptr<timeline::Track>
TimelineWidget::lookup_timeline_track(
shared_ptr<model::Track> model_track) const
shared_ptr<model::Track> modelTrack) const
{
REQUIRE(model_track);
REQUIRE(model_track != sequence()); // The sequence isn't
REQUIRE(modelTrack);
REQUIRE(modelTrack != sequence()); // The sequence isn't
// really a track
std::map<shared_ptr<model::Track>, shared_ptr<timeline::Track> >::
const_iterator iterator = trackMap.find(model_track);
const_iterator iterator = trackMap.find(modelTrack);
if(iterator == trackMap.end())
{
// The track is not present in the map

View file

@ -159,17 +159,17 @@ private:
* @param list The parent track of the branch.
**/
void create_timeline_tracks_from_branch(
boost::shared_ptr<model::Track> model_track);
boost::shared_ptr<model::Track> modelTrack);
/**
* Creates a timeline UI track to correspond to a model track.
* @param model_track The model track to create a timeline track from.
* @param modelTrack The model track to create a timeline track from.
* @return The timeline track created, or an empty shared_ptr if
* model_track has an unreckognised type (this is an error condition).
* modelTrack has an unreckognised type (this is an error condition).
**/
boost::shared_ptr<timeline::Track>
create_timeline_track_from_model_track(
boost::shared_ptr<model::Track> model_track);
create_timeline_track_from_modelTrack(
boost::shared_ptr<model::Track> modelTrack);
/**
* Removes any UI tracks which no longer have corresponding model
@ -178,20 +178,20 @@ private:
void remove_orphaned_tracks();
void search_orphaned_tracks_in_branch(
boost::shared_ptr<model::Track> model_track,
boost::shared_ptr<model::Track> modelTrack,
std::map<boost::shared_ptr<model::Track>,
boost::shared_ptr<timeline::Track> > &orphan_track_map);
/**
* Looks up a timeline UI track in trackMap that corresponds to a
* given model_track.
* @param model_track The model track to look up.
* given modelTrack.
* @param modelTrack The model track to look up.
* @returns The timeline UI track found, or an empty shared_ptr if
* model_track has no corresponding timeline UI track (this is an
* modelTrack has no corresponding timeline UI track (this is an
* error condition).
**/
boost::shared_ptr<timeline::Track> lookup_timeline_track(
boost::shared_ptr<model::Track> model_track) const;
boost::shared_ptr<model::Track> modelTrack) const;
// ----- Layout Functions ----- //

View file

@ -324,7 +324,7 @@ TimelineBody::draw_tracks(Cairo::RefPtr<Cairo::Context> cr)
iterator != layout_tree.end();
iterator++)
{
// const shared_ptr<model::Track> model_track(*iterator);
// const shared_ptr<model::Track> modelTrack(*iterator);
const shared_ptr<timeline::Track> timeline_track =
timelineWidget.lookup_timeline_track(*iterator);

View file

@ -97,7 +97,7 @@ namespace timeline {
shared_ptr<model::ClipTrack>
ClipTrack::getModelTrack ()
{
return dynamic_pointer_cast<model::ClipTrack>(model_track);
return dynamic_pointer_cast<model::ClipTrack>(modelTrack);
}
void

View file

@ -425,12 +425,12 @@ TimelineHeaderContainer::layout_headers()
shared_ptr<timeline::Track>
TimelineHeaderContainer::lookup_timeline_track(
shared_ptr<model::Track> model_track)
shared_ptr<model::Track> modelTrack)
{
REQUIRE(model_track != NULL);
REQUIRE(modelTrack != NULL);
shared_ptr<timeline::Track> timeline_track =
timelineWidget.lookup_timeline_track(model_track);
timelineWidget.lookup_timeline_track(modelTrack);
ENSURE(timeline_track);
return timeline_track;

View file

@ -162,28 +162,28 @@ private:
/**
* Draws the border decoration around the track header.
* @param model_track The track to draw the decoration for.
* @param modelTrack The track to draw the decoration for.
* @param clip_rect The clip to drawing to.
* @param depth The depth within the tree of this track. This is used
* to control the amount of indention.
* @param offset The vertical offset of the headers in pixels.
**/
void draw_header_decoration(
boost::shared_ptr<model::Track> model_track,
boost::shared_ptr<model::Track> modelTrack,
const Gdk::Rectangle &clip_rect);
/**
* A helper function which calls lookup_timeline_track within 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.
* @param modelTrack The model track to look up in the parent widget.
* @return Returns the track found, or returns NULL if no matching
* track was found.
* @remarks If the return value is going to be NULL, an ENSURE will
* fail.
**/
boost::shared_ptr<timeline::Track> lookup_timeline_track(
boost::shared_ptr<model::Track> model_track);
boost::shared_ptr<model::Track> modelTrack);
void begin_drag();

View file

@ -160,8 +160,8 @@ TimelineHeaderWidget::on_expose_event(GdkEventExpose *event)
REQUIRE(style);
REQUIRE(gdkWindow);
shared_ptr<model::Track> model_track = track.get_model_track();
REQUIRE(model_track);
shared_ptr<model::Track> modelTrack = track.get_modelTrack();
REQUIRE(modelTrack);
// Get the header box
const Gdk::Rectangle allocation = get_allocation();
@ -181,7 +181,7 @@ TimelineHeaderWidget::on_expose_event(GdkEventExpose *event)
else if(hoveringExpander)
state_type = STATE_PRELIGHT;
if(!model_track->get_child_tracks().empty())
if(!modelTrack->get_child_tracks().empty())
style->paint_expander (gdkWindow,
state_type,
box, *this, "",

View file

@ -149,9 +149,9 @@ TimelineLayoutHelper::begin_dragging_track(
dragPoint.get_x() - rect.get_x(),
dragPoint.get_y() - rect.get_y());
const shared_ptr<model::Track> model_track =
dragging_track->get_model_track();
draggingTrackIter = iterator_from_track(model_track);
const shared_ptr<model::Track> modelTrack =
dragging_track->get_modelTrack();
draggingTrackIter = iterator_from_track(modelTrack);
dragBranchHeight = measure_branch_height(draggingTrackIter);
dropPoint.relation = None;
@ -163,7 +163,7 @@ void
TimelineLayoutHelper::end_dragging_track(bool apply)
{
if(apply)
apply_drop_to_model_tree(dropPoint);
apply_drop_to_modelTree(dropPoint);
draggingTrackIter.node = NULL;
clone_tree_from_sequence();
@ -300,14 +300,14 @@ TimelineLayoutHelper::is_animating() const
TimelineLayoutHelper::TrackTree::pre_order_iterator
TimelineLayoutHelper::iterator_from_track(
boost::shared_ptr<model::Track> model_track)
boost::shared_ptr<model::Track> modelTrack)
{
REQUIRE(model_track);
REQUIRE(modelTrack);
TrackTree::pre_order_iterator iter;
for(iter = layoutTree.begin(); iter != layoutTree.end(); iter++)
{
if(*iter == model_track)
if(*iter == modelTrack)
break;
}
@ -384,15 +384,15 @@ TimelineLayoutHelper::layout_headers_recursive(
Gdk::Rectangle rect;
int track_height = 0;
const shared_ptr<model::Track> &model_track = *iterator;
REQUIRE(model_track);
const shared_ptr<model::Track> &modelTrack = *iterator;
REQUIRE(modelTrack);
shared_ptr<timeline::Track> timeline_track =
lookup_timeline_track(model_track);
lookup_timeline_track(modelTrack);
// Is this the root track of a dragging branch?
bool being_dragged = false;
if(dragging)
being_dragged = (model_track == *draggingTrackIter);
being_dragged = (modelTrack == *draggingTrackIter);
// Is the track going to be shown?
if(parent_expanded)
@ -473,11 +473,11 @@ TimelineLayoutHelper::layout_headers_recursive(
shared_ptr<timeline::Track>
TimelineLayoutHelper::lookup_timeline_track(
shared_ptr<model::Track> model_track)
shared_ptr<model::Track> modelTrack)
{
REQUIRE(model_track != NULL);
REQUIRE(modelTrack != NULL);
shared_ptr<timeline::Track> timeline_track =
timelineWidget.lookup_timeline_track(model_track);
timelineWidget.lookup_timeline_track(modelTrack);
ENSURE(timeline_track);
return timeline_track;
@ -503,10 +503,10 @@ TimelineLayoutHelper::attempt_drop(TrackTree::pre_order_iterator target,
const Gdk::Point &point)
{
// Lookup the tracks
const shared_ptr<model::Track> model_track(*target);
REQUIRE(model_track);
const shared_ptr<model::Track> modelTrack(*target);
REQUIRE(modelTrack);
const weak_ptr<timeline::Track> timeline_track =
lookup_timeline_track(model_track);
lookup_timeline_track(modelTrack);
// Calculate coordinates
const Gdk::Rectangle &rect = headerBoxes[timeline_track];
@ -530,9 +530,9 @@ TimelineLayoutHelper::attempt_drop(TrackTree::pre_order_iterator target,
full_width, half_height)))
{
// We're hovering over the lower half of the header
if(model_track->can_host_children())
if(modelTrack->can_host_children())
{
if(model_track->get_child_tracks().empty())
if(modelTrack->get_child_tracks().empty())
{
// Is our track being dragged after this header?
if(dragPoint.get_x() < x_mid)
@ -596,7 +596,7 @@ TimelineLayoutHelper::apply_drop_to_layout_tree(
}
void
TimelineLayoutHelper::apply_drop_to_model_tree(
TimelineLayoutHelper::apply_drop_to_modelTree(
const TimelineLayoutHelper::DropPoint &drop)
{
const shared_ptr<model::Sequence> sequence = get_sequence();

View file

@ -179,12 +179,12 @@ public:
/**
* A utility function which finds the iterator of a track in the
* layout tree.
* @param model_track The model track to look for.
* @param modelTrack The model track to look for.
* @return Returns the model iterator of layoutTree.end() if no
* iterator was found.
**/
TrackTree::pre_order_iterator iterator_from_track(
boost::shared_ptr<model::Track> model_track);
boost::shared_ptr<model::Track> modelTrack);
/**
* A function that recursively calculates the visible height of a
@ -290,14 +290,14 @@ protected:
* A helper function which calls lookup_timeline_track within 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.
* @param modelTrack The model track to look up in the parent widget.
* @return Returns the track found, or returns NULL if no matching
* track was found.
* @remarks If the return value is going to be NULL, an ENSURE will
* fail.
**/
boost::shared_ptr<timeline::Track> lookup_timeline_track(
boost::shared_ptr<model::Track> model_track);
boost::shared_ptr<model::Track> modelTrack);
/**
* A helper function which kicks off the animation timer.
@ -335,7 +335,7 @@ protected:
* specified by drop.
* @param[in] drop The point in the tree to drop onto.
**/
void apply_drop_to_model_tree(const DropPoint &drop);
void apply_drop_to_modelTree(const DropPoint &drop);
/**
* Helper to get the sequence object from the state.

View file

@ -39,14 +39,14 @@ const float Track::ExpandAnimationPeriod = 0.15;
Track::Track(TimelineWidget &timeline_widget,
shared_ptr<model::Track> track) :
timelineWidget(timeline_widget),
model_track(track),
modelTrack(track),
expanded(true),
expandDirection(None),
headerWidget(*this),
enableButton(Gtk::StockID("track_enabled"), WindowManager::MenuIconSize),
lockButton(Gtk::StockID("track_unlocked"), WindowManager::MenuIconSize)
{
REQUIRE(model_track);
REQUIRE(modelTrack);
titleMenuButton.set_relief(RELIEF_HALF);
titleMenuButton.unset_flags(CAN_FOCUS);
@ -83,11 +83,11 @@ Track::Track(TimelineWidget &timeline_widget,
mem_fun(this, &Track::on_remove_track) ) );
// Connect to the model
model_track->signalEnabledChanged().connect(sigc::mem_fun(this,
modelTrack->signalEnabledChanged().connect(sigc::mem_fun(this,
&Track::onEnabledChanged));
model_track->signalLockedChanged().connect(sigc::mem_fun(this,
modelTrack->signalLockedChanged().connect(sigc::mem_fun(this,
&Track::onLockedChanged));
model_track->signalNameChanged().connect(sigc::mem_fun(this,
modelTrack->signalNameChanged().connect(sigc::mem_fun(this,
&Track::onNameChanged));
}
@ -103,9 +103,9 @@ Track::get_header_widget()
}
shared_ptr<model::Track>
Track::get_model_track() const
Track::get_modelTrack() const
{
return model_track;
return modelTrack;
}
int
@ -241,17 +241,17 @@ Track::onLockedChanged(bool)
void
Track::on_set_name()
{
REQUIRE(model_track);
REQUIRE(modelTrack);
Gtk::Window *window = dynamic_cast<Window*>(
timelineWidget.get_toplevel());
REQUIRE(window != NULL);
dialogs::NameChooser dialog(*window,
_("Set Track Name"), model_track->get_name());
_("Set Track Name"), modelTrack->get_name());
if(dialog.run() == RESPONSE_OK)
model_track->set_name(dialog.get_name());
modelTrack->set_name(dialog.get_name());
}
void
@ -263,33 +263,33 @@ Track::onNameChanged(std::string)
void
Track::on_remove_track()
{
REQUIRE(model_track);
REQUIRE(modelTrack);
boost::shared_ptr<TimelineState> state = timelineWidget.get_state();
REQUIRE(state);
state->get_sequence()->remove_descendant_track(model_track);
state->get_sequence()->remove_descendant_track(modelTrack);
}
void
Track::onToggleEnabled()
{
bool status = model_track->getEnabled();
model_track->setEnabled(!status);
bool status = modelTrack->getEnabled();
modelTrack->setEnabled(!status);
}
void
Track::onToggleLocked()
{
bool status = model_track->getLocked();
model_track->setLocked(!status);
bool status = modelTrack->getLocked();
modelTrack->setLocked(!status);
}
void
Track::updateEnableButton()
{
REQUIRE (model_track);
REQUIRE (modelTrack);
if (model_track->getEnabled())
if (modelTrack->getEnabled())
{
enableButton.set_stock_id(Gtk::StockID("track_enabled"), WindowManager::MenuIconSize);
enableButton.set_tooltip_text(_("Disable track"));
@ -304,9 +304,9 @@ Track::updateEnableButton()
void
Track::updateLockButton()
{
REQUIRE (model_track);
REQUIRE (modelTrack);
if (model_track->getLocked())
if (modelTrack->getLocked())
{
lockButton.set_stock_id(Gtk::StockID("track_locked"), WindowManager::MenuIconSize);
lockButton.set_tooltip_text(_("Unlock track"));
@ -321,8 +321,8 @@ Track::updateLockButton()
void
Track::updateName()
{
REQUIRE(model_track);
titleMenuButton.set_label(model_track->get_name());
REQUIRE(modelTrack);
titleMenuButton.set_label(modelTrack->get_name());
}
} // namespace timeline

View file

@ -75,7 +75,7 @@ public:
Gtk::Widget& get_header_widget();
boost::shared_ptr<model::Track>
get_model_track() const;
get_modelTrack() const;
/**
* Return the visual height of the track in pixels.
@ -190,7 +190,7 @@ private:
protected:
TimelineWidget &timelineWidget;
boost::shared_ptr<model::Track> model_track;
boost::shared_ptr<model::Track> modelTrack;
private:
/**