sysprof: add section for marks

This commit is contained in:
Christian Hergert
2023-07-09 15:18:11 -07:00
parent fb796344c5
commit a519825e33
7 changed files with 161 additions and 0 deletions

View File

@ -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',

View File

@ -0,0 +1,69 @@
/* sysprof-marks-section.c
*
* Copyright 2023 Christian Hergert <chergert@redhat.com>
*
* 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 <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include "config.h"
#include <sysprof-gtk.h>
#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));
}

View File

@ -0,0 +1,32 @@
/* sysprof-marks-section.h
*
* Copyright 2023 Christian Hergert <chergert@redhat.com>
*
* 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 <http://www.gnu.org/licenses/>.
*
* 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

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="SysprofMarksSection" parent="SysprofSection">
<property name="title" translatable="yes">Marks</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="AdwViewStack" id="stack">
<property name="vexpand">true</property>
<child>
<object class="AdwViewStackPage">
<property name="title" translatable="yes">Mark Chart</property>
<property name="icon-name">table-symbolic</property>
<property name="child">
<object class="SysprofMarkChart" id="mark_chart">
<binding name="session">
<lookup name="session">SysprofMarksSection</lookup>
</binding>
</object>
</property>
</object>
</child>
<child>
<object class="AdwViewStackPage">
<property name="title" translatable="yes">Mark Table</property>
<property name="icon-name">table-symbolic</property>
<property name="child">
<object class="SysprofMarkTable" id="mark_table">
<binding name="session">
<lookup name="session">SysprofMarksSection</lookup>
</binding>
</object>
</property>
</object>
</child>
</object>
</child>
<child>
<object class="AdwViewSwitcherBar" id="switcher">
<property name="reveal">true</property>
<property name="stack">stack</property>
</object>
</child>
</object>
</child>
</template>
</interface>

View File

@ -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);

View File

@ -102,6 +102,13 @@
</binding>
</object>
</child>
<child>
<object class="SysprofMarksSection">
<binding name="session">
<lookup name="session">SysprofWindow</lookup>
</binding>
</object>
</child>
</object>
</property>
</object>

View File

@ -6,6 +6,7 @@
<file preprocess="xml-stripblanks">sysprof-files-dialog.ui</file>
<file preprocess="xml-stripblanks">sysprof-greeter.ui</file>
<file preprocess="xml-stripblanks">sysprof-logs-section.ui</file>
<file preprocess="xml-stripblanks">sysprof-marks-section.ui</file>
<file preprocess="xml-stripblanks">sysprof-metadata-dialog.ui</file>
<file preprocess="xml-stripblanks">sysprof-recording-pad.ui</file>
<file preprocess="xml-stripblanks">sysprof-samples-section.ui</file>