[gtk/surface-scale: 1/4] surface: Add a scale-factor property
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/surface-scale: 1/4] surface: Add a scale-factor property
- Date: Sat, 16 Jan 2021 20:23:01 +0000 (UTC)
commit aefc630d29c4d9b57229bcffd7461bf02598ce20
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jan 16 15:16:36 2021 -0500
surface: Add a scale-factor property
This will allow us to notify when the scale changes.
gdk/gdksurface.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 35c47a3476..ec48ad3543 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -92,6 +92,7 @@ enum {
PROP_MAPPED,
PROP_WIDTH,
PROP_HEIGHT,
+ PROP_SCALE_FACTOR,
LAST_PROP
};
@@ -551,6 +552,13 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
0, G_MAXINT, 0,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ properties[PROP_SCALE_FACTOR] =
+ g_param_spec_int ("scale-factor",
+ P_("Scale factor"),
+ P_("Scale factor"),
+ 1, G_MAXINT, 1,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+
g_object_class_install_properties (object_class, LAST_PROP, properties);
/**
@@ -782,6 +790,10 @@ gdk_surface_get_property (GObject *object,
g_value_set_int (value, surface->height);
break;
+ case PROP_SCALE_FACTOR:
+ g_value_set_int (value, gdk_surface_get_scale_factor (surface));
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]