Class Output

Nested Relationships

Nested Types

Class Documentation

class Output

Describes information about a display output.

Compositor authors may be notified about outputs via miral::WindowManagementPolicy::advise_output_create.

Authors may also use the miral::DisplayConfiguration to set certain properties on the output via a configuration file.

See also

miral::DisplayConfiguration - outputs can get their configuration from this class

Public Types

enum class Type

Display connector types.

Values:

enumerator unknown
enumerator vga
enumerator dvii
enumerator dvid
enumerator dvia
enumerator composite
enumerator svideo
enumerator lvds
enumerator component
enumerator ninepindin
enumerator displayport
enumerator hdmia
enumerator hdmib
enumerator tv
enumerator edp
enumerator virt
enumerator dsi
enumerator dpi

Public Functions

explicit Output(const mir::graphics::DisplayConfigurationOutput &output)

Construct an output from its configuration.

Parameters:

output – the configuration for this output

Output(Output const&)
Output &operator=(Output const&)
~Output()
auto type() const -> Type

The type of the output.

Returns:

the display connection type

auto physical_size_mm() const -> PhysicalSizeMM

The physical size of the output in millimeters.

Returns:

the physical size

auto connected() const -> bool

Whether the output is connected.

Returns:

true if connected, otherwise false

auto used() const -> bool

Whether the output is used in the configuration.

Returns:

true if used, otherwise false

auto pixel_format() const -> MirPixelFormat

The current output pixel format.

Returns:

the pixel format

auto refresh_rate() const -> double

The refresh rate in Hz.

Returns:

the refresh rate

auto power_mode() const -> MirPowerMode

The current power mode.

Returns:

the power mode

auto orientation() const -> MirOrientation

The orientation of the output.

Returns:

the orientation

auto scale() const -> float

Requested scale factor for this output, for HiDPI support.

Returns:

the scale

auto form_factor() const -> MirFormFactor

Form factor of this output, e.g. a phone display, tablet, monitor, TV, projector, and more.

Returns:

the form factor

auto extents() const -> Rectangle

The logical rectangle occupied by the output, based on its position, current mode and orientation (rotation).

Returns:

the extents

auto id() const -> int

Mir’s internal output ID.

This is useful for matching against a miral::WindowInfo::output_id.

Returns:

the id

auto name() const -> std::string

The output name.

This matches the name supplied to Wayland clients through wl_output::name.

Returns:

the name

auto attribute(std::string const &key) const -> std::optional<std::string>

Returns the custom attribute on this output by key.

Custom attributes may be registered on outputs via: miral::DisplayConfiguration::add_output_attribute.

Parameters:

key – the key

Returns:

the value at the key, if any

auto attributes_map() const -> std::map<std::string const, std::optional<std::string>>

Returns the entire attribute map on this output.

Returns:

the raw attributes of the output

auto valid() const -> bool

Check if this output is configured properly.

Returns:

true if the configuration is valid, otherwise false

auto is_same_output(Output const &other) const -> bool

Check if the provided output is the same as this one.

Parameters:

other – output to compare with

Returns:

true if they are the same, otherwise false

auto logical_group_id() const -> int

A positive number if this output is part of a logical output group (e.g. a display wall).

A single display area will stretch across all outputs in a group. This value is 0 if this output is not part of a logical group.

Users may set the group ID of the output through the miral::DisplayConfiguration.

Returns:

the group id

struct PhysicalSizeMM

Describes the physical size of the output in millimeters.

Public Members

int width
int height