libsysprof-gtk: get expressions for x/y of counter values

This commit is contained in:
Christian Hergert
2023-06-26 18:14:25 -07:00
parent b022b1537e
commit 696205aaf2
3 changed files with 14 additions and 3 deletions

View File

@ -31,6 +31,7 @@ struct _SysprofDocumentCounterValue
enum {
PROP_0,
PROP_TIME,
PROP_VALUE_DOUBLE,
N_PROPS
};
@ -52,6 +53,10 @@ sysprof_document_counter_value_get_property (GObject *object,
g_value_set_int64 (value, sysprof_document_counter_value_get_time (self));
break;
case PROP_VALUE_DOUBLE:
g_value_set_double (value, sysprof_document_counter_value_get_value_double (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@ -66,7 +71,12 @@ sysprof_document_counter_value_class_init (SysprofDocumentCounterValueClass *kla
properties [PROP_TIME] =
g_param_spec_int64 ("time", NULL, NULL,
G_MININT64, 0, G_MAXINT64,
G_MININT64, G_MAXINT64, 0,
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
properties[PROP_VALUE_DOUBLE] =
g_param_spec_double ("value-double", NULL, NULL,
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
(G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
g_object_class_install_properties (object_class, N_PROPS, properties);

View File

@ -202,6 +202,7 @@ test_charts_class_init (TestChartsClass *klass)
g_type_ensure (SYSPROF_TYPE_CHART_LAYER);
g_type_ensure (SYSPROF_TYPE_COLUMN_LAYER);
g_type_ensure (SYSPROF_TYPE_LINE_LAYER);
g_type_ensure (SYSPROF_TYPE_DOCUMENT_COUNTER_VALUE);
g_type_ensure (SYSPROF_TYPE_VALUE_AXIS);
}

View File

@ -108,10 +108,10 @@
<lookup name="item">GtkListItem</lookup>
</binding>
<property name="x-expression">
<lookup name="time" type="SysprofDocumentFrame"/>
<lookup name="time" type="SysprofDocumentCounterValue"/>
</property>
<property name="y-expression">
<lookup name="time" type="SysprofDocumentFrame"/>
<lookup name="value-double" type="SysprofDocumentCounterValue"/>
</property>
</object>
</property>