Class Monitor

All Implemented Interfaces:
PointerInterface

public class Monitor extends Object
`GdkMonitor` objects represent the individual outputs that are
associated with a `GdkDisplay`.

`GdkDisplay` keeps a `GListModel` to enumerate and monitor
monitors with [method@Gdk.Display.get_monitors]. You can use
[method@Gdk.Display.get_monitor_at_surface] to find a particular
monitor.

https://docs.gtk.org/gdk4/class.Monitor.html

  • Field Details

  • Constructor Details

  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getConnector

      public Str getConnector()
      Gets the name of the monitor's connector, if available.
      Returns:
      the name of the connector
    • getDisplay

      public Display getDisplay()
      Gets the display that this monitor belongs to.
      Returns:
      the display
    • getGeometry

      public void getGeometry(@Nonnull Rectangle geometry)
      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_factor]).
      Parameters:
      geometry - a `GdkRectangle` to be filled with the monitor geometry
    • getHeightMm

      public int getHeightMm()
      Gets the height in millimeters of the monitor.
      Returns:
      the physical height of the monitor
    • getManufacturer

      public Str getManufacturer()
      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).
      Returns:
      the name of the manufacturer
    • getModel

      public Str getModel()
      Gets the string identifying the monitor model, if available.
      Returns:
      the monitor model
    • getRefreshRate

      public int getRefreshRate()
      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.
      Returns:
      the refresh rate in milli-Hertz, or 0
    • getScaleFactor

      public int getScaleFactor()
      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.
      Returns:
      the scale factor
    • getSubpixelLayout

      public int getSubpixelLayout()
      Gets information about the layout of red, green and blue
      primaries for pixels.
      Returns:
      the subpixel layout
    • getWidthMm

      public int getWidthMm()
      Gets the width in millimeters of the monitor.
      Returns:
      the physical width of the monitor
    • isValid

      public boolean isValid()
      Returns %TRUE if the @monitor object corresponds to a
      physical monitor.

      The @monitor becomes invalid when the physical monitor
      is unplugged or removed.
      Returns:
      %TRUE if the object corresponds to a physical monitor
    • onInvalidate

      public SignalHandler onInvalidate(Monitor.OnInvalidate signal)
      Connect to signal "invalidate".
      See Monitor.OnInvalidate.onInvalidate() for signal description.
      Field SIGNAL_ON_INVALIDATE contains original signal name and can be used as resource reference.
      Parameters:
      signal - callback function (lambda).
      Returns:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()