mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 00:56:33 +01:00
Move NSGlView into libgtkmm2ext
This allows to re-use the concept with CairoWidget
This commit is contained in:
parent
b726255007
commit
b5e613d453
7 changed files with 91 additions and 41 deletions
|
|
@ -34,8 +34,9 @@
|
|||
|
||||
#include "pbd/signals.h"
|
||||
|
||||
#include "canvas/visibility.h"
|
||||
#include "gtkmm2ext/cairo_canvas.h"
|
||||
|
||||
#include "canvas/visibility.h"
|
||||
#include "canvas/root_group.h"
|
||||
|
||||
namespace Gtk {
|
||||
|
|
@ -174,7 +175,7 @@ public:
|
|||
};
|
||||
|
||||
/** A canvas which renders onto a GTK EventBox */
|
||||
class LIBCANVAS_API GtkCanvas : public Canvas, public Gtk::EventBox
|
||||
class LIBCANVAS_API GtkCanvas : public Canvas, public Gtk::EventBox, public Gtkmm2ext::CairoCanvas
|
||||
{
|
||||
public:
|
||||
GtkCanvas ();
|
||||
|
|
@ -203,6 +204,14 @@ public:
|
|||
|
||||
Glib::RefPtr<Pango::Context> get_pango_context();
|
||||
|
||||
void render (Cairo::RefPtr<Cairo::Context> const & ctx, cairo_rectangle_t* r)
|
||||
{
|
||||
ArdourCanvas::Rect rect (r->x, r->y, r->width + r->x, r->height + r->y);
|
||||
Canvas::render (rect, ctx);
|
||||
}
|
||||
|
||||
uint32_t background_color() { return Canvas::background_color (); }
|
||||
|
||||
protected:
|
||||
void on_size_allocate (Gtk::Allocation&);
|
||||
bool on_scroll_event (GdkEventScroll *);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue