From 7ca849313066c0419d62ee3146ede55d52212084 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Sat, 8 Oct 2016 16:27:27 -0700 Subject: [PATCH] viewport: remove SpViewport We didn't end up using this by using plain GtkViewport. --- lib/Makefile.am | 2 - lib/sp-viewport.c | 126 ---------------------------------------------- lib/sp-viewport.h | 34 ------------- 3 files changed, 162 deletions(-) delete mode 100644 lib/sp-viewport.c delete mode 100644 lib/sp-viewport.h diff --git a/lib/Makefile.am b/lib/Makefile.am index 42803c2b..25f96cd8 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -174,8 +174,6 @@ libsysprof_ui_@API_VERSION@_la_SOURCES = \ sp-process-model-row.c \ sp-profiler-menu-button.c \ sp-recording-state-view.c \ - sp-viewport.c \ - sp-viewport.h \ sp-visualizer-list.c \ sp-visualizer-list.h \ sp-visualizer-row.c \ diff --git a/lib/sp-viewport.c b/lib/sp-viewport.c deleted file mode 100644 index 7efa2975..00000000 --- a/lib/sp-viewport.c +++ /dev/null @@ -1,126 +0,0 @@ -/* sp-viewport.c - * - * Copyright (C) 2016 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 . - */ - -/* - * This is meant to act like GtkViewport but allow us to override the - * GtkAdjustment without having viewport change our values. - */ - -#define G_LOG_DOMAIN "sp-viewport" - -#include "sp-viewport.h" - -struct _SpViewport -{ - GtkViewport parent_instance; - - GtkAdjustment *hadjustment; - GtkAdjustment *vadjustment; -}; - -G_DEFINE_TYPE (SpViewport, sp_viewport, GTK_TYPE_VIEWPORT) - -enum { - PROP_0, - N_PROPS, - - /* Overridden properties */ - PROP_HADJUSTMENT, - PROP_VADJUSTMENT, -}; - -static void -sp_viewport_finalize (GObject *object) -{ - SpViewport *self = (SpViewport *)object; - - g_clear_object (&self->hadjustment); - g_clear_object (&self->vadjustment); - - G_OBJECT_CLASS (sp_viewport_parent_class)->finalize (object); -} - -static void -sp_viewport_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec) -{ - SpViewport *self = SP_VIEWPORT (object); - - switch (prop_id) - { - case PROP_HADJUSTMENT: - g_value_set_object (value, self->hadjustment); - break; - - case PROP_VADJUSTMENT: - g_value_set_object (value, self->vadjustment); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - } -} - -static void -sp_viewport_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) -{ - SpViewport *self = SP_VIEWPORT (object); - - switch (prop_id) - { - case PROP_HADJUSTMENT: - g_clear_object (&self->hadjustment); - self->hadjustment = g_value_dup_object (value); - g_object_notify_by_pspec (object, pspec); - break; - - case PROP_VADJUSTMENT: - g_clear_object (&self->vadjustment); - self->vadjustment = g_value_dup_object (value); - g_object_notify_by_pspec (object, pspec); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); - } -} - -static void -sp_viewport_class_init (SpViewportClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->set_property = sp_viewport_set_property; - object_class->get_property = sp_viewport_get_property; - object_class->finalize = sp_viewport_finalize; - - g_object_class_override_property (object_class, PROP_HADJUSTMENT, "hadjustment"); - g_object_class_override_property (object_class, PROP_VADJUSTMENT, "vadjustment"); -} - -static void -sp_viewport_init (SpViewport *self) -{ - self->hadjustment = gtk_adjustment_new (0, 0, 0, 0, 0, 0); - self->vadjustment = gtk_adjustment_new (0, 0, 0, 0, 0, 0); -} diff --git a/lib/sp-viewport.h b/lib/sp-viewport.h deleted file mode 100644 index dff59aac..00000000 --- a/lib/sp-viewport.h +++ /dev/null @@ -1,34 +0,0 @@ -/* sp-viewport.h - * - * Copyright (C) 2016 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 . - */ - -#ifndef SP_VIEWPORT_H -#define SP_VIEWPORT_H - -#include - -G_BEGIN_DECLS - -#define SP_TYPE_VIEWPORT (sp_viewport_get_type()) - -G_DECLARE_FINAL_TYPE (SpViewport, sp_viewport, SP, VIEWPORT, GtkViewport) - -GtkWidget *sp_viewport_new (void); - -G_END_DECLS - -#endif /* SP_VIEWPORT_H */