mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-14 02:26:39 +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 *);
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
#ifndef __CANVAS_NSGLVIEW_H__
|
||||
#define __CANVAS_NSGLVIEW_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
namespace ArdourCanvas
|
||||
{
|
||||
class GtkCanvas;
|
||||
|
||||
void* nsglview_create (GtkCanvas*);
|
||||
void nsglview_overlay (void*, GdkWindow*);
|
||||
void nsglview_resize (void*, int x, int y, int w, int h);
|
||||
void nsglview_queue_draw (void*, int x, int y, int w, int h);
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue