libsysprof-gtk: add columns to weighted callgraph view

These don't actually do anything yet, however.
This commit is contained in:
Christian Hergert
2023-06-09 14:24:08 -07:00
parent c5b5ae9df7
commit 626ccdce4d
3 changed files with 49 additions and 0 deletions

View File

@ -2,6 +2,7 @@
<gresources>
<gresource prefix="/libsysprof-gtk">
<file preprocess="xml-stripblanks">sysprof-callgraph-view.ui</file>
<file preprocess="xml-stripblanks">sysprof-weighted-callgraph-view.ui</file>
<file>style.css</file>
</gresource>
</gresources>

View File

@ -22,10 +22,14 @@
#include "sysprof-callgraph-view-private.h"
#include "sysprof-weighted-callgraph-view.h"
#include "sysprof-progress-cell-private.h"
struct _SysprofWeightedCallgraphView
{
SysprofCallgraphView parent_instance;
GtkColumnViewColumn *self_column;
GtkColumnViewColumn *total_column;
};
struct _SysprofWeightedCallgraphViewClass
@ -75,14 +79,22 @@ static void
sysprof_weighted_callgraph_view_class_init (SysprofWeightedCallgraphViewClass *klass)
{
SysprofCallgraphViewClass *callgraph_view_class = SYSPROF_CALLGRAPH_VIEW_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
callgraph_view_class->augment_size = sizeof (AugmentWeight);
callgraph_view_class->augment_func = augment_weight;
gtk_widget_class_set_template_from_resource (widget_class, "/libsysprof-gtk/sysprof-weighted-callgraph-view.ui");
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, self_column);
gtk_widget_class_bind_template_child (widget_class, SysprofWeightedCallgraphView, total_column);
g_type_ensure (SYSPROF_TYPE_PROGRESS_CELL);
}
static void
sysprof_weighted_callgraph_view_init (SysprofWeightedCallgraphView *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
GtkWidget *

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="SysprofWeightedCallgraphView" parent="SysprofCallgraphView">
<child internal-child="column_view">
<object class="GtkColumnView">
<child>
<object class="GtkColumnViewColumn" id="self_column">
<property name="title" translatable="yes">Self</property>
</object>
</child>
<child>
<object class="GtkColumnViewColumn" id="total_column">
<property name="title" translatable="yes">Total</property>
<property name="factory">
<object class="GtkBuilderListItemFactory">
<property name="bytes"><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GtkListItem">
<property name="child">
<object class="SysprofProgressCell" id="progress">
<property name="fraction">.50</property>
</object>
</property>
</template>
</interface>
]]>
</property>
</object>
</property>
</object>
</child>
</object>
</child>
</template>
</interface>