Struct core_graphics::display::CGDisplay
source · pub struct CGDisplay {
pub id: CGDirectDisplayID,
}
Fields
id: CGDirectDisplayID
Implementations
sourceimpl CGDisplay
impl CGDisplay
pub fn new(id: CGDirectDisplayID) -> CGDisplay
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 image(&self) -> Option<CGImage>
pub fn image(&self) -> Option<CGImage>
Returns an image containing the contents 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).