gi-gdk-3.0.29: Gdk bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | Safe-Inferred
Language | Haskell2010

GI.Gdk.Objects.Monitor

Contents

- Exported types
- Methods
  - getDisplay
  - getGeometry
  - getHeightMm
  - getManufacturer
  - getModel
  - getRefreshRate
  - getScaleFactor
  - getSubpixelLayout
  - getWidthMm
  - getWorkarea
  - isPrimary
- Properties
  - display
  - geometry
  - heightMm
  - manufacturer
  - model
  - refreshRate
  - scaleFactor
  - subpixelLayout
  - widthMm
  - workarea
- Signals
  - invalidate

Description

GdkMonitor objects represent the individual outputs that are associated with a `Display`. GdkDisplay has APIs to enumerate monitors with `displayGetNMonitors` and `displayGetMonitor`, and to find particular monitors with `displayGetPrimaryMonitor` or `displayGetMonitorAtWindow`.

GdkMonitor was introduced in GTK+ 3.22 and supersedes earlier APIs in GdkScreen to obtain monitor-related information.

Synopsis

- newtype Monitor = Monitor (ManagedPtr Monitor)
- class (GObject o, IsDescendantOf Monitor o) => IsMonitor o
- toMonitor :: (MonadIO m, IsMonitor o) => o -> m Monitor
- monitorGetDisplay :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Display
- monitorGetGeometry :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Rectangle
- monitorGetHeightMm :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Int32
- monitorGetManufacturer :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m (Maybe Text)
- monitorGetModel :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m (Maybe Text)
- monitorGetRefreshRate :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Int32
- monitorGetScaleFactor :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Int32
- monitorGetSubpixelLayout :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m SubpixelLayout
- monitorGetWidthMm :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Int32
- monitorGetWorkarea :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Rectangle
- monitorIsPrimary :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Bool
- constructMonitorDisplay :: (IsMonitor o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o)
- getMonitorDisplay :: (MonadIO m, IsMonitor o) => o -> m Display
- getMonitorGeometry :: (MonadIO m, IsMonitor o) => o -> m (Maybe Rectangle)
- getMonitorHeightMm :: (MonadIO m, IsMonitor o) => o -> m Int32
- getMonitorManufacturer :: (MonadIO m, IsMonitor o) => o -> m (Maybe Text)
- getMonitorModel :: (MonadIO m, IsMonitor o) => o -> m (Maybe Text)
- getMonitorRefreshRate :: (MonadIO m, IsMonitor o) => o -> m Int32
- getMonitorScaleFactor :: (MonadIO m, IsMonitor o) => o -> m Int32
- getMonitorSubpixelLayout :: (MonadIO m, IsMonitor o) => o -> m SubpixelLayout
- getMonitorWidthMm :: (MonadIO m, IsMonitor o) => o -> m Int32
- getMonitorWorkarea :: (MonadIO m, IsMonitor o) => o -> m (Maybe Rectangle)
- type MonitorInvalidateCallback = IO ()
- afterMonitorInvalidate :: (IsMonitor a, MonadIO m) => a -> ((?self :: a) => MonitorInvalidateCallback) -> m SignalHandlerId
- onMonitorInvalidate :: (IsMonitor a, MonadIO m) => a -> ((?self :: a) => MonitorInvalidateCallback) -> m SignalHandlerId

# Exported types

newtype Monitor Source #

Memory-managed wrapper type.

Constructors

Monitor (ManagedPtr Monitor) |

#### Instances

Instances details

Eq Monitor Source # |
Instance details Defined in GI.Gdk.Objects.Monitor Methods (==) :: Monitor -> Monitor -> Bool Source # (/=) :: Monitor -> Monitor -> Bool Source #
GObject Monitor Source # |
Instance details Defined in GI.Gdk.Objects.Monitor
ManagedPtrNewtype Monitor Source # |
Instance details Defined in GI.Gdk.Objects.Monitor Methods toManagedPtr :: Monitor -> ManagedPtr Monitor Source #
TypedObject Monitor Source # |
Instance details Defined in GI.Gdk.Objects.Monitor Methods glibType :: IO GType Source #
HasParentTypes Monitor Source # |
Instance details Defined in GI.Gdk.Objects.Monitor
IsGValue (Maybe Monitor) Source # | Convert `Monitor` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gdk.Objects.Monitor Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Monitor -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Monitor) Source #
type ParentTypes Monitor Source # |
Instance details Defined in GI.Gdk.Objects.Monitor type ParentTypes Monitor = '[Object]

