Mir
stub_display_configuration.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 General Public License version 2 or 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 General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Kevin DuBois <kevin.dubois@canonical.com>
17  */
18 
19 #ifndef MIR_TEST_DOUBLES_STUB_DISPLAY_CONFIGURATION_H_
20 #define MIR_TEST_DOUBLES_STUB_DISPLAY_CONFIGURATION_H_
21 
22 #include "mir/graphics/display_configuration.h"
23 
24 #include <vector>
26 
27 namespace mir
28 {
29 namespace test
30 {
31 namespace doubles
32 {
33 
34 struct StubDisplayConfigurationOutput : public graphics::DisplayConfigurationOutput
35 {
37  geometry::Size px_size, geometry::Size mm_size, MirPixelFormat format, double vrefresh, bool connected);
38 
40  geometry::Size px_size,
41  geometry::Size mm_size,
42  MirPixelFormat format,
43  double vrefresh,
44  bool connected,
45  MirSubpixelArrangement subpixel_arrangement);
46 
47  StubDisplayConfigurationOutput(graphics::DisplayConfigurationOutputId id,
48  geometry::Size px_size,
49  geometry::Size mm_size,
50  MirPixelFormat format,
51  double vrefresh,
52  bool connected);
53 
54  StubDisplayConfigurationOutput(graphics::DisplayConfigurationOutputId id,
55  geometry::Size px_size,
56  geometry::Size mm_size,
57  MirPixelFormat format,
58  double vrefresh,
59  bool connected,
60  MirSubpixelArrangement subpixel_arrangement);
61 
62  StubDisplayConfigurationOutput(graphics::DisplayConfigurationOutputId id,
63  std::vector<graphics::DisplayConfigurationMode> modes, std::vector<MirPixelFormat> formats);
64 };
65 
66 class StubDisplayConfig : public graphics::DisplayConfiguration
67 {
68 public:
70 
72 
73  StubDisplayConfig(graphics::DisplayConfiguration const& other);
74 
75  StubDisplayConfig(unsigned int num_displays);
76 
77  StubDisplayConfig(std::vector<std::pair<bool,bool>> const& connected_used);
78 
79  StubDisplayConfig(unsigned int num_displays, std::vector<MirPixelFormat> const& pfs);
80 
81  StubDisplayConfig(std::vector<geometry::Rectangle> const& rects);
82 
83  StubDisplayConfig(std::vector<graphics::DisplayConfigurationOutput> const& outputs);
84 
86  std::vector<graphics::DisplayConfigurationCard> const& cards,
87  std::vector<graphics::DisplayConfigurationOutput> const& outputs);
88 
89  void for_each_card(std::function<void(graphics::DisplayConfigurationCard const&)> f) const override;
90 
91  void for_each_output(std::function<void(graphics::DisplayConfigurationOutput const&)> f) const override;
92 
93  void for_each_output(std::function<void(graphics::UserDisplayConfigurationOutput&)> f) override;
94 
95  std::unique_ptr<graphics::DisplayConfiguration> clone() const override;
96 
97  std::vector<graphics::DisplayConfigurationCard> cards;
98  std::vector<graphics::DisplayConfigurationOutput> outputs;
99 };
100 
101 }
102 }
103 }
104 
105 #endif /* MIR_TEST_DOUBLES_STUB_DISPLAY_CONFIGURATION_H_ */
Definition: size.h:30
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: sw_splash.h:26
Definition: stub_display_configuration.h:34
MirSubpixelArrangement
Physical arrangement of subpixels on the physical output.
Definition: common.h:421
std::vector< graphics::DisplayConfigurationOutput > outputs
Definition: stub_display_configuration.h:98
StubDisplayConfigurationOutput(geometry::Size px_size, geometry::Size mm_size, MirPixelFormat format, double vrefresh, bool connected)
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:241
Definition: stub_display_configuration.h:66
std::vector< graphics::DisplayConfigurationCard > cards
Definition: stub_display_configuration.h:97
MirPixelFormat the EGL implementation will now set correct pixel format
Definition: mir_connection.h:350

Copyright © 2012-2018 Canonical Ltd.
Generated on Mon Feb 19 14:05:11 UTC 2018