MirAL
output.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 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 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: Alan Griffiths <alan@octopull.co.uk>
17  */
18 
19 #ifndef MIRAL_OUTPUT_H
20 #define MIRAL_OUTPUT_H
21 
22 #include <mir_toolkit/common.h>
23 
24 #include <mir/geometry/rectangle.h>
25 #include <mir/int_wrapper.h>
26 
27 #include <memory>
28 
29 namespace mir { namespace graphics { struct DisplayConfigurationOutput; } }
30 
31 namespace miral
32 {
33 using namespace mir::geometry;
34 
35 class Output
36 {
37 public:
38 
39  struct PhysicalSizeMM { int width; int height; };
40 
41  enum class Type
42  {
43  unknown,
44  vga,
45  dvii,
46  dvid,
47  dvia,
48  composite,
49  svideo,
50  lvds,
51  component,
52  ninepindin,
53  displayport,
54  hdmia,
55  hdmib,
56  tv,
57  edp
58  };
59 
60  explicit Output(const mir::graphics::DisplayConfigurationOutput &output);
61  Output(Output const&);
62  Output& operator=(Output const&);
63  ~Output();
64 
66  auto type() const -> Type;
67 
69  auto physical_size_mm() const -> PhysicalSizeMM;
70 
72  auto connected() const -> bool;
73 
75  auto used() const -> bool;
76 
78  auto pixel_format() const -> MirPixelFormat;
79 
81  auto refresh_rate() const -> double;
82 
84  auto power_mode() const -> MirPowerMode;
85 
86  auto orientation() const -> MirOrientation;
87 
89  auto scale() const -> float;
90 
92  auto form_factor() const -> MirFormFactor;
93 
96  auto extents() const -> Rectangle;
97 
98  auto valid() const -> bool;
99 
100  auto is_same_output(Output const& other) const -> bool;
101 
102 private:
103  std::shared_ptr<mir::graphics::DisplayConfigurationOutput> self;
104 };
105 
106 bool operator==(Output::PhysicalSizeMM const& lhs, Output::PhysicalSizeMM const& rhs);
107 inline bool operator!=(Output::PhysicalSizeMM const& lhs, Output::PhysicalSizeMM const& rhs)
108 { return !(lhs == rhs); }
109 
110 auto equivalent_display_area(Output const& lhs, Output const& rhs) -> bool;
111 }
112 
113 #endif //MIRAL_OUTPUT_H
Definition: active_outputs.h:25
bool operator!=(Output::PhysicalSizeMM const &lhs, Output::PhysicalSizeMM const &rhs)
Definition: output.h:107
Definition: output.h:39
auto equivalent_display_area(Output const &lhs, Output const &rhs) -> bool
int width
Definition: output.h:39
Type
Definition: output.h:41
Definition: output.h:35
bool operator==(Output::PhysicalSizeMM const &lhs, Output::PhysicalSizeMM const &rhs)
Mir Abstraction Layer.
Definition: active_outputs.h:27

Copyright © 2016 Canonical Ltd.
Generated on Wed Nov 30 08:45:30 UTC 2016