Lumiera  0.pre.03
»edityourfreedom«
TimelineHeaderContainer Class Reference

#include "gui/widget/timeline/timeline-header-container.hpp"

Description

A helper class for the TimelineWidget.

TimelineHeaderContainer is container widget for all the left-hand-side header widgets associated with timeline tracks.

Definition at line 55 of file timeline-header-container.hpp.

Public Member Functions

 TimelineHeaderContainer (gui::widget::TimelineWidget &timeline_widget)
 
void clear_headers ()
 
void update_headers ()
 Attaches the header all the header widgets of root tracks to this control. More...
 

Friends

class gui::widget::TimelineWidget
 
class timeline::Track
 

Private Member Functions

void begin_drag ()
 
void begin_scroll_slide (int scroll_slide_rate)
 Begins, or continues a scroll slide at a given rate. More...
 
void draw_header_decoration (shared_ptr< model::Track > modelTrack, const Gdk::Rectangle &clip_rect)
 Draws the border decoration around the track header. More...
 
void end_drag (bool apply=true)
 
void end_scroll_slide ()
 Ends a scroll slide, and disconnects the slide timer. More...
 
void forall_vfunc (gboolean include_internals, GtkCallback callback, gpointer callback_data)
 Applies a given function to all the widgets in the container. More...
 
void layout_headers ()
 Moves all the header widgets to the correct position given scroll, stacking etc. More...
 
shared_ptr< timeline::Tracklookup_timeline_track (shared_ptr< model::Track > modelTrack)
 A helper function which calls lookup_timeline_track within the parent timeline widget, but also applies lots of data consistency checks in the process. More...
 
bool on_button_press_event (GdkEventButton *event)
 An event handler for mouse button press events. More...
 
bool on_button_release_event (GdkEventButton *event)
 An event handler for mouse button release events. More...
 
void on_hovering_track_changed (shared_ptr< timeline::Track > hovering_track)
 
void on_layout_changed ()
 
bool on_motion_notify_event (GdkEventMotion *event)
 An event handler for mouse movement events. More...
 
void on_realize ()
 An event handler for the window realized signal. More...
 
void on_remove (Widget *widget)
 An event handler that is called when a widget is removed from the container. More...
 
void on_scroll ()
 This event is called when the scroll bar moves. More...
 
bool on_scroll_slide_timer ()
 An internal event handler, which is called when the scroll slide timer calls it. More...
 
void on_size_allocate (Gtk::Allocation &allocation)
 An event handler that is called to notify this widget to allocate a given area for itself. More...
 
void on_size_request (Gtk::Requisition *requisition)
 An event handler that is called to offer an allocation to this widget. More...
 
void on_unrealize ()
 An event handler for the window unrealized signal. More...
 
void raise_recursive (TimelineLayoutHelper::TrackTree::iterator_base node)
 Recursively raises all the header widget windows in a branch to the top of the Z-order. More...
 

Private Attributes

Gtk::Menu contextMenu
 The Menu object which will be displayed as the context menu when the user right clicks on the header container. More...
 
Glib::RefPtr< Gdk::Window > gdkWindow
 The widget's window object. More...
 
shared_ptr< timeline::TrackhoveringTrack
 
Gdk::Point mousePoint
 
sigc::connection scrollSlideEvent
 This connection is used to represent the timer which causes scroll sliding to occur. More...
 
int scrollSlideRate
 Specifies the rate at which scroll sliding is currently taking place. More...
 
gui::widget::TimelineWidgettimelineWidget
 The owner TimelineWidget of which this class is a helper. More...
 

Static Private Attributes

static const int ScrollSlideEventInterval
 The interval between scroll slide events in ms. More...
 
static const int ScrollSlideRateDivisor
 The amount to divide the mouse overshoot by to produce the slide scroll rate. More...
 

Constructor & Destructor Documentation

◆ TimelineHeaderContainer()

Member Function Documentation

◆ update_headers()

void update_headers ( )

Attaches the header all the header widgets of root tracks to this control.

Note
This must be called when the track list changes to synchronise the headers with the timeline body and the backend.

