From fb3d9022ad98049c887cec5aeffd6b73deb043ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 3 Oct 2016 19:52:23 +0200 Subject: [PATCH] Remove GtkHBox --- docs/reference/gtk/gtk4-sections.txt | 16 ----- gtk/deprecated/Makefile.inc | 2 - gtk/deprecated/gtkhbox.c | 98 ---------------------------- gtk/deprecated/gtkhbox.h | 68 ------------------- gtk/gtk-builder-tool.c | 1 - gtk/gtk.h | 1 - gtk/gtkbox.c | 4 -- gtk/gtkcontainer.c | 2 +- gtk/gtkgrid.c | 2 +- tests/testfontselection.c | 2 +- tests/testheightforwidth.c | 21 ++++-- testsuite/gtk/builder.c | 9 +-- testsuite/gtk/notify.c | 1 - 13 files changed, 22 insertions(+), 205 deletions(-) delete mode 100644 gtk/deprecated/gtkhbox.c delete mode 100644 gtk/deprecated/gtkhbox.h diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index 6ce7a69d86..b3155a68ca 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -1787,22 +1787,6 @@ GTK_HBUTTON_BOX_GET_CLASS gtk_hbutton_box_get_type -
-gtkhbox -GtkHBox -GtkHBox -gtk_hbox_new - -GTK_HBOX -GTK_IS_HBOX -GTK_TYPE_HBOX -GTK_HBOX_CLASS -GTK_IS_HBOX_CLASS -GTK_HBOX_GET_CLASS - -gtk_hbox_get_type -
-
gtkhpaned GtkHPaned diff --git a/gtk/deprecated/Makefile.inc b/gtk/deprecated/Makefile.inc index 4d2ba56f97..45039387f4 100644 --- a/gtk/deprecated/Makefile.inc +++ b/gtk/deprecated/Makefile.inc @@ -10,7 +10,6 @@ deprecated_h_sources = \ deprecated/gtkgradient.h \ deprecated/gtkhandlebox.h \ deprecated/gtkhbbox.h \ - deprecated/gtkhbox.h \ deprecated/gtkhpaned.h \ deprecated/gtkhscale.h \ deprecated/gtkhscrollbar.h \ @@ -55,7 +54,6 @@ deprecated_c_sources = \ deprecated/gtkgradient.c \ deprecated/gtkhandlebox.c \ deprecated/gtkhbbox.c \ - deprecated/gtkhbox.c \ deprecated/gtkhpaned.c \ deprecated/gtkhscale.c \ deprecated/gtkhscrollbar.c \ diff --git a/gtk/deprecated/gtkhbox.c b/gtk/deprecated/gtkhbox.c deleted file mode 100644 index 433ba75574..0000000000 --- a/gtk/deprecated/gtkhbox.c +++ /dev/null @@ -1,98 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include "config.h" - -#include "gtkboxprivate.h" -#include "gtkorientable.h" - -#include "gtkhbox.h" - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - -/** - * SECTION:gtkhbox - * @Short_description: A horizontal container box - * @Title: GtkHBox - * @See_also: #GtkVBox - * - * #GtkHBox is a container that organizes child widgets into a single row. - * - * Use the #GtkBox packing interface to determine the arrangement, - * spacing, width, and alignment of #GtkHBox children. - * - * All children are allocated the same height. - * - * GtkHBox has been deprecated. You can use #GtkBox instead, which is a - * very quick and easy change. If you have derived your own classes from - * GtkHBox, you can simply change the inheritance to derive directly - * from #GtkBox. No further changes are needed, since the default - * value of the #GtkOrientable:orientation property is - * %GTK_ORIENTATION_HORIZONTAL. - * If you don’t need first-child or last-child styling, and want your code - * to be future-proof, the recommendation is to switch to #GtkGrid instead - * of nested boxes. For more information about migrating to #GtkGrid, - * see [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid]. - */ - - -G_DEFINE_TYPE (GtkHBox, gtk_hbox, GTK_TYPE_BOX) - -static void -gtk_hbox_class_init (GtkHBoxClass *class) -{ -} - -static void -gtk_hbox_init (GtkHBox *hbox) -{ - gtk_orientable_set_orientation (GTK_ORIENTABLE (hbox), - GTK_ORIENTATION_HORIZONTAL); - - _gtk_box_set_old_defaults (GTK_BOX (hbox)); -} - -/** - * gtk_hbox_new: - * @homogeneous: %TRUE if all children are to be given equal space allotments. - * @spacing: the number of pixels to place by default between children. - * - * Creates a new #GtkHBox. - * - * Returns: a new #GtkHBox. - * - * Deprecated: 3.2: You can use gtk_box_new() with %GTK_ORIENTATION_HORIZONTAL instead, - * which is a quick and easy change. But the recommendation is to switch to - * #GtkGrid, since #GtkBox is going to go away eventually. - * See [Migrating from other containers to GtkGrid][gtk-migrating-GtkGrid]. - */ -GtkWidget * -gtk_hbox_new (gboolean homogeneous, - gint spacing) -{ - return g_object_new (GTK_TYPE_HBOX, - "spacing", spacing, - "homogeneous", homogeneous ? TRUE : FALSE, - NULL); -} diff --git a/gtk/deprecated/gtkhbox.h b/gtk/deprecated/gtkhbox.h deleted file mode 100644 index 45c746def4..0000000000 --- a/gtk/deprecated/gtkhbox.h +++ /dev/null @@ -1,68 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GTK_HBOX_H__ -#define __GTK_HBOX_H__ - - -#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) -#error "Only can be included directly." -#endif - -#include - - -G_BEGIN_DECLS - -#define GTK_TYPE_HBOX (gtk_hbox_get_type ()) -#define GTK_HBOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HBOX, GtkHBox)) -#define GTK_HBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HBOX, GtkHBoxClass)) -#define GTK_IS_HBOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HBOX)) -#define GTK_IS_HBOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HBOX)) -#define GTK_HBOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HBOX, GtkHBoxClass)) - - -typedef struct _GtkHBox GtkHBox; -typedef struct _GtkHBoxClass GtkHBoxClass; - -struct _GtkHBox -{ - GtkBox box; -}; - -struct _GtkHBoxClass -{ - GtkBoxClass parent_class; -}; - - -GDK_DEPRECATED_IN_3_2 -GType gtk_hbox_get_type (void) G_GNUC_CONST; -GDK_DEPRECATED_IN_3_2_FOR(gtk_box_new) -GtkWidget * gtk_hbox_new (gboolean homogeneous, - gint spacing); - -G_END_DECLS - -#endif /* __GTK_HBOX_H__ */ diff --git a/gtk/gtk-builder-tool.c b/gtk/gtk-builder-tool.c index 24171abce6..cb5e8643c2 100644 --- a/gtk/gtk-builder-tool.c +++ b/gtk/gtk-builder-tool.c @@ -195,7 +195,6 @@ needs_explicit_setting (MyParserData *data, { "GtkWidget", "vexpand", 0 }, { "GtkContainer", "border-width", 0 }, { "GtkVBox", "expand", 1 }, - { "GtkHBox", "expand", 1 }, { NULL, NULL, 0 } }; gchar *canonical_name; diff --git a/gtk/gtk.h b/gtk/gtk.h index 6a41b0d63c..a858454038 100644 --- a/gtk/gtk.h +++ b/gtk/gtk.h @@ -255,7 +255,6 @@ #include #include #include -#include #include #include #include diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index e39eb495a5..c2c34bc3f3 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -306,10 +306,6 @@ gtk_box_class_init (GtkBoxClass *class) * * Whether the child should receive extra space when the parent grows. * - * Note that the default value for this property is %FALSE for GtkBox, - * but #GtkHBox, #GtkVBox and other subclasses use the old default - * of %TRUE. - * * Note that the #GtkWidget:halign, #GtkWidget:valign, #GtkWidget:hexpand * and #GtkWidget:vexpand properties are the preferred way to influence * child size allocation in containers. diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index 55feadf8b2..d90370b0b4 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -87,7 +87,7 @@ * * The second type of container can have more than one child; its purpose is to * manage layout. This means that these containers assign - * sizes and positions to their children. For example, a #GtkHBox arranges its + * sizes and positions to their children. For example, a horizontal #GtkBox arranges its * children in a horizontal row, and a #GtkGrid arranges the widgets it contains * in a two-dimensional grid. * diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c index 5fed33fe2d..357dbb1bc7 100644 --- a/gtk/gtkgrid.c +++ b/gtk/gtkgrid.c @@ -36,7 +36,7 @@ * SECTION:gtkgrid * @Short_description: Pack widgets in a rows and columns * @Title: GtkGrid - * @See_also: #GtkTable, #GtkHBox, #GtkVBox + * @See_also: #GtkTable, #GtkVBox * * GtkGrid is a container which arranges its child widgets in * rows and columns. It is a very similar to #GtkTable and #GtkBox, diff --git a/tests/testfontselection.c b/tests/testfontselection.c index 8c87b2c6c4..fc384d6193 100644 --- a/tests/testfontselection.c +++ b/tests/testfontselection.c @@ -46,7 +46,7 @@ main (int argc, char *argv[]) window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_widget_set_size_request (window, 600, 600); - hbox = gtk_hbox_new (FALSE, 6); + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_container_add (GTK_CONTAINER (window), hbox); #ifndef GTK_DISABLE_DEPRECATED diff --git a/tests/testheightforwidth.c b/tests/testheightforwidth.c index fe47ed30a5..ba3fd0188f 100644 --- a/tests/testheightforwidth.c +++ b/tests/testheightforwidth.c @@ -43,7 +43,8 @@ TestInterface interfaces[] = { " 450" " 50" " " - " " + " " + " " " True" " " " " @@ -211,7 +212,8 @@ TestInterface interfaces[] = { " " " True" " " - " " + " " + " " " True" " " " " @@ -313,7 +315,8 @@ TestInterface interfaces[] = { " True" " True" " " - " " + " " + " " " True" " " " " @@ -364,7 +367,8 @@ TestInterface interfaces[] = { " " " " " " - " " + " " + " " " True" " " " " @@ -438,7 +442,8 @@ TestInterface interfaces[] = { " " " True" " " - " " + " " + " " " True" " 6" " " @@ -676,7 +681,8 @@ TestInterface interfaces[] = { " True" " 5" " " - " " + " " + " " " True" " 5" " " @@ -777,7 +783,8 @@ TestInterface interfaces[] = { " " " " " " - " " + " " + " " " True" " 5" " " diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c index 9aad57aa21..61228ee2f4 100644 --- a/testsuite/gtk/builder.c +++ b/testsuite/gtk/builder.c @@ -91,7 +91,7 @@ test_parser (void) g_error_free (error); error = NULL; - gtk_builder_add_from_string (builder, "", -1, &error); + gtk_builder_add_from_string (builder, "", -1, &error); g_assert_error (error, GTK_BUILDER_ERROR, GTK_BUILDER_ERROR_INVALID_TAG); g_error_free (error); @@ -724,7 +724,6 @@ test_types (void) " " " " " " - " " " " " " " " @@ -2428,7 +2427,8 @@ test_message_area (void) "" " " " " - " " + " " + " horizontal" " " " " " Message" @@ -2670,7 +2670,8 @@ test_no_ids (void) "" " " " " - " " + " " + " horizontal" " " " " " Message" diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c index 4c186b99aa..4d297d425f 100644 --- a/testsuite/gtk/notify.c +++ b/testsuite/gtk/notify.c @@ -374,7 +374,6 @@ test_type (gconstpointer data) g_str_equal (g_type_name (type), "GtkVScrollbar") || g_str_equal (g_type_name (type), "GtkHSeparator") || g_str_equal (g_type_name (type), "GtkVSeparator") || - g_str_equal (g_type_name (type), "GtkHBox") || g_str_equal (g_type_name (type), "GtkVBox") || g_str_equal (g_type_name (type), "GtkArrow") || g_str_equal (g_type_name (type), "GtkNumerableIcon") ||