2016-07-10 10:49:39 -04:00
|
|
|
/*
|
2019-08-03 08:34:29 -04:00
|
|
|
* Copyright (C) 2016 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2016-09-16 09:39:28 -04:00
|
|
|
#include "canvas.h"
|
2016-07-10 12:38:36 -04:00
|
|
|
#include "layout.h"
|
2016-07-10 10:49:39 -04:00
|
|
|
#include "push2.h"
|
|
|
|
|
2016-09-28 17:24:14 -04:00
|
|
|
#ifdef __APPLE__
|
|
|
|
#define Rect ArdourCanvas::Rect
|
|
|
|
#endif
|
|
|
|
|
2016-07-10 10:49:39 -04:00
|
|
|
using namespace ARDOUR;
|
|
|
|
using namespace ArdourSurface;
|
2016-09-16 09:39:28 -04:00
|
|
|
using namespace ArdourCanvas;
|
2016-07-10 10:49:39 -04:00
|
|
|
|
2016-09-27 15:31:17 -04:00
|
|
|
Push2Layout::Push2Layout (Push2& p, Session& s, std::string const & name)
|
2016-09-16 09:39:28 -04:00
|
|
|
: Container (p.canvas())
|
2021-06-18 16:33:32 -04:00
|
|
|
, _p2 (p)
|
|
|
|
, _session (s)
|
2016-09-27 15:31:17 -04:00
|
|
|
, _name (name)
|
2016-07-10 10:49:39 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Push2Layout::~Push2Layout ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-09-16 09:39:28 -04:00
|
|
|
void
|
|
|
|
Push2Layout::compute_bounding_box () const
|
2016-07-10 10:49:39 -04:00
|
|
|
{
|
2016-09-16 09:39:28 -04:00
|
|
|
/* 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());
|
2022-04-27 00:03:55 -04:00
|
|
|
set_bbox_clean ();
|
2016-09-16 09:39:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
Push2Layout::display_height() const
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
return _p2.canvas()->rows();
|
2016-09-16 09:39:28 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
Push2Layout::display_width() const
|
|
|
|
{
|
2021-06-18 16:33:32 -04:00
|
|
|
return _p2.canvas()->cols();
|
2016-07-10 10:49:39 -04:00
|
|
|
}
|