#include "pbd/signals.h"
+#include "canvas/visibility.h"
#include "canvas/types.h"
namespace ArdourCanvas
* and all except the `root group' have a pointer to their parent group.
*/
-class Item
+class LIBCANVAS_API Item
{
public:
Item (Canvas *);
Item (Group *, Duple);
virtual ~Item ();
+ void redraw () const;
+
/** Render this item to a Cairo context.
* @param area Area to draw, in **window** coordinates
*
items.push_back (this);
}
+ virtual bool covers (Duple const &) const;
+
/** Update _bounding_box and _bounding_box_dirty */
virtual void compute_bounding_box () const = 0;
Group* parent () const {
return _parent;
}
+
+ uint32_t depth() const;
+ const Item* closest_ancestor_with (const Item& other) const;
+ bool common_ancestor_within (uint32_t, const Item& other) const;
+
+ /** returns true if this item is an ancestor of @param candidate,
+ * and false otherwise.
+ */
+ bool is_ancestor_of (const Item& candidate) const {
+ return candidate.is_descendant_of (*this);
+ }
+ /** returns true if this Item is a descendant of @param candidate,
+ * and false otherwise.
+ */
+ bool is_descendant_of (const Item& candidate) const;
void set_position (Duple);
void set_x_position (Coord);
bool _ignore_events;
};
-extern std::ostream& operator<< (std::ostream&, const ArdourCanvas::Item&);
+extern LIBCANVAS_API std::ostream& operator<< (std::ostream&, const ArdourCanvas::Item&);
}