selection: Add another surface api

Of course, we need a getter too.
This commit is contained in:
Matthias Clasen 2017-10-23 05:22:28 +02:00
parent a4f7d0c0e0
commit 27e89c69cd
2 changed files with 15 additions and 0 deletions

View File

@ -1750,6 +1750,19 @@ gtk_selection_data_set_surface (GtkSelectionData *selection_data,
return retval;
}
cairo_surface_t *
gtk_selection_data_get_surface (GtkSelectionData *selection_data)
{
GdkPixbuf *pixbuf;
cairo_surface_t *surface;
pixbuf = gtk_selection_data_get_pixbuf (selection_data);
surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, 1, NULL);
g_object_unref (pixbuf);
return surface;
}
/**
* gtk_selection_data_get_pixbuf:
* @selection_data: a #GtkSelectionData

View File

@ -225,6 +225,8 @@ GDK_AVAILABLE_IN_ALL
gboolean gtk_selection_data_set_pixbuf (GtkSelectionData *selection_data,
GdkPixbuf *pixbuf);
GDK_AVAILABLE_IN_3_94
cairo_surface_t *gtk_selection_data_get_surface (GtkSelectionData *selection_data);
GDK_AVAILABLE_IN_3_94
gboolean gtk_selection_data_set_surface (GtkSelectionData *selection_data,
cairo_surface_t *surface);
GDK_AVAILABLE_IN_ALL