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_GRAPHICS_MESA_OVERLAPPING_OUTPUT_GROUPING_H_
20
#define MIR_GRAPHICS_MESA_OVERLAPPING_OUTPUT_GROUPING_H_
34
class DisplayConfiguration;
35
struct DisplayConfigurationOutput;
40
class OverlappingOutputGroup
43
template <typename Iterator>
44
OverlappingOutputGroup(Iterator begin, Iterator end) : outputs(begin, end) {}
45
OverlappingOutputGroup(OverlappingOutputGroup const&) = default;
46
OverlappingOutputGroup& operator=(OverlappingOutputGroup const&) = default;
48
geometry::Rectangle bounding_rectangle() const;
49
void for_each_output(std::function<void(DisplayConfigurationOutput const&)> const& f) const;
52
std::vector<DisplayConfigurationOutput> outputs;
55
/** Helper class that groups overlapping outputs together. */
56
class OverlappingOutputGrouping
59
OverlappingOutputGrouping(DisplayConfiguration const& conf);
60
void for_each_group(std::function<void(OverlappingOutputGroup const& group)> const& f);
63
void add_output(DisplayConfigurationOutput const& conf_output);
65
std::vector<OverlappingOutputGroup> groups;
72
#endif /* MIR_GRAPHICS_MESA_OVERLAPPING_OUTPUT_GROUPING_H_ */