Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 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_DISPLAY_CONFIGURATION_H_
20 #define MIR_GRAPHICS_DISPLAY_CONFIGURATION_H_
21 
22 #include "mir/int_wrapper.h"
23 #include "mir/geometry/size.h"
24 #include "mir/geometry/point.h"
26 #include "mir_toolkit/common.h"
27 
28 #include <functional>
29 #include <vector>
30 
31 namespace mir
32 {
33 namespace graphics
34 {
35 namespace detail { struct GraphicsConfCardIdTag; struct GraphicsConfOutputIdTag; }
36 
39 
44 {
47 };
48 
53 {
54  unknown,
55  vga,
56  dvii,
57  dvid,
58  dvia,
59  composite,
60  svideo,
61  lvds,
62  component,
63  ninepindin,
65  hdmia,
66  hdmib,
67  tv,
68  edp
69 };
70 
75 {
77  double vrefresh_hz;
78 };
79 
84 {
92  std::vector<geometry::PixelFormat> pixel_formats;
94  std::vector<DisplayConfigurationMode> modes;
100  bool connected;
102  bool used;
111 };
112 
113 std::ostream& operator<<(std::ostream& out, DisplayConfigurationCard const& val);
114 bool operator==(DisplayConfigurationCard const& val1, DisplayConfigurationCard const& val2);
115 bool operator!=(DisplayConfigurationCard const& val1, DisplayConfigurationCard const& val2);
116 
117 std::ostream& operator<<(std::ostream& out, DisplayConfigurationMode const& val);
118 bool operator==(DisplayConfigurationMode const& val1, DisplayConfigurationMode const& val2);
119 bool operator!=(DisplayConfigurationMode const& val1, DisplayConfigurationMode const& val2);
120 
121 std::ostream& operator<<(std::ostream& out, DisplayConfigurationOutput const& val);
124 
129 {
130 public:
132 
134  virtual void for_each_card(std::function<void(DisplayConfigurationCard const&)> f) const = 0;
136  virtual void for_each_output(std::function<void(DisplayConfigurationOutput const&)> f) const = 0;
137 
139  virtual void configure_output(DisplayConfigurationOutputId id, bool used,
140  geometry::Point top_left, size_t mode_index, MirPowerMode power_mode) = 0;
141 
142 protected:
143  DisplayConfiguration() = default;
144  DisplayConfiguration(DisplayConfiguration const& c) = delete;
146 };
147 
148 }
149 }
150 
151 #endif /* MIR_GRAPHICS_DISPLAY_CONFIGURATION_H_ */

Copyright © 2012,2013 Canonical Ltd.
Generated on Tue Oct 15 00:23:28 UTC 2013