Mir
overlapping_output_grouping.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Canonical Ltd.
3  *
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.
7  *
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.
12  *
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/>.
15  *
16  * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_GRAPHICS_OVERLAPPING_OUTPUT_GROUPING_H_
20 #define MIR_GRAPHICS_OVERLAPPING_OUTPUT_GROUPING_H_
21 
22 #include <vector>
23 #include <functional>
24 
25 namespace mir
26 {
27 namespace geometry
28 {
29 struct Rectangle;
30 }
31 namespace graphics
32 {
33 
34 class DisplayConfiguration;
35 struct DisplayConfigurationOutput;
36 
38 {
39 public:
40  template <typename Iterator>
41  OverlappingOutputGroup(Iterator begin, Iterator end) : outputs(begin, end) {}
44 
46  void for_each_output(std::function<void(DisplayConfigurationOutput const&)> const& f) const;
47 
48 private:
49  std::vector<DisplayConfigurationOutput> outputs;
50 };
51 
54 {
55 public:
57  void for_each_group(std::function<void(OverlappingOutputGroup const& group)> const& f);
58 
59 private:
60  void add_output(DisplayConfigurationOutput const& conf_output);
61 
62  std::vector<OverlappingOutputGroup> groups;
63 };
64 
65 }
66 }
67 
68 #endif /* MIR_GRAPHICS_OVERLAPPING_OUTPUT_GROUPING_H_ */
OverlappingOutputGrouping(DisplayConfiguration const &conf)
Definition: overlapping_output_grouping.cpp:74
All things Mir.
Definition: atomic_callback.h:25
OverlappingOutputGroup(Iterator begin, Iterator end)
Definition: overlapping_output_grouping.h:41
void for_each_output(std::function< void(DisplayConfigurationOutput const &)> const &f) const
Definition: overlapping_output_grouping.cpp:63
Definition: overlapping_output_grouping.h:37
void for_each_group(std::function< void(OverlappingOutputGroup const &group)> const &f)
Definition: overlapping_output_grouping.cpp:88
Configuration information for a display output.
Definition: display_configuration.h:83
Definition: rectangle.h:33
OverlappingOutputGroup & operator=(OverlappingOutputGroup const &)=default
geometry::Rectangle bounding_rectangle() const
Definition: overlapping_output_grouping.cpp:53
Interface to a configuration of display cards and outputs.
Definition: display_configuration.h:166
Helper class that groups overlapping outputs together.
Definition: overlapping_output_grouping.h:53

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015