Drop gtk_widget_register_surface

This is no longer used.
This commit is contained in:
Matthias Clasen
2019-04-19 16:18:57 -04:00
parent fa25b06a28
commit bab5836e89
4 changed files with 1 additions and 82 deletions

View File

@@ -4496,8 +4496,6 @@ gtk_widget_get_has_tooltip
gtk_widget_set_has_tooltip
gtk_widget_trigger_tooltip_query
gtk_widget_get_surface
gtk_widget_register_surface
gtk_widget_unregister_surface
gtk_widget_get_allocated_width
gtk_widget_get_allocated_height
gtk_widget_get_allocation

View File

@@ -104,8 +104,7 @@
a #GdkSurface, which in turn represents a windowing system surface in the
backend. If a widget has grabbed the current input device, or all input
devices, the event is propagated to that #GtkWidget. Otherwise, it is
propagated to the the #GtkWidget which called gtk_widget_register_surface()
on the #GdkSurface receiving the event.
propagated to the the #GtkRoot which owns the #GdkSurface receiving the event.
</para>
<para>

View File

@@ -8338,7 +8338,6 @@ gtk_widget_real_unrealize (GtkWidget *widget)
if (_gtk_widget_get_has_surface (widget))
{
gtk_widget_unregister_surface (widget, priv->surface);
gdk_surface_destroy (priv->surface);
priv->surface = NULL;
}
@@ -11340,77 +11339,6 @@ gtk_widget_set_surface (GtkWidget *widget,
}
}
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

View File

@@ -563,12 +563,6 @@ void gtk_widget_set_surface (GtkWidget *widget,
GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
GdkSurface * gtk_widget_get_surface (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
void gtk_widget_register_surface (GtkWidget *widget,
GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gtk_widget_unregister_surface (GtkWidget *widget,
GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
int gtk_widget_get_allocated_width (GtkWidget *widget);