summaryrefslogtreecommitdiff
path: root/libs/canvas/canvas/item.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/canvas/canvas/item.h')
-rw-r--r--libs/canvas/canvas/item.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/libs/canvas/canvas/item.h b/libs/canvas/canvas/item.h
index e856c7e149..da061f5bfc 100644
--- a/libs/canvas/canvas/item.h
+++ b/libs/canvas/canvas/item.h
@@ -28,6 +28,7 @@
#include "pbd/signals.h"
+#include "canvas/visibility.h"
#include "canvas/types.h"
namespace ArdourCanvas
@@ -48,7 +49,7 @@ class Rect;
* and all except the `root group' have a pointer to their parent group.
*/
-class Item
+class LIBCANVAS_API Item
{
public:
Item (Canvas *);
@@ -56,6 +57,8 @@ public:
Item (Group *, Duple);
virtual ~Item ();
+ void redraw () const;
+
/** Render this item to a Cairo context.
* @param area Area to draw, in **window** coordinates
*
@@ -73,6 +76,8 @@ public:
items.push_back (this);
}
+ virtual bool covers (Duple const &) const;
+
/** Update _bounding_box and _bounding_box_dirty */
virtual void compute_bounding_box () const = 0;
@@ -86,6 +91,21 @@ public:
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);
@@ -222,7 +242,7 @@ private:
bool _ignore_events;
};
-extern std::ostream& operator<< (std::ostream&, const ArdourCanvas::Item&);
+extern LIBCANVAS_API std::ostream& operator<< (std::ostream&, const ArdourCanvas::Item&);
}