2 * Copyright (C) 2016 Paul Davis
3 * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef _ardour_maschine2_canvas_h_
21 #define _ardour_maschine2_canvas_h_
23 #include <cairomm/refptr.h>
24 #include <glibmm/threads.h>
26 #include "canvas/canvas.h"
34 namespace ArdourSurface {
39 /* A canvas which renders to the Push2 display */
41 class Maschine2Canvas : public ArdourCanvas::Canvas
44 Maschine2Canvas (Maschine2&, M2Device*);
47 void request_redraw ();
48 void request_redraw (ArdourCanvas::Rect const &);
51 Cairo::RefPtr<Cairo::Context> image_context() { return context; }
53 ArdourCanvas::Coord width() const { return _width; }
54 ArdourCanvas::Coord height() const { return _height; }
56 void request_size (ArdourCanvas::Duple);
57 ArdourCanvas::Rect visible_area () const;
59 /* API that does nothing since we have no input events */
61 void grab (ArdourCanvas::Item*) {}
62 void focus (ArdourCanvas::Item*) {}
63 void unfocus (ArdourCanvas::Item*) {}
65 void pick_current_item (int) {}
66 void pick_current_item (ArdourCanvas::Duple const &, int) {}
67 bool get_mouse_position (ArdourCanvas::Duple&) const { return false; }
69 Glib::RefPtr<Pango::Context> get_pango_context ();
75 Cairo::RefPtr<Cairo::Context> context;
76 Cairo::RefPtr<Cairo::Region> expose_region;
77 Glib::RefPtr<Pango::Context> pango_context;
80 PBD::ScopedConnection vblank_connections;
85 } /* namespace ArdourSurface */