From 3c644c245dbe462cd24df04c41fcbfe6e9abf078 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Sun, 12 May 2019 16:51:40 -0700 Subject: [PATCH] libsysprof-ui: stub out marks view --- src/libsysprof-ui/libsysprof-ui.gresource.xml | 1 + src/libsysprof-ui/meson.build | 2 + src/libsysprof-ui/sysprof-marks-view.c | 58 +++++++++++++++++++ src/libsysprof-ui/sysprof-marks-view.h | 47 +++++++++++++++ src/libsysprof-ui/sysprof-ui.h | 6 +- src/libsysprof-ui/ui/sysprof-marks-view.ui | 33 +++++++++++ 6 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 src/libsysprof-ui/sysprof-marks-view.c create mode 100644 src/libsysprof-ui/sysprof-marks-view.h create mode 100644 src/libsysprof-ui/ui/sysprof-marks-view.ui diff --git a/src/libsysprof-ui/libsysprof-ui.gresource.xml b/src/libsysprof-ui/libsysprof-ui.gresource.xml index c1bb9295..bfe16207 100644 --- a/src/libsysprof-ui/libsysprof-ui.gresource.xml +++ b/src/libsysprof-ui/libsysprof-ui.gresource.xml @@ -12,6 +12,7 @@ ui/sysprof-callgraph-view.ui ui/sysprof-empty-state-view.ui ui/sysprof-failed-state-view.ui + ui/sysprof-marks-view.ui ui/sysprof-process-model-row.ui ui/sysprof-profiler-menu-button.ui ui/sysprof-recording-state-view.ui diff --git a/src/libsysprof-ui/meson.build b/src/libsysprof-ui/meson.build index b1607fad..9fa810d6 100644 --- a/src/libsysprof-ui/meson.build +++ b/src/libsysprof-ui/meson.build @@ -5,6 +5,7 @@ libsysprof_ui_public_sources = [ 'sysprof-empty-state-view.c', 'sysprof-failed-state-view.c', 'sysprof-line-visualizer-row.c', + 'sysprof-marks-view.c', 'sysprof-mark-visualizer-row.c', 'sysprof-model-filter.c', 'sysprof-multi-paned.c', @@ -33,6 +34,7 @@ libsysprof_ui_public_headers = [ 'sysprof-empty-state-view.h', 'sysprof-failed-state-view.h', 'sysprof-line-visualizer-row.h', + 'sysprof-marks-view.h', 'sysprof-mark-visualizer-row.h', 'sysprof-model-filter.h', 'sysprof-multi-paned.h', diff --git a/src/libsysprof-ui/sysprof-marks-view.c b/src/libsysprof-ui/sysprof-marks-view.c new file mode 100644 index 00000000..7b50e2ac --- /dev/null +++ b/src/libsysprof-ui/sysprof-marks-view.c @@ -0,0 +1,58 @@ +/* sysprof-marks-view.c + * + * Copyright 2019 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 + */ + +#define G_LOG_DOMAIN "sysprof-marks-view" + +#include "sysprof-marks-view.h" + +typedef struct +{ + GtkTreeView *tree_view; +} SysprofMarksViewPrivate; + +G_DEFINE_TYPE (SysprofMarksView, sysprof_marks_view, GTK_TYPE_BIN) + +static void +sysprof_marks_view_class_init (SysprofMarksViewClass *klass) +{ + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/ui/sysprof-marks-view.ui"); + gtk_widget_class_bind_template_child_private (widget_class, SysprofMarksView, tree_view); +} + +static void +sysprof_marks_view_init (SysprofMarksView *self) +{ + gtk_widget_init_template (GTK_WIDGET (self)); +} + +GtkWidget * +sysprof_marks_view_new (void) +{ + return g_object_new (SYSPROF_TYPE_MARKS_VIEW, NULL); +} + +void +sysprof_marks_view_set_reader (SysprofMarksView *self, + SysprofCaptureReader *reader) +{ + g_return_if_fail (SYSPROF_IS_MARKS_VIEW (self)); +} diff --git a/src/libsysprof-ui/sysprof-marks-view.h b/src/libsysprof-ui/sysprof-marks-view.h new file mode 100644 index 00000000..5f245760 --- /dev/null +++ b/src/libsysprof-ui/sysprof-marks-view.h @@ -0,0 +1,47 @@ +/* sysprof-marks-view.h + * + * Copyright 2019 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 +#include + +G_BEGIN_DECLS + +#define SYSPROF_TYPE_MARKS_VIEW (sysprof_marks_view_get_type()) + +SYSPROF_AVAILABLE_IN_ALL +G_DECLARE_DERIVABLE_TYPE (SysprofMarksView, sysprof_marks_view, SYSPROF, MARKS_VIEW, GtkBin) + +struct _SysprofMarksViewClass +{ + GtkBinClass parent_class; + + /*< private >*/ + gpointer _reserved[16]; +}; + +SYSPROF_AVAILABLE_IN_ALL +GtkWidget *sysprof_marks_view_new (void); +SYSPROF_AVAILABLE_IN_ALL +void sysprof_marks_view_set_reader (SysprofMarksView *self, + SysprofCaptureReader *reader); + +G_END_DECLS diff --git a/src/libsysprof-ui/sysprof-ui.h b/src/libsysprof-ui/sysprof-ui.h index df9c24dc..bd5cbdca 100644 --- a/src/libsysprof-ui/sysprof-ui.h +++ b/src/libsysprof-ui/sysprof-ui.h @@ -29,14 +29,16 @@ G_BEGIN_DECLS # include "sysprof-callgraph-view.h" # include "sysprof-cell-renderer-percent.h" # include "sysprof-cpu-visualizer-row.h" +# include "sysprof-empty-state-view.h" # include "sysprof-failed-state-view.h" # include "sysprof-line-visualizer-row.h" -# include "sysprof-empty-state-view.h" +# include "sysprof-marks-view.h" +# include "sysprof-mark-visualizer-row.h" # include "sysprof-model-filter.h" # include "sysprof-multi-paned.h" -# include "sysprof-recording-state-view.h" # include "sysprof-process-model-row.h" # include "sysprof-profiler-menu-button.h" +# include "sysprof-recording-state-view.h" # include "sysprof-visualizer-row.h" # include "sysprof-visualizer-view.h" # include "sysprof-zoom-manager.h" diff --git a/src/libsysprof-ui/ui/sysprof-marks-view.ui b/src/libsysprof-ui/ui/sysprof-marks-view.ui new file mode 100644 index 00000000..b6011f75 --- /dev/null +++ b/src/libsysprof-ui/ui/sysprof-marks-view.ui @@ -0,0 +1,33 @@ + + + +