class (GObject o, IsDescendantOf Monitor o) => IsMonitor o Source #

Type class for types which can be safely cast to `Monitor`, for instance with `toMonitor`.

#### Instances

Instances details

(GObject o, IsDescendantOf Monitor o) => IsMonitor o Source # |
Instance details Defined in GI.Gdk.Objects.Monitor

toMonitor :: (MonadIO m, IsMonitor o) => o -> m Monitor Source #

Cast to `Monitor`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, isPrimary, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.

#### Getters

getData, getDisplay, getGeometry, getHeightMm, getManufacturer, getModel, getProperty, getQdata, getRefreshRate, getScaleFactor, getSubpixelLayout, getWidthMm, getWorkarea.

#### Setters

setData, setDataFull, setProperty.

## getDisplay

monitorGetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsMonitor a) |
=> a | `monitor`: a `Monitor`
-> m Display | Returns: the display

Gets the display that this monitor belongs to.

Since: 3.22

## getGeometry

monitorGetGeometry Source #

Arguments

:: (HasCallStack, MonadIO m, IsMonitor a) |
=> a | `monitor`: a `Monitor`
-> m Rectangle |

Retrieves the size and position of an individual monitor within the display coordinate space. The returned geometry is in ”application pixels”, not in ”device pixels” (see `monitorGetScaleFactor`).

Since: 3.22

## getHeightMm

monitorGetHeightMm Source #

Arguments

:: (HasCallStack, MonadIO m, IsMonitor a) |
=> a | `monitor`: a `Monitor`
-> m Int32 | Returns: the physical height of the monitor

Gets the height in millimeters of the monitor.

Since: 3.22

## getManufacturer

monitorGetManufacturer Source #

Arguments

:: (HasCallStack, MonadIO m, IsMonitor a) |
=> a | `monitor`: a `Monitor`
-> m (Maybe Text) | Returns: the name of the manufacturer, or `Nothing`

Gets the name or PNP ID of the monitor's manufacturer, if available.

Note that this value might also vary depending on actual display backend.

PNP ID registry is located at https://uefi.org/pnp_id_list

## getModel

monitorGetModel Source #

Arguments

:: (HasCallStack, MonadIO m, IsMonitor a) |
=> a | `monitor`: a `Monitor`
-> m (Maybe Text) | Returns: the monitor model, or `Nothing`

Gets the a string identifying the monitor model, if available.

## getRefreshRate

monitorGetRefreshRate Source #

Arguments

:: (HasCallStack, MonadIO m, IsMonitor a) |
=> a | `monitor`: a `Monitor`
-> m Int32 | Returns: the refresh rate in milli-Hertz, or 0

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.

Since: 3.22

## getScaleFactor

monitorGetScaleFactor Source #

Arguments

:: (HasCallStack, MonadIO m, IsMonitor a) |
=> a | `monitor`: a `Monitor`
-> m Int32 | Returns: the scale factor

Gets the internal scale factor that maps from monitor coordinates to the actual device pixels. On traditional systems this is 1, but on very high density outputs this 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 window where it is better to use `windowGetScaleFactor` instead.

Since: 3.22

## getSubpixelLayout

monitorGetSubpixelLayout Source #

Arguments

:: (HasCallStack, MonadIO m, IsMonitor a) |
=> a | `monitor`: a `Monitor`
-> m SubpixelLayout | Returns: the subpixel layout

Gets information about the layout of red, green and blue primaries for each pixel in this monitor, if available.

Since: 3.22

## getWidthMm

monitorGetWidthMm Source #

Arguments

:: (HasCallStack, MonadIO m, IsMonitor a) |
=> a | `monitor`: a `Monitor`
-> m Int32 | Returns: the physical width of the monitor

Gets the width in millimeters of the monitor.

Since: 3.22

## getWorkarea

