mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
new API for TrackingText and similar items
This commit is contained in:
parent
ae4c4c8f90
commit
3accf1d2af
2 changed files with 43 additions and 0 deletions
|
|
@ -767,6 +767,28 @@ GtkCanvas::on_button_release_event (GdkEventButton* ev)
|
|||
return deliver_event (reinterpret_cast<GdkEvent*>(©));
|
||||
}
|
||||
|
||||
bool
|
||||
GtkCanvas::get_mouse_position (Duple& winpos) const
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
Gdk::ModifierType mask;
|
||||
Glib::RefPtr<Gdk::Window> self = Glib::RefPtr<Gdk::Window>::cast_const (get_window ());
|
||||
|
||||
if (!self) {
|
||||
std::cerr << " no self window\n";
|
||||
winpos = Duple (0, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
Glib::RefPtr<Gdk::Window> win = self->get_pointer (x, y, mask);
|
||||
|
||||
winpos.x = x;
|
||||
winpos.y = y;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Handler for GDK motion events.
|
||||
* @param ev Event.
|
||||
* @return true if the event was handled.
|
||||
|
|
@ -788,6 +810,8 @@ GtkCanvas::on_motion_notify_event (GdkEventMotion* ev)
|
|||
|
||||
DEBUG_TRACE (PBD::DEBUG::CanvasEvents, string_compose ("canvas motion @ %1, %2 canvas @ %3, %4\n", ev->x, ev->y, copy.motion.x, copy.motion.y));
|
||||
|
||||
MouseMotion (point); /* EMIT SIGNAL */
|
||||
|
||||
pick_current_item (point, ev->state);
|
||||
|
||||
/* Now deliver the motion event. It may seem a little inefficient
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue