[sysprof/wip/chergert/sysprof-3] libsysprof-ui: stub out marks view



commit 4c3d77a430f5bd07566f447cf33147ac901d4b1d
Author: Christian Hergert <chergert redhat com>
Date:   Sun May 12 16:51:40 2019 -0700

    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(-)
---
diff --git a/src/libsysprof-ui/libsysprof-ui.gresource.xml b/src/libsysprof-ui/libsysprof-ui.gresource.xml
index c1bb929..bfe1620 100644
--- a/src/libsysprof-ui/libsysprof-ui.gresource.xml
+++ b/src/libsysprof-ui/libsysprof-ui.gresource.xml
@@ -12,6 +12,7 @@
     <file preprocess="xml-stripblanks">ui/sysprof-callgraph-view.ui</file>
     <file preprocess="xml-stripblanks">ui/sysprof-empty-state-view.ui</file>
     <file preprocess="xml-stripblanks">ui/sysprof-failed-state-view.ui</file>
+    <file preprocess="xml-stripblanks">ui/sysprof-marks-view.ui</file>
     <file preprocess="xml-stripblanks">ui/sysprof-process-model-row.ui</file>
     <file preprocess="xml-stripblanks">ui/sysprof-profiler-menu-button.ui</file>
     <file preprocess="xml-stripblanks">ui/sysprof-recording-state-view.ui</file>
diff --git a/src/libsysprof-ui/meson.build b/src/libsysprof-ui/meson.build
index b1607fa..9fa810d 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 0000000..7b50e2a
--- /dev/null
+++ b/src/libsysprof-ui/sysprof-marks-view.c
@@ -0,0 +1,58 @@
+/* sysprof-marks-view.c
+ *
+ * Copyright 2019 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
+ */
+
+#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 0000000..5f24576
--- /dev/null
+++ b/src/libsysprof-ui/sysprof-marks-view.h
@@ -0,0 +1,47 @@
+/* sysprof-marks-view.h
+ *
+ * Copyright 2019 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-capture.h>
+#include <gtk/gtk.h>
+
+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 df9c24d..bd5cbdc 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 0000000..b6011f7
--- /dev/null
+++ b/src/libsysprof-ui/ui/sysprof-marks-view.ui
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <template class="SysprofMarksView" parent="GtkBin">
+    <child>
+      <object class="GtkScrolledWindow" id="scroller">
+        <property name="visible">true</property>
+        <child>
+          <object class="GtkTreeView" id="tree_view">
+            <property name="headers-visible">true</property>
+            <property name="visible">true</property>
+            <child>
+              <object class="GtkTreeViewColumn" id="text_column">
+                <property name="title" translatable="yes">Mark</property>
+                <property name="expand">false</property>
+                <child>
+                  <object class="GtkCellRendererText" id="text_cell">
+                    <property name="xalign">0</property>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child>
+              <object class="GtkTreeViewColumn" id="duration_column">
+                <property name="title" translatable="yes">Duration</property>
+                <property name="expand">true</property>
+              </object>
+            </child>
+          </object>
+        </child>
+      </object>
+    </child>
+  </template>
+</interface>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]