mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-08 19:50:21 +00:00
Add private getter for a monitor connector
The migration from GdkScreen's monitor API to GdkMonitor left out a way to get the connector's name of a monitor. While there's no real guarantee that the connector's name is stable, some system components used it to uniquely identify a monitor until the next plug in/out event. Since GTK 3 is API stable, we can only add a private setter and getter functions pair, without a property.
This commit is contained in:
parent
4119578562
commit
af778ec7d0
@ -155,6 +155,7 @@ gdk_monitor_finalize (GObject *object)
|
|||||||
{
|
{
|
||||||
GdkMonitor *monitor = GDK_MONITOR (object);
|
GdkMonitor *monitor = GDK_MONITOR (object);
|
||||||
|
|
||||||
|
g_free (monitor->connector);
|
||||||
g_free (monitor->manufacturer);
|
g_free (monitor->manufacturer);
|
||||||
g_free (monitor->model);
|
g_free (monitor->model);
|
||||||
|
|
||||||
@ -354,6 +355,22 @@ gdk_monitor_get_height_mm (GdkMonitor *monitor)
|
|||||||
return monitor->height_mm;
|
return monitor->height_mm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_monitor_get_connector:
|
||||||
|
* @monitor: a #GdkMonitor
|
||||||
|
*
|
||||||
|
* Gets the name of the monitor's connector, if available.
|
||||||
|
*
|
||||||
|
* Returns: (transfer none) (nullable): the name of the connector
|
||||||
|
*/
|
||||||
|
const char *
|
||||||
|
gdk_monitor_get_connector (GdkMonitor *monitor)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GDK_IS_MONITOR (monitor), NULL);
|
||||||
|
|
||||||
|
return monitor->connector;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gdk_monitor_get_manufacturer:
|
* gdk_monitor_get_manufacturer:
|
||||||
* @monitor: a #GdkMonitor
|
* @monitor: a #GdkMonitor
|
||||||
@ -493,6 +510,16 @@ gdk_monitor_set_model (GdkMonitor *monitor,
|
|||||||
g_object_notify (G_OBJECT (monitor), "model");
|
g_object_notify (G_OBJECT (monitor), "model");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gdk_monitor_set_connector (GdkMonitor *monitor,
|
||||||
|
const char *connector)
|
||||||
|
{
|
||||||
|
g_free (monitor->connector);
|
||||||
|
monitor->connector = g_strdup (connector);
|
||||||
|
|
||||||
|
/* g_object_notify (G_OBJECT (monitor), "connector"); */
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gdk_monitor_set_position (GdkMonitor *monitor,
|
gdk_monitor_set_position (GdkMonitor *monitor,
|
||||||
int x,
|
int x,
|
||||||
|
@ -36,6 +36,7 @@ struct _GdkMonitor {
|
|||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
char *manufacturer;
|
char *manufacturer;
|
||||||
char *model;
|
char *model;
|
||||||
|
char *connector;
|
||||||
GdkRectangle geometry;
|
GdkRectangle geometry;
|
||||||
int width_mm;
|
int width_mm;
|
||||||
int height_mm;
|
int height_mm;
|
||||||
@ -57,6 +58,9 @@ void gdk_monitor_set_manufacturer (GdkMonitor *monitor,
|
|||||||
const char *manufacturer);
|
const char *manufacturer);
|
||||||
void gdk_monitor_set_model (GdkMonitor *monitor,
|
void gdk_monitor_set_model (GdkMonitor *monitor,
|
||||||
const char *model);
|
const char *model);
|
||||||
|
void gdk_monitor_set_connector (GdkMonitor *monitor,
|
||||||
|
const char *connector);
|
||||||
|
const char * gdk_monitor_get_connector (GdkMonitor *monitor);
|
||||||
void gdk_monitor_set_position (GdkMonitor *monitor,
|
void gdk_monitor_set_position (GdkMonitor *monitor,
|
||||||
int x,
|
int x,
|
||||||
int y);
|
int y);
|
||||||
|
Loading…
Reference in New Issue
Block a user