Definition at line 87 of file timeline-header-container.cpp.

References ENSURE(), NULL, TimelineHeaderContainer::timelineWidget, and TimelineWidget::trackMap.

Referenced by TimelineWidget::create_timeline_tracks().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear_headers()

void clear_headers ( )

Definition at line 102 of file timeline-header-container.cpp.

References NULL, TimelineHeaderContainer::timelineWidget, and TimelineWidget::trackMap.

Referenced by TimelineWidget::~TimelineWidget().

+ Here is the caller graph for this function:

◆ on_realize()

void on_realize ( )
private

An event handler for the window realized signal.

Definition at line 116 of file timeline-header-container.cpp.

References TimelineHeaderContainer::gdkWindow.

◆ on_unrealize()

void on_unrealize ( )
private

An event handler for the window unrealized signal.

Definition at line 159 of file timeline-header-container.cpp.

References TimelineHeaderContainer::gdkWindow.

◆ on_button_press_event()

bool on_button_press_event ( GdkEventButton *  event)
private

An event handler for mouse button press events.

Parameters
eventThe GDK event containing details of the event.

Definition at line 170 of file timeline-header-container.cpp.

References TimelineHeaderContainer::contextMenu, TimelineLayoutHelper::header_from_point(), TimelineWidget::layoutHelper, NULL, and TimelineHeaderContainer::timelineWidget.

+ Here is the call graph for this function:

◆ on_button_release_event()

bool on_button_release_event ( GdkEventButton *  event)
private

An event handler for mouse button release events.

Parameters
eventThe GDK event containing details of the event.

Definition at line 206 of file timeline-header-container.cpp.

References TimelineHeaderContainer::end_drag().

+ Here is the call graph for this function:

◆ on_motion_notify_event()

bool on_motion_notify_event ( GdkEventMotion *  event)
private

◆ on_size_allocate()

void on_size_allocate ( Gtk::Allocation &  allocation)
private

An event handler that is called to notify this widget to allocate a given area for itself.

Parameters
allocationThe area to allocate for this widget.

Definition at line 296 of file timeline-header-container.cpp.

References TimelineHeaderContainer::gdkWindow, and TimelineHeaderContainer::layout_headers().

+ Here is the call graph for this function:

◆ on_size_request()

void on_size_request ( Gtk::Requisition *  requisition)
private

An event handler that is called to offer an allocation to this widget.

Parameters
requisitionThe area offered for this widget.

Definition at line 264 of file timeline-header-container.cpp.

References Tree< T, tree_node_allocator >::begin(), Tree< T, tree_node_allocator >::empty(), Tree< T, tree_node_allocator >::end(), TimelineLayoutHelper::get_layout_tree(), TimelineWidget::HeaderWidth, TimelineWidget::layoutHelper, TimelineHeaderContainer::lookup_timeline_track(), and TimelineHeaderContainer::timelineWidget.

+ Here is the call graph for this function:

◆ forall_vfunc()

void forall_vfunc ( gboolean  include_internals,
GtkCallback  callback,
gpointer  callback_data 
)
private

Applies a given function to all the widgets in the container.

Definition at line 314 of file timeline-header-container.cpp.

References NULL, TimelineHeaderContainer::timelineWidget, and TimelineWidget::trackMap.

◆ on_remove()

void on_remove ( Widget *  widget)
private

An event handler that is called when a widget is removed from the container.

Definition at line 333 of file timeline-header-container.cpp.

References TimelineHeaderContainer::timelineWidget, and TimelineWidget::trackMap.

◆ on_layout_changed()

void on_layout_changed ( )
private

Definition at line 350 of file timeline-header-container.cpp.

References TimelineHeaderContainer::layout_headers().

Referenced by TimelineWidget::on_layout_changed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_scroll()

void on_scroll ( )
private

This event is called when the scroll bar moves.

Definition at line 356 of file timeline-header-container.cpp.

References TimelineHeaderContainer::layout_headers().

Referenced by TimelineHeaderContainer::TimelineHeaderContainer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_hovering_track_changed()

void on_hovering_track_changed ( shared_ptr< timeline::Track hovering_track)
private