monitorGetWorkarea Source #

Arguments

:: (HasCallStack, MonadIO m, IsMonitor a) |
=> a | `monitor`: a `Monitor`
-> m Rectangle |

Retrieves the size and position of the “work area” on a monitor within the display coordinate space. The returned geometry is in ”application pixels”, not in ”device pixels” (see `monitorGetScaleFactor`).

The work area should be considered when positioning menus and similar popups, to avoid placing them below panels, docks or other desktop components.

Note that not all backends may have a concept of workarea. This function will return the monitor geometry if a workarea is not available, or does not apply.

Since: 3.22

## isPrimary

monitorIsPrimary Source #

Arguments

:: (HasCallStack, MonadIO m, IsMonitor a) |
=> a | `monitor`: a `Monitor`
-> m Bool | Returns: `True` if `monitor` is primary

Gets whether this monitor should be considered primary (see `displayGetPrimaryMonitor`).

Since: 3.22

# Properties

## display

No description available in the introspection data.

constructMonitorDisplay :: (IsMonitor o, MonadIO m, IsDisplay a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`display`” property. This is rarely needed directly, but it is used by `new`.

getMonitorDisplay :: (MonadIO m, IsMonitor o) => o -> m Display Source #

Get the value of the “`display`” property. When overloading is enabled, this is equivalent to

    get monitor #display

## geometry

No description available in the introspection data.

getMonitorGeometry :: (MonadIO m, IsMonitor o) => o -> m (Maybe Rectangle) Source #

Get the value of the “`geometry`” property. When overloading is enabled, this is equivalent to

    get monitor #geometry

## heightMm

No description available in the introspection data.

getMonitorHeightMm :: (MonadIO m, IsMonitor o) => o -> m Int32 Source #

Get the value of the “`height-mm`” property. When overloading is enabled, this is equivalent to

    get monitor #heightMm

## manufacturer

No description available in the introspection data.

getMonitorManufacturer :: (MonadIO m, IsMonitor o) => o -> m (Maybe Text) Source #

Get the value of the “`manufacturer`” property. When overloading is enabled, this is equivalent to

    get monitor #manufacturer

## model

No description available in the introspection data.

getMonitorModel :: (MonadIO m, IsMonitor o) => o -> m (Maybe Text) Source #

Get the value of the “`model`” property. When overloading is enabled, this is equivalent to

    get monitor #model

## refreshRate

No description available in the introspection data.

getMonitorRefreshRate :: (MonadIO m, IsMonitor o) => o -> m Int32 Source #

Get the value of the “`refresh-rate`” property. When overloading is enabled, this is equivalent to

    get monitor #refreshRate

## scaleFactor

No description available in the introspection data.

getMonitorScaleFactor :: (MonadIO m, IsMonitor o) => o -> m Int32 Source #

Get the value of the “`scale-factor`” property. When overloading is enabled, this is equivalent to

    get monitor #scaleFactor

## subpixelLayout

No description available in the introspection data.

getMonitorSubpixelLayout :: (MonadIO m, IsMonitor o) => o -> m SubpixelLayout Source #

Get the value of the “`subpixel-layout`” property. When overloading is enabled, this is equivalent to

    get monitor #subpixelLayout

## widthMm

No description available in the introspection data.

getMonitorWidthMm :: (MonadIO m, IsMonitor o) => o -> m Int32 Source #

Get the value of the “`width-mm`” property. When overloading is enabled, this is equivalent to

    get monitor #widthMm

## workarea

No description available in the introspection data.

getMonitorWorkarea :: (MonadIO m, IsMonitor o) => o -> m (Maybe Rectangle) Source #

Get the value of the “`workarea`” property. When overloading is enabled, this is equivalent to

    get monitor #workarea

# Signals

## invalidate

type MonitorInvalidateCallback = IO () Source #

No description available in the introspection data.

afterMonitorInvalidate :: (IsMonitor a, MonadIO m) => a -> ((?self :: a) => MonitorInvalidateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the invalidate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after monitor #invalidate callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onMonitorInvalidate :: (IsMonitor a, MonadIO m) => a -> ((?self :: a) => MonitorInvalidateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the invalidate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on monitor #invalidate callback