diff --git a/src/sysprof/meson.build b/src/sysprof/meson.build index fa3aa44e..92c24a14 100644 --- a/src/sysprof/meson.build +++ b/src/sysprof/meson.build @@ -4,6 +4,7 @@ sysprof_sources = [ 'sysprof-files-dialog.c', 'sysprof-greeter.c', 'sysprof-logs-section.c', + 'sysprof-marks-section.c', 'sysprof-metadata-dialog.c', 'sysprof-recording-pad.c', 'sysprof-samples-section.c', diff --git a/src/sysprof/sysprof-marks-section.c b/src/sysprof/sysprof-marks-section.c new file mode 100644 index 00000000..3b18eba3 --- /dev/null +++ b/src/sysprof/sysprof-marks-section.c @@ -0,0 +1,69 @@ +/* sysprof-marks-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 "sysprof-marks-section.h" + +struct _SysprofMarksSection +{ + SysprofSection parent_instance; + + SysprofMarkChart *mark_chart; + //SysprofMarkTable *mark_table; +}; + +G_DEFINE_FINAL_TYPE (SysprofMarksSection, sysprof_marks_section, SYSPROF_TYPE_SECTION) + +static void +sysprof_marks_section_dispose (GObject *object) +{ + SysprofMarksSection *self = (SysprofMarksSection *)object; + + gtk_widget_dispose_template (GTK_WIDGET (self), SYSPROF_TYPE_MARKS_SECTION); + + G_OBJECT_CLASS (sysprof_marks_section_parent_class)->dispose (object); +} + +static void +sysprof_marks_section_class_init (SysprofMarksSectionClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + object_class->dispose = sysprof_marks_section_dispose; + + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-marks-section.ui"); + gtk_widget_class_bind_template_child (widget_class, SysprofMarksSection, mark_chart); + //gtk_widget_class_bind_template_child (widget_class, SysprofMarksSection, mark_table); + + g_type_ensure (SYSPROF_TYPE_DOCUMENT_MARK); + g_type_ensure (SYSPROF_TYPE_MARK_CHART); + g_type_ensure (SYSPROF_TYPE_MARK_TABLE); +} + +static void +sysprof_marks_section_init (SysprofMarksSection *self) +{ + gtk_widget_init_template (GTK_WIDGET (self)); +} + diff --git a/src/sysprof/sysprof-marks-section.h b/src/sysprof/sysprof-marks-section.h new file mode 100644 index 00000000..c69482c6 --- /dev/null +++ b/src/sysprof/sysprof-marks-section.h @@ -0,0 +1,32 @@ +/* sysprof-marks-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_MARKS_SECTION (sysprof_marks_section_get_type()) + +G_DECLARE_FINAL_TYPE (SysprofMarksSection, sysprof_marks_section, SYSPROF, MARKS_SECTION, SysprofSection) + +G_END_DECLS + diff --git a/src/sysprof/sysprof-marks-section.ui b/src/sysprof/sysprof-marks-section.ui new file mode 100644 index 00000000..59835a4c --- /dev/null +++ b/src/sysprof/sysprof-marks-section.ui @@ -0,0 +1,49 @@ + + + + + diff --git a/src/sysprof/sysprof-window.c b/src/sysprof/sysprof-window.c index 31e11c7e..4bfe9865 100644 --- a/src/sysprof/sysprof-window.c +++ b/src/sysprof/sysprof-window.c @@ -27,6 +27,7 @@ #include "sysprof-files-dialog.h" #include "sysprof-greeter.h" #include "sysprof-logs-section.h" +#include "sysprof-marks-section.h" #include "sysprof-metadata-dialog.h" #include "sysprof-samples-section.h" #include "sysprof-sidebar.h" @@ -200,6 +201,7 @@ sysprof_window_class_init (SysprofWindowClass *klass) g_type_ensure (SYSPROF_TYPE_DOCUMENT); g_type_ensure (SYSPROF_TYPE_LOGS_SECTION); + g_type_ensure (SYSPROF_TYPE_MARKS_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 fbbfe7b6..ab6c910c 100644 --- a/src/sysprof/sysprof-window.ui +++ b/src/sysprof/sysprof-window.ui @@ -102,6 +102,13 @@ + + + + SysprofWindow + + + diff --git a/src/sysprof/sysprof.gresource.xml b/src/sysprof/sysprof.gresource.xml index cc248f82..42d19d66 100644 --- a/src/sysprof/sysprof.gresource.xml +++ b/src/sysprof/sysprof.gresource.xml @@ -6,6 +6,7 @@ sysprof-files-dialog.ui sysprof-greeter.ui sysprof-logs-section.ui + sysprof-marks-section.ui sysprof-metadata-dialog.ui sysprof-recording-pad.ui sysprof-samples-section.ui