Definition at line 364 of file timeline-header-container.cpp.

Referenced by TimelineHeaderContainer::TimelineHeaderContainer().

+ Here is the caller graph for this function:

◆ on_scroll_slide_timer()

bool on_scroll_slide_timer ( )
private

An internal event handler, which is called when the scroll slide timer calls it.

Definition at line 371 of file timeline-header-container.cpp.

References TimelineLayoutHelper::drag_to_point(), TimelineWidget::get_y_scroll_offset(), TimelineWidget::layoutHelper, TimelineHeaderContainer::mousePoint, TimelineHeaderContainer::scrollSlideRate, TimelineWidget::set_y_scroll_offset(), and TimelineHeaderContainer::timelineWidget.

Referenced by TimelineHeaderContainer::begin_scroll_slide().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ layout_headers()

void layout_headers ( )
private

Moves all the header widgets to the correct position given scroll, stacking etc.

Definition at line 388 of file timeline-header-container.cpp.

References Tree< T, tree_node_allocator >::begin(), Tree< T, tree_node_allocator >::empty(), Tree< T, tree_node_allocator >::end(), TimelineHeaderContainer::gdkWindow, TimelineLayoutHelper::get_dragging_track_iter(), TimelineLayoutHelper::get_layout_tree(), TimelineLayoutHelper::get_track_header_rect(), TimelineLayoutHelper::is_dragging_track(), TimelineWidget::layoutHelper, TimelineHeaderContainer::lookup_timeline_track(), TimelineHeaderContainer::raise_recursive(), and TimelineHeaderContainer::timelineWidget.

Referenced by TimelineHeaderContainer::on_layout_changed(), TimelineHeaderContainer::on_scroll(), and TimelineHeaderContainer::on_size_allocate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw_header_decoration()

void draw_header_decoration ( shared_ptr< model::Track modelTrack,
const Gdk::Rectangle &  clip_rect 
)
private

Draws the border decoration around the track header.

Parameters
modelTrackThe track to draw the decoration for.
clip_rectThe clip to drawing to.
depthThe depth within the tree of this track. This is used to control the amount of indention.
offsetThe vertical offset of the headers in pixels.

◆ lookup_timeline_track()

shared_ptr< timeline::Track > lookup_timeline_track ( shared_ptr< model::Track modelTrack)
private

A helper function which calls lookup_timeline_track within the parent timeline widget, but also applies lots of data consistency checks in the process.

Parameters
modelTrackThe model track to look up in the parent widget.
Returns
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.

Definition at line 446 of file timeline-header-container.cpp.

References ENSURE(), TimelineWidget::lookup_timeline_track(), NULL, and TimelineHeaderContainer::timelineWidget.

Referenced by TimelineHeaderContainer::layout_headers(), TimelineHeaderContainer::on_size_request(), and TimelineHeaderContainer::raise_recursive().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ begin_drag()

void begin_drag ( )
private

Definition at line 459 of file timeline-header-container.cpp.

References TimelineLayoutHelper::begin_dragging_track(), TimelineHeaderContainer::gdkWindow, TimelineLayoutHelper::get_dragging_track_iter(), TimelineWidget::layoutHelper, TimelineHeaderContainer::mousePoint, TimelineHeaderContainer::raise_recursive(), and TimelineHeaderContainer::timelineWidget.

Referenced by TimelineHeaderContainer::on_motion_notify_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ end_drag()

void end_drag ( bool  apply = true)
private

Definition at line 475 of file timeline-header-container.cpp.

References TimelineLayoutHelper::end_dragging_track(), TimelineHeaderContainer::end_scroll_slide(), TimelineHeaderContainer::gdkWindow, TimelineLayoutHelper::is_dragging_track(), TimelineWidget::layoutHelper, and TimelineHeaderContainer::timelineWidget.

Referenced by TimelineHeaderContainer::on_button_release_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ raise_recursive()

void raise_recursive ( TimelineLayoutHelper::TrackTree::iterator_base  node)
private

Recursively raises all the header widget windows in a branch to the top of the Z-order.

