diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-30 23:36:30 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-10-30 23:36:30 -0400 |
commit | 7bbd28aa08593f2c5e72b86090128d584edf184b (patch) | |
tree | 6d7a96c24b420838d6104c828293ed02d52e8f54 /libs/canvas/canvas/canvas.h | |
parent | 006ba7cd3640c65a4bc5cd5d2bfc22ffc47d1673 (diff) |
notable changes to try to improve most of enter/leave handling for canvas items
Diffstat (limited to 'libs/canvas/canvas/canvas.h')
-rw-r--r-- | libs/canvas/canvas/canvas.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/libs/canvas/canvas/canvas.h b/libs/canvas/canvas/canvas.h index e65abf6b27..0575685832 100644 --- a/libs/canvas/canvas/canvas.h +++ b/libs/canvas/canvas/canvas.h @@ -24,11 +24,14 @@ #ifndef __CANVAS_CANVAS_H__ #define __CANVAS_CANVAS_H__ +#include <set> + #include <gdkmm/window.h> #include <gtkmm/eventbox.h> #include <gtkmm/alignment.h> #include <cairomm/surface.h> #include <cairomm/context.h> + #include "pbd/signals.h" #include "canvas/root_group.h" @@ -63,6 +66,11 @@ public: /** called to ask the canvas' host to `ungrab' any grabbed item */ virtual void ungrab () = 0; + /** called to ask the canvas' host to keyboard focus on an item */ + virtual void focus (Item *) = 0; + /** called to ask the canvas' host to drop keyboard focus on an item */ + virtual void unfocus (Item*) = 0; + void render (Rect const &, Cairo::RefPtr<Cairo::Context> const &) const; /** @return root group */ @@ -126,6 +134,8 @@ public: void request_size (Duple); void grab (Item *); void ungrab (); + void focus (Item *); + void unfocus (Item*); Cairo::RefPtr<Cairo::Context> context (); @@ -136,6 +146,8 @@ protected: bool on_button_press_event (GdkEventButton *); bool on_button_release_event (GdkEventButton* event); bool on_motion_notify_event (GdkEventMotion *); + bool on_enter_notify_event (GdkEventCrossing*); + bool on_leave_notify_event (GdkEventCrossing*); bool button_handler (GdkEventButton *); bool motion_notify_handler (GdkEventMotion *); @@ -148,11 +160,12 @@ private: void item_going_away (Item *, boost::optional<Rect>); bool send_leave_event (Item const *, double, double) const; - - /** the item that the mouse is currently over, or 0 */ - Item const * _current_item; + /** Items that the pointer is currently within */ + std::set<Item const *> within_items; /** the item that is currently grabbed, or 0 */ Item const * _grabbed_item; + /** the item that currently has key focus or 0 */ + Item const * _focused_item; }; /** A GTK::Alignment with a GtkCanvas inside it plus some Gtk::Adjustments for |