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>
19
#ifndef MIR_GEOMETRY_RECTANGLES_H_
20
#define MIR_GEOMETRY_RECTANGLES_H_
23
#include "rectangle.h"
26
#include <initializer_list>
37
Rectangles(std::initializer_list<Rectangle> const& rects);
38
/* We want to keep implicit copy and move methods */
40
void add(Rectangle const& rect);
42
Rectangle bounding_rectangle() const;
43
void confine(Point& point) const;
45
typedef std::vector<Rectangle>::const_iterator const_iterator;
46
typedef std::vector<Rectangle>::size_type size_type;
47
const_iterator begin() const;
48
const_iterator end() const;
49
size_type size() const;
51
bool operator==(Rectangles const& rect) const;
52
bool operator!=(Rectangles const& rect) const;
55
std::vector<Rectangle> rectangles;
56
Rectangle bounding_rectangle_;
60
std::ostream& operator<<(std::ostream& out, Rectangles const& value);
65
#endif /* MIR_GEOMETRY_RECTANGLES_H_ */