Remove GtkHBox

This commit is contained in:
Timm Bäder 2016-10-03 19:52:23 +02:00 committed by Benjamin Otte
parent 9a5de96187
commit fb3d9022ad
13 changed files with 22 additions and 205 deletions

View File

@ -1787,22 +1787,6 @@ GTK_HBUTTON_BOX_GET_CLASS
gtk_hbutton_box_get_type
</SECTION>
<SECTION>
<FILE>gtkhbox</FILE>
<TITLE>GtkHBox</TITLE>
GtkHBox
gtk_hbox_new
<SUBSECTION Standard>
GTK_HBOX
GTK_IS_HBOX
GTK_TYPE_HBOX
GTK_HBOX_CLASS
GTK_IS_HBOX_CLASS
GTK_HBOX_GET_CLASS
<SUBSECTION Private>
gtk_hbox_get_type
</SECTION>
<SECTION>
<FILE>gtkhpaned</FILE>
<TITLE>GtkHPaned</TITLE>

View File

@ -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 \

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
/*
* 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 dont 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);
}

View File

@ -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 <http://www.gnu.org/licenses/>.
*/
/*
* 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 <gtk/gtk.h> can be included directly."
#endif
#include <gtk/gtkbox.h>
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__ */

View File

@ -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;

View File

@ -255,7 +255,6 @@
#include <gtk/deprecated/gtkgradient.h>
#include <gtk/deprecated/gtkhandlebox.h>
#include <gtk/deprecated/gtkhbbox.h>
#include <gtk/deprecated/gtkhbox.h>
#include <gtk/deprecated/gtkhpaned.h>
#include <gtk/deprecated/gtkhsv.h>
#include <gtk/deprecated/gtkhscale.h>

View File

@ -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.

View File

@ -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.
*

View File

@ -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,

View File

@ -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

View File

@ -43,7 +43,8 @@ TestInterface interfaces[] = {
" <property name=\"default_width\">450</property>"
" <property name=\"default_height\">50</property>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox5\">"
" <object class=\"GtkBox\" id=\"hbox5\">"
" <property name\"orientation\"horizontal</property>"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"label9\">"
@ -211,7 +212,8 @@ TestInterface interfaces[] = {
" <object class=\"GtkVBox\" id=\"vbox1\">"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox1\">"
" <object class=\"GtkBox\" id=\"hbox1\">"
" <property name\"orientation\"horizontal</property>"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkButton\" id=\"button1\">"
@ -313,7 +315,8 @@ TestInterface interfaces[] = {
" <property name=\"visible\">True</property>"
" <property name=\"can_focus\">True</property>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox1\">"
" <object class=\"GtkBox\" id=\"hbox1\">"
" <property name\"orientation\"horizontal</property>"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"label1\">"
@ -364,7 +367,8 @@ TestInterface interfaces[] = {
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox2\">"
" <object class=\"GtkBox\" id=\"hbox2\">"
" <property name\"orientation\"horizontal</property>"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkFrame\" id=\"frame2\">"
@ -438,7 +442,8 @@ TestInterface interfaces[] = {
" <object class=\"GtkVBox\" id=\"vbox1\">"
" <property name=\"visible\">True</property>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox1\">"
" <object class=\"GtkBox\" id=\"hbox1\">"
" <property name\"orientation\"horizontal</property>"
" <property name=\"visible\">True</property>"
" <property name=\"spacing\">6</property>"
" <child>"
@ -676,7 +681,8 @@ TestInterface interfaces[] = {
" <property name=\"visible\">True</property>"
" <property name=\"spacing\">5</property>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox1\">"
" <object class=\"GtkBox\" id=\"hbox1\">"
" <property name\"orientation\"horizontal</property>"
" <property name=\"visible\">True</property>"
" <property name=\"spacing\">5</property>"
" <child>"
@ -777,7 +783,8 @@ TestInterface interfaces[] = {
" </packing>"
" </child>"
" <child>"
" <object class=\"GtkHBox\" id=\"hbox2\">"
" <object class=\"GtkBox\" id=\"hbox2\">"
" <property name\"orientation\"horizontal</property>"
" <property name=\"visible\">True</property>"
" <property name=\"spacing\">5</property>"
" <child>"

View File

@ -91,7 +91,7 @@ test_parser (void)
g_error_free (error);
error = NULL;
gtk_builder_add_from_string (builder, "<interface><object class=\"GtkVBox\" id=\"a\"><object class=\"GtkHBox\" id=\"b\"/></object></interface>", -1, &error);
gtk_builder_add_from_string (builder, "<interface><object class=\"GtkVBox\" id=\"a\"><object class=\"GtkBox\" id=\"b\"/></object></interface>", -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)
" <object class=\"GtkEntry\" id=\"entry\"/>"
" <object class=\"GtkFontButton\" id=\"fontbutton\"/>"
" <object class=\"GtkHButtonBox\" id=\"hbuttonbox\"/>"
" <object class=\"GtkHBox\" id=\"hbox\"/>"
" <object class=\"GtkHPaned\" id=\"hpaned\"/>"
" <object class=\"GtkHScale\" id=\"hscale\"/>"
" <object class=\"GtkHScrollbar\" id=\"hscrollbar\"/>"
@ -2428,7 +2427,8 @@ test_message_area (void)
"<interface>"
" <object class=\"GtkInfoBar\" id=\"infobar1\">"
" <child internal-child=\"content_area\">"
" <object class=\"GtkHBox\" id=\"contentarea1\">"
" <object class=\"GtkBox\" id=\"contentarea1\">"
" <property name=\"orientation\">horizontal</property>"
" <child>"
" <object class=\"GtkLabel\" id=\"content\">"
" <property name=\"label\" translatable=\"yes\">Message</property>"
@ -2670,7 +2670,8 @@ test_no_ids (void)
"<interface>"
" <object class=\"GtkInfoBar\">"
" <child internal-child=\"content_area\">"
" <object class=\"GtkHBox\">"
" <object class=\"GtkBox\">"
" <property name=\"orientation\">horizontal</property>"
" <child>"
" <object class=\"GtkLabel\">"
" <property name=\"label\" translatable=\"yes\">Message</property>"

View File

@ -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") ||