pub struct CGDisplay {
pub id: CGDirectDisplayID,
}
Fields§
§id: CGDirectDisplayID
Implementations§
Source§impl CGDisplay
impl CGDisplay
pub fn new(id: CGDirectDisplayID) -> CGDisplay
Sourcepub fn null_display() -> CGDisplay
pub fn null_display() -> CGDisplay
A value that will never correspond to actual hardware.
Sourcepub fn display_count_with_point(point: CGPoint) -> Result<u32, CGError>
pub fn display_count_with_point(point: CGPoint) -> Result<u32, CGError>
Return the number of online displays with bounds that include the specified point.
Sourcepub fn displays_with_point(
point: CGPoint,
max_displays: u32,
) -> Result<(Vec<CGDirectDisplayID>, u32), CGError>
pub fn displays_with_point( point: CGPoint, max_displays: u32, ) -> Result<(Vec<CGDirectDisplayID>, u32), CGError>
Return a list of online displays with bounds that include the specified point.
Sourcepub fn display_count_with_rect(rect: CGRect) -> Result<u32, CGError>
pub fn display_count_with_rect(rect: CGRect) -> Result<u32, CGError>
Return the number of online displays with bounds that intersect the specified rectangle.
Sourcepub fn displays_with_rect(
rect: CGRect,
max_displays: u32,
) -> Result<(Vec<CGDirectDisplayID>, u32), CGError>
pub fn displays_with_rect( rect: CGRect, max_displays: u32, ) -> Result<(Vec<CGDirectDisplayID>, u32), CGError>
Return a list of online displays with bounds that intersect the specified rectangle.
Sourcepub fn bounds(&self) -> CGRect
pub fn bounds(&self) -> CGRect
Returns the bounds of a display in the global display coordinate space.
Sourcepub fn display_mode(&self) -> Option<CGDisplayMode>
pub fn display_mode(&self) -> Option<CGDisplayMode>
Returns information about a display’s current configuration.
Sourcepub fn begin_configuration(&self) -> Result<CGDisplayConfigRef, CGError>
pub fn begin_configuration(&self) -> Result<CGDisplayConfigRef, CGError>
Begins a new set of display configuration changes.
Sourcepub fn cancel_configuration(
&self,
config_ref: &CGDisplayConfigRef,
) -> Result<(), CGError>
pub fn cancel_configuration( &self, config_ref: &CGDisplayConfigRef, ) -> Result<(), CGError>
Cancels a set of display configuration changes.
Sourcepub fn complete_configuration(
&self,
config_ref: &CGDisplayConfigRef,
option: CGConfigureOption,
) -> Result<(), CGError>
pub fn complete_configuration( &self, config_ref: &CGDisplayConfigRef, option: CGConfigureOption, ) -> Result<(), CGError>
Completes a set of display configuration changes.
Sourcepub fn configure_display_with_display_mode(
&self,
config_ref: &CGDisplayConfigRef,
display_mode: &CGDisplayMode,
) -> Result<(), CGError>
pub fn configure_display_with_display_mode( &self, config_ref: &CGDisplayConfigRef, display_mode: &CGDisplayMode, ) -> Result<(), CGError>
Configures the display mode of a display.
Sourcepub fn configure_display_origin(
&self,
config_ref: &CGDisplayConfigRef,
x: i32,
y: i32,
) -> Result<(), CGError>
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.
Sourcepub fn configure_display_mirror_of_display(
&self,
config_ref: &CGDisplayConfigRef,
master: &CGDisplay,
) -> Result<(), CGError>
pub fn configure_display_mirror_of_display( &self, config_ref: &CGDisplayConfigRef, master: &CGDisplay, ) -> Result<(), CGError>
Changes the configuration of a mirroring set.
Sourcepub fn image(&self) -> Option<CGImage>
pub fn image(&self) -> Option<CGImage>
Returns an image containing the contents of the specified display.
Sourcepub fn image_for_rect(&self, bounds: CGRect) -> Option<CGImage>
pub fn image_for_rect(&self, bounds: CGRect) -> Option<CGImage>
Returns an image containing the contents of a portion of the specified display.
Sourcepub fn screenshot(
bounds: CGRect,
list_option: CGWindowListOption,
window_id: CGWindowID,
image_option: CGWindowImageOption,
) -> Option<CGImage>
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.
Sourcepub fn screenshot_from_windows(
bounds: CGRect,
windows: CFArray,
image_option: CGWindowImageOption,
) -> Option<CGImage>
pub fn screenshot_from_windows( bounds: CGRect, windows: CFArray, image_option: CGWindowImageOption, ) -> Option<CGImage>
Returns a composite image of the specified windows.
Sourcepub fn window_list_info(
option: CGWindowListOption,
relative_to_window: Option<CGWindowID>,
) -> Option<CFArray>
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.
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Returns a Boolean value indicating whether a display is active.
Sourcepub fn is_always_in_mirror_set(&self) -> bool
pub fn is_always_in_mirror_set(&self) -> bool
Returns a boolean indicating whether a display is always in a mirroring set.
Sourcepub fn is_asleep(&self) -> bool
pub fn is_asleep(&self) -> bool
Returns a boolean indicating whether a display is sleeping (and is therefore not drawable.)
Sourcepub fn is_builtin(&self) -> bool
pub fn is_builtin(&self) -> bool
Returns a boolean indicating whether a display is built-in, such as the internal display in portable systems.
Sourcepub fn is_in_hw_mirror_set(&self) -> bool
pub fn is_in_hw_mirror_set(&self) -> bool
Returns a boolean indicating whether a display is in a hardware mirroring set.
Sourcepub fn is_in_mirror_set(&self) -> bool
pub fn is_in_mirror_set(&self) -> bool
Returns a boolean indicating whether a display is in a mirroring set.
Sourcepub fn is_main(&self) -> bool
pub fn is_main(&self) -> bool
Returns a boolean indicating whether a display is the main display.
Sourcepub fn is_online(&self) -> bool
pub fn is_online(&self) -> bool
Returns a boolean indicating whether a display is connected or online.
Sourcepub fn uses_open_gl_acceleration(&self) -> bool
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.
Sourcepub fn is_stereo(&self) -> bool
pub fn is_stereo(&self) -> bool
Returns a boolean indicating whether a display is running in a stereo graphics mode.
Sourcepub fn mirrors_display(&self) -> CGDirectDisplayID
pub fn mirrors_display(&self) -> CGDirectDisplayID
For a secondary display in a mirroring set, returns the primary display.
Sourcepub fn primary_display(&self) -> CGDirectDisplayID
pub fn primary_display(&self) -> CGDirectDisplayID
Returns the primary display in a hardware mirroring set.
Sourcepub fn screen_size(&self) -> CGSize
pub fn screen_size(&self) -> CGSize
Returns the width and height of a display in millimeters.
Sourcepub fn serial_number(&self) -> u32
pub fn serial_number(&self) -> u32
Returns the serial number of a display monitor.
Sourcepub fn unit_number(&self) -> u32
pub fn unit_number(&self) -> u32
Returns the logical unit number of a display.
Sourcepub fn vendor_number(&self) -> u32
pub fn vendor_number(&self) -> u32
Returns the vendor number of the specified display’s monitor.
Sourcepub fn model_number(&self) -> u32
pub fn model_number(&self) -> u32
Returns the model number of a display monitor.
Sourcepub fn pixels_high(&self) -> u64
pub fn pixels_high(&self) -> u64
Returns the display height in pixel units.
Sourcepub fn pixels_wide(&self) -> u64
pub fn pixels_wide(&self) -> u64
Returns the display width in pixel units.
Sourcepub fn active_displays() -> Result<Vec<CGDirectDisplayID>, CGError>
pub fn active_displays() -> Result<Vec<CGDirectDisplayID>, CGError>
Provides a list of displays that are active (or drawable).
Sourcepub fn active_display_count() -> Result<u32, CGError>
pub fn active_display_count() -> Result<u32, CGError>
Provides count of displays that are active (or drawable).
Sourcepub fn hide_cursor(&self) -> Result<(), CGError>
pub fn hide_cursor(&self) -> Result<(), CGError>
Hides the mouse cursor, and increments the hide cursor count.
Sourcepub fn show_cursor(&self) -> Result<(), CGError>
pub fn show_cursor(&self) -> Result<(), CGError>
Decrements the hide cursor count, and shows the mouse cursor if the count is 0.
Sourcepub fn move_cursor_to_point(&self, point: CGPoint) -> Result<(), CGError>
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).