From 7c9f3acc60fb29a562d28d1f43a9e22298545bf1 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 16 Sep 2016 08:39:28 -0500 Subject: first compiling and theoretically correct version of Push2 canvas display. Not tested with device at this point --- libs/surfaces/push2/layout.cc | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'libs/surfaces/push2/layout.cc') diff --git a/libs/surfaces/push2/layout.cc b/libs/surfaces/push2/layout.cc index f675e3ddbb..be5ff6fdaf 100644 --- a/libs/surfaces/push2/layout.cc +++ b/libs/surfaces/push2/layout.cc @@ -16,14 +16,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "canvas.h" #include "layout.h" #include "push2.h" using namespace ARDOUR; using namespace ArdourSurface; +using namespace ArdourCanvas; Push2Layout::Push2Layout (Push2& p, Session& s) - : p2 (p) + : Container (p.canvas()) + , p2 (p) , session (s) { } @@ -32,8 +35,24 @@ Push2Layout::~Push2Layout () { } -bool -Push2Layout::mapped () const +void +Push2Layout::compute_bounding_box () const { - return p2.current_layout() == this; + /* all layouts occupy at least the full screen, even if their combined + * child boxes do not. + */ + _bounding_box = Rect (0, 0, display_width(), display_height()); + _bounding_box_dirty = false; +} + +int +Push2Layout::display_height() const +{ + return p2.canvas()->rows(); +} + +int +Push2Layout::display_width() const +{ + return p2.canvas()->cols(); } -- cgit v1.2.3