Package ch.bailu.gtk.gdk
Class Monitor
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gdk.Monitor
- All Implemented Interfaces:
PointerInterface
`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.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassHandler
Gets the name of the monitor's connector, if available.Gets the display that this monitor belongs to.void
getGeometry
(Rectangle geometry) Retrieves the size and position of the monitor within the
display coordinate space.int
Gets the height in millimeters of the monitor.static int
Gets the name or PNP ID of the monitor's manufacturer.getModel()
Gets the string identifying the monitor model, if available.static long
static TypeSystem.TypeSize
int
Gets the refresh rate of the monitor, if available.int
Gets the internal scale factor that maps from monitor coordinates
to device pixels.int
Gets information about the layout of red, green and blue
primaries for pixels.static long
static TypeSystem.TypeSize
int
Gets the width in millimeters of the monitor.boolean
isValid()
Returns %TRUE if the @monitor object corresponds to a
physical monitor.onInvalidate
(Monitor.OnInvalidate signal) Connect to signal "invalidate".Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_INVALIDATE
- See Also:
-
-
Constructor Details
-
Monitor
-
-
Method Details
-
getClassHandler
-
getConnector
Gets the name of the monitor's connector, if available.- Returns:
- the name of the connector
-
getDisplay
Gets the display that this monitor belongs to.- Returns:
- the display
-
getGeometry
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
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
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
Connect to signal "invalidate".
SeeMonitor.OnInvalidate.onInvalidate()
for signal description.
FieldSIGNAL_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
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-