removed no-longer-used Editor::track_canvas_motion()
[ardour.git] / gtk2_ardour / editor.h
index a7a7224e61e437a93a970a1aedfbcdb89cc0323c..bf4783409c1309387c663cf68946a68f9cab02df 100644 (file)
@@ -23,6 +23,7 @@
 #include <list>
 #include <map>
 #include <set>
+#include <stack>
 #include <string>
 #include <sys/time.h>
 #include <cmath>
@@ -116,6 +117,7 @@ class PlaylistSelector;
 class PluginSelector;
 class ProgressReporter;
 class RhythmFerret;
+class RulerDialog;
 class Selection;
 class SoundFileOmega;
 class StreamView;
@@ -422,6 +424,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        Gdk::Cursor* get_canvas_cursor () const { return current_canvas_cursor; }
        void set_canvas_cursor (Gdk::Cursor*, bool save=false);
+       
+       void push_canvas_cursor (Gdk::Cursor*);
+       void pop_canvas_cursor ();
+
        void set_current_trimmable (boost::shared_ptr<ARDOUR::Trimmable>);
        void set_current_movable (boost::shared_ptr<ARDOUR::Movable>);
 
@@ -446,10 +452,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
                _stepping_axis_view = v;
        }
 
-       ArdourCanvas::Group* get_trackview_group () const { return _trackview_group; }
-        ArdourCanvas::Group* get_hscroll_group () const { return h_scroll_group; }
-        ArdourCanvas::Group* get_vscroll_group () const { return v_scroll_group; }
-        ArdourCanvas::Group* get_hvscroll_group () const { return hv_scroll_group; }
+       ArdourCanvas::Container* get_trackview_group () const { return _trackview_group; }
+        ArdourCanvas::Container* get_noscroll_group () const { return no_scroll_group; }
+        ArdourCanvas::ScrollGroup* get_hscroll_group () const { return h_scroll_group; }
+        ArdourCanvas::ScrollGroup* get_vscroll_group () const { return v_scroll_group; }
+        ArdourCanvas::ScrollGroup* get_hvscroll_group () const { return hv_scroll_group; }
 
         ArdourCanvas::GtkCanvasViewport* get_track_canvas () const;
 
@@ -530,7 +537,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        JoinObjectRangeState _join_object_range_state;
 
-       void update_join_object_range_location (double, double);
+       void update_join_object_range_location (double);
 
        boost::optional<int>  pre_notebook_shrink_pane_width;
 
@@ -555,7 +562,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void refresh_location_display ();
        void refresh_location_display_internal (ARDOUR::Locations::LocationList&);
        void add_new_location (ARDOUR::Location *);
-       ArdourCanvas::Group* add_new_location_internal (ARDOUR::Location *);
+       ArdourCanvas::Container* add_new_location_internal (ARDOUR::Location *);
        void location_gone (ARDOUR::Location *);
        void remove_marker (ArdourCanvas::Item&, GdkEvent*);
        gint really_remove_marker (ARDOUR::Location* loc);
@@ -601,7 +608,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        LocationMarkerMap location_markers;
 
        void update_marker_labels ();
-       void update_marker_labels (ArdourCanvas::Group *);
+       void update_marker_labels (ArdourCanvas::Container *);
        void check_marker_label (Marker *);
 
        /** A set of lists of Markers that are in each of the canvas groups
@@ -610,7 +617,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
         *  a marker has moved we can decide whether we need to update the labels
         *  for all markers or for just a few.
         */
-       std::map<ArdourCanvas::Group *, std::list<Marker *> > _sorted_marker_lists;
+       std::map<ArdourCanvas::Container *, std::list<Marker *> > _sorted_marker_lists;
        void remove_sorted_marker (Marker *);
 
        void hide_marker (ArdourCanvas::Item*, GdkEvent*);
@@ -696,9 +703,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        Gtk::VBox           global_vpacker;
        Gtk::VBox           vpacker;
 
+       std::stack<Gdk::Cursor*> _cursor_stack;
        Gdk::Cursor*          current_canvas_cursor;
-       Gdk::Cursor* which_grabber_cursor ();
-       void set_canvas_cursor ();
+       Gdk::Cursor* which_grabber_cursor () const;
+       Gdk::Cursor* which_track_cursor () const;
+       Gdk::Cursor* which_mode_cursor () const;
+       Gdk::Cursor* which_trim_cursor (bool left_side) const;
+       bool reset_canvas_cursor ();
+       void choose_canvas_cursor_on_entry (GdkEventCrossing*, ItemType);
 
        ArdourCanvas::GtkCanvas* _track_canvas;
        ArdourCanvas::GtkCanvasViewport* _track_canvas_viewport;
@@ -711,50 +723,51 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void parameter_changed (std::string);
        void ui_parameter_changed (std::string);
 
-       bool track_canvas_motion (GdkEvent*);
-
        Gtk::EventBox             time_bars_event_box;
        Gtk::VBox                 time_bars_vbox;
 
        ArdourCanvas::Pixbuf     *logo_item;
 #if 0    
     /* these will be needed when we have canvas rulers */
-       ArdourCanvas::Group      *minsec_group;
-       ArdourCanvas::Group      *bbt_group;
-       ArdourCanvas::Group      *timecode_group;
-       ArdourCanvas::Group      *frame_group;
+       ArdourCanvas::Container      *minsec_group;
+       ArdourCanvas::Container      *bbt_group;
+       ArdourCanvas::Container      *timecode_group;
+       ArdourCanvas::Container      *frame_group;
 #endif
 
