Rotate output meter label. Is this really supported in the chosen gtk
[ardour.git] / gtk2_ardour / time_axis_view.h
index e2b634c0646b3d6df72d1cbd3c081107f78ab091..e5e13a6c3f000e6318bdf78d646aa28efced1eec 100644 (file)
 #include <vector>
 #include <list>
 
-#include <gtkmm.h>
-#include <libgnomecanvas/libgnomecanvas.h>
+#include <gtkmm/box.h>
+#include <gtkmm/frame.h>
+#include <gtkmm/eventbox.h>
+#include <gtkmm/table.h>
+#include <gtkmm/entry.h>
+#include <gtkmm/label.h>
 
 #include <ardour/types.h>
 #include <ardour/region.h>
@@ -34,6 +38,7 @@
 #include "axis_view.h"
 #include "enums.h"
 #include "editing.h"
+#include "canvas.h"
 
 namespace ARDOUR {
        class Session;
@@ -43,6 +48,10 @@ namespace ARDOUR {
        class Playlist;
 }
 
+namespace Gtk {
+       class Menu;
+}
+
 class PublicEditor;
 class AudioRegionSelection;
 class TimeSelection;
@@ -66,28 +75,28 @@ class TimeAxisView : public virtual AxisView
                   valued so that there is a precise
                   middle.
                */
-               Largest = 301,
-               Large = 201,
-               Larger = 101,
-               Normal = 51,
-               Smaller = 31,
-               Small = 21
+               Largest = 307,
+               Large = 207,
+               Larger = 107,
+               Normal = 57,
+               Smaller = 37,
+               Small = 27
        };
 
-       TimeAxisView(ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* parent, Gtk::Widget *canvas);
+       TimeAxisView(ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* parent, ArdourCanvas::Canvas& canvas);
        virtual ~TimeAxisView ();
 
        /* public data: XXX create accessor/mutators for these ?? */
 
        PublicEditor& editor;
-
+       
        guint32 height;  /* in canvas units */
        guint32 effective_height;  /* in canvas units */
        double  y_position;
        int     order;
 
        
-       GnomeCanvasItem   *canvas_display;
+       ArdourCanvas::Group   *canvas_display;
        Gtk::VBox       *control_parent;
 
        /* The Standard LHS Controls */
@@ -168,7 +177,7 @@ class TimeAxisView : public virtual AxisView
                return 0;
        }
 
-       void order_selection_trims (GnomeCanvasItem *item, bool put_start_on_top);
+       void order_selection_trims (ArdourCanvas::Item *item, bool put_start_on_top);
 
        virtual void get_selectables (jack_nframes_t start, jack_nframes_t end, double top, double bot, list<Selectable*>& results);
        virtual void get_inverted_selectables (Selection&, list<Selectable *>& results);
@@ -183,33 +192,34 @@ class TimeAxisView : public virtual AxisView
 
        /* call this on the parent */
 
-       virtual XMLNode* get_child_xml_node (std::string childname) { return 0; }
+       virtual XMLNode* get_child_xml_node (const string & childname) { return 0; }
 
   protected:
 
        string controls_base_unselected_name;
        string controls_base_selected_name;
 
-       /**
-        * Handle mouse press on our LHS control name entry.
-        *
-        * @param ev the event
-        */
-       virtual bool name_entry_button_press (GdkEventButton *ev);
+       bool name_entry_button_press (GdkEventButton *ev);
+       bool name_entry_button_release (GdkEventButton *ev);
+       bool name_entry_key_release (GdkEventKey *ev);
+       void name_entry_activated ();
+       sigc::connection name_entry_key_timeout;
+       bool name_entry_key_timed_out ();
+       guint32 last_name_entry_key_press_event;
+       
+       /* derived classes can override these */
 
-       /**
-        * Handle mouse relaese on our LHS control name entry.
-        * 
-        *@ param ev the event
-        */
-       virtual bool name_entry_button_release (GdkEventButton *ev);
+       virtual void name_entry_changed ();
+       virtual bool name_entry_focus_in (GdkEventFocus *ev);
+       virtual bool name_entry_focus_out (GdkEventFocus *ev);
 
        /**
         * Handle mouse relaese on our LHS control name ebox.
         * 
         *@ param ev the event
         */
-       virtual gint controls_ebox_button_release (GdkEventButton *ev);
+       virtual bool controls_ebox_button_release (GdkEventButton *ev);
+       virtual bool controls_ebox_scroll (GdkEventScroll *ev);
 
        /**
         * Displays the standard LHS control menu at when.
@@ -229,7 +239,7 @@ class TimeAxisView : public virtual AxisView
          * Do anything that needs to be done to dynamically reset
         * the LHS control menu.
         */
-       virtual gint handle_display_menu_map_event (GdkEventAny *ev) { return FALSE; }
+       virtual bool handle_display_menu_map_event (GdkEventAny *ev) { return false; }
 
        /**
         * Build the standard LHS control size menu for the default TrackHeight options.
@@ -272,7 +282,7 @@ class TimeAxisView : public virtual AxisView
 
        /* selection display */
 
-       GnomeCanvasItem      *selection_group;
+       ArdourCanvas::Group      *selection_group;
 
        list<SelectionRect*> free_selection_rects;
        list<SelectionRect*> used_selection_rects;
@@ -284,6 +294,8 @@ class TimeAxisView : public virtual AxisView
        bool _hidden;
        bool _has_state;
 
+       void check_height (Gdk::Rectangle&);
+
 }; /* class TimeAxisView */
 
 #endif /* __ardour_gtk_time_axis_h__ */