You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1009 B

#ifndef JUCI_TOOLTIPS_H_
#define JUCI_TOOLTIPS_H_
#include "gtkmm.h"
#include <string>
#include <list>
11 years ago
class Tooltip {
public:
11 years ago
Tooltip(std::function<Glib::RefPtr<Gtk::TextBuffer>()> get_buffer, Gtk::TextView& text_view, Glib::RefPtr<Gtk::TextBuffer::Mark> start_mark, Glib::RefPtr<Gtk::TextBuffer::Mark> end_mark);
~Tooltip();
void update();
void adjust();
Gdk::Rectangle activation_rectangle;
11 years ago
std::unique_ptr<Gtk::Window> window;
private:
11 years ago
std::function<Glib::RefPtr<Gtk::TextBuffer>()> get_buffer;
std::unique_ptr<Gtk::TextView> tooltip_widget;
Glib::RefPtr<Gtk::TextBuffer::Mark> start_mark;
Glib::RefPtr<Gtk::TextBuffer::Mark> end_mark;
Gtk::TextView& text_view;
int tooltip_width, tooltip_height;
};
class Tooltips : public std::list<Tooltip> {
public:
void init() {drawn_tooltips_rectangle=Gdk::Rectangle();}
void show(const Gdk::Rectangle& rectangle);
void show();
void hide();
static Gdk::Rectangle drawn_tooltips_rectangle;
};
#endif // JUCI_TOOLTIPS_H_