pub struct CGDisplay {
    pub id: CGDirectDisplayID,
}

Fields§

§id: CGDirectDisplayID

Implementations§

source§

impl CGDisplay

source

pub fn new(id: CGDirectDisplayID) -> CGDisplay

source

pub fn main() -> CGDisplay

Returns the the main display.

source

pub fn null_display() -> CGDisplay

A value that will never correspond to actual hardware.

source

pub fn bounds(&self) -> CGRect

Returns the bounds of a display in the global display coordinate space.

source

pub fn display_mode(&self) -> Option<CGDisplayMode>

Returns information about a display’s current configuration.

source

pub fn begin_configuration(&self) -> Result<CGDisplayConfigRef, CGError>

Begins a new set of display configuration changes.

source

pub fn cancel_configuration( &self, config_ref: &CGDisplayConfigRef ) -> Result<(), CGError>

Cancels a set of display configuration changes.

source

pub fn complete_configuration( &self, config_ref: &CGDisplayConfigRef, option: CGConfigureOption ) -> Result<(), CGError>

Completes a set of display configuration changes.

source

pub fn configure_display_with_display_mode( &self, config_ref: &CGDisplayConfigRef, display_mode: &CGDisplayMode ) -> Result<(), CGError>

Configures the display mode of a display.

source

pub fn configure_display_origin( &self, config_ref: &CGDisplayConfigRef, x: i32, y: i32 ) -> Result<(), CGError>

Configures the origin of a display in the global display coordinate space.

source

pub fn configure_display_mirror_of_display( &self, config_ref: &CGDisplayConfigRef, master: &CGDisplay ) -> Result<(), CGError>

Changes the configuration of a mirroring set.

source

pub fn image(&self) -> Option<CGImage>

Returns an image containing the contents of the specified display.

source

pub fn image_for_rect(&self, bounds: CGRect) -> Option<CGImage>

Returns an image containing the contents of a portion of the specified display.

source

pub fn screenshot( bounds: CGRect, list_option: CGWindowListOption, window_id: CGWindowID, image_option: CGWindowImageOption ) -> Option<CGImage>

Returns a composite image based on a dynamically generated list of windows.

source

pub fn screenshot_from_windows( bounds: CGRect, windows: CFArray, image_option: CGWindowImageOption ) -> Option<CGImage>

Returns a composite image of the specified windows.

source

pub fn window_list_info( option: CGWindowListOption, relative_to_window: Option<CGWindowID> ) -> Option<CFArray>

Generates and returns information about the selected windows in the current user session.

source

pub fn is_active(&self) -> bool

Returns a Boolean value indicating whether a display is active.

source

pub fn is_always_in_mirror_set(&self) -> bool

Returns a boolean indicating whether a display is always in a mirroring set.

source

pub fn is_asleep(&self) -> bool

Returns a boolean indicating whether a display is sleeping (and is therefore not drawable.)

source

pub fn is_builtin(&self) -> bool

Returns a boolean indicating whether a display is built-in, such as the internal display in portable systems.

source

pub fn is_in_hw_mirror_set(&self) -> bool

Returns a boolean indicating whether a display is in a hardware mirroring set.

source

pub fn is_in_mirror_set(&self) -> bool

Returns a boolean indicating whether a display is in a mirroring set.

source

pub fn is_main(&self) -> bool

Returns a boolean indicating whether a display is the main display.

source

pub fn is_online(&self) -> bool

Returns a boolean indicating whether a display is connected or online.

source

pub fn uses_open_gl_acceleration(&self) -> bool

Returns a boolean indicating whether Quartz is using OpenGL-based window acceleration (Quartz Extreme) to render in a display.

source

pub fn is_stereo(&self) -> bool

Returns a boolean indicating whether a display is running in a stereo graphics mode.

source

pub fn mirrors_display(&self) -> CGDirectDisplayID

For a secondary display in a mirroring set, returns the primary display.

source

pub fn primary_display(&self) -> CGDirectDisplayID

Returns the primary display in a hardware mirroring set.

source

pub fn rotation(&self) -> f64

Returns the rotation angle of a display in degrees.

source

pub fn screen_size(&self) -> CGSize

Returns the width and height of a display in millimeters.

source

pub fn serial_number(&self) -> u32

Returns the serial number of a display monitor.

source

pub fn unit_number(&self) -> u32

Returns the logical unit number of a display.

source

pub fn vendor_number(&self) -> u32

Returns the vendor number of the specified display’s monitor.

source

pub fn model_number(&self) -> u32

Returns the model number of a display monitor.

source

pub fn pixels_high(&self) -> u64

Returns the display height in pixel units.

source

pub fn pixels_wide(&self) -> u64

Returns the display width in pixel units.

source

pub fn active_displays() -> Result<Vec<CGDirectDisplayID>, CGError>

Provides a list of displays that are active (or drawable).

source

pub fn active_display_count() -> Result<u32, CGError>

Provides count of displays that are active (or drawable).

source

pub fn hide_cursor(&self) -> Result<(), CGError>

Hides the mouse cursor, and increments the hide cursor count.

source

pub fn show_cursor(&self) -> Result<(), CGError>

Decrements the hide cursor count, and shows the mouse cursor if the count is 0.

source

pub fn move_cursor_to_point(&self, point: CGPoint) -> Result<(), CGError>

Moves the mouse cursor to a specified point relative to the display origin (the upper-left corner of the display).

source

pub fn warp_mouse_cursor_position(point: CGPoint) -> Result<(), CGError>

Moves the mouse cursor without generating events.

source

pub fn associate_mouse_and_mouse_cursor_position( connected: bool ) -> Result<(), CGError>

Connects or disconnects the mouse and cursor while an application is in the foreground.

Trait Implementations§

source§

impl Clone for CGDisplay

source§

fn clone(&self) -> CGDisplay

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CGDisplay

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for CGDisplay

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.