X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Ftime_axis_view_item.h;h=19bf84b1bc516eab10fd2e4d48ed91c49e6c47c8;hb=306647b1d0751bdf39ca45986918240b7892011f;hp=60ff519216224e9732414871af4908a8b971d4eb;hpb=316973d7c7bc99bfef6367d42009883d0de2abbd;p=ardour.git diff --git a/gtk2_ardour/time_axis_view_item.h b/gtk2_ardour/time_axis_view_item.h index 60ff519216..19bf84b1bc 100644 --- a/gtk2_ardour/time_axis_view_item.h +++ b/gtk2_ardour/time_axis_view_item.h @@ -33,8 +33,8 @@ namespace ArdourCanvas { class Pixbuf; class Rectangle; class Item; - class Group; - class Text; + class Container; + class Text; } using ARDOUR::framepos_t; @@ -71,21 +71,23 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList TimeAxisView& get_time_axis_view () const; void set_name_text(const std::string&); virtual void set_height(double h); + virtual double height() const { return _height; } void set_y (double); - void set_color (Gdk::Color const &); + void set_color (uint32_t); + void set_name_text_color (); - uint32_t get_fill_color () const; + virtual uint32_t get_fill_color () const; ArdourCanvas::Item* get_canvas_frame(); - ArdourCanvas::Group* get_canvas_group(); + ArdourCanvas::Item* get_canvas_group(); ArdourCanvas::Item* get_name_highlight(); virtual void set_samples_per_pixel (double); double get_samples_per_pixel () const; - virtual void drag_start() { _dragging = true; } - virtual void drag_end() { _dragging = false; } + virtual void drag_start(); + virtual void drag_end(); bool dragging() const { return _dragging; } virtual void raise () { return; } @@ -93,9 +95,6 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList virtual void lower () { return; } virtual void lower_to_bottom () { return; } - virtual void hide_rect (); - virtual void show_rect (); - /** @return true if the name area should respond to events */ bool name_active() const { return name_connected; } @@ -154,16 +153,15 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList }; protected: - TimeAxisViewItem(const std::string &, ArdourCanvas::Group&, TimeAxisView&, double, Gdk::Color const &, - framepos_t, framecnt_t, bool recording = false, bool automation = false, Visibility v = Visibility (0)); + TimeAxisViewItem (const std::string &, ArdourCanvas::Item&, TimeAxisView&, double, uint32_t fill_color, + framepos_t, framecnt_t, bool recording = false, bool automation = false, Visibility v = Visibility (0)); TimeAxisViewItem (const TimeAxisViewItem&); - void init (ArdourCanvas::Group*, double, Gdk::Color const &, framepos_t, framepos_t, Visibility, bool, bool); + void init (ArdourCanvas::Item*, double, uint32_t, framepos_t, framepos_t, Visibility, bool, bool); - virtual bool canvas_group_event (GdkEvent*); + 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 (); @@ -212,34 +210,16 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList /** true if the name should respond to events */ bool name_connected; - /** true if a small vestigial rect should be shown when the item gets very narrow */ - bool show_vestigial; - - uint32_t fill_opacity; uint32_t fill_color; - uint32_t frame_color_r; - uint32_t frame_color_g; - uint32_t frame_color_b; - uint32_t selected_frame_color_r; - uint32_t selected_frame_color_g; - uint32_t selected_frame_color_b; - uint32_t label_color; - - uint32_t handle_color_r; - uint32_t handle_color_g; - uint32_t handle_color_b; - uint32_t lock_handle_color_r; - uint32_t lock_handle_color_g; - uint32_t lock_handle_color_b; + uint32_t last_item_width; int name_text_width; bool wide_enough_for_name; bool high_enough_for_name; - bool rect_visible; - ArdourCanvas::Group* group; - ArdourCanvas::Rectangle* vestigial_frame; + ArdourCanvas::Container* group; ArdourCanvas::Rectangle* frame; + ArdourCanvas::Rectangle* selection_frame; ArdourCanvas::Text* name_text; ArdourCanvas::Rectangle* name_highlight; @@ -247,20 +227,20 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList 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*); + bool frame_handle_crossing (GdkEvent*, ArdourCanvas::Rectangle*); double _height; Visibility visibility; + std::string fill_color_name; bool _recregion; bool _automation; ///< true if this is an automation region view bool _dragging; - -private: double _width; +private: void parameter_changed (std::string); - void manage_name_highlight (); - void manage_name_text (); + void manage_name_highlight (); + void manage_name_text (); }; /* class TimeAxisViewItem */