package ocgtk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Wrappers.Monitor

type t = [ `monitor | `object_ ] Gobject.obj
val is_valid : t -> bool

Returns %TRUE if the @monitor object corresponds to a physical monitor.

The @monitor becomes invalid when the physical monitor is unplugged or removed.

val get_width_mm : t -> int

Gets the width in millimeters of the monitor.

val get_subpixel_layout : t -> Gdk_enums.subpixellayout

Gets information about the layout of red, green and blue primaries for pixels.

val get_scale_factor : t -> int

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 method@Gdk.Surface.get_scale_factor instead.

val get_scale : t -> float

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 method@Gdk.Surface.get_scale instead.

val get_refresh_rate : t -> int

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.

val get_model : t -> string option

Gets the string identifying the monitor model, if available.

val get_manufacturer : t -> string option

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(https://uefi.org/pnp_id_list).

val get_height_mm : t -> int

Gets the height in millimeters of the monitor.

val get_geometry : t -> [ `rectangle ] Gobject.obj

Retrieves the size and position of the monitor within the display coordinate space.

The returned geometry is in ”application pixels”, not in ”device pixels” (see method@Gdk.Monitor.get_scale).

val get_display : t -> [ `display | `object_ ] Gobject.obj

Gets the display that this monitor belongs to.

val get_description : t -> string option

Gets a string describing the monitor, if available.

This can be used to identify a monitor in the UI.

val get_connector : t -> string option

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.

val get_valid : t -> bool

Get property: valid

val on_invalidate : ?after:bool -> t -> callback:(unit -> unit) -> Gobject.Signal.handler_id