diff --git a/src/gui/widgets/timeline-widget.cpp b/src/gui/widgets/timeline-widget.cpp index b1f64b07b..1eb0c19cb 100644 --- a/src/gui/widgets/timeline-widget.cpp +++ b/src/gui/widgets/timeline-widget.cpp @@ -175,6 +175,7 @@ TimelineWidget::hovering_track_changed_signal() const { return hoveringTrackChangedSignal; } + sigc::signal TimelineWidget::state_changed_signal() const { diff --git a/src/gui/widgets/timeline/timeline-body.cpp b/src/gui/widgets/timeline/timeline-body.cpp index 5ec1ca50f..8a6c8128a 100644 --- a/src/gui/widgets/timeline/timeline-body.cpp +++ b/src/gui/widgets/timeline/timeline-body.cpp @@ -43,7 +43,7 @@ namespace gui { namespace widgets { namespace timeline { -TimelineBody::TimelineBody(TimelineWidget &timeline_widget) : +TimelineBody::TimelineBody(TimelineWidget &timelineWidget) : Glib::ObjectBase("TimelineBody"), tool(NULL), mouseDownX(0), @@ -51,10 +51,10 @@ TimelineBody::TimelineBody(TimelineWidget &timeline_widget) : dragType(None), beginShiftTimeOffset(0), selectionAlpha(0.5), - timelineWidget(timeline_widget) + timelineWidget(timelineWidget) { // Connect up some events - timeline_widget.state_changed_signal().connect( + timelineWidget.state_changed_signal().connect( sigc::mem_fun(this, &TimelineBody::on_state_changed) ); // Install style properties @@ -274,12 +274,12 @@ TimelineBody::on_motion_notify_event(GdkEventMotion *event) // Forward the event to the tool tool->on_motion_notify_event(event); - + // See if the track that we're hovering over has changed - shared_ptr new_hovering_track( + shared_ptr newHoveringTrack( timelineWidget.layoutHelper.track_from_y(event->y)); - if(timelineWidget.get_hovering_track() != new_hovering_track) - timelineWidget.set_hovering_track(new_hovering_track); + if (timelineWidget.get_hovering_track() != newHoveringTrack) + timelineWidget.set_hovering_track(newHoveringTrack); } // false so that the message is passed up to the owner TimelineWidget @@ -507,7 +507,7 @@ TimelineBody::register_styles() const "The colour of the playback marker line", GDK_TYPE_COLOR, G_PARAM_READABLE)); } - + void TimelineBody::read_styles() { diff --git a/src/gui/widgets/timeline/timeline-body.hpp b/src/gui/widgets/timeline/timeline-body.hpp index f9adee189..b6e6a3c29 100644 --- a/src/gui/widgets/timeline/timeline-body.hpp +++ b/src/gui/widgets/timeline/timeline-body.hpp @@ -68,13 +68,15 @@ public: /** * Returns the type of the currently selected timeline tool. */ - ToolType get_tool() const; + ToolType + get_tool() const; /** * Selects a tool of a specified type. * @param tool_type The type of tool to set. */ - void set_tool(ToolType tool_type); + void + set_tool(ToolType tool_type); /* ===== Events ===== */ protected: diff --git a/src/gui/widgets/timeline/timeline-layout-helper.hpp b/src/gui/widgets/timeline/timeline-layout-helper.hpp index b488f8ced..03d019067 100644 --- a/src/gui/widgets/timeline/timeline-layout-helper.hpp +++ b/src/gui/widgets/timeline/timeline-layout-helper.hpp @@ -21,7 +21,7 @@ */ /** @file timeline-layout-helper.cpp - ** This file contains the definition of the layout helpeer class + ** This file contains the definition of the layout helper class */ #ifndef TIMELINE_LAYOUT_HELPER_HPP diff --git a/src/gui/widgets/timeline/timeline-tool.cpp b/src/gui/widgets/timeline/timeline-tool.cpp index 0e8a95542..9e261441d 100644 --- a/src/gui/widgets/timeline/timeline-tool.cpp +++ b/src/gui/widgets/timeline/timeline-tool.cpp @@ -30,8 +30,8 @@ namespace gui { namespace widgets { namespace timeline { -Tool::Tool(TimelineBody &timeline_body) : - timelineBody(timeline_body), +Tool::Tool(TimelineBody &timelineBody) : + timelineBody(timelineBody), isDragging(false) { } @@ -40,7 +40,7 @@ bool Tool::apply_cursor() { Glib::RefPtr window = timelineBody.get_window(); - if(!window) + if (!window) return false; window->set_cursor(get_cursor()); @@ -69,6 +69,8 @@ Tool::on_button_release_event(GdkEventButton* event) void Tool::on_motion_notify_event(GdkEventMotion *event) { + REQUIRE (event != NULL); + mousePoint = Point(event->x, event->y); } diff --git a/src/gui/widgets/timeline/timeline-tool.hpp b/src/gui/widgets/timeline/timeline-tool.hpp index 25d3e3263..6b5ca5398 100644 --- a/src/gui/widgets/timeline/timeline-tool.hpp +++ b/src/gui/widgets/timeline/timeline-tool.hpp @@ -58,13 +58,13 @@ class Tool protected: /** * Constructor - * @param timeline_body The owner timeline body object + * @param timelineBody The owner timeline body object */ - Tool(TimelineBody &timeline_body); + Tool(TimelineBody &timelineBody); public: /** - * Destructor to be overriden by derived classes. + * Destructor to be overridden by derived classes. * @remarks If this were not present, derrived class destructors * would not be called. */ @@ -85,25 +85,25 @@ public: /* ===== Event Handlers ===== */ /** * The event handler for button press events. - * @remarks This can be overriden by the derrived classes, but + * @remarks This can be overridden by the derived classes, but * Tool::on_button_press_event must be called at the start - * of the derrived class's override. + * of the derived class's override. */ virtual void on_button_press_event(GdkEventButton* event); /** * The event handler for button release events. - * @remarks This can be overriden by the derrived classes, but + * @remarks This can be overridden by the derived classes, but * Tool::on_button_release_event must be called at the end of - * the derrived class's override. + * the derived class's override. */ virtual void on_button_release_event(GdkEventButton* event); /** * The event handler for mouse move events. - * @remarks This can be overriden by the derrived classes, but + * @remarks This can be overridden by the derived classes, but * Tool::on_motion_notify_event must be called at the start of - * the derrived class's override. + * the derived class's override. */ virtual void on_motion_notify_event(GdkEventMotion *event); diff --git a/src/gui/widgets/timeline/timeline-track.hpp b/src/gui/widgets/timeline/timeline-track.hpp index 3d9a14ab8..4707cb436 100644 --- a/src/gui/widgets/timeline/timeline-track.hpp +++ b/src/gui/widgets/timeline/timeline-track.hpp @@ -61,7 +61,6 @@ public: Collapse }; -public: /** * Constructor */ @@ -75,7 +74,8 @@ public: Gtk::Widget& get_header_widget(); - boost::shared_ptr get_model_track() const; + boost::shared_ptr + get_model_track() const; /** * Return the visual height of the track in pixels. @@ -127,8 +127,14 @@ public: **/ Gtk::ExpanderStyle get_expander_style() const; + /** + * + **/ void show_header_context_menu(guint button, guint32 time); + /** + * Draw the track + **/ virtual void draw_track(Cairo::RefPtr cairo, TimelineViewWindow* const window) const = 0; @@ -140,8 +146,6 @@ private: **/ static const float ExpandAnimationPeriod; -private: - /** * Event handler for when the enabled status changes. **/