From 5c4992310e9dc69e7e3e044cb7cdca16c2db4f33 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 2 Jan 2011 10:47:04 +0100 Subject: [PATCH] several style fixes, underscore to camel case --- src/gui/controller/controller.cpp | 4 +- src/gui/controller/controller.hpp | 2 +- src/gui/model/clip-track.cpp | 6 +-- src/gui/widgets/timeline-widget.cpp | 44 +++++++++---------- src/gui/widgets/timeline-widget.hpp | 20 ++++----- src/gui/widgets/timeline/timeline-body.cpp | 2 +- .../widgets/timeline/timeline-clip-track.cpp | 2 +- .../timeline/timeline-header-container.cpp | 6 +-- .../timeline/timeline-header-container.hpp | 8 ++-- .../timeline/timeline-header-widget.cpp | 6 +-- .../timeline/timeline-layout-helper.cpp | 40 ++++++++--------- .../timeline/timeline-layout-helper.hpp | 10 ++--- src/gui/widgets/timeline/timeline-track.cpp | 44 +++++++++---------- src/gui/widgets/timeline/timeline-track.hpp | 4 +- 14 files changed, 99 insertions(+), 99 deletions(-) diff --git a/src/gui/controller/controller.cpp b/src/gui/controller/controller.cpp index c31ca787d..3ddf903d5 100644 --- a/src/gui/controller/controller.cpp +++ b/src/gui/controller/controller.cpp @@ -25,8 +25,8 @@ namespace gui { namespace controller { -Controller::Controller(model::Project &model_project) : - project(model_project) +Controller::Controller(model::Project &modelProject) : + project(modelProject) { } diff --git a/src/gui/controller/controller.hpp b/src/gui/controller/controller.hpp index 29d3684df..e462612aa 100644 --- a/src/gui/controller/controller.hpp +++ b/src/gui/controller/controller.hpp @@ -40,7 +40,7 @@ namespace controller { class Controller { public: - Controller(model::Project &model_project); + Controller(model::Project &modelProject); PlaybackController& get_playback_controller(); diff --git a/src/gui/model/clip-track.cpp b/src/gui/model/clip-track.cpp index bc691993f..95ddd8ac0 100644 --- a/src/gui/model/clip-track.cpp +++ b/src/gui/model/clip-track.cpp @@ -33,9 +33,9 @@ namespace model { { // TEST CODE: add a clip to the track - boost::shared_ptr model_clip(new model::Clip()); - model_clip->setName("Clip Name"); - clips.push_back(model_clip); + boost::shared_ptr modelClip(new model::Clip()); + modelClip->setName("Clip Name"); + clips.push_back(modelClip); // END TEST CODE } diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index 0f44402af..89c098783 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -286,39 +286,39 @@ TimelineWidget::create_timeline_tracks() void TimelineWidget::create_timeline_tracks_from_branch( - shared_ptr model_track) + shared_ptr 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 child, - model_track->get_child_tracks()) + modelTrack->get_child_tracks()) create_timeline_tracks_from_branch(child); } shared_ptr -TimelineWidget::create_timeline_track_from_model_track( - shared_ptr model_track) +TimelineWidget::create_timeline_track_from_modelTrack( + shared_ptr 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(new timeline::ClipTrack( - *this, dynamic_pointer_cast(model_track))); - else if(typeid(*model_track) == typeid(model::GroupTrack)) + *this, dynamic_pointer_cast(modelTrack))); + else if(typeid(*modelTrack) == typeid(model::GroupTrack)) return shared_ptr(new timeline::GroupTrack( - *this, dynamic_pointer_cast(model_track))); + *this, dynamic_pointer_cast(modelTrack))); ASSERT(NULL); // Unknown track type; return shared_ptr(); @@ -349,32 +349,32 @@ TimelineWidget::remove_orphaned_tracks() void TimelineWidget::search_orphaned_tracks_in_branch( - boost::shared_ptr model_track, + boost::shared_ptr modelTrack, std::map, boost::shared_ptr > &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 child, - model_track->get_child_tracks()) + modelTrack->get_child_tracks()) search_orphaned_tracks_in_branch(child, orphan_track_map); } shared_ptr TimelineWidget::lookup_timeline_track( - shared_ptr model_track) const + shared_ptr 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 >:: - 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 diff --git a/src/gui/widgets/timeline-widget.hpp b/src/gui/widgets/timeline-widget.hpp index 3bfa76593..b409d7fe1 100644 --- a/src/gui/widgets/timeline-widget.hpp +++ b/src/gui/widgets/timeline-widget.hpp @@ -159,17 +159,17 @@ private: * @param list The parent track of the branch. **/ void create_timeline_tracks_from_branch( - boost::shared_ptr model_track); + boost::shared_ptr 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 - create_timeline_track_from_model_track( - boost::shared_ptr model_track); + create_timeline_track_from_modelTrack( + boost::shared_ptr 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, + boost::shared_ptr modelTrack, std::map, boost::shared_ptr > &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 lookup_timeline_track( - boost::shared_ptr model_track) const; + boost::shared_ptr modelTrack) const; // ----- Layout Functions ----- // diff --git a/src/gui/widgets/timeline/timeline-body.cpp b/src/gui/widgets/timeline/timeline-body.cpp index 8a6c8128a..f78f99ec1 100644 --- a/src/gui/widgets/timeline/timeline-body.cpp +++ b/src/gui/widgets/timeline/timeline-body.cpp @@ -324,7 +324,7 @@ TimelineBody::draw_tracks(Cairo::RefPtr cr) iterator != layout_tree.end(); iterator++) { - // const shared_ptr model_track(*iterator); + // const shared_ptr modelTrack(*iterator); const shared_ptr timeline_track = timelineWidget.lookup_timeline_track(*iterator); diff --git a/src/gui/widgets/timeline/timeline-clip-track.cpp b/src/gui/widgets/timeline/timeline-clip-track.cpp index beddafc62..55b7169b8 100644 --- a/src/gui/widgets/timeline/timeline-clip-track.cpp +++ b/src/gui/widgets/timeline/timeline-clip-track.cpp @@ -97,7 +97,7 @@ namespace timeline { shared_ptr ClipTrack::getModelTrack () { - return dynamic_pointer_cast(model_track); + return dynamic_pointer_cast(modelTrack); } void diff --git a/src/gui/widgets/timeline/timeline-header-container.cpp b/src/gui/widgets/timeline/timeline-header-container.cpp index 66732d383..3ecfba2d0 100644 --- a/src/gui/widgets/timeline/timeline-header-container.cpp +++ b/src/gui/widgets/timeline/timeline-header-container.cpp @@ -425,12 +425,12 @@ TimelineHeaderContainer::layout_headers() shared_ptr TimelineHeaderContainer::lookup_timeline_track( - shared_ptr model_track) + shared_ptr modelTrack) { - REQUIRE(model_track != NULL); + REQUIRE(modelTrack != NULL); shared_ptr timeline_track = - timelineWidget.lookup_timeline_track(model_track); + timelineWidget.lookup_timeline_track(modelTrack); ENSURE(timeline_track); return timeline_track; diff --git a/src/gui/widgets/timeline/timeline-header-container.hpp b/src/gui/widgets/timeline/timeline-header-container.hpp index 4bf03a1e9..dc1218cbd 100644 --- a/src/gui/widgets/timeline/timeline-header-container.hpp +++ b/src/gui/widgets/timeline/timeline-header-container.hpp @@ -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, + boost::shared_ptr 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 lookup_timeline_track( - boost::shared_ptr model_track); + boost::shared_ptr modelTrack); void begin_drag(); diff --git a/src/gui/widgets/timeline/timeline-header-widget.cpp b/src/gui/widgets/timeline/timeline-header-widget.cpp index 5c9bf81bd..1eac796d0 100644 --- a/src/gui/widgets/timeline/timeline-header-widget.cpp +++ b/src/gui/widgets/timeline/timeline-header-widget.cpp @@ -160,8 +160,8 @@ TimelineHeaderWidget::on_expose_event(GdkEventExpose *event) REQUIRE(style); REQUIRE(gdkWindow); - shared_ptr model_track = track.get_model_track(); - REQUIRE(model_track); + shared_ptr 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, "", diff --git a/src/gui/widgets/timeline/timeline-layout-helper.cpp b/src/gui/widgets/timeline/timeline-layout-helper.cpp index 372220ff9..ec653ad81 100644 --- a/src/gui/widgets/timeline/timeline-layout-helper.cpp +++ b/src/gui/widgets/timeline/timeline-layout-helper.cpp @@ -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 = - dragging_track->get_model_track(); - draggingTrackIter = iterator_from_track(model_track); + const shared_ptr 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) + boost::shared_ptr 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 = *iterator; - REQUIRE(model_track); + const shared_ptr &modelTrack = *iterator; + REQUIRE(modelTrack); shared_ptr 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 TimelineLayoutHelper::lookup_timeline_track( - shared_ptr model_track) + shared_ptr modelTrack) { - REQUIRE(model_track != NULL); + REQUIRE(modelTrack != NULL); shared_ptr 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(*target); - REQUIRE(model_track); + const shared_ptr modelTrack(*target); + REQUIRE(modelTrack); const weak_ptr 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 sequence = get_sequence(); diff --git a/src/gui/widgets/timeline/timeline-layout-helper.hpp b/src/gui/widgets/timeline/timeline-layout-helper.hpp index 03d019067..4614d373a 100644 --- a/src/gui/widgets/timeline/timeline-layout-helper.hpp +++ b/src/gui/widgets/timeline/timeline-layout-helper.hpp @@ -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); + boost::shared_ptr 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 lookup_timeline_track( - boost::shared_ptr model_track); + boost::shared_ptr 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. diff --git a/src/gui/widgets/timeline/timeline-track.cpp b/src/gui/widgets/timeline/timeline-track.cpp index af33ce725..e2b22ce2e 100644 --- a/src/gui/widgets/timeline/timeline-track.cpp +++ b/src/gui/widgets/timeline/timeline-track.cpp @@ -39,14 +39,14 @@ const float Track::ExpandAnimationPeriod = 0.15; Track::Track(TimelineWidget &timeline_widget, shared_ptr 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 -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( 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 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 diff --git a/src/gui/widgets/timeline/timeline-track.hpp b/src/gui/widgets/timeline/timeline-track.hpp index 4707cb436..7e0668f31 100644 --- a/src/gui/widgets/timeline/timeline-track.hpp +++ b/src/gui/widgets/timeline/timeline-track.hpp @@ -75,7 +75,7 @@ public: Gtk::Widget& get_header_widget(); boost::shared_ptr - 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; + boost::shared_ptr modelTrack; private: /**