Fix thinkos in cubasish theme
[ardour.git] / gtk2_ardour / plugin_display.h
1 /*
2  * Copyright (C) 2017 Johannes Mueller <github@johannes-mueller.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18
19 #ifndef __ardour_plugin_display__
20 #define __ardour_plugin_display__
21
22 #include <gtkmm/drawingarea.h>
23
24 #include "ardour/plugin.h"
25
26 class PluginDisplay : public Gtk::DrawingArea
27 {
28 public:
29         PluginDisplay(boost::shared_ptr<ARDOUR::Plugin>, uint32_t max_height = 80);
30         virtual ~PluginDisplay();
31
32 protected:
33         bool on_expose_event (GdkEventExpose *);
34         void on_size_request (Gtk::Requisition* req);
35         bool on_button_press_event (GdkEventButton *ev);
36         bool on_button_release_event (GdkEventButton *ev);
37
38         void plugin_going_away () {
39                 _qdraw_connection.disconnect ();
40         }
41
42         virtual void update_height_alloc (uint32_t inline_height);
43         virtual uint32_t render_inline (cairo_t *, uint32_t width);
44
45         virtual void display_frame (cairo_t* cr, double w, double h);
46
47         boost::shared_ptr<ARDOUR::Plugin> _plug;
48         PBD::ScopedConnection _qdraw_connection;
49         PBD::ScopedConnection _death_connection;
50         cairo_surface_t* _surf;
51         uint32_t _max_height;
52         uint32_t _cur_height;
53         bool _scroll;
54 };
55
56 #endif