namespace ArdourCanvas
{
+struct Rect;
-class Rect;
class Item;
class ScrollGroup;
virtual Coord width () const = 0;
virtual Coord height () const = 0;
+ /** Store the coordinates of the mouse pointer in window coordinates in
+ @param winpos. Return true if the position was within the window,
+ false otherwise.
+ */
+ virtual bool get_mouse_position (Duple& winpos) const = 0;
+
+ /** Signal to be used by items that need to track the mouse position
+ within the window.
+ */
+ sigc::signal<void,Duple const&> MouseMotion;
+
+ /** Ensures that the position given by @param winpos (in window
+ coordinates) is within the current window area, possibly reduced by
+ @param border.
+ */
+ Duple clamp_to_window (Duple const& winpos, Duple border = Duple());
+
void zoomed();
std::string indent() const;
std::string render_indent() const;
void dump (std::ostream&) const;
+
+ /** Ask the canvas to pick the current item again, and generate
+ an enter event for it.
+ */
+ virtual void re_enter () = 0;
protected:
void queue_draw_item_area (Item *, Rect);
Coord width() const;
Coord height() const;
+ bool get_mouse_position (Duple& winpos) const;
+
+ void re_enter ();
+
protected:
+ bool on_scroll_event (GdkEventScroll *);
bool on_expose_event (GdkEventExpose *);
bool on_button_press_event (GdkEventButton *);
bool on_button_release_event (GdkEventButton* event);