Top | ![]() |
![]() |
![]() |
![]() |
GdkDisplay * | gdk_monitor_get_display () |
void | gdk_monitor_get_geometry () |
void | gdk_monitor_get_workarea () |
int | gdk_monitor_get_width_mm () |
int | gdk_monitor_get_height_mm () |
const char * | gdk_monitor_get_manufacturer () |
const char * | gdk_monitor_get_model () |
const char * | gdk_monitor_get_connector () |
int | gdk_monitor_get_scale_factor () |
int | gdk_monitor_get_refresh_rate () |
GdkSubpixelLayout | gdk_monitor_get_subpixel_layout () |
gboolean | gdk_monitor_is_valid () |
gchar * | connector | Read |
GdkDisplay * | display | Read / Write / Construct Only |
GdkRectangle * | geometry | Read |
gint | height-mm | Read |
gchar * | manufacturer | Read |
gchar * | model | Read |
gint | refresh-rate | Read |
gint | scale-factor | Read |
GdkSubpixelLayout | subpixel-layout | Read |
gboolean | valid | Read |
gint | width-mm | Read |
GdkRectangle * | workarea | Read |
GdkMonitor objects represent the individual outputs that are
associated with a GdkDisplay. GdkDisplay has APIs to enumerate
monitors with gdk_display_get_n_monitors()
and gdk_display_get_monitor()
, and
to find particular monitors with gdk_display_get_primary_monitor()
or
gdk_display_get_monitor_at_surface()
.
GdkDisplay *
gdk_monitor_get_display (GdkMonitor *monitor
);
Gets the display that this monitor belongs to.
void gdk_monitor_get_geometry (GdkMonitor *monitor
,GdkRectangle *geometry
);
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 gdk_monitor_get_scale_factor()
).
void gdk_monitor_get_workarea (GdkMonitor *monitor
,GdkRectangle *workarea
);
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
gdk_monitor_get_scale_factor()
).
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.
int
gdk_monitor_get_width_mm (GdkMonitor *monitor
);
Gets the width in millimeters of the monitor.
int
gdk_monitor_get_height_mm (GdkMonitor *monitor
);
Gets the height in millimeters of the monitor.
const char *
gdk_monitor_get_manufacturer (GdkMonitor *monitor
);
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
const char *
gdk_monitor_get_model (GdkMonitor *monitor
);
Gets the a string identifying the monitor model, if available.
const char *
gdk_monitor_get_connector (GdkMonitor *monitor
);
Gets the name of the monitor's connector, if available.
int
gdk_monitor_get_scale_factor (GdkMonitor *monitor
);
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 surface
where it is better to use gdk_surface_get_scale_factor()
instead.
int
gdk_monitor_get_refresh_rate (GdkMonitor *monitor
);
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.
GdkSubpixelLayout
gdk_monitor_get_subpixel_layout (GdkMonitor *monitor
);
Gets information about the layout of red, green and blue primaries for each pixel in this monitor, if available.
gboolean
gdk_monitor_is_valid (GdkMonitor *monitor
);
Returns TRUE
if the monitor
object corresponds to a
physical monitor. The monitor
becomes invalid when the
physical monitor is unplugged or removed.
“connector”
property “connector” gchar *
The connector name.
Owner: GdkMonitor
Flags: Read
Default value: NULL
“display”
property“display” GdkDisplay *
The display of the monitor.
Owner: GdkMonitor
Flags: Read / Write / Construct Only
“geometry”
property“geometry” GdkRectangle *
The geometry of the monitor.
Owner: GdkMonitor
Flags: Read
“height-mm”
property “height-mm” gint
The height of the monitor, in millimeters.
Owner: GdkMonitor
Flags: Read
Allowed values: >= 0
Default value: 0
“manufacturer”
property “manufacturer” gchar *
The manufacturer name.
Owner: GdkMonitor
Flags: Read
Default value: NULL
“model”
property “model” gchar *
The model name.
Owner: GdkMonitor
Flags: Read
Default value: NULL
“refresh-rate”
property “refresh-rate” gint
The refresh rate, in millihertz.
Owner: GdkMonitor
Flags: Read
Allowed values: >= 0
Default value: 0
“scale-factor”
property “scale-factor” gint
The scale factor.
Owner: GdkMonitor
Flags: Read
Allowed values: >= 0
Default value: 1
“subpixel-layout”
property “subpixel-layout” GdkSubpixelLayout
The subpixel layout.
Owner: GdkMonitor
Flags: Read
Default value: GDK_SUBPIXEL_LAYOUT_UNKNOWN
“valid”
property “valid” gboolean
Whether the monitor is still valid.
Owner: GdkMonitor
Flags: Read
Default value: TRUE
“width-mm”
property “width-mm” gint
The width of the monitor, in millimeters.
Owner: GdkMonitor
Flags: Read
Allowed values: >= 0
Default value: 0
“workarea”
property“workarea” GdkRectangle *
The workarea of the monitor.
Owner: GdkMonitor
Flags: Read
“invalidate”
signalvoid user_function (GdkMonitor *monitor, gpointer user_data)
The ::invalidate signal gets emitted when the output represented
by monitor
gets disconnected.
monitor |
the object on which this signal was emitted |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First