Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GdkMonitor
objects represent the individual outputs that are
associated with a GdkDisplay
.
GdkDisplay
keeps a GListModel
to enumerate and monitor
monitors with displayGetMonitors
. You can use
displayGetMonitorAtSurface
to find a particular
monitor.
Synopsis
- newtype Monitor = Monitor (ManagedPtr Monitor)
- class (GObject o, IsDescendantOf Monitor o) => IsMonitor o
- toMonitor :: (MonadIO m, IsMonitor o) => o -> m Monitor
- monitorGetConnector :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m (Maybe Text)
- monitorGetDescription :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m (Maybe Text)
- 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
- monitorGetScale :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Double
- 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
- monitorIsValid :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Bool
- getMonitorConnector :: (MonadIO m, IsMonitor o) => o -> m (Maybe Text)
- getMonitorDescription :: (MonadIO m, IsMonitor o) => o -> m (Maybe Text)
- 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
- getMonitorScale :: (MonadIO m, IsMonitor o) => o -> m Double
- getMonitorScaleFactor :: (MonadIO m, IsMonitor o) => o -> m Int32
- getMonitorSubpixelLayout :: (MonadIO m, IsMonitor o) => o -> m SubpixelLayout
- getMonitorValid :: (MonadIO m, IsMonitor o) => o -> m Bool
- getMonitorWidthMm :: (MonadIO m, IsMonitor o) => o -> m Int32
- 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
Memory-managed wrapper type.
Instances
Eq Monitor Source # | |
GObject Monitor Source # | |
Defined in GI.Gdk.Objects.Monitor | |
ManagedPtrNewtype Monitor Source # | |
Defined in GI.Gdk.Objects.Monitor toManagedPtr :: Monitor -> ManagedPtr Monitor # | |
TypedObject Monitor Source # | |
Defined in GI.Gdk.Objects.Monitor | |
HasParentTypes Monitor Source # | |
Defined in GI.Gdk.Objects.Monitor | |
IsGValue (Maybe Monitor) Source # | Convert |
Defined in GI.Gdk.Objects.Monitor | |
type ParentTypes Monitor Source # | |
Defined in GI.Gdk.Objects.Monitor type ParentTypes Monitor = '[Object] |
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, isValid, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getConnector, getData, getDescription, getDisplay, getGeometry, getHeightMm, getManufacturer, getModel, getProperty, getQdata, getRefreshRate, getScale, getScaleFactor, getSubpixelLayout, getWidthMm.
Setters
getConnector
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m (Maybe Text) | Returns: the name of the connector |
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.
getDescription
monitorGetDescription Source #
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m (Maybe Text) | Returns: the monitor description |
Gets a string describing the monitor, if available.
This can be used to identify a monitor in the UI.
Since: 4.10
getDisplay
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m Display | Returns: the display |
Gets the display that this monitor belongs to.
getGeometry
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m Rectangle |
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 monitorGetScale
).
getHeightMm
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m Int32 | Returns: the physical height of the monitor |
Gets the height in millimeters of the monitor.
getManufacturer
monitorGetManufacturer Source #
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m (Maybe Text) | Returns: the name of the manufacturer |
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.
getModel
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m (Maybe Text) | Returns: the monitor model |
Gets the string identifying the monitor model, if available.
getRefreshRate
monitorGetRefreshRate Source #
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> 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.
getScale
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m Double | Returns: the scale |
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 surfaceGetScale
instead.
Since: 4.14
getScaleFactor
monitorGetScaleFactor Source #
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m Int32 | Returns: the scale factor |
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 surfaceGetScaleFactor
instead.
getSubpixelLayout
monitorGetSubpixelLayout Source #
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m SubpixelLayout | Returns: the subpixel layout |
Gets information about the layout of red, green and blue primaries for pixels.
getWidthMm
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m Int32 | Returns: the physical width of the monitor |
Gets the width in millimeters of the monitor.
isValid
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m Bool | Returns: |
Returns True
if the monitor
object corresponds to a
physical monitor.
The monitor
becomes invalid when the physical monitor
is unplugged or removed.
Properties
connector
The connector name.
getMonitorConnector :: (MonadIO m, IsMonitor o) => o -> m (Maybe Text) Source #
Get the value of the “connector
” property.
When overloading is enabled, this is equivalent to
get
monitor #connector
description
A short description of the monitor, meant for display to the user.
Since: 4.10
getMonitorDescription :: (MonadIO m, IsMonitor o) => o -> m (Maybe Text) Source #
Get the value of the “description
” property.
When overloading is enabled, this is equivalent to
get
monitor #description
display
The GdkDisplay
of the monitor.
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
The geometry of the monitor.
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
The height of the monitor, in millimeters.
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
The manufacturer name.
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
The model name.
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
The refresh rate, in milli-Hertz.
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
scale
The scale of the monitor.
Since: 4.14
getMonitorScale :: (MonadIO m, IsMonitor o) => o -> m Double Source #
Get the value of the “scale
” property.
When overloading is enabled, this is equivalent to
get
monitor #scale
scaleFactor
The scale factor.
The scale factor is the next larger integer, compared to Surface:scale.
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
The subpixel layout.
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
valid
Whether the object is still valid.
getMonitorValid :: (MonadIO m, IsMonitor o) => o -> m Bool Source #
Get the value of the “valid
” property.
When overloading is enabled, this is equivalent to
get
monitor #valid
widthMm
The width of the monitor, in millimeters.
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
Signals
invalidate
type MonitorInvalidateCallback = IO () Source #
Emitted when the output represented by monitor
gets disconnected.
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