]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
gtk: GtkScrolledView (and GtkPanedView) for 3.24.33 (Ubuntu 22.04).
authorMatt Birkholz <matt@birchwood-abbey.net>
Fri, 28 Oct 2022 03:37:13 +0000 (20:37 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Fri, 28 Oct 2022 03:37:13 +0000 (20:37 -0700)
src/gtk/Makefile.am
src/gtk/configure.ac
src/gtk/gtkpanedview-3.24.33.c [new file with mode: 0644]
src/gtk/gtkscrolledview-3.24.33.c [new file with mode: 0644]

index 46fa630cf8049d578b766577b7df9e424ed12ea2..cad5f98bb4f75773545b26db42b008c8a08d804d 100644 (file)
@@ -141,6 +141,7 @@ EXTRA_DIST += gtkpanedview-3.16.7.c gtkscrolledview-3.16.7.c
 EXTRA_DIST += gtkpanedview-3.18.9.c gtkscrolledview-3.18.9.c
 EXTRA_DIST += gtkpanedview-3.20.9.c gtkscrolledview-3.20.9.c
 EXTRA_DIST += gtkpanedview-3.22.11.c gtkscrolledview-3.22.11.c
+EXTRA_DIST += gtkpanedview-3.24.33.c gtkscrolledview-3.24.33.c
 EXTRA_DIST += conses.png hello.scm test-gport-performance.scm
 EXTRA_DIST += debian
 
index ed7da8bc6f917d409e97f31a83bbde601c8ac771..f714968bbe3dbe09cf214a4f1e585a959af7baee 100644 (file)
@@ -82,6 +82,8 @@ AC_ARG_WITH([gtk-version],
 
 if test "${with_gtk_version}" != guess; then
     GTK_VERSION=$with_gtk_version
+elif pkg-config --exists 'gtk+-3.0 >= 3.24.33' 2>/dev/null; then
+    GTK_VERSION=3.24.33
 elif pkg-config --exists 'gtk+-3.0 >= 3.22.11' 2>/dev/null; then
     GTK_VERSION=3.22.11
 elif pkg-config --exists 'gtk+-3.0 >= 3.20.9' 2>/dev/null; then
@@ -94,7 +96,7 @@ elif pkg-config --exists 'gtk+-3.0 >= 3.14.13' 2>/dev/null; then
     GTK_VERSION=3.14.13
 elif pkg-config --exists 'gtk+-3.0 >= 3.10.8' 2>/dev/null; then
     GTK_VERSION=3.10.8
-elif pkg-config --exists 'gkt+-3.0 >= 3.6.0' 2>/dev/null; then
+elif pkg-config --exists 'gtk+-3.0 >= 3.6.0' 2>/dev/null; then
     GTK_VERSION=3.6.0
 else
     AC_MSG_ERROR([Sorry; your version of Gtk+ is not supported.])
diff --git a/src/gtk/gtkpanedview-3.24.33.c b/src/gtk/gtkpanedview-3.24.33.c
new file mode 100644 (file)
index 0000000..f50f7c4
--- /dev/null
@@ -0,0 +1,59 @@
+/* -*-C-*-
+
+Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015,
+    2016, 2017, 2018, 2019, 2020, 2021, 2022 Matthew Birkholz
+
+This file is part of a Gtk plugin for MIT/GNU Scheme Pucked.
+
+This plugin 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 2 of the License, or (at your
+option) any later version.
+
+This plugin 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 plugin; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+/* A specialized GtkPaned.  See documentation of <gtk-paned-view>. */
+
+/* The v3.20.9 of GtkPaned seems to do the right thing with
+   GtkScrolledViews, so this version of GtkPanedView is not actually
+   specialized. */
+
+#include "gtkpanedview.h"
+
+G_DEFINE_TYPE (GtkPanedView, gtk_paned_view,
+              GTK_TYPE_PANED)
+
+static void
+gtk_paned_view_class_init (GtkPanedViewClass *class)
+{
+}
+
+static void
+gtk_paned_view_init (GtkPanedView *paned_view)
+{
+}
+
+/**
+ * gtk_paned_view_new:
+ * @orientation: GTK_ORIENTATION_VERTICAL or GTK_ORIENTATION_HORIZONTAL.
+ *
+ * Creates a new paned view.
+ *
+ * Returns: a new paned view.
+ */
+GtkWidget*
+gtk_paned_view_new (GtkOrientation orientation)
+{
+  return (g_object_new (GTK_TYPE_PANED_VIEW,
+                       "orientation", orientation,
+                       NULL));
+}
diff --git a/src/gtk/gtkscrolledview-3.24.33.c b/src/gtk/gtkscrolledview-3.24.33.c
new file mode 100644 (file)
index 0000000..6d05e27
--- /dev/null
@@ -0,0 +1,75 @@
+/* -*-C-*-
+
+Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015,
+    2016, 2017, 2018, 2019, 2020, 2021, 2022 Matthew Birkholz
+
+This file is part of a Gtk plugin for MIT/GNU Scheme Pucked.
+
+This plugin 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 2 of the License, or (at your
+option) any later version.
+
+This plugin 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 plugin; if not, write to the Free Software Foundation,
+Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+/* A specialized GtkScrolledWindow.  See documentation of
+   <gtk-scrolled-view>. */
+
+/* The v3.22 of GtkScrolledWindow has "...propagate_natural_width" and
+   "..._height" properties that, when set, cause a GtkScrolledWindow
+   to do the right thing. */
+
+#include "gtkscrolledview.h"
+
+G_DEFINE_TYPE (GtkScrolledView, gtk_scrolled_view,
+              GTK_TYPE_SCROLLED_WINDOW)
+
+static void
+gtk_scrolled_view_class_init (GtkScrolledViewClass *class)
+{
+}
+
+static void
+gtk_scrolled_view_init (GtkScrolledView *scrolled_view)
+{
+}
+
+/**
+ * gtk_scrolled_view_new:
+ * @hadjustment: (allow-none): horizontal adjustment
+ * @vadjustment: (allow-none): vertical adjustment
+ *
+ * Creates a new scrolling window.
+ *
+ * The two arguments are the scrolling window's adjustments; these will be
+ * shared with the scrollbars and the child widget to keep the bars in sync 
+ * with the child. Usually you want to pass %NULL for the adjustments, which 
+ * will cause the scrolling window to create them for you.
+ *
+ * Returns: a new scrolling window
+ */
+GtkWidget*
+gtk_scrolled_view_new (GtkAdjustment *hadjustment,
+                      GtkAdjustment *vadjustment)
+{
+  GtkWidget *object;
+  GtkScrolledWindow *scrolled_window;
+
+  object = g_object_new (GTK_TYPE_SCROLLED_VIEW,
+                        "hadjustment", hadjustment,
+                        "vadjustment", vadjustment,
+                        NULL);
+  scrolled_window = GTK_SCROLLED_WINDOW (object);
+  gtk_scrolled_window_set_propagate_natural_height (scrolled_window, TRUE);
+  gtk_scrolled_window_set_propagate_natural_width (scrolled_window, TRUE);
+  return object;
+}