![]() |
Ardour
9.0-pre0-1454-gd1fd5452c9
|
#include <item.h>
Classes | |
struct | EventAccumulator |
Public Member Functions | |
Item (Canvas *) | |
Item (Item *) | |
Item (Item *, Duple const &p) | |
virtual | ~Item () |
void | redraw () const |
virtual void | render (Rect const &area, Cairo::RefPtr< Cairo::Context >) const =0 |
virtual void | prepare_for_render (Rect const &area) const |
virtual bool | needs_prepare_for_render () const |
virtual void | add_items_at_point (Duple point, std::vector< Item const * > &items) const |
virtual bool | covers (Duple const &point) const |
virtual void | compute_bounding_box () const =0 |
void | grab () |
void | ungrab () |
void | unparent () |
void | reparent (Item *, bool already_added=false) |
Item * | parent () const |
uint32_t | depth () const |
const Item * | closest_ancestor_with (const Item &other) const |
bool | common_ancestor_within (uint32_t, const Item &other) const |
bool | is_ancestor_of (const Item &candidate) const |
bool | is_descendant_of (const Item &candidate) const |
void | set_position (Duple) |
void | set_x_position (Coord) |
void | set_y_position (Coord) |
void | move (Duple) |
Duple | position () const |
Duple | window_origin () const |
Duple | canvas_origin () const |
ScrollGroup * | scroll_parent () const |
virtual void | size_request (double &w, double &h) const |
void | set_size_request (double w, double h) |
void | set_size_request_to_display_given_text (const std::vector< std::string > &strings, gint hpadding, gint vpadding) |
void | size_allocate (Rect const &) |
virtual void | _size_allocate (Rect const &) |
virtual void | size_allocate_children (Rect const &r) |
Rect | allocation () const |
void | set_layout_sensitive (bool) |
bool | layout_sensitive () const |
Rect | bounding_box () const |
Coord | height () const |
Coord | width () const |
Duple | item_to_parent (Duple const &) const |
Rect | item_to_parent (Rect const &) const |
Duple | parent_to_item (Duple const &) const |
Rect | parent_to_item (Rect const &) const |
void | canvas_to_item (Coord &, Coord &) const |
void | item_to_canvas (Coord &, Coord &) const |
Duple | canvas_to_item (Duple const &) const |
Rect | item_to_canvas (Rect const &) const |
Duple | item_to_canvas (Duple const &) const |
Rect | canvas_to_item (Rect const &) const |
Duple | item_to_window (Duple const &, bool rounded=true) const |
Duple | window_to_item (Duple const &) const |
Rect | item_to_window (Rect const &, bool rounded=true) const |
Rect | window_to_item (Rect const &) const |
void | raise_to_top () |
void | raise (int) |
void | lower_to_bottom () |
virtual void | hide () |
virtual void | show () |
void | block_change_notifications () |
void | unblock_change_notifications () |
bool | self_visible () const |
bool | visible () const |
Canvas * | canvas () const |
void | set_ignore_events (bool) |
bool | ignore_events () const |
void | set_data (std::string const &, void *) |
void * | get_data (std::string const &) const |
virtual void | add (Item *) |
virtual void | add_front (Item *) |
virtual void | remove (Item *) |
void | clear (bool with_delete=false) |
std::list< Item * > const & | items () const |
void | raise_child_to_top (Item *) |
void | raise_child (Item *, int) |
void | lower_child_to_bottom (Item *) |
virtual void | child_changed (bool bbox_changed) |
PackOptions | pack_options () const |
void | set_pack_options (PackOptions) |
std::string | whoami () const |
const std::string & | tooltip () const |
void | set_tooltip (const std::string &) |
void | start_tooltip_timeout () |
void | stop_tooltip_timeout () |
virtual void | dump (std::ostream &) const |
std::string | whatami () const |
bool | resize_queued () const |
void | queue_resize () |
bool | scroll_translation () const |
void | disable_scroll_translation () |
virtual void | layout () |
Duple | position_offset () const |
![]() | |
Fill (Item &self) | |
Fill (const Fill &)=delete | |
Fill & | operator= (const Fill &)=delete |
virtual | ~Fill () |
virtual void | set_fill_color (Gtkmm2ext::Color) |
virtual void | set_fill (bool) |
Gtkmm2ext::Color | fill_color () const |
bool | fill () const |
void | set_gradient (StopList const &stops, bool is_vertical) |
void | set_pattern (Cairo::RefPtr< Cairo::Pattern >) |
![]() | |
Outline (Item &self) | |
Outline (const Outline &)=delete | |
Outline & | operator= (const Outline &)=delete |
virtual | ~Outline () |
Gtkmm2ext::Color | outline_color () const |
virtual void | set_outline_color (Gtkmm2ext::Color) |
Distance | outline_width () const |
virtual void | set_outline_width (Distance) |
bool | outline () const |
virtual void | set_outline (bool) |
Public Attributes | |
sigc::signal1< bool, GdkEvent *, EventAccumulator< bool > > | Event |
bool | _resize_queued |
double | _requested_width |
double | _requested_height |
Static Public Attributes | |
static int | default_items_per_cell |
Protected Member Functions | |
void | begin_change () |
void | end_change () |
void | begin_visual_change () |
void | end_visual_change () |
void | set_bbox_clean () const |
void | set_bbox_dirty () const |
bool | bbox_dirty () const |
void | invalidate_lut () const |
void | clear_items (bool with_delete) |
void | ensure_lut () const |
void | add_child_bounding_boxes (bool include_hidden=false) const |
void | render_children (Rect const &area, Cairo::RefPtr< Cairo::Context > context) const |
void | prepare_for_render_children (Rect const &area) const |
Duple | scroll_offset () const |
![]() | |
void | setup_fill_context (Cairo::RefPtr< Cairo::Context >) const |
void | setup_gradient_context (Cairo::RefPtr< Cairo::Context >, Rect const &, Duple const &) const |
![]() | |
void | setup_outline_context (Cairo::RefPtr< Cairo::Context >) const |
Protected Attributes | |
Canvas * | _canvas |
Item * | _parent |
ScrollGroup * | _scroll_parent |
Duple | _position |
bool | _visible |
Rect | _pre_change_bounding_box |
Rect | _bounding_box |
PackOptions | _pack_options |
Rect | _allocation |
bool | _layout_sensitive |
std::map< std::string, void * > | _data |
LookupTable * | _lut |
std::list< Item * > | _items |
![]() | |
Item & | _self |
Gtkmm2ext::Color | _fill_color |
bool | _fill |
bool | _transparent |
StopList | _stops |
bool | _vertical_gradient |
Cairo::RefPtr< Cairo::Pattern > | _pattern |
![]() | |
Item & | _self |
Gtkmm2ext::Color | _outline_color |
Distance | _outline_width |
bool | _outline |
Private Member Functions | |
void | init () |
void | find_scroll_parent () |
void | propagate_show_hide () |
Private Attributes | |
std::string | _tooltip |
bool | _ignore_events |
bool | _scroll_translation |
bool | _bounding_box_dirty |
int | change_blocked |
Friends | |
class | Fill |
class | Outline |
Additional Inherited Members | |
![]() | |
typedef std::vector< std::pair< double, Gtkmm2ext::Color > > | StopList |
The parent class for anything that goes on the canvas.
Items have a position, which is expressed in the coordinates of the parent. They also have a bounding box, which describes the area in which they have drawable content, which is expressed in their own coordinates (whose origin is at the item position).
Any item that is being displayed on a canvas has a pointer to that canvas, and all except the ‘root group’ have a pointer to their parent group.
Definition at line 56 of file canvas/canvas/item.h.
ArdourCanvas::Item::Item | ( | Canvas * | ) |
ArdourCanvas::Item::Item | ( | Item * | ) |
|
virtual |
|
virtual |
Reimplemented in ArdourCanvas::Box, ArdourCanvas::Arc, ArdourCanvas::Widget, ArdourCanvas::Text, ArdourCanvas::Rectangle, CueMaster, TriggerBoxUI, TriggerEntry, TriggerMaster, CueBoxUI, and CueEntry.
|
virtual |
Reimplemented in ArdourCanvas::Table, and ArdourCanvas::Box.
|
protected |
|
virtual |
Reimplemented in ArdourCanvas::Table, and ArdourCanvas::Box.
|
virtual |
Adds one or more items to the vector items
based on their covering point
which is in window coordinates
Note that Item::add_items_at_window_point() is only intended to be called on items already looked up in a LookupTable (i.e. by a parent) and thus known to cover point
already.
Derived classes may add more items than themselves (e.g. containers).
|
inline |
Definition at line 159 of file canvas/canvas/item.h.
|
inlineprotected |
Definition at line 340 of file canvas/canvas/item.h.
|
protected |
To be called at the beginning of any property change that may alter the bounding box of this item
|
protected |
To be called at the beginning of any property change that does NOT alter the bounding box of this item
void ArdourCanvas::Item::block_change_notifications | ( | ) |
Rect ArdourCanvas::Item::bounding_box | ( | ) | const |
bounding box is the public API to get the area covered by the item (which may differ from its allocation). The returned Rect is in item coordinates (i.e. x0,y0 = 0,0 mean that the upper left corner of the bounding box is at the item's _position).
|
inline |
Definition at line 214 of file canvas/canvas/item.h.
Duple ArdourCanvas::Item::canvas_origin | ( | ) | const |
|
virtual |
Reimplemented in ArdourCanvas::Table, ArdourCanvas::Grid, and ArdourCanvas::Box.
void ArdourCanvas::Item::clear | ( | bool | with_delete = false | ) |
|
protected |
bool ArdourCanvas::Item::common_ancestor_within | ( | uint32_t | , |
const Item & | other | ||
) | const |
|
pure virtual |
Update _bounding_box and _bounding_box_dirty
Implemented in ArdourWaveView::WaveView, ArdourSurface::Push2Layout, ArdourSurface::Push2Knob, ArdourCanvas::FollowActionIcon, ArdourSurface::Maschine2Knob, ArdourSurface::Maschine2Layout, ArdourCanvas::XFadeCurve, ArdourCanvas::Widget, ArdourCanvas::Text, ArdourCanvas::Table, ArdourCanvas::StepButton, ArdourCanvas::StatefulImage, ArdourCanvas::Rectangle, ArdourCanvas::RectSet, ArdourCanvas::Polygon, ArdourCanvas::PolyLine, ArdourCanvas::PolyItem, ArdourCanvas::Pixbuf, ArdourCanvas::Meter, ArdourCanvas::Lollipop, ArdourCanvas::LineSet, ArdourCanvas::Line, ArdourCanvas::Image, ArdourCanvas::Grid, ArdourCanvas::FramedCurve, ArdourCanvas::Curve, ArdourCanvas::Container, ArdourCanvas::Button, ArdourCanvas::Box, ArdourCanvas::Arrow, ArdourCanvas::Arc, EndBoundaryRect, and StartBoundaryRect.
|
virtual |
Test if point is inside the item
point | The point is in window coordinates |
point
, false otherwise. Reimplemented in ArdourCanvas::RectSet, ArdourCanvas::Polygon, ArdourCanvas::PolyLine, ArdourCanvas::Lollipop, ArdourCanvas::LineSet, ArdourCanvas::Line, ArdourCanvas::Flag, ArdourCanvas::Curve, ArdourCanvas::Arrow, ArdourCanvas::Arc, EndBoundaryRect, and StartBoundaryRect.
uint32_t ArdourCanvas::Item::depth | ( | ) | const |
void ArdourCanvas::Item::disable_scroll_translation | ( | ) |
|
virtual |
Reimplemented in ArdourCanvas::Text, ArdourCanvas::Rectangle, and ArdourCanvas::PolyItem.
|
protected |
To be called at the endof any property change that may alter the bounding box of this item
|
protected |
To be called at the endof any property change that does NOT alter the bounding box of this item
|
protected |
|
private |
void* ArdourCanvas::Item::get_data | ( | std::string const & | ) | const |
void ArdourCanvas::Item::grab | ( | ) |
Coord ArdourCanvas::Item::height | ( | ) | const |
|
virtual |
Reimplemented in ArdourSurface::TrackMixLayout, and ArdourSurface::CueLayout.
|
inline |
Definition at line 219 of file canvas/canvas/item.h.
|
private |
|
protected |
|
inline |
returns true if this item is an ancestor of candidate
, and false otherwise.
Definition at line 126 of file canvas/canvas/item.h.
bool ArdourCanvas::Item::is_descendant_of | ( | const Item & | candidate | ) | const |
returns true if this Item is a descendant of candidate
, and false otherwise.
|
inline |
Definition at line 233 of file canvas/canvas/item.h.
|
virtual |
Reimplemented in ArdourCanvas::Table, and ArdourCanvas::Box.
|
inline |
Definition at line 161 of file canvas/canvas/item.h.
void ArdourCanvas::Item::lower_child_to_bottom | ( | Item * | ) |
void ArdourCanvas::Item::lower_to_bottom | ( | ) |
void ArdourCanvas::Item::move | ( | Duple | ) |
|
inlinevirtual |
Reimplemented in ArdourWaveView::WaveView.
Definition at line 85 of file canvas/canvas/item.h.
|
inline |
Definition at line 242 of file canvas/canvas/item.h.
|
inline |
Definition at line 115 of file canvas/canvas/item.h.
|
inline |
Definition at line 141 of file canvas/canvas/item.h.
Duple ArdourCanvas::Item::position_offset | ( | ) | const |
|
inlinevirtual |
Item has changed will be rendered in next render pass so give item a chance to perhaps schedule work in another thread etc.
area | Area to draw, in window coordinates |
Reimplemented in ArdourCanvas::Container, and ArdourWaveView::WaveView.
Definition at line 84 of file canvas/canvas/item.h.
|
protected |
|
private |
void ArdourCanvas::Item::queue_resize | ( | ) |
void ArdourCanvas::Item::raise | ( | int | ) |
void ArdourCanvas::Item::raise_child | ( | Item * | , |
int | |||
) |
void ArdourCanvas::Item::raise_child_to_top | ( | Item * | ) |
void ArdourCanvas::Item::raise_to_top | ( | ) |
void ArdourCanvas::Item::redraw | ( | ) | const |
|
virtual |
Reimplemented in ArdourCanvas::Table.
|
pure virtual |
Render this item to a Cairo context.
area | Area to draw, in window coordinates |
Items must convert their own coordinates into window coordinates because Cairo is limited to a fixed point coordinate space that does not extend as far as the Ardour timeline. All rendering must be done using coordinates that do not exceed the (rough) limits of the canvas' window, to avoid odd errors within Cairo as it converts doubles into its fixed point format and then tesselates the results.
Implemented in ArdourCanvas::XFadeCurve, ArdourCanvas::StatefulImage, ArdourCanvas::Ruler, ArdourCanvas::RectSet, ArdourCanvas::Polygon, ArdourCanvas::PolyLine, ArdourCanvas::Lollipop, ArdourCanvas::LineSet, ArdourCanvas::Line, ArdourCanvas::FramedCurve, ArdourCanvas::Curve, ArdourCanvas::Arc, ArdourCanvas::ScrollGroup, ArdourCanvas::Grid, ArdourCanvas::Container, ArdourCanvas::FollowActionIcon, ArdourCanvas::Widget, ArdourCanvas::Text, ArdourCanvas::StepButton, ArdourCanvas::Rectangle, ArdourCanvas::Pixbuf, ArdourCanvas::Note, ArdourCanvas::Image, ArdourCanvas::Button, ArdourWaveView::WaveView, ArdourCanvas::PianoRollHeader, ArdourSurface::Push2Menu, TriggerEntry, CueMaster, Loopster, EndBoundaryRect, StartBoundaryRect, CueEntry, ArdourSurface::TrackMixLayout, ArdourSurface::SplashLayout, ArdourSurface::ScaleLayout, ArdourSurface::MixLayout, ArdourSurface::Push2Knob, ArdourSurface::CueLayout, ArdourSurface::Maschine2Menu, ArdourSurface::Maschine2Knob, ArdourCanvas::Meter, TriggerMaster, SequencerStepIndicator, and StepView.
|
protected |
void ArdourCanvas::Item::reparent | ( | Item * | , |
bool | already_added = false |
||
) |
|
inline |
Definition at line 285 of file canvas/canvas/item.h.
|
protected |
|
inline |
Definition at line 148 of file canvas/canvas/item.h.
|
inline |
Definition at line 288 of file canvas/canvas/item.h.
|
inline |
Definition at line 207 of file canvas/canvas/item.h.
|
protected |
|
protected |
void ArdourCanvas::Item::set_data | ( | std::string const & | , |
void * | |||
) |
void ArdourCanvas::Item::set_ignore_events | ( | bool | ) |
void ArdourCanvas::Item::set_layout_sensitive | ( | bool | ) |
void ArdourCanvas::Item::set_pack_options | ( | PackOptions | ) |
void ArdourCanvas::Item::set_position | ( | Duple | ) |
void ArdourCanvas::Item::set_size_request | ( | double | w, |
double | h | ||
) |
void ArdourCanvas::Item::set_size_request_to_display_given_text | ( | const std::vector< std::string > & | strings, |
gint | hpadding, | ||
gint | vpadding | ||
) |
void ArdourCanvas::Item::set_tooltip | ( | const std::string & | ) |
void ArdourCanvas::Item::set_x_position | ( | Coord | ) |
void ArdourCanvas::Item::set_y_position | ( | Coord | ) |
|
virtual |
Reimplemented in ArdourSurface::TrackMixLayout, ArdourSurface::ScaleLayout, ArdourSurface::MixLayout, and ArdourSurface::CueLayout.
void ArdourCanvas::Item::size_allocate | ( | Rect const & | ) |
|
virtual |
Reimplemented in ArdourCanvas::Table, and ArdourCanvas::Box.
|
virtual |
Reimplemented in ArdourCanvas::Table, ArdourCanvas::Rectangle, ArdourCanvas::Box, ArdourCanvas::PianoRollHeader, and ArdourCanvas::Root.
void ArdourCanvas::Item::start_tooltip_timeout | ( | ) |
void ArdourCanvas::Item::stop_tooltip_timeout | ( | ) |
|
inline |
Definition at line 276 of file canvas/canvas/item.h.
void ArdourCanvas::Item::unblock_change_notifications | ( | ) |
void ArdourCanvas::Item::ungrab | ( | ) |
void ArdourCanvas::Item::unparent | ( | ) |
bool ArdourCanvas::Item::visible | ( | ) | const |
std::string ArdourCanvas::Item::whatami | ( | ) | const |
|
inline |
Definition at line 273 of file canvas/canvas/item.h.
Coord ArdourCanvas::Item::width | ( | ) | const |
Duple ArdourCanvas::Item::window_origin | ( | ) | const |
|
friend |
Definition at line 302 of file canvas/canvas/item.h.
|
friend |
Definition at line 303 of file canvas/canvas/item.h.
|
protected |
Definition at line 342 of file canvas/canvas/item.h.
|
mutableprotected |
our bounding box; may be out of date if _bounding_box_dirty is true
Definition at line 335 of file canvas/canvas/item.h.
|
mutableprivate |
true if _bounding_box might be out of date, false if its definitely not
Definition at line 377 of file canvas/canvas/item.h.
|
protected |
Definition at line 322 of file canvas/canvas/item.h.
|
protected |
Definition at line 346 of file canvas/canvas/item.h.
|
private |
Definition at line 374 of file canvas/canvas/item.h.
|
protected |
Definition at line 356 of file canvas/canvas/item.h.
|
protected |
Definition at line 343 of file canvas/canvas/item.h.
|
mutableprotected |
Definition at line 354 of file canvas/canvas/item.h.
|
protected |
Definition at line 336 of file canvas/canvas/item.h.
|
protected |
parent group; may be 0 if we are the root group or if we have been unparent()ed
Definition at line 324 of file canvas/canvas/item.h.
|
protected |
position of this item in parent coordinates
Definition at line 328 of file canvas/canvas/item.h.
|
protected |
our bounding box before any change that is currently in progress
Definition at line 332 of file canvas/canvas/item.h.
double ArdourCanvas::Item::_requested_height |
Definition at line 368 of file canvas/canvas/item.h.
double ArdourCanvas::Item::_requested_width |
Definition at line 367 of file canvas/canvas/item.h.
bool ArdourCanvas::Item::_resize_queued |
Definition at line 366 of file canvas/canvas/item.h.
|
protected |
scroll parent group; may be 0 if we are the root group or if we have been unparent()ed
Definition at line 326 of file canvas/canvas/item.h.
|
private |
Definition at line 375 of file canvas/canvas/item.h.
|
private |
Definition at line 373 of file canvas/canvas/item.h.
|
protected |
true if this item is visible (ie to be drawn), otherwise false
Definition at line 330 of file canvas/canvas/item.h.
|
private |
Definition at line 382 of file canvas/canvas/item.h.
|
static |
Definition at line 245 of file canvas/canvas/item.h.
sigc::signal1<bool, GdkEvent*, EventAccumulator<bool> > ArdourCanvas::Item::Event |
Definition at line 267 of file canvas/canvas/item.h.