2
* Copyright © 2013 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3,
6
* as published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
18
* XXX This header is only used externally in one location in QtMir. It could
19
* possibly be made private with only minor changes.
22
#ifndef MIR_GEOMETRY_RECTANGLES_H_
23
#define MIR_GEOMETRY_RECTANGLES_H_
25
#include "mir/geometry/point.h"
26
#include "mir/geometry/rectangle.h"
29
#include <initializer_list>
40
Rectangles(std::initializer_list<Rectangle> const& rects);
41
/* We want to keep implicit copy and move methods */
43
void add(Rectangle const& rect);
45
Rectangle bounding_rectangle() const;
46
void confine(Point& point) const;
48
typedef std::vector<Rectangle>::const_iterator const_iterator;
49
typedef std::vector<Rectangle>::size_type size_type;
50
const_iterator begin() const;
51
const_iterator end() const;
52
size_type size() const;
54
bool operator==(Rectangles const& rect) const;
55
bool operator!=(Rectangles const& rect) const;
58
std::vector<Rectangle> rectangles;
59
Rectangle bounding_rectangle_;
63
std::ostream& operator<<(std::ostream& out, Rectangles const& value);
68
#endif /* MIR_GEOMETRY_RECTANGLES_H_ */