Mir
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
include
platform
mir
graphics
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
"
25
#include "
mir/geometry/pixel_format.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
37
typedef
IntWrapper<detail::GraphicsConfCardIdTag>
DisplayConfigurationCardId
;
38
typedef
IntWrapper<detail::GraphicsConfOutputIdTag>
DisplayConfigurationOutputId
;
39
43
struct
DisplayConfigurationCard
44
{
45
DisplayConfigurationCardId
id
;
46
size_t
max_simultaneous_outputs
;
47
};
48
52
enum class
DisplayConfigurationOutputType
53
{
54
unknown
,
55
vga
,
56
dvii
,
57
dvid
,
58
dvia
,
59
composite
,
60
svideo
,
61
lvds
,
62
component
,
63
ninepindin
,
64
displayport
,
65
hdmia
,
66
hdmib
,
67
tv
,
68
edp
69
};
70
74
struct
DisplayConfigurationMode
75
{
76
geometry::Size
size
;
77
double
vrefresh_hz
;
78
};
79
83
struct
DisplayConfigurationOutput
84
{
86
DisplayConfigurationOutputId
id
;
88
DisplayConfigurationCardId
card_id
;
90
DisplayConfigurationOutputType
type
;
92
std::vector<geometry::PixelFormat>
pixel_formats
;
94
std::vector<DisplayConfigurationMode>
modes
;
96
size_t
preferred_mode_index
;
98
geometry::Size
physical_size_mm
;
100
bool
connected
;
102
bool
used
;
104
geometry::Point
top_left
;
106
size_t
current_mode_index
;
108
size_t
current_format_index
;
110
MirPowerMode
power_mode
;
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);
122
bool
operator==
(
DisplayConfigurationOutput
const
& val1,
DisplayConfigurationOutput
const
& val2);
123
bool
operator!=
(
DisplayConfigurationOutput
const
& val1,
DisplayConfigurationOutput
const
& val2);
124
128
class
DisplayConfiguration
129
{
130
public
:
131
virtual
~DisplayConfiguration
() {}
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
;
145
DisplayConfiguration
&
operator=
(
DisplayConfiguration
const
& c) =
delete
;
146
};
147
148
}
149
}
150
151
#endif
/* MIR_GRAPHICS_DISPLAY_CONFIGURATION_H_ */
Copyright © 2012,2013 Canonical Ltd.
Generated on Wed Oct 30 18:52:19 UTC 2013