sysprof: stub out counters section

This commit is contained in:
Christian Hergert
2023-07-14 11:29:50 -07:00
parent 668249a015
commit c81e832a5a
8 changed files with 205 additions and 0 deletions

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path d="m 3.195312 0 c -1.203124 0 -2.195312 1 -2.195312 2.199219 v 11.601562 c 0 1.199219 0.992188 2.199219 2.195312 2.199219 h 9.609376 c 1.203124 0 2.195312 -1 2.195312 -2.199219 v -11.601562 c 0 -1.199219 -0.992188 -2.199219 -2.195312 -2.199219 z m 0 2 h 9.609376 c 0.125 0 0.195312 0.070312 0.195312 0.199219 v 11.601562 c 0 0.128907 -0.070312 0.199219 -0.195312 0.199219 h -9.609376 c -0.125 0 -0.195312 -0.070312 -0.195312 -0.199219 v -11.601562 c 0 -0.128907 0.070312 -0.199219 0.195312 -0.199219 z m 2.804688 1 v 1 h -1 v 1 h -0.953125 v 1 h 0.953125 v 1 h -0.953125 v 1 h 0.953125 v 1 h -0.953125 v 1 h 0.953125 v 1 h 1 v 1 h 1 v -1 h 1 v 1 h 1 v -1 h 1 v 1 h 1 v -2 h 1 v -1 h -1 v -1 h 1 v -1 h -1 v -1 h 1 v -1 h -1 v -2 h -1 v 1 h -1 v -1 h -1 v 1 h -1 v -1 z m 0 0"/></svg>

After

Width:  |  Height:  |  Size: 916 B

View File

@ -1,6 +1,7 @@
sysprof_sources = [
'main.c',
'sysprof-application.c',
'sysprof-counters-section.c',
'sysprof-cpu-info-dialog.c',
'sysprof-files-section.c',
'sysprof-frame-utility.c',

View File

@ -0,0 +1,68 @@
/* sysprof-counters-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-counters-section.h"
struct _SysprofCountersSection
{
SysprofSection parent_instance;
};
G_DEFINE_FINAL_TYPE (SysprofCountersSection, sysprof_counters_section, SYSPROF_TYPE_SECTION)
static void
sysprof_counters_section_dispose (GObject *object)
{
SysprofCountersSection *self = (SysprofCountersSection *)object;
gtk_widget_dispose_template (GTK_WIDGET (self), SYSPROF_TYPE_COUNTERS_SECTION);
G_OBJECT_CLASS (sysprof_counters_section_parent_class)->dispose (object);
}
static void
sysprof_counters_section_class_init (SysprofCountersSectionClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->dispose = sysprof_counters_section_dispose;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-counters-section.ui");
g_type_ensure (SYSPROF_TYPE_CHART);
g_type_ensure (SYSPROF_TYPE_DOCUMENT_MARK);
g_type_ensure (SYSPROF_TYPE_DOCUMENT_COUNTER);
g_type_ensure (SYSPROF_TYPE_DOCUMENT_COUNTER_VALUE);
g_type_ensure (SYSPROF_TYPE_LINE_LAYER);
g_type_ensure (SYSPROF_TYPE_TIME_SERIES);
g_type_ensure (SYSPROF_TYPE_TIME_SPAN_LAYER);
g_type_ensure (SYSPROF_TYPE_XY_SERIES);
}
static void
sysprof_counters_section_init (SysprofCountersSection *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}

View File

@ -0,0 +1,31 @@
/* sysprof-counters-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_COUNTERS_SECTION (sysprof_counters_section_get_type())
G_DECLARE_FINAL_TYPE (SysprofCountersSection, sysprof_counters_section, SYSPROF, COUNTERS_SECTION, SysprofSection)
G_END_DECLS

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="SysprofCountersSection" parent="SysprofSection">
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="SysprofTimeScrubber" id="scrubber">
<binding name="session">
<lookup name="session">SysprofCountersSection</lookup>
</binding>
<child type="chart">
<object class="SysprofChart">
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="height-request">20</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkSeparator">
</object>
</child>
<child>
<object class="AdwViewStack" id="stack">
<property name="vexpand">true</property>
<child>
<object class="AdwViewStackPage">
<property name="title" translatable="yes">Counters Chart</property>
<property name="icon-name">mark-chart-symbolic</property>
<property name="child">
<object class="GtkScrolledWindow">
<child>
<object class="GtkListView">
</object>
</child>
</object>
</property>
</object>
</child>
<child>
<object class="AdwViewStackPage">
<property name="title" translatable="yes">Counters Table</property>
<property name="icon-name">mark-table-symbolic</property>
<property name="child">
<object class="GtkScrolledWindow">
<child>
<object class="GtkColumnView">
</object>
</child>
</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

@ -24,6 +24,7 @@
#include <sysprof-gtk.h>
#include "sysprof-counters-section.h"
#include "sysprof-cpu-info-dialog.h"
#include "sysprof-files-section.h"
#include "sysprof-greeter.h"
@ -412,6 +413,7 @@ sysprof_window_class_init (SysprofWindowClass *klass)
gtk_widget_class_add_binding_action (widget_class, GDK_KEY_bracketleft, GDK_CONTROL_MASK, "session.seek-backward", NULL);
gtk_widget_class_add_binding_action (widget_class, GDK_KEY_bracketright, GDK_CONTROL_MASK, "session.seek-forward", NULL);
g_type_ensure (SYSPROF_TYPE_COUNTERS_SECTION);
g_type_ensure (SYSPROF_TYPE_DOCUMENT);
g_type_ensure (SYSPROF_TYPE_FILES_SECTION);
g_type_ensure (SYSPROF_TYPE_LOGS_SECTION);

View File

@ -143,6 +143,36 @@
</binding>
</object>
</child>
<child>
<object class="SysprofCountersSection">
<property name="title" translatable="yes">CPU Usage</property>
<property name="category">counters</property>
<property name="icon-name">system-run-symbolic</property>
<binding name="session">
<lookup name="session">SysprofWindow</lookup>
</binding>
</object>
</child>
<child>
<object class="SysprofCountersSection">
<property name="title" translatable="yes">Network</property>
<property name="category">counters</property>
<property name="icon-name">network-transmit-receive-symbolic</property>
<binding name="session">
<lookup name="session">SysprofWindow</lookup>
</binding>
</object>
</child>
<child>
<object class="SysprofCountersSection">
<property name="title" translatable="yes">Storage</property>
<property name="category">counters</property>
<property name="icon-name">storage-symbolic</property>
<binding name="session">
<lookup name="session">SysprofWindow</lookup>
</binding>
</object>
</child>
<child>
<object class="SysprofFilesSection">
<property name="category">auxiliary</property>

View File

@ -3,6 +3,7 @@
<gresource prefix="/org/gnome/sysprof">
<file preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
<file preprocess="xml-stripblanks">gtk/menus.ui</file>
<file preprocess="xml-stripblanks">sysprof-counters-section.ui</file>
<file preprocess="xml-stripblanks">sysprof-cpu-info-dialog.ui</file>
<file preprocess="xml-stripblanks">sysprof-files-section.ui</file>
<file preprocess="xml-stripblanks">sysprof-frame-utility.ui</file>
@ -25,6 +26,7 @@
<file preprocess="xml-stripblanks">icons/scalable/actions/memory-allocations-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/metadata-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/process-mounts-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/storage-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/system-log-symbolic.svg</file>
</gresource>
</gresources>