diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-16 08:39:28 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-27 14:59:31 -0500 |
commit | 7c9f3acc60fb29a562d28d1f43a9e22298545bf1 (patch) | |
tree | 7418a4922ff7670d6ffc08dce39432afd1e5669c /libs/surfaces/push2/layout.cc | |
parent | 2810e5619a1926a286c6192143ada4973066efd8 (diff) |
first compiling and theoretically correct version of Push2 canvas display.
Not tested with device at this point
Diffstat (limited to 'libs/surfaces/push2/layout.cc')
-rw-r--r-- | libs/surfaces/push2/layout.cc | 27 |
1 files changed, 23 insertions, 4 deletions
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(); } |