[gtk/wip/ebassi/fixed-layout-v2: 2/3] Remove GtkLayout
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/ebassi/fixed-layout-v2: 2/3] Remove GtkLayout
- Date: Tue, 2 Apr 2019 14:51:41 +0000 (UTC)
commit 447dfc029f668eee32a1fe1af6ef2385f311dc0f
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Apr 2 15:25:02 2019 +0100
Remove GtkLayout
The need of a specialised fixed layout container that can be placed into
a GtkScrolledWindow ceased to exist once GtkScrolledWindow gained the
ability to automatically interpose a GtkViewport when adding a child
that does not implement GtkScrollable.
All the other justifications that led to the existence of GtkLayout as a
separate widget from GtkFixed have been largely made irrelevant in the
20 years since its inception.
docs/reference/gtk/gtk4-docs.xml | 1 -
docs/reference/gtk/gtk4-sections.txt | 21 -
gtk/gtk-autocleanups.h | 1 -
gtk/gtk.h | 1 -
gtk/gtkfixed.c | 3 -
gtk/gtklayout.c | 816 -----------------------------------
gtk/gtklayout.h | 97 -----
gtk/meson.build | 2 -
tests/testgtk.c | 81 ----
testsuite/gtk/defaultvalue.c | 5 -
10 files changed, 1028 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-docs.xml b/docs/reference/gtk/gtk4-docs.xml
index af8c97afd0..c1018bf53c 100644
--- a/docs/reference/gtk/gtk4-docs.xml
+++ b/docs/reference/gtk/gtk4-docs.xml
@@ -92,7 +92,6 @@
<xi:include href="xml/gtkheaderbar.xml" />
<xi:include href="xml/gtkoverlay.xml" />
<xi:include href="xml/gtkpaned.xml" />
- <xi:include href="xml/gtklayout.xml" />
<xi:include href="xml/gtknotebook.xml" />
<xi:include href="xml/gtkexpander.xml" />
<xi:include href="xml/gtkorientable.xml" />
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 167a16ee62..b2098ded5c 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -1739,27 +1739,6 @@ GtkLabelPrivate
GtkLabelSelectionInfo
</SECTION>
-<SECTION>
-<FILE>gtklayout</FILE>
-<TITLE>GtkLayout</TITLE>
-GtkLayout
-gtk_layout_new
-gtk_layout_put
-gtk_layout_move
-gtk_layout_set_size
-gtk_layout_get_size
-<SUBSECTION Standard>
-GTK_LAYOUT
-GTK_IS_LAYOUT
-GTK_TYPE_LAYOUT
-GTK_LAYOUT_CLASS
-GTK_IS_LAYOUT_CLASS
-GTK_LAYOUT_GET_CLASS
-<SUBSECTION Private>
-GtkLayoutPrivate
-gtk_layout_get_type
-</SECTION>
-
<SECTION>
<FILE>gtklinkbutton</FILE>
<TITLE>GtkLinkButton</TITLE>
diff --git a/gtk/gtk-autocleanups.h b/gtk/gtk-autocleanups.h
index 5ccb245539..edd4664b40 100644
--- a/gtk/gtk-autocleanups.h
+++ b/gtk/gtk-autocleanups.h
@@ -101,7 +101,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkIconTheme, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkIconView, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkImage, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkInfoBar, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLayout, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLevelBar, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkLinkButton, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkListStore, g_object_unref)
diff --git a/gtk/gtk.h b/gtk/gtk.h
index ac96a15810..bb637b522a 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -137,7 +137,6 @@
#include <gtk/gtkimmulticontext.h>
#include <gtk/gtkinfobar.h>
#include <gtk/gtklabel.h>
-#include <gtk/gtklayout.h>
#include <gtk/gtklayoutmanager.h>
#include <gtk/gtklayoutchild.h>
#include <gtk/gtklevelbar.h>
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c
index 1935de78a1..e41c887cb3 100644
--- a/gtk/gtkfixed.c
+++ b/gtk/gtkfixed.c
@@ -66,9 +66,6 @@
* If you know none of these things are an issue for your application,
* and prefer the simplicity of #GtkFixed, by all means use the
* widget. But you should be aware of the tradeoffs.
- *
- * See also #GtkLayout, which shares the ability to perform fixed positioning
- * of child widgets and additionally adds custom drawing and scrollability.
*/
#include "config.h"
diff --git a/gtk/meson.build b/gtk/meson.build
index 8fc6b91f0e..9ec10acd9a 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -259,7 +259,6 @@ gtk_public_sources = files([
'gtkimmulticontext.c',
'gtkinfobar.c',
'gtklabel.c',
- 'gtklayout.c',
'gtklayoutchild.c',
'gtklayoutmanager.c',
'gtklevelbar.c',
@@ -516,7 +515,6 @@ gtk_public_headers = files([
'gtkimmulticontext.h',
'gtkinfobar.h',
'gtklabel.h',
- 'gtklayout.h',
'gtklayoutchild.h',
'gtklayoutmanager.h',
'gtklevelbar.h',
diff --git a/tests/testgtk.c b/tests/testgtk.c
index a8d82b8e45..309a260aa6 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -5997,86 +5997,6 @@ create_mainloop (GtkWidget *widget)
gtk_widget_destroy (window);
}
-void create_layout (GtkWidget *widget)
-{
- GtkAdjustment *hadjustment, *vadjustment;
- GtkLayout *layout;
- static GtkWidget *window = NULL;
- GtkWidget *layout_widget;
- GtkWidget *scrolledwindow;
- GtkWidget *button;
-
- if (!window)
- {
- gchar buf[16];
-
- gint i, j;
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_display (GTK_WINDOW (window),
- gtk_widget_get_display (widget));
-
- g_signal_connect (window, "destroy",
- G_CALLBACK (gtk_widget_destroyed),
- &window);
-
- gtk_window_set_title (GTK_WINDOW (window), "Layout");
- gtk_widget_set_size_request (window, 200, 200);
-
- scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow),
- GTK_SHADOW_IN);
- gtk_scrolled_window_set_placement (GTK_SCROLLED_WINDOW (scrolledwindow),
- GTK_CORNER_TOP_RIGHT);
-
- gtk_container_add (GTK_CONTAINER (window), scrolledwindow);
-
- layout_widget = gtk_layout_new (NULL, NULL);
- layout = GTK_LAYOUT (layout_widget);
- gtk_container_add (GTK_CONTAINER (scrolledwindow), layout_widget);
-
- /* We set step sizes here since GtkLayout does not set
- * them itself.
- */
- hadjustment = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (layout));
- vadjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (layout));
- gtk_adjustment_set_step_increment (hadjustment, 10.0);
- gtk_adjustment_set_step_increment (vadjustment, 10.0);
- gtk_scrollable_set_hadjustment (GTK_SCROLLABLE (layout), hadjustment);
- gtk_scrollable_set_vadjustment (GTK_SCROLLABLE (layout), vadjustment);
-
- gtk_layout_set_size (layout, 1600, 128000);
-
- for (i=0 ; i < 16 ; i++)
- for (j=0 ; j < 16 ; j++)
- {
- sprintf(buf, "Button %d, %d", i, j);
- if ((i + j) % 2)
- button = gtk_button_new_with_label (buf);
- else
- button = gtk_label_new (buf);
-
- gtk_layout_put (layout, button, j*100, i*100);
- }
-
- for (i=16; i < 1280; i++)
- {
- sprintf(buf, "Button %d, %d", i, 0);
- if (i % 2)
- button = gtk_button_new_with_label (buf);
- else
- button = gtk_label_new (buf);
-
- gtk_layout_put (layout, button, 0, i*100);
- }
- }
-
- if (!gtk_widget_get_visible (window))
- gtk_widget_show (window);
- else
- gtk_widget_destroy (window);
-}
-
static void
show_native (GtkWidget *button,
GtkFileChooserNative *native)
@@ -6486,7 +6406,6 @@ struct {
{ "image", create_image },
{ "key lookup", create_key_lookup },
{ "labels", create_labels },
- { "layout", create_layout },
{ "listbox", create_listbox },
{ "menus", create_menus },
{ "message dialog", create_message_dialog },
diff --git a/testsuite/gtk/defaultvalue.c b/testsuite/gtk/defaultvalue.c
index 6404cda1ae..ae7849f1c7 100644
--- a/testsuite/gtk/defaultvalue.c
+++ b/testsuite/gtk/defaultvalue.c
@@ -273,11 +273,6 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
G_GNUC_END_IGNORE_DEPRECATIONS
- if (g_type_is_a (type, GTK_TYPE_LAYOUT) &&
- (strcmp (pspec->name, "hadjustment") == 0 ||
- strcmp (pspec->name, "vadjustment") == 0))
- continue;
-
if (g_type_is_a (type, GTK_TYPE_MESSAGE_DIALOG) &&
(strcmp (pspec->name, "image") == 0 ||
strcmp (pspec->name, "message-area") == 0))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]