pub trait MonitorExt: IsA<Monitor> + 'static {
Show 26 methods
// Provided methods
fn connector(&self) -> Option<GString> { ... }
fn description(&self) -> Option<GString> { ... }
fn display(&self) -> Display { ... }
fn geometry(&self) -> Rectangle { ... }
fn height_mm(&self) -> i32 { ... }
fn manufacturer(&self) -> Option<GString> { ... }
fn model(&self) -> Option<GString> { ... }
fn refresh_rate(&self) -> i32 { ... }
fn scale(&self) -> f64 { ... }
fn scale_factor(&self) -> i32 { ... }
fn subpixel_layout(&self) -> SubpixelLayout { ... }
fn width_mm(&self) -> i32 { ... }
fn is_valid(&self) -> bool { ... }
fn connect_invalidate<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_connector_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_description_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_geometry_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_height_mm_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_manufacturer_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_model_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_refresh_rate_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_scale_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_scale_factor_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_subpixel_layout_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_valid_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_width_mm_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Provided Methods§
Sourcefn connector(&self) -> Option<GString>
fn connector(&self) -> Option<GString>
Gets the name of the monitor’s connector, if available.
These are strings such as “eDP-1”, or “HDMI-2”. They depend on software and hardware configuration, and should not be relied on as stable identifiers of a specific monitor.
§Returns
the name of the connector
Sourcefn description(&self) -> Option<GString>
Available on crate feature v4_10
only.
fn description(&self) -> Option<GString>
v4_10
only.Gets a string describing the monitor, if available.
This can be used to identify a monitor in the UI.
§Returns
the monitor description
Sourcefn manufacturer(&self) -> Option<GString>
fn manufacturer(&self) -> Option<GString>
Gets the name or PNP ID of the monitor’s manufacturer.
Note that this value might also vary depending on actual display backend.
The PNP ID registry is located at https://uefi.org/pnp_id_list.
§Returns
the name of the manufacturer
Sourcefn refresh_rate(&self) -> i32
fn refresh_rate(&self) -> i32
Gets the refresh rate of the monitor, if available.
The value is in milli-Hertz, so a refresh rate of 60Hz is returned as 60000.
§Returns
the refresh rate in milli-Hertz, or 0
Sourcefn scale(&self) -> f64
Available on crate feature v4_14
only.
fn scale(&self) -> f64
v4_14
only.Gets the internal scale factor that maps from monitor coordinates to device pixels.
This can be used if you want to create pixel based data for a
particular monitor, but most of the time you’re drawing to a surface
where it is better to use SurfaceExt::scale()
instead.
§Returns
the scale
Sourcefn scale_factor(&self) -> i32
fn scale_factor(&self) -> i32
Gets the internal scale factor that maps from monitor coordinates to device pixels.
On traditional systems this is 1, but on very high density outputs it can be a higher value (often 2).
This can be used if you want to create pixel based data for a
particular monitor, but most of the time you’re drawing to a surface
where it is better to use SurfaceExt::scale_factor()
instead.
§Returns
the scale factor
Sourcefn subpixel_layout(&self) -> SubpixelLayout
fn subpixel_layout(&self) -> SubpixelLayout
Gets information about the layout of red, green and blue primaries for pixels.
§Returns
the subpixel layout
Sourcefn connect_invalidate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_invalidate<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Emitted when the output represented by @monitor gets disconnected.
fn connect_connector_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_description_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v4_10
only.fn connect_geometry_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_height_mm_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_manufacturer_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_refresh_rate_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_scale_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
v4_14
only.fn connect_scale_factor_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_subpixel_layout_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_valid_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_width_mm_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.