Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
GdkMonitor objects represent the individual outputs that are
associated with a Display
. GdkDisplay has APIs to enumerate
monitors with gdk_display_get_monitors()
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.
- newtype Monitor = Monitor (ManagedPtr Monitor)
- class GObject o => IsMonitor o
- toMonitor :: IsMonitor o => o -> IO Monitor
- noMonitor :: Maybe Monitor
- data MonitorGetDisplayMethodInfo
- monitorGetDisplay :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Display
- data MonitorGetGeometryMethodInfo
- monitorGetGeometry :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Rectangle
- data MonitorGetHeightMmMethodInfo
- monitorGetHeightMm :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Int32
- data MonitorGetManufacturerMethodInfo
- monitorGetManufacturer :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m (Maybe Text)
- data MonitorGetModelMethodInfo
- monitorGetModel :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m (Maybe Text)
- data MonitorGetRefreshRateMethodInfo
- monitorGetRefreshRate :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Int32
- data MonitorGetScaleFactorMethodInfo
- monitorGetScaleFactor :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Int32
- data MonitorGetSubpixelLayoutMethodInfo
- monitorGetSubpixelLayout :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m SubpixelLayout
- data MonitorGetWidthMmMethodInfo
- monitorGetWidthMm :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Int32
- data MonitorGetWorkareaMethodInfo
- monitorGetWorkarea :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Rectangle
- data MonitorIsPrimaryMethodInfo
- monitorIsPrimary :: (HasCallStack, MonadIO m, IsMonitor a) => a -> m Bool
- data MonitorDisplayPropertyInfo
- constructMonitorDisplay :: (IsMonitor o, IsDisplay a) => a -> IO (GValueConstruct o)
- getMonitorDisplay :: (MonadIO m, IsMonitor o) => o -> m Display
- monitorDisplay :: AttrLabelProxy "display"
- data MonitorGeometryPropertyInfo
- getMonitorGeometry :: (MonadIO m, IsMonitor o) => o -> m (Maybe Rectangle)
- monitorGeometry :: AttrLabelProxy "geometry"
- data MonitorHeightMmPropertyInfo
- getMonitorHeightMm :: (MonadIO m, IsMonitor o) => o -> m Int32
- monitorHeightMm :: AttrLabelProxy "heightMm"
- data MonitorManufacturerPropertyInfo
- getMonitorManufacturer :: (MonadIO m, IsMonitor o) => o -> m (Maybe Text)
- monitorManufacturer :: AttrLabelProxy "manufacturer"
- data MonitorModelPropertyInfo
- getMonitorModel :: (MonadIO m, IsMonitor o) => o -> m (Maybe Text)
- monitorModel :: AttrLabelProxy "model"
- data MonitorRefreshRatePropertyInfo
- getMonitorRefreshRate :: (MonadIO m, IsMonitor o) => o -> m Int32
- monitorRefreshRate :: AttrLabelProxy "refreshRate"
- data MonitorScaleFactorPropertyInfo
- getMonitorScaleFactor :: (MonadIO m, IsMonitor o) => o -> m Int32
- monitorScaleFactor :: AttrLabelProxy "scaleFactor"
- data MonitorSubpixelLayoutPropertyInfo
- getMonitorSubpixelLayout :: (MonadIO m, IsMonitor o) => o -> m SubpixelLayout
- monitorSubpixelLayout :: AttrLabelProxy "subpixelLayout"
- data MonitorWidthMmPropertyInfo
- getMonitorWidthMm :: (MonadIO m, IsMonitor o) => o -> m Int32
- monitorWidthMm :: AttrLabelProxy "widthMm"
- data MonitorWorkareaPropertyInfo
- getMonitorWorkarea :: (MonadIO m, IsMonitor o) => o -> m (Maybe Rectangle)
- monitorWorkarea :: AttrLabelProxy "workarea"
- type C_MonitorInvalidateCallback = Ptr () -> Ptr () -> IO ()
- type MonitorInvalidateCallback = IO ()
- data MonitorInvalidateSignalInfo
- afterMonitorInvalidate :: (GObject a, MonadIO m) => a -> MonitorInvalidateCallback -> m SignalHandlerId
- genClosure_MonitorInvalidate :: MonitorInvalidateCallback -> IO Closure
- mk_MonitorInvalidateCallback :: C_MonitorInvalidateCallback -> IO (FunPtr C_MonitorInvalidateCallback)
- noMonitorInvalidateCallback :: Maybe MonitorInvalidateCallback
- onMonitorInvalidate :: (GObject a, MonadIO m) => a -> MonitorInvalidateCallback -> m SignalHandlerId
- wrap_MonitorInvalidateCallback :: MonitorInvalidateCallback -> Ptr () -> Ptr () -> IO ()
Exported types
GObject Monitor Source # | |
IsObject Monitor Source # | |
IsMonitor Monitor Source # | |
((~) * info (ResolveMonitorMethod t Monitor), MethodInfo * info Monitor p) => IsLabel t (Monitor -> p) Source # | |
((~) * info (ResolveMonitorMethod t Monitor), MethodInfo * info Monitor p) => IsLabelProxy t (Monitor -> p) Source # | |
HasAttributeList * Monitor Source # | |
type AttributeList Monitor Source # | |
type SignalList Monitor Source # | |
Methods
getDisplay
data MonitorGetDisplayMethodInfo Source #
((~) * signature (m Display), MonadIO m, IsMonitor a) => MethodInfo * MonitorGetDisplayMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m Display | Returns: the display |
Gets the display that this monitor belongs to.
Since: 3.22
getGeometry
data MonitorGetGeometryMethodInfo Source #
((~) * signature (m Rectangle), MonadIO m, IsMonitor a) => MethodInfo * MonitorGetGeometryMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> 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
data MonitorGetHeightMmMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsMonitor a) => MethodInfo * MonitorGetHeightMmMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m Int32 | Returns: the physical height of the monitor |
Gets the height in millimeters of the monitor.
Since: 3.22
getManufacturer
data MonitorGetManufacturerMethodInfo Source #
((~) * signature (m (Maybe Text)), MonadIO m, IsMonitor a) => MethodInfo * MonitorGetManufacturerMethodInfo a signature Source # | |
monitorGetManufacturer Source #
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m (Maybe Text) | Returns: the name of the manufacturer, or |
Gets the name of the monitor's manufacturer, if available.
getModel
data MonitorGetModelMethodInfo Source #
((~) * signature (m (Maybe Text)), MonadIO m, IsMonitor a) => MethodInfo * MonitorGetModelMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m (Maybe Text) | Returns: the monitor model, or |
Gets the a string identifying the monitor model, if available.
getRefreshRate
data MonitorGetRefreshRateMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsMonitor a) => MethodInfo * MonitorGetRefreshRateMethodInfo a signature Source # | |
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.
Since: 3.22
getScaleFactor
data MonitorGetScaleFactorMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsMonitor a) => MethodInfo * MonitorGetScaleFactorMethodInfo a signature Source # | |
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 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
data MonitorGetSubpixelLayoutMethodInfo Source #
((~) * signature (m SubpixelLayout), MonadIO m, IsMonitor a) => MethodInfo * MonitorGetSubpixelLayoutMethodInfo a signature Source # | |
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 each pixel in this monitor, if available.
Since: 3.22
getWidthMm
data MonitorGetWidthMmMethodInfo Source #
((~) * signature (m Int32), MonadIO m, IsMonitor a) => MethodInfo * MonitorGetWidthMmMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m Int32 | Returns: the physical width of the monitor |
Gets the width in millimeters of the monitor.
Since: 3.22
getWorkarea
data MonitorGetWorkareaMethodInfo Source #
((~) * signature (m Rectangle), MonadIO m, IsMonitor a) => MethodInfo * MonitorGetWorkareaMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> 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
data MonitorIsPrimaryMethodInfo Source #
((~) * signature (m Bool), MonadIO m, IsMonitor a) => MethodInfo * MonitorIsPrimaryMethodInfo a signature Source # | |
:: (HasCallStack, MonadIO m, IsMonitor a) | |
=> a |
|
-> m Bool | Returns: |
Gets whether this monitor should be considered primary
(see displayGetPrimaryMonitor
).
Since: 3.22
Properties
display
data MonitorDisplayPropertyInfo Source #
constructMonitorDisplay :: (IsMonitor o, IsDisplay a) => a -> IO (GValueConstruct o) Source #
monitorDisplay :: AttrLabelProxy "display" Source #
geometry
data MonitorGeometryPropertyInfo Source #
monitorGeometry :: AttrLabelProxy "geometry" Source #
heightMm
data MonitorHeightMmPropertyInfo Source #
monitorHeightMm :: AttrLabelProxy "heightMm" Source #
manufacturer
data MonitorManufacturerPropertyInfo Source #
monitorManufacturer :: AttrLabelProxy "manufacturer" Source #
model
data MonitorModelPropertyInfo Source #
monitorModel :: AttrLabelProxy "model" Source #
refreshRate
data MonitorRefreshRatePropertyInfo Source #
monitorRefreshRate :: AttrLabelProxy "refreshRate" Source #
scaleFactor
data MonitorScaleFactorPropertyInfo Source #
monitorScaleFactor :: AttrLabelProxy "scaleFactor" Source #
subpixelLayout
data MonitorSubpixelLayoutPropertyInfo Source #
getMonitorSubpixelLayout :: (MonadIO m, IsMonitor o) => o -> m SubpixelLayout Source #
monitorSubpixelLayout :: AttrLabelProxy "subpixelLayout" Source #
widthMm
data MonitorWidthMmPropertyInfo Source #
monitorWidthMm :: AttrLabelProxy "widthMm" Source #
workarea
data MonitorWorkareaPropertyInfo Source #
monitorWorkarea :: AttrLabelProxy "workarea" Source #
Signals
invalidate
type MonitorInvalidateCallback = IO () Source #
afterMonitorInvalidate :: (GObject a, MonadIO m) => a -> MonitorInvalidateCallback -> m SignalHandlerId Source #
mk_MonitorInvalidateCallback :: C_MonitorInvalidateCallback -> IO (FunPtr C_MonitorInvalidateCallback) Source #
onMonitorInvalidate :: (GObject a, MonadIO m) => a -> MonitorInvalidateCallback -> m SignalHandlerId Source #
wrap_MonitorInvalidateCallback :: MonitorInvalidateCallback -> Ptr () -> Ptr () -> IO () Source #