diff options
author | Benjamin Otte <otte@redhat.com> | 2018-03-15 02:53:17 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2018-03-16 06:04:45 +0100 |
commit | a8608618a909e50309a400c9c857aadd2e1afa6d (patch) | |
tree | a8cfbb2131bc5c2263d2094fb5039bd6a5a1ac21 /gtk/gtkdragsource.c | |
parent | 1f4839d4c87358e0f258a2881e114c414b4153df (diff) | |
download | gtk+-a8608618a909e50309a400c9c857aadd2e1afa6d.tar.gz |
dragsource: Replace gtk_drag_source_set_icon_surface()
... with gtk_drag_source_set_icon_paintable().
Diffstat (limited to 'gtk/gtkdragsource.c')
-rw-r--r-- | gtk/gtkdragsource.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/gtk/gtkdragsource.c b/gtk/gtkdragsource.c index a50b6826b4..b74c12ee03 100644 --- a/gtk/gtkdragsource.c +++ b/gtk/gtkdragsource.c @@ -315,30 +315,6 @@ gtk_drag_source_add_uri_targets (GtkWidget *widget) } /** - * gtk_drag_source_set_icon_surface: (method) - * @widget: a #GtkWidget - * @surface: the cairo surface for the drag icon - * - * Sets the icon that will be used for drags from a particular widget - * from a cairo surface. GTK+ retains a reference for @surface and will - * release it when it is no longer needed. - */ -void -gtk_drag_source_set_icon_surface (GtkWidget *widget, - cairo_surface_t *surface) -{ - GtkDragSourceSite *site; - - g_return_if_fail (GTK_IS_WIDGET (widget)); - - site = g_object_get_data (G_OBJECT (widget), "gtk-site-data"); - g_return_if_fail (site != NULL); - - g_clear_pointer (&site->image_def, gtk_image_definition_unref); - site->image_def = gtk_image_definition_new_surface (surface); -} - -/** * gtk_drag_source_set_icon_name: (method) * @widget: a #GtkWidget * @icon_name: name of icon to use @@ -386,3 +362,27 @@ gtk_drag_source_set_icon_gicon (GtkWidget *widget, site->image_def = gtk_image_definition_new_gicon (icon); } +/** + * gtk_drag_source_set_icon_paintable: (method) + * @widget: a #GtkWidget + * @paintable: A #GdkPaintable + * + * Sets the icon that will be used for drags from a particular source + * to @paintable. + */ +void +gtk_drag_source_set_icon_paintable (GtkWidget *widget, + GdkPaintable *paintable) +{ + GtkDragSourceSite *site; + + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (GDK_IS_PAINTABLE (paintable)); + + site = g_object_get_data (G_OBJECT (widget), "gtk-site-data"); + g_return_if_fail (site != NULL); + + gtk_image_definition_unref (site->image_def); + site->image_def = gtk_image_definition_new_paintable (paintable); +} + |