Include gtkmm2ext/gtk_ui.h
[ardour.git] / gtk2_ardour / time_axis_view_item.h
index a1eff29c4b7986348bfba1fd5cb4d61e099aeef7..d33738cc8b55c397eb4b1a02df19289f8af6d785 100644 (file)
 #ifndef __gtk_ardour_time_axis_view_item_h__
 #define __gtk_ardour_time_axis_view_item_h__
 
-#include <sigc++/signal_system.h>
-#include <gtk-canvas.h>
+#include <sigc++/signal.h>
+
 #include <jack/jack.h>
 #include <string>
 
+#include <libgnomecanvasmm/text.h>
+
 #include "selectable.h"
+#include "simplerect.h"
+#include "canvas.h"
 
 class TimeAxisView;
 
@@ -34,7 +38,7 @@ class TimeAxisView;
  * A base class for 'items' that may appear upon a TimeAxisView
  *
  */
-class TimeAxisViewItem : public SigC::Object, public Selectable
+class TimeAxisViewItem : public sigc::trackable, public Selectable
 {
    public:
        virtual ~TimeAxisViewItem() ;
@@ -215,27 +219,28 @@ class TimeAxisViewItem : public SigC::Object, public Selectable
     /**
      * 
      */
-    void set_color(GdkColor& color) ;
+    void set_color(Gdk::Color& color) ;
     
     /**
      * 
      */
-    GtkCanvasItem* get_canvas_frame() ;
+    ArdourCanvas::Item* get_canvas_frame() ;
 
     /**
      * 
      */
-    GtkCanvasItem* get_canvas_group();
+    ArdourCanvas::Item* get_canvas_group();
 
     /**
      * 
      */
-    GtkCanvasItem* get_name_highlight();
+    ArdourCanvas::Item* get_name_highlight();
 
     /**
      * 
      */
-    GtkCanvasItem* get_name_text();
+    ArdourCanvas::Text* get_name_text();
+
 
     /**
      * Sets the samples per unit of this item.
@@ -264,7 +269,8 @@ class TimeAxisViewItem : public SigC::Object, public Selectable
     bool name_active() const { return name_connected; }
 
     // Default sizes, font and spacing
-    static std::string NAME_FONT ;
+    static Pango::FontDescription NAME_FONT ;
+    static bool have_name_font;
     static const double NAME_X_OFFSET ;
     static const double NAME_Y_OFFSET ;
     static const double NAME_HIGHLIGHT_SIZE ;
@@ -290,28 +296,28 @@ class TimeAxisViewItem : public SigC::Object, public Selectable
      * the destructor, this allows us to capture the source of the deletion
      * event
      */
-    SigC::Signal2<void,std::string,void*> ItemRemoved ;
+    sigc::signal<void,std::string,void*> ItemRemoved ;
     
     /** Emitted when the name/Id of this item is changed */
-    SigC::Signal3<void,std::string,std::string,void*> NameChanged ;
+    sigc::signal<void,std::string,std::string,void*> NameChanged ;
     
     /** Emiited when the position of this item changes */
-    SigC::Signal2<void,jack_nframes_t,void*> PositionChanged ;
+    sigc::signal<void,jack_nframes_t,void*> PositionChanged ;
     
     /** Emitted when the position lock of this item is changed */
-    SigC::Signal2<void,bool,void*> PositionLockChanged ;
+    sigc::signal<void,bool,void*> PositionLockChanged ;
     
     /** Emitted when the duration of this item changes */
-    SigC::Signal2<void,jack_nframes_t,void*> DurationChanged ;
+    sigc::signal<void,jack_nframes_t,void*> DurationChanged ;
     
     /** Emitted when the maximum item duration is changed */
-    SigC::Signal2<void,jack_nframes_t,void*> MaxDurationChanged ;
+    sigc::signal<void,jack_nframes_t,void*> MaxDurationChanged ;
     
     /** Emitted when the mionimum item duration is changed */
-    SigC::Signal2<void,jack_nframes_t,void*> MinDurationChanged ;
+    sigc::signal<void,jack_nframes_t,void*> MinDurationChanged ;
     
     /** Emitted when the selected status of this item changes */
-    SigC::Signal1<void, bool> Selected ;
+    sigc::signal<void, bool> Selected ;
     
 
   protected:
@@ -334,7 +340,7 @@ class TimeAxisViewItem : public SigC::Object, public Selectable
      * @param start the start point of this item
      * @param duration the duration of this item
      */
-    TimeAxisViewItem(std::string it_name, GtkCanvasGroup* parent, TimeAxisView& tv, double spu, GdkColor& base_color, 
+    TimeAxisViewItem(const std::string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color, 
                     jack_nframes_t start, jack_nframes_t duration, Visibility v = Visibility (0));
     
     /**
@@ -342,7 +348,7 @@ class TimeAxisViewItem : public SigC::Object, public Selectable
      *
      * @param color the base color of the item
      */
-    virtual void compute_colors(GdkColor& color) ;
+    virtual void compute_colors(Gdk::Color& color) ;
     
     /**
      * convenience method to set the various canvas item colors
@@ -440,13 +446,13 @@ class TimeAxisViewItem : public SigC::Object, public Selectable
     uint32_t lock_handle_color_g ;
     uint32_t lock_handle_color_b ;
     
-    GtkCanvasItem* group ;               /* the group */
-    GtkCanvasItem* vestigial_frame ;     /* simplerect */
-    GtkCanvasItem* frame ;               /* simplerect */
-    GtkCanvasItem* name_text ;           /* text */
-    GtkCanvasItem* name_highlight ;      /* simplerect */
-    GtkCanvasItem* frame_handle_start ;  /* simplerect */
-    GtkCanvasItem* frame_handle_end ;    /* simplerect */
+    ArdourCanvas::Group*      group;
+    ArdourCanvas::SimpleRect* vestigial_frame;
+    ArdourCanvas::SimpleRect* frame;
+    ArdourCanvas::Text*       name_text;
+    ArdourCanvas::SimpleRect* name_highlight;
+    ArdourCanvas::SimpleRect* frame_handle_start;
+    ArdourCanvas::SimpleRect* frame_handle_end;
 
 }; /* class TimeAxisViewItem */