#ifndef JUCI_TOOLTIPS_H_ #define JUCI_TOOLTIPS_H_ #include "gtkmm.h" #include #include class Tooltip { public: Tooltip(std::function()> get_buffer, Gtk::TextView& text_view, Glib::RefPtr start_mark, Glib::RefPtr end_mark); ~Tooltip(); void update(); void adjust(bool disregard_drawn=false); Gdk::Rectangle activation_rectangle; std::unique_ptr window; private: bool tooltip_on_motion_notify_event(GdkEventMotion* event); std::function()> get_buffer; std::unique_ptr tooltip_widget; Glib::RefPtr start_mark; Glib::RefPtr end_mark; Gtk::TextView& text_view; int tooltip_width, tooltip_height; }; class Tooltips : public std::list { public: static void init() {drawn_tooltips_rectangle=Gdk::Rectangle();} void show(const Gdk::Rectangle& rectangle, bool disregard_drawn=false); void show(bool disregard_drawn=false); void hide(); static Gdk::Rectangle drawn_tooltips_rectangle; }; #endif // JUCI_TOOLTIPS_H_