Document new selection apis

Document the new cairo surface-based apis for GtkSelection.
This commit is contained in:
Matthias Clasen 2017-10-23 05:46:58 +02:00
parent 50006c229f
commit 65408a0b0c
2 changed files with 30 additions and 0 deletions

View File

@ -5247,6 +5247,8 @@ gtk_selection_data_set_text
gtk_selection_data_get_text
gtk_selection_data_set_pixbuf
gtk_selection_data_get_pixbuf
gtk_selection_data_set_surface
gtk_selection_data_get_surface
gtk_selection_data_set_uris
gtk_selection_data_get_uris
gtk_selection_data_get_targets

View File

@ -1733,6 +1733,20 @@ gtk_selection_data_set_pixbuf (GtkSelectionData *selection_data,
return FALSE;
}
/**
* gtk_selection_data_set_surface:
* @selection_data: a #GtkSelectionData
* @surface: a cairo image surface
*
* Sets the contents of the selection from a cairo image surface.
* The surface is converted to the form determined by
* @selection_data->target.
*
* Returns: %TRUE if the selection was successfully set,
* otherwise %FALSE.
*
* Since: 3.94
**/
gboolean
gtk_selection_data_set_surface (GtkSelectionData *selection_data,
cairo_surface_t *surface)
@ -1750,6 +1764,20 @@ gtk_selection_data_set_surface (GtkSelectionData *selection_data,
return retval;
}
/**
* gtk_selection_data_get_surface:
* @selection_data: a #GtkSelectionData
*
* Gets the contents of the selection data as a cairo surface.
*
* Returns: (nullable) (transfer full): if the selection data
* contained a recognized image type and it could be converted to a
* cairo surface, a newly allocated surface is returned, otherwise
* %NULL. If the result is non-%NULL it must be freed with
* g_object_unref().
*
* Since: 3.94
**/
cairo_surface_t *
gtk_selection_data_get_surface (GtkSelectionData *selection_data)
{