Mir
mir_display_configuration.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 Lesser 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 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: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
17  */
18 
19 #ifndef MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
20 #define MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
21 
22 #include "client_types.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
41 typedef struct MirOutputMode MirOutputMode;
42 
49 
63  MirDisplayConfig const* config)
64  MIR_FOR_REMOVAL_IN_VERSION_1("Not accurate in Mir 0.26 and later. May be removed in future.");
65 
83 
95  size_t index);
96 
108  size_t index);
109 
120 
135 MirOutputMode const* mir_output_get_mode(MirOutput const* output, size_t index);
136 
154 
169 
184 
196 
204 
212 
223  size_t index);
224 
233 
241 
252 int mir_output_get_id(MirOutput const* output);
253 
264 
272 MIR_FOR_REMOVAL_IN_VERSION_1("use mir_output_type_name instead");
273 
281 
297 
313 
323 unsigned int mir_output_get_logical_width(MirOutput const* output);
324 
334 unsigned int mir_output_get_logical_height(MirOutput const* output);
335 
348 void mir_output_set_logical_size(MirOutput* output, unsigned w, unsigned h);
349 
350 /*
351  * Determine if the logical size of an output is user-customized or just
352  * automatically calculated.
353  *
354  * \param [in] output The MirOutput to query
355  * \returns Whether the logical output size has been user-customized.
356  */
358 
375 void mir_output_set_position(MirOutput* output, int x, int y);
376 
399  MirOutput const* output);
400 
407 bool mir_output_is_enabled(MirOutput const* output);
408 
415 
422 
433 char const* mir_output_get_model(MirOutput const* output);
434 
449 
464 
475 
485 
493 
501 
517 
526 
536 
543 
550 uint32_t mir_output_get_gamma_size(MirOutput const* output);
551 
562 void mir_output_get_gamma(MirOutput const* output,
563  uint16_t* red,
564  uint16_t* green,
565  uint16_t* blue,
566  uint32_t size);
567 
577  uint16_t const* red,
578  uint16_t const* green,
579  uint16_t const* blue,
580  uint32_t size);
581 
591 void mir_output_set_scale_factor(MirOutput* output, float scale);
592 
607 uint8_t const* mir_output_get_edid(MirOutput const* output);
608 
619 size_t mir_output_get_edid_size(MirOutput const* output);
620 
630 
639 
646 
649 #ifdef __cplusplus
650 }
651 #endif
652 
653 #endif //MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
#define MIR_FOR_REMOVAL_IN_VERSION_1(message)
Definition: deprecations.h:30
char const * mir_display_output_type_name(MirDisplayOutputType type) MIR_FOR_REMOVAL_IN_VERSION_1("use mir_output_type_name instead")
Get the textual name of an output type.
MirPixelFormat mir_output_get_current_pixel_format(MirOutput const *output)
Get the current pixel format.
size_t mir_output_get_edid_size(MirOutput const *output)
Get the size of the EDID of this display.
int mir_display_config_get_num_outputs(MirDisplayConfig const *config)
Get the number of outputs available in this display configuration.
void mir_output_get_gamma(MirOutput const *output, uint16_t *red, uint16_t *green, uint16_t *blue, uint32_t size)
Get the gamma ramp of a display.
MirOutputConnectionState mir_output_get_connection_state(MirOutput const *output)
Get whether there is a display physically connected to the output.
void mir_output_set_gamma(MirOutput *output, uint16_t const *red, uint16_t const *green, uint16_t const *blue, uint32_t size)
Set the gamma ramp of a display.
MirSubpixelArrangement mir_output_get_subpixel_arrangement(MirOutput const *output)
Get the subpixel arrangement of a display.
MirFormFactor
Form factor associated with a physical output.
Definition: common.h:429
void mir_output_disable(MirOutput *output)
Disable this output.
uint32_t mir_output_get_gamma_size(MirOutput const *output)
Gets the gamma size.
MirFormFactor mir_output_get_form_factor(MirOutput const *output)
Get the form-factor of a connected output.
MirOutputMode const * mir_output_get_preferred_mode(MirOutput const *output)
Get a handle to the output's preferred mode.
struct MirOutputMode MirOutputMode
A descriptor for a display mode.
Definition: mir_display_configuration.h:41
MirOrientation
Direction relative to the "natural" orientation of the display.
Definition: common.h:275
int mir_output_get_position_x(MirOutput const *output)
Get the x coordinate of the top-left point of the output in the virtual display space.
int mir_output_mode_get_height(MirOutputMode const *mode)
Get the height, in pixels, of a MirOutputMode.
int mir_output_get_physical_height_mm(MirOutput const *output)
Get the physical height of the connected display, in millimetres.
struct MirDisplayConfig MirDisplayConfig
Definition: client_types.h:53
int mir_output_get_id(MirOutput const *output)
Get the ID of an output.
void mir_output_set_position(MirOutput *output, int x, int y)
Set the coordinates of the top-left point of the output in the virtual display space.
void mir_display_config_release(MirDisplayConfig *config)
Release resources associated with a MirDisplayConfig handle.
void mir_output_set_orientation(MirOutput *output, MirOrientation orientation)
Set the orientation of a display.
unsigned int mir_output_get_logical_height(MirOutput const *output)
Get the height of the virtual display space occupied by an output.
MirPixelFormat mir_output_get_pixel_format(MirOutput const *output, size_t index)
Get a pixel format from the list of supported formats.
MirPowerMode
Definition: common.h:190
bool mir_output_is_enabled(MirOutput const *output)
Get whether this output is enabled in the current configuration.
MirDisplayOutputType
Definition: client_types.h:315
int mir_output_get_num_modes(MirOutput const *output)
Get the number of modes in the supported mode list of this output.
char const * mir_output_get_model(MirOutput const *output)
Get a descriptive manufacturer/model string for the connected display.
MirPixelFormat the EGL implementation will now set correct pixel format
Definition: mir_connection.h:350
double mir_output_mode_get_refresh_rate(MirOutputMode const *mode)
Get the refresh rate, in Hz, of a MirOutputMode.
int mir_display_config_get_max_simultaneous_outputs(MirDisplayConfig const *config) MIR_FOR_REMOVAL_IN_VERSION_1("Not accurate in Mir 0.26 and later. May be removed in future.")
Get the maximum possible number of simultaneously active outputs this system supports.
int mir_output_mode_get_width(MirOutputMode const *mode)
Get the width, in pixels, of a MirOutputMode.
int mir_output_get_physical_width_mm(MirOutput const *output)
Get the physical width of the connected display, in millimetres.
char const * mir_output_type_name(MirOutputType type)
Get the textual name of an output type.
void mir_output_set_current_mode(MirOutput *output, MirOutputMode const *mode)
Set the current mode of an output.
MirOutputMode const * mir_output_get_mode(MirOutput const *output, size_t index)
Get a handle for a mode descriptor from the list of supported modes.
void mir_output_set_power_mode(MirOutput *output, MirPowerMode mode)
Set the power state of a connected display.
MirOutput const * mir_display_config_get_output(MirDisplayConfig const *config, size_t index)
Get a read-only handle to the index 'th output of this configuration.
void mir_output_set_scale_factor(MirOutput *output, float scale)
Set the scale-factor of a display.
void mir_output_set_pixel_format(MirOutput *output, MirPixelFormat format)
Set the output format.
void mir_output_set_logical_size(MirOutput *output, unsigned w, unsigned h)
Set the logical size of the virtual display space occupied by an output.
MirOutputConnectionState
Definition: client_types.h:337
MirPowerMode mir_output_get_power_mode(MirOutput const *output)
Get the power state of a connected display.
int mir_output_get_position_y(MirOutput const *output)
Get the y coordinate of the top-left point of the output in the virtual display space.
MirOutputMode const * mir_output_get_current_mode(MirOutput const *output)
Get a handle to the output's current mode.
bool mir_output_is_gamma_supported(MirOutput const *output)
Gets if the platform supports gamma correction.
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:245
MirOrientation mir_output_get_orientation(MirOutput const *output)
Get the orientation of a display.
MirOutputType
Definition: common.h:198
uint8_t const * mir_output_get_edid(MirOutput const *output)
Get the raw EDID data of a display.
bool mir_output_has_custom_logical_size(MirOutput const *output)
unsigned int mir_output_get_logical_width(MirOutput const *output)
Get the width of the virtual display space occupied by an output.
int mir_output_get_num_pixel_formats(MirOutput const *output)
Get the number of pixel formats supported by this output.
float mir_output_get_scale_factor(MirOutput const *output)
Get the scale-factor of a display.
size_t mir_output_get_current_mode_index(MirOutput const *output)
Get the index of to the output's current mode.
MirSubpixelArrangement
Physical arrangement of subpixels on the physical output.
Definition: common.h:445
struct MirOutput MirOutput
Descriptor for an output connection.
Definition: client_types.h:72
size_t mir_output_get_preferred_mode_index(MirOutput const *output)
Get the index of the output's preferred mode.
void mir_output_enable(MirOutput *output)
Enable this output.
MirOutput * mir_display_config_get_mutable_output(MirDisplayConfig *config, size_t index)
Get a modifyable handle to the index 'th output of this configuration.
MirOutputType mir_output_get_type(MirOutput const *output)
Get the physical connection type of an output.

Copyright © 2012-2021 Canonical Ltd.
Generated on Tue Mar 30 08:30:24 UTC 2021
This documentation is licensed under the GPL version 2 or 3.