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 
67 
79  size_t index);
80 
92  size_t index);
93 
104 
119 MirOutputMode const* mir_output_get_mode(MirOutput const* output, size_t index);
120 
138 
153 
168 
180 
188 
196 
207  size_t index);
208 
217 
225 
236 int mir_output_get_id(MirOutput const* output);
237 
248 
256 
272 
288 
298 unsigned int mir_output_get_logical_width(MirOutput const* output);
299 
309 unsigned int mir_output_get_logical_height(MirOutput const* output);
310 
323 void mir_output_set_logical_size(MirOutput* output, unsigned w, unsigned h);
324 
325 /*
326  * Determine if the logical size of an output is user-customized or just
327  * automatically calculated.
328  *
329  * \param [in] output The MirOutput to query
330  * \returns Whether the logical output size has been user-customized.
331  */
333 
350 void mir_output_set_position(MirOutput* output, int x, int y);
351 
374  MirOutput const* output);
375 
382 bool mir_output_is_enabled(MirOutput const* output);
383 
390 
397 
408 char const* mir_output_get_model(MirOutput const* output);
409 
424 
439 
450 
460 
468 
476 
492 
501 
511 
518 
525 uint32_t mir_output_get_gamma_size(MirOutput const* output);
526 
537 void mir_output_get_gamma(MirOutput const* output,
538  uint16_t* red,
539  uint16_t* green,
540  uint16_t* blue,
541  uint32_t size);
542 
552  uint16_t const* red,
553  uint16_t const* green,
554  uint16_t const* blue,
555  uint32_t size);
556 
566 void mir_output_set_scale_factor(MirOutput* output, float scale);
567 
582 uint8_t const* mir_output_get_edid(MirOutput const* output);
583 
594 size_t mir_output_get_edid_size(MirOutput const* output);
595 
605 
614 
621 
624 #ifdef __cplusplus
625 }
626 #endif
627 
628 #endif //MIR_TOOLKIT_MIR_DISPLAY_CONFIGURATION_H_
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:363
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:209
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:50
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:124
bool mir_output_is_enabled(MirOutput const *output)
Get whether this output is enabled in the current configuration.
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.
double mir_output_mode_get_refresh_rate(MirOutputMode const *mode)
Get the refresh rate, in Hz, of a MirOutputMode.
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:283
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:179
MirOrientation mir_output_get_orientation(MirOutput const *output)
Get the orientation of a display.
MirOutputType
Definition: common.h:132
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:379
struct MirOutput MirOutput
Descriptor for an output connection.
Definition: client_types.h:69
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 Fri Jun 11 07:44:02 UTC 2021
This documentation is licensed under the GPL version 2 or 3.