-       ArdourCanvas::Group      *tempo_group;
-       ArdourCanvas::Group      *meter_group;
-       ArdourCanvas::Group      *marker_group;
-       ArdourCanvas::Group      *range_marker_group;
-       ArdourCanvas::Group      *transport_marker_group;
-       ArdourCanvas::Group*      cd_marker_group;
+       ArdourCanvas::Container      *tempo_group;
+       ArdourCanvas::Container      *meter_group;
+       ArdourCanvas::Container      *marker_group;
+       ArdourCanvas::Container      *range_marker_group;
+       ArdourCanvas::Container      *transport_marker_group;
+       ArdourCanvas::Container*      cd_marker_group;
 
        /* parent for groups which themselves contain time markers */
-       ArdourCanvas::Group*     _time_markers_group;
+       ArdourCanvas::Container*     _time_markers_group;
 
        /* The group containing all other groups that are scrolled vertically
           and horizontally.
        */
-        ArdourCanvas::Group* hv_scroll_group;
+        ArdourCanvas::ScrollGroup* hv_scroll_group;
 
        /* The group containing all other groups that are scrolled vertically ONLY
        */
-        ArdourCanvas::Group* v_scroll_group;
+        ArdourCanvas::ScrollGroup* v_scroll_group;
 
        /* The group containing all other groups that are scrolled horizontally ONLY
        */
-        ArdourCanvas::Group* h_scroll_group;
+        ArdourCanvas::ScrollGroup* h_scroll_group;
+
+       /* The group containing all trackviews. */
+       ArdourCanvas::Container* no_scroll_group;
 
        /* The group containing all trackviews. */
-       ArdourCanvas::Group* _trackview_group;
+       ArdourCanvas::Container* _trackview_group;
 
        /* The group holding things (mostly regions) while dragging so they
         * are on top of everything else
         */
-       ArdourCanvas::Group* _drag_motion_group;
+       ArdourCanvas::Container* _drag_motion_group;
 
         /* a rect that sits at the bottom of all tracks to act as a drag-no-drop/clickable
         * target area.
@@ -791,6 +804,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        Gtk::Widget * ruler_grabbed_widget;
 
+       RulerDialog* ruler_dialog;
+
        void initialize_rulers ();
        void update_just_timecode ();
        void compute_fixed_ruler_scale (); //calculates the RulerScale of the fixed rulers
@@ -888,7 +903,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        /* videtimline related actions */
        Gtk::Label                videotl_label;
-       ArdourCanvas::Group*      videotl_group;
+       ArdourCanvas::Container*      videotl_group;
        Glib::RefPtr<Gtk::ToggleAction> ruler_video_action;
        Glib::RefPtr<Gtk::ToggleAction> xjadeo_proc_action;
        Glib::RefPtr<Gtk::ToggleAction> xjadeo_ontop_action;
@@ -1035,7 +1050,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        /* track views */
        TrackViewList track_views;
-       std::pair<TimeAxisView*, double> trackview_by_y_position (double, bool trackview_relative_offset = true);
+       std::pair<TimeAxisView*, double> trackview_by_y_position (double, bool trackview_relative_offset = true) const;
        RouteTimeAxisView* axis_view_from_route (boost::shared_ptr<ARDOUR::Route>) const;
 
        TrackViewList get_tracks_for_range_action () const;
@@ -1202,11 +1217,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void temporal_zoom_by_frame (framepos_t start, framepos_t end);
        void temporal_zoom_to_frame (bool coarser, framepos_t frame);
 
-       void insert_region_list_drag (boost::shared_ptr<ARDOUR::Region>, int x, int y);
        void insert_region_list_selection (float times);
 
-       void insert_route_list_drag (boost::shared_ptr<ARDOUR::Route>, int x, int y);
-
        /* import & embed */
 
        void add_external_audio_action (Editing::ImportMode);
@@ -1342,6 +1354,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        DragManager* _drags;
 
        void escape ();
+       void lock ();
+       void unlock ();
+       Gtk::Dialog* lock_dialog;
+
+       struct timeval last_event_time;
+       bool generic_event_handler (GdkEvent*);
+       bool lock_timeout_callback ();
+       void start_lock_event_timing ();
 
        Gtk::Menu fade_context_menu;
 
@@ -1396,6 +1416,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        bool canvas_fade_out_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*);
        bool canvas_fade_out_handle_event (GdkEvent* event,ArdourCanvas::Item*, AudioRegionView*, bool trim = false);
        bool canvas_region_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
+       bool canvas_wave_view_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
        bool canvas_frame_handle_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
        bool canvas_region_view_name_highlight_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
        bool canvas_region_view_name_event (GdkEvent* event,ArdourCanvas::Item*, RegionView*);
@@ -1433,9 +1454,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        friend class EditorRouteGroups;
        friend class EditorRegions;
 
-       /** true if the mouse is over a place where region trim can happen */
-       bool _over_region_trim_target;
-
        /* non-public event handlers */
 
        bool canvas_playhead_cursor_event (GdkEvent* event, ArdourCanvas::Item*);
@@ -1470,8 +1488,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        TempoLines* tempo_lines;
 
-       ArdourCanvas::Group* global_rect_group;
-       ArdourCanvas::Group* time_line_group;
+       ArdourCanvas::Container* global_rect_group;
+       ArdourCanvas::Container* time_line_group;
 
        void hide_measures ();
         void draw_measures (ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
@@ -2053,8 +2071,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        Gtk::MenuItem& action_menu_item (std::string const &);
        void action_pre_activated (Glib::RefPtr<Gtk::Action> const &);
 
-       void set_canvas_cursor_for_region_view (double, RegionView *);
-
        MouseCursors* _cursors;
 
        void follow_mixer_selection ();