Remove now-deprecated non-zero page size in Adjustments used for SpinButtons;
[ardour.git] / gtk2_ardour / time_axis_view_item.h
index 80d917704187a75cdc7ba9ad2d670d712c36d6d9..9643daf260dfd1319f8000056dbc3727f0a82b88 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #ifndef __gtk_ardour_time_axis_view_item_h__
@@ -39,7 +38,7 @@ class TimeAxisView;
 class TimeAxisViewItem : public Selectable
 {
    public:
-       virtual ~TimeAxisViewItem() ;
+       virtual ~TimeAxisViewItem() ;
     
     /**
      * Set the position of this item upon the timeline to the specified value
@@ -177,6 +176,9 @@ class TimeAxisViewItem : public Selectable
      * @param yn true if this item should show its selected status
      */
     virtual void set_should_show_selection (bool yn) ;
+
+    void set_sensitive (bool yn) { _sensitive = yn; }
+    bool sensitive () const { return _sensitive; }
     
     //---------------------------------------------------------------------------------------//
     // Parent Component Methods
@@ -197,7 +199,7 @@ class TimeAxisViewItem : public Selectable
      *
      * @param new_name the new name text to display
      */
-    void set_name_text(std::string new_name) ;
+    void set_name_text(const Glib::ustring& new_name) ;
     
     /**
      * Set the height of this item
@@ -205,7 +207,9 @@ class TimeAxisViewItem : public Selectable
      * @param h the new height
      */
     virtual void set_height(double h) ;
-    
+
+    void set_y (double);
+
     /**
      * 
      */
@@ -219,7 +223,7 @@ class TimeAxisViewItem : public Selectable
     /**
      * 
      */
-    ArdourCanvas::Item* get_canvas_group();
+    ArdourCanvas::Group* get_canvas_group();
 
     /**
      * 
@@ -264,7 +268,7 @@ class TimeAxisViewItem : public Selectable
     bool name_active() const { return name_connected; }
 
     // Default sizes, font and spacing
-    static Pango::FontDescription NAME_FONT ;
+    static Pango::FontDescription* NAME_FONT ;
     static bool have_name_font;
     static const double NAME_X_OFFSET ;
     static const double GRAB_HANDLE_LENGTH ;
@@ -294,6 +298,7 @@ class TimeAxisViewItem : public Selectable
      * the destructor, this allows us to capture the source of the deletion
      * event
      */
+
     sigc::signal<void,std::string,void*> ItemRemoved ;
     
     /** Emitted when the name/Id of this item is changed */
@@ -314,8 +319,6 @@ class TimeAxisViewItem : public Selectable
     /** Emitted when the mionimum item duration is changed */
     sigc::signal<void,nframes_t,void*> MinDurationChanged ;
     
-  protected:
-    
     enum Visibility {
            ShowFrame = 0x1,
            ShowNameHighlight = 0x2,
@@ -326,7 +329,7 @@ class TimeAxisViewItem : public Selectable
            HideFrameTB = 0x40,
            FullWidthNameHighlight = 0x80
     };
-
+  protected:
     /**
      * Constructs a new TimeAxisViewItem.
      *
@@ -339,7 +342,11 @@ class TimeAxisViewItem : public Selectable
      * @param duration the duration of this item
      */
     TimeAxisViewItem(const std::string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color, 
-                    nframes_t start, nframes_t duration, Visibility v = Visibility (0));
+                    nframes_t start, nframes_t duration, bool recording = false, Visibility v = Visibility (0));
+
+    TimeAxisViewItem (const TimeAxisViewItem& other);
+
+    void init (const std::string& it_name, double spu, Gdk::Color& base_color, nframes_t start, nframes_t duration, Visibility vis);
     
     /**
      * Calculates some contrasting color for displaying various parts of this item, based upon the base color
@@ -356,7 +363,7 @@ class TimeAxisViewItem : public Selectable
     /**
      * Sets the frame color depending on whether this item is selected
      */
-    void set_frame_color() ;
+    virtual void set_frame_color() ;
     
     /**
      * Sets the colors of the start and end trim handle depending on object state
@@ -409,6 +416,9 @@ class TimeAxisViewItem : public Selectable
 
     /** should the item show its selected status */
     bool should_show_selection;
+
+    /** should the item respond to events */
+    bool _sensitive;
     
     /**
      * The unique item name of this Item
@@ -452,7 +462,14 @@ class TimeAxisViewItem : public Selectable
     ArdourCanvas::SimpleRect* frame_handle_start;
     ArdourCanvas::SimpleRect* frame_handle_end;
 
+    int name_text_width;
+    double last_name_text_width;
+
+    std::map<Glib::ustring::size_type,int> name_text_size_cache;
+    
     Visibility visibility;
+       bool _recregion;
+
 
 }; /* class TimeAxisViewItem */