Parameters
nodeThe window of node's track header will be raised, as well as all it's descendant nodes.

Definition at line 493 of file timeline-header-container.cpp.

References Tree< T, tree_node_allocator >::begin(), Tree< T, tree_node_allocator >::end(), ENSURE(), TimelineLayoutHelper::get_layout_tree(), TimelineWidget::layoutHelper, TimelineHeaderContainer::lookup_timeline_track(), and TimelineHeaderContainer::timelineWidget.

Referenced by TimelineHeaderContainer::begin_drag(), and TimelineHeaderContainer::layout_headers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ begin_scroll_slide()

void begin_scroll_slide ( int  scroll_slide_rate)
private

Begins, or continues a scroll slide at a given rate.

Parameters
scroll_slide_rateThe distance to slide every timer event in units of 1/256th of the view height.

Definition at line 520 of file timeline-header-container.cpp.

References TimelineHeaderContainer::on_scroll_slide_timer(), TimelineHeaderContainer::scrollSlideEvent, TimelineHeaderContainer::ScrollSlideEventInterval, and TimelineHeaderContainer::scrollSlideRate.

Referenced by TimelineHeaderContainer::on_motion_notify_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ end_scroll_slide()

void end_scroll_slide ( )
private

Ends a scroll slide, and disconnects the slide timer.

Definition at line 531 of file timeline-header-container.cpp.

References TimelineHeaderContainer::scrollSlideEvent, and TimelineHeaderContainer::scrollSlideRate.

Referenced by TimelineHeaderContainer::end_drag(), and TimelineHeaderContainer::on_motion_notify_event().

+ Here is the caller graph for this function:

Member Data Documentation

◆ timelineWidget

◆ gdkWindow

◆ contextMenu

Gtk::Menu contextMenu
private

The Menu object which will be displayed as the context menu when the user right clicks on the header container.

Remarks
The context menu will be displayed when the user's right click is not processed by track headers.

Definition at line 235 of file timeline-header-container.hpp.

Referenced by TimelineHeaderContainer::on_button_press_event(), and TimelineHeaderContainer::TimelineHeaderContainer().

◆ scrollSlideEvent

sigc::connection scrollSlideEvent
private

This connection is used to represent the timer which causes scroll sliding to occur.

Remarks
Scroll sliding is an animated scroll which occurs when the user drags a header outside the area of the timeline body.

Definition at line 243 of file timeline-header-container.hpp.

Referenced by TimelineHeaderContainer::begin_scroll_slide(), and TimelineHeaderContainer::end_scroll_slide().

◆ scrollSlideRate

int scrollSlideRate
private

Specifies the rate at which scroll sliding is currently taking place.

Definition at line 249 of file timeline-header-container.hpp.

Referenced by TimelineHeaderContainer::begin_scroll_slide(), TimelineHeaderContainer::end_scroll_slide(), and TimelineHeaderContainer::on_scroll_slide_timer().

◆ hoveringTrack

shared_ptr<timeline::Track> hoveringTrack
private

◆ mousePoint

◆ ScrollSlideRateDivisor

const int ScrollSlideRateDivisor
staticprivate

The amount to divide the mouse overshoot by to produce the slide scroll rate.

Remarks
Smaller values cause faster scrolling.

Definition at line 263 of file timeline-header-container.hpp.

Referenced by TimelineHeaderContainer::on_motion_notify_event().

◆ ScrollSlideEventInterval

const int ScrollSlideEventInterval
staticprivate

The interval between scroll slide events in ms.

Definition at line 268 of file timeline-header-container.hpp.

Referenced by TimelineHeaderContainer::begin_scroll_slide().

Friends And Related Function Documentation

◆ gui::widget::TimelineWidget

friend class gui::widget::TimelineWidget
friend

Definition at line 270 of file timeline-header-container.hpp.

◆ timeline::Track

friend class timeline::Track
friend

Definition at line 271 of file timeline-header-container.hpp.

+ Inheritance diagram for TimelineHeaderContainer:
+ Collaboration diagram for TimelineHeaderContainer:

The documentation for this class was generated from the following files: