diff --git a/src/sysprof/meson.build b/src/sysprof/meson.build index 5e1101a4..0bda8cfd 100644 --- a/src/sysprof/meson.build +++ b/src/sysprof/meson.build @@ -6,6 +6,7 @@ sysprof_sources = [ 'sysprof-logs-section.c', 'sysprof-marks-section.c', 'sysprof-metadata-dialog.c', + 'sysprof-metadata-section.c', 'sysprof-recording-pad.c', 'sysprof-samples-section.c', 'sysprof-section.c', diff --git a/src/sysprof/sysprof-metadata-section.c b/src/sysprof/sysprof-metadata-section.c new file mode 100644 index 00000000..63311c54 --- /dev/null +++ b/src/sysprof/sysprof-metadata-section.c @@ -0,0 +1,68 @@ +/* sysprof-metadata-section.c + * + * Copyright 2023 Christian Hergert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#include "config.h" + +#include + +#include +#include + +#include "sysprof-metadata-section.h" + +struct _SysprofMetadataSection +{ + SysprofSection parent_instance; + + GtkColumnView *column_view; +}; + +G_DEFINE_FINAL_TYPE (SysprofMetadataSection, sysprof_metadata_section, SYSPROF_TYPE_SECTION) + +static void +sysprof_metadata_section_dispose (GObject *object) +{ + SysprofMetadataSection *self = (SysprofMetadataSection *)object; + + gtk_widget_dispose_template (GTK_WIDGET (self), SYSPROF_TYPE_METADATA_SECTION); + + G_OBJECT_CLASS (sysprof_metadata_section_parent_class)->dispose (object); +} + +static void +sysprof_metadata_section_class_init (SysprofMetadataSectionClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + object_class->dispose = sysprof_metadata_section_dispose; + + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-metadata-section.ui"); + gtk_widget_class_bind_template_child (widget_class, SysprofMetadataSection, column_view); + + g_type_ensure (SYSPROF_TYPE_DOCUMENT_METADATA); + g_type_ensure (SYSPROF_TYPE_TIME_LABEL); +} + +static void +sysprof_metadata_section_init (SysprofMetadataSection *self) +{ + gtk_widget_init_template (GTK_WIDGET (self)); +} diff --git a/src/sysprof/sysprof-metadata-section.h b/src/sysprof/sysprof-metadata-section.h new file mode 100644 index 00000000..a17129a8 --- /dev/null +++ b/src/sysprof/sysprof-metadata-section.h @@ -0,0 +1,31 @@ +/* sysprof-metadata-section.h + * + * Copyright 2023 Christian Hergert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +#pragma once + +#include "sysprof-section.h" + +G_BEGIN_DECLS + +#define SYSPROF_TYPE_METADATA_SECTION (sysprof_metadata_section_get_type()) + +G_DECLARE_FINAL_TYPE (SysprofMetadataSection, sysprof_metadata_section, SYSPROF, METADATA_SECTION, SysprofSection) + +G_END_DECLS diff --git a/src/sysprof/sysprof-metadata-section.ui b/src/sysprof/sysprof-metadata-section.ui new file mode 100644 index 00000000..cff85ec6 --- /dev/null +++ b/src/sysprof/sysprof-metadata-section.ui @@ -0,0 +1,146 @@ + + + + + diff --git a/src/sysprof/sysprof-window.c b/src/sysprof/sysprof-window.c index 53285d7b..b11c66d7 100644 --- a/src/sysprof/sysprof-window.c +++ b/src/sysprof/sysprof-window.c @@ -29,6 +29,7 @@ #include "sysprof-logs-section.h" #include "sysprof-marks-section.h" #include "sysprof-metadata-dialog.h" +#include "sysprof-metadata-section.h" #include "sysprof-samples-section.h" #include "sysprof-sidebar.h" #include "sysprof-window.h" @@ -186,6 +187,7 @@ sysprof_window_class_init (SysprofWindowClass *klass) g_type_ensure (SYSPROF_TYPE_FILES_SECTION); g_type_ensure (SYSPROF_TYPE_LOGS_SECTION); g_type_ensure (SYSPROF_TYPE_MARKS_SECTION); + g_type_ensure (SYSPROF_TYPE_METADATA_SECTION); g_type_ensure (SYSPROF_TYPE_SAMPLES_SECTION); g_type_ensure (SYSPROF_TYPE_SESSION); g_type_ensure (SYSPROF_TYPE_SIDEBAR); diff --git a/src/sysprof/sysprof-window.ui b/src/sysprof/sysprof-window.ui index 1871bd87..f5a11396 100644 --- a/src/sysprof/sysprof-window.ui +++ b/src/sysprof/sysprof-window.ui @@ -116,6 +116,13 @@ + + + + SysprofWindow + + + diff --git a/src/sysprof/sysprof.gresource.xml b/src/sysprof/sysprof.gresource.xml index 3d3c7e93..68708186 100644 --- a/src/sysprof/sysprof.gresource.xml +++ b/src/sysprof/sysprof.gresource.xml @@ -8,6 +8,7 @@ sysprof-logs-section.ui sysprof-marks-section.ui sysprof-metadata-dialog.ui + sysprof-metadata-section.ui sysprof-recording-pad.ui sysprof-samples-section.ui sysprof-sidebar.ui