[]Struct gdk::Monitor

pub struct Monitor(_, _);

Monitor objects represent the individual outputs that are associated with a Display. Display has APIs to enumerate monitors with Display::get_n_monitors and Display::get_monitor, and to find particular monitors with Display::get_primary_monitor or Display::get_monitor_at_window.

Monitor was introduced in GTK+ 3.22 and supersedes earlier APIs in Screen to obtain monitor-related information.

Feature: v3_22

Implementations

impl Monitor[src]

pub fn get_display(&self) -> Option<Display>[src]

Gets the display that this monitor belongs to.

Feature: v3_22

Returns

the display

pub fn get_geometry(&self) -> Rectangle[src]

Retrieves the size and position of an individual monitor within the display coordinate space. The returned geometry is in ”application pixels”, not in ”device pixels” (see Monitor::get_scale_factor).

Feature: v3_22

geometry

a Rectangle to be filled with the monitor geometry

pub fn get_height_mm(&self) -> i32[src]

Gets the height in millimeters of the monitor.

Feature: v3_22

Returns

the physical height of the monitor

pub fn get_manufacturer(&self) -> Option<GString>[src]

Gets the name or PNP ID of the monitor's manufacturer, if available.

Note that this value might also vary depending on actual display backend.

PNP ID registry is located at https://uefi.org/pnp_id_list

Feature: v3_22

Returns

the name of the manufacturer, or None

pub fn get_model(&self) -> Option<GString>[src]

Gets the a string identifying the monitor model, if available.

Feature: v3_22

Returns

the monitor model, or None

pub fn get_refresh_rate(&self) -> i32[src]

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.

Feature: v3_22

Returns

the refresh rate in milli-Hertz, or 0

pub fn get_scale_factor(&self) -> i32[src]

Gets the internal scale factor that maps from monitor coordinates to the actual device pixels. On traditional systems this is 1, but on very high density outputs this 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 window where it is better to use WindowExt::get_scale_factor instead.

Feature: v3_22

Returns

the scale factor

pub fn get_subpixel_layout(&self) -> SubpixelLayout[src]

Gets information about the layout of red, green and blue primaries for each pixel in this monitor, if available.

Feature: v3_22

Returns

the subpixel layout

pub fn get_width_mm(&self) -> i32[src]

Gets the width in millimeters of the monitor.

Feature: v3_22

Returns

the physical width of the monitor

pub fn get_workarea(&self) -> Rectangle[src]

Retrieves the size and position of the “work area” on a monitor within the display coordinate space. The returned geometry is in ”application pixels”, not in ”device pixels” (see Monitor::get_scale_factor).

The work area should be considered when positioning menus and similar popups, to avoid placing them below panels, docks or other desktop components.

Note that not all backends may have a concept of workarea. This function will return the monitor geometry if a workarea is not available, or does not apply.

Feature: v3_22

workarea

a Rectangle to be filled with the monitor workarea

pub fn is_primary(&self) -> bool[src]

Gets whether this monitor should be considered primary (see Display::get_primary_monitor).

Feature: v3_22

Returns

true if self is primary

pub fn get_property_display(&self) -> Option<Display>[src]

pub fn get_property_geometry(&self) -> Option<Rectangle>[src]

pub fn get_property_height_mm(&self) -> i32[src]

pub fn get_property_refresh_rate(&self) -> i32[src]

pub fn get_property_scale_factor(&self) -> i32[src]

pub fn get_property_width_mm(&self) -> i32[src]

pub fn get_property_workarea(&self) -> Option<Rectangle>[src]

pub fn connect_invalidate<F: Fn(&Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_geometry_notify<F: Fn(&Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_height_mm_notify<F: Fn(&Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_manufacturer_notify<F: Fn(&Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_model_notify<F: Fn(&Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_refresh_rate_notify<F: Fn(&Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_scale_factor_notify<F: Fn(&Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_subpixel_layout_notify<F: Fn(&Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_width_mm_notify<F: Fn(&Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

pub fn connect_property_workarea_notify<F: Fn(&Monitor) + 'static>(
    &self,
    f: F
) -> SignalHandlerId
[src]

Trait Implementations

impl Clone for Monitor

impl Debug for Monitor

impl Display for Monitor[src]

impl Eq for Monitor

impl Hash for Monitor

impl Ord for Monitor

impl<T: ObjectType> PartialEq<T> for Monitor

impl<T: ObjectType> PartialOrd<T> for Monitor

impl StaticType for Monitor

Auto Trait Implementations

impl RefUnwindSafe for Monitor

impl !Send for Monitor

impl !Sync for Monitor

impl Unpin for Monitor

impl UnwindSafe for Monitor

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<Array>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<List>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 

type Storage = (Option<PtrArray>, Vec<Stash<'a, <T as GlibPtrDefault>::GlibType, T>>)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.