Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
IBeamTool Class Reference

#include "gui/widget/timeline/timeline-ibeam-tool.hpp"

Description

A helper class to implement the timeline i-beam tool.

Definition at line 50 of file timeline-ibeam-tool.hpp.

Public Member Functions

 IBeamTool (TimelineBody &timeline_body)
 
ToolType get_type () const
 this is an ABC More...
 
- Public Member Functions inherited from Tool
virtual ~Tool ()
 
bool apply_cursor ()
 Re-applies the cursor for the current tool at the current moment. More...
 

Protected Member Functions

 ~IBeamTool ()
 
Glib::RefPtr< Gdk::Cursor > get_cursor () const
 Gets the cursor to display for this tool at this moment. More...
 
void on_button_press_event (GdkEventButton *event)
 The event handler for button press events. More...
 
void on_button_release_event (GdkEventButton *event)
 The event handler for button release events. More...
 
void on_motion_notify_event (GdkEventMotion *event)
 The event handler for mouse move events. More...
 
- Protected Member Functions inherited from Tool
 Tool (TimelineBody &owner)
 
Gdk::Rectangle get_body_rectangle () const
 Helper function which retrieves the rectangle of the timeline body. More...
 
shared_ptr< TimelineStateget_state () const
 A helper function to get the state. More...
 
gui::widget::TimelineWidgetget_timeline_widget () const
 Helper function which retrieves the pointer to owner timeline widget object, which is the owner of the timeline body. More...
 
TimelineViewWindowview_window () const
 A helper function to get the view window. More...
 

Private Types

enum  DragType {
  None,
  Selection,
  GrabStart,
  GrabEnd
}
 An enum used to represent the type of drag currently take place. More...
 

Private Member Functions

void begin_scroll_slide (int scroll_slide_rate)
 Begins, or continues a scroll slide at a given rate. More...
 
void end_scroll_slide ()
 Ends a scroll slide, and disconnects the slide timer. More...
 
bool is_mouse_in_end_drag_zone () const
 Determines if the cursor is hovering over the end of the selection. More...
 
bool is_mouse_in_start_drag_zone () const
 Determines if the cursor is hovering over the start of the selection. More...
 
bool on_scroll_slide_timer ()
 An internal event handler, which is called when the scroll slide timer calls it. More...
 
void set_leading_x (const int x)
 As the user drags, this function is called to update the position of the moving end of the selection. More...
 

Private Attributes

DragType dragType
 Specifies the type of drag currently taking place. More...
 
TimeVar pinnedDragTime
 During a selection drag, one end of the selection is moving with the mouse, the other is pinned. More...
 
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...
 
Control< TimeSpanselectionControl
 

Static Private Attributes

static const int DragZoneWidth
 DragZoneSize defines the width of the zone near to the end of the selection in which dragging will cause the selection to resize. More...
 
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...
 

Additional Inherited Members

- Protected Attributes inherited from Tool
bool isDragging
 
Gdk::Point mousePoint
 
TimelineBodytimelineBody
 

Member Enumeration Documentation

enum DragType
private

An enum used to represent the type of drag currently take place.

Enumerator
None 

No drag is occurring.

Selection 

A selection drag is occurring.

Remarks
The position of one end of the selection was set at mouse-down of the drag, and the other end is set by drag-release.
GrabStart 

The start of the selection is being dragged.

GrabEnd 

The end of the selection is being dragged.

Definition at line 133 of file timeline-ibeam-tool.hpp.

Constructor & Destructor Documentation

IBeamTool ( TimelineBody timeline_body)
Parameters
timeline_bodyowner timeline body object

Definition at line 53 of file timeline-ibeam-tool.cpp.

References Tool::get_state(), and IBeamTool::selectionControl.

+ Here is the call graph for this function:

~IBeamTool ( )
protected

Definition at line 65 of file timeline-ibeam-tool.cpp.

References IBeamTool::end_scroll_slide(), and IBeamTool::selectionControl.

+ Here is the call graph for this function:

Member Function Documentation

ToolType get_type ( ) const
virtual

this is an ABC

Gets the type of tool represented by this class.

Remarks
This must be implemented by all timeline tool classes.

Implements Tool.

Definition at line 73 of file timeline-ibeam-tool.cpp.

References gui::widget::timeline::IBeam.

Glib::RefPtr< Gdk::Cursor > get_cursor ( ) const
protectedvirtual

Gets the cursor to display for this tool at this moment.

Remarks
This must be implemented by all timeline tool classes.

Implements Tool.

Definition at line 80 of file timeline-ibeam-tool.cpp.

References IBeamTool::dragType, IBeamTool::GrabEnd, IBeamTool::GrabStart, IBeamTool::is_mouse_in_end_drag_zone(), IBeamTool::is_mouse_in_start_drag_zone(), and IBeamTool::Selection.

+ Here is the call graph for this function:

void on_button_press_event ( GdkEventButton *  event)
protectedvirtual

The event handler for button press events.

Reimplemented from Tool.

Definition at line 109 of file timeline-ibeam-tool.cpp.

