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(mir::graphics::DisplayConfigurationOutput const &output)

Construct an output from its configuration.

Parameters:

output – the configuration for this output

Output(Output const&)
Output &operator=(Output const&)
~Output()
Type type() const

The type of the output.

Returns:

the display connection type

PhysicalSizeMM physical_size_mm() const

The physical size of the output in millimeters.

Returns:

the physical size

bool connected() const

Whether the output is connected.

Returns:

true if connected, otherwise false

bool used() const

Whether the output is used in the configuration.

Returns:

true if used, otherwise false

MirPixelFormat pixel_format() const

The current output pixel format.

Returns:

the pixel format

double refresh_rate() const

The refresh rate in Hz.

Returns:

the refresh rate

MirPowerMode power_mode() const

The current power mode.

Returns:

the power mode

MirOrientation orientation() const

The orientation of the output.

Returns:

the orientation

float scale() const

Requested scale factor for this output, for HiDPI support.

Returns:

the scale

MirFormFactor form_factor() const

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

Returns:

the form factor

Rectangle extents() const

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

Returns:

the extents

int id() const

Mir’s internal output ID.

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

Returns:

the id

std::string name() const

The output name.

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

Returns:

the name

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

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

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

Returns the entire attribute map on this output.

Returns:

the raw attributes of the output

bool valid() const

Check if this output is configured properly.

Returns:

true if the configuration is valid, otherwise false

bool is_same_output(Output const &other) const

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

int logical_group_id() const

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 Functions

bool operator==(PhysicalSizeMM const&) const = default

Public Members

int width
int height