enum {
PROP_0,
+ PROP_DESCRIPTION,
PROP_DISPLAY,
PROP_MANUFACTURER,
PROP_MODEL,
switch (prop_id)
{
+ case PROP_DESCRIPTION:
+ g_value_set_string (value, monitor->description);
+ break;
+
case PROP_DISPLAY:
g_value_set_object (value, monitor->display);
break;
{
GdkMonitor *monitor = GDK_MONITOR (object);
+ g_free (monitor->description);
g_free (monitor->connector);
g_free (monitor->manufacturer);
g_free (monitor->model);
object_class->get_property = gdk_monitor_get_property;
object_class->set_property = gdk_monitor_set_property;
+ /**
+ * GdkMonitor:description: (attributes org.gtk.Property.get=gdk_monitor_get_description)
+ *
+ * A short description of the monitor, meant for display to the user.
+ *
+ * Since: 4.10
+ */
+ props[PROP_DESCRIPTION] =
+ g_param_spec_string ("description", NULL, NULL,
+ NULL,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
/**
* GdkMonitor:display: (attributes org.gtk.Property.get=gdk_monitor_get_display)
*
return monitor->valid;
}
+
+/**
+ * gdk_monitor_get_description: (attributes org.gtk.Method.get_property=description)
+ * @monitor: a `GdkMonitor`
+ *
+ * Gets a string describing the monitor, if available.
+ *
+ * This can be used to identify a monitor in the UI.
+ *
+ * Returns: (transfer none) (nullable): the monitor description
+ *
+ * Since: 4.10
+ */
+const char *
+gdk_monitor_get_description (GdkMonitor *monitor)
+{
+ g_return_val_if_fail (GDK_IS_MONITOR (monitor), NULL);
+
+ return monitor->description;
+}
+
+void
+gdk_monitor_set_description (GdkMonitor *monitor,
+ const char *description)
+{
+ g_free (monitor->description);
+ monitor->description = g_strdup (description);
+ g_object_notify_by_pspec (G_OBJECT (monitor), props[PROP_DESCRIPTION]);
+}
+
char *manufacturer;
char *model;
char *connector;
+ char *description;
GdkRectangle geometry;
int width_mm;
int height_mm;
void gdk_monitor_set_subpixel_layout (GdkMonitor *monitor,
GdkSubpixelLayout subpixel);
void gdk_monitor_invalidate (GdkMonitor *monitor);
+void gdk_monitor_set_description (GdkMonitor *monitor,
+ const char *description);
G_END_DECLS