[gtk/wip/matthiasc/popup5: 116/120] Drop gtk_widget_set_surface
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup5: 116/120] Drop gtk_widget_set_surface
- Date: Sun, 19 May 2019 20:28:44 +0000 (UTC)
commit b680514d4552b9cfeb55f5312398d0d8d549c9ae
Author: Matthias Clasen <mclasen redhat com>
Date: Fri May 17 21:34:20 2019 +0000
Drop gtk_widget_set_surface
Not used anymore. Only GtkNative's have surfaces.
docs/reference/gtk/gtk4-sections.txt | 1 -
gtk/gtkpopover.c | 1 -
gtk/gtkwidget.c | 106 -----------------------------------
gtk/gtkwidget.h | 3 -
gtk/gtkwindow.c | 2 -
5 files changed, 113 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index b65afd99fd..a1b98bcf54 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4525,7 +4525,6 @@ gtk_widget_has_visible_focus
gtk_widget_has_grab
gtk_widget_is_drawable
gtk_widget_is_toplevel
-gtk_widget_set_surface
gtk_widget_set_receives_default
gtk_widget_get_receives_default
gtk_widget_set_support_multidevice
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index ada55380a0..07835b0c4b 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -570,7 +570,6 @@ gtk_popover_realize (GtkWidget *widget)
priv->surface = gdk_surface_new_popup (display, gtk_widget_get_surface (priv->relative_to));
- gtk_widget_set_surface (widget, priv->surface);
gdk_surface_set_widget (priv->surface, widget);
g_signal_connect_swapped (priv->surface, "notify::state", G_CALLBACK (surface_state_changed), widget);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8561b9cbd0..87e63f622a 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8199,7 +8199,6 @@ gtk_widget_real_realize (GtkWidget *widget)
if (GTK_IS_NATIVE (widget))
{
- g_assert (priv->surface != NULL);
priv->surface = gtk_native_get_surface (GTK_NATIVE (widget));
g_object_ref (priv->surface);
}
@@ -11202,111 +11201,6 @@ gtk_widget_get_allocated_baseline (GtkWidget *widget)
return priv->baseline - margin.top - border.top - padding.top;
}
-/**
- * gtk_widget_set_surface:
- * @widget: a #GtkWidget
- * @surface: (transfer full): a #GdkSurface
- *
- * Sets a widget’s surface. This function should only be used in a
- * widget’s #GtkWidget::realize implementation. The %surface passed is
- * usually either new surface created with gdk_surface_new(), or the
- * surface of its parent widget as returned by
- * gtk_widget_get_parent_surface().
- *
- * Widgets must indicate whether they will create their own #GdkSurface
- * by calling gtk_widget_set_has_surface(). This is usually done in the
- * widget’s init() function.
- *
- * Note that this function does not add any reference to @surface.
- */
-void
-gtk_widget_set_surface (GtkWidget *widget,
- GdkSurface *surface)
-{
- GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (surface == NULL || GDK_IS_SURFACE (surface));
-
- if (priv->surface != surface)
- {
- priv->surface = surface;
- }
-}
-
-static void gtk_widget_render (GtkWidget *, GdkSurface *, const cairo_region_t *);
-
-static gboolean
-surface_expose (GdkSurface *surface,
- cairo_region_t *region,
- GtkWidget *widget)
-{
- gtk_widget_render (widget, surface, region);
-
- return TRUE;
-}
-
-static gboolean
-surface_event (GdkSurface *surface,
- GdkEvent *event,
- GtkWidget *widget)
-{
- gtk_main_do_event (event);
-
- return TRUE;
-}
-
-/**
- * gtk_widget_register_surface:
- * @widget: a #GtkWidget
- * @surface: a #GdkSurface
- *
- * Registers a #GdkSurface with the widget and sets it up so that
- * the widget receives events for it. Call gtk_widget_unregister_surface()
- * when destroying the surface.
- *
- * Before 3.8 you needed to call gdk_surface_set_user_data() directly to set
- * this up. This is now deprecated and you should use gtk_widget_register_surface()
- * instead. Old code will keep working as is, although some new features like
- * transparency might not work perfectly.
- */
-void
-gtk_widget_register_surface (GtkWidget *widget,
- GdkSurface *surface)
-{
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (GDK_IS_SURFACE (surface));
-
- g_assert (gdk_surface_get_widget (surface) == NULL);
- gdk_surface_set_widget (surface, widget);
-
- g_signal_connect (surface, "render", G_CALLBACK (surface_expose), widget);
- g_signal_connect (surface, "event", G_CALLBACK (surface_event), widget);
-}
-
-/**
- * gtk_widget_unregister_surface:
- * @widget: a #GtkWidget
- * @surface: a #GdkSurface
- *
- * Unregisters a #GdkSurface from the widget that was previously set up with
- * gtk_widget_register_surface(). You need to call this when the surface is
- * no longer used by the widget, such as when you destroy it.
- */
-void
-gtk_widget_unregister_surface (GtkWidget *widget,
- GdkSurface *surface)
-{
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (GDK_IS_SURFACE (surface));
-
- g_assert (gdk_surface_get_widget (surface) == widget);
- gdk_surface_set_widget (surface, NULL);
-
- g_signal_handlers_disconnect_by_func (surface, surface_expose, widget);
- g_signal_handlers_disconnect_by_func (surface, surface_event, widget);
-}
-
/**
* gtk_widget_get_surface:
* @widget: a #GtkWidget
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 678b3361d3..6738079a08 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -552,9 +552,6 @@ void gtk_widget_set_child_visible (GtkWidget *widget,
GDK_AVAILABLE_IN_ALL
gboolean gtk_widget_get_child_visible (GtkWidget *widget);
-GDK_AVAILABLE_IN_ALL
-void gtk_widget_set_surface (GtkWidget *widget,
- GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
GdkSurface * gtk_widget_get_surface (GtkWidget *widget);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 8ee1e4bbbb..4662448a88 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5698,8 +5698,6 @@ gtk_window_realize (GtkWidget *widget)
}
priv->surface = surface;
-
- gtk_widget_set_surface (widget, surface);
gdk_surface_set_widget (surface, widget);
g_signal_connect_swapped (surface, "notify::state", G_CALLBACK (surface_state_changed), widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]