+
+ return std::make_pair ((TimeAxisView *) 0, 0);
+}
+
+bool
+TimeAxisView::resizer_button_press (GdkEventButton* event)
+{
+ _resize_drag_start = event->y_root;
+ return true;
+}
+
+bool
+TimeAxisView::resizer_button_release (GdkEventButton*)
+{
+ _editor.stop_canvas_autoscroll ();
+ _resize_drag_start = -1;
+ return true;
+}
+
+void
+TimeAxisView::idle_resize (uint32_t h)
+{
+ set_height (h);
+}
+
+bool
+TimeAxisView::resizer_motion (GdkEventMotion* ev)
+{
+ if (_resize_drag_start >= 0) {
+ /* (ab)use the DragManager to do autoscrolling; adjust the event coordinates
+ into the world coordinate space that DragManager::motion_handler is expecting,
+ and then fake a DragManager motion event so that when maybe_autoscroll
+ asks DragManager for the current pointer position it will get the correct
+ answers.
+ */
+ int tx, ty;
+ resizer.translate_coordinates (*control_parent, ev->x, ev->y, tx, ty);
+ ev->y = ty - _editor.get_trackview_group_vertical_offset();
+ _editor.drags()->motion_handler ((GdkEvent *) ev, false);
+ _editor.maybe_autoscroll (false, true);
+
+ /* now do the actual TAV resize */
+ int32_t const delta = (int32_t) floor (ev->y_root - _resize_drag_start);
+ _editor.add_to_idle_resize (this, delta);
+ _resize_drag_start = ev->y_root;
+ }
+
+ return true;
+}
+
+bool
+TimeAxisView::resizer_expose (GdkEventExpose* event)
+{
+ int w, h, x, y, d;
+ Glib::RefPtr<Gdk::Window> win (resizer.get_window());
+ Glib::RefPtr<Gdk::GC> dark (resizer.get_style()->get_fg_gc (STATE_NORMAL));
+ Glib::RefPtr<Gdk::GC> light (resizer.get_style()->get_bg_gc (STATE_NORMAL));
+
+ win->draw_rectangle (controls_ebox.get_style()->get_bg_gc(STATE_NORMAL),
+ true,
+ event->area.x,
+ event->area.y,
+ event->area.width,
+ event->area.height);
+
+ win->get_geometry (x, y, w, h, d);
+
+ /* handle/line #1 */
+
+ win->draw_line (dark, 0, 0, w - 2, 0);
+ win->draw_point (dark, 0, 1);
+ win->draw_line (light, 1, 1, w - 1, 1);
+ win->draw_point (light, w - 1, 0);
+
+ /* handle/line #2 */
+
+ win->draw_line (dark, 0, 4, w - 2, 4);
+ win->draw_point (dark, 0, 5);
+ win->draw_line (light, 1, 5, w - 1, 5);
+ win->draw_point (light, w - 1, 4);
+
+ /* use vertical resize mouse cursor */
+ win->set_cursor(Gdk::Cursor(Gdk::SB_V_DOUBLE_ARROW));
+
+ return true;
+}
+
+bool
+TimeAxisView::set_visibility (bool yn)
+{
+ if (yn != marked_for_display()) {
+ if (yn) {
+ set_marked_for_display (true);
+ canvas_display()->show();
+ } else {
+ set_marked_for_display (false);
+ hide ();
+ }
+ return true; // things changed
+ }
+
+ return false;
+}
+
+uint32_t
+TimeAxisView::preset_height (Height h)
+{
+ switch (h) {
+ case HeightLargest:
+ return extra_height + 48 + 250;
+ case HeightLarger:
+ return extra_height + 48 + 150;
+ case HeightLarge:
+ return extra_height + 48 + 50;
+ case HeightNormal:
+ return extra_height + 48;
+ case HeightSmall:
+ return 27;
+ case HeightSmaller:
+ return smaller_height;
+ }
+
+ /* NOTREACHED */
+ return 0;
+}
+
+/** @return Child time axis views that are not hidden */
+TimeAxisView::Children
+TimeAxisView::get_child_list ()
+{
+ Children c;
+
+ for (Children::iterator i = children.begin(); i != children.end(); ++i) {
+ if (!(*i)->hidden()) {
+ c.push_back(*i);
+ }
+ }
+
+ return c;
+}
+
+void
+TimeAxisView::build_size_menu ()
+{
+ if (_size_menu && _size_menu->gobj ()) {
+ return;
+ }
+
+ delete _size_menu;
+
+ using namespace Menu_Helpers;
+
+ _size_menu = new Menu;
+ _size_menu->set_name ("ArdourContextMenu");
+ MenuList& items = _size_menu->items();
+
+ items.push_back (MenuElem (_("Largest"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLargest, true)));
+ items.push_back (MenuElem (_("Larger"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarger, true)));
+ items.push_back (MenuElem (_("Large"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightLarge, true)));
+ items.push_back (MenuElem (_("Normal"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightNormal, true)));
+ items.push_back (MenuElem (_("Smaller"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmaller, true)));
+ items.push_back (MenuElem (_("Small"), sigc::bind (sigc::mem_fun (*this, &TimeAxisView::set_height_enum), HeightSmall, true)));