References IBeamTool::dragType, Tool::get_state(), IBeamTool::GrabEnd, IBeamTool::GrabStart, IBeamTool::is_mouse_in_end_drag_zone(), IBeamTool::is_mouse_in_start_drag_zone(), Duration::NIL, Tool::on_button_press_event(), IBeamTool::pinnedDragTime, IBeamTool::Selection, and IBeamTool::selectionControl.

+ Here is the call graph for this function:

void on_button_release_event ( GdkEventButton *  event)
protectedvirtual

The event handler for button release events.

Reimplemented from Tool.

Definition at line 143 of file timeline-ibeam-tool.cpp.

References Tool::apply_cursor(), IBeamTool::dragType, IBeamTool::end_scroll_slide(), ENSURE(), Tool::isDragging, IBeamTool::None, Tool::on_button_release_event(), and IBeamTool::set_leading_x().

+ Here is the call graph for this function:

void on_motion_notify_event ( GdkEventMotion *  event)
protectedvirtual

The event handler for mouse move events.

Reimplemented from Tool.

Definition at line 169 of file timeline-ibeam-tool.cpp.

References Tool::apply_cursor(), IBeamTool::begin_scroll_slide(), IBeamTool::dragType, IBeamTool::end_scroll_slide(), ENSURE(), Tool::get_body_rectangle(), Tool::isDragging, IBeamTool::None, Tool::on_motion_notify_event(), IBeamTool::ScrollSlideRateDivisor, and IBeamTool::set_leading_x().

+ Here is the call graph for this function:

bool on_scroll_slide_timer ( )
private

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

Definition at line 197 of file timeline-ibeam-tool.cpp.

References Tool::get_body_rectangle(), IBeamTool::scrollSlideRate, TimelineViewWindow::shift_view(), and Tool::view_window().

Referenced by IBeamTool::begin_scroll_slide().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void set_leading_x ( const int  x)
private

As the user drags, this function is called to update the position of the moving end of the selection.

Definition at line 208 of file timeline-ibeam-tool.cpp.

References Tool::get_state(), IBeamTool::pinnedDragTime, and IBeamTool::selectionControl.

Referenced by IBeamTool::on_button_release_event(), and IBeamTool::on_motion_notify_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 width.

Definition at line 227 of file timeline-ibeam-tool.cpp.

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

Referenced by IBeamTool::on_motion_notify_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void end_scroll_slide ( )
private

Ends a scroll slide, and disconnects the slide timer.

Definition at line 238 of file timeline-ibeam-tool.cpp.

References IBeamTool::scrollSlideEvent, and IBeamTool::scrollSlideRate.

Referenced by IBeamTool::on_button_release_event(), IBeamTool::on_motion_notify_event(), and IBeamTool::~IBeamTool().

+ Here is the caller graph for this function:

bool is_mouse_in_start_drag_zone ( ) const
private

Determines if the cursor is hovering over the start of the selection.

Definition at line 247 of file timeline-ibeam-tool.cpp.

References IBeamTool::DragZoneWidth, Tool::get_state(), Tool::mousePoint, TimelineViewWindow::time_to_x(), and Tool::view_window().

Referenced by IBeamTool::get_cursor(), and IBeamTool::on_button_press_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool is_mouse_in_end_drag_zone ( ) const
private

Determines if the cursor is hovering over the end of the selection.

Definition at line 258 of file timeline-ibeam-tool.cpp.

References IBeamTool::DragZoneWidth, Tool::get_state(), Tool::mousePoint, TimelineViewWindow::time_to_x(), and Tool::view_window().

Referenced by IBeamTool::get_cursor(), and IBeamTool::on_button_press_event().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

DragType dragType
private

Specifies the type of drag currently taking place.

Definition at line 165 of file timeline-ibeam-tool.hpp.

Referenced by IBeamTool::get_cursor(), IBeamTool::on_button_press_event(), IBeamTool::on_button_release_event(), and IBeamTool::on_motion_notify_event().

TimeVar pinnedDragTime
private

During a selection drag, one end of the selection is moving with the mouse, the other is pinned.

pinnedDragTime specifies the time of that point.

Definition at line 172 of file timeline-ibeam-tool.hpp.

Referenced by IBeamTool::on_button_press_event(), and IBeamTool::set_leading_x().

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 selection outside the area of the timeline body.

Definition at line 180 of file timeline-ibeam-tool.hpp.

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

int scrollSlideRate
private

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

Definition at line 186 of file timeline-ibeam-tool.hpp.

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

const int DragZoneWidth
staticprivate

DragZoneSize defines the width of the zone near to the end of the selection in which dragging will cause the selection to resize.

Remarks
The selection marque can be resized by dragging the ends of it. Special cursors are shown when the mouse is in this region.

Definition at line 195 of file timeline-ibeam-tool.hpp.

Referenced by IBeamTool::is_mouse_in_end_drag_zone(), and IBeamTool::is_mouse_in_start_drag_zone().

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 202 of file timeline-ibeam-tool.hpp.

Referenced by IBeamTool::on_motion_notify_event().

const int ScrollSlideEventInterval
staticprivate

The interval between scroll slide events in ms.

Definition at line 207 of file timeline-ibeam-tool.hpp.

Referenced by IBeamTool::begin_scroll_slide().

+ Inheritance diagram for IBeamTool:
+ Collaboration diagram for IBeamTool:

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