From 626ccdce4da599615d815b8d39e3e782f5a27f06 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 9 Jun 2023 14:24:08 -0700 Subject: [PATCH] libsysprof-gtk: add columns to weighted callgraph view These don't actually do anything yet, however. --- .../libsysprof-gtk.gresource.xml | 1 + .../sysprof-weighted-callgraph-view.c | 12 +++++++ .../sysprof-weighted-callgraph-view.ui | 36 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 src/libsysprof-gtk/sysprof-weighted-callgraph-view.ui diff --git a/src/libsysprof-gtk/libsysprof-gtk.gresource.xml b/src/libsysprof-gtk/libsysprof-gtk.gresource.xml index c4a74e39..a7d26acf 100644 --- a/src/libsysprof-gtk/libsysprof-gtk.gresource.xml +++ b/src/libsysprof-gtk/libsysprof-gtk.gresource.xml @@ -2,6 +2,7 @@ sysprof-callgraph-view.ui + sysprof-weighted-callgraph-view.ui style.css diff --git a/src/libsysprof-gtk/sysprof-weighted-callgraph-view.c b/src/libsysprof-gtk/sysprof-weighted-callgraph-view.c index 230b302a..9a4227f6 100644 --- a/src/libsysprof-gtk/sysprof-weighted-callgraph-view.c +++ b/src/libsysprof-gtk/sysprof-weighted-callgraph-view.c @@ -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 * diff --git a/src/libsysprof-gtk/sysprof-weighted-callgraph-view.ui b/src/libsysprof-gtk/sysprof-weighted-callgraph-view.ui new file mode 100644 index 00000000..fc612f14 --- /dev/null +++ b/src/libsysprof-gtk/sysprof-weighted-callgraph-view.ui @@ -0,0 +1,36 @@ + + + +