From 92261dfc17d145407610439d5ce3284a6bb15ac3 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 27 Jun 2023 12:33:50 -0700 Subject: [PATCH] libsysprof-gtk: give access to normalized model This can be handy from the inspector so you can inspect the normalized values for the charts. --- src/libsysprof-gtk/sysprof-xy-layer.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/libsysprof-gtk/sysprof-xy-layer.c b/src/libsysprof-gtk/sysprof-xy-layer.c index edfdc9c0..28d84980 100644 --- a/src/libsysprof-gtk/sysprof-xy-layer.c +++ b/src/libsysprof-gtk/sysprof-xy-layer.c @@ -27,6 +27,8 @@ enum { PROP_SERIES, PROP_X_AXIS, PROP_Y_AXIS, + PROP_NORMALIZED_X, + PROP_NORMALIZED_Y, N_PROPS }; @@ -71,6 +73,16 @@ sysprof_xy_layer_get_property (GObject *object, g_value_set_object (value, sysprof_xy_layer_get_y_axis (self)); break; + case PROP_NORMALIZED_X: + /* For inspector debugging */ + g_value_set_object (value, self->normal_x); + break; + + case PROP_NORMALIZED_Y: + /* For inspector debugging */ + g_value_set_object (value, self->normal_y); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } @@ -127,6 +139,16 @@ sysprof_xy_layer_class_init (SysprofXYLayerClass *klass) SYSPROF_TYPE_AXIS, (G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS)); + properties [PROP_NORMALIZED_X] = + g_param_spec_object ("normalized-x", NULL, NULL, + SYSPROF_TYPE_NORMALIZED_SERIES, + (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + + properties [PROP_NORMALIZED_Y] = + g_param_spec_object ("normalized-y", NULL, NULL, + SYSPROF_TYPE_NORMALIZED_SERIES, + (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); + g_object_class_install_properties (object_class, N_PROPS, properties); }