libsysprof-analyze: add API to read back the min/max ranges

This commit is contained in:
Christian Hergert
2023-06-16 16:58:46 -07:00
parent 06767c0a1d
commit 4e5e6be841
2 changed files with 29 additions and 1 deletions

View File

@ -192,3 +192,25 @@ sysprof_xy_series_sort (SysprofXYSeries *self)
sizeof (SysprofXYSeriesValue),
compare_by_xy);
}
void
sysprof_xy_series_get_range (SysprofXYSeries *self,
float *min_x,
float *min_y,
float *max_x,
float *max_y)
{
g_return_if_fail (self != NULL);
if (min_x)
*min_x = self->min_x;
if (max_x)
*max_x = self->max_x;
if (min_y)
*min_y = self->min_y;
if (max_y)
*max_y = self->max_y;
}

View File

@ -61,7 +61,13 @@ SYSPROF_AVAILABLE_IN_ALL
GListModel *sysprof_xy_series_get_model (SysprofXYSeries *self);
SYSPROF_AVAILABLE_IN_ALL
const SysprofXYSeriesValue *sysprof_xy_series_get_values (const SysprofXYSeries *self,
guint *n_values);
guint *n_values);
SYSPROF_AVAILABLE_IN_ALL
void sysprof_xy_series_get_range (SysprofXYSeries *self,
float *min_x,
float *min_y,
float *max_x,
float *max_y);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (SysprofXYSeries, sysprof_xy_series_unref)