summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view_item.h
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/time_axis_view_item.h')
-rw-r--r--gtk2_ardour/time_axis_view_item.h54
1 files changed, 33 insertions, 21 deletions
diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h
index 3985b8ffd8..60ff519216 100644
--- a/gtk2_ardour/time_axis_view_item.h
+++ b/gtk2_ardour/time_axis_view_item.h
@@ -21,17 +21,22 @@
#define __gtk_ardour_time_axis_view_item_h__
#include <string>
-
-#include <libgnomecanvasmm/pixbuf.h>
-
+#include <gdk/gdk.h>
+#include <gdkmm/color.h>
+#include <pangomm/fontdescription.h>
#include "pbd/signals.h"
-
#include "selectable.h"
-#include "simplerect.h"
-#include "canvas.h"
class TimeAxisView;
+namespace ArdourCanvas {
+ class Pixbuf;
+ class Rectangle;
+ class Item;
+ class Group;
+ class Text;
+}
+
using ARDOUR::framepos_t;
using ARDOUR::framecnt_t;
@@ -69,14 +74,15 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
void set_y (double);
void set_color (Gdk::Color const &);
+ uint32_t get_fill_color () const;
+
ArdourCanvas::Item* get_canvas_frame();
ArdourCanvas::Group* get_canvas_group();
ArdourCanvas::Item* get_name_highlight();
- ArdourCanvas::Pixbuf* get_name_pixbuf();
- virtual void set_samples_per_unit(double spu);
+ virtual void set_samples_per_pixel (double);
- double get_samples_per_unit();
+ double get_samples_per_pixel () const;
virtual void drag_start() { _dragging = true; }
virtual void drag_end() { _dragging = false; }
@@ -153,16 +159,17 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
TimeAxisViewItem (const TimeAxisViewItem&);
- void init (const std::string&, double, Gdk::Color const &, framepos_t, framepos_t, Visibility, bool, bool);
+ void init (ArdourCanvas::Group*, double, Gdk::Color const &, framepos_t, framepos_t, Visibility, bool, bool);
+
+ virtual bool canvas_group_event (GdkEvent*);
virtual void compute_colors (Gdk::Color const &);
virtual void set_colors();
virtual void set_frame_color();
+ virtual void set_frame_gradient ();
void set_trim_handle_colors();
virtual void reset_width_dependent_items (double);
- void reset_name_width (double);
- void update_name_pixbuf_visibility ();
static gint idle_remove_this_item(TimeAxisViewItem*, void*);
@@ -190,8 +197,8 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
/** indicates whether the min duration constraint is active */
bool min_duration_active;
- /** samples per canvas unit */
- double samples_per_unit;
+ /** frames per canvas pixel */
+ double samples_per_pixel;
/** should the item respond to events */
bool _sensitive;
@@ -225,20 +232,22 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
uint32_t lock_handle_color_g;
uint32_t lock_handle_color_b;
uint32_t last_item_width;
- int name_pixbuf_width;
+ int name_text_width;
bool wide_enough_for_name;
bool high_enough_for_name;
bool rect_visible;
ArdourCanvas::Group* group;
- ArdourCanvas::SimpleRect* vestigial_frame;
- ArdourCanvas::SimpleRect* frame;
- ArdourCanvas::Pixbuf* name_pixbuf;
- ArdourCanvas::SimpleRect* name_highlight;
+ ArdourCanvas::Rectangle* vestigial_frame;
+ ArdourCanvas::Rectangle* frame;
+ ArdourCanvas::Text* name_text;
+ ArdourCanvas::Rectangle* name_highlight;
/* with these two values, if frame_handle_start == 0 then frame_handle_end will also be 0 */
- ArdourCanvas::SimpleRect* frame_handle_start; ///< `frame' (fade) handle for the start of the item, or 0
- ArdourCanvas::SimpleRect* frame_handle_end; ///< `frame' (fade) handle for the end of the item, or 0
+ ArdourCanvas::Rectangle* frame_handle_start; ///< `frame' (fade) handle for the start of the item, or 0
+ ArdourCanvas::Rectangle* frame_handle_end; ///< `frame' (fade) handle for the end of the item, or 0
+
+ bool frame_handle_crossing (GdkEvent*, ArdourCanvas::Rectangle*);
double _height;
Visibility visibility;
@@ -247,8 +256,11 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
bool _dragging;
private:
+ double _width;
void parameter_changed (std::string);
+ void manage_name_highlight ();
+ void manage_name_text ();
}; /* class TimeAxisViewItem */