textbuffer: Add a content provider api

We need a content provider for the selection,
to implement DND, and the text buffer already
has one. Just add an api to get it.
This commit is contained in:
Matthias Clasen 2019-12-31 09:23:25 -05:00
parent e9203eeef7
commit a52757874e
2 changed files with 11 additions and 0 deletions

View File

@ -4078,6 +4078,13 @@ cut_or_copy (GtkTextBuffer *buffer,
}
}
GdkContentProvider *
gtk_text_buffer_get_selection_content (GtkTextBuffer *buffer)
{
return gtk_text_buffer_content_new (buffer);
}
/**
* gtk_text_buffer_cut_clipboard:
* @buffer: a #GtkTextBuffer

View File

@ -453,6 +453,10 @@ gboolean gtk_text_buffer_delete_selection (GtkTextBuffer *buffer,
gboolean interactive,
gboolean default_editable);
GDK_AVAILABLE_IN_ALL
GdkContentProvider *
gtk_text_buffer_get_selection_content (GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL
gboolean gtk_text_buffer_get_can_undo (GtkTextBuffer *buffer);
GDK_AVAILABLE_IN_ALL